aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2005-02-28 03:48:13 +0000
committerDaniel Berlin <dberlin@dberlin.org>2005-02-28 03:48:13 +0000
commitff5f58a960ef5ebef296b78380ac21ec73eb60d3 (patch)
tree6b416e8523c502a82d386c98de1a39da6527b040
parentf9f5c9e8498b005d223e54abc259d8edc19f22f3 (diff)
Merge from the pain trainstructure-aliasing-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/structure-aliasing-branch@95649 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog26
-rw-r--r--MAINTAINERS8
-rw-r--r--boehm-gc/ChangeLog27
-rw-r--r--boehm-gc/allchblk.c10
-rwxr-xr-xboehm-gc/configure8
-rw-r--r--boehm-gc/configure.ac4
-rw-r--r--boehm-gc/configure.host9
-rw-r--r--boehm-gc/dyn_load.c15
-rw-r--r--boehm-gc/include/gc_config.h.in3
-rw-r--r--boehm-gc/include/private/gc_priv.h4
-rw-r--r--boehm-gc/mach_dep.c123
-rw-r--r--boehm-gc/mark_rts.c5
-rw-r--r--boehm-gc/pthread_stop_world.c24
-rwxr-xr-xconfigure196
-rw-r--r--configure.in6
-rw-r--r--fixincludes/ChangeLog4
-rw-r--r--fixincludes/Makefile.in6
-rw-r--r--gcc/ChangeLog1735
-rw-r--r--gcc/ChangeLog.54
-rw-r--r--gcc/ChangeLog.72
-rw-r--r--gcc/ChangeLog.tree-ssa8
-rw-r--r--gcc/Makefile.in42
-rw-r--r--gcc/ada/ChangeLog786
-rw-r--r--gcc/ada/Make-lang.in3
-rw-r--r--gcc/ada/Makefile.in80
-rw-r--r--gcc/ada/Makefile.rtl81
-rw-r--r--gcc/ada/a-chahan.adb213
-rw-r--r--gcc/ada/a-chahan.ads108
-rw-r--r--gcc/ada/a-except.adb59
-rw-r--r--gcc/ada/a-numeri.ads6
-rw-r--r--gcc/ada/a-strbou.adb37
-rw-r--r--gcc/ada/a-strbou.ads986
-rw-r--r--gcc/ada/a-strfix.adb235
-rw-r--r--gcc/ada/a-strfix.ads263
-rw-r--r--gcc/ada/a-string.ads9
-rw-r--r--gcc/ada/a-strmap.adb2
-rw-r--r--gcc/ada/a-strmap.ads2
-rw-r--r--gcc/ada/a-strsea.adb116
-rw-r--r--gcc/ada/a-strsea.ads28
-rw-r--r--gcc/ada/a-strsup.adb343
-rw-r--r--gcc/ada/a-strsup.ads245
-rw-r--r--gcc/ada/a-strunb.adb306
-rw-r--r--gcc/ada/a-strunb.ads347
-rw-r--r--gcc/ada/a-stunau.ads4
-rw-r--r--gcc/ada/a-stwibo.adb42
-rw-r--r--gcc/ada/a-stwibo.ads1015
-rw-r--r--gcc/ada/a-stwifi.adb238
-rw-r--r--gcc/ada/a-stwifi.ads236
-rw-r--r--gcc/ada/a-stwima.adb59
-rw-r--r--gcc/ada/a-stwima.ads66
-rw-r--r--gcc/ada/a-stwise.adb176
-rw-r--r--gcc/ada/a-stwise.ads97
-rw-r--r--gcc/ada/a-stwisu.adb350
-rw-r--r--gcc/ada/a-stwisu.ads284
-rw-r--r--gcc/ada/a-stwiun.adb182
-rw-r--r--gcc/ada/a-stwiun.ads304
-rw-r--r--gcc/ada/a-suteio.adb45
-rw-r--r--gcc/ada/a-suteio.ads8
-rw-r--r--gcc/ada/a-swuwti.adb66
-rw-r--r--gcc/ada/a-swuwti.ads17
-rw-r--r--gcc/ada/a-tags.adb242
-rw-r--r--gcc/ada/a-tags.ads41
-rw-r--r--gcc/ada/a-textio.adb171
-rw-r--r--gcc/ada/a-textio.ads110
-rw-r--r--gcc/ada/a-witeio.adb213
-rw-r--r--gcc/ada/a-witeio.ads115
-rw-r--r--gcc/ada/a-wtcoau.adb10
-rw-r--r--gcc/ada/a-wtcoau.ads4
-rw-r--r--gcc/ada/a-wtcoio.adb42
-rw-r--r--gcc/ada/a-wtcoio.ads32
-rw-r--r--gcc/ada/a-wtedit.adb108
-rw-r--r--gcc/ada/a-wtedit.ads76
-rw-r--r--gcc/ada/a-wttest.adb4
-rw-r--r--gcc/ada/a-wttest.ads2
-rw-r--r--gcc/ada/ada-tree.h8
-rw-r--r--gcc/ada/adaint.c73
-rw-r--r--gcc/ada/adaint.h3
-rw-r--r--gcc/ada/ali-util.adb8
-rw-r--r--gcc/ada/ali.adb13
-rw-r--r--gcc/ada/ali.ads8
-rw-r--r--gcc/ada/atree.adb29
-rw-r--r--gcc/ada/atree.ads37
-rw-r--r--gcc/ada/atree.h92
-rw-r--r--gcc/ada/binde.adb10
-rw-r--r--gcc/ada/bindgen.adb92
-rw-r--r--gcc/ada/bindusg.adb7
-rw-r--r--gcc/ada/checks.adb38
-rw-r--r--gcc/ada/clean.adb12
-rw-r--r--gcc/ada/csets.adb5
-rw-r--r--gcc/ada/cstand.adb174
-rw-r--r--gcc/ada/debug.adb4
-rw-r--r--gcc/ada/decl.c59
-rw-r--r--gcc/ada/einfo.adb159
-rw-r--r--gcc/ada/einfo.ads46
-rw-r--r--gcc/ada/errout.adb6
-rw-r--r--gcc/ada/exp_aggr.adb290
-rw-r--r--gcc/ada/exp_attr.adb129
-rw-r--r--gcc/ada/exp_ch11.adb6
-rw-r--r--gcc/ada/exp_ch3.adb277
-rw-r--r--gcc/ada/exp_ch3.ads13
-rw-r--r--gcc/ada/exp_ch4.adb77
-rw-r--r--gcc/ada/exp_ch6.adb4
-rw-r--r--gcc/ada/exp_dbug.adb5
-rw-r--r--gcc/ada/exp_disp.adb146
-rw-r--r--gcc/ada/exp_disp.ads4
-rw-r--r--gcc/ada/exp_dist.adb194
-rw-r--r--gcc/ada/exp_imgv.adb173
-rw-r--r--gcc/ada/exp_imgv.ads12
-rw-r--r--gcc/ada/exp_prag.adb11
-rw-r--r--gcc/ada/exp_strm.adb92
-rw-r--r--gcc/ada/exp_util.adb13
-rw-r--r--gcc/ada/exp_util.ads10
-rw-r--r--gcc/ada/g-dirope.adb22
-rw-r--r--gcc/ada/g-expect-vms.adb95
-rw-r--r--gcc/ada/g-expect.adb22
-rw-r--r--gcc/ada/g-os_lib.adb27
-rw-r--r--gcc/ada/g-os_lib.ads443
-rw-r--r--gcc/ada/g-socket.ads393
-rw-r--r--gcc/ada/gnat1drv.adb158
-rw-r--r--gcc/ada/gnat_rm.texi416
-rw-r--r--gcc/ada/gnat_ugn.texi1479
-rw-r--r--gcc/ada/gnatbind.adb24
-rw-r--r--gcc/ada/gnatbl.c15
-rw-r--r--gcc/ada/gnatchop.adb32
-rw-r--r--gcc/ada/gnatfind.adb8
-rw-r--r--gcc/ada/gnatlbr.adb4
-rw-r--r--gcc/ada/gnatlink.adb28
-rw-r--r--gcc/ada/gnatls.adb24
-rw-r--r--gcc/ada/gnatmem.adb10
-rw-r--r--gcc/ada/gnatname.adb5
-rw-r--r--gcc/ada/i-c.adb445
-rw-r--r--gcc/ada/i-c.ads162
-rw-r--r--gcc/ada/i-cobol.adb83
-rw-r--r--gcc/ada/i-cpp.adb159
-rw-r--r--gcc/ada/i-cpp.ads40
-rw-r--r--gcc/ada/impunit.adb186
-rw-r--r--gcc/ada/impunit.ads35
-rw-r--r--gcc/ada/init.c189
-rw-r--r--gcc/ada/krunch.adb33
-rw-r--r--gcc/ada/krunch.ads9
-rw-r--r--gcc/ada/lib-xref.adb10
-rw-r--r--gcc/ada/make.adb94
-rw-r--r--gcc/ada/misc.c6
-rw-r--r--gcc/ada/mlib-prj.adb22
-rw-r--r--gcc/ada/mlib-tgt-vms-ia64.adb6
-rw-r--r--gcc/ada/mlib.adb14
-rw-r--r--gcc/ada/namet.adb79
-rw-r--r--gcc/ada/namet.ads71
-rw-r--r--gcc/ada/opt.ads7
-rw-r--r--gcc/ada/par-ch12.adb50
-rw-r--r--gcc/ada/par-ch2.adb33
-rw-r--r--gcc/ada/par-ch3.adb17
-rw-r--r--gcc/ada/par-prag.adb10
-rw-r--r--gcc/ada/prj-makr.adb84
-rw-r--r--gcc/ada/raise.h5
-rw-r--r--gcc/ada/rtsfind.adb54
-rw-r--r--gcc/ada/rtsfind.ads84
-rw-r--r--gcc/ada/s-asthan-vms.adb597
-rw-r--r--gcc/ada/s-atacco.adb12
-rw-r--r--gcc/ada/s-atacco.ads10
-rw-r--r--gcc/ada/s-crtl.ads20
-rw-r--r--gcc/ada/s-finimp.adb56
-rw-r--r--gcc/ada/s-imgwch.adb40
-rw-r--r--gcc/ada/s-imgwch.ads20
-rw-r--r--gcc/ada/s-osinte-vxworks.ads8
-rw-r--r--gcc/ada/s-scaval.adb24
-rw-r--r--gcc/ada/s-scaval.ads31
-rw-r--r--gcc/ada/s-soflin.ads5
-rw-r--r--gcc/ada/s-strops.adb24
-rw-r--r--gcc/ada/s-strops.ads10
-rw-r--r--gcc/ada/s-taprop-mingw.adb8
-rw-r--r--gcc/ada/s-taprop.ads8
-rw-r--r--gcc/ada/s-tassta.adb14
-rw-r--r--gcc/ada/s-tpopde-vms.adb7
-rw-r--r--gcc/ada/s-tporft.adb5
-rw-r--r--gcc/ada/s-vaflop.adb4
-rw-r--r--gcc/ada/s-valwch.adb47
-rw-r--r--gcc/ada/s-valwch.ads14
-rw-r--r--gcc/ada/s-wchcnv.adb330
-rw-r--r--gcc/ada/s-wchcnv.ads37
-rw-r--r--gcc/ada/s-wchcon.ads52
-rw-r--r--gcc/ada/s-wchstw.adb269
-rw-r--r--gcc/ada/s-wchstw.ads16
-rw-r--r--gcc/ada/s-wchwts.adb179
-rw-r--r--gcc/ada/s-wchwts.ads19
-rw-r--r--gcc/ada/s-widwch.adb66
-rw-r--r--gcc/ada/s-widwch.ads12
-rw-r--r--gcc/ada/s-wwdcha.adb24
-rw-r--r--gcc/ada/s-wwdcha.ads10
-rw-r--r--gcc/ada/s-wwdenu.adb146
-rw-r--r--gcc/ada/s-wwdenu.ads34
-rw-r--r--gcc/ada/s-wwdwch.adb147
-rw-r--r--gcc/ada/s-wwdwch.ads25
-rw-r--r--gcc/ada/scans.ads5
-rw-r--r--gcc/ada/scn.adb5
-rw-r--r--gcc/ada/scng.adb850
-rw-r--r--gcc/ada/seh_init.c4
-rw-r--r--gcc/ada/sem_aggr.adb75
-rw-r--r--gcc/ada/sem_attr.adb137
-rw-r--r--gcc/ada/sem_case.adb9
-rw-r--r--gcc/ada/sem_ch10.adb24
-rw-r--r--gcc/ada/sem_ch12.adb91
-rw-r--r--gcc/ada/sem_ch13.adb48
-rw-r--r--gcc/ada/sem_ch2.adb3
-rw-r--r--gcc/ada/sem_ch3.adb24
-rw-r--r--gcc/ada/sem_ch4.adb29
-rw-r--r--gcc/ada/sem_ch5.adb8
-rw-r--r--gcc/ada/sem_ch6.adb656
-rw-r--r--gcc/ada/sem_ch7.adb7
-rw-r--r--gcc/ada/sem_ch8.adb72
-rw-r--r--gcc/ada/sem_disp.adb123
-rw-r--r--gcc/ada/sem_elab.adb141
-rw-r--r--gcc/ada/sem_eval.adb63
-rw-r--r--gcc/ada/sem_eval.ads3
-rw-r--r--gcc/ada/sem_prag.adb112
-rw-r--r--gcc/ada/sem_res.adb183
-rw-r--r--gcc/ada/sem_util.adb39
-rw-r--r--gcc/ada/sinfo.adb43
-rw-r--r--gcc/ada/sinfo.ads70
-rw-r--r--gcc/ada/sinput.adb54
-rw-r--r--gcc/ada/sinput.ads65
-rw-r--r--gcc/ada/snames.adb2091
-rw-r--r--gcc/ada/snames.ads2981
-rw-r--r--gcc/ada/snames.h213
-rw-r--r--gcc/ada/sprint.adb45
-rw-r--r--gcc/ada/stand.ads10
-rw-r--r--gcc/ada/stringt.adb28
-rw-r--r--gcc/ada/stringt.ads6
-rw-r--r--gcc/ada/switch-b.adb8
-rw-r--r--gcc/ada/trans.c22
-rw-r--r--gcc/ada/treepr.adb15
-rw-r--r--gcc/ada/ttypes.ads9
-rw-r--r--gcc/ada/types.adb21
-rw-r--r--gcc/ada/types.ads48
-rw-r--r--gcc/ada/types.h58
-rw-r--r--gcc/ada/uintp.adb44
-rw-r--r--gcc/ada/uintp.ads17
-rw-r--r--gcc/ada/uintp.h10
-rw-r--r--gcc/ada/usage.adb10
-rw-r--r--gcc/ada/utils.c155
-rw-r--r--gcc/ada/utils2.c18
-rw-r--r--gcc/ada/vms_conv.adb8
-rw-r--r--gcc/ada/vms_data.ads40
-rw-r--r--gcc/ada/widechar.adb1654
-rw-r--r--gcc/ada/widechar.ads94
-rw-r--r--gcc/ada/xr_tabls.ads4
-rw-r--r--gcc/ada/xsinfo.adb10
-rw-r--r--gcc/ada/xsnames.adb4
-rw-r--r--gcc/basic-block.h2
-rw-r--r--gcc/bb-reorder.c32
-rw-r--r--gcc/bitmap.c12
-rw-r--r--gcc/bitmap.h10
-rw-r--r--gcc/bt-load.c14
-rw-r--r--gcc/builtins.c355
-rw-r--r--gcc/builtins.def44
-rw-r--r--gcc/c-common.c59
-rw-r--r--gcc/c-common.h2
-rw-r--r--gcc/c-config-lang.in4
-rw-r--r--gcc/c-decl.c9
-rw-r--r--gcc/c-objc-common.h4
-rw-r--r--gcc/c-opts.c5
-rw-r--r--gcc/c-parse.in3588
-rw-r--r--gcc/c-pretty-print.c67
-rw-r--r--gcc/c-tree.h8
-rw-r--r--gcc/c-typeck.c94
-rw-r--r--gcc/cfg.c61
-rw-r--r--gcc/cfganal.c14
-rw-r--r--gcc/cfgbuild.c6
-rw-r--r--gcc/cfgcleanup.c8
-rw-r--r--gcc/cfgexpand.c2
-rw-r--r--gcc/cfgloop.c17
-rw-r--r--gcc/cfgrtl.c11
-rw-r--r--gcc/cgraphunit.c12
-rw-r--r--gcc/combine.c2
-rw-r--r--gcc/common.opt8
-rw-r--r--gcc/config.gcc5
-rw-r--r--gcc/config/alpha/linux-unwind.h10
-rw-r--r--gcc/config/arm/arm-protos.h1
-rw-r--r--gcc/config/arm/arm.c92
-rw-r--r--gcc/config/arm/arm.h4
-rw-r--r--gcc/config/arm/arm.md159
-rw-r--r--gcc/config/arm/fpa.md37
-rw-r--r--gcc/config/arm/lib1funcs.asm17
-rw-r--r--gcc/config/arm/rtems-elf.h8
-rw-r--r--gcc/config/avr/avr.c602
-rw-r--r--gcc/config/avr/avr.h4
-rw-r--r--gcc/config/cris/cris-protos.h6
-rw-r--r--gcc/config/cris/cris.c302
-rw-r--r--gcc/config/cris/cris.h9
-rw-r--r--gcc/config/cris/cris.md14
-rw-r--r--gcc/config/darwin.c4
-rw-r--r--gcc/config/darwin7.h2
-rw-r--r--gcc/config/elfos.h10
-rw-r--r--gcc/config/frv/frv.c7
-rw-r--r--gcc/config/frv/frv.md37
-rw-r--r--gcc/config/host-linux.c68
-rw-r--r--gcc/config/i386/i386.md65
-rw-r--r--gcc/config/i386/linux-unwind.h10
-rw-r--r--gcc/config/i386/t-nwld23
-rw-r--r--gcc/config/ia64/hpux.h21
-rw-r--r--gcc/config/ia64/ia64.c148
-rw-r--r--gcc/config/ia64/ia64.h9
-rw-r--r--gcc/config/ia64/lib1funcs.asm10
-rw-r--r--gcc/config/ia64/linux-unwind.h10
-rw-r--r--gcc/config/ia64/t-hpux17
-rw-r--r--gcc/config/ia64/t-ia643
-rw-r--r--gcc/config/ip2k/ip2k.c22
-rw-r--r--gcc/config/iq2000/iq2000.h9
-rw-r--r--gcc/config/m68k/m68k.c10
-rw-r--r--gcc/config/m68k/t-rtems1
-rw-r--r--gcc/config/mips/iris6.h4
-rw-r--r--gcc/config/mips/irix-csr.c17
-rw-r--r--gcc/config/mips/linux-unwind.h17
-rw-r--r--gcc/config/mips/mips.c58
-rw-r--r--gcc/config/mips/mips.md8
-rw-r--r--gcc/config/mips/t-iris66
-rw-r--r--gcc/config/mips/t-slibgcc-irix22
-rw-r--r--gcc/config/mn10300/linux.h14
-rw-r--r--gcc/config/pa/linux-unwind.h27
-rw-r--r--gcc/config/pa/pa.c176
-rw-r--r--gcc/config/pa/som.h4
-rw-r--r--gcc/config/pa/t-hpux-shlib24
-rw-r--r--gcc/config/rs6000/aix.h20
-rw-r--r--gcc/config/rs6000/altivec.md2
-rw-r--r--gcc/config/rs6000/beos.h15
-rw-r--r--gcc/config/rs6000/darwin-ldouble.c51
-rw-r--r--gcc/config/rs6000/darwin-tramp.asm4
-rw-r--r--gcc/config/rs6000/libgcc-ppc64.ver10
-rw-r--r--gcc/config/rs6000/linux-unwind.h10
-rw-r--r--gcc/config/rs6000/rs6000.c58
-rw-r--r--gcc/config/rs6000/rs6000.h2
-rw-r--r--gcc/config/rs6000/rs6000.md107
-rw-r--r--gcc/config/rs6000/sysv4.h7
-rw-r--r--gcc/config/rs6000/t-aix4322
-rw-r--r--gcc/config/rs6000/t-aix5222
-rw-r--r--gcc/config/rs6000/t-newas3
-rw-r--r--gcc/config/rs6000/t-rtems92
-rw-r--r--gcc/config/s390/linux-unwind.h10
-rw-r--r--gcc/config/s390/s390.c8
-rw-r--r--gcc/config/s390/s390.h20
-rw-r--r--gcc/config/s390/s390.md54
-rw-r--r--gcc/config/sh/linux-unwind.h10
-rw-r--r--gcc/config/sh/sh.c2
-rw-r--r--gcc/config/sh/t-linux18
-rw-r--r--gcc/config/sparc/linux-unwind.h10
-rw-r--r--gcc/config/sparc/t-elf4
-rw-r--r--gcc/config/t-libunwind-elf19
-rw-r--r--gcc/config/t-slibgcc-darwin19
-rw-r--r--gcc/config/t-slibgcc-elf-ver20
-rw-r--r--gcc/config/t-slibgcc-sld19
-rwxr-xr-xgcc/configure320
-rw-r--r--gcc/configure.ac5
-rw-r--r--gcc/conflict.c2
-rw-r--r--gcc/convert.c2
-rw-r--r--gcc/cp/ChangeLog497
-rw-r--r--gcc/cp/call.c144
-rw-r--r--gcc/cp/class.c324
-rw-r--r--gcc/cp/cp-objcp-common.h4
-rw-r--r--gcc/cp/cp-tree.def15
-rw-r--r--gcc/cp/cp-tree.h33
-rw-r--r--gcc/cp/cvt.c5
-rw-r--r--gcc/cp/cxx-pretty-print.c2
-rw-r--r--gcc/cp/cxx-pretty-print.h2
-rw-r--r--gcc/cp/decl.c168
-rw-r--r--gcc/cp/decl.h2
-rw-r--r--gcc/cp/decl2.c42
-rw-r--r--gcc/cp/error.c14
-rw-r--r--gcc/cp/except.c101
-rw-r--r--gcc/cp/init.c55
-rw-r--r--gcc/cp/mangle.c2
-rw-r--r--gcc/cp/method.c53
-rw-r--r--gcc/cp/name-lookup.c2
-rw-r--r--gcc/cp/parser.c132
-rw-r--r--gcc/cp/pt.c137
-rw-r--r--gcc/cp/ptree.c4
-rw-r--r--gcc/cp/rtti.c2
-rw-r--r--gcc/cp/search.c12
-rw-r--r--gcc/cp/semantics.c17
-rw-r--r--gcc/cp/tree.c6
-rw-r--r--gcc/cp/typeck.c49
-rw-r--r--gcc/cse.c55
-rw-r--r--gcc/cselib.c5
-rw-r--r--gcc/dbxout.c19
-rw-r--r--gcc/defaults.h15
-rw-r--r--gcc/df.c76
-rw-r--r--gcc/df.h18
-rw-r--r--gcc/diagnostic.c2
-rw-r--r--gcc/doc/cpp.texi19
-rw-r--r--gcc/doc/cppinternals.texi19
-rw-r--r--gcc/doc/extend.texi32
-rw-r--r--gcc/doc/gcc.texi7
-rw-r--r--gcc/doc/gccint.texi7
-rw-r--r--gcc/doc/include/gcc-common.texi2
-rw-r--r--gcc/doc/install.texi18
-rw-r--r--gcc/doc/invoke.texi98
-rw-r--r--gcc/doc/md.texi6
-rw-r--r--gcc/doc/tm.texi89
-rw-r--r--gcc/dominance.c6
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/emit-rtl.c7
-rw-r--r--gcc/except.c3
-rw-r--r--gcc/expmed.c40
-rw-r--r--gcc/flags.h6
-rw-r--r--gcc/flow.c189
-rw-r--r--gcc/fold-const.c532
-rw-r--r--gcc/fortran/ChangeLog215
-rw-r--r--gcc/fortran/arith.c12
-rw-r--r--gcc/fortran/array.c2
-rw-r--r--gcc/fortran/check.c40
-rw-r--r--gcc/fortran/decl.c75
-rw-r--r--gcc/fortran/dependency.c6
-rw-r--r--gcc/fortran/dump-parse-tree.c10
-rw-r--r--gcc/fortran/expr.c111
-rw-r--r--gcc/fortran/f95-lang.c62
-rw-r--r--gcc/fortran/gfortran.h70
-rw-r--r--gcc/fortran/gfortran.texi7
-rw-r--r--gcc/fortran/interface.c22
-rw-r--r--gcc/fortran/intrinsic.c36
-rw-r--r--gcc/fortran/intrinsic.h9
-rw-r--r--gcc/fortran/iresolve.c12
-rw-r--r--gcc/fortran/match.c26
-rw-r--r--gcc/fortran/matchexp.c10
-rw-r--r--gcc/fortran/module.c94
-rw-r--r--gcc/fortran/parse.c19
-rw-r--r--gcc/fortran/primary.c20
-rw-r--r--gcc/fortran/resolve.c68
-rw-r--r--gcc/fortran/simplify.c6
-rw-r--r--gcc/fortran/st.c2
-rw-r--r--gcc/fortran/symbol.c262
-rw-r--r--gcc/fortran/trans-array.c16
-rw-r--r--gcc/fortran/trans-common.c2
-rw-r--r--gcc/fortran/trans-decl.c12
-rw-r--r--gcc/fortran/trans-expr.c40
-rw-r--r--gcc/fortran/trans-io.c5
-rw-r--r--gcc/fortran/trans-stmt.c12
-rw-r--r--gcc/fortran/trans.h2
-rw-r--r--gcc/function.h8
-rw-r--r--gcc/gcc.c41
-rw-r--r--gcc/gcse.c121
-rw-r--r--gcc/genautomata.c14
-rw-r--r--gcc/gengtype-lex.l4
-rw-r--r--gcc/gengtype.c4
-rw-r--r--gcc/genopinit.c1
-rw-r--r--gcc/genpreds.c9
-rw-r--r--gcc/ggc-page.c3
-rw-r--r--gcc/gimple-low.c19
-rw-r--r--gcc/gimplify.c31
-rw-r--r--gcc/global.c34
-rw-r--r--gcc/haifa-sched.c8
-rw-r--r--gcc/java/ChangeLog72
-rw-r--r--gcc/java/builtins.c4
-rw-r--r--gcc/java/decl.c30
-rw-r--r--gcc/java/expr.c29
-rw-r--r--gcc/java/gcj.texi42
-rw-r--r--gcc/java/java-except.h3
-rw-r--r--gcc/java/jcf-parse.c2
-rw-r--r--gcc/java/jcf-write.c1
-rw-r--r--gcc/java/jv-scan.c28
-rw-r--r--gcc/java/lex.c12
-rw-r--r--gcc/java/parse-scan.y13
-rw-r--r--gcc/java/verify-glue.c17
-rw-r--r--gcc/java/verify-impl.c99
-rw-r--r--gcc/java/verify.h4
-rw-r--r--gcc/lambda-code.c40
-rw-r--r--gcc/langhooks-def.h3
-rw-r--r--gcc/langhooks.c8
-rw-r--r--gcc/langhooks.h11
-rw-r--r--gcc/libada-mk.in2
-rw-r--r--gcc/libgcc-std.ver19
-rw-r--r--gcc/libgcc2.c470
-rw-r--r--gcc/libgcc2.h69
-rw-r--r--gcc/loop-invariant.c28
-rw-r--r--gcc/mklibgcc.in233
-rw-r--r--gcc/objc/ChangeLog8
-rw-r--r--gcc/objc/Make-lang.in29
-rw-r--r--gcc/objc/config-lang.in4
-rw-r--r--gcc/optabs.c5
-rw-r--r--gcc/optabs.h8
-rw-r--r--gcc/opts.c5
-rw-r--r--gcc/passes.c27
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/gcc.pot7802
-rw-r--r--gcc/predict.c10
-rw-r--r--gcc/print-tree.c15
-rw-r--r--gcc/read-rtl.c5
-rw-r--r--gcc/reload.c17
-rw-r--r--gcc/rtl.c2
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/simplify-rtx.c18
-rw-r--r--gcc/stmt.c24
-rw-r--r--gcc/stub-objc.c46
-rw-r--r--gcc/system.h6
-rw-r--r--gcc/testsuite/ChangeLog522
-rw-r--r--gcc/testsuite/ada/acats/tests/cxa/cxa3004.a235
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb30061.am404
-rw-r--r--gcc/testsuite/ada/acats/tests/cxb/cxb30131.c3
-rw-r--r--gcc/testsuite/g++.dg/charset/asm1.c2
-rw-r--r--gcc/testsuite/g++.dg/charset/asm2.c2
-rw-r--r--gcc/testsuite/g++.dg/charset/asm3.c2
-rw-r--r--gcc/testsuite/g++.dg/charset/asm4.c2
-rw-r--r--gcc/testsuite/g++.dg/charset/asm5.c2
-rw-r--r--gcc/testsuite/g++.dg/charset/attribute1.c2
-rw-r--r--gcc/testsuite/g++.dg/charset/attribute2.c2
-rw-r--r--gcc/testsuite/g++.dg/charset/charset.exp2
-rw-r--r--gcc/testsuite/g++.dg/charset/extern1.cc2
-rw-r--r--gcc/testsuite/g++.dg/charset/extern2.cc2
-rw-r--r--gcc/testsuite/g++.dg/charset/extern3.cc2
-rw-r--r--gcc/testsuite/g++.dg/charset/function.cc2
-rw-r--r--gcc/testsuite/g++.dg/charset/string.c2
-rw-r--r--gcc/testsuite/g++.dg/dg.exp1
-rw-r--r--gcc/testsuite/g++.dg/lookup/anon2.C7
-rw-r--r--gcc/testsuite/g++.dg/other/anon3.C2
-rw-r--r--gcc/testsuite/g++.dg/rtti/tinfo1.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash2.C2
-rw-r--r--gcc/testsuite/g++.dg/template/qualttp15.C4
-rw-r--r--gcc/testsuite/g++.dg/template/qualttp20.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p10769a.C46
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/template6.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/struct1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ptrmem5.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20020720-1.x2
-rw-r--r--gcc/testsuite/gcc.dg/asm-b.c6
-rw-r--r--gcc/testsuite/gcc.dg/builtins-10.c7
-rw-r--r--gcc/testsuite/gcc.dg/builtins-34.c17
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm1.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm2.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm3.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm4.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm5.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/asm6.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/attribute1.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/attribute2.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/charset.exp2
-rw-r--r--gcc/testsuite/gcc.dg/charset/extern.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/function.c2
-rw-r--r--gcc/testsuite/gcc.dg/charset/string.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/separate-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/971104-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/990416-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/sibcall-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-power-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/uninit-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect.exp3
-rw-r--r--gcc/testsuite/gcc.misc-tests/linkage.exp5
-rw-r--r--gcc/testsuite/gfortran.dg/do_iterator.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr17708.f904
-rw-r--r--gcc/testsuite/gfortran.dg/select_4.f9012
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp282
-rw-r--r--gcc/testsuite/lib/gfortran-dg.exp48
-rw-r--r--gcc/testsuite/lib/target-supports.exp86
-rw-r--r--gcc/testsuite/treelang/ChangeLog25
-rw-r--r--gcc/testsuite/treelang/compile/var_defs.tree6
-rw-r--r--gcc/toplev.c15
-rw-r--r--gcc/tree-cfg.c46
-rw-r--r--gcc/tree-complex.c53
-rw-r--r--gcc/tree-data-ref.c26
-rw-r--r--gcc/tree-dfa.c9
-rw-r--r--gcc/tree-dump.c129
-rw-r--r--gcc/tree-dump.h5
-rw-r--r--gcc/tree-eh.c9
-rw-r--r--gcc/tree-flow.h1
-rw-r--r--gcc/tree-if-conv.c8
-rw-r--r--gcc/tree-into-ssa.c1471
-rw-r--r--gcc/tree-loop-linear.c1
-rw-r--r--gcc/tree-optimize.c15
-rw-r--r--gcc/tree-outof-ssa.c126
-rw-r--r--gcc/tree-pass.h2
-rw-r--r--gcc/tree-scalar-evolution.c4
-rw-r--r--gcc/tree-sra.c22
-rw-r--r--gcc/tree-ssa-alias.c189
-rw-r--r--gcc/tree-ssa-ccp.c32
-rw-r--r--gcc/tree-ssa-dce.c4
-rw-r--r--gcc/tree-ssa-dom.c79
-rw-r--r--gcc/tree-ssa-dse.c4
-rw-r--r--gcc/tree-ssa-forwprop.c6
-rw-r--r--gcc/tree-ssa-live.c22
-rw-r--r--gcc/tree-ssa-live.h4
-rw-r--r--gcc/tree-ssa-loop-im.c44
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c25
-rw-r--r--gcc/tree-ssa-loop-ivopts.c524
-rw-r--r--gcc/tree-ssa-loop-manip.c21
-rw-r--r--gcc/tree-ssa-loop-niter.c115
-rw-r--r--gcc/tree-ssa-operands.c12
-rw-r--r--gcc/tree-ssa-pre.c65
-rw-r--r--gcc/tree-ssa-structalias.c18
-rw-r--r--gcc/tree-ssa.c20
-rw-r--r--gcc/tree-ssanames.c8
-rw-r--r--gcc/tree-vectorizer.c4438
-rw-r--r--gcc/tree-vectorizer.h91
-rw-r--r--gcc/tree-vn.c14
-rw-r--r--gcc/tree.c209
-rw-r--r--gcc/tree.h30
-rw-r--r--gcc/treelang/ChangeLog91
-rw-r--r--gcc/treelang/Make-lang.in1
-rw-r--r--gcc/treelang/lang-specs.h1
-rw-r--r--gcc/treelang/parse.y54
-rw-r--r--gcc/treelang/treelang.texi270
-rw-r--r--gcc/treelang/treetree.c146
-rw-r--r--gcc/treelang/treetree.h10
-rw-r--r--gcc/value-prof.c26
-rw-r--r--gcc/version.c2
-rw-r--r--include/ChangeLog5
-rw-r--r--include/ansidecl.h5
-rw-r--r--libcpp/ChangeLog51
-rw-r--r--libcpp/charset.c71
-rw-r--r--libcpp/config.in8
-rwxr-xr-xlibcpp/configure140
-rw-r--r--libcpp/configure.ac2
-rw-r--r--libcpp/directives.c2
-rw-r--r--libcpp/files.c99
-rw-r--r--libcpp/include/cpplib.h9
-rw-r--r--libcpp/init.c2
-rw-r--r--libcpp/internal.h11
-rw-r--r--libcpp/macro.c28
-rw-r--r--libcpp/pch.c5
-rw-r--r--libcpp/po/ChangeLog4
-rw-r--r--libcpp/po/cpplib.pot210
-rw-r--r--libcpp/traditional.c2
-rw-r--r--libffi/ChangeLog21
-rw-r--r--libffi/src/frv/ffitarget.h32
-rw-r--r--libffi/src/powerpc/ffi.c10
-rw-r--r--libffi/testsuite/libffi.call/cls_align_longdouble.c1
-rw-r--r--libffi/testsuite/libffi.call/float.c1
-rw-r--r--libffi/testsuite/libffi.call/float2.c1
-rw-r--r--libffi/testsuite/libffi.call/float3.c1
-rw-r--r--libgfortran/ChangeLog31
-rw-r--r--libgfortran/intrinsics/args.c8
-rw-r--r--libgfortran/intrinsics/c99_functions.c2
-rw-r--r--libgfortran/intrinsics/date_and_time.c192
-rw-r--r--libgfortran/io/list_read.c6
-rw-r--r--libgfortran/io/transfer.c2
-rw-r--r--libgfortran/io/write.c2
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/cp-demangle.c15
-rw-r--r--libjava/ChangeLog3990
-rw-r--r--libjava/Makefile.am192
-rw-r--r--libjava/Makefile.in1275
-rw-r--r--libjava/NEWS208
-rwxr-xr-xlibjava/configure775
-rw-r--r--libjava/configure.ac24
-rw-r--r--libjava/defineclass.cc14
-rw-r--r--libjava/external/sax/Makefile.am6
-rw-r--r--libjava/external/sax/Makefile.in41
-rw-r--r--libjava/external/w3c_dom/Makefile.am6
-rw-r--r--libjava/external/w3c_dom/Makefile.in41
-rw-r--r--libjava/gcj/cni.h6
-rw-r--r--libjava/gcj/javaprims.h25
-rw-r--r--libjava/gcj/method.h2
-rw-r--r--libjava/gij.cc2
-rw-r--r--libjava/gnu/awt/xlib/XEventLoop.java36
-rw-r--r--libjava/gnu/awt/xlib/XFramePeer.java2
-rw-r--r--libjava/gnu/awt/xlib/XToolkit.java26
-rw-r--r--libjava/gnu/gcj/convert/Convert.java4
-rw-r--r--libjava/gnu/gcj/runtime/NameFinder.java75
-rw-r--r--libjava/gnu/gcj/runtime/PersistentByteMap.java187
-rw-r--r--libjava/gnu/gcj/runtime/SharedLibHelper.java26
-rw-r--r--libjava/gnu/gcj/runtime/SharedLibLoader.java2
-rw-r--r--libjava/gnu/gcj/tools/gcj_dbtool/Main.java177
-rw-r--r--libjava/gnu/gcj/xlib/XAnyEvent.java4
-rw-r--r--libjava/gnu/gcj/xlib/natXAnyEvent.cc60
-rw-r--r--libjava/gnu/java/awt/ClasspathToolkit.java26
-rw-r--r--libjava/gnu/java/awt/EmbeddedWindow.java1
-rw-r--r--libjava/gnu/java/awt/color/ClutProfileConverter.java1
-rw-r--r--libjava/gnu/java/awt/image/ImageDecoder.java42
-rw-r--r--libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java7
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java15
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java48
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java243
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics.java41
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java1626
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java28
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java524
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java15
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkArg.java61
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkArgList.java75
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java1
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java18
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkClipboard.java8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java22
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java4
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java13
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java11
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java8
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMainThread.java111
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java4
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java10
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java9
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java10
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkToolkit.java97
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java64
-rw-r--r--libjava/gnu/java/beans/EmptyBeanInfo.java70
-rw-r--r--libjava/gnu/java/beans/IntrospectionIncubator.java3
-rw-r--r--libjava/gnu/java/beans/info/ComponentBeanInfo.java75
-rw-r--r--libjava/gnu/java/io/Base64InputStream.java28
-rw-r--r--libjava/gnu/java/lang/MainThread.java4
-rw-r--r--libjava/gnu/java/locale/LocaleInformation_en.java2
-rw-r--r--libjava/gnu/java/net/PlainSocketImpl.java14
-rw-r--r--libjava/gnu/java/net/protocol/http/Cookie.java1
-rw-r--r--libjava/gnu/java/net/protocol/http/HTTPConnection.java2
-rw-r--r--libjava/gnu/java/net/protocol/http/HTTPDateFormat.java12
-rw-r--r--libjava/gnu/java/net/protocol/http/Request.java1
-rw-r--r--libjava/gnu/java/net/protocol/jar/Connection.java7
-rw-r--r--libjava/gnu/java/nio/PipeImpl.java7
-rw-r--r--libjava/gnu/java/nio/SelectorImpl.java24
-rw-r--r--libjava/gnu/java/nio/channels/FileChannelImpl.java3
-rw-r--r--libjava/gnu/java/nio/charset/ISO_8859_1.java25
-rw-r--r--libjava/gnu/java/nio/charset/Provider.java47
-rw-r--r--libjava/gnu/java/nio/charset/US_ASCII.java26
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16.java11
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16BE.java15
-rw-r--r--libjava/gnu/java/nio/charset/UTF_16LE.java14
-rw-r--r--libjava/gnu/java/nio/charset/UTF_8.java16
-rw-r--r--libjava/gnu/java/rmi/dgc/DGCImpl.java1
-rw-r--r--libjava/gnu/java/rmi/registry/RegistryImpl.java5
-rw-r--r--libjava/gnu/java/rmi/rmic/RMIC.java4
-rw-r--r--libjava/gnu/java/rmi/server/ConnectionRunnerPool.java4
-rw-r--r--libjava/gnu/java/rmi/server/UnicastConnectionManager.java1
-rw-r--r--libjava/gnu/java/security/PolicyFile.java16
-rw-r--r--libjava/gnu/java/security/der/DERReader.java46
-rw-r--r--libjava/gnu/java/security/der/DERWriter.java3
-rw-r--r--libjava/gnu/java/security/provider/EncodedKeyFactory.java14
-rw-r--r--libjava/gnu/java/security/provider/Gnu.java3
-rw-r--r--libjava/gnu/java/security/provider/GnuDHPublicKey.java1
-rw-r--r--libjava/gnu/java/security/provider/GnuDSAPrivateKey.java73
-rw-r--r--libjava/gnu/java/security/provider/GnuDSAPublicKey.java63
-rw-r--r--libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java37
-rw-r--r--libjava/gnu/java/security/x509/X500DistinguishedName.java1
-rw-r--r--libjava/gnu/java/security/x509/X509CRL.java1
-rw-r--r--libjava/gnu/java/security/x509/X509CRLEntry.java1
-rw-r--r--libjava/gnu/java/security/x509/X509Certificate.java5
-rw-r--r--libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java1
-rw-r--r--libjava/gnu/java/security/x509/ext/CertificatePolicies.java1
-rw-r--r--libjava/gnu/java/security/x509/ext/PolicyConstraint.java2
-rw-r--r--libjava/gnu/java/text/FormatCharacterIterator.java6
-rw-r--r--libjava/gnu/regexp/RE.java19
-rw-r--r--libjava/gnu/xml/aelfred2/SAXDriver.java153
-rw-r--r--libjava/gnu/xml/dom/Consumer.java5
-rw-r--r--libjava/gnu/xml/dom/DomAttr.java7
-rw-r--r--libjava/gnu/xml/dom/DomCDATA.java91
-rw-r--r--libjava/gnu/xml/dom/DomCharacterData.java25
-rw-r--r--libjava/gnu/xml/dom/DomDoctype.java5
-rw-r--r--libjava/gnu/xml/dom/DomDocument.java111
-rw-r--r--libjava/gnu/xml/dom/DomDocumentBuilder.java1
-rw-r--r--libjava/gnu/xml/dom/DomDocumentConfiguration.java9
-rw-r--r--libjava/gnu/xml/dom/DomElement.java15
-rw-r--r--libjava/gnu/xml/dom/DomEx.java175
-rw-r--r--libjava/gnu/xml/dom/DomFragment.java76
-rw-r--r--libjava/gnu/xml/dom/DomImpl.java3
-rw-r--r--libjava/gnu/xml/dom/DomIterator.java9
-rw-r--r--libjava/gnu/xml/dom/DomNamedNodeMap.java13
-rw-r--r--libjava/gnu/xml/dom/DomNode.java70
-rw-r--r--libjava/gnu/xml/dom/DomNsNode.java29
-rw-r--r--libjava/gnu/xml/dom/DomPI.java145
-rw-r--r--libjava/gnu/xml/dom/DomText.java4
-rw-r--r--libjava/gnu/xml/dom/DomXPathExpression.java1
-rw-r--r--libjava/gnu/xml/dom/DomXPathResult.java2
-rw-r--r--libjava/gnu/xml/dom/JAXPFactory.java1
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSEx.java75
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSParser.java22
-rw-r--r--libjava/gnu/xml/dom/ls/DomLSSerializer.java8
-rw-r--r--libjava/gnu/xml/pipeline/CallFilter.java17
-rw-r--r--libjava/gnu/xml/pipeline/DomConsumer.java27
-rw-r--r--libjava/gnu/xml/pipeline/LinkFilter.java1
-rw-r--r--libjava/gnu/xml/pipeline/NSFilter.java9
-rw-r--r--libjava/gnu/xml/pipeline/TeeConsumer.java14
-rw-r--r--libjava/gnu/xml/pipeline/ValidationConsumer.java16
-rw-r--r--libjava/gnu/xml/pipeline/WellFormednessFilter.java9
-rw-r--r--libjava/gnu/xml/pipeline/XIncludeFilter.java1
-rw-r--r--libjava/gnu/xml/pipeline/XsltFilter.java1
-rw-r--r--libjava/gnu/xml/transform/ApplyImportsNode.java6
-rw-r--r--libjava/gnu/xml/transform/Bindings.java4
-rw-r--r--libjava/gnu/xml/transform/DocumentFunction.java6
-rw-r--r--libjava/gnu/xml/transform/FormatNumberFunction.java1
-rw-r--r--libjava/gnu/xml/transform/NodeNumberNode.java3
-rw-r--r--libjava/gnu/xml/transform/NumberNode.java1
-rw-r--r--libjava/gnu/xml/transform/Stylesheet.java2
-rw-r--r--libjava/gnu/xml/transform/SystemPropertyFunction.java1
-rw-r--r--libjava/gnu/xml/transform/Template.java2
-rw-r--r--libjava/gnu/xml/transform/TemplatesImpl.java3
-rw-r--r--libjava/gnu/xml/transform/TransformerImpl.java6
-rw-r--r--libjava/gnu/xml/transform/ValueOfNode.java3
-rw-r--r--libjava/gnu/xml/transform/XSLURIResolver.java1
-rw-r--r--libjava/gnu/xml/util/DoParse.java18
-rw-r--r--libjava/gnu/xml/util/Resolver.java10
-rw-r--r--libjava/gnu/xml/util/SAXNullTransformerFactory.java5
-rw-r--r--libjava/gnu/xml/xpath/Expr.java2
-rw-r--r--libjava/gnu/xml/xpath/FunctionCall.java1
-rw-r--r--libjava/gnu/xml/xpath/Predicate.java2
-rw-r--r--libjava/gnu/xml/xpath/RelationalExpr.java1
-rw-r--r--libjava/gnu/xml/xpath/Selector.java2
-rw-r--r--libjava/gnu/xml/xpath/XPathParser.java1
-rw-r--r--libjava/include/Makefile.am2
-rw-r--r--libjava/include/Makefile.in2
-rw-r--r--libjava/include/java-props.h1
-rw-r--r--libjava/include/jvm.h4
-rw-r--r--libjava/java/applet/Applet.java8
-rw-r--r--libjava/java/awt/AWTError.java4
-rw-r--r--libjava/java/awt/AWTEvent.java4
-rw-r--r--libjava/java/awt/AWTEventMulticaster.java4
-rw-r--r--libjava/java/awt/AWTException.java4
-rw-r--r--libjava/java/awt/AWTKeyStroke.java21
-rw-r--r--libjava/java/awt/AWTPermission.java2
-rw-r--r--libjava/java/awt/ActiveEvent.java2
-rw-r--r--libjava/java/awt/Adjustable.java4
-rw-r--r--libjava/java/awt/AlphaComposite.java4
-rw-r--r--libjava/java/awt/AttributeValue.java4
-rw-r--r--libjava/java/awt/BasicStroke.java28
-rw-r--r--libjava/java/awt/BorderLayout.java4
-rw-r--r--libjava/java/awt/BufferCapabilities.java4
-rw-r--r--libjava/java/awt/Button.java21
-rw-r--r--libjava/java/awt/Canvas.java9
-rw-r--r--libjava/java/awt/Checkbox.java182
-rw-r--r--libjava/java/awt/CheckboxGroup.java4
-rw-r--r--libjava/java/awt/CheckboxMenuItem.java42
-rw-r--r--libjava/java/awt/Choice.java86
-rw-r--r--libjava/java/awt/Color.java4
-rw-r--r--libjava/java/awt/ColorPaintContext.java4
-rw-r--r--libjava/java/awt/Component.java81
-rw-r--r--libjava/java/awt/ComponentOrientation.java2
-rw-r--r--libjava/java/awt/Composite.java4
-rw-r--r--libjava/java/awt/CompositeContext.java4
-rw-r--r--libjava/java/awt/Container.java69
-rw-r--r--libjava/java/awt/ContainerOrderFocusTraversalPolicy.java4
-rw-r--r--libjava/java/awt/DefaultFocusTraversalPolicy.java4
-rw-r--r--libjava/java/awt/DefaultKeyboardFocusManager.java2
-rw-r--r--libjava/java/awt/Dialog.java44
-rw-r--r--libjava/java/awt/Dimension.java6
-rw-r--r--libjava/java/awt/DisplayMode.java4
-rw-r--r--libjava/java/awt/EventDispatchThread.java11
-rw-r--r--libjava/java/awt/EventQueue.java100
-rw-r--r--libjava/java/awt/FileDialog.java4
-rw-r--r--libjava/java/awt/Font.java7
-rw-r--r--libjava/java/awt/FontFormatException.java4
-rw-r--r--libjava/java/awt/Frame.java124
-rw-r--r--libjava/java/awt/Graphics.java4
-rw-r--r--libjava/java/awt/Graphics2D.java2
-rw-r--r--libjava/java/awt/GraphicsConfigTemplate.java4
-rw-r--r--libjava/java/awt/GraphicsConfiguration.java2
-rw-r--r--libjava/java/awt/GraphicsDevice.java4
-rw-r--r--libjava/java/awt/GridBagLayout.java6
-rw-r--r--libjava/java/awt/GridBagLayoutInfo.java4
-rw-r--r--libjava/java/awt/GridLayout.java2
-rw-r--r--libjava/java/awt/HeadlessException.java4
-rw-r--r--libjava/java/awt/IllegalComponentStateException.java4
-rw-r--r--libjava/java/awt/Image.java4
-rw-r--r--libjava/java/awt/Insets.java6
-rw-r--r--libjava/java/awt/ItemSelectable.java4
-rw-r--r--libjava/java/awt/JobAttributes.java4
-rw-r--r--libjava/java/awt/KeyEventDispatcher.java4
-rw-r--r--libjava/java/awt/KeyEventPostProcessor.java4
-rw-r--r--libjava/java/awt/KeyboardFocusManager.java6
-rw-r--r--libjava/java/awt/Label.java11
-rw-r--r--libjava/java/awt/LayoutManager.java4
-rw-r--r--libjava/java/awt/List.java184
-rw-r--r--libjava/java/awt/Menu.java12
-rw-r--r--libjava/java/awt/MenuBar.java13
-rw-r--r--libjava/java/awt/MenuComponent.java8
-rw-r--r--libjava/java/awt/MenuContainer.java4
-rw-r--r--libjava/java/awt/MenuItem.java21
-rw-r--r--libjava/java/awt/PageAttributes.java4
-rw-r--r--libjava/java/awt/Paint.java2
-rw-r--r--libjava/java/awt/PaintContext.java2
-rw-r--r--libjava/java/awt/Panel.java4
-rw-r--r--libjava/java/awt/Point.java6
-rw-r--r--libjava/java/awt/Polygon.java6
-rw-r--r--libjava/java/awt/PopupMenu.java11
-rw-r--r--libjava/java/awt/PrintGraphics.java4
-rw-r--r--libjava/java/awt/PrintJob.java4
-rw-r--r--libjava/java/awt/Rectangle.java6
-rw-r--r--libjava/java/awt/RenderingHints.java4
-rw-r--r--libjava/java/awt/Robot.java368
-rw-r--r--libjava/java/awt/ScrollPane.java24
-rw-r--r--libjava/java/awt/Scrollbar.java1296
-rw-r--r--libjava/java/awt/Shape.java4
-rw-r--r--libjava/java/awt/Stroke.java4
-rw-r--r--libjava/java/awt/SystemColor.java6
-rw-r--r--libjava/java/awt/TextArea.java11
-rw-r--r--libjava/java/awt/TextComponent.java16
-rw-r--r--libjava/java/awt/Toolkit.java8
-rw-r--r--libjava/java/awt/Transparency.java2
-rw-r--r--libjava/java/awt/Window.java114
-rw-r--r--libjava/java/awt/color/CMMException.java4
-rw-r--r--libjava/java/awt/color/ColorSpace.java2
-rw-r--r--libjava/java/awt/color/ICC_ColorSpace.java2
-rw-r--r--libjava/java/awt/color/ICC_Profile.java4
-rw-r--r--libjava/java/awt/color/ProfileDataException.java4
-rw-r--r--libjava/java/awt/datatransfer/FlavorTable.java4
-rw-r--r--libjava/java/awt/datatransfer/MimeTypeParseException.java4
-rw-r--r--libjava/java/awt/datatransfer/Transferable.java4
-rw-r--r--libjava/java/awt/datatransfer/UnsupportedFlavorException.java4
-rw-r--r--libjava/java/awt/dnd/Autoscroll.java4
-rw-r--r--libjava/java/awt/dnd/DnDConstants.java11
-rw-r--r--libjava/java/awt/dnd/DragGestureListener.java4
-rw-r--r--libjava/java/awt/dnd/DragSourceAdapter.java4
-rw-r--r--libjava/java/awt/dnd/DragSourceDropEvent.java4
-rw-r--r--libjava/java/awt/dnd/DragSourceListener.java4
-rw-r--r--libjava/java/awt/dnd/DragSourceMotionListener.java4
-rw-r--r--libjava/java/awt/dnd/DropTarget.java9
-rw-r--r--libjava/java/awt/dnd/DropTargetAdapter.java4
-rw-r--r--libjava/java/awt/dnd/DropTargetContext.java2
-rw-r--r--libjava/java/awt/dnd/DropTargetListener.java4
-rw-r--r--libjava/java/awt/dnd/InvalidDnDOperationException.java4
-rw-r--r--libjava/java/awt/dnd/MouseDragGestureRecognizer.java4
-rw-r--r--libjava/java/awt/dnd/peer/DropTargetContextPeer.java4
-rw-r--r--libjava/java/awt/event/AWTEventListener.java4
-rw-r--r--libjava/java/awt/event/AWTEventListenerProxy.java4
-rw-r--r--libjava/java/awt/event/ActionEvent.java4
-rw-r--r--libjava/java/awt/event/AdjustmentEvent.java4
-rw-r--r--libjava/java/awt/event/AdjustmentListener.java4
-rw-r--r--libjava/java/awt/event/ComponentAdapter.java4
-rw-r--r--libjava/java/awt/event/ComponentEvent.java4
-rw-r--r--libjava/java/awt/event/ComponentListener.java4
-rw-r--r--libjava/java/awt/event/ContainerAdapter.java4
-rw-r--r--libjava/java/awt/event/ContainerEvent.java4
-rw-r--r--libjava/java/awt/event/ContainerListener.java4
-rw-r--r--libjava/java/awt/event/FocusAdapter.java4
-rw-r--r--libjava/java/awt/event/FocusEvent.java4
-rw-r--r--libjava/java/awt/event/FocusListener.java4
-rw-r--r--libjava/java/awt/event/InputEvent.java4
-rw-r--r--libjava/java/awt/event/InputMethodEvent.java4
-rw-r--r--libjava/java/awt/event/InputMethodListener.java4
-rw-r--r--libjava/java/awt/event/InvocationEvent.java4
-rw-r--r--libjava/java/awt/event/ItemEvent.java4
-rw-r--r--libjava/java/awt/event/ItemListener.java4
-rw-r--r--libjava/java/awt/event/KeyAdapter.java4
-rw-r--r--libjava/java/awt/event/KeyEvent.java6
-rw-r--r--libjava/java/awt/event/KeyListener.java4
-rw-r--r--libjava/java/awt/event/MouseAdapter.java4
-rw-r--r--libjava/java/awt/event/MouseEvent.java6
-rw-r--r--libjava/java/awt/event/MouseListener.java4
-rw-r--r--libjava/java/awt/event/MouseMotionAdapter.java4
-rw-r--r--libjava/java/awt/event/MouseMotionListener.java4
-rw-r--r--libjava/java/awt/event/MouseWheelEvent.java4
-rw-r--r--libjava/java/awt/event/MouseWheelListener.java4
-rw-r--r--libjava/java/awt/event/PaintEvent.java4
-rw-r--r--libjava/java/awt/event/TextEvent.java4
-rw-r--r--libjava/java/awt/event/TextListener.java4
-rw-r--r--libjava/java/awt/event/WindowAdapter.java4
-rw-r--r--libjava/java/awt/event/WindowEvent.java4
-rw-r--r--libjava/java/awt/event/WindowFocusListener.java4
-rw-r--r--libjava/java/awt/event/WindowListener.java4
-rw-r--r--libjava/java/awt/event/WindowStateListener.java4
-rw-r--r--libjava/java/awt/font/TextAttribute.java300
-rw-r--r--libjava/java/awt/font/TextHitInfo.java4
-rw-r--r--libjava/java/awt/font/TransformAttribute.java37
-rw-r--r--libjava/java/awt/geom/Area.java4
-rw-r--r--libjava/java/awt/geom/CubicCurve2D.java8
-rw-r--r--libjava/java/awt/geom/Dimension2D.java4
-rw-r--r--libjava/java/awt/geom/Ellipse2D.java6
-rw-r--r--libjava/java/awt/geom/IllegalPathStateException.java2
-rw-r--r--libjava/java/awt/geom/Line2D.java8
-rw-r--r--libjava/java/awt/geom/NoninvertibleTransformException.java2
-rw-r--r--libjava/java/awt/geom/PathIterator.java4
-rw-r--r--libjava/java/awt/geom/Point2D.java4
-rw-r--r--libjava/java/awt/geom/QuadCurve2D.java9
-rw-r--r--libjava/java/awt/geom/Rectangle2D.java14
-rw-r--r--libjava/java/awt/geom/RectangularShape.java4
-rw-r--r--libjava/java/awt/geom/RoundRectangle2D.java2
-rw-r--r--libjava/java/awt/im/InputContext.java8
-rw-r--r--libjava/java/awt/im/InputMethodHighlight.java4
-rw-r--r--libjava/java/awt/im/InputMethodRequests.java4
-rw-r--r--libjava/java/awt/im/InputSubset.java4
-rw-r--r--libjava/java/awt/im/spi/InputMethod.java4
-rw-r--r--libjava/java/awt/im/spi/InputMethodDescriptor.java4
-rw-r--r--libjava/java/awt/image/BandCombineOp.java2
-rw-r--r--libjava/java/awt/image/BandedSampleModel.java2
-rw-r--r--libjava/java/awt/image/ByteLookupTable.java4
-rw-r--r--libjava/java/awt/image/ComponentSampleModel.java2
-rw-r--r--libjava/java/awt/image/DataBuffer.java2
-rw-r--r--libjava/java/awt/image/DataBufferByte.java2
-rw-r--r--libjava/java/awt/image/DataBufferDouble.java4
-rw-r--r--libjava/java/awt/image/DataBufferFloat.java4
-rw-r--r--libjava/java/awt/image/DataBufferInt.java2
-rw-r--r--libjava/java/awt/image/DataBufferShort.java2
-rw-r--r--libjava/java/awt/image/DataBufferUShort.java2
-rw-r--r--libjava/java/awt/image/ImagingOpException.java4
-rw-r--r--libjava/java/awt/image/IndexColorModel.java12
-rw-r--r--libjava/java/awt/image/Kernel.java4
-rw-r--r--libjava/java/awt/image/LookupTable.java4
-rw-r--r--libjava/java/awt/image/MemoryImageSource.java656
-rw-r--r--libjava/java/awt/image/MultiPixelPackedSampleModel.java11
-rw-r--r--libjava/java/awt/image/PackedColorModel.java2
-rw-r--r--libjava/java/awt/image/PixelInterleavedSampleModel.java4
-rw-r--r--libjava/java/awt/image/RGBImageFilter.java6
-rw-r--r--libjava/java/awt/image/Raster.java2
-rw-r--r--libjava/java/awt/image/RasterFormatException.java4
-rw-r--r--libjava/java/awt/image/ReplicateScaleFilter.java16
-rw-r--r--libjava/java/awt/image/SampleModel.java2
-rw-r--r--libjava/java/awt/image/ShortLookupTable.java4
-rw-r--r--libjava/java/awt/image/SinglePixelPackedSampleModel.java2
-rw-r--r--libjava/java/awt/image/WritableRaster.java2
-rw-r--r--libjava/java/awt/peer/RobotPeer.java12
-rw-r--r--libjava/java/awt/print/Book.java255
-rw-r--r--libjava/java/awt/print/PrinterAbortException.java4
-rw-r--r--libjava/java/awt/print/PrinterException.java4
-rw-r--r--libjava/java/awt/print/PrinterIOException.java6
-rw-r--r--libjava/java/awt/print/PrinterJob.java18
-rw-r--r--libjava/java/beans/AppletInitializer.java4
-rw-r--r--libjava/java/beans/Beans.java481
-rw-r--r--libjava/java/beans/ExceptionListener.java4
-rw-r--r--libjava/java/beans/PropertyChangeEvent.java4
-rw-r--r--libjava/java/beans/PropertyChangeListenerProxy.java4
-rw-r--r--libjava/java/beans/PropertyChangeSupport.java4
-rw-r--r--libjava/java/beans/PropertyDescriptor.java24
-rw-r--r--libjava/java/beans/VetoableChangeListenerProxy.java4
-rw-r--r--libjava/java/beans/VetoableChangeSupport.java4
-rw-r--r--libjava/java/io/BufferedReader.java6
-rw-r--r--libjava/java/io/ByteArrayInputStream.java4
-rw-r--r--libjava/java/io/ByteArrayOutputStream.java4
-rw-r--r--libjava/java/io/CharArrayReader.java4
-rw-r--r--libjava/java/io/CharArrayWriter.java4
-rw-r--r--libjava/java/io/CharConversionException.java4
-rw-r--r--libjava/java/io/DataInput.java4
-rw-r--r--libjava/java/io/DataInputStream.java4
-rw-r--r--libjava/java/io/DataOutput.java4
-rw-r--r--libjava/java/io/DataOutputStream.java6
-rw-r--r--libjava/java/io/EOFException.java4
-rw-r--r--libjava/java/io/Externalizable.java2
-rw-r--r--libjava/java/io/FileDescriptor.java2
-rw-r--r--libjava/java/io/FileInputStream.java6
-rw-r--r--libjava/java/io/FileNotFoundException.java6
-rw-r--r--libjava/java/io/FileOutputStream.java6
-rw-r--r--libjava/java/io/FilenameFilter.java4
-rw-r--r--libjava/java/io/FilterInputStream.java4
-rw-r--r--libjava/java/io/FilterOutputStream.java4
-rw-r--r--libjava/java/io/FilterReader.java4
-rw-r--r--libjava/java/io/FilterWriter.java4
-rw-r--r--libjava/java/io/IOException.java4
-rw-r--r--libjava/java/io/InputStream.java4
-rw-r--r--libjava/java/io/InputStreamReader.java4
-rw-r--r--libjava/java/io/InterruptedIOException.java6
-rw-r--r--libjava/java/io/LineNumberInputStream.java4
-rw-r--r--libjava/java/io/LineNumberReader.java6
-rw-r--r--libjava/java/io/ObjectInputStream.java169
-rw-r--r--libjava/java/io/ObjectOutputStream.java62
-rw-r--r--libjava/java/io/ObjectStreamClass.java102
-rw-r--r--libjava/java/io/ObjectStreamException.java4
-rw-r--r--libjava/java/io/ObjectStreamField.java81
-rw-r--r--libjava/java/io/OptionalDataException.java4
-rw-r--r--libjava/java/io/OutputStream.java4
-rw-r--r--libjava/java/io/OutputStreamWriter.java4
-rw-r--r--libjava/java/io/PrintStream.java6
-rw-r--r--libjava/java/io/PrintWriter.java4
-rw-r--r--libjava/java/io/PushbackInputStream.java4
-rw-r--r--libjava/java/io/PushbackReader.java4
-rw-r--r--libjava/java/io/RandomAccessFile.java6
-rw-r--r--libjava/java/io/Reader.java2
-rw-r--r--libjava/java/io/SequenceInputStream.java4
-rw-r--r--libjava/java/io/Serializable.java5
-rw-r--r--libjava/java/io/StreamCorruptedException.java4
-rw-r--r--libjava/java/io/StreamTokenizer.java2
-rw-r--r--libjava/java/io/StringBufferInputStream.java4
-rw-r--r--libjava/java/io/StringWriter.java4
-rw-r--r--libjava/java/io/SyncFailedException.java4
-rw-r--r--libjava/java/io/UTFDataFormatException.java4
-rw-r--r--libjava/java/io/UnsupportedEncodingException.java4
-rw-r--r--libjava/java/io/VMObjectStreamClass.java92
-rw-r--r--libjava/java/io/WriteAbortedException.java4
-rw-r--r--libjava/java/io/Writer.java4
-rw-r--r--libjava/java/io/natObjectInputStream.cc44
-rw-r--r--libjava/java/io/natVMObjectStreamClass.cc64
-rw-r--r--libjava/java/lang/AbstractMethodError.java4
-rw-r--r--libjava/java/lang/ArithmeticException.java4
-rw-r--r--libjava/java/lang/ArrayIndexOutOfBoundsException.java4
-rw-r--r--libjava/java/lang/ArrayStoreException.java4
-rw-r--r--libjava/java/lang/AssertionError.java4
-rw-r--r--libjava/java/lang/Boolean.java4
-rw-r--r--libjava/java/lang/Byte.java4
-rw-r--r--libjava/java/lang/Class.h6
-rw-r--r--libjava/java/lang/Class.java4
-rw-r--r--libjava/java/lang/ClassCastException.java4
-rw-r--r--libjava/java/lang/ClassCircularityError.java4
-rw-r--r--libjava/java/lang/ClassLoader.java17
-rw-r--r--libjava/java/lang/ClassNotFoundException.java4
-rw-r--r--libjava/java/lang/CloneNotSupportedException.java6
-rw-r--r--libjava/java/lang/Cloneable.java6
-rw-r--r--libjava/java/lang/Comparable.java4
-rw-r--r--libjava/java/lang/Compiler.java4
-rw-r--r--libjava/java/lang/Double.java6
-rw-r--r--libjava/java/lang/Error.java6
-rw-r--r--libjava/java/lang/Exception.java6
-rw-r--r--libjava/java/lang/ExceptionInInitializerError.java6
-rw-r--r--libjava/java/lang/Float.java6
-rw-r--r--libjava/java/lang/IllegalAccessError.java4
-rw-r--r--libjava/java/lang/IllegalAccessException.java4
-rw-r--r--libjava/java/lang/IllegalArgumentException.java4
-rw-r--r--libjava/java/lang/IllegalMonitorStateException.java4
-rw-r--r--libjava/java/lang/IllegalStateException.java4
-rw-r--r--libjava/java/lang/IllegalThreadStateException.java4
-rw-r--r--libjava/java/lang/IncompatibleClassChangeError.java4
-rw-r--r--libjava/java/lang/IndexOutOfBoundsException.java4
-rw-r--r--libjava/java/lang/InheritableThreadLocal.java6
-rw-r--r--libjava/java/lang/InstantiationError.java4
-rw-r--r--libjava/java/lang/InstantiationException.java4
-rw-r--r--libjava/java/lang/Integer.java4
-rw-r--r--libjava/java/lang/InternalError.java4
-rw-r--r--libjava/java/lang/InterruptedException.java4
-rw-r--r--libjava/java/lang/LinkageError.java4
-rw-r--r--libjava/java/lang/Long.java4
-rw-r--r--libjava/java/lang/NegativeArraySizeException.java4
-rw-r--r--libjava/java/lang/NoClassDefFoundError.java4
-rw-r--r--libjava/java/lang/NoSuchFieldError.java4
-rw-r--r--libjava/java/lang/NoSuchFieldException.java4
-rw-r--r--libjava/java/lang/NoSuchMethodError.java4
-rw-r--r--libjava/java/lang/NoSuchMethodException.java4
-rw-r--r--libjava/java/lang/NullPointerException.java4
-rw-r--r--libjava/java/lang/Number.java4
-rw-r--r--libjava/java/lang/NumberFormatException.java4
-rw-r--r--libjava/java/lang/Object.h5
-rw-r--r--libjava/java/lang/OutOfMemoryError.java4
-rw-r--r--libjava/java/lang/Process.java4
-rw-r--r--libjava/java/lang/Runnable.java4
-rw-r--r--libjava/java/lang/Runtime.java4
-rw-r--r--libjava/java/lang/RuntimeException.java6
-rw-r--r--libjava/java/lang/RuntimePermission.java4
-rw-r--r--libjava/java/lang/SecurityException.java4
-rw-r--r--libjava/java/lang/SecurityManager.java4
-rw-r--r--libjava/java/lang/Short.java4
-rw-r--r--libjava/java/lang/StackOverflowError.java4
-rw-r--r--libjava/java/lang/StackTraceElement.java6
-rw-r--r--libjava/java/lang/StringBuffer.java4
-rw-r--r--libjava/java/lang/StringIndexOutOfBoundsException.java4
-rw-r--r--libjava/java/lang/ThreadDeath.java4
-rw-r--r--libjava/java/lang/ThreadGroup.java4
-rw-r--r--libjava/java/lang/Throwable.java4
-rw-r--r--libjava/java/lang/UnsatisfiedLinkError.java4
-rw-r--r--libjava/java/lang/UnsupportedOperationException.java4
-rw-r--r--libjava/java/lang/VMCompiler.java3
-rw-r--r--libjava/java/lang/VerifyError.java4
-rw-r--r--libjava/java/lang/VirtualMachineError.java4
-rw-r--r--libjava/java/lang/natClass.cc8
-rw-r--r--libjava/java/lang/natClassLoader.cc10
-rw-r--r--libjava/java/lang/natRuntime.cc22
-rw-r--r--libjava/java/lang/natVMClassLoader.cc9
-rw-r--r--libjava/java/lang/reflect/AccessibleObject.java6
-rw-r--r--libjava/java/lang/reflect/Array.java6
-rw-r--r--libjava/java/lang/reflect/Field.java58
-rw-r--r--libjava/java/lang/reflect/InvocationTargetException.java6
-rw-r--r--libjava/java/lang/reflect/Member.java6
-rw-r--r--libjava/java/lang/reflect/Modifier.java6
-rw-r--r--libjava/java/lang/reflect/Proxy.java12
-rw-r--r--libjava/java/lang/reflect/ReflectPermission.java6
-rw-r--r--libjava/java/lang/reflect/UndeclaredThrowableException.java4
-rw-r--r--libjava/java/lang/reflect/natField.cc94
-rw-r--r--libjava/java/lang/reflect/natMethod.cc4
-rw-r--r--libjava/java/math/BigInteger.java6
-rw-r--r--libjava/java/net/NetworkInterface.java4
-rw-r--r--libjava/java/net/URI.java8
-rw-r--r--libjava/java/net/URL.java6
-rw-r--r--libjava/java/net/URLClassLoader.java160
-rw-r--r--libjava/java/nio/ByteBufferHelper.java4
-rw-r--r--libjava/java/nio/ByteBufferImpl.java11
-rw-r--r--libjava/java/nio/CharBufferImpl.java3
-rw-r--r--libjava/java/nio/CharViewBufferImpl.java5
-rw-r--r--libjava/java/nio/DirectByteBufferImpl.java36
-rw-r--r--libjava/java/nio/DoubleBufferImpl.java7
-rw-r--r--libjava/java/nio/DoubleViewBufferImpl.java5
-rw-r--r--libjava/java/nio/FloatBufferImpl.java7
-rw-r--r--libjava/java/nio/FloatViewBufferImpl.java5
-rw-r--r--libjava/java/nio/IntBufferImpl.java7
-rw-r--r--libjava/java/nio/IntViewBufferImpl.java5
-rw-r--r--libjava/java/nio/LongBufferImpl.java7
-rw-r--r--libjava/java/nio/LongViewBufferImpl.java5
-rw-r--r--libjava/java/nio/MappedByteBufferImpl.java7
-rw-r--r--libjava/java/nio/ShortBufferImpl.java7
-rw-r--r--libjava/java/nio/ShortViewBufferImpl.java5
-rw-r--r--libjava/java/nio/channels/Channel.java4
-rw-r--r--libjava/java/nio/channels/Channels.java12
-rw-r--r--libjava/java/nio/channels/IllegalBlockingModeException.java4
-rw-r--r--libjava/java/nio/charset/Charset.java31
-rw-r--r--libjava/java/nio/charset/spi/CharsetProvider.java2
-rw-r--r--libjava/java/rmi/server/RemoteObject.java34
-rw-r--r--libjava/java/rmi/server/RemoteRef.java2
-rw-r--r--libjava/java/rmi/server/ServerRef.java2
-rw-r--r--libjava/java/rmi/server/UID.java2
-rw-r--r--libjava/java/rmi/server/UnicastRemoteObject.java11
-rw-r--r--libjava/java/security/AccessControlException.java4
-rw-r--r--libjava/java/security/AlgorithmParameterGenerator.java2
-rw-r--r--libjava/java/security/AlgorithmParameters.java2
-rw-r--r--libjava/java/security/AllPermission.java114
-rw-r--r--libjava/java/security/BasicPermission.java203
-rw-r--r--libjava/java/security/DigestException.java4
-rw-r--r--libjava/java/security/DigestInputStream.java4
-rw-r--r--libjava/java/security/DigestOutputStream.java4
-rw-r--r--libjava/java/security/GeneralSecurityException.java4
-rw-r--r--libjava/java/security/Guard.java4
-rw-r--r--libjava/java/security/GuardedObject.java4
-rw-r--r--libjava/java/security/InvalidAlgorithmParameterException.java4
-rw-r--r--libjava/java/security/InvalidKeyException.java2
-rw-r--r--libjava/java/security/InvalidParameterException.java2
-rw-r--r--libjava/java/security/Key.java4
-rw-r--r--libjava/java/security/KeyException.java4
-rw-r--r--libjava/java/security/KeyFactory.java2
-rw-r--r--libjava/java/security/KeyManagementException.java4
-rw-r--r--libjava/java/security/KeyStore.java2
-rw-r--r--libjava/java/security/KeyStoreException.java4
-rw-r--r--libjava/java/security/MessageDigestSpi.java4
-rw-r--r--libjava/java/security/NoSuchAlgorithmException.java4
-rw-r--r--libjava/java/security/NoSuchProviderException.java4
-rw-r--r--libjava/java/security/Permission.java4
-rw-r--r--libjava/java/security/PermissionCollection.java6
-rw-r--r--libjava/java/security/Permissions.java113
-rw-r--r--libjava/java/security/Principal.java4
-rw-r--r--libjava/java/security/PrivateKey.java4
-rw-r--r--libjava/java/security/PrivilegedActionException.java6
-rw-r--r--libjava/java/security/ProviderException.java4
-rw-r--r--libjava/java/security/PublicKey.java4
-rw-r--r--libjava/java/security/SecureClassLoader.java26
-rw-r--r--libjava/java/security/SecureRandom.java10
-rw-r--r--libjava/java/security/SecureRandomSpi.java4
-rw-r--r--libjava/java/security/SignatureException.java4
-rw-r--r--libjava/java/security/SignatureSpi.java2
-rw-r--r--libjava/java/security/SignedObject.java2
-rw-r--r--libjava/java/security/Signer.java2
-rw-r--r--libjava/java/security/UnrecoverableKeyException.java4
-rw-r--r--libjava/java/security/UnresolvedPermission.java4
-rw-r--r--libjava/java/security/acl/AclNotFoundException.java4
-rw-r--r--libjava/java/security/acl/LastOwnerException.java4
-rw-r--r--libjava/java/security/acl/NotOwnerException.java4
-rw-r--r--libjava/java/security/cert/CertPath.java6
-rw-r--r--libjava/java/security/cert/CertPathBuilderException.java4
-rw-r--r--libjava/java/security/cert/CertPathValidatorException.java4
-rw-r--r--libjava/java/security/cert/CertStoreException.java4
-rw-r--r--libjava/java/security/cert/CertificateFactory.java2
-rw-r--r--libjava/java/security/interfaces/DSAPrivateKey.java5
-rw-r--r--libjava/java/security/interfaces/DSAPublicKey.java5
-rw-r--r--libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java1
-rw-r--r--libjava/java/security/interfaces/RSAPrivateCrtKey.java2
-rw-r--r--libjava/java/security/interfaces/RSAPrivateKey.java2
-rw-r--r--libjava/java/security/interfaces/RSAPublicKey.java2
-rw-r--r--libjava/java/text/BreakIterator.java4
-rw-r--r--libjava/java/text/ChoiceFormat.java4
-rw-r--r--libjava/java/text/CollationElementIterator.java11
-rw-r--r--libjava/java/text/CollationKey.java6
-rw-r--r--libjava/java/text/Collator.java4
-rw-r--r--libjava/java/text/DateFormat.java224
-rw-r--r--libjava/java/text/DateFormatSymbols.java4
-rw-r--r--libjava/java/text/DecimalFormat.java3
-rw-r--r--libjava/java/text/DecimalFormatSymbols.java2
-rw-r--r--libjava/java/text/FieldPosition.java4
-rw-r--r--libjava/java/text/Format.java4
-rw-r--r--libjava/java/text/MessageFormat.java194
-rw-r--r--libjava/java/text/NumberFormat.java2
-rw-r--r--libjava/java/text/ParseException.java4
-rw-r--r--libjava/java/text/ParsePosition.java4
-rw-r--r--libjava/java/text/RuleBasedCollator.java101
-rw-r--r--libjava/java/text/SimpleDateFormat.java894
-rw-r--r--libjava/java/text/StringCharacterIterator.java4
-rw-r--r--libjava/java/util/AbstractCollection.java4
-rw-r--r--libjava/java/util/AbstractList.java925
-rw-r--r--libjava/java/util/AbstractMap.java6
-rw-r--r--libjava/java/util/AbstractSequentialList.java4
-rw-r--r--libjava/java/util/AbstractSet.java4
-rw-r--r--libjava/java/util/ArrayList.java4
-rw-r--r--libjava/java/util/Arrays.java8
-rw-r--r--libjava/java/util/BitSet.java6
-rw-r--r--libjava/java/util/Calendar.java277
-rw-r--r--libjava/java/util/Collection.java4
-rw-r--r--libjava/java/util/Collections.java58
-rw-r--r--libjava/java/util/Comparator.java6
-rw-r--r--libjava/java/util/ConcurrentModificationException.java6
-rw-r--r--libjava/java/util/Currency.java10
-rw-r--r--libjava/java/util/Date.java3
-rw-r--r--libjava/java/util/EmptyStackException.java6
-rw-r--r--libjava/java/util/Enumeration.java6
-rw-r--r--libjava/java/util/EventListener.java4
-rw-r--r--libjava/java/util/EventListenerProxy.java4
-rw-r--r--libjava/java/util/EventObject.java4
-rw-r--r--libjava/java/util/GregorianCalendar.java811
-rw-r--r--libjava/java/util/HashMap.java6
-rw-r--r--libjava/java/util/HashSet.java4
-rw-r--r--libjava/java/util/Hashtable.java4
-rw-r--r--libjava/java/util/IdentityHashMap.java12
-rw-r--r--libjava/java/util/Iterator.java4
-rw-r--r--libjava/java/util/LinkedHashMap.java2
-rw-r--r--libjava/java/util/LinkedHashSet.java4
-rw-r--r--libjava/java/util/LinkedList.java6
-rw-r--r--libjava/java/util/List.java4
-rw-r--r--libjava/java/util/ListIterator.java4
-rw-r--r--libjava/java/util/ListResourceBundle.java4
-rw-r--r--libjava/java/util/Map.java6
-rw-r--r--libjava/java/util/MissingResourceException.java4
-rw-r--r--libjava/java/util/NoSuchElementException.java6
-rw-r--r--libjava/java/util/Observable.java6
-rw-r--r--libjava/java/util/Observer.java4
-rw-r--r--libjava/java/util/Properties.java4
-rw-r--r--libjava/java/util/PropertyPermission.java25
-rw-r--r--libjava/java/util/PropertyPermissionCollection.java4
-rw-r--r--libjava/java/util/RandomAccess.java4
-rw-r--r--libjava/java/util/Set.java4
-rw-r--r--libjava/java/util/SimpleTimeZone.java334
-rw-r--r--libjava/java/util/SortedMap.java4
-rw-r--r--libjava/java/util/SortedSet.java4
-rw-r--r--libjava/java/util/Stack.java6
-rw-r--r--libjava/java/util/StringTokenizer.java4
-rw-r--r--libjava/java/util/TimeZone.java1
-rw-r--r--libjava/java/util/Timer.java6
-rw-r--r--libjava/java/util/TooManyListenersException.java4
-rw-r--r--libjava/java/util/TreeMap.java10
-rw-r--r--libjava/java/util/TreeSet.java4
-rw-r--r--libjava/java/util/Vector.java4
-rw-r--r--libjava/java/util/jar/Attributes.java52
-rw-r--r--libjava/java/util/jar/JarFile.java736
-rw-r--r--libjava/java/util/logging/FileHandler.java4
-rw-r--r--libjava/java/util/logging/Level.java4
-rw-r--r--libjava/java/util/logging/Logger.java16
-rw-r--r--libjava/java/util/prefs/AbstractPreferences.java2
-rw-r--r--libjava/java/util/prefs/BackingStoreException.java4
-rw-r--r--libjava/java/util/prefs/InvalidPreferencesFormatException.java5
-rw-r--r--libjava/java/util/prefs/Preferences.java6
-rw-r--r--libjava/java/util/regex/Matcher.java13
-rw-r--r--libjava/java/util/regex/Pattern.java14
-rw-r--r--libjava/java/util/zip/InflaterInputStream.java16
-rw-r--r--libjava/java/util/zip/ZipFile.java11
-rw-r--r--libjava/javax/accessibility/Accessible.java4
-rw-r--r--libjava/javax/accessibility/AccessibleAction.java4
-rw-r--r--libjava/javax/accessibility/AccessibleBundle.java4
-rw-r--r--libjava/javax/accessibility/AccessibleComponent.java4
-rw-r--r--libjava/javax/accessibility/AccessibleContext.java2
-rw-r--r--libjava/javax/accessibility/AccessibleEditableText.java4
-rw-r--r--libjava/javax/accessibility/AccessibleExtendedComponent.java4
-rw-r--r--libjava/javax/accessibility/AccessibleExtendedTable.java4
-rw-r--r--libjava/javax/accessibility/AccessibleHyperlink.java4
-rw-r--r--libjava/javax/accessibility/AccessibleHypertext.java4
-rw-r--r--libjava/javax/accessibility/AccessibleIcon.java4
-rw-r--r--libjava/javax/accessibility/AccessibleKeyBinding.java4
-rw-r--r--libjava/javax/accessibility/AccessibleRelation.java2
-rw-r--r--libjava/javax/accessibility/AccessibleRelationSet.java2
-rw-r--r--libjava/javax/accessibility/AccessibleResourceBundle.java4
-rw-r--r--libjava/javax/accessibility/AccessibleRole.java2
-rw-r--r--libjava/javax/accessibility/AccessibleSelection.java4
-rw-r--r--libjava/javax/accessibility/AccessibleState.java2
-rw-r--r--libjava/javax/accessibility/AccessibleStateSet.java2
-rw-r--r--libjava/javax/accessibility/AccessibleTable.java4
-rw-r--r--libjava/javax/accessibility/AccessibleTableModelChange.java4
-rw-r--r--libjava/javax/accessibility/AccessibleText.java4
-rw-r--r--libjava/javax/accessibility/AccessibleValue.java4
-rw-r--r--libjava/javax/crypto/SecretKey.java1
-rw-r--r--libjava/javax/imageio/IIOException.java4
-rw-r--r--libjava/javax/imageio/IIOParam.java14
-rw-r--r--libjava/javax/imageio/ImageIO.java148
-rw-r--r--libjava/javax/imageio/ImageReadParam.java16
-rw-r--r--libjava/javax/imageio/ImageReader.java39
-rw-r--r--libjava/javax/imageio/ImageWriter.java13
-rw-r--r--libjava/javax/imageio/metadata/IIOInvalidTreeException.java13
-rw-r--r--libjava/javax/imageio/metadata/IIOMetadataNode.java549
-rw-r--r--libjava/javax/imageio/spi/IIORegistry.java8
-rw-r--r--libjava/javax/imageio/spi/IIOServiceProvider.java4
-rw-r--r--libjava/javax/imageio/spi/ImageInputStreamSpi.java4
-rw-r--r--libjava/javax/imageio/spi/ImageOutputStreamSpi.java4
-rw-r--r--libjava/javax/imageio/spi/ImageReaderWriterSpi.java4
-rw-r--r--libjava/javax/imageio/spi/ImageTranscoderSpi.java4
-rw-r--r--libjava/javax/imageio/spi/RegisterableService.java4
-rw-r--r--libjava/javax/imageio/spi/ServiceRegistry.java10
-rw-r--r--libjava/javax/imageio/stream/FileCacheImageInputStream.java18
-rw-r--r--libjava/javax/imageio/stream/FileCacheImageOutputStream.java32
-rw-r--r--libjava/javax/imageio/stream/FileImageInputStream.java23
-rw-r--r--libjava/javax/imageio/stream/FileImageOutputStream.java45
-rw-r--r--libjava/javax/imageio/stream/IIOByteBuffer.java4
-rw-r--r--libjava/javax/imageio/stream/ImageInputStream.java4
-rw-r--r--libjava/javax/imageio/stream/ImageInputStreamImpl.java360
-rw-r--r--libjava/javax/imageio/stream/ImageOutputStream.java4
-rw-r--r--libjava/javax/imageio/stream/ImageOutputStreamImpl.java180
-rw-r--r--libjava/javax/imageio/stream/MemoryCacheImageInputStream.java40
-rw-r--r--libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java54
-rw-r--r--libjava/javax/naming/Binding.java4
-rw-r--r--libjava/javax/naming/CannotProceedException.java4
-rw-r--r--libjava/javax/naming/CompositeName.java4
-rw-r--r--libjava/javax/naming/CompoundName.java4
-rw-r--r--libjava/javax/naming/LinkException.java4
-rw-r--r--libjava/javax/naming/LinkRef.java4
-rw-r--r--libjava/javax/naming/NameClassPair.java4
-rw-r--r--libjava/javax/naming/Reference.java4
-rw-r--r--libjava/javax/naming/ReferralException.java4
-rw-r--r--libjava/javax/naming/directory/Attribute.java4
-rw-r--r--libjava/javax/naming/directory/AttributeModificationException.java4
-rw-r--r--libjava/javax/naming/directory/Attributes.java4
-rw-r--r--libjava/javax/naming/directory/DirContext.java4
-rw-r--r--libjava/javax/naming/directory/ModificationItem.java4
-rw-r--r--libjava/javax/naming/directory/SearchControls.java4
-rw-r--r--libjava/javax/naming/directory/SearchResult.java4
-rw-r--r--libjava/javax/naming/event/EventContext.java4
-rw-r--r--libjava/javax/naming/event/EventDirContext.java4
-rw-r--r--libjava/javax/naming/event/NamespaceChangeListener.java4
-rw-r--r--libjava/javax/naming/event/NamingExceptionEvent.java4
-rw-r--r--libjava/javax/naming/event/NamingListener.java4
-rw-r--r--libjava/javax/naming/event/ObjectChangeListener.java4
-rw-r--r--libjava/javax/naming/ldap/Control.java4
-rw-r--r--libjava/javax/naming/ldap/ExtendedResponse.java4
-rw-r--r--libjava/javax/naming/ldap/HasControls.java4
-rw-r--r--libjava/javax/naming/ldap/LdapContext.java4
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotification.java4
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java4
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotificationListener.java4
-rw-r--r--libjava/javax/naming/spi/DirectoryManager.java4
-rw-r--r--libjava/javax/naming/spi/ResolveResult.java4
-rw-r--r--libjava/javax/naming/spi/Resolver.java4
-rw-r--r--libjava/javax/net/ssl/SSLContext.java10
-rw-r--r--libjava/javax/security/auth/Subject.java4
-rw-r--r--libjava/javax/security/auth/callback/Callback.java1
-rw-r--r--libjava/javax/security/auth/callback/CallbackHandler.java1
-rw-r--r--libjava/javax/security/auth/callback/ChoiceCallback.java1
-rw-r--r--libjava/javax/security/auth/callback/ConfirmationCallback.java5
-rw-r--r--libjava/javax/security/auth/callback/LanguageCallback.java1
-rw-r--r--libjava/javax/security/auth/callback/NameCallback.java1
-rw-r--r--libjava/javax/security/auth/callback/PasswordCallback.java1
-rw-r--r--libjava/javax/security/auth/callback/TextInputCallback.java1
-rw-r--r--libjava/javax/security/auth/callback/TextOutputCallback.java1
-rw-r--r--libjava/javax/security/auth/callback/UnsupportedCallbackException.java1
-rw-r--r--libjava/javax/security/sasl/Sasl.java11
-rw-r--r--libjava/javax/security/sasl/SaslServerFactory.java4
-rw-r--r--libjava/javax/swing/AbstractAction.java8
-rw-r--r--libjava/javax/swing/AbstractButton.java56
-rw-r--r--libjava/javax/swing/AbstractCellEditor.java2
-rw-r--r--libjava/javax/swing/AbstractListModel.java79
-rw-r--r--libjava/javax/swing/AbstractSet.java103
-rw-r--r--libjava/javax/swing/ActionMap.java90
-rw-r--r--libjava/javax/swing/BoundedRangeModel.java219
-rw-r--r--libjava/javax/swing/ComponentInputMap.java10
-rw-r--r--libjava/javax/swing/DebugGraphics.java612
-rw-r--r--libjava/javax/swing/DefaultBoundedRangeModel.java45
-rw-r--r--libjava/javax/swing/DefaultButtonModel.java10
-rw-r--r--libjava/javax/swing/DefaultCellEditor.java2
-rw-r--r--libjava/javax/swing/DefaultCellRenderer.java74
-rw-r--r--libjava/javax/swing/DefaultComboBoxModel.java17
-rw-r--r--libjava/javax/swing/DefaultDesktopManager.java59
-rw-r--r--libjava/javax/swing/DefaultListCellRenderer.java7
-rw-r--r--libjava/javax/swing/DefaultListModel.java24
-rw-r--r--libjava/javax/swing/DefaultListSelectionModel.java31
-rw-r--r--libjava/javax/swing/DefaultSingleSelectionModel.java69
-rw-r--r--libjava/javax/swing/ImageIcon.java13
-rw-r--r--libjava/javax/swing/InputMap.java90
-rw-r--r--libjava/javax/swing/JApplet.java80
-rw-r--r--libjava/javax/swing/JButton.java150
-rw-r--r--libjava/javax/swing/JCheckBox.java56
-rw-r--r--libjava/javax/swing/JCheckBoxMenuItem.java2
-rw-r--r--libjava/javax/swing/JComboBox.java247
-rw-r--r--libjava/javax/swing/JComponent.java63
-rw-r--r--libjava/javax/swing/JEditorPane.java83
-rw-r--r--libjava/javax/swing/JFileChooser.java6
-rw-r--r--libjava/javax/swing/JFormattedTextField.java103
-rw-r--r--libjava/javax/swing/JFrame.java6
-rw-r--r--libjava/javax/swing/JInternalFrame.java25
-rw-r--r--libjava/javax/swing/JLabel.java107
-rw-r--r--libjava/javax/swing/JLayeredPane.java61
-rw-r--r--libjava/javax/swing/JList.java253
-rw-r--r--libjava/javax/swing/JMenu.java48
-rw-r--r--libjava/javax/swing/JMenuBar.java50
-rw-r--r--libjava/javax/swing/JMenuItem.java22
-rw-r--r--libjava/javax/swing/JOptionPane.java4
-rw-r--r--libjava/javax/swing/JPasswordField.java12
-rw-r--r--libjava/javax/swing/JPopupMenu.java108
-rw-r--r--libjava/javax/swing/JProgressBar.java33
-rw-r--r--libjava/javax/swing/JRadioButton.java8
-rw-r--r--libjava/javax/swing/JRootPane.java61
-rw-r--r--libjava/javax/swing/JScrollBar.java100
-rw-r--r--libjava/javax/swing/JScrollPane.java74
-rw-r--r--libjava/javax/swing/JSlider.java56
-rw-r--r--libjava/javax/swing/JSpinner.java9
-rw-r--r--libjava/javax/swing/JTabbedPane.java30
-rw-r--r--libjava/javax/swing/JTable.java355
-rw-r--r--libjava/javax/swing/JTextArea.java6
-rw-r--r--libjava/javax/swing/JTextField.java59
-rw-r--r--libjava/javax/swing/JToggleButton.java9
-rw-r--r--libjava/javax/swing/JToolBar.java288
-rw-r--r--libjava/javax/swing/JTree.java743
-rw-r--r--libjava/javax/swing/JViewport.java24
-rw-r--r--libjava/javax/swing/JWindow.java286
-rw-r--r--libjava/javax/swing/KeyStroke.java29
-rw-r--r--libjava/javax/swing/LookAndFeel.java6
-rw-r--r--libjava/javax/swing/MenuSelectionManager.java8
-rw-r--r--libjava/javax/swing/OverlayLayout.java2
-rw-r--r--libjava/javax/swing/RepaintManager.java2
-rw-r--r--libjava/javax/swing/ScrollPaneLayout.java16
-rw-r--r--libjava/javax/swing/SizeRequirements.java2
-rw-r--r--libjava/javax/swing/SpinnerListModel.java4
-rw-r--r--libjava/javax/swing/SwingUtilities.java173
-rw-r--r--libjava/javax/swing/Timer.java17
-rw-r--r--libjava/javax/swing/TransferHandler.java102
-rw-r--r--libjava/javax/swing/UIDefaults.java128
-rw-r--r--libjava/javax/swing/UIManager.java8
-rw-r--r--libjava/javax/swing/ViewportLayout.java15
-rw-r--r--libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java4
-rw-r--r--libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java4
-rw-r--r--libjava/javax/swing/event/EventListenerList.java6
-rw-r--r--libjava/javax/swing/event/MouseInputAdapter.java144
-rw-r--r--libjava/javax/swing/plaf/basic/BasicButtonListener.java18
-rw-r--r--libjava/javax/swing/plaf/basic/BasicButtonUI.java11
-rw-r--r--libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java1
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java1
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboBoxUI.java26
-rw-r--r--libjava/javax/swing/plaf/basic/BasicComboPopup.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java8
-rw-r--r--libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLabelUI.java12
-rw-r--r--libjava/javax/swing/plaf/basic/BasicListUI.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicLookAndFeel.java2
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuBarUI.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuItemUI.java8
-rw-r--r--libjava/javax/swing/plaf/basic/BasicMenuUI.java10
-rw-r--r--libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java20
-rw-r--r--libjava/javax/swing/plaf/basic/BasicProgressBarUI.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java8
-rw-r--r--libjava/javax/swing/plaf/basic/BasicRootPaneUI.java18
-rw-r--r--libjava/javax/swing/plaf/basic/BasicScrollBarUI.java6
-rw-r--r--libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java60
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSliderUI.java132
-rw-r--r--libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java1
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java16
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java4
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTableUI.java43
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextPaneUI.java11
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTextUI.java34
-rw-r--r--libjava/javax/swing/plaf/basic/BasicToolBarUI.java259
-rw-r--r--libjava/javax/swing/plaf/basic/BasicTreeUI.java5
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLookAndFeel.java288
-rw-r--r--libjava/javax/swing/table/DefaultTableCellRenderer.java6
-rw-r--r--libjava/javax/swing/table/DefaultTableColumnModel.java370
-rw-r--r--libjava/javax/swing/table/DefaultTableModel.java367
-rw-r--r--libjava/javax/swing/table/JTableHeader.java14
-rw-r--r--libjava/javax/swing/table/TableColumn.java377
-rw-r--r--libjava/javax/swing/table/TableColumnModel.java198
-rw-r--r--libjava/javax/swing/table/TableModel.java152
-rw-r--r--libjava/javax/swing/text/AbstractDocument.java163
-rw-r--r--libjava/javax/swing/text/DefaultEditorKit.java77
-rw-r--r--libjava/javax/swing/text/EditorKit.java20
-rw-r--r--libjava/javax/swing/text/GapContent.java2
-rw-r--r--libjava/javax/swing/text/JTextComponent.java168
-rw-r--r--libjava/javax/swing/text/PasswordView.java32
-rw-r--r--libjava/javax/swing/text/PlainDocument.java36
-rw-r--r--libjava/javax/swing/text/PlainView.java26
-rw-r--r--libjava/javax/swing/text/Position.java8
-rw-r--r--libjava/javax/swing/text/Segment.java12
-rw-r--r--libjava/javax/swing/text/StyledEditorKit.java522
-rw-r--r--libjava/javax/swing/text/TextAction.java69
-rw-r--r--libjava/javax/swing/text/Utilities.java4
-rw-r--r--libjava/javax/swing/text/View.java153
-rw-r--r--libjava/javax/swing/text/ViewFactory.java2
-rw-r--r--libjava/javax/swing/tree/DefaultMutableTreeNode.java1865
-rw-r--r--libjava/javax/swing/tree/MutableTreeNode.java103
-rw-r--r--libjava/javax/swing/tree/TreeCellEditor.java30
-rw-r--r--libjava/javax/swing/undo/UndoManager.java4
-rw-r--r--libjava/javax/swing/undo/UndoableEditSupport.java6
-rw-r--r--libjava/javax/transaction/HeuristicCommitException.java4
-rw-r--r--libjava/javax/transaction/HeuristicMixedException.java4
-rw-r--r--libjava/javax/transaction/HeuristicRollbackException.java4
-rw-r--r--libjava/javax/transaction/InvalidTransactionException.java4
-rw-r--r--libjava/javax/transaction/NotSupportedException.java4
-rw-r--r--libjava/javax/transaction/RollbackException.java4
-rw-r--r--libjava/javax/transaction/Status.java4
-rw-r--r--libjava/javax/transaction/Synchronization.java4
-rw-r--r--libjava/javax/transaction/SystemException.java4
-rw-r--r--libjava/javax/transaction/Transaction.java4
-rw-r--r--libjava/javax/transaction/TransactionManager.java4
-rw-r--r--libjava/javax/transaction/TransactionRequiredException.java4
-rw-r--r--libjava/javax/transaction/TransactionRolledbackException.java4
-rw-r--r--libjava/javax/transaction/UserTransaction.java4
-rw-r--r--libjava/javax/transaction/xa/XAException.java4
-rw-r--r--libjava/javax/transaction/xa/XAResource.java4
-rw-r--r--libjava/javax/transaction/xa/Xid.java4
-rw-r--r--libjava/javax/xml/XMLConstants.java4
-rw-r--r--libjava/javax/xml/datatype/DatatypeConfigurationException.java4
-rw-r--r--libjava/javax/xml/datatype/DatatypeConstants.java4
-rw-r--r--libjava/javax/xml/datatype/DatatypeFactory.java4
-rw-r--r--libjava/javax/xml/datatype/Duration.java4
-rw-r--r--libjava/javax/xml/datatype/XMLGregorianCalendar.java4
-rw-r--r--libjava/javax/xml/namespace/NamespaceContext.java4
-rw-r--r--libjava/javax/xml/namespace/QName.java4
-rw-r--r--libjava/javax/xml/parsers/DocumentBuilder.java5
-rw-r--r--libjava/javax/xml/parsers/DocumentBuilderFactory.java7
-rw-r--r--libjava/javax/xml/parsers/FactoryConfigurationError.java4
-rw-r--r--libjava/javax/xml/parsers/ParserConfigurationException.java4
-rw-r--r--libjava/javax/xml/parsers/SAXParser.java4
-rw-r--r--libjava/javax/xml/parsers/SAXParserFactory.java4
-rw-r--r--libjava/javax/xml/transform/ErrorListener.java4
-rw-r--r--libjava/javax/xml/transform/OutputKeys.java4
-rw-r--r--libjava/javax/xml/transform/Result.java4
-rw-r--r--libjava/javax/xml/transform/Source.java4
-rw-r--r--libjava/javax/xml/transform/SourceLocator.java4
-rw-r--r--libjava/javax/xml/transform/Templates.java4
-rw-r--r--libjava/javax/xml/transform/Transformer.java4
-rw-r--r--libjava/javax/xml/transform/TransformerConfigurationException.java4
-rw-r--r--libjava/javax/xml/transform/TransformerException.java4
-rw-r--r--libjava/javax/xml/transform/TransformerFactory.java4
-rw-r--r--libjava/javax/xml/transform/TransformerFactoryConfigurationError.java4
-rw-r--r--libjava/javax/xml/transform/URIResolver.java4
-rw-r--r--libjava/javax/xml/transform/dom/DOMLocator.java4
-rw-r--r--libjava/javax/xml/transform/dom/DOMResult.java4
-rw-r--r--libjava/javax/xml/transform/dom/DOMSource.java4
-rw-r--r--libjava/javax/xml/transform/sax/SAXResult.java4
-rw-r--r--libjava/javax/xml/transform/sax/SAXSource.java4
-rw-r--r--libjava/javax/xml/transform/sax/SAXTransformerFactory.java7
-rw-r--r--libjava/javax/xml/transform/sax/TemplatesHandler.java4
-rw-r--r--libjava/javax/xml/transform/sax/TransformerHandler.java4
-rw-r--r--libjava/javax/xml/transform/stream/StreamResult.java4
-rw-r--r--libjava/javax/xml/transform/stream/StreamSource.java4
-rw-r--r--libjava/javax/xml/validation/Schema.java4
-rw-r--r--libjava/javax/xml/validation/SchemaFactory.java4
-rw-r--r--libjava/javax/xml/validation/TypeInfoProvider.java4
-rw-r--r--libjava/javax/xml/validation/Validator.java4
-rw-r--r--libjava/javax/xml/validation/ValidatorHandler.java4
-rw-r--r--libjava/javax/xml/xpath/XPathConstants.java4
-rw-r--r--libjava/javax/xml/xpath/XPathException.java4
-rw-r--r--libjava/javax/xml/xpath/XPathExpression.java4
-rw-r--r--libjava/javax/xml/xpath/XPathExpressionException.java4
-rw-r--r--libjava/javax/xml/xpath/XPathFactory.java4
-rw-r--r--libjava/javax/xml/xpath/XPathFactoryConfigurationException.java4
-rw-r--r--libjava/javax/xml/xpath/XPathFunction.java4
-rw-r--r--libjava/javax/xml/xpath/XPathFunctionException.java4
-rw-r--r--libjava/javax/xml/xpath/XPathFunctionResolver.java4
-rw-r--r--libjava/jni.cc79
-rw-r--r--libjava/jni/gtk-peer/gdkfont.h25
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c115
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c250
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c696
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c18
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c505
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c187
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c16
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c12
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c18
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c10
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c109
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c90
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c44
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c15
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c8
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c307
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c4
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c366
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c185
-rw-r--r--libjava/jni/gtk-peer/gthread-jni.c4
-rw-r--r--libjava/jni/gtk-peer/gtkcairopeer.h13
-rw-r--r--libjava/jni/gtk-peer/gtkpeer.h13
-rw-r--r--libjava/link.cc93
-rw-r--r--libjava/posix-threads.cc26
-rw-r--r--libjava/prims.cc183
-rw-r--r--libjava/testsuite/libjava.jni/jni.exp86
-rw-r--r--libjava/testsuite/libjava.mauve/xfails590
-rw-r--r--libjava/verify.cc96
-rw-r--r--libmudflap/ChangeLog5
-rw-r--r--libstdc++-v3/ChangeLog334
-rw-r--r--libstdc++-v3/acconfig.h2
-rw-r--r--libstdc++-v3/acinclude.m42
-rw-r--r--libstdc++-v3/config.h.in2
-rw-r--r--libstdc++-v3/config/linker-map.gnu10
-rwxr-xr-xlibstdc++-v3/configure2
-rw-r--r--libstdc++-v3/include/Makefile.am7
-rw-r--r--libstdc++-v3/include/Makefile.in7
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc6
-rw-r--r--libstdc++-v3/include/bits/c++config2
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h54
-rw-r--r--libstdc++-v3/include/c_std/std_cmath.h6
-rw-r--r--libstdc++-v3/include/std/std_complex.h22
-rw-r--r--libstdc++-v3/include/tr1/functional1071
-rw-r--r--libstdc++-v3/include/tr1/tuple11
-rw-r--r--libstdc++-v3/include/tr1/type_traits362
-rw-r--r--libstdc++-v3/include/tr1/type_traits_fwd.h13
-rw-r--r--libstdc++-v3/include/tr1/utility9
-rw-r--r--libstdc++-v3/libsupc++/del_op.cc4
-rw-r--r--libstdc++-v3/libsupc++/eh_alloc.cc6
-rw-r--r--libstdc++-v3/libsupc++/eh_catch.cc23
-rw-r--r--libstdc++-v3/libsupc++/eh_throw.cc5
-rw-r--r--libstdc++-v3/libsupc++/unwind-cxx.h1
-rwxr-xr-xlibstdc++-v3/scripts/check_performance38
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc3
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex/13450.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex/complex_value.cc1
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex/pow.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc4
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/01.cc6
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/02.cc6
-rw-r--r--libstdc++-v3/testsuite/ext/array_allocator/2.cc3
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp1
-rw-r--r--libstdc++-v3/testsuite/testsuite_tr1.h77
-rw-r--r--libstdc++-v3/testsuite/thread/pthread1.cc2
-rw-r--r--libstdc++-v3/testsuite/thread/pthread2.cc2
-rw-r--r--libstdc++-v3/testsuite/thread/pthread3.cc2
-rw-r--r--libstdc++-v3/testsuite/thread/pthread4.cc2
-rw-r--r--libstdc++-v3/testsuite/thread/pthread5.cc2
-rw-r--r--libstdc++-v3/testsuite/thread/pthread6.cc2
-rw-r--r--libstdc++-v3/testsuite/thread/pthread7-rope.cc2
-rw-r--r--libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc1
-rw-r--r--maintainer-scripts/ChangeLog4
-rw-r--r--maintainer-scripts/crontab3
1708 files changed, 64011 insertions, 45580 deletions
diff --git a/ChangeLog b/ChangeLog
index afdc57ea2e2..ef2f14bb0c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+
+ * MAINTAINERS (Language Front Ends Maintainers): Add myself as
+ treelang maintainer.
+ (Write After Approval): Remove myself.
+
+2005-02-23 Paul Schlie <schlie@comcast.net>
+
+ * configure.in: Allow darwin targeted ports to build tk, itcl and
+ libgui.
+ * configure: Regenerate.
+
+2005-02-21 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR libgcj/10353
+ * configure.in (noconfigdirs) <sparc-*-solaris2.[0-6]>: Add libgcj.
+ * configure: Regenerate.
+
+2005-02-18 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2005-02-10 Ian Lance Taylor <ian@airs.com>
+
+ * MAINTAINERS: Update my e-mail address.
+
2005-02-02 Richard Guenther <rguenth@gcc.gnu.org>
* MAINTAINERS (Write After Approval): Add myself.
diff --git a/MAINTAINERS b/MAINTAINERS
index 985a6de510a..c4d42890472 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -122,6 +122,7 @@ objective-c Stan Shebs shebs@apple.com
objective-c Ovidiu Predescu ovidiu@cup.hp.com
objective-c Ziemowit Laski zlaski@apple.com
treelang Tim Josling tej@melbpc.org.au
+treelang James A. Morrison phython@gcc.gnu.org
Various Maintainers
@@ -163,7 +164,7 @@ basic block reordering Jason Eckhardt jle@rice.edu
i18n Philipp Thomas pthomas@suse.de
diagnostic messages Gabriel Dos Reis gdr@integrable-solutions.net
libiberty DJ Delorie dj@redhat.com
-libiberty Ian Lance Taylor ian@wasabisystems.com
+libiberty Ian Lance Taylor ian@airs.com
build machinery (*.in) DJ Delorie dj@redhat.com
build machinery (*.in) Nathanael Nerode neroden@gcc.gnu.org
build machinery (*.in) Alexandre Oliva aoliva@redhat.com
@@ -229,6 +230,7 @@ Brian Ford ford@vss.fsi.com
Kaveh Ghazi ghazi@caip.rutgers.edu
Matthew Gingell gingell@gnat.com
Anthony Green green@redhat.com
+Doug Gregor doug.gregor@gmail.com
Richard Guenther rguenth@gcc.gnu.org
Laurent Guerby laurent@guerby.net
Mostafa Hagog hagog@gcc.gnu.org
@@ -242,6 +244,7 @@ Daniel Jacobowitz dan@debian.org
Andreas Jaeger aj@suse.de
Fariborz Jahanian fjahanian@apple.com
Klaus Kaempf kkaempf@progis.de
+Steve Kargl sgk@troutmask.apl.washington.edu
Brendan Kehoe brendan@zen.org
Mumit Khan khan@xraylith.wisc.edu
Matthias Klose doko@debian.org
@@ -249,6 +252,7 @@ Jeff Knaggs jknaggs@redhat.com
Michael Koch konqueror@gmx.de
Matt Kraai kraai@ftbfs.org
Scott Robert Ladd scott.ladd@coyotegulch.com
+Razya Ladelsky razya@gcc.gnu.org
Aaron W. LaFramboise aaronavay62@aaronwl.com
Marc Lehmann pcg@goof.com
Alan Lehotsky apl@alum.mit.edu
@@ -267,7 +271,6 @@ Greg McGary gkm@gnu.org
Adam Megacz adam@xwt.org
Alan Modra amodra@bigpond.net.au
Catherine Moore clm@redhat.com
-James A. Morrison ja2morri@uwaterloo.ca
Dorit Naishlos dorit@il.ibm.com
Adam Nemet anemet@lnxw.com
Dan Nicolaescu dann@ics.uci.edu
@@ -286,6 +289,7 @@ Volker Reichelt reichelt@igpm.rwth-aachen.de
Tom Rix trix@redhat.com
Craig Rodrigues rodrigc@gcc.gnu.org
Gavin Romig-Koch gavin@redhat.com
+Ira Rosen irar@il.ibm.com
Ira Ruben ira@apple.com
Douglas Rupp rupp@gnat.com
Matthew Sachs msachs@apple.com
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index 5bb9d45a435..cb49b3a8d54 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,30 @@
+2005-02-26 Richard Earnshaw <rearnsha@arm.com>
+
+ * dyn_load.c: On NetBSD, include machine/elf_machdep.h and define
+ ELFSIZE in terms of ARCH_ELFSIZE (back-ported from gc7.0alpha1).
+
+2005-02-15 Bryce McKinlay <mckinlay@redhat.com>
+
+ PR libgcj/19823
+ * configure.host: Set gc_use_mmap on *-linux*.
+ * configure.ac: Define USE_MMAP if gc_use_mmap is set.
+ * include/private/gc_priv.h: Include gc_config.h.
+ * configure, include/gc_config.h.in: Rebuilt.
+
+2005-02-07 Hans Boehm <Hans.Boehm@hp.com>
+
+ * allchblk.c (GC_allochblk_nth): Dont overlook available space if
+ GC disabled, correctly convert GC_finalizer_mem_freed to byte,
+ total_size to words.
+ * dyn_load.c (win32 GC_register_dynamic_libraries): Consider only
+ MEM_IMAGE regions.
+ * mach_dep.c (GC_with_callee_saves_pushed): separate into new function,
+ and indent appropriately.
+ * mark_rts.c (GC_approx_sp): Access stack.
+ * pthread_stop_world.c: (GC_suspend_handler): Explicitly push
+ callee-saves registers when appropriate.
+ (GC_stop_world): Handle EINTR from sem_wait (sync with Mono GC).
+
2005-01-01 Bryce McKinlay <mckinlay@redhat.com>
* configure.ac (AC_CONFIG_HEADERS): Build both include/gc_config.h
diff --git a/boehm-gc/allchblk.c b/boehm-gc/allchblk.c
index 793c468b928..f9c31e04527 100644
--- a/boehm-gc/allchblk.c
+++ b/boehm-gc/allchblk.c
@@ -590,8 +590,9 @@ int n;
GET_HDR(hbp, hhdr);
size_avail = hhdr->hb_sz;
if (size_avail < size_needed) continue;
- if (!GC_use_entire_heap
- && size_avail != size_needed
+ if (size_avail != size_needed
+ && !GC_use_entire_heap
+ && !GC_dont_gc
&& USED_HEAP_SIZE >= GC_requested_heapsize
&& !TRUE_INCREMENTAL && GC_should_collect()) {
# ifdef USE_MUNMAP
@@ -608,7 +609,8 @@ int n;
/* If we are deallocating lots of memory from */
/* finalizers, fail and collect sooner rather */
/* than later. */
- if (GC_finalizer_mem_freed > (GC_heapsize >> 4)) {
+ if (WORDS_TO_BYTES(GC_finalizer_mem_freed)
+ > (GC_heapsize >> 4)) {
continue;
}
# endif /* !USE_MUNMAP */
@@ -698,7 +700,7 @@ int n;
struct hblk * h;
struct hblk * prev = hhdr -> hb_prev;
- GC_words_wasted += total_size;
+ GC_words_wasted += BYTES_TO_WORDS(total_size);
GC_large_free_bytes -= total_size;
GC_remove_from_fl(hhdr, n);
for (h = hbp; h < limit; h++) {
diff --git a/boehm-gc/configure b/boehm-gc/configure
index 36243d4c58b..b205d328c03 100755
--- a/boehm-gc/configure
+++ b/boehm-gc/configure
@@ -6558,6 +6558,14 @@ _ACEOF
fi
fi;
+if test "${gc_use_mmap}" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_MMAP 1
+_ACEOF
+
+fi
+
if test -n "$with_cross_host" &&
test x"$with_cross_host" != x"no"; then
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac
index 208a9160872..dfb0e17e261 100644
--- a/boehm-gc/configure.ac
+++ b/boehm-gc/configure.ac
@@ -446,6 +446,10 @@ AC_ARG_ENABLE(gc-debug,
esac
fi])
+if test "${gc_use_mmap}" = "yes"; then
+ AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory])
+fi
+
if test -n "$with_cross_host" &&
test x"$with_cross_host" != x"no"; then
toolexecdir='$(exec_prefix)/$(target_noncanonical)'
diff --git a/boehm-gc/configure.host b/boehm-gc/configure.host
index a98a0a7cb30..97f4dacb6de 100644
--- a/boehm-gc/configure.host
+++ b/boehm-gc/configure.host
@@ -18,8 +18,11 @@
# It sets the following shell variables:
# gc_cflags Special CFLAGS to use when building
+# gc_use_mmap Set to "yes" on platforms where mmap should be used instead
+# of sbrk. This will define USE_MMAP.
gc_cflags=""
+gc_use_mmap=
# We should set -fexceptions if we are using gcc and might be used
# inside something like gcj. This is the zeroth approximation:
@@ -37,6 +40,12 @@ else
esac
fi
+case "${host}" in
+ *-linux*)
+ gc_use_mmap=yes
+ ;;
+esac
+
case "${target_optspace}:${host}" in
yes:*)
gc_cflags="${gc_cflags} -Os"
diff --git a/boehm-gc/dyn_load.c b/boehm-gc/dyn_load.c
index 9bd9e060688..c5139aa80a8 100644
--- a/boehm-gc/dyn_load.c
+++ b/boehm-gc/dyn_load.c
@@ -80,6 +80,11 @@
# define l_name lm_name
#endif
+#if defined(NETBSD)
+# include <machine/elf_machdep.h>
+# define ELFSIZE ARCH_ELFSIZE
+#endif
+
#if defined(LINUX) && defined(__ELF__) || defined(SCO_ELF) || \
(defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
(defined(NETBSD) && defined(__ELF__)) || defined(HURD)
@@ -735,6 +740,10 @@ void GC_register_dynamic_libraries()
# define HAVE_REGISTER_MAIN_STATIC_DATA
+ /* The frame buffer testing code is dead in this version. */
+ /* We leave it here temporarily in case the switch to just */
+ /* testing for MEM_IMAGE sections causes un expected */
+ /* problems. */
GC_bool GC_warn_fb = TRUE; /* Warn about traced likely */
/* graphics memory. */
GC_bool GC_disallow_ignore_fb = FALSE;
@@ -856,7 +865,11 @@ void GC_register_dynamic_libraries()
&& (protect == PAGE_EXECUTE_READWRITE
|| protect == PAGE_READWRITE)
&& !GC_is_heap_base(buf.AllocationBase)
- && !is_frame_buffer(p, buf.RegionSize)) {
+ /* This used to check for
+ * !is_frame_buffer(p, buf.RegionSize, buf.Type)
+ * instead of just checking for MEM_IMAGE.
+ * If something breaks, change it back. */
+ && buf.Type == MEM_IMAGE) {
# ifdef DEBUG_VIRTUALQUERY
GC_dump_meminfo(&buf);
# endif
diff --git a/boehm-gc/include/gc_config.h.in b/boehm-gc/include/gc_config.h.in
index 60ffb9741b6..92f1b2cf460 100644
--- a/boehm-gc/include/gc_config.h.in
+++ b/boehm-gc/include/gc_config.h.in
@@ -145,6 +145,9 @@
/* define GC_local_malloc() & GC_local_malloc_atomic() */
#undef THREAD_LOCAL_ALLOC
+/* use MMAP instead of sbrk to get new memory */
+#undef USE_MMAP
+
/* POSIX version of C Source */
#undef _POSIX_C_SOURCE
diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h
index e5bd52b62b7..c336ce5c433 100644
--- a/boehm-gc/include/private/gc_priv.h
+++ b/boehm-gc/include/private/gc_priv.h
@@ -19,6 +19,10 @@
# ifndef GC_PRIVATE_H
# define GC_PRIVATE_H
+/* Autoconf definitions. */
+/* FIXME: This should really be included directly from each .c file. */
+#include <gc_config.h>
+
#if defined(mips) && defined(SYSTYPE_BSD) && defined(sony_news)
/* sony RISC NEWS, NEWSOS 4 */
# define BSD_TIME
diff --git a/boehm-gc/mach_dep.c b/boehm-gc/mach_dep.c
index 327e11ca690..5412b8b54fd 100644
--- a/boehm-gc/mach_dep.c
+++ b/boehm-gc/mach_dep.c
@@ -400,64 +400,79 @@ void GC_push_regs()
}
#endif /* !USE_GENERIC_PUSH_REGS && !USE_ASM_PUSH_REGS */
+void GC_with_callee_saves_pushed(fn, arg)
+void (*fn)();
+ptr_t arg;
+{
+ word dummy;
+
+# if defined(USE_GENERIC_PUSH_REGS)
+# ifdef HAVE_BUILTIN_UNWIND_INIT
+ /* This was suggested by Richard Henderson as the way to */
+ /* force callee-save registers and register windows onto */
+ /* the stack. */
+ __builtin_unwind_init();
+# else /* !HAVE_BUILTIN_UNWIND_INIT */
+ /* Generic code */
+ /* The idea is due to Parag Patel at HP. */
+ /* We're not sure whether he would like */
+ /* to be he acknowledged for it or not. */
+ jmp_buf regs;
+ register word * i = (word *) regs;
+ register ptr_t lim = (ptr_t)(regs) + (sizeof regs);
+
+ /* Setjmp doesn't always clear all of the buffer. */
+ /* That tends to preserve garbage. Clear it. */
+ for (; (char *)i < lim; i++) {
+ *i = 0;
+ }
+# if defined(POWERPC) || defined(MSWIN32) || defined(MSWINCE) \
+ || defined(UTS4) || defined(LINUX) || defined(EWS4800)
+ (void) setjmp(regs);
+# else
+ (void) _setjmp(regs);
+ /* We don't want to mess with signals. According to */
+ /* SUSV3, setjmp() may or may not save signal mask. */
+ /* _setjmp won't, but is less portable. */
+# endif
+# endif /* !HAVE_BUILTIN_UNWIND_INIT */
+# elif defined(PTHREADS) && !defined(MSWIN32) /* !USE_GENERIC_PUSH_REGS */
+ /* We may still need this to save thread contexts. */
+ /* This should probably be used in all Posix/non-gcc */
+ /* settings. We defer that change to minimize risk. */
+ ucontext_t ctxt;
+ getcontext(&ctxt);
+# else /* Shouldn't be needed */
+ ABORT("Unexpected call to GC_with_callee_saves_pushed");
+# endif
+# if (defined(SPARC) && !defined(HAVE_BUILTIN_UNWIND_INIT)) \
+ || defined(IA64)
+ /* On a register window machine, we need to save register */
+ /* contents on the stack for this to work. The setjmp */
+ /* is probably not needed on SPARC, since pointers are */
+ /* only stored in windowed or scratch registers. It is */
+ /* needed on IA64, since some non-windowed registers are */
+ /* preserved. */
+ {
+ GC_save_regs_ret_val = GC_save_regs_in_stack();
+ /* On IA64 gcc, could use __builtin_ia64_flushrs() and */
+ /* __builtin_ia64_flushrs(). The latter will be done */
+ /* implicitly by __builtin_unwind_init() for gcc3.0.1 */
+ /* and later. */
+ }
+# endif
+ fn(arg);
+ /* Strongly discourage the compiler from treating the above */
+ /* as a tail-call, since that would pop the register */
+ /* contents before we get a chance to look at them. */
+ GC_noop1((word)(&dummy));
+}
+
#if defined(USE_GENERIC_PUSH_REGS)
void GC_generic_push_regs(cold_gc_frame)
ptr_t cold_gc_frame;
{
- {
- word dummy;
-
-# ifdef HAVE_BUILTIN_UNWIND_INIT
- /* This was suggested by Richard Henderson as the way to */
- /* force callee-save registers and register windows onto */
- /* the stack. */
- __builtin_unwind_init();
-# else /* !HAVE_BUILTIN_UNWIND_INIT */
- /* Generic code */
- /* The idea is due to Parag Patel at HP. */
- /* We're not sure whether he would like */
- /* to be he acknowledged for it or not. */
- jmp_buf regs;
- register word * i = (word *) regs;
- register ptr_t lim = (ptr_t)(regs) + (sizeof regs);
-
- /* Setjmp doesn't always clear all of the buffer. */
- /* That tends to preserve garbage. Clear it. */
- for (; (char *)i < lim; i++) {
- *i = 0;
- }
-# if defined(POWERPC) || defined(MSWIN32) || defined(MSWINCE) \
- || defined(UTS4) || defined(LINUX) || defined(EWS4800)
- (void) setjmp(regs);
-# else
- (void) _setjmp(regs);
- /* We don't want to mess with signals. According to */
- /* SUSV3, setjmp() may or may not save signal mask. */
- /* _setjmp won't, but is less portable. */
-# endif
-# endif /* !HAVE_BUILTIN_UNWIND_INIT */
-# if (defined(SPARC) && !defined(HAVE_BUILTIN_UNWIND_INIT)) \
- || defined(IA64)
- /* On a register window machine, we need to save register */
- /* contents on the stack for this to work. The setjmp */
- /* is probably not needed on SPARC, since pointers are */
- /* only stored in windowed or scratch registers. It is */
- /* needed on IA64, since some non-windowed registers are */
- /* preserved. */
- {
- GC_save_regs_ret_val = GC_save_regs_in_stack();
- /* On IA64 gcc, could use __builtin_ia64_flushrs() and */
- /* __builtin_ia64_flushrs(). The latter will be done */
- /* implicitly by __builtin_unwind_init() for gcc3.0.1 */
- /* and later. */
- }
-# endif
- GC_push_current_stack(cold_gc_frame);
- /* Strongly discourage the compiler from treating the above */
- /* as a tail-call, since that would pop the register */
- /* contents before we get a chance to look at them. */
- GC_noop1((word)(&dummy));
- }
+ GC_with_callee_saves_pushed(GC_push_current_stack, cold_gc_frame);
}
#endif /* USE_GENERIC_PUSH_REGS */
diff --git a/boehm-gc/mark_rts.c b/boehm-gc/mark_rts.c
index 55eb5d54339..4074879a71a 100644
--- a/boehm-gc/mark_rts.c
+++ b/boehm-gc/mark_rts.c
@@ -368,8 +368,11 @@ ptr_t p;
ptr_t GC_approx_sp()
{
- word dummy;
+ VOLATILE word dummy;
+ dummy = 42; /* Force stack to grow if necessary. Otherwise the */
+ /* later accesses might cause the kernel to think we're */
+ /* doing something wrong. */
# ifdef _MSC_VER
# pragma warning(disable:4172)
# endif
diff --git a/boehm-gc/pthread_stop_world.c b/boehm-gc/pthread_stop_world.c
index 832c49ca81e..b5e7faed5ab 100644
--- a/boehm-gc/pthread_stop_world.c
+++ b/boehm-gc/pthread_stop_world.c
@@ -101,8 +101,28 @@ word GC_stop_count; /* Incremented at the beginning of GC_stop_world. */
sem_t GC_suspend_ack_sem;
+void GC_suspend_handler_inner(ptr_t sig_arg);
+
+#if defined(IA64) || defined(HP_PA)
+extern void GC_with_callee_saves_pushed();
+
void GC_suspend_handler(int sig)
{
+ GC_with_callee_saves_pushed(GC_suspend_handler_inner, (ptr_t)(word)sig);
+}
+
+#else
+/* We believe that in all other cases the full context is already */
+/* in the signal handler frame. */
+void GC_suspend_handler(int sig)
+{
+ GC_suspend_handler_inner((ptr_t)(word)sig);
+}
+#endif
+
+void GC_suspend_handler_inner(ptr_t sig_arg)
+{
+ int sig = (int)(word)sig_arg;
int dummy;
pthread_t my_thread = pthread_self();
GC_thread me;
@@ -369,9 +389,11 @@ void GC_stop_world()
}
}
for (i = 0; i < n_live_threads; i++) {
- if (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
+ while (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
+ if (errno != EINTR) {
GC_err_printf1("Sem_wait returned %ld\n", (unsigned long)code);
ABORT("sem_wait for handler failed");
+ }
}
}
# ifdef PARALLEL_MARK
diff --git a/configure b/configure
index 24cfc0175fe..85df544ed66 100755
--- a/configure
+++ b/configure
@@ -50,7 +50,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -165,7 +164,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -336,11 +334,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -506,16 +499,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -602,7 +591,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:606: checking host system type" >&5
+echo "configure:595: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -623,7 +612,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:627: checking target system type" >&5
+echo "configure:616: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -641,7 +630,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:645: checking build system type" >&5
+echo "configure:634: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -696,7 +685,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:700: checking for a BSD compatible install" >&5
+echo "configure:689: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -749,7 +738,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:753: checking whether ln works" >&5
+echo "configure:742: checking whether ln works" >&5
if eval "test \"`echo '$''{'acx_cv_prog_LN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -773,7 +762,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:777: checking whether ln -s works" >&5
+echo "configure:766: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1106,9 +1095,6 @@ case "${host}" in
powerpc-*-beos*)
noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
;;
- *-*-darwin*)
- noconfigdirs="$noconfigdirs tk itcl libgui"
- ;;
esac
@@ -1555,6 +1541,9 @@ case "${target}" in
use_gnu_ld=no
fi
;;
+ sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;;
v810-*-*)
@@ -1810,7 +1799,7 @@ else
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1814: checking for $ac_word" >&5
+echo "configure:1803: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1840,7 +1829,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1844: checking for $ac_word" >&5
+echo "configure:1833: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1891,7 +1880,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1895: checking for $ac_word" >&5
+echo "configure:1884: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1923,7 +1912,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1927: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1916: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1934,12 +1923,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1938 "configure"
+#line 1927 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1965,12 +1954,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1969: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1974: checking whether we are using GNU C" >&5
+echo "configure:1963: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1979,7 +1968,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1983: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1998,7 +1987,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2002: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1991: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2065,7 +2054,7 @@ fi
# Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2069: checking for $ac_word" >&5
+echo "configure:2058: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2097,7 +2086,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "gnatbind", so it can be a program name with args.
set dummy gnatbind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2101: checking for $ac_word" >&5
+echo "configure:2090: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2130,7 +2119,7 @@ fi
fi
echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
-echo "configure:2134: checking whether compiler driver understands Ada" >&5
+echo "configure:2123: checking whether compiler driver understands Ada" >&5
if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2163,7 +2152,7 @@ else
fi
echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6
-echo "configure:2167: checking how to compare bootstrapped objects" >&5
+echo "configure:2156: checking how to compare bootstrapped objects" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2261,9 +2250,9 @@ saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $gmpinc"
# Check GMP actually works
echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6
-echo "configure:2265: checking for correct version of gmp.h" >&5
+echo "configure:2254: checking for correct version of gmp.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2267 "configure"
+#line 2256 "configure"
#include "confdefs.h"
#include "gmp.h"
int main() {
@@ -2274,7 +2263,7 @@ choke me
; return 0; }
EOF
-if { (eval echo configure:2278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
else
@@ -2287,12 +2276,12 @@ rm -f conftest*
if test x"$have_gmp" = xyes; then
echo $ac_n "checking for MPFR""... $ac_c" 1>&6
-echo "configure:2291: checking for MPFR" >&5
+echo "configure:2280: checking for MPFR" >&5
saved_LIBS="$LIBS"
LIBS="$LIBS $gmplibs"
cat > conftest.$ac_ext <<EOF
-#line 2296 "configure"
+#line 2285 "configure"
#include "confdefs.h"
#include <gmp.h>
#include <mpfr.h>
@@ -2300,7 +2289,7 @@ int main() {
mpfr_t n; mpfr_init(n);
; return 0; }
EOF
-if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
else
@@ -2787,7 +2776,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2791: checking for $ac_word" >&5
+echo "configure:2780: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_BISON'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2822,7 +2811,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2826: checking for $ac_word" >&5
+echo "configure:2815: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2857,7 +2846,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2861: checking for $ac_word" >&5
+echo "configure:2850: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_M4'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2892,7 +2881,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2896: checking for $ac_word" >&5
+echo "configure:2885: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_FLEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2927,7 +2916,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2931: checking for $ac_word" >&5
+echo "configure:2920: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LEX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2962,7 +2951,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2966: checking for $ac_word" >&5
+echo "configure:2955: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_MAKEINFO'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3608,7 +3597,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
# Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3612: checking for $ac_word" >&5
+echo "configure:3601: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3641,7 +3630,7 @@ if test -z "$ac_cv_prog_AR" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3645: checking for $ac_word" >&5
+echo "configure:3634: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3680,7 +3669,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3684: checking for $ac_word" >&5
+echo "configure:3673: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3713,7 +3702,7 @@ if test -z "$ac_cv_prog_AS" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3717: checking for $ac_word" >&5
+echo "configure:3706: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3752,7 +3741,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3756: checking for $ac_word" >&5
+echo "configure:3745: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3785,7 +3774,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3789: checking for $ac_word" >&5
+echo "configure:3778: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3824,7 +3813,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3828: checking for $ac_word" >&5
+echo "configure:3817: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3857,7 +3846,7 @@ if test -z "$ac_cv_prog_LD" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3861: checking for $ac_word" >&5
+echo "configure:3850: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3896,7 +3885,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3900: checking for $ac_word" >&5
+echo "configure:3889: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3929,7 +3918,7 @@ if test -z "$ac_cv_prog_NM" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3933: checking for $ac_word" >&5
+echo "configure:3922: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3968,7 +3957,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3972: checking for $ac_word" >&5
+echo "configure:3961: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4001,7 +3990,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4005: checking for $ac_word" >&5
+echo "configure:3994: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4040,7 +4029,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4044: checking for $ac_word" >&5
+echo "configure:4033: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4073,7 +4062,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4077: checking for $ac_word" >&5
+echo "configure:4066: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4112,7 +4101,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4116: checking for $ac_word" >&5
+echo "configure:4105: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4145,7 +4134,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
# Extract the first word of "objcopy", so it can be a program name with args.
set dummy objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4149: checking for $ac_word" >&5
+echo "configure:4138: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4184,7 +4173,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4188: checking for $ac_word" >&5
+echo "configure:4177: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4217,7 +4206,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4221: checking for $ac_word" >&5
+echo "configure:4210: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4263,7 +4252,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4267: checking for $ac_word" >&5
+echo "configure:4256: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4296,7 +4285,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AR_FOR_TARGET" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4300: checking for $ac_word" >&5
+echo "configure:4289: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4335,7 +4324,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4339: checking for $ac_word" >&5
+echo "configure:4328: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4368,7 +4357,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AS_FOR_TARGET" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4372: checking for $ac_word" >&5
+echo "configure:4361: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4407,7 +4396,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4411: checking for $ac_word" >&5
+echo "configure:4400: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4440,7 +4429,7 @@ if test -z "$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4444: checking for $ac_word" >&5
+echo "configure:4433: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4479,7 +4468,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4483: checking for $ac_word" >&5
+echo "configure:4472: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4512,7 +4501,7 @@ if test -z "$ac_cv_prog_CONFIGURED_LD_FOR_TARGET" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4516: checking for $ac_word" >&5
+echo "configure:4505: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4551,7 +4540,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4555: checking for $ac_word" >&5
+echo "configure:4544: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4584,7 +4573,7 @@ if test -z "$ac_cv_prog_CONFIGURED_NM_FOR_TARGET" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4588: checking for $ac_word" >&5
+echo "configure:4577: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4623,7 +4612,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4627: checking for $ac_word" >&5
+echo "configure:4616: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4656,7 +4645,7 @@ if test -z "$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4660: checking for $ac_word" >&5
+echo "configure:4649: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4695,7 +4684,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4699: checking for $ac_word" >&5
+echo "configure:4688: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4728,7 +4717,7 @@ if test -z "$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4732: checking for $ac_word" >&5
+echo "configure:4721: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4813,7 +4802,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4817: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4806: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
@@ -4860,7 +4849,7 @@ esac
# gcc for stageN-gcc and stagePREV-gcc for stage(N-1). In case this is not
# possible, however, we can resort to mv.
echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6
-echo "configure:4864: checking if symbolic links between directories work" >&5
+echo "configure:4853: checking if symbolic links between directories work" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4994,15 +4983,34 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+t quote
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
# Without the "./", some shells look in PATH for config.status.
diff --git a/configure.in b/configure.in
index e5068f22f48..9ec9dc94201 100644
--- a/configure.in
+++ b/configure.in
@@ -308,9 +308,6 @@ case "${host}" in
powerpc-*-beos*)
noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
;;
- *-*-darwin*)
- noconfigdirs="$noconfigdirs tk itcl libgui"
- ;;
esac
@@ -753,6 +750,9 @@ case "${target}" in
use_gnu_ld=no
fi
;;
+ sparc-*-solaris2.[[0-6]] | sparc-*-solaris2.[[0-6]].*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;;
v810-*-*)
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 9262818e9fd..03b55917f10 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-23 James E Wilson <wilson@specifixinc.com>
+
+ * Makefile.in (full-stamp, test-stamp, $(AF)): Add $(CFLAGS) to link.
+
2004-12-13 Andrew Pinski <pinskia@physics.uc.edu>
PR 18458
diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in
index b60665bc4bf..1383ef61b61 100644
--- a/fixincludes/Makefile.in
+++ b/fixincludes/Makefile.in
@@ -102,15 +102,15 @@ oneprocess : full-stamp
twoprocess : test-stamp $(AF)
full-stamp : $(ALLOBJ) $(LIBIBERTY)
- $(CC) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBIBERTY)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBIBERTY)
$(STAMP) $@
test-stamp : $(TESTOBJ) $(LIBIBERTY)
- $(CC) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBIBERTY)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBIBERTY)
$(STAMP) $@
$(AF): $(FIXOBJ) $(LIBIBERTY)
- $(CC) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBIBERTY)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBIBERTY)
$(ALLOBJ) : $(HDR)
fixincl.o : fixincl.c $(srcdir)/fixincl.x
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e02434e999d..4b0fee53f4d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,1702 @@
+2005-02-26 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/20188
+ * tree-ssa-alias.c (count_uses_and_derefs): If we have TREE_LIST
+ for the lhs, also walk over the tree. Likewise for rhs.
+
+2005-02-26 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-ssa-dom.c (simple_iv_increment_p): New function.
+ (simplify_rhs_and_lookup_avail_expr, eliminate_redundant_computations):
+ Do not propagate value of iv before increment over the increment.
+
+2005-02-25 Joseph S. Myers <joseph@codesourcery.com>
+
+ * c-parser.c: New file.
+ * c-parse.in: Remove.
+ * Makefile.in (c-parse.o-warn, c-parse.o, c-parse.c, c-parse.y):
+ Remove.
+ (c-parser.o): Add dependencies.
+ (C_AND_OBJC_OBJC, C_OBJS, gcc.srcextra, GTFILES, distclean,
+ maintainer-clean, TAGS): Update.
+ * c-config-lang.in (gtfiles): Update.
+ * gengtype-lex.l: Don't handle "@@".
+ * stub-objc.c (objc_get_class_ivars, objc_build_throw_stmt,
+ objc_build_synchronized, objc_begin_try_stmt,
+ objc_begin_catch_clause, objc_finish_catch_clause,
+ objc_build_finally_clause, objc_finish_try_stmt): New.
+ * c-tree.h (struct c_declspecs): Add declspecs_seen_p and
+ type_seen_p.
+ (c_parse_init): Update comment.
+ * c-decl.c (c_init_decl_processing): Update comment.
+ (build_null_declspecs, declspecs_add_qual, declspecs_add_type,
+ declspecs_add_scspec, declspecs_add_attrs): Initialize and update
+ new c_declspecs members.
+
+2005-02-25 Julian Brown <julian@codesourcery.com>
+
+ * config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK
+ from being used for symbols with vague linkage when
+ HAVE_GAS_COMDAT_GROUP is true.
+
+2005-02-25 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/include/gcc-common.texi (version-GCC): Update to 4.1.
+
+2005-02-25 Steve Ellcey <sje@cup.hp.com>
+
+ PR target/19930
+ * doc/tm.texi (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Document.
+ (LIBGCC2_HAS_DF_MODE): New.
+ (LIBGCC2_HAS_XF_MODE): New.
+ (LIBGCC2_HAS_TF_MODE): New.
+ * libgcc2.h (LIBGCC2_HAS_XF_MODE): New name for HAVE_XFMODE.
+ (LIBGCC2_HAS_TF_MODE): New name for HAVE_TFMODE.
+ * libgcc2.c (LIBGCC2_HAS_XF_MODE): New name for HAVE_XFMODE.
+ (LIBGCC2_HAS_TF_MODE): New name for HAVE_TFMODE.
+ (LIBGCC2_HAS_DF_MODE): New name for HAVE_DFMODE.
+ * config/ia64/t-ia64 (LIB1ASMFUNCS): Remove __compat
+ and add _fixtfdi, _fixunstfdi, _floatditf
+ * lib1funcs.asm: Remove L__compat. Add L_fixtfdi,
+ L_fixunstfdi, L_floatditf.
+ * config/ia64/hpux.h (LIBGCC2_HAS_XF_MODE): Define.
+ (LIBGCC2_HAS_TF_MODE): Define.
+
+2005-02-25 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/20204
+ * tree-into-ssa.c (insert_phi_nodes_for): Do not use
+ REWRITE_THIS_STMT markers on PHI nodes.
+ (rewrite_initialize_block): Likewise.
+
+2005-02-25 Mark Mitchell <mark@codesourcery.com>
+
+ * version.c (version_string): Update to 4.1.
+
+2005-02-25 Paolo Carlini <pcarlini@suse.de>
+
+ * doc/extend.texi (5.24 Declaring Attributes of Functions)<noreturn>:
+ Clarify that the alternative way doesn't work in GNU C++.
+
+2005-02-25 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/19937
+ * tree-ssa-loop-ivopts.c (rewrite_use_compare): Cast the final value
+ to the type of the induction variable.
+
+2005-02-25 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR rtl-optimization/20117
+ * bb-reorder.c (duplicate_computed_gotos): Don't duplicate
+ the block including noncopyable insn.
+
+2005-02-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cse.c (delete_trivially_dead_insns): Speed up by minimizing
+ calls to find_reg_note.
+
+2005-02-24 Richard Henderson <rth@redhat.com>
+
+ PR tree-opt/20127
+ * tree-sra.c (instantiate_element): Copy TREE_THIS_VOLATILE from
+ the type.
+
+2005-02-24 Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Check for
+ vector types if to use base reg for misaligned non-word ld/std.
+
+2005-02-24 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/14619
+ * config/cris/cris.c (cris_target_asm_function_prologue): Create
+ dwarf2 label manually and put it after, not before the prologue.
+
+2005-02-24 David Edelsohn <edelsohn@gnu.org>
+
+ PR target/19019
+ * reload.c (operands_match_p): Only increment register number for
+ SCALAR_INT_MODE_P modes in multiple hard registers.
+
+ * config/rs6000/rs6000.md (trunctfdf2): Remove register constraints.
+ Fix formatting.
+
+2005-02-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * ChangeLog.5: Fix log message typo(s).
+ * ChangeLog.7: Likewise.
+ * ChangeLog.tree-ssa: Likewise.
+ * cfgexpand.c: Fix comment typo(s).
+ * conflict.c: Likewise.
+ * defaults.h: Likewise.
+ * dwarf2out.c: Likewise.
+ * gcse.c: Likewise.
+ * ggc-page.c: Likewise.
+ * tree-eh.c: Likewise.
+ * tree-ssa-dom.c: Likewise.
+
+2005-02-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/19019
+ * mklibgcc.in: Pass -DSHARED when compiling all *_s${objext} objects.
+ * config/rs6000/darwin-ldouble.c: Only use the .symver directives
+ if SHARED is defined.
+
+ PR target/20196
+ * config/rs6000/rs6000.md (LTU, GTU sCC splitters): Add earlyclobber,
+ allow splitting only if operands 0 and 3 don't overlap.
+
+2005-02-24 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/19953
+ * builtins.c (fold_builtin_complex_mul, fold_builtin_complex_div): New.
+ (fold_builtin_1): Call them.
+ * fold-const.c (fold_complex_mult_parts): Split out from ...
+ (fold_complex_mult): ... here. Fix typo in both imaginary case.
+ (fold_complex_div_parts, fold_complex_div): New.
+ (fold): Use them.
+ * tree.h (fold_complex_mult_parts, fold_complex_div_parts): Declare.
+
+2005-02-24 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * tree-ssa-ccp.c (visit_assignment): Verify that result of
+ VIEW_CONVERT_EXPR is_gimple_min_invariant.
+
+ * print-tree.c (print_node_brief): Print LABEL_DECL_UID.
+ (print_node): Likewise.
+ Print TYPE_SIZES_GIMPLIFIED.
+
+2005-02-24 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/cris.md ("umulhisi3", "umulqihi3", "mulsi3")
+ ("mulqihi3", "mulhisi3", "mulsidi3", "umulsidi3"): Mark input
+ operands as commutative in constraints.
+
+2005-02-24 Diego Novillo <dnovillo@redhat.com>
+
+ * tree-into-ssa.c: Re-organize internal functions.
+
+2005-02-24 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/18902
+ * c-opts.c (c_common_post_options): Set flag_complex_method to 2
+ for c99.
+ * common.opt (fcx-limited-range): New.
+ * opts.c (set_fast_math_flags): Set flag_cx_limited_range.
+ * toplev.c (flag_complex_method): Initialize to 1.
+ (process_options): Set flag_complex_method to 0 if
+ flag_cx_limited_range.
+ * doc/invoke.texi (-fcx-limited-range): New.
+
+2005-02-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cse.c (delete_trivially_dead_insns): Speed up by using
+ NEXT_INSN and PREV_INSN directly instead of next_real_insn and
+ prev_real_insn.
+
+2005-02-24 Andrea Tarani <andrea.tarani@gilbarco.com>
+
+ * config/m68k/m68k.c (m68k_save_reg): Also save A5 for non-leaf
+ functions when -mid-shared-library is being used.
+
+2005-02-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * doc/tm.texi (LINK_LIBGCC_SPECIAL): Remove.
+ (LINK_LIBGCC_SPECIAL_1): Don't mention it.
+ * gcc.c: Don't check for LINK_LIBGCC_SPECIAL.
+ * system.h: Poison LINK_LIBGCC_SPECIAL.
+
+2005-02-23 James E Wilson <wilson@specifixinc.com>
+
+ * gengtype.c (note_insn_name): Make 1 element larger.
+
+2005-02-23 Roger Sayle <roger@eyesopen.com>
+
+ PR target/20018
+ PR rtl-optimization/20097
+ * simplify-rtx.c (simplify_relational_operation_1): Avoid creating
+ BImode SUBREGs of SImode registers which confuse the ia64 backend.
+
+2005-02-23 David Edelsohn <edelsohn@gnu.org>
+
+ * t-aix43 (SHLIB_INSTALL): Create directory for shared library.
+ * t-aix52 (SHLIB_INSTALL): Same.
+
+2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * genpreds.c: Update copyright.
+
+2005-02-23 Michael Beach <michaelb@ieee.org>
+
+ PR target/20159
+ * config/sparc/t-elf (startup files): Assemble with CPP.
+
+2005-02-23 Paolo Bonzini <bonzini@gnu.org>
+
+ * genpreds.c (mark_mode_tests): Handle non-VOIDmode match_operands.
+ (write_predicate_expr): Likewise.
+
+2005-02-22 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/20100
+ PR tree-optimization/20115
+ * tree-optimize.c (init_tree_optimization_passes): Remove
+ pass_maybe_create_global_var.
+ * tree-pass.h (pass_maybe_create_global_var): Remove.
+ * tree-ssa-alias.c (aliases_computed_p): Declare.
+ (struct alias_info): Add field NUM_PURE_CONST_CALLS_FOUND.
+ (count_calls_and_maybe_create_global_var): Remove.
+ (pass_maybe_create_global_var): Remove.
+ (init_alias_info): Do not declare aliases_computed_p.
+ (maybe_create_global_var): If the function contains no
+ call-clobbered variables and a mix of pure/const and regular
+ function calls, create .GLOBAL_VAR.
+ Mark all call-clobbered variables for renaming.
+ (merge_pointed_to_info): Update comment.
+ (add_pointed_to_var): Likewise.
+ (is_escape_site): Likewise.
+ Accept struct alias_info * instead of size_t *.
+ Update all users.
+ Update AI->NUM_CALLS_FOUND and AI->NUM_PURE_CONST_CALLS_FOUND
+ as necessary.
+ * tree-ssa-operands.c (get_call_expr_operands): If
+ ALIASES_COMPUTED_P is false, do not add call-clobbering
+ operands.
+ * tree-ssa.c (init_tree_ssa): Set ALIASES_COMPUTED_P to false.
+ (delete_tree_ssa): Likewise.
+
+2005-02-22 James E Wilson <wilson@specifixinc.com>
+
+ * toplev.c (backend_init): Don't call init_adjust_machine_modes here.
+ (do_compile): Do call it here.
+
+2005-02-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR rtl-optimization/20017.
+ * passes.c (rest_of_handle_combine, rest_of_handle_cse,
+ rest_of_handle_cse2, rest_of_handle_gcse): Call
+ delete_dead_jumptables immediately before calling cleanup_cfg.
+
+2005-02-22 Devang Patel <dpatel@apple.com>
+
+ PR 19952
+ * tree-if-conv.c (process_phi_nodes): Use bsi_after_labels and skip
+ all labels
+
+2005-02-22 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/aix.h (WINT_TYPE): Define.
+
+2005-02-22 Stan Shebs <shebs@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Default to
+ natural alignment for 64-bit Darwin.
+ (rs6000_parse_alignment_option): Warn about uses of -malign-power
+ on 64-bit Darwin.
+ * doc/invoke.texi: Document this.
+
+2005-02-22 DJ Delorie <dj@redhat.com>
+
+ * c-common.c (c_common_type_for_mode): Pass the mode's precision
+ to make_[un]signed_type, not the mode itself.
+
+2005-02-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cfg.c (cached_make_edge): Call make_edge if edge cache is
+ not available. Use tail calls wherever possible.
+ (make_edge): Call unchecked_make_edge to create an edge.
+
+ * tree-outof-ssa.c (SSANORM_USE_COALESCE_LIST): Remove.
+ (coalesce_ssa_name): Don't check for
+ SSANORM_USE_COALESCE_LIST.
+ (rewrite_out_of_ssa): Don't use SSANORM_USE_COALESCE_LIST.
+
+2005-02-22 Diego Novillo <dnovillo@redhat.com>
+
+ * tree-into-ssa.c (rewrite_blocks): Move debug dumps from ...
+ (rewrite_into_ssa): ... here.
+
+2005-02-21 Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/19786
+ * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Add one
+ tag to another's may-alias bitmap when adding to the other's list.
+
+2005-02-21 DJ Delorie <dj@redhat.com>
+
+ * tree-ssa-loop-ivopts.c (computation_cost): Start register
+ numbering at LAST_VIRTUAL_REGISTER+1 to avoid possibly using hard
+ registers in unsupported ways.
+ * expmed.c (init_expmed): Likewise.
+
+2005-02-21 Stan Cox <scox@redhat.com>
+
+ * config/iq2000/iq2000.h (DWARF_FRAME_RETURN_COLUMN): Change to 31.
+
+2005-02-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * tree-cfg.c (fold_cond_expr_cond): New.
+ (make_edges): Call fold_cond_expr_cond.
+ (find_taken_edge): Accept nothing but INTEGER_CST.
+ (find_taken_edge_cond_expr): Reject INTEGER_CST other than 0
+ and 1.
+ (find_taken_edge_switch_expr): Remove a check for INTEGER_CST.
+
+ * flow.c (delete_dead_jumptables): Speed up by scanning insns
+ that do not belong to any basic block.
+
+2005-02-21 Jeff Law <law@redhat.com>
+
+ * cfganal.c (find_unreachable_blocks): Manually CSE load of
+ e->dest.
+
+2005-02-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * tree-outof-ssa.c (SSANORM_REMOVE_ALL_PHIS): Remove.
+ (SSANORM_COALESCE_PARTITIONS, SSANORM_USE_COALESCE_LIST):
+ Adjust their definitions.
+ (remove_ssa_form): Don't check for SSANORM_REMOVE_ALL_PHIS.
+ (rewrite_out_of_ssa): Don't use SSANORM_REMOVE_ALL_PHIS.
+
+ * c-objc-common.h, c-pretty-print.c, cgraphunit.c, except.c,
+ genautomata.c, langhooks.c, langhooks.h, system.h,
+ config/arm/lib1funcs.asm: Update copyright.
+
+2005-02-21 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * dbxout.c (dbxout_function_end): Emit Lscope label always.
+
+2005-02-21 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR bootstrap/13770
+ * doc/install.texi: Document --with-gc.
+
+2005-02-21 Paolo Bonzini <bonzini@gnu.org>
+
+ * simplify-rtx.c (simplify_unary_operation): Add a missing
+ "break" statement.
+
+2005-02-21 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR tree-optimization/18663
+ * tree-ssa-dom.c (extract_range_from_cond): Return 0
+ if the type has variable bounds.
+
+2005-02-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcse.c: Remove an obsolete comment.
+
+ * cse.c (init_cse_reg_info): Use xmalloc instead of xrealloc.
+
+2005-02-20 Hans-Peter Nilsson <hp@axis.com>
+
+ * doc/extend.texi (Function Attributes) <Attribute const>: The
+ attribute "pure" is below this text, not above.
+
+2005-02-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (pa_assemble_integer, get_plabel): Small cleanups.
+ (pa_asm_output_mi_thunk): Use asm_output_insn instead of fprintf.
+ * som.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Small cleanup.
+
+2005-02-20 Zack Weinberg <zack@codesourcery.com>
+
+ PR 18785
+ * langhooks.h (struct lang_hooks): Add to_target_charset.
+ * langhooks.c (lhd_to_target_charset): New function.
+ * langhooks-def.h: Declare lhd_to_target_charset.
+ (LANG_HOOKS_TO_TARGET_CHARSET): New macro.
+ (LANG_HOOKS_INITIALIZER): Update.
+ * c-common.c (c_common_to_target_charset): New function.
+ * c-common.h: Declare it.
+ * c-objc-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
+ c_common_to_target_charset.
+
+ * defaults.c (TARGET_BELL, TARGET_BS, TARGET_CR, TARGET_DIGIT0)
+ (TARGET_ESC, TARGET_FF, TARGET_NEWLINE, TARGET_TAB, TARGET_VT):
+ Delete definitions.
+ * system.h: Poison them.
+ * doc/tm.texi: Don't discuss them.
+ * builtins.c (fold_builtin_isdigit): Use lang_hooks.to_target_charset.
+ * c-pretty-print.c (pp_c_integer_constant): Don't use pp_c_char.
+ (pp_c_char): Do not attempt to generate letter escapes for
+ newline, tab, etc.
+ * config/arm/arm.c (output_ascii_pseudo_op): Likewise.
+ * config/mips/mips.c (mips_output_ascii): Likewise.
+
+2005-02-20 Dorit Naishlos <dorit@il.ibm.com>
+
+ PR tree-optimization/19951
+ * tree-vect-analyze.c (vect_analyze_loop_form): Check if loop exit edge
+ is abnormal.
+
+2005-02-19 Steven Bosscher <stevenb@suse.de>
+
+ PR middle-end/19698
+ * function.h (struct function): New field `max_loop_depth'.
+ * cfgloop.c (establish_preds): Update maximum loop depth seen so far.
+ (flow_loops_find): Reset the max loop depth count before finding loops.
+ * flow.c (MAX_LIVENESS_ROUNDS): New constant.
+ (update_life_info_in_dirty_blocks): Remove 2002-05-28 workaround.
+ (calculate_global_regs_live): Make sure the loop will terminate
+ when the initial sets are not empty.
+
+2005-02-19 Zack Weinberg <zack@codesourcery.com>
+
+ * mklibgcc.in: If libgcc_eh.a would be empty, put a dummy
+ object inside.
+ * config/ia64/hpux.h: Don't define LIBGCC_SPEC.
+
+2005-02-19 Richard Sandiford <rsandifo@redhat.com>
+
+ PR other/19525
+ * doc/invoke.texi: Remove documentation of %M spec.
+ * gcc.c: Likewise.
+ (init_spec): Remove %M suffix from -lgcc_s.
+ (do_spec_1): Remove 'M' case.
+ * mklibgcc.in: Remove SHLIB_MULTILIB handling. Expect SHLIB_LINK
+ to put shared libraries in the multilib directory. Remove the
+ shlib_so_soname substitution variable. Don't add a multilib encoding
+ to shlib_base_name. Set shlib_slibdir_qual to the full pathname
+ reported by -print-multi-os-directory. Pass @multilib_dir@ to
+ SHLIB_INSTALL as well as SHLIB_LINK.
+ * config/t-slibgcc-elf-ver (SHLIB_SONAME): Use @shlib_base_name@.
+ (SHLIB_NAME): Delete.
+ (SHLIB_DIR): New macro.
+ (SHLIB_LINK): Put $(SHLIB_SONAME) and $(SHLIB_SOLINK) in $(SHLIB_DIR).
+ (SHLIB_INSTALL): Adjust accordingly.
+ * config/t-slibgcc-darwin: As for t-slibgcc-elf-ver.
+ * config/t-slibgcc-sld: Likewise.
+ * config/t-libunwind-elf (SHLIBUNWIND_NAME): Delete.
+ (SHLIBUNWIND_SONAME): Use @shlib_base_name@.
+ (SHLIBUNWIND_LINK): Put $(SHLIBUNWIND_SONAME) and $(SHLIB_SOLINK)
+ in $(SHLIB_DIR).
+ (SHLIBUNWIND_INSTALL): Adjust accordingly.
+ * config/i386/t-nwld (SHLIB_SONAME): Delete.
+ (SHLIB_LINK, SHLIB_INSTALL): Use SHLIB_NAME instead of SHLIB_SONAME.
+ Use @shlib_base_name@ instead of @shlib_so_name@.
+ * config/ia64/t-hpux (SHLIB_LINK): Put @shlib_base_name@.so.0
+ and @shlib_base_name@.so in @multilib_dir@.
+ (SHLIB_INSTALL): Adjust accordingly. Add @shlib_slibdir_qual@
+ to the install path.
+ * config/mips/t-slibgcc-irix: As for t-slibgcc-elf-ver.
+ (SHLIB_LINK): Remove previous workaround.
+ * config/pa/t-hpux-shlib (SHLIB_DIR, SHLIB_SLIBDIR_QUAL): New macros.
+ (SHLIB_LINK): Put $(SHLIB_SONAME) and $(SHLIB_NAME) in $(SHLIB_DIR).
+ (SHLIB_INSTALL): Adjust accordingly. Add $(SHLIB_SLIBDIR_QUAL) to
+ the install path.
+ * config/rs6000/t-aix43 (SHLIB_LINK): Put @shlib_base_name@.a in
+ @multilib_dir@. Use @multilib_dir@ to check for threading libraries.
+ (SHLIB_INSTALL): Adjust accordingly.
+ (SHLIB_LIBS): Use @multilib_dir@ to check for threading libraries.
+ * config/rs6000/t-aix52: As for config/rs6000/t-aix43.
+ * config/sh/t-linux (SHLIB_LINK, SHLIB_INSTALL): As for
+ config/t-slibgcc-elf-ver.
+
+2005-02-19 Zdenek Dvorak <dvorakz@suse.cz>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/19828
+ * tree-ssa-loop-im.c: Add a TODO comment.
+ (movement_possibility): Return MOVE_PRESERVE_EXECUTION for calls
+ without side-effects.
+
+2005-02-18 James A. Morrison <phython@gcc.gnu.org>
+
+ * tree-ssa-ccp.c (widen_bitfield): Pass type to build_int_cst and don't
+ call fold_convert.
+
+2005-02-18 James E. Wilson <wilson@specifixinc.com>
+
+ * doc/invoke.texi (IA-64 Options): Delete -mb-step.
+ * config/ia64/ia64.c (last_group, group_idx): Delete variables.
+ (errata_find_address_regs, errata_emit_nops, fixup_errata): Delete
+ functions.
+ (ia64_reorg): Delete fixup_errata call.
+ * config/ia64/ia64.h (MASK_B_STEP, TARGET_B_STEP): Delete.
+ (TARGET_SWITCHES): Delete -mb-step entry.
+
+2005-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/20043
+ * c-typeck.c (composite_type): Handle quals in transparent unions.
+ (type_lists_compatible_p): Likewise.
+
+2005-02-18 Stan Shebs <shebs@apple.com>
+
+ * config/darwin.c (machopic_select_rtx_section): Don't put relocatable
+ expressions in the .literal8 section.
+
+2005-02-18 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/darwin-tramp.asm: Remove stray 'APPLE LOCAL' marker.
+
+2005-02-18 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (constant_boolean_node): Always create values of the
+ specified type, don't bother calling truthvalue_conversion.
+
+2005-02-18 Joseph S. Myers <joseph@codesourcery.com>
+
+ * except.c (output_function_exception_table): Call
+ assemble_external_libcall (eh_personality_libfunc).
+
+2005-02-18 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR target/19886
+ * config/ia64/ia64.h (struct machine_function): Add state_num.
+ * config/ia64/ia64.c (process_epilogue,
+ process_for_unwind_directive): Use new unwind state numbers each
+ time rather than state 1.
+
+2005-02-18 Ulrich Weigand <uweigand@de.ibm.com>
+
+ PR target/20054
+ * config/s390/s390.md ("*llgt_sidi", "*llgt_sidi_split"): Move to
+ before the "*llgt_didi" pattern.
+
+2005-02-18 Jason Merrill <jason@redhat.com>
+
+ * gimplify.c (gimplify_modify_expr_rhs) [CALL_EXPR]: Revert again.
+
+2005-02-18 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm/lib1funcs.asm (FUNC_ALIAS): New macro.
+ (div0): Use it in place of ARM_FUNC_ALIAS.
+ (lshrdi3, ashrdi3, ashlrdi3): Likewise.
+
+2005-02-18 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR middle-end/20030
+ * fold-const.c (fold_indirect_ref_1): Use the correct index for zero
+ access, the lower bound of the array type if it exists.
+
+2005-02-18 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/20008
+ * stmt.c (expand_case): Don't assume cleanup_tree_cfg will remove
+ cases that are out-of-range for the index type.
+
+2005-02-18 James A. Morrison <phython@gcc.gnu.org>
+
+ * stmt.c (emit_case_bit_tests): Call fold_convert instead of convert.
+ (estimate_case_costs): Don't call convert.
+ * expmed.c (expand_shift): Likewise.
+ (make_tree): Call fold_convert instead of convert.
+
+2005-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/19813
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Add assertion
+ that ref to be marked MEM_READONLY_P doesn't have base that needs
+ constructing.
+
+2005-02-18 Joseph S. Myers <joseph@codesourcery.com>
+
+ * genautomata.c (output_get_cpu_unit_code_func,
+ output_cpu_unit_reservation_p): Don't generate old-style function
+ definitions.
+
+2005-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/20023
+ PR tree-optimization/20009
+ * convert.c (convert_to_integer): Revert 2005-02-16 change.
+
+ PR tree-optimization/18947
+ * cgraphunit.c (cgraph_finalize_function): When redefining an extern
+ inline, remove all nodes that are inlined into the extern inline
+ being redefined.
+
+2005-02-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * bt-load.c, cfgloop.c, convert.c, dominance.c, global.c,
+ loop-invariant.c, stmt.c, tree-ssa-forwprop.c,
+ tree-ssa-live.c, tree-ssanames.c, tree-vn.c,
+ config/host-linux.c, config/arm/fpa.md, config/avr/avr.h:
+ Update copyright.
+
+2005-02-17 Roger Sayle <roger@eyesopen.com>
+
+ PR tree-optimization/19917
+ * tree-eh.c (tree_could_trap_p): Consider calls to weak functions
+ to be potentially trapping.
+
+2005-02-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * libgcc2.c, tree-vect-analyze.c: Fix comment typos.
+
+2005-02-17 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * builtins.c (expand_builtin_return_addr): Remove tem parameter.
+ tem becomes a local variable which is set to the value of the
+ back end defined INITIAL_FRAME_ADDRESS macro.
+ (expand_builtin_frame_address): Omit the base parameter to
+ expand_builtin_return_addr.
+ (expand_builtin_profile_func): Likewise.
+ * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Define new macro.
+ (DYNAMIC_CHAIN_ADDRESS): Remove the case for the initial frame.
+ * doc/tm.texi: Documentation for INITIAL_FRAME_ADDRESS_RTX added.
+
+2005-02-17 Jakub Jelinek <jakub@redhat.com>
+
+ * config/s390/s390.c (s390_alloc_pool, s390_free_pool,
+ s390_chunkify_start): Use BITMAP_ALLOC and BITMAP_FREE.
+ * config/frv/frv.c (frv_function_epilogue): Likewise.
+
+2005-02-17 Daniel Berlin <dberlin@dberlin.org>
+
+ * lambda-code (perfect_nestify): Remove mark/unmark
+ for rewriting hack.
+ * tree-loop-linear.c (linear_transform_loops): Add
+ rewrite_into_ssa call so that ssa is correct for
+ rewriting into loop closed.
+
+2005-02-17 Nathan Sidwell <nathan@codesourcery.com>
+
+ * bitmap.h (BITMAP_XMALLOC, BITMAP_XFREE): Remove.
+ * bb-reorder.c (duplicate_computed_gotos): Use BITMAP_ALLOC and
+ BITMAP_FREE.
+ * bt-load.c (btr_def_live_range, combine_btr_defs,
+ migrate_btr_def, migrate_btr_defs): Likewise.
+ * cfgcleanup.c (thread_jump): Likewise.
+ * cfgloop.c (get_loop_body_in_bfs_order): Likewise.
+ * df.c (df_insn_table_realloc, df_bitmaps_alloc, df_bitmaps_free,
+ df_alloc, df_free, df_du_chain_create, df_bb_rd_local_compute,
+ df_rd_local_compute, df_reg_info_compute): Likewise.
+ * dominance.c (init_dom_info, free_dom_info): Likewise.
+ * flow.c (init_propagate_block_info,
+ free_propagate_block_info): Likewise.
+ * gcse.c (alloc_gcse_mem, free_gcse_mem): Likewise.
+ * global.c (allocate_bb_info, free_bb_info, calculate_reg_pav,
+ modify_reg_pav): Likewise.
+ * loop-invariant.c (find_defs, find_invariant_insn,
+ find_invariants, free_inv_motion_data): Likewise.
+ * predict.c (tree_predict_by_opcode,
+ estimate_bb_frequencies): Likewise.
+ * stmt.c (expand_case): Likewise.
+ * tree-cfg.c (tree_duplicate_sese_region): Likewise.
+ * tree-dfa.c (mark_new_vars_to_rename): Likewise.
+ * tree-if-conv.c (get_loop_body_in_if_conv_order): Likewise.
+ * tree-into-ssa.c (insert_phi_nodes_for, def_blocks_free,
+ get_def_blocks_for, mark_def_site_blocks, rewrite_into_ssa,
+ rewrite_ssa_into_ssa): Likewise.
+ * tree-optimize.c (tree_rest_of_compilation): Likewise.
+ * tree-outof-ssa.c (new_temp_expr_table, free_temp_expr_table,
+ analyze_edges_for_bb, perform_edge_inserts): Likewise.
+ * tree-scalar-evolution.c (scev_initialize, scev_finalize): Likewise.
+ * tree-sra.c (tree_sra): Likewise.
+ * tree-ssa-alias.c (init_alias_info, delete_alias_info): Likewise.
+ * tree-ssa-ccp.c (ccp_fold_builtin): Likewise.
+ * tree-ssa-dce.c (tree_dce_init, tree_dce_done): Likewise.
+ * tree-ssa-dom.c (tree_ssa_dominator_optimize): Likewise.
+ * tree-ssa-dse.c (tree_ssa_dse): Likewise.
+ * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_var):
+ Likewise.
+ * tree-ssa-live.c (new_tree_live_info, delete_tree_live_info,
+ calculate_live_on_entry, calculate_live_on_exit,
+ build_tree_conflict_graph): Likewise.
+ * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_init, record_use,
+ record_important_candidates, set_use_iv_cost, find_depends,
+ determine_use_iv_costs, iv_ca_new, iv_ca_free, free_loop_data,
+ tree_ssa_iv_optimize_finalize): Likewise.
+ * tree-ssa-loop-manip.c (add_exit_phis_var, get_loops_exit,
+ find_uses_to_rename_use, rewrite_into_loop_closed_ssa,
+ tree_duplicate_loop_to_header_edge): Likewise.
+ * tree-ssa-pre.c (init_pre, fini_pre): Likewise.
+ * tree-ssa.c (verify_flow_insensitive_alias_info,
+ verify_name_tags, verify_ssa, init_tree_ssa,
+ delete_tree_ssa): Likewise.
+ * tree-ssanames.c (marked_ssa_names, init_ssanames,
+ fini_ssanames): Likewise.
+ * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): Likewise.
+
+2005-02-17 Ralf Corsepius <ralf.corsepius@rtems.org>
+
+ * config/rs6000/t-rtems: Completely reworked.
+
+2005-02-17 Ira Rosen <irar@il.ibm.com>
+
+ * tree-data-ref.c (array_base_name_differ_p): Remove gcc_assert.
+
+2005-02-17 Ira Rosen <irar@il.ibm.com>
+
+ * tree-vect-analyze.c (vect_analyze_pointer_ref_access): Use
+ POINTER_TYPE_P when checking that type is a pointer.
+ (vect_get_memtag): Remove.
+ (vect_address_analysis): Use POINTER_TYPE_P. Call
+ vect_object_analysis with dummy parameter for memtag.
+ (vect_object_analysis): Extract memtag (functionality that
+ used to be in vect_get_memtag and moved here). Fix printings.
+ (vect_analyze_data_refs): Fix comment. Call vect_object_analysis
+ with correct parameters. Remove call to vect_get_memtag.
+
+2005-02-17 Dorit Naishlos <dorit@il.ibm.com>
+
+ * Makefile.in (tree-vect-analyze.o, tree-vect-transform.o): New.
+ (tree-vectorizer.o): Added missing dependencies.
+
+ * tree-vectorizer.h (vect_dump, vect_verbosity_level): Added extern
+ decleration.
+ (slpeel_tree_peel_loop_to_edge): Function externalized (had a static
+ declaration in tree-vectorizer.c, now has an extern declaration in
+ tree-vectorizer.h).
+ (slpeel_make_loop_iterate_ntimes, slpeel_can_duplicate_loop_p,
+ slpeel_verify_cfg_after_peeling, vect_strip_conversion,
+ get_vectype_for_scalar_type, vect_is_simple_use,
+ vect_is_simple_iv_evolution, vect_can_force_dr_alignment_p,
+ vect_supportable_dr_alignment, new_loop_vec_info, destroy_loop_vec_info,
+ new_stmt_vec_info, vect_analyze_loop, vectorizable_load,
+ vectorizable_store, vectorizable_operation, vectorizable_assignment,
+ vect_transform_loop, vect_print_dump_info, vect_set_verbosity_level,
+ find_loop_location): Likewise.
+
+ * tree-vectorizer.c (langhooks.h): #include removed.
+ (slpeel_tree_peel_loop_to_edge): Function externalized. Declaration
+ moved to tree-vectorized.h.
+ (slpeel_make_loop_iterate_ntimes, slpeel_can_duplicate_loop_p,
+ slpeel_verify_cfg_after_peeling, vect_strip_conversion,
+ get_vectype_for_scalar_type, vect_is_simple_use,
+ vect_is_simple_iv_evolution, vect_can_force_dr_alignment_p,
+ vect_supportable_dr_alignment, new_loop_vec_info,
+ destroy_loop_vec_info, new_stmt_vec_info, vect_print_dump_info,
+ vect_set_verbosity_level, find_loop_location): Likewise.
+
+ (vect_analyze_loop): Function externalized. Declaration moved to
+ tree-vectorized.h. Function definition moved to tree-vect-analyze.c.
+ (vect_analyze_loop_form): Moved to tree-vect-analyze.c.
+ (vect_mark_stmts_to_be_vectorized, vect_analyze_scalar_cycles,
+ vect_analyze_data_ref_accesses, vect_analyze_data_ref_dependences,
+ vect_analyze_data_refs_alignment, vect_compute_data_refs_alignment,
+ vect_enhance_data_refs_alignment, vect_analyze_operations,
+ exist_non_indexing_operands_for_use_p, vect_mark_relevant,
+ vect_stmt_relevant_p, vect_get_loop_niters,
+ vect_analyze_data_ref_dependence, vect_compute_data_ref_alignment,
+ vect_analyze_data_ref_access, vect_analyze_pointer_ref_access,
+ vect_can_advance_ivs_p, vect_get_ptr_offset, vect_analyze_offset_expr,
+ vect_base_addr_differ_p, vect_object_analysis, vect_address_analysis,
+ vect_get_memtag): Likewise.
+
+ (vectorizable_load): Function externalized. Declaration moved to
+ tree-vectorized.h. Function definition moved to tree-vect-transform.c.
+ (vectorizable_store, vectorizable_operation, vectorizable_assignment,
+ vect_transform_loop): Likewise.
+ (vect_transform_stmt): Moved to tree-vect-transform.c.
+ (vect_align_data_ref, vect_create_destination_var,
+ vect_create_data_ref_ptr, vect_create_index_for_vector_ref,
+ vect_create_addr_base_for_vector_ref, vect_get_new_vect_var,
+ vect_get_vec_def_for_operand, vect_init_vector,
+ vect_finish_stmt_generation, vect_generate_tmps_on_preheader,
+ vect_build_loop_niters, vect_update_ivs_after_vectorizer,
+ vect_gen_niters_for_prolog_loop, vect_update_inits_of_dr,
+ vect_update_inits_of_drs, vect_do_peeling_for_alignment,
+ vect_do_peeling_for_loop_bound): Likewise.
+
+ * tree-vect-analyze.c: New file.
+ * tree-vect-transform.c: New file.
+
+2005-02-17 Jason Merrill <jason@redhat.com>
+
+ PR mudflap/19319, c++/19317
+ * gimplify.c (gimplify_modify_expr_rhs) [CALL_EXPR]: Make return
+ slot explicit.
+
+2005-02-17 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/install.texi (Specific): Update link for Darwin-specific
+ tool binary site.
+
+2005-02-16 James A. Morrison <phython@gcc.gnu.org>
+
+ * fold-const.c (invert_truthvalue): <INTEGER_CST>: Call
+ constant_boolean_node.
+
+2005-02-16 David Edelsohn <edelsohn@gnu.org>
+
+ PR target/19019
+ * config/rs6000/t-aix43 (SHLIB_MAPFILES): Add libgcc-ppc64.ver.
+ * config/rs6000/t-aix52 (SHLIB_MAPFILES): Same.
+
+2005-02-16 Richard Henderson <rth@redhat.com>
+
+ PR 19920
+ * libgcc2.c (WORD_SIZE): Remove all definitions; replace uses
+ with W_TYPE_SIZE.
+ (HIGH_WORD_COEFF, HIGH_HALFWORD_COEFF): Remove all definitions;
+ replace uses with Wtype_MAXp1_F.
+ (L_fixunstfdi, L_fixtfdi, L_floatditf, L_fixunsxfdi, L_fixxfdi,
+ L_floatdixf, L_fixunsxfsi, L_fixunsdfdi, L_floatdidf, L_fixunsdfsi,
+ L_powidf2, L_powixf2, L_powitf2, L_muldc3, L_divdc3, L_mulxc3,
+ L_divxc3, L_multc3, L_divtc3): Protect with HAVE_DFMODE, HAVE_XFMODE,
+ and HAVE_TFMODE as appropriate.
+ (__fixunssfDI): Provide an implementation that doesn't need DFmode.
+ (__floatdisf): Likewise.
+ * libgcc2.h (LIBGCC2_DOUBLE_TYPE_SIZE): New.
+ (HAVE_DFMODE, HAVE_XFMODE, HAVE_TFMODE): New.
+ (Wtype_MAXp1_F): New.
+ (DFtype, DCtype, __fixdfdi, __floatdidf, __fixunsdfSI, __fixunsdfDI,
+ __powidf2, __divdc3, __muldc3): Protect with HAVE_DFMODE.
+
+2005-02-16 Richard Earnshaw <rearnsha@arm.com>
+
+ * PR target/19162
+ * arm.c (arm_apply_result_size): New function.
+ * arm.h (APPLY_RESULT_SIZE): Define.
+ * arm-protos.h (arm_apply_result_size): Add prototype.
+ * arm.md (RO_REGNUM, FPA_F0_REGNUM, FPA_F7_REGNUM): New constants.
+ (movxf): New expand.
+ (ldmsi_postinc4_thumb, stmsi_postinc4_thumb): New patterns for Thumb.
+ (call_value_symbol): Remove predicate for operand 0.
+ (call_value_insn, sibcall_value, sibcall_value_insn): Likewise.
+ (untyped_call): Rework to correclty return values for any type.
+ (untyped_return): New expand.
+ * fpa.md (movxf_fpa): Simplify and use sfm/lfm when appropriate.
+
+2005-02-16 Stan Shebs <shebs@apple.com>
+
+ * config.gcc (powerpc-*-darwin*): Use fragment for Darwin 8 or later.
+ * config/rs6000/t-darwin8: New, for 64-bit multilib.
+
+2005-02-16 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/install.texi (sparc-sun-solaris2*): Document required GMP
+ configure settings on Solaris 7 and later.
+
+2005-02-16 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/19865
+ * tree-optimize.c (init_tree_optimization_passes): Run
+ pass_may_alias after pass_sra.
+
+2005-02-16 Richard Henderson <rth@redhat.com>
+ Stuart Hastings <stuart@apple.com>
+
+ PR debug/19521
+ * dbxout.c (dbxout_function_end): Take decl parameter; update callers.
+ Do nothing if debug info suppressed for this function.
+ (dbxout_begin_function): Early exit if debug info suppressed for
+ this function.
+
+2005-02-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/20007
+ * config/ip2k/ip2k.c (ip2k_reorg): Adjust calls to
+ find_basic_blocks.
+ * config/sh/sh.c (sh_output_mi_thunk): Likewise.
+
+ PR tree-optimization/19967
+ * builtins.c (expand_builtin_strstr, expand_builtin_strpbrk,
+ expand_builtin_strchr, expand_builtin_strrchr): Take a new
+ argument TYPE. Adjust calls to fold_builtin_XXX.
+ (expand_builtin, fold_builtin_1): Adjust calls to
+ expand_builtin_XXX.
+ (fold_builtin_strchr, fold_builtin_strpbrk,
+ fold_builtin_strstr, fold_builtin_strrchr): Convert the folded
+ result to a requested type TYPE.
+
+2005-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/19857
+ * fold-const.c (fold): Don't optimize (T)(x & cst) to
+ (T)x & (T)cst if (T)cst overflows.
+ * convert.c (convert_to_integer) <case POINTER_TYPE>: Pass
+ TYPE_UNSIGNED (type) as type_for_size's UNSIGNEDP argument.
+
+2005-02-15 Jeff Law <law@redhat.com>
+
+ * gcse.c (blocks_with_calls): New bitmap.
+ (alloc_gcse_mem): Allocate it.
+ (free_gcse_mem): Free it.
+ (clear_modifY_mem_tables): Clear it.
+ (record_last_mem_set_info): Set the proper bit in BLOCK_WITH_CALLS
+ when we encounter CALL_INSNs.
+ (compute_transp, case MEM): Handle blocks with calls separate
+ from blocks without calls. Use bitmap iterators rather than
+ FOR_EACH_BB.
+
+2005-02-15 Peter O'Gorman <peter@pogma.com>
+
+ PR bootstrap/18810
+ * mklibgcc.in (vis_hide): Use a temporary object file, not
+ -o /dev/null.
+
+2005-02-15 Andy Hutchinson <HutchinsonAndy@netscape.net>
+
+ PR target/19924
+ * config/avr/avr.h (MODES_TIEABLE_P): Define to 1 to allow subreg
+ access optimization.
+
+2005-02-15 David Edelsohn <edelsohn@gnu.org>
+ Alan Modra <amodra@bigpond.net.au>
+
+ PR target/19019
+ * config/rs6000/darwin-ldouble.c (_xlqadd): Rename to __gcc_qadd.
+ (_xlqsub): Rename to __gcc_qsub.
+ (_xlqmul): Rename to __gcc_qmul.
+ (_xlqdiv): Rename to __gcc_qdiv.
+ Provide versioned symbol aliases with old names.
+ * config/rs6000/libgcc-ppc64.ver: Rename symbols.
+ * config/rs6000/rs6000.c (rs6000_init_libfuncs): Rename symbols.
+ * config/rs6000/t-aix43 (LIB2FUNCS_EXTRA): New.
+ * config/rs6000/t-aix52 (LIB2FUNCS_EXTRA): New.
+ * config/rs6000/t-newas (LIB2FUNCS_EXTRA): New.
+
+2005-02-15 James A. Morrison <phython@gcc.gnu.org>
+
+ * fold-const.c (fold): Fold -(~A) to A + 1. Fold ~(-A) to A - 1.
+ Fold ~(A - 1) and ~(A + -1) to -A.
+
+2005-02-15 James A. Morrison <phython@gcc.gnu.org>
+
+ PR pch/14940
+ PR target/19300
+ * config/host-linux.c (linux_gt_pch_use_address): Copy from
+ config/pa/pa-host.c:pa_gt_pch_use_address.
+
+2005-02-15 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-vn.c (get_value_handle): Make sure that given an
+ is_gimple_min_invariant expression, we always return it.
+
+2005-02-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * passes.c (rest_of_handle_gcse): Fix a comment.
+
+2005-02-15 Jeff Law <law@redhat.com>
+
+ * gcse.c (canon_modify_mem_set_list_set): Kill unnecessary
+ bitmap.
+ (alloc_gcse_mem, free_gcse_mem): Corresponding changes.
+ (canon_list_insert, record_last_mem_set_info): Similarly.
+ (clear_modify_mem_tables): Similarly.
+
+2005-02-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * bitmap.c, bitmap.h, lambda-code.c, tree-dfa.c, tree-dump.c,
+ tree-dump.h, tree-ssa-loop-manip.c, value-prof.c,
+ config/mips/mips.md, config/rs6000/aix.h,
+ config/rs6000/beos.h, config/rs6000/sysv4.h: Update copyright.
+
+2005-02-15 Richard Henderson <rth@redhat.com>
+
+ * bb-reorder.c (find_traces_1_round): Force fallthru edge from a
+ call to be best_edge.
+
+2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * basic-block.h: Adjust the prototype for find_basic_blocks.
+ * cfgbuild.c (find_basic_blocks): Remove unused arguments.
+ * passes.c (rest_of_handle_loop_optimize): Adjust the call to
+ find_basic_blocks.
+
+ * flow.c (recompute_reg_usage): Remove all arguments.
+ * passes.c (rest_of_compilation): Adjust the call to
+ recompute_reg_usage.
+ * rtl.h: Adjust the prototype for recompute_reg_usage.
+
+2005-02-14 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-dump.c (dump_files): Update to reflect new member
+ of dump_file_info.
+ (dump_register): Add new argument.
+ Set glob name.
+ (dump_switch_p_1): Check against glob name if doglob was passed.
+ (dump_switch_p): Check against regular first, then glob if
+ we didn't have any hits on the dump name.
+ * tree-optimize.c (register_one_dump_file):
+ Pass in glob name as well.
+ * tree-pass.h (struct dump_file_info): Add glob
+ member.
+
+2005-02-14 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR preprocessor/16323
+ * doc/invoke.texi: Document that -Wendif-labels is on by default.
+
+2005-02-14 David Edelsohn <edelsohn@gnu.org>
+
+ PR target/19019
+ * config/rs6000/rs6000.md (trunctfdf2): Change to define_expand.
+ (trunctfdf2_internal1): New.
+ (trunctfdf2_internal2): Renamed from trunctfdf2.
+
+2005-02-14 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/19853
+ * tree-dfa.c (add_referenced_var): Always examine DECL_INITIAL.
+
+2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * passes.c (rest_of_handle_loop_optimize): Remove calls to
+ delete_dead_jumptables and cleanup_cfg.
+
+2005-02-14 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * reload.c (find_reloads): Swap address_reloaded flags when
+ swapping commutative operands.
+
+2005-02-14 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * lambda-code.c (lambda_loopnest_to_gcc_loopnest, perfect_nestify):
+ Use standard_iv_increment_position for computing the bsi position
+ for create_iv.
+ * tree-ssa-loop-manip.c (create_iv): Add a comment on how to compute
+ the bsi position.
+
+2005-02-13 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR target/17428
+ * cfgrtl.c (safe_insert_insn_on_edge): Avoid extending
+ life range of hard registers.
+ * value-prof.c (insn_prefetch_values_to_profile): Only
+ scan normal insns.
+
+ * value-prof.c (rtl_find_values_to_profile): Do not look for values to
+ profile in libcalls.
+
+2005-02-13 Nathan Sidwell <nathan@codesourcery.com>
+
+ * bitmap.h (bitmap_and_compl_into): Return bool.
+ * bitmap.c (bitmap_and_compl_into): Return changed flag.
+
+2005-02-13 James A. Morrison <phython@gcc.gnu.org>
+
+ PR tree-optimization/19944
+ * fold-const.c (fold): Re-add ABS_EXPR folding.
+
+2005-02-13 David Edelsohn <edelsohn@gnu.org>
+
+ PR target/19019
+ * config/rs6000/aix.h ({TARGET,MASK}_XL_CALL): Rename to
+ {TARGET,MASK}_XL_COMPAT.
+ (SUBTARGET_SWITCHES): Rename xl-call to xl-compat. Use
+ MASK_XL_COMPAT.
+ * config/rs6000/beos.h ({TARGET,MASK}_XL_CALL): Remove.
+ * config/rs6000/rs6000.c (function_arg): Change TARGET_XL_CALL to
+ TARGET_XL_COMPAT.
+ (rs6000_arg_partial_bytes): Same.
+ (rs6000_generate_compare): Generate PARALLEL for compare if TFmode
+ and XL compatibility enabled.
+ * config/rs6000/rs6000.h (TARGET_XL_CALL): Rename to TARGET_XL_COMPAT.
+ * config/rs6000/rs6000.md (cmptf_internal1): Add !TARGET_XL_COMPAT
+ test to final condition.
+ (cmptf_internal2): New.
+ * doc/invoke.texi (RS/6000 Subtarget Options): Change xl-call to
+ xl-compat. Add TFmode information to description.
+
+2005-02-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * flags.h, read-rtl.c, tree-ssa-live.h: Update copyright.
+
+2005-02-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/16405
+ * fold-const.c (fold_indirect_ref_1): Split out from...
+ (build_fold_indirect_ref): Here.
+ (fold_indirect_ref): New fn.
+ * tree.h: Declare it.
+ * gimplify.c (gimplify_compound_lval): Call fold_indirect_ref.
+ (gimplify_modify_expr_rhs): Likewise.
+ (gimplify_expr): Likewise.
+
+2005-02-13 James A. Morrison <phython@gcc.gnu.org>
+
+ PR tree-optimization/14303
+ PR tree-optimization/15784
+ * fold-const.c (fold): Fold ABS_EXPR<x> >= 0 to true, when possible.
+ Fold ABS_EXPR<x> < 0 to false. Fold ABS_EXPR<x> == 0 to x == 0 and
+ ABS_EXPR<x> != 0 to x != 0.
+
+2005-02-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * c-tree.h, combine.c, expmed.c, flow.c, libgcc2.c,
+ simplify-rtx.c, tree-ssa-live.h: Fix comment typos. Follow
+ spelling conventions.
+
+ * passes.c (rest_of_handle_gcse): Don't run cse_main and
+ delete_trivially_dead_insns too many times.
+
+ * passes.c (rest_of_handle_gcse): Remove dead assignments to
+ tem and tem2.
+
+2005-02-12 Ira Rosen <irar@il.ibm.com>
+
+ * tree-vectorizer.c (vect_get_base_and_offset): Remove.
+ (vect_is_simple_iv_evolution): Remove redundant parameter
+ and step check.
+ (vect_analyze_scalar_cycles): Call vect_is_simple_iv_evolution
+ without last parameter.
+ (vect_analyze_pointer_ref_access): Get access_fn as parameter.
+ Return pointer step. Call vect_is_simple_iv_evolution without
+ last parameter. Check only that the step is multiple of size
+ type. Remove stmt_vinfo updates.
+ (vect_get_memtag_and_dr): Remove.
+ (vect_get_memtag): New function.
+ (vect_address_analysis): New function.
+ (vect_object_analysis): New function.
+ (vect_analyze_data_refs): Call vect_object_analysis and
+ vect_get_memtag. Update stmt_vinfo fields.
+
+2005-02-12 Ira Rosen <irar@il.ibm.com>
+
+ * tree-data-ref.c (array_base_name_differ_p): Check that the bases
+ exist and are objects. Remove checks for pointer.
+ * tree-vectorizer.c (vect_create_addr_base_for_vector_ref): Use
+ STMT_VINFO_VECT_DR_BASE_ADDRESS instead of DR_BASE_NAME.
+ (vect_create_data_ref_ptr): Likewise.
+ (vect_base_addr_differ_p): New function.
+ (vect_analyze_data_ref_dependence): Call vect_base_addr_differ_p.
+ (vect_analyze_pointer_ref_access): Add output parameter - ptr_init.
+ Don't set the DR_BASE_NAME field of data-ref.
+ (vect_get_memtag_and_dr): Use ptr_init instead of DR_BASE_NAME.
+
+2005-02-12 Uros Bizjak <uros@kss-loka.si>
+
+ * optabs.h (enum optab_index): Add new OTI_ldexp.
+ (ldexp_optab): Define corresponding macro.
+ * optabs.c (init_optabs): Initialize ldexp_optab.
+ * genopinit.c (optabs): Implement ldexp_optab using ldexp?f3
+ patterns.
+ * builtins.c (expand_builtin_mathfn_2): Handle BUILT_IN_LDEXP{,F,L}
+ using ldexp_optab.
+ (expand_builtin): Expand BUILT_IN_LDEXP{,F,L} using
+ expand_builtin_mathfn_2 if flag_unsafe_math_optimizations is set.
+
+ * config/i386/i386.md (ldexpsf3, ldexpdf3, ldexpxf3): New expanders
+ to implement ldexpf, ldexp and ldexpl built-ins as inline x87
+ intrinsics.
+
+2005-02-12 Ira Rosen <irar@il.ibm.com>
+
+ * tree-vectorizer.h (struct _stmt_vec_info): Rename a field: base
+ to base_address.
+ * tree-vectorizer.c (new_stmt_vec_info): Rename the above field of
+ stmt_vec_info.
+ (vect_get_base_and_offset): Always return an address.
+ (vect_create_addr_base_for_vector_ref): Remove treatment for
+ different data reference types.
+ (vect_compute_data_ref_alignment): Rename base to base_address in
+ stmt_vec_info. Get the object in order to force its alignment.
+ (vect_get_memtag_and_dr): Rename base to base_address in
+ stmt_vec_info. Extract the object for memtag analysis.
+
+2005-02-12 Hans-Peter Nilsson <hp@axis.com>
+
+ PR regression/19898.
+ * config/cris/cris.c (cris_notice_update_cc): When testing if insn
+ changes cc_status, use apply modified_in_p to part of cc_status
+ and insn, not cris_reg_overlap_mentioned_p on SET_DEST of insn
+ body.
+
+2005-02-11 Richard Henderson <rth@redhat.com>
+
+ * tree-complex.c (expand_complex_libcall): New.
+ (expand_complex_multiplication): Use it for c99 compliance.
+ (expand_complex_division): Likewise.
+ * fold-const.c (fold_complex_add, fold_complex_mult): New.
+ (fold): Call them.
+ * builtins.c (built_in_names): Remove const.
+ * tree.c (build_common_builtin_nodes): Build complex arithmetic
+ builtins.
+ * tree.h (BUILT_IN_COMPLEX_MUL_MIN, BUILT_IN_COMPLEX_MUL_MAX): New.
+ (BUILT_IN_COMPLEX_DIV_MIN, BUILT_IN_COMPLEX_DIV_MAX): New.
+ (built_in_names): Remove const.
+ * c-common.c (c_common_type_for_mode): Handle complex modes.
+ * flags.h, toplev.c (flag_complex_method): Rename from
+ flag_complex_divide_method.
+ * libgcc2.c (__divsc3, __divdc3, __divxc3, __divtc3,
+ __mulsc3, __muldc3, __mulxc3, __multc3): New.
+ * libgcc2.h: Declare them.
+ * libgcc-std.ver: Export them.
+ * mklibgcc.in (lib2funcs): Build them.
+
+2005-02-11 Steven Bosscher <stevenb@suse.de>
+
+ PR tree-optimization/19876
+ Partially revert my change from 2005-01-14
+ * tree-ssa-pre.c (compute_antic_aux): Make recursive once again...
+ (compute_antic): ...and remove the loop here.
+
+2005-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/19858
+ * fold-const.c (make_bit_field_ref): If bitpos == 0 and bitsize
+ is number of inner's bits, avoid creating a BIT_FIELD_REF.
+
+ * config/rs6000/sysv4.h (ENDFILE_LINUX_SPEC): Use crtendS.o instead of
+ crtend.o if -pie. Use %{x:a;:b} spec syntax.
+
+2005-02-11 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config/mips/linux-unwind.h (mips_fallback_frame_state): Adjust
+ offsets for the big-endian 32-bit case.
+
+2005-02-11 Joseph S. Myers <joseph@codesourcery.com>
+
+ * config/ia64/hpux.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Define.
+
+2005-02-11 Dale Johannesen <dalej@apple.com>
+
+ * cselib.c (cselib_process_insn): Clear out regs where
+ HARD_REGNO_CALL_PART_CLOBBERED is true at a call.
+ * reload.c (find_equiv_reg): Ditto.
+
+2005-02-11 Ian Lance Taylor <ian@airs.com>
+
+ * read-rtl.c (read_rtx_1): Give fatal error if we see a vector
+ with no elements.
+
+ * tree.c (build_function_type_list): Work correctly if there are
+ no arguments.
+
+2005-02-11 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("*cmpdi_cct", "*cmpsi_cct", "*cmpdi_ccs",
+ "*cmpsi_ccs"): Use %h instead of %c to print immediate operand.
+ ("*zero_extendhisi2_64", "*zero_extendhisi2_31"): Choose based on
+ TARGET_ZARCH instead of TARGET_64BIT.
+
+2005-02-11 Ralf Corsepius <ralf.corsepius@rtems.org>
+
+ * config/rs6000/t-rtems:
+ (MULTILIB_OPTIONS): Remove mcpu=602.
+ (MUTLILIB_DIRNAMES): Remove m602.
+ (MULTILIB_MATCHES): Add ${MULTILIB_MATCHES_FLOAT}.
+ Let mcpu=602 match mcpu=603.
+ (MULTILIB_NEW_EXCEPTIONS_ONLY): Add mcpu=601, mcpu=602, mcpu=m603.
+
+2005-02-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa/linux-unwind.h (pa32_fallback_frame_state): Handle misaligned
+ signal trampolines.
+
+2005-02-10 David Daney <ddaney@avtrex.com>
+
+ * config/alpha/linux-unwind.h: Add exception clause to copyright.
+ * config/i386/linux-unwind.h: Likewise.
+ * config/ia64/linux-unwind.h: Likewise.
+ * config/mips/linux-unwind.h: Likewise.
+ * config/pa/linux-unwind.h: Likewise.
+ * config/rs6000/linux-unwind.h: Likewise.
+ * config/s390/linux-unwind.h: Likewise.
+ * config/sh/linux-unwind.h: Likewise.
+ * config/sparc/linux-unwind.h: Likewise.
+
+2005-02-10 Steven Bosscher <stevenb@suse.de>
+
+ PR tree-optimization/17549
+ * tree-outof-ssa.c (find_replaceable_in_bb): Do not allow
+ TER to replace a DEF with its expression if the DEF and the
+ rhs of the expression we replace into have the same root
+ variable.
+
+2005-02-10 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md: Fix the placement of the match_scratch in the
+ lea64 peephole2.
+
+2005-02-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cse.c, tree-ssa-loop-ivopts.c, config/rs6000/linux-unwind.h:
+ Fix comment typos.
+
+2005-02-10 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-ssa-loop-ivopts.c (determine_base_object): Ignore casts.
+ (strip_offset): Handle addresses.
+ (add_address_candidates): Use strip_offset.
+ (difference_cost): Reflect strip_offset change.
+ (force_var_cost, difference_cost): Strip nops.
+
+2005-02-10 Kazu Hirata <kazu@cs.umass.edu>
+
+ * df.h (DF_REF_MODE_CHANGE, DF_REF_MEM_OK): Remove.
+
+ * builtins.def, haifa-sched.c, libgcc2.c, libgcc2.h,
+ tree-ssa-loop-ivcanon.c, tree-ssa-loop-niter.c,
+ config/cris/cris-protos.h, config/cris/cris.c: Update
+ copyright.
+
+2005-02-10 Jeff Law <law@redhat.com>
+
+ * tree-ssa-dom.c (thread_across_edge): Use xmalloc, not xcalloc.
+ (lookup_avail_expr): Similarly.
+
+2005-02-10 Richard Guenther <rguenth@gcc.gnu.org>
+
+ * builtins.c (fold_builtin_powi): New function.
+ (fold_builtin_1): Call it.
+
+2005-02-10 Steven Bosscher <stevenb@suse.de>
+
+ PR documentation/19309
+ * doc/cpp.texi: The __GNUC__ and related predefined macros
+ are also defined for the "standalone" cpp.
+ Some non-GCC compilers may also define __GNUC__.
+
+2005-02-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/19342
+ * c-typeck.c (common_type): New routine. Old common_type renamed
+ to...
+ (c_common_type): ...this.
+ (build_conditional_expr, build_binary_op): Use c_common_type instead
+ of common_type.
+
+2005-02-10 Steven Bosscher <stevenb@suse.de>
+
+ * doc/md.texi: Replace @samp{length} with @code{length}.
+
+2005-02-09 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/18687
+ * tree-flow.h (find_loop_niter): Declare.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Try using scev even for loops with more than one exit.
+ * tree-ssa-loop-ivopts.c (struct loop_data): Removed niter field.
+ (struct ivopts_data): Added niters field.
+ (struct nfe_cache_elt): New.
+ (nfe_hash, nfe_eq, niter_for_exit, niter_for_single_dom_exit): New
+ functions.
+ (tree_ssa_iv_optimize_init): Initialize niters cache.
+ (determine_number_of_iterations): Removed.
+ (find_induction_variables): Do not call determine_number_of_iterations.
+ Access niters for single exit through niter_for_single_dom_exit.
+ (add_iv_outer_candidates): Access niters for single exit through
+ niter_for_single_dom_exit.
+ (may_eliminate_iv): Take data argument. Use niter_for_exit. Do not use
+ number_of_iterations_cond.
+ (iv_period): New function.
+ (determine_use_iv_cost_condition): Pass data to may_eliminate_iv.
+ (may_replace_final_value): Take data argument. Use
+ niter_for_single_dom_exit.
+ (determine_use_iv_cost_outer): Pass data to may_replace_final_value.
+ (rewrite_use_compare): Pass data to may_eliminate_iv.
+ (rewrite_use_outer): Pass data to may_replace_final_value.
+ (free_loop_data): Clean up the niters cache.
+ (tree_ssa_iv_optimize_finalize): Free the niters cache.
+ (tree_ssa_iv_optimize_loop): Do not call loop_commit_inserts.
+ * tree-ssa-loop-niter.c (find_loop_niter): New function.
+ (find_loop_niter_by_eval): Use tree_int_cst_lt.
+ (num_ending_zeros): Moved to tree.c.
+ * tree.h (num_ending_zeros): Declare.
+ * tree.c (num_ending_zeros): Moved from tree.c.
+
+2005-02-09 Richard Henderson <rth@redhat.com>
+
+ * builtins.c (DEF_BUILTIN): Add COND argument.
+ * tree.h (DEF_BUILTIN): Likewise.
+ * builtins.def (DEF_GCC_BUILTIN, DEF_LIB_BUILTIN, DEF_EXT_LIB_BUILTIN,
+ DEF_C94_BUILTIN, DEF_C99_BUILTIN, DEF_C99_C90RES_BUILTIN): Update to
+ match.
+ (DEF_BUILTIN_STUB): New.
+ (BUILT_IN_STACK_SAVE, BUILT_IN_STACK_RESTORE, BUILT_IN_INIT_TRAMPOLINE,
+ BUILT_IN_ADJUST_TRAMPOLINE, BUILT_IN_NONLOCAL_GOTO,
+ BUILT_IN_PROFILE_FUNC_ENTER, BUILT_IN_PROFILE_FUNC_EXIT): Use it.
+ * c-common.c (DEF_BUILTIN): Add COND argument.
+ * tree.c (local_define_builtin): New.
+ (build_common_builtin_nodes): New.
+
+2005-02-09 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold_strip_sign_ops): New function to simplify a
+ floating point expression ignoring the sign of the result.
+ (fold) <ABS_EXPR>: Use it to simplify fabs(x).
+ (fold) <MULT_EXPR>: Use it to simplify x*x.
+ * tree.h (fold_strip_sign_ops): Prototype here.
+ * builtins.c (fold_builtin_copysign): Take an additional FNDECL
+ argument. Use fold_strip_sign_ops to simplify the first argument.
+ (fold_builtin_pow): Use fold_strip_sign_ops to simplify the
+ first argument when the second argument is an even integer
+ constant, but only with -funsafe_math_optimizations.
+ (fold_builtin_1): Update call to fold_builtin_copysign.
+
+2005-02-09 Ian Lance Taylor <ian@airs.com>
+
+ PR middle-end/19583
+ * gimple-low.c (try_catch_may_fallthru): In EH_FILTER_EXPR case,
+ just check whether EH_FILTER_FAILURE falls through.
+
+2005-02-09 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * gcc/haifa-sched.c (schedule_block): Make queued sched group
+ insns return to ready list in the next turn.
+
+2005-02-09 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR middle-end/19402
+ * builtins.def: New __builtin_powi[lf].
+ * builtins.c (mathfn_built_in): Handle BUILT_IN_POWI.
+ (expand_builtin_powi): New function.
+ (expand_builtin): Dispatch to expand_builtin_powi.
+ * libgcc2.h: Add prototypes for __builtin_powi[lf].
+ * libgcc2.c: Add __builtin_powi[lf] implementation.
+ * mklibgcc.in: Add __builtin_powi[lf] to lib2funcs.
+ * optabs.h: Add powi_optab.
+ * optabs.c (init_optabs): Initialize powi_optab.
+ * doc/extend.texi: Document __builtin_powi[lf].
+
+2005-02-09 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_set_dump_settings): Check that dump_file
+ exists.
+
+2005-02-09 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR middle-end/19854
+ * fold-const.c (try_move_mult_to_index): Remove redundant
+ type argument. Create ADDR_EXPR with correct type.
+ (fold): Update callers of try_move_mult_to_index. Convert
+ result to the appropriate type.
+
+2005-02-09 Roger Sayle <roger@eyesopen.com>
+
+ PR target/19597
+ * config/avr/avr.c (default_rtx_costs): Delete.
+ (avr_operand_rtx_cost): New function.
+ (avr_rtx_costs): Completely rewrite.
+
+2005-02-08 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/19806
+ * config/cris/cris.c (in_code): New variable.
+ (cris_output_addr_const): Now a static function, a wrapper for
+ output_addr_const.
+ (cris_asm_output_symbol_ref): New function, broken out SYMBOL_REF
+ case from old cris_output_addr_const.
+ (cris_asm_output_label_ref): Similar for LABEL_REF.
+ (cris_output_addr_const_extra): Similar for UNSPEC.
+ * config/cris/cris.h (OUTPUT_ADDR_CONST_EXTRA)
+ (ASM_OUTPUT_SYMBOL_REF, ASM_OUTPUT_LABEL_REF): Define.
+ * config/cris/cris-protos.h (cris_output_addr_const): Remove
+ declaration.
+ (cris_asm_output_symbol_ref, cris_output_addr_const_extra)
+ (cris_asm_output_label_ref): Declare.
+
+2005-02-08 Paolo Bonzini <bonzini@gnu.org>
+
+ PR preprocessor/19801
+ * doc/cppinternals.texi (Conventions, Lexer, Files): Adjust
+ filenames that changed when libcpp was moved to the toplevel.
+
+2005-02-07 Roger Sayle <roger@eyesopen.com>
+
+ * simplify-rtx.c (simplify_relational_operation_1): Avoid creating
+ zero extensions of BImode operands. Call lowpart_subreg instead
+ of gen_lowpart_common and gen_lowpart_SUBREG.
+
+2005-02-07 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR ada/19489
+ * libada-mk.in: Use cc_for_cross_gnattools, not cc_set_by_configure.
+ * configure.ac: Set cc_for_cross_gnattools.
+ * configure: Regenerate.
+
+2005-02-08 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/19803
+ * predict.c (PROB_VERY_UNLIKELY): Use 1% instead of 10%.
+
+2005-02-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR debug/19327
+ * dbxout.c (dbxout_symbol) <FUNCTION_DECL>: Skip inline instance
+ of nested functions.
+
+2005-02-07 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * doc/extend.texi: Document deprecated extensions allowing
+ static floating-point members to have initializers and allowing
+ floating-point literals in integral constant expressions.
+
+2005-02-07 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cfgcleanup.c, df.h, diagnostic.c, rtl.c, tree-vectorizer.h,
+ config/darwin7.h, config/mips/mips.c,
+ config/rs6000/altivec.md, config/rs6000/darwin-tramp.asm:
+ Update copyright.
+
+ * cse.c: Update comments.
+
+2005-02-07 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR middle-end/19775
+ * builtins.c (fold_builtin_sqrt): Transform
+ sqrt(pow(x,y)) to pow(fabs(x),y*0.5), not
+ pow(x,y*0.5).
+
+2005-02-07 Leehod Baruch <leehod@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * doc/invoke.texi (ftree-vectorizer-verbose): New.
+ * opts.c (OPT_ftree_vectorizer_verbose_): New case for switch.
+ * common.opt (ftree-vectorizer-verbose): New Flag for the vectorizer
+ was added.
+ * tree.h (vect_set_verbosity_level): New extern function declaration
+ added.
+ * tree-vectorizer.h (verbosity_levels): New enum type.
+ * tree-vectorizer.c (vect_debug_stats): Function removed.
+ (vect_debug_details): Likewise.
+ (vect_verbosity_level): Global variable was defined and initialized.
+ (vect_dump): Global variable definition.
+ (vect_print_dump_info): New function.
+ (vect_set_dump_settings): New function.
+ (vect_set_verbosity_level): New function.
+ (vectorize_loops): Add call to vect_set_dump_settings.
+
+ (slpeel_make_loop_iterate_ntimes): Dump condition was changed.
+ (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise.
+ (slpeel_tree_peel_loop_to_edge): Likewise.
+
+ (vect_analyze_offset_expr): Call to vect_print_dump_info with
+ appropriate verbosity level instead of call to vect_debug_details
+ or vect_debug_stats.
+ (vect_get_base_and_offset):
+ (vect_create_addr_base_for_vector_ref):
+ (get_vectype_for_scalar_type):
+ (vect_create_data_ref_ptr):
+ (vect_init_vector):
+ (vect_get_vec_def_for_operand):
+ (vect_finish_stmt_generation):
+ (vectorizable_assignment):
+ (vectorizable_operation):
+ (vectorizable_store):
+ (vectorizable_load):
+ (vect_transform_stmt):
+ (vect_update_ivs_after_vectorizer):
+ (vect_do_peeling_for_loop_bound):
+ (vect_update_inits_of_drs):
+ (vect_do_peeling_for_alignment):
+ (vect_transform_loop):
+ (vect_is_simple_use):
+ (vect_analyze_operations):
+ (vect_is_simple_iv_evolution):
+ (vect_analyze_scalar_cycles):
+ (vect_analyze_data_ref_dependence):
+ (vect_analyze_data_ref_dependences):
+ (vect_compute_data_ref_alignment):
+ (vect_enhance_data_refs_alignment):
+ (vect_analyze_data_refs_alignment):
+ (vect_analyze_data_ref_access):
+ (vect_analyze_data_ref_accesses):
+ (vect_analyze_pointer_ref_access):
+ (vect_get_memtag_and_dr):
+ (vect_analyze_data_refs):
+ (vect_mark_relevant):
+ (vect_stmt_relevant_p):
+ (vect_mark_stmts_to_be_vectorized):
+ (vect_can_advance_ivs_p):
+ (vect_get_loop_niters):
+ (vect_analyze_loop_form):
+ (vect_analyze_loop):
+ (vectorize_loops): Likewise.
+
+ (vect_do_peeling_for_loop_bound): Dump format slightly changed.
+ (vect_update_inits_of_drs):
+ (vect_do_peeling_for_alignment):
+ (vect_transform_loop):
+ (vect_analyze_operations):
+ (vect_analyze_scalar_cycles):
+ (vect_analyze_data_ref_dependences):
+ (vect_analyze_data_refs_alignment):
+ (vect_analyze_data_ref_accesses):
+ (vect_analyze_data_refs):
+ (vect_mark_stmts_to_be_vectorized):
+ (vect_get_loop_niters):
+ (vect_analyze_loop_form):
+ (vect_analyze_loop): Likewise.
+ (vect_mark_stmts_to_be_vectorized): Add call to print_generic_expr.
+
+2005-02-07 Richard Sandiford <rsandifo@redhat.com>
+
+ PR bootstrap/19796
+ Revert:
+ 2005-01-26 Richard Sandiford <rsandifo@redhat.com>
+ * config/mips/iris6.h (ENDFILE_SPEC): Don't link in irix-csr.o if
+ either -ffast-math or -funsafe-math-optimizations is in use.
+
+ 2005-01-24 Richard Sandiford <rsandifo@redhat.com>
+ * config/mips/irix-csr.c: New file.
+ * config/mips/t-iris6 (irix-csr.o): New rule to build it.
+ (EXTRA_MULTILIB_PARTS): Add irix-csr.o.
+ * config/mips/iris6.h (ENDFILE_SPEC): Include it in n32 and n64
+ executables.
+
+2005-02-07 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mn10300/linux.h (LIB_SPEC, STARTFILE_SPEC): Remove
+ redundant, incorrect definitions.
+
+ * config/frv/frv.md ("tls_indirect_call"): Turn into libcall-like
+ expand.
+ ("*tls_indirect_call"): New, reference hard regs directly.
+ * config/frv/frv.c (gen_inlined_tls_plt): Adjust.
+
+2005-02-07 Ralf Corsepius <ralf.corsepius@rtems.org>
+
+ * config/arm/rtems-elf.h (SUBTARGET_EXTRA_ASM_SPEC):
+ Let !-mhard-float !-msoft-float imply -mfpu=softfpa.
+
+2005-02-06 Roger Sayle <roger@eyesopen.com>
+
+ PR rtl-optimization/19800
+ * simplify_rtx.c (simplify_relational_operation_1): Explicitly
+ call gen_lowpart_common and gen_lowpart_SUBREG instead of calling
+ gen_lowpart.
+
+2005-02-07 Ralf Corsepius <ralf.corsepius@rtems.org>
+
+ * config/m68k/t-rtems (MULTILIB_MATCHES): Let m528x match m5200.
+
+2005-02-07 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR other/17135
+ * doc/invoke.texi: Correct documentation of -freorder-functions.
+
+2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR other/14402
+ * doc/invoke.texi: Don't mention gccbug.
+
+2005-02-06 Roger Sayle <roger@eyesopen.com>
+ Andrew Pinski <pinskia@physics.uc.edu>
+ Paolo Bonzini <paolo.bonzini@lu.unisi.ch>
+
+ * simplify-rtx.c (simplify_relational_operation_1): Simplify
+ (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0))
+ into just (zero_extract:SI FOO (const_int 1) BAR).
+
+2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
+
+ * doc/cpp.texi: Include gcc-common.texi. Don't define gcctabopt
+ macro locally. Don't give last revision date. Use GCC version
+ number from gcc-common.texi.
+ * doc/cppinternals.texi: Include gcc-common.texi. Don't give last
+ revision date. Use GCC version number from gcc-common.texi.
+ Describe being a library as current state rather than as 3.x
+ history.
+ * doc/gcc.texi: Remove last update date.
+ * doc/gccint.texi: Likewise. Update copyright dates.
+ * doc/install.texi: Update copyright dates.
+
+2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR other/7549
+ * doc/invoke.texi: Mention for each option included in -Wall that
+ it is included in -Wall.
+ * doc/gcc.texi: Update copyright and last modification date.
+
+2005-02-06 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Do not add
+ unnecessary cast to original induction variable increments.
+
+2005-02-06 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/18219
+ * tree-ssa-loop-ivopts.c (get_computation_at): Produce computations
+ in distributed form.
+
2005-02-06 Richard Sandiford <rsandifo@redhat.com>
* expmed.c (store_bit_field): Make the SUBREG code adjust bitnum.
@@ -96,7 +1795,7 @@
(vect_analyze_loop_form): Argument in call to vect_debug_details/stats
changed from loop to loop_loc.
- (vect_enhance_data_refs_alignment): Removed unused variable loop.
+ (vect_enhance_data_refs_alignment): Removed unused variable loop.
2005-02-03 Leehod Baruch <leehod@il.ibm.com>
Dorit Naishlos <dorit@il.ibm.com>
@@ -111,7 +1810,7 @@
(vect_create_index_for_vector_ref): Likewise.
(vect_update_ivs_after_vectorizer): Likewise.
(new_stmt_vec_info): Likewise.
-
+
(new_loop_vec_info): Second argument in call to new_stmt_vec_info was
changed from loop to loop_vinfo.
(vect_create_data_ref_ptr): First argument in call to
@@ -127,7 +1826,7 @@
was changed from loop to loop_vinfo.
(vect_analyze_data_ref_dependences): Third argument in call to
vect_analyze_data_ref_dependence was changed from loop to loop_vinfo.
-
+
(vect_create_index_for_vector_ref): Get the loop from loop_vinfo.
(vect_create_data_ref_ptr): Likewise.
(vect_init_vector): Likewise.
@@ -206,11 +1905,11 @@
2005-02-03 Dorit Naishlos <dorit@il.ibm.com>
* tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Call
- standard_iv_increment_position. Remove call to bsi_next
+ standard_iv_increment_position. Remove call to bsi_next
(no need to bump the iterator anymore).
(vect_create_index_for_vector_ref): Call
standard_iv_increment_position. Remove second function argument.
- (vect_finish_stmt_generation): Remove call to bsi_next
+ (vect_finish_stmt_generation): Remove call to bsi_next
(no need to bump the iterator anymore).
(vect_create_data_ref_ptr): Remove second argument (bsi) in call
to vect_create_index_for_vector_ref.
@@ -478,16 +2177,16 @@
* config.gcc: Don't include embedded systems fragment, switches default
debugging format to ELF.
- * config/i386/openbsdelf.h: Add DBX_REGISTER_NUMBER since we no
+ * config/i386/openbsdelf.h: Add DBX_REGISTER_NUMBER since we no
longer pick it up there.
2005-01-31 Dale Johannesen <dalej@apple.com>
-
+
* doc/extend.texi (nested functions): Fix linkage description.
Clarify that static is not allowed.
2005-01-31 Dale Johannesen <dalej@apple.com>
-
+
* config/rs6000/darwin.md (movsf_low_di): Make work.
(movdf_low_di): Make work.
@@ -568,7 +2267,7 @@
2005-01-30 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/19624
-
+
* Makefile.in (tree-ssa-pre.o): Add CFGLOOP_H.
* tree-ssa-pre.c: Add cfgloop.h.
Update comment.
@@ -601,7 +2300,7 @@
PR target/19700
* config/i386/i386.c (ix86_expand_copysign): New.
(ix86_split_copysign_const): New.
- (ix86_split_copysign_var): Rename from ix86_split_copysign,
+ (ix86_split_copysign_var): Rename from ix86_split_copysign,
rearrange op1/nmask operands.
* config/i386/i386-protos.h: Update.
* config/i386/i386.md (copysignsf3): Use ix86_expand_copysign.
@@ -977,7 +2676,7 @@
2005-01-26 Steven Bosscher <stevenb@suse.de>
- PR middle-end/19616
+ PR middle-end/19616
* tree.h (CALL_EXPR_TAILCALL): Add comment.
* calls.c (check_sibcall_argument_overlap_1): Revert the change
to this function from 2004-07-10.
@@ -1373,7 +3072,7 @@
2005-01-21 Mark Dettinger <dettinge@de.ibm.com>
- * config/s390/s390.c (struct processor_costs): New fields
+ * config/s390/s390.c (struct processor_costs): New fields
dlgr, dlr, dr, dsgfr, dsgr.
(z900_cost, z990_cost): Values for new fields.
(s390_rtx_costs): New cases MEM und COMPARE in switch
@@ -1557,7 +3256,7 @@
(add_location_or_const_value_attribute): Use it.
Also try to generate a frame_base from a single element location
list.
-
+
2005-01-20 Kazu Hirata <kazu@cs.umass.edu>
PR tree-optimization/15349
@@ -1697,7 +3396,7 @@
2005-01-19 Ralf Corsepius <ralf.corsepius@rtems.org>
PR target/19529
- * config/sh/t-rtems: New.
+ * config/sh/t-rtems: New.
* config.gcc (sh-*-rtems*): Reflect having added config/sh/t-rtems.
2005-01-19 Zdenek Dvorak <dvorakz@suse.cz>
@@ -2119,7 +3818,7 @@
2005-01-15 Ralf Corsepius <ralf.corsepius@rtems.org>
* config/mips/rtems.h (MIPS_DEFAULT_GVALUE): Set to 0.
- * config/mips/t-rtems (MULTILIBS_DIRNAMES,MULTILIB_OPTIONS):
+ * config/mips/t-rtems (MULTILIBS_DIRNAMES,MULTILIB_OPTIONS):
Remove little endian multilib variants.
Add mips32 multilib variant.
@@ -2231,7 +3930,7 @@
(TARGET_ASM_FILE_END): Call arm_file_end.
(aof_file_end): Likewise.
* arm-protos.h (thumb_call_via_reg): Declare.
- * arm.md (call_reg_thumb, call_value_reg_thumb): Call
+ * arm.md (call_reg_thumb, call_value_reg_thumb): Call
thumb_call_via_reg in normal case.
2005-01-14 Jakub Jelinek <jakub@redhat.com>
@@ -2318,7 +4017,7 @@
IX86_BUILTIN_MOVDQ2Q): Remove.
(IX86_BUILTIN_VEC_EXT_V4SI): New.
(ix86_init_mmx_sse_builtins, ix86_expand_builtin): Update to match.
- (ix86_expand_vector_extract): For V4S[FI], extract element 0 after
+ (ix86_expand_vector_extract): For V4S[FI], extract element 0 after
shuffling.
* config/i386/sse.md (sse_concatv2sf): Accept zero operand 2.
(sse2_pextrw): Fix immediate constraint.
@@ -2479,7 +4178,7 @@
vec_extractv16qi, vec_initv16qi): New.
* config/i386/emmintrin.h (__m128i, __m128d): Use typedef, not define.
- (_mm_set_sd, _mm_set1_pd, _mm_setzero_pd, _mm_set_epi64x,
+ (_mm_set_sd, _mm_set1_pd, _mm_setzero_pd, _mm_set_epi64x,
_mm_set_epi32, _mm_set_epi16, _mm_set_epi8, _mm_setzero_si128): Use
constructor form.
(_mm_load_pd, _mm_store_pd): Use plain dereference.
diff --git a/gcc/ChangeLog.5 b/gcc/ChangeLog.5
index e5c26cc1cd2..c5f3b54200f 100644
--- a/gcc/ChangeLog.5
+++ b/gcc/ChangeLog.5
@@ -3405,8 +3405,8 @@ Fri May 18 15:39:16 CEST 2001 Jan Hubicka <jh@suse.cz>
what a basic block is, and what the various fields are used for.
* flow.c (calculate_globlal_regs_live): Add documentation about
how the algorithm works, and how we know that it will terminate.
- Check that the the inductive assumption that guarantees
- termination actually holds.
+ Check that the inductive assumption that guarantees termination
+ actually holds.
(mark_used_regs): Treat conditionally set registers as used.
(debug_regset): Add comment.
* rtl.texi (cond_exec): Add documentation.
diff --git a/gcc/ChangeLog.7 b/gcc/ChangeLog.7
index f9c6a7dbcb0..022212bfa87 100644
--- a/gcc/ChangeLog.7
+++ b/gcc/ChangeLog.7
@@ -1717,7 +1717,7 @@ Tue Jun 11 21:53:37 CEST 2002 Jan Hubicka <jh@suse.cz>
last insn created by the splitter.
* caller-save.c (init_caller_save): Move creation of SAVEINSN
- and RESTINSN into into the scope of the sequence.
+ and RESTINSN into the scope of the sequence.
* mips.c (mips_expand_prologue): Use emit_jump_insn for trivial
RETURN insns.
diff --git a/gcc/ChangeLog.tree-ssa b/gcc/ChangeLog.tree-ssa
index cf077aa1e36..4f22a6e77c8 100644
--- a/gcc/ChangeLog.tree-ssa
+++ b/gcc/ChangeLog.tree-ssa
@@ -3420,7 +3420,7 @@
* tree-alias-common.c (find_func_aliases): Do not call
intra_function_call for languages assuring no aliasing between
- arguments (by themselves) and and global memory.
+ arguments (by themselves) and global memory.
2003-12-21 Jan Hubicka <jh@suse.cz>
@@ -7693,7 +7693,7 @@
(finalize): Free allocations.
(cfg_blocks_empty): New. Is cfg_blocks queue list.
(cfg_blocks_add): New. Add a basic block to cfg_blocks list.
- (cfg_blocks_pop): New. Get a a basic_block form the list.
+ (cfg_blocks_pop): New. Get a basic_block from the list.
2003-09-18 Richard Henderson <rth@redhat.com>
@@ -9565,7 +9565,7 @@
(optimize_stmt): Don't abort if a statement makes more than one
definition.
Check for MODIFY_EXPR statements directly, instead of relying on
- the the presence of a single definition.
+ the presence of a single definition.
* tree-ssa-pre.c (tree_perform_ssapre): Call dump_function_to_file
instead of dump_function.
* tree-ssa.c (rewrite_into_ssa): Likewise.
@@ -15291,7 +15291,7 @@
* tree-ssa-dce (tree_ssa_eliminate_dead_code): Initialize prev to
NULL_TREE.
Don't close dump_file until end of function.
- Dump the the tree after DCE for -fdump-tree-dce.
+ Dump the tree after DCE for -fdump-tree-dce.
2002-10-08 Richard Henderson <rth@redhat.com>
Jason Merrill <jason@redhat.com>
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 4a1b4218f94..14cb6fd0bfd 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -193,7 +193,6 @@ gcc.o-warn = -Wno-error
build/insn-conditions.o-warn = -Wno-error
# Bison-1.75 output often yields (harmless) -Wtraditional warnings
build/gengtype-yacc.o-warn = -Wno-error
-c-parse.o-warn = -Wno-error
# flex output may yield harmless "no previous prototype" warnings
build/gengtype-lex.o-warn = -Wno-error
# SYSCALLS.c misses prototypes
@@ -884,11 +883,11 @@ CXX_TARGET_OBJS=@cxx_target_objs@
C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \
c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \
- c-objc-common.o c-dump.o c-pch.o $(C_TARGET_OBJS) \
+ c-objc-common.o c-dump.o c-pch.o c-parser.o $(C_TARGET_OBJS) \
c-gimplify.o tree-mudflap.o c-pretty-print.o
# Language-specific object files for C.
-C_OBJS = c-parse.o c-lang.o stub-objc.o $(C_AND_OBJC_OBJS)
+C_OBJS = c-lang.o stub-objc.o $(C_AND_OBJC_OBJS)
# Language-independent object files.
OBJS-common = \
@@ -902,7 +901,8 @@ OBJS-common = \
tree-ssa-dom.o domwalk.o tree-tailcall.o gimple-low.o tree-iterator.o \
tree-phinodes.o tree-ssanames.o tree-sra.o tree-complex.o tree-ssa-loop.o \
tree-ssa-loop-niter.o tree-ssa-loop-manip.o tree-ssa-threadupdate.o \
- tree-vectorizer.o tree-ssa-loop-ivcanon.o tree-ssa-propagate.o \
+ tree-vectorizer.o tree-vect-analyze.o tree-vect-transform.o \
+ tree-ssa-loop-ivcanon.o tree-ssa-propagate.o \
tree-ssa-loop-ivopts.o tree-if-conv.o tree-ssa-loop-unswitch.o \
alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \
@@ -1347,24 +1347,15 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
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-parse.o : c-parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+c-parser.o : c-parser.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(GGC_H) intl.h $(C_TREE_H) input.h $(FLAGS_H) toplev.h output.h \
- $(CPPLIB_H) varray.h gt-c-parse.h langhooks.h $(C_COMMON_H) $(C_PRAGMA_H)
+ $(CPPLIB_H) varray.h gt-c-parser.h langhooks.h $(C_COMMON_H) $(C_PRAGMA_H)
srcextra: gcc.srcextra lang.srcextra
-gcc.srcextra: c-parse.y c-parse.c gengtype-lex.c gengtype-yacc.c gengtype-yacc.h
+gcc.srcextra: gengtype-lex.c gengtype-yacc.c gengtype-yacc.h
-cp -p $^ $(srcdir)
-c-parse.c: c-parse.y
- -$(BISON) $(BISONFLAGS) -o $@ $<
-
-c-parse.y: c-parse.in
- echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
- sed -e "/^@@ifobjc.*/,/^@@end_ifobjc.*/d" \
- -e "/^@@ifc.*/d" -e "/^@@end_ifc.*/d" $< >>tmp-c-parse.y
- $(SHELL) $(srcdir)/../move-if-change tmp-c-parse.y $@
-
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)
@@ -1769,10 +1760,18 @@ tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
errors.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 $(LAMBDA_H)
+tree-vect-analyze.o: tree-vect-analyze.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 $(SCEV_H) $(EXPR_H)
+tree-vect-transform.o: tree-vect-transform.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 target.h tree-pass.h $(EXPR_H) \
+ tree-vectorizer.h tree-data-ref.h $(SCEV_H) langhooks.h toplev.h
tree-vectorizer.o: tree-vectorizer.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-pass.h $(EXPR_H) \
- tree-vectorizer.h tree-data-ref.h $(SCEV_H)
+ tree-vectorizer.h tree-data-ref.h $(SCEV_H) input.h target.h cfglayout.h
tree-loop-linear.o: tree-loop-linear.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-pass.h \
@@ -2422,7 +2421,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
$(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
- $(srcdir)/c-objc-common.c $(srcdir)/c-common.c $(srcdir)/c-parse.in \
+ $(srcdir)/c-objc-common.c $(srcdir)/c-common.c $(srcdir)/c-parser.c \
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c \
$(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
$(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
@@ -2444,7 +2443,7 @@ gt-emit-rtl.h gt-explow.h gt-stor-layout.h gt-regclass.h \
gt-lists.h gt-alias.h gt-cselib.h gt-gcse.h \
gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dojump.h \
gt-dwarf2out.h gt-reg-stack.h gt-dwarf2asm.h \
-gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parse.h \
+gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parser.h \
gt-c-pragma.h gtype-c.h gt-cfglayout.h \
gt-tree-mudflap.h gt-tree-complex.h \
gt-tree-eh.h \
@@ -3161,7 +3160,7 @@ distclean: clean lang.distclean
-rm -f Makefile *.oaux
-rm -f gthr-default.h
-rm -f */stage1 */stage2 */stage3 */stage4 */include */stageprofile */stagefeedback
- -rm -f c-parse.y c-parse.c c-parse.output TAGS */TAGS
+ -rm -f TAGS */TAGS
-rm -f *.asm
-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
-rm -f testsuite/*.log testsuite/*.sum
@@ -3181,7 +3180,6 @@ maintainer-clean:
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
$(MAKE) lang.maintainer-clean distclean
- -rm -f $(srcdir)/c-parse.y $(srcdir)/c-parse.c
-rm -f cpp.??s cpp.*aux
-rm -f gcc.??s gcc.*aux
-rm -f $(docdir)/*.info $(docdir)/*.1 $(docdir)/*.7 $(docdir)/*.dvi
@@ -3643,7 +3641,7 @@ TAGS: lang.tags
incs="$$incs --include $$dir/TAGS.sub"; \
fi; \
done; \
- etags -o TAGS.sub *.y *.h *.c -l yacc c-parse.in; \
+ etags -o TAGS.sub *.y *.h *.c; \
etags --include TAGS.sub $$incs)
# ------------------------------------------------------
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 6c9a04c2552..a1bab757948 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,789 @@
+2005-02-13 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR ada/19942
+ * utils.c (gnat_type_for_mode): Return null instead of ICE because we asked
+ for an unknown mode.
+
+2005-02-12 Richard Henderson <rth@redhat.com>
+
+ * utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes;
+ validate SCALAR_INT_MODE_P before calling gnat_type_for_size.
+
+2005-02-10 Andreas Jaeger <aj@suse.de>
+
+ * init.c (__gnat_initialize): Mark parameter as unused.
+
+2005-02-09 Doug Rupp <rupp@adacore.com>
+
+ * g-expect-vms.adb (Non_Blocking_Spawn): Separate out.
+ * g-enblsp-vms-alpha.adb g-enblsp-vms-ia64.adb: New subunits.
+
+2005-02-09 Doug Rupp <rupp@adacore.com>
+
+ * gnatchop.adb (dup, dup2),
+ g-dirope.adb (closedir, opendir, rmdir): Reference via System.CRTL.
+
+ * gnatlbr.adb (mkdir),
+ mlib-tgt-vms-ia64.adb (popen, plose): Import with decc$ prefix.
+
+ * s-crtl.ads (closdir, dup, dup2, opendir, rmdir): Import.
+
+2005-02-09 Doug Rupp <rupp@adacore.com>
+
+ * s-tpopde-vms.adb: Add pragma Warnings (Off) for Task_Id conversions.
+
+2005-02-09 Robert Dewar <dewar@adacore.com>
+ Thomas Quinot <quinot@adacore.com>
+ Javier Miranda <miranda@adacore.com>
+ Pascal Obry <obry@adacore.com>
+ Ed Schonberg <schonberg@adacore.com>
+ Doug Rupp <rupp@adacore.com>
+ Gary Dismukes <dismukes@adacore.com>
+ Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * g-zstspl.ads: New file.
+
+ * a-chahan.ads, a-chahan.adb: Add declarations from AI-285
+
+ * a-string.ads: Add pragma Ada_05 for wide_wide_space to get warning in
+ Ada 95 mode
+ Add definition of Wide_Wide_Space for AI-285
+
+ * impunit.ads, impunit.adb, sem_ch10.adb: Complete rewrite and new
+ interface (to support Ada 95 and Ada 2005 units).
+ Add Unbounded_IO files
+ Add entries for Wide_Wide packages for AI-285
+ Add list of containers packages to Ada 2005 unit list
+
+ * a-swuwti.ads, a-swuwti.adb, a-suteio.ads, a-suteio.adb: Updates to
+ support new Unbounded_IO package cleanly.
+
+ * g-utf_32.ads, g-utf_32.adb: New files.
+
+ * Makefile.rtl: Add entry for g-utf_32
+ Add new files for Unbounded_IO
+ Adjust make file for new AI-285 wide wide packages
+ Add AI-302 containers to the run time.
+
+ * a-stwibo.adb, a-stwibo.ads, a-stwisu.adb, a-stwisu.ads,
+ a-strbou.ads, a-strbou.adb, a-strsup.ads, a-strsup.adb: New
+ subprograms for AI-301.
+
+ * a-stwiun.adb, a-stwiun.ads: Minor reformatting.
+
+ * a-stunau.ads: Minor comment correction
+
+ * rtsfind.ads, rtsfind.adb: Add definitions for Wide_Wide attributes
+ etc.
+ Also extend Text_IO_Kludge to support Wide_Wide_Text_IO
+ (Check_RPC): Update to match changes in expanded code.
+ Clean up unused entity.
+
+ * exp_ch3.ads, exp_ch3.adb: Fix various places where Wide_Wide_String
+ was not taken into account.
+ This includes proper initialization with Normalize_Scalars.
+ (Get_Simple_Init_Val): Major rewrite for initialize scalars and
+ normalize scalars cases (particularly the latter) to do a better job
+ of finding invalid representations.
+
+ * s-scaval.ads, s-scaval.adb: Add values for zero invalid values
+
+ * s-strops.ads, s-strops.adb: Remove string normalize routines, never
+ used
+
+ * exp_dist.adb: Add support for wide wide character type
+ (Expand_Receiving_Stubs_Bodies): For a package declaration that has a
+ private part, generate stub bodies at the end of the private part,
+ not the visible part.
+ (Add_RACW_Primitive_Operations_And_Bodies): Add last missing code for
+ PolyORB support.
+ (Add_Obj_RPC_Receiver_Completion): Add PCS-specific subprograms and
+ generic wrapper to execute final processing after completing the
+ expansion of the RPC receiver for an RACW.
+
+ * snames.h, snames.ads, snames.adb: Add definitions for wide_wide
+ packages and attributes.
+ (Preset_Names): Addition of the new reserved words of Ada 2005,
+ that is interface, overriding and synchronized.
+ (Get_Pragma_Id): Give support to the use of the new reserved word
+ "interface" as a pragma name.
+ (Is_Pragma_Name): Give support to the use of the new reserved word
+ "interface" as a pragma name.
+ (Preset_Names): Add stream_size string for the Stream_Size Ada2005
+ attribute implementation.
+
+ * exp_attr.adb (Expand_Attribute_Reference): Do not apply validity
+ checks to entities that are output parameters of Asm operations.
+ Handle the Stream_Size attribute.
+ Add implementation of Wide_Wide_Value, Wide_Wide_Image, Wide_Wide_Width
+
+ * exp_imgv.ads, exp_imgv.adb: Add support for wide wide character type
+
+ * sem_attr.adb (Eval_Attribute): Raise compile-time constraint error
+ for second parameter being 0.0.
+ Add support for wide wide character type.
+ (Analyze_Attribute, Eval_Attribute): Handle the Stream_Size attribute.
+
+ * s-valwch.adb, s-valwch.ads, s-imgwch.ads, s-imgwch.adb,
+ s-wchstw.ads, s-wchstw.adb, s-wchwts.adb, s-wchwts.ads,
+ s-widwch.adb, s-widwch.ads, s-wwdcha.adb, s-wwdcha.ads,
+ s-wwdenu.adb, s-wwdenu.ads, s-wwdwch.adb, s-wwdwch.ads: Add support
+ for wide wide character cases.
+
+ * cstand.adb: Create entities for Wide_Wide_Character and
+ Wide_Wide_String.
+
+ * i-c.ads, i-c.adb: Fix not raising CE for null wide strings in
+ accordance with AI-258.
+ Add new declarations for 16/32 bit C character types (Part of AI285)
+
+ * einfo.ads, einfo.adb (Is_Obsolescent, Is_Ada_2005): New flag
+ (Obsolescent_Warning): New field
+ (Rep_Clause): New local subprogram used to share code. Returns the rep
+ clause for which the name is given in parameter.
+ (Has_Stream_Size_Clause): New routine.
+ (Stream_Size_Clause): Idem. Implementation is based on Rep_Clause.
+ (Address_Clause): Implementation is now using Rep_Clause.
+ (Alignment_Clause): Idem.
+ (Size_Clause): Idem.
+
+ * lib-xref.adb (Generate_Reference): Test for reference to Ada 2005
+ entity in non-Ada 2005 mode and generate warning.
+
+ * par-prag.adb: Add handling of one argument form for pragma Ada_05.
+ (Prag): Code cleanup. Remove old gnat pragma "overriding"
+
+ * sem_prag.adb: Add handling of one argument form for pragma Ada_05
+ (Analyze_Pragma, case Elaborate, Elaborate_All): Do not disable warnings
+ on the named unit if the pragma is not in the current compilation unit,
+ so that elaboration calls in the current unit can set up an elaboration
+ dependency on the named unit, as needed.
+ (Analyze_Pragma, case Obsolescent): Allow pragma to be used for library
+ subprogram as well as for subprograms declared within a package.
+ (Analyze_Pragma, Sig_Flags): Code cleanup. Remove support for the GNAT
+ pragma overriding.
+
+ * krunch.ads, krunch.adb: Add special handling of Wide_Wide (krunched
+ to z) to avoid some instances of duplication for Wide_Wide packages.
+
+ * namet.ads, namet.adb: Implement encoding (WWhhhhhhhh) for wide wide
+ characters.
+
+ * scn.adb: Char_Literal_Value field is now a Uint
+
+ * scng.adb: Significant rewrite to handle new Ada 2005 features
+ allowing wide and wide wide characters in program text, e.g. for
+ identifiers, as described in AI-285.
+ (Set_Reserved): New procedure, makes setting up keywords cleaner.
+ (Initialize_Scanner): Register the new reserved words of Ada 2005.
+ (Scan): Give support to the new reserved words.
+
+ * par-ch2.adb (P_Identifier): Compiling in Ada95 mode, generate a
+ warning notifying that interface, overriding, and synchronized are
+ new reserved words.
+ (P_Pragma): Allow the use of the new reserved word "interface" as
+ a pragma name.
+
+ * gnatls.adb, gnatbind.adb,
+ ali-util.adb, binde.adb, ali.ads, ali.adb: Code cleanup. Rename
+ identifiers named "interface" to "SAL_Interface".
+
+ * bindgen.adb (Gen_Main_Ada): Add support for the new SEH
+ (Structured Exception handling).
+ (Gen_Main_C): Idem.
+
+ * bindgen.adb:
+ (Gen_Main_Ada): Set the default exit code if specified.
+ (Gen_Main_C): Likewise.
+ Part of *DC20-006.
+ (Gen_Output_File_C): Remove redundant output of gnat_exit_status.
+ Code cleanup. Rename identifiers named "interface" to "SAL_Interface"
+
+ * switch-b.adb, bindusg.adb, opt.ads, vms_data.ads: Add handling of
+ new -Xnnn switch.
+
+ * mlib-prj.adb, mlib.adb: Code cleanup. Rename one identifier that
+ has a collision with the new Ada 2005 "interface" reserved word.
+
+ * par-ch3.adb (P_Defining_Identifier): Compiling in Ada95 mode,
+ generate a warning notifying that interface, overriding, and
+ synchronized are new reserved words.
+
+ * scans.ads (Token_Type): Addition of the tokens corresponding to the
+ new reserved words of Ada 2005: Tok_Interface, Tok_Overriding
+ and Tok_Synchronized.
+
+ * sem_res.adb (Resolve_Actuals): Change error messages to refer to
+ "dispatching" rather than "primitive" operations, since dispatching
+ calls are now allowed to abstract formal subprograms (which are not
+ primitive).
+ Char_Literal_Value field is now a Uint
+ (Resolve_Slice): If the prefix is an access to an unconstrained array,
+ compute the actual subtype of the designated object to impose the proper
+ index constraints.
+ (Resolve_Selected_Component): Do not insert an access check if the
+ prefix is an access type: such a node is expanded into an explicit
+ dereference, on which the access check is performed anyway. Removes
+ expensive duplicate checks.
+ (Resolve_Call): Use new flag Is_Obsolescent and field
+ Obsolescent_Warning so that pragma Obsolescent works on library
+ subprograms.
+ Add support for wide wide character type
+ (Resolve_Allocator): Replace the error message on wrong null-exclusion
+ value by a warning message.
+ (Resolve_Type_Conversion): If the mixed-mode expression is interpreted
+ as fixed-point, and one of the operands is non-static and universal, it
+ can only be an illegal exponentiation operation, in which case there is
+ no real value to retrieve.
+
+ * exp_strm.adb: Add support for wide wide character type
+ (Build_Elementary_Input_Call): Compute the size of the stream element by
+ querying the rep chain to find the Stream_Attribute attribute value.
+ (Build_Elementary_Write_Call): Ditto.
+
+ * sem_aggr.adb: Char_Literal_Value field is now a Uint
+ Add support for wide wide character type
+ Replace the error messages on wrong null-exclusion value by warnings
+ as described in Ada 2005.
+ (Resolve_Extension_Aggregate): Document the fact that the error
+ message on class-wide expressions in extensions aggregates.
+
+ * sem_case.adb: Add support for wide wide character type
+
+ * sem_ch13.adb: Add support for wide wide character type
+ (Analyze_Attribute_Definition_Clause): Handle the Stream_Size attribute.
+
+ * sem_ch3.adb: Add support for wide wide character type
+ (Process_Subtype): If constraint is illegal for the type, set Ekind of
+ now-useless Itype, to prevent cascaded errors on a compiler built
+ without -gnatp.
+
+ * sem_ch8.adb: Add with and use of Sem_Disp.
+ (Analyze_Subprogram_Renaming): Replace unclean uses of
+ Corresponding_Spec with Corresponding_Formal_Spec (and delete setting
+ of Corresponding_Spec to Empty).
+ (Attribute_Renaming): Replace use of Corresponding_Spec with
+ Corresponding_ Formal_Spec and simplify condition.
+ (Use_One_Package): Check that scope of homonym of identifier is defined,
+ before checking whether it is a wrapper package.
+ Add support for wide wide character type
+
+ * sem_eval.adb: Add support for wide wide character type.
+ (Eval_Arithmetic_Op): Check for compile time known signed integer
+ overflow in the non-static case.
+ (Subtypes_Statically_Match): A formal scalar type and its base type do
+ not statically match.
+
+ * sem_util.adb (Collect_Primitive_Operations): Minor change of "/=" to
+ "not in" for test of N_Formal_Subprogram_Declaration (which is now a
+ subtype).
+ (Unit_Declaration_Node): Ditto.
+ (Is_Variable_Prefix): For the case of an indexed component whose prefix
+ has a packed array type, the prefix has been rewritten into a type
+ conversion. Determine variable-ness from the converted expression.
+ Handle wide wide character cases.
+
+ * stand.ads: Add types Wide_Wide_Character and Wide_Wide_String
+
+ * stringt.ads, stringt.adb: Handle full UTF-32 range.
+ Remove ["0A"] from comment, since it can look like a line terminator.
+ Currently we don't permit this, but this is under discussion by the
+ ARG, and it is easy enough to use a different example.
+
+ * s-wchcon.ads, s-wchcnv.ads, s-wchcnv.adb: Add new subprograms for
+ handling UTF-32 encoding for wide wide character.
+ Implement new brackets coding ["hhhhhhhh"]
+ Add UTF-8 encodings for full UTF-32 range
+
+ * ttypes.ads: Add definition of Standard_Wide_Wide_Character_Size
+
+ * types.h, types.ads, types.adb: Wide_Wide_Character now has full 31
+ bit range Add full UTF-32 support.
+ (RT_Exception_Code): Addition of CE_Null_Not_Allowed; used to
+ notify that constraint error will be raised at run-time
+ because a null value is assigned to a null-excluding object.
+ Remove some obsolete declarations and make Char_Code
+ unsigned.
+
+ * a-except.adb (Rcheck_30): New subprogram. Addition of the message
+ corresponding to CE_Null_Not_Allowed, and adjust the output of all the
+ Rcheck subprograms.
+
+ * checks.adb (Check_Null_Not_Allowed): Replace the error message on
+ wrong null-exclusion value by a warning message.
+ (Enable_Range_Check): Do range check if the prefix is an
+ explicit dereference whose designated object is an unconstrained array.
+ Current algorithm for removing duplicate checks is over-eager in this
+ case.
+
+ * sem_ch5.adb (Analyze_Assignment): Replace the error messages on wrong
+ null-exclusion value by a warning message
+
+ * atree.h, atree.ads, atree.adb: Remove Char_Code field support
+ completely. Add support for Uint2 field
+
+ sem_ch2.adb, exp_ch11.adb, exp_dbug.adb,
+ exp_prag.adb: Char_Literal_Value field is now a Uint.
+
+ * exp_util.adb (Insert_Actions): Replace
+ N_Formal_Subprogram_Declaration by
+ N_Formal_{Abstract|Concrete}_Subprogram_Declaration.
+ Char_Literal_Value field is now a Uint.
+
+ * sinfo.ads, sinfo.adb (Corresponding_Formal_Spec): New function
+ defined for subprogram renaming declarations. When set, the field
+ indicates the defining entity of a corresponding formal subprogram
+ when the renaming corresponds to a formal subprogram association in an
+ instantiation.
+ (Set_Corresponding_Formal_Spec): New procedure to return
+ Corresponding_Formal_Spec field.
+ Minor changes of "=" to "in" in tests of N_Formal_Subprogram_Declaration
+ (which is now a subtype).
+ Char_Literal_Value field is now a Uint
+
+ * exp_disp.ads, exp_disp.adb (Make_DT): Generate code that moves the
+ pointer to the base of the dispatch table.
+ Minor changes to comments.
+ (Controlling_Type): New function for determining the tagged type
+ associated with a tagged primitive subprogram.
+ (Expand_Dispatching_Call): Add support for a controlling actual that is
+ directly a value of type Ada.Tag rather than a tagged object.
+
+ * i-cpp.ads, i-cpp.adb, a-tags.ads, a-tags.adb: Update documentation
+ describing the new layout.
+ (Dispatch_Table): The expander computes the actual array size, allocates
+ the Dispatch_Table record accordingly, and generates code that displaces
+ the base of the record after the Typeinfo_Ptr component. The access to
+ these components is done by means of local functions.
+ (Offset_To_Top): New function.
+ (Typeinfo_Ptr): New function.
+ (Get_TSD): Modified to access the new position of the TSD.
+ (Set_TSD): Modified to save the TSD in its new position.
+
+ * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing for the
+ case of formal abstract subprograms. Add check and message for -gnat05.
+ Update comments.
+
+ * sem_ch12.adb: Add with and use for Sem_Disp.
+ (Analyze_Associations): Minor change from "=" to "in" for use of
+ N_Formal_Subtype_Declaration (which is now a subtype).
+ (Set_Analyzed_Formal): Minor changes from "=" to "in" for uses of
+ N_Formal_Subtype_Declaration (which is now a subtype).
+ (Analyze_Formal_Subprogram): Add handling for
+ N_Formal_Abstract_Subprogram, marking the formal as abstract and
+ dispatching, setting the controlling status of the formal parameters
+ and result, and issuing an error if there is no controlling type for
+ the formal subprogram.
+ (Instantiate_Formal_Subprogram): Rather than setting Corresponding_Spec,
+ which is an unclean use of that field, we set the new field
+ Corresponding_Formal_Spec to make the formal subprogram available to
+ processing in Analyze_Subprogram_Declaration.
+ (Analyze_Formal_{Discrete, Decimal_Fixed_Point, Fixed_Point,
+ Floating_Point, Modular_Integer, Signed_Integer}_Type: Make formal type
+ Constrained, so that it is is does not statically match its anonymous
+ base type.
+
+ * sem_ch6.adb (Analyze_Subprogram_Specification): Include test for
+ abstract formal subprograms in error check for functions returning
+ abstract types. Set scope of new designator for
+ a parameterless subprogram, so that it is available when checking the
+ body for nested subprograms, before full analysis of said body.
+ (Analyze_Subprogram_Body): Warn on inlining bodies with nested
+ subprogram only if inner one comes from source.
+ (Analyze_Function_Call): If the call is given in object notation, the
+ analysis of the name rewrites the node and analyzes it with the proper
+ argument list. After analyzing the name, if the call has been rewritten
+ and the result type is set, no further analysis is needed.
+ (Analyze_Return_Type): Subsidiary to Process_Formals: analyze subtype
+ mark in function specification, in a context where the formals are
+ visible and hide outer homographs.
+
+ * sem_disp.adb (Check_Controlling_Type): Relax the check for same scope
+ as the tagged type for the cases of abstract formal subprograms and
+ renamings of those. Clean up spec comments.
+ (Check_Dispatching_Context): Add error message to indicate "abstract
+ procedure", covering the case of a call to a formal abstract procedure
+ that has statically tagged operands.
+ (Check_Dispatching_Call): Check for the case of an actual given by
+ a tag-indeterminate function call whose type is an ancestor of the
+ containing call's associated tagged type. This situation can occur
+ for inherited primitives with function defaults. In this case we
+ use the tagged type's tag directly as the controlling argument for
+ the calls.
+ (Expand_Call): Name change on call to Expand_Dispatch_Call.
+
+ * sprint.adb (Sprint_Node_Actual): Split
+ N_Formal_Subprogram_Declaration into two alternatives for the new
+ cases N_Formal_Abstract_Subprogram_Declaration and
+ N_Formal_Concrete_Subprogram_Declaration.
+ Char_Literal_Value field is now a Uint.
+
+ * trans.c: Get rid of junk Uint2 reference.
+ Char_Literal_Value field is now a Uint.
+ (gnat_to_gnu, case N_Aggregate): Check TYPE_UNCHECKED_UNION_P.
+ (gigi): Correct third arg to gimplify_body.
+
+ * ada-tree.h: (TYPE_UNCHECKED_UNION_P): New flag.
+ (TYPE_LANG_FLAG_0): Check for record or union.
+
+ * treepr.adb: Char_Literal_Value field is now a Uint
+
+ * uintp.h, uintp.ads, uintp.adb: Add new routines UI_To_CC and
+ UI_From_CC.
+
+ * widechar.ads, widechar.adb (Is_UTF_32_Non_Graphic): New function
+ Add full UTF-32 support
+ Char_Code is now 32 bits
+
+ * sinput.ads, sinput.adb (Skip_Line_Terminators): Extend to deal with
+ wide character UTF_32 line terminators.
+ Initialize Main_Source_File to avoid error when no main
+ source is loaded.
+
+ * errout.adb (Finalize): Do not check Num_SRef_Pragmas
+ (Main_Source_File) when no main source has been loaded, to avoid
+ potential crash.
+
+2005-02-09 Robert Dewar <dewar@adacore.com>
+
+ * a-strunb.ads, a-strunb.adb: Add missing pragma Ada_05 statements
+ Fix name of Set routine
+
+ * a-strfix.ads, a-strfix.adb: Add new index functions from AI-301 to
+ fixed packages.
+
+ * a-stwise.ads, a-stwise.adb, a-stwifi.ads, a-stwifi.adb,
+ a-strsea.ads, a-strsea.adb: Add new index functions from AI-301 to
+ fixed packages
+
+ * a-witeio.ads, a-witeio.adb, a-textio.ads, a-textio.adb: New function
+ forms of Get_Line subprograms for AI-301.
+
+ * a-wtcoau.adb, a-wtcoau.ads, a-wtcoio.adb, a-wtcoio.ads,
+ a-wtedit.adb, a-wtedit.adb, a-wtedit.ads, a-wttest.adb,
+ a-wttest.ads, a-strmap.ads, a-strmap.adb, a-stwima.adb,
+ a-stwima.ads: Minor reformatting.
+
+2005-02-09 Doug Rupp <rupp@adacore.com>
+ Thomas Quinot <quinot@adacore.com>
+
+ * adaint.c, adaint.h
+ [VMS] (to_ptr32): New function.
+ (MAYBE_TO_PTR32): New macro.
+ (__gnat_portable_spawn,__gnat_portable_no_block_spawn): Adjust argv
+ for pointer size.
+ [VMS] (descriptor_s, ile_s): Use __char_ptr32 for adr field.
+ [VMS] (#define fork()): Remove since unneccessary.
+ (__gnat_set_close_on_exec): New routine to support
+ GNAT.OS_Lib.Set_Close_On_Exec.
+
+ * g-expect.adb (Set_Up_Communications): Mark the pipe descriptors for
+ the parent side as close-on-exec so that they are not inherited by the
+ child.
+
+ * g-os_lib.ads, g-os_lib.adb (Set_Close_On_Exec): New subprogram to
+ set or clear the FD_CLOEXEC flag on a file descriptor.
+
+2005-02-09 Eric Botcazou <ebotcazou@adacore.com>
+ Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ Fix for c330001 - PR ada/19386
+
+ * decl.c:
+ (gnat_to_gnu_field): Do not necessarily invoke make_packable_type
+ on the field if Pragma Component_Alignment (Storage_Unit).
+ (gnat_to_gnu_entity, case object): Do not treat a renaming that has
+ side-effects as if it were a constant; also make SAVE_EXPR to protect
+ side-effects.
+ (gnat_to_gnu_entity, case E_Record_Subtype): If have _Parent, make a
+ UNION_TYPE.
+ (make_dummy_type): Set TYPE_UNCHECKED_UNION_P.
+ (components_to_record): Test it.
+ Fix improper usage of REFERENCE_CLASS_P.
+
+ * utils2.c (build_binary_op, case MODIFY_EXPRP): Treat UNION_TYPE as
+ RECORD_TYPE.
+
+ * utils2.c: Minor reformatting.
+
+ * utils.c (convert, case UNION_TYPE): Check TYPE_UNCHECKED_UNION;
+ handle other cases like RECORD_TYPE.
+
+ * utils.c (gnat_pushdecl): Set TREE_NO_WARNING.
+
+2005-02-09 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Gen_Assign): If the expression is an aggregate for a
+ component of an array of arrays in an assignment context, and the
+ aggregate has component associations that require sliding on
+ assignment, force reanalysis of the aggregate to generate a temporary
+ before the assignment.
+ (Must_Slide): Make global to the package, for use in Gen_Assign.
+
+2005-02-09 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch4.adb (Expand_Composite_Equality): If a component is an
+ unchecked union with no inferable discriminants, return a
+ Raise_Program_Error node, rather than inserting it at the point the
+ type is frozen.
+ (Expand_Record_Equality, Component_Equality): Handle properly the case
+ where some subcomponent is an unchecked union whose generated equality
+ code raises program error.
+
+2005-02-09 Doug Rupp <rupp@adacore.com>
+
+ * gnatbl.c: [VMS] (_POSIX_EXIT): Define.
+ [VMS] (#define exit hack): Remove.
+
+2005-02-09 Pascal Obry <obry@adacore.com>
+ Arnaud Charlet <charlet@adacore.com>
+
+ * init.c (__gnat_initialize): Add a new parameter eh which contains the
+ address of the exception registration. The Win32 version of this
+ routine calls __gnat_install_SEH_handler() to initialize the SEH
+ (Structured Exception Handling) handler.
+ (__gnat_error_handler) [Win32]: Removed. Not needed as we use
+ SEH (Structured Exception Handling) now.
+ (__gnat_install_handler) [Win32]: Nothing to do now as we use SEH.
+ (__gnat_initialize for ppc-vxworks): Adjust comments and the
+ preprocessor condition protecting the call to the extra eh setup
+ subprogram, which is only available for the ppc target.
+ (__gnat_clear_exception_count): replaced reference to
+ variable taskIdCurrent by call to taskIdSelf(), cleaner.
+
+ * seh_init.c: New file.
+
+ * Make-lang.in: (GNAT_ADA_OBJS): Add seh_init.o.
+ (GNATBIND_OBJS): Idem.
+
+ * misc.c (gnat_parse_file): Update call to __gnat_initialize. This
+ routine takes a new parameter (a pointer to the exception registration
+ for the SEH (Structured Exception Handling) support.
+
+ * raise.h: (__gnat_install_SEH_handler): New prototype.
+ Update copyright notice.
+
+ * s-tassta.adb (Task_Wrapper): Declare the exception registration
+ record and initialize it by calling __gnat_install_SEH_handler.
+
+2005-02-09 Vincent Celier <celier@adacore.com>
+
+ * make.adb (Gnatmake): Do not fail when the main project has no object
+ directory.
+
+2005-02-09 Doug Rupp <rupp@adacore.com>
+
+ * Makefile.in [VMS] (LN,LN_S): Define as cp -p
+ Rename s-asthan-vms.adb to s-asthan-vms-alpha.adb.
+ [VMS]: Add translations for g-enblsp.adb.
+
+ * s-asthan-vms.adb: Removed.
+ * s-asthan-vms-alpha.adb: Added.
+
+2005-02-09 Pascal Obry <obry@adacore.com>
+
+ * Makefile.in (LIBGNAT_SRCS): Add seh_init.c.
+ (LIBGNAT_OBJS): Add seh_init.o.
+
+2005-02-09 Arnaud Charlet <charlet@adacore.com>
+
+ PR ada/16592
+
+ * Makefile.in: Link all gnat tools with -static-libgcc, since
+ -shared-libgcc is now used by default on some systems (e.g. linux with
+ recent binutils).
+ Remove references to Makefile.prolog/generic, no longer used.
+
+2005-02-09 Vincent Celier <celier@adacore.com>
+
+ * prj-makr.adb (Process_Directory): Put file name in canonical case
+ before matching against the patterns.
+ If gnatname has been invoked as <prefix>-gnatname
+ then invoke the compiler as <prefix>-gcc, not just "gcc".
+
+2005-02-09 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Analyze_Selected_Component): Create Actual_Subtype even
+ with expansion disabled. The actual subtype is needed among other
+ places when the selected component appears in the context of a loop
+ bound, and denotes a packed array.
+ (Operator_Check): Always use the first subtype in the
+ error message, to avoid the appearance of internal base types.
+ (Transform_Object_Operation): Copy each actual in full
+ to the parameter associations of the constructed call, rather than
+ using the shallow copy mechanism of New_Copy_List. This ensures that
+ the chaining of named associations is done properly.
+ (Complete_Object_Operation): Rewrite node, rather than
+ replacing it, so that we can trace back to the original selected
+ component.
+
+ * sem_elab.adb (Set_Elaboration_Constraint): For initialization calls,
+ and calls that use object notation, if the called function is not
+ declared in a withed unit, place the elaboration constraint on the
+ unit in the context that makes the function accessible.
+ (Check_Elab_Subtype_Declaration): Check whether a subtype declaration
+ imposes an elaboration constraint between two packages.
+
+2005-02-09 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch7.adb (Uninstall_Declarations): Exchange full and private
+ views of a private type after handling its private dependents, to
+ maintain proper stack discipline between entry and exit from the
+ package.
+
+2005-02-09 Cyrille Comar <comar@adacore.com>
+
+ * s-finimp.adb: (Finalize_List): Optimize in the no-abort case.
+ Minor reformatting.
+
+2005-02-09 Arnaud Charlet <charlet@adacore.com>
+
+ * s-tporft.adb (Register_Foreign_Thread): Initialize Task_Image[_Len]
+ fields for foreign threads.
+
+2005-02-09 Doug Rupp <rupp@adacore.com>
+
+ * s-vaflop.adb: Add pragma Warnings (Off) to eliminate infinite
+ recursion warnings when compiled with -gnatdm.
+
+2005-02-09 Robert Dewar <dewar@adacore.com>
+
+ * usage.adb: Add line for switch -gnat05 (allow Ada 2005 extensions)
+ Slight fix to documentation of -gnaty with no parameters
+
+ * xr_tabls.ads: Add ??? comment for missing overall comment
+
+ * xsinfo.adb: Make default file name be sinfo.h, since this is what
+ we now use by default.
+
+ * xsnames.adb: Adjust end of file test to look for five space followed
+ by '#' instead of six spaces. The format of xsnames.adb was modified
+ in the last update.
+
+ * a-numeri.ads: Add reference to AI-388 for greek letter pi
+ identifier.
+
+ * clean.adb: Minor reformatting.
+
+ * gnat1drv.adb, gnatfind.adb, gnatlink.adb, gnatmem.adb,
+ gnatname.adb: Minor reformatting
+ Add 2005 to copyright output when utility is run
+
+ * csets.adb: Eliminate obsolete comment
+
+ * debug.adb, g-socket.ads, i-cobol.adb: Minor reformatting throughout
+ Update comments.
+
+ * sem_eval.ads (Eval_Integer_Literal): Do not inline this, not useful.
+
+2005-02-09 Sergey Rybin <rybin@adacore.com>
+
+ * gnat_ugn.texi: Add to the gnatpp section the paragraph describing
+ the difference between compact and incompact layout and add the record
+ representation clause to the example illustrating different layouts.
+ Add the description of '-A5' gnatpp option ("align 'AT' keywords in
+ component clauses").
+
+2005-02-09 Florian Villoing <villoing@adacore.com>
+
+ * gnat_ugn.texi: Fix typos.
+ Use @command to display 'gcc', 'gnatbind', etc. insted of @code or
+ @file.
+ Make proper use of @ref, @xref and @pxref to avoid duplication of "see"
+ in the generated documentation.
+
+2005-02-09 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat_ugn.texi: Remove all mentions of FSU threads, which are no
+ longer supported.
+ Update linker wrapper when linking with non GNU C++.
+
+2005-02-09 Pascal Obry <obry@adacore.com>
+
+ * gnat_ugn.texi:
+ Document the procedure to debug the DllMain routine on Windows.
+ Add note about -funwind-tables and mixed Ada and C/C++ programming in
+ ZCX mode.
+ Document new BIND qualifer /RETURN_CODES=VMS.
+
+2005-02-09 Ben Brosgol <brosgol@adacore.com>
+
+ * gnat_ugn.texi: Wordsmithing of "GNAT and Libraries" chapter
+ Edited gnatmetric chapter
+
+2005-02-09 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi:
+ Changes to document new wide wide character support
+ For AI-285
+ Update documentation on Normalize_Scalars and Initialize_Scalars
+
+2005-02-09 Pascal Obry <obry@adacore.com>
+
+ * s-taprop-mingw.adb, s-soflin.ads: Minor reformatting.
+
+2005-02-09 Jose Ruiz <ruiz@adacore.com>
+
+ * s-osinte-vxworks.ads (taskPriorityGet): Add this function (imported
+ from the VxWorks kernel) that is needed for getting the active
+ priority of the different tasks.
+
+ * s-atacco.ads, s-atacco.adb (Nothing): Remove this dummy procedure.
+ Use a pragma Elaborate_Body in the spec file instead.
+ Noticed by code reading.
+
+2005-02-09 Thomas Quinot <quinot@adacore.com>
+
+ * exp_util.ads: Minor correction in comment.
+
+2005-02-09 Arnaud Charlet <charlet@adacore.com>
+
+ * s-taprop.ads (Initialize): Update comments. Remove pragma Inline,
+ since this procedure is now too complex to be worth inlining.
+
+2005-02-09 Richard Henderson <rth@redhat.com>
+
+ * utils.c (gnat_define_builtin): Remove.
+ (gnat_install_builtins): Use build_common_builtin_nodes.
+
+2005-02-09 Arnaud Charlet <charlet@adacore.com>
+
+ * a-rbtgso.adb, a-crbtgo.ads, a-crbtgo.adb, a-crbtgk.ads,
+ a-crbtgk.adb, a-crbltr.ads, a-coprnu.ads, a-coprnu.adb,
+ a-coorse.ads, a-coorse.adb, a-convec.ads, a-convec.adb,
+ a-contai.ads, a-coinve.ads, a-coinve.adb, a-cohata.ads,
+ a-cohama.ads, a-cohama.adb, a-ciorse.ads, 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-cgarso.ads, a-cgarso.adb, a-cdlili.ads, a-cdlili.adb,
+ a-cgaaso.adb, a-coormu.adb, a-ciormu.adb, a-cihase.adb,
+ a-cihase.ads, a-cohase.adb, a-cohase.ads, a-ciorma.ads,
+ a-coorma.ads, a-swunha.ads, a-stunha.ads, a-ciormu.ads,
+ a-coormu.ads, a-rbtgso.ads, a-swunha.adb, a-stunha.adb,
+ a-cgaaso.ads, a-ciorma.adb, a-coorma.adb, a-secain.adb,
+ a-secain.ads, a-slcain.ads, a-slcain.adb, a-shcain.ads,
+ a-shcain.adb, a-chtgke.ads, a-chtgke.adb, a-stwiha.ads,
+ a-stwiha.adb, a-strhas.ads, a-strhas.adb, a-chzla1.ads,
+ a-chzla9.ads, a-lfztio.ads, a-liztio.ads, a-llfzti.ads,
+ a-llizti.ads, a-sfztio.ads, a-siztio.ads, a-ssizti.ads,
+ a-stzbou.adb, a-stzbou.ads, a-stzfix.adb, a-stzfix.ads,
+ a-stzhas.adb, a-stzhas.ads, a-stzmap.adb, a-stzmap.ads,
+ a-stzsea.adb, a-stzsea.ads, a-stzsup.adb, a-stzsup.ads,
+ a-stzunb.adb, a-stzunb.ads, a-swunau.adb, a-swunau.ads,
+ a-szmzco.ads, a-szunau.adb, a-szunau.ads, a-szunha.adb,
+ a-szunha.ads, a-szuzti.adb, a-szuzti.ads, a-tiunio.ads,
+ a-wwunio.ads, a-ztcoau.adb, a-ztcoau.ads, a-ztcoio.adb,
+ a-ztcoio.ads, a-ztcstr.adb, a-ztcstr.ads, a-ztdeau.adb,
+ a-ztdeau.ads, a-ztdeio.adb, a-ztdeio.ads, a-ztedit.adb,
+ a-ztedit.ads, a-ztenau.adb, a-ztenau.ads, a-ztenio.adb,
+ a-ztenio.ads, a-ztexio.adb, a-ztexio.ads, a-ztfiio.adb,
+ a-ztfiio.ads, a-ztflau.adb, a-ztflau.ads, a-ztflio.adb,
+ a-ztflio.ads, a-ztgeau.adb, a-ztgeau.ads, a-ztinau.adb,
+ a-ztinau.ads, a-ztinio.adb, a-ztinio.ads, a-ztmoau.adb,
+ a-ztmoau.ads, a-ztmoio.adb, a-ztmoio.ads, a-zttest.adb,
+ a-zttest.ads, a-zzunio.ads: New files. Part of new Ada 2005
+ library.
+
2005-01-27 Laurent GUERBY <laurent@guerby.net>
* Makefile.in: Fix a-intnam.ads from previous commit,
diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in
index 9a03fafa6d7..220b3563a29 100644
--- a/gcc/ada/Make-lang.in
+++ b/gcc/ada/Make-lang.in
@@ -146,7 +146,7 @@ GNAT_ADA_OBJS = ada/ada.o ada/a-charac.o ada/a-chlat1.o ada/a-except.o \
ada/stylesw.o ada/validsw.o ada/system.o ada/table.o ada/targparm.o \
ada/tbuild.o ada/tree_gen.o ada/tree_io.o ada/treepr.o ada/treeprs.o \
ada/ttypef.o ada/ttypes.o ada/types.o ada/uintp.o ada/uname.o ada/urealp.o \
- ada/usage.o ada/widechar.o ada/s-crtl.o
+ ada/usage.o ada/widechar.o ada/s-crtl.o ada/seh_init.o
# Object files for gnat executables
GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o
@@ -161,6 +161,7 @@ GNATBIND_OBJS = \
ada/cstreams.o \
ada/final.o \
ada/init.o \
+ ada/seh_init.o \
ada/link.o \
ada/raise.o \
ada/tracebak.o \
diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in
index edf39b63f49..1e6e5350f3d 100644
--- a/gcc/ada/Makefile.in
+++ b/gcc/ada/Makefile.in
@@ -163,6 +163,7 @@ GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
program_transform_name =
objdir = .
+target_alias=@target_alias@
target=@target@
xmake_file = @xmake_file@
tmake_file = @tmake_file@
@@ -1174,6 +1175,8 @@ ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(host))),
soext = .exe
hyphen = _
+LN = cp -p
+LN_S = cp -p
ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
AR = iar
@@ -1188,6 +1191,7 @@ endif
ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(targ))),)
ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
LIBGNAT_TARGET_PAIRS_AUX1 = \
+ g-enblsp.adb<g-enblsp-vms-ia64.adb \
s-auxdec.ads<s-auxdec-vms_64.ads \
s-crtl.ads<s-crtl-vms.ads \
s-osinte.adb<s-osinte-vms-ia64.adb \
@@ -1196,6 +1200,8 @@ ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
else
ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
LIBGNAT_TARGET_PAIRS_AUX1 = \
+ g-enblsp.adb<g-enblsp-vms-alpha.adb \
+ s-asthan.adb<s-asthan-vms-alpha.adb \
s-crtl.ads<s-crtl-vms.ads \
s-osinte.adb<s-osinte-vms.adb \
s-osinte.ads<s-osinte-vms.ads \
@@ -1227,7 +1233,6 @@ endif
i-cstrea.adb<i-cstrea-vms.adb \
i-cpp.adb<i-cpp-vms.adb \
interfac.ads<interfac-vms.ads \
- s-asthan.adb<s-asthan-vms.adb \
s-inmaop.adb<s-inmaop-vms.adb \
s-interr.adb<s-interr-vms.adb \
s-intman.adb<s-intman-vms.adb \
@@ -1262,7 +1267,7 @@ endif
EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
EXTRA_GNATTOOLS = \
../../gnatlbr$(exeext) \
- ,,/../gnatsym$(exeext)
+ ../../gnatsym$(exeext)
# This command transforms (YYYYMMDD) into YY,MMDD
GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
@@ -1334,7 +1339,6 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
GMEM_LIB = gmemlib
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
LIBRARY_VERSION := $(LIB_VERSION)
-
endif
ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
@@ -1448,12 +1452,12 @@ endif
# subdirectory and copied.
LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
errno.c exit.c cal.c ctrl_c.c \
- raise.h raise.c sysdep.c aux-io.c init.c \
+ raise.h raise.c sysdep.c aux-io.c init.c seh_init.c \
final.c tracebak.c tb-alvms.c tb-alvxw.c expect.c mkdir.c socket.c gsocket.h \
$(EXTRA_LIBGNAT_SRCS)
LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o \
- raise.o sysdep.o aux-io.o init.o cal.o final.o \
+ raise.o sysdep.o aux-io.o init.o seh_init.o cal.o final.o \
tracebak.o expect.o mkdir.o socket.o $(EXTRA_LIBGNAT_OBJS)
# NOTE ??? - when the -I option for compiling Ada code is made to work,
@@ -1474,8 +1478,7 @@ GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
ADA_INCLUDE_SRCS =\
ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
machcode.ads text_io.ads unchconv.ads unchdeal.ads \
- sequenio.ads system.ads Makefile.prolog Makefile.generic \
- memtrack.adb \
+ sequenio.ads system.ads Makefile.adalib memtrack.adb \
a-*.adb a-*.ads g-*.ad? i-*.ad? \
s-[a-o]*.adb s-[p-z]*.adb \
s-[a-o]*.ads s-[p-z]*.ads
@@ -1497,6 +1500,8 @@ TOOLS_FLAGS_TO_PASS= \
"GNATLINK=$(GNATLINK)" \
"GNATBIND=$(GNATBIND)"
+GCC_LINK="$(CC) -static-libgcc $(ADA_INCLUDES)"
+
# Build directory for the tools. Let's copy the target-dependent
# sources using the same mechanism as for gnatlib. The other sources are
# accessed using the vpath directive below
@@ -1574,83 +1579,74 @@ gnattools4: ../stamp-tools
../../gnatchop$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop
- $(GNATLINK) -v gnatchop -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatchop -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnat$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd
- $(GNATLINK) -v gnatcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatcmd -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatkr$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr
- $(GNATLINK) -v gnatkr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatkr -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatls$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls
- $(GNATLINK) -v gnatls -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatls -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatname$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname
- $(GNATLINK) -v gnatname -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatname -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gprmake$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gprmake --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprmake
- $(GNATLINK) -v gprmake -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gprmake -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatprep$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep
- $(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatprep -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatxref$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref
- $(GNATLINK) -v gnatxref -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatxref -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatfind$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind
- $(GNATLINK) -v gnatfind -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatfind -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatclean$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
- $(GNATLINK) -v gnatclean -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatclean -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatsym$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
- $(GNATLINK) -v gnatsym -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatsym -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../gnatdll$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
- $(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatdll -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
../../vxaddr2line$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
- $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(CLIB)
+ $(GNATLINK) -v vxaddr2line -o $@ --GCC=$(GCC_LINK) $(CLIB)
gnatmake-re: ../stamp-tools link.o
$(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
$(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
$(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
- --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
+ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
# Note the use of the "mv" command in order to allow gnatlink to be linked with
# with the former version of gnatlink itself which cannot override itself.
@@ -1658,7 +1654,7 @@ gnatlink-re: ../stamp-tools link.o
$(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
$(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
- --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
+ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
$(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
# Needs to be built with CC=gcc
@@ -1695,15 +1691,10 @@ install-gnatlib: ../stamp-gnatlib
# deleting the right one.
-$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
-$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
$(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
$(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- $(RMDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
-$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
-$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
- -$(INSTALL_DATA) rts/Makefile.prolog $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
- -$(INSTALL_DATA) rts/Makefile.generic $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
for file in rts/*.ali; do \
$(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
done
@@ -1987,7 +1978,6 @@ b_gnatm.o : b_gnatm.c
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
-ADA_SHARE_MAKE_DIR = $(prefix)/share/gnat
# force no sibling call optimization on s-traceb.o so the number of stack
# frames to be skipped when computing a call chain is not modified by
@@ -2043,7 +2033,12 @@ mkdir.o : mkdir.c
socket.o : socket.c gsocket.h
sysdep.o : sysdep.c
-cio.o : cio.c
+gen-soccon: gen-soccon.c gsocket.h
+ $(CC) $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
+ $(ALL_CPPFLAGS) $(INCLUDES) -DTARGET=\"$(target_alias)\" \
+ $< $(OUTPUT_OPTION)
+
+cio.o : cio.c
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
@@ -2051,6 +2046,12 @@ init.o : init.c ada.h types.h raise.h
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+# No optimization to compile this file as optimizations (-O1 or above) breaks
+# the SEH handling on Windows. The reasons are not clear.
+seh_init.o : seh_init.c raise.h
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) -O0 \
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
raise.o : raise.c raise.h
$(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
@@ -2072,5 +2073,4 @@ force:
../../gnatlbr$(exeext): ../../prefix.o
$(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
- $(GNATLINK) -v gnatlbr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatlbr -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index 4c01553fe50..282cbff9569 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1,5 +1,5 @@
# Makefile.rtl for GNU Ada Compiler (GNAT).
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -75,13 +75,40 @@ GNATRTL_TASKING_OBJS= \
GNATRTL_NONTASKING_OBJS= \
a-caldel$(objext) \
a-calend$(objext) \
+ a-cdlili$(objext) \
+ a-cgaaso$(objext) \
+ a-cgarso$(objext) \
+ a-cgcaso$(objext) \
a-chahan$(objext) \
a-charac$(objext) \
a-chlat1$(objext) \
a-chlat9$(objext) \
+ a-chtgke$(objext) \
+ a-chtgop$(objext) \
+ a-chzla1$(objext) \
+ a-chzla9$(objext) \
+ a-cidlli$(objext) \
+ a-cihama$(objext) \
+ a-cihase$(objext) \
+ a-ciorma$(objext) \
+ a-ciormu$(objext) \
+ a-ciorse$(objext) \
+ a-cohama$(objext) \
+ a-cohase$(objext) \
+ a-cohata$(objext) \
+ a-coinve$(objext) \
a-colien$(objext) \
a-colire$(objext) \
a-comlin$(objext) \
+ a-contai$(objext) \
+ a-convec$(objext) \
+ a-coorma$(objext) \
+ a-coormu$(objext) \
+ a-coorse$(objext) \
+ a-coprnu$(objext) \
+ a-crbltr$(objext) \
+ a-crbtgk$(objext) \
+ a-crbtgo$(objext) \
a-cwila1$(objext) \
a-cwila9$(objext) \
a-decima$(objext) \
@@ -102,12 +129,16 @@ GNATRTL_NONTASKING_OBJS= \
a-iwteio$(objext) \
a-lfteio$(objext) \
a-lfwtio$(objext) \
+ a-lfztio$(objext) \
a-liteio$(objext) \
a-liwtio$(objext) \
+ a-liztio$(objext) \
a-llftio$(objext) \
a-llfwti$(objext) \
+ a-llfzti$(objext) \
a-llitio$(objext) \
a-lliwti$(objext) \
+ a-llizti$(objext) \
a-ncelfu$(objext) \
a-ngcefu$(objext) \
a-ngcoty$(objext) \
@@ -127,20 +158,28 @@ GNATRTL_NONTASKING_OBJS= \
a-nuflra$(objext) \
a-numaux$(objext) \
a-numeri$(objext) \
+ a-rbtgso$(objext) \
+ a-secain$(objext) \
a-sequio$(objext) \
a-sfteio$(objext) \
a-sfwtio$(objext) \
+ a-sfztio$(objext) \
+ a-shcain$(objext) \
a-siocst$(objext) \
a-siteio$(objext) \
a-siwtio$(objext) \
+ a-siztio$(objext) \
+ a-slcain$(objext) \
a-ssicst$(objext) \
a-ssitio$(objext) \
a-ssiwti$(objext) \
+ a-ssizti$(objext) \
a-stmaco$(objext) \
a-storio$(objext) \
a-strbou$(objext) \
a-stream$(objext) \
a-strfix$(objext) \
+ a-strhas$(objext) \
a-string$(objext) \
a-strmap$(objext) \
a-strsea$(objext) \
@@ -148,15 +187,30 @@ GNATRTL_NONTASKING_OBJS= \
a-strunb$(objext) \
a-ststio$(objext) \
a-stunau$(objext) \
+ a-stunha$(objext) \
a-stwibo$(objext) \
a-stwifi$(objext) \
+ a-stwiha$(objext) \
a-stwima$(objext) \
a-stwise$(objext) \
a-stwisu$(objext) \
a-stwiun$(objext) \
+ a-stzbou$(objext) \
+ a-stzfix$(objext) \
+ a-stzhas$(objext) \
+ a-stzmap$(objext) \
+ a-stzsea$(objext) \
+ a-stzsup$(objext) \
+ a-stzunb$(objext) \
a-suteio$(objext) \
- a-swuwti$(objext) \
a-swmwco$(objext) \
+ a-swunau$(objext) \
+ a-swunha$(objext) \
+ a-swuwti$(objext) \
+ a-szmzco$(objext) \
+ a-szunau$(objext) \
+ a-szunha$(objext) \
+ a-szuzti$(objext) \
a-tags$(objext) \
a-teioed$(objext) \
a-textio$(objext) \
@@ -176,6 +230,7 @@ GNATRTL_NONTASKING_OBJS= \
a-timoio$(objext) \
a-tiocst$(objext) \
a-titest$(objext) \
+ a-tiunio$(objext) \
a-unccon$(objext) \
a-uncdea$(objext) \
a-witeio$(objext) \
@@ -196,6 +251,26 @@ GNATRTL_NONTASKING_OBJS= \
a-wtmoau$(objext) \
a-wtmoio$(objext) \
a-wttest$(objext) \
+ a-wwunio$(objext) \
+ a-ztcoau$(objext) \
+ a-ztcoio$(objext) \
+ a-ztcstr$(objext) \
+ a-ztdeau$(objext) \
+ a-ztdeio$(objext) \
+ a-ztedit$(objext) \
+ a-ztenau$(objext) \
+ a-ztenio$(objext) \
+ a-ztexio$(objext) \
+ a-ztfiio$(objext) \
+ a-ztflau$(objext) \
+ a-ztflio$(objext) \
+ a-ztgeau$(objext) \
+ a-ztinau$(objext) \
+ a-ztinio$(objext) \
+ a-ztmoau$(objext) \
+ a-ztmoio$(objext) \
+ a-zttest$(objext) \
+ a-zzunio$(objext) \
ada$(objext) \
calendar$(objext) \
g-arrspl$(objext) \
@@ -256,7 +331,9 @@ GNATRTL_NONTASKING_OBJS= \
g-table$(objext) \
g-tasloc$(objext) \
g-traceb$(objext) \
+ g-utf_32$(objext) \
g-wistsp$(objext) \
+ g-zstspl$(objext) \
gnat$(objext) \
i-c$(objext) \
i-cexten$(objext) \
diff --git a/gcc/ada/a-chahan.adb b/gcc/ada/a-chahan.adb
index 11733401137..c94a999ddf3 100644
--- a/gcc/ada/a-chahan.adb
+++ b/gcc/ada/a-chahan.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -281,7 +281,7 @@ package body Ada.Characters.Handling is
-- Is_Alphanumeric --
---------------------
- function Is_Alphanumeric (Item : in Character) return Boolean is
+ function Is_Alphanumeric (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Alphanum) /= 0;
end Is_Alphanumeric;
@@ -290,7 +290,7 @@ package body Ada.Characters.Handling is
-- Is_Basic --
--------------
- function Is_Basic (Item : in Character) return Boolean is
+ function Is_Basic (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Basic) /= 0;
end Is_Basic;
@@ -299,16 +299,21 @@ package body Ada.Characters.Handling is
-- Is_Character --
------------------
- function Is_Character (Item : in Wide_Character) return Boolean is
+ function Is_Character (Item : Wide_Character) return Boolean is
begin
return Wide_Character'Pos (Item) < 256;
end Is_Character;
+ function Is_Character (Item : Wide_Wide_Character) return Boolean is
+ begin
+ return Wide_Wide_Character'Pos (Item) < 256;
+ end Is_Character;
+
----------------
-- Is_Control --
----------------
- function Is_Control (Item : in Character) return Boolean is
+ function Is_Control (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Control) /= 0;
end Is_Control;
@@ -317,7 +322,7 @@ package body Ada.Characters.Handling is
-- Is_Digit --
--------------
- function Is_Digit (Item : in Character) return Boolean is
+ function Is_Digit (Item : Character) return Boolean is
begin
return Item in '0' .. '9';
end Is_Digit;
@@ -326,7 +331,7 @@ package body Ada.Characters.Handling is
-- Is_Graphic --
----------------
- function Is_Graphic (Item : in Character) return Boolean is
+ function Is_Graphic (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Graphic) /= 0;
end Is_Graphic;
@@ -335,7 +340,7 @@ package body Ada.Characters.Handling is
-- Is_Hexadecimal_Digit --
--------------------------
- function Is_Hexadecimal_Digit (Item : in Character) return Boolean is
+ function Is_Hexadecimal_Digit (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Hex_Digit) /= 0;
end Is_Hexadecimal_Digit;
@@ -344,7 +349,7 @@ package body Ada.Characters.Handling is
-- Is_ISO_646 --
----------------
- function Is_ISO_646 (Item : in Character) return Boolean is
+ function Is_ISO_646 (Item : Character) return Boolean is
begin
return Item in ISO_646;
end Is_ISO_646;
@@ -352,7 +357,7 @@ package body Ada.Characters.Handling is
-- Note: much more efficient coding of the following function is possible
-- by testing several 16#80# bits in a complete word in a single operation
- function Is_ISO_646 (Item : in String) return Boolean is
+ function Is_ISO_646 (Item : String) return Boolean is
begin
for J in Item'Range loop
if Item (J) not in ISO_646 then
@@ -367,7 +372,7 @@ package body Ada.Characters.Handling is
-- Is_Letter --
---------------
- function Is_Letter (Item : in Character) return Boolean is
+ function Is_Letter (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Letter) /= 0;
end Is_Letter;
@@ -376,7 +381,7 @@ package body Ada.Characters.Handling is
-- Is_Lower --
--------------
- function Is_Lower (Item : in Character) return Boolean is
+ function Is_Lower (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Lower) /= 0;
end Is_Lower;
@@ -385,7 +390,7 @@ package body Ada.Characters.Handling is
-- Is_Special --
----------------
- function Is_Special (Item : in Character) return Boolean is
+ function Is_Special (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Special) /= 0;
end Is_Special;
@@ -394,7 +399,7 @@ package body Ada.Characters.Handling is
-- Is_String --
---------------
- function Is_String (Item : in Wide_String) return Boolean is
+ function Is_String (Item : Wide_String) return Boolean is
begin
for J in Item'Range loop
if Wide_Character'Pos (Item (J)) >= 256 then
@@ -405,25 +410,60 @@ package body Ada.Characters.Handling is
return True;
end Is_String;
+ function Is_String (Item : Wide_Wide_String) return Boolean is
+ begin
+ for J in Item'Range loop
+ if Wide_Wide_Character'Pos (Item (J)) >= 256 then
+ return False;
+ end if;
+ end loop;
+
+ return True;
+ end Is_String;
+
--------------
-- Is_Upper --
--------------
- function Is_Upper (Item : in Character) return Boolean is
+ function Is_Upper (Item : Character) return Boolean is
begin
return (Char_Map (Item) and Upper) /= 0;
end Is_Upper;
+ -----------------------
+ -- Is_Wide_Character --
+ -----------------------
+
+ function Is_Wide_Character (Item : Wide_Wide_Character) return Boolean is
+ begin
+ return Wide_Wide_Character'Pos (Item) < 2**16;
+ end Is_Wide_Character;
+
+ --------------------
+ -- Is_Wide_String --
+ --------------------
+
+ function Is_Wide_String (Item : Wide_Wide_String) return Boolean is
+ begin
+ for J in Item'Range loop
+ if Wide_Wide_Character'Pos (Item (J)) >= 2**16 then
+ return False;
+ end if;
+ end loop;
+
+ return True;
+ end Is_Wide_String;
+
--------------
-- To_Basic --
--------------
- function To_Basic (Item : in Character) return Character is
+ function To_Basic (Item : Character) return Character is
begin
return Value (Basic_Map, Item);
end To_Basic;
- function To_Basic (Item : in String) return String is
+ function To_Basic (Item : String) return String is
Result : String (1 .. Item'Length);
begin
@@ -439,9 +479,8 @@ package body Ada.Characters.Handling is
------------------
function To_Character
- (Item : in Wide_Character;
- Substitute : in Character := ' ')
- return Character
+ (Item : Wide_Character;
+ Substitute : Character := ' ') return Character
is
begin
if Is_Character (Item) then
@@ -451,14 +490,25 @@ package body Ada.Characters.Handling is
end if;
end To_Character;
+ function To_Character
+ (Item : Wide_Wide_Character;
+ Substitute : Character := ' ') return Character
+ is
+ begin
+ if Is_Character (Item) then
+ return Character'Val (Wide_Wide_Character'Pos (Item));
+ else
+ return Substitute;
+ end if;
+ end To_Character;
+
----------------
-- To_ISO_646 --
----------------
function To_ISO_646
- (Item : in Character;
- Substitute : in ISO_646 := ' ')
- return ISO_646
+ (Item : Character;
+ Substitute : ISO_646 := ' ') return ISO_646
is
begin
if Item in ISO_646 then
@@ -469,9 +519,8 @@ package body Ada.Characters.Handling is
end To_ISO_646;
function To_ISO_646
- (Item : in String;
- Substitute : in ISO_646 := ' ')
- return String
+ (Item : String;
+ Substitute : ISO_646 := ' ') return String
is
Result : String (1 .. Item'Length);
@@ -491,12 +540,12 @@ package body Ada.Characters.Handling is
-- To_Lower --
--------------
- function To_Lower (Item : in Character) return Character is
+ function To_Lower (Item : Character) return Character is
begin
return Value (Lower_Case_Map, Item);
end To_Lower;
- function To_Lower (Item : in String) return String is
+ function To_Lower (Item : String) return String is
Result : String (1 .. Item'Length);
begin
@@ -512,9 +561,22 @@ package body Ada.Characters.Handling is
---------------
function To_String
- (Item : in Wide_String;
- Substitute : in Character := ' ')
- return String
+ (Item : Wide_String;
+ Substitute : Character := ' ') return String
+ is
+ Result : String (1 .. Item'Length);
+
+ begin
+ for J in Item'Range loop
+ Result (J - (Item'First - 1)) := To_Character (Item (J), Substitute);
+ end loop;
+
+ return Result;
+ end To_String;
+
+ function To_String
+ (Item : Wide_Wide_String;
+ Substitute : Character := ' ') return String
is
Result : String (1 .. Item'Length);
@@ -522,6 +584,7 @@ package body Ada.Characters.Handling is
for J in Item'Range loop
Result (J - (Item'First - 1)) := To_Character (Item (J), Substitute);
end loop;
+
return Result;
end To_String;
@@ -530,16 +593,14 @@ package body Ada.Characters.Handling is
--------------
function To_Upper
- (Item : in Character)
- return Character
+ (Item : Character) return Character
is
begin
return Value (Upper_Case_Map, Item);
end To_Upper;
function To_Upper
- (Item : in String)
- return String
+ (Item : String) return String
is
Result : String (1 .. Item'Length);
@@ -556,20 +617,30 @@ package body Ada.Characters.Handling is
-----------------------
function To_Wide_Character
- (Item : in Character)
- return Wide_Character
+ (Item : Character) return Wide_Character
is
begin
return Wide_Character'Val (Character'Pos (Item));
end To_Wide_Character;
+ function To_Wide_Character
+ (Item : Wide_Wide_Character;
+ Substitute : Wide_Character := ' ') return Wide_Character
+ is
+ begin
+ if Wide_Wide_Character'Pos (Item) < 2**16 then
+ return Wide_Character'Val (Wide_Wide_Character'Pos (Item));
+ else
+ return Substitute;
+ end if;
+ end To_Wide_Character;
+
--------------------
-- To_Wide_String --
--------------------
function To_Wide_String
- (Item : in String)
- return Wide_String
+ (Item : String) return Wide_String
is
Result : Wide_String (1 .. Item'Length);
@@ -580,4 +651,68 @@ package body Ada.Characters.Handling is
return Result;
end To_Wide_String;
+
+ function To_Wide_String
+ (Item : Wide_Wide_String;
+ Substitute : Wide_Character := ' ') return Wide_String
+ is
+ Result : Wide_String (1 .. Item'Length);
+
+ begin
+ for J in Item'Range loop
+ Result (J - (Item'First - 1)) :=
+ To_Wide_Character (Item (J), Substitute);
+ end loop;
+
+ return Result;
+ end To_Wide_String;
+
+ ----------------------------
+ -- To_Wide_Wide_Character --
+ ----------------------------
+
+ function To_Wide_Wide_Character
+ (Item : Character) return Wide_Wide_Character
+ is
+ begin
+ return Wide_Wide_Character'Val (Character'Pos (Item));
+ end To_Wide_Wide_Character;
+
+ function To_Wide_Wide_Character
+ (Item : Wide_Character) return Wide_Wide_Character
+ is
+ begin
+ return Wide_Wide_Character'Val (Wide_Character'Pos (Item));
+ end To_Wide_Wide_Character;
+
+ -------------------------
+ -- To_Wide_Wide_String --
+ -------------------------
+
+ function To_Wide_Wide_String
+ (Item : String) return Wide_Wide_String
+ is
+ Result : Wide_Wide_String (1 .. Item'Length);
+
+ begin
+ for J in Item'Range loop
+ Result (J - (Item'First - 1)) := To_Wide_Wide_Character (Item (J));
+ end loop;
+
+ return Result;
+ end To_Wide_Wide_String;
+
+ function To_Wide_Wide_String
+ (Item : Wide_String) return Wide_Wide_String
+ is
+ Result : Wide_Wide_String (1 .. Item'Length);
+
+ begin
+ for J in Item'Range loop
+ Result (J - (Item'First - 1)) := To_Wide_Wide_Character (Item (J));
+ end loop;
+
+ return Result;
+ end To_Wide_Wide_String;
+
end Ada.Characters.Handling;
diff --git a/gcc/ada/a-chahan.ads b/gcc/ada/a-chahan.ads
index 0a0162d1d67..ca29d752419 100644
--- a/gcc/ada/a-chahan.ads
+++ b/gcc/ada/a-chahan.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -43,30 +43,30 @@ pragma Preelaborate (Handling);
-- Character Classification Functions --
----------------------------------------
- function Is_Control (Item : in Character) return Boolean;
- function Is_Graphic (Item : in Character) return Boolean;
- function Is_Letter (Item : in Character) return Boolean;
- function Is_Lower (Item : in Character) return Boolean;
- function Is_Upper (Item : in Character) return Boolean;
- function Is_Basic (Item : in Character) return Boolean;
- function Is_Digit (Item : in Character) return Boolean;
- function Is_Decimal_Digit (Item : in Character) return Boolean
- renames Is_Digit;
- function Is_Hexadecimal_Digit (Item : in Character) return Boolean;
- function Is_Alphanumeric (Item : in Character) return Boolean;
- function Is_Special (Item : in Character) return Boolean;
+ function Is_Control (Item : Character) return Boolean;
+ function Is_Graphic (Item : Character) return Boolean;
+ function Is_Letter (Item : Character) return Boolean;
+ function Is_Lower (Item : Character) return Boolean;
+ function Is_Upper (Item : Character) return Boolean;
+ function Is_Basic (Item : Character) return Boolean;
+ function Is_Digit (Item : Character) return Boolean;
+ function Is_Decimal_Digit (Item : Character) return Boolean
+ renames Is_Digit;
+ function Is_Hexadecimal_Digit (Item : Character) return Boolean;
+ function Is_Alphanumeric (Item : Character) return Boolean;
+ function Is_Special (Item : Character) return Boolean;
---------------------------------------------------
-- Conversion Functions for Character and String --
---------------------------------------------------
- function To_Lower (Item : in Character) return Character;
- function To_Upper (Item : in Character) return Character;
- function To_Basic (Item : in Character) return Character;
+ function To_Lower (Item : Character) return Character;
+ function To_Upper (Item : Character) return Character;
+ function To_Basic (Item : Character) return Character;
- function To_Lower (Item : in String) return String;
- function To_Upper (Item : in String) return String;
- function To_Basic (Item : in String) return String;
+ function To_Lower (Item : String) return String;
+ function To_Upper (Item : String) return String;
+ function To_Basic (Item : String) return String;
----------------------------------------------------------------------
-- Classifications of and Conversions Between Character and ISO 646 --
@@ -75,42 +75,69 @@ pragma Preelaborate (Handling);
subtype ISO_646 is
Character range Character'Val (0) .. Character'Val (127);
- function Is_ISO_646 (Item : in Character) return Boolean;
- function Is_ISO_646 (Item : in String) return Boolean;
+ function Is_ISO_646 (Item : Character) return Boolean;
+ function Is_ISO_646 (Item : String) return Boolean;
function To_ISO_646
- (Item : in Character;
- Substitute : in ISO_646 := ' ')
- return ISO_646;
+ (Item : Character;
+ Substitute : ISO_646 := ' ') return ISO_646;
function To_ISO_646
- (Item : in String;
- Substitute : in ISO_646 := ' ')
- return String;
+ (Item : String;
+ Substitute : ISO_646 := ' ') return String;
------------------------------------------------------
-- Classifications of Wide_Character and Characters --
------------------------------------------------------
- function Is_Character (Item : in Wide_Character) return Boolean;
- function Is_String (Item : in Wide_String) return Boolean;
+ function Is_Character (Item : Wide_Character) return Boolean;
+ function Is_Character (Item : Wide_Wide_Character) return Boolean;
+ function Is_String (Item : Wide_String) return Boolean;
+ function Is_String (Item : Wide_Wide_String) return Boolean;
+ function Is_Wide_Character (Item : Wide_Wide_Character) return Boolean;
+ function Is_Wide_String (Item : Wide_Wide_String) return Boolean;
- ------------------------------------------------------
- -- Conversions between Wide_Character and Character --
- ------------------------------------------------------
+ ---------------------------------------------------------------------------
+ -- Conversions between Wide_Wide_Character, Wide_Character and Character --
+ ---------------------------------------------------------------------------
function To_Character
- (Item : in Wide_Character;
- Substitute : in Character := ' ')
- return Character;
+ (Item : Wide_Character;
+ Substitute : Character := ' ') return Character;
+
+ function To_Character
+ (Item : Wide_Wide_Character;
+ Substitute : Character := ' ') return Character;
function To_String
- (Item : in Wide_String;
- Substitute : in Character := ' ')
- return String;
+ (Item : Wide_String;
+ Substitute : Character := ' ') return String;
- function To_Wide_Character (Item : in Character) return Wide_Character;
- function To_Wide_String (Item : in String) return Wide_String;
+ function To_String
+ (Item : Wide_Wide_String;
+ Substitute : Character := ' ') return String;
+
+ function To_Wide_Character
+ (Item : Character) return Wide_Character;
+ function To_Wide_Character
+ (Item : Wide_Wide_Character;
+ Substitute : Wide_Character := ' ') return Wide_Character;
+
+ function To_Wide_String
+ (Item : String) return Wide_String;
+ function To_Wide_String
+ (Item : Wide_Wide_String;
+ Substitute : Wide_Character := ' ') return Wide_String;
+
+ function To_Wide_Wide_Character
+ (Item : Character) return Wide_Wide_Character;
+ function To_Wide_Wide_Character
+ (Item : Wide_Character) return Wide_Wide_Character;
+
+ function To_Wide_Wide_String
+ (Item : String) return Wide_Wide_String;
+ function To_Wide_Wide_String
+ (Item : Wide_String) return Wide_Wide_String;
private
pragma Inline (Is_Control);
@@ -130,5 +157,6 @@ private
pragma Inline (Is_Character);
pragma Inline (To_Character);
pragma Inline (To_Wide_Character);
+ pragma Inline (To_Wide_Wide_Character);
end Ada.Characters.Handling;
diff --git a/gcc/ada/a-except.adb b/gcc/ada/a-except.adb
index 1ca819011c5..7470d545039 100644
--- a/gcc/ada/a-except.adb
+++ b/gcc/ada/a-except.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -484,6 +484,7 @@ package body Ada.Exceptions is
procedure Rcheck_27 (File : Big_String_Ptr; Line : Integer);
procedure Rcheck_28 (File : Big_String_Ptr; Line : Integer);
procedure Rcheck_29 (File : Big_String_Ptr; Line : Integer);
+ procedure Rcheck_30 (File : Big_String_Ptr; Line : Integer);
pragma Export (C, Rcheck_00, "__gnat_rcheck_00");
pragma Export (C, Rcheck_01, "__gnat_rcheck_01");
@@ -515,6 +516,7 @@ package body Ada.Exceptions is
pragma Export (C, Rcheck_27, "__gnat_rcheck_27");
pragma Export (C, Rcheck_28, "__gnat_rcheck_28");
pragma Export (C, Rcheck_29, "__gnat_rcheck_29");
+ pragma Export (C, Rcheck_30, "__gnat_rcheck_30");
-- None of these procedures ever returns (they raise an exception!). By
-- using pragma No_Return, we ensure that any junk code after the call,
@@ -550,6 +552,7 @@ package body Ada.Exceptions is
pragma No_Return (Rcheck_27);
pragma No_Return (Rcheck_28);
pragma No_Return (Rcheck_29);
+ pragma No_Return (Rcheck_30);
---------------------------------------------
-- Reason Strings for Run-Time Check Calls --
@@ -568,29 +571,30 @@ package body Ada.Exceptions is
Rmsg_05 : constant String := "index check failed" & NUL;
Rmsg_06 : constant String := "invalid data" & NUL;
Rmsg_07 : constant String := "length check failed" & NUL;
- Rmsg_08 : constant String := "overflow check failed" & NUL;
- Rmsg_09 : constant String := "partition check failed" & NUL;
- Rmsg_10 : constant String := "range check failed" & NUL;
- Rmsg_11 : constant String := "tag check failed" & NUL;
- Rmsg_12 : constant String := "access before elaboration" & NUL;
- Rmsg_13 : constant String := "accessibility check failed" & NUL;
- Rmsg_14 : constant String := "all guards closed" & NUL;
- Rmsg_15 : constant String := "duplicated entry address" & NUL;
- Rmsg_16 : constant String := "explicit raise" & NUL;
- Rmsg_17 : constant String := "finalize/adjust raised exception" & NUL;
- Rmsg_18 : constant String := "misaligned address value" & NUL;
- Rmsg_19 : constant String := "missing return" & NUL;
- Rmsg_20 : constant String := "overlaid controlled object" & NUL;
- Rmsg_21 : constant String := "potentially blocking operation" & NUL;
- Rmsg_22 : constant String := "stubbed subprogram called" & NUL;
- Rmsg_23 : constant String := "unchecked union restriction" & NUL;
- Rmsg_24 : constant String := "illegal use of"
+ Rmsg_08 : constant String := "null-exclusion check failed" & NUL;
+ Rmsg_09 : constant String := "overflow check failed" & NUL;
+ Rmsg_10 : constant String := "partition check failed" & NUL;
+ Rmsg_11 : constant String := "range check failed" & NUL;
+ Rmsg_12 : constant String := "tag check failed" & NUL;
+ Rmsg_13 : constant String := "access before elaboration" & NUL;
+ Rmsg_14 : constant String := "accessibility check failed" & NUL;
+ Rmsg_15 : constant String := "all guards closed" & NUL;
+ Rmsg_16 : constant String := "duplicated entry address" & NUL;
+ Rmsg_17 : constant String := "explicit raise" & NUL;
+ Rmsg_18 : constant String := "finalize/adjust raised exception" & NUL;
+ Rmsg_19 : constant String := "misaligned address value" & NUL;
+ Rmsg_20 : constant String := "missing return" & NUL;
+ Rmsg_21 : constant String := "overlaid controlled object" & NUL;
+ Rmsg_22 : constant String := "potentially blocking operation" & NUL;
+ Rmsg_23 : constant String := "stubbed subprogram called" & NUL;
+ Rmsg_24 : constant String := "unchecked union restriction" & NUL;
+ Rmsg_25 : constant String := "illegal use of"
& " remote access-to-class-wide type, see RM E.4(18)" & NUL;
- Rmsg_25 : constant String := "empty storage pool" & NUL;
- Rmsg_26 : constant String := "explicit raise" & NUL;
- Rmsg_27 : constant String := "infinite recursion" & NUL;
- Rmsg_28 : constant String := "object too large" & NUL;
- Rmsg_29 : constant String := "restriction violation" & NUL;
+ Rmsg_26 : constant String := "empty storage pool" & NUL;
+ Rmsg_27 : constant String := "explicit raise" & NUL;
+ Rmsg_28 : constant String := "infinite recursion" & NUL;
+ Rmsg_29 : constant String := "object too large" & NUL;
+ Rmsg_30 : constant String := "restriction violation" & NUL;
-----------------------
-- Polling Interface --
@@ -1097,7 +1101,7 @@ package body Ada.Exceptions is
procedure Rcheck_12 (File : Big_String_Ptr; Line : Integer) is
begin
- Raise_Program_Error_Msg (File, Line, To_Ptr (Rmsg_12'Address));
+ Raise_Constraint_Error_Msg (File, Line, To_Ptr (Rmsg_12'Address));
end Rcheck_12;
procedure Rcheck_13 (File : Big_String_Ptr; Line : Integer) is
@@ -1162,7 +1166,7 @@ package body Ada.Exceptions is
procedure Rcheck_25 (File : Big_String_Ptr; Line : Integer) is
begin
- Raise_Storage_Error_Msg (File, Line, To_Ptr (Rmsg_25'Address));
+ Raise_Program_Error_Msg (File, Line, To_Ptr (Rmsg_25'Address));
end Rcheck_25;
procedure Rcheck_26 (File : Big_String_Ptr; Line : Integer) is
@@ -1185,6 +1189,11 @@ package body Ada.Exceptions is
Raise_Storage_Error_Msg (File, Line, To_Ptr (Rmsg_29'Address));
end Rcheck_29;
+ procedure Rcheck_30 (File : Big_String_Ptr; Line : Integer) is
+ begin
+ Raise_Storage_Error_Msg (File, Line, To_Ptr (Rmsg_30'Address));
+ end Rcheck_30;
+
-------------
-- Reraise --
-------------
diff --git a/gcc/ada/a-numeri.ads b/gcc/ada/a-numeri.ads
index e0dfef2b2f2..dab536504c2 100644
--- a/gcc/ada/a-numeri.ads
+++ b/gcc/ada/a-numeri.ads
@@ -23,9 +23,9 @@ pragma Pure (Numerics);
3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511;
["03C0"] : constant := Pi;
- -- This is the greek letter Pi. Note that it is conforming to have this
- -- present even in Ada 95 mode, because there is no way for a normal mode
- -- Ada 95 program to reference this identifier in any case.
+ -- This is the greek letter Pi (for Ada 2005 AI-388). Note that it is
+ -- conforming to have this present even in Ada 95 mode, because there is
+ -- no way for a normal mode Ada 95 program to reference this identifier.
e : constant :=
2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996;
diff --git a/gcc/ada/a-strbou.adb b/gcc/ada/a-strbou.adb
index 886c03ff68a..08d339d0b68 100644
--- a/gcc/ada/a-strbou.adb
+++ b/gcc/ada/a-strbou.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -35,23 +35,26 @@ package body Ada.Strings.Bounded is
package body Generic_Bounded_Length is
+ -- The subprograms in this body are those for which there is no
+ -- Bounded_String input, and hence no implicit information on the
+ -- maximum size. This means that the maximum size has to be passed
+ -- explicitly to the routine in Superbounded.
+
---------
-- "*" --
---------
function "*"
- (Left : in Natural;
- Right : in Character)
- return Bounded_String
+ (Left : Natural;
+ Right : Character) return Bounded_String
is
begin
return Times (Left, Right, Max_Length);
end "*";
function "*"
- (Left : in Natural;
- Right : in String)
- return Bounded_String
+ (Left : Natural;
+ Right : String) return Bounded_String
is
begin
return Times (Left, Right, Max_Length);
@@ -62,34 +65,30 @@ package body Ada.Strings.Bounded is
---------------
function Replicate
- (Count : in Natural;
- Item : in Character;
- Drop : in Strings.Truncation := Strings.Error)
- return Bounded_String
+ (Count : Natural;
+ Item : Character;
+ Drop : Strings.Truncation := Strings.Error) return Bounded_String
is
begin
return Super_Replicate (Count, Item, Drop, Max_Length);
end Replicate;
function Replicate
- (Count : in Natural;
- Item : in String;
- Drop : in Strings.Truncation := Strings.Error)
- return Bounded_String
+ (Count : Natural;
+ Item : String;
+ Drop : Strings.Truncation := Strings.Error) return Bounded_String
is
begin
return Super_Replicate (Count, Item, Drop, Max_Length);
end Replicate;
-
-----------------------
-- To_Bounded_String --
-----------------------
function To_Bounded_String
- (Source : in String;
- Drop : in Strings.Truncation := Strings.Error)
- return Bounded_String
+ (Source : String;
+ Drop : Strings.Truncation := Strings.Error) return Bounded_String
is
begin
return To_Super_String (Source, Max_Length, Drop);
diff --git a/gcc/ada/a-strbou.ads b/gcc/ada/a-strbou.ads
index 7e9f54f1b0a..5b8346ad102 100644
--- a/gcc/ada/a-strbou.ads
+++ b/gcc/ada/a-strbou.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,214 +55,245 @@ pragma Preelaborate (Bounded);
subtype Length_Range is Natural range 0 .. Max_Length;
- function Length (Source : in Bounded_String) return Length_Range;
+ function Length (Source : Bounded_String) return Length_Range;
--------------------------------------------------------
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
function To_Bounded_String
- (Source : in String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Source : String;
+ Drop : Truncation := Error) return Bounded_String;
- function To_String (Source : in Bounded_String) return String;
+ function To_String (Source : Bounded_String) return String;
+
+ procedure Set_Bounded_String
+ (Target : out Bounded_String;
+ Source : String;
+ Drop : Truncation := Error);
+ pragma Ada_05 (Set_Bounded_String);
function Append
- (Left, Right : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Left : Bounded_String;
+ Right : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String;
function Append
- (Left : in Bounded_String;
- Right : in String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Left : Bounded_String;
+ Right : String;
+ Drop : Truncation := Error) return Bounded_String;
function Append
- (Left : in String;
- Right : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Left : String;
+ Right : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String;
function Append
- (Left : in Bounded_String;
- Right : in Character;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Left : Bounded_String;
+ Right : Character;
+ Drop : Truncation := Error) return Bounded_String;
function Append
- (Left : in Character;
- Right : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Left : Character;
+ Right : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String;
procedure Append
(Source : in out Bounded_String;
- New_Item : in Bounded_String;
- Drop : in Truncation := Error);
+ New_Item : Bounded_String;
+ Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_String;
- New_Item : in String;
- Drop : in Truncation := Error);
+ New_Item : String;
+ Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_String;
- New_Item : in Character;
- Drop : in Truncation := Error);
+ New_Item : Character;
+ Drop : Truncation := Error);
function "&"
- (Left, Right : in Bounded_String)
- return Bounded_String;
+ (Left : Bounded_String;
+ Right : Bounded_String) return Bounded_String;
function "&"
- (Left : in Bounded_String;
- Right : in String)
- return Bounded_String;
+ (Left : Bounded_String;
+ Right : String) return Bounded_String;
function "&"
- (Left : in String;
- Right : in Bounded_String)
- return Bounded_String;
+ (Left : String;
+ Right : Bounded_String) return Bounded_String;
function "&"
- (Left : in Bounded_String;
- Right : in Character)
- return Bounded_String;
+ (Left : Bounded_String;
+ Right : Character) return Bounded_String;
function "&"
- (Left : in Character;
- Right : in Bounded_String)
- return Bounded_String;
+ (Left : Character;
+ Right : Bounded_String) return Bounded_String;
function Element
- (Source : in Bounded_String;
- Index : in Positive)
- return Character;
+ (Source : Bounded_String;
+ Index : Positive) return Character;
procedure Replace_Element
(Source : in out Bounded_String;
- Index : in Positive;
- By : in Character);
+ Index : Positive;
+ By : Character);
function Slice
- (Source : in Bounded_String;
- Low : in Positive;
- High : in Natural)
- return String;
+ (Source : Bounded_String;
+ Low : Positive;
+ High : Natural) return String;
+
+ function Bounded_Slice
+ (Source : Bounded_String;
+ Low : Positive;
+ High : Natural) return Bounded_String;
+ pragma Ada_05 (Bounded_Slice);
+
+ procedure Bounded_Slice
+ (Source : Bounded_String;
+ Target : out Bounded_String;
+ Low : Positive;
+ High : Natural);
+ pragma Ada_05 (Bounded_Slice);
- function "=" (Left, Right : in Bounded_String) return Boolean;
+ function "="
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean;
function "="
- (Left : in Bounded_String;
- Right : in String)
- return Boolean;
+ (Left : Bounded_String;
+ Right : String) return Boolean;
function "="
- (Left : in String;
- Right : in Bounded_String)
- return Boolean;
+ (Left : String;
+ Right : Bounded_String) return Boolean;
- function "<" (Left, Right : in Bounded_String) return Boolean;
+ function "<"
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean;
function "<"
- (Left : in Bounded_String;
- Right : in String)
- return Boolean;
+ (Left : Bounded_String;
+ Right : String) return Boolean;
function "<"
- (Left : in String;
- Right : in Bounded_String)
- return Boolean;
+ (Left : String;
+ Right : Bounded_String) return Boolean;
- function "<=" (Left, Right : in Bounded_String) return Boolean;
+ function "<="
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean;
function "<="
- (Left : in Bounded_String;
- Right : in String)
- return Boolean;
+ (Left : Bounded_String;
+ Right : String) return Boolean;
function "<="
- (Left : in String;
- Right : in Bounded_String)
- return Boolean;
+ (Left : String;
+ Right : Bounded_String) return Boolean;
- function ">" (Left, Right : in Bounded_String) return Boolean;
+ function ">"
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean;
function ">"
- (Left : in Bounded_String;
- Right : in String)
- return Boolean;
+ (Left : Bounded_String;
+ Right : String) return Boolean;
function ">"
- (Left : in String;
- Right : in Bounded_String)
- return Boolean;
+ (Left : String;
+ Right : Bounded_String) return Boolean;
- function ">=" (Left, Right : in Bounded_String) return Boolean;
+ function ">="
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean;
function ">="
- (Left : in Bounded_String;
- Right : in String)
- return Boolean;
+ (Left : Bounded_String;
+ Right : String) return Boolean;
function ">="
- (Left : in String;
- Right : in Bounded_String)
- return Boolean;
+ (Left : String;
+ Right : Bounded_String) return Boolean;
----------------------
-- Search Functions --
----------------------
function Index
- (Source : in Bounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : Bounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Index
+ (Source : Bounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Index
- (Source : in Bounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
function Index
- (Source : in Bounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Bounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Bounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
function Index_Non_Blank
- (Source : in Bounded_String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Bounded_String;
+ Going : Direction := Forward) return Natural;
+
+ function Index_Non_Blank
+ (Source : Bounded_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in Bounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : Bounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Count
- (Source : in Bounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : Bounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Count
- (Source : in Bounded_String;
- Set : in Maps.Character_Set)
- return Natural;
+ (Source : Bounded_String;
+ Set : Maps.Character_Set) return Natural;
procedure Find_Token
- (Source : in Bounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
@@ -271,569 +302,588 @@ pragma Preelaborate (Bounded);
------------------------------------
function Translate
- (Source : in Bounded_String;
- Mapping : in Maps.Character_Mapping)
- return Bounded_String;
+ (Source : Bounded_String;
+ Mapping : Maps.Character_Mapping) return Bounded_String;
procedure Translate
(Source : in out Bounded_String;
- Mapping : in Maps.Character_Mapping);
+ Mapping : Maps.Character_Mapping);
function Translate
- (Source : in Bounded_String;
- Mapping : in Maps.Character_Mapping_Function)
- return Bounded_String;
+ (Source : Bounded_String;
+ Mapping : Maps.Character_Mapping_Function) return Bounded_String;
procedure Translate
(Source : in out Bounded_String;
- Mapping : in Maps.Character_Mapping_Function);
+ Mapping : Maps.Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
- (Source : in Bounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Source : Bounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error) return Bounded_String;
procedure Replace_Slice
(Source : in out Bounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error);
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error);
function Insert
- (Source : in Bounded_String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Source : Bounded_String;
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error) return Bounded_String;
procedure Insert
(Source : in out Bounded_String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error);
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error);
function Overwrite
- (Source : in Bounded_String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Source : Bounded_String;
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Error) return Bounded_String;
procedure Overwrite
(Source : in out Bounded_String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error);
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Error);
function Delete
- (Source : in Bounded_String;
- From : in Positive;
- Through : in Natural)
- return Bounded_String;
+ (Source : Bounded_String;
+ From : Positive;
+ Through : Natural) return Bounded_String;
procedure Delete
(Source : in out Bounded_String;
- From : in Positive;
- Through : in Natural);
+ From : Positive;
+ Through : Natural);
---------------------------------
-- String Selector Subprograms --
---------------------------------
function Trim
- (Source : in Bounded_String;
- Side : in Trim_End)
- return Bounded_String;
+ (Source : Bounded_String;
+ Side : Trim_End) return Bounded_String;
procedure Trim
(Source : in out Bounded_String;
- Side : in Trim_End);
+ Side : Trim_End);
function Trim
- (Source : in Bounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return Bounded_String;
+ (Source : Bounded_String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return Bounded_String;
procedure Trim
(Source : in out Bounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set);
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set);
function Head
- (Source : in Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Source : Bounded_String;
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error) return Bounded_String;
procedure Head
(Source : in out Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error);
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error);
function Tail
- (Source : in Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Source : Bounded_String;
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error) return Bounded_String;
procedure Tail
(Source : in out Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error);
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error);
------------------------------------
-- String Constructor Subprograms --
------------------------------------
function "*"
- (Left : in Natural;
- Right : in Character)
- return Bounded_String;
+ (Left : Natural;
+ Right : Character) return Bounded_String;
function "*"
- (Left : in Natural;
- Right : in String)
- return Bounded_String;
+ (Left : Natural;
+ Right : String) return Bounded_String;
function "*"
- (Left : in Natural;
- Right : in Bounded_String)
- return Bounded_String;
+ (Left : Natural;
+ Right : Bounded_String) return Bounded_String;
function Replicate
- (Count : in Natural;
- Item : in Character;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Count : Natural;
+ Item : Character;
+ Drop : Truncation := Error) return Bounded_String;
function Replicate
- (Count : in Natural;
- Item : in String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Count : Natural;
+ Item : String;
+ Drop : Truncation := Error) return Bounded_String;
function Replicate
- (Count : in Natural;
- Item : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String;
+ (Count : Natural;
+ Item : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String;
private
-
- -- Most of the implementation is in the non generic package
+ -- Most of the implementation is in the separate non generic package
-- Ada.Strings.Superbounded. Type Bounded_String is derived from type
- -- Superbounded.Super_String with the maximum length constraint.
- -- Except for five, all subprograms are renames of subprograms that
- -- are inherited from Superbounded.Super_String.
+ -- Superbounded.Super_String with the maximum length constraint. In
+ -- almost all cases, the routines in Superbounded can be called with
+ -- no requirement to pass the maximum length explicitly, since there
+ -- is at least one Bounded_String argument from which the maximum
+ -- length can be obtained. For all such routines, the implementation
+ -- in this private part is simply a renaming of the corresponding
+ -- routine in the super bouded package.
+
+ -- The five exceptions are the * and Replicate routines operating on
+ -- character values. For these cases, we have a routine in the body
+ -- that calls the superbounded routine passing the maximum length
+ -- explicitly as an extra parameter.
type Bounded_String is new Superbounded.Super_String (Max_Length);
+ -- Deriving Bounded_String from Superbounded.Super_String is the
+ -- real trick, it ensures that the type Bounded_String declared in
+ -- the generic instantiation is compatible with the Super_String
+ -- type declared in the Superbounded package.
Null_Bounded_String : constant Bounded_String :=
- (Max_Length => Max_Length,
- Current_Length => 0,
- Data => (1 .. Max_Length => ASCII.NUL));
+ (Max_Length => Max_Length,
+ Current_Length => 0,
+ Data =>
+ (1 .. Max_Length => ASCII.NUL));
pragma Inline (To_Bounded_String);
- function Length (Source : in Bounded_String) return Length_Range
- renames Super_Length;
+ procedure Set_Bounded_String
+ (Target : out Bounded_String;
+ Source : String;
+ Drop : Truncation := Error)
+ renames Set_Super_String;
- function To_String (Source : in Bounded_String) return String
- renames Super_To_String;
+ function Length
+ (Source : Bounded_String) return Length_Range
+ renames Super_Length;
+
+ function To_String
+ (Source : Bounded_String) return String
+ renames Super_To_String;
function Append
- (Left, Right : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Append;
+ (Left : Bounded_String;
+ Right : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Append;
function Append
- (Left : in Bounded_String;
- Right : in String;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Append;
+ (Left : Bounded_String;
+ Right : String;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Append;
function Append
- (Left : in String;
- Right : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Append;
+ (Left : String;
+ Right : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Append;
function Append
- (Left : in Bounded_String;
- Right : in Character;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Append;
+ (Left : Bounded_String;
+ Right : Character;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Append;
function Append
- (Left : in Character;
- Right : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Append;
+ (Left : Character;
+ Right : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Append;
procedure Append
(Source : in out Bounded_String;
- New_Item : in Bounded_String;
- Drop : in Truncation := Error)
- renames Super_Append;
+ New_Item : Bounded_String;
+ Drop : Truncation := Error)
+ renames Super_Append;
procedure Append
(Source : in out Bounded_String;
- New_Item : in String;
- Drop : in Truncation := Error)
- renames Super_Append;
+ New_Item : String;
+ Drop : Truncation := Error)
+ renames Super_Append;
procedure Append
(Source : in out Bounded_String;
- New_Item : in Character;
- Drop : in Truncation := Error)
- renames Super_Append;
+ New_Item : Character;
+ Drop : Truncation := Error)
+ renames Super_Append;
function "&"
- (Left, Right : in Bounded_String)
- return Bounded_String
- renames Concat;
+ (Left : Bounded_String;
+ Right : Bounded_String) return Bounded_String
+ renames Concat;
function "&"
- (Left : in Bounded_String;
- Right : in String)
- return Bounded_String
- renames Concat;
+ (Left : Bounded_String;
+ Right : String) return Bounded_String
+ renames Concat;
function "&"
- (Left : in String;
- Right : in Bounded_String)
- return Bounded_String
- renames Concat;
+ (Left : String;
+ Right : Bounded_String) return Bounded_String
+ renames Concat;
function "&"
- (Left : in Bounded_String;
- Right : in Character)
- return Bounded_String
- renames Concat;
+ (Left : Bounded_String;
+ Right : Character) return Bounded_String
+ renames Concat;
function "&"
- (Left : in Character;
- Right : in Bounded_String)
- return Bounded_String
- renames Concat;
+ (Left : Character;
+ Right : Bounded_String) return Bounded_String
+ renames Concat;
function Element
- (Source : in Bounded_String;
- Index : in Positive)
- return Character
- renames Super_Element;
+ (Source : Bounded_String;
+ Index : Positive) return Character
+ renames Super_Element;
procedure Replace_Element
(Source : in out Bounded_String;
- Index : in Positive;
- By : in Character)
- renames Super_Replace_Element;
+ Index : Positive;
+ By : Character)
+ renames Super_Replace_Element;
function Slice
- (Source : in Bounded_String;
- Low : in Positive;
- High : in Natural)
- return String
- renames Super_Slice;
+ (Source : Bounded_String;
+ Low : Positive;
+ High : Natural) return String
+ renames Super_Slice;
+
+ function Bounded_Slice
+ (Source : Bounded_String;
+ Low : Positive;
+ High : Natural) return Bounded_String
+ renames Super_Slice;
+
+ procedure Bounded_Slice
+ (Source : Bounded_String;
+ Target : out Bounded_String;
+ Low : Positive;
+ High : Natural)
+ renames Super_Slice;
- function "=" (Left, Right : in Bounded_String) return Boolean
- renames Equal;
+ function "="
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean
+ renames Equal;
function "="
- (Left : in Bounded_String;
- Right : in String)
- return Boolean
- renames Equal;
+ (Left : Bounded_String;
+ Right : String) return Boolean
+ renames Equal;
function "="
- (Left : in String;
- Right : in Bounded_String)
- return Boolean
- renames Equal;
+ (Left : String;
+ Right : Bounded_String) return Boolean
+ renames Equal;
- function "<" (Left, Right : in Bounded_String) return Boolean
- renames Less;
+ function "<"
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean
+ renames Less;
function "<"
- (Left : in Bounded_String;
- Right : in String)
- return Boolean
- renames Less;
+ (Left : Bounded_String;
+ Right : String) return Boolean
+ renames Less;
function "<"
- (Left : in String;
- Right : in Bounded_String)
- return Boolean
- renames Less;
+ (Left : String;
+ Right : Bounded_String) return Boolean
+ renames Less;
- function "<=" (Left, Right : in Bounded_String) return Boolean
- renames Less_Or_Equal;
+ function "<="
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean
+ renames Less_Or_Equal;
function "<="
- (Left : in Bounded_String;
- Right : in String)
- return Boolean
- renames Less_Or_Equal;
+ (Left : Bounded_String;
+ Right : String) return Boolean
+ renames Less_Or_Equal;
function "<="
- (Left : in String;
- Right : in Bounded_String)
- return Boolean
- renames Less_Or_Equal;
+ (Left : String;
+ Right : Bounded_String) return Boolean
+ renames Less_Or_Equal;
- function ">" (Left, Right : in Bounded_String) return Boolean
- renames Greater;
+ function ">"
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean
+ renames Greater;
function ">"
- (Left : in Bounded_String;
- Right : in String)
- return Boolean
- renames Greater;
+ (Left : Bounded_String;
+ Right : String) return Boolean
+ renames Greater;
function ">"
- (Left : in String;
- Right : in Bounded_String)
- return Boolean
- renames Greater;
+ (Left : String;
+ Right : Bounded_String) return Boolean
+ renames Greater;
- function ">=" (Left, Right : in Bounded_String) return Boolean
- renames Greater_Or_Equal;
+ function ">="
+ (Left : Bounded_String;
+ Right : Bounded_String) return Boolean
+ renames Greater_Or_Equal;
function ">="
- (Left : in Bounded_String;
- Right : in String)
- return Boolean
- renames Greater_Or_Equal;
+ (Left : Bounded_String;
+ Right : String) return Boolean
+ renames Greater_Or_Equal;
function ">="
- (Left : in String;
- Right : in Bounded_String)
- return Boolean
- renames Greater_Or_Equal;
+ (Left : String;
+ Right : Bounded_String) return Boolean
+ renames Greater_Or_Equal;
+
+ function Index
+ (Source : Bounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ renames Super_Index;
+
+ function Index
+ (Source : Bounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ renames Super_Index;
function Index
- (Source : in Bounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural
- renames Super_Index;
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Super_Index;
function Index
- (Source : in Bounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural
- renames Super_Index;
+ (Source : Bounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ renames Super_Index;
function Index
- (Source : in Bounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
- renames Super_Index;
+ (Source : Bounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ renames Super_Index;
+
+ function Index
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Super_Index;
+
+ function Index_Non_Blank
+ (Source : Bounded_String;
+ Going : Direction := Forward) return Natural
+ renames Super_Index_Non_Blank;
function Index_Non_Blank
- (Source : in Bounded_String;
- Going : in Direction := Forward)
- return Natural
- renames Super_Index_Non_Blank;
+ (Source : Bounded_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ renames Super_Index_Non_Blank;
function Count
- (Source : in Bounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural
- renames Super_Count;
+ (Source : Bounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ renames Super_Count;
function Count
- (Source : in Bounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural
- renames Super_Count;
+ (Source : Bounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ renames Super_Count;
function Count
- (Source : in Bounded_String;
- Set : in Maps.Character_Set)
- return Natural
- renames Super_Count;
+ (Source : Bounded_String;
+ Set : Maps.Character_Set) return Natural
+ renames Super_Count;
procedure Find_Token
- (Source : in Bounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : Bounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
- renames Super_Find_Token;
+ renames Super_Find_Token;
function Translate
- (Source : in Bounded_String;
- Mapping : in Maps.Character_Mapping)
- return Bounded_String
- renames Super_Translate;
+ (Source : Bounded_String;
+ Mapping : Maps.Character_Mapping) return Bounded_String
+ renames Super_Translate;
procedure Translate
(Source : in out Bounded_String;
- Mapping : in Maps.Character_Mapping)
- renames Super_Translate;
+ Mapping : Maps.Character_Mapping)
+ renames Super_Translate;
function Translate
- (Source : in Bounded_String;
- Mapping : in Maps.Character_Mapping_Function)
- return Bounded_String
- renames Super_Translate;
+ (Source : Bounded_String;
+ Mapping : Maps.Character_Mapping_Function) return Bounded_String
+ renames Super_Translate;
procedure Translate
(Source : in out Bounded_String;
- Mapping : in Maps.Character_Mapping_Function)
- renames Super_Translate;
+ Mapping : Maps.Character_Mapping_Function)
+ renames Super_Translate;
function Replace_Slice
- (Source : in Bounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Replace_Slice;
+ (Source : Bounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Replace_Slice;
procedure Replace_Slice
(Source : in out Bounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error)
- renames Super_Replace_Slice;
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error)
+ renames Super_Replace_Slice;
function Insert
- (Source : in Bounded_String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Insert;
+ (Source : Bounded_String;
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Insert;
procedure Insert
(Source : in out Bounded_String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
- renames Super_Insert;
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error)
+ renames Super_Insert;
function Overwrite
- (Source : in Bounded_String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Overwrite;
+ (Source : Bounded_String;
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Overwrite;
procedure Overwrite
(Source : in out Bounded_String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
- renames Super_Overwrite;
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Error)
+ renames Super_Overwrite;
function Delete
- (Source : in Bounded_String;
- From : in Positive;
- Through : in Natural)
- return Bounded_String
- renames Super_Delete;
+ (Source : Bounded_String;
+ From : Positive;
+ Through : Natural) return Bounded_String
+ renames Super_Delete;
procedure Delete
(Source : in out Bounded_String;
- From : in Positive;
- Through : in Natural)
- renames Super_Delete;
+ From : Positive;
+ Through : Natural)
+ renames Super_Delete;
function Trim
- (Source : in Bounded_String;
- Side : in Trim_End)
- return Bounded_String
- renames Super_Trim;
+ (Source : Bounded_String;
+ Side : Trim_End) return Bounded_String
+ renames Super_Trim;
procedure Trim
(Source : in out Bounded_String;
- Side : in Trim_End)
- renames Super_Trim;
+ Side : Trim_End)
+ renames Super_Trim;
function Trim
- (Source : in Bounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return Bounded_String
- renames Super_Trim;
+ (Source : Bounded_String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return Bounded_String
+ renames Super_Trim;
procedure Trim
(Source : in out Bounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- renames Super_Trim;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set)
+ renames Super_Trim;
function Head
- (Source : in Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Head;
+ (Source : Bounded_String;
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Head;
procedure Head
(Source : in out Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error)
- renames Super_Head;
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error)
+ renames Super_Head;
function Tail
- (Source : in Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error)
- return Bounded_String
- renames Super_Tail;
+ (Source : Bounded_String;
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error) return Bounded_String
+ renames Super_Tail;
procedure Tail
(Source : in out Bounded_String;
- Count : in Natural;
- Pad : in Character := Space;
- Drop : in Truncation := Error)
- renames Super_Tail;
+ Count : Natural;
+ Pad : Character := Space;
+ Drop : Truncation := Error)
+ renames Super_Tail;
function "*"
- (Left : in Natural;
- Right : in Bounded_String)
- return Bounded_String
- renames Times;
+ (Left : Natural;
+ Right : Bounded_String) return Bounded_String
+ renames Times;
function Replicate
- (Count : in Natural;
- Item : in Bounded_String;
- Drop : in Truncation := Error)
- return Bounded_String
+ (Count : Natural;
+ Item : Bounded_String;
+ Drop : Truncation := Error) return Bounded_String
renames Super_Replicate;
end Generic_Bounded_Length;
diff --git a/gcc/ada/a-strfix.adb b/gcc/ada/a-strfix.adb
index 03a5061c49b..aadc977051c 100644
--- a/gcc/ada/a-strfix.adb
+++ b/gcc/ada/a-strfix.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -50,59 +50,82 @@ package body Ada.Strings.Fixed is
------------------------
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
renames Ada.Strings.Search.Index;
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
renames Ada.Strings.Search.Index;
function Index
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Search.Index;
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ renames Ada.Strings.Search.Index;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ renames Ada.Strings.Search.Index;
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Search.Index;
+
+ function Index_Non_Blank
+ (Source : String;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Search.Index_Non_Blank;
+
function Index_Non_Blank
- (Source : in String;
- Going : in Direction := Forward)
- return Natural
+ (Source : String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Search.Index_Non_Blank;
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
renames Ada.Strings.Search.Count;
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
renames Ada.Strings.Search.Count;
function Count
- (Source : in String;
- Set : in Maps.Character_Set)
- return Natural
+ (Source : String;
+ Set : Maps.Character_Set) return Natural
renames Ada.Strings.Search.Count;
procedure Find_Token
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
renames Ada.Strings.Search.Find_Token;
@@ -112,9 +135,8 @@ package body Ada.Strings.Fixed is
---------
function "*"
- (Left : in Natural;
- Right : in Character)
- return String
+ (Left : Natural;
+ Right : Character) return String
is
Result : String (1 .. Left);
@@ -127,9 +149,8 @@ package body Ada.Strings.Fixed is
end "*";
function "*"
- (Left : in Natural;
- Right : in String)
- return String
+ (Left : Natural;
+ Right : String) return String
is
Result : String (1 .. Left * Right'Length);
Ptr : Integer := 1;
@@ -148,10 +169,9 @@ package body Ada.Strings.Fixed is
------------
function Delete
- (Source : in String;
- From : in Positive;
- Through : in Natural)
- return String
+ (Source : String;
+ From : Positive;
+ Through : Natural) return String
is
begin
if From > Through then
@@ -185,10 +205,10 @@ package body Ada.Strings.Fixed is
procedure Delete
(Source : in out String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Source => Delete (Source, From, Through),
@@ -202,10 +222,9 @@ package body Ada.Strings.Fixed is
----------
function Head
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String
is
subtype Result_Type is String (1 .. Count);
@@ -232,9 +251,9 @@ package body Ada.Strings.Fixed is
procedure Head
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Source => Head (Source, Count, Pad),
@@ -249,10 +268,9 @@ package body Ada.Strings.Fixed is
------------
function Insert
- (Source : in String;
- Before : in Positive;
- New_Item : in String)
- return String
+ (Source : String;
+ Before : Positive;
+ New_Item : String) return String
is
Result : String (1 .. Source'Length + New_Item'Length);
Front : constant Integer := Before - Source'First;
@@ -274,9 +292,9 @@ package body Ada.Strings.Fixed is
procedure Insert
(Source : in out String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error)
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error)
is
begin
Move (Source => Insert (Source, Before, New_Item),
@@ -289,11 +307,11 @@ package body Ada.Strings.Fixed is
----------
procedure Move
- (Source : in String;
+ (Source : String;
Target : out String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
Sfirst : constant Integer := Source'First;
Slast : constant Integer := Source'Last;
@@ -398,10 +416,9 @@ package body Ada.Strings.Fixed is
---------------
function Overwrite
- (Source : in String;
- Position : in Positive;
- New_Item : in String)
- return String
+ (Source : String;
+ Position : Positive;
+ New_Item : String) return String
is
begin
if Position not in Source'First .. Source'Last + 1 then
@@ -430,9 +447,9 @@ package body Ada.Strings.Fixed is
procedure Overwrite
(Source : in out String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Right)
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Right)
is
begin
Move (Source => Overwrite (Source, Position, New_Item),
@@ -445,11 +462,10 @@ package body Ada.Strings.Fixed is
-------------------
function Replace_Slice
- (Source : in String;
- Low : in Positive;
- High : in Natural;
- By : in String)
- return String
+ (Source : String;
+ Low : Positive;
+ High : Natural;
+ By : String) return String
is
begin
if Low > Source'Last + 1 or High < Source'First - 1 then
@@ -490,12 +506,12 @@ package body Ada.Strings.Fixed is
procedure Replace_Slice
(Source : in out String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Replace_Slice (Source, Low, High, By), Source, Drop, Justify, Pad);
@@ -506,10 +522,9 @@ package body Ada.Strings.Fixed is
----------
function Tail
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String
is
subtype Result_Type is String (1 .. Count);
@@ -536,9 +551,9 @@ package body Ada.Strings.Fixed is
procedure Tail
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Source => Tail (Source, Count, Pad),
@@ -553,9 +568,8 @@ package body Ada.Strings.Fixed is
---------------
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping)
- return String
+ (Source : String;
+ Mapping : Maps.Character_Mapping) return String
is
Result : String (1 .. Source'Length);
@@ -569,7 +583,7 @@ package body Ada.Strings.Fixed is
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping)
+ Mapping : Maps.Character_Mapping)
is
begin
for J in Source'Range loop
@@ -578,9 +592,8 @@ package body Ada.Strings.Fixed is
end Translate;
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return String
+ (Source : String;
+ Mapping : Maps.Character_Mapping_Function) return String
is
Result : String (1 .. Source'Length);
pragma Unsuppress (Access_Check);
@@ -595,7 +608,7 @@ package body Ada.Strings.Fixed is
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping_Function)
+ Mapping : Maps.Character_Mapping_Function)
is
pragma Unsuppress (Access_Check);
begin
@@ -609,9 +622,8 @@ package body Ada.Strings.Fixed is
----------
function Trim
- (Source : in String;
- Side : in Trim_End)
- return String
+ (Source : String;
+ Side : Trim_End) return String
is
Low, High : Integer;
@@ -658,9 +670,9 @@ package body Ada.Strings.Fixed is
procedure Trim
(Source : in out String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Character := Space)
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Character := Space)
is
begin
Move (Trim (Source, Side),
@@ -670,10 +682,9 @@ package body Ada.Strings.Fixed is
end Trim;
function Trim
- (Source : in String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return String
+ (Source : String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return String
is
High, Low : Integer;
@@ -705,10 +716,10 @@ package body Ada.Strings.Fixed is
procedure Trim
(Source : in out String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set;
- Justify : in Alignment := Strings.Left;
- Pad : in Character := Space)
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set;
+ Justify : Alignment := Strings.Left;
+ Pad : Character := Space)
is
begin
Move (Source => Trim (Source, Left, Right),
diff --git a/gcc/ada/a-strfix.ads b/gcc/ada/a-strfix.ads
index 6b0c147e1ed..bf1a496828d 100644
--- a/gcc/ada/a-strfix.ads
+++ b/gcc/ada/a-strfix.ads
@@ -6,32 +6,10 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 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. --
+-- This specification is adapted from the Ada Reference Manual for use with --
+-- 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. --
-- --
------------------------------------------------------------------------------
@@ -46,63 +24,86 @@ pragma Preelaborate (Fixed);
--------------------------------------------------------------
procedure Move
- (Source : in String;
+ (Source : String;
Target : out String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
------------------------
-- Search Subprograms --
------------------------
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Index
- (Source : in String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
function Index
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index_Non_Blank
+ (Source : String;
+ Going : Direction := Forward) return Natural;
function Index_Non_Blank
- (Source : in String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Count
- (Source : in String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Count
- (Source : in String;
- Set : in Maps.Character_Set)
- return Natural;
+ (Source : String;
+ Set : Maps.Character_Set) return Natural;
procedure Find_Token
- (Source : in String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
@@ -111,144 +112,132 @@ pragma Preelaborate (Fixed);
------------------------------------
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping)
- return String;
+ (Source : String;
+ Mapping : Maps.Character_Mapping) return String;
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping);
+ Mapping : Maps.Character_Mapping);
function Translate
- (Source : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return String;
+ (Source : String;
+ Mapping : Maps.Character_Mapping_Function) return String;
procedure Translate
(Source : in out String;
- Mapping : in Maps.Character_Mapping_Function);
+ Mapping : Maps.Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
- (Source : in String;
- Low : in Positive;
- High : in Natural;
- By : in String)
- return String;
+ (Source : String;
+ Low : Positive;
+ High : Natural;
+ By : String) return String;
procedure Replace_Slice
(Source : in out String;
- Low : in Positive;
- High : in Natural;
- By : in String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
function Insert
- (Source : in String;
- Before : in Positive;
- New_Item : in String)
- return String;
+ (Source : String;
+ Before : Positive;
+ New_Item : String) return String;
procedure Insert
(Source : in out String;
- Before : in Positive;
- New_Item : in String;
- Drop : in Truncation := Error);
+ Before : Positive;
+ New_Item : String;
+ Drop : Truncation := Error);
function Overwrite
- (Source : in String;
- Position : in Positive;
- New_Item : in String)
- return String;
+ (Source : String;
+ Position : Positive;
+ New_Item : String) return String;
procedure Overwrite
(Source : in out String;
- Position : in Positive;
- New_Item : in String;
- Drop : in Truncation := Right);
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Right);
function Delete
- (Source : in String;
- From : in Positive;
- Through : in Natural)
- return String;
+ (Source : String;
+ From : Positive;
+ Through : Natural) return String;
procedure Delete
(Source : in out String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
---------------------------------
-- String Selector Subprograms --
---------------------------------
function Trim
- (Source : in String;
- Side : in Trim_End)
- return String;
+ (Source : String;
+ Side : Trim_End) return String;
procedure Trim
(Source : in out String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
function Trim
- (Source : in String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return String;
+ (Source : String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return String;
procedure Trim
(Source : in out String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set;
- Justify : in Alignment := Strings.Left;
- Pad : in Character := Space);
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set;
+ Justify : Alignment := Strings.Left;
+ Pad : Character := Space);
function Head
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String;
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String;
procedure Head
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
function Tail
- (Source : in String;
- Count : in Natural;
- Pad : in Character := Space)
- return String;
+ (Source : String;
+ Count : Natural;
+ Pad : Character := Space) return String;
procedure Tail
(Source : in out String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Character := Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Character := Space);
----------------------------------
-- String Constructor Functions --
----------------------------------
function "*"
- (Left : in Natural;
- Right : in Character)
- return String;
+ (Left : Natural;
+ Right : Character) return String;
function "*"
- (Left : in Natural;
- Right : in String)
- return String;
+ (Left : Natural;
+ Right : String) return String;
end Ada.Strings.Fixed;
diff --git a/gcc/ada/a-string.ads b/gcc/ada/a-string.ads
index e8ec5ac3690..5b9d803a200 100644
--- a/gcc/ada/a-string.ads
+++ b/gcc/ada/a-string.ads
@@ -16,8 +16,13 @@
package Ada.Strings is
pragma Pure (Strings);
- Space : constant Character := ' ';
- Wide_Space : constant Wide_Character := ' ';
+ Space : constant Character := ' ';
+ Wide_Space : constant Wide_Character := ' ';
+
+ -- The following declaration is for Ada 2005 (AI-285)
+
+ Wide_Wide_Space : constant Wide_Wide_Character := ' ';
+ pragma Ada_05 (Wide_Wide_Space);
Length_Error, Pattern_Error, Index_Error, Translation_Error : exception;
diff --git a/gcc/ada/a-strmap.adb b/gcc/ada/a-strmap.adb
index 9c6edda677b..c7201cfc985 100644
--- a/gcc/ada/a-strmap.adb
+++ b/gcc/ada/a-strmap.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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-strmap.ads b/gcc/ada/a-strmap.ads
index 3e5adf27cf8..598b2348857 100644
--- a/gcc/ada/a-strmap.ads
+++ b/gcc/ada/a-strmap.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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-strsea.adb b/gcc/ada/a-strsea.adb
index 62089c31f8e..c4e4d5db54b 100644
--- a/gcc/ada/a-strsea.adb
+++ b/gcc/ada/a-strsea.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -76,9 +76,9 @@ package body Ada.Strings.Search is
-----------
function Count
- (Source : String;
- Pattern : String;
- Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
N : Natural;
J : Natural;
@@ -110,9 +110,9 @@ package body Ada.Strings.Search is
end Count;
function Count
- (Source : String;
- Pattern : String;
- Mapping : Maps.Character_Mapping_Function) return Natural
+ (Source : String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
Mapped_Source : String (Source'Range);
N : Natural;
@@ -280,7 +280,6 @@ package body Ada.Strings.Search is
declare
pragma Unsuppress (Access_Check);
-
begin
for J in Source'Range loop
Mapped_Source (J) := Mapping.all (Source (J));
@@ -348,6 +347,84 @@ package body Ada.Strings.Search is
return 0;
end Index;
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Set, Test, Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Set, Test, Backward);
+ end if;
+ end Index;
+
---------------------
-- Index_Non_Blank --
---------------------
@@ -375,7 +452,30 @@ package body Ada.Strings.Search is
-- Fall through if no match
return 0;
+ end Index_Non_Blank;
+ function Index_Non_Blank
+ (Source : String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (From .. Source'Last), Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (Source'First .. From), Backward);
+ end if;
end Index_Non_Blank;
end Ada.Strings.Search;
diff --git a/gcc/ada/a-strsea.ads b/gcc/ada/a-strsea.ads
index c176d12d626..457b452f202 100644
--- a/gcc/ada/a-strsea.ads
+++ b/gcc/ada/a-strsea.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -61,8 +61,34 @@ pragma Preelaborate (Search);
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Index
+ (Source : String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+
+ function Index
+ (Source : String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Index_Non_Blank
+ (Source : String;
+ Going : Direction := Forward) return Natural;
+
function Index_Non_Blank
(Source : String;
+ From : Positive;
Going : Direction := Forward) return Natural;
function Count
diff --git a/gcc/ada/a-strsup.adb b/gcc/ada/a-strsup.adb
index 8ae039336d9..f32398e71b0 100644
--- a/gcc/ada/a-strsup.adb
+++ b/gcc/ada/a-strsup.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2005 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- --
@@ -42,8 +42,7 @@ package body Ada.Strings.Superbounded is
function Concat
(Left : Super_String;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Left.Max_Length);
Llen : constant Natural := Left.Current_Length;
@@ -64,8 +63,7 @@ package body Ada.Strings.Superbounded is
function Concat
(Left : Super_String;
- Right : String)
- return Super_String
+ Right : String) return Super_String
is
Result : Super_String (Left.Max_Length);
Llen : constant Natural := Left.Current_Length;
@@ -85,8 +83,7 @@ package body Ada.Strings.Superbounded is
function Concat
(Left : String;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Llen : constant Natural := Left'Length;
@@ -107,8 +104,7 @@ package body Ada.Strings.Superbounded is
function Concat
(Left : Super_String;
- Right : Character)
- return Super_String
+ Right : Character) return Super_String
is
Result : Super_String (Left.Max_Length);
Llen : constant Natural := Left.Current_Length;
@@ -127,8 +123,7 @@ package body Ada.Strings.Superbounded is
function Concat
(Left : Character;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Rlen : constant Natural := Right.Current_Length;
@@ -149,22 +144,29 @@ package body Ada.Strings.Superbounded is
-- Equal --
-----------
- function "=" (Left, Right : Super_String) return Boolean is
+ function "="
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Current_Length = Right.Current_Length
and then Left.Data (1 .. Left.Current_Length) =
Right.Data (1 .. Right.Current_Length);
end "=";
- function Equal (Left : Super_String; Right : String)
- return Boolean is
+ function Equal
+ (Left : Super_String;
+ Right : String) return Boolean
+ is
begin
return Left.Current_Length = Right'Length
and then Left.Data (1 .. Left.Current_Length) = Right;
end Equal;
- function Equal (Left : String; Right : Super_String)
- return Boolean is
+ function Equal
+ (Left : String;
+ Right : Super_String) return Boolean
+ is
begin
return Left'Length = Right.Current_Length
and then Left = Right.Data (1 .. Right.Current_Length);
@@ -174,7 +176,10 @@ package body Ada.Strings.Superbounded is
-- Greater --
-------------
- function Greater (Left, Right : Super_String) return Boolean is
+ function Greater
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) >
Right.Data (1 .. Right.Current_Length);
@@ -182,8 +187,7 @@ package body Ada.Strings.Superbounded is
function Greater
(Left : Super_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) > Right;
@@ -191,8 +195,7 @@ package body Ada.Strings.Superbounded is
function Greater
(Left : String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left > Right.Data (1 .. Right.Current_Length);
@@ -202,7 +205,10 @@ package body Ada.Strings.Superbounded is
-- Greater_Or_Equal --
----------------------
- function Greater_Or_Equal (Left, Right : Super_String) return Boolean is
+ function Greater_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) >=
Right.Data (1 .. Right.Current_Length);
@@ -210,8 +216,7 @@ package body Ada.Strings.Superbounded is
function Greater_Or_Equal
(Left : Super_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >= Right;
@@ -219,8 +224,7 @@ package body Ada.Strings.Superbounded is
function Greater_Or_Equal
(Left : String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left >= Right.Data (1 .. Right.Current_Length);
@@ -230,7 +234,10 @@ package body Ada.Strings.Superbounded is
-- Less --
----------
- function Less (Left, Right : Super_String) return Boolean is
+ function Less
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) <
Right.Data (1 .. Right.Current_Length);
@@ -238,8 +245,7 @@ package body Ada.Strings.Superbounded is
function Less
(Left : Super_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) < Right;
@@ -247,8 +253,7 @@ package body Ada.Strings.Superbounded is
function Less
(Left : String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left < Right.Data (1 .. Right.Current_Length);
@@ -258,7 +263,10 @@ package body Ada.Strings.Superbounded is
-- Less_Or_Equal --
-------------------
- function Less_Or_Equal (Left, Right : Super_String) return Boolean is
+ function Less_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) <=
Right.Data (1 .. Right.Current_Length);
@@ -266,8 +274,7 @@ package body Ada.Strings.Superbounded is
function Less_Or_Equal
(Left : Super_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <= Right;
@@ -275,13 +282,47 @@ package body Ada.Strings.Superbounded is
function Less_Or_Equal
(Left : String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left <= Right.Data (1 .. Right.Current_Length);
end Less_Or_Equal;
+ ----------------------
+ -- Set_Super_String --
+ ----------------------
+
+ procedure Set_Super_String
+ (Target : out Super_String;
+ Source : String;
+ Drop : Truncation := Error)
+ is
+ Slen : constant Natural := Source'Length;
+ Max_Length : constant Positive := Target.Max_Length;
+
+ begin
+ if Slen <= Max_Length then
+ Target.Current_Length := Slen;
+ Target.Data (1 .. Slen) := Source;
+
+ else
+ case Drop is
+ when Strings.Right =>
+ Target.Current_Length := Max_Length;
+ Target.Data (1 .. Max_Length) :=
+ Source (Source'First .. Source'First - 1 + Max_Length);
+
+ when Strings.Left =>
+ Target.Current_Length := Max_Length;
+ Target.Data (1 .. Max_Length) :=
+ Source (Source'Last - (Max_Length - 1) .. Source'Last);
+
+ when Strings.Error =>
+ raise Ada.Strings.Length_Error;
+ end case;
+ end if;
+ end Set_Super_String;
+
------------------
-- Super_Append --
------------------
@@ -289,9 +330,9 @@ package body Ada.Strings.Superbounded is
-- Case of Super_String and Super_String
function Super_Append
- (Left, Right : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ (Left : Super_String;
+ Right : Super_String;
+ Drop : Truncation := Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
@@ -341,7 +382,7 @@ package body Ada.Strings.Superbounded is
procedure Super_Append
(Source : in out Super_String;
New_Item : Super_String;
- Drop : Truncation := Error)
+ Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
@@ -386,8 +427,7 @@ package body Ada.Strings.Superbounded is
function Super_Append
(Left : Super_String;
Right : String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
@@ -440,7 +480,7 @@ package body Ada.Strings.Superbounded is
procedure Super_Append
(Source : in out Super_String;
New_Item : String;
- Drop : Truncation := Error)
+ Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
@@ -488,8 +528,7 @@ package body Ada.Strings.Superbounded is
function Super_Append
(Left : String;
Right : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
@@ -543,8 +582,7 @@ package body Ada.Strings.Superbounded is
function Super_Append
(Left : Super_String;
Right : Character;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
@@ -578,7 +616,7 @@ package body Ada.Strings.Superbounded is
procedure Super_Append
(Source : in out Super_String;
New_Item : Character;
- Drop : Truncation := Error)
+ Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
@@ -612,8 +650,7 @@ package body Ada.Strings.Superbounded is
function Super_Append
(Left : Character;
Right : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
@@ -649,10 +686,9 @@ package body Ada.Strings.Superbounded is
-----------------
function Super_Count
- (Source : Super_String;
- Pattern : String;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : Super_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return
@@ -661,10 +697,9 @@ package body Ada.Strings.Superbounded is
end Super_Count;
function Super_Count
- (Source : Super_String;
- Pattern : String;
- Mapping : Maps.Character_Mapping_Function)
- return Natural
+ (Source : Super_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return
@@ -674,8 +709,7 @@ package body Ada.Strings.Superbounded is
function Super_Count
(Source : Super_String;
- Set : Maps.Character_Set)
- return Natural
+ Set : Maps.Character_Set) return Natural
is
begin
return Search.Count (Source.Data (1 .. Source.Current_Length), Set);
@@ -688,8 +722,7 @@ package body Ada.Strings.Superbounded is
function Super_Delete
(Source : Super_String;
From : Positive;
- Through : Natural)
- return Super_String
+ Through : Natural) return Super_String
is
Result : Super_String (Source.Max_Length);
Slen : constant Natural := Source.Current_Length;
@@ -747,8 +780,7 @@ package body Ada.Strings.Superbounded is
function Super_Element
(Source : Super_String;
- Index : Positive)
- return Character
+ Index : Positive) return Character
is
begin
if Index in 1 .. Source.Current_Length then
@@ -782,8 +814,7 @@ package body Ada.Strings.Superbounded is
(Source : Super_String;
Count : Natural;
Pad : Character := Space;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -830,7 +861,7 @@ package body Ada.Strings.Superbounded is
procedure Super_Head
(Source : in out Super_String;
Count : Natural;
- Pad : Character := Space;
+ Pad : Character := Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
@@ -878,11 +909,10 @@ package body Ada.Strings.Superbounded is
-----------------
function Super_Index
- (Source : Super_String;
- Pattern : String;
- Going : Strings.Direction := Strings.Forward;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : Super_String;
+ Pattern : String;
+ Going : Strings.Direction := Strings.Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return Search.Index
@@ -890,11 +920,10 @@ package body Ada.Strings.Superbounded is
end Super_Index;
function Super_Index
- (Source : Super_String;
- Pattern : String;
- Going : Direction := Forward;
- Mapping : Maps.Character_Mapping_Function)
- return Natural
+ (Source : Super_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return Search.Index
@@ -905,22 +934,58 @@ package body Ada.Strings.Superbounded is
(Source : Super_String;
Set : Maps.Character_Set;
Test : Strings.Membership := Strings.Inside;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Set, Test, Going);
end Super_Index;
+ function Super_Index
+ (Source : Super_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Data (1 .. Source.Current_Length),
+ Pattern, From, Going, Mapping);
+ end Super_Index;
+
+ function Super_Index
+ (Source : Super_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Data (1 .. Source.Current_Length),
+ Pattern, From, Going, Mapping);
+ end Super_Index;
+
+ function Super_Index
+ (Source : Super_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Data (1 .. Source.Current_Length), Set, From, Test, Going);
+ end Super_Index;
+
---------------------------
-- Super_Index_Non_Blank --
---------------------------
function Super_Index_Non_Blank
(Source : Super_String;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return
@@ -928,6 +993,17 @@ package body Ada.Strings.Superbounded is
(Source.Data (1 .. Source.Current_Length), Going);
end Super_Index_Non_Blank;
+ function Super_Index_Non_Blank
+ (Source : Super_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ return
+ Search.Index_Non_Blank
+ (Source.Data (1 .. Source.Current_Length), From, Going);
+ end Super_Index_Non_Blank;
+
------------------
-- Super_Insert --
------------------
@@ -936,8 +1012,7 @@ package body Ada.Strings.Superbounded is
(Source : Super_String;
Before : Positive;
New_Item : String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -1032,11 +1107,10 @@ package body Ada.Strings.Superbounded is
---------------------
function Super_Overwrite
- (Source : Super_String;
- Position : Positive;
- New_Item : String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ (Source : Super_String;
+ Position : Positive;
+ New_Item : String;
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -1172,12 +1246,11 @@ package body Ada.Strings.Superbounded is
-------------------------
function Super_Replace_Slice
- (Source : Super_String;
- Low : Positive;
- High : Natural;
- By : String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
@@ -1273,8 +1346,7 @@ package body Ada.Strings.Superbounded is
(Count : Natural;
Item : Character;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
@@ -1297,8 +1369,7 @@ package body Ada.Strings.Superbounded is
(Count : Natural;
Item : String;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Length : constant Integer := Count * Item'Length;
Result : Super_String (Max_Length);
@@ -1354,8 +1425,7 @@ package body Ada.Strings.Superbounded is
function Super_Replicate
(Count : Natural;
Item : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
begin
return
@@ -1373,8 +1443,7 @@ package body Ada.Strings.Superbounded is
function Super_Slice
(Source : Super_String;
Low : Positive;
- High : Natural)
- return String
+ High : Natural) return String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
@@ -1388,6 +1457,43 @@ package body Ada.Strings.Superbounded is
end if;
end Super_Slice;
+ function Super_Slice
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural) return Super_String
+ is
+ Result : Super_String (Source.Max_Length);
+
+ begin
+ if Low > Source.Current_Length + 1
+ or else High > Source.Current_Length
+ then
+ raise Index_Error;
+ else
+ Result.Current_Length := High - Low + 1;
+ Result.Data (1 .. Source.Current_Length) := Source.Data (Low .. High);
+ end if;
+
+ return Result;
+ end Super_Slice;
+
+ procedure Super_Slice
+ (Source : Super_String;
+ Target : out Super_String;
+ Low : Positive;
+ High : Natural)
+ is
+ begin
+ if Low > Source.Current_Length + 1
+ or else High > Source.Current_Length
+ then
+ raise Index_Error;
+ else
+ Target.Current_Length := High - Low + 1;
+ Target.Data (1 .. Source.Current_Length) := Source.Data (Low .. High);
+ end if;
+ end Super_Slice;
+
----------------
-- Super_Tail --
----------------
@@ -1396,8 +1502,7 @@ package body Ada.Strings.Superbounded is
(Source : Super_String;
Count : Natural;
Pad : Character := Space;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -1445,7 +1550,7 @@ package body Ada.Strings.Superbounded is
procedure Super_Tail
(Source : in out Super_String;
Count : Natural;
- Pad : Character := Space;
+ Pad : Character := Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
@@ -1497,7 +1602,7 @@ package body Ada.Strings.Superbounded is
-- Super_To_String --
---------------------
- function Super_To_String (Source : in Super_String) return String is
+ function Super_To_String (Source : Super_String) return String is
begin
return Source.Data (1 .. Source.Current_Length);
end Super_To_String;
@@ -1508,8 +1613,7 @@ package body Ada.Strings.Superbounded is
function Super_Translate
(Source : Super_String;
- Mapping : Maps.Character_Mapping)
- return Super_String
+ Mapping : Maps.Character_Mapping) return Super_String
is
Result : Super_String (Source.Max_Length);
@@ -1535,8 +1639,7 @@ package body Ada.Strings.Superbounded is
function Super_Translate
(Source : Super_String;
- Mapping : Maps.Character_Mapping_Function)
- return Super_String
+ Mapping : Maps.Character_Mapping_Function) return Super_String
is
Result : Super_String (Source.Max_Length);
@@ -1564,8 +1667,9 @@ package body Ada.Strings.Superbounded is
-- Super_Trim --
----------------
- function Super_Trim (Source : Super_String; Side : Trim_End)
- return Super_String
+ function Super_Trim
+ (Source : Super_String;
+ Side : Trim_End) return Super_String
is
Result : Super_String (Source.Max_Length);
Last : Natural := Source.Current_Length;
@@ -1621,8 +1725,7 @@ package body Ada.Strings.Superbounded is
function Super_Trim
(Source : Super_String;
Left : Maps.Character_Set;
- Right : Maps.Character_Set)
- return Super_String
+ Right : Maps.Character_Set) return Super_String
is
Result : Super_String (Source.Max_Length);
@@ -1688,8 +1791,7 @@ package body Ada.Strings.Superbounded is
function Times
(Left : Natural;
Right : Character;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
@@ -1711,8 +1813,7 @@ package body Ada.Strings.Superbounded is
function Times
(Left : Natural;
Right : String;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
Pos : Positive := 1;
@@ -1739,8 +1840,7 @@ package body Ada.Strings.Superbounded is
function Times
(Left : Natural;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Pos : Positive := 1;
@@ -1773,8 +1873,7 @@ package body Ada.Strings.Superbounded is
function To_Super_String
(Source : String;
Max_Length : Natural;
- Drop : Truncation := Error)
- return Super_String
+ Drop : Truncation := Error) return Super_String
is
Result : Super_String (Max_Length);
Slen : constant Natural := Source'Length;
diff --git a/gcc/ada/a-strsup.ads b/gcc/ada/a-strsup.ads
index 7716ca79e25..542f821e74f 100644
--- a/gcc/ada/a-strsup.ads
+++ b/gcc/ada/a-strsup.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2005 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- --
@@ -63,8 +63,7 @@ pragma Preelaborate (Superbounded);
function To_Super_String
(Source : String;
Max_Length : Natural;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
-- Note the additional parameter Max_Length, which specifies the maximum
-- length setting of the resulting Super_String value.
@@ -73,34 +72,35 @@ pragma Preelaborate (Superbounded);
function Super_To_String (Source : Super_String) return String;
+ procedure Set_Super_String
+ (Target : out Super_String;
+ Source : String;
+ Drop : Truncation := Error);
+
function Super_Append
- (Left, Right : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ (Left : Super_String;
+ Right : Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Super_String;
Right : String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : String;
Right : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Super_String;
Right : Character;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Character;
Right : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Append
(Source : in out Super_String;
@@ -118,33 +118,28 @@ pragma Preelaborate (Superbounded);
Drop : Truncation := Error);
function Concat
- (Left, Right : Super_String)
- return Super_String;
+ (Left : Super_String;
+ Right : Super_String) return Super_String;
function Concat
(Left : Super_String;
- Right : String)
- return Super_String;
+ Right : String) return Super_String;
function Concat
(Left : String;
- Right : Super_String)
- return Super_String;
+ Right : Super_String) return Super_String;
function Concat
(Left : Super_String;
- Right : Character)
- return Super_String;
+ Right : Character) return Super_String;
function Concat
(Left : Character;
- Right : Super_String)
- return Super_String;
+ Right : Super_String) return Super_String;
function Super_Element
(Source : Super_String;
- Index : Positive)
- return Character;
+ Index : Positive) return Character;
procedure Super_Replace_Element
(Source : in out Super_String;
@@ -154,70 +149,82 @@ pragma Preelaborate (Superbounded);
function Super_Slice
(Source : Super_String;
Low : Positive;
- High : Natural)
- return String;
+ High : Natural) return String;
+
+ function Super_Slice
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural) return Super_String;
+
+ procedure Super_Slice
+ (Source : Super_String;
+ Target : out Super_String;
+ Low : Positive;
+ High : Natural);
- function "=" (Left, Right : Super_String) return Boolean;
+ function "="
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
- function Equal (Left, Right : Super_String) return Boolean renames "=";
+ function Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean renames "=";
function Equal
(Left : Super_String;
- Right : String)
- return Boolean;
+ Right : String) return Boolean;
function Equal
(Left : String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Less (Left, Right : Super_String) return Boolean;
+ function Less
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Less
(Left : Super_String;
- Right : String)
- return Boolean;
+ Right : String) return Boolean;
function Less
(Left : String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Less_Or_Equal (Left, Right : Super_String) return Boolean;
+ function Less_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Less_Or_Equal
(Left : Super_String;
- Right : String)
- return Boolean;
+ Right : String) return Boolean;
function Less_Or_Equal
(Left : String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Greater (Left, Right : Super_String) return Boolean;
+ function Greater
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Greater
(Left : Super_String;
- Right : String)
- return Boolean;
+ Right : String) return Boolean;
function Greater
(Left : String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Greater_Or_Equal (Left, Right : Super_String) return Boolean;
+ function Greater_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Greater_Or_Equal
(Left : Super_String;
- Right : String)
- return Boolean;
+ Right : String) return Boolean;
function Greater_Or_Equal
(Left : String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
----------------------
-- Search Functions --
@@ -227,44 +234,63 @@ pragma Preelaborate (Superbounded);
(Source : Super_String;
Pattern : String;
Going : Direction := Forward;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Super_Index
(Source : Super_String;
Pattern : String;
Going : Direction := Forward;
- Mapping : Maps.Character_Mapping_Function)
- return Natural;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Super_Index
(Source : Super_String;
Set : Maps.Character_Set;
Test : Membership := Inside;
- Going : Direction := Forward)
- return Natural;
+ Going : Direction := Forward) return Natural;
+
+ function Super_Index
+ (Source : Super_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Super_Index
+ (Source : Super_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+
+ function Super_Index
+ (Source : Super_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Super_Index_Non_Blank
+ (Source : Super_String;
+ Going : Direction := Forward) return Natural;
function Super_Index_Non_Blank
(Source : Super_String;
- Going : Direction := Forward)
- return Natural;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
function Super_Count
(Source : Super_String;
Pattern : String;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Super_Count
(Source : Super_String;
Pattern : String;
- Mapping : Maps.Character_Mapping_Function)
- return Natural;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Super_Count
(Source : Super_String;
- Set : Maps.Character_Set)
- return Natural;
+ Set : Maps.Character_Set) return Natural;
procedure Super_Find_Token
(Source : Super_String;
@@ -278,9 +304,8 @@ pragma Preelaborate (Superbounded);
------------------------------------
function Super_Translate
- (Source : Super_String;
- Mapping : Maps.Character_Mapping)
- return Super_String;
+ (Source : Super_String;
+ Mapping : Maps.Character_Mapping) return Super_String;
procedure Super_Translate
(Source : in out Super_String;
@@ -288,8 +313,7 @@ pragma Preelaborate (Superbounded);
function Super_Translate
(Source : Super_String;
- Mapping : Maps.Character_Mapping_Function)
- return Super_String;
+ Mapping : Maps.Character_Mapping_Function) return Super_String;
procedure Super_Translate
(Source : in out Super_String;
@@ -300,26 +324,24 @@ pragma Preelaborate (Superbounded);
---------------------------------------
function Super_Replace_Slice
- (Source : Super_String;
- Low : Positive;
- High : Natural;
- By : String;
- Drop : Truncation := Error)
- return Super_String;
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Replace_Slice
- (Source : in out Super_String;
- Low : Positive;
- High : Natural;
- By : String;
- Drop : Truncation := Error);
+ (Source : in out Super_String;
+ Low : Positive;
+ High : Natural;
+ By : String;
+ Drop : Truncation := Error);
function Super_Insert
(Source : Super_String;
Before : Positive;
New_Item : String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Insert
(Source : in out Super_String;
@@ -328,11 +350,10 @@ pragma Preelaborate (Superbounded);
Drop : Truncation := Error);
function Super_Overwrite
- (Source : Super_String;
- Position : Positive;
- New_Item : String;
- Drop : Truncation := Error)
- return Super_String;
+ (Source : Super_String;
+ Position : Positive;
+ New_Item : String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Overwrite
(Source : in out Super_String;
@@ -343,8 +364,7 @@ pragma Preelaborate (Superbounded);
function Super_Delete
(Source : Super_String;
From : Positive;
- Through : Natural)
- return Super_String;
+ Through : Natural) return Super_String;
procedure Super_Delete
(Source : in out Super_String;
@@ -357,18 +377,16 @@ pragma Preelaborate (Superbounded);
function Super_Trim
(Source : Super_String;
- Side : Trim_End)
- return Super_String;
+ Side : Trim_End) return Super_String;
procedure Super_Trim
(Source : in out Super_String;
Side : Trim_End);
function Super_Trim
- (Source : Super_String;
+ (Source : Super_String;
Left : Maps.Character_Set;
- Right : Maps.Character_Set)
- return Super_String;
+ Right : Maps.Character_Set) return Super_String;
procedure Super_Trim
(Source : in out Super_String;
@@ -379,26 +397,24 @@ pragma Preelaborate (Superbounded);
(Source : Super_String;
Count : Natural;
Pad : Character := Space;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Head
(Source : in out Super_String;
Count : Natural;
- Pad : Character := Space;
+ Pad : Character := Space;
Drop : Truncation := Error);
function Super_Tail
(Source : Super_String;
Count : Natural;
- Pad : Character := Space;
- Drop : Truncation := Error)
- return Super_String;
+ Pad : Character := Space;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Tail
(Source : in out Super_String;
Count : Natural;
- Pad : Character := Space;
+ Pad : Character := Space;
Drop : Truncation := Error);
------------------------------------
@@ -412,46 +428,39 @@ pragma Preelaborate (Superbounded);
function Times
(Left : Natural;
Right : Character;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Times
(Left : Natural;
Right : String;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Times
(Left : Natural;
- Right : Super_String)
- return Super_String;
+ Right : Super_String) return Super_String;
function Super_Replicate
(Count : Natural;
Item : Character;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Super_Replicate
(Count : Natural;
Item : String;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Super_Replicate
(Count : Natural;
Item : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
private
-
-- Pragma Inline declarations
pragma Inline ("=");
diff --git a/gcc/ada/a-strunb.adb b/gcc/ada/a-strunb.adb
index d9c411f5601..8a997b3cf41 100644
--- a/gcc/ada/a-strunb.adb
+++ b/gcc/ada/a-strunb.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -44,16 +44,19 @@ package body Ada.Strings.Unbounded is
Chunk_Size : Natural);
pragma Inline (Realloc_For_Chunk);
-- Adjust the size allocated for the string. Add at least Chunk_Size so it
- -- is safe to add a string of this size at the end of the current
- -- content. The real size allocated for the string is Chunk_Size + x %
- -- of the current string size. This buffered handling makes the Append
- -- unbounded string routines very fast.
+ -- is safe to add a string of this size at the end of the current content.
+ -- The real size allocated for the string is Chunk_Size + x of the current
+ -- string size. This buffered handling makes the Append unbounded string
+ -- routines very fast.
---------
-- "&" --
---------
- function "&" (Left, Right : Unbounded_String) return Unbounded_String is
+ function "&"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Unbounded_String
+ is
L_Length : constant Natural := Left.Last;
R_Length : constant Natural := Right.Last;
Result : Unbounded_String;
@@ -73,8 +76,7 @@ package body Ada.Strings.Unbounded is
function "&"
(Left : Unbounded_String;
- Right : String)
- return Unbounded_String
+ Right : String) return Unbounded_String
is
L_Length : constant Natural := Left.Last;
Result : Unbounded_String;
@@ -92,8 +94,7 @@ package body Ada.Strings.Unbounded is
function "&"
(Left : String;
- Right : Unbounded_String)
- return Unbounded_String
+ Right : Unbounded_String) return Unbounded_String
is
R_Length : constant Natural := Right.Last;
Result : Unbounded_String;
@@ -112,8 +113,7 @@ package body Ada.Strings.Unbounded is
function "&"
(Left : Unbounded_String;
- Right : Character)
- return Unbounded_String
+ Right : Character) return Unbounded_String
is
Result : Unbounded_String;
@@ -131,8 +131,7 @@ package body Ada.Strings.Unbounded is
function "&"
(Left : Character;
- Right : Unbounded_String)
- return Unbounded_String
+ Right : Unbounded_String) return Unbounded_String
is
Result : Unbounded_String;
@@ -152,8 +151,7 @@ package body Ada.Strings.Unbounded is
function "*"
(Left : Natural;
- Right : Character)
- return Unbounded_String
+ Right : Character) return Unbounded_String
is
Result : Unbounded_String;
@@ -170,8 +168,7 @@ package body Ada.Strings.Unbounded is
function "*"
(Left : Natural;
- Right : String)
- return Unbounded_String
+ Right : String) return Unbounded_String
is
Len : constant Natural := Right'Length;
K : Positive;
@@ -193,8 +190,7 @@ package body Ada.Strings.Unbounded is
function "*"
(Left : Natural;
- Right : Unbounded_String)
- return Unbounded_String
+ Right : Unbounded_String) return Unbounded_String
is
Len : constant Natural := Right.Last;
K : Positive;
@@ -219,7 +215,10 @@ package body Ada.Strings.Unbounded is
-- "<" --
---------
- function "<" (Left, Right : Unbounded_String) return Boolean is
+ function "<"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) < Right.Reference (1 .. Right.Last);
@@ -227,8 +226,7 @@ package body Ada.Strings.Unbounded is
function "<"
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) < Right;
@@ -236,8 +234,7 @@ package body Ada.Strings.Unbounded is
function "<"
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left < Right.Reference (1 .. Right.Last);
@@ -247,7 +244,10 @@ package body Ada.Strings.Unbounded is
-- "<=" --
----------
- function "<=" (Left, Right : Unbounded_String) return Boolean is
+ function "<="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) <= Right.Reference (1 .. Right.Last);
@@ -255,8 +255,7 @@ package body Ada.Strings.Unbounded is
function "<="
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) <= Right;
@@ -264,8 +263,7 @@ package body Ada.Strings.Unbounded is
function "<="
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left <= Right.Reference (1 .. Right.Last);
@@ -275,7 +273,10 @@ package body Ada.Strings.Unbounded is
-- "=" --
---------
- function "=" (Left, Right : Unbounded_String) return Boolean is
+ function "="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) = Right.Reference (1 .. Right.Last);
@@ -283,8 +284,7 @@ package body Ada.Strings.Unbounded is
function "="
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) = Right;
@@ -292,8 +292,7 @@ package body Ada.Strings.Unbounded is
function "="
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left = Right.Reference (1 .. Right.Last);
@@ -303,7 +302,10 @@ package body Ada.Strings.Unbounded is
-- ">" --
---------
- function ">" (Left, Right : Unbounded_String) return Boolean is
+ function ">"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) > Right.Reference (1 .. Right.Last);
@@ -311,8 +313,7 @@ package body Ada.Strings.Unbounded is
function ">"
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) > Right;
@@ -320,8 +321,7 @@ package body Ada.Strings.Unbounded is
function ">"
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left > Right.Reference (1 .. Right.Last);
@@ -331,7 +331,10 @@ package body Ada.Strings.Unbounded is
-- ">=" --
----------
- function ">=" (Left, Right : Unbounded_String) return Boolean is
+ function ">="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean
+ is
begin
return
Left.Reference (1 .. Left.Last) >= Right.Reference (1 .. Right.Last);
@@ -339,8 +342,7 @@ package body Ada.Strings.Unbounded is
function ">="
(Left : Unbounded_String;
- Right : String)
- return Boolean
+ Right : String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) >= Right;
@@ -348,8 +350,7 @@ package body Ada.Strings.Unbounded is
function ">="
(Left : String;
- Right : Unbounded_String)
- return Boolean
+ Right : Unbounded_String) return Boolean
is
begin
return Left >= Right.Reference (1 .. Right.Last);
@@ -362,9 +363,8 @@ package body Ada.Strings.Unbounded is
procedure Adjust (Object : in out Unbounded_String) is
begin
-- Copy string, except we do not copy the statically allocated null
- -- string, since it can never be deallocated.
- -- Note that we do not copy extra string room here to avoid dragging
- -- unused allocated memory.
+ -- string, since it can never be deallocated. Note that we do not copy
+ -- extra string room here to avoid dragging unused allocated memory.
if Object.Reference /= Null_String'Access then
Object.Reference := new String'(Object.Reference (1 .. Object.Last));
@@ -412,10 +412,9 @@ package body Ada.Strings.Unbounded is
-----------
function Count
- (Source : Unbounded_String;
- Pattern : String;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return
@@ -423,10 +422,9 @@ package body Ada.Strings.Unbounded is
end Count;
function Count
- (Source : Unbounded_String;
- Pattern : String;
- Mapping : Maps.Character_Mapping_Function)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return
@@ -434,9 +432,8 @@ package body Ada.Strings.Unbounded is
end Count;
function Count
- (Source : Unbounded_String;
- Set : Maps.Character_Set)
- return Natural
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set) return Natural
is
begin
return Search.Count (Source.Reference (1 .. Source.Last), Set);
@@ -449,8 +446,7 @@ package body Ada.Strings.Unbounded is
function Delete
(Source : Unbounded_String;
From : Positive;
- Through : Natural)
- return Unbounded_String
+ Through : Natural) return Unbounded_String
is
begin
return
@@ -488,8 +484,7 @@ package body Ada.Strings.Unbounded is
function Element
(Source : Unbounded_String;
- Index : Positive)
- return Character
+ Index : Positive) return Character
is
begin
if Index <= Source.Last then
@@ -556,8 +551,7 @@ package body Ada.Strings.Unbounded is
function Head
(Source : Unbounded_String;
Count : Natural;
- Pad : Character := Space)
- return Unbounded_String
+ Pad : Character := Space) return Unbounded_String
is
begin
return To_Unbounded_String
@@ -570,7 +564,6 @@ package body Ada.Strings.Unbounded is
Pad : Character := Space)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference :=
new String'(Fixed.Head (Source.Reference (1 .. Source.Last),
@@ -584,11 +577,10 @@ package body Ada.Strings.Unbounded is
-----------
function Index
- (Source : Unbounded_String;
- Pattern : String;
- Going : Strings.Direction := Strings.Forward;
- Mapping : Maps.Character_Mapping := Maps.Identity)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Strings.Direction := Strings.Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return Search.Index
@@ -596,11 +588,10 @@ package body Ada.Strings.Unbounded is
end Index;
function Index
- (Source : Unbounded_String;
- Pattern : String;
- Going : Direction := Forward;
- Mapping : Maps.Character_Mapping_Function)
- return Natural
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return Search.Index
@@ -611,22 +602,69 @@ package body Ada.Strings.Unbounded is
(Source : Unbounded_String;
Set : Maps.Character_Set;
Test : Strings.Membership := Strings.Inside;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Search.Index
(Source.Reference (1 .. Source.Last), Set, Test, Going);
end Index;
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping);
+ end Index;
+
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping);
+ end Index;
+
+
+ function Index
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ return Search.Index
+ (Source.Reference (1 .. Source.Last), Set, From, Test, Going);
+ end Index;
+
+ function Index_Non_Blank
+ (Source : Unbounded_String;
+ Going : Strings.Direction := Strings.Forward) return Natural
+ is
+ begin
+ return
+ Search.Index_Non_Blank
+ (Source.Reference (1 .. Source.Last), Going);
+ end Index_Non_Blank;
+
function Index_Non_Blank
(Source : Unbounded_String;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ From : Positive;
+ Going : Direction := Forward) return Natural
is
begin
return
- Search.Index_Non_Blank (Source.Reference (1 .. Source.Last), Going);
+ Search.Index_Non_Blank
+ (Source.Reference (1 .. Source.Last), From, Going);
end Index_Non_Blank;
----------------
@@ -646,8 +684,7 @@ package body Ada.Strings.Unbounded is
function Insert
(Source : Unbounded_String;
Before : Positive;
- New_Item : String)
- return Unbounded_String
+ New_Item : String) return Unbounded_String
is
begin
return To_Unbounded_String
@@ -688,11 +725,10 @@ package body Ada.Strings.Unbounded is
---------------
function Overwrite
- (Source : Unbounded_String;
- Position : Positive;
- New_Item : String)
- return Unbounded_String is
-
+ (Source : Unbounded_String;
+ Position : Positive;
+ New_Item : String) return Unbounded_String
+ is
begin
return To_Unbounded_String
(Fixed.Overwrite
@@ -705,15 +741,12 @@ package body Ada.Strings.Unbounded is
New_Item : String)
is
NL : constant Natural := New_Item'Length;
-
begin
if Position <= Source.Last - NL + 1 then
Source.Reference (Position .. Position + NL - 1) := New_Item;
-
else
declare
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Overwrite
@@ -741,7 +774,6 @@ package body Ada.Strings.Unbounded is
Alloc_Chunk_Size : constant Positive :=
Chunk_Size + (S_Length / Growth_Factor);
Tmp : String_Access;
-
begin
Tmp := new String (1 .. S_Length + Alloc_Chunk_Size);
Tmp (1 .. Source.Last) := Source.Reference (1 .. Source.Last);
@@ -773,11 +805,10 @@ package body Ada.Strings.Unbounded is
-------------------
function Replace_Slice
- (Source : Unbounded_String;
- Low : Positive;
- High : Natural;
- By : String)
- return Unbounded_String
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String) return Unbounded_String
is
begin
return To_Unbounded_String
@@ -786,13 +817,12 @@ package body Ada.Strings.Unbounded is
end Replace_Slice;
procedure Replace_Slice
- (Source : in out Unbounded_String;
- Low : Positive;
- High : Natural;
- By : String)
+ (Source : in out Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Replace_Slice
@@ -801,6 +831,20 @@ package body Ada.Strings.Unbounded is
Free (Old);
end Replace_Slice;
+ --------------------------
+ -- Set_Unbounded_String --
+ --------------------------
+
+ procedure Set_Unbounded_String
+ (Target : out Unbounded_String;
+ Source : String)
+ is
+ begin
+ Target.Last := Source'Length;
+ Target.Reference := new String (1 .. Source'Length);
+ Target.Reference.all := Source;
+ end Set_Unbounded_String;
+
-----------
-- Slice --
-----------
@@ -808,8 +852,7 @@ package body Ada.Strings.Unbounded is
function Slice
(Source : Unbounded_String;
Low : Positive;
- High : Natural)
- return String
+ High : Natural) return String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
@@ -828,9 +871,7 @@ package body Ada.Strings.Unbounded is
function Tail
(Source : Unbounded_String;
Count : Natural;
- Pad : Character := Space)
- return Unbounded_String is
-
+ Pad : Character := Space) return Unbounded_String is
begin
return To_Unbounded_String
(Fixed.Tail (Source.Reference (1 .. Source.Last), Count, Pad));
@@ -842,7 +883,6 @@ package body Ada.Strings.Unbounded is
Pad : Character := Space)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Tail (Source.Reference (1 .. Source.Last), Count, Pad));
@@ -865,7 +905,6 @@ package body Ada.Strings.Unbounded is
function To_Unbounded_String (Source : String) return Unbounded_String is
Result : Unbounded_String;
-
begin
Result.Last := Source'Length;
Result.Reference := new String (1 .. Source'Length);
@@ -874,11 +913,9 @@ package body Ada.Strings.Unbounded is
end To_Unbounded_String;
function To_Unbounded_String
- (Length : Natural)
- return Unbounded_String
+ (Length : Natural) return Unbounded_String
is
Result : Unbounded_String;
-
begin
Result.Last := Length;
Result.Reference := new String (1 .. Length);
@@ -891,8 +928,7 @@ package body Ada.Strings.Unbounded is
function Translate
(Source : Unbounded_String;
- Mapping : Maps.Character_Mapping)
- return Unbounded_String
+ Mapping : Maps.Character_Mapping) return Unbounded_String
is
begin
return To_Unbounded_String
@@ -909,8 +945,7 @@ package body Ada.Strings.Unbounded is
function Translate
(Source : Unbounded_String;
- Mapping : Maps.Character_Mapping_Function)
- return Unbounded_String
+ Mapping : Maps.Character_Mapping_Function) return Unbounded_String
is
begin
return To_Unbounded_String
@@ -931,8 +966,7 @@ package body Ada.Strings.Unbounded is
function Trim
(Source : Unbounded_String;
- Side : Trim_End)
- return Unbounded_String
+ Side : Trim_End) return Unbounded_String
is
begin
return To_Unbounded_String
@@ -944,7 +978,6 @@ package body Ada.Strings.Unbounded is
Side : Trim_End)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Trim (Source.Reference (1 .. Source.Last), Side));
@@ -955,8 +988,7 @@ package body Ada.Strings.Unbounded is
function Trim
(Source : Unbounded_String;
Left : Maps.Character_Set;
- Right : Maps.Character_Set)
- return Unbounded_String
+ Right : Maps.Character_Set) return Unbounded_String
is
begin
return To_Unbounded_String
@@ -969,7 +1001,6 @@ package body Ada.Strings.Unbounded is
Right : Maps.Character_Set)
is
Old : String_Access := Source.Reference;
-
begin
Source.Reference := new String'
(Fixed.Trim (Source.Reference (1 .. Source.Last), Left, Right));
@@ -977,4 +1008,35 @@ package body Ada.Strings.Unbounded is
Free (Old);
end Trim;
+ ---------------------
+ -- Unbounded_Slice --
+ ---------------------
+
+ function Unbounded_Slice
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural) return Unbounded_String
+ is
+ begin
+ if Low > Source.Last + 1 or else High > Source.Last then
+ raise Index_Error;
+ else
+ return To_Unbounded_String (Source.Reference.all (Low .. High));
+ end if;
+ end Unbounded_Slice;
+
+ procedure Unbounded_Slice
+ (Source : Unbounded_String;
+ Target : out Unbounded_String;
+ Low : Positive;
+ High : Natural)
+ is
+ begin
+ if Low > Source.Last + 1 or else High > Source.Last then
+ raise Index_Error;
+ else
+ Target := To_Unbounded_String (Source.Reference.all (Low .. High));
+ end if;
+ end Unbounded_Slice;
+
end Ada.Strings.Unbounded;
diff --git a/gcc/ada/a-strunb.ads b/gcc/ada/a-strunb.ads
index 996eb0e10cf..c974b879e27 100644
--- a/gcc/ada/a-strunb.ads
+++ b/gcc/ada/a-strunb.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,172 +55,212 @@ pragma Preelaborate (Unbounded);
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
- function To_Unbounded_String (Source : String) return Unbounded_String;
- function To_Unbounded_String (Length : in Natural) return Unbounded_String;
+ function To_Unbounded_String
+ (Source : String) return Unbounded_String;
+
+ function To_Unbounded_String
+ (Length : Natural) return Unbounded_String;
function To_String (Source : Unbounded_String) return String;
+ procedure Set_Unbounded_String
+ (Target : out Unbounded_String;
+ Source : String);
+ pragma Ada_05 (Set_Unbounded_String);
+
procedure Append
(Source : in out Unbounded_String;
- New_Item : in Unbounded_String);
+ New_Item : Unbounded_String);
procedure Append
(Source : in out Unbounded_String;
- New_Item : in String);
+ New_Item : String);
procedure Append
(Source : in out Unbounded_String;
- New_Item : in Character);
+ New_Item : Character);
- function "&" (Left, Right : Unbounded_String) return Unbounded_String;
+ function "&"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Unbounded_String;
function "&"
- (Left : in Unbounded_String;
- Right : in String)
- return Unbounded_String;
+ (Left : Unbounded_String;
+ Right : String) return Unbounded_String;
function "&"
- (Left : in String;
- Right : in Unbounded_String)
- return Unbounded_String;
+ (Left : String;
+ Right : Unbounded_String) return Unbounded_String;
function "&"
- (Left : in Unbounded_String;
- Right : in Character)
- return Unbounded_String;
+ (Left : Unbounded_String;
+ Right : Character) return Unbounded_String;
function "&"
- (Left : in Character;
- Right : in Unbounded_String)
- return Unbounded_String;
+ (Left : Character;
+ Right : Unbounded_String) return Unbounded_String;
function Element
- (Source : in Unbounded_String;
- Index : in Positive)
- return Character;
+ (Source : Unbounded_String;
+ Index : Positive) return Character;
procedure Replace_Element
(Source : in out Unbounded_String;
- Index : in Positive;
+ Index : Positive;
By : Character);
function Slice
- (Source : in Unbounded_String;
- Low : in Positive;
- High : in Natural)
- return String;
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural) return String;
+
+ function Unbounded_Slice
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural) return Unbounded_String;
+ pragma Ada_05 (Unbounded_Slice);
+
+ procedure Unbounded_Slice
+ (Source : Unbounded_String;
+ Target : out Unbounded_String;
+ Low : Positive;
+ High : Natural);
+ pragma Ada_05 (Unbounded_Slice);
- function "=" (Left, Right : in Unbounded_String) return Boolean;
+ function "="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function "="
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function "="
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function "<" (Left, Right : in Unbounded_String) return Boolean;
+ function "<"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function "<"
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function "<"
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function "<=" (Left, Right : in Unbounded_String) return Boolean;
+ function "<="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function "<="
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function "<="
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function ">" (Left, Right : in Unbounded_String) return Boolean;
+ function ">"
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function ">"
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function ">"
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
- function ">=" (Left, Right : in Unbounded_String) return Boolean;
+ function ">="
+ (Left : Unbounded_String;
+ Right : Unbounded_String) return Boolean;
function ">="
- (Left : in Unbounded_String;
- Right : in String)
- return Boolean;
+ (Left : Unbounded_String;
+ Right : String) return Boolean;
function ">="
- (Left : in String;
- Right : in Unbounded_String)
- return Boolean;
+ (Left : String;
+ Right : Unbounded_String) return Boolean;
------------------------
-- Search Subprograms --
------------------------
function Index
- (Source : in Unbounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Index
- (Source : in Unbounded_String;
- Pattern : in String;
- Going : in Direction := Forward;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
function Index
- (Source : in Unbounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Unbounded_String;
+ Pattern : String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
function Index_Non_Blank
- (Source : in Unbounded_String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Unbounded_String;
+ Going : Direction := Forward) return Natural;
+
+ function Index_Non_Blank
+ (Source : Unbounded_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in Unbounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping := Maps.Identity)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Count
- (Source : in Unbounded_String;
- Pattern : in String;
- Mapping : in Maps.Character_Mapping_Function)
- return Natural;
+ (Source : Unbounded_String;
+ Pattern : String;
+ Mapping : Maps.Character_Mapping_Function) return Natural;
function Count
- (Source : in Unbounded_String;
- Set : in Maps.Character_Set)
- return Natural;
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set) return Natural;
procedure Find_Token
- (Source : in Unbounded_String;
- Set : in Maps.Character_Set;
- Test : in Membership;
+ (Source : Unbounded_String;
+ Set : Maps.Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
@@ -229,129 +269,116 @@ pragma Preelaborate (Unbounded);
------------------------------------
function Translate
- (Source : in Unbounded_String;
- Mapping : in Maps.Character_Mapping)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Mapping : Maps.Character_Mapping) return Unbounded_String;
procedure Translate
(Source : in out Unbounded_String;
Mapping : Maps.Character_Mapping);
function Translate
- (Source : in Unbounded_String;
- Mapping : in Maps.Character_Mapping_Function)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Mapping : Maps.Character_Mapping_Function) return Unbounded_String;
procedure Translate
(Source : in out Unbounded_String;
- Mapping : in Maps.Character_Mapping_Function);
+ Mapping : Maps.Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
- (Source : in Unbounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String) return Unbounded_String;
procedure Replace_Slice
- (Source : in out Unbounded_String;
- Low : in Positive;
- High : in Natural;
- By : in String);
+ (Source : in out Unbounded_String;
+ Low : Positive;
+ High : Natural;
+ By : String);
function Insert
- (Source : in Unbounded_String;
- Before : in Positive;
- New_Item : in String)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Before : Positive;
+ New_Item : String) return Unbounded_String;
procedure Insert
(Source : in out Unbounded_String;
- Before : in Positive;
- New_Item : in String);
+ Before : Positive;
+ New_Item : String);
function Overwrite
- (Source : in Unbounded_String;
- Position : in Positive;
- New_Item : in String)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Position : Positive;
+ New_Item : String) return Unbounded_String;
procedure Overwrite
- (Source : in out Unbounded_String;
- Position : in Positive;
- New_Item : in String);
+ (Source : in out Unbounded_String;
+ Position : Positive;
+ New_Item : String);
function Delete
- (Source : in Unbounded_String;
- From : in Positive;
- Through : in Natural)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ From : Positive;
+ Through : Natural) return Unbounded_String;
procedure Delete
(Source : in out Unbounded_String;
- From : in Positive;
- Through : in Natural);
+ From : Positive;
+ Through : Natural);
function Trim
- (Source : in Unbounded_String;
- Side : in Trim_End)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Side : Trim_End) return Unbounded_String;
procedure Trim
(Source : in out Unbounded_String;
- Side : in Trim_End);
+ Side : Trim_End);
function Trim
- (Source : in Unbounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set) return Unbounded_String;
procedure Trim
(Source : in out Unbounded_String;
- Left : in Maps.Character_Set;
- Right : in Maps.Character_Set);
+ Left : Maps.Character_Set;
+ Right : Maps.Character_Set);
function Head
- (Source : in Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Count : Natural;
+ Pad : Character := Space) return Unbounded_String;
procedure Head
(Source : in out Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space);
+ Count : Natural;
+ Pad : Character := Space);
function Tail
- (Source : in Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space)
- return Unbounded_String;
+ (Source : Unbounded_String;
+ Count : Natural;
+ Pad : Character := Space) return Unbounded_String;
procedure Tail
(Source : in out Unbounded_String;
- Count : in Natural;
- Pad : in Character := Space);
+ Count : Natural;
+ Pad : Character := Space);
function "*"
- (Left : in Natural;
- Right : in Character)
- return Unbounded_String;
+ (Left : Natural;
+ Right : Character) return Unbounded_String;
function "*"
- (Left : in Natural;
- Right : in String)
- return Unbounded_String;
+ (Left : Natural;
+ Right : String) return Unbounded_String;
function "*"
- (Left : in Natural;
- Right : in Unbounded_String)
- return Unbounded_String;
+ (Left : Natural;
+ Right : Unbounded_String) return Unbounded_String;
private
pragma Inline (Length);
diff --git a/gcc/ada/a-stunau.ads b/gcc/ada/a-stunau.ads
index 2da87482fa0..6ba3e567140 100644
--- a/gcc/ada/a-stunau.ads
+++ b/gcc/ada/a-stunau.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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,7 @@
-- This child package of Ada.Strings.Unbounded provides some specialized
-- access functions which are intended to allow more efficient use of the
-- facilities of Ada.Strings.Unbounded, particularly by other layered
--- utilities (such as GNAT.Patterns).
+-- utilities (such as GNAT.SPITBOL.Patterns).
package Ada.Strings.Unbounded.Aux is
pragma Preelaborate (Aux);
diff --git a/gcc/ada/a-stwibo.adb b/gcc/ada/a-stwibo.adb
index 9d0661a6c96..a53dd7a3569 100644
--- a/gcc/ada/a-stwibo.adb
+++ b/gcc/ada/a-stwibo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -40,18 +40,16 @@ package body Ada.Strings.Wide_Bounded is
---------
function "*"
- (Left : in Natural;
- Right : in Wide_Character)
- return Bounded_Wide_String
+ (Left : Natural;
+ Right : Wide_Character) return Bounded_Wide_String
is
begin
return Times (Left, Right, Max_Length);
end "*";
function "*"
- (Left : in Natural;
- Right : in Wide_String)
- return Bounded_Wide_String
+ (Left : Natural;
+ Right : Wide_String) return Bounded_Wide_String
is
begin
return Times (Left, Right, Max_Length);
@@ -62,39 +60,37 @@ package body Ada.Strings.Wide_Bounded is
---------------
function Replicate
- (Count : in Natural;
- Item : in Wide_Character;
- Drop : in Strings.Truncation := Strings.Error)
- return Bounded_Wide_String
+ (Count : Natural;
+ Item : Wide_Character;
+ Drop : Strings.Truncation := Strings.Error)
+ return Bounded_Wide_String
is
begin
return Super_Replicate (Count, Item, Drop, Max_Length);
end Replicate;
function Replicate
- (Count : in Natural;
- Item : in Wide_String;
- Drop : in Strings.Truncation := Strings.Error)
- return Bounded_Wide_String
+ (Count : Natural;
+ Item : Wide_String;
+ Drop : Strings.Truncation := Strings.Error)
+ return Bounded_Wide_String
is
begin
return Super_Replicate (Count, Item, Drop, Max_Length);
end Replicate;
-
- -----------------------
- -- To_Bounded_String --
- -----------------------
+ ----------------------------
+ -- To_Bounded_Wide_String --
+ ----------------------------
function To_Bounded_Wide_String
- (Source : in Wide_String;
- Drop : in Strings.Truncation := Strings.Error)
- return Bounded_Wide_String
+ (Source : Wide_String;
+ Drop : Strings.Truncation := Strings.Error)
+ return Bounded_Wide_String
is
begin
return To_Super_String (Source, Max_Length, Drop);
end To_Bounded_Wide_String;
end Generic_Bounded_Length;
-
end Ada.Strings.Wide_Bounded;
diff --git a/gcc/ada/a-stwibo.ads b/gcc/ada/a-stwibo.ads
index 9cebf6f484b..5c3bfd215b7 100644
--- a/gcc/ada/a-stwibo.ads
+++ b/gcc/ada/a-stwibo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,805 +55,848 @@ pragma Preelaborate (Wide_Bounded);
subtype Length_Range is Natural range 0 .. Max_Length;
- function Length (Source : in Bounded_Wide_String) return Length_Range;
+ function Length (Source : Bounded_Wide_String) return Length_Range;
--------------------------------------------------------
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
function To_Bounded_Wide_String
- (Source : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Source : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
function To_Wide_String
- (Source : in Bounded_Wide_String)
- return Wide_String;
+ (Source : Bounded_Wide_String) return Wide_String;
+
+ procedure Set_Bounded_Wide_String
+ (Target : out Bounded_Wide_String;
+ Source : Wide_String;
+ Drop : Truncation := Error);
+ pragma Ada_05 (Set_Bounded_Wide_String);
function Append
- (Left, Right : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
function Append
- (Left : in Bounded_Wide_String;
- Right : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
function Append
- (Left : in Wide_String;
- Right : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
function Append
- (Left : in Bounded_Wide_String;
- Right : in Wide_Character;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Left : Bounded_Wide_String;
+ Right : Wide_Character;
+ Drop : Truncation := Error) return Bounded_Wide_String;
function Append
- (Left : in Wide_Character;
- Right : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Left : Wide_Character;
+ Right : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
procedure Append
(Source : in out Bounded_Wide_String;
- New_Item : in Bounded_Wide_String;
- Drop : in Truncation := Error);
+ New_Item : Bounded_Wide_String;
+ Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_Wide_String;
- New_Item : in Wide_String;
- Drop : in Truncation := Error);
+ New_Item : Wide_String;
+ Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_Wide_String;
- New_Item : in Wide_Character;
- Drop : in Truncation := Error);
+ New_Item : Wide_Character;
+ Drop : Truncation := Error);
function "&"
- (Left, Right : in Bounded_Wide_String)
- return Bounded_Wide_String;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Bounded_Wide_String;
function "&"
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Bounded_Wide_String;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Bounded_Wide_String;
function "&"
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Bounded_Wide_String;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Bounded_Wide_String;
function "&"
- (Left : in Bounded_Wide_String;
- Right : in Wide_Character)
- return Bounded_Wide_String;
+ (Left : Bounded_Wide_String;
+ Right : Wide_Character) return Bounded_Wide_String;
function "&"
- (Left : in Wide_Character;
- Right : in Bounded_Wide_String)
- return Bounded_Wide_String;
+ (Left : Wide_Character;
+ Right : Bounded_Wide_String) return Bounded_Wide_String;
function Element
- (Source : in Bounded_Wide_String;
- Index : in Positive)
- return Wide_Character;
+ (Source : Bounded_Wide_String;
+ Index : Positive) return Wide_Character;
procedure Replace_Element
(Source : in out Bounded_Wide_String;
- Index : in Positive;
- By : in Wide_Character);
+ Index : Positive;
+ By : Wide_Character);
function Slice
- (Source : in Bounded_Wide_String;
- Low : in Positive;
- High : in Natural)
- return Wide_String;
+ (Source : Bounded_Wide_String;
+ Low : Positive;
+ High : Natural) return Wide_String;
+
+ function Bounded_Slice
+ (Source : Bounded_Wide_String;
+ Low : Positive;
+ High : Natural) return Bounded_Wide_String;
+ pragma Ada_05 (Bounded_Slice);
+
+ procedure Bounded_Slice
+ (Source : Bounded_Wide_String;
+ Target : out Bounded_Wide_String;
+ Low : Positive;
+ High : Natural);
+ pragma Ada_05 (Bounded_Slice);
function "="
- (Left : in Bounded_Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function "="
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean;
function "="
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function "<"
- (Left : in Bounded_Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function "<"
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean;
function "<"
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function "<="
- (Left : in Bounded_Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function "<="
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean;
function "<="
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function ">"
- (Left : in Bounded_Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function ">"
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean;
function ">"
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function ">="
- (Left : in Bounded_Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
function ">="
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean;
function ">="
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean;
----------------------
-- Search Functions --
----------------------
function Index
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
+
+ function Index
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
+
+ function Index
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Index
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
+ pragma Ada_05 (Index);
function Index
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
function Index
- (Source : in Bounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index_Non_Blank
+ (Source : Bounded_Wide_String;
+ Going : Direction := Forward) return Natural;
function Index_Non_Blank
- (Source : in Bounded_Wide_String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Bounded_Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
function Count
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Count
- (Source : in Bounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural;
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural;
procedure Find_Token
- (Source : in Bounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
------------------------------------
- -- Wide_String Translation Subprograms --
+ -- String Translation Subprograms --
------------------------------------
function Translate
- (Source : in Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping)
+ return Bounded_Wide_String;
procedure Translate
- (Source : in out Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping);
+ (Source : in out Bounded_Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping);
function Translate
- (Source : in Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function)
+ return Bounded_Wide_String;
procedure Translate
(Source : in out Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function);
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function);
---------------------------------------
- -- Wide_String Transformation Subprograms --
+ -- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
- (Source : in Bounded_Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
procedure Replace_Slice
(Source : in out Bounded_Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error);
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error);
function Insert
- (Source : in Bounded_Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
procedure Insert
(Source : in out Bounded_Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error);
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error);
function Overwrite
- (Source : in Bounded_Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
procedure Overwrite
(Source : in out Bounded_Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error);
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error);
function Delete
- (Source : in Bounded_Wide_String;
- From : in Positive;
- Through : in Natural)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ From : Positive;
+ Through : Natural) return Bounded_Wide_String;
procedure Delete
(Source : in out Bounded_Wide_String;
- From : in Positive;
- Through : in Natural);
+ From : Positive;
+ Through : Natural);
---------------------------------
- -- Wide_String Selector Subprograms --
+ -- String Selector Subprograms --
---------------------------------
function Trim
- (Source : in Bounded_Wide_String;
- Side : in Trim_End)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Side : Trim_End) return Bounded_Wide_String;
procedure Trim
(Source : in out Bounded_Wide_String;
- Side : in Trim_End);
+ Side : Trim_End);
function Trim
- (Source : in Bounded_Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set) return Bounded_Wide_String;
procedure Trim
(Source : in out Bounded_Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set);
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set);
function Head
- (Source : in Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error) return Bounded_Wide_String;
procedure Head
(Source : in out Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error);
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error);
function Tail
- (Source : in Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Source : Bounded_Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error) return Bounded_Wide_String;
procedure Tail
(Source : in out Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error);
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error);
------------------------------------
- -- Wide_String Constructor Subprograms --
+ -- String Constructor Subprograms --
------------------------------------
function "*"
- (Left : in Natural;
- Right : in Wide_Character)
- return Bounded_Wide_String;
+ (Left : Natural;
+ Right : Wide_Character) return Bounded_Wide_String;
function "*"
- (Left : in Natural;
- Right : in Wide_String)
- return Bounded_Wide_String;
+ (Left : Natural;
+ Right : Wide_String) return Bounded_Wide_String;
function "*"
- (Left : in Natural;
- Right : in Bounded_Wide_String)
- return Bounded_Wide_String;
+ (Left : Natural;
+ Right : Bounded_Wide_String) return Bounded_Wide_String;
function Replicate
- (Count : in Natural;
- Item : in Wide_Character;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Count : Natural;
+ Item : Wide_Character;
+ Drop : Truncation := Error) return Bounded_Wide_String;
function Replicate
- (Count : in Natural;
- Item : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Count : Natural;
+ Item : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
function Replicate
- (Count : in Natural;
- Item : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String;
+ (Count : Natural;
+ Item : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String;
private
-
- -- Most of the implementation is in the non generic package
- -- Ada.Strings.Superbounded. Type Bounded_Wide_String is derived from
- -- type Wide_Superbounded.Super_String with the maximum length
- -- constraint. Except for five, all subprograms are renames of
- -- subprograms that are inherited from Wide_Superbounded.Super_String.
+ -- Most of the implementation is in the separate non generic package
+ -- Ada.Strings.Wide_Superbounded. Type Bounded_Wide_String is derived
+ -- from type Wide_Superbounded.Super_String with the maximum length
+ -- constraint. In almost all cases, the routines in Wide_Superbounded
+ -- can be called with no requirement to pass the maximum length
+ -- explicitly, since there is at least one Bounded_Wide_String argument
+ -- from which the maximum length can be obtained. For all such
+ -- routines, the implementation in this private part is simply a
+ -- renaming of the corresponding routine in the super bouded package.
+
+ -- The five exceptions are the * and Replicate routines operating on
+ -- character values. For these cases, we have a routine in the body
+ -- that calls the superbounded routine passing the maximum length
+ -- explicitly as an extra parameter.
type Bounded_Wide_String is
new Wide_Superbounded.Super_String (Max_Length);
+ -- Deriving Bounded_Wide_String from Wide_Superbounded.Super_String is
+ -- the real trick, it ensures that the type Bounded_Wide_String
+ -- declared in the generic instantiation is compatible with the
+ -- Super_String type declared in the Wide_Superbounded package.
Null_Bounded_Wide_String : constant Bounded_Wide_String :=
- (Max_Length => Max_Length,
- Current_Length => 0,
- Data => (1 .. Max_Length => Wide_Superbounded.Wide_NUL));
+ (Max_Length => Max_Length,
+ Current_Length => 0,
+ Data =>
+ (1 .. Max_Length =>
+ Wide_Superbounded.Wide_NUL));
pragma Inline (To_Bounded_Wide_String);
- function Length (Source : in Bounded_Wide_String) return Length_Range
- renames Super_Length;
+ procedure Set_Bounded_Wide_String
+ (Target : out Bounded_Wide_String;
+ Source : Wide_String;
+ Drop : Truncation := Error)
+ renames Set_Super_String;
+
+ function Length
+ (Source : Bounded_Wide_String) return Length_Range
+ renames Super_Length;
function To_Wide_String
- (Source : in Bounded_Wide_String)
- return Wide_String
- renames Super_To_String;
+ (Source : Bounded_Wide_String) return Wide_String
+ renames Super_To_String;
function Append
- (Left, Right : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Append;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Append;
function Append
- (Left : in Bounded_Wide_String;
- Right : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Append;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Append;
function Append
- (Left : in Wide_String;
- Right : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Append;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Append;
function Append
- (Left : in Bounded_Wide_String;
- Right : in Wide_Character;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Append;
+ (Left : Bounded_Wide_String;
+ Right : Wide_Character;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Append;
function Append
- (Left : in Wide_Character;
- Right : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Append;
+ (Left : Wide_Character;
+ Right : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Append;
procedure Append
(Source : in out Bounded_Wide_String;
- New_Item : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- renames Super_Append;
+ New_Item : Bounded_Wide_String;
+ Drop : Truncation := Error)
+ renames Super_Append;
procedure Append
(Source : in out Bounded_Wide_String;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
- renames Super_Append;
+ New_Item : Wide_String;
+ Drop : Truncation := Error)
+ renames Super_Append;
procedure Append
(Source : in out Bounded_Wide_String;
- New_Item : in Wide_Character;
- Drop : in Truncation := Error)
- renames Super_Append;
+ New_Item : Wide_Character;
+ Drop : Truncation := Error)
+ renames Super_Append;
function "&"
- (Left, Right : in Bounded_Wide_String)
- return Bounded_Wide_String
- renames Concat;
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Bounded_Wide_String
+ renames Concat;
function "&"
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Bounded_Wide_String
- renames Concat;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Bounded_Wide_String
+ renames Concat;
function "&"
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Bounded_Wide_String
- renames Concat;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Bounded_Wide_String
+ renames Concat;
function "&"
- (Left : in Bounded_Wide_String;
- Right : in Wide_Character)
- return Bounded_Wide_String
- renames Concat;
+ (Left : Bounded_Wide_String;
+ Right : Wide_Character) return Bounded_Wide_String
+ renames Concat;
function "&"
- (Left : in Wide_Character;
- Right : in Bounded_Wide_String)
- return Bounded_Wide_String
- renames Concat;
+ (Left : Wide_Character;
+ Right : Bounded_Wide_String) return Bounded_Wide_String
+ renames Concat;
function Element
- (Source : in Bounded_Wide_String;
- Index : in Positive)
- return Wide_Character
- renames Super_Element;
+ (Source : Bounded_Wide_String;
+ Index : Positive) return Wide_Character
+ renames Super_Element;
procedure Replace_Element
(Source : in out Bounded_Wide_String;
- Index : in Positive;
- By : in Wide_Character)
- renames Super_Replace_Element;
+ Index : Positive;
+ By : Wide_Character)
+ renames Super_Replace_Element;
function Slice
- (Source : in Bounded_Wide_String;
- Low : in Positive;
- High : in Natural)
- return Wide_String
- renames Super_Slice;
+ (Source : Bounded_Wide_String;
+ Low : Positive;
+ High : Natural) return Wide_String
+ renames Super_Slice;
+
+ function Bounded_Slice
+ (Source : Bounded_Wide_String;
+ Low : Positive;
+ High : Natural) return Bounded_Wide_String
+ renames Super_Slice;
+
+ procedure Bounded_Slice
+ (Source : Bounded_Wide_String;
+ Target : out Bounded_Wide_String;
+ Low : Positive;
+ High : Natural)
+ renames Super_Slice;
- function "=" (Left, Right : in Bounded_Wide_String) return Boolean
- renames Equal;
+ function "="
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Equal;
function "="
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean
- renames Equal;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean
+ renames Equal;
function "="
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean
- renames Equal;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Equal;
- function "<" (Left, Right : in Bounded_Wide_String) return Boolean
- renames Less;
+ function "<"
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Less;
function "<"
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean
- renames Less;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean
+ renames Less;
function "<"
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean
- renames Less;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Less;
- function "<=" (Left, Right : in Bounded_Wide_String) return Boolean
- renames Less_Or_Equal;
+ function "<="
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Less_Or_Equal;
function "<="
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean
- renames Less_Or_Equal;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean
+ renames Less_Or_Equal;
function "<="
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean
- renames Less_Or_Equal;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Less_Or_Equal;
- function ">" (Left, Right : in Bounded_Wide_String) return Boolean
- renames Greater;
+ function ">"
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Greater;
function ">"
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean
- renames Greater;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean
+ renames Greater;
function ">"
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean
- renames Greater;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Greater;
- function ">=" (Left, Right : in Bounded_Wide_String) return Boolean
- renames Greater_Or_Equal;
+ function ">="
+ (Left : Bounded_Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Greater_Or_Equal;
function ">="
- (Left : in Bounded_Wide_String;
- Right : in Wide_String)
- return Boolean
- renames Greater_Or_Equal;
+ (Left : Bounded_Wide_String;
+ Right : Wide_String) return Boolean
+ renames Greater_Or_Equal;
function ">="
- (Left : in Wide_String;
- Right : in Bounded_Wide_String)
- return Boolean
- renames Greater_Or_Equal;
+ (Left : Wide_String;
+ Right : Bounded_Wide_String) return Boolean
+ renames Greater_Or_Equal;
+
+ function Index
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ renames Super_Index;
+
+ function Index
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ renames Super_Index;
+
+ function Index
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Super_Index;
function Index
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
- renames Super_Index;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ renames Super_Index;
function Index
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
- renames Super_Index;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ renames Super_Index;
function Index
- (Source : in Bounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
- renames Super_Index;
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Super_Index;
+
+ function Index_Non_Blank
+ (Source : Bounded_Wide_String;
+ Going : Direction := Forward) return Natural
+ renames Super_Index_Non_Blank;
function Index_Non_Blank
- (Source : in Bounded_Wide_String;
- Going : in Direction := Forward)
- return Natural
- renames Super_Index_Non_Blank;
+ (Source : Bounded_Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ renames Super_Index_Non_Blank;
function Count
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
- renames Super_Count;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ renames Super_Count;
function Count
- (Source : in Bounded_Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
- renames Super_Count;
+ (Source : Bounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ renames Super_Count;
function Count
- (Source : in Bounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural
- renames Super_Count;
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural
+ renames Super_Count;
procedure Find_Token
- (Source : in Bounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Bounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
- renames Super_Find_Token;
+ renames Super_Find_Token;
function Translate
- (Source : in Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- return Bounded_Wide_String
- renames Super_Translate;
+ (Source : Bounded_Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping)
+ return Bounded_Wide_String
+ renames Super_Translate;
procedure Translate
(Source : in out Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- renames Super_Translate;
+ Mapping : Wide_Maps.Wide_Character_Mapping)
+ renames Super_Translate;
function Translate
- (Source : in Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Bounded_Wide_String
- renames Super_Translate;
+ (Source : Bounded_Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function)
+ return Bounded_Wide_String
+ renames Super_Translate;
procedure Translate
(Source : in out Bounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- renames Super_Translate;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function)
+ renames Super_Translate;
function Replace_Slice
- (Source : in Bounded_Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Replace_Slice;
+ (Source : Bounded_Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Replace_Slice;
procedure Replace_Slice
(Source : in out Bounded_Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error)
- renames Super_Replace_Slice;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error)
+ renames Super_Replace_Slice;
function Insert
- (Source : in Bounded_Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Insert;
+ (Source : Bounded_Wide_String;
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Insert;
procedure Insert
(Source : in out Bounded_Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
- renames Super_Insert;
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error)
+ renames Super_Insert;
function Overwrite
- (Source : in Bounded_Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Overwrite;
+ (Source : Bounded_Wide_String;
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Overwrite;
procedure Overwrite
(Source : in out Bounded_Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
- renames Super_Overwrite;
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error)
+ renames Super_Overwrite;
function Delete
- (Source : in Bounded_Wide_String;
- From : in Positive;
- Through : in Natural)
- return Bounded_Wide_String
- renames Super_Delete;
+ (Source : Bounded_Wide_String;
+ From : Positive;
+ Through : Natural) return Bounded_Wide_String
+ renames Super_Delete;
procedure Delete
(Source : in out Bounded_Wide_String;
- From : in Positive;
- Through : in Natural)
- renames Super_Delete;
+ From : Positive;
+ Through : Natural)
+ renames Super_Delete;
function Trim
- (Source : in Bounded_Wide_String;
- Side : in Trim_End)
- return Bounded_Wide_String
- renames Super_Trim;
+ (Source : Bounded_Wide_String;
+ Side : Trim_End) return Bounded_Wide_String
+ renames Super_Trim;
procedure Trim
(Source : in out Bounded_Wide_String;
- Side : in Trim_End)
- renames Super_Trim;
+ Side : Trim_End)
+ renames Super_Trim;
function Trim
- (Source : in Bounded_Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- return Bounded_Wide_String
- renames Super_Trim;
+ (Source : Bounded_Wide_String;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set) return Bounded_Wide_String
+ renames Super_Trim;
procedure Trim
(Source : in out Bounded_Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- renames Super_Trim;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set)
+ renames Super_Trim;
function Head
- (Source : in Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Head;
+ (Source : Bounded_Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Head;
procedure Head
(Source : in out Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error)
- renames Super_Head;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error)
+ renames Super_Head;
function Tail
- (Source : in Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
- renames Super_Tail;
+ (Source : Bounded_Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error) return Bounded_Wide_String
+ renames Super_Tail;
procedure Tail
(Source : in out Bounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space;
- Drop : in Truncation := Error)
- renames Super_Tail;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space;
+ Drop : Truncation := Error)
+ renames Super_Tail;
function "*"
- (Left : in Natural;
- Right : in Bounded_Wide_String)
- return Bounded_Wide_String
- renames Times;
+ (Left : Natural;
+ Right : Bounded_Wide_String) return Bounded_Wide_String
+ renames Times;
function Replicate
- (Count : in Natural;
- Item : in Bounded_Wide_String;
- Drop : in Truncation := Error)
- return Bounded_Wide_String
+ (Count : Natural;
+ Item : Bounded_Wide_String;
+ Drop : Truncation := Error) return Bounded_Wide_String
renames Super_Replicate;
end Generic_Bounded_Length;
diff --git a/gcc/ada/a-stwifi.adb b/gcc/ada/a-stwifi.adb
index 100fb8019e6..f7d64c9af3c 100644
--- a/gcc/ada/a-stwifi.adb
+++ b/gcc/ada/a-stwifi.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -41,59 +41,85 @@ package body Ada.Strings.Wide_Fixed is
------------------------
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
renames Ada.Strings.Wide_Search.Index;
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
renames Ada.Strings.Wide_Search.Index;
function Index
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Wide_Search.Index;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ renames Ada.Strings.Wide_Search.Index;
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ renames Ada.Strings.Wide_Search.Index;
+
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Wide_Search.Index;
+
+ function Index_Non_Blank
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural
+ renames Ada.Strings.Wide_Search.Index_Non_Blank;
+
function Index_Non_Blank
- (Source : in Wide_String;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
renames Ada.Strings.Wide_Search.Index_Non_Blank;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
renames Ada.Strings.Wide_Search.Count;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
renames Ada.Strings.Wide_Search.Count;
function Count
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural
renames Ada.Strings.Wide_Search.Count;
procedure Find_Token
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
renames Ada.Strings.Wide_Search.Find_Token;
@@ -103,9 +129,8 @@ package body Ada.Strings.Wide_Fixed is
---------
function "*"
- (Left : in Natural;
- Right : in Wide_Character)
- return Wide_String
+ (Left : Natural;
+ Right : Wide_Character) return Wide_String
is
Result : Wide_String (1 .. Left);
@@ -118,9 +143,8 @@ package body Ada.Strings.Wide_Fixed is
end "*";
function "*"
- (Left : in Natural;
- Right : in Wide_String)
- return Wide_String
+ (Left : Natural;
+ Right : Wide_String) return Wide_String
is
Result : Wide_String (1 .. Left * Right'Length);
Ptr : Integer := 1;
@@ -139,10 +163,9 @@ package body Ada.Strings.Wide_Fixed is
------------
function Delete
- (Source : in Wide_String;
- From : in Positive;
- Through : in Natural)
- return Wide_String
+ (Source : Wide_String;
+ From : Positive;
+ Through : Natural) return Wide_String
is
begin
if From not in Source'Range
@@ -168,10 +191,10 @@ package body Ada.Strings.Wide_Fixed is
procedure Delete
(Source : in out Wide_String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Source => Delete (Source, From, Through),
@@ -185,10 +208,9 @@ package body Ada.Strings.Wide_Fixed is
----------
function Head
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space)
- return Wide_String
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space) return Wide_String
is
Result : Wide_String (1 .. Count);
@@ -209,9 +231,9 @@ package body Ada.Strings.Wide_Fixed is
procedure Head
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space)
is
begin
Move (Source => Head (Source, Count, Pad),
@@ -226,10 +248,9 @@ package body Ada.Strings.Wide_Fixed is
------------
function Insert
- (Source : in Wide_String;
- Before : in Positive;
- New_Item : in Wide_String)
- return Wide_String
+ (Source : Wide_String;
+ Before : Positive;
+ New_Item : Wide_String) return Wide_String
is
Result : Wide_String (1 .. Source'Length + New_Item'Length);
@@ -245,9 +266,9 @@ package body Ada.Strings.Wide_Fixed is
procedure Insert
(Source : in out Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error)
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error)
is
begin
Move (Source => Insert (Source, Before, New_Item),
@@ -260,11 +281,11 @@ package body Ada.Strings.Wide_Fixed is
----------
procedure Move
- (Source : in Wide_String;
+ (Source : Wide_String;
Target : out Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
Sfirst : constant Integer := Source'First;
Slast : constant Integer := Source'Last;
@@ -369,10 +390,9 @@ package body Ada.Strings.Wide_Fixed is
---------------
function Overwrite
- (Source : in Wide_String;
- Position : in Positive;
- New_Item : in Wide_String)
- return Wide_String
+ (Source : Wide_String;
+ Position : Positive;
+ New_Item : Wide_String) return Wide_String
is
begin
if Position not in Source'First .. Source'Last + 1 then
@@ -396,9 +416,9 @@ package body Ada.Strings.Wide_Fixed is
procedure Overwrite
(Source : in out Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Right)
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Right)
is
begin
Move (Source => Overwrite (Source, Position, New_Item),
@@ -411,11 +431,10 @@ package body Ada.Strings.Wide_Fixed is
-------------------
function Replace_Slice
- (Source : in Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String)
- return Wide_String
+ (Source : Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String) return Wide_String
is
Result_Length : Natural;
@@ -446,12 +465,12 @@ package body Ada.Strings.Wide_Fixed is
procedure Replace_Slice
(Source : in out Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Replace_Slice (Source, Low, High, By), Source, Drop, Justify, Pad);
@@ -462,10 +481,9 @@ package body Ada.Strings.Wide_Fixed is
----------
function Tail
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space)
- return Wide_String
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space) return Wide_String
is
Result : Wide_String (1 .. Count);
@@ -488,9 +506,9 @@ package body Ada.Strings.Wide_Fixed is
procedure Tail
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space)
is
begin
Move (Source => Tail (Source, Count, Pad),
@@ -505,9 +523,8 @@ package body Ada.Strings.Wide_Fixed is
---------------
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- return Wide_String
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Wide_String
is
Result : Wide_String (1 .. Source'Length);
@@ -521,7 +538,7 @@ package body Ada.Strings.Wide_Fixed is
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
+ Mapping : Wide_Maps.Wide_Character_Mapping)
is
begin
for J in Source'Range loop
@@ -530,9 +547,8 @@ package body Ada.Strings.Wide_Fixed is
end Translate;
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Wide_String
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Wide_String
is
Result : Wide_String (1 .. Source'Length);
@@ -546,7 +562,7 @@ package body Ada.Strings.Wide_Fixed is
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function)
is
begin
for J in Source'Range loop
@@ -559,9 +575,8 @@ package body Ada.Strings.Wide_Fixed is
----------
function Trim
- (Source : in Wide_String;
- Side : in Trim_End)
- return Wide_String
+ (Source : Wide_String;
+ Side : Trim_End) return Wide_String
is
Low : Natural := Source'First;
High : Natural := Source'Last;
@@ -599,9 +614,9 @@ package body Ada.Strings.Wide_Fixed is
procedure Trim
(Source : in out Wide_String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space)
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Source => Trim (Source, Side),
@@ -611,10 +626,9 @@ package body Ada.Strings.Wide_Fixed is
end Trim;
function Trim
- (Source : in Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- return Wide_String
+ (Source : Wide_String;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set) return Wide_String
is
Low : Natural := Source'First;
High : Natural := Source'Last;
@@ -644,10 +658,10 @@ package body Ada.Strings.Wide_Fixed is
procedure Trim
(Source : in out Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set;
- Justify : in Alignment := Strings.Left;
- Pad : in Wide_Character := Wide_Space)
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set;
+ Justify : Alignment := Strings.Left;
+ Pad : Wide_Character := Wide_Space)
is
begin
Move (Source => Trim (Source, Left, Right),
diff --git a/gcc/ada/a-stwifi.ads b/gcc/ada/a-stwifi.ads
index 7331db5f543..177e2f8011d 100644
--- a/gcc/ada/a-stwifi.ads
+++ b/gcc/ada/a-stwifi.ads
@@ -24,63 +24,89 @@ pragma Preelaborate (Wide_Fixed);
-------------------------------------------------------------------
procedure Move
- (Source : in Wide_String;
+ (Source : Wide_String;
Target : out Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
------------------------
-- Search Subprograms --
------------------------
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Index
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index);
+
+ function Index_Non_Blank
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural;
function Index_Non_Blank
- (Source : in Wide_String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+ pragma Ada_05 (Index_Non_Blank);
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Count
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural;
procedure Find_Token
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
@@ -89,144 +115,132 @@ pragma Preelaborate (Wide_Fixed);
-----------------------------------------
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- return Wide_String;
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Wide_String;
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping);
+ Mapping : Wide_Maps.Wide_Character_Mapping);
function Translate
- (Source : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Wide_String;
+ (Source : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Wide_String;
procedure Translate
(Source : in out Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function);
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function);
--------------------------------------------
-- Wide_String Transformation Subprograms --
--------------------------------------------
function Replace_Slice
- (Source : in Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String)
- return Wide_String;
+ (Source : Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String) return Wide_String;
procedure Replace_Slice
(Source : in out Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String;
- Drop : in Truncation := Error;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
function Insert
- (Source : in Wide_String;
- Before : in Positive;
- New_Item : in Wide_String)
- return Wide_String;
+ (Source : Wide_String;
+ Before : Positive;
+ New_Item : Wide_String) return Wide_String;
procedure Insert
(Source : in out Wide_String;
- Before : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Error);
+ Before : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error);
function Overwrite
- (Source : in Wide_String;
- Position : in Positive;
- New_Item : in Wide_String)
- return Wide_String;
+ (Source : Wide_String;
+ Position : Positive;
+ New_Item : Wide_String) return Wide_String;
procedure Overwrite
(Source : in out Wide_String;
- Position : in Positive;
- New_Item : in Wide_String;
- Drop : in Truncation := Right);
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Right);
function Delete
- (Source : in Wide_String;
- From : in Positive;
- Through : in Natural)
- return Wide_String;
+ (Source : Wide_String;
+ From : Positive;
+ Through : Natural) return Wide_String;
procedure Delete
(Source : in out Wide_String;
- From : in Positive;
- Through : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ From : Positive;
+ Through : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
--------------------------------------
-- Wide_String Selector Subprograms --
--------------------------------------
function Trim
- (Source : in Wide_String;
- Side : in Trim_End)
- return Wide_String;
+ (Source : Wide_String;
+ Side : Trim_End) return Wide_String;
procedure Trim
(Source : in out Wide_String;
- Side : in Trim_End;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Wide_Space);
+ Side : Trim_End;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Wide_Space);
function Trim
- (Source : in Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- return Wide_String;
+ (Source : Wide_String;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set) return Wide_String;
procedure Trim
(Source : in out Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set;
- Justify : in Alignment := Ada.Strings.Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set;
+ Justify : Alignment := Ada.Strings.Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
function Head
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
- return Wide_String;
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Ada.Strings.Wide_Space) return Wide_String;
procedure Head
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
function Tail
- (Source : in Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Ada.Strings.Wide_Space)
- return Wide_String;
+ (Source : Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Ada.Strings.Wide_Space) return Wide_String;
procedure Tail
(Source : in out Wide_String;
- Count : in Natural;
- Justify : in Alignment := Left;
- Pad : in Wide_Character := Ada.Strings.Wide_Space);
+ Count : Natural;
+ Justify : Alignment := Left;
+ Pad : Wide_Character := Ada.Strings.Wide_Space);
---------------------------------------
-- Wide_String Constructor Functions --
---------------------------------------
function "*"
- (Left : in Natural;
- Right : in Wide_Character)
- return Wide_String;
+ (Left : Natural;
+ Right : Wide_Character) return Wide_String;
function "*"
- (Left : in Natural;
- Right : in Wide_String)
- return Wide_String;
+ (Left : Natural;
+ Right : Wide_String) return Wide_String;
end Ada.Strings.Wide_Fixed;
diff --git a/gcc/ada/a-stwima.adb b/gcc/ada/a-stwima.adb
index e3bacd4498a..79e0479acff 100644
--- a/gcc/ada/a-stwima.adb
+++ b/gcc/ada/a-stwima.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -40,8 +40,7 @@ package body Ada.Strings.Wide_Maps is
---------
function "-"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
LS : constant Wide_Character_Ranges_Access := Left.Set;
RS : constant Wide_Character_Ranges_Access := Right.Set;
@@ -159,8 +158,7 @@ package body Ada.Strings.Wide_Maps is
-----------
function "and"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
LS : constant Wide_Character_Ranges_Access := Left.Set;
RS : constant Wide_Character_Ranges_Access := Right.Set;
@@ -210,8 +208,7 @@ package body Ada.Strings.Wide_Maps is
-----------
function "not"
- (Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Right : Wide_Character_Set) return Wide_Character_Set
is
RS : constant Wide_Character_Ranges_Access := Right.Set;
@@ -253,8 +250,7 @@ package body Ada.Strings.Wide_Maps is
----------
function "or"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
LS : constant Wide_Character_Ranges_Access := Left.Set;
RS : constant Wide_Character_Ranges_Access := Right.Set;
@@ -341,8 +337,7 @@ package body Ada.Strings.Wide_Maps is
-----------
function "xor"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set
is
begin
return (Left or Right) - (Left and Right);
@@ -409,9 +404,8 @@ package body Ada.Strings.Wide_Maps is
-----------
function Is_In
- (Element : in Wide_Character;
- Set : in Wide_Character_Set)
- return Boolean
+ (Element : Wide_Character;
+ Set : Wide_Character_Set) return Boolean
is
L, R, M : Natural;
SS : constant Wide_Character_Ranges_Access := Set.Set;
@@ -446,9 +440,8 @@ package body Ada.Strings.Wide_Maps is
---------------
function Is_Subset
- (Elements : in Wide_Character_Set;
- Set : in Wide_Character_Set)
- return Boolean
+ (Elements : Wide_Character_Set;
+ Set : Wide_Character_Set) return Boolean
is
ES : constant Wide_Character_Ranges_Access := Elements.Set;
SS : constant Wide_Character_Ranges_Access := Set.Set;
@@ -493,8 +486,7 @@ package body Ada.Strings.Wide_Maps is
---------------
function To_Domain
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence
is
begin
return Map.Map.Domain;
@@ -505,8 +497,7 @@ package body Ada.Strings.Wide_Maps is
----------------
function To_Mapping
- (From, To : in Wide_Character_Sequence)
- return Wide_Character_Mapping
+ (From, To : Wide_Character_Sequence) return Wide_Character_Mapping
is
Domain : Wide_Character_Sequence (1 .. From'Length);
Rangev : Wide_Character_Sequence (1 .. To'Length);
@@ -554,8 +545,7 @@ package body Ada.Strings.Wide_Maps is
--------------
function To_Range
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence
is
begin
return Map.Map.Rangev;
@@ -566,8 +556,7 @@ package body Ada.Strings.Wide_Maps is
---------------
function To_Ranges
- (Set : in Wide_Character_Set)
- return Wide_Character_Ranges
+ (Set : in Wide_Character_Set) return Wide_Character_Ranges
is
begin
return Set.Set.all;
@@ -578,8 +567,7 @@ package body Ada.Strings.Wide_Maps is
-----------------
function To_Sequence
- (Set : in Wide_Character_Set)
- return Wide_Character_Sequence
+ (Set : Wide_Character_Set) return Wide_Character_Sequence
is
SS : constant Wide_Character_Ranges_Access := Set.Set;
@@ -604,8 +592,7 @@ package body Ada.Strings.Wide_Maps is
-- Case of multiple range input
function To_Set
- (Ranges : in Wide_Character_Ranges)
- return Wide_Character_Set
+ (Ranges : Wide_Character_Ranges) return Wide_Character_Set
is
Result : Wide_Character_Ranges (Ranges'Range);
N : Natural := 0;
@@ -667,8 +654,7 @@ package body Ada.Strings.Wide_Maps is
-- Case of single range input
function To_Set
- (Span : in Wide_Character_Range)
- return Wide_Character_Set
+ (Span : Wide_Character_Range) return Wide_Character_Set
is
begin
if Span.Low > Span.High then
@@ -685,8 +671,7 @@ package body Ada.Strings.Wide_Maps is
-- Case of wide string input
function To_Set
- (Sequence : in Wide_Character_Sequence)
- return Wide_Character_Set
+ (Sequence : Wide_Character_Sequence) return Wide_Character_Set
is
R : Wide_Character_Ranges (1 .. Sequence'Length);
@@ -701,8 +686,7 @@ package body Ada.Strings.Wide_Maps is
-- Case of single wide character input
function To_Set
- (Singleton : in Wide_Character)
- return Wide_Character_Set
+ (Singleton : Wide_Character) return Wide_Character_Set
is
begin
return
@@ -715,9 +699,8 @@ package body Ada.Strings.Wide_Maps is
-----------
function Value
- (Map : in Wide_Character_Mapping;
- Element : in Wide_Character)
- return Wide_Character
+ (Map : Wide_Character_Mapping;
+ Element : Wide_Character) return Wide_Character
is
L, R, M : Natural;
diff --git a/gcc/ada/a-stwima.ads b/gcc/ada/a-stwima.ads
index 079336e0ea1..382452f4085 100644
--- a/gcc/ada/a-stwima.ads
+++ b/gcc/ada/a-stwima.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -63,16 +63,13 @@ package Ada.Strings.Wide_Maps is
array (Positive range <>) of Wide_Character_Range;
function To_Set
- (Ranges : in Wide_Character_Ranges)
- return Wide_Character_Set;
+ (Ranges : Wide_Character_Ranges) return Wide_Character_Set;
function To_Set
- (Span : in Wide_Character_Range)
- return Wide_Character_Set;
+ (Span : Wide_Character_Range) return Wide_Character_Set;
function To_Ranges
- (Set : in Wide_Character_Set)
- return Wide_Character_Ranges;
+ (Set : in Wide_Character_Set) return Wide_Character_Ranges;
---------------------------------------
-- Operations on Wide Character Sets --
@@ -81,55 +78,44 @@ package Ada.Strings.Wide_Maps is
function "=" (Left, Right : in Wide_Character_Set) return Boolean;
function "not"
- (Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Right : Wide_Character_Set) return Wide_Character_Set;
function "and"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function "or"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function "xor"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function "-"
- (Left, Right : in Wide_Character_Set)
- return Wide_Character_Set;
+ (Left, Right : Wide_Character_Set) return Wide_Character_Set;
function Is_In
- (Element : in Wide_Character;
- Set : in Wide_Character_Set)
- return Boolean;
+ (Element : Wide_Character;
+ Set : Wide_Character_Set) return Boolean;
function Is_Subset
- (Elements : in Wide_Character_Set;
- Set : in Wide_Character_Set)
- return Boolean;
+ (Elements : Wide_Character_Set;
+ Set : Wide_Character_Set) return Boolean;
function "<="
- (Left : in Wide_Character_Set;
- Right : in Wide_Character_Set)
- return Boolean
+ (Left : Wide_Character_Set;
+ Right : Wide_Character_Set) return Boolean
renames Is_Subset;
subtype Wide_Character_Sequence is Wide_String;
-- Alternative representation for a set of character values
function To_Set
- (Sequence : in Wide_Character_Sequence)
- return Wide_Character_Set;
+ (Sequence : Wide_Character_Sequence) return Wide_Character_Set;
function To_Set
- (Singleton : in Wide_Character)
- return Wide_Character_Set;
+ (Singleton : Wide_Character) return Wide_Character_Set;
function To_Sequence
- (Set : in Wide_Character_Set)
- return Wide_Character_Sequence;
+ (Set : Wide_Character_Set) return Wide_Character_Sequence;
-----------------------------------------
-- Wide Character Mapping Declarations --
@@ -139,9 +125,8 @@ package Ada.Strings.Wide_Maps is
-- Representation for a wide character to wide character mapping:
function Value
- (Map : in Wide_Character_Mapping;
- Element : in Wide_Character)
- return Wide_Character;
+ (Map : Wide_Character_Mapping;
+ Element : Wide_Character) return Wide_Character;
Identity : constant Wide_Character_Mapping;
@@ -150,19 +135,16 @@ package Ada.Strings.Wide_Maps is
---------------------------------
function To_Mapping
- (From, To : in Wide_Character_Sequence)
- return Wide_Character_Mapping;
+ (From, To : Wide_Character_Sequence) return Wide_Character_Mapping;
function To_Domain
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence;
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence;
function To_Range
- (Map : in Wide_Character_Mapping)
- return Wide_Character_Sequence;
+ (Map : Wide_Character_Mapping) return Wide_Character_Sequence;
type Wide_Character_Mapping_Function is
- access function (From : in Wide_Character) return Wide_Character;
+ access function (From : Wide_Character) return Wide_Character;
private
package AF renames Ada.Finalization;
diff --git a/gcc/ada/a-stwise.adb b/gcc/ada/a-stwise.adb
index a8b8ae910f3..d1eae0ed637 100644
--- a/gcc/ada/a-stwise.adb
+++ b/gcc/ada/a-stwise.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -42,8 +42,7 @@ package body Ada.Strings.Wide_Search is
function Belongs
(Element : Wide_Character;
Set : Wide_Maps.Wide_Character_Set;
- Test : Membership)
- return Boolean;
+ Test : Membership) return Boolean;
pragma Inline (Belongs);
-- Determines if the given element is in (Test = Inside) or not in
-- (Test = Outside) the given character set.
@@ -55,9 +54,8 @@ package body Ada.Strings.Wide_Search is
function Belongs
(Element : Wide_Character;
Set : Wide_Maps.Wide_Character_Set;
- Test : Membership)
- return Boolean is
-
+ Test : Membership) return Boolean
+ is
begin
if Test = Inside then
return Is_In (Element, Set);
@@ -71,10 +69,10 @@ package body Ada.Strings.Wide_Search is
-----------
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
is
N : Natural;
J : Natural;
@@ -117,10 +115,9 @@ package body Ada.Strings.Wide_Search is
end Count;
function Count
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
Mapped_Source : Wide_String (Source'Range);
@@ -132,9 +129,9 @@ package body Ada.Strings.Wide_Search is
return Count (Mapped_Source, Pattern);
end Count;
- function Count (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural
+ function Count
+ (Source : in Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural
is
N : Natural := 0;
@@ -153,9 +150,9 @@ package body Ada.Strings.Wide_Search is
----------------
procedure Find_Token
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural)
is
@@ -190,11 +187,11 @@ package body Ada.Strings.Wide_Search is
-----------
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
is
begin
if Pattern = "" then
@@ -239,16 +236,11 @@ package body Ada.Strings.Wide_Search is
return 0;
end Index;
- -----------
- -- Index --
- -----------
-
function Index
- (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
Mapped_Source : Wide_String (Source'Range);
@@ -261,11 +253,10 @@ package body Ada.Strings.Wide_Search is
end Index;
function Index
- (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
is
begin
if Going = Forward then
@@ -288,14 +279,92 @@ package body Ada.Strings.Wide_Search is
return 0;
end Index;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (From .. Source'Last), Pattern, Forward, Mapping);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return Index
+ (Source (Source'First .. From), Pattern, Backward, Mapping);
+ end if;
+ end Index;
+
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (From .. Source'Last), Set, Test, Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index (Source (Source'First .. From), Set, Test, Backward);
+ end if;
+ end Index;
+
---------------------
-- Index_Non_Blank --
---------------------
function Index_Non_Blank
- (Source : in Wide_String;
- Going : in Direction := Forward)
- return Natural
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural
is
begin
if Going = Forward then
@@ -316,7 +385,30 @@ package body Ada.Strings.Wide_Search is
-- Fall through if no match
return 0;
+ end Index_Non_Blank;
+ function Index_Non_Blank
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ if Going = Forward then
+ if From < Source'First then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (From .. Source'Last), Forward);
+
+ else
+ if From > Source'Last then
+ raise Index_Error;
+ end if;
+
+ return
+ Index_Non_Blank (Source (Source'First .. From), Backward);
+ end if;
end Index_Non_Blank;
end Ada.Strings.Wide_Search;
diff --git a/gcc/ada/a-stwise.ads b/gcc/ada/a-stwise.ads
index 01f21660695..26ba39a0bae 100644
--- a/gcc/ada/a-stwise.ads
+++ b/gcc/ada/a-stwise.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,49 +43,76 @@ with Ada.Strings.Wide_Maps;
private package Ada.Strings.Wide_Search is
pragma Preelaborate (Wide_Search);
- function Index (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.Identity)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping :=
+ Wide_Maps.Identity) return Natural;
- function Index (Source : in Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
- function Index (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
- function Index_Non_Blank (Source : in Wide_String;
- Going : in Direction := Forward)
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
return Natural;
- function Count (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.Identity)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
- function Count (Source : in Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ function Index
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Index_Non_Blank
+ (Source : Wide_String;
+ Going : Direction := Forward) return Natural;
- function Count (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
+ function Index_Non_Blank
+ (Source : Wide_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
+
+ function Count
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
return Natural;
+ function Count
+ (Source : Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
+
+ function Count
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural;
- procedure Find_Token (Source : in Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
- First : out Positive;
- Last : out Natural);
+ procedure Find_Token
+ (Source : Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
+ First : out Positive;
+ Last : out Natural);
end Ada.Strings.Wide_Search;
diff --git a/gcc/ada/a-stwisu.adb b/gcc/ada/a-stwisu.adb
index ebf15f71264..bdaac0b64df 100644
--- a/gcc/ada/a-stwisu.adb
+++ b/gcc/ada/a-stwisu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2005 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- --
@@ -42,8 +42,7 @@ package body Ada.Strings.Wide_Superbounded is
function Concat
(Left : Super_String;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Left.Max_Length);
Llen : constant Natural := Left.Current_Length;
@@ -64,8 +63,7 @@ package body Ada.Strings.Wide_Superbounded is
function Concat
(Left : Super_String;
- Right : Wide_String)
- return Super_String
+ Right : Wide_String) return Super_String
is
Result : Super_String (Left.Max_Length);
Llen : constant Natural := Left.Current_Length;
@@ -85,8 +83,7 @@ package body Ada.Strings.Wide_Superbounded is
function Concat
(Left : Wide_String;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Llen : constant Natural := Left'Length;
@@ -107,8 +104,7 @@ package body Ada.Strings.Wide_Superbounded is
function Concat
(Left : Super_String;
- Right : Wide_Character)
- return Super_String
+ Right : Wide_Character) return Super_String
is
Result : Super_String (Left.Max_Length);
Llen : constant Natural := Left.Current_Length;
@@ -127,8 +123,7 @@ package body Ada.Strings.Wide_Superbounded is
function Concat
(Left : Wide_Character;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Rlen : constant Natural := Right.Current_Length;
@@ -149,22 +144,29 @@ package body Ada.Strings.Wide_Superbounded is
-- Equal --
-----------
- function "=" (Left, Right : Super_String) return Boolean is
+ function "="
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Current_Length = Right.Current_Length
and then Left.Data (1 .. Left.Current_Length) =
Right.Data (1 .. Right.Current_Length);
end "=";
- function Equal (Left : Super_String; Right : Wide_String)
- return Boolean is
+ function Equal
+ (Left : Super_String;
+ Right : Wide_String) return Boolean
+ is
begin
return Left.Current_Length = Right'Length
and then Left.Data (1 .. Left.Current_Length) = Right;
end Equal;
- function Equal (Left : Wide_String; Right : Super_String)
- return Boolean is
+ function Equal
+ (Left : Wide_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left'Length = Right.Current_Length
and then Left = Right.Data (1 .. Right.Current_Length);
@@ -174,7 +176,10 @@ package body Ada.Strings.Wide_Superbounded is
-- Greater --
-------------
- function Greater (Left, Right : Super_String) return Boolean is
+ function Greater
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) >
Right.Data (1 .. Right.Current_Length);
@@ -182,8 +187,7 @@ package body Ada.Strings.Wide_Superbounded is
function Greater
(Left : Super_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) > Right;
@@ -191,8 +195,7 @@ package body Ada.Strings.Wide_Superbounded is
function Greater
(Left : Wide_String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left > Right.Data (1 .. Right.Current_Length);
@@ -202,7 +205,10 @@ package body Ada.Strings.Wide_Superbounded is
-- Greater_Or_Equal --
----------------------
- function Greater_Or_Equal (Left, Right : Super_String) return Boolean is
+ function Greater_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) >=
Right.Data (1 .. Right.Current_Length);
@@ -210,8 +216,7 @@ package body Ada.Strings.Wide_Superbounded is
function Greater_Or_Equal
(Left : Super_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >= Right;
@@ -219,8 +224,7 @@ package body Ada.Strings.Wide_Superbounded is
function Greater_Or_Equal
(Left : Wide_String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left >= Right.Data (1 .. Right.Current_Length);
@@ -230,7 +234,10 @@ package body Ada.Strings.Wide_Superbounded is
-- Less --
----------
- function Less (Left, Right : Super_String) return Boolean is
+ function Less
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) <
Right.Data (1 .. Right.Current_Length);
@@ -238,8 +245,7 @@ package body Ada.Strings.Wide_Superbounded is
function Less
(Left : Super_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) < Right;
@@ -247,8 +253,7 @@ package body Ada.Strings.Wide_Superbounded is
function Less
(Left : Wide_String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left < Right.Data (1 .. Right.Current_Length);
@@ -258,7 +263,10 @@ package body Ada.Strings.Wide_Superbounded is
-- Less_Or_Equal --
-------------------
- function Less_Or_Equal (Left, Right : Super_String) return Boolean is
+ function Less_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean
+ is
begin
return Left.Data (1 .. Left.Current_Length) <=
Right.Data (1 .. Right.Current_Length);
@@ -266,8 +274,7 @@ package body Ada.Strings.Wide_Superbounded is
function Less_Or_Equal
(Left : Super_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <= Right;
@@ -275,13 +282,47 @@ package body Ada.Strings.Wide_Superbounded is
function Less_Or_Equal
(Left : Wide_String;
- Right : Super_String)
- return Boolean
+ Right : Super_String) return Boolean
is
begin
return Left <= Right.Data (1 .. Right.Current_Length);
end Less_Or_Equal;
+ ----------------------
+ -- Set_Super_String --
+ ----------------------
+
+ procedure Set_Super_String
+ (Target : out Super_String;
+ Source : Wide_String;
+ Drop : Truncation := Error)
+ is
+ Slen : constant Natural := Source'Length;
+ Max_Length : constant Positive := Target.Max_Length;
+
+ begin
+ if Slen <= Max_Length then
+ Target.Current_Length := Slen;
+ Target.Data (1 .. Slen) := Source;
+
+ else
+ case Drop is
+ when Strings.Right =>
+ Target.Current_Length := Max_Length;
+ Target.Data (1 .. Max_Length) :=
+ Source (Source'First .. Source'First - 1 + Max_Length);
+
+ when Strings.Left =>
+ Target.Current_Length := Max_Length;
+ Target.Data (1 .. Max_Length) :=
+ Source (Source'Last - (Max_Length - 1) .. Source'Last);
+
+ when Strings.Error =>
+ raise Ada.Strings.Length_Error;
+ end case;
+ end if;
+ end Set_Super_String;
+
------------------
-- Super_Append --
------------------
@@ -289,9 +330,9 @@ package body Ada.Strings.Wide_Superbounded is
-- Case of Super_String and Super_String
function Super_Append
- (Left, Right : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ (Left : Super_String;
+ Right : Super_String;
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
@@ -386,8 +427,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Append
(Left : Super_String;
Right : Wide_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
@@ -488,8 +528,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Append
(Left : Wide_String;
Right : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
@@ -543,8 +582,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Append
(Left : Super_String;
Right : Wide_Character;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
@@ -612,8 +650,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Append
(Left : Wide_Character;
Right : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
@@ -649,10 +686,10 @@ package body Ada.Strings.Wide_Superbounded is
-----------------
function Super_Count
- (Source : Super_String;
- Pattern : Wide_String;
- Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Super_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
is
begin
return
@@ -661,10 +698,9 @@ package body Ada.Strings.Wide_Superbounded is
end Super_Count;
function Super_Count
- (Source : Super_String;
- Pattern : Wide_String;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Super_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
begin
return
@@ -674,8 +710,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Count
(Source : Super_String;
- Set : Wide_Maps.Wide_Character_Set)
- return Natural
+ Set : Wide_Maps.Wide_Character_Set) return Natural
is
begin
return Wide_Search.Count (Source.Data (1 .. Source.Current_Length), Set);
@@ -688,8 +723,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Delete
(Source : Super_String;
From : Positive;
- Through : Natural)
- return Super_String
+ Through : Natural) return Super_String
is
Result : Super_String (Source.Max_Length);
Slen : constant Natural := Source.Current_Length;
@@ -747,8 +781,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Element
(Source : Super_String;
- Index : Positive)
- return Wide_Character
+ Index : Positive) return Wide_Character
is
begin
if Index in 1 .. Source.Current_Length then
@@ -782,8 +815,7 @@ package body Ada.Strings.Wide_Superbounded is
(Source : Super_String;
Count : Natural;
Pad : Wide_Character := Wide_Space;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -830,7 +862,7 @@ package body Ada.Strings.Wide_Superbounded is
procedure Super_Head
(Source : in out Super_String;
Count : Natural;
- Pad : Wide_Character := Wide_Space;
+ Pad : Wide_Character := Wide_Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
@@ -878,11 +910,11 @@ package body Ada.Strings.Wide_Superbounded is
-----------------
function Super_Index
- (Source : Super_String;
- Pattern : Wide_String;
- Going : Strings.Direction := Strings.Forward;
- Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural
+ (Source : Super_String;
+ Pattern : Wide_String;
+ Going : Strings.Direction := Strings.Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
is
begin
return Wide_Search.Index
@@ -890,11 +922,10 @@ package body Ada.Strings.Wide_Superbounded is
end Super_Index;
function Super_Index
- (Source : Super_String;
- Pattern : Wide_String;
- Going : Direction := Forward;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Super_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
begin
return Wide_Search.Index
@@ -905,22 +936,59 @@ package body Ada.Strings.Wide_Superbounded is
(Source : Super_String;
Set : Wide_Maps.Wide_Character_Set;
Test : Strings.Membership := Strings.Inside;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Wide_Search.Index
(Source.Data (1 .. Source.Current_Length), Set, Test, Going);
end Super_Index;
+ function Super_Index
+ (Source : Super_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural
+ is
+ begin
+ return Wide_Search.Index
+ (Source.Data (1 .. Source.Current_Length),
+ Pattern, From, Going, Mapping);
+ end Super_Index;
+
+ function Super_Index
+ (Source : Super_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
+ is
+ begin
+ return Wide_Search.Index
+ (Source.Data (1 .. Source.Current_Length),
+ Pattern, From, Going, Mapping);
+ end Super_Index;
+
+ function Super_Index
+ (Source : Super_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ return Wide_Search.Index
+ (Source.Data (1 .. Source.Current_Length), Set, From, Test, Going);
+ end Super_Index;
+
---------------------------
-- Super_Index_Non_Blank --
---------------------------
function Super_Index_Non_Blank
(Source : Super_String;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return
@@ -928,6 +996,17 @@ package body Ada.Strings.Wide_Superbounded is
(Source.Data (1 .. Source.Current_Length), Going);
end Super_Index_Non_Blank;
+ function Super_Index_Non_Blank
+ (Source : Super_String;
+ From : Positive;
+ Going : Direction := Forward) return Natural
+ is
+ begin
+ return
+ Wide_Search.Index_Non_Blank
+ (Source.Data (1 .. Source.Current_Length), From, Going);
+ end Super_Index_Non_Blank;
+
------------------
-- Super_Insert --
------------------
@@ -936,8 +1015,7 @@ package body Ada.Strings.Wide_Superbounded is
(Source : Super_String;
Before : Positive;
New_Item : Wide_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -948,9 +1026,9 @@ package body Ada.Strings.Wide_Superbounded is
Alen : constant Integer := Slen - Blen;
Droplen : constant Integer := Tlen - Max_Length;
- -- Tlen is the length of the total Wide_String before possible
- -- truncation. Blen, Alen are the lengths of the before and after
- -- pieces of the source Wide_String.
+ -- Tlen is the length of the total string before possible truncation.
+ -- Blen, Alen are the lengths of the before and after pieces of the
+ -- source string.
begin
if Alen < 0 then
@@ -1032,11 +1110,10 @@ package body Ada.Strings.Wide_Superbounded is
---------------------
function Super_Overwrite
- (Source : Super_String;
- Position : Positive;
- New_Item : Wide_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ (Source : Super_String;
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -1172,12 +1249,11 @@ package body Ada.Strings.Wide_Superbounded is
-------------------------
function Super_Replace_Slice
- (Source : Super_String;
- Low : Positive;
- High : Natural;
- By : Wide_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
@@ -1197,10 +1273,10 @@ package body Ada.Strings.Wide_Superbounded is
Droplen : constant Integer := Tlen - Max_Length;
Result : Super_String (Max_Length);
- -- Tlen is the total length of the result Wide_String before any
+ -- Tlen is the total length of the result string before any
-- truncation. Blen and Alen are the lengths of the pieces
- -- of the original Wide_String that end up in the result
- -- Wide_String before and after the replaced slice.
+ -- of the original string that end up in the result string
+ -- before and after the replaced slice.
begin
if Droplen <= 0 then
@@ -1273,8 +1349,7 @@ package body Ada.Strings.Wide_Superbounded is
(Count : Natural;
Item : Wide_Character;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
@@ -1297,8 +1372,7 @@ package body Ada.Strings.Wide_Superbounded is
(Count : Natural;
Item : Wide_String;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Length : constant Integer := Count * Item'Length;
Result : Super_String (Max_Length);
@@ -1354,8 +1428,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Replicate
(Count : Natural;
Item : Super_String;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
begin
return
@@ -1373,8 +1446,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Slice
(Source : Super_String;
Low : Positive;
- High : Natural)
- return Wide_String
+ High : Natural) return Wide_String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
@@ -1388,6 +1460,43 @@ package body Ada.Strings.Wide_Superbounded is
end if;
end Super_Slice;
+ function Super_Slice
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural) return Super_String
+ is
+ Result : Super_String (Source.Max_Length);
+
+ begin
+ if Low > Source.Current_Length + 1
+ or else High > Source.Current_Length
+ then
+ raise Index_Error;
+ else
+ Result.Current_Length := High - Low + 1;
+ Result.Data (1 .. Source.Current_Length) := Source.Data (Low .. High);
+ end if;
+
+ return Result;
+ end Super_Slice;
+
+ procedure Super_Slice
+ (Source : Super_String;
+ Target : out Super_String;
+ Low : Positive;
+ High : Natural)
+ is
+ begin
+ if Low > Source.Current_Length + 1
+ or else High > Source.Current_Length
+ then
+ raise Index_Error;
+ else
+ Target.Current_Length := High - Low + 1;
+ Target.Data (1 .. Source.Current_Length) := Source.Data (Low .. High);
+ end if;
+ end Super_Slice;
+
----------------
-- Super_Tail --
----------------
@@ -1396,8 +1505,7 @@ package body Ada.Strings.Wide_Superbounded is
(Source : Super_String;
Count : Natural;
Pad : Wide_Character := Wide_Space;
- Drop : Strings.Truncation := Strings.Error)
- return Super_String
+ Drop : Strings.Truncation := Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
@@ -1445,7 +1553,7 @@ package body Ada.Strings.Wide_Superbounded is
procedure Super_Tail
(Source : in out Super_String;
Count : Natural;
- Pad : Wide_Character := Wide_Space;
+ Pad : Wide_Character := Wide_Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
@@ -1497,7 +1605,7 @@ package body Ada.Strings.Wide_Superbounded is
-- Super_To_String --
---------------------
- function Super_To_String (Source : in Super_String) return Wide_String is
+ function Super_To_String (Source : Super_String) return Wide_String is
begin
return Source.Data (1 .. Source.Current_Length);
end Super_To_String;
@@ -1508,8 +1616,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Translate
(Source : Super_String;
- Mapping : Wide_Maps.Wide_Character_Mapping)
- return Super_String
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Super_String
is
Result : Super_String (Source.Max_Length);
@@ -1535,8 +1642,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Translate
(Source : Super_String;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Super_String
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Super_String
is
Result : Super_String (Source.Max_Length);
@@ -1566,8 +1672,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Trim
(Source : Super_String;
- Side : Trim_End)
- return Super_String
+ Side : Trim_End) return Super_String
is
Result : Super_String (Source.Max_Length);
Last : Natural := Source.Current_Length;
@@ -1623,8 +1728,7 @@ package body Ada.Strings.Wide_Superbounded is
function Super_Trim
(Source : Super_String;
Left : Wide_Maps.Wide_Character_Set;
- Right : Wide_Maps.Wide_Character_Set)
- return Super_String
+ Right : Wide_Maps.Wide_Character_Set) return Super_String
is
Result : Super_String (Source.Max_Length);
@@ -1690,8 +1794,7 @@ package body Ada.Strings.Wide_Superbounded is
function Times
(Left : Natural;
Right : Wide_Character;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
@@ -1713,8 +1816,7 @@ package body Ada.Strings.Wide_Superbounded is
function Times
(Left : Natural;
Right : Wide_String;
- Max_Length : Positive)
- return Super_String
+ Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
Pos : Positive := 1;
@@ -1741,8 +1843,7 @@ package body Ada.Strings.Wide_Superbounded is
function Times
(Left : Natural;
- Right : Super_String)
- return Super_String
+ Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Pos : Positive := 1;
@@ -1775,8 +1876,7 @@ package body Ada.Strings.Wide_Superbounded is
function To_Super_String
(Source : Wide_String;
Max_Length : Natural;
- Drop : Truncation := Error)
- return Super_String
+ Drop : Truncation := Error) return Super_String
is
Result : Super_String (Max_Length);
Slen : constant Natural := Source'Length;
diff --git a/gcc/ada/a-stwisu.ads b/gcc/ada/a-stwisu.ads
index 8ea068642f8..a9df6fa2547 100644
--- a/gcc/ada/a-stwisu.ads
+++ b/gcc/ada/a-stwisu.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2005 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- --
@@ -35,7 +35,7 @@
-- generic package Ada.Strings.Wide_Bounded.Generic_Bounded_Length.
-- It defines type Super_String as a discriminated record with the maximum
--- length as the discriminant. Individual instantiations of
+-- length as the discriminant. Individual instantiations of the package
-- Strings.Wide_Bounded.Generic_Bounded_Length use this type with
-- an appropriate discriminant value set.
@@ -50,14 +50,12 @@ pragma Preelaborate (Wide_Superbounded);
Current_Length : Natural := 0;
Data : Wide_String (1 .. Max_Length) := (others => Wide_NUL);
end record;
- -- Type Wide_Bounded_String in
- -- Ada.Strings.Wide_Bounded.Generic_Bounded_Length is derived from this
- -- type, with the constraint of the maximum length.
+ -- Ada.Strings.Wide_Bounded.Generic_Bounded_Length.Wide_Bounded_String is
+ -- derived from this type, with the constraint of the maximum length.
- -- The subprograms defined for Super_String are similar to those
- -- defined for Wide_Bounded_String, except that they have different names,
- -- so that they can be renamed in
- -- Ada.Strings.Wide_Bounded.Generic_Bounded_Length.
+ -- The subprograms defined for Super_String are similar to those defined
+ -- for Bounded_Wide_String, except that they have different names, so that
+ -- they can be renamed in Ada.Strings.Wide_Bounded.Generic_Bounded_Length.
function Super_Length (Source : Super_String) return Natural;
@@ -68,88 +66,83 @@ pragma Preelaborate (Wide_Superbounded);
function To_Super_String
(Source : Wide_String;
Max_Length : Natural;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
-- Note the additional parameter Max_Length, which specifies the maximum
-- length setting of the resulting Super_String value.
-- The following procedures have declarations (and semantics) that are
- -- exactly analogous to those declared in Ada.Strings.Bounded.
+ -- exactly analogous to those declared in Ada.Strings.Wide_Bounded.
function Super_To_String (Source : Super_String) return Wide_String;
+ procedure Set_Super_String
+ (Target : out Super_String;
+ Source : Wide_String;
+ Drop : Truncation := Error);
+
function Super_Append
- (Left, Right : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ (Left : Super_String;
+ Right : Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Super_String;
Right : Wide_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Wide_String;
Right : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Super_String;
Right : Wide_Character;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Wide_Character;
Right : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Append
(Source : in out Super_String;
New_Item : Super_String;
- Drop : Truncation := Error);
+ Drop : Truncation := Error);
procedure Super_Append
(Source : in out Super_String;
New_Item : Wide_String;
- Drop : Truncation := Error);
+ Drop : Truncation := Error);
procedure Super_Append
(Source : in out Super_String;
New_Item : Wide_Character;
- Drop : Truncation := Error);
+ Drop : Truncation := Error);
function Concat
- (Left, Right : Super_String)
- return Super_String;
+ (Left : Super_String;
+ Right : Super_String) return Super_String;
function Concat
(Left : Super_String;
- Right : Wide_String)
- return Super_String;
+ Right : Wide_String) return Super_String;
function Concat
(Left : Wide_String;
- Right : Super_String)
- return Super_String;
+ Right : Super_String) return Super_String;
function Concat
(Left : Super_String;
- Right : Wide_Character)
- return Super_String;
+ Right : Wide_Character) return Super_String;
function Concat
(Left : Wide_Character;
- Right : Super_String)
- return Super_String;
+ Right : Super_String) return Super_String;
function Super_Element
(Source : Super_String;
- Index : Positive)
- return Wide_Character;
+ Index : Positive) return Wide_Character;
procedure Super_Replace_Element
(Source : in out Super_String;
@@ -159,70 +152,82 @@ pragma Preelaborate (Wide_Superbounded);
function Super_Slice
(Source : Super_String;
Low : Positive;
- High : Natural)
- return Wide_String;
+ High : Natural) return Wide_String;
+
+ function Super_Slice
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural) return Super_String;
+
+ procedure Super_Slice
+ (Source : Super_String;
+ Target : out Super_String;
+ Low : Positive;
+ High : Natural);
- function "=" (Left, Right : Super_String) return Boolean;
+ function "="
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
- function Equal (Left, Right : Super_String) return Boolean renames "=";
+ function Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean renames "=";
function Equal
(Left : Super_String;
- Right : Wide_String)
- return Boolean;
+ Right : Wide_String) return Boolean;
function Equal
(Left : Wide_String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Less (Left, Right : Super_String) return Boolean;
+ function Less
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Less
(Left : Super_String;
- Right : Wide_String)
- return Boolean;
+ Right : Wide_String) return Boolean;
function Less
(Left : Wide_String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Less_Or_Equal (Left, Right : Super_String) return Boolean;
+ function Less_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Less_Or_Equal
(Left : Super_String;
- Right : Wide_String)
- return Boolean;
+ Right : Wide_String) return Boolean;
function Less_Or_Equal
(Left : Wide_String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Greater (Left, Right : Super_String) return Boolean;
+ function Greater
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Greater
(Left : Super_String;
- Right : Wide_String)
- return Boolean;
+ Right : Wide_String) return Boolean;
function Greater
(Left : Wide_String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
- function Greater_Or_Equal (Left, Right : Super_String) return Boolean;
+ function Greater_Or_Equal
+ (Left : Super_String;
+ Right : Super_String) return Boolean;
function Greater_Or_Equal
(Left : Super_String;
- Right : Wide_String)
- return Boolean;
+ Right : Wide_String) return Boolean;
function Greater_Or_Equal
(Left : Wide_String;
- Right : Super_String)
- return Boolean;
+ Right : Super_String) return Boolean;
----------------------
-- Search Functions --
@@ -233,43 +238,65 @@ pragma Preelaborate (Wide_Superbounded);
Pattern : Wide_String;
Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ return Natural;
function Super_Index
(Source : Super_String;
Pattern : Wide_String;
Going : Direction := Forward;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Super_Index
(Source : Super_String;
Set : Wide_Maps.Wide_Character_Set;
Test : Membership := Inside;
- Going : Direction := Forward)
- return Natural;
+ Going : Direction := Forward) return Natural;
+
+ function Super_Index
+ (Source : Super_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
+
+ function Super_Index
+ (Source : Super_String;
+ Pattern : Wide_String;
+ From : Positive;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
+
+ function Super_Index
+ (Source : Super_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ From : Positive;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
+
+ function Super_Index_Non_Blank
+ (Source : Super_String;
+ Going : Direction := Forward) return Natural;
function Super_Index_Non_Blank
(Source : Super_String;
- Going : Direction := Forward)
- return Natural;
+ From : Positive;
+ Going : Direction := Forward) return Natural;
function Super_Count
(Source : Super_String;
Pattern : Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ return Natural;
function Super_Count
(Source : Super_String;
Pattern : Wide_String;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Super_Count
(Source : Super_String;
- Set : Wide_Maps.Wide_Character_Set)
- return Natural;
+ Set : Wide_Maps.Wide_Character_Set) return Natural;
procedure Super_Find_Token
(Source : Super_String;
@@ -278,14 +305,13 @@ pragma Preelaborate (Wide_Superbounded);
First : out Positive;
Last : out Natural);
- -----------------------------------------
- -- Wide_String Translation Subprograms --
- -----------------------------------------
+ ------------------------------------
+ -- String Translation Subprograms --
+ ------------------------------------
function Super_Translate
- (Source : Super_String;
- Mapping : Wide_Maps.Wide_Character_Mapping)
- return Super_String;
+ (Source : Super_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Super_String;
procedure Super_Translate
(Source : in out Super_String;
@@ -293,38 +319,35 @@ pragma Preelaborate (Wide_Superbounded);
function Super_Translate
(Source : Super_String;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Super_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Super_String;
procedure Super_Translate
(Source : in out Super_String;
Mapping : Wide_Maps.Wide_Character_Mapping_Function);
- --------------------------------------------
- -- Wide_String Transformation Subprograms --
- --------------------------------------------
+ ---------------------------------------
+ -- String Transformation Subprograms --
+ ---------------------------------------
function Super_Replace_Slice
- (Source : Super_String;
- Low : Positive;
- High : Natural;
- By : Wide_String;
- Drop : Truncation := Error)
- return Super_String;
+ (Source : Super_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Replace_Slice
- (Source : in out Super_String;
- Low : Positive;
- High : Natural;
- By : Wide_String;
- Drop : Truncation := Error);
+ (Source : in out Super_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String;
+ Drop : Truncation := Error);
function Super_Insert
(Source : Super_String;
Before : Positive;
New_Item : Wide_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Insert
(Source : in out Super_String;
@@ -333,11 +356,10 @@ pragma Preelaborate (Wide_Superbounded);
Drop : Truncation := Error);
function Super_Overwrite
- (Source : Super_String;
- Position : Positive;
- New_Item : Wide_String;
- Drop : Truncation := Error)
- return Super_String;
+ (Source : Super_String;
+ Position : Positive;
+ New_Item : Wide_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Overwrite
(Source : in out Super_String;
@@ -348,32 +370,29 @@ pragma Preelaborate (Wide_Superbounded);
function Super_Delete
(Source : Super_String;
From : Positive;
- Through : Natural)
- return Super_String;
+ Through : Natural) return Super_String;
procedure Super_Delete
(Source : in out Super_String;
From : Positive;
Through : Natural);
- --------------------------------------
- -- Wide_String Selector Subprograms --
- --------------------------------------
+ ---------------------------------
+ -- String Selector Subprograms --
+ ---------------------------------
function Super_Trim
(Source : Super_String;
- Side : Trim_End)
- return Super_String;
+ Side : Trim_End) return Super_String;
procedure Super_Trim
(Source : in out Super_String;
Side : Trim_End);
function Super_Trim
- (Source : Super_String;
+ (Source : Super_String;
Left : Wide_Maps.Wide_Character_Set;
- Right : Wide_Maps.Wide_Character_Set)
- return Super_String;
+ Right : Wide_Maps.Wide_Character_Set) return Super_String;
procedure Super_Trim
(Source : in out Super_String;
@@ -384,30 +403,28 @@ pragma Preelaborate (Wide_Superbounded);
(Source : Super_String;
Count : Natural;
Pad : Wide_Character := Wide_Space;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Head
(Source : in out Super_String;
Count : Natural;
Pad : Wide_Character := Wide_Space;
- Drop : Truncation := Error);
+ Drop : Truncation := Error);
function Super_Tail
(Source : Super_String;
Count : Natural;
Pad : Wide_Character := Wide_Space;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
procedure Super_Tail
(Source : in out Super_String;
Count : Natural;
Pad : Wide_Character := Wide_Space;
- Drop : Truncation := Error);
+ Drop : Truncation := Error);
------------------------------------
- -- Wide_String Constructor Subprograms --
+ -- String Constructor Subprograms --
------------------------------------
-- Note: in some of the following routines, there is an extra parameter
@@ -417,46 +434,39 @@ pragma Preelaborate (Wide_Superbounded);
function Times
(Left : Natural;
Right : Wide_Character;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Times
(Left : Natural;
Right : Wide_String;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Times
(Left : Natural;
- Right : Super_String)
- return Super_String;
+ Right : Super_String) return Super_String;
function Super_Replicate
(Count : Natural;
Item : Wide_Character;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Super_Replicate
(Count : Natural;
Item : Wide_String;
Drop : Truncation := Error;
- Max_Length : Positive)
- return Super_String;
+ Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Super_Replicate
(Count : Natural;
Item : Super_String;
- Drop : Truncation := Error)
- return Super_String;
+ Drop : Truncation := Error) return Super_String;
private
-
-- Pragma Inline declarations
pragma Inline ("=");
diff --git a/gcc/ada/a-stwiun.adb b/gcc/ada/a-stwiun.adb
index 5e88d3e9997..b4217720079 100644
--- a/gcc/ada/a-stwiun.adb
+++ b/gcc/ada/a-stwiun.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -55,8 +55,7 @@ package body Ada.Strings.Wide_Unbounded is
function "&"
(Left : Unbounded_Wide_String;
- Right : Unbounded_Wide_String)
- return Unbounded_Wide_String
+ Right : Unbounded_Wide_String) return Unbounded_Wide_String
is
L_Length : constant Natural := Left.Last;
R_Length : constant Natural := Right.Last;
@@ -77,8 +76,7 @@ package body Ada.Strings.Wide_Unbounded is
function "&"
(Left : Unbounded_Wide_String;
- Right : Wide_String)
- return Unbounded_Wide_String
+ Right : Wide_String) return Unbounded_Wide_String
is
L_Length : constant Natural := Left.Last;
Result : Unbounded_Wide_String;
@@ -96,8 +94,7 @@ package body Ada.Strings.Wide_Unbounded is
function "&"
(Left : Wide_String;
- Right : Unbounded_Wide_String)
- return Unbounded_Wide_String
+ Right : Unbounded_Wide_String) return Unbounded_Wide_String
is
R_Length : constant Natural := Right.Last;
Result : Unbounded_Wide_String;
@@ -116,8 +113,7 @@ package body Ada.Strings.Wide_Unbounded is
function "&"
(Left : Unbounded_Wide_String;
- Right : Wide_Character)
- return Unbounded_Wide_String
+ Right : Wide_Character) return Unbounded_Wide_String
is
Result : Unbounded_Wide_String;
@@ -135,8 +131,7 @@ package body Ada.Strings.Wide_Unbounded is
function "&"
(Left : Wide_Character;
- Right : Unbounded_Wide_String)
- return Unbounded_Wide_String
+ Right : Unbounded_Wide_String) return Unbounded_Wide_String
is
Result : Unbounded_Wide_String;
@@ -157,8 +152,7 @@ package body Ada.Strings.Wide_Unbounded is
function "*"
(Left : Natural;
- Right : Wide_Character)
- return Unbounded_Wide_String
+ Right : Wide_Character) return Unbounded_Wide_String
is
Result : Unbounded_Wide_String;
@@ -174,9 +168,8 @@ package body Ada.Strings.Wide_Unbounded is
end "*";
function "*"
- (Left : Natural;
- Right : Wide_String)
- return Unbounded_Wide_String
+ (Left : Natural;
+ Right : Wide_String) return Unbounded_Wide_String
is
Len : constant Natural := Right'Length;
K : Positive;
@@ -198,8 +191,7 @@ package body Ada.Strings.Wide_Unbounded is
function "*"
(Left : Natural;
- Right : Unbounded_Wide_String)
- return Unbounded_Wide_String
+ Right : Unbounded_Wide_String) return Unbounded_Wide_String
is
Len : constant Natural := Right.Last;
K : Positive;
@@ -226,8 +218,7 @@ package body Ada.Strings.Wide_Unbounded is
function "<"
(Left : Unbounded_Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return
@@ -236,8 +227,7 @@ package body Ada.Strings.Wide_Unbounded is
function "<"
(Left : Unbounded_Wide_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) < Right;
@@ -245,8 +235,7 @@ package body Ada.Strings.Wide_Unbounded is
function "<"
(Left : Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return Left < Right.Reference (1 .. Right.Last);
@@ -258,8 +247,7 @@ package body Ada.Strings.Wide_Unbounded is
function "<="
(Left : Unbounded_Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return
@@ -268,8 +256,7 @@ package body Ada.Strings.Wide_Unbounded is
function "<="
(Left : Unbounded_Wide_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) <= Right;
@@ -277,8 +264,7 @@ package body Ada.Strings.Wide_Unbounded is
function "<="
(Left : Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return Left <= Right.Reference (1 .. Right.Last);
@@ -290,8 +276,7 @@ package body Ada.Strings.Wide_Unbounded is
function "="
(Left : Unbounded_Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return
@@ -300,8 +285,7 @@ package body Ada.Strings.Wide_Unbounded is
function "="
(Left : Unbounded_Wide_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) = Right;
@@ -309,8 +293,7 @@ package body Ada.Strings.Wide_Unbounded is
function "="
(Left : Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return Left = Right.Reference (1 .. Right.Last);
@@ -322,8 +305,7 @@ package body Ada.Strings.Wide_Unbounded is
function ">"
(Left : Unbounded_Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return
@@ -332,8 +314,7 @@ package body Ada.Strings.Wide_Unbounded is
function ">"
(Left : Unbounded_Wide_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) > Right;
@@ -341,8 +322,7 @@ package body Ada.Strings.Wide_Unbounded is
function ">"
(Left : Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return Left > Right.Reference (1 .. Right.Last);
@@ -354,8 +334,7 @@ package body Ada.Strings.Wide_Unbounded is
function ">="
(Left : Unbounded_Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return
@@ -364,8 +343,7 @@ package body Ada.Strings.Wide_Unbounded is
function ">="
(Left : Unbounded_Wide_String;
- Right : Wide_String)
- return Boolean
+ Right : Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) >= Right;
@@ -373,8 +351,7 @@ package body Ada.Strings.Wide_Unbounded is
function ">="
(Left : Wide_String;
- Right : Unbounded_Wide_String)
- return Boolean
+ Right : Unbounded_Wide_String) return Boolean
is
begin
return Left >= Right.Reference (1 .. Right.Last);
@@ -438,11 +415,11 @@ package body Ada.Strings.Wide_Unbounded is
-----------
function Count
- (Source : Unbounded_Wide_String;
- Pattern : Wide_String;
- Mapping : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.Identity)
- return Natural
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping :=
+ Wide_Maps.Identity)
+ return Natural
is
begin
return Wide_Search.Count
@@ -450,10 +427,9 @@ package body Ada.Strings.Wide_Unbounded is
end Count;
function Count
- (Source : Unbounded_Wide_String;
- Pattern : Wide_String;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
begin
return Wide_Search.Count
@@ -461,9 +437,8 @@ package body Ada.Strings.Wide_Unbounded is
end Count;
function Count
- (Source : Unbounded_Wide_String;
- Set : Wide_Maps.Wide_Character_Set)
- return Natural
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural
is
begin
return Wide_Search.Count (Source.Reference (1 .. Source.Last), Set);
@@ -476,8 +451,7 @@ package body Ada.Strings.Wide_Unbounded is
function Delete
(Source : Unbounded_Wide_String;
From : Positive;
- Through : Natural)
- return Unbounded_Wide_String
+ Through : Natural) return Unbounded_Wide_String
is
begin
return To_Unbounded_Wide_String
@@ -515,8 +489,7 @@ package body Ada.Strings.Wide_Unbounded is
function Element
(Source : Unbounded_Wide_String;
- Index : Positive)
- return Wide_Character
+ Index : Positive) return Wide_Character
is
begin
if Index <= Source.Last then
@@ -581,8 +554,7 @@ package body Ada.Strings.Wide_Unbounded is
function Head
(Source : Unbounded_Wide_String;
Count : Natural;
- Pad : Wide_Character := Wide_Space)
- return Unbounded_Wide_String
+ Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String
is
begin
return
@@ -609,12 +581,11 @@ package body Ada.Strings.Wide_Unbounded is
-----------
function Index
- (Source : Unbounded_Wide_String;
- Pattern : Wide_String;
- Going : Strings.Direction := Strings.Forward;
- Mapping : Wide_Maps.Wide_Character_Mapping :=
- Wide_Maps.Identity)
- return Natural
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Strings.Direction := Strings.Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping :=
+ Wide_Maps.Identity) return Natural
is
begin
return Wide_Search.Index
@@ -622,11 +593,10 @@ package body Ada.Strings.Wide_Unbounded is
end Index;
function Index
- (Source : Unbounded_Wide_String;
- Pattern : Wide_String;
- Going : Direction := Forward;
- Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Natural
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural
is
begin
return Wide_Search.Index
@@ -637,8 +607,7 @@ package body Ada.Strings.Wide_Unbounded is
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
Test : Strings.Membership := Strings.Inside;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Wide_Search.Index
@@ -647,8 +616,7 @@ package body Ada.Strings.Wide_Unbounded is
function Index_Non_Blank
(Source : Unbounded_Wide_String;
- Going : Strings.Direction := Strings.Forward)
- return Natural
+ Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Wide_Search.Index_Non_Blank
@@ -672,8 +640,7 @@ package body Ada.Strings.Wide_Unbounded is
function Insert
(Source : Unbounded_Wide_String;
Before : Positive;
- New_Item : Wide_String)
- return Unbounded_Wide_String
+ New_Item : Wide_String) return Unbounded_Wide_String
is
begin
return To_Unbounded_Wide_String
@@ -715,11 +682,10 @@ package body Ada.Strings.Wide_Unbounded is
---------------
function Overwrite
- (Source : Unbounded_Wide_String;
- Position : Positive;
- New_Item : Wide_String)
- return Unbounded_Wide_String is
-
+ (Source : Unbounded_Wide_String;
+ Position : Positive;
+ New_Item : Wide_String) return Unbounded_Wide_String
+ is
begin
return To_Unbounded_Wide_String
(Wide_Fixed.Overwrite
@@ -800,11 +766,10 @@ package body Ada.Strings.Wide_Unbounded is
-------------------
function Replace_Slice
- (Source : Unbounded_Wide_String;
- Low : Positive;
- High : Natural;
- By : Wide_String)
- return Unbounded_Wide_String
+ (Source : Unbounded_Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String) return Unbounded_Wide_String
is
begin
return
@@ -836,8 +801,7 @@ package body Ada.Strings.Wide_Unbounded is
function Slice
(Source : Unbounded_Wide_String;
Low : Positive;
- High : Natural)
- return Wide_String
+ High : Natural) return Wide_String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
@@ -857,9 +821,8 @@ package body Ada.Strings.Wide_Unbounded is
function Tail
(Source : Unbounded_Wide_String;
Count : Natural;
- Pad : Wide_Character := Wide_Space)
- return Unbounded_Wide_String is
-
+ Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String
+ is
begin
return To_Unbounded_Wide_String
(Wide_Fixed.Tail (Source.Reference (1 .. Source.Last), Count, Pad));
@@ -884,11 +847,9 @@ package body Ada.Strings.Wide_Unbounded is
------------------------------
function To_Unbounded_Wide_String
- (Source : Wide_String)
- return Unbounded_Wide_String
+ (Source : Wide_String) return Unbounded_Wide_String
is
Result : Unbounded_Wide_String;
-
begin
Result.Last := Source'Length;
Result.Reference := new Wide_String (1 .. Source'Length);
@@ -896,11 +857,10 @@ package body Ada.Strings.Wide_Unbounded is
return Result;
end To_Unbounded_Wide_String;
- function To_Unbounded_Wide_String (Length : Natural)
- return Unbounded_Wide_String
+ function To_Unbounded_Wide_String
+ (Length : Natural) return Unbounded_Wide_String
is
Result : Unbounded_Wide_String;
-
begin
Result.Last := Length;
Result.Reference := new Wide_String (1 .. Length);
@@ -912,8 +872,7 @@ package body Ada.Strings.Wide_Unbounded is
--------------------
function To_Wide_String
- (Source : Unbounded_Wide_String)
- return Wide_String
+ (Source : Unbounded_Wide_String) return Wide_String
is
begin
return Source.Reference (1 .. Source.Last);
@@ -925,8 +884,7 @@ package body Ada.Strings.Wide_Unbounded is
function Translate
(Source : Unbounded_Wide_String;
- Mapping : Wide_Maps.Wide_Character_Mapping)
- return Unbounded_Wide_String
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Unbounded_Wide_String
is
begin
return To_Unbounded_Wide_String
@@ -944,7 +902,7 @@ package body Ada.Strings.Wide_Unbounded is
function Translate
(Source : Unbounded_Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping_Function)
- return Unbounded_Wide_String
+ return Unbounded_Wide_String
is
begin
return To_Unbounded_Wide_String
@@ -965,8 +923,7 @@ package body Ada.Strings.Wide_Unbounded is
function Trim
(Source : Unbounded_Wide_String;
- Side : Trim_End)
- return Unbounded_Wide_String
+ Side : Trim_End) return Unbounded_Wide_String
is
begin
return To_Unbounded_Wide_String
@@ -988,8 +945,7 @@ package body Ada.Strings.Wide_Unbounded is
function Trim
(Source : Unbounded_Wide_String;
Left : Wide_Maps.Wide_Character_Set;
- Right : Wide_Maps.Wide_Character_Set)
- return Unbounded_Wide_String
+ Right : Wide_Maps.Wide_Character_Set) return Unbounded_Wide_String
is
begin
return To_Unbounded_Wide_String
diff --git a/gcc/ada/a-stwiun.ads b/gcc/ada/a-stwiun.ads
index 6b348d456fd..ed231b2e66c 100644
--- a/gcc/ada/a-stwiun.ads
+++ b/gcc/ada/a-stwiun.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -56,195 +56,165 @@ pragma Preelaborate (Wide_Unbounded);
--------------------------------------------------------
function To_Unbounded_Wide_String
- (Source : Wide_String)
- return Unbounded_Wide_String;
+ (Source : Wide_String) return Unbounded_Wide_String;
function To_Unbounded_Wide_String
- (Length : in Natural)
- return Unbounded_Wide_String;
+ (Length : Natural) return Unbounded_Wide_String;
function To_Wide_String
- (Source : Unbounded_Wide_String)
- return Wide_String;
+ (Source : Unbounded_Wide_String) return Wide_String;
procedure Append
(Source : in out Unbounded_Wide_String;
- New_Item : in Unbounded_Wide_String);
+ New_Item : Unbounded_Wide_String);
procedure Append
(Source : in out Unbounded_Wide_String;
- New_Item : in Wide_String);
+ New_Item : Wide_String);
procedure Append
(Source : in out Unbounded_Wide_String;
- New_Item : in Wide_Character);
+ New_Item : Wide_Character);
function "&"
- (Left, Right : Unbounded_Wide_String)
- return Unbounded_Wide_String;
+ (Left, Right : Unbounded_Wide_String) return Unbounded_Wide_String;
function "&"
- (Left : in Unbounded_Wide_String;
- Right : in Wide_String)
- return Unbounded_Wide_String;
+ (Left : Unbounded_Wide_String;
+ Right : Wide_String) return Unbounded_Wide_String;
function "&"
- (Left : in Wide_String;
- Right : in Unbounded_Wide_String)
- return Unbounded_Wide_String;
+ (Left : Wide_String;
+ Right : Unbounded_Wide_String) return Unbounded_Wide_String;
function "&"
- (Left : in Unbounded_Wide_String;
- Right : in Wide_Character)
- return Unbounded_Wide_String;
+ (Left : Unbounded_Wide_String;
+ Right : Wide_Character) return Unbounded_Wide_String;
function "&"
- (Left : in Wide_Character;
- Right : in Unbounded_Wide_String)
- return Unbounded_Wide_String;
+ (Left : Wide_Character;
+ Right : Unbounded_Wide_String) return Unbounded_Wide_String;
function Element
- (Source : in Unbounded_Wide_String;
- Index : in Positive)
- return Wide_Character;
+ (Source : Unbounded_Wide_String;
+ Index : Positive) return Wide_Character;
procedure Replace_Element
(Source : in out Unbounded_Wide_String;
- Index : in Positive;
+ Index : Positive;
By : Wide_Character);
function Slice
- (Source : in Unbounded_Wide_String;
- Low : in Positive;
- High : in Natural)
- return Wide_String;
+ (Source : Unbounded_Wide_String;
+ Low : Positive;
+ High : Natural) return Wide_String;
function "="
- (Left : in Unbounded_Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function "="
- (Left : in Unbounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Wide_String) return Boolean;
function "="
- (Left : in Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function "<"
- (Left : in Unbounded_Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function "<"
- (Left : in Unbounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Wide_String) return Boolean;
function "<"
- (Left : in Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function "<="
- (Left : in Unbounded_Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function "<="
- (Left : in Unbounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Wide_String) return Boolean;
function "<="
- (Left : in Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function ">"
- (Left : in Unbounded_Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function ">"
- (Left : in Unbounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Wide_String) return Boolean;
function ">"
- (Left : in Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function ">="
- (Left : in Unbounded_Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
function ">="
- (Left : in Unbounded_Wide_String;
- Right : in Wide_String)
- return Boolean;
+ (Left : Unbounded_Wide_String;
+ Right : Wide_String) return Boolean;
function ">="
- (Left : in Wide_String;
- Right : in Unbounded_Wide_String)
- return Boolean;
+ (Left : Wide_String;
+ Right : Unbounded_Wide_String) return Boolean;
------------------------
-- Search Subprograms --
------------------------
function Index
- (Source : in Unbounded_Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
function Index
- (Source : in Unbounded_Wide_String;
- Pattern : in Wide_String;
- Going : in Direction := Forward;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Going : Direction := Forward;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Index
- (Source : in Unbounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership := Inside;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership := Inside;
+ Going : Direction := Forward) return Natural;
function Index_Non_Blank
- (Source : in Unbounded_Wide_String;
- Going : in Direction := Forward)
- return Natural;
+ (Source : Unbounded_Wide_String;
+ Going : Direction := Forward) return Natural;
function Count
- (Source : in Unbounded_Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
- return Natural;
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
+ return Natural;
function Count
- (Source : in Unbounded_Wide_String;
- Pattern : in Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Natural;
+ (Source : Unbounded_Wide_String;
+ Pattern : Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Count
- (Source : in Unbounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set)
- return Natural;
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set) return Natural;
procedure Find_Token
- (Source : in Unbounded_Wide_String;
- Set : in Wide_Maps.Wide_Character_Set;
- Test : in Membership;
+ (Source : Unbounded_Wide_String;
+ Set : Wide_Maps.Wide_Character_Set;
+ Test : Membership;
First : out Positive;
Last : out Natural);
@@ -253,129 +223,117 @@ pragma Preelaborate (Wide_Unbounded);
------------------------------------
function Translate
- (Source : in Unbounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping) return Unbounded_Wide_String;
procedure Translate
(Source : in out Unbounded_Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping);
function Translate
- (Source : in Unbounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function)
+ return Unbounded_Wide_String;
procedure Translate
(Source : in out Unbounded_Wide_String;
- Mapping : in Wide_Maps.Wide_Character_Mapping_Function);
+ Mapping : Wide_Maps.Wide_Character_Mapping_Function);
---------------------------------------
-- Wide_String Transformation Subprograms --
---------------------------------------
function Replace_Slice
- (Source : in Unbounded_Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Low : Positive;
+ High : Natural;
+ By : Wide_String) return Unbounded_Wide_String;
procedure Replace_Slice
(Source : in out Unbounded_Wide_String;
- Low : in Positive;
- High : in Natural;
- By : in Wide_String);
+ Low : Positive;
+ High : Natural;
+ By : Wide_String);
function Insert
- (Source : in Unbounded_Wide_String;
- Before : in Positive;
- New_Item : in Wide_String)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Before : Positive;
+ New_Item : Wide_String) return Unbounded_Wide_String;
procedure Insert
(Source : in out Unbounded_Wide_String;
- Before : in Positive;
- New_Item : in Wide_String);
+ Before : Positive;
+ New_Item : Wide_String);
function Overwrite
- (Source : in Unbounded_Wide_String;
- Position : in Positive;
- New_Item : in Wide_String)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Position : Positive;
+ New_Item : Wide_String) return Unbounded_Wide_String;
procedure Overwrite
(Source : in out Unbounded_Wide_String;
- Position : in Positive;
- New_Item : in Wide_String);
+ Position : Positive;
+ New_Item : Wide_String);
function Delete
- (Source : in Unbounded_Wide_String;
- From : in Positive;
- Through : in Natural)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ From : Positive;
+ Through : Natural) return Unbounded_Wide_String;
procedure Delete
(Source : in out Unbounded_Wide_String;
- From : in Positive;
- Through : in Natural);
+ From : Positive;
+ Through : Natural);
function Trim
- (Source : in Unbounded_Wide_String;
- Side : in Trim_End)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Side : Trim_End) return Unbounded_Wide_String;
procedure Trim
(Source : in out Unbounded_Wide_String;
- Side : in Trim_End);
+ Side : Trim_End);
function Trim
- (Source : in Unbounded_Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set) return Unbounded_Wide_String;
procedure Trim
(Source : in out Unbounded_Wide_String;
- Left : in Wide_Maps.Wide_Character_Set;
- Right : in Wide_Maps.Wide_Character_Set);
+ Left : Wide_Maps.Wide_Character_Set;
+ Right : Wide_Maps.Wide_Character_Set);
function Head
- (Source : in Unbounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String;
procedure Head
(Source : in out Unbounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space);
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space);
function Tail
- (Source : in Unbounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space)
- return Unbounded_Wide_String;
+ (Source : Unbounded_Wide_String;
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String;
procedure Tail
(Source : in out Unbounded_Wide_String;
- Count : in Natural;
- Pad : in Wide_Character := Wide_Space);
+ Count : Natural;
+ Pad : Wide_Character := Wide_Space);
function "*"
- (Left : in Natural;
- Right : in Wide_Character)
- return Unbounded_Wide_String;
+ (Left : Natural;
+ Right : Wide_Character) return Unbounded_Wide_String;
function "*"
- (Left : in Natural;
- Right : in Wide_String)
- return Unbounded_Wide_String;
+ (Left : Natural;
+ Right : Wide_String) return Unbounded_Wide_String;
function "*"
- (Left : in Natural;
- Right : in Unbounded_Wide_String)
- return Unbounded_Wide_String;
+ (Left : Natural;
+ Right : Unbounded_Wide_String) return Unbounded_Wide_String;
private
pragma Inline (Length);
diff --git a/gcc/ada/a-suteio.adb b/gcc/ada/a-suteio.adb
index 737f3c7b35d..b1ddff23741 100644
--- a/gcc/ada/a-suteio.adb
+++ b/gcc/ada/a-suteio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-1999 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005 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- --
@@ -50,7 +50,6 @@ package body Ada.Strings.Unbounded.Text_IO is
begin
Get_Line (Buffer, Last);
Str1 := new String'(Buffer (1 .. Last));
-
while Last = Buffer'Last loop
Get_Line (Buffer, Last);
Str2 := new String'(Str1.all & Buffer (1 .. Last));
@@ -72,7 +71,6 @@ package body Ada.Strings.Unbounded.Text_IO is
begin
Get_Line (File, Buffer, Last);
Str1 := new String'(Buffer (1 .. Last));
-
while Last = Buffer'Last loop
Get_Line (File, Buffer, Last);
Str2 := new String'(Str1.all & Buffer (1 .. Last));
@@ -84,6 +82,47 @@ package body Ada.Strings.Unbounded.Text_IO is
return Result;
end Get_Line;
+ procedure Get_Line (Item : out Unbounded_String) is
+ Buffer : String (1 .. 1000);
+ Last : Natural;
+ Str1 : String_Access;
+ Str2 : String_Access;
+
+ begin
+ Get_Line (Buffer, Last);
+ Str1 := new String'(Buffer (1 .. Last));
+ while Last = Buffer'Last loop
+ Get_Line (Buffer, Last);
+ Str2 := new String'(Str1.all & Buffer (1 .. Last));
+ Free (Str1);
+ Str1 := Str2;
+ end loop;
+
+ Set_String (Item, Str1);
+ end Get_Line;
+
+ procedure Get_Line
+ (File : Ada.Text_IO.File_Type;
+ Item : out Unbounded_String)
+ is
+ Buffer : String (1 .. 1000);
+ Last : Natural;
+ Str1 : String_Access;
+ Str2 : String_Access;
+
+ begin
+ Get_Line (File, Buffer, Last);
+ Str1 := new String'(Buffer (1 .. Last));
+ while Last = Buffer'Last loop
+ Get_Line (Buffer, Last);
+ Str2 := new String'(Str1.all & Buffer (1 .. Last));
+ Free (Str1);
+ Str1 := Str2;
+ end loop;
+
+ Set_String (Item, Str1);
+ end Get_Line;
+
---------
-- Put --
---------
diff --git a/gcc/ada/a-suteio.ads b/gcc/ada/a-suteio.ads
index c98f453f64b..e743bdf7243 100644
--- a/gcc/ada/a-suteio.ads
+++ b/gcc/ada/a-suteio.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-1999 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005 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- --
@@ -46,6 +46,12 @@ package Ada.Strings.Unbounded.Text_IO is
-- as an unbounded string of appropriate length. If no File parameter
-- is present, input is from Current_Input.
+ procedure Get_Line
+ (File : Ada.Text_IO.File_Type;
+ Item : out Unbounded_String);
+ procedure Get_Line (Item : out Unbounded_String);
+ -- Similar to the above, but in procedure form with an out parameter
+
procedure Put (U : Unbounded_String);
procedure Put (File : Ada.Text_IO.File_Type; U : Unbounded_String);
procedure Put_Line (U : Unbounded_String);
diff --git a/gcc/ada/a-swuwti.adb b/gcc/ada/a-swuwti.adb
index adf4ba7f05c..9836ae5b58c 100644
--- a/gcc/ada/a-swuwti.adb
+++ b/gcc/ada/a-swuwti.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-1999 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005 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,7 +31,8 @@
-- --
------------------------------------------------------------------------------
-with Ada.Wide_Text_IO; use Ada.Wide_Text_IO;
+with Ada.Strings.Wide_Unbounded.Aux; use Ada.Strings.Wide_Unbounded.Aux;
+with Ada.Wide_Text_IO; use Ada.Wide_Text_IO;
package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is
@@ -44,11 +45,11 @@ package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is
Last : Natural;
Str1 : Wide_String_Access;
Str2 : Wide_String_Access;
+ Result : Unbounded_Wide_String;
begin
Get_Line (Buffer, Last);
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));
@@ -56,17 +57,18 @@ package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is
Str1 := Str2;
end loop;
- return To_Unbounded_Wide_String (Str1.all);
+ Set_Wide_String (Result, Str1);
+ return Result;
end Get_Line;
function Get_Line
- (File : Ada.Wide_Text_IO.File_Type)
- return Unbounded_Wide_String
+ (File : Ada.Wide_Text_IO.File_Type) return Unbounded_Wide_String
is
Buffer : Wide_String (1 .. 1000);
Last : Natural;
Str1 : Wide_String_Access;
Str2 : Wide_String_Access;
+ Result : Unbounded_Wide_String;
begin
Get_Line (File, Buffer, Last);
@@ -79,7 +81,49 @@ package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is
Str1 := Str2;
end loop;
- return To_Unbounded_Wide_String (Str1.all);
+ Set_Wide_String (Result, Str1);
+ return Result;
+ end Get_Line;
+
+ procedure Get_Line (Item : out Unbounded_Wide_String) is
+ Buffer : Wide_String (1 .. 1000);
+ Last : Natural;
+ Str1 : Wide_String_Access;
+ Str2 : Wide_String_Access;
+
+ begin
+ Get_Line (Buffer, Last);
+ 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));
+ Free (Str1);
+ Str1 := Str2;
+ end loop;
+
+ Set_Wide_String (Item, Str1);
+ end Get_Line;
+
+ procedure Get_Line
+ (File : Ada.Wide_Text_IO.File_Type;
+ Item : out Unbounded_Wide_String)
+ is
+ Buffer : Wide_String (1 .. 1000);
+ Last : Natural;
+ Str1 : Wide_String_Access;
+ Str2 : Wide_String_Access;
+
+ begin
+ Get_Line (File, Buffer, Last);
+ 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));
+ Free (Str1);
+ Str1 := Str2;
+ end loop;
+
+ Set_Wide_String (Item, Str1);
end Get_Line;
---------
@@ -88,12 +132,12 @@ package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is
procedure Put (U : Unbounded_Wide_String) is
begin
- Put (To_Wide_String (U));
+ Put (Get_Wide_String (U).all);
end Put;
procedure Put (File : File_Type; U : Unbounded_Wide_String) is
begin
- Put (File, To_Wide_String (U));
+ Put (File, Get_Wide_String (U).all);
end Put;
--------------
@@ -102,12 +146,12 @@ package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is
procedure Put_Line (U : Unbounded_Wide_String) is
begin
- Put_Line (To_Wide_String (U));
+ Put_Line (Get_Wide_String (U).all);
end Put_Line;
procedure Put_Line (File : File_Type; U : Unbounded_Wide_String) is
begin
- Put_Line (File, To_Wide_String (U));
+ Put_Line (File, Get_Wide_String (U).all);
end Put_Line;
end Ada.Strings.Wide_Unbounded.Wide_Text_IO;
diff --git a/gcc/ada/a-swuwti.ads b/gcc/ada/a-swuwti.ads
index fca6211b00d..ff8acf75273 100644
--- a/gcc/ada/a-swuwti.ads
+++ b/gcc/ada/a-swuwti.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-1999 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005 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,9 +32,9 @@
------------------------------------------------------------------------------
-- This child package of Ada.Strings.Wide_Unbounded provides specialized
--- Text_IO routines that work directly with unbounded strings, avoiding the
--- inefficiencies of access via the standard interface, and also taking
--- direct advantage of the variable length semantics of these strings.
+-- Wide_Text_IO routines that work directly with unbounded wide strings,
+-- avoiding the inefficiencies of access via the standard interface, and also
+-- taking direct advantage of the variable length semantics of these strings.
with Ada.Wide_Text_IO;
@@ -43,12 +43,17 @@ package Ada.Strings.Wide_Unbounded.Wide_Text_IO is
function Get_Line
return Unbounded_Wide_String;
function Get_Line
- (File : Ada.Wide_Text_IO.File_Type)
- return Unbounded_Wide_String;
+ (File : Ada.Wide_Text_IO.File_Type) return Unbounded_Wide_String;
-- Reads up to the end of the current line, returning the result
-- as an unbounded string of appropriate length. If no File parameter
-- is present, input is from Current_Input.
+ procedure Get_Line
+ (File : Ada.Wide_Text_IO.File_Type;
+ Item : out Unbounded_Wide_String);
+ procedure Get_Line (Item : out Unbounded_Wide_String);
+ -- Similar to the above, but in procedure form with an out parameter
+
procedure Put
(U : Unbounded_Wide_String);
procedure Put
diff --git a/gcc/ada/a-tags.adb b/gcc/ada/a-tags.adb
index dddf1bb8835..03221948d34 100644
--- a/gcc/ada/a-tags.adb
+++ b/gcc/ada/a-tags.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,36 +32,35 @@
------------------------------------------------------------------------------
with Ada.Exceptions;
-
with System.HTable;
-with Unchecked_Conversion;
-
pragma Elaborate_All (System.HTable);
package body Ada.Tags is
-- Structure of the GNAT Dispatch Table
--- +----------------------+
--- | TSD pointer ---|-----> Type Specific Data
--- +----------------------+ +-------------------+
--- | table of | | inheritance depth |
--- : primitive ops : +-------------------+
--- | pointers | | expanded name |
--- +----------------------+ +-------------------+
--- | external tag |
--- +-------------------+
--- | Hash table link |
--- +-------------------+
--- | Remotely Callable |
--- +-------------------+
--- | Rec Ctrler offset |
--- +-------------------+
--- | table of |
--- : ancestor :
--- | tags |
--- +-------------------+
+-- +-----------------------+
+-- | Offset_To_Top |
+-- +-----------------------+
+-- | Typeinfo_Ptr/TSD_Ptr |----> Type Specific Data
+-- Tag ---> +-----------------------+ +-------------------+
+-- | table of | | inheritance depth |
+-- : primitive ops : +-------------------+
+-- | pointers | | expanded name |
+-- +-----------------------+ +-------------------+
+-- | external tag |
+-- +-------------------+
+-- | Hash table link |
+-- +-------------------+
+-- | Remotely Callable |
+-- +-------------------+
+-- | Rec Ctrler offset |
+-- +-------------------+
+-- | table of |
+-- : ancestor :
+-- | tags |
+-- +-------------------+
subtype Cstring is String (Positive);
type Cstring_Ptr is access all Cstring;
@@ -69,12 +68,12 @@ package body Ada.Tags is
type Tag_Table is array (Natural range <>) of Tag;
pragma Suppress_Initialization (Tag_Table);
pragma Suppress (Index_Check, On => Tag_Table);
- -- We suppress index checks because the declared size in the record
- -- below is a dummy size of one (see below).
+ -- We suppress index checks because the declared size in the record below
+ -- is a dummy size of one (see below).
type Wide_Boolean is new Boolean;
- -- This name should probably be changed sometime ??? and indeed
- -- probably this field could simply be of type Standard.Boolean.
+ -- This name should probably be changed sometime ??? and indeed probably
+ -- this field could simply be of type Standard.Boolean.
type Type_Specific_Data is record
Idepth : Natural;
@@ -85,31 +84,48 @@ package body Ada.Tags is
RC_Offset : SSE.Storage_Offset;
Ancestor_Tags : Tag_Table (0 .. 1);
end record;
- -- The size of the Ancestor_Tags array actually depends on the tagged
- -- type to which it applies. We are using the same mechanism as for
- -- the Prims_Ptr array in the Dispatch_Table record. See comments
- -- below for more details.
+ -- The size of the Ancestor_Tags array actually depends on the tagged type
+ -- to which it applies. We are using the same mechanism as for the
+ -- Prims_Ptr array in the Dispatch_Table record. See comments below for
+ -- more details.
type Dispatch_Table is record
- TSD : Type_Specific_Data_Ptr;
- Prims_Ptr : Address_Array (1 .. 1);
+ -- Offset_To_Top : Integer := 0;
+ -- Typeinfo_Ptr : System.Address; -- Currently TSD is also here???
+ Prims_Ptr : Address_Array (Positive);
end record;
- -- The size of the Prims_Ptr array actually depends on the tagged
- -- type to which it applies. For each tagged type, the expander
- -- computes the actual array size, and allocates the Dispatch_Table
- -- record accordingly.
+
+ -- Note on the commented out fields of the Dispatch_Table
+ -- ------------------------------------------------------
+ -- According to the C++ ABI the components Offset_To_Top and Typeinfo_Ptr
+ -- are stored just "before" the dispatch table (that is, the Prims_Ptr
+ -- table), and they are referenced with negative offsets referring to the
+ -- base of the dispatch table. The _Tag (or the VTable_Ptr in C++ termi-
+ -- nology) must point to the base of the virtual table, just after these
+ -- components, to point to the Prims_Ptr table. For this purpose the
+ -- expander generates a Prims_Ptr table that has enough space for these
+ -- additional components, and generates code that displaces the _Tag to
+ -- point after these components.
+ -- -----------------------------------------------------------------------
+
+ -- The size of the Prims_Ptr array actually depends on the tagged type to
+ -- which it applies. For each tagged type, the expander computes the
+ -- actual array size, allocates the Dispatch_Table record accordingly, and
+ -- generates code that displaces the base of the record after the
+ -- Typeinfo_Ptr component. For this reason the first two components have
+ -- been commented in the previous declaration. The access to these
+ -- components is done by means of local functions.
--
- -- To avoid the use of discriminants to define the actual size
- -- of the dispatch table, we used to declare the tag as a pointer
- -- to a record that contains an arbitrary array of addresses, using
- -- Positive as its index. This ensures that there are never range
- -- checks when accessing the dispatch table, but it prevents GDB
- -- from displaying tagged types properly. A better approach is
- -- to declare this record type as holding a small number of addresses,
- -- and to explicitly suppress checks on it.
+ -- To avoid the use of discriminants to define the actual size of the
+ -- dispatch table, we used to declare the tag as a pointer to a record
+ -- that contains an arbitrary array of addresses, using Positive as its
+ -- index. This ensures that there are never range checks when accessing
+ -- the dispatch table, but it prevents GDB from displaying tagged types
+ -- properly. A better approach is to declare this record type as holding a
+ -- small number of addresses, and to explicitly suppress checks on it.
--
- -- Note that in both cases, this type is never allocated, and serves
- -- only to declare the corresponding access type.
+ -- Note that in both cases, this type is never allocated, and serves only
+ -- to declare the corresponding access type.
---------------------------------------------
-- Unchecked Conversions for String Fields --
@@ -121,13 +137,34 @@ package body Ada.Tags is
function To_Address is
new Unchecked_Conversion (Cstring_Ptr, System.Address);
+ -----------------------------------------------------------
+ -- Unchecked Conversions for the component offset_to_top --
+ -----------------------------------------------------------
+
+ type Int_Ptr is access Integer;
+
+ function To_Int_Ptr is
+ new Unchecked_Conversion (System.Address, Int_Ptr);
+
-----------------------
-- Local Subprograms --
-----------------------
function Length (Str : Cstring_Ptr) return Natural;
- -- Length of string represented by the given pointer (treating the
- -- string as a C-style string, which is Nul terminated).
+ -- Length of string represented by the given pointer (treating the string
+ -- as a C-style string, which is Nul terminated).
+
+ function Offset_To_Top (T : Tag) return Integer;
+ -- Returns the current value of the offset_to_top component available in
+ -- the prologue of the dispatch table.
+
+ function Typeinfo_Ptr (T : Tag) return System.Address;
+ -- Returns the current value of the typeinfo_ptr component available in
+ -- the prologue of the dispatch table.
+
+ pragma Unreferenced (Offset_To_Top);
+ pragma Unreferenced (Typeinfo_Ptr);
+ -- These functions will be used for full compatibility with the C++ ABI
-------------------------
-- External_Tag_HTable --
@@ -135,9 +172,9 @@ package body Ada.Tags is
type HTable_Headers is range 1 .. 64;
- -- The following internal package defines the routines used for
- -- the instantiation of a new System.HTable.Static_HTable (see
- -- below). See spec in g-htable.ads for details of usage.
+ -- The following internal package defines the routines used for the
+ -- instantiation of a new System.HTable.Static_HTable (see below). See
+ -- spec in g-htable.ads for details of usage.
package HTable_Subprograms is
procedure Set_HT_Link (T : Tag; Next : Tag);
@@ -195,7 +232,7 @@ package body Ada.Tags is
function Get_HT_Link (T : Tag) return Tag is
begin
- return T.TSD.HT_Link;
+ return TSD (T).HT_Link;
end Get_HT_Link;
----------
@@ -216,7 +253,7 @@ package body Ada.Tags is
procedure Set_HT_Link (T : Tag; Next : Tag) is
begin
- T.TSD.HT_Link := Next;
+ TSD (T).HT_Link := Next;
end Set_HT_Link;
end HTable_Subprograms;
@@ -241,9 +278,9 @@ package body Ada.Tags is
-- = Typ'tag
function CW_Membership (Obj_Tag : Tag; Typ_Tag : Tag) return Boolean is
- Pos : constant Integer := Obj_Tag.TSD.Idepth - Typ_Tag.TSD.Idepth;
+ Pos : constant Integer := TSD (Obj_Tag).Idepth - TSD (Typ_Tag).Idepth;
begin
- return Pos >= 0 and then Obj_Tag.TSD.Ancestor_Tags (Pos) = Typ_Tag;
+ return Pos >= 0 and then TSD (Obj_Tag).Ancestor_Tags (Pos) = Typ_Tag;
end CW_Membership;
-------------------
@@ -251,7 +288,7 @@ package body Ada.Tags is
-------------------
function Expanded_Name (T : Tag) return String is
- Result : constant Cstring_Ptr := T.TSD.Expanded_Name;
+ Result : constant Cstring_Ptr := TSD (T).Expanded_Name;
begin
return Result (1 .. Length (Result));
end Expanded_Name;
@@ -261,7 +298,7 @@ package body Ada.Tags is
------------------
function External_Tag (T : Tag) return String is
- Result : constant Cstring_Ptr := T.TSD.External_Tag;
+ Result : constant Cstring_Ptr := TSD (T).External_Tag;
begin
return Result (1 .. Length (Result));
end External_Tag;
@@ -272,7 +309,7 @@ package body Ada.Tags is
function Get_Expanded_Name (T : Tag) return System.Address is
begin
- return To_Address (T.TSD.Expanded_Name);
+ return To_Address (TSD (T).Expanded_Name);
end Get_Expanded_Name;
----------------------
@@ -281,7 +318,7 @@ package body Ada.Tags is
function Get_External_Tag (T : Tag) return System.Address is
begin
- return To_Address (T.TSD.External_Tag);
+ return To_Address (TSD (T).External_Tag);
end Get_External_Tag;
---------------------------
@@ -290,7 +327,7 @@ package body Ada.Tags is
function Get_Inheritance_Depth (T : Tag) return Natural is
begin
- return T.TSD.Idepth;
+ return TSD (T).Idepth;
end Get_Inheritance_Depth;
-------------------------
@@ -311,7 +348,7 @@ package body Ada.Tags is
function Get_RC_Offset (T : Tag) return SSE.Storage_Offset is
begin
- return T.TSD.RC_Offset;
+ return TSD (T).RC_Offset;
end Get_RC_Offset;
---------------------------
@@ -320,7 +357,7 @@ package body Ada.Tags is
function Get_Remotely_Callable (T : Tag) return Boolean is
begin
- return T.TSD.Remotely_Callable = True;
+ return TSD (T).Remotely_Callable = True;
end Get_Remotely_Callable;
-------------
@@ -328,8 +365,11 @@ package body Ada.Tags is
-------------
function Get_TSD (T : Tag) return System.Address is
+ use type System.Storage_Elements.Storage_Offset;
+ TSD_Ptr : constant Addr_Ptr :=
+ To_Addr_Ptr (To_Address (T) - DT_Typeinfo_Ptr_Size);
begin
- return To_Address (T.TSD);
+ return TSD_Ptr.all;
end Get_TSD;
----------------
@@ -353,20 +393,21 @@ package body Ada.Tags is
-----------------
procedure Inherit_TSD (Old_TSD : System.Address; New_Tag : Tag) is
- TSD : constant Type_Specific_Data_Ptr :=
- To_Type_Specific_Data_Ptr (Old_TSD);
- New_TSD : Type_Specific_Data renames New_Tag.TSD.all;
+ Old_TSD_Ptr : constant Type_Specific_Data_Ptr :=
+ To_Type_Specific_Data_Ptr (Old_TSD);
+ New_TSD_Ptr : constant Type_Specific_Data_Ptr :=
+ TSD (New_Tag);
begin
- if TSD /= null then
- New_TSD.Idepth := TSD.Idepth + 1;
- New_TSD.Ancestor_Tags (1 .. New_TSD.Idepth)
- := TSD.Ancestor_Tags (0 .. TSD.Idepth);
+ if Old_TSD_Ptr /= null then
+ New_TSD_Ptr.Idepth := Old_TSD_Ptr.Idepth + 1;
+ New_TSD_Ptr.Ancestor_Tags (1 .. New_TSD_Ptr.Idepth) :=
+ Old_TSD_Ptr.Ancestor_Tags (0 .. Old_TSD_Ptr.Idepth);
else
- New_TSD.Idepth := 0;
+ New_TSD_Ptr.Idepth := 0;
end if;
- New_TSD.Ancestor_Tags (0) := New_Tag;
+ New_TSD_Ptr.Ancestor_Tags (0) := New_Tag;
end Inherit_TSD;
------------------
@@ -389,7 +430,6 @@ package body Ada.Tags is
declare
Msg1 : constant String := "unknown tagged type: ";
Msg2 : String (1 .. Msg1'Length + External'Length);
-
begin
Msg2 (1 .. Msg1'Length) := Msg1;
Msg2 (Msg1'Length + 1 .. Msg1'Length + External'Length) :=
@@ -430,7 +470,7 @@ package body Ada.Tags is
(Obj : System.Address;
T : Tag) return SSE.Storage_Count
is
- Parent_Tag : constant Tag := T.TSD.Ancestor_Tags (1);
+ Parent_Tag : constant Tag := TSD (T).Ancestor_Tags (1);
-- The tag of the parent type through the dispatch table
F : constant Acc_Size := To_Acc_Size (Parent_Tag.Prims_Ptr (1));
@@ -449,7 +489,7 @@ package body Ada.Tags is
function Parent_Tag (T : Tag) return Tag is
begin
- return T.TSD.Ancestor_Tags (1);
+ return TSD (T).Ancestor_Tags (1);
end Parent_Tag;
------------------
@@ -467,7 +507,7 @@ package body Ada.Tags is
procedure Set_Expanded_Name (T : Tag; Value : System.Address) is
begin
- T.TSD.Expanded_Name := To_Cstring_Ptr (Value);
+ TSD (T).Expanded_Name := To_Cstring_Ptr (Value);
end Set_Expanded_Name;
----------------------
@@ -476,7 +516,7 @@ package body Ada.Tags is
procedure Set_External_Tag (T : Tag; Value : System.Address) is
begin
- T.TSD.External_Tag := To_Cstring_Ptr (Value);
+ TSD (T).External_Tag := To_Cstring_Ptr (Value);
end Set_External_Tag;
---------------------------
@@ -488,7 +528,7 @@ package body Ada.Tags is
Value : Natural)
is
begin
- T.TSD.Idepth := Value;
+ TSD (T).Idepth := Value;
end Set_Inheritance_Depth;
-------------------------
@@ -510,7 +550,7 @@ package body Ada.Tags is
procedure Set_RC_Offset (T : Tag; Value : SSE.Storage_Offset) is
begin
- T.TSD.RC_Offset := Value;
+ TSD (T).RC_Offset := Value;
end Set_RC_Offset;
---------------------------
@@ -520,9 +560,9 @@ package body Ada.Tags is
procedure Set_Remotely_Callable (T : Tag; Value : Boolean) is
begin
if Value then
- T.TSD.Remotely_Callable := True;
+ TSD (T).Remotely_Callable := True;
else
- T.TSD.Remotely_Callable := False;
+ TSD (T).Remotely_Callable := False;
end if;
end Set_Remotely_Callable;
@@ -531,8 +571,44 @@ package body Ada.Tags is
-------------
procedure Set_TSD (T : Tag; Value : System.Address) is
+ use type System.Storage_Elements.Storage_Offset;
+ TSD_Ptr : constant Addr_Ptr :=
+ To_Addr_Ptr (To_Address (T) - DT_Typeinfo_Ptr_Size);
begin
- T.TSD := To_Type_Specific_Data_Ptr (Value);
+ TSD_Ptr.all := Value;
end Set_TSD;
+ -------------------
+ -- Offset_To_Top --
+ -------------------
+
+ function Offset_To_Top (T : Tag) return Integer is
+ use type System.Storage_Elements.Storage_Offset;
+ TSD_Ptr : constant Int_Ptr :=
+ To_Int_Ptr (To_Address (T) - DT_Prologue_Size);
+ begin
+ return TSD_Ptr.all;
+ end Offset_To_Top;
+
+ ------------------
+ -- Typeinfo_Ptr --
+ ------------------
+
+ function Typeinfo_Ptr (T : Tag) return System.Address is
+ use type System.Storage_Elements.Storage_Offset;
+ TSD_Ptr : constant Addr_Ptr :=
+ To_Addr_Ptr (To_Address (T) - DT_Typeinfo_Ptr_Size);
+ begin
+ return TSD_Ptr.all;
+ end Typeinfo_Ptr;
+
+ ---------
+ -- TSD --
+ ---------
+
+ function TSD (T : Tag) return Type_Specific_Data_Ptr is
+ begin
+ return To_Type_Specific_Data_Ptr (Get_TSD (T));
+ end TSD;
+
end Ada.Tags;
diff --git a/gcc/ada/a-tags.ads b/gcc/ada/a-tags.ads
index 5dc3d1e378d..92715a85b14 100644
--- a/gcc/ada/a-tags.ads
+++ b/gcc/ada/a-tags.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -79,6 +79,12 @@ private
-- initialize those structures and uses the GET functions to
-- retreive the information when needed
+ type Dispatch_Table;
+ type Tag is access all Dispatch_Table;
+
+ type Type_Specific_Data;
+ type Type_Specific_Data_Ptr is access all Type_Specific_Data;
+
package SSE renames System.Storage_Elements;
function CW_Membership (Obj_Tag : Tag; Typ_Tag : Tag) return Boolean;
@@ -188,16 +194,26 @@ private
procedure Set_Remotely_Callable (T : Tag; Value : Boolean);
-- Set to true if the type has been declared in a context described
- -- in E.4 (18)
+ -- in E.4 (18).
+
+ function TSD (T : Tag) return Type_Specific_Data_Ptr;
+ -- This function is conceptually equivalent to Get_TSD, but
+ -- returning a Type_Specific_Data_Ptr type (rather than an Address)
+ -- simplifies the implementation of the other subprograms.
DT_Prologue_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
- (Standard'Address_Size / System.Storage_Unit);
+ (2 * (Standard'Address_Size / System.Storage_Unit));
-- Size of the first part of the dispatch table
+ DT_Typeinfo_Ptr_Size : constant SSE.Storage_Count :=
+ SSE.Storage_Count
+ (Standard'Address_Size / System.Storage_Unit);
+ -- Size of the Typeinfo_Ptr field of the Dispatch Table.
+
DT_Entry_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
- (Standard'Address_Size / System.Storage_Unit);
+ (1 * (Standard'Address_Size / System.Storage_Unit));
-- Size of each primitive operation entry in the Dispatch Table.
TSD_Prologue_Size : constant SSE.Storage_Count :=
@@ -206,7 +222,7 @@ private
-- Size of the first part of the type specific data
TSD_Entry_Size : constant SSE.Storage_Count :=
- SSE.Storage_Count (Standard'Address_Size / System.Storage_Unit);
+ SSE.Storage_Count (1 * (Standard'Address_Size / System.Storage_Unit));
-- Size of each ancestor tag entry in the TSD
type Address_Array is array (Natural range <>) of System.Address;
@@ -215,18 +231,20 @@ private
-- of this type are declared with a dummy size of 1, the actual size
-- depending on the number of primitive operations.
- type Dispatch_Table;
- type Tag is access all Dispatch_Table;
-
- type Type_Specific_Data;
- type Type_Specific_Data_Ptr is access all Type_Specific_Data;
-
function To_Type_Specific_Data_Ptr is
new Unchecked_Conversion (System.Address, Type_Specific_Data_Ptr);
function To_Address is
new Unchecked_Conversion (Type_Specific_Data_Ptr, System.Address);
+ function To_Address is
+ new Unchecked_Conversion (Tag, System.Address);
+
+ type Addr_Ptr is access System.Address;
+
+ function To_Addr_Ptr is
+ new Unchecked_Conversion (System.Address, Addr_Ptr);
+
-- Primitive dispatching operations are always inlined, to facilitate
-- use in a minimal/no run-time environment for high integrity use.
@@ -247,5 +265,6 @@ private
pragma Inline_Always (Set_RC_Offset);
pragma Inline_Always (Set_Remotely_Callable);
pragma Inline_Always (Set_TSD);
+ pragma Inline_Always (TSD);
end Ada.Tags;
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index 7afb804ff9c..3fc95f02bd8 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -60,7 +60,6 @@ package body Ada.Text_IO is
function AFCB_Allocate (Control_Block : Text_AFCB) return FCB.AFCB_Ptr is
pragma Unreferenced (Control_Block);
-
begin
return new Text_AFCB;
end AFCB_Allocate;
@@ -118,7 +117,7 @@ package body Ada.Text_IO is
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Col (File : in File_Type) return Positive_Count is
+ function Col (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Col;
@@ -135,9 +134,9 @@ package body Ada.Text_IO is
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "")
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "")
is
Dummy_File_Control_Block : Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
@@ -212,8 +211,8 @@ package body Ada.Text_IO is
-- End_Of_File --
-----------------
- function End_Of_File (File : in File_Type) return Boolean is
- ch : int;
+ function End_Of_File (File : File_Type) return Boolean is
+ ch : int;
begin
FIO.Check_Read_Status (AP (File));
@@ -270,7 +269,7 @@ package body Ada.Text_IO is
-- End_Of_Line --
-----------------
- function End_Of_Line (File : in File_Type) return Boolean is
+ function End_Of_Line (File : File_Type) return Boolean is
ch : int;
begin
@@ -301,7 +300,7 @@ package body Ada.Text_IO is
-- End_Of_Page --
-----------------
- function End_Of_Page (File : in File_Type) return Boolean is
+ function End_Of_Page (File : File_Type) return Boolean is
ch : int;
begin
@@ -357,7 +356,7 @@ package body Ada.Text_IO is
-- Flush --
-----------
- procedure Flush (File : in File_Type) is
+ procedure Flush (File : File_Type) is
begin
FIO.Flush (AP (File));
end Flush;
@@ -371,7 +370,7 @@ package body Ada.Text_IO is
-- Form --
----------
- function Form (File : in File_Type) return String is
+ function Form (File : File_Type) return String is
begin
return FIO.Form (AP (File));
end Form;
@@ -381,7 +380,7 @@ package body Ada.Text_IO is
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Character)
is
ch : int;
@@ -430,7 +429,7 @@ package body Ada.Text_IO is
end Get;
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out String)
is
ch : int;
@@ -489,7 +488,7 @@ package body Ada.Text_IO is
-- More work required here ???
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character)
is
ch : int;
@@ -530,7 +529,7 @@ package body Ada.Text_IO is
end Get_Immediate;
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
Available : out Boolean)
is
@@ -594,7 +593,7 @@ package body Ada.Text_IO is
--------------
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out String;
Last : out Natural)
is
@@ -712,6 +711,58 @@ package body Ada.Text_IO is
Get_Line (Current_In, Item, Last);
end Get_Line;
+ function Get_Line (File : File_Type) return String is
+ Buffer : String (1 .. 500);
+ Last : Natural;
+
+ function Get_Rest (S : String) return String;
+ -- This is a recursive function that reads the rest of the line and
+ -- returns it. S is the part read so far.
+
+ --------------
+ -- Get_Rest --
+ --------------
+
+ function Get_Rest (S : String) return String is
+
+ -- Each time we allocate a buffer the same size as what we have
+ -- read so far. This limits us to a logarithmic number of calls
+ -- to Get_Rest and also ensures only a linear use of stack space.
+
+ Buffer : String (1 .. S'Length);
+ Last : Natural;
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ declare
+ R : constant String := S & Buffer (1 .. Last);
+ begin
+ if Last < Buffer'Last then
+ return R;
+ else
+ return Get_Rest (R);
+ end if;
+ end;
+ end Get_Rest;
+
+ -- Start of processing for Get_Line
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ if Last < Buffer'Last then
+ return Buffer (1 .. Last);
+ else
+ return Get_Rest (Buffer (1 .. Last));
+ end if;
+ end Get_Line;
+
+ function Get_Line return String is
+ begin
+ return Get_Line (Current_In);
+ end Get_Line;
+
----------
-- Getc --
----------
@@ -733,7 +784,7 @@ package body Ada.Text_IO is
-- Is_Open --
-------------
- function Is_Open (File : in File_Type) return Boolean is
+ function Is_Open (File : File_Type) return Boolean is
begin
return FIO.Is_Open (AP (File));
end Is_Open;
@@ -746,7 +797,7 @@ package body Ada.Text_IO is
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Line (File : in File_Type) return Positive_Count is
+ function Line (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Line;
@@ -761,7 +812,7 @@ package body Ada.Text_IO is
-- Line_Length --
-----------------
- function Line_Length (File : in File_Type) return Count is
+ function Line_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Line_Length;
@@ -777,7 +828,7 @@ package body Ada.Text_IO is
----------------
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
End_Of_Line : out Boolean)
is
@@ -818,7 +869,7 @@ package body Ada.Text_IO is
-- Mode --
----------
- function Mode (File : in File_Type) return File_Mode is
+ function Mode (File : File_Type) return File_Mode is
begin
return To_TIO (FIO.Mode (AP (File)));
end Mode;
@@ -827,7 +878,7 @@ package body Ada.Text_IO is
-- Name --
----------
- function Name (File : in File_Type) return String is
+ function Name (File : File_Type) return String is
begin
return FIO.Name (AP (File));
end Name;
@@ -837,8 +888,8 @@ package body Ada.Text_IO is
--------------
procedure New_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
@@ -867,7 +918,7 @@ package body Ada.Text_IO is
File.Col := 1;
end New_Line;
- procedure New_Line (Spacing : in Positive_Count := 1) is
+ procedure New_Line (Spacing : Positive_Count := 1) is
begin
New_Line (Current_Out, Spacing);
end New_Line;
@@ -876,7 +927,7 @@ package body Ada.Text_IO is
-- New_Page --
--------------
- procedure New_Page (File : in File_Type) is
+ procedure New_Page (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
@@ -925,9 +976,9 @@ package body Ada.Text_IO is
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "")
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "")
is
Dummy_File_Control_Block : Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
@@ -955,7 +1006,7 @@ package body Ada.Text_IO is
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Page (File : in File_Type) return Positive_Count is
+ function Page (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Page;
@@ -970,7 +1021,7 @@ package body Ada.Text_IO is
-- Page_Length --
-----------------
- function Page_Length (File : in File_Type) return Count is
+ function Page_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Page_Length;
@@ -986,8 +1037,8 @@ package body Ada.Text_IO is
---------
procedure Put
- (File : in File_Type;
- Item : in Character)
+ (File : File_Type;
+ Item : Character)
is
begin
FIO.Check_Write_Status (AP (File));
@@ -1003,7 +1054,7 @@ package body Ada.Text_IO is
File.Col := File.Col + 1;
end Put;
- procedure Put (Item : in Character) is
+ procedure Put (Item : Character) is
begin
FIO.Check_Write_Status (AP (Current_Out));
@@ -1025,8 +1076,8 @@ package body Ada.Text_IO is
---------
procedure Put
- (File : in File_Type;
- Item : in String)
+ (File : File_Type;
+ Item : String)
is
begin
FIO.Check_Write_Status (AP (File));
@@ -1052,7 +1103,7 @@ package body Ada.Text_IO is
end if;
end Put;
- procedure Put (Item : in String) is
+ procedure Put (Item : String) is
begin
Put (Current_Out, Item);
end Put;
@@ -1062,8 +1113,8 @@ package body Ada.Text_IO is
--------------
procedure Put_Line
- (File : in File_Type;
- Item : in String)
+ (File : File_Type;
+ Item : String)
is
Ilen : Natural := Item'Length;
Istart : Natural := Item'First;
@@ -1127,7 +1178,7 @@ package body Ada.Text_IO is
end;
end Put_Line;
- procedure Put_Line (Item : in String) is
+ procedure Put_Line (Item : String) is
begin
Put_Line (Current_Out, Item);
end Put_Line;
@@ -1231,7 +1282,7 @@ package body Ada.Text_IO is
procedure Reset
(File : in out File_Type;
- Mode : in File_Mode)
+ Mode : File_Mode)
is
begin
-- Don't allow change of mode for current file (RM A.10.2(5))
@@ -1273,8 +1324,8 @@ package body Ada.Text_IO is
-------------
procedure Set_Col
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
ch : int;
@@ -1333,7 +1384,7 @@ package body Ada.Text_IO is
end if;
end Set_Col;
- procedure Set_Col (To : in Positive_Count) is
+ procedure Set_Col (To : Positive_Count) is
begin
Set_Col (Current_Out, To);
end Set_Col;
@@ -1342,7 +1393,7 @@ package body Ada.Text_IO is
-- Set_Error --
---------------
- procedure Set_Error (File : in File_Type) is
+ procedure Set_Error (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Err := File;
@@ -1352,7 +1403,7 @@ package body Ada.Text_IO is
-- Set_Input --
---------------
- procedure Set_Input (File : in File_Type) is
+ procedure Set_Input (File : File_Type) is
begin
FIO.Check_Read_Status (AP (File));
Current_In := File;
@@ -1363,8 +1414,8 @@ package body Ada.Text_IO is
--------------
procedure Set_Line
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
@@ -1401,7 +1452,7 @@ package body Ada.Text_IO is
end if;
end Set_Line;
- procedure Set_Line (To : in Positive_Count) is
+ procedure Set_Line (To : Positive_Count) is
begin
Set_Line (Current_Out, To);
end Set_Line;
@@ -1410,7 +1461,7 @@ package body Ada.Text_IO is
-- Set_Line_Length --
---------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count) is
+ procedure Set_Line_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
@@ -1424,7 +1475,7 @@ package body Ada.Text_IO is
File.Line_Length := To;
end Set_Line_Length;
- procedure Set_Line_Length (To : in Count) is
+ procedure Set_Line_Length (To : Count) is
begin
Set_Line_Length (Current_Out, To);
end Set_Line_Length;
@@ -1433,7 +1484,7 @@ package body Ada.Text_IO is
-- Set_Output --
----------------
- procedure Set_Output (File : in File_Type) is
+ procedure Set_Output (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Out := File;
@@ -1443,7 +1494,7 @@ package body Ada.Text_IO is
-- Set_Page_Length --
---------------------
- procedure Set_Page_Length (File : in File_Type; To : in Count) is
+ procedure Set_Page_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
@@ -1457,7 +1508,7 @@ package body Ada.Text_IO is
File.Page_Length := To;
end Set_Page_Length;
- procedure Set_Page_Length (To : in Count) is
+ procedure Set_Page_Length (To : Count) is
begin
Set_Page_Length (Current_Out, To);
end Set_Page_Length;
@@ -1467,8 +1518,8 @@ package body Ada.Text_IO is
---------------
procedure Skip_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
ch : int;
@@ -1548,7 +1599,7 @@ package body Ada.Text_IO is
end loop;
end Skip_Line;
- procedure Skip_Line (Spacing : in Positive_Count := 1) is
+ procedure Skip_Line (Spacing : Positive_Count := 1) is
begin
Skip_Line (Current_In, Spacing);
end Skip_Line;
@@ -1557,7 +1608,7 @@ package body Ada.Text_IO is
-- Skip_Page --
---------------
- procedure Skip_Page (File : in File_Type) is
+ procedure Skip_Page (File : File_Type) is
ch : int;
begin
@@ -1712,7 +1763,7 @@ package body Ada.Text_IO is
procedure Write
(File : in out Text_AFCB;
- Item : in Stream_Element_Array)
+ Item : Stream_Element_Array)
is
function Has_Translated_Characters return Boolean;
diff --git a/gcc/ada/a-textio.ads b/gcc/ada/a-textio.ads
index 4f38370c77a..451c9d0560c 100644
--- a/gcc/ada/a-textio.ads
+++ b/gcc/ada/a-textio.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -86,34 +86,34 @@ pragma Elaborate_Body (Text_IO);
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "");
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "");
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "");
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "");
procedure Close (File : in out File_Type);
procedure Delete (File : in out File_Type);
- procedure Reset (File : in out File_Type; Mode : in File_Mode);
+ procedure Reset (File : in out File_Type; Mode : File_Mode);
procedure Reset (File : in out File_Type);
- function Mode (File : in File_Type) return File_Mode;
- function Name (File : in File_Type) return String;
- function Form (File : in File_Type) return String;
+ function Mode (File : File_Type) return File_Mode;
+ function Name (File : File_Type) return String;
+ function Form (File : File_Type) return String;
- function Is_Open (File : in File_Type) return Boolean;
+ function Is_Open (File : File_Type) return Boolean;
------------------------------------------------------
-- Control of default input, output and error files --
------------------------------------------------------
- procedure Set_Input (File : in File_Type);
- procedure Set_Output (File : in File_Type);
- procedure Set_Error (File : in File_Type);
+ procedure Set_Input (File : File_Type);
+ procedure Set_Output (File : File_Type);
+ procedure Set_Error (File : File_Type);
function Standard_Input return File_Type;
function Standard_Output return File_Type;
@@ -140,76 +140,76 @@ pragma Elaborate_Body (Text_IO);
-- Note: The parameter file is IN OUT in the RM, but this is clearly
-- an oversight, and was intended to be IN, see AI95-00057.
- procedure Flush (File : in File_Type);
+ procedure Flush (File : File_Type);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count);
- procedure Set_Line_Length (To : in Count);
+ procedure Set_Line_Length (File : File_Type; To : Count);
+ procedure Set_Line_Length (To : Count);
- procedure Set_Page_Length (File : in File_Type; To : in Count);
- procedure Set_Page_Length (To : in Count);
+ procedure Set_Page_Length (File : File_Type; To : Count);
+ procedure Set_Page_Length (To : Count);
- function Line_Length (File : in File_Type) return Count;
+ function Line_Length (File : File_Type) return Count;
function Line_Length return Count;
- function Page_Length (File : in File_Type) return Count;
+ function Page_Length (File : File_Type) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
- procedure New_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure New_Line (Spacing : in Positive_Count := 1);
+ procedure New_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure New_Line (Spacing : Positive_Count := 1);
- procedure Skip_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure Skip_Line (Spacing : in Positive_Count := 1);
+ procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure Skip_Line (Spacing : Positive_Count := 1);
- function End_Of_Line (File : in File_Type) return Boolean;
+ function End_Of_Line (File : File_Type) return Boolean;
function End_Of_Line return Boolean;
- procedure New_Page (File : in File_Type);
+ procedure New_Page (File : File_Type);
procedure New_Page;
- procedure Skip_Page (File : in File_Type);
+ procedure Skip_Page (File : File_Type);
procedure Skip_Page;
- function End_Of_Page (File : in File_Type) return Boolean;
+ function End_Of_Page (File : File_Type) return Boolean;
function End_Of_Page return Boolean;
- function End_Of_File (File : in File_Type) return Boolean;
+ function End_Of_File (File : File_Type) return Boolean;
function End_Of_File return Boolean;
- procedure Set_Col (File : in File_Type; To : in Positive_Count);
- procedure Set_Col (To : in Positive_Count);
+ procedure Set_Col (File : File_Type; To : Positive_Count);
+ procedure Set_Col (To : Positive_Count);
- procedure Set_Line (File : in File_Type; To : in Positive_Count);
- procedure Set_Line (To : in Positive_Count);
+ procedure Set_Line (File : File_Type; To : Positive_Count);
+ procedure Set_Line (To : Positive_Count);
- function Col (File : in File_Type) return Positive_Count;
+ function Col (File : File_Type) return Positive_Count;
function Col return Positive_Count;
- function Line (File : in File_Type) return Positive_Count;
+ function Line (File : File_Type) return Positive_Count;
function Line return Positive_Count;
- function Page (File : in File_Type) return Positive_Count;
+ function Page (File : File_Type) return Positive_Count;
function Page return Positive_Count;
----------------------------
-- Character Input-Output --
----------------------------
- procedure Get (File : in File_Type; Item : out Character);
+ procedure Get (File : File_Type; Item : out Character);
procedure Get (Item : out Character);
- procedure Put (File : in File_Type; Item : in Character);
- procedure Put (Item : in Character);
+ procedure Put (File : File_Type; Item : Character);
+ procedure Put (Item : Character);
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
End_Of_Line : out Boolean);
@@ -218,14 +218,14 @@ pragma Elaborate_Body (Text_IO);
End_Of_Line : out Boolean);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character);
procedure Get_Immediate
(Item : out Character);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Character;
Available : out Boolean);
@@ -237,13 +237,13 @@ pragma Elaborate_Body (Text_IO);
-- String Input-Output --
-------------------------
- procedure Get (File : in File_Type; Item : out String);
+ procedure Get (File : File_Type; Item : out String);
procedure Get (Item : out String);
- procedure Put (File : in File_Type; Item : in String);
- procedure Put (Item : in String);
+ procedure Put (File : File_Type; Item : String);
+ procedure Put (Item : String);
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out String;
Last : out Natural);
@@ -251,12 +251,18 @@ pragma Elaborate_Body (Text_IO);
(Item : out String;
Last : out Natural);
+ function Get_Line (File : File_Type) return String;
+ pragma Ada_05 (Get_Line);
+
+ function Get_Line return String;
+ pragma Ada_05 (Get_Line);
+
procedure Put_Line
- (File : in File_Type;
- Item : in String);
+ (File : File_Type;
+ Item : String);
procedure Put_Line
- (Item : in String);
+ (Item : String);
---------------------------------------
-- Generic packages for Input-Output --
@@ -375,7 +381,7 @@ private
procedure Write
(File : in out Text_AFCB;
- Item : in Ada.Streams.Stream_Element_Array);
+ Item : Ada.Streams.Stream_Element_Array);
-- Write operation used when Text_IO file is treated directly as Stream
------------------------
diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb
index 621f4bd30ff..cfed9a7f0a4 100644
--- a/gcc/ada/a-witeio.adb
+++ b/gcc/ada/a-witeio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -40,6 +40,7 @@ with System.CRTL;
with System.File_IO;
with System.WCh_Cnv; use System.WCh_Cnv;
with System.WCh_Con; use System.WCh_Con;
+
with Unchecked_Conversion;
with Unchecked_Deallocation;
@@ -65,14 +66,13 @@ package body Ada.Wide_Text_IO is
-- Local Subprograms --
-----------------------
- function Getc_Immed (File : in File_Type) return int;
+ function Getc_Immed (File : File_Type) return int;
-- This routine is identical to Getc, except that the read is done in
-- Get_Immediate mode (i.e. without waiting for a line return).
function Get_Wide_Char_Immed
(C : Character;
- File : File_Type)
- return Wide_Character;
+ File : File_Type) return Wide_Character;
-- This routine is identical to Get_Wide_Char, except that the reads are
-- done in Get_Immediate mode (i.e. without waiting for a line return).
@@ -86,11 +86,9 @@ package body Ada.Wide_Text_IO is
-------------------
function AFCB_Allocate
- (Control_Block : Wide_Text_AFCB)
- return FCB.AFCB_Ptr
+ (Control_Block : Wide_Text_AFCB) return FCB.AFCB_Ptr
is
pragma Unreferenced (Control_Block);
-
begin
return new Wide_Text_AFCB;
end AFCB_Allocate;
@@ -148,7 +146,7 @@ package body Ada.Wide_Text_IO is
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Col (File : in File_Type) return Positive_Count is
+ function Col (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Col;
@@ -165,9 +163,9 @@ package body Ada.Wide_Text_IO is
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "")
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "")
is
Dummy_File_Control_Block : Wide_Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
@@ -241,7 +239,7 @@ package body Ada.Wide_Text_IO is
-- End_Of_File --
-----------------
- function End_Of_File (File : in File_Type) return Boolean is
+ function End_Of_File (File : File_Type) return Boolean is
ch : int;
begin
@@ -302,7 +300,7 @@ package body Ada.Wide_Text_IO is
-- End_Of_Line --
-----------------
- function End_Of_Line (File : in File_Type) return Boolean is
+ function End_Of_Line (File : File_Type) return Boolean is
ch : int;
begin
@@ -336,7 +334,7 @@ package body Ada.Wide_Text_IO is
-- End_Of_Page --
-----------------
- function End_Of_Page (File : in File_Type) return Boolean is
+ function End_Of_Page (File : File_Type) return Boolean is
ch : int;
begin
@@ -386,7 +384,7 @@ package body Ada.Wide_Text_IO is
-- Flush --
-----------
- procedure Flush (File : in File_Type) is
+ procedure Flush (File : File_Type) is
begin
FIO.Flush (AP (File));
end Flush;
@@ -400,7 +398,7 @@ package body Ada.Wide_Text_IO is
-- Form --
----------
- function Form (File : in File_Type) return String is
+ function Form (File : File_Type) return String is
begin
return FIO.Form (AP (File));
end Form;
@@ -410,7 +408,7 @@ package body Ada.Wide_Text_IO is
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character)
is
C : Character;
@@ -434,7 +432,7 @@ package body Ada.Wide_Text_IO is
end Get;
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_String)
is
begin
@@ -453,7 +451,7 @@ package body Ada.Wide_Text_IO is
-------------------
procedure Get_Character
- (File : in File_Type;
+ (File : File_Type;
Item : out Character)
is
ch : int;
@@ -501,7 +499,7 @@ package body Ada.Wide_Text_IO is
-------------------
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character)
is
ch : int;
@@ -537,7 +535,7 @@ package body Ada.Wide_Text_IO is
end Get_Immediate;
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
Available : out Boolean)
is
@@ -580,7 +578,7 @@ package body Ada.Wide_Text_IO is
--------------
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_String;
Last : out Natural)
is
@@ -671,22 +669,78 @@ package body Ada.Wide_Text_IO is
Get_Line (Current_In, Item, Last);
end Get_Line;
+ function Get_Line (File : File_Type) return Wide_String is
+ Buffer : Wide_String (1 .. 500);
+ Last : Natural;
+
+ function Get_Rest (S : Wide_String) return Wide_String;
+ -- This is a recursive function that reads the rest of the line and
+ -- returns it. S is the part read so far.
+
+ --------------
+ -- Get_Rest --
+ --------------
+
+ function Get_Rest (S : Wide_String) return Wide_String is
+
+ -- Each time we allocate a buffer the same size as what we have
+ -- read so far. This limits us to a logarithmic number of calls
+ -- to Get_Rest and also ensures only a linear use of stack space.
+
+ Buffer : Wide_String (1 .. S'Length);
+ Last : Natural;
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ declare
+ R : constant Wide_String := S & Buffer (1 .. Last);
+ begin
+ if Last < Buffer'Last then
+ return R;
+ else
+ return Get_Rest (R);
+ end if;
+ end;
+ end Get_Rest;
+
+ -- Start of processing for Get_Line
+
+ begin
+ Get_Line (File, Buffer, Last);
+
+ if Last < Buffer'Last then
+ return Buffer (1 .. Last);
+ else
+ return Get_Rest (Buffer (1 .. Last));
+ end if;
+ end Get_Line;
+
+ function Get_Line return Wide_String is
+ begin
+ return Get_Line (Current_In);
+ end Get_Line;
+
-------------------
-- Get_Wide_Char --
-------------------
function Get_Wide_Char
(C : Character;
- File : File_Type)
- return Wide_Character
+ File : File_Type) return Wide_Character
is
function In_Char return Character;
-- Function used to obtain additional characters it the wide character
-- sequence is more than one character long.
+ function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+
+ -------------
+ -- In_Char --
+ -------------
+
function In_Char return Character is
ch : constant Integer := Getc (File);
-
begin
if ch = EOF then
raise End_Error;
@@ -695,7 +749,7 @@ package body Ada.Wide_Text_IO is
end if;
end In_Char;
- function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+ -- Start of processing for In_Char
begin
return WC_In (C, File.WC_Method);
@@ -707,16 +761,20 @@ package body Ada.Wide_Text_IO is
function Get_Wide_Char_Immed
(C : Character;
- File : File_Type)
- return Wide_Character
+ File : File_Type) return Wide_Character
is
function In_Char return Character;
-- Function used to obtain additional characters it the wide character
-- sequence is more than one character long.
+ function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+
+ -------------
+ -- In_Char --
+ -------------
+
function In_Char return Character is
ch : constant Integer := Getc_Immed (File);
-
begin
if ch = EOF then
raise End_Error;
@@ -725,7 +783,7 @@ package body Ada.Wide_Text_IO is
end if;
end In_Char;
- function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+ -- Start of processing for Get_Wide_Char_Immed
begin
return WC_In (C, File.WC_Method);
@@ -752,7 +810,7 @@ package body Ada.Wide_Text_IO is
-- Getc_Immed --
----------------
- function Getc_Immed (File : in File_Type) return int is
+ function Getc_Immed (File : File_Type) return int is
ch : int;
end_of_file : int;
@@ -785,7 +843,7 @@ package body Ada.Wide_Text_IO is
-- Is_Open --
-------------
- function Is_Open (File : in File_Type) return Boolean is
+ function Is_Open (File : File_Type) return Boolean is
begin
return FIO.Is_Open (AP (File));
end Is_Open;
@@ -798,7 +856,7 @@ package body Ada.Wide_Text_IO is
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Line (File : in File_Type) return Positive_Count is
+ function Line (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Line;
@@ -813,7 +871,7 @@ package body Ada.Wide_Text_IO is
-- Line_Length --
-----------------
- function Line_Length (File : in File_Type) return Count is
+ function Line_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Line_Length;
@@ -829,7 +887,7 @@ package body Ada.Wide_Text_IO is
----------------
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
End_Of_Line : out Boolean)
is
@@ -902,7 +960,7 @@ package body Ada.Wide_Text_IO is
-- Mode --
----------
- function Mode (File : in File_Type) return File_Mode is
+ function Mode (File : File_Type) return File_Mode is
begin
return To_TIO (FIO.Mode (AP (File)));
end Mode;
@@ -911,7 +969,7 @@ package body Ada.Wide_Text_IO is
-- Name --
----------
- function Name (File : in File_Type) return String is
+ function Name (File : File_Type) return String is
begin
return FIO.Name (AP (File));
end Name;
@@ -921,8 +979,8 @@ package body Ada.Wide_Text_IO is
--------------
procedure New_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
@@ -951,7 +1009,7 @@ package body Ada.Wide_Text_IO is
File.Col := 1;
end New_Line;
- procedure New_Line (Spacing : in Positive_Count := 1) is
+ procedure New_Line (Spacing : Positive_Count := 1) is
begin
New_Line (Current_Out, Spacing);
end New_Line;
@@ -960,7 +1018,7 @@ package body Ada.Wide_Text_IO is
-- New_Page --
--------------
- procedure New_Page (File : in File_Type) is
+ procedure New_Page (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
@@ -1009,9 +1067,9 @@ package body Ada.Wide_Text_IO is
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "")
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "")
is
Dummy_File_Control_Block : Wide_Text_AFCB;
pragma Warnings (Off, Dummy_File_Control_Block);
@@ -1038,7 +1096,7 @@ package body Ada.Wide_Text_IO is
-- to exceed the value of Count'Last, i.e. no check is required for
-- overflow raising layout error.
- function Page (File : in File_Type) return Positive_Count is
+ function Page (File : File_Type) return Positive_Count is
begin
FIO.Check_File_Open (AP (File));
return File.Page;
@@ -1053,7 +1111,7 @@ package body Ada.Wide_Text_IO is
-- Page_Length --
-----------------
- function Page_Length (File : in File_Type) return Count is
+ function Page_Length (File : File_Type) return Count is
begin
FIO.Check_Write_Status (AP (File));
return File.Page_Length;
@@ -1069,25 +1127,30 @@ package body Ada.Wide_Text_IO is
---------
procedure Put
- (File : in File_Type;
- Item : in Wide_Character)
+ (File : File_Type;
+ Item : Wide_Character)
is
procedure Out_Char (C : Character);
-- Procedure to output one character of a wide character sequence
+ procedure WC_Out is new Wide_Char_To_Char_Sequence (Out_Char);
+ --------------
+ -- Out_Char --
+ --------------
+
procedure Out_Char (C : Character) is
begin
Putc (Character'Pos (C), File);
end Out_Char;
- procedure WC_Out is new Wide_Char_To_Char_Sequence (Out_Char);
+ -- Start of processing for Put
begin
WC_Out (Item, File.WC_Method);
File.Col := File.Col + 1;
end Put;
- procedure Put (Item : in Wide_Character) is
+ procedure Put (Item : Wide_Character) is
begin
Put (Current_Out, Item);
end Put;
@@ -1097,8 +1160,8 @@ package body Ada.Wide_Text_IO is
---------
procedure Put
- (File : in File_Type;
- Item : in Wide_String)
+ (File : File_Type;
+ Item : Wide_String)
is
begin
for J in Item'Range loop
@@ -1106,7 +1169,7 @@ package body Ada.Wide_Text_IO is
end loop;
end Put;
- procedure Put (Item : in Wide_String) is
+ procedure Put (Item : Wide_String) is
begin
Put (Current_Out, Item);
end Put;
@@ -1116,15 +1179,15 @@ package body Ada.Wide_Text_IO is
--------------
procedure Put_Line
- (File : in File_Type;
- Item : in Wide_String)
+ (File : File_Type;
+ Item : Wide_String)
is
begin
Put (File, Item);
New_Line (File);
end Put_Line;
- procedure Put_Line (Item : in Wide_String) is
+ procedure Put_Line (Item : Wide_String) is
begin
Put (Current_Out, Item);
New_Line (Current_Out);
@@ -1231,7 +1294,7 @@ package body Ada.Wide_Text_IO is
procedure Reset
(File : in out File_Type;
- Mode : in File_Mode)
+ Mode : File_Mode)
is
begin
-- Don't allow change of mode for current file (RM A.10.2(5))
@@ -1273,8 +1336,8 @@ package body Ada.Wide_Text_IO is
-------------
procedure Set_Col
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
ch : int;
@@ -1333,7 +1396,7 @@ package body Ada.Wide_Text_IO is
end if;
end Set_Col;
- procedure Set_Col (To : in Positive_Count) is
+ procedure Set_Col (To : Positive_Count) is
begin
Set_Col (Current_Out, To);
end Set_Col;
@@ -1342,7 +1405,7 @@ package body Ada.Wide_Text_IO is
-- Set_Error --
---------------
- procedure Set_Error (File : in File_Type) is
+ procedure Set_Error (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Err := File;
@@ -1352,7 +1415,7 @@ package body Ada.Wide_Text_IO is
-- Set_Input --
---------------
- procedure Set_Input (File : in File_Type) is
+ procedure Set_Input (File : File_Type) is
begin
FIO.Check_Read_Status (AP (File));
Current_In := File;
@@ -1363,8 +1426,8 @@ package body Ada.Wide_Text_IO is
--------------
procedure Set_Line
- (File : in File_Type;
- To : in Positive_Count)
+ (File : File_Type;
+ To : Positive_Count)
is
begin
-- Raise Constraint_Error if out of range value. The reason for this
@@ -1401,7 +1464,7 @@ package body Ada.Wide_Text_IO is
end if;
end Set_Line;
- procedure Set_Line (To : in Positive_Count) is
+ procedure Set_Line (To : Positive_Count) is
begin
Set_Line (Current_Out, To);
end Set_Line;
@@ -1410,7 +1473,7 @@ package body Ada.Wide_Text_IO is
-- Set_Line_Length --
---------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count) is
+ procedure Set_Line_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
@@ -1424,7 +1487,7 @@ package body Ada.Wide_Text_IO is
File.Line_Length := To;
end Set_Line_Length;
- procedure Set_Line_Length (To : in Count) is
+ procedure Set_Line_Length (To : Count) is
begin
Set_Line_Length (Current_Out, To);
end Set_Line_Length;
@@ -1433,7 +1496,7 @@ package body Ada.Wide_Text_IO is
-- Set_Output --
----------------
- procedure Set_Output (File : in File_Type) is
+ procedure Set_Output (File : File_Type) is
begin
FIO.Check_Write_Status (AP (File));
Current_Out := File;
@@ -1443,7 +1506,7 @@ package body Ada.Wide_Text_IO is
-- Set_Page_Length --
---------------------
- procedure Set_Page_Length (File : in File_Type; To : in Count) is
+ procedure Set_Page_Length (File : File_Type; To : Count) is
begin
-- Raise Constraint_Error if out of range value. The reason for this
-- explicit test is that we don't want junk values around, even if
@@ -1457,7 +1520,7 @@ package body Ada.Wide_Text_IO is
File.Page_Length := To;
end Set_Page_Length;
- procedure Set_Page_Length (To : in Count) is
+ procedure Set_Page_Length (To : Count) is
begin
Set_Page_Length (Current_Out, To);
end Set_Page_Length;
@@ -1497,8 +1560,8 @@ package body Ada.Wide_Text_IO is
---------------
procedure Skip_Line
- (File : in File_Type;
- Spacing : in Positive_Count := 1)
+ (File : File_Type;
+ Spacing : Positive_Count := 1)
is
ch : int;
@@ -1580,7 +1643,7 @@ package body Ada.Wide_Text_IO is
File.Before_Wide_Character := False;
end Skip_Line;
- procedure Skip_Line (Spacing : in Positive_Count := 1) is
+ procedure Skip_Line (Spacing : Positive_Count := 1) is
begin
Skip_Line (Current_In, Spacing);
end Skip_Line;
@@ -1589,7 +1652,7 @@ package body Ada.Wide_Text_IO is
-- Skip_Page --
---------------
- procedure Skip_Page (File : in File_Type) is
+ procedure Skip_Page (File : File_Type) is
ch : int;
begin
@@ -1741,7 +1804,7 @@ package body Ada.Wide_Text_IO is
procedure Write
(File : in out Wide_Text_AFCB;
- Item : in Stream_Element_Array)
+ Item : Stream_Element_Array)
is
Siz : constant size_t := Item'Length;
diff --git a/gcc/ada/a-witeio.ads b/gcc/ada/a-witeio.ads
index 662f5976b79..ee9dc8639ba 100644
--- a/gcc/ada/a-witeio.ads
+++ b/gcc/ada/a-witeio.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -89,34 +89,34 @@ package Ada.Wide_Text_IO is
procedure Create
(File : in out File_Type;
- Mode : in File_Mode := Out_File;
- Name : in String := "";
- Form : in String := "");
+ Mode : File_Mode := Out_File;
+ Name : String := "";
+ Form : String := "");
procedure Open
(File : in out File_Type;
- Mode : in File_Mode;
- Name : in String;
- Form : in String := "");
+ Mode : File_Mode;
+ Name : String;
+ Form : String := "");
procedure Close (File : in out File_Type);
procedure Delete (File : in out File_Type);
- procedure Reset (File : in out File_Type; Mode : in File_Mode);
+ procedure Reset (File : in out File_Type; Mode : File_Mode);
procedure Reset (File : in out File_Type);
- function Mode (File : in File_Type) return File_Mode;
- function Name (File : in File_Type) return String;
- function Form (File : in File_Type) return String;
+ function Mode (File : File_Type) return File_Mode;
+ function Name (File : File_Type) return String;
+ function Form (File : File_Type) return String;
- function Is_Open (File : in File_Type) return Boolean;
+ function Is_Open (File : File_Type) return Boolean;
------------------------------------------------------
-- Control of default input, output and error files --
------------------------------------------------------
- procedure Set_Input (File : in File_Type);
- procedure Set_Output (File : in File_Type);
- procedure Set_Error (File : in File_Type);
+ procedure Set_Input (File : File_Type);
+ procedure Set_Output (File : File_Type);
+ procedure Set_Error (File : File_Type);
function Standard_Input return File_Type;
function Standard_Output return File_Type;
@@ -143,76 +143,76 @@ package Ada.Wide_Text_IO is
-- Note: The paramter file is in out in the RM, but as pointed out
-- in <<95-5166.a Tucker Taft 95-6-23>> this is clearly an oversight.
- procedure Flush (File : in File_Type);
+ procedure Flush (File : File_Type);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
- procedure Set_Line_Length (File : in File_Type; To : in Count);
- procedure Set_Line_Length (To : in Count);
+ procedure Set_Line_Length (File : File_Type; To : Count);
+ procedure Set_Line_Length (To : Count);
- procedure Set_Page_Length (File : in File_Type; To : in Count);
- procedure Set_Page_Length (To : in Count);
+ procedure Set_Page_Length (File : File_Type; To : Count);
+ procedure Set_Page_Length (To : Count);
- function Line_Length (File : in File_Type) return Count;
+ function Line_Length (File : File_Type) return Count;
function Line_Length return Count;
- function Page_Length (File : in File_Type) return Count;
+ function Page_Length (File : File_Type) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
- procedure New_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure New_Line (Spacing : in Positive_Count := 1);
+ procedure New_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure New_Line (Spacing : Positive_Count := 1);
- procedure Skip_Line (File : in File_Type; Spacing : in Positive_Count := 1);
- procedure Skip_Line (Spacing : in Positive_Count := 1);
+ procedure Skip_Line (File : File_Type; Spacing : Positive_Count := 1);
+ procedure Skip_Line (Spacing : Positive_Count := 1);
- function End_Of_Line (File : in File_Type) return Boolean;
+ function End_Of_Line (File : File_Type) return Boolean;
function End_Of_Line return Boolean;
- procedure New_Page (File : in File_Type);
+ procedure New_Page (File : File_Type);
procedure New_Page;
- procedure Skip_Page (File : in File_Type);
+ procedure Skip_Page (File : File_Type);
procedure Skip_Page;
- function End_Of_Page (File : in File_Type) return Boolean;
+ function End_Of_Page (File : File_Type) return Boolean;
function End_Of_Page return Boolean;
- function End_Of_File (File : in File_Type) return Boolean;
+ function End_Of_File (File : File_Type) return Boolean;
function End_Of_File return Boolean;
- procedure Set_Col (File : in File_Type; To : in Positive_Count);
- procedure Set_Col (To : in Positive_Count);
+ procedure Set_Col (File : File_Type; To : Positive_Count);
+ procedure Set_Col (To : Positive_Count);
- procedure Set_Line (File : in File_Type; To : in Positive_Count);
- procedure Set_Line (To : in Positive_Count);
+ procedure Set_Line (File : File_Type; To : Positive_Count);
+ procedure Set_Line (To : Positive_Count);
- function Col (File : in File_Type) return Positive_Count;
+ function Col (File : File_Type) return Positive_Count;
function Col return Positive_Count;
- function Line (File : in File_Type) return Positive_Count;
+ function Line (File : File_Type) return Positive_Count;
function Line return Positive_Count;
- function Page (File : in File_Type) return Positive_Count;
+ function Page (File : File_Type) return Positive_Count;
function Page return Positive_Count;
----------------------------
-- Character Input-Output --
----------------------------
- procedure Get (File : in File_Type; Item : out Wide_Character);
+ procedure Get (File : File_Type; Item : out Wide_Character);
procedure Get (Item : out Wide_Character);
- procedure Put (File : in File_Type; Item : in Wide_Character);
- procedure Put (Item : in Wide_Character);
+ procedure Put (File : File_Type; Item : Wide_Character);
+ procedure Put (Item : Wide_Character);
procedure Look_Ahead
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
End_Of_Line : out Boolean);
@@ -221,14 +221,14 @@ package Ada.Wide_Text_IO is
End_Of_Line : out Boolean);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character);
procedure Get_Immediate
(Item : out Wide_Character);
procedure Get_Immediate
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_Character;
Available : out Boolean);
@@ -240,13 +240,13 @@ package Ada.Wide_Text_IO is
-- String Input-Output --
-------------------------
- procedure Get (File : in File_Type; Item : out Wide_String);
+ procedure Get (File : File_Type; Item : out Wide_String);
procedure Get (Item : out Wide_String);
- procedure Put (File : in File_Type; Item : in Wide_String);
- procedure Put (Item : in Wide_String);
+ procedure Put (File : File_Type; Item : Wide_String);
+ procedure Put (Item : Wide_String);
procedure Get_Line
- (File : in File_Type;
+ (File : File_Type;
Item : out Wide_String;
Last : out Natural);
@@ -254,12 +254,18 @@ package Ada.Wide_Text_IO is
(Item : out Wide_String;
Last : out Natural);
+ function Get_Line (File : File_Type) return Wide_String;
+ pragma Ada_05 (Get_Line);
+
+ function Get_Line return Wide_String;
+ pragma Ada_05 (Get_Line);
+
procedure Put_Line
- (File : in File_Type;
- Item : in Wide_String);
+ (File : File_Type;
+ Item : Wide_String);
procedure Put_Line
- (Item : in Wide_String);
+ (Item : Wide_String);
---------------------------------------
-- Generic packages for Input-Output --
@@ -398,7 +404,7 @@ private
procedure Write
(File : in out Wide_Text_AFCB;
- Item : in Ada.Streams.Stream_Element_Array);
+ Item : Ada.Streams.Stream_Element_Array);
-- Write operation used when Wide_Text_IO file is treated as a Stream
------------------------
@@ -440,7 +446,7 @@ private
-- occurs. The result is EOF if the end of file was read.
procedure Get_Character
- (File : in File_Type;
+ (File : File_Type;
Item : out Character);
-- This is essentially a copy of the normal Get routine from Text_IO. It
-- obtains a single character from the input file File, and places it in
@@ -449,8 +455,7 @@ private
function Get_Wide_Char
(C : Character;
- File : File_Type)
- return Wide_Character;
+ File : File_Type) return Wide_Character;
-- This function is shared by Get and Get_Immediate to extract a wide
-- character value from the given File. The first byte has already been
-- read and is passed in C. The wide character value is returned as the
diff --git a/gcc/ada/a-wtcoau.adb b/gcc/ada/a-wtcoau.adb
index 12d75dc685d..aecad0046bb 100644
--- a/gcc/ada/a-wtcoau.adb
+++ b/gcc/ada/a-wtcoau.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -45,7 +45,7 @@ package body Ada.Wide_Text_IO.Complex_Aux is
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Width : Field)
@@ -96,7 +96,7 @@ package body Ada.Wide_Text_IO.Complex_Aux is
----------
procedure Gets
- (From : in String;
+ (From : String;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Last : out Positive)
@@ -163,8 +163,8 @@ package body Ada.Wide_Text_IO.Complex_Aux is
(To : out String;
ItemR : Long_Long_Float;
ItemI : Long_Long_Float;
- Aft : in Field;
- Exp : in Field)
+ Aft : Field;
+ Exp : Field)
is
I_String : String (1 .. 3 * Field'Last);
R_String : String (1 .. 3 * Field'Last);
diff --git a/gcc/ada/a-wtcoau.ads b/gcc/ada/a-wtcoau.ads
index b6fc12152aa..95aa3459268 100644
--- a/gcc/ada/a-wtcoau.ads
+++ b/gcc/ada/a-wtcoau.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -42,7 +42,7 @@
package Ada.Wide_Text_IO.Complex_Aux is
procedure Get
- (File : in File_Type;
+ (File : File_Type;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Width : Field);
diff --git a/gcc/ada/a-wtcoio.adb b/gcc/ada/a-wtcoio.adb
index 024006445e0..bdac8ee5031 100644
--- a/gcc/ada/a-wtcoio.adb
+++ b/gcc/ada/a-wtcoio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,6 +32,7 @@
------------------------------------------------------------------------------
with Ada.Wide_Text_IO.Complex_Aux;
+
with System.WCh_Con; use System.WCh_Con;
with System.WCh_WtS; use System.WCh_WtS;
@@ -44,9 +45,6 @@ package body Ada.Wide_Text_IO.Complex_IO is
subtype LLF is Long_Long_Float;
-- Type used for calls to routines in Aux
--- subtype TFT is Ada.Wide_Text_IO.File_Type;
- -- File type required for calls to routines in Aux
-
function TFT is new
Ada.Unchecked_Conversion (File_Type, Ada.Wide_Text_IO.File_Type);
-- This unchecked conversion is to get around a visibility bug in
@@ -58,12 +56,12 @@ package body Ada.Wide_Text_IO.Complex_IO is
---------
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Complex;
- Width : in Field := 0)
+ Width : Field := 0)
is
- Real_Item : Real'Base;
- Imag_Item : Real'Base;
+ Real_Item : Real'Base;
+ Imag_Item : Real'Base;
begin
Aux.Get (TFT (File), LLF (Real_Item), LLF (Imag_Item), Width);
@@ -79,7 +77,7 @@ package body Ada.Wide_Text_IO.Complex_IO is
procedure Get
(Item : out Complex;
- Width : in Field := 0)
+ Width : Field := 0)
is
begin
Get (Current_Input, Item, Width);
@@ -90,7 +88,7 @@ package body Ada.Wide_Text_IO.Complex_IO is
---------
procedure Get
- (From : in Wide_String;
+ (From : Wide_String;
Item : out Complex;
Last : out Positive)
is
@@ -116,11 +114,11 @@ package body Ada.Wide_Text_IO.Complex_IO is
---------
procedure Put
- (File : in File_Type;
- Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp)
+ (File : File_Type;
+ Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp)
is
begin
Aux.Put (TFT (File), LLF (Re (Item)), LLF (Im (Item)), Fore, Aft, Exp);
@@ -131,10 +129,10 @@ package body Ada.Wide_Text_IO.Complex_IO is
---------
procedure Put
- (Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp)
+ (Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp)
is
begin
Put (Current_Output, Item, Fore, Aft, Exp);
@@ -146,9 +144,9 @@ package body Ada.Wide_Text_IO.Complex_IO is
procedure Put
(To : out Wide_String;
- Item : in Complex;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp)
+ Item : Complex;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp)
is
S : String (To'First .. To'Last);
diff --git a/gcc/ada/a-wtcoio.ads b/gcc/ada/a-wtcoio.ads
index 96c0a2a5b00..14bf5e76ca3 100644
--- a/gcc/ada/a-wtcoio.ads
+++ b/gcc/ada/a-wtcoio.ads
@@ -27,36 +27,36 @@ package Ada.Wide_Text_IO.Complex_IO is
Default_Exp : Field := 3;
procedure Get
- (File : in File_Type;
+ (File : File_Type;
Item : out Complex;
- Width : in Field := 0);
+ Width : Field := 0);
procedure Get
(Item : out Complex;
- Width : in Field := 0);
+ Width : Field := 0);
procedure Put
- (File : in File_Type;
- Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp);
+ (File : File_Type;
+ Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp);
procedure Put
- (Item : in Complex;
- Fore : in Field := Default_Fore;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp);
+ (Item : Complex;
+ Fore : Field := Default_Fore;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp);
procedure Get
- (From : in Wide_String;
+ (From : Wide_String;
Item : out Complex;
Last : out Positive);
procedure Put
(To : out Wide_String;
- Item : in Complex;
- Aft : in Field := Default_Aft;
- Exp : in Field := Default_Exp);
+ Item : Complex;
+ Aft : Field := Default_Aft;
+ Exp : Field := Default_Exp);
end Ada.Wide_Text_IO.Complex_IO;
diff --git a/gcc/ada/a-wtedit.adb b/gcc/ada/a-wtedit.adb
index ab7e9643c1d..2f0f4fb994f 100644
--- a/gcc/ada/a-wtedit.adb
+++ b/gcc/ada/a-wtedit.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -69,13 +69,12 @@ package body Ada.Wide_Text_IO.Editing is
-----------
function Image
- (Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
- return Wide_String
+ (Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark) return Wide_String
is
begin
return Format_Number
@@ -88,9 +87,8 @@ package body Ada.Wide_Text_IO.Editing is
------------
function Length
- (Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Natural
+ (Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Natural
is
Picstr : constant String := Pic_String (Pic);
V_Adjust : Integer := 0;
@@ -122,13 +120,13 @@ package body Ada.Wide_Text_IO.Editing is
---------
procedure Put
- (File : in Wide_Text_IO.File_Type;
- Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
+ (File : Wide_Text_IO.File_Type;
+ Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark)
is
begin
Wide_Text_IO.Put (File, Image (Item, Pic,
@@ -136,12 +134,12 @@ package body Ada.Wide_Text_IO.Editing is
end Put;
procedure Put
- (Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
+ (Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark)
is
begin
Wide_Text_IO.Put (Image (Item, Pic,
@@ -150,12 +148,12 @@ package body Ada.Wide_Text_IO.Editing is
procedure Put
(To : out Wide_String;
- Item : in Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
+ Item : Num;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark)
is
Result : constant Wide_String :=
Image (Item, Pic, Currency, Fill, Separator, Radix_Mark);
@@ -175,15 +173,13 @@ package body Ada.Wide_Text_IO.Editing is
function Valid
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Boolean
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Boolean
is
begin
declare
Temp : constant Wide_String := Image (Item, Pic, Currency);
pragma Warnings (Off, Temp);
-
begin
return True;
end;
@@ -192,7 +188,6 @@ package body Ada.Wide_Text_IO.Editing is
when Layout_Error => return False;
end Valid;
-
end Decimal_Output;
------------
@@ -220,11 +215,11 @@ package body Ada.Wide_Text_IO.Editing is
when '(' =>
- -- We now need to scan out the count after a left paren.
- -- In the non-wide version we used Integer_IO.Get, but
- -- that is not convenient here, since we don't want to
- -- drag in normal Text_IO just for this purpose. So we
- -- do the scan ourselves, with the normal validity checks.
+ -- We now need to scan out the count after a left paren. In
+ -- the non-wide version we used Integer_IO.Get, but that is
+ -- not convenient here, since we don't want to drag in normal
+ -- Text_IO just for this purpose. So we do the scan ourselves,
+ -- with the normal validity checks.
Last := Picture_Index + 1;
Count := 0;
@@ -262,7 +257,7 @@ package body Ada.Wide_Text_IO.Editing is
end loop;
-- In what follows note that one copy of the repeated
- -- character has already been made, so a count of one is a
+ -- character has already been made, so a count of one is
-- no-op, and a count of zero erases a character.
for J in 2 .. Count loop
@@ -293,7 +288,6 @@ package body Ada.Wide_Text_IO.Editing is
exception
when others =>
raise Picture_Error;
-
end Expand;
-------------------
@@ -306,8 +300,7 @@ package body Ada.Wide_Text_IO.Editing is
Currency_Symbol : Wide_String;
Fill_Character : Wide_Character;
Separator_Character : Wide_Character;
- Radix_Point : Wide_Character)
- return Wide_String
+ Radix_Point : Wide_Character) return Wide_String
is
Attrs : Number_Attributes := Parse_Number_String (Number);
Position : Integer;
@@ -368,8 +361,8 @@ package body Ada.Wide_Text_IO.Editing is
end loop;
-- The rounding may add a digit in front. Either the
- -- leading blank or the sign (already captured) can
- -- be overwritten.
+ -- leading blank or the sign (already captured) can be
+ -- overwritten.
if R_Pos = 1 then
Rounded (R_Pos) := '1';
@@ -421,7 +414,7 @@ package body Ada.Wide_Text_IO.Editing is
for J in reverse Last .. Answer'Last loop
exit when J = Pic.Radix_Position;
- -- Do this test First, Separator_Character can equal Pic.Floater.
+ -- Do this test First, Separator_Character can equal Pic.Floater
if Answer (J) = Pic.Floater then
exit;
@@ -547,7 +540,7 @@ package body Ada.Wide_Text_IO.Editing is
or else
Pic.Floater = '-'
then
- for J in Pic.End_Float .. Position loop -- May be null range.
+ for J in Pic.End_Float .. Position loop -- May be null range
if Answer (J) = '9' then
Answer (J) := '0';
@@ -573,12 +566,12 @@ package body Ada.Wide_Text_IO.Editing is
elsif Pic.Floater = '$' then
- for J in Pic.End_Float .. Position loop -- May be null range.
+ for J in Pic.End_Float .. Position loop -- May be null range
if Answer (J) = '9' then
Answer (J) := '0';
elsif Answer (J) = '_' then
- Answer (J) := ' '; -- no separator before leftmost digit.
+ Answer (J) := ' '; -- no separator before leftmost digit
elsif Answer (J) = 'b' then
Answer (J) := ' ';
@@ -598,7 +591,7 @@ package body Ada.Wide_Text_IO.Editing is
elsif Pic.Floater = '*' then
- for J in Pic.End_Float .. Position loop -- May be null range.
+ for J in Pic.End_Float .. Position loop -- May be null range
if Answer (J) = '9' then
Answer (J) := '0';
@@ -1013,7 +1006,6 @@ package body Ada.Wide_Text_IO.Editing is
return Answer;
end if;
-
end Format_Number;
-------------------------
@@ -1094,7 +1086,6 @@ package body Ada.Wide_Text_IO.Editing is
-- No significant (intger) digits needs a null range.
return Answer;
-
end Parse_Number_String;
----------------
@@ -2713,9 +2704,8 @@ package body Ada.Wide_Text_IO.Editing is
----------------
function To_Picture
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Picture
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Picture
is
Result : Picture;
@@ -2751,9 +2741,8 @@ package body Ada.Wide_Text_IO.Editing is
-----------
function Valid
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Boolean
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Boolean
is
begin
declare
@@ -2777,7 +2766,6 @@ package body Ada.Wide_Text_IO.Editing is
exception
when others => return False;
-
end Valid;
end Ada.Wide_Text_IO.Editing;
diff --git a/gcc/ada/a-wtedit.ads b/gcc/ada/a-wtedit.ads
index 06e30a75eb0..6605d59d6d9 100644
--- a/gcc/ada/a-wtedit.ads
+++ b/gcc/ada/a-wtedit.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -40,14 +40,12 @@ package Ada.Wide_Text_IO.Editing is
type Picture is private;
function Valid
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Boolean;
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Boolean;
function To_Picture
- (Pic_String : in String;
- Blank_When_Zero : in Boolean := False)
- return Picture;
+ (Pic_String : String;
+ Blank_When_Zero : Boolean := False) return Picture;
function Pic_String (Pic : in Picture) return String;
function Blank_When_Zero (Pic : in Picture) return Boolean;
@@ -63,62 +61,59 @@ package Ada.Wide_Text_IO.Editing is
generic
type Num is delta <> digits <>;
- Default_Currency : in Wide_String :=
+ Default_Currency : Wide_String :=
Wide_Text_IO.Editing.Default_Currency;
- Default_Fill : in Wide_Character :=
+ Default_Fill : Wide_Character :=
Wide_Text_IO.Editing.Default_Fill;
- Default_Separator : in Wide_Character :=
+ Default_Separator : Wide_Character :=
Wide_Text_IO.Editing.Default_Separator;
- Default_Radix_Mark : in Wide_Character :=
+ Default_Radix_Mark : Wide_Character :=
Wide_Text_IO.Editing.Default_Radix_Mark;
package Decimal_Output is
function Length
- (Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Natural;
+ (Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Natural;
function Valid
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency)
- return Boolean;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency) return Boolean;
function Image
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark)
- return Wide_String;
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark) return Wide_String;
procedure Put
- (File : in File_Type;
+ (File : File_Type;
Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark);
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark);
procedure Put
(Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark);
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark);
procedure Put
(To : out Wide_String;
Item : Num;
- Pic : in Picture;
- Currency : in Wide_String := Default_Currency;
- Fill : in Wide_Character := Default_Fill;
- Separator : in Wide_Character := Default_Separator;
- Radix_Mark : in Wide_Character := Default_Radix_Mark);
+ Pic : Picture;
+ Currency : Wide_String := Default_Currency;
+ Fill : Wide_Character := Default_Fill;
+ Separator : Wide_Character := Default_Separator;
+ Radix_Mark : Wide_Character := Default_Radix_Mark);
end Decimal_Output;
@@ -196,8 +191,7 @@ private
Currency_Symbol : Wide_String;
Fill_Character : Wide_Character;
Separator_Character : Wide_Character;
- Radix_Point : Wide_Character)
- return Wide_String;
+ Radix_Point : Wide_Character) return Wide_String;
-- Formats number according to Pic
function Expand (Picture : in String) return String;
diff --git a/gcc/ada/a-wttest.adb b/gcc/ada/a-wttest.adb
index af0db6cf13f..8e925f11ca4 100644
--- a/gcc/ada/a-wttest.adb
+++ b/gcc/ada/a-wttest.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,7 +39,7 @@ package body Ada.Wide_Text_IO.Text_Streams is
-- Stream --
------------
- function Stream (File : in File_Type) return Stream_Access is
+ function Stream (File : File_Type) return Stream_Access is
begin
System.File_IO.Check_File_Open (FCB.AFCB_Ptr (File));
return Stream_Access (File);
diff --git a/gcc/ada/a-wttest.ads b/gcc/ada/a-wttest.ads
index be43e0aac40..c209e0e401d 100644
--- a/gcc/ada/a-wttest.ads
+++ b/gcc/ada/a-wttest.ads
@@ -19,6 +19,6 @@ package Ada.Wide_Text_IO.Text_Streams is
type Stream_Access is access all Streams.Root_Stream_Type'Class;
- function Stream (File : in File_Type) return Stream_Access;
+ function Stream (File : File_Type) return Stream_Access;
end Ada.Wide_Text_IO.Text_Streams;
diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h
index fde996972c9..fad1513ab8f 100644
--- a/gcc/ada/ada-tree.h
+++ b/gcc/ada/ada-tree.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2004 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005 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- *
@@ -64,7 +64,8 @@ struct lang_type GTY(()) {tree t; };
/* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a
record being used as a fat pointer (only true for RECORD_TYPE). */
-#define TYPE_IS_FAT_POINTER_P(NODE) TYPE_LANG_FLAG_0 (NODE)
+#define TYPE_IS_FAT_POINTER_P(NODE) \
+ TYPE_LANG_FLAG_0 (RECORD_OR_UNION_CHECK (NODE))
#define TYPE_FAT_POINTER_P(NODE) \
(TREE_CODE (NODE) == RECORD_TYPE && TYPE_IS_FAT_POINTER_P (NODE))
@@ -159,6 +160,9 @@ struct lang_type GTY(()) {tree t; };
padding or alignment. */
#define TYPE_IS_PADDING_P(NODE) TYPE_LANG_FLAG_5 (RECORD_TYPE_CHECK (NODE))
+/* For a UNION_TYPE, nonzero if this is an unchecked union. */
+#define TYPE_UNCHECKED_UNION_P(NODE) TYPE_LANG_FLAG_6 (UNION_TYPE_CHECK (NODE))
+
/* This field is only defined for FUNCTION_TYPE nodes. If the Ada
subprogram contains no parameters passed by copy in/copy out then this
field is 0. Otherwise it points to a list of nodes used to specify the
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 8ed3b40fe18..f94f3bfb5f2 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -277,6 +277,37 @@ int max_path_len = GNAT_MAX_PATH_LEN;
system provides the routine readdir_r. */
#undef HAVE_READDIR_R
+#if defined(VMS) && defined (__LONG_POINTERS)
+
+/* Return a 32 bit pointer to an array of 32 bit pointers
+ given a 64 bit pointer to an array of 64 bit pointers */
+
+typedef __char_ptr32 *__char_ptr_char_ptr32 __attribute__ ((mode (SI)));
+
+static __char_ptr_char_ptr32
+to_ptr32 (char **ptr64)
+{
+ int argc;
+ __char_ptr_char_ptr32 short_argv;
+
+ for (argc=0; ptr64[argc]; argc++);
+
+ /* Reallocate argv with 32 bit pointers. */
+ short_argv = (__char_ptr_char_ptr32) decc$malloc
+ (sizeof (__char_ptr32) * (argc + 1));
+
+ for (argc=0; ptr64[argc]; argc++)
+ short_argv[argc] = (__char_ptr32) decc$strdup (ptr64[argc]);
+
+ short_argv[argc] = (__char_ptr32) 0;
+ return short_argv;
+
+}
+#define MAYBE_TO_PTR32(argv) to_ptr32 (argv)
+#else
+#define MAYBE_TO_PTR32(argv) argv
+#endif
+
void
__gnat_to_gm_time
(OS_Time *p_time,
@@ -1213,13 +1244,13 @@ static char *to_host_path_spec (char *);
struct descriptor_s
{
unsigned short len, mbz;
- char *adr;
+ __char_ptr32 adr;
};
typedef struct _ile3
{
unsigned short len, code;
- char *adr;
+ __char_ptr32 adr;
unsigned short *retlen_adr;
} ile_s;
@@ -1524,17 +1555,6 @@ __gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
#endif
}
-#ifdef VMS
-/* Defined in VMS header files. */
-#if defined (__ALPHA)
-#define fork() (decc$$alloc_vfork_blocks() >= 0 ? \
- LIB$GET_CURRENT_INVO_CONTEXT (decc$$get_vfork_jmpbuf()) : -1)
-#elif defined (__IA64)
-#define fork() (decc$$alloc_vfork_blocks() >= 0 ? \
- LIB$I64_GET_CURR_INVO_CONTEXT(decc$$get_vfork_jmpbuf()) : -1)
-#endif
-#endif
-
#if defined (sun) && defined (__SVR4)
/* Using fork on Solaris will duplicate all the threads. fork1, which
duplicates only the active thread, must be used instead, or spawning
@@ -1585,7 +1605,7 @@ __gnat_portable_spawn (char *args[])
if (pid == 0)
{
/* The child. */
- if (execv (args[0], args) != 0)
+ if (execv (args[0], MAYBE_TO_PTR32 (args)) != 0)
#if defined (VMS)
return -1; /* execv is in parent context on VMS. */
#else
@@ -1866,7 +1886,7 @@ __gnat_portable_no_block_spawn (char *args[])
if (pid == 0)
{
/* The child. */
- if (execv (args[0], args) != 0)
+ if (execv (args[0], MAYBE_TO_PTR32 (args)) != 0)
#if defined (VMS)
return -1; /* execv is in parent context on VMS. */
#else
@@ -2593,3 +2613,24 @@ get_gcc_version (void)
{
return 3;
}
+
+int
+__gnat_set_close_on_exec (int fd, int close_on_exec_p)
+{
+#if defined (F_GETFD) && defined (FD_CLOEXEC) && ! defined (__vxworks)
+ int flags = fcntl (fd, F_GETFD, 0);
+ if (flags < 0)
+ return flags;
+ if (close_on_exec_p)
+ flags |= FD_CLOEXEC;
+ else
+ flags &= ~FD_CLOEXEC;
+ return fcntl (fd, F_SETFD, flags | FD_CLOEXEC);
+#else
+ return -1;
+ /* For the Windows case, we should use SetHandleInformation to remove
+ the HANDLE_INHERIT property from fd. This is not implemented yet,
+ but for our purposes (support of GNAT.Expect) this does not matter,
+ as by default handles are *not* inherited. */
+#endif
+}
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 542b1c12cf9..cf7e4032f4a 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2004 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005 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- *
@@ -149,6 +149,7 @@ extern void __gnat_set_binary_mode (int);
extern void __gnat_set_text_mode (int);
extern char *__gnat_ttyname (int);
extern int __gnat_lseek (int, long, int);
+extern int __gnat_set_close_on_exec (int, int);
extern int __gnat_dup (int);
extern int __gnat_dup2 (int, int);
diff --git a/gcc/ada/ali-util.adb b/gcc/ada/ali-util.adb
index 1bf114a59e6..518d1df8a83 100644
--- a/gcc/ada/ali-util.adb
+++ b/gcc/ada/ali-util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -291,8 +291,8 @@ package body ALI.Util is
-- set the Interface flag in the Withs table, so that its
-- dependant are not considered for elaboration order.
- if ALIs.Table (Idread).Interface then
- Withs.Table (W).Interface := True;
+ if ALIs.Table (Idread).SAL_Interface then
+ Withs.Table (W).SAL_Interface := True;
Interface_Library_Unit := True;
-- Set the entry in the Interfaces hash table, so that other
@@ -313,7 +313,7 @@ package body ALI.Util is
-- set the flag in the entry of the Withs table.
elsif Interface_Library_Unit and then Interfaces.Get (Afile) then
- Withs.Table (W).Interface := True;
+ Withs.Table (W).SAL_Interface := True;
end if;
end loop;
end loop;
diff --git a/gcc/ada/ali.adb b/gcc/ada/ali.adb
index 0f182055571..4c8a08b05a8 100644
--- a/gcc/ada/ali.adb
+++ b/gcc/ada/ali.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -654,6 +654,7 @@ package body ALI is
Ofile_Full_Name => Full_Object_File_Name,
Queuing_Policy => ' ',
Restrictions => Restrictions_Initial,
+ SAL_Interface => False,
Sfile => No_Name,
Task_Dispatching_Policy => ' ',
Time_Slice_Value => -1,
@@ -661,7 +662,6 @@ package body ALI is
Unit_Exception_Table => False,
Ver => (others => ' '),
Ver_Len => 0,
- Interface => False,
Zero_Cost_Exceptions => False);
-- Now we acquire the input lines from the ALI file. Note that the
@@ -878,7 +878,7 @@ package body ALI is
-- Processing for SL
if C = 'L' then
- ALIs.Table (Id).Interface := True;
+ ALIs.Table (Id).SAL_Interface := True;
-- Processing for SS
@@ -1194,7 +1194,8 @@ package body ALI is
Units.Table (Units.Last).First_With := Withs.Last + 1;
Units.Table (Units.Last).First_Arg := First_Arg;
Units.Table (Units.Last).Elab_Position := 0;
- Units.Table (Units.Last).Interface := ALIs.Table (Id).Interface;
+ Units.Table (Units.Last).SAL_Interface := ALIs.Table (Id).
+ SAL_Interface;
Units.Table (Units.Last).Body_Needed_For_SAL := False;
if Debug_Flag_U then
@@ -1290,7 +1291,6 @@ package body ALI is
Fatal_Error_Ignore;
end if;
-
-- DE parameter (Dynamic elaboration checks)
elsif C = 'D' then
@@ -1376,7 +1376,6 @@ package body ALI is
Fatal_Error_Ignore;
end if;
-
-- PR/PU/PK parameters
elsif C = 'P' then
@@ -1459,7 +1458,7 @@ package body ALI is
Withs.Table (Withs.Last).Elaborate := False;
Withs.Table (Withs.Last).Elaborate_All := False;
Withs.Table (Withs.Last).Elab_All_Desirable := False;
- Withs.Table (Withs.Last).Interface := False;
+ Withs.Table (Withs.Last).SAL_Interface := False;
-- Generic case with no object file available
diff --git a/gcc/ada/ali.ads b/gcc/ada/ali.ads
index 48b1732f315..cab4b062365 100644
--- a/gcc/ada/ali.ads
+++ b/gcc/ada/ali.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -103,7 +103,7 @@ package ALI is
-- Length of characters stored in Ver. Not set if V lines are
-- ignored as a result of the Ignore_Lines parameter.
- Interface : Boolean;
+ SAL_Interface : Boolean;
-- Set True when this is an interface to a standalone library
First_Unit : Unit_Id;
@@ -332,7 +332,7 @@ package ALI is
-- Set True if IS qualifier appears in ALI file, indicating that
-- an Initialize_Scalars pragma applies to the unit.
- Interface : Boolean;
+ SAL_Interface : Boolean;
-- Set True when this is an interface to a standalone library
Body_Needed_For_SAL : Boolean;
@@ -475,7 +475,7 @@ package ALI is
Elab_All_Desirable : Boolean;
-- Indicates presence of ED parameter
- Interface : Boolean := False;
+ SAL_Interface : Boolean := False;
-- True if the Unit is an Interface of a Stand-Alone Library
end record;
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index 149203a5ca8..8122d85068c 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -191,7 +191,7 @@ package body Atree is
Unchecked_Conversion (Union_Id_Ptr, Flag_Word2_Ptr);
-- The following declarations are used to store flags 152-183 in the
- -- Field12 field of the fourth component of an extended (entity) node.
+ -- Field11 field of the fourth component of an extended (entity) node.
type Flag_Word3 is record
Flag152 : Boolean;
@@ -2960,11 +2960,16 @@ package body Atree is
return String_Id (Nodes.Table (N).Field3);
end Str3;
- function Char_Code2 (N : Node_Id) return Char_Code is
- begin
+ function Uint2 (N : Node_Id) return Uint is
pragma Assert (N in Nodes.First .. Nodes.Last);
- return Char_Code (Nodes.Table (N).Field2 - Char_Code_Bias);
- end Char_Code2;
+ U : constant Union_Id := Nodes.Table (N).Field2;
+ begin
+ if U = 0 then
+ return Uint_0;
+ else
+ return From_Union (U);
+ end if;
+ end Uint2;
function Uint3 (N : Node_Id) return Uint is
pragma Assert (N in Nodes.First .. Nodes.Last);
@@ -4858,6 +4863,12 @@ package body Atree is
Nodes.Table (N).Field3 := Union_Id (Val);
end Set_Str3;
+ procedure Set_Uint2 (N : Node_Id; Val : Uint) is
+ begin
+ pragma Assert (N in Nodes.First .. Nodes.Last);
+ Nodes.Table (N).Field2 := To_Union (Val);
+ end Set_Uint2;
+
procedure Set_Uint3 (N : Node_Id; Val : Uint) is
begin
pragma Assert (N in Nodes.First .. Nodes.Last);
@@ -4960,12 +4971,6 @@ package body Atree is
Nodes.Table (N + 3).Field8 := To_Union (Val);
end Set_Ureal21;
- procedure Set_Char_Code2 (N : Node_Id; Val : Char_Code) is
- begin
- pragma Assert (N in Nodes.First .. Nodes.Last);
- Nodes.Table (N).Field2 := Union_Id (Val) + Char_Code_Bias;
- end Set_Char_Code2;
-
procedure Set_Flag4 (N : Node_Id; Val : Boolean) is
begin
pragma Assert (N in Nodes.First .. Nodes.Last);
diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads
index aeee0f5ec6e..8b08b524a1f 100644
--- a/gcc/ada/atree.ads
+++ b/gcc/ada/atree.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -124,7 +124,6 @@ package Atree is
-- Field4
-- Field5 Five fields holding Union_Id values
- -- Char_CodeN Synonym for FieldN typed as Char_Code
-- ElistN Synonym for FieldN typed as Elist_Id
-- ListN Synonym for FieldN typed as List_Id
-- NameN Synonym for FieldN typed as Name_Id
@@ -133,14 +132,14 @@ package Atree is
-- UintN Synonym for FieldN typed as Uint (Empty = Uint_0)
-- UrealN Synonym for FieldN typed as Ureal
- -- Note: the actual usage of FieldN (i.e. whether it contains a Char_Code,
- -- Elist_Id, List_Id, Name_Id, Node_Id, String_Id, Uint or Ureal), depends
- -- on the value in Nkind. Generally the access to this field is always via
- -- the functional interface, so the field names Char_CodeN, ElistN, ListN,
- -- NameN, NodeN, StrN, UintN and UrealN are used only in the bodies of the
- -- access functions (i.e. in the bodies of Sinfo and Einfo). These access
- -- functions contain debugging code that checks that the use is consistent
- -- with Nkind and Ekind values.
+ -- Note: the actual usage of FieldN (i.e. whether it contains a Elist_Id,
+ -- List_Id, Name_Id, Node_Id, String_Id, Uint or Ureal), depends on the
+ -- value in Nkind. Generally the access to this field is always via the
+ -- functional interface, so the field names ElistN, ListN, NameN, NodeN,
+ -- StrN, UintN and UrealN are used only in the bodies of the access
+ -- functions (i.e. in the bodies of Sinfo and Einfo). These access
+ -- functions contain debugging code that checks that the use is
+ -- consistent with Nkind and Ekind values.
-- However, in specialized circumstances (examples are the circuit in
-- generic instantiation to copy trees, and in the tree dump routine),
@@ -988,9 +987,6 @@ package Atree is
function Name2 (N : Node_Id) return Name_Id;
pragma Inline (Name2);
- function Char_Code2 (N : Node_Id) return Char_Code;
- pragma Inline (Char_Code2);
-
function Str3 (N : Node_Id) return String_Id;
pragma Inline (Str3);
@@ -999,6 +995,9 @@ package Atree is
-- Uint_0 is returned. This avoids the rather tricky requirement
-- of initializing all Uint fields in nodes and entities.
+ function Uint2 (N : Node_Id) return Uint;
+ pragma Inline (Uint2);
+
function Uint3 (N : Node_Id) return Uint;
pragma Inline (Uint3);
@@ -1910,12 +1909,12 @@ package Atree is
procedure Set_Name2 (N : Node_Id; Val : Name_Id);
pragma Inline (Set_Name2);
- procedure Set_Char_Code2 (N : Node_Id; Val : Char_Code);
- pragma Inline (Set_Char_Code2);
-
procedure Set_Str3 (N : Node_Id; Val : String_Id);
pragma Inline (Set_Str3);
+ procedure Set_Uint2 (N : Node_Id; Val : Uint);
+ pragma Inline (Set_Uint2);
+
procedure Set_Uint3 (N : Node_Id; Val : Uint);
pragma Inline (Set_Uint3);
@@ -2780,9 +2779,9 @@ package Atree is
Field4 : Union_Id;
Field5 : Union_Id;
-- Five general use fields, which can contain Node_Id, List_Id,
- -- Elist_Id, String_Id, Name_Id, or Char_Code values depending
- -- on the values in Nkind and (for extended nodes), in Ekind.
- -- See packages Sinfo and Einfo for details of their use.
+ -- Elist_Id, String_Id, or Name_Id values depending on the
+ -- values in Nkind and (for extended nodes), in Ekind. See
+ -- packages Sinfo and Einfo for details of their use.
-- Extension (second component) of extended node
diff --git a/gcc/ada/atree.h b/gcc/ada/atree.h
index 3c40799f4bb..0d06969467e 100644
--- a/gcc/ada/atree.h
+++ b/gcc/ada/atree.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2003, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -216,6 +216,46 @@ struct Flag_Word3
Boolean flag183 : 1;
};
+/* Structure used for extra flags in fifth component overlaying Field11 */
+struct Flag_Word4
+{
+ Boolean flag184 : 1;
+ Boolean flag185 : 1;
+ Boolean flag186 : 1;
+ Boolean flag187 : 1;
+ Boolean flag188 : 1;
+ Boolean flag189 : 1;
+ Boolean flag190 : 1;
+ Boolean flag191 : 1;
+
+ Boolean flag192 : 1;
+ Boolean flag193 : 1;
+ Boolean flag194 : 1;
+ Boolean flag195 : 1;
+ Boolean flag196 : 1;
+ Boolean flag197 : 1;
+ Boolean flag198 : 1;
+ Boolean flag199 : 1;
+
+ Boolean flag200 : 1;
+ Boolean flag201 : 1;
+ Boolean flag202 : 1;
+ Boolean flag203 : 1;
+ Boolean flag204 : 1;
+ Boolean flag205 : 1;
+ Boolean flag206 : 1;
+ Boolean flag207 : 1;
+
+ Boolean flag208 : 1;
+ Boolean flag209 : 1;
+ Boolean flag210 : 1;
+ Boolean flag211 : 1;
+ Boolean flag212 : 1;
+ Boolean flag213 : 1;
+ Boolean flag214 : 1;
+ Boolean flag215 : 1;
+};
+
struct Non_Extended
{
Source_Ptr sloc;
@@ -238,14 +278,15 @@ struct Extended
union
{
Int field11;
- struct Flag_Word3 fw3;
+ struct Flag_Word3 fw3;
+ struct Flag_Word4 fw4;
} X;
union
{
Int field12;
- struct Flag_Word fw;
- struct Flag_Word2 fw2;
+ struct Flag_Word fw;
+ struct Flag_Word2 fw2;
} U;
};
@@ -272,7 +313,6 @@ struct Node
that Node_Id values can be used as subscripts. */
extern struct Node *Nodes_Ptr;
-
#define Parent atree__parent
extern Node_Id Parent (Node_Id);
@@ -338,6 +378,10 @@ extern Node_Id Current_Error_Node;
#define Field21(N) (Nodes_Ptr[(N) - First_Node_Id + 3].V.EX.field8)
#define Field22(N) (Nodes_Ptr[(N) - First_Node_Id + 3].V.EX.field9)
#define Field23(N) (Nodes_Ptr[(N) - First_Node_Id + 3].V.EX.field10)
+#define Field24(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field6)
+#define Field25(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field7)
+#define Field26(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field8)
+#define Field27(N) (Nodes_Ptr[(N) - First_Node_Id + 3].V.EX.field9)
#define Node1(N) Field1 (N)
#define Node2(N) Field2 (N)
@@ -362,6 +406,10 @@ extern Node_Id Current_Error_Node;
#define Node21(N) Field21 (N)
#define Node22(N) Field22 (N)
#define Node23(N) Field23 (N)
+#define Node24(N) Field24 (N)
+#define Node25(N) Field25 (N)
+#define Node26(N) Field26 (N)
+#define Node27(N) Field27 (N)
#define List1(N) Field1 (N)
#define List2(N) Field2 (N)
@@ -388,6 +436,7 @@ extern Node_Id Current_Error_Node;
#define Str3(N) Field3 (N)
+#define Uint2(N) ((Field2 (N) == 0) ? Uint_0 : Field2 (N))
#define Uint3(N) ((Field3 (N) == 0) ? Uint_0 : Field3 (N))
#define Uint4(N) ((Field4 (N) == 0) ? Uint_0 : Field4 (N))
#define Uint5(N) ((Field5 (N) == 0) ? Uint_0 : Field5 (N))
@@ -599,3 +648,36 @@ extern Node_Id Current_Error_Node;
#define Flag181(N) (Nodes_Ptr[(N) - First_Node_Id + 3].V.EX.X.fw3.flag181)
#define Flag182(N) (Nodes_Ptr[(N) - First_Node_Id + 3].V.EX.X.fw3.flag182)
#define Flag183(N) (Nodes_Ptr[(N) - First_Node_Id + 3].V.EX.X.fw3.flag183)
+
+#define Flag184(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag184)
+#define Flag185(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag185)
+#define Flag186(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag186)
+#define Flag187(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag187)
+#define Flag188(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag188)
+#define Flag189(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag189)
+#define Flag190(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag190)
+#define Flag191(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag191)
+#define Flag192(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag192)
+#define Flag193(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag193)
+#define Flag194(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag194)
+#define Flag195(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag195)
+#define Flag196(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag196)
+#define Flag197(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag197)
+#define Flag198(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag198)
+#define Flag199(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag199)
+#define Flag200(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag200)
+#define Flag201(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag201)
+#define Flag202(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag202)
+#define Flag203(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag203)
+#define Flag204(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag204)
+#define Flag205(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag205)
+#define Flag206(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag206)
+#define Flag207(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag207)
+#define Flag208(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag208)
+#define Flag209(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag209)
+#define Flag210(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag210)
+#define Flag211(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag211)
+#define Flag212(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag212)
+#define Flag213(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag213)
+#define Flag214(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag214)
+#define Flag215(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.fw4.flag215)
diff --git a/gcc/ada/binde.adb b/gcc/ada/binde.adb
index d90c75ee064..cc40af1964d 100644
--- a/gcc/ada/binde.adb
+++ b/gcc/ada/binde.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -770,7 +770,7 @@ package body Binde is
-- Skip also if no ALI file for this with, happens with certain
-- specialized generic files that do not get compiled.
- if not Withs.Table (W).Interface
+ if not Withs.Table (W).SAL_Interface
and then Withs.Table (W).Afile /= No_File
and then Generic_Separately_Compiled (Withs.Table (W).Sfile)
then
@@ -1011,7 +1011,7 @@ package body Binde is
-- there is a body and a spec, then spec must be elaborated first
-- Note that the corresponding spec immediately follows the body
- if not Units.Table (U).Interface
+ if not Units.Table (U).SAL_Interface
and then Units.Table (U).Utype = Is_Body
then
Build_Link (Corresponding_Spec (U), U, Spec_First);
@@ -1021,12 +1021,12 @@ package body Binde is
-- process WITH references for this unit ignoring generic units and
-- interfaces to stand-alone libraries.
- if not Units.Table (U).Interface then
+ if not Units.Table (U).SAL_Interface then
for
W in Units.Table (U).First_With .. Units.Table (U).Last_With
loop
if Withs.Table (W).Sfile /= No_File
- and then (not Withs.Table (W).Interface)
+ and then (not Withs.Table (W).SAL_Interface)
then
-- Check for special case of withing a unit that does not
-- exist any more. If the unit was completely missing we
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index d2e0652fb79..49d73c4bcc2 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -390,7 +390,7 @@ package body Bindgen is
-- Don't generate reference for stand alone library
- and then not U.Interface
+ and then not U.SAL_Interface
-- Don't generate reference for predefined file in No_Run_Time
-- mode, since we don't include the object files in this case
@@ -715,7 +715,7 @@ package body Bindgen is
-- Don't generate reference for stand alone library
- and then not U.Interface
+ and then not U.SAL_Interface
-- Don't generate reference for predefined file in No_Run_Time
-- mode, since we don't include the object files in this case
@@ -979,7 +979,7 @@ package body Bindgen is
-- to True, we do not need to test if this has already been
-- done, since it is quicker to set the flag than to test it.
- if not U.Interface and then U.Utype = Is_Body
+ if not U.SAL_Interface and then U.Utype = Is_Body
and then Units.Table (Unum_Spec).Set_Elab_Entity
then
Set_String (" E");
@@ -1004,7 +1004,7 @@ package body Bindgen is
-- The uname_E assignment is skipped if this is a separate spec,
-- since the assignment will be done when we process the body.
- elsif not U.Interface then
+ elsif not U.SAL_Interface then
if Force_Checking_Of_Elaboration_Flags or
Interface_Library_Unit or
(not Bind_Main_Program)
@@ -1097,7 +1097,7 @@ package body Bindgen is
-- to True, we do not need to test if this has already been
-- done, since it is quicker to set the flag than to test it.
- if not U.Interface and then U.Utype = Is_Body
+ if not U.SAL_Interface and then U.Utype = Is_Body
and then Units.Table (Unum_Spec).Set_Elab_Entity
then
Set_String (" ");
@@ -1118,7 +1118,7 @@ package body Bindgen is
-- The uname_E assignment is skipped if this is a separate spec,
-- since the assignment will be done when we process the body.
- elsif not U.Interface then
+ elsif not U.SAL_Interface then
Get_Name_String (U.Uname);
if Force_Checking_Of_Elaboration_Flags or
@@ -1270,7 +1270,7 @@ package body Bindgen is
Num := 0;
for A in ALIs.First .. ALIs.Last loop
- if not ALIs.Table (A).Interface
+ if not ALIs.Table (A).SAL_Interface
and then ALIs.Table (A).Unit_Exception_Table
then
Num := Num + 1;
@@ -1308,7 +1308,7 @@ package body Bindgen is
end if;
for A in ALIs.First .. ALIs.Last loop
- if not ALIs.Table (A).Interface
+ if not ALIs.Table (A).SAL_Interface
and then ALIs.Table (A).Unit_Exception_Table
then
Get_Decoded_Name_String_With_Brackets
@@ -1436,7 +1436,7 @@ package body Bindgen is
Num := 0;
for A in ALIs.First .. ALIs.Last loop
- if not ALIs.Table (A).Interface
+ if not ALIs.Table (A).SAL_Interface
and then ALIs.Table (A).Unit_Exception_Table
then
Num := Num + 1;
@@ -1466,7 +1466,7 @@ package body Bindgen is
Num2 := 0;
for A in ALIs.First .. ALIs.Last loop
- if not ALIs.Table (A).Interface
+ if not ALIs.Table (A).SAL_Interface
and then ALIs.Table (A).Unit_Exception_Table
then
Num2 := Num2 + 1;
@@ -1584,15 +1584,24 @@ package body Bindgen is
Write_Statement_Buffer;
end if;
+ if Opt.Default_Exit_Status /= 0
+ and then Bind_Main_Program
+ and then not Configurable_Run_Time_Mode
+ then
+ WBI (" procedure Set_Exit_Status (Status : Integer);");
+ WBI (" pragma Import (C, Set_Exit_Status, " &
+ """__gnat_set_exit_status"");");
+ WBI ("");
+ end if;
+
-- Initialize and Finalize
if not Cumulative_Restrictions.Set (No_Finalization) then
- WBI (" procedure initialize;");
+ WBI (" procedure initialize (Addr : System.Address);");
WBI (" pragma Import (C, initialize, ""__gnat_initialize"");");
WBI ("");
WBI (" procedure finalize;");
WBI (" pragma Import (C, finalize, ""__gnat_finalize"");");
- WBI ("");
end if;
-- Deal with declarations for main program case
@@ -1630,6 +1639,13 @@ package body Bindgen is
Write_Statement_Buffer;
WBI ("");
+
+ if Bind_Main_Program
+ and then not Suppress_Standard_Library_On_Target
+ then
+ WBI (" SEH : aliased array (1 .. 2) of Integer;");
+ WBI ("");
+ end if;
end if;
-- Generate a reference to Ada_Main_Program_Name. This symbol is
@@ -1670,8 +1686,26 @@ package body Bindgen is
WBI (" gnat_envp := System.Null_Address;");
end if;
+ if Opt.Default_Exit_Status /= 0
+ and then Bind_Main_Program
+ and then not Configurable_Run_Time_Mode
+ then
+ Set_String (" Set_Exit_Status (");
+ Set_Int (Opt.Default_Exit_Status);
+ Set_String (");");
+ Write_Statement_Buffer;
+ end if;
+
if not Cumulative_Restrictions.Set (No_Finalization) then
- WBI (" Initialize;");
+
+ if not No_Main_Subprogram
+ and then Bind_Main_Program
+ and then not Suppress_Standard_Library_On_Target
+ then
+ WBI (" Initialize (SEH'Address);");
+ else
+ WBI (" Initialize (System.Null_Address);");
+ end if;
end if;
WBI (" " & Ada_Init_Name.all & ";");
@@ -1758,6 +1792,13 @@ package body Bindgen is
WBI (" char *ensure_reference __attribute__ ((__unused__)) = " &
"__gnat_ada_main_program_name;");
WBI ("");
+
+ if not Suppress_Standard_Library_On_Target
+ and then not No_Main_Subprogram
+ then
+ WBI (" int SEH [2];");
+ WBI ("");
+ end if;
end if;
-- If main program is a function, generate result variable
@@ -1790,11 +1831,24 @@ package body Bindgen is
WBI (" gnat_envp = 0;");
end if;
+ if Opt.Default_Exit_Status /= 0
+ and then Bind_Main_Program
+ and then not Configurable_Run_Time_Mode
+ then
+ Set_String (" __gnat_set_exit_status (");
+ Set_Int (Opt.Default_Exit_Status);
+ Set_String (");");
+ Write_Statement_Buffer;
+ end if;
+
-- The __gnat_initialize routine is used only if we have a run-time
if not Suppress_Standard_Library_On_Target then
- WBI
- (" __gnat_initialize ();");
+ if not No_Main_Subprogram and then Bind_Main_Program then
+ WBI (" __gnat_initialize ((void *)SEH);");
+ else
+ WBI (" __gnat_initialize ((void *)0);");
+ end if;
end if;
WBI (" " & Ada_Init_Name.all & " ();");
@@ -1938,7 +1992,7 @@ package body Bindgen is
-- If not spec that has an associated body, then generate a
-- comment giving the name of the corresponding object file.
- if (not Units.Table (Elab_Order.Table (E)).Interface)
+ if (not Units.Table (Elab_Order.Table (E)).SAL_Interface)
and then Units.Table (Elab_Order.Table (E)).Utype /= Is_Spec
then
Get_Name_String
@@ -2502,7 +2556,7 @@ package body Bindgen is
end if;
if not Suppress_Standard_Library_On_Target then
- WBI ("extern void __gnat_initialize (void);");
+ WBI ("extern void __gnat_initialize (void *);");
WBI ("extern void __gnat_finalize (void);");
WBI ("extern void __gnat_install_handler (void);");
end if;
@@ -2530,7 +2584,6 @@ package body Bindgen is
WBI ("extern int gnat_argc;");
WBI ("extern char **gnat_argv;");
WBI ("extern char **gnat_envp;");
- WBI ("extern int gnat_exit_status;");
-- If configurable run time and no command line args, then the
-- generation of these variables is entirely suppressed.
@@ -2545,7 +2598,6 @@ package body Bindgen is
WBI ("int gnat_argc;");
WBI ("char **gnat_argv;");
WBI ("char **gnat_envp;");
- WBI ("int gnat_exit_status = 0;");
end if;
-- Similarly deal with exit status
diff --git a/gcc/ada/bindusg.adb b/gcc/ada/bindusg.adb
index e5bae217018..31b0ba823f7 100644
--- a/gcc/ada/bindusg.adb
+++ b/gcc/ada/bindusg.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -227,6 +227,11 @@ begin
Write_Str ("ject consistency only)");
Write_Eol;
+ -- Line for X switch
+
+ Write_Str (" -Xnnn Default exit status value = nnn");
+ Write_Eol;
+
-- Line for -z switch
Write_Str (" -z No main subprogram (zero main)");
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index b26e4d981db..6801837afc7 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -2591,19 +2591,28 @@ package body Checks is
then
case Msg_K is
when Components =>
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding " &
- "components", Expr);
+ Apply_Compile_Time_Constraint_Error
+ (N => Expr,
+ Msg => "(Ada 2005) NULL not allowed in"
+ & " null-excluding components?",
+ Reason => CE_Null_Not_Allowed,
+ Rep => False);
when Formals =>
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding formals",
- Expr);
+ Apply_Compile_Time_Constraint_Error
+ (N => Expr,
+ Msg => "(Ada 2005) NULL not allowed in"
+ & " null-excluding formals?",
+ Reason => CE_Null_Not_Allowed,
+ Rep => False);
when Objects =>
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding objects",
- Expr);
+ Apply_Compile_Time_Constraint_Error
+ (N => Expr,
+ Msg => "(Ada 2005) NULL not allowed in"
+ & " null-excluding objects?",
+ Reason => CE_Null_Not_Allowed,
+ Rep => False);
end case;
end if;
end Check_Null_Not_Allowed;
@@ -3478,6 +3487,15 @@ package body Checks is
Set_Do_Range_Check (N, True);
return;
end if;
+
+ -- Ditto if the prefix is an explicit dereference whose
+ -- designated type is unconstrained.
+
+ elsif Nkind (Prefix (P)) = N_Explicit_Dereference
+ and then not Is_Constrained (Atyp)
+ then
+ Set_Do_Range_Check (N, True);
+ return;
end if;
Indx := First_Index (Atyp);
diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb
index 3af321115ea..c0f6e16ffd7 100644
--- a/gcc/ada/clean.adb
+++ b/gcc/ada/clean.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2003-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2005, 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- --
@@ -80,9 +80,9 @@ package body Clean is
-- files will be done.
Do_Nothing : Boolean := False;
- -- Set to True when switch -n is specified.
- -- When True, no file is deleted. gnatclean only lists the files that
- -- would have been deleted if the switch -n had not been specified.
+ -- Set to True when switch -n is specified. When True, no file is deleted.
+ -- gnatclean only lists the files that would have been deleted if the
+ -- switch -n had not been specified.
File_Deleted : Boolean := False;
-- Set to True if at least one file has been deleted
@@ -151,7 +151,7 @@ package body Clean is
-- Extracts the first element from the Q
Q_Front : Natural;
- -- Points to the first valid element in the Q.
+ -- Points to the first valid element in the Q
package Q is new Table.Table (
Table_Component_Type => File_Name_Type,
@@ -1041,7 +1041,7 @@ package body Clean is
if not Copyright_Displayed then
Copyright_Displayed := True;
Put_Line ("GNATCLEAN " & Gnatvsn.Gnat_Version_String
- & " Copyright 2003-2004 Free Software Foundation, Inc.");
+ & " Copyright 2003-2005 Free Software Foundation, Inc.");
end if;
end Display_Copyright;
diff --git a/gcc/ada/csets.adb b/gcc/ada/csets.adb
index 319989b5b3b..4fc22889daa 100644
--- a/gcc/ada/csets.adb
+++ b/gcc/ada/csets.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -1159,8 +1159,7 @@ package body Csets is
Identifier_Char ('[') := True;
-- Add entry for ESC if wide characters in use with a wide character
- -- encoding method active that uses the ESC code for encoding. Also
- -- add entry for left bracket to capture use of brackets notation.
+ -- encoding method active that uses the ESC code for encoding.
if Identifier_Character_Set = 'w'
and then Wide_Character_Encoding_Method in WC_ESC_Encoding_Method
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 73afd401c2f..1f45f5e6d63 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -195,13 +195,14 @@ package body CStand is
Binary_Ops : constant array (S_Binary_Ops) of Name_Id :=
-- There is one entry here for each binary operator, except for the
- -- case of concatenation, where there are two entries, one for a
- -- String result, and one for a Wide_String result.
+ -- case of concatenation, where there are three entries, one for a
+ -- String result, one for Wide_String, and one for Wide_Wide_String.
(Name_Op_Add,
Name_Op_And,
Name_Op_Concat,
Name_Op_Concat,
+ Name_Op_Concat,
Name_Op_Divide,
Name_Op_Eq,
Name_Op_Expon,
@@ -222,24 +223,25 @@ package body CStand is
-- This table has the corresponding result types. The entries are
-- ordered so they correspond to the Binary_Ops array above.
- (Universal_Integer, -- Add
- Standard_Boolean, -- And
- Standard_String, -- Concat (String)
- Standard_Wide_String, -- Concat (Wide_String)
- Universal_Integer, -- Divide
- Standard_Boolean, -- Eq
- Universal_Integer, -- Expon
- Standard_Boolean, -- Ge
- Standard_Boolean, -- Gt
- Standard_Boolean, -- Le
- Standard_Boolean, -- Lt
- Universal_Integer, -- Mod
- Universal_Integer, -- Multiply
- Standard_Boolean, -- Ne
- Standard_Boolean, -- Or
- Universal_Integer, -- Rem
- Universal_Integer, -- Subtract
- Standard_Boolean); -- Xor
+ (Universal_Integer, -- Add
+ Standard_Boolean, -- And
+ Standard_String, -- Concat (String)
+ Standard_Wide_String, -- Concat (Wide_String)
+ Standard_Wide_Wide_String, -- Concat (Wide_Wide_String)
+ Universal_Integer, -- Divide
+ Standard_Boolean, -- Eq
+ Universal_Integer, -- Expon
+ Standard_Boolean, -- Ge
+ Standard_Boolean, -- Gt
+ Standard_Boolean, -- Le
+ Standard_Boolean, -- Lt
+ Universal_Integer, -- Mod
+ Universal_Integer, -- Multiply
+ Standard_Boolean, -- Ne
+ Standard_Boolean, -- Or
+ Universal_Integer, -- Rem
+ Universal_Integer, -- Subtract
+ Standard_Boolean); -- Xor
Unary_Ops : constant array (S_Unary_Ops) of Name_Id :=
@@ -277,13 +279,20 @@ package body CStand is
-- For concatenation, we create a separate operator for each
-- array type. This simplifies the resolution of the component-
-- component concatenation operation. In Standard, we set the types
- -- of the formals for string and wide string concatenation.
+ -- of the formals for string, wide [wide]_string, concatenations.
Set_Etype (First_Entity (Standard_Op_Concat), Standard_String);
Set_Etype (Last_Entity (Standard_Op_Concat), Standard_String);
Set_Etype (First_Entity (Standard_Op_Concatw), Standard_Wide_String);
Set_Etype (Last_Entity (Standard_Op_Concatw), Standard_Wide_String);
+
+ Set_Etype (First_Entity (Standard_Op_Concatww),
+ Standard_Wide_Wide_String);
+
+ Set_Etype (Last_Entity (Standard_Op_Concatww),
+ Standard_Wide_Wide_String);
+
end Create_Operators;
---------------------
@@ -537,8 +546,8 @@ package body CStand is
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
- Set_Char_Literal_Value (B_Node, 16#00#);
- Set_Entity (B_Node, Empty);
+ Set_Char_Literal_Value (B_Node, Uint_0);
+ Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Character);
Set_Low_Bound (R_Node, B_Node);
@@ -547,8 +556,8 @@ package body CStand is
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
- Set_Char_Literal_Value (B_Node, 16#FF#);
- Set_Entity (B_Node, Empty);
+ Set_Char_Literal_Value (B_Node, UI_From_Int (16#FF#));
+ Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Character);
Set_High_Bound (R_Node, B_Node);
@@ -582,8 +591,8 @@ package body CStand is
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name); -- ???
- Set_Char_Literal_Value (B_Node, 16#0000#);
- Set_Entity (B_Node, Empty);
+ Set_Char_Literal_Value (B_Node, Uint_0);
+ Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Character);
Set_Low_Bound (R_Node, B_Node);
@@ -592,8 +601,8 @@ package body CStand is
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name); -- ???
- Set_Char_Literal_Value (B_Node, 16#FFFF#);
- Set_Entity (B_Node, Empty);
+ Set_Char_Literal_Value (B_Node, UI_From_Int (16#FFFF#));
+ Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Character);
Set_High_Bound (R_Node, B_Node);
@@ -601,6 +610,54 @@ package body CStand is
Set_Etype (R_Node, Standard_Wide_Character);
Set_Parent (R_Node, Standard_Wide_Character);
+ -- Create type definition for type Wide_Wide_Character. Note that we
+ -- do not set the Literals field, since type Wide_Wide_Character is
+ -- handled with special routines that do not need a literal list.
+
+ Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
+ Set_Type_Definition (Parent (Standard_Wide_Wide_Character), Tdef_Node);
+
+ Set_Ekind (Standard_Wide_Wide_Character, E_Enumeration_Type);
+ Set_Etype (Standard_Wide_Wide_Character,
+ Standard_Wide_Wide_Character);
+ Init_Size (Standard_Wide_Wide_Character,
+ Standard_Wide_Wide_Character_Size);
+
+ Set_Elem_Alignment (Standard_Wide_Wide_Character);
+ Set_Is_Unsigned_Type (Standard_Wide_Wide_Character);
+ Set_Is_Character_Type (Standard_Wide_Wide_Character);
+ Set_Is_Known_Valid (Standard_Wide_Wide_Character);
+ Set_Size_Known_At_Compile_Time (Standard_Wide_Wide_Character);
+ Set_Is_Ada_2005 (Standard_Wide_Wide_Character);
+
+ -- Create the bounds for type Wide_Wide_Character
+
+ R_Node := New_Node (N_Range, Stloc);
+
+ -- Low bound for type Wide_Wide_Character
+
+ B_Node := New_Node (N_Character_Literal, Stloc);
+ Set_Is_Static_Expression (B_Node);
+ Set_Chars (B_Node, No_Name); -- ???
+ Set_Char_Literal_Value (B_Node, Uint_0);
+ Set_Entity (B_Node, Empty);
+ Set_Etype (B_Node, Standard_Wide_Wide_Character);
+ Set_Low_Bound (R_Node, B_Node);
+
+ -- High bound for type Wide_Wide_Character
+
+ B_Node := New_Node (N_Character_Literal, Stloc);
+ Set_Is_Static_Expression (B_Node);
+ Set_Chars (B_Node, No_Name); -- ???
+ Set_Char_Literal_Value (B_Node, UI_From_Int (16#7FFF_FFFF#));
+ Set_Entity (B_Node, Empty);
+ Set_Etype (B_Node, Standard_Wide_Wide_Character);
+ Set_High_Bound (R_Node, B_Node);
+
+ Set_Scalar_Range (Standard_Wide_Wide_Character, R_Node);
+ Set_Etype (R_Node, Standard_Wide_Wide_Character);
+ Set_Parent (R_Node, Standard_Wide_Wide_Character);
+
-- Create type definition node for type String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
@@ -609,9 +666,9 @@ package body CStand is
CompDef_Node : Node_Id;
begin
CompDef_Node := New_Node (N_Component_Definition, Stloc);
- Set_Aliased_Present (CompDef_Node, False);
- Set_Access_Definition (CompDef_Node, Empty);
- Set_Subtype_Indication (CompDef_Node, Identifier_For (S_Character));
+ Set_Aliased_Present (CompDef_Node, False);
+ Set_Access_Definition (CompDef_Node, Empty);
+ Set_Subtype_Indication (CompDef_Node, Identifier_For (S_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
@@ -637,6 +694,7 @@ package body CStand is
-- Create type definition node for type Wide_String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
+
declare
CompDef_Node : Node_Id;
begin
@@ -647,6 +705,7 @@ package body CStand is
Identifier_For (S_Wide_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
+
Set_Subtype_Marks (Tdef_Node, New_List);
Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
Set_Type_Definition (Parent (Standard_Wide_String), Tdef_Node);
@@ -665,6 +724,42 @@ package body CStand is
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
+ -- Create type definition node for type Wide_Wide_String
+
+ Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
+
+ declare
+ CompDef_Node : Node_Id;
+ begin
+ CompDef_Node := New_Node (N_Component_Definition, Stloc);
+ Set_Aliased_Present (CompDef_Node, False);
+ Set_Access_Definition (CompDef_Node, Empty);
+ Set_Subtype_Indication (CompDef_Node,
+ Identifier_For (S_Wide_Wide_Character));
+ Set_Component_Definition (Tdef_Node, CompDef_Node);
+ end;
+
+ Set_Subtype_Marks (Tdef_Node, New_List);
+ Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
+ Set_Type_Definition (Parent (Standard_Wide_Wide_String), Tdef_Node);
+
+ Set_Ekind (Standard_Wide_Wide_String, E_String_Type);
+ Set_Etype (Standard_Wide_Wide_String,
+ Standard_Wide_Wide_String);
+ Set_Component_Type (Standard_Wide_Wide_String,
+ Standard_Wide_Wide_Character);
+ Set_Component_Size (Standard_Wide_Wide_String, Uint_32);
+ Init_Size_Align (Standard_Wide_Wide_String);
+ Set_Is_Ada_2005 (Standard_Wide_Wide_String);
+
+ -- Set index type of Wide_Wide_String
+
+ E_Id := First
+ (Subtype_Marks (Type_Definition (Parent (Standard_Wide_Wide_String))));
+ Set_First_Index (Standard_Wide_Wide_String, E_Id);
+ Set_Entity (E_Id, Standard_Positive);
+ Set_Etype (E_Id, Standard_Positive);
+
-- Create subtype declaration for Natural
Decl := New_Node (N_Subtype_Declaration, Stloc);
@@ -760,7 +855,7 @@ package body CStand is
Set_Is_Static_Expression (Expr_Decl);
Set_Chars (Expr_Decl, No_Name);
Set_Etype (Expr_Decl, Standard_Character);
- Set_Char_Literal_Value (Expr_Decl, Ccode);
+ Set_Char_Literal_Value (Expr_Decl, UI_From_Int (Int (Ccode)));
end;
Append (Decl, Decl_A);
@@ -1703,6 +1798,12 @@ package body CStand is
P (" -- See RM A.1(36) for details of this type");
Write_Eol;
+ P (" type Wide_Wide_Character is (...)");
+ Write_Str (" for Wide_Character'Size use ");
+ Write_Int (Standard_Wide_Wide_Character_Size);
+ P (";");
+ P (" -- See RM A.1(36) for details of this type");
+
P (" type String is array (Positive range <>) of Character;");
P (" pragma Pack (String);");
Write_Eol;
@@ -1712,6 +1813,11 @@ package body CStand is
P (" pragma Pack (Wide_String);");
Write_Eol;
+ P (" type Wide_Wide_String is array (Positive range <>)" &
+ " of Wide_Wide_Character;");
+ P (" pragma Pack (Wide_Wide_String);");
+ Write_Eol;
+
-- Here it's OK to use the Duration type of the host compiler since
-- the implementation of Duration in GNAT is target independent.
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 90036e2332b..a0cc0fbf031 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -120,8 +120,6 @@ package body Debug is
-- d.y
-- d.z
-
-
-- d1 Error msgs have node numbers where possible
-- d2 Eliminate error flags in verbose form error messages
-- d3 Dump bad node in Comperr on an abort
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 710d0f1a4f0..6edda454a0c 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -748,6 +748,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
if (const_flag
+ && !TREE_SIDE_EFFECTS (gnu_expr)
&& TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE
&& TYPE_MODE (gnu_type) != BLKmode
&& Ekind (Etype (gnat_entity)) != E_Class_Wide_Type
@@ -757,8 +758,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* If this is a declaration or reference that we can stabilize,
just use that declaration or reference as this entity unless
the latter has to be materialized. */
- else if ((DECL_P (gnu_expr)
- || (REFERENCE_CLASS_P (gnu_expr) == tcc_reference))
+ else if ((DECL_P (gnu_expr) || REFERENCE_CLASS_P (gnu_expr))
&& !Materialize_Entity (gnat_entity)
&& (!global_bindings_p ()
|| (staticp (gnu_expr)
@@ -793,7 +793,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (!global_bindings_p ())
{
+ bool has_side_effects = TREE_SIDE_EFFECTS (gnu_expr);
+
gnu_expr = gnat_stabilize_reference (gnu_expr, true);
+
+ /* If the original expression had side effects, put a
+ SAVE_EXPR around this whole thing. */
+ if (has_side_effects)
+ gnu_expr = save_expr (gnu_expr);
+
add_stmt (gnu_expr);
}
@@ -2582,6 +2590,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
tree gnu_subst_list
= substitution_list (gnat_entity, gnat_base_type, NULL_TREE,
definition);
+ bool possibly_overlapping_fields = false;
tree gnu_temp;
/* If this is a derived type, we may be seeing fields from any
@@ -2598,12 +2607,24 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
BIGGEST_ALIGNMENT);
if (Present (Parent_Subtype (gnat_root_type)))
- gnu_subst_list
- = substitution_list (Parent_Subtype (gnat_root_type),
- Empty, gnu_subst_list, definition);
+ {
+ gnu_subst_list
+ = substitution_list (Parent_Subtype (gnat_root_type),
+ Empty, gnu_subst_list,
+ definition);
+
+ /* If there's a _Parent field, it may overlap the
+ fields we have that appear to be in this record but
+ actually are from the parent. So make note of that
+ fact and later we'll make a UNION_TYPE instead of
+ a RECORD_TYPE, since the latter may not have
+ overlapping fields. */
+ possibly_overlapping_fields = true;
+ }
}
- gnu_type = make_node (RECORD_TYPE);
+ gnu_type = make_node (possibly_overlapping_fields
+ ? UNION_TYPE : RECORD_TYPE);
TYPE_NAME (gnu_type) = gnu_entity_id;
TYPE_STUB_DECL (gnu_type)
= create_type_decl (NULL_TREE, gnu_type, NULL, false, false,
@@ -3163,10 +3184,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
p->next = defer_incomplete_list;
defer_incomplete_list = p;
}
- else if
- (IN (Ekind (Base_Type (Directly_Designated_Type (gnat_entity))),
- Incomplete_Or_Private_Kind))
- { ;}
+ else if (IN (Ekind (Base_Type
+ (Directly_Designated_Type (gnat_entity))),
+ Incomplete_Or_Private_Kind))
+ ;
else
gnat_to_gnu_entity (Directly_Designated_Type (gnat_entity),
NULL_TREE, 0);
@@ -4372,9 +4393,13 @@ make_dummy_type (Entity_Id gnat_type)
/* If this is a record, make this a RECORD_TYPE or UNION_TYPE; else make
it a VOID_TYPE. */
- if (Is_Record_Type (gnat_underlying))
- gnu_type = make_node (Is_Unchecked_Union (gnat_underlying)
- ? UNION_TYPE : RECORD_TYPE);
+ if (Is_Unchecked_Union (gnat_underlying))
+ {
+ gnu_type = make_node (UNION_TYPE);
+ TYPE_UNCHECKED_UNION_P (gnu_type) = 1;
+ }
+ else if (Is_Record_Type (gnat_underlying))
+ gnu_type = make_node (RECORD_TYPE);
else
gnu_type = make_node (ENUMERAL_TYPE);
@@ -5098,7 +5123,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
&& TYPE_MODE (gnu_field_type) == BLKmode
&& host_integerp (TYPE_SIZE (gnu_field_type), 1)
&& compare_tree_int (TYPE_SIZE (gnu_field_type), BIGGEST_ALIGNMENT) <= 0
- && (packed
+ && (packed == 1
|| (gnu_size && tree_int_cst_lt (gnu_size,
TYPE_SIZE (gnu_field_type)))
|| Present (Component_Clause (gnat_field))))
@@ -5375,7 +5400,9 @@ components_to_record (tree gnu_record_type, Node_Id component_list,
/* If this is an unchecked union, each variant must have exactly one
component, each of which becomes one component of this union. */
- if (TREE_CODE (gnu_record_type) == UNION_TYPE && Present (variant_part))
+ if (TREE_CODE (gnu_record_type) == UNION_TYPE
+ && TYPE_UNCHECKED_UNION_P (gnu_record_type)
+ && Present (variant_part))
for (variant = First_Non_Pragma (Variants (variant_part));
Present (variant);
variant = Next_Non_Pragma (variant))
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 39ab9634e75..8606bf0958a 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -209,7 +209,8 @@ package body Einfo is
-- Privals_Chain Elist23
-- Protected_Operation Node23
- -- (unused) Node24
+ -- Obsolescent_Warning Node24
+
-- (unused) Node25
-- (unused) Node26
-- (unused) Node27
@@ -391,6 +392,7 @@ package body Einfo is
-- Vax_Float Flag151
-- Entry_Accepted Flag152
+ -- Is_Obsolescent Flag153
-- Has_Per_Object_Constraint Flag154
-- Has_Private_Declaration Flag155
-- Referenced Flag156
@@ -424,10 +426,9 @@ package body Einfo is
-- Has_Contiguous_Rep Flag181
-- Has_Xref_Entry Flag182
-- Must_Be_On_Byte_Boundary Flag183
+ -- Has_Stream_Size_Clause Flag184
+ -- Is_Ada_2005 Flag185
- -- (unused) Flag153
- -- (unused) Flag184
- -- (unused) Flag185
-- (unused) Flag186
-- (unused) Flag187
-- (unused) Flag188
@@ -459,6 +460,36 @@ package body Einfo is
-- (unused) Flag214
-- (unused) Flag215
+ -----------------------
+ -- Local subprograms --
+ -----------------------
+
+ function Rep_Clause (Id : E; Rep_Name : Name_Id) return N;
+ -- Returns the attribute definition clause whose name is Rep_Name. Returns
+ -- Empty if not found.
+
+ ----------------
+ -- Rep_Clause --
+ ----------------
+
+ function Rep_Clause (Id : E; Rep_Name : Name_Id) return N is
+ Ritem : Node_Id;
+
+ begin
+ Ritem := First_Rep_Item (Id);
+ while Present (Ritem) loop
+ if Nkind (Ritem) = N_Attribute_Definition_Clause
+ and then Chars (Ritem) = Rep_Name
+ then
+ return Ritem;
+ else
+ Ritem := Next_Rep_Item (Ritem);
+ end if;
+ end loop;
+
+ return Empty;
+ end Rep_Clause;
+
--------------------------------
-- Attribute Access Functions --
--------------------------------
@@ -1238,6 +1269,12 @@ package body Einfo is
return Flag23 (Implementation_Base_Type (Id));
end Has_Storage_Size_Clause;
+ function Has_Stream_Size_Clause (Id : E) return B is
+ begin
+ pragma Assert (Is_Elementary_Type (Id));
+ return Flag184 (Id);
+ end Has_Stream_Size_Clause;
+
function Has_Subprogram_Descriptor (Id : E) return B is
begin
return Flag93 (Id);
@@ -1317,6 +1354,11 @@ package body Einfo is
return Flag69 (Id);
end Is_Access_Constant;
+ function Is_Ada_2005 (Id : E) return B is
+ begin
+ return Flag185 (Id);
+ end Is_Ada_2005;
+
function Is_Aliased (Id : E) return B is
begin
pragma Assert (Nkind (Id) in N_Entity);
@@ -1574,6 +1616,12 @@ package body Einfo is
return Flag178 (Id);
end Is_Null_Init_Proc;
+ function Is_Obsolescent (Id : E) return B is
+ begin
+ pragma Assert (Is_Subprogram (Id));
+ return Flag153 (Id);
+ end Is_Obsolescent;
+
function Is_Optional_Parameter (Id : E) return B is
begin
pragma Assert (Is_Formal (Id));
@@ -1881,6 +1929,12 @@ package body Einfo is
return Node17 (Id);
end Object_Ref;
+ function Obsolescent_Warning (Id : E) return N is
+ begin
+ pragma Assert (Is_Subprogram (Id));
+ return Node24 (Id);
+ end Obsolescent_Warning;
+
function Original_Access_Type (Id : E) return E is
begin
pragma Assert
@@ -3171,6 +3225,12 @@ package body Einfo is
Set_Flag23 (Id, V);
end Set_Has_Storage_Size_Clause;
+ procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True) is
+ begin
+ pragma Assert (Is_Elementary_Type (Id));
+ Set_Flag184 (Id, V);
+ end Set_Has_Stream_Size_Clause;
+
procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True) is
begin
Set_Flag93 (Id, V);
@@ -3254,6 +3314,11 @@ package body Einfo is
Set_Flag69 (Id, V);
end Set_Is_Access_Constant;
+ procedure Set_Is_Ada_2005 (Id : E; V : B := True) is
+ begin
+ Set_Flag185 (Id, V);
+ end Set_Is_Ada_2005;
+
procedure Set_Is_Aliased (Id : E; V : B := True) is
begin
pragma Assert (Nkind (Id) in N_Entity);
@@ -3528,6 +3593,12 @@ package body Einfo is
Set_Flag178 (Id, V);
end Set_Is_Null_Init_Proc;
+ procedure Set_Is_Obsolescent (Id : E; V : B := True) is
+ begin
+ pragma Assert (Is_Subprogram (Id));
+ Set_Flag153 (Id, V);
+ end Set_Is_Obsolescent;
+
procedure Set_Is_Optional_Parameter (Id : E; V : B := True) is
begin
pragma Assert (Is_Formal (Id));
@@ -3840,6 +3911,12 @@ package body Einfo is
Set_Node17 (Id, V);
end Set_Object_Ref;
+ procedure Set_Obsolescent_Warning (Id : E; V : N) is
+ begin
+ pragma Assert (Is_Subprogram (Id));
+ Set_Node24 (Id, V);
+ end Set_Obsolescent_Warning;
+
procedure Set_Original_Access_Type (Id : E; V : E) is
begin
pragma Assert
@@ -4421,21 +4498,8 @@ package body Einfo is
--------------------
function Address_Clause (Id : E) return N is
- Ritem : Node_Id;
-
begin
- Ritem := First_Rep_Item (Id);
- while Present (Ritem) loop
- if Nkind (Ritem) = N_Attribute_Definition_Clause
- and then Chars (Ritem) = Name_Address
- then
- return Ritem;
- else
- Ritem := Next_Rep_Item (Ritem);
- end if;
- end loop;
-
- return Empty;
+ return Rep_Clause (Id, Name_Address);
end Address_Clause;
----------------------
@@ -4443,35 +4507,20 @@ package body Einfo is
----------------------
function Alignment_Clause (Id : E) return N is
- Ritem : Node_Id;
-
begin
- Ritem := First_Rep_Item (Id);
- while Present (Ritem) loop
- if Nkind (Ritem) = N_Attribute_Definition_Clause
- and then Chars (Ritem) = Name_Alignment
- then
- return Ritem;
- else
- Ritem := Next_Rep_Item (Ritem);
- end if;
- end loop;
-
- return Empty;
+ return Rep_Clause (Id, Name_Alignment);
end Alignment_Clause;
----------------------
-- Ancestor_Subtype --
----------------------
- function Ancestor_Subtype (Id : E) return E is
+ function Ancestor_Subtype (Id : E) return E is
begin
-- If this is first subtype, or is a base type, then there is no
-- ancestor subtype, so we return Empty to indicate this fact.
- if Is_First_Subtype (Id)
- or else Id = Base_Type (Id)
- then
+ if Is_First_Subtype (Id) or else Id = Base_Type (Id) then
return Empty;
end if;
@@ -4623,7 +4672,7 @@ package body Einfo is
then
Full_D := Parent (Full_View (Id));
- -- The full view may have been rewritten as an object renaming.
+ -- The full view may have been rewritten as an object renaming
if Nkind (Full_D) = N_Object_Renaming_Declaration then
return Name (Full_D);
@@ -4779,7 +4828,7 @@ package body Einfo is
Ent := Next_Entity (Ent);
end if;
- -- Skip all hidden stored discriminants if any.
+ -- Skip all hidden stored discriminants if any
while Present (Ent) loop
exit when Ekind (Ent) = E_Discriminant
@@ -5583,7 +5632,7 @@ package body Einfo is
-- E_Discriminant d2
-- ...
- -- so it is critical not to go past the leading discriminants.
+ -- so it is critical not to go past the leading discriminants
D : E := Id;
@@ -5903,23 +5952,19 @@ package body Einfo is
-----------------
function Size_Clause (Id : E) return N is
- Ritem : Node_Id;
-
begin
- Ritem := First_Rep_Item (Id);
- while Present (Ritem) loop
- if Nkind (Ritem) = N_Attribute_Definition_Clause
- and then Chars (Ritem) = Name_Size
- then
- return Ritem;
- else
- Ritem := Next_Rep_Item (Ritem);
- end if;
- end loop;
-
- return Empty;
+ return Rep_Clause (Id, Name_Size);
end Size_Clause;
+ ------------------------
+ -- Stream_Size_Clause --
+ ------------------------
+
+ function Stream_Size_Clause (Id : E) return N is
+ begin
+ return Rep_Clause (Id, Name_Stream_Size);
+ end Stream_Size_Clause;
+
------------------
-- Subtype_Kind --
------------------
@@ -6216,6 +6261,7 @@ package body Einfo is
W ("Has_Small_Clause", Flag67 (Id));
W ("Has_Specified_Layout", Flag100 (Id));
W ("Has_Storage_Size_Clause", Flag23 (Id));
+ W ("Has_Stream_Size_Clause", Flag184 (Id));
W ("Has_Subprogram_Descriptor", Flag93 (Id));
W ("Has_Task", Flag30 (Id));
W ("Has_Unchecked_Union", Flag123 (Id));
@@ -6228,6 +6274,7 @@ package body Einfo is
W ("Is_AST_Entry", Flag132 (Id));
W ("Is_Abstract", Flag19 (Id));
W ("Is_Access_Constant", Flag69 (Id));
+ W ("Is_Ada_2005", Flag185 (Id));
W ("Is_Aliased", Flag15 (Id));
W ("Is_Asynchronous", Flag81 (Id));
W ("Is_Atomic", Flag85 (Id));
@@ -6275,6 +6322,7 @@ package body Einfo is
W ("Is_Machine_Code_Subprogram", Flag137 (Id));
W ("Is_Non_Static_Subtype", Flag109 (Id));
W ("Is_Null_Init_Proc", Flag178 (Id));
+ W ("Is_Obsolescent", Flag153 (Id));
W ("Is_Optional_Parameter", Flag134 (Id));
W ("Is_Overriding_Operation", Flag39 (Id));
W ("Is_Package_Body_Entity", Flag160 (Id));
@@ -7207,6 +7255,9 @@ package body Einfo is
procedure Write_Field24_Name (Id : Entity_Id) is
begin
case Ekind (Id) is
+ when Subprogram_Kind =>
+ Write_Str ("Obsolescent_Warning");
+
when others =>
Write_Str ("Field24??");
end case;
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index c61ce663a28..573539fa1ba 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -41,6 +41,10 @@ package Einfo is
-- This package defines the annotations to the abstract syntax tree that
-- are needed to support semantic processing of an Ada compilation.
+-- Note that after editing this spec and the corresponding body it is
+-- required to run ceinfo to check the consistentcy of spec and body.
+-- See ceinfo.adb for more information about the checks made.
+
-- These annotations are for the most part attributes of declared entities,
-- and they correspond to conventional symbol table information. Other
-- attributes include sets of meanings for overloaded names, possible
@@ -527,7 +531,7 @@ package Einfo is
-- Component_Size (Uint22) [implementation base type only]
-- Present in array types. It contains the component size value for
--- the array. A value of zero means that the value is not yet set.
+-- the array. A value of No_Uint means that the value is not yet set.
-- The value can be set by the use of a component size clause, or
-- by the front end in package Layout, or by the backend. A negative
-- value is used to represent a value which is not known at compile
@@ -1517,6 +1521,10 @@ package Einfo is
-- of access types, this flag is present only in the root type, since a
-- storage size clause cannot be given to a derived type.
+-- Has_Stream_Size_Clause (Flag184)
+-- This flag is set on types which have a Stream_Size clause attribute.
+-- Used to prevent multiple Stream_Size clauses for a given entity.
+
-- Has_Subprogram_Descriptor (Flag93)
-- This flag is set on entities for which zero-cost exception subprogram
-- descriptors can be generated (subprograms and library level package
@@ -1650,6 +1658,10 @@ package Einfo is
-- Is_Access_Type (synthesized)
-- Applies to all entities, true for access types and subtypes
+-- Is_Ada_2005 (Flag185)
+-- Applies to all entities, true if a valid pragma Ada_05 applies to the
+-- entity, indicating that the entity is Ada 2005 only.
+
-- Is_Aliased (Flag15)
-- Present in objects whose declarations carry the keyword aliased,
-- and on record components that have the keyword.
@@ -2091,6 +2103,10 @@ package Einfo is
-- Applies to all entities, true for entities representing objects,
-- including generic formal parameters.
+-- Is_Obsolescent (Flag153)
+-- Present in subprogram entities. Set if a valid pragma Obsolescent
+-- applies to the subprogram.
+
-- Is_Optional_Parameter (Flag134)
-- Present in parameter entities. Set if the parameter is specified as
-- optional by use of a First_Optional_Parameter argument to one of the
@@ -2649,6 +2665,11 @@ package Einfo is
-- Applies to subprograms and subprogram types. Yields the number of
-- formals as a value of type Pos.
+-- Obsolescent_Warning (Node24)
+-- Present in subprogram entities. Set non-empty only if the pragma
+-- Obsolescent had a string argument, in which case it records the
+-- contents of the corresponding string literal node.
+
-- Original_Access_Type (Node21)
-- Present in access to subprogram types. Anonymous access to protected
-- subprogram types are replaced by an occurrence of an internal access
@@ -3912,6 +3933,7 @@ package Einfo is
-- Has_Qualified_Name (Flag161)
-- Has_Unknown_Discriminants (Flag72)
-- Has_Xref_Entry (Flag182)
+ -- Is_Ada_2005 (Flag185)
-- Is_Bit_Packed_Array (Flag122) (base type only)
-- Is_Child_Unit (Flag73)
-- Is_Compilation_Unit (Flag149)
@@ -4297,6 +4319,7 @@ package Einfo is
-- Generic_Renamings (Elist23) (for an instance)
-- Inner_Instances (Elist23) (for a generic function)
-- Privals_Chain (Elist23) (for a protected function)
+ -- Obsolescent_Warning (Node24)
-- Body_Needed_For_SAL (Flag40)
-- Elaboration_Entity_Required (Flag174)
-- Function_Returns_With_DSP (Flag169)
@@ -4321,6 +4344,7 @@ package Einfo is
-- Is_Instantiated (Flag126) (generic case only)
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
+ -- Is_Obsolescent (Flag153)
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Pure (Flag44)
@@ -4542,6 +4566,7 @@ package Einfo is
-- Generic_Renamings (Elist23) (for an instance)
-- Inner_Instances (Elist23) (for a generic procedure)
-- Privals_Chain (Elist23) (for a protected procedure)
+ -- Obsolescent_Warning (Node24)
-- Body_Needed_For_SAL (Flag40)
-- Elaboration_Entity_Required (Flag174)
-- Function_Returns_With_DSP (Flag169) (always False for procedure)
@@ -4566,6 +4591,7 @@ package Einfo is
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Null_Init_Proc (Flag178)
+ -- Is_Obsolescent (Flag153)
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Pure (Flag44)
@@ -5114,6 +5140,7 @@ package Einfo is
function Has_Small_Clause (Id : E) return B;
function Has_Specified_Layout (Id : E) return B;
function Has_Storage_Size_Clause (Id : E) return B;
+ function Has_Stream_Size_Clause (Id : E) return B;
function Has_Subprogram_Descriptor (Id : E) return B;
function Has_Task (Id : E) return B;
function Has_Unchecked_Union (Id : E) return B;
@@ -5130,6 +5157,7 @@ package Einfo is
function Is_AST_Entry (Id : E) return B;
function Is_Abstract (Id : E) return B;
function Is_Access_Constant (Id : E) return B;
+ function Is_Ada_2005 (Id : E) return B;
function Is_Aliased (Id : E) return B;
function Is_Asynchronous (Id : E) return B;
function Is_Atomic (Id : E) return B;
@@ -5172,6 +5200,7 @@ package Einfo is
function Is_Machine_Code_Subprogram (Id : E) return B;
function Is_Non_Static_Subtype (Id : E) return B;
function Is_Null_Init_Proc (Id : E) return B;
+ function Is_Obsolescent (Id : E) return B;
function Is_Optional_Parameter (Id : E) return B;
function Is_Package_Body_Entity (Id : E) return B;
function Is_Packed (Id : E) return B;
@@ -5225,6 +5254,7 @@ package Einfo is
function Normalized_Position (Id : E) return U;
function Normalized_Position_Max (Id : E) return U;
function Object_Ref (Id : E) return E;
+ function Obsolescent_Warning (Id : E) return N;
function Original_Access_Type (Id : E) return E;
function Original_Array_Type (Id : E) return E;
function Original_Record_Component (Id : E) return E;
@@ -5385,6 +5415,7 @@ package Einfo is
function Root_Type (Id : E) return E;
function Scope_Depth_Set (Id : E) return B;
function Size_Clause (Id : E) return N;
+ function Stream_Size_Clause (Id : E) return N;
function Tag_Component (Id : E) return E;
function Type_High_Bound (Id : E) return N;
function Type_Low_Bound (Id : E) return N;
@@ -5583,6 +5614,7 @@ package Einfo is
procedure Set_Has_Small_Clause (Id : E; V : B := True);
procedure Set_Has_Specified_Layout (Id : E; V : B := True);
procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True);
+ procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Subprogram_Descriptor (Id : E; V : B := True);
procedure Set_Has_Task (Id : E; V : B := True);
procedure Set_Has_Unchecked_Union (Id : E; V : B := True);
@@ -5599,6 +5631,7 @@ package Einfo is
procedure Set_Is_AST_Entry (Id : E; V : B := True);
procedure Set_Is_Abstract (Id : E; V : B := True);
procedure Set_Is_Access_Constant (Id : E; V : B := True);
+ procedure Set_Is_Ada_2005 (Id : E; V : B := True);
procedure Set_Is_Aliased (Id : E; V : B := True);
procedure Set_Is_Asynchronous (Id : E; V : B := True);
procedure Set_Is_Atomic (Id : E; V : B := True);
@@ -5646,6 +5679,7 @@ package Einfo is
procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True);
procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True);
procedure Set_Is_Null_Init_Proc (Id : E; V : B := True);
+ procedure Set_Is_Obsolescent (Id : E; V : B := True);
procedure Set_Is_Optional_Parameter (Id : E; V : B := True);
procedure Set_Is_Overriding_Operation (Id : E; V : B := True);
procedure Set_Is_Package_Body_Entity (Id : E; V : B := True);
@@ -5699,6 +5733,7 @@ package Einfo is
procedure Set_Normalized_Position (Id : E; V : U);
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_Original_Access_Type (Id : E; V : E);
procedure Set_Original_Array_Type (Id : E; V : E);
procedure Set_Original_Record_Component (Id : E; V : E);
@@ -6109,6 +6144,7 @@ package Einfo is
pragma Inline (Has_Small_Clause);
pragma Inline (Has_Specified_Layout);
pragma Inline (Has_Storage_Size_Clause);
+ pragma Inline (Has_Stream_Size_Clause);
pragma Inline (Has_Subprogram_Descriptor);
pragma Inline (Has_Task);
pragma Inline (Has_Unchecked_Union);
@@ -6125,6 +6161,7 @@ package Einfo is
pragma Inline (Is_AST_Entry);
pragma Inline (Is_Abstract);
pragma Inline (Is_Access_Constant);
+ pragma Inline (Is_Ada_2005);
pragma Inline (Is_Access_Type);
pragma Inline (Is_Aliased);
pragma Inline (Is_Array_Type);
@@ -6194,6 +6231,7 @@ package Einfo is
pragma Inline (Is_Named_Number);
pragma Inline (Is_Non_Static_Subtype);
pragma Inline (Is_Null_Init_Proc);
+ pragma Inline (Is_Obsolescent);
pragma Inline (Is_Numeric_Type);
pragma Inline (Is_Object);
pragma Inline (Is_Optional_Parameter);
@@ -6261,6 +6299,7 @@ package Einfo is
pragma Inline (Normalized_Position);
pragma Inline (Normalized_Position_Max);
pragma Inline (Object_Ref);
+ pragma Inline (Obsolescent_Warning);
pragma Inline (Original_Access_Type);
pragma Inline (Original_Array_Type);
pragma Inline (Original_Record_Component);
@@ -6468,6 +6507,7 @@ package Einfo is
pragma Inline (Set_Is_AST_Entry);
pragma Inline (Set_Is_Abstract);
pragma Inline (Set_Is_Access_Constant);
+ pragma Inline (Set_Is_Ada_2005);
pragma Inline (Set_Is_Aliased);
pragma Inline (Set_Is_Asynchronous);
pragma Inline (Set_Is_Atomic);
@@ -6515,6 +6555,7 @@ package Einfo is
pragma Inline (Set_Is_Machine_Code_Subprogram);
pragma Inline (Set_Is_Non_Static_Subtype);
pragma Inline (Set_Is_Null_Init_Proc);
+ pragma Inline (Set_Is_Obsolescent);
pragma Inline (Set_Is_Optional_Parameter);
pragma Inline (Set_Is_Overriding_Operation);
pragma Inline (Set_Is_Package_Body_Entity);
@@ -6568,6 +6609,7 @@ package Einfo is
pragma Inline (Set_Normalized_Position);
pragma Inline (Set_Normalized_Position_Max);
pragma Inline (Set_Object_Ref);
+ pragma Inline (Set_Obsolescent_Warning);
pragma Inline (Set_Original_Access_Type);
pragma Inline (Set_Original_Array_Type);
pragma Inline (Set_Original_Record_Component);
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 9751d2a2ceb..6ddda3f0d45 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -1090,7 +1090,9 @@ package body Errout is
-- Source_Reference. This ensures outputting the proper name of
-- the source file in this situation.
- if Num_SRef_Pragmas (Main_Source_File) /= 0 then
+ if Main_Source_File = No_Source_File or else
+ Num_SRef_Pragmas (Main_Source_File) /= 0
+ then
Current_Error_Source_File := No_Source_File;
end if;
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 5337391dde2..ad2dcbe1326 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -67,6 +67,20 @@ package body Exp_Aggr is
type Case_Table_Type is array (Nat range <>) of Case_Bounds;
-- Table type used by Check_Case_Choices procedure
+ function Must_Slide
+ (Obj_Type : Entity_Id;
+ Typ : Entity_Id) return Boolean;
+ -- A static array aggregate in an object declaration can in most cases be
+ -- expanded in place. The one exception is when the aggregate is given
+ -- with component associations that specify different bounds from those of
+ -- the type definition in the object declaration. In this pathological
+ -- case the aggregate must slide, and we must introduce an intermediate
+ -- temporary to hold it.
+ --
+ -- The same holds in an assignment to one-dimensional array of arrays,
+ -- when a component may be given with bounds that differ from those of the
+ -- component type.
+
procedure Sort_Case_Table (Case_Table : in out Case_Table_Type);
-- Sort the Case Table using the Lower Bound of each Choice as the key.
-- A simple insertion sort is used since the number of choices in a case
@@ -110,16 +124,16 @@ package body Exp_Aggr is
Flist : Node_Id := Empty;
Obj : Entity_Id := Empty;
Is_Limited_Ancestor_Expansion : Boolean := False) return List_Id;
- -- N is an N_Aggregate or a N_Extension_Aggregate. Typ is the type
- -- of the aggregate. Target is an expression containing the
- -- location on which the component by component assignments will
- -- take place. Returns the list of assignments plus all other
- -- adjustments needed for tagged and controlled types. Flist is an
- -- expression representing the finalization list on which to
- -- attach the controlled components if any. Obj is present in the
- -- object declaration and dynamic allocation cases, it contains
- -- an entity that allows to know if the value being created needs to be
- -- attached to the final list in case of pragma finalize_Storage_Only.
+ -- N is an N_Aggregate or a N_Extension_Aggregate. Typ is the type of the
+ -- aggregate. Target is an expression containing the location on which the
+ -- component by component assignments will take place. Returns the list of
+ -- assignments plus all other adjustments needed for tagged and controlled
+ -- types. Flist is an expression representing the finalization list on
+ -- which to attach the controlled components if any. Obj is present in the
+ -- object declaration and dynamic allocation cases, it contains an entity
+ -- that allows to know if the value being created needs to be attached to
+ -- the final list in case of pragma finalize_Storage_Only.
+ --
-- Is_Limited_Ancestor_Expansion indicates that the function has been
-- called recursively to expand the limited ancestor to avoid copying it.
@@ -159,19 +173,19 @@ package body Exp_Aggr is
Max_Others_Replicate : Nat := 5;
Handle_Bit_Packed : Boolean := False);
-- If possible, convert named notation to positional notation. This
- -- conversion is possible only in some static cases. If the conversion
- -- is possible, then N is rewritten with the analyzed converted
- -- aggregate. The parameter Max_Others_Replicate controls the maximum
- -- number of values corresponding to an others choice that will be
- -- converted to positional notation (the default of 5 is the normal
- -- limit, and reflects the fact that normally the loop is better than
- -- a lot of separate assignments). Note that this limit gets overridden
- -- in any case if either of the restrictions No_Elaboration_Code or
- -- No_Implicit_Loops is set. The parameter Handle_Bit_Packed is usually
- -- set False (since we do not expect the back end to handle bit packed
- -- arrays, so the normal case of conversion is pointless), but in the
- -- special case of a call from Packed_Array_Aggregate_Handled, we set
- -- this parameter to True, since these are cases we handle in there.
+ -- conversion is possible only in some static cases. If the conversion is
+ -- possible, then N is rewritten with the analyzed converted aggregate.
+ -- The parameter Max_Others_Replicate controls the maximum number of
+ -- values corresponding to an others choice that will be converted to
+ -- positional notation (the default of 5 is the normal limit, and reflects
+ -- the fact that normally the loop is better than a lot of separate
+ -- assignments). Note that this limit gets overridden in any case if
+ -- either of the restrictions No_Elaboration_Code or No_Implicit_Loops is
+ -- set. The parameter Handle_Bit_Packed is usually set False (since we do
+ -- not expect the back end to handle bit packed arrays, so the normal case
+ -- of conversion is pointless), but in the special case of a call from
+ -- Packed_Array_Aggregate_Handled, we set this parameter to True, since
+ -- these are cases we handle in there.
procedure Expand_Array_Aggregate (N : Node_Id);
-- This is the top-level routine to perform array aggregate expansion.
@@ -220,18 +234,17 @@ package body Exp_Aggr is
Target : Node_Id;
Flist : Node_Id := Empty;
Obj : Entity_Id := Empty) return List_Id;
- -- N is a nested (record or array) aggregate that has been marked
- -- with 'Delay_Expansion'. Typ is the expected type of the
- -- aggregate and Target is a (duplicable) expression that will
- -- hold the result of the aggregate expansion. Flist is the
- -- finalization list to be used to attach controlled
- -- components. 'Obj' when non empty, carries the original object
- -- being initialized in order to know if it needs to be attached
- -- to the previous parameter which may not be the case when
- -- Finalize_Storage_Only is set. Basically this procedure is used
- -- to implement top-down expansions of nested aggregates. This is
- -- necessary for avoiding temporaries at each level as well as for
- -- propagating the right internal finalization list.
+ -- N is a nested (record or array) aggregate that has been marked with
+ -- 'Delay_Expansion'. Typ is the expected type of the aggregate and Target
+ -- is a (duplicable) expression that will hold the result of the aggregate
+ -- expansion. Flist is the finalization list to be used to attach
+ -- controlled components. 'Obj' when non empty, carries the original
+ -- object being initialized in order to know if it needs to be attached to
+ -- the previous parameter which may not be the case in the case where
+ -- Finalize_Storage_Only is set. Basically this procedure is used to
+ -- implement top-down expansions of nested aggregates. This is necessary
+ -- for avoiding temporaries at each level as well as for propagating the
+ -- right internal finalization list.
function Make_OK_Assignment_Statement
(Sloc : Source_Ptr;
@@ -280,10 +293,10 @@ package body Exp_Aggr is
function Backend_Processing_Possible (N : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (N);
- -- Typ is the correct constrained array subtype of the aggregate.
+ -- Typ is the correct constrained array subtype of the aggregate
function Static_Check (N : Node_Id; Index : Node_Id) return Boolean;
- -- Recursively checks that N is fully positional, returns true if so.
+ -- Recursively checks that N is fully positional, returns true if so
------------------
-- Static_Check --
@@ -352,13 +365,12 @@ package body Exp_Aggr is
end if;
-- Checks 5 (if the component type is tagged, then we may need
- -- to do tag adjustments; perhaps this should be refined to
- -- check for any component associations that actually
- -- need tag adjustment, along the lines of the test that's
- -- done in Has_Delayed_Nested_Aggregate_Or_Tagged_Comps
- -- for record aggregates with tagged components, but not
- -- clear whether it's worthwhile ???; in the case of the
- -- JVM, object tags are handled implicitly)
+ -- to do tag adjustments; perhaps this should be refined to check for
+ -- any component associations that actually need tag adjustment,
+ -- along the lines of the test that is carried out in
+ -- Has_Delayed_Nested_Aggregate_Or_Tagged_Comps for record aggregates
+ -- with tagged components, but not clear whether it's worthwhile ???;
+ -- in the case of the JVM, object tags are handled implicitly)
if Is_Tagged_Type (Component_Type (Typ)) and then not Java_VM then
return False;
@@ -392,11 +404,11 @@ package body Exp_Aggr is
-- we are dealing with an expression we emit a sequence of
-- assignments instead of a loop.
- -- (c) Generate the remaining loops to cover the others choice if any.
+ -- (c) Generate the remaining loops to cover the others choice if any
-- 2. If the aggregate contains positional elements we
- -- (a) translate the positional elements in a series of assignments.
+ -- (a) translate the positional elements in a series of assignments
-- (b) Generate a final loop to cover the others choice if any.
-- Note that this final loop has to be a while loop since the case
@@ -432,18 +444,18 @@ package body Exp_Aggr is
Index_Base_H : constant Node_Id := Type_High_Bound (Index_Base);
function Add (Val : Int; To : Node_Id) return Node_Id;
- -- Returns an expression where Val is added to expression To,
- -- unless To+Val is provably out of To's base type range.
- -- To must be an already analyzed expression.
+ -- Returns an expression where Val is added to expression To, unless
+ -- To+Val is provably out of To's base type range. To must be an
+ -- already analyzed expression.
function Empty_Range (L, H : Node_Id) return Boolean;
- -- Returns True if the range defined by L .. H is certainly empty.
+ -- Returns True if the range defined by L .. H is certainly empty
function Equal (L, H : Node_Id) return Boolean;
- -- Returns True if L = H for sure.
+ -- Returns True if L = H for sure
function Index_Base_Name return Node_Id;
- -- Returns a new reference to the index type name.
+ -- Returns a new reference to the index type name
function Gen_Assign (Ind : Node_Id; Expr : Node_Id) return List_Id;
-- Ind must be a side-effect free expression. If the input aggregate
@@ -452,7 +464,7 @@ package body Exp_Aggr is
--
-- Into (Indices, Ind) := Expr;
--
- -- Otherwise we call Build_Code recursively.
+ -- Otherwise we call Build_Code recursively
--
-- Ada 2005 (AI-287): In case of default initialized component, Expr
-- is empty and we generate a call to the corresponding IP subprogram.
@@ -823,9 +835,30 @@ package body Exp_Aggr is
end if;
if Is_Delayed_Aggregate (Expr_Q) then
- return
- Add_Loop_Actions (
- Late_Expansion (Expr_Q, Etype (Expr_Q), Indexed_Comp, F));
+
+ -- This is either a subaggregate of a multidimentional array,
+ -- or a component of an array type whose component type is
+ -- also an array. In the latter case, the expression may have
+ -- component associations that provide different bounds from
+ -- those of the component type, and sliding must occur. Instead
+ -- of decomposing the current aggregate assignment, force the
+ -- re-analysis of the assignment, so that a temporary will be
+ -- generated in the usual fashion, and sliding will take place.
+
+ if Nkind (Parent (N)) = N_Assignment_Statement
+ and then Is_Array_Type (Comp_Type)
+ and then Present (Component_Associations (Expr_Q))
+ and then Must_Slide (Comp_Type, Etype (Expr_Q))
+ then
+ Set_Expansion_Delayed (Expr_Q, False);
+ Set_Analyzed (Expr_Q, False);
+
+ else
+ return
+ Add_Loop_Actions (
+ Late_Expansion (
+ Expr_Q, Etype (Expr_Q), Indexed_Comp, F));
+ end if;
end if;
end if;
@@ -1268,7 +1301,7 @@ package body Exp_Aggr is
Sort_Case_Table (Table);
end if;
- -- STEP 1 (b): take care of the whole set of discrete choices.
+ -- STEP 1 (b): take care of the whole set of discrete choices
for J in 1 .. Nb_Choices loop
Low := Table (J).Choice_Lo;
@@ -2470,7 +2503,7 @@ package body Exp_Aggr is
Next_Elmt (Disc2);
end loop;
- -- If any discriminant constraint is non-static, emit a check.
+ -- If any discriminant constraint is non-static, emit a check
if Present (Cond) then
Insert_Action (N,
@@ -2632,10 +2665,11 @@ package body Exp_Aggr is
(N : Node_Id;
Ix : Node_Id;
Ixb : Node_Id) return Boolean;
- -- Convert the aggregate into a purely positional form if possible.
+ -- Convert the aggregate into a purely positional form if possible
function Is_Flat (N : Node_Id; Dims : Int) return Boolean;
- -- Non trivial for multidimensional aggregate.
+ -- Return True iff the array N is flat (which is not rivial
+ -- in the case of multidimensionsl aggregates).
-------------
-- Flatten --
@@ -2985,14 +3019,14 @@ package body Exp_Aggr is
-- Ctyp is the corresponding component type.
Aggr_Dimension : constant Pos := Number_Dimensions (Typ);
- -- Number of aggregate index dimensions.
+ -- Number of aggregate index dimensions
Aggr_Low : array (1 .. Aggr_Dimension) of Node_Id;
Aggr_High : array (1 .. Aggr_Dimension) of Node_Id;
- -- Low and High bounds of the constraint for each aggregate index.
+ -- Low and High bounds of the constraint for each aggregate index
Aggr_Index_Typ : array (1 .. Aggr_Dimension) of Entity_Id;
- -- The type of each index.
+ -- The type of each index
Maybe_In_Place_OK : Boolean;
-- If the type is neither controlled nor packed and the aggregate
@@ -3035,14 +3069,6 @@ package body Exp_Aggr is
-- be done in place, because none of the new values can depend on the
-- components of the target of the assignment.
- function Must_Slide (N : Node_Id; Typ : Entity_Id) return Boolean;
- -- A static aggregate in an object declaration can in most cases be
- -- expanded in place. The one exception is when the aggregate is given
- -- with component associations that specify different bounds from those
- -- of the type definition in the object declaration. In this rather
- -- pathological case the aggregate must slide, and we must introduce
- -- an intermediate temporary to hold it.
-
procedure Others_Check (Sub_Aggr : Node_Id; Dim : Pos);
-- Checks that if an others choice is present in any sub-aggregate no
-- aggregate index is outside the bounds of the index constraint.
@@ -3209,14 +3235,14 @@ package body Exp_Aggr is
procedure Check_Same_Aggr_Bounds (Sub_Aggr : Node_Id; Dim : Pos) is
Sub_Lo : constant Node_Id := Low_Bound (Aggregate_Bounds (Sub_Aggr));
Sub_Hi : constant Node_Id := High_Bound (Aggregate_Bounds (Sub_Aggr));
- -- The bounds of this specific sub-aggregate.
+ -- The bounds of this specific sub-aggregate
Aggr_Lo : constant Node_Id := Aggr_Low (Dim);
Aggr_Hi : constant Node_Id := Aggr_High (Dim);
-- The bounds of the aggregate for this dimension
Ind_Typ : constant Entity_Id := Aggr_Index_Typ (Dim);
- -- The index type for this dimension.
+ -- The index type for this dimension.xxx
Cond : Node_Id := Empty;
@@ -3463,7 +3489,7 @@ package body Exp_Aggr is
Comp : Node_Id := Expr;
function Check_Component (Comp : Node_Id) return Boolean;
- -- Do the recursive traversal, after copy.
+ -- Do the recursive traversal, after copy
---------------------
-- Check_Component --
@@ -3518,7 +3544,8 @@ package body Exp_Aggr is
return False;
elsif Nkind (Expr) = N_Allocator then
- -- For now, too complex to analyze.
+
+ -- For now, too complex to analyze
return False;
end if;
@@ -3586,55 +3613,11 @@ package body Exp_Aggr is
end loop;
end if;
- -- Now check the component values themselves.
+ -- Now check the component values themselves
return Safe_Aggregate (N);
end In_Place_Assign_OK;
- ----------------
- -- Must_Slide --
- ----------------
-
- function Must_Slide (N : Node_Id; Typ : Entity_Id) return Boolean
- is
- Obj_Type : constant Entity_Id :=
- Etype (Defining_Identifier (Parent (N)));
-
- L1, L2, H1, H2 : Node_Id;
-
- begin
- -- No sliding if the type of the object is not established yet, if
- -- it is an unconstrained type whose actual subtype comes from the
- -- aggregate, or if the two types are identical.
-
- if not Is_Array_Type (Obj_Type) then
- return False;
-
- elsif not Is_Constrained (Obj_Type) then
- return False;
-
- elsif Typ = Obj_Type then
- return False;
-
- else
- -- Sliding can only occur along the first dimension
-
- Get_Index_Bounds (First_Index (Typ), L1, H1);
- Get_Index_Bounds (First_Index (Obj_Type), L2, H2);
-
- if not Is_Static_Expression (L1)
- or else not Is_Static_Expression (L2)
- or else not Is_Static_Expression (H1)
- or else not Is_Static_Expression (H2)
- then
- return False;
- else
- return Expr_Value (L1) /= Expr_Value (L2)
- or else Expr_Value (H1) /= Expr_Value (H2);
- end if;
- end if;
- end Must_Slide;
-
------------------
-- Others_Check --
------------------
@@ -3642,10 +3625,10 @@ package body Exp_Aggr is
procedure Others_Check (Sub_Aggr : Node_Id; Dim : Pos) is
Aggr_Lo : constant Node_Id := Aggr_Low (Dim);
Aggr_Hi : constant Node_Id := Aggr_High (Dim);
- -- The bounds of the aggregate for this dimension.
+ -- The bounds of the aggregate for this dimension
Ind_Typ : constant Entity_Id := Aggr_Index_Typ (Dim);
- -- The index type for this dimension.
+ -- The index type for this dimension
Need_To_Check : Boolean := False;
@@ -3886,7 +3869,7 @@ package body Exp_Aggr is
pragma Assert (not Raises_Constraint_Error (N));
- -- STEP 1a.
+ -- STEP 1a
-- Check that the index range defined by aggregate bounds is
-- compatible with corresponding index subtype.
@@ -3934,14 +3917,14 @@ package body Exp_Aggr is
end loop;
end Index_Compatibility_Check;
- -- STEP 1b.
+ -- STEP 1b
-- If an others choice is present check that no aggregate
-- index is outside the bounds of the index constraint.
Others_Check (N, 1);
- -- STEP 1c.
+ -- STEP 1c
-- For multidimensional arrays make sure that all subaggregates
-- corresponding to the same dimension have the same bounds.
@@ -3950,7 +3933,7 @@ package body Exp_Aggr is
Check_Same_Aggr_Bounds (N, 1);
end if;
- -- STEP 2.
+ -- STEP 2
-- Here we test for is packed array aggregate that we can handle
-- at compile time. If so, return with transformation done. Note
@@ -4017,7 +4000,7 @@ package body Exp_Aggr is
return;
end if;
- -- STEP 3.
+ -- STEP 3
-- Delay expansion for nested aggregates it will be taken care of
-- when the parent aggregate is expanded
@@ -4042,7 +4025,7 @@ package body Exp_Aggr is
return;
end if;
- -- STEP 4.
+ -- STEP 4
-- Look if in place aggregate expansion is possible
@@ -4086,7 +4069,8 @@ package body Exp_Aggr is
if not Has_Default_Init_Comps (N)
and then Comes_From_Source (Parent (N))
and then Nkind (Parent (N)) = N_Object_Declaration
- and then not Must_Slide (N, Typ)
+ and then not
+ Must_Slide (Etype (Defining_Identifier (Parent (N))), Typ)
and then N = Expression (Parent (N))
and then not Is_Bit_Packed_Array (Typ)
and then not Has_Controlled_Component (Typ)
@@ -4120,7 +4104,7 @@ package body Exp_Aggr is
Set_Expansion_Delayed (N);
return;
- -- In the remaining cases the aggregate is the RHS of an assignment.
+ -- In the remaining cases the aggregate is the RHS of an assignment
elsif Maybe_In_Place_OK
and then Is_Entity_Name (Name (Parent (N)))
@@ -4602,7 +4586,7 @@ package body Exp_Aggr is
if Is_Tagged_Type (Typ) then
- -- The tagged case, _parent and _tag component must be created.
+ -- The tagged case, _parent and _tag component must be created
-- Reset null_present unconditionally. tagged records always have
-- at least one field (the tag or the parent)
@@ -5164,6 +5148,48 @@ package body Exp_Aggr is
end if;
end Initialize_Discriminants;
+ ----------------
+ -- Must_Slide --
+ ----------------
+
+ function Must_Slide
+ (Obj_Type : Entity_Id;
+ Typ : Entity_Id) return Boolean
+ is
+ L1, L2, H1, H2 : Node_Id;
+ begin
+ -- No sliding if the type of the object is not established yet, if
+ -- it is an unconstrained type whose actual subtype comes from the
+ -- aggregate, or if the two types are identical.
+
+ if not Is_Array_Type (Obj_Type) then
+ return False;
+
+ elsif not Is_Constrained (Obj_Type) then
+ return False;
+
+ elsif Typ = Obj_Type then
+ return False;
+
+ else
+ -- Sliding can only occur along the first dimension
+
+ Get_Index_Bounds (First_Index (Typ), L1, H1);
+ Get_Index_Bounds (First_Index (Obj_Type), L2, H2);
+
+ if not Is_Static_Expression (L1)
+ or else not Is_Static_Expression (L2)
+ or else not Is_Static_Expression (H1)
+ or else not Is_Static_Expression (H2)
+ then
+ return False;
+ else
+ return Expr_Value (L1) /= Expr_Value (L2)
+ or else Expr_Value (H1) /= Expr_Value (H2);
+ end if;
+ end if;
+ end Must_Slide;
+
---------------------------
-- Safe_Slice_Assignment --
---------------------------
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index fa99d8bd1ad..7c965cd2a7f 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -497,12 +497,15 @@ package body Exp_Attr is
-- Start of processing for Expand_N_Attribute_Reference
begin
- -- Do required validity checking
+ -- Do required validity checking, if enabled. Do not apply check to
+ -- output parameters of an Asm instruction, since the value of this
+ -- is not set till after the attribute has been elaborated.
- if Validity_Checks_On and Validity_Check_Operands then
+ if Validity_Checks_On and then Validity_Check_Operands
+ and then Id /= Attribute_Asm_Output
+ then
declare
Expr : Node_Id;
-
begin
Expr := First (Expressions (N));
while Present (Expr) loop
@@ -1901,7 +1904,7 @@ package body Exp_Attr is
-- Now we need to get the entity for the call, and construct
-- a function call node, where we preset a reference to Dnn
-- as the controlling argument (doing an unchecked
- -- conversion to the classwide tagged type to make it
+ -- conversion to the class-wide tagged type to make it
-- look like a real tagged object).
Fname := Find_Prim_Op (Rtyp, TSS_Stream_Input);
@@ -2398,8 +2401,6 @@ package body Exp_Attr is
Make_Integer_Literal (Loc,
Intval => 1))))))));
-
-
end if;
Analyze_And_Resolve (N, Btyp);
@@ -3153,7 +3154,7 @@ package body Exp_Attr is
Rewrite (Prefix (N), New_Occurrence_Of (Entity (Pref), Loc));
return;
- -- For x'Size applied to an object of a class wide type, transform
+ -- For x'Size applied to an object of a class-wide type, transform
-- X'Size into a call to the primitive operation _Size applied to X.
elsif Is_Class_Wide_Type (Ptyp) then
@@ -3232,8 +3233,7 @@ package body Exp_Attr is
-- Common processing for record and array component case
if Siz /= 0 then
- Rewrite (N,
- Make_Integer_Literal (Loc, Siz));
+ Rewrite (N, Make_Integer_Literal (Loc, Siz));
Analyze_And_Resolve (N, Typ);
@@ -3364,6 +3364,29 @@ package body Exp_Attr is
end if;
end Storage_Size;
+ -----------------
+ -- Stream_Size --
+ -----------------
+
+ when Attribute_Stream_Size => Stream_Size : declare
+ Ptyp : constant Entity_Id := Etype (Pref);
+ Size : Int;
+
+ begin
+ -- If we have a Stream_Size clause for this type use it, otherwise
+ -- the Stream_Size if the size of the type.
+
+ if Has_Stream_Size_Clause (Ptyp) then
+ Size := UI_To_Int
+ (Static_Integer (Expression (Stream_Size_Clause (Ptyp))));
+ else
+ Size := UI_To_Int (Esize (Ptyp));
+ end if;
+
+ Rewrite (N, Make_Integer_Literal (Loc, Intval => Size));
+ Analyze_And_Resolve (N, Typ);
+ end Stream_Size;
+
----------
-- Succ --
----------
@@ -3998,6 +4021,39 @@ package body Exp_Attr is
Analyze_And_Resolve (N, Standard_Wide_String);
end Wide_Image;
+ ---------------------
+ -- Wide_Wide_Image --
+ ---------------------
+
+ -- We expand typ'Wide_Wide_Image (X) into
+
+ -- String_To_Wide_Wide_String
+ -- (typ'Image (X), Wide_Character_Encoding_Method)
+
+ -- This works in all cases because String_To_Wide_Wide_String converts
+ -- any wide character escape sequences resulting from the Image call to
+ -- the proper Wide_Character equivalent
+
+ -- not quite right for typ = Wide_Wide_Character ???
+
+ when Attribute_Wide_Wide_Image => Wide_Wide_Image :
+ begin
+ Rewrite (N,
+ Make_Function_Call (Loc,
+ Name => New_Reference_To
+ (RTE (RE_String_To_Wide_Wide_String), Loc),
+ Parameter_Associations => New_List (
+ Make_Attribute_Reference (Loc,
+ Prefix => Pref,
+ Attribute_Name => Name_Image,
+ Expressions => Exprs),
+
+ Make_Integer_Literal (Loc,
+ Intval => Int (Wide_Character_Encoding_Method)))));
+
+ Analyze_And_Resolve (N, Standard_Wide_Wide_String);
+ end Wide_Wide_Image;
+
----------------
-- Wide_Value --
----------------
@@ -4036,6 +4092,53 @@ package body Exp_Attr is
Analyze_And_Resolve (N, Typ);
end Wide_Value;
+ ---------------------
+ -- Wide_Wide_Value --
+ ---------------------
+
+ -- We expand typ'Wide_Value_Value (X) into
+
+ -- typ'Value
+ -- (Wide_Wide_String_To_String (X, Wide_Character_Encoding_Method))
+
+ -- Wide_Wide_String_To_String is a runtime function that converts its
+ -- wide string argument to String, converting any non-translatable
+ -- characters into appropriate escape sequences. This preserves the
+ -- required semantics of Wide_Wide_Value in all cases, and results in a
+ -- very simple implementation approach.
+
+ -- It's not quite right where typ = Wide_Wide_Character, because the
+ -- encoding method may not cover the whole character type ???
+
+ when Attribute_Wide_Wide_Value => Wide_Wide_Value :
+ begin
+ Rewrite (N,
+ Make_Attribute_Reference (Loc,
+ Prefix => Pref,
+ Attribute_Name => Name_Value,
+
+ Expressions => New_List (
+ Make_Function_Call (Loc,
+ Name =>
+ New_Reference_To (RTE (RE_Wide_Wide_String_To_String), Loc),
+
+ Parameter_Associations => New_List (
+ Relocate_Node (First (Exprs)),
+ Make_Integer_Literal (Loc,
+ Intval => Int (Wide_Character_Encoding_Method)))))));
+
+ Analyze_And_Resolve (N, Typ);
+ end Wide_Wide_Value;
+
+ ---------------------
+ -- Wide_Wide_Width --
+ ---------------------
+
+ -- Wide_Wide_Width attribute is handled in separate unit Exp_Imgv
+
+ when Attribute_Wide_Wide_Width =>
+ Exp_Imgv.Expand_Width_Attribute (N, Wide_Wide);
+
----------------
-- Wide_Width --
----------------
@@ -4043,7 +4146,7 @@ package body Exp_Attr is
-- Wide_Width attribute is handled in separate unit Exp_Imgv
when Attribute_Wide_Width =>
- Exp_Imgv.Expand_Width_Attribute (N, Wide => True);
+ Exp_Imgv.Expand_Width_Attribute (N, Wide);
-----------
-- Width --
@@ -4052,7 +4155,7 @@ package body Exp_Attr is
-- Width attribute is handled in separate unit Exp_Imgv
when Attribute_Width =>
- Exp_Imgv.Expand_Width_Attribute (N, Wide => False);
+ Exp_Imgv.Expand_Width_Attribute (N, Normal);
-----------
-- Write --
@@ -4318,7 +4421,6 @@ package body Exp_Attr is
New_Reference_To (Base_Type (Etype (Prefix (N))), Loc),
Attribute_Name => Cnam)),
Reason => CE_Overflow_Check_Failed));
-
end Expand_Pred_Succ;
------------------------
@@ -4354,7 +4456,6 @@ package body Exp_Attr is
end if;
return Proc;
-
end Find_Inherited_TSS;
----------------------------
diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb
index 80ac70db61a..35084860c8c 100644
--- a/gcc/ada/exp_ch11.adb
+++ b/gcc/ada/exp_ch11.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -921,7 +921,9 @@ package body Exp_Ch11 is
-- Lang component: 'A'
Append_To (L,
- Make_Character_Literal (Loc, Name_uA, Get_Char_Code ('A')));
+ Make_Character_Literal (Loc,
+ Chars => Name_uA,
+ Char_Literal_Value => UI_From_Int (Character'Pos ('A'))));
-- Name_Length component: Nam'Length
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index a09f7f57288..1d027d05176 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -60,7 +60,6 @@ with Stand; use Stand;
with Snames; use Snames;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
-with Uintp; use Uintp;
with Validsw; use Validsw;
package body Exp_Ch3 is
@@ -487,7 +486,9 @@ package body Exp_Ch3 is
return New_List (
Make_Assignment_Statement (Loc,
Name => Comp,
- Expression => Get_Simple_Init_Val (Comp_Type, Loc)));
+ Expression =>
+ Get_Simple_Init_Val
+ (Comp_Type, Loc, Component_Size (A_Type))));
else
return
@@ -567,11 +568,12 @@ package body Exp_Ch3 is
-- apply in this case), and we must generate a procedure (even if it is
-- null) to satisfy the call in this case.
- -- Exception: do not build an array init_proc for a type whose root type
- -- is Standard.String or Standard.Wide_String, since there is no place
- -- to put the code, and in any case we handle initialization of such
- -- types (in the Initialize_Scalars case, that's the only time the issue
- -- arises) in a special manner anyway which does not need an init_proc.
+ -- Exception: do not build an array init_proc for a type whose root
+ -- type is Standard.String or Standard.Wide_[Wide_]String, since there
+ -- is no place to put the code, and in any case we handle initialization
+ -- of such types (in the Initialize_Scalars case, that's the only time
+ -- the issue arises) in a special manner anyway which does not need an
+ -- init_proc.
if Has_Non_Null_Base_Init_Proc (Comp_Type)
or else Needs_Simple_Initialization (Comp_Type)
@@ -579,7 +581,8 @@ package body Exp_Ch3 is
or else (not Restriction_Active (No_Initialize_Scalars)
and then Is_Public (A_Type)
and then Root_Type (A_Type) /= Standard_String
- and then Root_Type (A_Type) /= Standard_Wide_String)
+ and then Root_Type (A_Type) /= Standard_Wide_String
+ and then Root_Type (A_Type) /= Standard_Wide_Wide_String)
then
Proc_Id :=
Make_Defining_Identifier (Loc, Make_Init_Proc_Name (A_Type));
@@ -654,6 +657,7 @@ package body Exp_Ch3 is
-- Nothing to do if we already built a master entity for this scope
if not Has_Master_Entity (Scope (T)) then
+
-- first build the master entity
-- _Master : constant Master_Id := Current_Master.all;
-- and insert it just before the current declaration
@@ -1996,7 +2000,8 @@ package body Exp_Ch3 is
elsif Component_Needs_Simple_Initialization (Typ) then
Stmts :=
- Build_Assignment (Id, Get_Simple_Init_Val (Typ, Loc));
+ Build_Assignment
+ (Id, Get_Simple_Init_Val (Typ, Loc, Esize (Id)));
-- Nothing needed for this case
@@ -2058,7 +2063,8 @@ package body Exp_Ch3 is
elsif Component_Needs_Simple_Initialization (Typ) then
Append_List_To (Statement_List,
- Build_Assignment (Id, Get_Simple_Init_Val (Typ, Loc)));
+ Build_Assignment
+ (Id, Get_Simple_Init_Val (Typ, Loc, Esize (Id))));
end if;
end if;
@@ -3403,7 +3409,7 @@ package body Exp_Ch3 is
elsif Needs_Simple_Initialization (Typ) then
Set_No_Initialization (N, False);
- Set_Expression (N, Get_Simple_Init_Val (Typ, Loc));
+ Set_Expression (N, Get_Simple_Init_Val (Typ, Loc, Esize (Def_Id)));
Analyze_And_Resolve (Expression (N), Typ);
end if;
@@ -3877,13 +3883,14 @@ package body Exp_Ch3 is
then
null;
- -- We do not need an init proc for string or wide string, since
- -- the only time these need initialization in normalize or
+ -- We do not need an init proc for string or wide [wide] string,
+ -- since the only time these need initialization in normalize or
-- initialize scalars mode, and these types are treated specially
-- and do not need initialization procedures.
elsif Root_Type (Base) = Standard_String
or else Root_Type (Base) = Standard_Wide_String
+ or else Root_Type (Base) = Standard_Wide_Wide_String
then
null;
@@ -4878,14 +4885,87 @@ package body Exp_Ch3 is
-------------------------
function Get_Simple_Init_Val
- (T : Entity_Id;
- Loc : Source_Ptr) return Node_Id
+ (T : Entity_Id;
+ Loc : Source_Ptr;
+ Size : Uint := No_Uint) return Node_Id
is
Val : Node_Id;
- Typ : Node_Id;
Result : Node_Id;
Val_RE : RE_Id;
+ Size_To_Use : Uint;
+ -- This is the size to be used for computation of the appropriate
+ -- initial value for the Normalize_Scalars and Initialize_Scalars case.
+
+ Lo_Bound : Uint;
+ Hi_Bound : Uint;
+ -- These are the values computed by the procedure Check_Subtype_Bounds
+
+ procedure Check_Subtype_Bounds;
+ -- This procedure examines the subtype T, and its ancestor subtypes
+ -- and derived types to determine the best known information about
+ -- the bounds of the subtype. After the call Lo_Bound is set either
+ -- to No_Uint if no information can be determined, or to a value which
+ -- represents a known low bound, i.e. a valid value of the subtype can
+ -- not be less than this value. Hi_Bound is similarly set to a known
+ -- high bound (valid value cannot be greater than this).
+
+ --------------------------
+ -- Check_Subtype_Bounds --
+ --------------------------
+
+ procedure Check_Subtype_Bounds is
+ ST1 : Entity_Id;
+ ST2 : Entity_Id;
+ Lo : Node_Id;
+ Hi : Node_Id;
+ Loval : Uint;
+ Hival : Uint;
+
+ begin
+ Lo_Bound := No_Uint;
+ Hi_Bound := No_Uint;
+
+ -- Loop to climb ancestor subtypes and derived types
+
+ ST1 := T;
+ loop
+ if not Is_Discrete_Type (ST1) then
+ return;
+ end if;
+
+ Lo := Type_Low_Bound (ST1);
+ Hi := Type_High_Bound (ST1);
+
+ if Compile_Time_Known_Value (Lo) then
+ Loval := Expr_Value (Lo);
+
+ if Lo_Bound = No_Uint or else Lo_Bound < Loval then
+ Lo_Bound := Loval;
+ end if;
+ end if;
+
+ if Compile_Time_Known_Value (Hi) then
+ Hival := Expr_Value (Hi);
+
+ if Hi_Bound = No_Uint or else Hi_Bound > Hival then
+ Hi_Bound := Hival;
+ end if;
+ end if;
+
+ ST2 := Ancestor_Subtype (ST1);
+
+ if No (ST2) then
+ ST2 := Etype (ST1);
+ end if;
+
+ exit when ST1 = ST2;
+ ST1 := ST2;
+ end loop;
+ end Check_Subtype_Bounds;
+
+ -- Start of processing for Get_Simple_Init_Val
+
begin
-- For a private type, we should always have an underlying type
-- (because this was already checked in Needs_Simple_Initialization).
@@ -4893,7 +4973,7 @@ package body Exp_Ch3 is
-- do an Unchecked_Convert to the private type.
if Is_Private_Type (T) then
- Val := Get_Simple_Init_Val (Underlying_Type (T), Loc);
+ Val := Get_Simple_Init_Val (Underlying_Type (T), Loc, Size);
-- A special case, if the underlying value is null, then qualify
-- it with the underlying type, so that the null is properly typed
@@ -4927,46 +5007,98 @@ package body Exp_Ch3 is
elsif Is_Scalar_Type (T) then
pragma Assert (Init_Or_Norm_Scalars);
+ -- Compute size of object. If it is given by the caller, we can
+ -- use it directly, otherwise we use Esize (T) as an estimate. As
+ -- far as we know this covers all cases correctly.
+
+ if Size = No_Uint or else Size <= Uint_0 then
+ Size_To_Use := UI_Max (Uint_1, Esize (T));
+ else
+ Size_To_Use := Size;
+ end if;
+
+ -- Maximum size to use is 64 bits, since we will create values
+ -- of type Unsigned_64 and the range must fit this type.
+
+ if Size_To_Use /= No_Uint and then Size_To_Use > Uint_64 then
+ Size_To_Use := Uint_64;
+ end if;
+
+ -- Check known bounds of subtype
+
+ Check_Subtype_Bounds;
+
-- Processing for Normalize_Scalars case
if Normalize_Scalars then
- -- First prepare a value (out of subtype range if possible)
+ -- If zero is invalid, it is a convenient value to use that is
+ -- for sure an appropriate invalid value in all situations.
+
+ if Lo_Bound /= No_Uint and then Lo_Bound > Uint_0 then
+ Val := Make_Integer_Literal (Loc, 0);
+
+ -- Cases where all one bits is the appropriate invalid value
+
+ -- For modular types, all 1 bits is either invalid or valid. If
+ -- it is valid, then there is nothing that can be done since there
+ -- are no invalid values (we ruled out zero already).
+
+ -- For signed integer types that have no negative values, either
+ -- there is room for negative values, or there is not. If there
+ -- is, then all 1 bits may be interpretecd as minus one, which is
+ -- certainly invalid. Alternatively it is treated as the largest
+ -- positive value, in which case the observation for modular types
+ -- still applies.
+
+ -- For float types, all 1-bits is a NaN (not a number), which is
+ -- certainly an appropriately invalid value.
- if Is_Real_Type (T) or else Is_Integer_Type (T) then
- Val :=
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (Base_Type (T), Loc),
- Attribute_Name => Name_First);
+ elsif Is_Unsigned_Type (T)
+ or else Is_Floating_Point_Type (T)
+ or else Is_Enumeration_Type (T)
+ then
+ Val := Make_Integer_Literal (Loc, 2 ** Size_To_Use - 1);
+
+ -- Resolve as Unsigned_64, because the largest number we
+ -- can generate is out of range of universal integer.
+
+ Analyze_And_Resolve (Val, RTE (RE_Unsigned_64));
- elsif Is_Modular_Integer_Type (T) then
- Val :=
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (Base_Type (T), Loc),
- Attribute_Name => Name_Last);
+ -- Case of signed types
else
- pragma Assert (Is_Enumeration_Type (T));
-
- if Esize (T) <= 8 then
- Typ := RTE (RE_Unsigned_8);
- elsif Esize (T) <= 16 then
- Typ := RTE (RE_Unsigned_16);
- elsif Esize (T) <= 32 then
- Typ := RTE (RE_Unsigned_32);
- else
- Typ := RTE (RE_Unsigned_64);
- end if;
+ declare
+ Signed_Size : constant Uint :=
+ UI_Min (Uint_63, Size_To_Use - 1);
+
+ begin
+ -- Normally we like to use the most negative number. The
+ -- one exception is when this number is in the known subtype
+ -- range and the largest positive number is not in the known
+ -- subtype range.
+
+ -- For this exceptional case, use largest positive value
- Val :=
- Make_Attribute_Reference (Loc,
- Prefix => New_Occurrence_Of (Typ, Loc),
- Attribute_Name => Name_Last);
+ if Lo_Bound /= No_Uint and then Hi_Bound /= No_Uint
+ and then Lo_Bound <= (-(2 ** Signed_Size))
+ and then Hi_Bound < 2 ** Signed_Size
+ then
+ Val := Make_Integer_Literal (Loc, 2 ** Signed_Size - 1);
+
+ -- Normal case of largest negative value
+
+ else
+ Val := Make_Integer_Literal (Loc, -(2 ** Signed_Size));
+ end if;
+ end;
end if;
-- Here for Initialize_Scalars case
else
+ -- For float types, use float values from System.Scalar_Values
+
if Is_Floating_Point_Type (T) then
if Root_Type (T) = Standard_Short_Float then
Val_RE := RE_IS_Isf;
@@ -4978,25 +5110,42 @@ package body Exp_Ch3 is
Val_RE := RE_IS_Ill;
end if;
- elsif Is_Unsigned_Type (Base_Type (T)) then
- if Esize (T) = 8 then
+ -- If zero is invalid, use zero values from System.Scalar_Values
+
+ elsif Lo_Bound /= No_Uint and then Lo_Bound > Uint_0 then
+ if Size_To_Use <= 8 then
+ Val_RE := RE_IS_Iz1;
+ elsif Size_To_Use <= 16 then
+ Val_RE := RE_IS_Iz2;
+ elsif Size_To_Use <= 32 then
+ Val_RE := RE_IS_Iz4;
+ else
+ Val_RE := RE_IS_Iz8;
+ end if;
+
+ -- For unsigned, use unsigned values from System.Scalar_Values
+
+ elsif Is_Unsigned_Type (T) then
+ if Size_To_Use <= 8 then
Val_RE := RE_IS_Iu1;
- elsif Esize (T) = 16 then
+ elsif Size_To_Use <= 16 then
Val_RE := RE_IS_Iu2;
- elsif Esize (T) = 32 then
+ elsif Size_To_Use <= 32 then
Val_RE := RE_IS_Iu4;
- else pragma Assert (Esize (T) = 64);
+ else
Val_RE := RE_IS_Iu8;
end if;
- else -- signed type
- if Esize (T) = 8 then
+ -- For signed, use signed values from System.Scalar_Values
+
+ else
+ if Size_To_Use <= 8 then
Val_RE := RE_IS_Is1;
- elsif Esize (T) = 16 then
+ elsif Size_To_Use <= 16 then
Val_RE := RE_IS_Is2;
- elsif Esize (T) = 32 then
+ elsif Size_To_Use <= 32 then
Val_RE := RE_IS_Is4;
- else pragma Assert (Esize (T) = 64);
+ else
Val_RE := RE_IS_Is8;
end if;
end if;
@@ -5004,11 +5153,11 @@ package body Exp_Ch3 is
Val := New_Occurrence_Of (RTE (Val_RE), Loc);
end if;
- -- The final expression is obtained by doing an unchecked
- -- conversion of this result to the base type of the
- -- required subtype. We use the base type to avoid the
- -- unchecked conversion from chopping bits, and then we
- -- set Kill_Range_Check to preserve the "bad" value.
+ -- The final expression is obtained by doing an unchecked conversion
+ -- of this result to the base type of the required subtype. We use
+ -- the base type to avoid the unchecked conversion from chopping
+ -- bits, and then we set Kill_Range_Check to preserve the "bad"
+ -- value.
Result := Unchecked_Convert_To (Base_Type (T), Val);
@@ -5022,11 +5171,13 @@ package body Exp_Ch3 is
return Result;
- -- String or Wide_String (must have Initialize_Scalars set)
+ -- String or Wide_[Wide]_String (must have Initialize_Scalars set)
elsif Root_Type (T) = Standard_String
or else
Root_Type (T) = Standard_Wide_String
+ or else
+ Root_Type (T) = Standard_Wide_Wide_String
then
pragma Assert (Init_Or_Norm_Scalars);
@@ -5037,7 +5188,8 @@ package body Exp_Ch3 is
Choices => New_List (
Make_Others_Choice (Loc)),
Expression =>
- Get_Simple_Init_Val (Component_Type (T), Loc))));
+ Get_Simple_Init_Val
+ (Component_Type (T), Loc, Esize (Root_Type (T))))));
-- Access type is initialized to null
@@ -5570,7 +5722,8 @@ package body Exp_Ch3 is
elsif Init_Or_Norm_Scalars
and then
(Root_Type (T) = Standard_String
- or else Root_Type (T) = Standard_Wide_String)
+ or else Root_Type (T) = Standard_Wide_String
+ or else Root_Type (T) = Standard_Wide_Wide_String)
and then
(not Is_Itype (T)
or else Nkind (Associated_Node_For_Itype (T)) /= N_Aggregate)
diff --git a/gcc/ada/exp_ch3.ads b/gcc/ada/exp_ch3.ads
index 27cd7d8c1a3..59f8ef71008 100644
--- a/gcc/ada/exp_ch3.ads
+++ b/gcc/ada/exp_ch3.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 Types; use Types;
with Elists; use Elists;
+with Uintp; use Uintp;
package Exp_Ch3 is
@@ -96,10 +97,16 @@ package Exp_Ch3 is
function Get_Simple_Init_Val
(T : Entity_Id;
- Loc : Source_Ptr) return Node_Id;
+ Loc : Source_Ptr;
+ Size : Uint := No_Uint) return Node_Id;
-- For a type which Needs_Simple_Initialization (see above), prepares
-- the tree for an expression representing the required initial value.
-- Loc is the source location used in constructing this tree which is
- -- returned as the result of the call.
+ -- returned as the result of the call. The Size parameter indicates the
+ -- target size of the object if it is known (indicated by a value that
+ -- is not No_Uint and is greater than zero). If Size is not given (Size
+ -- set to No_Uint, or non-positive), then the Esize of T is used as an
+ -- estimate of the Size. The object size is needed to prepare a known
+ -- invalid value for use by Normalize_Scalars.
end Exp_Ch3;
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 67fc5e80640..fd03a08b411 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -1063,12 +1063,20 @@ package body Exp_Ch4 is
Test := Expand_Composite_Equality
(Nod, Component_Type (Typ), L, R, Decls);
- return
- Make_Implicit_If_Statement (Nod,
- Condition => Make_Op_Not (Loc, Right_Opnd => Test),
- Then_Statements => New_List (
- Make_Return_Statement (Loc,
- Expression => New_Occurrence_Of (Standard_False, Loc))));
+ -- If some (sub)component is an unchecked_union, the whole
+ -- operation will raise program error.
+
+ if Nkind (Test) = N_Raise_Program_Error then
+ return Test;
+
+ else
+ return
+ Make_Implicit_If_Statement (Nod,
+ Condition => Make_Op_Not (Loc, Right_Opnd => Test),
+ Then_Statements => New_List (
+ Make_Return_Statement (Loc,
+ Expression => New_Occurrence_Of (Standard_False, Loc))));
+ end if;
end Component_Equality;
------------------
@@ -1650,14 +1658,9 @@ package body Exp_Ch4 is
-- It is not possible to infer the discriminant since
-- the subtype is not constrained.
- Insert_Action (Nod,
+ return
Make_Raise_Program_Error (Loc,
- Reason => PE_Unchecked_Union_Restriction));
-
- -- Prevent Gigi from generating illegal code, change
- -- the equality to a standard False.
-
- return New_Occurrence_Of (Standard_False, Loc);
+ Reason => PE_Unchecked_Union_Restriction);
end if;
-- Rhs of the composite equality
@@ -1686,11 +1689,9 @@ package body Exp_Ch4 is
end if;
else
- Insert_Action (Nod,
+ return
Make_Raise_Program_Error (Loc,
- Reason => PE_Unchecked_Union_Restriction));
-
- return Empty;
+ Reason => PE_Unchecked_Union_Restriction);
end if;
-- Call the TSS equality function with the inferred
@@ -7108,6 +7109,7 @@ package body Exp_Ch4 is
declare
New_Lhs : Node_Id;
New_Rhs : Node_Id;
+ Check : Node_Id;
begin
if First_Time then
@@ -7119,20 +7121,31 @@ package body Exp_Ch4 is
New_Rhs := New_Copy_Tree (Rhs);
end if;
- Result :=
- Make_And_Then (Loc,
- Left_Opnd => Result,
- Right_Opnd =>
- Expand_Composite_Equality (Nod, Etype (C),
- Lhs =>
- Make_Selected_Component (Loc,
- Prefix => New_Lhs,
- Selector_Name => New_Reference_To (C, Loc)),
- Rhs =>
- Make_Selected_Component (Loc,
- Prefix => New_Rhs,
- Selector_Name => New_Reference_To (C, Loc)),
- Bodies => Bodies));
+ Check :=
+ Expand_Composite_Equality (Nod, Etype (C),
+ Lhs =>
+ Make_Selected_Component (Loc,
+ Prefix => New_Lhs,
+ Selector_Name => New_Reference_To (C, Loc)),
+ Rhs =>
+ Make_Selected_Component (Loc,
+ Prefix => New_Rhs,
+ Selector_Name => New_Reference_To (C, Loc)),
+ Bodies => Bodies);
+
+ -- If some (sub)component is an unchecked_union, the whole
+ -- operation will raise program error.
+
+ if Nkind (Check) = N_Raise_Program_Error then
+ Result := Check;
+ Set_Etype (Result, Standard_Boolean);
+ exit;
+ else
+ Result :=
+ Make_And_Then (Loc,
+ Left_Opnd => Result,
+ Right_Opnd => Check);
+ end if;
end;
C := Suitable_Element (Next_Entity (C));
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 0b6447aad4e..6305f5dd746 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -1733,7 +1733,7 @@ package body Exp_Ch6 is
and then Present (Controlling_Argument (N))
and then not Java_VM
then
- Expand_Dispatch_Call (N);
+ Expand_Dispatching_Call (N);
-- The following return is worrisome. Is it really OK to
-- skip all remaining processing in this procedure ???
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb
index f2284d408e8..f0f7f0a0ad4 100644
--- a/gcc/ada/exp_dbug.adb
+++ b/gcc/ada/exp_dbug.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2005 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- --
@@ -793,8 +793,7 @@ package body Exp_Dbug is
elsif Nkind (Choice) = N_Character_Literal
and then No (Entity (Choice))
then
- Add_Uint_To_Buffer
- (UI_From_Int (Int (Char_Literal_Value (Choice))));
+ Add_Uint_To_Buffer (Char_Literal_Value (Choice));
else
declare
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index fb8f6be31e0..9cc9fb0098e 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -142,11 +142,11 @@ package body Exp_Disp is
-- Check if the type has a private view or if the public view appears
-- in the visible part of a package spec.
- --------------------------
- -- Expand_Dispatch_Call --
- --------------------------
+ -----------------------------
+ -- Expand_Dispatching_Call --
+ -----------------------------
- procedure Expand_Dispatch_Call (Call_Node : Node_Id) is
+ procedure Expand_Dispatching_Call (Call_Node : Node_Id) is
Loc : constant Source_Ptr := Sloc (Call_Node);
Call_Typ : constant Entity_Id := Etype (Call_Node);
@@ -154,21 +154,25 @@ package body Exp_Disp is
Param_List : constant List_Id := Parameter_Associations (Call_Node);
Subp : Entity_Id := Entity (Name (Call_Node));
- CW_Typ : Entity_Id;
- New_Call : Node_Id;
- New_Call_Name : Node_Id;
- New_Params : List_Id := No_List;
- Param : Node_Id;
- Res_Typ : Entity_Id;
- Subp_Ptr_Typ : Entity_Id;
- Subp_Typ : Entity_Id;
- Typ : Entity_Id;
- Eq_Prim_Op : Entity_Id := Empty;
+ CW_Typ : Entity_Id;
+ New_Call : Node_Id;
+ New_Call_Name : Node_Id;
+ New_Params : List_Id := No_List;
+ Param : Node_Id;
+ Res_Typ : Entity_Id;
+ Subp_Ptr_Typ : Entity_Id;
+ Subp_Typ : Entity_Id;
+ Typ : Entity_Id;
+ Eq_Prim_Op : Entity_Id := Empty;
+ Controlling_Tag : Node_Id;
function New_Value (From : Node_Id) return Node_Id;
-- From is the original Expression. New_Value is equivalent to a call
-- to Duplicate_Subexpr with an explicit dereference when From is an
- -- access parameter
+ -- access parameter.
+
+ function Controlling_Type (Subp : Entity_Id) return Entity_Id;
+ -- Returns the tagged type for which Subp is a primitive subprogram
---------------
-- New_Value --
@@ -176,7 +180,6 @@ package body Exp_Disp is
function New_Value (From : Node_Id) return Node_Id is
Res : constant Node_Id := Duplicate_Subexpr (From);
-
begin
if Is_Access_Type (Etype (From)) then
return Make_Explicit_Dereference (Sloc (From), Res);
@@ -185,10 +188,45 @@ package body Exp_Disp is
end if;
end New_Value;
- -- Start of processing for Expand_Dispatch_Call
+ ----------------------
+ -- Controlling_Type --
+ ----------------------
+
+ function Controlling_Type (Subp : Entity_Id) return Entity_Id is
+ begin
+ if Ekind (Subp) = E_Function
+ and then Has_Controlling_Result (Subp)
+ then
+ return Base_Type (Etype (Subp));
+
+ else
+ declare
+ Formal : Entity_Id := First_Formal (Subp);
+
+ begin
+ while Present (Formal) loop
+ if Is_Controlling_Formal (Formal) then
+ if Is_Access_Type (Etype (Formal)) then
+ return Base_Type (Designated_Type (Etype (Formal)));
+ else
+ return Base_Type (Etype (Formal));
+ end if;
+ end if;
+
+ Next_Formal (Formal);
+ end loop;
+ end;
+ end if;
+
+ -- Controlling type not found (should never happen)
+
+ return Empty;
+ end Controlling_Type;
+
+ -- Start of processing for Expand_Dispatching_Call
begin
- -- If this is an inherited operation that was overriden, the body
+ -- If this is an inherited operation that was overridden, the body
-- that is being called is its alias.
if Present (Alias (Subp))
@@ -198,17 +236,31 @@ package body Exp_Disp is
Subp := Alias (Subp);
end if;
- -- Expand_Dispatch is called directly from the semantics, so we need
- -- a check to see whether expansion is active before proceeding
+ -- Expand_Dispatching_Call is called directly from the semantics,
+ -- so we need a check to see whether expansion is active before
+ -- proceeding.
if not Expander_Active then
return;
end if;
- -- Definition of the ClassWide Type and the Tagged type
+ -- Definition of the class-wide type and the tagged type
+
+ -- If the controlling argument is itself a tag rather than a tagged
+ -- object, then use the class-wide type associated with the subprogram's
+ -- controlling type. This case can occur when a call to an inherited
+ -- primitive has an actual that originated from a default parameter
+ -- given by a tag-indeterminate call and when there is no other
+ -- controlling argument providing the tag (AI-239 requires dispatching).
+ -- This capability of dispatching directly by tag is also needed by the
+ -- implementation of AI-260 (for the generic dispatching constructors).
- if Is_Access_Type (Etype (Ctrl_Arg)) then
+ if Etype (Ctrl_Arg) = RTE (RE_Tag) then
+ CW_Typ := Class_Wide_Type (Controlling_Type (Subp));
+
+ elsif Is_Access_Type (Etype (Ctrl_Arg)) then
CW_Typ := Designated_Type (Etype (Ctrl_Arg));
+
else
CW_Typ := Etype (Ctrl_Arg);
end if;
@@ -291,7 +343,7 @@ package body Exp_Disp is
elsif No (Find_Controlling_Arg (Param)) then
Append_To (New_Params, Relocate_Node (Param));
- -- No tag check for function dispatching on result it the
+ -- No tag check for function dispatching on result if the
-- Tag given by the context is this one
elsif Find_Controlling_Arg (Param) = Ctrl_Arg then
@@ -362,7 +414,7 @@ package body Exp_Disp is
if Etype (Subp) = Typ then
Res_Typ := CW_Typ;
else
- Res_Typ := Etype (Subp);
+ Res_Typ := Etype (Subp);
end if;
Subp_Typ := Create_Itype (E_Subprogram_Type, Call_Node);
@@ -389,9 +441,9 @@ package body Exp_Disp is
Set_Scope (New_Formal, Subp_Typ);
-- Change all the controlling argument types to be class-wide
- -- to avoid a recursion in dispatching
+ -- to avoid a recursion in dispatching.
- if Is_Controlling_Actual (Param) then
+ if Is_Controlling_Formal (New_Formal) then
Set_Etype (New_Formal, Etype (Param));
end if;
@@ -443,6 +495,20 @@ package body Exp_Disp is
Set_Etype (Subp_Ptr_Typ, Subp_Ptr_Typ);
Set_Directly_Designated_Type (Subp_Ptr_Typ, Subp_Typ);
+ -- If the controlling argument is a value of type Ada.Tag then
+ -- use it directly. Otherwise, the tag must be extracted from
+ -- the controlling object.
+
+ if Etype (Ctrl_Arg) = RTE (RE_Tag) then
+ Controlling_Tag := Duplicate_Subexpr (Ctrl_Arg);
+
+ else
+ Controlling_Tag :=
+ Make_Selected_Component (Loc,
+ Prefix => Duplicate_Subexpr_Move_Checks (Ctrl_Arg),
+ Selector_Name => New_Reference_To (DTC_Entity (Subp), Loc));
+ end if;
+
-- Generate:
-- Subp_Ptr_Typ!(Get_Prim_Op_Address (Ctrl._Tag, pos));
@@ -454,9 +520,7 @@ package body Exp_Disp is
-- Vptr
- Make_Selected_Component (Loc,
- Prefix => Duplicate_Subexpr_Move_Checks (Ctrl_Arg),
- Selector_Name => New_Reference_To (DTC_Entity (Subp), Loc)),
+ Controlling_Tag,
-- Position
@@ -468,11 +532,10 @@ package body Exp_Disp is
Name => New_Call_Name,
Parameter_Associations => New_Params);
- -- if this is a dispatching "=", we must first compare the tags so
+ -- If this is a dispatching "=", we must first compare the tags so
-- we generate: x.tag = y.tag and then x = y
if Subp = Eq_Prim_Op then
-
Param := First_Actual (Call_Node);
New_Call :=
Make_And_Then (Loc,
@@ -504,7 +567,7 @@ package body Exp_Disp is
Rewrite (Call_Node, New_Call);
Analyze_And_Resolve (Call_Node, Call_Typ);
- end Expand_Dispatch_Call;
+ end Expand_Dispatching_Call;
-------------
-- Fill_DT --
@@ -651,6 +714,11 @@ package body Exp_Disp is
-- or
-- DT_Ptr : Vtable_Ptr := Vtable_Ptr!(DT'Address); CPP case
+ -- According to the C++ ABI, the base of the vtable is located
+ -- after the following prologue: Offset_To_Top, Typeinfo_Ptr.
+ -- Hence, move the pointer to the base of the vtable down, after
+ -- this prologue.
+
Append_To (Result,
Make_Object_Declaration (Loc,
Defining_Identifier => DT_Ptr,
@@ -658,9 +726,15 @@ package body Exp_Disp is
Object_Definition => New_Reference_To (Generalized_Tag, Loc),
Expression =>
Unchecked_Convert_To (Generalized_Tag,
- Make_Attribute_Reference (Loc,
- Prefix => New_Reference_To (DT, Loc),
- Attribute_Name => Name_Address))));
+ Make_Op_Add (Loc,
+ Left_Opnd =>
+ Unchecked_Convert_To (RTE (RE_Storage_Offset),
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Reference_To (DT, Loc),
+ Attribute_Name => Name_Address)),
+ Right_Opnd =>
+ Make_DT_Access_Action (Typ,
+ DT_Prologue_Size, No_List)))));
-- Generate code to define the boolean that controls registration, in
-- order to avoid multiple registrations for tagged types defined in
diff --git a/gcc/ada/exp_disp.ads b/gcc/ada/exp_disp.ads
index aedda2d7d01..34bcffc5c59 100644
--- a/gcc/ada/exp_disp.ads
+++ b/gcc/ada/exp_disp.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -76,7 +76,7 @@ package Exp_Disp is
-- Class case check that no pragma CPP_Virtual is missing and that the
-- DT_Position are coherent
- procedure Expand_Dispatch_Call (Call_Node : Node_Id);
+ procedure Expand_Dispatching_Call (Call_Node : Node_Id);
-- Expand the call to the operation through the dispatch table and perform
-- the required tag checks when appropriate. For CPP types the call is
-- done through the Vtable (tag checks are not relevant)
diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb
index 63c6d3cb21f..4c756b13317 100644
--- a/gcc/ada/exp_dist.adb
+++ b/gcc/ada/exp_dist.adb
@@ -358,7 +358,7 @@ package body Exp_Dist is
-- Mapping between a RCI subprogram and the corresponding calling stubs
procedure Add_Stub_Type
- (Designated_Type : Entity_Id;
+ (Designated_Type : Entity_Id;
RACW_Type : Entity_Id;
Decls : List_Id;
Stub_Type : out Entity_Id;
@@ -551,10 +551,18 @@ package body Exp_Dist is
-- class-wide type before doing the real call using any of the RACW type
-- pointing on the designated type.
+ procedure Specific_Add_Obj_RPC_Receiver_Completion
+ (Loc : Source_Ptr;
+ Decls : List_Id;
+ RPC_Receiver : Entity_Id;
+ Stub_Elements : Stub_Structure);
+ -- Add the necessary code to Decls after the completion of generation
+ -- of the RACW RPC receiver described by Stub_Elements.
+
procedure Specific_Add_Receiving_Stubs_To_Declarations
(Pkg_Spec : Node_Id;
Decls : List_Id);
- -- Add receiving stubs to the declarative part
+ -- Add receiving stubs to the declarative part of an RCI unit
package GARLIC_Support is
@@ -611,6 +619,12 @@ package body Exp_Dist is
RACW_Type : Entity_Id := Empty;
Parent_Primitive : Entity_Id := Empty) return Node_Id;
+ procedure Add_Obj_RPC_Receiver_Completion
+ (Loc : Source_Ptr;
+ Decls : List_Id;
+ RPC_Receiver : Entity_Id;
+ Stub_Elements : Stub_Structure);
+
procedure Add_Receiving_Stubs_To_Declarations
(Pkg_Spec : Node_Id;
Decls : List_Id);
@@ -680,6 +694,12 @@ package body Exp_Dist is
RACW_Type : Entity_Id := Empty;
Parent_Primitive : Entity_Id := Empty) return Node_Id;
+ procedure Add_Obj_RPC_Receiver_Completion
+ (Loc : Source_Ptr;
+ Decls : List_Id;
+ RPC_Receiver : Entity_Id;
+ Stub_Elements : Stub_Structure);
+
procedure Add_Receiving_Stubs_To_Declarations
(Pkg_Spec : Node_Id;
Decls : List_Id);
@@ -1108,6 +1128,7 @@ package body Exp_Dist is
RPC_Receiver : Entity_Id;
RPC_Receiver_Statements : List_Id;
RPC_Receiver_Case_Alternatives : constant List_Id := New_List;
+ RPC_Receiver_Elsif_Parts : List_Id;
RPC_Receiver_Request : Entity_Id;
RPC_Receiver_Subp_Id : Entity_Id;
RPC_Receiver_Subp_Index : Entity_Id;
@@ -1145,6 +1166,20 @@ package body Exp_Dist is
Subp_Index => RPC_Receiver_Subp_Index,
Stmts => RPC_Receiver_Statements,
Decl => RPC_Receiver_Decl);
+
+ if Get_PCS_Name = Name_PolyORB_DSA then
+
+ -- For the case of PolyORB, we need to map a textual operation
+ -- name into a primitive index. Currently we do so using a
+ -- simple sequence of string comparisons.
+
+ RPC_Receiver_Elsif_Parts := New_List;
+ Append_To (RPC_Receiver_Statements,
+ Make_Implicit_If_Statement (Designated_Type,
+ Condition => New_Occurrence_Of (Standard_False, Loc),
+ Then_Statements => New_List,
+ Elsif_Parts => RPC_Receiver_Elsif_Parts));
+ end if;
end if;
-- Build callers, receivers for every primitive operations and a RPC
@@ -1238,6 +1273,26 @@ package body Exp_Dist is
-- Add a case alternative to the receiver
+ if Get_PCS_Name = Name_PolyORB_DSA then
+ Append_To (RPC_Receiver_Elsif_Parts,
+ Make_Elsif_Part (Loc,
+ Condition =>
+ Make_Function_Call (Loc,
+ Name =>
+ New_Occurrence_Of (
+ RTE (RE_Caseless_String_Eq), Loc),
+ Parameter_Associations => New_List (
+ New_Occurrence_Of (RPC_Receiver_Subp_Id, Loc),
+ Make_String_Literal (Loc, Subp_Str))),
+ Then_Statements => New_List (
+ Make_Assignment_Statement (Loc,
+ Name => New_Occurrence_Of (
+ RPC_Receiver_Subp_Index, Loc),
+ Expression =>
+ Make_Integer_Literal (Loc,
+ Current_Primitive_Number)))));
+ end if;
+
Append_To (RPC_Receiver_Case_Alternatives,
Make_Case_Statement_Alternative (Loc,
Discrete_Choices => New_List (
@@ -1275,21 +1330,8 @@ package body Exp_Dist is
Alternatives => RPC_Receiver_Case_Alternatives));
Append_To (Decls, RPC_Receiver_Decl);
-
- -- The RPC receiver body should not be the completion of the
- -- declaration recorded in the stub structure, because then the
- -- occurrences of the formal parameters within the body should
- -- refer to the entities from the declaration, not from the
- -- completion, to which we do not have easy access. Instead, the
- -- RPC receiver body acts as its own declaration, and the RPC
- -- receiver declaration is completed by a renaming-as-body.
-
- Append_To (Decls,
- Make_Subprogram_Renaming_Declaration (Loc,
- Specification =>
- Copy_Specification (Loc,
- Specification (Stub_Elements.RPC_Receiver_Decl)),
- Name => New_Occurrence_Of (RPC_Receiver, Loc)));
+ Specific_Add_Obj_RPC_Receiver_Completion (Loc,
+ Decls, RPC_Receiver, Stub_Elements);
end if;
-- Do not analyze RPC receiver at this stage since it will otherwise
@@ -2170,7 +2212,12 @@ package body Exp_Dist is
E : Entity_Id) return Node_Id
is
begin
- return Make_Integer_Literal (Loc, Get_Subprogram_Id (E));
+ case Get_PCS_Name is
+ when Name_PolyORB_DSA =>
+ return Make_String_Literal (Loc, Get_Subprogram_Id (E));
+ when others =>
+ return Make_Integer_Literal (Loc, Get_Subprogram_Id (E));
+ end case;
end Build_Subprogram_Id;
------------------------
@@ -2442,7 +2489,12 @@ package body Exp_Dist is
begin
if Nkind (Unit_Node) = N_Package_Declaration then
Spec := Specification (Unit_Node);
- Decls := Visible_Declarations (Spec);
+ Decls := Private_Declarations (Spec);
+
+ if No (Decls) then
+ Decls := Visible_Declarations (Spec);
+ end if;
+
New_Scope (Scope_Of_Spec (Spec));
Specific_Add_Receiving_Stubs_To_Declarations (Spec, Decls);
@@ -2497,6 +2549,32 @@ package body Exp_Dist is
procedure Add_RAS_Access_TSS (N : Node_Id);
-- Add a subprogram body for RAS Access TSS
+ -------------------------------------
+ -- Add_Obj_RPC_Receiver_Completion --
+ -------------------------------------
+
+ procedure Add_Obj_RPC_Receiver_Completion
+ (Loc : Source_Ptr;
+ Decls : List_Id;
+ RPC_Receiver : Entity_Id;
+ Stub_Elements : Stub_Structure) is
+ begin
+ -- The RPC receiver body should not be the completion of the
+ -- declaration recorded in the stub structure, because then the
+ -- occurrences of the formal parameters within the body should
+ -- refer to the entities from the declaration, not from the
+ -- completion, to which we do not have easy access. Instead, the
+ -- RPC receiver body acts as its own declaration, and the RPC
+ -- receiver declaration is completed by a renaming-as-body.
+
+ Append_To (Decls,
+ Make_Subprogram_Renaming_Declaration (Loc,
+ Specification =>
+ Copy_Specification (Loc,
+ Specification (Stub_Elements.RPC_Receiver_Decl)),
+ Name => New_Occurrence_Of (RPC_Receiver, Loc)));
+ end Add_Obj_RPC_Receiver_Completion;
+
-----------------------
-- Add_RACW_Features --
-----------------------
@@ -5051,6 +5129,52 @@ package body Exp_Dist is
procedure Add_RAS_Access_TSS (N : Node_Id);
-- Add a subprogram body for RAS Access TSS
+ -------------------------------------
+ -- Add_Obj_RPC_Receiver_Completion --
+ -------------------------------------
+
+ procedure Add_Obj_RPC_Receiver_Completion
+ (Loc : Source_Ptr;
+ Decls : List_Id;
+ RPC_Receiver : Entity_Id;
+ Stub_Elements : Stub_Structure)
+ is
+ Desig : constant Entity_Id :=
+ Etype (Designated_Type (Stub_Elements.RACW_Type));
+ begin
+ Append_To (Decls,
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Occurrence_Of (
+ RTE (RE_Register_Obj_Receiving_Stub), Loc),
+
+ Parameter_Associations => New_List (
+
+ -- Name
+
+ Make_String_Literal (Loc,
+ Full_Qualified_Name (Desig)),
+
+ -- Handler
+
+ Make_Attribute_Reference (Loc,
+ Prefix =>
+ New_Occurrence_Of (
+ Defining_Unit_Name (Parent (RPC_Receiver)), Loc),
+ Attribute_Name =>
+ Name_Access),
+
+ -- Receiver
+
+ Make_Attribute_Reference (Loc,
+ Prefix =>
+ New_Occurrence_Of (
+ Defining_Identifier (
+ Stub_Elements.RPC_Receiver_Decl), Loc),
+ Attribute_Name =>
+ Name_Access))));
+ end Add_Obj_RPC_Receiver_Completion;
+
-----------------------
-- Add_RACW_Features --
-----------------------
@@ -8137,6 +8261,9 @@ package body Exp_Dist is
elsif U_Type = Standard_Wide_Character then
Lib_RE := RE_FA_WC;
+ elsif U_Type = Standard_Wide_Wide_Character then
+ Lib_RE := RE_FA_WWC;
+
-- Floating point types
elsif U_Type = Standard_Short_Float then
@@ -8915,6 +9042,9 @@ package body Exp_Dist is
elsif U_Type = Standard_Wide_Character then
Lib_RE := RE_TA_WC;
+ elsif U_Type = Standard_Wide_Wide_Character then
+ Lib_RE := RE_TA_WWC;
+
-- Floating point types
elsif U_Type = Standard_Short_Float then
@@ -9619,6 +9749,9 @@ package body Exp_Dist is
elsif U_Type = Standard_Wide_Character then
Lib_RE := RE_TC_WC;
+ elsif U_Type = Standard_Wide_Wide_Character then
+ Lib_RE := RE_TC_WWC;
+
-- Floating point types
elsif U_Type = Standard_Short_Float then
@@ -10664,6 +10797,26 @@ package body Exp_Dist is
Set_TSS (Typ, Snam);
end Set_Renaming_TSS;
+ ----------------------------------------------
+ -- Specific_Add_Obj_RPC_Receiver_Completion --
+ ----------------------------------------------
+
+ procedure Specific_Add_Obj_RPC_Receiver_Completion
+ (Loc : Source_Ptr;
+ Decls : List_Id;
+ RPC_Receiver : Entity_Id;
+ Stub_Elements : Stub_Structure) is
+ begin
+ case Get_PCS_Name is
+ when Name_PolyORB_DSA =>
+ PolyORB_Support.Add_Obj_RPC_Receiver_Completion (Loc,
+ Decls, RPC_Receiver, Stub_Elements);
+ when others =>
+ GARLIC_Support.Add_Obj_RPC_Receiver_Completion (Loc,
+ Decls, RPC_Receiver, Stub_Elements);
+ end case;
+ end Specific_Add_Obj_RPC_Receiver_Completion;
+
--------------------------------
-- Specific_Add_RACW_Features --
--------------------------------
@@ -10674,8 +10827,7 @@ package body Exp_Dist is
Stub_Type : Entity_Id;
Stub_Type_Access : Entity_Id;
RPC_Receiver_Decl : Node_Id;
- Declarations : List_Id)
- is
+ Declarations : List_Id) is
begin
case Get_PCS_Name is
when Name_PolyORB_DSA =>
diff --git a/gcc/ada/exp_imgv.adb b/gcc/ada/exp_imgv.adb
index 5989cbc3b5c..65bcc3d3821 100644
--- a/gcc/ada/exp_imgv.adb
+++ b/gcc/ada/exp_imgv.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005 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- --
@@ -194,6 +194,11 @@ package body Exp_Imgv is
-- tv = Wide_Character (Expr)
-- pm = Wide_Character_Encoding_Method
+ -- For types whose root type is Wide_Wide_Character
+ -- xx = Wide_Wide_haracter
+ -- tv = Wide_Wide_Character (Expr)
+ -- pm = Wide_Character_Encoding_Method
+
-- For floating-point types
-- xx = Floating_Point
-- tv = Long_Long_Float (Expr)
@@ -254,6 +259,10 @@ package body Exp_Imgv is
Imid := RE_Image_Wide_Character;
Tent := Rtyp;
+ elsif Rtyp = Standard_Wide_Wide_Character then
+ Imid := RE_Image_Wide_Wide_Character;
+ Tent := Rtyp;
+
elsif Is_Signed_Integer_Type (Rtyp) then
if Esize (Rtyp) <= Esize (Standard_Integer) then
Imid := RE_Image_Integer;
@@ -382,9 +391,11 @@ package body Exp_Imgv is
Prefix => New_Reference_To (Ptyp, Loc),
Attribute_Name => Name_Aft));
- -- For wide character, append encoding method
+ -- For wide [wide] character, append encoding method
- elsif Rtyp = Standard_Wide_Character then
+ elsif Rtyp = Standard_Wide_Character
+ or else Rtyp = Standard_Wide_Wide_Character
+ then
Append_To (Arglist,
Make_Integer_Literal (Loc,
Intval => Int (Wide_Character_Encoding_Method)));
@@ -445,6 +456,10 @@ package body Exp_Imgv is
-- Value_Wide_Character (X, Wide_Character_Encoding_Method)
+ -- For types derived from Wide_Wide_Character, typ'Value (X) expands into
+
+ -- Value_Wide_Wide_Character (X, Wide_Character_Encoding_Method)
+
-- For decimal types with size <= Integer'Size, typ'Value (X)
-- expands into
@@ -455,7 +470,7 @@ package body Exp_Imgv is
-- btyp?(Value_Long_Long_Decimal (X, typ'Scale))
-- For enumeration types other than those derived from types Boolean,
- -- Character, and Wide_Character in Standard, typ'Value (X) expands to:
+ -- Character, Wide_[Wide_]Character in Standard, typ'Value (X) expands to:
-- Enum'Val (Value_Enumeration_NN (typS, typI'Address, Num, X))
@@ -493,6 +508,12 @@ package body Exp_Imgv is
Make_Integer_Literal (Loc,
Intval => Int (Wide_Character_Encoding_Method)));
+ elsif Rtyp = Standard_Wide_Wide_Character then
+ Vid := RE_Value_Wide_Wide_Character;
+ Append_To (Args,
+ Make_Integer_Literal (Loc,
+ Intval => Int (Wide_Character_Encoding_Method)));
+
elsif Rtyp = Base_Type (Standard_Short_Short_Integer)
or else Rtyp = Base_Type (Standard_Short_Integer)
or else Rtyp = Base_Type (Standard_Integer)
@@ -624,20 +645,28 @@ package body Exp_Imgv is
-- Expand_Width_Attribute --
----------------------------
- -- The processing here also handles the case of Wide_Width. With the
+ -- The processing here also handles the case of Wide_[Wide_]Width. With the
-- exceptions noted, the processing is identical
-- For scalar types derived from Boolean, character and integer types
-- in package Standard. Note that the Width attribute is computed at
-- compile time for all cases except those involving non-static sub-
- -- types. For such subtypes, typ'Width and typ'Wide_Width expands into:
+ -- types. For such subtypes, typ'[Wide_[Wide_]]Width expands into:
-- Result_Type (xx (yy (Ptyp'First), yy (Ptyp'Last)))
-- where
-- For types whose root type is Character
- -- xx = Width_Character (Wide_Width_Character for Wide_Width case)
+ -- xx = Width_Character
+ -- yy = Character
+
+ -- For types whose root type is Wide_Character
+ -- xx = Wide_Width_Character
+ -- yy = Character
+
+ -- For types whose root type is Wide_Wide_Character
+ -- xx = Wide_Wide_Width_Character
-- yy = Character
-- For types whose root type is Boolean
@@ -664,8 +693,37 @@ package body Exp_Imgv is
-- Result_Type (Wide_Width_Wide_Character (
-- Wide_Character (typ'First),
-- Wide_Character (typ'Last));
+ -- Wide_Character_Encoding_Method);
+
+ -- and typ'Wide_Wide_Width expands into
+
+ -- Result_Type (Wide_Wide_Width_Wide_Character (
+ -- Wide_Character (typ'First),
+ -- Wide_Character (typ'Last));
+ -- Wide_Character_Encoding_Method);
+
+ -- For types derived from Wide_Wide_Character, typ'Width expands into
+
+ -- Result_Type (Width_Wide_Wide_Character (
+ -- Wide_Wide_Character (typ'First),
+ -- Wide_Wide_Character (typ'Last),
+ -- Wide_Character_Encoding_Method);
+
+ -- and typ'Wide_Width expands into:
+
+ -- Result_Type (Wide_Width_Wide_Wide_Character (
+ -- Wide_Wide_Character (typ'First),
+ -- Wide_Wide_Character (typ'Last));
+ -- Wide_Character_Encoding_Method);
- -- For real types, typ'Width and typ'Wide_Width expand into
+ -- and typ'Wide_Wide_Width expands into
+
+ -- Result_Type (Wide_Wide_Width_Wide_Wide_Char (
+ -- Wide_Wide_Character (typ'First),
+ -- Wide_Wide_Character (typ'Last));
+ -- Wide_Character_Encoding_Method);
+
+ -- For real types, typ'Width and typ'Wide_[Wide_]Width expand into
-- if Ptyp'First > Ptyp'Last then 0 else btyp'Width end if
@@ -690,11 +748,20 @@ package body Exp_Imgv is
-- typ'Pos (Typ'Last))
-- Wide_Character_Encoding_Method);
+ -- and typ'Wide_Wide_Width expands into:
+
+ -- Result_Type (Wide_Wide_Width_Enumeration_NN
+ -- (typS,
+ -- typI,
+ -- typ'Pos (typ'First),
+ -- typ'Pos (Typ'Last))
+ -- Wide_Character_Encoding_Method);
+
-- where typS and typI are the enumeration image strings and
-- indexes table, as described in Build_Enumeration_Image_Tables.
-- NN is 8/16/32 for depending on the element type for typI.
- procedure Expand_Width_Attribute (N : Node_Id; Wide : Boolean) is
+ procedure Expand_Width_Attribute (N : Node_Id; Attr : Atype := Normal) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Pref : constant Node_Id := Prefix (N);
@@ -715,22 +782,33 @@ package body Exp_Imgv is
-- Types derived from Standard.Character
elsif Rtyp = Standard_Character then
- if not Wide then
- XX := RE_Width_Character;
- else
- XX := RE_Wide_Width_Character;
- end if;
+ case Attr is
+ when Normal => XX := RE_Width_Character;
+ when Wide => XX := RE_Wide_Width_Character;
+ when Wide_Wide => XX := RE_Wide_Wide_Width_Character;
+ end case;
YY := Rtyp;
-- Types derived from Standard.Wide_Character
elsif Rtyp = Standard_Wide_Character then
- if not Wide then
- XX := RE_Width_Wide_Character;
- else
- XX := RE_Wide_Width_Wide_Character;
- end if;
+ case Attr is
+ when Normal => XX := RE_Width_Wide_Character;
+ when Wide => XX := RE_Wide_Width_Wide_Character;
+ when Wide_Wide => XX := RE_Wide_Wide_Width_Wide_Character;
+ end case;
+
+ YY := Rtyp;
+
+ -- Types derived from Standard.Wide_Wide_Character
+
+ elsif Rtyp = Standard_Wide_Wide_Character then
+ case Attr is
+ when Normal => XX := RE_Width_Wide_Wide_Character;
+ when Wide => XX := RE_Wide_Width_Wide_Wide_Character;
+ when Wide_Wide => XX := RE_Wide_Wide_Width_Wide_Wide_Char;
+ end case;
YY := Rtyp;
@@ -781,24 +859,34 @@ package body Exp_Imgv is
Ttyp := Component_Type (Etype (Lit_Indexes (Rtyp)));
- if not Wide then
- if Ttyp = Standard_Integer_8 then
- XX := RE_Width_Enumeration_8;
- elsif Ttyp = Standard_Integer_16 then
- XX := RE_Width_Enumeration_16;
- else
- XX := RE_Width_Enumeration_32;
- end if;
-
- else
- if Ttyp = Standard_Integer_8 then
- XX := RE_Wide_Width_Enumeration_8;
- elsif Ttyp = Standard_Integer_16 then
- XX := RE_Wide_Width_Enumeration_16;
- else
- XX := RE_Wide_Width_Enumeration_32;
- end if;
- end if;
+ case Attr is
+ when Normal =>
+ if Ttyp = Standard_Integer_8 then
+ XX := RE_Width_Enumeration_8;
+ elsif Ttyp = Standard_Integer_16 then
+ XX := RE_Width_Enumeration_16;
+ else
+ XX := RE_Width_Enumeration_32;
+ end if;
+
+ when Wide =>
+ if Ttyp = Standard_Integer_8 then
+ XX := RE_Wide_Width_Enumeration_8;
+ elsif Ttyp = Standard_Integer_16 then
+ XX := RE_Wide_Width_Enumeration_16;
+ else
+ XX := RE_Wide_Width_Enumeration_32;
+ end if;
+
+ when Wide_Wide =>
+ if Ttyp = Standard_Integer_8 then
+ XX := RE_Wide_Wide_Width_Enumeration_8;
+ elsif Ttyp = Standard_Integer_16 then
+ XX := RE_Wide_Wide_Width_Enumeration_16;
+ else
+ XX := RE_Wide_Wide_Width_Enumeration_32;
+ end if;
+ end case;
Arglist :=
New_List (
@@ -826,9 +914,9 @@ package body Exp_Imgv is
Prefix => New_Reference_To (Ptyp, Loc),
Attribute_Name => Name_Last))));
- -- For enumeration'Wide_Width, add encoding method parameter
+ -- For enumeration'Wide_[Wide_]Width, add encoding method parameter
- if Wide then
+ if Attr /= Normal then
Append_To (Arglist,
Make_Integer_Literal (Loc,
Intval => Int (Wide_Character_Encoding_Method)));
@@ -857,9 +945,12 @@ package body Exp_Imgv is
Prefix => New_Reference_To (Ptyp, Loc),
Attribute_Name => Name_Last)));
- -- For Wide_Character'Width, add encoding method parameter
+ -- For Wide_[Wide_]Character'Width, add encoding method parameter
- if Rtyp = Standard_Wide_Character and then Wide then
+ if (Rtyp = Standard_Wide_Character
+ or else
+ Rtyp = Standard_Wide_Wide_Character)
+ and then Attr /= Normal then
Append_To (Arglist,
Make_Integer_Literal (Loc,
Intval => Int (Wide_Character_Encoding_Method)));
diff --git a/gcc/ada/exp_imgv.ads b/gcc/ada/exp_imgv.ads
index 7df2692a76f..5f601dd7fe8 100644
--- a/gcc/ada/exp_imgv.ads
+++ b/gcc/ada/exp_imgv.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000 Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2005 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- --
@@ -78,8 +78,12 @@ package Exp_Imgv is
-- This procedure is called from Exp_Attr to expand an occurrence
-- of the attribute Value.
- procedure Expand_Width_Attribute (N : Node_Id; Wide : Boolean);
- -- This procedure is called from Exp_Attr to expand an occurrence of
- -- the attributes Width (Wide = False) or Wide_Width (Wide = True).
+ type Atype is (Normal, Wide, Wide_Wide);
+ -- Type of attribute in call to Expand_Width_Attribute
+
+ procedure Expand_Width_Attribute (N : Node_Id; Attr : Atype := Normal);
+ -- This procedure is called from Exp_Attr to expand an occurrence of the
+ -- attributes Width (Attr = Normal), or Wide_Width (Attr Wide), or
+ -- Wide_Wide_Width (Attr = Wide_Wide).
end Exp_Imgv;
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb
index cbaef5b5a15..27ec905f1cd 100644
--- a/gcc/ada/exp_prag.adb
+++ b/gcc/ada/exp_prag.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -517,19 +517,22 @@ package body Exp_Prag is
Rewrite (Expression (Lang1),
Make_Character_Literal (Loc,
Chars => Name_uV,
- Char_Literal_Value => Get_Char_Code ('V')));
+ Char_Literal_Value =>
+ UI_From_Int (Character'Pos ('V'))));
Analyze (Expression (Lang1));
Rewrite (Expression (Lang2),
Make_Character_Literal (Loc,
Chars => Name_uM,
- Char_Literal_Value => Get_Char_Code ('M')));
+ Char_Literal_Value =>
+ UI_From_Int (Character'Pos ('M'))));
Analyze (Expression (Lang2));
Rewrite (Expression (Lang3),
Make_Character_Literal (Loc,
Chars => Name_uS,
- Char_Literal_Value => Get_Char_Code ('S')));
+ Char_Literal_Value =>
+ UI_From_Int (Character'Pos ('S'))));
Analyze (Expression (Lang3));
if Exception_Code (Id) /= No_Uint then
diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb
index 9a5129efb9d..a38ce46007a 100644
--- a/gcc/ada/exp_strm.adb
+++ b/gcc/ada/exp_strm.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -24,19 +24,20 @@
-- --
------------------------------------------------------------------------------
-with Atree; use Atree;
-with Einfo; use Einfo;
-with Namet; use Namet;
-with Nlists; use Nlists;
-with Nmake; use Nmake;
-with Rtsfind; use Rtsfind;
-with Sinfo; use Sinfo;
-with Snames; use Snames;
-with Stand; use Stand;
-with Tbuild; use Tbuild;
-with Ttypes; use Ttypes;
-with Exp_Tss; use Exp_Tss;
-with Uintp; use Uintp;
+with Atree; use Atree;
+with Einfo; use Einfo;
+with Namet; use Namet;
+with Nlists; use Nlists;
+with Nmake; use Nmake;
+with Rtsfind; use Rtsfind;
+with Sem_Util; use Sem_Util;
+with Sinfo; use Sinfo;
+with Snames; use Snames;
+with Stand; use Stand;
+with Tbuild; use Tbuild;
+with Ttypes; use Ttypes;
+with Exp_Tss; use Exp_Tss;
+with Uintp; use Uintp;
package body Exp_Strm is
@@ -446,13 +447,22 @@ package body Exp_Strm is
U_Type : constant Entity_Id := Underlying_Type (P_Type);
Rt_Type : constant Entity_Id := Root_Type (U_Type);
FST : constant Entity_Id := First_Subtype (U_Type);
- P_Size : constant Uint := Esize (FST);
- Res : Node_Id;
Strm : constant Node_Id := First (Expressions (N));
Targ : constant Node_Id := Next (Strm);
+ P_Size : Uint;
+ Res : Node_Id;
Lib_RE : RE_Id;
begin
+ -- Compute the size of the stream element. This is either the size of
+ -- the first subtype or if given the size of the Stream_Size attribute.
+
+ if Is_Elementary_Type (FST) and then Has_Stream_Size_Clause (FST) then
+ P_Size := Static_Integer (Expression (Stream_Size_Clause (FST)));
+ else
+ P_Size := Esize (FST);
+ end if;
+
-- Check first for Boolean and Character. These are enumeration types,
-- but we treat them specially, since they may require special handling
-- in the transfer protocol. However, this special handling only applies
@@ -474,20 +484,24 @@ package body Exp_Strm is
then
Lib_RE := RE_I_WC;
+ elsif Rt_Type = Standard_Wide_Wide_Character
+ and then Has_Stream_Standard_Rep (U_Type)
+ then
+ Lib_RE := RE_I_WWC;
+
-- Floating point types
elsif Is_Floating_Point_Type (U_Type) then
-
- if Rt_Type = Standard_Short_Float then
+ if P_Size <= Standard_Short_Float_Size then
Lib_RE := RE_I_SF;
- elsif Rt_Type = Standard_Float then
+ elsif P_Size <= Standard_Float_Size then
Lib_RE := RE_I_F;
- elsif Rt_Type = Standard_Long_Float then
+ elsif P_Size <= Standard_Long_Float_Size then
Lib_RE := RE_I_LF;
- else pragma Assert (Rt_Type = Standard_Long_Long_Float);
+ else
Lib_RE := RE_I_LLF;
end if;
@@ -615,13 +629,22 @@ package body Exp_Strm is
U_Type : constant Entity_Id := Underlying_Type (P_Type);
Rt_Type : constant Entity_Id := Root_Type (U_Type);
FST : constant Entity_Id := First_Subtype (U_Type);
- P_Size : constant Uint := Esize (FST);
Strm : constant Node_Id := First (Expressions (N));
Item : constant Node_Id := Next (Strm);
+ P_Size : Uint;
Lib_RE : RE_Id;
Libent : Entity_Id;
begin
+ -- Compute the size of the stream element. This is either the size of
+ -- the first subtype or if given the size of the Stream_Size attribute.
+
+ if Is_Elementary_Type (FST) and then Has_Stream_Size_Clause (FST) then
+ P_Size := Static_Integer (Expression (Stream_Size_Clause (FST)));
+ else
+ P_Size := Esize (FST);
+ end if;
+
-- Find the routine to be called
-- Check for First Boolean and Character. These are enumeration types,
@@ -645,20 +668,21 @@ package body Exp_Strm is
then
Lib_RE := RE_W_WC;
+ elsif Rt_Type = Standard_Wide_Wide_Character
+ and then Has_Stream_Standard_Rep (U_Type)
+ then
+ Lib_RE := RE_W_WWC;
+
-- Floating point types
elsif Is_Floating_Point_Type (U_Type) then
-
- if Rt_Type = Standard_Short_Float then
+ if P_Size <= Standard_Short_Float_Size then
Lib_RE := RE_W_SF;
-
- elsif Rt_Type = Standard_Float then
+ elsif P_Size <= Standard_Float_Size then
Lib_RE := RE_W_F;
-
- elsif Rt_Type = Standard_Long_Float then
+ elsif P_Size <= Standard_Long_Float_Size then
Lib_RE := RE_W_LF;
-
- else pragma Assert (Rt_Type = Standard_Long_Long_Float);
+ else
Lib_RE := RE_W_LLF;
end if;
@@ -695,16 +719,12 @@ package body Exp_Strm is
then
if P_Size <= Standard_Short_Short_Integer_Size then
Lib_RE := RE_W_SSI;
-
elsif P_Size <= Standard_Short_Integer_Size then
Lib_RE := RE_W_SI;
-
elsif P_Size <= Standard_Integer_Size then
Lib_RE := RE_W_I;
-
elsif P_Size <= Standard_Long_Integer_Size then
Lib_RE := RE_W_LI;
-
else
Lib_RE := RE_W_LLI;
end if;
@@ -723,16 +743,12 @@ package body Exp_Strm is
then
if P_Size <= Standard_Short_Short_Integer_Size then
Lib_RE := RE_W_SSU;
-
elsif P_Size <= Standard_Short_Integer_Size then
Lib_RE := RE_W_SU;
-
elsif P_Size <= Standard_Integer_Size then
Lib_RE := RE_W_U;
-
elsif P_Size <= Standard_Long_Integer_Size then
Lib_RE := RE_W_LU;
-
else
Lib_RE := RE_W_LLU;
end if;
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 25522c4b509..162b939f125 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -489,7 +489,7 @@ package body Exp_Util is
Make_Character_Literal (Loc,
Chars => Name_Find,
Char_Literal_Value =>
- Char_Code (Character'Pos ('(')))));
+ UI_From_Int (Character'Pos ('(')))));
Append_To (Stats,
Make_Assignment_Statement (Loc,
@@ -548,7 +548,7 @@ package body Exp_Util is
Make_Character_Literal (Loc,
Chars => Name_Find,
Char_Literal_Value =>
- Char_Code (Character'Pos (',')))));
+ UI_From_Int (Character'Pos (',')))));
Append_To (Stats,
Make_Assignment_Statement (Loc,
@@ -571,7 +571,7 @@ package body Exp_Util is
Make_Character_Literal (Loc,
Chars => Name_Find,
Char_Literal_Value =>
- Char_Code (Character'Pos (')')))));
+ UI_From_Int (Character'Pos (')')))));
return Build_Task_Image_Function (Loc, Decls, Stats, Res);
end Build_Task_Array_Image;
@@ -870,7 +870,7 @@ package body Exp_Util is
Make_Character_Literal (Loc,
Chars => Name_Find,
Char_Literal_Value =>
- Char_Code (Character'Pos ('.')))));
+ UI_From_Int (Character'Pos ('.')))));
Append_To (Stats,
Make_Assignment_Statement (Loc,
@@ -1833,8 +1833,9 @@ package body Exp_Util is
N_Entry_Body |
N_Exception_Declaration |
N_Exception_Renaming_Declaration |
+ N_Formal_Abstract_Subprogram_Declaration |
+ N_Formal_Concrete_Subprogram_Declaration |
N_Formal_Object_Declaration |
- N_Formal_Subprogram_Declaration |
N_Formal_Type_Declaration |
N_Full_Type_Declaration |
N_Function_Instantiation |
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads
index 3e68682b437..f75038cbdc5 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -262,9 +262,9 @@ package Exp_Util is
-- copy of the subexpression, and returns it. This is intended for use
-- when the expansion of an expression needs to repeat part of it. For
-- example, replacing a**2 by a*a requires two references to a which
- -- may be a complex subexpression. Duplicate_Subexpression guarantees
- -- not to duplicate side effects. If necessary, it generates actions
- -- to save the expression value in a temporary, inserting these actions
+ -- may be a complex subexpression. Duplicate_Subexpr guarantees not
+ -- to duplicate side effects. If necessary, it generates actions to
+ -- save the expression value in a temporary, inserting these actions
-- into the tree using Insert_Actions with Exp as the insertion location.
-- The original expression and the returned result then become references
-- to this saved value. Exp must be analyzed on entry. On return, Exp
@@ -349,7 +349,7 @@ package Exp_Util is
-- Force the evaluation of the expression right away. Similar behavior
-- to Remove_Side_Effects when Variable_Ref is set to TRUE. That is to
-- say, it removes the side-effects and capture the values of the
- -- variables. Remove_Side_effects guarantees that multiple evaluations
+ -- variables. Remove_Side_Effects guarantees that multiple evaluations
-- of the same expression won't generate multiple side effects, whereas
-- Force_Evaluation further guarantees that all evaluations will yield
-- the same result.
diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb
index 40a181a7087..6c46baa86b4 100644
--- a/gcc/ada/g-dirope.adb
+++ b/gcc/ada/g-dirope.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2003 Ada Core Technologies, Inc. --
+-- Copyright (C) 1998-2005 Ada Core Technologies, 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,9 +34,12 @@
with Ada.Characters.Handling;
with Ada.Strings.Fixed;
with Ada.Strings.Maps;
+
with Unchecked_Deallocation;
with Unchecked_Conversion;
-with System; use System;
+
+with System; use System;
+with System.CRTL; use System.CRTL;
with GNAT.OS_Lib;
@@ -181,10 +184,6 @@ package body GNAT.Directory_Operations is
-----------
procedure Close (Dir : in out Dir_Type) is
-
- function closedir (Directory : System.Address) return Integer;
- pragma Import (C, closedir, "closedir");
-
Discard : Integer;
pragma Warnings (Off, Discard);
@@ -193,7 +192,7 @@ package body GNAT.Directory_Operations is
raise Directory_Error;
end if;
- Discard := closedir (System.Address (Dir.all));
+ Discard := closedir (DIRs (Dir.all));
Free (Dir);
end Close;
@@ -630,12 +629,8 @@ package body GNAT.Directory_Operations is
is
C_File_Name : constant String := Dir_Name & ASCII.NUL;
- function opendir
- (File_Name : String) return Dir_Type_Value;
- pragma Import (C, opendir, "opendir");
-
begin
- Dir := new Dir_Type_Value'(opendir (C_File_Name));
+ Dir := new Dir_Type_Value'(Dir_Type_Value (opendir (C_File_Name)));
if not Is_Open (Dir) then
Free (Dir);
@@ -737,9 +732,6 @@ package body GNAT.Directory_Operations is
Success : Boolean;
Working_Dir : Dir_Type;
- procedure rmdir (Dir_Name : String);
- pragma Import (C, rmdir, "rmdir");
-
begin
-- Remove the directory only if it is empty
diff --git a/gcc/ada/g-expect-vms.adb b/gcc/ada/g-expect-vms.adb
index 1f18885c813..35a1f21a25e 100644
--- a/gcc/ada/g-expect-vms.adb
+++ b/gcc/ada/g-expect-vms.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2003 Ada Core Technologies, Inc. --
+-- Copyright (C) 2002-2005 Ada Core Technologies, 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- --
@@ -87,13 +87,13 @@ package body GNAT.Expect is
------------------------------
function Dup (Fd : File_Descriptor) return File_Descriptor;
- pragma Import (C, Dup);
+ pragma Import (C, Dup, "decc$dup");
procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
- pragma Import (C, Dup2);
+ pragma Import (C, Dup2, "decc$dup2");
procedure Kill (Pid : Process_Id; Sig_Num : Integer);
- pragma Import (C, Kill);
+ pragma Import (C, Kill, "decc$kill");
function Create_Pipe (Pipe : access Pipe_Type) return Integer;
pragma Import (C, Create_Pipe, "__gnat_pipe");
@@ -835,92 +835,7 @@ package body GNAT.Expect is
Args : GNAT.OS_Lib.Argument_List;
Buffer_Size : Natural := 4096;
Err_To_Out : Boolean := False)
- is
- function Alloc_Vfork_Blocks return Integer;
- pragma Import (C, Alloc_Vfork_Blocks, "decc$$alloc_vfork_blocks");
-
- function Get_Vfork_Jmpbuf return System.Address;
- pragma Import (C, Get_Vfork_Jmpbuf, "decc$$get_vfork_jmpbuf");
-
- function Get_Current_Invo_Context
- (Addr : System.Address) return Process_Id;
- pragma Import (C, Get_Current_Invo_Context,
- "LIB$GET_CURRENT_INVO_CONTEXT");
-
- Pipe1, Pipe2, Pipe3 : aliased Pipe_Type;
-
- Arg : String_Access;
- Arg_List : aliased array (1 .. Args'Length + 2) of System.Address;
-
- Command_With_Path : String_Access;
-
- begin
- -- Create the rest of the pipes
-
- Set_Up_Communications
- (Descriptor, Err_To_Out, Pipe1'Access, Pipe2'Access, Pipe3'Access);
-
- Command_With_Path := Locate_Exec_On_Path (Command);
-
- if Command_With_Path = null then
- raise Invalid_Process;
- end if;
-
- -- Fork a new process. It's not possible to do this in a subprogram.
-
- if Alloc_Vfork_Blocks >= 0 then
- Descriptor.Pid := Get_Current_Invo_Context (Get_Vfork_Jmpbuf);
- else
- Descriptor.Pid := -1;
- end if;
-
- -- Are we now in the child (or, for Windows, still in the common
- -- process).
-
- if Descriptor.Pid = Null_Pid then
- -- Prepare an array of arguments to pass to C
-
- Arg := new String (1 .. Command_With_Path'Length + 1);
- Arg (1 .. Command_With_Path'Length) := Command_With_Path.all;
- Arg (Arg'Last) := ASCII.Nul;
- Arg_List (1) := Arg.all'Address;
-
- for J in Args'Range loop
- Arg := new String (1 .. Args (J)'Length + 1);
- Arg (1 .. Args (J)'Length) := Args (J).all;
- Arg (Arg'Last) := ASCII.Nul;
- Arg_List (J + 2 - Args'First) := Arg.all'Address;
- end loop;
-
- Arg_List (Arg_List'Last) := System.Null_Address;
-
- -- This does not return on Unix systems
-
- Set_Up_Child_Communications
- (Descriptor, Pipe1, Pipe2, Pipe3, Command_With_Path.all,
- Arg_List'Address);
- end if;
-
- Free (Command_With_Path);
-
- -- Did we have an error when spawning the child ?
-
- if Descriptor.Pid < Null_Pid then
- raise Invalid_Process;
- else
- -- We are now in the parent process
-
- Set_Up_Parent_Communications (Descriptor, Pipe1, Pipe2, Pipe3);
- end if;
-
- -- Create the buffer
-
- Descriptor.Buffer_Size := Buffer_Size;
-
- if Buffer_Size /= 0 then
- Descriptor.Buffer := new String (1 .. Positive (Buffer_Size));
- end if;
- end Non_Blocking_Spawn;
+ is separate;
-------------------------
-- Reinitialize_Buffer --
diff --git a/gcc/ada/g-expect.adb b/gcc/ada/g-expect.adb
index 144b157feee..2571a440d65 100644
--- a/gcc/ada/g-expect.adb
+++ b/gcc/ada/g-expect.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2003 Ada Core Technologies, Inc. --
+-- Copyright (C) 2000-2005 Ada Core Technologies, 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- --
@@ -1123,6 +1123,8 @@ package body GNAT.Expect is
Pipe2 : access Pipe_Type;
Pipe3 : access Pipe_Type)
is
+ Status : Boolean;
+
begin
-- Create the pipes
@@ -1134,18 +1136,36 @@ package body GNAT.Expect is
return;
end if;
+ -- Record the 'parent' end of the two pipes in Pid:
+ -- Child stdin is connected to the 'write' end of Pipe1;
+ -- Child stdout is connected to the 'read' end of Pipe2.
+ -- We do not want these descriptors to remain open in the child
+ -- process, so we mark them close-on-exec/non-inheritable.
+
Pid.Input_Fd := Pipe1.Output;
+ Set_Close_On_Exec (Pipe1.Output, True, Status);
Pid.Output_Fd := Pipe2.Input;
+ Set_Close_On_Exec (Pipe2.Input, True, Status);
if Err_To_Out then
+
+ -- Reuse the standard output pipe for standard error
+
Pipe3.all := Pipe2.all;
else
+
+ -- Create a separate pipe for standard error
+
if Create_Pipe (Pipe3) /= 0 then
return;
end if;
end if;
+ -- As above, we record the proper fd for the child's
+ -- standard error stream.
+
Pid.Error_Fd := Pipe3.Input;
+ Set_Close_On_Exec (Pipe3.Input, True, Status);
end Set_Up_Communications;
----------------------------------
diff --git a/gcc/ada/g-os_lib.adb b/gcc/ada/g-os_lib.adb
index 64122462ec4..65213cd5247 100644
--- a/gcc/ada/g-os_lib.adb
+++ b/gcc/ada/g-os_lib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1995-2004 Ada Core Technologies, Inc. --
+-- Copyright (C) 1995-2005 Ada Core Technologies, 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- --
@@ -1075,7 +1075,7 @@ package body GNAT.OS_Lib is
S : Integer;
begin
- -- Use the global lock because To_GM_Time is not thread safe.
+ -- Use the global lock because To_GM_Time is not thread safe
Locked_Processing : begin
SSL.Lock_Task.all;
@@ -1920,7 +1920,7 @@ package body GNAT.OS_Lib is
if Status <= 0 then
Last := Finish + 1;
- -- Replace symbolic link with its value.
+ -- Replace symbolic link with its value
else
if Is_Absolute_Path (Link_Buffer (1 .. Status)) then
@@ -2056,6 +2056,23 @@ package body GNAT.OS_Lib is
Rename_File (C_Old_Name'Address, C_New_Name'Address, Success);
end Rename_File;
+ -----------------------
+ -- Set_Close_On_Exec --
+ -----------------------
+
+ procedure Set_Close_On_Exec
+ (FD : File_Descriptor;
+ Close_On_Exec : Boolean;
+ Status : out Boolean)
+ is
+ function C_Set_Close_On_Exec
+ (FD : File_Descriptor; Close_On_Exec : System.CRTL.int)
+ return System.CRTL.int;
+ pragma Import (C, C_Set_Close_On_Exec, "__gnat_set_close_on_exec");
+ begin
+ Status := C_Set_Close_On_Exec (FD, Boolean'Pos (Close_On_Exec)) = 0;
+ end Set_Close_On_Exec;
+
--------------------
-- Set_Executable --
--------------------
@@ -2186,7 +2203,7 @@ package body GNAT.OS_Lib is
Dup2 (Saved_Error, Standerr);
end if;
- -- And close the saved standard output and error file descriptors.
+ -- And close the saved standard output and error file descriptors
Close (Saved_Output);
@@ -2234,7 +2251,7 @@ package body GNAT.OS_Lib is
is
procedure Spawn (Args : Argument_List);
- -- Call Spawn.
+ -- Call Spawn with given argument list
N_Args : Argument_List (Args'Range);
-- Normalized arguments
diff --git a/gcc/ada/g-os_lib.ads b/gcc/ada/g-os_lib.ads
index fb32ac1dd7b..fa094b088c7 100644
--- a/gcc/ada/g-os_lib.ads
+++ b/gcc/ada/g-os_lib.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1995-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2005 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,36 +36,39 @@
-- This package contains types and procedures for interfacing to the
-- underlying OS. It is used by the GNAT compiler and by tools associated
-- with the GNAT compiler, and therefore works for the various operating
--- systems to which GNAT has been ported. This package will undoubtedly
--- grow as new services are needed by various tools.
+-- systems to which GNAT has been ported. This package will undoubtedly grow
+-- as new services are needed by various tools.
--- This package tends to use fairly low-level Ada in order to not bring
--- in large portions of the RTL. For example, functions return access
--- to string as part of avoiding functions returning unconstrained types.
+-- This package tends to use fairly low-level Ada in order to not bring in
+-- large portions of the RTL. For example, functions return access to string
+-- as part of avoiding functions returning unconstrained types.
--- Except where specifically noted, these routines are portable across
--- all GNAT implementations on all supported operating systems.
+-- Except where specifically noted, these routines are portable across all
+-- GNAT implementations on all supported operating systems.
with System;
with GNAT.Strings;
package GNAT.OS_Lib is
-pragma Elaborate_Body (OS_Lib);
+ pragma Elaborate_Body (OS_Lib);
+
+ -----------------------
+ -- String Operations --
+ -----------------------
+
+ -- These are reexported from package Strings (which was introduced to
+ -- avoid different packages declarting different types unnecessarily).
+ -- See package GNAT.Strings for details.
subtype String_Access is Strings.String_Access;
- -- General purpose string access type. Some of the functions in this
- -- package allocate string results on the heap, and return a value of
- -- this type. Note that the caller is responsible for freeing this
- -- String to avoid memory leaks.
function "=" (Left, Right : in String_Access) return Boolean
renames Strings."=";
procedure Free (X : in out String_Access) renames Strings.Free;
- -- This procedure is provided for freeing returned values of type
- -- String_Access
subtype String_List is Strings.String_List;
+
function "=" (Left, Right : in String_List) return Boolean
renames Strings."=";
@@ -79,15 +82,12 @@ pragma Elaborate_Body (OS_Lib);
return String_List renames Strings."&";
subtype String_List_Access is Strings.String_List_Access;
- -- General purpose array and pointer for list of string accesses
+
function "=" (Left, Right : in String_List_Access) return Boolean
renames Strings."=";
procedure Free (Arg : in out String_List_Access)
renames Strings.Free;
- -- Frees the given array and all strings that its elements reference,
- -- and then sets the argument to null. Provided for freeing returned
- -- values of this type (including Argument_List_Access).
---------------------
-- Time/Date Stuff --
@@ -127,9 +127,9 @@ pragma Elaborate_Body (OS_Lib);
function ">" (X, Y : OS_Time) return Boolean;
function ">=" (X, Y : OS_Time) return Boolean;
function "<=" (X, Y : OS_Time) return Boolean;
- -- Basic comparison operators on OS_Time with obvious meanings. Note
- -- that these have Intrinsic convention, so for example it is not
- -- permissible to create accesses to any of these functions.
+ -- Basic comparison operators on OS_Time with obvious meanings. Note that
+ -- these have Intrinsic convention, so for example it is not permissible
+ -- to create accesses to any of these functions.
procedure GM_Split
(Date : OS_Time;
@@ -146,15 +146,15 @@ pragma Elaborate_Body (OS_Lib);
-- File Stuff --
----------------
- -- These routines give access to the open/creat/close/read/write level
- -- of I/O routines in the typical C library (these functions are not
- -- part of the ANSI C standard, but are typically available in all
- -- systems). See also package Interfaces.C_Streams for access to the
- -- stream level routines.
+ -- These routines give access to the open/creat/close/read/write level of
+ -- I/O routines in the typical C library (these functions are not part of
+ -- the ANSI C standard, but are typically available in all systems). See
+ -- also package Interfaces.C_Streams for access to the stream level
+ -- routines.
- -- Note on file names. If a file name is passed as type String in any
- -- of the following specifications, then the name is a normal Ada string
- -- and need not be NUL-terminated. However, a trailing NUL character is
+ -- Note on file names. If a file name is passed as type String in any of
+ -- the following specifications, then the name is a normal Ada string and
+ -- need not be NUL-terminated. However, a trailing NUL character is
-- permitted, and will be ignored (more accurately, the NUL and any
-- characters that follow it will be ignored).
@@ -189,9 +189,8 @@ pragma Elaborate_Body (OS_Lib);
function Open_Read_Write
(Name : String;
Fmode : Mode) return File_Descriptor;
- -- Open file Name for both reading and writing, returning file
- -- descriptor. File descriptor returned is Invalid_FD if file cannot be
- -- opened.
+ -- Open file Name for both reading and writing, returning file descriptor.
+ -- File descriptor returned is Invalid_FD if file cannot be opened.
function Create_File
(Name : String;
@@ -224,29 +223,30 @@ pragma Elaborate_Body (OS_Lib);
Name : out Temp_File_Name);
-- Create and open for writing a temporary file in the current working
-- directory. The name of the file and the File Descriptor are returned.
- -- The File Descriptor returned is Invalid_FD in the case of failure.
- -- No mode parameter is provided. Since this is a temporary file,
- -- there is no point in doing text translation on it.
- -- On some OSes, the maximum number of temp files that can be
- -- created with this procedure may be limited. When the maximum is
- -- reached, this procedure returns Invalid_FD. On some OSes, there may be
- -- a race condition between processes trying to create temp files
- -- at the same time in the same directory using this procedure.
+ -- The File Descriptor returned is Invalid_FD in the case of failure. No
+ -- mode parameter is provided. Since this is a temporary file, there is no
+ -- point in doing text translation on it.
+ --
+ -- On some OSes, the maximum number of temp files that can be created with
+ -- this procedure may be limited. When the maximum is reached, this
+ -- procedure returns Invalid_FD. On some OSes, there may be a race
+ -- condition between processes trying to create temp files at the same
+ -- time in the same directory using this procedure.
procedure Create_Temp_File
(FD : out File_Descriptor;
Name : out String_Access);
-- Create and open for writing a temporary file in the current working
-- directory. The name of the file and the File Descriptor are returned.
- -- No mode parameter is provided. Since this is a temporary file,
- -- there is no point in doing text translation on it.
- -- It is the responsibility of the caller to deallocate the access value
- -- returned in Name.
- -- This procedure will always succeed if the current working directory
- -- is writable. If the current working directory is not writable, then
+ -- No mode parameter is provided. Since this is a temporary file, there is
+ -- no point in doing text translation on it. It is the responsibility of
+ -- the caller to deallocate the access value returned in Name.
+ --
+ -- This procedure will always succeed if the current working directory is
+ -- writable. If the current working directory is not writable, then
-- Invalid_FD is returned for the file descriptor and null for the Name.
- -- There is no race condition problem between processes trying to
- -- create temp files at the same time in the same directory.
+ -- There is no race condition problem between processes trying to create
+ -- temp files at the same time in the same directory.
procedure Close (FD : File_Descriptor; Status : out Boolean);
-- Close file referenced by FD. Status is False if the underlying service
@@ -254,8 +254,18 @@ pragma Elaborate_Body (OS_Lib);
-- and invalid file descriptor (the file may have been closed twice).
procedure Close (FD : File_Descriptor);
- -- Close file referenced by FD. This form is used when the caller
- -- wants to ignore any possible error (see above for error cases).
+ -- Close file referenced by FD. This form is used when the caller wants to
+ -- ignore any possible error (see above for error cases).
+
+ procedure Set_Close_On_Exec
+ (FD : File_Descriptor;
+ Close_On_Exec : Boolean;
+ Status : out Boolean);
+ -- When Close_On_Exec is True, mark FD to be closed automatically when new
+ -- program is executed by the calling process (i.e. prevent FD from being
+ -- inherited by child processes). When Close_On_Exec is False, mark FD to
+ -- not be closed on exec (i.e. allow it to be inherited). Status is False
+ -- if the operation could not be performed.
procedure Delete_File (Name : String; Success : out Boolean);
-- Deletes file. Success is set True or False indicating if the delete is
@@ -265,29 +275,29 @@ pragma Elaborate_Body (OS_Lib);
(Old_Name : String;
New_Name : String;
Success : out Boolean);
- -- Rename a file. Success is set True or False indicating if the
- -- rename is successful or not.
+ -- Rename a file. Success is set True or False indicating if the rename is
+ -- successful or not.
- -- The following defines the mode for the Copy_File procedure below.
- -- Note that "time stamps and other file attributes" in the descriptions
- -- below refers to the creation and last modification times, and also
- -- the file access (read/write/execute) status flags.
+ -- The following defines the mode for the Copy_File procedure below. Note
+ -- that "time stamps and other file attributes" in the descriptions below
+ -- refers to the creation and last modification times, and also the file
+ -- access (read/write/execute) status flags.
type Copy_Mode is
(Copy,
- -- Copy the file. It is an error if the target file already exists.
- -- The time stamps and other file attributes are preserved in the copy.
+ -- Copy the file. It is an error if the target file already exists. The
+ -- time stamps and other file attributes are preserved in the copy.
Overwrite,
- -- If the target file exists, the file is replaced otherwise
- -- the file is just copied. The time stamps and other file
- -- attributes are preserved in the copy.
+ -- If the target file exists, the file is replaced otherwise the file
+ -- is just copied. The time stamps and other file attributes are
+ -- preserved in the copy.
Append);
- -- If the target file exists, the contents of the source file
- -- is appended at the end. Otherwise the source file is just
- -- copied. The time stamps and other file attributes are
- -- are preserved if the destination file does not exist.
+ -- If the target file exists, the contents of the source file is
+ -- appended at the end. Otherwise the source file is just copied. The
+ -- time stamps and other file attributes are are preserved if the
+ -- destination file does not exist.
type Attribute is
(Time_Stamps,
@@ -295,8 +305,8 @@ pragma Elaborate_Body (OS_Lib);
-- attributes are set to normal default values for file creation.
Full,
- -- All attributes are copied from the source file to the target
- -- file. This includes the timestamps, and for example also includes
+ -- All attributes are copied from the source file to the target file.
+ -- This includes the timestamps, and for example also includes
-- read/write/execute attributes in Unix systems.
None);
@@ -305,8 +315,8 @@ pragma Elaborate_Body (OS_Lib);
-- Note: The default is Time_Stamps, which corresponds to the normal
-- default on Windows style systems. Full corresponds to the typical
- -- effect of "cp -p" on Unix systems, and None corresponds to the
- -- typical effect of "cp" on Unix systems.
+ -- effect of "cp -p" on Unix systems, and None corresponds to the typical
+ -- effect of "cp" on Unix systems.
-- Note: Time_Stamps and Full are not supported on VMS and VxWorks
@@ -320,15 +330,15 @@ pragma Elaborate_Body (OS_Lib);
-- Pathname can be a filename or directory name. In the latter case Name
-- is copied into the directory preserving the same file name. Mode
-- defines the kind of copy, see above with the default being a normal
- -- copy in which the target file must not already exist. Success is set
- -- to True or False indicating if the copy is successful (depending on
- -- the specified Mode).
+ -- copy in which the target file must not already exist. Success is set to
+ -- True or False indicating if the copy is successful (depending on the
+ -- specified Mode).
--
- -- Note: this procedure is only supported to a very limited extent on
- -- VMS. The only supported mode is Overwrite, and the only supported
- -- value for Preserve is None, resulting in the default action which
- -- for Overwrite is to leave attributes unchanged. Furthermore, the
- -- copy only works for simple text files.
+ -- Note: this procedure is only supported to a very limited extent on VMS.
+ -- The only supported mode is Overwrite, and the only supported value for
+ -- Preserve is None, resulting in the default action which for Overwrite
+ -- is to leave attributes unchanged. Furthermore, the copy only works for
+ -- simple text files.
procedure Copy_Time_Stamps (Source, Dest : String; Success : out Boolean);
-- Copy Source file time stamps (last modification and last access time
@@ -343,16 +353,16 @@ pragma Elaborate_Body (OS_Lib);
(FD : File_Descriptor;
A : System.Address;
N : Integer) return Integer;
- -- Read N bytes to address A from file referenced by FD. Returned value
- -- is count of bytes actually read, which can be less than N at EOF.
+ -- Read N bytes to address A from file referenced by FD. Returned value is
+ -- count of bytes actually read, which can be less than N at EOF.
function Write
(FD : File_Descriptor;
A : System.Address;
N : Integer) return Integer;
-- Write N bytes from address A to file referenced by FD. The returned
- -- value is the number of bytes written, which can be less than N if
- -- a disk full condition was detected.
+ -- value is the number of bytes written, which can be less than N if a
+ -- disk full condition was detected.
Seek_Cur : constant := 1;
Seek_End : constant := 2;
@@ -364,9 +374,9 @@ pragma Elaborate_Body (OS_Lib);
offset : Long_Integer;
origin : Integer);
pragma Import (C, Lseek, "__gnat_lseek");
- -- Sets the current file pointer to the indicated offset value,
- -- relative to the current position (origin = SEEK_CUR), end of
- -- file (origin = SEEK_END), or start of file (origin = SEEK_SET).
+ -- Sets the current file pointer to the indicated offset value, relative
+ -- to the current position (origin = SEEK_CUR), end of file (origin =
+ -- SEEK_END), or start of file (origin = SEEK_SET).
function File_Length (FD : File_Descriptor) return Long_Integer;
pragma Import (C, File_Length, "__gnat_file_length");
@@ -374,12 +384,12 @@ pragma Elaborate_Body (OS_Lib);
function File_Time_Stamp (Name : String) return OS_Time;
-- Given the name of a file or directory, Name, obtains and returns the
- -- time stamp. This function can be used for an unopened file.
- -- Returns Invalid_Time is Name doesn't correspond to an existing file.
+ -- time stamp. This function can be used for an unopened file. Returns
+ -- Invalid_Time is Name doesn't correspond to an existing file.
function File_Time_Stamp (FD : File_Descriptor) return OS_Time;
- -- Get time stamp of file from file descriptor FD
- -- Returns Invalid_Time is FD doesn't correspond to an existing file.
+ -- Get time stamp of file from file descriptor FD Returns Invalid_Time is
+ -- FD doesn't correspond to an existing file.
function Normalize_Pathname
(Name : String;
@@ -394,43 +404,41 @@ pragma Elaborate_Body (OS_Lib);
-- directory if Directory is null. The result returned is the normalized
-- name of the file. For most cases, if two file names designate the same
-- file through different paths, Normalize_Pathname will return the same
- -- canonical name in both cases. However, there are cases when this is
- -- not true; for example, this is not true in Unix for two hard links
+ -- canonical name in both cases. However, there are cases when this is not
+ -- true; for example, this is not true in Unix for two hard links
-- designating the same file.
--
-- On Windows, the returned path will start with a drive letter except
- -- when Directory is not empty and does not include a drive letter.
- -- If Directory is empty (the default) and Name is a relative path
- -- or an absolute path without drive letter, the letter of the current
- -- drive will start the returned path. If Case_Sensitive is True
- -- (the default), then this drive letter will be forced to upper case
- -- ("C:\...").
+ -- when Directory is not empty and does not include a drive letter. If
+ -- Directory is empty (the default) and Name is a relative path or an
+ -- absolute path without drive letter, the letter of the current drive
+ -- will start the returned path. If Case_Sensitive is True (the default),
+ -- then this drive letter will be forced to upper case ("C:\...").
--
-- If Resolve_Links is set to True, then the symbolic links, on systems
- -- that support them, will be fully converted to the name of the file
- -- or directory pointed to. This is slightly less efficient, since it
+ -- that support them, will be fully converted to the name of the file or
+ -- directory pointed to. This is slightly less efficient, since it
-- requires system calls.
--
-- If Name cannot be resolved or is null on entry (for example if there is
- -- a circularity in symbolic links: A is a symbolic link for B, while B is
- -- a symbolic link for A), then Normalize_Pathname returns an empty string.
+ -- symbolic link circularity, e.g. A is a symbolic link for B, and B is a
+ -- symbolic link for A), then Normalize_Pathname returns an empty string.
--
-- In VMS, if Name follows the VMS syntax file specification, it is first
-- converted into Unix syntax. If the conversion fails, Normalize_Pathname
-- returns an empty string.
--
-- For case-sensitive file systems, the value of Case_Sensitive parameter
- -- is ignored. For file systems that are not case-sensitive, such as
+ -- is ignored. For file systems that are not case-sensitive, such as
-- Windows and OpenVMS, if this parameter is set to False, then the file
-- and directory names are folded to lower case. This allows checking
-- whether two files are the same by applying this function to their names
- -- and comparing the results. If Case_Sensitive is set to True, this
+ -- and comparing the results. If Case_Sensitive is set to True, this
-- function does not change the casing of file and directory names.
function Is_Absolute_Path (Name : String) return Boolean;
- -- Returns True if Name is an absolute path name, i.e. it designates
- -- a file or a directory absolutely, rather than relative to another
- -- directory.
+ -- Returns True if Name is an absolute path name, i.e. it designates a
+ -- file or directory absolutely rather than relative to another directory.
function Is_Regular_File (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of an existing
@@ -446,25 +454,25 @@ pragma Elaborate_Body (OS_Lib);
-- a relative path name, it is relative to the current working directory.
function Is_Readable_File (Name : String) return Boolean;
- -- Determines if the given string, Name, is the name of an existing
- -- file that is readable. Returns True if so, False otherwise. Note
- -- that this function simply interrogates the file attributes (e.g.
- -- using the C function stat), so it does not indicate a situation
- -- in which a file may not actually be readable due to some other
- -- process having exclusive access.
+ -- Determines if the given string, Name, is the name of an existing file
+ -- that is readable. Returns True if so, False otherwise. Note that this
+ -- function simply interrogates the file attributes (e.g. using the C
+ -- function stat), so it does not indicate a situation in which a file may
+ -- not actually be readable due to some other process having exclusive
+ -- access.
function Is_Writable_File (Name : String) return Boolean;
- -- Determines if the given string, Name, is the name of an existing
- -- file that is writable. Returns True if so, False otherwise. Note
- -- that this function simply interrogates the file attributes (e.g.
- -- using the C function stat), so it does not indicate a situation
- -- in which a file may not actually be writeable due to some other
- -- process having exclusive access.
+ -- Determines if the given string, Name, is the name of an existing file
+ -- that is writable. Returns True if so, False otherwise. Note that this
+ -- function simply interrogates the file attributes (e.g. using the C
+ -- function stat), so it does not indicate a situation in which a file may
+ -- not actually be writeable due to some other process having exclusive
+ -- access.
function Is_Symbolic_Link (Name : String) return Boolean;
- -- Determines if the given string, Name, is the path of a symbolic link
- -- on systems that support it. Returns True if so, False if the path
- -- is not a symbolic link or if the system does not support symbolic links.
+ -- Determines if the given string, Name, is the path of a symbolic link on
+ -- systems that support it. Returns True if so, False if the path is not a
+ -- symbolic link or if the system does not support symbolic links.
--
-- A symbolic link is an indirect pointer to a file; its directory entry
-- contains the name of the file to which it is linked. Symbolic links may
@@ -496,16 +504,16 @@ pragma Elaborate_Body (OS_Lib);
(File_Name : String;
Path : String) return String_Access;
-- Try to locate a regular file whose name is given by File_Name in the
- -- directories listed in Path. If a file is found, its full pathname is
+ -- directories listed in Path. If a file is found, its full pathname is
-- returned; otherwise, a null pointer is returned. If the File_Name given
-- is an absolute pathname, then Locate_Regular_File just checks that the
-- file exists and is a regular file. Otherwise, if the File_Name given
- -- includes directory information, Locate_Regular_File first checks if
- -- the file exists relative to the current directory. If it does not,
- -- or if the File_Name given is a simple file name, the Path argument is
- -- parsed according to OS conventions, and for each directory in the Path
- -- a check is made if File_Name is a relative pathname of a regular file
- -- from that directory.
+ -- includes directory information, Locate_Regular_File first checks if the
+ -- file exists relative to the current directory. If it does not, or if
+ -- the File_Name given is a simple file name, the Path argument is parsed
+ -- according to OS conventions, and for each directory in the Path a check
+ -- is made if File_Name is a relative pathname of a regular file from that
+ -- directory.
--
-- Note that this function allocates some memory for the returned value.
-- This memory needs to be deallocated after use.
@@ -531,8 +539,8 @@ pragma Elaborate_Body (OS_Lib);
-- routine (using String in place of C_File_Name) defined above.
subtype C_File_Name is System.Address;
- -- This subtype is used to document that a parameter is the address
- -- of a null-terminated string containing the name of a file.
+ -- This subtype is used to document that a parameter is the address of a
+ -- null-terminated string containing the name of a file.
-- All the following functions need comments ???
@@ -571,7 +579,7 @@ pragma Elaborate_Body (OS_Lib);
Success : out Boolean);
function File_Time_Stamp (Name : C_File_Name) return OS_Time;
- -- Returns Invalid_Time is Name doesn't correspond to an existing file.
+ -- Returns Invalid_Time is Name doesn't correspond to an existing file
function Is_Regular_File (Name : C_File_Name) return Boolean;
function Is_Directory (Name : C_File_Name) return Boolean;
@@ -589,9 +597,9 @@ pragma Elaborate_Body (OS_Lib);
------------------
subtype Argument_List is String_List;
- -- Type used for argument list in call to Spawn. The lower bound
- -- of the array should be 1, and the length of the array indicates
- -- the number of arguments.
+ -- Type used for argument list in call to Spawn. The lower bound of the
+ -- array should be 1, and the length of the array indicates the number of
+ -- arguments.
subtype Argument_List_Access is String_List_Access;
-- Type used to return Argument_List without dragging in secondary stack.
@@ -606,42 +614,45 @@ pragma Elaborate_Body (OS_Lib);
-- and Non_Blocking_Spawn call Normalize_Arguments automatically, but
-- since there is a guarantee that a second call does nothing, this
-- internal call will have no effect if Normalize_Arguments is called
- -- before calling Spawn. The call to Normalize_Arguments assumes that
- -- the individual referenced arguments in Argument_List are on the heap,
- -- and may free them and reallocate if they are modified.
+ -- before calling Spawn. The call to Normalize_Arguments assumes that the
+ -- individual referenced arguments in Argument_List are on the heap, and
+ -- may free them and reallocate if they are modified.
procedure Spawn
(Program_Name : String;
Args : Argument_List;
Success : out Boolean);
- -- The first parameter of function Spawn is the name of the executable.
- -- The second parameter contains the arguments to be passed to the
- -- program. Success is False if the named program could not be spawned
- -- or its execution completed unsuccessfully. Note that the caller will
- -- be blocked until the execution of the spawned program is complete.
- -- For maximum portability, use a full path name for the Program_Name
- -- argument. On some systems (notably Unix systems) a simple file
- -- name may also work (if the executable can be located in the path).
+ -- This procedure spawns a program with a given list of arguments. The
+ -- first parameter of is the name of the executable. The second parameter
+ -- contains the arguments to be passed to this program. Success is False
+ -- if the named program could not be spawned or its execution completed
+ -- unsuccessfully. Note that the caller will be blocked until the
+ -- execution of the spawned program is complete. For maximum portability,
+ -- use a full path name for the Program_Name argument. On some systems
+ -- (notably Unix systems) a simple file name may also work (if the
+ -- executable can be located in the path).
--
- -- "Spawn" should not be used in tasking applications.
+ -- "Spawn" should not be used in tasking applications. Why not??? More
+ -- documentation would be helpful here ??? Is it really tasking programs,
+ -- or tasking activity that cause trouble ???
--
-- Note: Arguments in Args that contain spaces and/or quotes such as
-- "--GCC=gcc -v" or "--GCC=""gcc -v""" are not portable across all
- -- operating systems, and would not have the desired effect if they
- -- were passed directly to the operating system. To avoid this problem,
- -- Spawn makes an internal call to Normalize_Arguments, which ensures
- -- that such arguments are modified in a manner that ensures that the
- -- desired effect is obtained on all operating systems. The caller may
- -- call Normalize_Arguments explicitly before the call (e.g. to print
- -- out the exact form of arguments passed to the operating system). In
- -- this case the guarantee a second call to Normalize_Arguments has no
- -- effect ensures that the internal call will not affect the result.
- -- Note that the implicit call to Normalize_Arguments may free and
- -- reallocate some of the individual arguments.
+ -- operating systems, and would not have the desired effect if they were
+ -- passed directly to the operating system. To avoid this problem, Spawn
+ -- makes an internal call to Normalize_Arguments, which ensures that such
+ -- arguments are modified in a manner that ensures that the desired effect
+ -- is obtained on all operating systems. The caller may call
+ -- Normalize_Arguments explicitly before the call (e.g. to print out the
+ -- exact form of arguments passed to the operating system). In this case
+ -- the guarantee a second call to Normalize_Arguments has no effect
+ -- ensures that the internal call will not affect the result. Note that
+ -- the implicit call to Normalize_Arguments may free and reallocate some
+ -- of the individual arguments.
--
- -- This function will always set Success to False under VxWorks and
- -- other similar operating systems which have no notion of the concept
- -- of a dynamically executable file.
+ -- This function will always set Success to False under VxWorks and other
+ -- similar operating systems which have no notion of the concept of
+ -- dynamically executable file.
function Spawn
(Program_Name : String;
@@ -659,12 +670,10 @@ pragma Elaborate_Body (OS_Lib);
Output_File_Descriptor : File_Descriptor;
Return_Code : out Integer;
Err_To_Out : Boolean := True);
- -- Similar to the procedure above, but redirects the output to
- -- the file designated by Output_File_Descriptor. If Err_To_Out
- -- is True, then the Standard Error output is also redirected.
- --
- -- Return_Code is set to the status code returned by the operating
- -- system as described above.
+ -- Similar to the procedure above, but redirects the output to the file
+ -- designated by Output_File_Descriptor. If Err_To_Out is True, then the
+ -- Standard Error output is also redirected.
+ -- Return_Code is set to the status code returned by the operating system
--
-- "Spawn" should not be used in tasking applications.
@@ -675,13 +684,13 @@ pragma Elaborate_Body (OS_Lib);
Success : out Boolean;
Return_Code : out Integer;
Err_To_Out : Boolean := True);
- -- Similar to the procedure above, but saves the output of the command
- -- to a file with the name Output_File.
+ -- Similar to the procedure above, but saves the output of the command to
+ -- a file with the name Output_File.
--
-- Success is set to True if the command is executed and its output
- -- successfully written to the file. If Success is True, then
- -- Return_Code will be set to the status code returned by the
- -- operating system. Otherwise, Return_Code is undefined.
+ -- successfully written to the file. If Success is True, then Return_Code
+ -- will be set to the status code returned by the operating system.
+ -- Otherwise, Return_Code is undefined.
--
-- "Spawn" should not be used in tasking applications.
@@ -691,31 +700,31 @@ pragma Elaborate_Body (OS_Lib);
-- comparison for equality.
Invalid_Pid : constant Process_Id;
- -- A special value used to indicate errors, as described below.
+ -- A special value used to indicate errors, as described below
function Non_Blocking_Spawn
(Program_Name : String;
Args : Argument_List)
return Process_Id;
- -- This is a non blocking call. The Process_Id of the spawned process
- -- is returned. Parameters are to be used as in Spawn. If Invalid_Id
- -- is returned the program could not be spawned.
+ -- This is a non blocking call. The Process_Id of the spawned process is
+ -- returned. Parameters are to be used as in Spawn. If Invalid_Id is
+ -- returned the program could not be spawned.
--
-- "Non_Blocking_Spawn" should not be used in tasking applications.
--
- -- This function will always return Invalid_Id under VxWorks, since
- -- there is no notion of executables under this OS.
+ -- This function will always return Invalid_Id under VxWorks, since there
+ -- is no notion of executables under this OS.
procedure Wait_Process (Pid : out Process_Id; Success : out Boolean);
-- Wait for the completion of any of the processes created by previous
- -- calls to Non_Blocking_Spawn. The caller will be suspended until one
- -- of these processes terminates (normally or abnormally). If any of
- -- these subprocesses terminates prior to the call to Wait_Process (and
- -- has not been returned by a previous call to Wait_Process), then the
- -- call to Wait_Process is immediate. Pid identifies the process that
- -- has terminated (matching the value returned from Non_Blocking_Spawn).
- -- Success is set to True if this sub-process terminated successfully.
- -- If Pid = Invalid_Id, there were no subprocesses left to wait on.
+ -- calls to Non_Blocking_Spawn. The caller will be suspended until one of
+ -- these processes terminates (normally or abnormally). If any of these
+ -- subprocesses terminates prior to the call to Wait_Process (and has not
+ -- been returned by a previous call to Wait_Process), then the call to
+ -- Wait_Process is immediate. Pid identifies the process that has
+ -- terminated (matching the value returned from Non_Blocking_Spawn).
+ -- Success is set to True if this sub-process terminated successfully. If
+ -- Pid = Invalid_Id, there were no subprocesses left to wait on.
--
-- This function will always set success to False under VxWorks, since
-- there is no notion of executables under this OS.
@@ -723,9 +732,9 @@ pragma Elaborate_Body (OS_Lib);
function Argument_String_To_List
(Arg_String : String)
return Argument_List_Access;
- -- Take a string that is a program and its arguments and parse it into
- -- an Argument_List. Note that the result is allocated on the heap, and
- -- must be freed by the programmer (when it is no longer needed) to avoid
+ -- Take a string that is a program and its arguments and parse it into an
+ -- Argument_List. Note that the result is allocated on the heap, and must
+ -- be freed by the programmer (when it is no longer needed) to avoid
-- memory leaks.
-------------------
@@ -733,25 +742,24 @@ pragma Elaborate_Body (OS_Lib);
-------------------
function Getenv (Name : String) return String_Access;
- -- Get the value of the environment variable. Returns an access
- -- to the empty string if the environment variable does not exist
- -- or has an explicit null value (in some operating systems these
- -- are distinct cases, in others they are not; this interface
- -- abstracts away that difference. The argument is allocated on
- -- the heap (even in the null case), and needs to be freed explicitly
- -- when no longer needed to avoid memory leaks.
+ -- Get the value of the environment variable. Returns an access to the
+ -- empty string if the environment variable does not exist or has an
+ -- explicit null value (in some operating systems these are distinct
+ -- cases, in others they are not; this interface abstracts away that
+ -- difference. The argument is allocated on the heap (even in the null
+ -- case), and needs to be freed explicitly when no longer needed to avoid
+ -- memory leaks.
procedure Setenv (Name : String; Value : String);
-- Set the value of the environment variable Name to Value. This call
-- modifies the current environment, but does not modify the parent
- -- process environment. After a call to Setenv, Getenv (Name) will
- -- always return a String_Access referencing the same String as Value.
- -- This is true also for the null string case (the actual effect may
- -- be to either set an explicit null as the value, or to remove the
- -- entry, this is operating system dependent). Note that any following
- -- calls to Spawn will pass an environment to the spawned process that
- -- includes the changes made by Setenv calls. This procedure is not
- -- available under VMS.
+ -- process environment. After a call to Setenv, Getenv (Name) will always
+ -- return a String_Access referencing the same String as Value. This is
+ -- true also for the null string case (the actual effect may be to either
+ -- set an explicit null as the value, or to remove the entry, this is
+ -- operating system dependent). Note that any following calls to Spawn
+ -- will pass an environment to the spawned process that includes the
+ -- changes made by Setenv calls. This procedure is not available on VMS.
procedure OS_Exit (Status : Integer);
pragma Import (C, OS_Exit, "__gnat_os_exit");
@@ -762,37 +770,36 @@ pragma Elaborate_Body (OS_Lib);
pragma Import (C, OS_Abort, "abort");
pragma No_Return (OS_Abort);
-- Exit to OS signalling an abort (traceback or other appropriate
- -- diagnostic information should be given if possible, or entry made
- -- to the debugger if that is possible).
+ -- diagnostic information should be given if possible, or entry made to
+ -- the debugger if that is possible).
function Errno return Integer;
pragma Import (C, Errno, "__get_errno");
- -- Return the task-safe last error number.
+ -- Return the task-safe last error number
procedure Set_Errno (Errno : Integer);
pragma Import (C, Set_Errno, "__set_errno");
- -- Set the task-safe error number.
+ -- Set the task-safe error number
Directory_Separator : constant Character;
- -- The character that is used to separate parts of a pathname.
+ -- The character that is used to separate parts of a pathname
Path_Separator : constant Character;
- -- The character to separate paths in an environment variable value.
+ -- The character to separate paths in an environment variable value
private
pragma Import (C, Path_Separator, "__gnat_path_separator");
pragma Import (C, Directory_Separator, "__gnat_dir_separator");
type OS_Time is new Long_Integer;
- -- Type used for timestamps in the compiler. This type is used to
- -- hold time stamps, but may have a different representation than
- -- C's time_t. This type needs to match the declaration of OS_Time
- -- in adaint.h.
-
- -- Add pragma Inline statements for comparison operations on OS_Time.
- -- It would actually be nice to use pragma Import (Intrinsic) here,
- -- but this was not properly supported till GNAT 3.15a, so that would
- -- cause bootstrap path problems. To be changed later ???
+ -- Type used for timestamps in the compiler. This type is used to hold
+ -- time stamps, but may have a different representation than C's time_t.
+ -- This type needs to match the declaration of OS_Time in adaint.h.
+
+ -- Add pragma Inline statements for comparison operations on OS_Time. It
+ -- would actually be nice to use pragma Import (Intrinsic) here, but this
+ -- was not properly supported till GNAT 3.15a, so that would cause
+ -- bootstrap path problems. To be changed later ???
Invalid_Time : constant OS_Time := -1;
-- This value should match the return valud by __gnat_file_time_*
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads
index f56b4cc01c8..c613d20f836 100644
--- a/gcc/ada/g-socket.ads
+++ b/gcc/ada/g-socket.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2004 Ada Core Technologies, Inc. --
+-- Copyright (C) 2001-2005 Ada Core Technologies, 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,26 +31,23 @@
-- --
------------------------------------------------------------------------------
--- This package provides an interface to the sockets communication
--- facility provided on many operating systems. This is implemented
--- on the following platforms:
+-- This package provides an interface to the sockets communication facility
+-- provided on many operating systems. This is implemented on the following
+-- platforms:
--- All native ports, except Interix, with restrictions as follows
+-- All native ports, with restrictions as follows
--- Multicast is available only on systems which provide support
--- for this feature, so it is not available if Multicast is not
--- supported, or not installed. In particular Multicast is not
--- available with the Windows version.
+-- Multicast is available only on systems which provide support for this
+-- feature, so it is not available if Multicast is not supported, or not
+-- installed. In particular Multicast is not available with the Windows
+-- version.
--- The VMS implementation has implemented using the DECC RTL Socket
--- API, and is thus subject to limitations in the implementation of
--- this API.
+-- The VMS implementation has implemented using the DECC RTL Socket API,
+-- and is thus subject to limitations in the implementation of this API.
--- This package is not supported on the Interix port of GNAT.
+-- VxWorks cross ports fully implement this package
--- VxWorks cross ports fully implement this package.
-
--- This package is not yet implemented on LynxOS.
+-- This package is not yet implemented on LynxOS or other cross ports
with Ada.Exceptions;
with Ada.Streams;
@@ -64,24 +61,22 @@ package GNAT.Sockets is
-- between applications. This package provides an Ada-like interface
-- similar to that proposed as part of the BSD socket layer.
- -- GNAT.Sockets has been designed with several ideas in mind.
+ -- GNAT.Sockets has been designed with several ideas in mind
- -- This is a system independent interface. Therefore, we try as
- -- much as possible to mask system incompatibilities. Some
- -- functionalities are not available because there are not fully
- -- supported on some systems.
+ -- This is a system independent interface. Therefore, we try as much as
+ -- possible to mask system incompatibilities. Some functionalities are not
+ -- available because there are not fully supported on some systems.
- -- This is a thick binding. For instance, a major effort has been
- -- done to avoid using memory addresses or untyped ints. We
- -- preferred to define streams and enumeration types. Errors are
- -- not returned as returned values but as exceptions.
+ -- This is a thick binding. For instance, a major effort has been done to
+ -- avoid using memory addresses or untyped ints. We preferred to define
+ -- streams and enumeration types. Errors are not returned as returned
+ -- values but as exceptions.
-- This package provides a POSIX-compliant interface (between two
- -- different implementations of the same routine, we adopt the one
- -- closest to the POSIX specification). For instance, using
- -- select(), the notification of an asynchronous connect failure
- -- is delivered in the write socket set (POSIX) instead of the
- -- exception socket set (NT).
+ -- different implementations of the same routine, we adopt the one closest
+ -- to the POSIX specification). For instance, using select(), the
+ -- notification of an asynchronous connect failure is delivered in the
+ -- write socket set (POSIX) instead of the exception socket set (NT).
-- Here is a typical example of what you can do:
@@ -120,11 +115,10 @@ package GNAT.Sockets is
-- Address.Port := 5876;
-- -- The first step is to create a socket. Once created, this
- -- -- socket must be associated to with an address. Usually only
- -- -- a server (Pong here) needs to bind an address explicitly.
- -- -- Most of the time clients can skip this step because the
- -- -- socket routines will bind an arbitrary address to an unbound
- -- -- socket.
+ -- -- socket must be associated to with an address. Usually only a
+ -- -- server (Pong here) needs to bind an address explicitly. Most
+ -- -- of the time clients can skip this step because the socket
+ -- -- routines will bind an arbitrary address to an unbound socket.
-- Create_Socket (Server);
@@ -289,7 +283,7 @@ package GNAT.Sockets is
-- Channel := Stream (Socket);
- -- -- Send message to server Pong.
+ -- -- Send message to server Pong
-- String'Output (Channel, "Hello world");
@@ -373,28 +367,26 @@ package GNAT.Sockets is
-- end PingPong;
procedure Initialize (Process_Blocking_IO : Boolean := False);
- -- Initialize must be called before using any other socket routines.
- -- The Process_Blocking_IO parameter indicates whether the thread
- -- library provides process-blocking or thread-blocking input/output
- -- operations. In the former case (typically with FSU threads)
- -- GNAT.Sockets should be initialized with a value of True to
- -- provide task-blocking IO through an emulation mechanism.
- -- Only the first call to Initialize is taken into account (further
- -- calls will be ignored). Note that with the default value
- -- of Process_Blocking_IO, this operation is a no-op on UNIX
- -- platforms, but applications should make sure to call it
- -- if portability is expected: some platforms (such as Windows)
- -- require initialization before any other socket operations.
+ -- Initialize must be called before using any other socket routines. The
+ -- Process_Blocking_IO parameter indicates whether the thread library
+ -- provides process-blocking or thread-blocking input/output operations.
+ -- In the former case (typically with FSU threads) GNAT.Sockets should be
+ -- initialized with a value of True to provide task-blocking IO through an
+ -- emulation mechanism. Only the first call to Initialize is taken into
+ -- account (further calls will be ignored). Note that with the default
+ -- value of Process_Blocking_IO, this operation is a no-op on UNIX
+ -- platforms, but applications should make sure to call it if portability
+ -- is expected: some platforms (such as Windows) require initialization
+ -- before any other socket operations.
procedure Finalize;
-- After Finalize is called it is not possible to use any routines
-- exported in by this package. This procedure is idempotent.
type Socket_Type is private;
- -- Sockets are used to implement a reliable bi-directional
- -- point-to-point, stream-based connections between
- -- hosts. No_Socket provides a special value to denote
- -- uninitialized sockets.
+ -- Sockets are used to implement a reliable bi-directional point-to-point,
+ -- stream-based connections between hosts. No_Socket provides a special
+ -- value to denote uninitialized sockets.
No_Socket : constant Socket_Type;
@@ -436,11 +428,10 @@ package GNAT.Sockets is
No_Port : constant Port_Type;
type Inet_Addr_Type (Family : Family_Type := Family_Inet) is private;
- -- An Internet address depends on an address family (IPv4 contains
- -- 4 octets and Ipv6 contains 16 octets). Any_Inet_Addr is a special
- -- value treated like a wildcard enabling all addresses.
- -- No_Inet_Addr provides a special value to denote uninitialized
- -- inet addresses.
+ -- An Internet address depends on an address family (IPv4 contains 4
+ -- octets and Ipv6 contains 16 octets). Any_Inet_Addr is a special value
+ -- treated like a wildcard enabling all addresses. No_Inet_Addr provides a
+ -- special value to denote uninitialized inet addresses.
Any_Inet_Addr : constant Inet_Addr_Type;
No_Inet_Addr : constant Inet_Addr_Type;
@@ -449,28 +440,28 @@ package GNAT.Sockets is
Addr : Inet_Addr_Type (Family);
Port : Port_Type;
end record;
- -- Socket addresses fully define a socket connection with a
- -- protocol family, an Internet address and a port. No_Sock_Addr
- -- provides a special value for uninitialized socket addresses.
+ -- Socket addresses fully define a socket connection with protocol family,
+ -- an Internet address and a port. No_Sock_Addr provides a special value
+ -- for uninitialized socket addresses.
No_Sock_Addr : constant Sock_Addr_Type;
function Image (Value : Inet_Addr_Type) return String;
- -- Return an image of an Internet address. IPv4 notation consists
- -- in 4 octets in decimal format separated by dots. IPv6 notation
- -- consists in 16 octets in hexadecimal format separated by
- -- colons (and possibly dots).
+ -- Return an image of an Internet address. IPv4 notation consists in 4
+ -- octets in decimal format separated by dots. IPv6 notation consists in
+ -- 16 octets in hexadecimal format separated by colons (and possibly
+ -- dots).
function Image (Value : Sock_Addr_Type) return String;
- -- Return inet address image and port image separated by a colon.
+ -- Return inet address image and port image separated by a colon
function Inet_Addr (Image : String) return Inet_Addr_Type;
-- Convert address image from numbers-and-dots notation into an
-- inet address.
- -- Host entries provide complete information on a given host:
- -- the official name, an array of alternative names or aliases and
- -- array of network addresses.
+ -- Host entries provide complete information on a given host: the official
+ -- name, an array of alternative names or aliases and array of network
+ -- addresses.
type Host_Entry_Type
(Aliases_Length, Addresses_Length : Natural) is private;
@@ -487,39 +478,38 @@ package GNAT.Sockets is
function Aliases
(E : Host_Entry_Type;
N : Positive := 1) return String;
- -- Return N'th aliases in host entry. The first index is 1.
+ -- Return N'th aliases in host entry. The first index is 1
function Addresses
(E : Host_Entry_Type;
N : Positive := 1) return Inet_Addr_Type;
- -- Return N'th addresses in host entry. The first index is 1.
+ -- Return N'th addresses in host entry. The first index is 1
Host_Error : exception;
- -- Exception raised by the two following procedures. Once raised,
- -- its message contains a string describing the error code. This
- -- exception is raised when an host entry can not be retrieved.
+ -- Exception raised by the two following procedures. Once raised, its
+ -- message contains a string describing the error code. This exception is
+ -- raised when an host entry can not be retrieved.
function Get_Host_By_Address
(Address : Inet_Addr_Type;
Family : Family_Type := Family_Inet) return Host_Entry_Type;
- -- Return host entry structure for the given Inet address.
- -- Note that no result will be returned if there is no mapping of this
- -- IP address to a host name in the system tables (host database,
- -- DNS or otherwise).
+ -- Return host entry structure for the given Inet address. Note that no
+ -- result will be returned if there is no mapping of this IP address to a
+ -- host name in the system tables (host database, DNS or otherwise).
function Get_Host_By_Name
(Name : String) return Host_Entry_Type;
- -- Return host entry structure for the given host name. Here name
- -- is either a host name, or an IP address. If Name is an IP address,
- -- this is equivalent to Get_Host_By_Address (Inet_Addr (Name)).
+ -- Return host entry structure for the given host name. Here name is
+ -- either a host name, or an IP address. If Name is an IP address, this is
+ -- equivalent to Get_Host_By_Address (Inet_Addr (Name)).
function Host_Name return String;
-- Return the name of the current host
type Service_Entry_Type (Aliases_Length : Natural) is private;
- -- Service entries provide complete information on a given
- -- service: the official name, an array of alternative names or
- -- aliases and the port number.
+ -- Service entries provide complete information on a given service: the
+ -- official name, an array of alternative names or aliases and the port
+ -- number.
function Official_Name (S : Service_Entry_Type) return String;
-- Return official name in service entry
@@ -536,7 +526,7 @@ package GNAT.Sockets is
function Aliases
(S : Service_Entry_Type;
N : Positive := 1) return String;
- -- Return N'th aliases in service entry. The first index is 1.
+ -- Return N'th aliases in service entry (the first index is 1)
function Get_Service_By_Name
(Name : String;
@@ -552,9 +542,9 @@ package GNAT.Sockets is
-- Comment required ???
-- Errors are described by an enumeration type. There is only one
- -- exception Socket_Error in this package to deal with an error
- -- during a socket routine. Once raised, its message contains the
- -- error code between brackets and a string describing the error code.
+ -- exception Socket_Error in this package to deal with an error during a
+ -- socket routine. Once raised, its message contains the error code
+ -- between brackets and a string describing the error code.
-- The name of the enumeration constant documents the error condition
@@ -604,10 +594,9 @@ package GNAT.Sockets is
Unknown_Server_Error,
Cannot_Resolve_Error);
- -- Get_Socket_Options and Set_Socket_Options manipulate options
- -- associated with a socket. Options may exist at multiple
- -- protocol levels in the communication stack. Socket_Level is the
- -- uppermost socket level.
+ -- Get_Socket_Options and Set_Socket_Options manipulate options associated
+ -- with a socket. Options may exist at multiple protocol levels in the
+ -- communication stack. Socket_Level is the uppermost socket level.
type Level_Type is (
Socket_Level,
@@ -615,9 +604,9 @@ package GNAT.Sockets is
IP_Protocol_For_UDP_Level,
IP_Protocol_For_TCP_Level);
- -- There are several options available to manipulate sockets. Each
- -- option has a name and several values available. Most of the
- -- time, the value is a boolean to enable or disable this option.
+ -- There are several options available to manipulate sockets. Each option
+ -- has a name and several values available. Most of the time, the value is
+ -- a boolean to enable or disable this option.
type Option_Name is (
Keep_Alive, -- Enable sending of keep-alive messages
@@ -668,10 +657,10 @@ package GNAT.Sockets is
end case;
end record;
- -- There are several controls available to manipulate
- -- sockets. Each option has a name and several values available.
- -- These controls differ from the socket options in that they are
- -- not specific to sockets but are available for any device.
+ -- There are several controls available to manipulate sockets. Each option
+ -- has a name and several values available. These controls differ from the
+ -- socket options in that they are not specific to sockets but are
+ -- available for any device.
type Request_Name is (
Non_Blocking_IO, -- Cause a caller not to wait on blocking operations.
@@ -688,35 +677,36 @@ package GNAT.Sockets is
end case;
end record;
- -- A request flag allows to specify the type of message
- -- transmissions or receptions. A request flag can be a
- -- combination of zero or more predefined request flags.
+ -- A request flag allows to specify the type of message transmissions or
+ -- receptions. A request flag can be combination of zero or more
+ -- predefined request flags.
type Request_Flag_Type is private;
No_Request_Flag : constant Request_Flag_Type;
- -- This flag corresponds to the normal execution of an operation.
+ -- This flag corresponds to the normal execution of an operation
Process_Out_Of_Band_Data : constant Request_Flag_Type;
- -- This flag requests that the receive or send function operates
- -- on out-of-band data when the socket supports this notion (e.g.
+ -- This flag requests that the receive or send function operates on
+ -- out-of-band data when the socket supports this notion (e.g.
-- Socket_Stream).
Peek_At_Incoming_Data : constant Request_Flag_Type;
-- This flag causes the receive operation to return data from the
- -- beginning of the receive queue without removing that data from
- -- the queue. A subsequent receive call will return the same data.
+ -- beginning of the receive queue without removing that data from the
+ -- queue. A subsequent receive call will return the same data.
Wait_For_A_Full_Reception : constant Request_Flag_Type;
- -- This flag requests that the operation block until the full
- -- request is satisfied. However, the call may still return less
- -- data than requested if a signal is caught, an error or
- -- disconnect occurs, or the next data to be received is of a dif-
- -- ferent type than that returned.
+ -- This flag requests that the operation block until the full request is
+ -- satisfied. However, the call may still return less data than requested
+ -- if a signal is caught, an error or disconnect occurs, or the next data
+ -- to be received is of a different type than that returned. Note that
+ -- this flag depends on support in the underlying sockets implementation,
+ -- and is not supported under Windows.
Send_End_Of_Record : constant Request_Flag_Type;
- -- This flag indicates that the entire message has been sent and
- -- so this terminates the record.
+ -- This flag indicates that the entire message has been sent and so this
+ -- terminates the record.
function "+" (L, R : Request_Flag_Type) return Request_Flag_Type;
-- Combine flag L with flag R
@@ -734,17 +724,17 @@ package GNAT.Sockets is
(Socket : out Socket_Type;
Family : Family_Type := Family_Inet;
Mode : Mode_Type := Socket_Stream);
- -- Create an endpoint for communication. Raises Socket_Error on error.
+ -- Create an endpoint for communication. Raises Socket_Error on error
procedure Accept_Socket
(Server : Socket_Type;
Socket : out Socket_Type;
Address : out Sock_Addr_Type);
- -- Extract the first connection request on the queue of pending
- -- connections, creates a new connected socket with mostly the
- -- same properties as Server, and allocates a new socket. The
- -- returned Address is filled in with the address of the
- -- connection. Raises Socket_Error on error.
+ -- Extracts the first connection request on the queue of pending
+ -- connections, creates a new connected socket with mostly the same
+ -- properties as Server, and allocates a new socket. The returned Address
+ -- is filled in with the address of the connection. Raises Socket_Error on
+ -- error.
procedure Bind_Socket
(Socket : Socket_Type;
@@ -753,7 +743,7 @@ package GNAT.Sockets is
-- Socket_Error on error.
procedure Close_Socket (Socket : Socket_Type);
- -- Close a socket and more specifically a non-connected socket.
+ -- Close a socket and more specifically a non-connected socket
procedure Connect_Socket
(Socket : Socket_Type;
@@ -764,9 +754,9 @@ package GNAT.Sockets is
procedure Control_Socket
(Socket : Socket_Type;
Request : in out Request_Type);
- -- Obtain or set parameter values that control the socket. This
- -- control differs from the socket options in that they are not
- -- specific to sockets but are available for any device.
+ -- Obtain or set parameter values that control the socket. This control
+ -- differs from the socket options in that they are not specific to
+ -- sockets but are available for any device.
function Get_Peer_Name (Socket : Socket_Type) return Sock_Addr_Type;
-- Return the peer or remote socket address of a socket. Raise
@@ -774,8 +764,8 @@ package GNAT.Sockets is
function Get_Socket_Name (Socket : Socket_Type) return Sock_Addr_Type;
-- Return the local or current socket address of a socket. Return
- -- No_Sock_Addr on error (for instance, socket closed or not
- -- locally bound).
+ -- No_Sock_Addr on error (for instance, socket closed or not locally
+ -- bound).
function Get_Socket_Option
(Socket : Socket_Type;
@@ -787,21 +777,20 @@ package GNAT.Sockets is
procedure Listen_Socket
(Socket : Socket_Type;
Length : Positive := 15);
- -- To accept connections, a socket is first created with
- -- Create_Socket, a willingness to accept incoming connections and
- -- a queue Length for incoming connections are specified. Raise
- -- Socket_Error on error.
+ -- To accept connections, a socket is first created with Create_Socket,
+ -- a willingness to accept incoming connections and a queue Length for
+ -- incoming connections are specified. Raise Socket_Error on error.
procedure Receive_Socket
(Socket : Socket_Type;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset;
Flags : Request_Flag_Type := No_Request_Flag);
- -- Receive message from Socket. Last is the index value such that
- -- Item (Last) is the last character assigned. Note that Last is
- -- set to Item'First - 1 when the socket has been closed by
- -- peer. This is not an error and no exception is raised. Flags
- -- allows to control the reception. Raise Socket_Error on error.
+ -- Receive message from Socket. Last is the index value such that Item
+ -- (Last) is the last character assigned. Note that Last is set to
+ -- Item'First - 1 when the socket has been closed by peer. This is not an
+ -- error and no exception is raised. Flags allows to control the
+ -- reception. Raise Socket_Error on error.
procedure Receive_Socket
(Socket : Socket_Type;
@@ -809,11 +798,10 @@ package GNAT.Sockets is
Last : out Ada.Streams.Stream_Element_Offset;
From : out Sock_Addr_Type;
Flags : Request_Flag_Type := No_Request_Flag);
- -- Receive message from Socket. If Socket is not
- -- connection-oriented, the source address From of the message is
- -- filled in. Last is the index value such that Item (Last) is the
- -- last character assigned. Flags allows to control the
- -- reception. Raises Socket_Error on error.
+ -- Receive message from Socket. If Socket is not connection-oriented, the
+ -- source address From of the message is filled in. Last is the index
+ -- value such that Item (Last) is the last character assigned. Flags
+ -- allows to control the reception. Raises Socket_Error on error.
procedure Receive_Vector
(Socket : Socket_Type;
@@ -824,11 +812,10 @@ package GNAT.Sockets is
function Resolve_Exception
(Occurrence : Ada.Exceptions.Exception_Occurrence) return Error_Type;
- -- When Socket_Error or Host_Error are raised, the exception
- -- message contains the error code between brackets and a string
- -- describing the error code. Resolve_Error extracts the error
- -- code from an exception message and translate it into an
- -- enumeration value.
+ -- When Socket_Error or Host_Error are raised, the exception message
+ -- contains the error code between brackets and a string describing the
+ -- error code. Resolve_Error extracts the error code from an exception
+ -- message and translate it into an enumeration value.
procedure Send_Socket
(Socket : Socket_Type;
@@ -837,9 +824,8 @@ package GNAT.Sockets is
Flags : Request_Flag_Type := No_Request_Flag);
-- Transmit a message to another socket. Note that Last is set to
-- Item'First-1 when socket has been closed by peer. This is not
- -- considered an error and no exception is raised. Flags allows to
- -- control the transmission. Raises Socket_Error on any other
- -- error condition.
+ -- considered an error and no exception is raised. Flags allows to control
+ -- the transmission. Raises Socket_Error on any other error condition.
procedure Send_Socket
(Socket : Socket_Type;
@@ -847,9 +833,8 @@ package GNAT.Sockets is
Last : out Ada.Streams.Stream_Element_Offset;
To : Sock_Addr_Type;
Flags : Request_Flag_Type := No_Request_Flag);
- -- Transmit a message to another socket. The address is given by
- -- To. Flags allows to control the transmission. Raises
- -- Socket_Error on error.
+ -- Transmit a message to another socket. The address is given by To. Flags
+ -- allows to control the transmission. Raises Socket_Error on error.
procedure Send_Vector
(Socket : Socket_Type;
@@ -862,15 +847,15 @@ package GNAT.Sockets is
(Socket : Socket_Type;
Level : Level_Type := Socket_Level;
Option : Option_Type);
- -- Manipulate socket options. Raises Socket_Error on error.
+ -- Manipulate socket options. Raises Socket_Error on error
procedure Shutdown_Socket
(Socket : Socket_Type;
How : Shutmode_Type := Shut_Read_Write);
- -- Shutdown a connected socket. If How is Shut_Read, further
- -- receives will be disallowed. If How is Shut_Write, further
- -- sends will be disallowed. If how is Shut_Read_Write, further
- -- sends and receives will be disallowed.
+ -- Shutdown a connected socket. If How is Shut_Read, further receives will
+ -- be disallowed. If How is Shut_Write, further sends will be disallowed.
+ -- If how is Shut_Read_Write, further sends and receives will be
+ -- disallowed.
type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class;
-- Same interface as Ada.Streams.Stream_IO
@@ -883,26 +868,24 @@ package GNAT.Sockets is
function Stream
(Socket : Socket_Type;
Send_To : Sock_Addr_Type) return Stream_Access;
- -- Create a stream associated with a datagram-based socket that is
- -- already bound. Send_To is the socket address to which messages are
- -- being sent.
+ -- Create a stream associated with a datagram-based socket that is already
+ -- bound. Send_To is the socket address to which messages are being sent.
function Get_Address
(Stream : Stream_Access) return Sock_Addr_Type;
- -- Return the socket address from which the last message was received.
+ -- Return the socket address from which the last message was received
procedure Free is new Ada.Unchecked_Deallocation
(Ada.Streams.Root_Stream_Type'Class, Stream_Access);
-- Destroy a stream created by one of the Stream functions above,
- -- releasing the corresponding resources. The user is responsible
- -- for calling this subprogram when the stream is not needed anymore.
+ -- releasing the corresponding resources. The user is responsible for
+ -- calling this subprogram when the stream is not needed anymore.
type Socket_Set_Type is limited private;
- -- This type allows to manipulate sets of sockets. It allows to
- -- wait for events on multiple endpoints at one time. This is an
- -- access type on a system dependent structure. To avoid memory
- -- leaks it is highly recommended to clean the access value with
- -- procedure Empty.
+ -- This type allows to manipulate sets of sockets. It allows to wait for
+ -- events on multiple endpoints at one time. This is an access type on a
+ -- system dependent structure. To avoid memory leaks it is highly
+ -- recommended to clean the access value with procedure Empty.
procedure Clear (Item : in out Socket_Set_Type; Socket : Socket_Type);
-- Remove Socket from Item
@@ -929,33 +912,31 @@ package GNAT.Sockets is
procedure Set (Item : in out Socket_Set_Type; Socket : Socket_Type);
-- Insert Socket into Item
- -- C select() waits for a number of file descriptors to change
- -- status. Usually, three independent sets of descriptors are
- -- watched (read, write and exception). A timeout gives an upper
- -- bound on the amount of time elapsed before select returns.
- -- This function blocks until an event occurs. On some platforms,
- -- C select can block the full process.
+ -- C select() waits for a number of file descriptors to change status.
+ -- Usually, three independent sets of descriptors are watched (read, write
+ -- and exception). A timeout gives an upper bound on the amount of time
+ -- elapsed before select returns. This function blocks until an event
+ -- occurs. On some platforms, C select can block the full process.
--
- -- Check_Selector provides the very same behaviour. The only
- -- difference is that it does not watch for exception events. Note
- -- that on some platforms it is kept process blocking in purpose.
- -- The timeout parameter allows the user to have the behaviour he
- -- wants. Abort_Selector allows to abort safely a Check_Selector
- -- that is blocked forever. A special file descriptor is opened by
- -- Create_Selector and included in each call to
- -- Check_Selector. Abort_Selector causes an event to occur on this
- -- descriptor in order to unblock Check_Selector. The user must
- -- call Close_Selector to discard this special file. A reason to
- -- abort a select operation is typically to add a socket in one of
- -- the socket sets when the timeout is set to forever.
+ -- Check_Selector provides the very same behaviour. The only difference is
+ -- that it does not watch for exception events. Note that on some
+ -- platforms it is kept process blocking in purpose. The timeout parameter
+ -- allows the user to have the behaviour he wants. Abort_Selector allows
+ -- to abort safely a Check_Selector that is blocked forever. A special
+ -- file descriptor is opened by Create_Selector and included in each call
+ -- to Check_Selector. Abort_Selector causes an event to occur on this
+ -- descriptor in order to unblock Check_Selector. The user must call
+ -- Close_Selector to discard this special file. A reason to abort a select
+ -- operation is typically to add a socket in one of the socket sets when
+ -- the timeout is set to forever.
type Selector_Type is limited private;
type Selector_Access is access all Selector_Type;
- -- Selector_Duration is a subtype of Standard.Duration because the
- -- full range of Standard.Duration cannot be represented in the
- -- equivalent C structure. Moreover, negative values are not
- -- allowed to avoid system incompatibilities.
+ -- Selector_Duration is a subtype of Standard.Duration because the full
+ -- range of Standard.Duration cannot be represented in the equivalent C
+ -- structure. Moreover, negative values are not allowed to avoid system
+ -- incompatibilities.
Immediate : constant := 0.0;
Forever : constant := Duration (Integer'Last) * 1.0;
@@ -976,18 +957,17 @@ package GNAT.Sockets is
W_Socket_Set : in out Socket_Set_Type;
Status : out Selector_Status;
Timeout : Selector_Duration := Forever);
- -- Return when one Socket in R_Socket_Set has some data to be read
- -- or if one Socket in W_Socket_Set is ready to receive some
- -- data. In these cases Status is set to Completed and sockets
- -- that are ready are set in R_Socket_Set or W_Socket_Set. Status
- -- is set to Expired if no socket was ready after a Timeout
- -- expiration. Status is set to Aborted if an abort signal has been
- -- received while checking socket status. As this procedure
- -- returns when Timeout occurs, it is a design choice to keep this
- -- procedure process blocking. Note that a Timeout of 0.0 returns
- -- immediately. Also note that two different objects must be passed
- -- as R_Socket_Set and W_Socket_Set (even if they contain the same
- -- set of Sockets), or some event will be lost.
+ -- Return when one Socket in R_Socket_Set has some data to be read or if
+ -- one Socket in W_Socket_Set is ready to receive some data. In these
+ -- cases Status is set to Completed and sockets that are ready are set in
+ -- R_Socket_Set or W_Socket_Set. Status is set to Expired if no socket was
+ -- ready after a Timeout expiration. Status is set to Aborted if an abort
+ -- signal has been received while checking socket status. As this
+ -- procedure returns when Timeout occurs, it is a design choice to keep
+ -- this procedure process blocking. Note that a Timeout of 0.0 returns
+ -- immediately. Also note that two different objects must be passed as
+ -- R_Socket_Set and W_Socket_Set (even if they contain the same set of
+ -- Sockets), or some event will be lost.
procedure Check_Selector
(Selector : in out Selector_Type;
@@ -996,13 +976,13 @@ package GNAT.Sockets is
E_Socket_Set : in out Socket_Set_Type;
Status : out Selector_Status;
Timeout : Selector_Duration := Forever);
- -- This refined version of Check_Selector allows to watch for
- -- exception events (that is notifications of out-of-band
- -- transmission and reception). As above, all of R_Socket_Set,
- -- W_Socket_Set and E_Socket_Set must be different objects.
+ -- This refined version of Check_Selector allows to watch for exception
+ -- events (that is notifications of out-of-band transmission and
+ -- reception). As above, all of R_Socket_Set, W_Socket_Set and
+ -- E_Socket_Set must be different objects.
procedure Abort_Selector (Selector : Selector_Type);
- -- Send an abort signal to the selector.
+ -- Send an abort signal to the selector
private
@@ -1016,8 +996,7 @@ private
pragma Volatile (Selector_Type);
- -- The two signalling sockets are used to abort a select
- -- operation.
+ -- The two signalling sockets are used to abort a select operation
subtype Socket_Set_Access is System.Address;
No_Socket_Set : constant Socket_Set_Access := System.Null_Address;
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index 0a31d559fae..d7bd37815a6 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -179,7 +179,7 @@ begin
Write_Str ("GNAT ");
Write_Str (Gnat_Version_String);
Write_Eol;
- Write_Str ("Copyright 1992-2004 Free Software Foundation, Inc.");
+ Write_Str ("Copyright 1992-2005 Free Software Foundation, Inc.");
Write_Eol;
end if;
@@ -247,9 +247,9 @@ begin
Suppress_Options (Overflow_Check) := True;
end if;
- -- Check we have exactly one source file, this happens only in
- -- the case where the driver is called directly, it cannot happen
- -- when gnat1 is invoked from gcc in the normal case.
+ -- Check we have exactly one source file, this happens only in the case
+ -- where the driver is called directly, it cannot happen when gnat1 is
+ -- invoked from gcc in the normal case.
if Osint.Number_Of_Files /= 1 then
Usage;
@@ -280,27 +280,33 @@ begin
or else Nkind (Original_Node (Unit (Main_Unit_Node)))
in N_Generic_Instantiation)
then
- declare
+ Bad_Body : declare
Sname : Unit_Name_Type := Unit_Name (Main_Unit);
Src_Ind : Source_File_Index;
Fname : File_Name_Type;
- procedure Bad_Body (Msg : String);
+ procedure Bad_Body_Error (Msg : String);
-- Issue message for bad body found
- procedure Bad_Body (Msg : String) is
+ --------------------
+ -- Bad_Body_Error --
+ --------------------
+
+ procedure Bad_Body_Error (Msg : String) is
begin
Error_Msg_N (Msg, Main_Unit_Node);
Error_Msg_Name_1 := Fname;
Error_Msg_N
("remove incorrect body in file{!", Main_Unit_Node);
- end Bad_Body;
+ end Bad_Body_Error;
+
+ -- Start of processing for Bad_Body
begin
Sname := Unit_Name (Main_Unit);
- -- If we do not already have a body name, then get the body
- -- name (but how can we have a body name here ???)
+ -- If we do not already have a body name, then get the body name
+ -- (but how can we have a body name here ???)
if not Is_Body_Name (Sname) then
Sname := Get_Body_Name (Sname);
@@ -311,18 +317,18 @@ begin
-- Case where body is present and it is not a subunit. Exclude
-- the subunit case, because it has nothing to do with the
- -- package we are compiling. It is illegal for a child unit
- -- and a subunit with the same expanded name (RM 10.2(9)) to
- -- appear together in a partition, but there is nothing to
- -- stop a compilation environment from having both, and the
- -- test here simply allows that. If there is an attempt to
- -- include both in a partition, this is diagnosed at bind time.
- -- In Ada 83 mode this is not a warning case.
-
- -- Note: if weird file names are being used, we can have a
- -- situation where the file name that supposedly contains a
- -- body, in fact contains a spec, or we can't tell what it
- -- contains. Skip the error message in these cases.
+ -- package we are compiling. It is illegal for a child unit and a
+ -- subunit with the same expanded name (RM 10.2(9)) to appear
+ -- together in a partition, but there is nothing to stop a
+ -- compilation environment from having both, and the test here
+ -- simply allows that. If there is an attempt to include both in
+ -- a partition, this is diagnosed at bind time. In Ada 83 mode
+ -- this is not a warning case.
+
+ -- Note: if weird file names are being used, we can have
+ -- situation where the file name that supposedly contains body,
+ -- in fact contains a spec, or we can't tell what it contains.
+ -- Skip the error message in these cases.
if Src_Ind /= No_Source_File
and then Get_Expected_Unit_Type (Fname) = Expect_Body
@@ -330,12 +336,12 @@ begin
then
Error_Msg_Name_1 := Sname;
- -- Ada 83 case of a package body being ignored. This is not
- -- an error as far as the Ada 83 RM is concerned, but it is
+ -- Ada 83 case of a package body being ignored. This is not an
+ -- error as far as the Ada 83 RM is concerned, but it is
-- almost certainly not what is wanted so output a warning.
-- Give this message only if there were no errors, since
- -- otherwise it may be incorrect (we may have misinterpreted
- -- a junk spec as not needing a body when it really does).
+ -- otherwise it may be incorrect (we may have misinterpreted a
+ -- junk spec as not needing a body when it really does).
if Main_Kind = N_Package_Declaration
and then Ada_Version = Ada_83
@@ -358,33 +364,35 @@ begin
if Nkind (Original_Node (Unit (Main_Unit_Node)))
in N_Generic_Instantiation
then
- Bad_Body
+ Bad_Body_Error
("generic instantiation for % does not allow a body");
-- A library unit that is a renaming never allows a body
elsif Main_Kind in N_Renaming_Declaration then
- Bad_Body
+ Bad_Body_Error
("renaming declaration for % does not allow a body!");
- -- Remaining cases are packages and generic packages.
- -- Here we only do the test if there are no previous
- -- errors, because if there are errors, they may lead
- -- us to incorrectly believe that a package does not
- -- allow a body when in fact it does.
+ -- Remaining cases are packages and generic packages. Here
+ -- we only do the test if there are no previous errors,
+ -- because if there are errors, they may lead us to
+ -- incorrectly believe that a package does not allow a body
+ -- when in fact it does.
elsif not Compilation_Errors then
if Main_Kind = N_Package_Declaration then
- Bad_Body ("package % does not allow a body!");
+ Bad_Body_Error
+ ("package % does not allow a body!");
elsif Main_Kind = N_Generic_Package_Declaration then
- Bad_Body ("generic package % does not allow a body!");
+ Bad_Body_Error
+ ("generic package % does not allow a body!");
end if;
end if;
end if;
end if;
- end;
+ end Bad_Body;
end if;
-- Exit if compilation errors detected
@@ -405,9 +413,9 @@ begin
Exit_Program (E_Errors);
end if;
- -- Set Generate_Code on main unit and its spec. We do this even if
- -- are not generating code, since Lib-Writ uses this to determine
- -- which units get written in the ali file.
+ -- Set Generate_Code on main unit and its spec. We do this even if are
+ -- not generating code, since Lib-Writ uses this to determine which
+ -- units get written in the ali file.
Set_Generate_Code (Main_Unit);
@@ -437,15 +445,15 @@ begin
-- be generated (i.e. no -gnatc or -gnats switch was used). Check if
-- we can in fact satisfy this request.
- -- Cannot generate code if someone has turned off code generation
- -- for any reason at all. We will try to figure out a reason below.
+ -- Cannot generate code if someone has turned off code generation for
+ -- any reason at all. We will try to figure out a reason below.
elsif Operating_Mode /= Generate_Code then
Back_End_Mode := Skip;
- -- We can generate code for a subprogram body unless there were
- -- missing subunits. Note that we always generate code for all
- -- generic units (a change from some previous versions of GNAT).
+ -- We can generate code for a subprogram body unless there were missing
+ -- subunits. Note that we always generate code for all generic units (a
+ -- change from some previous versions of GNAT).
elsif Main_Kind = N_Subprogram_Body
and then not Subunits_Missing
@@ -507,17 +515,17 @@ begin
Back_End_Mode := Skip;
end if;
- -- At this stage Call_Back_End is set to indicate if the backend
- -- should be called to generate code. If it is not set, then code
- -- generation has been turned off, even though code was requested
- -- by the original command. This is not an error from the user
- -- point of view, but it is an error from the point of view of
- -- the gcc driver, so we must exit with an error status.
+ -- At this stage Call_Back_End is set to indicate if the backend should
+ -- be called to generate code. If it is not set, then code generation
+ -- has been turned off, even though code was requested by the original
+ -- command. This is not an error from the user point of view, but it is
+ -- an error from the point of view of the gcc driver, so we must exit
+ -- with an error status.
- -- We generate an informative message (from the gcc point of view,
- -- it is an error message, but from the users point of view this
- -- is not an error, just a consequence of compiling something that
- -- cannot generate code).
+ -- We generate an informative message (from the gcc point of view, it
+ -- is an error message, but from the users point of view this is not an
+ -- error, just a consequence of compiling something that cannot
+ -- generate code).
if Back_End_Mode = Skip then
Write_Str ("cannot generate code for ");
@@ -603,9 +611,9 @@ begin
return;
end if;
- -- Ensure that we properly register a dependency on system.ads,
- -- since even if we do not semantically depend on this, Targparm
- -- has read system parameters from the system.ads file.
+ -- Ensure that we properly register a dependency on system.ads, since
+ -- even if we do not semantically depend on this, Targparm has read
+ -- system parameters from the system.ads file.
Lib.Writ.Ensure_System_Dependency;
@@ -631,22 +639,22 @@ begin
Back_End.Call_Back_End (Back_End_Mode);
- -- Once the backend is complete, we unlock the names table. This
- -- call allows a few extra entries, needed for example for the file
- -- name for the library file output.
+ -- Once the backend is complete, we unlock the names table. This call
+ -- allows a few extra entries, needed for example for the file name for
+ -- the library file output.
Namet.Unlock;
- -- Validate unchecked conversions (using the values for size
- -- and alignment annotated by the backend where possible).
+ -- Validate unchecked conversions (using the values for size and
+ -- alignment annotated by the backend where possible).
Sem_Ch13.Validate_Unchecked_Conversions;
- -- Now we complete output of errors, rep info and the tree info.
- -- These are delayed till now, since it is perfectly possible for
- -- gigi to generate errors, modify the tree (in particular by setting
- -- flags indicating that elaboration is required, and also to back
- -- annotate representation information for List_Rep_Info.
+ -- Now we complete output of errors, rep info and the tree info. These
+ -- are delayed till now, since it is perfectly possible for gigi to
+ -- generate errors, modify the tree (in particular by setting flags
+ -- indicating that elaboration is required, and also to back annotate
+ -- representation information for List_Rep_Info.
Errout.Finalize;
List_Rep_Info;
@@ -662,11 +670,11 @@ begin
Write_ALI (Object => (Back_End_Mode = Generate_Object));
- -- Generate the ASIS tree after writing the ALI file, since in
- -- ASIS mode, Write_ALI may in fact result in further tree
- -- decoration from the original tree file. Note that we dump
- -- the tree just before generating it, so that the dump will
- -- exactly reflect what is written out.
+ -- Generate the ASIS tree after writing the ALI file, since in ASIS
+ -- mode, Write_ALI may in fact result in further tree decoration from
+ -- the original tree file. Note that we dump the tree just before
+ -- generating it, so that the dump will exactly reflect what is written
+ -- out.
Treepr.Tree_Dump;
Tree_Gen;
@@ -689,8 +697,8 @@ begin
when Storage_Error =>
- -- Assume this is a bug. If it is real, the message will in
- -- any case say Storage_Error, giving a strong hint!
+ -- Assume this is a bug. If it is real, the message will in any case
+ -- say Storage_Error, giving a strong hint!
Comperr.Compiler_Abort ("Storage_Error");
end;
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index bd114e7cacc..ba11f6a71f9 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -248,6 +248,7 @@ The Implementation of Standard I/O
* Sequential_IO::
* Text_IO::
* Wide_Text_IO::
+* Wide_Wide_Text_IO::
* Stream_IO::
* Shared Files::
* Open Modes::
@@ -259,6 +260,8 @@ 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.Command_Line.Environment (a-colien.ads)::
* Ada.Direct_IO.C_Streams (a-diocst.ads)::
@@ -268,8 +271,10 @@ The GNAT Library
* Ada.Streams.Stream_IO.C_Streams (a-ssicst.ads)::
* Ada.Strings.Unbounded.Text_IO (a-suteio.ads)::
* 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_Text_IO.C_Streams (a-wtcstr.ads)::
+* Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads)::
* GNAT.Array_Split (g-arrspl.ads)::
* GNAT.AWK (g-awk.ads)::
* GNAT.Bounded_Buffers (g-boubuf.ads)::
@@ -332,6 +337,7 @@ The GNAT Library
* GNAT.Traceback (g-traceb.ads)::
* GNAT.Traceback.Symbolic (g-trasym.ads)::
* GNAT.Wide_String_Split (g-wistsp.ads)::
+* GNAT.Wide_Wide_String_Split (g-zistsp.ads)::
* Interfaces.C.Extensions (i-cexten.ads)::
* Interfaces.C.Streams (i-cstrea.ads)::
* Interfaces.CPP (i-cpp.ads)::
@@ -366,6 +372,11 @@ Wide_Text_IO
* Wide_Text_IO Stream Pointer Positioning::
* Wide_Text_IO Reading and Writing Non-Regular Files::
+Wide_Wide_Text_IO
+
+* Wide_Wide_Text_IO Stream Pointer Positioning::
+* Wide_Wide_Text_IO Reading and Writing Non-Regular Files::
+
Interfacing to Other Languages
* Interfacing to C::
@@ -2250,9 +2261,13 @@ as will any declaration of a scalar variable. For composite variables,
whether the variable is initialized may also depend on whether the package
in which the type of the variable is declared is compiled with the pragma.
-The other important difference is that there is control over the value used
-for initializing scalar objects. At bind time, you can select whether to
-initialize with invalid values (like Normalize_Scalars), or with high or
+The other important difference is that you can control the value used
+for initializing scalar objects. At bind time, you can select several
+options for initialization. You can
+initialize with invalid values (similar to Normalize_Scalars, though for
+Initialize_Scalars it is not always possible to determine the invalid
+values in complex cases like signed component fields with non-standard
+sizes). You can also initialize with high or
low values, or with a specified bit pattern. See the users guide for binder
options for specifying these cases.
@@ -2263,6 +2278,10 @@ behavior depends on the choice. Of course the behavior should not change,
and if it does, then most likely you have an erroneous reference to an
uninitialized value.
+It is even possible to change the value at execution time eliminating even
+the need to rebind with a different switch using an environment variable.
+See the GNAT users guide for details.
+
Note that pragma @code{Initialize_Scalars} is particularly useful in
conjunction with the enhanced validity checking that is now provided
in GNAT, which checks for invalid values under more conditions.
@@ -2730,45 +2749,60 @@ are as follows:
@item Standard.Character
@noindent
Objects whose root type is Standard.Character are initialized to
-Character'Last. This will be out of range of the subtype only if
-the subtype range excludes this value.
+Character'Last unless the subtype range excludes NUL (in which case
+NUL is used). This choice will always generate an invalid value if
+one exists.
@item Standard.Wide_Character
@noindent
Objects whose root type is Standard.Wide_Character are initialized to
-Wide_Character'Last. This will be out of range of the subtype only if
-the subtype range excludes this value.
+Wide_Character'Last unless the subtype range excludes NUL (in which case
+NUL is used). This choice will always generate an invalid value if
+one exists.
-@item Integer types
+@item Standard.Wide_Wide_Character
@noindent
-Objects of an integer type are initialized to base_type'First, where
-base_type is the base type of the object type. This will be out of range
-of the subtype only if the subtype range excludes this value. For example,
-if you declare the subtype:
-
-@smallexample @c ada
-subtype Ityp is integer range 1 .. 10;
-@end smallexample
+Objects whose root type is Standard.Wide_Wide_Character are initialized to
+the invalid value 16#FFFF_FFFF# unless the subtype range excludes NUL (in
+which case NUL is used). This choice will always generate an invalid value if
+one exists.
+@item Integer types
@noindent
-then objects of type x will be initialized to Integer'First, a negative
-number that is certainly outside the range of subtype @code{Ityp}.
-
-@item Real types
-Objects of all real types (fixed and floating) are initialized to
-base_type'First, where base_Type is the base type of the object type.
-This will be out of range of the subtype only if the subtype range
-excludes this value.
+Objects of an integer type are treated differently depending on whether
+negative values are present in the subtype. If no negative values are
+present, then all one bits is used as the initial value except in the
+special case where zero is excluded from the subtype, in which case
+all zero bits are used. This choice will always generate an invalid
+value if one exists.
+
+For subtypes with negative values present, the largest negative number
+is used, except in the unusual case where this largest negative number
+is in the subtype, and the largest positive number is not, in which case
+the largest positive value is used. This choice will always generate
+an invalid value if one exists.
+
+@item Floating-Point Types
+Objects of all floating-point types are initialized to all 1-bits. For
+standard IEEE format, this corresponds to a NaN (not a number) which is
+indeed an invalid value.
+
+@item Fixed-Point Types
+Objects of all fixed-point types are treated as described above for integers,
+with the rules applying to the underlying integer value used to represent
+the fixed-point value.
@item Modular types
-Objects of a modular type are initialized to typ'Last. This will be out
-of range of the subtype only if the subtype excludes this value.
+Objects of a modular type are initialized to all one bits, except in
+the special case where zero is excluded from the subtype, in which
+case all zero bits are used. This choice will always generate an
+invalid value if one exists.
@item Enumeration types
Objects of an enumeration type are initialized to all one-bits, i.e.@: to
-the value @code{2 ** typ'Size - 1}. This will be out of range of the
-enumeration subtype in all cases except where the subtype contains
-exactly 2**8, 2**16, or 2**32 elements.
+the value @code{2 ** typ'Size - 1} unless the subtype excludes the literal
+whose Pos value is zero, in which case a code of zero is used. This choice
+will always generate an invalid value if one exists.
@end table
@@ -7112,8 +7146,9 @@ to be output either by the compiler or binder.
@item No_Wide_Characters
@findex No_Wide_Characters
This restriction ensures at compile time that no uses of the types
-@code{Wide_Character} or @code{Wide_String}
-appear, and that no wide character literals
+@code{Wide_Character} or @code{Wide_String} or corresponding wide
+wide types
+appear, and that no wide or wide wide string or character literals
appear in the program (that is literals representing characters not in
type @code{Character}.
@@ -10286,6 +10321,16 @@ packages without @samp{Wide_} in the name, but operate with the types
@code{Wide_String} and @code{Wide_Character} instead of @code{String}
and @code{Character}.
+@item Ada.Strings.Wide_Wide_Bounded (A.4.7)
+@itemx Ada.Strings.Wide_Wide_Fixed (A.4.7)
+@itemx Ada.Strings.Wide_Wide_Maps (A.4.7)
+@itemx Ada.Strings.Wide_Wide_Maps.Constants (A.4.7)
+@itemx Ada.Strings.Wide_Wide_Unbounded (A.4.7)
+These packages provide analogous capabilities to the corresponding
+packages without @samp{Wide_} in the name, but operate with the types
+@code{Wide_Wide_String} and @code{Wide_Wide_Character} instead
+of @code{String} and @code{Character}.
+
@item Ada.Synchronous_Task_Control (D.10)
This package provides some standard facilities for controlling task
communication in a synchronous manner.
@@ -10474,8 +10519,72 @@ types are @code{Wide_Character} and @code{Wide_String} instead of
This package is similar to @code{Ada.Text_IO.Streams}, except that the
types are @code{Wide_Character} and @code{Wide_String} instead of
@code{Character} and @code{String}.
+
+@item Ada.Wide_Wide_Text_IO (A.11)
+This package is similar to @code{Ada.Text_IO}, except that the external
+file supports wide character representations, and the internal types are
+@code{Wide_Character} and @code{Wide_String} instead of @code{Character}
+and @code{String}. It contains generic subpackages listed next.
+
+@item Ada.Wide_Wide_Text_IO.Decimal_IO
+Provides input-output facilities for decimal fixed-point types
+
+@item Ada.Wide_Wide_Text_IO.Enumeration_IO
+Provides input-output facilities for enumeration types.
+
+@item Ada.Wide_Wide_Text_IO.Fixed_IO
+Provides input-output facilities for ordinary fixed-point types.
+
+@item Ada.Wide_Wide_Text_IO.Float_IO
+Provides input-output facilities for float types. The following
+predefined instantiations of this generic package are available:
+
+@table @code
+@item Short_Float
+@code{Short_Float_Wide_Wide_Text_IO}
+@item Float
+@code{Float_Wide_Wide_Text_IO}
+@item Long_Float
+@code{Long_Float_Wide_Wide_Text_IO}
@end table
+@item Ada.Wide_Wide_Text_IO.Integer_IO
+Provides input-output facilities for integer types. The following
+predefined instantiations of this generic package are available:
+
+@table @code
+@item Short_Short_Integer
+@code{Ada.Short_Short_Integer_Wide_Wide_Text_IO}
+@item Short_Integer
+@code{Ada.Short_Integer_Wide_Wide_Text_IO}
+@item Integer
+@code{Ada.Integer_Wide_Wide_Text_IO}
+@item Long_Integer
+@code{Ada.Long_Integer_Wide_Wide_Text_IO}
+@item Long_Long_Integer
+@code{Ada.Long_Long_Integer_Wide_Wide_Text_IO}
+@end table
+
+@item Ada.Wide_Wide_Text_IO.Modular_IO
+Provides input-output facilities for modular (unsigned) types
+
+@item Ada.Wide_Wide_Text_IO.Complex_IO (G.1.3)
+This package is similar to @code{Ada.Text_IO.Complex_IO}, except that the
+external file supports wide character representations.
+
+@item Ada.Wide_Wide_Text_IO.Editing (F.3.4)
+This package is similar to @code{Ada.Text_IO.Editing}, except that the
+types are @code{Wide_Character} and @code{Wide_String} instead of
+@code{Character} and @code{String}.
+
+@item Ada.Wide_Wide_Text_IO.Streams (A.12.3)
+This package is similar to @code{Ada.Text_IO.Streams}, except that the
+types are @code{Wide_Character} and @code{Wide_String} instead of
+@code{Character} and @code{String}.
+@end table
+
+
+
@node The Implementation of Standard I/O
@chapter The Implementation of Standard I/O
@@ -10515,6 +10624,7 @@ these additional facilities are also described in this chapter.
* Sequential_IO::
* Text_IO::
* Wide_Text_IO::
+* Wide_Wide_Text_IO::
* Stream_IO::
* Shared Files::
* Open Modes::
@@ -10534,14 +10644,20 @@ Ada.Text_IO
@item
Ada.Text_IO.Complex_IO
@item
-Ada.Text_IO.Text_Streams,
+Ada.Text_IO.Text_Streams
@item
Ada.Wide_Text_IO
@item
-Ada.Wide_Text_IO.Complex_IO,
+Ada.Wide_Text_IO.Complex_IO
@item
Ada.Wide_Text_IO.Text_Streams
@item
+Ada.Wide_Wide_Text_IO
+@item
+Ada.Wide_Wide_Text_IO.Complex_IO
+@item
+Ada.Wide_Wide_Text_IO.Text_Streams
+@item
Ada.Stream_IO
@item
Ada.Sequential_IO
@@ -10908,6 +11024,10 @@ The package @code{Ada.Strings.Wide_Unbounded.Wide_Text_IO} in library
files @file{a-swuwti.ads} and @file{a-swuwti.adb} provides similar extended
@code{Wide_Text_IO} functionality for unbounded wide strings.
+The package @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} in library
+files @file{a-szuzti.ads} and @file{a-szuzti.adb} provides similar extended
+@code{Wide_Wide_Text_IO} functionality for unbounded wide wide strings.
+
@node Wide_Text_IO
@section Wide_Text_IO
@@ -11079,6 +11199,148 @@ treated as data characters), and @code{End_Of_Page} always returns
@code{False}. Similarly, the end of file indication is not sticky, so
it is possible to read beyond an end of file.
+@node Wide_Wide_Text_IO
+@section Wide_Wide_Text_IO
+
+@noindent
+@code{Wide_Wide_Text_IO} is similar in most respects to Text_IO, except that
+both input and output files may contain special sequences that represent
+wide wide character values. The encoding scheme for a given file may be
+specified using a FORM parameter:
+
+@smallexample
+WCEM=@var{x}
+@end smallexample
+
+@noindent
+as part of the FORM string (WCEM = wide character encoding method),
+where @var{x} is one of the following characters
+
+@table @samp
+@item h
+Hex ESC encoding
+@item u
+Upper half encoding
+@item s
+Shift-JIS encoding
+@item e
+EUC Encoding
+@item 8
+UTF-8 encoding
+@item b
+Brackets encoding
+@end table
+
+@noindent
+The encoding methods match those that
+can be used in a source
+program, but there is no requirement that the encoding method used for
+the source program be the same as the encoding method used for files,
+and different files may use different encoding methods.
+
+The default encoding method for the standard files, and for opened files
+for which no WCEM parameter is given in the FORM string matches the
+wide character encoding specified for the main program (the default
+being brackets encoding if no coding method was specified with -gnatW).
+
+@table @asis
+
+@item UTF-8 Coding
+A wide character is represented using
+UCS Transformation Format 8 (UTF-8) as defined in Annex R of ISO
+10646-1/Am.2. Depending on the character value, the representation
+is a one, two, three, or four byte sequence:
+
+@smallexample
+16#000000#-16#00007f#: 2#0xxxxxxx#
+16#000080#-16#0007ff#: 2#110xxxxx# 2#10xxxxxx#
+16#000800#-16#00ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
+16#010000#-16#10ffff#: 2#11110xxx# 2#10xxxxxx# 2#10xxxxxx# 2#10xxxxxx#
+@end smallexample
+
+@noindent
+where the xxx bits correspond to the left-padded bits of the
+21-bit character value. Note that all lower half ASCII characters
+are represented as ASCII bytes and all upper half characters and
+other wide characters are represented as sequences of upper-half
+characters.
+
+@item Brackets Coding
+In this encoding, a wide wide character is represented by the following eight
+character sequence if is in wide character range
+
+@smallexample
+[ " a b c d " ]
+@end smallexample
+
+and by the following ten character sequence if not
+
+@smallexample
+[ " a b c d e f " ]
+@end smallexample
+
+@noindent
+where @code{a}, @code{b}, @code{c}, @code{d}, @code{e}, and @code{f}
+are the four or six hexadecimal
+characters (using uppercase letters) of the wide wide character code. For
+example, @code{["01A345"]} is used to represent the wide wide character
+with code @code{16#01A345#}.
+
+This scheme is compatible with use of the full Wide_Wide_Character set.
+On input, brackets coding can also be used for upper half characters,
+e.g.@: @code{["C1"]} for lower case a. However, on output, brackets notation
+is only used for wide characters with a code greater than @code{16#FF#}.
+
+@end table
+
+@noindent
+If is also possible to use the other Wide_Character encoding methods,
+such as Shift-JIS, but the other schemes cannot support the full range
+of wide wide characters.
+An attempt to output a character that cannot
+be represented using the encoding scheme for the file causes
+Constraint_Error to be raised. An invalid wide character sequence on
+input also causes Constraint_Error to be raised.
+
+@menu
+* Wide_Wide_Text_IO Stream Pointer Positioning::
+* Wide_Wide_Text_IO Reading and Writing Non-Regular Files::
+@end menu
+
+@node Wide_Wide_Text_IO Stream Pointer Positioning
+@subsection Stream Pointer Positioning
+
+@noindent
+@code{Ada.Wide_Wide_Text_IO} is similar to @code{Ada.Text_IO} in its handling
+of stream pointer positioning (@pxref{Text_IO}). There is one additional
+case:
+
+If @code{Ada.Wide_Wide_Text_IO.Look_Ahead} reads a character outside the
+normal lower ASCII set (i.e.@: a character in the range:
+
+@smallexample @c ada
+Wide_Wide_Character'Val (16#0080#) .. Wide_Wide_Character'Val (16#10FFFF#)
+@end smallexample
+
+@noindent
+then although the logical position of the file pointer is unchanged by
+the @code{Look_Ahead} call, the stream is physically positioned past the
+wide character sequence. Again this is to avoid the need for buffering
+or backup, and all @code{Wide_Wide_Text_IO} routines check the internal
+indication that this situation has occurred so that this is not visible
+to a normal program using @code{Wide_Wide_Text_IO}. However, this discrepancy
+can be observed if the wide text file shares a stream with another file.
+
+@node Wide_Wide_Text_IO Reading and Writing Non-Regular Files
+@subsection Reading and Writing Non-Regular Files
+
+@noindent
+As in the case of Text_IO, when a non-regular file is read, it is
+assumed that the file contains no page marks (any form characters are
+treated as data characters), and @code{End_Of_Page} always returns
+@code{False}. Similarly, the end of file indication is not sticky, so
+it is possible to read beyond an end of file.
+
@node Stream_IO
@section Stream_IO
@@ -11399,6 +11661,17 @@ operations.
Form : in String := "");
end Ada.Wide_Text_IO.C_Streams;
+ with Interfaces.C_Streams;
+ package Ada.Wide_Wide_Text_IO.C_Streams is
+ function C_Stream (F : File_Type)
+ return Interfaces.C_Streams.FILEs;
+ procedure Open
+ (File : in out File_Type;
+ Mode : in File_Mode;
+ C_Stream : in Interfaces.C_Streams.FILEs;
+ Form : in String := "");
+ end Ada.Wide_Wide_Text_IO.C_Streams;
+
with Interfaces.C_Streams;
package Ada.Stream_IO.C_Streams is
function C_Stream (F : File_Type)
@@ -11412,7 +11685,7 @@ operations.
@end smallexample
@noindent
-In each of these five packages, the @code{C_Stream} function obtains the
+In each of these six packages, the @code{C_Stream} function obtains the
@code{FILE} pointer from a currently opened Ada file. It is then
possible to use the @code{Interfaces.C_Streams} package to operate on
this stream, or the stream can be passed to a C program which can
@@ -11466,6 +11739,8 @@ 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.Command_Line.Environment (a-colien.ads)::
* Ada.Direct_IO.C_Streams (a-diocst.ads)::
@@ -11475,8 +11750,10 @@ of GNAT, and will generate a warning message.
* Ada.Streams.Stream_IO.C_Streams (a-ssicst.ads)::
* Ada.Strings.Unbounded.Text_IO (a-suteio.ads)::
* 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_Text_IO.C_Streams (a-wtcstr.ads)::
+* Ada.Wide_Wide_Text_IO.C_Streams (a-ztcstr.ads)::
* GNAT.Array_Split (g-arrspl.ads)::
* GNAT.AWK (g-awk.ads)::
* GNAT.Bounded_Buffers (g-boubuf.ads)::
@@ -11539,6 +11816,7 @@ of GNAT, and will generate a warning message.
* GNAT.Traceback (g-traceb.ads)::
* GNAT.Traceback.Symbolic (g-trasym.ads)::
* GNAT.Wide_String_Split (g-wistsp.ads)::
+* GNAT.Wide_Wide_String_Split (g-zistsp.ads)::
* Interfaces.C.Extensions (i-cexten.ads)::
* Interfaces.C.Streams (i-cstrea.ads)::
* Interfaces.CPP (i-cpp.ads)::
@@ -11602,6 +11880,34 @@ instead of @code{Character}. The provision of such a package
is specifically authorized by the Ada Reference Manual
(RM A.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})
+@cindex Latin_1 constants for Wide_Wide_Character
+
+@noindent
+This child of @code{Ada.Characters}
+provides a set of definitions corresponding to those in the
+RM-defined package @code{Ada.Characters.Latin_1} but with the
+types of the constants being @code{Wide_Wide_Character}
+instead of @code{Character}. The provision of such a package
+is specifically authorized by the Ada Reference Manual
+(RM A.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})
+@cindex Latin_9 constants for Wide_Wide_Character
+
+@noindent
+This child of @code{Ada.Characters}
+provides a set of definitions corresponding to those in the
+GNAT defined package @code{Ada.Characters.Latin_9} but with the
+types of the constants being @code{Wide_Wide_Character}
+instead of @code{Character}. The provision of such a package
+is specifically authorized by the Ada Reference Manual
+(RM A.3(27)).
+
@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})
@@ -11700,6 +12006,17 @@ This package provides subprograms for Text_IO for unbounded
wide strings, avoiding the necessity for an intermediate operation
with ordinary wide strings.
+@node Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO (a-szuzti.ads)
+@section @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@file{a-szuzti.ads})
+@cindex @code{Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO} (@file{a-szuzti.ads})
+@cindex @code{Unbounded_Wide_Wide_String}, IO support
+@cindex @code{Text_IO}, extensions for unbounded wide wide strings
+
+@noindent
+This package provides subprograms for Text_IO for unbounded
+wide wide strings, avoiding the necessity for an intermediate operation
+with ordinary wide wide strings.
+
@node Ada.Text_IO.C_Streams (a-tiocst.ads)
@section @code{Ada.Text_IO.C_Streams} (@file{a-tiocst.ads})
@cindex @code{Ada.Text_IO.C_Streams} (@file{a-tiocst.ads})
@@ -11722,6 +12039,18 @@ 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_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})
+@cindex C Streams, Interfacing with @code{Wide_Wide_Text_IO}
+
+@noindent
+This package provides subprograms that allow interfacing between
+C streams and @code{Wide_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 GNAT.Array_Split (g-arrspl.ads)
@section @code{GNAT.Array_Split} (@file{g-arrspl.ads})
@cindex @code{GNAT.Array_Split} (@file{g-arrspl.ads})
@@ -12336,7 +12665,7 @@ defines a string access and an array of string access types.
@cindex String splitter
@noindent
-Useful string-manipulation routines: given a set of separators, split
+Useful string manipulation routines: given a set of separators, split
a string wherever the separators appear, and provide direct access
to the resulting slices. This package is instantiated from
@code{GNAT.Array_Split}.
@@ -12406,8 +12735,19 @@ name and line number information.
@cindex Wide_String splitter
@noindent
-Useful wide_string-manipulation routines: given a set of separators, split
-a wide_string wherever the separators appear, and provide direct access
+Useful wide string manipulation routines: given a set of separators, split
+a wide string wherever the separators appear, and provide direct access
+to the resulting slices. This package is instantiated from
+@code{GNAT.Array_Split}.
+
+@node GNAT.Wide_Wide_String_Split (g-zistsp.ads)
+@section @code{GNAT.Wide_Wide_String_Split} (@file{g-zistsp.ads})
+@cindex @code{GNAT.Wide_Wide_String_Split} (@file{g-zistsp.ads})
+@cindex Wide_Wide_String splitter
+
+@noindent
+Useful wide wide string manipulation routines: given a set of separators, split
+a wide wide string wherever the separators appear, and provide direct access
to the resulting slices. This package is instantiated from
@code{GNAT.Array_Split}.
@@ -12610,7 +12950,7 @@ to support the @code{Task_Info} pragma
@noindent
This package provides routines for converting between
-wide characters and a representation as a value of type
+wide and wide wide characters and a representation as a value of type
@code{Standard.String}, using a specified wide character
encoding method. It uses definitions in
package @code{System.Wch_Con}.
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 93f221345d4..f112f4dd79c 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -567,7 +567,6 @@ Platform-Specific Information for the Run-Time Libraries
* Summary of Run-Time Configurations::
* Specifying a Run-Time Library::
-* Choosing between Native and FSU Threads Libraries::
* Choosing the Scheduling Policy::
* Solaris-Specific Considerations::
* IRIX-Specific Considerations::
@@ -679,7 +678,7 @@ by GNAT.
@item
@ref{Compiling Using gcc}, describes how to compile
-Ada programs with @code{gcc}, the Ada compiler.
+Ada programs with @command{gcc}, the Ada compiler.
@item
@ref{Binding Using gnatbind}, describes how to
@@ -688,13 +687,13 @@ utility.
@item
@ref{Linking Using gnatlink},
-describes @code{gnatlink}, a
+describes @command{gnatlink}, a
program that provides for linking using the GNAT run-time library to
-construct a program. @code{gnatlink} can also incorporate foreign language
+construct a program. @command{gnatlink} can also incorporate foreign language
object units into the executable.
@item
-@ref{The GNAT Make Program gnatmake}, describes @code{gnatmake}, a
+@ref{The GNAT Make Program gnatmake}, describes @command{gnatmake}, a
utility that automatically determines the set of sources
needed by an Ada compilation unit, and executes the necessary compilations
binding and link.
@@ -994,7 +993,7 @@ All appropriate object files must be linked to produce an executable.
@end enumerate
@noindent
-All three steps are most commonly handled by using the @code{gnatmake}
+All three steps are most commonly handled by using the @command{gnatmake}
utility program that, given the name of the main program, automatically
performs the necessary compilation, binding and linking steps.
@@ -1047,7 +1046,7 @@ $ gcc -c hello.adb
@end smallexample
@noindent
-@code{gcc} is the command used to run the compiler. This compiler is
+@command{gcc} is the command used to run the compiler. This compiler is
capable of compiling programs in several languages, including Ada 95 and
C. It assumes that you have given it an Ada program if the file extension is
either @file{.ads} or @file{.adb}, and it will then call
@@ -1068,8 +1067,8 @@ which contains additional information used to check
that an Ada program is consistent.
To build an executable file,
use @code{gnatbind} to bind the program
-and @code{gnatlink} to link it. The
-argument to both @code{gnatbind} and @code{gnatlink} is the name of the
+and @command{gnatlink} to link it. The
+argument to both @code{gnatbind} and @command{gnatlink} is the name of the
@file{ALI} file, but the default extension of @file{.ali} can
be omitted. This means that in the most common case, the argument
is simply the name of the main program:
@@ -1204,7 +1203,7 @@ $ gcc -c greetings.ads -gnatc
@noindent
Although the compilation can be done in separate steps as in the
above example, in practice it is almost always more convenient
-to use the @code{gnatmake} tool. All you need to know in this case
+to use the @command{gnatmake} tool. All you need to know in this case
is the name of the main program's source file. The effect of the above four
commands can be achieved with a single one:
@@ -1213,7 +1212,7 @@ $ gnatmake gmain.adb
@end smallexample
@noindent
-In the next section we discuss the advantages of using @code{gnatmake} in
+In the next section we discuss the advantages of using @command{gnatmake} in
more detail.
@c *****************************
@@ -1222,7 +1221,7 @@ more detail.
@noindent
If you work on a program by compiling single components at a time using
-@code{gcc}, you typically keep track of the units you modify. In order to
+@command{gcc}, you typically keep track of the units you modify. In order to
build a consistent system, you compile not only these units, but also any
units that depend on the units you have modified.
For example, in the preceding case,
@@ -1241,7 +1240,7 @@ if the dependencies change as you change the program, you must make
sure that the makefile is kept up-to-date manually, which is also an
error-prone process.
-The @code{gnatmake} utility takes care of these details automatically.
+The @command{gnatmake} utility takes care of these details automatically.
Invoke it using either one of the following forms:
@smallexample
@@ -1251,22 +1250,22 @@ $ gnatmake ^gmain^GMAIN^
@noindent
The argument is the name of the file containing the main program;
-you may omit the extension. @code{gnatmake}
+you may omit the extension. @command{gnatmake}
examines the environment, automatically recompiles any files that need
recompiling, and binds and links the resulting set of object files,
generating the executable file, @file{^gmain^GMAIN.EXE^}.
In a large program, it
-can be extremely helpful to use @code{gnatmake}, because working out by hand
+can be extremely helpful to use @command{gnatmake}, because working out by hand
what needs to be recompiled can be difficult.
-Note that @code{gnatmake}
+Note that @command{gnatmake}
takes into account all the Ada 95 rules that
establish dependencies among units. These include dependencies that result
from inlining subprogram bodies, and from
generic instantiation. Unlike some other
-Ada make tools, @code{gnatmake} does not rely on the dependencies that were
+Ada make tools, @command{gnatmake} does not rely on the dependencies that were
found by the compiler on a previous compilation, which may possibly
-be wrong when sources change. @code{gnatmake} determines the exact set of
+be wrong when sources change. @command{gnatmake} determines the exact set of
dependencies from scratch each time it is run.
@ifset vms
@@ -1335,7 +1334,7 @@ contained in a @emph{project} (also known as a @emph{project file}):
a collection of properties such
as source directories, identities of main subprograms, tool switches, etc.,
and their associated values.
-(See @ref{GNAT Project Manager}, for details.)
+See @ref{GNAT Project Manager} for details.
In order to run GPS, you will need to either create a new project
or else open an existing one.
@@ -1936,7 +1935,7 @@ Form feed, @code{16#0C#}
@noindent
Source files are in standard text file format. In addition, GNAT will
-recognize a wide variety of stream formats, in which the end of physical
+recognize a wide variety of stream formats, in which the end of
physical lines is marked by any of the following sequences:
@code{LF}, @code{CR}, @code{CR-LF}, or @code{LF-CR}. This is useful
in accommodating files that are imported from other operating systems.
@@ -2281,7 +2280,7 @@ normally it will be placed in the @file{gnat.adc}
file used to hold configuration
pragmas that apply to a complete compilation environment.
For more details on how the @file{gnat.adc} file is created and used
-@pxref{Handling of Configuration Pragmas}
+see @ref{Handling of Configuration Pragmas}.
@cindex @file{gnat.adc}
@ifclear vms
@@ -2298,7 +2297,7 @@ $ gcc -c -x ada peculiar_file_name.sim
@end ifclear
@noindent
-@code{gnatmake} handles non-standard file names in the usual manner (the
+@command{gnatmake} handles non-standard file names in the usual manner (the
non-standard file name for the main program is simply used as the
argument to gnatmake). Note that if the extension is also non-standard,
then it must be included in the gnatmake command, it may not be omitted.
@@ -2585,7 +2584,7 @@ example, if the @code{make} utility is used to control compilation,
the rule for an Ada object file must mention all the source files on
which the object file depends, according to the above definition.
The determination of the necessary
-recompilations is done automatically when one uses @code{gnatmake}.
+recompilations is done automatically when one uses @command{gnatmake}.
@end itemize
@node The Ada Library Information Files
@@ -2611,7 +2610,7 @@ Main program information (including priority and time slice settings,
as well as the wide character encoding used during compilation).
@item
-List of arguments used in the @code{gcc} command for the compilation
+List of arguments used in the @command{gcc} command for the compilation
@item
Attributes of the unit, including configuration pragmas used, an indication
@@ -3211,7 +3210,7 @@ located in this directory:
@smallexample
$ cat ./my_script
#!/bin/sh
-CC $* `gcc -print-libgcc-file-name`
+CC $* `gcc -print-file-name=libgcc.a` `gcc -print-file-name=libgcc_eh.a`
$ gnatlink ada_unit file1.o file2.o --LINK=./my_script
@end smallexample
@@ -3484,10 +3483,10 @@ GNAT uses the current directory for temporary files.
@c *************************
@node Compiling Using gcc
-@chapter Compiling Using @code{gcc}
+@chapter Compiling Using @command{gcc}
@noindent
-This chapter discusses how to compile Ada programs using the @code{gcc}
+This chapter discusses how to compile Ada programs using the @command{gcc}
command. It also describes the set of switches
that can be used to control the behavior of the compiler.
@menu
@@ -3503,7 +3502,7 @@ that can be used to control the behavior of the compiler.
@noindent
The first step in creating an executable program is to compile the units
-of the program using the @code{gcc} command. You must compile the
+of the program using the @command{gcc} command. You must compile the
following files:
@itemize @bullet
@@ -3574,7 +3573,7 @@ having an extension
@file{.ads} for a spec or @file{.adb} for a body).
@ifclear vms
You specify the
-@option{-c} switch to tell @code{gcc} to compile, but not link, the file.
+@option{-c} switch to tell @command{gcc} to compile, but not link, the file.
@end ifclear
The result of a successful compilation is an object file, which has the
same name as the source file but an extension of @file{.o} and an Ada
@@ -3585,17 +3584,17 @@ file in any directory using an absolute or relative path specification
containing the directory information.
@findex gnat1
-@code{gcc} is actually a driver program that looks at the extensions of
+@command{gcc} is actually a driver program that looks at the extensions of
the file arguments and loads the appropriate compiler. For example, the
GNU C compiler is @file{cc1}, and the Ada compiler is @file{gnat1}.
These programs are in directories known to the driver program (in some
configurations via environment variables you set), but need not be in
-your path. The @code{gcc} driver also calls the assembler and any other
+your path. The @command{gcc} driver also calls the assembler and any other
utilities needed to complete the generation of the required object
files.
-It is possible to supply several file names on the same @code{gcc}
-command. This causes @code{gcc} to call the appropriate compiler for
+It is possible to supply several file names on the same @command{gcc}
+command. This causes @command{gcc} to call the appropriate compiler for
each file. For example, the following command lists three separate
files to be compiled:
@@ -3615,10 +3614,10 @@ except for
@end ifclear
@node Switches for gcc
-@section Switches for @code{gcc}
+@section Switches for @command{gcc}
@noindent
-The @code{gcc} command accepts switches that control the
+The @command{gcc} command accepts switches that control the
compilation process. These switches are fully described in this section.
First we briefly list all the switches, in alphabetical order, then we
describe the switches in more detail in functionally grouped sections.
@@ -3651,34 +3650,34 @@ describe the switches in more detail in functionally grouped sections.
@table @option
@c !sort!
@ifclear vms
-@cindex @option{-b} (@code{gcc})
+@cindex @option{-b} (@command{gcc})
@item -b @var{target}
Compile your program to run on @var{target}, which is the name of a
system configuration. You must have a GNAT cross-compiler built if
@var{target} is not the same as your host system.
@item -B@var{dir}
-@cindex @option{-B} (@code{gcc})
+@cindex @option{-B} (@command{gcc})
Load compiler executables (for example, @code{gnat1}, the Ada compiler)
from @var{dir} instead of the default location. Only use this switch
when multiple versions of the GNAT compiler are available. See the
-@code{gcc} manual page for further details. You would normally use the
+@command{gcc} manual page for further details. You would normally use the
@option{-b} or @option{-V} switch instead.
@item -c
-@cindex @option{-c} (@code{gcc})
+@cindex @option{-c} (@command{gcc})
Compile. Always use this switch when compiling Ada programs.
-Note: for some other languages when using @code{gcc}, notably in
+Note: for some other languages when using @command{gcc}, notably in
the case of C and C++, it is possible to use
-use @code{gcc} without a @option{-c} switch to
+use @command{gcc} without a @option{-c} switch to
compile and link in one step. In the case of GNAT, you
cannot use this approach, because the binder must be run
-and @code{gcc} cannot be used to run the GNAT binder.
+and @command{gcc} cannot be used to run the GNAT binder.
@end ifclear
@item -fno-inline
-@cindex @option{-fno-inline} (@code{gcc})
+@cindex @option{-fno-inline} (@command{gcc})
Suppresses all back-end inlining, even if other optimization or inlining
switches are set.
This includes suppression of inlining that results
@@ -3686,47 +3685,47 @@ from the use of the pragma @code{Inline_Always}.
See also @option{-gnatn} and @option{-gnatN}.
@item -fno-strict-aliasing
-@cindex @option{-fno-strict-aliasing} (@code{gcc})
+@cindex @option{-fno-strict-aliasing} (@command{gcc})
Causes the compiler to avoid assumptions regarding non-aliasing
-of objects of different types. See section
-@pxref{Optimization and Strict Aliasing} for details.
+of objects of different types. See
+@ref{Optimization and Strict Aliasing} for details.
@item -fstack-check
-@cindex @option{-fstack-check} (@code{gcc})
+@cindex @option{-fstack-check} (@command{gcc})
Activates stack checking.
See @ref{Stack Overflow Checking} for details of the use of this option.
@item ^-g^/DEBUG^
-@cindex @option{^-g^/DEBUG^} (@code{gcc})
+@cindex @option{^-g^/DEBUG^} (@command{gcc})
Generate debugging information. This information is stored in the object
file and copied from there to the final executable file by the linker,
where it can be read by the debugger. You must use the
@option{^-g^/DEBUG^} switch if you plan on using the debugger.
@item -gnat83
-@cindex @option{-gnat83} (@code{gcc})
+@cindex @option{-gnat83} (@command{gcc})
Enforce Ada 83 restrictions.
@item -gnata
-@cindex @option{-gnata} (@code{gcc})
+@cindex @option{-gnata} (@command{gcc})
Assertions enabled. @code{Pragma Assert} and @code{pragma Debug} to be
activated.
@item -gnatA
-@cindex @option{-gnatA} (@code{gcc})
+@cindex @option{-gnatA} (@command{gcc})
Avoid processing @file{gnat.adc}. If a gnat.adc file is present,
it will be ignored.
@item -gnatb
-@cindex @option{-gnatb} (@code{gcc})
+@cindex @option{-gnatb} (@command{gcc})
Generate brief messages to @file{stderr} even if verbose mode set.
@item -gnatc
-@cindex @option{-gnatc} (@code{gcc})
+@cindex @option{-gnatc} (@command{gcc})
Check syntax and semantics only (no code generation attempted).
@item -gnatd
-@cindex @option{-gnatd} (@code{gcc})
+@cindex @option{-gnatd} (@command{gcc})
Specify debug options for the compiler. The string of characters after
the @option{-gnatd} specify the specific debug options. The possible
characters are 0-9, a-z, A-Z, optionally preceded by a dot. See
@@ -3736,59 +3735,59 @@ programmers, and these are documented at appropriate points in this
users guide.
@item -gnatD
-@cindex @option{-gnatD} (@code{gcc})
+@cindex @option{-gnatD} (@command{gcc})
Create expanded source files for source level debugging. This switch
also suppress generation of cross-reference information
(see @option{-gnatx}).
@item -gnatec=@var{path}
-@cindex @option{-gnatec} (@code{gcc})
+@cindex @option{-gnatec} (@command{gcc})
Specify a configuration pragma file
@ifclear vms
(the equal sign is optional)
@end ifclear
-(see @ref{The Configuration Pragmas Files}).
+(@pxref{The Configuration Pragmas Files}).
@item ^-gnateD^/DATA_PREPROCESSING=^symbol[=value]
-@cindex @option{-gnateD} (@code{gcc})
+@cindex @option{-gnateD} (@command{gcc})
Defines a symbol, associated with value, for preprocessing.
-(see @ref{Integrated Preprocessing})
+(@pxref{Integrated Preprocessing}).
@item -gnatef
-@cindex @option{-gnatef} (@code{gcc})
+@cindex @option{-gnatef} (@command{gcc})
Display full source path name in brief error messages.
@item -gnatem=@var{path}
-@cindex @option{-gnatem} (@code{gcc})
+@cindex @option{-gnatem} (@command{gcc})
Specify a mapping file
@ifclear vms
(the equal sign is optional)
@end ifclear
-(see @ref{Units to Sources Mapping Files}).
+(@pxref{Units to Sources Mapping Files}).
@item -gnatep=@var{file}
-@cindex @option{-gnatep} (@code{gcc})
+@cindex @option{-gnatep} (@command{gcc})
Specify a preprocessing data file
@ifclear vms
(the equal sign is optional)
@end ifclear
-(see @ref{Integrated Preprocessing}).
+(@pxref{Integrated Preprocessing}).
@item -gnatE
-@cindex @option{-gnatE} (@code{gcc})
+@cindex @option{-gnatE} (@command{gcc})
Full dynamic elaboration checks.
@item -gnatf
-@cindex @option{-gnatf} (@code{gcc})
+@cindex @option{-gnatf} (@command{gcc})
Full errors. Multiple errors per line, all undefined references, do not
attempt to suppress cascaded errors.
@item -gnatF
-@cindex @option{-gnatF} (@code{gcc})
+@cindex @option{-gnatF} (@command{gcc})
Externals names are folded to all uppercase.
@item -gnatg
-@cindex @option{-gnatg} (@code{gcc})
+@cindex @option{-gnatg} (@command{gcc})
Internal GNAT implementation mode. This should not be used for
applications programs, it is intended only for use by the compiler
and its run-time library. For documentation, see the GNAT sources.
@@ -3797,51 +3796,51 @@ are generated on unreferenced entities, and all warnings are treated
as errors.
@item -gnatG
-@cindex @option{-gnatG} (@code{gcc})
+@cindex @option{-gnatG} (@command{gcc})
List generated expanded code in source form.
@item ^-gnath^/HELP^
-@cindex @option{^-gnath^/HELP^} (@code{gcc})
+@cindex @option{^-gnath^/HELP^} (@command{gcc})
Output usage information. The output is written to @file{stdout}.
@item ^-gnati^/IDENTIFIER_CHARACTER_SET=^@var{c}
-@cindex @option{^-gnati^/IDENTIFIER_CHARACTER_SET^} (@code{gcc})
+@cindex @option{^-gnati^/IDENTIFIER_CHARACTER_SET^} (@command{gcc})
Identifier character set
@ifclear vms
(@var{c}=1/2/3/4/8/9/p/f/n/w).
@end ifclear
@ifset vms
For details of the possible selections for @var{c},
-see @xref{Character Set Control}.
+see @ref{Character Set Control}.
@end ifset
@item -gnatk=@var{n}
-@cindex @option{-gnatk} (@code{gcc})
+@cindex @option{-gnatk} (@command{gcc})
Limit file names to @var{n} (1-999) characters ^(@code{k} = krunch)^^.
@item -gnatl
-@cindex @option{-gnatl} (@code{gcc})
+@cindex @option{-gnatl} (@command{gcc})
Output full source listing with embedded error messages.
@item -gnatL
-@cindex @option{-gnatL} (@code{gcc})
+@cindex @option{-gnatL} (@command{gcc})
Use the longjmp/setjmp method for exception handling
@item -gnatm=@var{n}
-@cindex @option{-gnatm} (@code{gcc})
+@cindex @option{-gnatm} (@command{gcc})
Limit number of detected error or warning messages to @var{n}
where @var{n} is in the range 1..999_999. The default setting if
no switch is given is 9999. Compilation is terminated if this
limit is exceeded.
@item -gnatn
-@cindex @option{-gnatn} (@code{gcc})
+@cindex @option{-gnatn} (@command{gcc})
Activate inlining for subprograms for which
pragma @code{inline} is specified. This inlining is performed
by the GCC back-end.
@item -gnatN
-@cindex @option{-gnatN} (@code{gcc})
+@cindex @option{-gnatN} (@command{gcc})
Activate front end inlining for subprograms for which
pragma @code{Inline} is specified. This inlining is performed
by the front end and will be visible in the
@@ -3856,76 +3855,76 @@ to specify both options. There are a few cases that the back-end inlining
catches that cannot be dealt with in the front-end.
@item -gnato
-@cindex @option{-gnato} (@code{gcc})
+@cindex @option{-gnato} (@command{gcc})
Enable numeric overflow checking (which is not normally enabled by
default). Not that division by zero is a separate check that is not
controlled by this switch (division by zero checking is on by default).
@item -gnatp
-@cindex @option{-gnatp} (@code{gcc})
+@cindex @option{-gnatp} (@command{gcc})
Suppress all checks.
@item -gnatP
-@cindex @option{-gnatP} (@code{gcc})
+@cindex @option{-gnatP} (@command{gcc})
Enable polling. This is required on some systems (notably Windows NT) to
obtain asynchronous abort and asynchronous transfer of control capability.
See the description of pragma Polling in the GNAT Reference Manual for
full details.
@item -gnatq
-@cindex @option{-gnatq} (@code{gcc})
+@cindex @option{-gnatq} (@command{gcc})
Don't quit; try semantics, even if parse errors.
@item -gnatQ
-@cindex @option{-gnatQ} (@code{gcc})
+@cindex @option{-gnatQ} (@command{gcc})
Don't quit; generate @file{ALI} and tree files even if illegalities.
@item ^-gnatR[0/1/2/3[s]]^/REPRESENTATION_INFO^
-@cindex @option{-gnatR} (@code{gcc})
+@cindex @option{-gnatR} (@command{gcc})
Output representation information for declared types and objects.
@item -gnats
-@cindex @option{-gnats} (@code{gcc})
+@cindex @option{-gnats} (@command{gcc})
Syntax check only.
@item -gnatS
-@cindex @option{-gnatS} (@code{gcc})
+@cindex @option{-gnatS} (@command{gcc})
Print package Standard.
@item -gnatt
-@cindex @option{-gnatt} (@code{gcc})
+@cindex @option{-gnatt} (@command{gcc})
Generate tree output file.
@item ^-gnatT^/TABLE_MULTIPLIER=^@var{nnn}
-@cindex @option{^-gnatT^/TABLE_MULTIPLIER^} (@code{gcc})
+@cindex @option{^-gnatT^/TABLE_MULTIPLIER^} (@command{gcc})
All compiler tables start at @var{nnn} times usual starting size.
@item -gnatu
-@cindex @option{-gnatu} (@code{gcc})
+@cindex @option{-gnatu} (@command{gcc})
List units for this compilation.
@item -gnatU
-@cindex @option{-gnatU} (@code{gcc})
+@cindex @option{-gnatU} (@command{gcc})
Tag all error messages with the unique string ``error:''
@item -gnatv
-@cindex @option{-gnatv} (@code{gcc})
+@cindex @option{-gnatv} (@command{gcc})
Verbose mode. Full error output with source lines to @file{stdout}.
@item -gnatV
-@cindex @option{-gnatV} (@code{gcc})
+@cindex @option{-gnatV} (@command{gcc})
Control level of validity checking. See separate section describing
this feature.
@item ^-gnatw@var{xxx}^/WARNINGS=(@var{option}[,...])^
-@cindex @option{^-gnatw^/WARNINGS^} (@code{gcc})
+@cindex @option{^-gnatw^/WARNINGS^} (@command{gcc})
Warning mode where
^@var{xxx} is a string of option letters that^the list of options^ denotes
the exact warnings that
-are enabled or disabled. (see @ref{Warning Message Control})
+are enabled or disabled (@pxref{Warning Message Control}).
@item ^-gnatW^/WIDE_CHARACTER_ENCODING=^@var{e}
-@cindex @option{^-gnatW^/WIDE_CHARACTER_ENCODING^} (@code{gcc})
+@cindex @option{^-gnatW^/WIDE_CHARACTER_ENCODING^} (@command{gcc})
Wide character encoding method
@ifclear vms
(@var{e}=n/h/u/s/e/8).
@@ -3935,15 +3934,15 @@ Wide character encoding method
@end ifset
@item -gnatx
-@cindex @option{-gnatx} (@code{gcc})
+@cindex @option{-gnatx} (@command{gcc})
Suppress generation of cross-reference information.
@item ^-gnaty^/STYLE_CHECKS=(option,option..)^
-@cindex @option{^-gnaty^/STYLE_CHECKS^} (@code{gcc})
-Enable built-in style checks. (see @ref{Style Checking})
+@cindex @option{^-gnaty^/STYLE_CHECKS^} (@command{gcc})
+Enable built-in style checks (@pxref{Style Checking}).
@item ^-gnatz^/DISTRIBUTION_STUBS=^@var{m}
-@cindex @option{^-gnatz^/DISTRIBUTION_STUBS^} (@code{gcc})
+@cindex @option{^-gnatz^/DISTRIBUTION_STUBS^} (@command{gcc})
Distribution stub generation and compilation
@ifclear vms
(@var{m}=r/c for receiver/caller stubs).
@@ -3957,14 +3956,14 @@ to be generated and compiled).
Use the zero cost method for exception handling
@item ^-I^/SEARCH=^@var{dir}
-@cindex @option{^-I^/SEARCH^} (@code{gcc})
+@cindex @option{^-I^/SEARCH^} (@command{gcc})
@cindex RTL
Direct GNAT to search the @var{dir} directory for source files needed by
the current compilation
(@pxref{Search Paths and the Run-Time Library (RTL)}).
@item ^-I-^/NOCURRENT_DIRECTORY^
-@cindex @option{^-I-^/NOCURRENT_DIRECTORY^} (@code{gcc})
+@cindex @option{^-I-^/NOCURRENT_DIRECTORY^} (@command{gcc})
@cindex RTL
Except for the source file named in the command line, do not look for source
files in the directory containing the source file named in the command line
@@ -3982,8 +3981,8 @@ This may result in less efficient code, but is sometimes necessary
in order to compile large and/or nested @code{case} statements.
@item -o @var{file}
-@cindex @option{-o} (@code{gcc})
-This switch is used in @code{gcc} to redirect the generated object file
+@cindex @option{-o} (@command{gcc})
+This switch is used in @command{gcc} to redirect the generated object file
and its associated ALI file. Beware of this switch with GNAT, because it may
cause the object file and ALI file to have different names which in turn
may confuse the binder and the linker.
@@ -4001,7 +4000,7 @@ Library (RTL) ALI files.
@ifclear vms
@item -O[@var{n}]
-@cindex @option{-O} (@code{gcc})
+@cindex @option{-O} (@command{gcc})
@var{n} controls the optimization level.
@table @asis
@@ -4019,7 +4018,7 @@ Extensive optimization
Extensive optimization with automatic inlining of subprograms not
specified by pragma @code{Inline}. This applies only to
inlining within a unit. For details on control of inlining
-see @xref{Subprogram Inlining Control}.
+see @ref{Subprogram Inlining Control}.
@end table
@end ifclear
@@ -4064,18 +4063,18 @@ usually, but not always, improves the performance of programs.
@ifclear vms
@item -pass-exit-codes
-@cindex @option{-pass-exit-codes} (@code{gcc})
+@cindex @option{-pass-exit-codes} (@command{gcc})
Catch exit codes from the compiler and use the most meaningful as
exit status.
@end ifclear
@item --RTS=@var{rts-path}
-@cindex @option{--RTS} (@code{gcc})
+@cindex @option{--RTS} (@command{gcc})
Specifies the default location of the runtime library. Same meaning as the
-equivalent @code{gnatmake} flag (see @ref{Switches for gnatmake}).
+equivalent @command{gnatmake} flag (@pxref{Switches for gnatmake}).
@item ^-S^/ASM^
-@cindex @option{^-S^/ASM^} (@code{gcc})
+@cindex @option{^-S^/ASM^} (@command{gcc})
^Used in place of @option{-c} to^Used to^
cause the assembler source file to be
generated, using @file{^.s^.S^} as the extension,
@@ -4083,21 +4082,21 @@ instead of the object file.
This may be useful if you need to examine the generated assembly code.
@item ^-fverbose-asm^/VERBOSE_ASM^
-@cindex @option{^-fverbose-asm^/VERBOSE_ASM^} (@code{gcc})
+@cindex @option{^-fverbose-asm^/VERBOSE_ASM^} (@command{gcc})
^Used in conjunction with @option{-S}^Used in place of @option{/ASM}^
to cause the generated assembly code file to be annotated with variable
names, making it significantly easier to follow.
@item ^-v^/VERBOSE^
-@cindex @option{^-v^/VERBOSE^} (@code{gcc})
-Show commands generated by the @code{gcc} driver. Normally used only for
+@cindex @option{^-v^/VERBOSE^} (@command{gcc})
+Show commands generated by the @command{gcc} driver. Normally used only for
debugging purposes or if you need to be sure what version of the
compiler you are executing.
@ifclear vms
@item -V @var{ver}
-@cindex @option{-V} (@code{gcc})
-Execute @var{ver} version of the compiler. This is the @code{gcc}
+@cindex @option{-V} (@command{gcc})
+Execute @var{ver} version of the compiler. This is the @command{gcc}
version, not the GNAT version.
@end ifclear
@@ -4188,7 +4187,7 @@ format:
@table @option
@c !sort!
@item -gnatv
-@cindex @option{-gnatv} (@code{gcc})
+@cindex @option{-gnatv} (@command{gcc})
@findex stdout
@ifclear vms
The v stands for verbose.
@@ -4215,7 +4214,7 @@ prefix can be used to search for error messages. When this switch is
used the only source lines output are those with errors.
@item -gnatl
-@cindex @option{-gnatl} (@code{gcc})
+@cindex @option{-gnatl} (@command{gcc})
@ifclear vms
The @code{l} stands for list.
@end ifclear
@@ -4249,14 +4248,14 @@ standard output is redirected, a brief summary is written to
warning messages generated.
@item -gnatU
-@cindex @option{-gnatU} (@code{gcc})
+@cindex @option{-gnatU} (@command{gcc})
This switch forces all error messages to be preceded by the unique
string ``error:''. This means that error messages take a few more
characters in space, but allows easy searching for and identification
of error messages.
@item -gnatb
-@cindex @option{-gnatb} (@code{gcc})
+@cindex @option{-gnatb} (@command{gcc})
@ifclear vms
The @code{b} stands for brief.
@end ifclear
@@ -4267,7 +4266,7 @@ format message or full listing (which as usual is written to
@file{stdout} (the standard output file).
@item -gnatm^^=^@var{n}
-@cindex @option{-gnatm} (@code{gcc})
+@cindex @option{-gnatm} (@command{gcc})
@ifclear vms
The @code{m} stands for maximum.
@end ifclear
@@ -4283,7 +4282,7 @@ compilation abandoned
@end smallexample
@item -gnatf
-@cindex @option{-gnatf} (@code{gcc})
+@cindex @option{-gnatf} (@command{gcc})
@cindex Error messages, suppressing
@ifclear vms
The @code{f} stands for full.
@@ -4327,7 +4326,7 @@ Additional details on incorrect parameters
@end itemize
@item -gnatq
-@cindex @option{-gnatq} (@code{gcc})
+@cindex @option{-gnatq} (@command{gcc})
@ifclear vms
The @code{q} stands for quit (really ``don't quit'').
@end ifclear
@@ -4341,7 +4340,7 @@ the other hand, the semantic analyzer is more likely to encounter some
internal fatal error when given a syntactically invalid tree.
@item -gnatQ
-@cindex @option{-gnatQ} (@code{gcc})
+@cindex @option{-gnatQ} (@command{gcc})
In normal operation mode, the @file{ALI} file is not generated if any
illegalities are detected in the program. The use of @option{-gnatQ} forces
generation of the @file{ALI} file. This file is marked as being in
@@ -4361,7 +4360,7 @@ causes the tree to be badly malformed, then ASIS may crash during the
analysis.
When @option{-gnatQ} is used and the generated @file{ALI} file is marked as
-being in error, @code{gnatmake} will attempt to recompile the source when it
+being in error, @command{gnatmake} will attempt to recompile the source when it
finds such an @file{ALI} file, including with switch @option{-gnatc}.
Note that @option{-gnatQ} has no effect if @option{-gnats} is specified,
@@ -4537,7 +4536,7 @@ warning messages:
@c !sort!
@item -gnatwa
@emph{Activate all optional errors.}
-@cindex @option{-gnatwa} (@code{gcc})
+@cindex @option{-gnatwa} (@command{gcc})
This switch activates most optional warning messages, see remaining list
in this section for details on optional warning messages that can be
individually controlled. The warnings that are not turned on by this
@@ -4549,14 +4548,14 @@ All other optional warnings are turned on.
@item -gnatwA
@emph{Suppress all optional errors.}
-@cindex @option{-gnatwA} (@code{gcc})
+@cindex @option{-gnatwA} (@command{gcc})
This switch suppresses all optional warning messages, see remaining list
in this section for details on optional warning messages that can be
individually controlled.
@item -gnatwc
@emph{Activate warnings on conditionals.}
-@cindex @option{-gnatwc} (@code{gcc})
+@cindex @option{-gnatwc} (@command{gcc})
@cindex Conditionals, constant
This switch activates warnings for conditional expressions used in
tests that are known to be True or False at compile time. The default
@@ -4570,13 +4569,13 @@ This warning can also be turned on using @option{-gnatwa}.
@item -gnatwC
@emph{Suppress warnings on conditionals.}
-@cindex @option{-gnatwC} (@code{gcc})
+@cindex @option{-gnatwC} (@command{gcc})
This switch suppresses warnings for conditional expressions used in
tests that are known to be True or False at compile time.
@item -gnatwd
@emph{Activate warnings on implicit dereferencing.}
-@cindex @option{-gnatwd} (@code{gcc})
+@cindex @option{-gnatwd} (@command{gcc})
If this switch is set, then the use of a prefix of an access type
in an indexed component, slice, or selected component without an
explicit @code{.all} will generate a warning. With this warning
@@ -4589,7 +4588,7 @@ this warning option.
@item -gnatwD
@emph{Suppress warnings on implicit dereferencing.}
-@cindex @option{-gnatwD} (@code{gcc})
+@cindex @option{-gnatwD} (@command{gcc})
@cindex Implicit dereferencing
@cindex Dereferencing, implicit
This switch suppresses warnings for implicit dereferences in
@@ -4597,7 +4596,7 @@ indexed components, slices, and selected components.
@item -gnatwe
@emph{Treat warnings as errors.}
-@cindex @option{-gnatwe} (@code{gcc})
+@cindex @option{-gnatwe} (@command{gcc})
@cindex Warnings, treat as error
This switch causes warning messages to be treated as errors.
The warning string still appears, but the warning messages are counted
@@ -4605,7 +4604,7 @@ as errors, and prevent the generation of an object file.
@item -gnatwf
@emph{Activate warnings on unreferenced formals.}
-@cindex @option{-gnatwf} (@code{gcc})
+@cindex @option{-gnatwf} (@command{gcc})
@cindex Formals, unreferenced
This switch causes a warning to be generated if a formal parameter
is not referenced in the body of the subprogram. This warning can
@@ -4613,7 +4612,7 @@ also be turned on using @option{-gnatwa} or @option{-gnatwu}.
@item -gnatwF
@emph{Suppress warnings on unreferenced formals.}
-@cindex @option{-gnatwF} (@code{gcc})
+@cindex @option{-gnatwF} (@command{gcc})
This switch suppresses warnings for unreferenced formal
parameters. Note that the
combination @option{-gnatwu} followed by @option{-gnatwF} has the
@@ -4622,7 +4621,7 @@ formals.
@item -gnatwg
@emph{Activate warnings on unrecognized pragmas.}
-@cindex @option{-gnatwg} (@code{gcc})
+@cindex @option{-gnatwg} (@command{gcc})
@cindex Pragmas, unrecognized
This switch causes a warning to be generated if an unrecognized
pragma is encountered. Apart from issuing this warning, the
@@ -4633,12 +4632,12 @@ Manual requirement that such warnings appear).
@item -gnatwG
@emph{Suppress warnings on unrecognized pragmas.}
-@cindex @option{-gnatwG} (@code{gcc})
+@cindex @option{-gnatwG} (@command{gcc})
This switch suppresses warnings for unrecognized pragmas.
@item -gnatwh
@emph{Activate warnings on hiding.}
-@cindex @option{-gnatwh} (@code{gcc})
+@cindex @option{-gnatwh} (@command{gcc})
@cindex Hiding of Declarations
This switch activates warnings on hiding declarations.
A declaration is considered hiding
@@ -4649,12 +4648,12 @@ Note that @option{-gnatwa} does not affect the setting of this warning option.
@item -gnatwH
@emph{Suppress warnings on hiding.}
-@cindex @option{-gnatwH} (@code{gcc})
+@cindex @option{-gnatwH} (@command{gcc})
This switch suppresses warnings on hiding declarations.
@item -gnatwi
@emph{Activate warnings on implementation units.}
-@cindex @option{-gnatwi} (@code{gcc})
+@cindex @option{-gnatwi} (@command{gcc})
This switch activates warnings for a @code{with} of an internal GNAT
implementation unit, defined as any unit from the @code{Ada},
@code{Interfaces}, @code{GNAT},
@@ -4668,13 +4667,13 @@ This warning can also be turned on using @option{-gnatwa}.
@item -gnatwI
@emph{Disable warnings on implementation units.}
-@cindex @option{-gnatwI} (@code{gcc})
+@cindex @option{-gnatwI} (@command{gcc})
This switch disables warnings for a @code{with} of an internal GNAT
implementation unit.
@item -gnatwj
@emph{Activate warnings on obsolescent features (Annex J).}
-@cindex @option{-gnatwj} (@code{gcc})
+@cindex @option{-gnatwj} (@command{gcc})
@cindex Features, obsolescent
@cindex Obsolescent features
If this warning option is activated, then warnings are generated for
@@ -4699,23 +4698,23 @@ Second, the restriction does flag uses of package @code{ASCII}.
@item -gnatwJ
@emph{Suppress warnings on obsolescent features (Annex J).}
-@cindex @option{-gnatwJ} (@code{gcc})
+@cindex @option{-gnatwJ} (@command{gcc})
This switch disables warnings on use of obsolescent features.
@item -gnatwk
@emph{Activate warnings on variables that could be constants.}
-@cindex @option{-gnatwk} (@code{gcc})
+@cindex @option{-gnatwk} (@command{gcc})
This switch activates warnings for variables that are initialized but
never modified, and then could be declared constants.
@item -gnatwK
@emph{Suppress warnings on variables that could be constants.}
-@cindex @option{-gnatwK} (@code{gcc})
+@cindex @option{-gnatwK} (@command{gcc})
This switch disables warnings on variables that could be declared constants.
@item -gnatwl
@emph{Activate warnings for missing elaboration pragmas.}
-@cindex @option{-gnatwl} (@code{gcc})
+@cindex @option{-gnatwl} (@command{gcc})
@cindex Elaboration, warnings
This switch activates warnings on missing
@code{pragma Elaborate_All} statements.
@@ -4728,14 +4727,14 @@ This warning is not automatically turned on by the use of @option{-gnatwa}.
@item -gnatwL
@emph{Suppress warnings for missing elaboration pragmas.}
-@cindex @option{-gnatwL} (@code{gcc})
+@cindex @option{-gnatwL} (@command{gcc})
This switch suppresses warnings on missing pragma Elaborate_All statements.
See the section in this guide on elaboration checking for details on
when such pragma should be used.
@item -gnatwm
@emph{Activate warnings on modified but unreferenced variables.}
-@cindex @option{-gnatwm} (@code{gcc})
+@cindex @option{-gnatwm} (@command{gcc})
This switch activates warnings for variables that are assigned (using
an initialization value or with one or more assignment statements) but
whose value is never read. The warning is suppressed for volatile
@@ -4745,13 +4744,13 @@ This warning can also be turned on using @option{-gnatwa}.
@item -gnatwM
@emph{Disable warnings on modified but unreferenced variables.}
-@cindex @option{-gnatwM} (@code{gcc})
+@cindex @option{-gnatwM} (@command{gcc})
This switch disables warnings for variables that are assigned or
initialized, but never read.
@item -gnatwn
@emph{Set normal warnings mode.}
-@cindex @option{-gnatwn} (@code{gcc})
+@cindex @option{-gnatwn} (@command{gcc})
This switch sets normal warning mode, in which enabled warnings are
issued and treated as warnings rather than errors. This is the default
mode. the switch @option{-gnatwn} can be used to cancel the effect of
@@ -4762,7 +4761,7 @@ use of @option{-gnatg}.
@item -gnatwo
@emph{Activate warnings on address clause overlays.}
-@cindex @option{-gnatwo} (@code{gcc})
+@cindex @option{-gnatwo} (@command{gcc})
@cindex Address Clauses, warnings
This switch activates warnings for possibly unintended initialization
effects of defining address clauses that cause one variable to overlap
@@ -4771,14 +4770,14 @@ This warning can also be turned on using @option{-gnatwa}.
@item -gnatwO
@emph{Suppress warnings on address clause overlays.}
-@cindex @option{-gnatwO} (@code{gcc})
+@cindex @option{-gnatwO} (@command{gcc})
This switch suppresses warnings on possibly unintended initialization
effects of defining address clauses that cause one variable to overlap
another.
@item -gnatwp
@emph{Activate warnings on ineffective pragma Inlines.}
-@cindex @option{-gnatwp} (@code{gcc})
+@cindex @option{-gnatwp} (@command{gcc})
@cindex Inlining, warnings
This switch activates warnings for failure of front end inlining
(activated by @option{-gnatN}) to inline a particular call. There are
@@ -4788,14 +4787,14 @@ This warning can also be turned on using @option{-gnatwa}.
@item -gnatwP
@emph{Suppress warnings on ineffective pragma Inlines.}
-@cindex @option{-gnatwP} (@code{gcc})
+@cindex @option{-gnatwP} (@command{gcc})
This switch suppresses warnings on ineffective pragma Inlines. If the
inlining mechanism cannot inline a call, it will simply ignore the
request silently.
@item -gnatwr
@emph{Activate warnings on redundant constructs.}
-@cindex @option{-gnatwr} (@code{gcc})
+@cindex @option{-gnatwr} (@command{gcc})
This switch activates warnings for redundant constructs. The following
is the current list of constructs regarded as redundant:
This warning can also be turned on using @option{-gnatwa}.
@@ -4823,21 +4822,21 @@ Comparison of boolean expressions to an explicit True value.
@item -gnatwR
@emph{Suppress warnings on redundant constructs.}
-@cindex @option{-gnatwR} (@code{gcc})
+@cindex @option{-gnatwR} (@command{gcc})
This switch suppresses warnings for redundant constructs.
@item -gnatws
@emph{Suppress all warnings.}
-@cindex @option{-gnatws} (@code{gcc})
+@cindex @option{-gnatws} (@command{gcc})
This switch completely suppresses the
output of all warning messages from the GNAT front end.
-Note that it does not suppress warnings from the @code{gcc} back end.
+Note that it does not suppress warnings from the @command{gcc} back end.
To suppress these back end warnings as well, use the switch @option{-w}
in addition to @option{-gnatws}.
@item -gnatwu
@emph{Activate warnings on unused entities.}
-@cindex @option{-gnatwu} (@code{gcc})
+@cindex @option{-gnatwu} (@command{gcc})
This switch activates warnings to be generated for entities that
are declared but not referenced, and for units that are @code{with}'ed
and not
@@ -4854,19 +4853,19 @@ a warning is also generated, noting that the
@code{with} can be moved to the body. The default is that
such warnings are not generated.
This switch also activates warnings on unreferenced formals
-(it is includes the effect of @option{-gnatwf}).
+(it includes the effect of @option{-gnatwf}).
This warning can also be turned on using @option{-gnatwa}.
@item -gnatwU
@emph{Suppress warnings on unused entities.}
-@cindex @option{-gnatwU} (@code{gcc})
+@cindex @option{-gnatwU} (@command{gcc})
This switch suppresses warnings for unused entities and packages.
It also turns off warnings on unreferenced formals (and thus includes
the effect of @option{-gnatwF}).
@item -gnatwv
@emph{Activate warnings on unassigned variables.}
-@cindex @option{-gnatwv} (@code{gcc})
+@cindex @option{-gnatwv} (@command{gcc})
@cindex Unassigned variable warnings
This switch activates warnings for access to variables which
may not be properly initialized. The default is that
@@ -4874,13 +4873,13 @@ such warnings are generated.
@item -gnatwV
@emph{Suppress warnings on unassigned variables.}
-@cindex @option{-gnatwV} (@code{gcc})
+@cindex @option{-gnatwV} (@command{gcc})
This switch suppresses warnings for access to variables which
may not be properly initialized.
@item -gnatwx
@emph{Activate warnings on Export/Import pragmas.}
-@cindex @option{-gnatwx} (@code{gcc})
+@cindex @option{-gnatwx} (@command{gcc})
@cindex Export/Import pragma warnings
This switch activates warnings on Export/Import pragmas when
the compiler detects a possible conflict between the Ada and
@@ -4892,7 +4891,7 @@ generated.
@item -gnatwX
@emph{Suppress warnings on Export/Import pragmas.}
-@cindex @option{-gnatwX} (@code{gcc})
+@cindex @option{-gnatwX} (@command{gcc})
This switch suppresses warnings on Export/Import pragmas.
The sense of this is that you are telling the compiler that
you know what you are doing in writing the pragma, and it
@@ -4900,7 +4899,7 @@ should not complain at you.
@item -gnatwz
@emph{Activate warnings on unchecked conversions.}
-@cindex @option{-gnatwz} (@code{gcc})
+@cindex @option{-gnatwz} (@command{gcc})
@cindex Unchecked_Conversion warnings
This switch activates warnings for unchecked conversions
where the types are known at compile time to have different
@@ -4909,7 +4908,7 @@ is that such warnings are generated.
@item -gnatwZ
@emph{Suppress warnings on unchecked conversions.}
-@cindex @option{-gnatwZ} (@code{gcc})
+@cindex @option{-gnatwZ} (@command{gcc})
This switch suppresses warnings for unchecked conversions
where the types are known at compile time to have different
sizes.
@@ -4974,7 +4973,7 @@ When no switch @option{^-gnatw^/WARNINGS^} is used, this is equivalent to:
@table @option
@item -gnata
-@cindex @option{-gnata} (@code{gcc})
+@cindex @option{-gnata} (@command{gcc})
@findex Assert
@findex Debug
@cindex Assertions
@@ -5066,7 +5065,7 @@ to the default checks described above.
@c !sort!
@item -gnatVa
@emph{All validity checks.}
-@cindex @option{-gnatVa} (@code{gcc})
+@cindex @option{-gnatVa} (@command{gcc})
All validity checks are turned on.
@ifclear vms
That is, @option{-gnatVa} is
@@ -5075,13 +5074,13 @@ equivalent to @option{gnatVcdfimorst}.
@item -gnatVc
@emph{Validity checks for copies.}
-@cindex @option{-gnatVc} (@code{gcc})
+@cindex @option{-gnatVc} (@command{gcc})
The right hand side of assignments, and the initializing values of
object declarations are validity checked.
@item -gnatVd
@emph{Default (RM) validity checks.}
-@cindex @option{-gnatVd} (@code{gcc})
+@cindex @option{-gnatVd} (@command{gcc})
Some validity checks are done by default following normal Ada semantics
(RM 13.9.1 (9-11)).
A check is done in case statements that the expression is within the range
@@ -5098,7 +5097,7 @@ overwriting may occur.
@item -gnatVf
@emph{Validity checks for floating-point values.}
-@cindex @option{-gnatVf} (@code{gcc})
+@cindex @option{-gnatVf} (@command{gcc})
In the absence of this switch, validity checking occurs only for discrete
values. If @option{-gnatVf} is specified, then validity checking also applies
for floating-point values, and NaN's and infinities are considered invalid,
@@ -5113,13 +5112,13 @@ options. For example,
@item -gnatVi
@emph{Validity checks for @code{in} mode parameters}
-@cindex @option{-gnatVi} (@code{gcc})
+@cindex @option{-gnatVi} (@command{gcc})
Arguments for parameters of mode @code{in} are validity checked in function
and procedure calls at the point of call.
@item -gnatVm
@emph{Validity checks for @code{in out} mode parameters.}
-@cindex @option{-gnatVm} (@code{gcc})
+@cindex @option{-gnatVm} (@command{gcc})
Arguments for parameters of mode @code{in out} are validity checked in
procedure calls at the point of call. The @code{'m'} here stands for
modify, since this concerns parameters that can be modified by the call.
@@ -5130,7 +5129,7 @@ will be subject to validity checking.
@item -gnatVn
@emph{No validity checks.}
-@cindex @option{-gnatVn} (@code{gcc})
+@cindex @option{-gnatVn} (@command{gcc})
This switch turns off all validity checking, including the default checking
for case statements and left hand side subscripts. Note that the use of
the switch @option{-gnatp} suppresses all run-time checks, including
@@ -5139,7 +5138,7 @@ is used, it cancels any other @option{-gnatV} previously issued.
@item -gnatVo
@emph{Validity checks for operator and attribute operands.}
-@cindex @option{-gnatVo} (@code{gcc})
+@cindex @option{-gnatVo} (@command{gcc})
Arguments for predefined operators and attributes are validity checked.
This includes all operators in package @code{Standard},
the shift operators defined as intrinsic in package @code{Interfaces}
@@ -5148,7 +5147,7 @@ on individual component values for composite comparisons.
@item -gnatVp
@emph{Validity checks for parameters.}
-@cindex @option{-gnatVp} (@code{gcc})
+@cindex @option{-gnatVp} (@command{gcc})
This controls the treatment of parameters within a subprogram (as opposed
to @option{-gnatVi} and @option{-gnatVm} which control validity testing
of parameters on a call. If either of these call options is used, then
@@ -5160,20 +5159,20 @@ will be checked (or rechecked) within the subprogram.
@item -gnatVr
@emph{Validity checks for function returns.}
-@cindex @option{-gnatVr} (@code{gcc})
+@cindex @option{-gnatVr} (@command{gcc})
The expression in @code{return} statements in functions is validity
checked.
@item -gnatVs
@emph{Validity checks for subscripts.}
-@cindex @option{-gnatVs} (@code{gcc})
+@cindex @option{-gnatVs} (@command{gcc})
All subscripts expressions are checked for validity, whether they appear
on the right side or left side (in default mode only left side subscripts
are validity checked).
@item -gnatVt
@emph{Validity checks for tests.}
-@cindex @option{-gnatVt} (@code{gcc})
+@cindex @option{-gnatVt} (@command{gcc})
Expressions used as conditions in @code{if}, @code{while} or @code{exit}
statements are checked, as well as guard expressions in entry calls.
@@ -5231,7 +5230,7 @@ temporary disabling of validity checks.
@noindent
The @option{-gnaty^x^(option,option,...)^} switch
-@cindex @option{-gnaty} (@code{gcc})
+@cindex @option{-gnaty} (@command{gcc})
causes the compiler to
enforce specified style rules. A limited set of style rules has been used
in writing the GNAT sources themselves. This switch allows user programs
@@ -5316,7 +5315,7 @@ permitted. This allows the construction of box comments where lines of minus
signs are used to form the top and bottom of the box.
@item
-If a comment starts and ends with ``@code{--}'' is permitted as long as at
+A comment that starts and ends with ``@code{--}'' is permitted as long as at
least one blank follows the initial ``@code{--}''. Together with the preceding
rule, this allows the construction of box comments, as shown in the following
example:
@@ -5337,7 +5336,7 @@ optional labels on @code{end} statements ending subprograms and on
@item ^f^VTABS^
@emph{No form feeds or vertical tabs.}
If the ^letter f^word VTABS^ appears in the string after @option{-gnaty} then
-neither form feeds nor vertical tab characters are not permitted
+neither form feeds nor vertical tab characters are permitted
in the source text.
@item ^h^HTABS^
@@ -5611,12 +5610,12 @@ checking against constraints, but not arithmetic overflow checking for
integer operations (including division by zero) or checks for access
before elaboration on subprogram calls. All other run-time checks, as
required by the Ada 95 Reference Manual, are generated by default.
-The following @code{gcc} switches refine this default behavior:
+The following @command{gcc} switches refine this default behavior:
@table @option
@c !sort!
@item -gnatp
-@cindex @option{-gnatp} (@code{gcc})
+@cindex @option{-gnatp} (@command{gcc})
@cindex Suppressing checks
@cindex Checks, suppressing
@findex Suppress
@@ -5628,7 +5627,7 @@ of the code at the expense of safety in the presence of invalid data or
program bugs.
@item -gnato
-@cindex @option{-gnato} (@code{gcc})
+@cindex @option{-gnato} (@command{gcc})
@cindex Overflow checks
@cindex Check, overflow
Enables overflow checking for integer operations.
@@ -5708,11 +5707,11 @@ not performed in default mode. This means that out of the box, with the
default settings, GNAT does not do all the checks expected from the
language description in the Ada Reference Manual. If you want all constraint
checks to be performed, as described in this Manual, then you must
-explicitly use the -gnato switch either on the @code{gnatmake} or
-@code{gcc} command.
+explicitly use the -gnato switch either on the @command{gnatmake} or
+@command{gcc} command.
@item -gnatE
-@cindex @option{-gnatE} (@code{gcc})
+@cindex @option{-gnatE} (@command{gcc})
@cindex Elaboration checks
@cindex Check, elaboration
Enables dynamic checks for access-before-elaboration
@@ -5734,7 +5733,7 @@ the program source.
@cindex -fstack-check
@noindent
-For most operating systems, @code{gcc} does not perform stack overflow
+For most operating systems, @command{gcc} does not perform stack overflow
checking by default. This means that if the main environment task or
some other task exceeds the available stack space, then unpredictable
behavior will occur.
@@ -5785,10 +5784,10 @@ is an operating systems issue, and must be addressed with the
appropriate operating systems commands.
@node Using gcc for Syntax Checking
-@subsection Using @code{gcc} for Syntax Checking
+@subsection Using @command{gcc} for Syntax Checking
@table @option
@item -gnats
-@cindex @option{-gnats} (@code{gcc})
+@cindex @option{-gnats} (@command{gcc})
@ifclear vms
@noindent
@@ -5840,10 +5839,10 @@ together. This is primarily used by the @code{gnatchop} utility
@end table
@node Using gcc for Semantic Checking
-@subsection Using @code{gcc} for Semantic Checking
+@subsection Using @command{gcc} for Semantic Checking
@table @option
@item -gnatc
-@cindex @option{-gnatc} (@code{gcc})
+@cindex @option{-gnatc} (@command{gcc})
@ifclear vms
@noindent
@@ -5886,7 +5885,7 @@ and specifications where a separate body is present).
@table @option
@cindex Ada 83 compatibility
@item -gnat83
-@cindex @option{-gnat83} (@code{gcc})
+@cindex @option{-gnat83} (@command{gcc})
@cindex ACVC, Ada 83 tests
@noindent
@@ -5919,7 +5918,7 @@ For further information, please refer to @ref{Compatibility and Porting Guide}.
@subsection Character Set Control
@table @option
@item ^-gnati^/IDENTIFIER_CHARACTER_SET=^@var{c}
-@cindex @option{^-gnati^/IDENTIFIER_CHARACTER_SET^} (@code{gcc})
+@cindex @option{^-gnati^/IDENTIFIER_CHARACTER_SET^} (@command{gcc})
@noindent
Normally GNAT recognizes the Latin-1 character set in source program
@@ -5968,7 +5967,7 @@ allowed in identifiers
implementation of these character sets.
@item ^-gnatW^/WIDE_CHARACTER_ENCODING=^@var{e}
-@cindex @option{^-gnatW^/WIDE_CHARACTER_ENCODING^} (@code{gcc})
+@cindex @option{^-gnatW^/WIDE_CHARACTER_ENCODING^} (@command{gcc})
Specify the method of encoding for wide characters.
@var{e} is one of the following:
@@ -5993,7 +5992,7 @@ UTF-8 encoding (brackets encoding also recognized)
Brackets encoding only (default value)
@end table
For full details on the these encoding
-methods see @xref{Wide Character Encodings}.
+methods see @ref{Wide Character Encodings}.
Note that brackets coding is always accepted, even if one of the other
options is specified, so for example @option{-gnatW8} specifies that both
brackets and @code{UTF-8} encodings will be recognized. The units that are
@@ -6017,7 +6016,7 @@ parameter.
@table @option
@item ^-gnatk^/FILE_NAME_MAX_LENGTH=^@var{n}
-@cindex @option{-gnatk} (@code{gcc})
+@cindex @option{-gnatk} (@command{gcc})
Activates file name ``krunching''. @var{n}, a decimal integer in the range
1-999, indicates the maximum allowable length of a file name (not
including the @file{.ads} or @file{.adb} extension). The default is not
@@ -6032,7 +6031,7 @@ For the source file naming rules, @xref{File Naming Rules}.
@table @option
@c !sort!
@item -gnatn
-@cindex @option{-gnatn} (@code{gcc})
+@cindex @option{-gnatn} (@command{gcc})
@ifclear vms
The @code{n} here is intended to suggest the first syllable of the
word ``inline''.
@@ -6050,10 +6049,10 @@ If you specify this switch the compiler will access these bodies,
creating an extra source dependency for the resulting object file, and
where possible, the call will be inlined.
For further details on when inlining is possible
-see @xref{Inlining of Subprograms}.
+see @ref{Inlining of Subprograms}.
@item -gnatN
-@cindex @option{-gnatN} (@code{gcc})
+@cindex @option{-gnatN} (@command{gcc})
The front end inlining activated by this switch is generally more extensive,
and quite often more effective than the standard @option{-gnatn} inlining mode.
It will also generate additional dependencies.
@@ -6067,7 +6066,7 @@ to specify both options.
@table @option
@item -gnatt
-@cindex @option{-gnatt} (@code{gcc})
+@cindex @option{-gnatt} (@command{gcc})
@cindex Writing internal trees
@cindex Internal trees, writing to file
Causes GNAT to write the internal tree for a unit to a file (with the
@@ -6078,19 +6077,19 @@ these tools do the necessary compilations automatically, so you should
not have to specify this switch in normal operation.
@item -gnatu
-@cindex @option{-gnatu} (@code{gcc})
+@cindex @option{-gnatu} (@command{gcc})
Print a list of units required by this compilation on @file{stdout}.
The listing includes all units on which the unit being compiled depends
either directly or indirectly.
@ifclear vms
@item -pass-exit-codes
-@cindex @option{-pass-exit-codes} (@code{gcc})
-If this switch is not used, the exit code returned by @code{gcc} when
+@cindex @option{-pass-exit-codes} (@command{gcc})
+If this switch is not used, the exit code returned by @command{gcc} when
compiling multiple files indicates whether all source files have
been successfully used to generate object files or not.
-When @option{-pass-exit-codes} is used, @code{gcc} exits with an extended
+When @option{-pass-exit-codes} is used, @command{gcc} exits with an extended
exit status and allows an integrated development environment to better
react to a compilation failure. Those exit status are:
@@ -6115,7 +6114,7 @@ An object file has been generated for every source file.
@cindex Debugging options
@ifclear vms
@item -gnatd@var{x}
-@cindex @option{-gnatd} (@code{gcc})
+@cindex @option{-gnatd} (@command{gcc})
Activate internal debugging switches. @var{x} is a letter or digit, or
string of letters or digits, which specifies the type of debugging
outputs desired. Normally these are used only for internal development
@@ -6125,7 +6124,7 @@ file @file{debug.adb}.
@end ifclear
@item -gnatG
-@cindex @option{-gnatG} (@code{gcc})
+@cindex @option{-gnatG} (@command{gcc})
This switch causes the compiler to generate auxiliary output containing
a pseudo-source listing of the generated expanded code. Like most Ada
compilers, GNAT works by first transforming the high level Ada code into
@@ -6209,7 +6208,7 @@ evaluation of the expression 1.0/27.0).
@end table
@item -gnatD
-@cindex @option{-gnatD} (@code{gcc})
+@cindex @option{-gnatD} (@command{gcc})
When used in conjunction with @option{-gnatG}, this switch causes
the expanded source, as described above for
@option{-gnatG} to be written to files with names
@@ -6217,7 +6216,7 @@ the expanded source, as described above for
instead of to the standard ooutput file. For
example, if the source file name is @file{hello.adb}, then a file
@file{^hello.adb.dg^HELLO.ADB_DG^} will be written. The debugging
-information generated by the @code{gcc} @option{^-g^/DEBUG^} switch
+information generated by the @command{gcc} @option{^-g^/DEBUG^} switch
will refer to the generated @file{^xxx.dg^XXX_DG^} file. This allows
you to do source level debugging using the generated code which is
sometimes useful for complex code, for example to find out exactly
@@ -6233,7 +6232,7 @@ In other words @option{-gnatD} is equivalent to @option{-gnatDG}).
@ifclear vms
@item -gnatR[0|1|2|3[s]]
-@cindex @option{-gnatR} (@code{gcc})
+@cindex @option{-gnatR} (@command{gcc})
This switch controls output from the compiler of a listing showing
representation information for declared types and objects. For
@option{-gnatR0}, no information is output (equivalent to omitting
@@ -6252,7 +6251,7 @@ file is the name of the corresponding source file.
@end ifclear
@ifset vms
@item /REPRESENTATION_INFO
-@cindex @option{/REPRESENTATION_INFO} (@code{gcc})
+@cindex @option{/REPRESENTATION_INFO} (@command{gcc})
This qualifier controls output from the compiler of a listing showing
representation information for declared types and objects. For
@option{/REPRESENTATION_INFO=NONE}, no information is output
@@ -6275,7 +6274,7 @@ file is the name of the corresponding source file.
@end ifset
@item -gnatS
-@cindex @option{-gnatS} (@code{gcc})
+@cindex @option{-gnatS} (@command{gcc})
The use of the switch @option{-gnatS} for an
Ada compilation will cause the compiler to output a
representation of package Standard in a form very
@@ -6288,7 +6287,7 @@ determine the characteristics of target dependent
types in package Standard.
@item -gnatx
-@cindex @option{-gnatx} (@code{gcc})
+@cindex @option{-gnatx} (@command{gcc})
Normally the compiler generates full cross-referencing information in
the @file{ALI} file. This information is used by a number of tools,
including @code{gnatfind} and @code{gnatxref}. The @option{-gnatx} switch
@@ -6316,7 +6315,11 @@ raised, the tables are used to control a back trace of the
subprogram invocation stack to locate the required exception
handler. This method has considerably poorer performance for
the propagation of exceptions, but there is no overhead for
-exception handlers if no exception is raised.
+exception handlers if no exception is raised. Note that in this
+mode and in the context of mixed Ada and C/C++ programming,
+to propagate an exception through a C/C++ code, the C/C++ code
+must be compiled with the @option{-funwind-tables} GCC's
+option.
The following switches can be used to control which of the
two exception handling methods is used.
@@ -6325,7 +6328,7 @@ two exception handling methods is used.
@c !sort!
@item -gnatL
-@cindex @option{-gnatL} (@code{gcc})
+@cindex @option{-gnatL} (@command{gcc})
This switch causes the longjmp/setjmp approach to be used
for exception handling. If this is the default mechanism for the
target (see below), then this has no effect. If the default
@@ -6333,14 +6336,14 @@ mechanism for the target is zero cost exceptions, then
this switch can be used to modify this default, but it must be
used for all units in the partition, including all run-time
library units. One way to achieve this is to use the
-@option{-a} and @option{-f} switches for @code{gnatmake}.
+@option{-a} and @option{-f} switches for @command{gnatmake}.
This option is rarely used. One case in which it may be
advantageous is if you have an application where exception
raising is common and the overall performance of the
application is improved by favoring exception propagation.
@item -gnatZ
-@cindex @option{-gnatZ} (@code{gcc})
+@cindex @option{-gnatZ} (@command{gcc})
@cindex Zero Cost Exceptions
This switch causes the zero cost approach to be sed
for exception handling. If this is the default mechanism for the
@@ -6349,7 +6352,7 @@ mechanism for the target is longjmp/setjmp exceptions, then
this switch can be used to modify this default, but it must be
used for all units in the partition, including all run-time
library units. One way to achieve this is to use the
-@option{-a} and @option{-f} switches for @code{gnatmake}.
+@option{-a} and @option{-f} switches for @command{gnatmake}.
This option can only be used if the zero cost approach
is available for the target in use (see below).
@end table
@@ -6373,7 +6376,7 @@ used by default.
@table @option
@item -gnatem^^=^@var{path}
-@cindex @option{-gnatem} (@code{gcc})
+@cindex @option{-gnatem} (@command{gcc})
A mapping file is a way to communicate to the compiler two mappings:
from unit names to file names (without any directory information) and from
file names to path names (with full directory information). These mappings
@@ -6385,7 +6388,7 @@ sources are read over a slow network connection. In normal operation,
you need not be concerned with the format or use of mapping files,
and the @option{-gnatem} switch is not a switch that you would use
explicitly. it is intended only for use by automatic tools such as
-@code{gnatmake} running under the project file facility. The
+@command{gnatmake} running under the project file facility. The
description here of the format of mapping files is provided
for completeness and for possible use by other tools.
@@ -6410,7 +6413,7 @@ will be created.
Several @option{-gnatem} switches may be specified; however, only the last
one on the command line will be taken into account.
-When using a project file, @code{gnatmake} create a temporary mapping file
+When using a project file, @command{gnatmake} create a temporary mapping file
and communicates it to the compiler using this switch.
@end table
@@ -6427,15 +6430,15 @@ indicates, through a text file, the preprocessing data to be used.
@option{-gnateD} specifies or modifies the values of preprocessing symbol.
@noindent
-It is recommended that @code{gnatmake} switch ^-s^/SWITCH_CHECK^ should be
+It is recommended that @command{gnatmake} switch ^-s^/SWITCH_CHECK^ should be
used when Integrated Preprocessing is used. The reason is that preprocessing
with another Preprocessing Data file without changing the sources will
not trigger recompilation without this switch.
@noindent
-Note that @code{gnatmake} switch ^-m^/MINIMAL_RECOMPILATION^ will almost
+Note that @command{gnatmake} switch ^-m^/MINIMAL_RECOMPILATION^ will almost
always trigger recompilation for sources that are preprocessed,
-because @code{gnatmake} cannot compute the checksum of the source after
+because @command{gnatmake} cannot compute the checksum of the source after
preprocessing.
@noindent
@@ -6446,7 +6449,7 @@ preprocessing is triggered and parameterized.
@table @code
@item -gnatep=@var{file}
-@cindex @option{-gnatep} (@code{gcc})
+@cindex @option{-gnatep} (@command{gcc})
This switch indicates to the compiler the file name (without directory
information) of the preprocessor data file to use. The preprocessor data file
should be found in the source directories.
@@ -6467,8 +6470,8 @@ lines starting with the character '*'.
@noindent
After the file name or the character '*', another optional literal string
-indicating the file name of the definition file to be used for preprocessing.
-(see @ref{Form of Definitions File}. The definition files are found by the
+indicating the file name of the definition file to be used for preprocessing
+(@pxref{Form of Definitions File}). The definition files are found by the
compiler in one of the source directories. In some cases, when compiling
a source in a directory other than the current directory, if the definition
file is in the current directory, it may be necessary to add the current
@@ -6530,7 +6533,7 @@ Examples of valid lines in a preprocessor data file:
@end smallexample
@item ^-gnateD^/DATA_PREPROCESSING=^symbol[=value]
-@cindex @option{-gnateD} (@code{gcc})
+@cindex @option{-gnateD} (@command{gcc})
Define or redefine a preprocessing symbol, associated with value. If no value
is given on the command line, then the value of the symbol is @code{True}.
A symbol is an identifier, following normal Ada (case-insensitive)
@@ -6588,10 +6591,11 @@ unless you actually see a performance improvement.
On VMS, GNAT compiled programs return POSIX-style codes by default,
e.g. @option{/RETURN_CODES=POSIX}.
-To enable VMS style return codes, GNAT LINK with the option
+To enable VMS style return codes, use GNAT BIND and LINK with the option
@option{/RETURN_CODES=VMS}. For example:
@smallexample
+GNAT BIND MYMAIN.ALI /RETURN_CODES=VMS
GNAT LINK MYMAIN.ALI /RETURN_CODES=VMS
@end smallexample
@@ -6623,7 +6627,7 @@ The directory containing the source file of the main unit being compiled
@item
Each directory named by an @option{^-I^/SOURCE_SEARCH^} switch given on the
-@code{gcc} command line, in the order given.
+@command{gcc} command line, in the order given.
@item
@findex ADA_INCLUDE_PATH
@@ -6690,7 +6694,7 @@ The compiler outputs its object files and ALI files in the current
working directory.
@ifclear vms
Caution: The object file can be redirected with the @option{-o} switch;
-however, @code{gcc} and @code{gnat1} have not been coordinated on this
+however, @command{gcc} and @code{gnat1} have not been coordinated on this
so the @file{ALI} file will not go to the right place. Therefore, you should
avoid using the @option{-o} switch.
@end ifclear
@@ -6813,7 +6817,7 @@ Generates a main program incorporating the given elaboration order.
This program is a small Ada package (body and spec) that
must be subsequently compiled
using the GNAT compiler. The necessary compilation step is usually
-performed automatically by @code{gnatlink}. The two most important
+performed automatically by @command{gnatlink}. The two most important
functions of this program
are to call the elaboration routines of units in an appropriate order
and to call the main program.
@@ -6821,7 +6825,7 @@ and to call the main program.
@item
Determines the set of object files required by the given main program.
This information is output in the forms of comments in the generated program,
-to be read by the @code{gnatlink} utility used to link the Ada application.
+to be read by the @command{gnatlink} utility used to link the Ada application.
@end enumerate
@node Running gnatbind
@@ -6851,7 +6855,7 @@ that the given main program requires the package @code{Pack}, whose
file is @file{pack.ali} and whose corresponding source spec file is
@file{pack.ads}, it attempts to locate the source file @file{pack.ads}
(using the same search path conventions as previously described for the
-@code{gcc} command). If it can locate this source file, it checks that
+@command{gcc} command). If it can locate this source file, it checks that
the time stamps
or source checksums of the source and its references to in @file{ALI} files
match. In other words, any @file{ALI} files that mentions this spec must have
@@ -6912,7 +6916,7 @@ program in C rather than Ada. This may for example be helpful when you
are generating a mixed language program with the main program in C. The
GNAT compiler itself is an example.
The use of the @option{^-C^/BIND_FILE=C^} switch
-for both @code{gnatbind} and @code{gnatlink} will cause the program to
+for both @code{gnatbind} and @command{gnatlink} will cause the program to
be generated in C (and compiled using the gnu C compiler).
@node Switches for gnatbind
@@ -6974,7 +6978,7 @@ See also the packages @code{GNAT.Traceback} and
@code{GNAT.Traceback.Symbolic} for more information.
@ifclear vms
Note that on x86 ports, you must not use @option{-fomit-frame-pointer}
-@code{gcc} option.
+@command{gcc} option.
@end ifclear
@item ^-F^/FORCE_ELABS_FLAGS^
@@ -7007,13 +7011,13 @@ Output chosen elaboration order.
@item ^-Lxxx^/BUILD_LIBRARY=xxx^
@cindex @option{^-L^/BUILD_LIBRARY^} (@command{gnatbind})
-Binds the units for library building. In this case the adainit and
-adafinal procedures (See @pxref{Binding with Non-Ada Main Programs})
+Bind the units for library building. In this case the adainit and
+adafinal procedures (@pxref{Binding with Non-Ada Main Programs})
are renamed to ^xxxinit^XXXINIT^ and
^xxxfinal^XXXFINAL^.
Implies ^-n^/NOCOMPILE^.
@ifclear vms
-(@pxref{GNAT and Libraries}, for more details.)
+(@xref{GNAT and Libraries}, for more details.)
@end ifclear
@ifset vms
On OpenVMS, these init and final procedures are exported in uppercase
@@ -7051,7 +7055,7 @@ Do not look for library files in the system default directory.
@item --RTS=@var{rts-path}
@cindex @option{--RTS} (@code{gnatbind})
Specifies the default location of the runtime library. Same meaning as the
-equivalent @code{gnatmake} flag (see @ref{Switches for gnatmake}).
+equivalent @command{gnatmake} flag (@pxref{Switches for gnatmake}).
@item ^-o ^/OUTPUT=^@var{file}
@cindex @option{^-o ^/OUTPUT^} (@command{gnatbind})
@@ -7196,9 +7200,9 @@ the resulting program is self-consistent.
If a source file has been edited since it was last compiled, and you
specify this switch, the binder will not detect that the object
file is out of date with respect to the source file. Note that this is the
-mode that is automatically used by @code{gnatmake} because in this
+mode that is automatically used by @command{gnatmake} because in this
case the checking against sources has already been performed by
-@code{gnatmake} in the course of compilation (i.e. before binding).
+@command{gnatmake} in the course of compilation (i.e. before binding).
@ifset vms
@item /READ_SOURCES=AVAILABLE
@@ -7298,7 +7302,7 @@ with extreme care.}
@noindent
The following switches provide additional control over the elaboration
-order. For full details see @xref{Elaboration Order Handling in GNAT}.
+order. For full details see @ref{Elaboration Order Handling in GNAT}.
@table @option
@item ^-p^/PESSIMISTIC_ELABORATION^
@@ -7461,7 +7465,7 @@ file, unless overridden by the use of the @option{^-o file^/OUTPUT=file^}.
The output is an Ada unit in source form that can
be compiled with GNAT unless the -C switch is used in which case the
output is a C source file, which must be compiled using the C compiler.
-This compilation occurs automatically as part of the @code{gnatlink}
+This compilation occurs automatically as part of the @command{gnatlink}
processing.
Currently the GNAT run time requires a FPU using 80 bits mode
@@ -7527,7 +7531,7 @@ it.
The binder takes the name of an ALI file as its argument and needs to
locate source files as well as other ALI files to verify object consistency.
-For source files, it follows exactly the same search rules as @code{gcc}
+For source files, it follows exactly the same search rules as @command{gcc}
(@pxref{Search Paths and the Run-Time Library (RTL)}). For ALI files the
directories searched are:
@@ -7690,16 +7694,16 @@ after accessing the Ada units.
@c ------------------------------------
@node Linking Using gnatlink
-@chapter Linking Using @code{gnatlink}
+@chapter Linking Using @command{gnatlink}
@c ------------------------------------
@findex gnatlink
@noindent
-This chapter discusses @code{gnatlink}, a tool that links
+This chapter discusses @command{gnatlink}, a tool that links
an Ada program and builds an executable file. This utility
-invokes the system linker ^(via the @code{gcc} command)^^
+invokes the system linker ^(via the @command{gcc} command)^^
with a correct list of object files and library references.
-@code{gnatlink} automatically determines the list of files and
+@command{gnatlink} automatically determines the list of files and
references for the Ada part of a program. It uses the binder file
generated by the @command{gnatbind} to determine this list.
@@ -7711,10 +7715,10 @@ generated by the @command{gnatbind} to determine this list.
@end menu
@node Running gnatlink
-@section Running @code{gnatlink}
+@section Running @command{gnatlink}
@noindent
-The form of the @code{gnatlink} command is
+The form of the @command{gnatlink} command is
@smallexample
$ gnatlink [@var{switches}] @var{mainprog}[.ali]
@@ -7722,7 +7726,7 @@ $ gnatlink [@var{switches}] @var{mainprog}[.ali]
@end smallexample
@noindent
-The arguments of @code{gnatlink} (switches, main @file{ALI} file,
+The arguments of @command{gnatlink} (switches, main @file{ALI} file,
non-Ada objects
or linker options) may be in any order, provided that no non-Ada object may
be mistaken for a main @file{ALI} file.
@@ -7733,13 +7737,13 @@ whose name is the concatenation of @file{F} and @file{.ali}.
@noindent
@file{@var{mainprog}.ali} references the ALI file of the main program.
The @file{.ali} extension of this file can be omitted. From this
-reference, @code{gnatlink} locates the corresponding binder file
+reference, @command{gnatlink} locates the corresponding binder file
@file{b~@var{mainprog}.adb} and, using the information in this file along
with the list of non-Ada objects and linker options, constructs a
linker command file to create the executable.
-The arguments other than the @code{gnatlink} switches and the main @file{ALI}
-file are passed to the linker uninterpreted.
+The arguments other than the @command{gnatlink} switches and the main
+@file{ALI} file are passed to the linker uninterpreted.
They typically include the names of
object files for units written in other languages than Ada and any library
references required to resolve references in any of these foreign language
@@ -7768,46 +7772,46 @@ $ gnatlink my_prog -Wl,-Map,MAPFILE
@end ifset
Using @var{linker options} it is possible to set the program stack and
-heap size. See @ref{Setting Stack Size from gnatlink}, and
+heap size. See @ref{Setting Stack Size from gnatlink} and
@ref{Setting Heap Size from gnatlink}.
-@code{gnatlink} determines the list of objects required by the Ada
+@command{gnatlink} determines the list of objects required by the Ada
program and prepends them to the list of objects passed to the linker.
-@code{gnatlink} also gathers any arguments set by the use of
+@command{gnatlink} also gathers any arguments set by the use of
@code{pragma Linker_Options} and adds them to the list of arguments
presented to the linker.
@ifset vms
-@code{gnatlink} accepts the following types of extra files on the command
+@command{gnatlink} accepts the following types of extra files on the command
line: objects (.OBJ), libraries (.OLB), sharable images (.EXE), and
options files (.OPT). These are recognized and handled according to their
extension.
@end ifset
@node Switches for gnatlink
-@section Switches for @code{gnatlink}
+@section Switches for @command{gnatlink}
@noindent
-The following switches are available with the @code{gnatlink} utility:
+The following switches are available with the @command{gnatlink} utility:
@table @option
@c !sort!
@item ^-A^/BIND_FILE=ADA^
-@cindex @option{^-A^/BIND_FILE=ADA^} (@code{gnatlink})
+@cindex @option{^-A^/BIND_FILE=ADA^} (@command{gnatlink})
The binder has generated code in Ada. This is the default.
@item ^-C^/BIND_FILE=C^
-@cindex @option{^-C^/BIND_FILE=C^} (@code{gnatlink})
+@cindex @option{^-C^/BIND_FILE=C^} (@command{gnatlink})
If instead of generating a file in Ada, the binder has generated one in
C, then the linker needs to know about it. Use this switch to signal
-to @code{gnatlink} that the binder has generated C code rather than
+to @command{gnatlink} that the binder has generated C code rather than
Ada code.
@item ^-f^/FORCE_OBJECT_FILE_LIST^
@cindex Command line length
-@cindex @option{^-f^/FORCE_OBJECT_FILE_LIST^} (@code{gnatlink})
-On some targets, the command line length is limited, and @code{gnatlink}
+@cindex @option{^-f^/FORCE_OBJECT_FILE_LIST^} (@command{gnatlink})
+On some targets, the command line length is limited, and @command{gnatlink}
will generate a separate file for the linker if the list of object files
is too long.
The @option{^-f^/FORCE_OBJECT_FILE_LIST^} switch forces this file
@@ -7817,7 +7821,7 @@ special situations where the command line length is exceeded.
@item ^-g^/DEBUG^
@cindex Debugging information, including
-@cindex @option{^-g^/DEBUG^} (@code{gnatlink})
+@cindex @option{^-g^/DEBUG^} (@command{gnatlink})
The option to include debugging information causes the Ada bind file (in
other words, @file{b~@var{mainprog}.adb}) to be compiled with
@option{^-g^/DEBUG^}.
@@ -7829,24 +7833,24 @@ default. The same procedure apply if a C bind file was generated using
are @file{b_@var{mainprog}.c} and @file{b_@var{mainprog}.o}.
@item ^-n^/NOCOMPILE^
-@cindex @option{^-n^/NOCOMPILE^} (@code{gnatlink})
+@cindex @option{^-n^/NOCOMPILE^} (@command{gnatlink})
Do not compile the file generated by the binder. This may be used when
a link is rerun with different options, but there is no need to recompile
the binder file.
@item ^-v^/VERBOSE^
-@cindex @option{^-v^/VERBOSE^} (@code{gnatlink})
+@cindex @option{^-v^/VERBOSE^} (@command{gnatlink})
Causes additional information to be output, including a full list of the
included object files. This switch option is most useful when you want
to see what set of object files are being used in the link step.
@item ^-v -v^/VERBOSE/VERBOSE^
-@cindex @option{^-v -v^/VERBOSE/VERBOSE^} (@code{gnatlink})
+@cindex @option{^-v -v^/VERBOSE/VERBOSE^} (@command{gnatlink})
Very verbose mode. Requests that the compiler operate in verbose mode when
it compiles the binder file, and that the system linker run in verbose mode.
@item ^-o ^/EXECUTABLE=^@var{exec-name}
-@cindex @option{^-o^/EXECUTABLE^} (@code{gnatlink})
+@cindex @option{^-o^/EXECUTABLE^} (@command{gnatlink})
@var{exec-name} specifies an alternate name for the generated
executable program. If this switch is omitted, the executable has the same
name as the main unit. For example, @code{gnatlink try.ali} creates
@@ -7854,28 +7858,28 @@ an executable called @file{^try^TRY.EXE^}.
@ifclear vms
@item -b @var{target}
-@cindex @option{-b} (@code{gnatlink})
+@cindex @option{-b} (@command{gnatlink})
Compile your program to run on @var{target}, which is the name of a
system configuration. You must have a GNAT cross-compiler built if
@var{target} is not the same as your host system.
@item -B@var{dir}
-@cindex @option{-B} (@code{gnatlink})
+@cindex @option{-B} (@command{gnatlink})
Load compiler executables (for example, @code{gnat1}, the Ada compiler)
from @var{dir} instead of the default location. Only use this switch
when multiple versions of the GNAT compiler are available. See the
-@code{gcc} manual page for further details. You would normally use the
+@command{gcc} manual page for further details. You would normally use the
@option{-b} or @option{-V} switch instead.
@item --GCC=@var{compiler_name}
-@cindex @option{--GCC=compiler_name} (@code{gnatlink})
+@cindex @option{--GCC=compiler_name} (@command{gnatlink})
Program used for compiling the binder file. The default is
-`@code{gcc}'. You need to use quotes around @var{compiler_name} if
+@command{gcc}. You need to use quotes around @var{compiler_name} if
@code{compiler_name} contains spaces or other separator characters. As
-an example @option{--GCC="foo -x -y"} will instruct @code{gnatlink} to use
+an example @option{--GCC="foo -x -y"} will instruct @command{gnatlink} to use
@code{foo -x -y} as your compiler. Note that switch @option{-c} is always
inserted after your command name. Thus in the above example the compiler
-command that will be used by @code{gnatlink} will be @code{foo -c -x -y}.
+command that will be used by @command{gnatlink} will be @code{foo -c -x -y}.
If several @option{--GCC=compiler_name} are used, only the last
@var{compiler_name} is taken into account. However, all the additional
switches are also taken into account. Thus,
@@ -7883,13 +7887,13 @@ switches are also taken into account. Thus,
@option{--GCC="bar -x -y -z -t"}.
@item --LINK=@var{name}
-@cindex @option{--LINK=} (@code{gnatlink})
+@cindex @option{--LINK=} (@command{gnatlink})
@var{name} is the name of the linker to be invoked. This is especially
useful in mixed language programs since languages such as C++ require
their own linker to be used. When this switch is omitted, the default
-name for the linker is (@file{gcc}). When this switch is used, the
-specified linker is called instead of (@file{gcc}) with exactly the same
-parameters that would have been passed to (@file{gcc}) so if the desired
+name for the linker is @command{gcc}. When this switch is used, the
+specified linker is called instead of @command{gcc} with exactly the same
+parameters that would have been passed to @command{gcc} so if the desired
linker requires different parameters it is necessary to use a wrapper
script that massages the parameters before invoking the real linker. It
may be useful to control the exact invocation by using the verbose
@@ -7899,7 +7903,7 @@ switch.
@ifset vms
@item /DEBUG=TRACEBACK
-@cindex @code{/DEBUG=TRACEBACK} (@code{gnatlink})
+@cindex @code{/DEBUG=TRACEBACK} (@command{gnatlink})
This qualifier causes sufficient information to be included in the
executable file to allow a traceback, but does not include the full
symbol information needed by the debugger.
@@ -7925,11 +7929,11 @@ Prefer linking with object libraries over sharable images, even without
@end table
@node Setting Stack Size from gnatlink
-@section Setting Stack Size from @code{gnatlink}
+@section Setting Stack Size from @command{gnatlink}
@noindent
Under Windows systems, it is possible to specify the program stack size from
-@code{gnatlink} using either:
+@command{gnatlink} using either:
@itemize @bullet
@@ -7955,11 +7959,11 @@ because the coma is a separator for this option.
@end itemize
@node Setting Heap Size from gnatlink
-@section Setting Heap Size from @code{gnatlink}
+@section Setting Heap Size from @command{gnatlink}
@noindent
Under Windows systems, it is possible to specify the program heap size from
-@code{gnatlink} using either:
+@command{gnatlink} using either:
@itemize @bullet
@@ -7985,7 +7989,7 @@ because the coma is a separator for this option.
@end itemize
@node The GNAT Make Program gnatmake
-@chapter The GNAT Make Program @code{gnatmake}
+@chapter The GNAT Make Program @command{gnatmake}
@findex gnatmake
@menu
@@ -8025,7 +8029,7 @@ recompiled. The dependency rules in Ada can be quite complex, especially
in the presence of overloading, @code{use} clauses, generics and inlined
subprograms.
-@code{gnatmake} automatically takes care of the third and fourth steps
+@command{gnatmake} automatically takes care of the third and fourth steps
of this process. It determines which sources need to be compiled,
compiles them, and binds and links the resulting object files.
@@ -8034,13 +8038,13 @@ accurately recomputed from the new sources. The source based approach of
the GNAT compilation model makes this possible. This means that if
changes to the source program cause corresponding changes in
dependencies, they will always be tracked exactly correctly by
-@code{gnatmake}.
+@command{gnatmake}.
@node Running gnatmake
-@section Running @code{gnatmake}
+@section Running @command{gnatmake}
@noindent
-The usual form of the @code{gnatmake} command is
+The usual form of the @command{gnatmake} command is
@smallexample
$ gnatmake [@var{switches}] @var{file_name}
@@ -8063,34 +8067,34 @@ extension be given. A relative or absolute directory path can be
specified in a @var{file_name}, in which case, the input source file will
be searched for in the specified directory only. Otherwise, the input
source file will first be searched in the directory where
-@code{gnatmake} was invoked and if it is not found, it will be search on
+@command{gnatmake} was invoked and if it is not found, it will be search on
the source path of the compiler as described in
@ref{Search Paths and the Run-Time Library (RTL)}.
-All @code{gnatmake} output (except when you specify
+All @command{gnatmake} output (except when you specify
@option{^-M^/DEPENDENCIES_LIST^}) is to
@file{stderr}. The output produced by the
@option{^-M^/DEPENDENCIES_LIST^} switch is send to
@file{stdout}.
@node Switches for gnatmake
-@section Switches for @code{gnatmake}
+@section Switches for @command{gnatmake}
@noindent
-You may specify any of the following switches to @code{gnatmake}:
+You may specify any of the following switches to @command{gnatmake}:
@table @option
@c !sort!
@ifclear vms
@item --GCC=@var{compiler_name}
-@cindex @option{--GCC=compiler_name} (@code{gnatmake})
-Program used for compiling. The default is `@code{gcc}'. You need to use
+@cindex @option{--GCC=compiler_name} (@command{gnatmake})
+Program used for compiling. The default is `@command{gcc}'. You need to use
quotes around @var{compiler_name} if @code{compiler_name} contains
spaces or other separator characters. As an example @option{--GCC="foo -x
--y"} will instruct @code{gnatmake} to use @code{foo -x -y} as your
+-y"} will instruct @command{gnatmake} to use @code{foo -x -y} as your
compiler. Note that switch @option{-c} is always inserted after your
command name. Thus in the above example the compiler command that will
-be used by @code{gnatmake} will be @code{foo -c -x -y}.
+be used by @command{gnatmake} will be @code{foo -c -x -y}.
If several @option{--GCC=compiler_name} are used, only the last
@var{compiler_name} is taken into account. However, all the additional
switches are also taken into account. Thus,
@@ -8098,32 +8102,32 @@ switches are also taken into account. Thus,
@option{--GCC="bar -x -y -z -t"}.
@item --GNATBIND=@var{binder_name}
-@cindex @option{--GNATBIND=binder_name} (@code{gnatmake})
+@cindex @option{--GNATBIND=binder_name} (@command{gnatmake})
Program used for binding. The default is `@code{gnatbind}'. You need to
use quotes around @var{binder_name} if @var{binder_name} contains spaces
or other separator characters. As an example @option{--GNATBIND="bar -x
--y"} will instruct @code{gnatmake} to use @code{bar -x -y} as your
-binder. Binder switches that are normally appended by @code{gnatmake} to
+-y"} will instruct @command{gnatmake} to use @code{bar -x -y} as your
+binder. Binder switches that are normally appended by @command{gnatmake} to
`@code{gnatbind}' are now appended to the end of @code{bar -x -y}.
@item --GNATLINK=@var{linker_name}
-@cindex @option{--GNATLINK=linker_name} (@code{gnatmake})
-Program used for linking. The default is `@code{gnatlink}'. You need to
+@cindex @option{--GNATLINK=linker_name} (@command{gnatmake})
+Program used for linking. The default is `@command{gnatlink}'. You need to
use quotes around @var{linker_name} if @var{linker_name} contains spaces
or other separator characters. As an example @option{--GNATLINK="lan -x
--y"} will instruct @code{gnatmake} to use @code{lan -x -y} as your
-linker. Linker switches that are normally appended by @code{gnatmake} to
-`@code{gnatlink}' are now appended to the end of @code{lan -x -y}.
+-y"} will instruct @command{gnatmake} to use @code{lan -x -y} as your
+linker. Linker switches that are normally appended by @command{gnatmake} to
+`@command{gnatlink}' are now appended to the end of @code{lan -x -y}.
@end ifclear
@item ^-a^/ALL_FILES^
-@cindex @option{^-a^/ALL_FILES^} (@code{gnatmake})
+@cindex @option{^-a^/ALL_FILES^} (@command{gnatmake})
Consider all files in the make process, even the GNAT internal system
files (for example, the predefined Ada library files), as well as any
locked files. Locked files are files whose ALI file is write-protected.
By default,
-@code{gnatmake} does not check these files,
+@command{gnatmake} does not check these files,
because the assumption is that the GNAT internal files are properly up
to date, and also that any write protected ALI files have been properly
installed. Note that if there is an installation problem, such that one
@@ -8147,7 +8151,7 @@ the @code{/CHECKS=SUPPRESS_ALL /STYLE_CHECKS=GNAT} switch.
@end ifset
@item ^-b^/ACTIONS=BIND^
-@cindex @option{^-b^/ACTIONS=BIND^} (@code{gnatmake})
+@cindex @option{^-b^/ACTIONS=BIND^} (@command{gnatmake})
Bind only. Can be combined with @option{^-c^/ACTIONS=COMPILE^} to do
compilation and binding, but no link.
Can be combined with @option{^-l^/ACTIONS=LINK^}
@@ -8159,23 +8163,23 @@ may be given without extension, with the source extension or, if no GNAT
Project File is specified, with the ALI file extension.
@item ^-c^/ACTIONS=COMPILE^
-@cindex @option{^-c^/ACTIONS=COMPILE^} (@code{gnatmake})
+@cindex @option{^-c^/ACTIONS=COMPILE^} (@command{gnatmake})
Compile only. Do not perform binding, except when @option{^-b^/ACTIONS=BIND^}
is also specified. Do not perform linking, except if both
@option{^-b^/ACTIONS=BIND^} and
@option{^-l^/ACTIONS=LINK^} are also specified.
If the root unit specified by @var{file_name} is not a main unit, this is the
-default. Otherwise @code{gnatmake} will attempt binding and linking
+default. Otherwise @command{gnatmake} will attempt binding and linking
unless all objects are up to date and the executable is more recent than
the objects.
@item ^-C^/MAPPING^
-@cindex @option{^-C^/MAPPING^} (@code{gnatmake})
+@cindex @option{^-C^/MAPPING^} (@command{gnatmake})
Use a temporary mapping file. A mapping file is a way to communicate to the
compiler two mappings: from unit names to file names (without any directory
information) and from file names to path names (with full directory
information). These mappings are used by the compiler to short-circuit the path
-search. When @code{gnatmake} is invoked with this switch, it will create
+search. When @command{gnatmake} is invoked with this switch, it will create
a temporary mapping file, initially populated by the project manager,
if @option{^-P^/PROJECT_FILE^} is used, otherwise initially empty.
Each invocation of the compiler will add the newly accessed sources to the
@@ -8183,7 +8187,7 @@ mapping file. This will improve the source search during the next invocation
of the compiler.
@item ^-C=^/USE_MAPPING_FILE=^@var{file}
-@cindex @option{^-C=^/USE_MAPPING^} (@code{gnatmake})
+@cindex @option{^-C=^/USE_MAPPING^} (@command{gnatmake})
Use a specific mapping file. The file, specified as a path name (absolute or
relative) by this switch, should already exist, otherwise the switch is
ineffective. The specified mapping file will be communicated to the compiler.
@@ -8192,7 +8196,7 @@ This switch is not compatible with a project file
(^-j^/PROCESSES=^nnn, when nnn is greater than 1).
@item ^-D ^/DIRECTORY_OBJECTS=^@var{dir}
-@cindex @option{^-D^/DIRECTORY_OBJECTS^} (@code{gnatmake})
+@cindex @option{^-D^/DIRECTORY_OBJECTS^} (@command{gnatmake})
Put all object files and ALI file in directory @var{dir}.
If the @option{^-D^/DIRECTORY_OBJECTS^} switch is not used, all object files
and ALI files go in the current working directory.
@@ -8201,79 +8205,79 @@ This switch cannot be used when using a project file.
@ifclear vms
@item -eL
-@cindex @option{-eL} (@code{gnatmake})
+@cindex @option{-eL} (@command{gnatmake})
Follow all symbolic links when processing project files.
@end ifclear
@item ^-f^/FORCE_COMPILE^
-@cindex @option{^-f^/FORCE_COMPILE^} (@code{gnatmake})
+@cindex @option{^-f^/FORCE_COMPILE^} (@command{gnatmake})
Force recompilations. Recompile all sources, even though some object
files may be up to date, but don't recompile predefined or GNAT internal
files or locked files (files with a write-protected ALI file),
unless the @option{^-a^/ALL_FILES^} switch is also specified.
@item ^-F^/FULL_PATH_IN_BRIEF_MESSAGES^
-@cindex @option{^-F^/FULL_PATH_IN_BRIEF_MESSAGES^} (@code{gnatmake})
+@cindex @option{^-F^/FULL_PATH_IN_BRIEF_MESSAGES^} (@command{gnatmake})
When using project files, if some errors or warnings are detected during
parsing and verbose mode is not in effect (no use of switch
^-v^/VERBOSE^), then error lines start with the full path name of the project
file, rather than its simple file name.
@item ^-i^/IN_PLACE^
-@cindex @option{^-i^/IN_PLACE^} (@code{gnatmake})
-In normal mode, @code{gnatmake} compiles all object files and ALI files
+@cindex @option{^-i^/IN_PLACE^} (@command{gnatmake})
+In normal mode, @command{gnatmake} compiles all object files and ALI files
into the current directory. If the @option{^-i^/IN_PLACE^} switch is used,
then instead object files and ALI files that already exist are overwritten
in place. This means that once a large project is organized into separate
-directories in the desired manner, then @code{gnatmake} will automatically
+directories in the desired manner, then @command{gnatmake} will automatically
maintain and update this organization. If no ALI files are found on the
Ada object path (@ref{Search Paths and the Run-Time Library (RTL)}),
the new object and ALI files are created in the
directory containing the source being compiled. If another organization
is desired, where objects and sources are kept in different directories,
a useful technique is to create dummy ALI files in the desired directories.
-When detecting such a dummy file, @code{gnatmake} will be forced to recompile
-the corresponding source file, and it will be put the resulting object
-and ALI files in the directory where it found the dummy file.
+When detecting such a dummy file, @command{gnatmake} will be forced to
+recompile the corresponding source file, and it will be put the resulting
+object and ALI files in the directory where it found the dummy file.
@item ^-j^/PROCESSES=^@var{n}
-@cindex @option{^-j^/PROCESSES^} (@code{gnatmake})
+@cindex @option{^-j^/PROCESSES^} (@command{gnatmake})
@cindex Parallel make
Use @var{n} processes to carry out the (re)compilations. On a
multiprocessor machine compilations will occur in parallel. In the
event of compilation errors, messages from various compilations might
-get interspersed (but @code{gnatmake} will give you the full ordered
+get interspersed (but @command{gnatmake} will give you the full ordered
list of failing compiles at the end). If this is problematic, rerun
the make process with n set to 1 to get a clean list of messages.
@item ^-k^/CONTINUE_ON_ERROR^
-@cindex @option{^-k^/CONTINUE_ON_ERROR^} (@code{gnatmake})
+@cindex @option{^-k^/CONTINUE_ON_ERROR^} (@command{gnatmake})
Keep going. Continue as much as possible after a compilation error. To
ease the programmer's task in case of compilation errors, the list of
-sources for which the compile fails is given when @code{gnatmake}
+sources for which the compile fails is given when @command{gnatmake}
terminates.
-If @code{gnatmake} is invoked with several @file{file_names} and with this
+If @command{gnatmake} is invoked with several @file{file_names} and with this
switch, if there are compilation errors when building an executable,
-@code{gnatmake} will not attempt to build the following executables.
+@command{gnatmake} will not attempt to build the following executables.
@item ^-l^/ACTIONS=LINK^
-@cindex @option{^-l^/ACTIONS=LINK^} (@code{gnatmake})
+@cindex @option{^-l^/ACTIONS=LINK^} (@command{gnatmake})
Link only. Can be combined with @option{^-b^/ACTIONS=BIND^} to binding
and linking. Linking will not be performed if combined with
@option{^-c^/ACTIONS=COMPILE^}
but not with @option{^-b^/ACTIONS=BIND^}.
When not combined with @option{^-b^/ACTIONS=BIND^}
all the units in the closure of the main program must have been previously
-compiled and must be up to date, and the main program need to have been bound.
+compiled and must be up to date, and the main program needs to have been bound.
The root unit specified by @var{file_name}
may be given without extension, with the source extension or, if no GNAT
Project File is specified, with the ALI file extension.
@item ^-m^/MINIMAL_RECOMPILATION^
-@cindex @option{^-m^/MINIMAL_RECOMPILATION^} (@code{gnatmake})
-Specifies that the minimum necessary amount of recompilations
-be performed. In this mode @code{gnatmake} ignores time
+@cindex @option{^-m^/MINIMAL_RECOMPILATION^} (@command{gnatmake})
+Specify that the minimum necessary amount of recompilations
+be performed. In this mode @command{gnatmake} ignores time
stamp differences when the only
modifications to a source file consist in adding/removing comments,
empty lines, spaces or tabs. This means that if you have changed the
@@ -8287,7 +8291,7 @@ trade-off between compilation time and accurate debugging information.
@item ^-M^/DEPENDENCIES_LIST^
@cindex Dependencies, producing list
-@cindex @option{^-M^/DEPENDENCIES_LIST^} (@code{gnatmake})
+@cindex @option{^-M^/DEPENDENCIES_LIST^} (@command{gnatmake})
Check if all objects are up to date. If they are, output the object
dependences to @file{stdout} in a form that can be directly exploited in
a @file{Makefile}. By default, each source file is prefixed with its
@@ -8308,7 +8312,7 @@ dependencies of the objects in external Ada libraries (see switch
are never reported.
@item ^-n^/DO_OBJECT_CHECK^
-@cindex @option{^-n^/DO_OBJECT_CHECK^} (@code{gnatmake})
+@cindex @option{^-n^/DO_OBJECT_CHECK^} (@command{gnatmake})
Don't compile, bind, or link. Checks if all objects are up to date.
If they are not, the full name of the first file that needs to be
recompiled is printed.
@@ -8316,27 +8320,27 @@ Repeated use of this option, followed by compiling the indicated source
file, will eventually result in recompiling all required units.
@item ^-o ^/EXECUTABLE=^@var{exec_name}
-@cindex @option{^-o^/EXECUTABLE^} (@code{gnatmake})
+@cindex @option{^-o^/EXECUTABLE^} (@command{gnatmake})
Output executable name. The name of the final executable program will be
@var{exec_name}. If the @option{^-o^/EXECUTABLE^} switch is omitted the default
name for the executable will be the name of the input file in appropriate form
for an executable file on the host system.
-This switch cannot be used when invoking @code{gnatmake} with several
+This switch cannot be used when invoking @command{gnatmake} with several
@file{file_names}.
@item ^-P^/PROJECT_FILE=^@var{project}
-@cindex @option{^-P^/PROJECT_FILE^} (@code{gnatmake})
+@cindex @option{^-P^/PROJECT_FILE^} (@command{gnatmake})
Use project file @var{project}. Only one such switch can be used.
-See @ref{gnatmake and Project Files}.
+@xref{gnatmake and Project Files}.
@item ^-q^/QUIET^
-@cindex @option{^-q^/QUIET^} (@code{gnatmake})
+@cindex @option{^-q^/QUIET^} (@command{gnatmake})
Quiet. When this flag is not set, the commands carried out by
-@code{gnatmake} are displayed.
+@command{gnatmake} are displayed.
@item ^-s^/SWITCH_CHECK/^
-@cindex @option{^-s^/SWITCH_CHECK^} (@code{gnatmake})
+@cindex @option{^-s^/SWITCH_CHECK^} (@command{gnatmake})
Recompile if compiler switches have changed since last compilation.
All compiler switches but -I and -o are taken into account in the
following way:
@@ -8348,31 +8352,31 @@ is equivalent to @option{-O -g}.
This switch is recommended when Integrated Preprocessing is used.
@item ^-u^/UNIQUE^
-@cindex @option{^-u^/UNIQUE^} (@code{gnatmake})
+@cindex @option{^-u^/UNIQUE^} (@command{gnatmake})
Unique. Recompile at most the main files. It implies -c. Combined with
-f, it is equivalent to calling the compiler directly. Note that using
^-u^/UNIQUE^ with a project file and no main has a special meaning
-(see @ref{Project Files and Main Subprograms}).
+(@pxref{Project Files and Main Subprograms}).
@item ^-U^/ALL_PROJECTS^
-@cindex @option{^-U^/ALL_PROJECTS^} (@code{gnatmake})
+@cindex @option{^-U^/ALL_PROJECTS^} (@command{gnatmake})
When used without a project file or with one or several mains on the command
line, is equivalent to ^-u^/UNIQUE^. When used with a project file and no main
on the command line, all sources of all project files are checked and compiled
if not up to date, and libraries are rebuilt, if necessary.
@item ^-v^/REASONS^
-@cindex @option{^-v^/REASONS^} (@code{gnatmake})
-Verbose. Displays the reason for all recompilations @code{gnatmake}
+@cindex @option{^-v^/REASONS^} (@command{gnatmake})
+Verbose. Display the reason for all recompilations @command{gnatmake}
decides are necessary.
@item ^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}
-Indicates the verbosity of the parsing of GNAT project files.
-See @ref{Switches Related to Project Files}.
+Indicate the verbosity of the parsing of GNAT project files.
+@xref{Switches Related to Project Files}.
@item ^-x^/NON_PROJECT_UNIT_COMPILATION^
-@cindex @option{^-x^/NON_PROJECT_UNIT_COMPILATION^} (@code{gnatmake})
-Indicates that sources that are not part of any Project File may be compiled.
+@cindex @option{^-x^/NON_PROJECT_UNIT_COMPILATION^} (@command{gnatmake})
+Indicate that sources that are not part of any Project File may be compiled.
Normally, when using Project Files, only sources that are part of a Project
File may be compile. When this switch is used, a source outside of all Project
Files may be compiled. The ALI file and the object file will be put in the
@@ -8380,30 +8384,30 @@ object directory of the main Project. The compilation switches used will only
be those specified on the command line.
@item ^-X^/EXTERNAL_REFERENCE=^@var{name=value}
-Indicates that external variable @var{name} has the value @var{value}.
+Indicate that external variable @var{name} has the value @var{value}.
The Project Manager will use this value for occurrences of
@code{external(name)} when parsing the project file.
-See @ref{Switches Related to Project Files}.
+@xref{Switches Related to Project Files}.
@item ^-z^/NOMAIN^
-@cindex @option{^-z^/NOMAIN^} (@code{gnatmake})
+@cindex @option{^-z^/NOMAIN^} (@command{gnatmake})
No main subprogram. Bind and link the program even if the unit name
given on the command line is a package name. The resulting executable
will execute the elaboration routines of the package and its closure,
then the finalization routines.
@item ^-g^/DEBUG^
-@cindex @option{^-g^/DEBUG^} (@code{gnatmake})
+@cindex @option{^-g^/DEBUG^} (@command{gnatmake})
Enable debugging. This switch is simply passed to the compiler and to the
linker.
@end table
@table @asis
-@item @code{gcc} @asis{switches}
+@item @command{gcc} @asis{switches}
@ifclear vms
-Any uppercase or multi-character switch that is not a @code{gnatmake} switch
-is passed to @code{gcc} (e.g. @option{-O}, @option{-gnato,} etc.)
+Any uppercase or multi-character switch that is not a @command{gnatmake} switch
+is passed to @command{gcc} (e.g. @option{-O}, @option{-gnato,} etc.)
@end ifclear
@ifset vms
Any qualifier that cannot be recognized as a qualifier for @code{GNAT MAKE}
@@ -8419,15 +8423,15 @@ Source and library search path switches:
@table @option
@c !sort!
@item ^-aI^/SOURCE_SEARCH=^@var{dir}
-@cindex @option{^-aI^/SOURCE_SEARCH^} (@code{gnatmake})
+@cindex @option{^-aI^/SOURCE_SEARCH^} (@command{gnatmake})
When looking for source files also look in directory @var{dir}.
The order in which source files search is undertaken is
described in @ref{Search Paths and the Run-Time Library (RTL)}.
@item ^-aL^/SKIP_MISSING=^@var{dir}
-@cindex @option{^-aL^/SKIP_MISSING^} (@code{gnatmake})
+@cindex @option{^-aL^/SKIP_MISSING^} (@command{gnatmake})
Consider @var{dir} as being an externally provided Ada library.
-Instructs @code{gnatmake} to skip compilation units whose @file{.ALI}
+Instructs @command{gnatmake} to skip compilation units whose @file{.ALI}
files have been located in directory @var{dir}. This allows you to have
missing bodies for the units in @var{dir} and to ignore out of date bodies
for the same units. You still need to specify
@@ -8435,37 +8439,37 @@ the location of the specs for these units by using the switches
@option{^-aI^/SOURCE_SEARCH=^@var{dir}}
or @option{^-I^/SEARCH=^@var{dir}}.
Note: this switch is provided for compatibility with previous versions
-of @code{gnatmake}. The easier method of causing standard libraries
+of @command{gnatmake}. The easier method of causing standard libraries
to be excluded from consideration is to write-protect the corresponding
ALI files.
@item ^-aO^/OBJECT_SEARCH=^@var{dir}
-@cindex @option{^-aO^/OBJECT_SEARCH^} (@code{gnatmake})
+@cindex @option{^-aO^/OBJECT_SEARCH^} (@command{gnatmake})
When searching for library and object files, look in directory
@var{dir}. The order in which library files are searched is described in
@ref{Search Paths for gnatbind}.
@item ^-A^/CONDITIONAL_SOURCE_SEARCH=^@var{dir}
-@cindex Search paths, for @code{gnatmake}
-@cindex @option{^-A^/CONDITIONAL_SOURCE_SEARCH^} (@code{gnatmake})
+@cindex Search paths, for @command{gnatmake}
+@cindex @option{^-A^/CONDITIONAL_SOURCE_SEARCH^} (@command{gnatmake})
Equivalent to @option{^-aL^/SKIP_MISSING=^@var{dir}
^-aI^/SOURCE_SEARCH=^@var{dir}}.
@item ^-I^/SEARCH=^@var{dir}
-@cindex @option{^-I^/SEARCH^} (@code{gnatmake})
+@cindex @option{^-I^/SEARCH^} (@command{gnatmake})
Equivalent to @option{^-aO^/OBJECT_SEARCH=^@var{dir}
^-aI^/SOURCE_SEARCH=^@var{dir}}.
@item ^-I-^/NOCURRENT_DIRECTORY^
-@cindex @option{^-I-^/NOCURRENT_DIRECTORY^} (@code{gnatmake})
+@cindex @option{^-I-^/NOCURRENT_DIRECTORY^} (@command{gnatmake})
@cindex Source files, suppressing search
Do not look for source files in the directory containing the source
file named in the command line.
Do not look for ALI or object files in the directory
-where @code{gnatmake} was invoked.
+where @command{gnatmake} was invoked.
@item ^-L^/LIBRARY_SEARCH=^@var{dir}
-@cindex @option{^-L^/LIBRARY_SEARCH^} (@code{gnatmake})
+@cindex @option{^-L^/LIBRARY_SEARCH^} (@command{gnatmake})
@cindex Linker libraries
Add directory @var{dir} to the list of directories in which the linker
will search for libraries. This is equivalent to
@@ -8476,15 +8480,15 @@ set in the registry are not searched for.
@end ifclear
@item -nostdinc
-@cindex @option{-nostdinc} (@code{gnatmake})
+@cindex @option{-nostdinc} (@command{gnatmake})
Do not look for source files in the system default directory.
@item -nostdlib
-@cindex @option{-nostdlib} (@code{gnatmake})
+@cindex @option{-nostdlib} (@command{gnatmake})
Do not look for library files in the system default directory.
@item --RTS=@var{rts-path}
-@cindex @option{--RTS} (@code{gnatmake})
+@cindex @option{--RTS} (@command{gnatmake})
Specifies the default location of the runtime library. GNAT looks for the
runtime
in the following directories, and stops as soon as a valid runtime is found
@@ -8505,7 +8509,7 @@ The selected path is handled like a normal RTS path.
@end table
@node Mode Switches for gnatmake
-@section Mode Switches for @code{gnatmake}
+@section Mode Switches for @command{gnatmake}
@noindent
The mode switches (referred to as @code{mode_switches}) allow the
@@ -8518,26 +8522,26 @@ designated component of GNAT.
@table @option
@c !sort!
@item -cargs @var{switches}
-@cindex @option{-cargs} (@code{gnatmake})
+@cindex @option{-cargs} (@command{gnatmake})
Compiler switches. Here @var{switches} is a list of switches
-that are valid switches for @code{gcc}. They will be passed on to
-all compile steps performed by @code{gnatmake}.
+that are valid switches for @command{gcc}. They will be passed on to
+all compile steps performed by @command{gnatmake}.
@item -bargs @var{switches}
-@cindex @option{-bargs} (@code{gnatmake})
+@cindex @option{-bargs} (@command{gnatmake})
Binder switches. Here @var{switches} is a list of switches
that are valid switches for @code{gnatbind}. They will be passed on to
-all bind steps performed by @code{gnatmake}.
+all bind steps performed by @command{gnatmake}.
@item -largs @var{switches}
-@cindex @option{-largs} (@code{gnatmake})
+@cindex @option{-largs} (@command{gnatmake})
Linker switches. Here @var{switches} is a list of switches
-that are valid switches for @code{gnatlink}. They will be passed on to
-all link steps performed by @code{gnatmake}.
+that are valid switches for @command{gnatlink}. They will be passed on to
+all link steps performed by @command{gnatmake}.
@item -margs @var{switches}
-@cindex @option{-margs} (@code{gnatmake})
-Make switches. The switches are directly interpreted by @code{gnatmake},
+@cindex @option{-margs} (@command{gnatmake})
+Make switches. The switches are directly interpreted by @command{gnatmake},
regardless of any previous occurrence of @option{-cargs}, @option{-bargs}
or @option{-largs}.
@end table
@@ -8547,25 +8551,25 @@ or @option{-largs}.
@noindent
This section contains some additional useful notes on the operation
-of the @code{gnatmake} command.
+of the @command{gnatmake} command.
@itemize @bullet
@item
-@cindex Recompilation, by @code{gnatmake}
-If @code{gnatmake} finds no ALI files, it recompiles the main program
+@cindex Recompilation, by @command{gnatmake}
+If @command{gnatmake} finds no ALI files, it recompiles the main program
and all other units required by the main program.
-This means that @code{gnatmake}
+This means that @command{gnatmake}
can be used for the initial compile, as well as during subsequent steps of
the development cycle.
@item
If you enter @code{gnatmake @var{file}.adb}, where @file{@var{file}.adb}
-is a subunit or body of a generic unit, @code{gnatmake} recompiles
+is a subunit or body of a generic unit, @command{gnatmake} recompiles
@file{@var{file}.adb} (because it finds no ALI) and stops, issuing a
warning.
@item
-In @code{gnatmake} the switch @option{^-I^/SEARCH^}
+In @command{gnatmake} the switch @option{^-I^/SEARCH^}
is used to specify both source and
library file paths. Use @option{^-aI^/SOURCE_SEARCH^}
instead if you just want to specify
@@ -8574,14 +8578,14 @@ if you want to specify library paths
only.
@item
-@code{gnatmake} will ignore any files whose ALI file is write-protected.
+@command{gnatmake} will ignore any files whose ALI file is write-protected.
This may conveniently be used to exclude standard libraries from
consideration and in particular it means that the use of the
@option{^-f^/FORCE_COMPILE^} switch will not recompile these files
unless @option{^-a^/ALL_FILES^} is also specified.
@item
-@code{gnatmake} has been designed to make the use of Ada libraries
+@command{gnatmake} has been designed to make the use of Ada libraries
particularly convenient. Assume you have an Ada library organized
as follows: @i{^obj-dir^[OBJ_DIR]^} contains the objects and ALI files for
of your Ada compilation units,
@@ -8600,7 +8604,7 @@ $ gnatmake /SOURCE_SEARCH=@i{[INCLUDE_DIR]}
@end smallexample
@item
-Using @code{gnatmake} along with the
+Using @command{gnatmake} along with the
@option{^-m (minimal recompilation)^/MINIMAL_RECOMPILATION^}
switch provides a mechanism for avoiding unnecessary rcompilations. Using
this switch,
@@ -8616,12 +8620,12 @@ that the debugging information may be out of date.
@end itemize
@node How gnatmake Works
-@section How @code{gnatmake} Works
+@section How @command{gnatmake} Works
@noindent
-Generally @code{gnatmake} automatically performs all necessary
+Generally @command{gnatmake} automatically performs all necessary
recompilations and you don't need to worry about how it works. However,
-it may be useful to have some basic understanding of the @code{gnatmake}
+it may be useful to have some basic understanding of the @command{gnatmake}
approach and in particular to understand how it uses the results of
previous compilations without incorrectly depending on them.
@@ -8632,14 +8636,15 @@ the ALI file. This means that neither the source file itself nor any
files that it depends on have been modified, and hence there is no need
to recompile this file.
-@code{gnatmake} works by first checking if the specified main unit is up
+@command{gnatmake} works by first checking if the specified main unit is up
to date. If so, no compilations are required for the main unit. If not,
-@code{gnatmake} compiles the main program to build a new ALI file that
+@command{gnatmake} compiles the main program to build a new ALI file that
reflects the latest sources. Then the ALI file of the main unit is
examined to find all the source files on which the main program depends,
-and @code{gnatmake} recursively applies the above procedure on all these files.
+and @command{gnatmake} recursively applies the above procedure on all these
+files.
-This process ensures that @code{gnatmake} only trusts the dependencies
+This process ensures that @command{gnatmake} only trusts the dependencies
in an existing ALI file if they are known to be correct. Otherwise it
always recompiles to determine a new, guaranteed accurate set of
dependencies. As a result the program is compiled ``upside down'' from what may
@@ -8647,20 +8652,21 @@ be more familiar as the required order of compilation in some other Ada
systems. In particular, clients are compiled before the units on which
they depend. The ability of GNAT to compile in any order is critical in
allowing an order of compilation to be chosen that guarantees that
-@code{gnatmake} will recompute a correct set of new dependencies if
+@command{gnatmake} will recompute a correct set of new dependencies if
necessary.
-When invoking @code{gnatmake} with several @var{file_names}, if a unit is
+When invoking @command{gnatmake} with several @var{file_names}, if a unit is
imported by several of the executables, it will be recompiled at most once.
Note: when using non-standard naming conventions
-(See @ref{Using Other File Names}), changing through a configuration pragmas
-file the version of a source and invoking @code{gnatmake} to recompile may
+(@pxref{Using Other File Names}), changing through a configuration pragmas
+file the version of a source and invoking @command{gnatmake} to recompile may
have no effect, if the previous version of the source is still accessible
-by @code{gnatmake}. It may be necessary to use the switch ^-f^/FORCE_COMPILE^.
+by @command{gnatmake}. It may be necessary to use the switch
+^-f^/FORCE_COMPILE^.
@node Examples of gnatmake Usage
-@section Examples of @code{gnatmake} Usage
+@section Examples of @command{gnatmake} Usage
@table @code
@item gnatmake hello.adb
@@ -8689,7 +8695,7 @@ and @file{^main3^MAIN3.EXE^}.
Compile all files necessary to bind and link the main program unit
@code{Main_Unit} (from file @file{main_unit.adb}). All compilations will
be done with optimization level 2 and the order of elaboration will be
-listed by the binder. @code{gnatmake} will operate in quiet mode, not
+listed by the binder. @command{gnatmake} will operate in quiet mode, not
displaying commands it is executing.
@end table
@@ -8775,8 +8781,8 @@ By default, GNAT generates all run-time checks, except arithmetic overflow
checking for integer operations and checks for access before elaboration on
subprogram calls. The latter are not required in default mode, because all
necessary checking is done at compile time.
-@cindex @option{-gnatp} (@code{gcc})
-@cindex @option{-gnato} (@code{gcc})
+@cindex @option{-gnatp} (@command{gcc})
+@cindex @option{-gnato} (@command{gcc})
Two gnat switches, @option{-gnatp} and @option{-gnato} allow this default to
be modified. @xref{Run-Time Checks}.
@@ -8848,7 +8854,7 @@ possibility of an immediate abort at any point.
@node Optimization Levels
@subsection Optimization Levels
-@cindex @option{^-O^/OPTIMIZE^} (@code{gcc})
+@cindex @option{^-O^/OPTIMIZE^} (@command{gcc})
@noindent
The default is optimization off. This results in the fastest compile
@@ -8861,7 +8867,7 @@ optimization is enabled. You can use the
@ifset vms
@code{OPTIMIZE} qualifier
@end ifset
-to @code{gcc} to control the optimization level:
+to @command{gcc} to control the optimization level:
@table @option
@item ^-O0^/OPTIMIZE=NONE^
@@ -8914,7 +8920,7 @@ levels.
Note regarding the use of @option{-O3}: The use of this optimization level
is generally discouraged with GNAT, since it often results in larger
executables which run more slowly. See further discussion of this point
-in @pxref{Inlining of Subprograms}.
+in @ref{Inlining of Subprograms}.
@node Debugging Optimized Code
@subsection Debugging Optimized Code
@@ -8940,7 +8946,7 @@ Explicit temporary variables that you code might be eliminated at
^level^setting^ @option{-O1} or higher.
The use of the @option{^-g^/DEBUG^} switch,
-@cindex @option{^-g^/DEBUG^} (@code{gcc})
+@cindex @option{^-g^/DEBUG^} (@command{gcc})
which is needed for source-level debugging,
affects the size of the program executable on disk,
and indeed the debugging information can be quite large.
@@ -9057,7 +9063,7 @@ The optimization level is at least @option{-O1}.
@item
The called subprogram is suitable for inlining: It must be small enough
-and not contain nested subprograms or anything else that @code{gcc}
+and not contain nested subprograms or anything else that @command{gcc}
cannot support in inlined subprograms.
@item
@@ -9082,7 +9088,7 @@ The optimization level is at least @option{-O1}.
@item
The called subprogram is suitable for inlining: It must be small enough
-and not contain nested subprograms or anything else @code{gcc} cannot
+and not contain nested subprograms or anything else @command{gcc} cannot
support in inlined subprograms.
@item
@@ -9092,9 +9098,9 @@ The call appears in a body (not in a package spec).
There is a @code{pragma Inline} for the subprogram.
@item
-@cindex @option{-gnatn} (@code{gcc})
+@cindex @option{-gnatn} (@command{gcc})
The @option{^-gnatn^/INLINE^} switch
-is used in the @code{gcc} command line
+is used in the @command{gcc} command line
@end itemize
Note that specifying the @option{-gnatn} switch causes additional
@@ -9132,12 +9138,12 @@ is compiled, the call will be inlined if the body of @code{Q} is small
enough, but now @code{Main} depends on the body of @code{R} in
@file{r.adb} as well as on the spec. This means that if this body is edited,
the main program must be recompiled. Note that this extra dependency
-occurs whether or not the call is in fact inlined by @code{gcc}.
+occurs whether or not the call is in fact inlined by @command{gcc}.
The use of front end inlining with @option{-gnatN} generates similar
additional dependencies.
-@cindex @option{^-fno-inline^/INLINE=SUPPRESS^} (@code{gcc})
+@cindex @option{^-fno-inline^/INLINE=SUPPRESS^} (@command{gcc})
Note: The @option{^-fno-inline^/INLINE=SUPPRESS^} switch
can be used to prevent
all inlining. This switch overrides all other conditions and ensures
@@ -9468,7 +9474,7 @@ being processed.
@cindex @option{^-a^/ALL^} (@command{gnatelim})
Also look for subprograms from the GNAT run time that can be eliminated. Note
that when @file{gnat.adc} is produced using this switch, the entire program
-must be recompiled with switch @option{^-a^/ALL_FILES^} to @code{gnatmake}.
+must be recompiled with switch @option{^-a^/ALL_FILES^} to @command{gnatmake}.
@item ^-I^/INCLUDE_DIRS=^@var{dir}
@cindex @option{^-I^/INCLUDE_DIRS^} (@command{gnatelim})
@@ -9489,12 +9495,12 @@ file must be specified with full path.
@item ^--GCC^/COMPILER^=@var{compiler_name}
@cindex @option{^-GCC^/COMPILER^} (@command{gnatelim})
-Instructs @code{gnatelim} to use specific @code{gcc} compiler instead of one
+Instructs @code{gnatelim} to use specific @command{gcc} compiler instead of one
available on the path.
@item ^--GNATMAKE^/GNATMAKE^=@var{gnatmake_name}
@cindex @option{^--GNATMAKE^/GNATMAKE^} (@command{gnatelim})
-Instructs @code{gnatelim} to use specific @code{gnatmake} instead of one
+Instructs @code{gnatelim} to use specific @command{gnatmake} instead of one
available on the path.
@end table
@@ -9681,8 +9687,7 @@ should apply to all subsequent compilations in the same compilation
environment. Using GNAT, the current directory, possibly containing a
@file{gnat.adc} file is the representation
of a compilation environment. For more information on the
-@file{gnat.adc} file, see the section on handling of configuration
-pragmas @pxref{Handling of Configuration Pragmas}.
+@file{gnat.adc} file, see @ref{Handling of Configuration Pragmas}.
Second, in compilation mode, if @code{gnatchop}
is given a file that starts with
@@ -9867,7 +9872,8 @@ generated files to refers back to the original file name and line number.
The result is that all error messages refer back to the original
unchopped file.
In addition, the debugging information placed into the object file (when
-the @option{^-g^/DEBUG^} switch of @code{gcc} or @code{gnatmake} is specified)
+the @option{^-g^/DEBUG^} switch of @command{gcc} or @command{gnatmake} is
+specified)
also refers back to this original file so that tools like profilers and
debuggers will give information in terms of the original unchopped file.
@@ -10011,7 +10017,7 @@ all compilations performed in a given compilation environment.
GNAT also provides the @code{gnatchop} utility to provide an automatic
way to handle configuration pragmas following the semantics for
compilations (that is, files with multiple units), described in the RM.
-See section @pxref{Operating gnatchop in Compilation Mode} for details.
+See @ref{Operating gnatchop in Compilation Mode} for details.
However, for most purposes, it will be more convenient to edit the
@file{gnat.adc} file that contains configuration pragmas directly,
as described in the following section.
@@ -10062,7 +10068,7 @@ pragma Extend_System (Aux_DEC);
@noindent
In the presence of this pragma, GNAT adds to the definition of the
predefined package SYSTEM all the additional types and subprograms that are
-defined in DEC Ada. See @pxref{Compatibility with DEC Ada} for details.
+defined in DEC Ada. See @ref{Compatibility with DEC Ada} for details.
@end ifset
@node Handling Arbitrary File Naming Conventions Using gnatname
@@ -10088,11 +10094,11 @@ does not need additional information.
@noindent
When the source file names do not follow the standard GNAT default file naming
conventions, the GNAT compiler must be given additional information through
-a configuration pragmas file (see @ref{Configuration Pragmas})
+a configuration pragmas file (@pxref{Configuration Pragmas})
or a project file.
When the non standard file naming conventions are well-defined,
a small number of pragmas @code{Source_File_Name} specifying a naming pattern
-(see @ref{Alternative File Naming Schemes}) may be sufficient. However,
+(@pxref{Alternative File Naming Schemes}) may be sufficient. However,
if the file naming conventions are irregular or arbitrary, a number
of pragma @code{Source_File_Name} for individual compilation units
must be defined.
@@ -10703,7 +10709,7 @@ One of the specifiable properties of a project is a list of files that contain
main subprograms. This property is captured in the @code{Main} attribute,
whose value is a list of strings. If a project defines the @code{Main}
attribute, it is not necessary to identify the main subprogram(s) when
-invoking @command{gnatmake} (see @ref{gnatmake and Project Files}).
+invoking @command{gnatmake} (@pxref{gnatmake and Project Files}).
@node Executable File Names
@unnumberedsubsubsec Executable File Names
@@ -11081,7 +11087,7 @@ end B;
@end smallexample
Attribute @code{Locally_Removed_Files} may also be used to check if a source
-is still needed: if it is possible to build using @code{gnatmake} when such
+is still needed: if it is possible to build using @command{gnatmake} when such
a source is put in attribute @code{Locally_Removed_Files} of a project P, then
it is possible to remove the source completely from a system that includes
project P.
@@ -11260,9 +11266,9 @@ A @emph{string expression} is either a @emph{simple string expression} or a
A @emph{simple string expression} is one of the following:
@itemize @bullet
@item A literal string; e.g.@code{"comm/my_proj.gpr"}
-@item A string-valued variable reference (see @ref{Variables})
-@item A string-valued attribute reference (see @ref{Attributes})
-@item An external reference (see @ref{External References in Project Files})
+@item A string-valued variable reference (@pxref{Variables})
+@item A string-valued attribute reference (@pxref{Attributes})
+@item An external reference (@pxref{External References in Project Files})
@end itemize
@noindent
@@ -11326,7 +11332,7 @@ Variables of a string type are called @emph{typed variables}; all other
variables are called @emph{untyped variables}. Typed variables are
particularly useful in @code{case} constructions, to support conditional
attribute declarations.
-(see @ref{case Constructions}).
+(@pxref{case Constructions}).
The string literals in the list are case sensitive and must all be different.
They may include any graphic characters allowed in Ada, including spaces.
@@ -11427,7 +11433,7 @@ the project's properties. Some attributes have values that are strings;
others have values that are string lists.
There are two categories of attributes: @emph{simple attributes}
-and @emph{associative arrays} (see @ref{Associative Array Attributes}).
+and @emph{associative arrays} (@pxref{Associative Array Attributes}).
Legal project attribute names, and attribute names for each legal package are
listed below. Attributes names are case-insensitive.
@@ -11475,7 +11481,7 @@ The following attributes are defined on projects (all are simple attributes):
@noindent
The following attributes are defined for package @code{Naming}
-(see @ref{Naming Schemes}):
+(@pxref{Naming Schemes}):
@multitable @columnfractions .4 .2 .2 .2
@item Attribute Name @tab Category @tab Index @tab Value
@@ -11521,7 +11527,7 @@ The following attributes are defined for package @code{Naming}
The following attributes are defined for packages @code{Builder},
@code{Compiler}, @code{Binder},
@code{Linker}, @code{Cross_Reference}, and @code{Finder}
-(see @ref{^Switches^Switches^ and Project Files}).
+(@pxref{^Switches^Switches^ and Project Files}).
@multitable @columnfractions .4 .2 .2 .2
@item Attribute Name @tab Category @tab Index @tab Value
@@ -11706,7 +11712,7 @@ attribute declarations. String type declarations, variable declarations and
package declarations are not allowed.
The value of the case variable is often given by an external reference
-(see @ref{External References in Project Files}).
+(@pxref{External References in Project Files}).
@c ****************************************
@c * Objects and Sources in Project Files *
@@ -11726,7 +11732,7 @@ The value of the case variable is often given by an external reference
Each project has exactly one object directory and one or more source
directories. The source directories must contain at least one source file,
unless the project file explicitly specifies that no source files are present
-(see @ref{Source File Names}).
+(@pxref{Source File Names}).
@node Object Directory
@subsection Object Directory
@@ -11859,7 +11865,7 @@ contains a source file name.
By default, if neither the attribute @code{Source_Files} nor the attribute
@code{Source_List_File} is given an explicit value, then each file in the
source directories that conforms to the project's naming scheme
-(see @ref{Naming Schemes}) is an immediate source of the project.
+(@pxref{Naming Schemes}) is an immediate source of the project.
A warning is issued if both attributes @code{Source_Files} and
@code{Source_List_File} are given explicit values. In this case, the attribute
@@ -11892,8 +11898,8 @@ list, or the @code{"Ada"} may be absent from @code{Languages}:
Otherwise, a project must contain at least one immediate source.
Projects with no source files are useful as template packages
-(see @ref{Packages in Project Files}) for other projects; in particular to
-define a package @code{Naming} (see @ref{Naming Schemes}).
+(@pxref{Packages in Project Files}) for other projects; in particular to
+define a package @code{Naming} (@pxref{Naming Schemes}).
@c ****************************
@c * Importing Projects *
@@ -12203,7 +12209,7 @@ an attribute declaration.
A @emph{package} defines the settings for project-aware tools within a
project.
For each such tool one can declare a package; the names for these
-packages are preset (see @ref{Packages}).
+packages are preset (@pxref{Packages}).
A package may contain variable declarations, attribute declarations, and case
constructions.
@@ -12261,7 +12267,7 @@ a package from the template.
In addition to the tool-oriented packages, you can also declare a package
named @code{Naming} to establish specialized source file naming conventions
-(see @ref{Naming Schemes}).
+(@pxref{Naming Schemes}).
@c ************************************
@c * Variables from Imported Projects *
@@ -12342,11 +12348,11 @@ of reasons might not be possible), you can define the relevant file
naming scheme in the @code{Naming} package in your project file.
@noindent
-Note that the use of pragmas described in @ref{Alternative
-File Naming Schemes} by mean of a configuration pragmas file is not
-supported when using project files. You must use the features described
-in this paragraph. You can however use specify other configuration
-pragmas (see @ref{Specifying Configuration Pragmas}).
+Note that the use of pragmas described in
+@ref{Alternative File Naming Schemes} by mean of a configuration
+pragmas file is not supported when using project files. You must use
+the features described in this paragraph. You can however use specify
+other configuration pragmas (@pxref{Specifying Configuration Pragmas}).
@ifclear vms
For example, the following
@@ -13817,8 +13823,8 @@ definitions and/or references to a specified entity or entities, whereas
cross-references.
To use these tools, you must not compile your application using the
-@option{-gnatx} switch on the @file{gnatmake} command line
-(see @ref{The GNAT Make Program gnatmake}). Otherwise, cross-referencing
+@option{-gnatx} switch on the @command{gnatmake} command line
+(@pxref{The GNAT Make Program gnatmake}). Otherwise, cross-referencing
information will not be generated.
@menu
@@ -13874,13 +13880,13 @@ or permissions status in the file system for the current user.
@item -aIDIR
@cindex @option{-aIDIR} (@command{gnatxref})
When looking for source files also look in directory DIR. The order in which
-source file search is undertaken is the same as for @file{gnatmake}.
+source file search is undertaken is the same as for @command{gnatmake}.
@item -aODIR
@cindex @option{-aODIR} (@command{gnatxref})
When searching for library and object files, look in directory
DIR. The order in which library files are searched is the same as for
-@file{gnatmake}.
+@command{gnatmake}.
@item -nostdinc
@cindex @option{-nostdinc} (@command{gnatxref})
@@ -13893,7 +13899,7 @@ Do not look for library files in the system default directory.
@item --RTS=@var{rts-path}
@cindex @option{--RTS} (@command{gnatxref})
Specifies the default location of the runtime library. Same meaning as the
-equivalent @code{gnatmake} flag (see @ref{Switches for gnatmake}).
+equivalent @command{gnatmake} flag (@pxref{Switches for gnatmake}).
@item ^-d^/DERIVED_TYPES^
@cindex @option{^-d^/DERIVED_TYPES^} (@command{gnatxref})
@@ -13939,7 +13945,7 @@ display every unused entity and 'with'ed package.
@item -v
Instead of producing the default output, @code{gnatxref} will generate a
@file{tags} file that can be used by vi. For examples how to use this
-feature, see @xref{Examples of gnatxref Usage}. The tags file is output
+feature, see @ref{Examples of gnatxref Usage}. The tags file is output
to the standard output, thus you will have to redirect it to a file.
@end ifclear
@@ -13968,7 +13974,7 @@ where
@table @code
@item pattern
An entity will be output only if it matches the regular expression found
-in @samp{pattern}, see @xref{Regular Expressions in gnatfind and gnatxref}.
+in @samp{pattern}, see @ref{Regular Expressions in gnatfind and gnatxref}.
Omitting the pattern is equivalent to specifying @samp{*}, which
will match any entity. Note that if you do not provide a pattern, you
@@ -13981,7 +13987,7 @@ for matching purposes. At the current time there is no support for
@item sourcefile
@code{gnatfind} will look for references, bodies or declarations
of symbols referenced in @file{sourcefile}, at line @samp{line}
-and column @samp{column}. See @pxref{Examples of gnatfind Usage}
+and column @samp{column}. See @ref{Examples of gnatfind Usage}
for syntax examples.
@item line
@@ -14031,13 +14037,13 @@ or permission status in the file system for the current user.
@item -aIDIR
@cindex @option{-aIDIR} (@command{gnatfind})
When looking for source files also look in directory DIR. The order in which
-source file search is undertaken is the same as for @file{gnatmake}.
+source file search is undertaken is the same as for @command{gnatmake}.
@item -aODIR
@cindex @option{-aODIR} (@command{gnatfind})
When searching for library and object files, look in directory
DIR. The order in which library files are searched is the same as for
-@file{gnatmake}.
+@command{gnatmake}.
@item -nostdinc
@cindex @option{-nostdinc} (@command{gnatfind})
@@ -14050,7 +14056,7 @@ Do not look for library files in the system default directory.
@item --RTS=@var{rts-path}
@cindex @option{--RTS} (@command{gnatfind})
Specifies the default location of the runtime library. Same meaning as the
-equivalent @code{gnatmake} flag (see @ref{Switches for gnatmake}).
+equivalent @command{gnatmake} flag (@pxref{Switches for gnatmake}).
@item ^-d^/DERIVED_TYPE_INFORMATION^
@cindex @option{^-d^/DERIVED_TYPE_INFORMATION^} (@code{gnatfind})
@@ -14633,6 +14639,9 @@ Align @code{:=} in assignment statements
@item ^-A4^/ALIGN=ARROWS^
Align @code{=>} in associations
+
+@item ^-A5^/ALIGN=COMPONENT_CLAUSES^
+Align @code{at} keywords in the component clauses in record representation clauses
@end table
@noindent
@@ -14739,7 +14748,7 @@ compatible.
@noindent
This group of @command{gnatpp} switches controls the layout of comments and
-complex syntactic constructs. See @ref{Formatting Comments}, for details
+complex syntactic constructs. See @ref{Formatting Comments} for details
on their effect.
@table @option
@@ -15162,6 +15171,31 @@ many words in a line as possible).
@subsection Construct Layout
@noindent
+In several cases the suggested layout in the Ada Reference Manual includes
+an extra level of indentation that many programmers prefer to avoid. The
+affected cases include:
+
+@itemize @bullet
+
+@item Record type declaration (RM 3.8)
+
+@item Record representation clause (RM 13.5.1)
+
+@item Loop statement in case if a loop has a statement identifier (RM 5.6)
+
+@item Block statement in case if a block has a statement identifier (RM 5.6)
+@end itemize
+
+@noindent
+In compact mode (when GNAT style layout or compact layout is set),
+the pretty printer uses one level of indentation instead
+of two. This is achived in the record definition and record representation
+clause cases by putting the @code{record} keyword on the same line as the
+start of the declaration or representation clause, and in the block and loop
+case by putting the block or loop header on the same line as the statement
+identifier.
+
+@noindent
The difference between GNAT style @option{^-l1^/CONSTRUCT_LAYOUT=GNAT^}
and compact @option{^-l2^/CONSTRUCT_LAYOUT=COMPACT^}
layout on the one hand, and uncompact layout
@@ -15191,6 +15225,22 @@ type q is
@item
@smallexample @c ada
+for q use record
+ a at 0 range 0 .. 31;
+ b at 4 range 0 .. 31;
+end record;
+@end smallexample
+@tab
+@smallexample @c ada
+for q use
+ record
+ a at 0 range 0 .. 31;
+ b at 4 range 0 .. 31;
+ end record;
+@end smallexample
+
+@item
+@smallexample @c ada
Block : declare
A : Integer := 3;
begin
@@ -15235,6 +15285,12 @@ type q is record type q is
end record; b : integer;
end record;
+for q use record for q use
+ a at 0 range 0 .. 31; record
+ b at 4 range 0 .. 31; a at 0 range 0 .. 31;
+end record; b at 4 range 0 .. 31;
+ end record;
+
Block : declare Block :
A : Integer := 3; declare
begin A : Integer := 3;
@@ -15454,7 +15510,7 @@ end Test;
@cindex Metric tool
@noindent
-^The @command{gnatmetric} tool^GNAT METRIC^ is an ASIS-based utility
+^The @command{gnatmetric} tool^@command{GNAT METRIC}^ is an ASIS-based utility
for computing various program metrics.
It takes an Ada source file as input and generates a file containing the
metrics data as output. Various switches control which
@@ -15468,40 +15524,45 @@ an error message; no metric information for this file will be
computed and reported.
If the compilation unit contained in the input source depends semantically
-upon units located outside the current directory, you have to provide the
-source search path when invoking @command{gnatmetric}.
-If these units are contained in files
-with names that do not follow the GNAT file naming rules, you have to provide
-the configuration file describing the corresponding naming scheme; see the
-description of the @command{gnatmetric} switches below. Another possibility
-is to use a project file and to
-call @command{gnatmetric} through the @command{gnat} driver
+upon units in files located outside the current directory, you have to provide
+the source search path when invoking @command{gnatmetric}.
+If it depends semantically upon units that are contained
+in files with names that do not follow the GNAT file naming rules, you have to
+provide the configuration file describing the corresponding naming scheme; see
+the description of the @command{gnatmetric} switches below.
+Alternatively, you may use a project file and invoke @command{gnatmetric}
+through the @command{gnat} driver.
+
The @command{gnatmetric} command has the form
@smallexample
-$ gnatmetric [@var{switches}] @var{filename} [@var{-cargs gcc_switches}]
+$ gnatmetric [@i{switches}] @{@i{filename}@} [@i{-cargs gcc_switches}]
@end smallexample
@noindent
where
@itemize @bullet
@item
-@var{switches} specify the metrics to compute and define the destination for
+@i{switches} specify the metrics to compute and define the destination for
the output
@item
-@var{filename} is the name (including the extension) of the source file to
-process; ``wildcards'' or several file names on the same @command{gnatmetric}
-command are allowed. The file name may contain path information; in this case
-it does not have to follow the GNAT file naming rules
+Each @i{filename} is the name (including the extension) of a source
+file to process. ``Wildcards'' are allowed, and
+the file name may contain path information.
+If no @i{filename} is supplied, then the @i{switches} list must contain
+at least one
+@option{-files} switch (@pxref{Other gnatmetric Switches}).
+Including both a @option{-files} switch and one or more
+@i{filename} arguments is permitted.
@item
-@option{-cargs gcc_switches} is a list of switches for
+@i{-cargs gcc_switches} is a list of switches for
@command{gcc}. They will be passed on to all compiler invocations made by
@command{gnatmetric} to generate the ASIS trees. Here you can provide
-@option{-I} switches to form the source search path,
-and use the @var{-gnatec} switch to set the configuration file.
+@option{^-I^/INCLUDE_DIRS=^} switches to form the source search path,
+and use the @option{-gnatec} switch to set the configuration file.
@end itemize
@menu
@@ -15580,7 +15641,11 @@ Put the XML output into @var{file_name} (also implies @option{^-x^/XML^})
@cindex @option{^-sfn^/SHORT_SOURCE_FILE_NAME^} (@command{gnatmetric})
@item ^-sfn^/SHORT_SOURCE_FILE_NAME^
-Use short source file names in the output
+Use ``short'' source file names in the output. (The @command{gnatmetric}
+output includes the name(s) of the Ada source file(s) from which the metrics
+are computed. By default each name includes the absolute path. The
+@option{^-sfn^/SHORT_SOURCE_FILE_NAME^} switch causes @command{gnatmetric}
+to exclude all directory information from the file names that are output.)
@end table
@@ -15591,35 +15656,45 @@ Use short source file names in the output
@noindent
@command{gnatmetric} relies on the GNAT compilation model @minus{}
one compilation
-unit per one source file. It computes some metrics for the whole source
-file (mostly ``number of lines'' metrics) and it always computes metrics for
-the top program unit of the corresponding compilation unit.
+unit per one source file. It computes line metrics for the whole source
+file, and it also computes syntax
+and complexity metrics for the file's outermost unit.
-@command{gnatmetric} considers the following constructs as program units to
-compute metrics for:
+By default, @command{gnatmetric} will also compute all metrics for certain
+kinds of locally declared program units:
@itemize @bullet
@item
-a library item or a subunit in a compilation unit;
+subprogram (and generic subprogram) bodies;
@item
-all kinds of bodies;
+package (and generic package) specifications and bodies;
@item
-declarations of tasks and protected types and objects, package and generic
-package declarations;
+task object and type specifications and bodies;
+@item
+protected object and type specifications and bodies.
@end itemize
@noindent
-That is, a subprogram declaration, a generic instantiation or a renaming is
-considered as a program unit only if it is a library item of a compilation
-unit.
+These kinds of entities will be referred to as
+@emph{eligible local program units}, or simply @emph{eligible local units},
+@cindex Eligible local unit (for @command{gnatmetric})
+in the discussion below.
+
+Note that a subprogram declaration, generic instantiation,
+or renaming declaration only receives metrics
+computation when it appear as the outermost entity
+in a source file.
+
+Suppression of metrics computation for eligible local units can be
+obtained via the following switch:
@table @option
@cindex @option{^-n@var{x}^/SUPPRESS^} (@command{gnatmetric})
@item ^-nolocal^/SUPPRESS=LOCAL_DETAILS^
-Do not compute detailed metrics for local program units
+Do not compute detailed metrics for eligible local program units
@end table
@@ -15628,12 +15703,13 @@ Do not compute detailed metrics for local program units
@cindex Line metrics control in @command{gnatmetric}
@noindent
-For any source file containing a legal compilation unit, and for any program
-unit, @command{gnatmetric} computes the following metrics:
+For any (legal) source file, and for each of its
+eligible local program units, @command{gnatmetric} computes the following
+metrics:
@itemize @bullet
@item
-the total number of lines in the file;
+the total number of lines;
@item
the total number of code lines (i.e., non-blank lines that are not comments)
@@ -15683,59 +15759,62 @@ The number of blank lines
@end table
+
@node Syntax Metrics Control
@subsection Syntax Metrics Control
@cindex Syntax metrics control in @command{gnatmetric}
@noindent
-For any program unit, @command{gnatmetric} computes the total number of
-declarations and the total number of statements. The sum of all the statements
-and all the declarations is considered as @emph{LSLOC} (``Logical Source
-Lines Of Code'')
-and is reported as a separate metric.
+@command{gnatmetric} computes various syntactic metrics for the
+outermost unit and for each eligible local unit:
+
+@table @emph
+@item LSLOC (``Logical Source Lines Of Code'')
+The total number of declarations and the total number of statements
-For any body and any task, protected, package and generic package declaration
-the maximal static nesting level of nested program units is computed.
+@item Maximal static nesting level of inner program units
According to
@cite{Ada 95 Language Reference Manual}, 10.1(1), ``A program unit is either a
package, a task unit, a protected unit, a
protected entry, a generic unit, or an explicitly declared subprogram other
than an enumeration literal.''
-For any program unit @command{gnatmetric} computes the maximal nesting level of
-composite syntactic constructs. This corresponds to the notion of the
+@item Maximal nesting level of composite syntactic constructs
+This corresponds to the notion of the
maximum nesting level in the GNAT built-in style checks
-(see @ref{Style Checking})
+(@pxref{Style Checking})
+@end table
-For any library-level program unit @command{gnatmetric} additionally computes
+@noindent
+For the outermost unit in the file, @command{gnatmetric} additionally computes
the following metrics:
@table @emph
@item Public subprograms
-This metric is computed for non-private compilation units only. It is a number
-of the subprograms and generic subprograms declared in the given compilation
-unit that can be called
-or instantiated outside the unit. Formal generic subprograms and generic
-instantiations are not counted. Protected subprograms are counted in the same
-way as non-protected ones.
+This metric is computed for package specifications. It is the
+number of subprograms and generic subprograms declared in the visible
+part (including in nested packages, protected objects, and
+protected types).
@item All subprograms
-This metric is computed for all the library level bodies and subunits. The
-metric is equal to a total number of subprogram bodies in the compilation unit.
+This metric is computed for bodies and subunits. The
+metric is equal to a total number of subprogram bodies in the compilation
+unit.
Neither generic instantiations nor renamings-as-a-body nor body stubs
are counted. Any subprogram body is counted, independently of its nesting
level and enclosing constructs. Generic bodies and bodies of protected
subprograms are counted in the same way as ``usual'' subprogram bodies.
@item Public types
-This metric is computed only for non-private package declarations and
+This metric is computed for package specifications and
generic package declarations. It is the total number of types
that can be referenced from outside this compilation unit, plus the
number of types from all the visible parts of all the visible generic packages.
-Generic formal types are not counted.
+Generic formal types are not counted. Only types, not subtypes,
+are included.
@noindent
-Along with counting the total number of public types, the following
+Along with the total number of public types, the following
types are counted and reported separately:
@itemize @bullet
@@ -15865,7 +15944,7 @@ the following switches:
@item ^-nocc^/SUPPRESS=CYCLOMATIC_COMPLEXITY^
Do not compute the McCabe Cyclomatic Complexity
-@item ^noec-^/SUPPRESS=ESSENTIAL_COMPLEXITY^
+@item ^-noec^/SUPPRESS=ESSENTIAL_COMPLEXITY^
Do not compute the Essential Complexity
@item ^-nonl^/SUPPRESS=MAXIMAL_LOOP_NESTING^
@@ -16588,13 +16667,13 @@ Several such switches may be specified simultaneously.
@cindex @option{^-aI^/SOURCE_SEARCH^} (@code{gnatls})
@cindex @option{^-I^/SEARCH^} (@code{gnatls})
@cindex @option{^-I-^/NOCURRENT_DIRECTORY^} (@code{gnatls})
-Source path manipulation. Same meaning as the equivalent @code{gnatmake} flags
-(see @ref{Switches for gnatmake}).
+Source path manipulation. Same meaning as the equivalent @command{gnatmake}
+flags (@pxref{Switches for gnatmake}).
@item --RTS=@var{rts-path}
@cindex @option{--RTS} (@code{gnatls})
Specifies the default location of the runtime library. Same meaning as the
-equivalent @code{gnatmake} flag (see @ref{Switches for gnatmake}).
+equivalent @command{gnatmake} flag (@pxref{Switches for gnatmake}).
@item ^-v^/OUTPUT=VERBOSE^
@cindex @option{^-v^/OUTPUT=VERBOSE^} (@code{gnatls})
@@ -16840,14 +16919,14 @@ Verbose mode.
@item ^-vP^/MESSAGES_PROJECT_FILE=^@emph{x}
@cindex @option{^-vP^/MESSAGES_PROJECT_FILE^} (@code{gnatclean})
Indicates the verbosity of the parsing of GNAT project files.
-See @ref{Switches Related to Project Files}.
+@xref{Switches Related to Project Files}.
@item ^-X^/EXTERNAL_REFERENCE=^@var{name=value}
@cindex @option{^-X^/EXTERNAL_REFERENCE^} (@code{gnatclean})
Indicates that external variable @var{name} has the value @var{value}.
The Project Manager will use this value for occurrences of
@code{external(name)} when parsing the project file.
-See @ref{Switches Related to Project Files}.
+@xref{Switches Related to Project Files}.
@item ^-aO^/OBJECT_SEARCH=^@var{dir}
@cindex @option{^-aO^/OBJECT_SEARCH^} (@code{gnatclean})
@@ -16877,7 +16956,7 @@ where @code{gnatclean} was invoked.
@noindent
This chapter describes how to build and use libraries with GNAT, and also shows
how to recompile the GNAT run-time library. You should be familiar with the
-Project Manager facility (see @ref{GNAT Project Manager}) before reading this
+Project Manager facility (@pxref{GNAT Project Manager}) before reading this
chapter.
@menu
@@ -16911,7 +16990,7 @@ In the GNAT environment, a library has three types of components:
Source files.
@item
@file{ALI} files.
-See @ref{The Ada Library Information Files}.
+@xref{The Ada Library Information Files}.
@item
Object files, an archive or a shared library.
@end itemize
@@ -16920,17 +16999,17 @@ Object files, an archive or a shared library.
A GNAT library may expose all its source files, which is useful for
documentation purposes. Alternatively, it may expose only the units needed by
an external user to make use of the library. That is to say, the specs
-expliciting the library services along with all the units needed to compile
+reflecting the library services along with all the units needed to compile
those specs, which can include generic bodies or any body implementing an
inlined routine. In the case of @emph{stand-alone libraries} those exposed
-units are called @emph{interface units} (see @ref{Stand-alone Ada Libraries}).
+units are called @emph{interface units} (@pxref{Stand-alone Ada Libraries}).
All compilation units comprising an application, including those in a library,
need to be elaborated in an order partially defined by Ada's semantics. GNAT
computes the elaboration order from the @file{ALI} files and this is why they
constitute a mandatory part of GNAT libraries. Except in the case of
@emph{stand-alone libraries}, where a specific library elaboration routine is
-produced independantly of the application(s) using the library.
+produced independently of the application(s) using the library.
@node General Ada Libraries
@section General Ada Libraries
@@ -16946,8 +17025,8 @@ produced independantly of the application(s) using the library.
@noindent
The easiest way to build a library is to use the Project Manager,
-which supports a special type of projects called Library Projects
-(see @ref{Library Projects}).
+which supports a special type of project called a @emph{Library Project}
+(@pxref{Library Projects}).
A project is considered a library project, when two project-level attributes
are defined in it: @code{Library_Name} and @code{Library_Dir}. In order to
@@ -16958,7 +17037,7 @@ project-level attributes can be specified:
This attribute controls whether the library is to be static or dynamic
@item Library_Version
-This attribute specifies what is the library version; this value is used
+This attribute specifies the library version; this value is used
during dynamic linking of shared libraries to determine if the currently
installed versions of the binaries are compatible.
@@ -16973,8 +17052,8 @@ library.
The GNAT Project Manager takes full care of the library maintenance task,
including recompilation of the source files for which objects do not exist
or are not up to date, assembly of the library archive, and installation of
-the library, i.e. copying associated source, object and @file{ALI} files
-to the specified location.
+the library (i.e., copying associated source, object and @file{ALI} files
+to the specified location).
Here is a simple library project file:
@smallexample @c ada
@@ -16986,20 +17065,24 @@ project My_Lib is
for Library_Kind use "dynamic";
end My_lib;
@end smallexample
+
+@noindent
and the compilation command to build and install the library:
+
@smallexample @c ada
$ gnatmake -Pmy_lib
@end smallexample
+@noindent
It is not entirely trivial to perform manually all the steps required to
produce a library. We recommend that you use the GNAT Project Manager
for this task. In special cases where this is not desired, the necessary
steps are discussed below.
There are various possibilities for compiling the units that make up the
-library: for example with a Makefile (see @ref{Using the GNU make Utility}) or
+library: for example with a Makefile (@pxref{Using the GNU make Utility}) or
with a conventional script. For simple libraries, it is also possible to create
-dummy main program which depends upon all the packages that comprise the
+a dummy main program which depends upon all the packages that comprise the
interface of the library. This dummy main program can then be given to
@command{gnatmake}, which will ensure that all necessary objects are built.
@@ -17054,22 +17137,22 @@ the directive @option{-lxxx} at link time.
@subsection Installing a library
@noindent
-When using project files, installing libraries is part of the library build
-process and thus, no further action is needed in order to make use of the
+If you use project files, library installation is part of the library build
+process. Thus no further action is needed in order to make use of the
libraries that are built as part of the general application build. A usable
version of the library is installed in the directory specified by the
@code{Library_Dir} attribute of the library project file.
-One may want to install a library in a context different from where the library
-is built. This is, for instance, the case of third party suppliers, who whish
+You may want to install a library in a context different from where the library
+is built. This situation arises with third party suppliers, who may want
to distribute a library in binary form where the user is not expected to be
-able to recompile the library. The simplest option, in this case, is to provide
-project file slightly different from the one used to build the library which
-makes use of the @code{externally_built} attribute. For instance the project
+able to recompile the library. The simplest option in this case is to provide
+a project file slightly different from the one used to build the library, by
+using the @code{externally_built} attribute. For instance, the project
file used to build the library in the previous section can be changed into the
following one when the library is installed:
-@smallexample @c ada
+@smallexample @c projectfile
project My_Lib is
for Source_Dirs use ("src1", "src2");
for Library_Name use "mylib";
@@ -17079,26 +17162,28 @@ project My_Lib is
end My_lib;
@end smallexample
-This project file assumes that the directories "src1", "src2" & "lib" exist in
+@noindent
+This project file assumes that the directories @file{src1},
+@file{src2}, and @file{lib} exist in
the directory containing the project file. The @code{externally_built}
attribute makes it clear to the GNAT builder that it should not attempt to
recompile any of the units from this library. It allows the library provider to
restrict the source set to the minimum necessary for clients to make use of the
library as described in the first section of this chapter. It is the
-responsability of the library provider to install the necessary sources, ALI
-files & libraries in the directories mentioned in the project file. For
-convenience to the user, it is recommended to install the user's library
-project file in a location that will be searched automatically by the GNAT
-builder. That is to say, any directory refernced in the @code{ADA_LIBRARY_PATH}
-environmenbt variable (see @ref{Importing Projects}), or in the default GNAT
-library location that can be queried with @code{gnatls -v} and is usually of
+responsibility of the library provider to install the necessary sources, ALI
+files and libraries in the directories mentioned in the project file. For
+convenience, the user's library project file should be installed in a location
+that will be searched automatically by the GNAT
+builder. These are the directories referenced in the @code{ADA_LIBRARY_PATH}
+environment variable (@pxref{Importing Projects}), and also the default GNAT
+library location that can be queried with @command{gnatls -v} and is usually of
the form $gnat_install_root/lib/gnat.
When project files are not an option, it is also possible, but not recommended,
-to install the library so that the sources needed to use the library be on the
+to install the library so that the sources needed to use the library are on the
Ada source path and the ALI files & libraries be on the Ada Object path (see
-@ref{Search Paths and the Run-Time Library (RTL)}. Alternatively, he system
-administrator can place general purpose libraries in the default compiler
+@ref{Search Paths and the Run-Time Library (RTL)}. Alternatively, the system
+administrator can place general-purpose libraries in the default compiler
paths, by specifying the libraries' location in the configuration files
@file{ada_source_path} and @file{ada_object_path}. These configuration files
must be located in the GNAT installation tree at the same place as the gcc spec
@@ -17144,9 +17229,10 @@ any part of it.
@noindent Once again, the project facility greatly simplifies the use of
libraries. In this context, using a library is just a matter of adding a
@code{with} clause in the user project. For instance, to make use of the
-library "My_Lib" used as an examples in earlier sections, is just a matter of
-writing something like:
-@smallexample @c ada
+library @code{My_Lib} shown in examples in earlier sections, you can
+write:
+
+@smallexample @c projectfile
with "my_lib";
project My_Proj is
...
@@ -17154,8 +17240,8 @@ end My_Proj;
@end smallexample
Even if you have a third-party, non-Ada library, you can still use GNAT's
-Project Manager facility to provide a wrapper for it. The following project for
-example, when @code{with}ed in your main project, will link with the
+Project Manager facility to provide a wrapper for it. For example, the
+following project, when @code{with}ed by your main project, will link with the
third-party library @file{liba.a}:
@smallexample @c projectfile
@@ -17172,7 +17258,7 @@ end Liba;
@noindent
In order to use an Ada library manually, you need to make sure that this
library is on both your source and object path
-(see @ref{Search Paths and the Run-Time Library (RTL)},
+(see @ref{Search Paths and the Run-Time Library (RTL)}
and @ref{Search Paths for gnatbind}). Furthermore, when the objects are grouped
in an archive or a shared library, you need to specify the desired
library at link time.
@@ -17225,7 +17311,8 @@ pragma Linker_Options ("-lmy_lib");
@subsection Introduction to Stand-alone Libraries
@noindent
-A Stand-alone Library (SAL) is a library that contains the necessary code to
+A Stand-alone Library (abbreviated ``SAL'') is a library that contains the
+necessary code to
elaborate the Ada units that are included in the library. In contrast with
an ordinary library, which consists of all sources, objects and @file{ALI}
files of the
@@ -17274,7 +17361,7 @@ that make a project a Library Project (@code{Library_Name} and
@end smallexample
@noindent
-Attribute @code{Library_Interface} has a non empty string list value,
+Attribute @code{Library_Interface} has a non-empty string list value,
each string in the list designating a unit contained in an immediate source
of the project file.
@@ -17307,7 +17394,7 @@ object directory or one of the source directories, but it can be the same as
the library directory. The sources of the Interface
Units of the library that are needed by an Ada client of the library will be
copied to the designated directory, called the Interface Copy directory.
-These sources includes the specs of the Interface Units, but they may also
+These sources include the specs of the Interface Units, but they may also
include bodies and subunits, when pragmas @code{Inline} or @code{Inline_Always}
are used, or when there is a generic unit in the spec. Before the sources
are copied to the Interface Copy directory, an attempt is made to delete all
@@ -17404,7 +17491,7 @@ example) are called before the library services are used. Any number of
libraries can be used simultaneously, as long as the elaboration
procedure of each library is called.
-Below is an example of C program that uses the @code{mylib} library.
+Below is an example of a C program that uses the @code{mylib} library.
@smallexample
#include "mylib_interface.h"
@@ -17430,7 +17517,7 @@ Note that invoking any library finalization procedure generated by
@code{gnatbind} shuts down the Ada run-time environment.
Consequently, the
finalization of all Ada libraries must be performed at the end of the program.
-No call to these libraries nor to the Ada run-time library should be made
+No call to these libraries or to the Ada run-time library should be made
after the finalization phase.
@node Restrictions in Stand-alone Libraries
@@ -17496,7 +17583,7 @@ to use it.
@noindent
This chapter offers some examples of makefiles that solve specific
problems. It does not explain how to write a makefile (see the GNU make
-documentation), nor does it try to replace the @code{gnatmake} utility
+documentation), nor does it try to replace the @command{gnatmake} utility
(@pxref{The GNAT Make Program gnatmake}).
All the examples in this section are specific to the GNU version of
@@ -17525,7 +17612,7 @@ time of very big applications while maintaining full coherence at
each step of the build process.
The list of dependencies are handled automatically by
-@code{gnatmake}. The Makefile is simply used to call gnatmake in each of
+@command{gnatmake}. The Makefile is simply used to call gnatmake in each of
the appropriate directories.
Note that you should also read the example on how to automatically
@@ -17726,7 +17813,7 @@ operating systems limit the length of the command line. It is thus hard to give
gnatmake the list of source and object directories.
This example shows how you can set up environment variables, which will
-make @code{gnatmake} behave exactly as if the directories had been
+make @command{gnatmake} behave exactly as if the directories had been
specified on the command line, but have a much higher length limit (or
even none on most systems).
@@ -18930,7 +19017,7 @@ the incorrect user program.
@noindent
@code{GDB} is a general purpose, platform-independent debugger that
-can be used to debug mixed-language programs compiled with @code{GCC},
+can be used to debug mixed-language programs compiled with @command{gcc},
and in particular is capable of debugging Ada programs compiled with
GNAT. The latest versions of @code{GDB} are Ada-aware and can handle
complex Ada data structures.
@@ -19396,7 +19483,7 @@ familiarity with compiler internals.
@enumerate
@item
-Run @code{gcc} with the @option{-gnatf}. This first
+Run @command{gcc} with the @option{-gnatf}. This first
switch causes all errors on a given line to be reported. In its absence,
only the first error on a line is displayed.
@@ -19406,15 +19493,15 @@ terminates prematurely or goes into an infinite loop, the last error
message displayed may help to pinpoint the culprit.
@item
-Run @code{gcc} with the @option{^-v (verbose)^/VERBOSE^} switch. In this mode,
-@code{gcc} produces ongoing information about the progress of the
+Run @command{gcc} with the @option{^-v (verbose)^/VERBOSE^} switch. In this
+mode, @command{gcc} produces ongoing information about the progress of the
compilation and provides the name of each procedure as code is
generated. This switch allows you to find which Ada procedure was being
compiled when it encountered a code generation problem.
@item
@cindex @option{-gnatdc} switch
-Run @code{gcc} with the @option{-gnatdc} switch. This is a GNAT specific
+Run @command{gcc} with the @option{-gnatdc} switch. This is a GNAT specific
switch that does for the front-end what @option{^-v^VERBOSE^} does
for the back end. The system prints the name of each unit,
either a compilation unit or nested unit, as it is being analyzed.
@@ -19422,11 +19509,11 @@ either a compilation unit or nested unit, as it is being analyzed.
Finally, you can start
@code{gdb} directly on the @code{gnat1} executable. @code{gnat1} is the
front-end of GNAT, and can be run independently (normally it is just
-called from @code{gcc}). You can use @code{gdb} on @code{gnat1} as you
+called from @command{gcc}). You can use @code{gdb} on @code{gnat1} as you
would on a C program (but @pxref{The GNAT Debugger GDB} for caveats). The
@code{where} command is the first line of attack; the variable
@code{lineno} (seen by @code{print lineno}), used by the second phase of
-@code{gnat1} and by the @code{gcc} backend, indicates the source line at
+@code{gnat1} and by the @command{gcc} backend, indicates the source line at
which the execution stopped, and @code{input_file name} indicates the name of
the source file.
@end enumerate
@@ -19504,7 +19591,7 @@ both language-defined children and GNAT run-time routines.
@findex GNAT
Files with prefix @file{^g-^G-^} are children of @code{GNAT}. These are useful
general-purpose packages, fully documented in their specifications. All
-the other @file{.c} files are modifications of common @code{gcc} files.
+the other @file{.c} files are modifications of common @command{gcc} files.
@end itemize
@node Getting Internal Debugging Information
@@ -19672,7 +19759,7 @@ From this traceback we can see that the exception was raised in
@file{stb.adb} at line 5, which was reached from a procedure call in
@file{stb.adb} at line 10, and so on. The @file{b~std.adb} is the binder file,
which contains the call to the main program.
-@pxref{Running gnatbind}. The remaining entries are assorted runtime routines,
+@xref{Running gnatbind}. The remaining entries are assorted runtime routines,
and the output will vary from platform to platform.
It is also possible to use @code{GDB} with these traceback addresses to debug
@@ -20351,7 +20438,7 @@ the type WIDE_CHARACTER.
The floating-point types supported by GNAT are those
supported by DEC Ada, but defaults are different, and are controlled by
-pragmas. See @pxref{Floating-Point Types and Representations} for details.
+pragmas. See @ref{Floating-Point Types and Representations} for details.
@node The Package SYSTEM
@section The Package SYSTEM
@@ -21528,17 +21615,13 @@ and GNAT systems.
@cindex Run-time libraries (platform-specific information)
@noindent
-The GNAT run-time implementation
-may vary with respect to both the underlying threads library and
-the exception handling scheme.
+The GNAT run-time implementation may vary with respect to both the
+underlying threads library and the exception handling scheme.
For threads support, one or more of the following are supplied:
@itemize @bullet
@item @b{native threads library}, a binding to the thread package from
the underlying operating system
-@item @b{FSU threads library}, a binding to the Florida State University
-threads implementation, which complies fully with the requirements of Annex D
-
@item @b{pthreads library} (Sparc Solaris only), a binding to the Solaris
POSIX thread package
@end itemize
@@ -21575,7 +21658,6 @@ information about several specific platforms.
@menu
* Summary of Run-Time Configurations::
* Specifying a Run-Time Library::
-* Choosing between Native and FSU Threads Libraries::
* Choosing the Scheduling Policy::
* Solaris-Specific Considerations::
* IRIX-Specific Considerations::
@@ -21606,10 +21688,6 @@ information about several specific platforms.
@item @code{@ @ @ @ }Tasking @tab native Solaris threads library
@item @code{@ @ @ @ }Exceptions @tab ZCX
@*
-@item @code{@ @ }@i{rts-fsu} @tab
-@item @code{@ @ @ @ }Tasking @tab FSU threads library
-@item @code{@ @ @ @ }Exceptions @tab SJLJ
-@*
@item @code{@ @ }@i{rts-m64}
@item @code{@ @ @ @ }Tasking @tab native Solaris threads library
@item @code{@ @ @ @ }Exceptions @tab ZCX
@@ -21627,15 +21705,11 @@ information about several specific platforms.
@*
@item @b{x86-linux}
@item @code{@ @ }@i{rts-native (default)}
-@item @code{@ @ @ @ }Tasking @tab LinuxThread library
+@item @code{@ @ @ @ }Tasking @tab pthread library
@item @code{@ @ @ @ }Exceptions @tab ZCX
@*
-@item @code{@ @ }@i{rts-fsu}
-@item @code{@ @ @ @ }Tasking @tab FSU threads library
-@item @code{@ @ @ @ }Exceptions @tab SJLJ
-@*
@item @code{@ @ }@i{rts-sjlj}
-@item @code{@ @ @ @ }Tasking @tab LinuxThread library
+@item @code{@ @ @ @ }Tasking @tab pthread library
@item @code{@ @ @ @ }Exceptions @tab SJLJ
@*
@item @b{x86-windows}
@@ -21683,12 +21757,6 @@ For example on x86-linux:
| | |
| +--- adalib <----+
|
- +--- rts-fsu
- | |
- | +--- adainclude
- | |
- | +--- adalib
- |
+--- rts-sjlj
|
+--- adainclude
@@ -21698,19 +21766,19 @@ For example on x86-linux:
@end smallexample
@noindent
-If the @i{rts-fsu} library is to be selected on a permanent basis,
+If the @i{rts-sjlj} library is to be selected on a permanent basis,
these soft links can be modified with the following commands:
@smallexample
$ cd $target
$ rm -f adainclude adalib
-$ ln -s rts-fsu/adainclude adainclude
-$ ln -s rts-fsu/adalib adalib
+$ ln -s rts-sjlj/adainclude adainclude
+$ ln -s rts-sjlj/adalib adalib
@end smallexample
@noindent
-Alternatively, you can specify @file{rts-fsu/adainclude} in the file
-@file{$target/ada_source_path} and @file{rts-fsu/adalib} in
+Alternatively, you can specify @file{rts-sjlj/adainclude} in the file
+@file{$target/ada_source_path} and @file{rts-sjlj/adalib} in
@file{$target/ada_object_path}.
Selecting another run-time library temporarily can be
@@ -21721,103 +21789,21 @@ achieved by the regular mechanism for GNAT object or source path selection:
Set the environment variables:
@smallexample
-$ ADA_INCLUDE_PATH=$target/rts-fsu/adainclude:$ADA_INCLUDE_PATH
-$ ADA_OBJECTS_PATH=$target/rts-fsu/adalib:$ADA_OBJECTS_PATH
+$ ADA_INCLUDE_PATH=$target/rts-sjlj/adainclude:$ADA_INCLUDE_PATH
+$ ADA_OBJECTS_PATH=$target/rts-sjlj/adalib:$ADA_OBJECTS_PATH
$ export ADA_INCLUDE_PATH ADA_OBJECTS_PATH
@end smallexample
@item
-Use @option{-aI$target/rts-fsu/adainclude}
-and @option{-aO$target/rts-fsu/adalib}
+Use @option{-aI$target/rts-sjlj/adainclude}
+and @option{-aO$target/rts-sjlj/adalib}
on the @command{gnatmake} command line
@item
-Use the switch @option{--RTS}; e.g., @option{--RTS=fsu}
+Use the switch @option{--RTS}; e.g., @option{--RTS=sjlj}
@cindex @option{--RTS} option
@end itemize
-@noindent
-You can similarly switch to @emph{rts-sjlj}.
-
-@node Choosing between Native and FSU Threads Libraries
-@section Choosing between Native and FSU Threads Libraries
-@cindex Native threads library
-@cindex FSU threads library
-
-@noindent
-Some GNAT implementations offer a choice between
-native threads and FSU threads.
-
-@itemize @bullet
-@item
-The @emph{native threads} library correspond to the standard system threads
-implementation (e.g. LinuxThreads on GNU/Linux,
-@cindex LinuxThreads library
-POSIX threads on AIX, or
-Solaris threads on Solaris). When this option is chosen, GNAT provides
-a full and accurate implementation of the core language tasking model
-as described in Chapter 9 of the Ada Reference Manual,
-but might not (and probably does not) implement
-the exact semantics as specified in @w{Annex D} (the Real-Time Systems Annex).
-@cindex Annex D (Real-Time Systems Annex) compliance
-@cindex Real-Time Systems Annex compliance
-Indeed, the reason that a choice of libraries is offered
-on a given target is because some of the
-ACATS tests for @w{Annex D} fail using the native threads library.
-As far as possible, this library is implemented
-in accordance with Ada semantics (e.g., modifying priorities as required
-to simulate ceiling locking),
-but there are often slight inaccuracies, most often in the area of
-absolutely respecting the priority rules on a single
-processor.
-Moreover, it is not possible in general to define the exact behavior,
-because the native threads implementations
-are not well enough documented.
-
-On systems where the @code{SCHED_FIFO} POSIX scheduling policy is supported,
-@cindex POSIX scheduling policies
-@cindex @code{SCHED_FIFO} scheduling policy
-native threads will provide a behavior very close to the @w{Annex D}
-requirements (i.e., a run-till-blocked scheduler with fixed priorities), but
-on some systems (in particular GNU/Linux and Solaris), you need to have root
-privileges to use the @code{SCHED_FIFO} policy.
-
-@item
-The @emph{FSU threads} library provides a completely accurate implementation
-of @w{Annex D}.
-Thus, operating with this library, GNAT is 100% compliant with both the core
-and all @w{Annex D}
-requirements.
-The formal validations for implementations offering
-a choice of threads packages are always carried out using the FSU
-threads option.
-@end itemize
-
-@noindent
-From these considerations, it might seem that FSU threads are the
-better choice,
-but that is by no means always the case. The FSU threads package
-operates with all Ada tasks appearing to the system to be a single
-thread. This is often considerably more efficient than operating
-with separate threads, since for example, switching between tasks
-can be accomplished without the (in some cases considerable)
-overhead of a context switch between two system threads. However,
-it means that you may well lose concurrency at the system
-level. Notably, some system operations (such as I/O) may block all
-tasks in a program and not just the calling task. More
-significantly, the FSU threads approach likely means you cannot
-take advantage of multiple processors, since for this you need
-separate threads (or even separate processes) to operate on
-different processors.
-
-For most programs, the native threads library is
-usually the better choice. Use the FSU threads if absolute
-conformance to @w{Annex D} is important for your application, or if
-you find that the improved efficiency of FSU threads is significant to you.
-
-Note also that to take full advantage of Florist and Glade, it is highly
-recommended that you use native threads.
-
@node Choosing the Scheduling Policy
@section Choosing the Scheduling Policy
@@ -21874,8 +21860,8 @@ debugging 64-bit applications.
@subsection Solaris Threads Issues
@noindent
-Starting with version 3.14, GNAT under Solaris comes with a new tasking
-run-time library based on POSIX threads --- @emph{rts-pthread}.
+GNAT under Solaris comes with an alternate tasking run-time library
+based on POSIX threads --- @emph{rts-pthread}.
@cindex rts-pthread threads library
This run-time library has the advantage of being mostly shared across all
POSIX-compliant thread implementations, and it also provides under
@@ -21893,11 +21879,8 @@ with respectively
As explained above, the native run-time library is based on the Solaris thread
library (@code{libthread}) and is the default library.
-The FSU run-time library is based on the FSU threads.
-@cindex FSU threads library
-Starting with Solaris 2.5.1, when the Solaris threads library is used
-(this is the default), programs
+When the Solaris threads library is used (this is the default), programs
compiled with GNAT can automatically take advantage of
and can thus execute on multiple processors.
The user can alternatively specify a processor on which the program should run
@@ -23653,8 +23636,8 @@ and in particular must have the capability of implementing the
standard dynamic model of elaboration with run-time checks.
In GNAT, this standard mode can be achieved either by the use of
-the @option{-gnatE} switch on the compiler (@code{gcc} or @code{gnatmake})
-command, or by the use of the configuration pragma:
+the @option{-gnatE} switch on the compiler (@command{gcc} or
+@command{gnatmake}) command, or by the use of the configuration pragma:
@smallexample @c ada
pragma Elaboration_Checks (RM);
@@ -26817,7 +26800,7 @@ By virtue of the Open VMS Integrity parameter passing conventions,
even imported
and exported subprograms that have 32-bit address parameters are
compatible with those that have 64-bit address parameters.
-(See @ref{Making code 64 bit clean}, for details.)
+(See @ref{Making code 64 bit clean} for details.)
The areas that may need attention are those where record types have
been defined that contain components of the type @code{System.Address}, and
@@ -26983,7 +26966,7 @@ the 32-bit address space.
(optional) Explicitly use the 32-bit storage pool
for access types used in a 32-bit context, or use
generic access types where possible
-(see @ref{Restrictions on use of 64 bit objects}).
+(@pxref{Restrictions on use of 64 bit objects}).
@end itemize
@noindent
@@ -27015,7 +26998,7 @@ and then passing this address to a subprogram expecting
@code{System.Short_Address},
or assigning it to a variable of type @code{Short_Address}, will cause
@code{Constraint_Error} to be raised. In case the code is not 64-bit clean
-(see @ref{Making code 64 bit clean}), or checks are suppressed,
+(@pxref{Making code 64 bit clean}), or checks are suppressed,
no exception is raised and execution
will become erroneous.
@@ -27133,7 +27116,7 @@ platforms (NT, 2000, and XP Professional).
@noindent
One of the strengths of the GNAT technology is that its tool set
-(@code{gcc}, @code{gnatbind}, @code{gnatlink}, @code{gnatmake}, the
+(@command{gcc}, @command{gnatbind}, @command{gnatlink}, @command{gnatmake}, the
@code{gdb} debugger, etc.) is used in the same way regardless of the
platform.
@@ -27274,7 +27257,7 @@ application that contains a mix of Ada and C/C++, the choice of your
Windows C/C++ development environment conditions your overall
interoperability strategy.
-If you use @code{gcc} to compile the non-Ada part of your application,
+If you use @command{gcc} to compile the non-Ada part of your application,
there are no Windows-specific restrictions that affect the overall
interoperability with your Ada code. If you plan to use
Microsoft tools (e.g. Microsoft Visual C/C++), you should be aware of
@@ -27350,7 +27333,7 @@ are available for Windows:
@noindent
This is the default calling convention used when interfacing to C/C++
-routines compiled with either @code{gcc} or Microsoft Visual C++.
+routines compiled with either @command{gcc} or Microsoft Visual C++.
In the @code{C} calling convention subprogram parameters are pushed on the
stack by the caller from right to left. The caller itself is in charge of
@@ -27457,8 +27440,8 @@ added at the end of the @code{Link_Name} by the compiler.
Note, that in some special cases a DLL's entry point name lacks a trailing
@code{@@}@code{@i{nn}} while the exported name generated for a call has it.
The @code{gnatdll} tool, which creates the import library for the DLL, is able
-to handle those cases (see the description of the switches in
-@pxref{Using gnatdll} section).
+to handle those cases (@pxref{Using gnatdll} for the description of
+the switches).
@node DLL Calling Convention
@subsection @code{DLL} Calling Convention
@@ -27609,7 +27592,7 @@ $ gnatmake my_ada_app -largs -lAPI
@end smallexample
@noindent
-The argument @option{-largs -lAPI} at the end of the @code{gnatmake} command
+The argument @option{-largs -lAPI} at the end of the @command{gnatmake} command
tells the GNAT linker to look first for a library named @file{API.lib}
(Microsoft-style name) and if not found for a library named @file{libAPI.a}
(GNAT-style name). Note that if the Ada package spec for @file{API.dll}
@@ -27620,8 +27603,8 @@ pragma Linker_Options ("-lAPI");
@end smallexample
@noindent
-you do not have to add @option{-largs -lAPI} at the end of the @code{gnatmake}
-command.
+you do not have to add @option{-largs -lAPI} at the end of the
+@command{gnatmake} command.
If any one of the items above is missing you will have to create it
yourself. The following sections explain how to do so using as an
@@ -27865,11 +27848,11 @@ and use DLLs with GNAT.
@item building object files
The first step is to build all objects files that are to be included
-into the DLL. This is done by using the standard @code{gnatmake} tool.
+into the DLL. This is done by using the standard @command{gnatmake} tool.
@item building the DLL
-To build the DLL you must use @code{gcc}'s @code{-shared}
+To build the DLL you must use @command{gcc}'s @code{-shared}
option. It is quite simple to use this method:
@smallexample
@@ -27878,7 +27861,7 @@ $ gcc -shared -o api.dll obj1.o obj2.o ...
It is important to note that in this case all symbols found in the
object files are automatically exported. It is possible to restrict
-the set of symbols to export by passing to @code{gcc} a definition
+the set of symbols to export by passing to @command{gcc} a definition
file, @pxref{The Definition File}. For example:
@smallexample
@@ -27955,14 +27938,14 @@ skip this step if you plan to use the Ada DLL only from Ada applications.
@item
Your Ada code must export an initialization routine which calls the routine
-@code{adainit} generated by @code{gnatbind} to perform the elaboration of
+@code{adainit} generated by @command{gnatbind} to perform the elaboration of
the Ada code in the DLL (@pxref{Ada DLLs and Elaboration}). The initialization
routine exported by the Ada DLL must be invoked by the clients of the DLL
to initialize the DLL.
@item
When useful, the DLL should also export a finalization routine which calls
-routine @code{adafinal} generated by @code{gnatbind} to perform the
+routine @code{adafinal} generated by @command{gnatbind} to perform the
finalization of the Ada code in the DLL (@pxref{Ada DLLs and Finalization}).
The finalization routine exported by the Ada DLL must be invoked by the
clients of the DLL when the DLL services are no further needed.
@@ -28431,9 +28414,9 @@ $ gnatlink api -o api.jnk -mdll -Wl,--base-file,api.base
@end smallexample
@noindent
-In addition to the base file, the @code{gnatlink} command generates an
+In addition to the base file, the @command{gnatlink} command generates an
output file @file{api.jnk} which can be discarded. The @option{-mdll} switch
-asks @code{gnatlink} to generate the routines @code{DllMain} and
+asks @command{gnatlink} to generate the routines @code{DllMain} and
@code{DllMainCRTStartup} that are called by the Windows loader when the DLL
is loaded into memory.
@@ -28452,8 +28435,8 @@ $ dlltool --dllname api.dll --def api.def --base-file api.base \
@item
@code{gnatdll} builds the base file using the new export table. Note that
-@code{gnatbind} must be called once again since the binder generated file
-has been deleted during the previous call to @code{gnatlink}.
+@command{gnatbind} must be called once again since the binder generated file
+has been deleted during the previous call to @command{gnatlink}.
@smallexample
@group
@@ -28622,7 +28605,7 @@ $ windres -i myres.rc -o myres.o
@end smallexample
@noindent
-By default @code{windres} will run @code{gcc} to preprocess the @file{.rc}
+By default @code{windres} will run @command{gcc} to preprocess the @file{.rc}
file. You can specify an alternate preprocessor (usually named
@file{cpp.exe}) using the @code{windres} @option{--preprocessor}
parameter. A list of all possible options may be obtained by entering
@@ -28645,7 +28628,7 @@ $ windres -i myres.res -o myres.o
@noindent
To include the resource file in your program just add the
GNAT-compatible object file for the resource(s) to the linker
-arguments. With @code{gnatmake} this is done by using the @option{-largs}
+arguments. With @command{gnatmake} this is done by using the @option{-largs}
option:
@smallexample
@@ -28734,6 +28717,42 @@ At this stage a breakpoint is set inside the DLL. From there on
you can use the standard approach to debug the whole program
(@pxref{Running and Debugging Ada Programs}).
+To break on the @code{DllMain} routine it is not possible to follow
+the procedure above. At the time the program stop on @code{ada_main}
+the @code{DllMain} routine as already been called. Either you can use
+the procedure below @pxref{Debugging the DLL Directly} or this procedure:
+
+@enumerate 1
+@item Launch @code{GDB} on the main program.
+
+@smallexample
+$ gdb -nw ada_main
+@end smallexample
+
+@item Load DLL symbols
+
+@smallexample
+(gdb) add-sym api.dll
+@end smallexample
+
+@item Set a breakpoint inside the DLL
+
+@smallexample
+(gdb) break ada_dll.adb:45
+@end smallexample
+
+Note that at this point it is not possible to break using the routine symbol
+directly as the program is not yet running. The solution is to break
+on the proper line (break in @file{ada_dll.adb} line 45).
+
+@item Start the program
+
+@smallexample
+(gdb) run
+@end smallexample
+
+@end enumerate
+
@node Program Built with Foreign Tools and DLL Built with GCC/GNAT
@subsection Program Built with Foreign Tools and DLL Built with GCC/GNAT
@@ -28775,9 +28794,13 @@ $ gdb -nw test.dll
@item Set a breakpoint on a DLL subroutine.
@smallexample
-(gdb) break ada_dll
+(gdb) break ada_dll.adb:45
@end smallexample
+Note that at this point it is not possible to break using the routine symbol
+directly as the program is not yet running. The solution is to break
+on the proper line (break in @file{ada_dll.adb} line 45).
+
@item
Specify the executable file to @code{GDB}.
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index a64990ec590..d13af031bc8 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -120,7 +120,7 @@ procedure Gnatbind is
Max_Storage_At_Blocking => True,
-- Not checkable at compile time
- others => False);
+ others => False);
Additional_Restrictions_Listed : Boolean := False;
-- Set True if we have listed header for restrictions
@@ -337,8 +337,8 @@ procedure Gnatbind is
Opt.Bind_Alternate_Main_Name := True;
Opt.Alternate_Main_Name := new String'(Argv (3 .. Argv'Last));
- -- All other options are single character and are handled
- -- by Scan_Binder_Switches.
+ -- All other options are single character and are handled by
+ -- Scan_Binder_Switches.
else
Scan_Binder_Switches (Argv);
@@ -438,10 +438,10 @@ begin
Osint.Add_Default_Search_Dirs;
-- Carry out package initializations. These are initializations which
- -- might logically be performed at elaboration time, but Namet at
- -- least can't be done that way (because it is used in the Compiler),
- -- and we decide to be consistent. Like elaboration, the order in
- -- which these calls are made is in some cases important.
+ -- might logically be performed at elaboration time, but Namet at least
+ -- can't be done that way (because it is used in the Compiler), and we
+ -- decide to be consistent. Like elaboration, the order in which these
+ -- calls are made is in some cases important.
Csets.Initialize;
Namet.Initialize;
@@ -481,7 +481,7 @@ begin
Write_Str ("GNATBIND ");
Write_Str (Gnat_Version_String);
Write_Eol;
- Write_Str ("Copyright 1995-2004 Free Software Foundation, Inc.");
+ Write_Str ("Copyright 1995-2005 Free Software Foundation, Inc.");
Write_Eol;
end if;
@@ -562,7 +562,7 @@ begin
-- ALI files.
for Index in ALIs.First .. ALIs.Last loop
- ALIs.Table (Index).Interface := False;
+ ALIs.Table (Index).SAL_Interface := False;
end loop;
-- Add System.Standard_Library to list to ensure that these files are
@@ -654,7 +654,7 @@ begin
Write_Eol;
for J in Elab_Order.First .. Elab_Order.Last loop
- if not Units.Table (Elab_Order.Table (J)).Interface then
+ if not Units.Table (Elab_Order.Table (J)).SAL_Interface then
Write_Str (" ");
Write_Unit_Name
(Units.Table (Elab_Order.Table (J)).Uname);
@@ -680,7 +680,7 @@ begin
Total_Warnings := Total_Warnings + Warnings_Detected;
end;
- -- All done. Set proper exit status.
+ -- All done. Set proper exit status
Finalize_Binderr;
Namet.Finalize;
diff --git a/gcc/ada/gnatbl.c b/gcc/ada/gnatbl.c
index 82284286676..ead189ff261 100644
--- a/gcc/ada/gnatbl.c
+++ b/gcc/ada/gnatbl.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005 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- *
@@ -24,6 +24,10 @@
* *
****************************************************************************/
+#ifdef VMS
+#define _POSIX_EXIT 1
+#endif
+
#include "config.h"
#include "system.h"
@@ -32,13 +36,6 @@
#endif
#include "adaint.h"
-#ifdef VMS
-#ifdef exit
-#undef exit
-#endif
-#define exit __posix_exit
-#endif
-
/* These can be set by command line arguments */
char *binder_path = 0;
char *linker_path = 0;
@@ -138,7 +135,7 @@ process_args (int *p_argc, char *argv[])
if (! strcmp (argv[i], "-gnatbind"))
{
- /* Explicit naming of binder. Grab the value then remove the
+ /* Explicit naming of binder. Grab the value then remove the
two arguments from the argument list. */
if ( i + 1 >= *p_argc )
{
diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb
index 0c5a25227af..a6b12e5c5fa 100644
--- a/gcc/ada/gnatchop.adb
+++ b/gcc/ada/gnatchop.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2004 Ada Core Technologies, Inc. --
+-- Copyright (C) 1998-2005 Ada Core Technologies, 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- --
@@ -35,6 +35,8 @@ with GNAT.Table;
with Gnatvsn;
with Hostparm;
+with System.CRTL; use System.CRTL;
+
procedure Gnatchop is
Terminate_Program : exception;
@@ -182,7 +184,7 @@ procedure Gnatchop is
-- Note that this function returns false for the last entry.
procedure Sort_Units;
- -- Sort units and set up sorted unit table.
+ -- Sort units and set up sorted unit table
----------------------
-- File_Descriptors --
@@ -190,10 +192,6 @@ procedure Gnatchop is
function dup (handle : File_Descriptor) return File_Descriptor;
function dup2 (from, to : File_Descriptor) return File_Descriptor;
- -- File descriptor based functions needed for redirecting stdin/stdout
-
- pragma Import (C, dup, "dup");
- pragma Import (C, dup2, "dup2");
---------------------
-- Local variables --
@@ -332,6 +330,24 @@ procedure Gnatchop is
Success : out Boolean);
-- Write one compilation unit of the source to file
+ ---------
+ -- dup --
+ ---------
+
+ function dup (handle : File_Descriptor) return File_Descriptor is
+ begin
+ return File_Descriptor (System.CRTL.dup (int (handle)));
+ end dup;
+
+ ----------
+ -- dup2 --
+ ----------
+
+ function dup2 (from, to : File_Descriptor) return File_Descriptor is
+ begin
+ return File_Descriptor (System.CRTL.dup2 (int (from), int (to)));
+ end dup2;
+
---------------
-- Error_Msg --
---------------
@@ -1148,7 +1164,7 @@ procedure Gnatchop is
Put_Line (Standard_Error, Gnatvsn.Gnat_Version_String);
Put_Line
(Standard_Error,
- "Copyright 1998-2004, Ada Core Technologies Inc.");
+ "Copyright 1998-2005, Ada Core Technologies Inc.");
when 'w' =>
Overwrite_Files := True;
@@ -1316,7 +1332,7 @@ procedure Gnatchop is
Unit_Sort.Sort (Natural (Unit.Last));
- -- Set the Sorted_Index fields in the unit tables.
+ -- Set the Sorted_Index fields in the unit tables
for J in 1 .. SUnit_Num (Unit.Last) loop
Unit.Table (Sorted_Units.Table (J)).Sorted_Index := J;
diff --git a/gcc/ada/gnatfind.adb b/gcc/ada/gnatfind.adb
index 980f31febb8..bd8a22a5548 100644
--- a/gcc/ada/gnatfind.adb
+++ b/gcc/ada/gnatfind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2005 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- --
@@ -87,10 +87,8 @@ procedure Gnatfind is
when 'a' =>
if GNAT.Command_Line.Full_Switch = "a" then
Read_Only := True;
-
elsif GNAT.Command_Line.Full_Switch = "aI" then
Osint.Add_Src_Search_Dir (GNAT.Command_Line.Parameter);
-
else
Osint.Add_Lib_Search_Dir (GNAT.Command_Line.Parameter);
end if;
@@ -117,7 +115,6 @@ procedure Gnatfind is
when 'n' =>
if GNAT.Command_Line.Full_Switch = "nostdinc" then
Opt.No_Stdinc := True;
-
elsif GNAT.Command_Line.Full_Switch = "nostlib" then
Opt.No_Stdlib := True;
end if;
@@ -125,7 +122,6 @@ procedure Gnatfind is
when 'p' =>
declare
S : constant String := GNAT.Command_Line.Parameter;
-
begin
Prj_File_Length := S'Length;
Prj_File (1 .. Prj_File_Length) := S;
@@ -241,7 +237,7 @@ procedure Gnatfind is
procedure Write_Usage is
begin
Put_Line ("GNATFIND " & Gnatvsn.Gnat_Version_String);
- Put_Line ("Copyright 1998-2004, Ada Core Technologies Inc.");
+ Put_Line ("Copyright 1998-2005, Ada Core Technologies Inc.");
Put_Line ("Usage: gnatfind pattern[:sourcefile[:line[:column]]] "
& "[file1 file2 ...]");
New_Line;
diff --git a/gcc/ada/gnatlbr.adb b/gcc/ada/gnatlbr.adb
index 3dd2d4dba29..6873c3cc5f2 100644
--- a/gcc/ada/gnatlbr.adb
+++ b/gcc/ada/gnatlbr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005 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- --
@@ -61,7 +61,7 @@ procedure GnatLbr is
Make_Path : String_Access;
procedure Create_Directory (Name : System.Address; Mode : Integer);
- pragma Import (C, Create_Directory, "mkdir");
+ pragma Import (C, Create_Directory, "decc$mkdir");
begin
if Argument_Count = 0 then
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index 19728a86d88..5a4a57fec39 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2005 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- --
@@ -172,28 +172,28 @@ procedure Gnatlink is
-- Set to True to force generation of a response file
function Base_Name (File_Name : in String) return String;
- -- Return just the file name part without the extension (if present).
+ -- Return just the file name part without the extension (if present)
procedure Delete (Name : in String);
- -- Wrapper to unlink as status is ignored by this application.
+ -- Wrapper to unlink as status is ignored by this application
procedure Error_Msg (Message : in String);
-- Output the error or warning Message
procedure Exit_With_Error (Error : in String);
- -- Output Error and exit program with a fatal condition.
+ -- Output Error and exit program with a fatal condition
procedure Process_Args;
- -- Go through all the arguments and build option tables.
+ -- Go through all the arguments and build option tables
procedure Process_Binder_File (Name : in String);
- -- Reads the binder file and extracts linker arguments.
+ -- Reads the binder file and extracts linker arguments
procedure Write_Header;
- -- Show user the program name, version and copyright.
+ -- Show user the program name, version and copyright
procedure Write_Usage;
- -- Show user the program options.
+ -- Show user the program options
---------------
-- Base_Name --
@@ -514,7 +514,7 @@ procedure Gnatlink is
new String'(Arg);
end if;
- -- Pass to gcc for linking program.
+ -- Pass to gcc for linking program
Gcc_Linker_Options.Increment_Last;
Gcc_Linker_Options.Table
@@ -639,10 +639,10 @@ procedure Gnatlink is
-- For call to Close
GNAT_Static : Boolean := False;
- -- Save state of -static option.
+ -- Save state of -static option
GNAT_Shared : Boolean := False;
- -- Save state of -shared option.
+ -- Save state of -shared option
Xlinker_Was_Previous : Boolean := False;
-- Indicate that "-Xlinker" was the option preceding the current
@@ -704,7 +704,7 @@ procedure Gnatlink is
-- terminator.
function Index (S, Pattern : String) return Natural;
- -- Return the last occurrence of Pattern in S, or 0 if none.
+ -- Return the last occurrence of Pattern in S, or 0 if none
function Is_Option_Present (Opt : in String) return Boolean;
-- Return true if the option Opt is already present in
@@ -1279,7 +1279,7 @@ procedure Gnatlink is
Write_Str ("GNATLINK ");
Write_Str (Gnat_Version_String);
Write_Eol;
- Write_Str ("Copyright 1995-2004 Free Software Foundation, Inc");
+ Write_Str ("Copyright 1995-2005 Free Software Foundation, Inc");
Write_Eol;
end if;
end Write_Header;
@@ -1663,7 +1663,7 @@ begin
end Bind_Step;
end if;
- -- Now, actually link the program.
+ -- Now, actually link the program
-- Skip this step for now on the JVM since the Java interpreter will do
-- the actual link at run time. We might consider packing all class files
diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb
index f8fec48d0e4..900b0ead18a 100644
--- a/gcc/ada/gnatls.adb
+++ b/gcc/ada/gnatls.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -52,11 +52,12 @@ procedure Gnatls is
-- Name of the env. variable that contains path name(s) of directories
-- where project files may reside.
+ -- NOTE : The following string may be used by other tools, such as GPS. So
+ -- it can only be modified if these other uses are checked and coordinated.
+
Project_Search_Path : constant String := "Project Search Path:";
-- Label displayed in verbose mode before the directories in the project
- -- search path.
- -- NOTE: This string may be used by other tools, such as GPS; so, it
- -- should not be modified inconsiderately.
+ -- search path. Do not modify without checking NOTE above.
No_Project_Default_Dir : constant String := "-";
@@ -549,6 +550,7 @@ procedure Gnatls is
-- Remove any encoding info (%s or %b)
Get_Name_String (N);
+
if Name_Len > 2
and then Name_Buffer (Name_Len - 1) = '%'
then
@@ -977,7 +979,7 @@ procedure Gnatls is
U.Internal or
U.Is_Generic or
U.Init_Scalars or
- U.Interface or
+ U.SAL_Interface or
U.Body_Needed_For_SAL or
U.Elaborate_Body
then
@@ -1032,8 +1034,8 @@ procedure Gnatls is
Write_Str (" Init_Scalars");
end if;
- if U.Interface then
- Write_Str (" Interface");
+ if U.SAL_Interface then
+ Write_Str (" SAL_Interface");
end if;
if U.Body_Needed_For_SAL then
@@ -1247,6 +1249,7 @@ procedure Gnatls is
-- Scan the file line by line
while Index < Buffer'Last loop
+
-- Find the end of line
Last := Index;
@@ -1448,10 +1451,9 @@ procedure Gnatls is
Output_Status (ST, Verbose => True);
Write_Eol;
end loop;
-
end Usage;
--- Start of processing for Gnatls
+-- Start of processing for Gnatls
begin
-- Initialize standard packages
@@ -1498,7 +1500,7 @@ begin
Write_Str ("GNATLS ");
Write_Str (Gnat_Version_String);
Write_Eol;
- Write_Str ("Copyright 1997-2004 Free Software Foundation, Inc.");
+ Write_Str ("Copyright 1997-2005 Free Software Foundation, Inc.");
Write_Eol;
Write_Eol;
Write_Str ("Source Search Path:");
@@ -1583,6 +1585,7 @@ begin
Add_Default_Dir := False;
elsif First /= Last or else Project_Path (First) /= '.' then
+
-- If the directory is ".", skip it as it is the current
-- directory and it is already the first directory in the
-- project path.
@@ -1755,7 +1758,6 @@ begin
Write_Str ("depends upon");
Write_Eol;
Write_Str (" ");
-
else
Write_Eol;
end if;
diff --git a/gcc/ada/gnatmem.adb b/gcc/ada/gnatmem.adb
index f2a13770f85..19575945b31 100644
--- a/gcc/ada/gnatmem.adb
+++ b/gcc/ada/gnatmem.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2004, Ada Core Technologies, Inc. --
+-- Copyright (C) 1997-2005, Ada Core Technologies, 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- --
@@ -37,9 +37,9 @@
-- The running my_prog will produce a file named gmem.out that will be
-- parsed by gnatmem.
--- - Record a reference to the allocated memory on each allocation call.
+-- - Record a reference to the allocated memory on each allocation call
--- - Suppress this reference on deallocation.
+-- - Suppress this reference on deallocation
-- - At the end of the program, remaining references are potential leaks.
-- sort them out the best possible way in order to locate the root of
@@ -89,7 +89,7 @@ procedure Gnatmem is
-- These need comments, and should be on separate lines ???
function Read_Next return Storage_Elmt;
- -- Reads next dynamic storage operation from the log file.
+ -- Reads next dynamic storage operation from the log file
function Mem_Image (X : Storage_Count) return String;
-- X is a size in storage_element. Returns a value
@@ -233,7 +233,7 @@ procedure Gnatmem is
New_Line;
Put ("GNATMEM ");
Put_Line (Gnat_Version_String);
- Put_Line ("Copyright 1997-2004 Free Software Foundation, Inc.");
+ Put_Line ("Copyright 1997-2005 Free Software Foundation, Inc.");
New_Line;
Put_Line ("Usage: gnatmem switches [depth] exename");
diff --git a/gcc/ada/gnatname.adb b/gcc/ada/gnatname.adb
index bdce127628f..dfb2a29e63e 100644
--- a/gcc/ada/gnatname.adb
+++ b/gcc/ada/gnatname.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005 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- --
@@ -172,7 +172,7 @@ procedure Gnatname is
Output.Write_Str ("GNATNAME ");
Output.Write_Line (Gnatvsn.Gnat_Version_String);
Output.Write_Line
- ("Copyright 2001-2004 Free Software Foundation, Inc.");
+ ("Copyright 2001-2005 Free Software Foundation, Inc.");
end if;
end Output_Version;
@@ -231,7 +231,6 @@ procedure Gnatname is
when 'v' =>
if Opt.Verbose_Mode then
Very_Verbose := True;
-
else
Opt.Verbose_Mode := True;
end if;
diff --git a/gcc/ada/i-c.adb b/gcc/ada/i-c.adb
index 844f016441e..da8e3146f66 100644
--- a/gcc/ada/i-c.adb
+++ b/gcc/ada/i-c.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -63,6 +63,32 @@ package body Interfaces.C is
return False;
end Is_Nul_Terminated;
+ -- Case of char16_array
+
+ function Is_Nul_Terminated (Item : char16_array) return Boolean is
+ begin
+ for J in Item'Range loop
+ if Item (J) = char16_nul then
+ return True;
+ end if;
+ end loop;
+
+ return False;
+ end Is_Nul_Terminated;
+
+ -- Case of char32_array
+
+ function Is_Nul_Terminated (Item : char32_array) return Boolean is
+ begin
+ for J in Item'Range loop
+ if Item (J) = char32_nul then
+ return True;
+ end if;
+ end loop;
+
+ return False;
+ end Is_Nul_Terminated;
+
------------
-- To_Ada --
------------
@@ -78,8 +104,7 @@ package body Interfaces.C is
function To_Ada
(Item : char_array;
- Trim_Nul : Boolean := True)
- return String
+ Trim_Nul : Boolean := True) return String
is
Count : Natural;
From : size_t;
@@ -119,10 +144,10 @@ package body Interfaces.C is
-- Convert char_array to String (procedure form)
procedure To_Ada
- (Item : char_array;
- Target : out String;
- Count : out Natural;
- Trim_Nul : Boolean := True)
+ (Item : char_array;
+ Target : out String;
+ Count : out Natural;
+ Trim_Nul : Boolean := True)
is
From : size_t;
To : Positive;
@@ -173,8 +198,7 @@ package body Interfaces.C is
function To_Ada
(Item : wchar_array;
- Trim_Nul : Boolean := True)
- return Wide_String
+ Trim_Nul : Boolean := True) return Wide_String
is
Count : Natural;
From : size_t;
@@ -214,13 +238,13 @@ package body Interfaces.C is
-- Convert wchar_array to Wide_String (procedure form)
procedure To_Ada
- (Item : wchar_array;
- Target : out Wide_String;
- Count : out Natural;
- Trim_Nul : Boolean := True)
+ (Item : wchar_array;
+ Target : out Wide_String;
+ Count : out Natural;
+ Trim_Nul : Boolean := True)
is
- From : size_t;
- To : Positive;
+ From : size_t;
+ To : Positive;
begin
if Trim_Nul then
@@ -254,7 +278,192 @@ package body Interfaces.C is
To := To + 1;
end loop;
end if;
+ end To_Ada;
+
+ -- Convert char16_t to Wide_Character
+
+ function To_Ada (Item : char16_t) return Wide_Character is
+ begin
+ return Wide_Character'Val (char16_t'Pos (Item));
+ end To_Ada;
+
+ -- Convert char16_array to Wide_String (function form)
+
+ function To_Ada
+ (Item : char16_array;
+ Trim_Nul : Boolean := True) return Wide_String
+ is
+ Count : Natural;
+ From : size_t;
+
+ begin
+ if Trim_Nul then
+ From := Item'First;
+
+ loop
+ if From > Item'Last then
+ raise Terminator_Error;
+ elsif Item (From) = char16_t'Val (0) then
+ exit;
+ else
+ From := From + 1;
+ end if;
+ end loop;
+
+ Count := Natural (From - Item'First);
+
+ else
+ Count := Item'Length;
+ end if;
+
+ declare
+ R : Wide_String (1 .. Count);
+
+ begin
+ for J in R'Range loop
+ R (J) := To_Ada (Item (size_t (J) + (Item'First - 1)));
+ end loop;
+
+ return R;
+ end;
+ end To_Ada;
+
+ -- Convert char16_array to Wide_String (procedure form)
+
+ procedure To_Ada
+ (Item : char16_array;
+ Target : out Wide_String;
+ Count : out Natural;
+ Trim_Nul : Boolean := True)
+ is
+ From : size_t;
+ To : Positive;
+
+ begin
+ if Trim_Nul then
+ From := Item'First;
+ loop
+ if From > Item'Last then
+ raise Terminator_Error;
+ elsif Item (From) = char16_t'Val (0) then
+ exit;
+ else
+ From := From + 1;
+ end if;
+ end loop;
+
+ Count := Natural (From - Item'First);
+
+ else
+ Count := Item'Length;
+ end if;
+
+ if Count > Target'Length then
+ raise Constraint_Error;
+
+ else
+ From := Item'First;
+ To := Target'First;
+
+ for J in 1 .. Count loop
+ Target (To) := To_Ada (Item (From));
+ From := From + 1;
+ To := To + 1;
+ end loop;
+ end if;
+ end To_Ada;
+
+ -- Convert char32_t to Wide_Wide_Character
+
+ function To_Ada (Item : char32_t) return Wide_Wide_Character is
+ begin
+ return Wide_Wide_Character'Val (char32_t'Pos (Item));
+ end To_Ada;
+
+ -- Convert char32_array to Wide_Wide_String (function form)
+
+ function To_Ada
+ (Item : char32_array;
+ Trim_Nul : Boolean := True) return Wide_Wide_String
+ is
+ Count : Natural;
+ From : size_t;
+
+ begin
+ if Trim_Nul then
+ From := Item'First;
+
+ loop
+ if From > Item'Last then
+ raise Terminator_Error;
+ elsif Item (From) = char32_t'Val (0) then
+ exit;
+ else
+ From := From + 1;
+ end if;
+ end loop;
+
+ Count := Natural (From - Item'First);
+
+ else
+ Count := Item'Length;
+ end if;
+
+ declare
+ R : Wide_Wide_String (1 .. Count);
+
+ begin
+ for J in R'Range loop
+ R (J) := To_Ada (Item (size_t (J) + (Item'First - 1)));
+ end loop;
+ return R;
+ end;
+ end To_Ada;
+
+ -- Convert char32_array to Wide_Wide_String (procedure form)
+
+ procedure To_Ada
+ (Item : char32_array;
+ Target : out Wide_Wide_String;
+ Count : out Natural;
+ Trim_Nul : Boolean := True)
+ is
+ From : size_t;
+ To : Positive;
+
+ begin
+ if Trim_Nul then
+ From := Item'First;
+ loop
+ if From > Item'Last then
+ raise Terminator_Error;
+ elsif Item (From) = char32_t'Val (0) then
+ exit;
+ else
+ From := From + 1;
+ end if;
+ end loop;
+
+ Count := Natural (From - Item'First);
+
+ else
+ Count := Item'Length;
+ end if;
+
+ if Count > Target'Length then
+ raise Constraint_Error;
+
+ else
+ From := Item'First;
+ To := Target'First;
+
+ for J in 1 .. Count loop
+ Target (To) := To_Ada (Item (From));
+ From := From + 1;
+ To := To + 1;
+ end loop;
+ end if;
end To_Ada;
----------
@@ -272,8 +481,7 @@ package body Interfaces.C is
function To_C
(Item : String;
- Append_Nul : Boolean := True)
- return char_array
+ Append_Nul : Boolean := True) return char_array
is
begin
if Append_Nul then
@@ -292,12 +500,11 @@ package body Interfaces.C is
-- Append_Nul False
else
-
- -- A nasty case, if the string is null, we must return
- -- a null char_array. The lower bound of this array is
- -- required to be zero (RM B.3(50)) but that is of course
- -- impossible given that size_t is unsigned. According to
- -- Ada 2005 AI-258, the result is to raise Constraint_Error.
+ -- A nasty case, if the string is null, we must return a null
+ -- char_array. The lower bound of this array is required to be zero
+ -- (RM B.3(50)) but that is of course impossible given that size_t
+ -- is unsigned. According to Ada 2005 AI-258, the result is to raise
+ -- Constraint_Error.
if Item'Length = 0 then
raise Constraint_Error;
@@ -365,8 +572,7 @@ package body Interfaces.C is
function To_C
(Item : Wide_String;
- Append_Nul : Boolean := True)
- return wchar_array
+ Append_Nul : Boolean := True) return wchar_array
is
begin
if Append_Nul then
@@ -383,23 +589,105 @@ package body Interfaces.C is
end;
else
- -- A nasty case, if the string is null, we must return
- -- a null char_array. The lower bound of this array is
- -- required to be zero (RM B.3(50)) but that is of course
- -- impossible given that size_t is unsigned. This needs
- -- ARG resolution, but for now GNAT returns bounds 1 .. 0
+ -- A nasty case, if the string is null, we must return a null
+ -- wchar_array. The lower bound of this array is required to be zero
+ -- (RM B.3(50)) but that is of course impossible given that size_t
+ -- is unsigned. According to Ada 2005 AI-258, the result is to raise
+ -- Constraint_Error.
if Item'Length = 0 then
+ raise Constraint_Error;
+
+ else
declare
- R : wchar_array (1 .. 0);
+ R : wchar_array (0 .. Item'Length - 1);
begin
+ for J in size_t range 0 .. Item'Length - 1 loop
+ R (J) := To_C (Item (Integer (J) + Item'First));
+ end loop;
+
return R;
end;
+ end if;
+ end if;
+ end To_C;
+
+ -- Convert Wide_String to wchar_array (procedure form)
+
+ procedure To_C
+ (Item : Wide_String;
+ Target : out wchar_array;
+ Count : out size_t;
+ Append_Nul : Boolean := True)
+ is
+ To : size_t;
+
+ begin
+ if Target'Length < Item'Length then
+ raise Constraint_Error;
+
+ else
+ To := Target'First;
+ for From in Item'Range loop
+ Target (To) := To_C (Item (From));
+ To := To + 1;
+ end loop;
+
+ if Append_Nul then
+ if To > Target'Last then
+ raise Constraint_Error;
+ else
+ Target (To) := wide_nul;
+ Count := Item'Length + 1;
+ end if;
+
+ else
+ Count := Item'Length;
+ end if;
+ end if;
+ end To_C;
+
+ -- Convert Wide_Character to char16_t
+
+ function To_C (Item : Wide_Character) return char16_t is
+ begin
+ return char16_t'Val (Wide_Character'Pos (Item));
+ end To_C;
+
+ -- Convert Wide_String to char16_array (function form)
+
+ function To_C
+ (Item : Wide_String;
+ Append_Nul : Boolean := True) return char16_array
+ is
+ begin
+ if Append_Nul then
+ declare
+ R : char16_array (0 .. Item'Length);
+
+ begin
+ for J in Item'Range loop
+ R (size_t (J - Item'First)) := To_C (Item (J));
+ end loop;
+
+ R (R'Last) := char16_t'Val (0);
+ return R;
+ end;
+
+ else
+ -- A nasty case, if the string is null, we must return a null
+ -- char16_array. The lower bound of this array is required to be zero
+ -- (RM B.3(50)) but that is of course impossible given that size_t
+ -- is unsigned. According to Ada 2005 AI-258, the result is to raise
+ -- Constraint_Error.
+
+ if Item'Length = 0 then
+ raise Constraint_Error;
else
declare
- R : wchar_array (0 .. Item'Length - 1);
+ R : char16_array (0 .. Item'Length - 1);
begin
for J in size_t range 0 .. Item'Length - 1 loop
@@ -412,11 +700,11 @@ package body Interfaces.C is
end if;
end To_C;
- -- Convert Wide_String to wchar_array (procedure form)
+ -- Convert Wide_String to char16_array (procedure form)
procedure To_C
(Item : Wide_String;
- Target : out wchar_array;
+ Target : out char16_array;
Count : out size_t;
Append_Nul : Boolean := True)
is
@@ -437,7 +725,94 @@ package body Interfaces.C is
if To > Target'Last then
raise Constraint_Error;
else
- Target (To) := wide_nul;
+ Target (To) := char16_t'Val (0);
+ Count := Item'Length + 1;
+ end if;
+
+ else
+ Count := Item'Length;
+ end if;
+ end if;
+ end To_C;
+
+ -- Convert Wide_Character to char32_t
+
+ function To_C (Item : Wide_Wide_Character) return char32_t is
+ begin
+ return char32_t'Val (Wide_Wide_Character'Pos (Item));
+ end To_C;
+
+ -- Convert Wide_Wide_String to char32_array (function form)
+
+ function To_C
+ (Item : Wide_Wide_String;
+ Append_Nul : Boolean := True) return char32_array
+ is
+ begin
+ if Append_Nul then
+ declare
+ R : char32_array (0 .. Item'Length);
+
+ begin
+ for J in Item'Range loop
+ R (size_t (J - Item'First)) := To_C (Item (J));
+ end loop;
+
+ R (R'Last) := char32_t'Val (0);
+ return R;
+ end;
+
+ else
+ -- A nasty case, if the string is null, we must return a null
+ -- char32_array. The lower bound of this array is required to be zero
+ -- (RM B.3(50)) but that is of course impossible given that size_t
+ -- is unsigned. According to Ada 2005 AI-258, the result is to raise
+ -- Constraint_Error.
+
+ if Item'Length = 0 then
+ raise Constraint_Error;
+
+ else
+ declare
+ R : char32_array (0 .. Item'Length - 1);
+
+ begin
+ for J in size_t range 0 .. Item'Length - 1 loop
+ R (J) := To_C (Item (Integer (J) + Item'First));
+ end loop;
+
+ return R;
+ end;
+ end if;
+ end if;
+ end To_C;
+
+ -- Convert Wide_Wide_String to char32_array (procedure form)
+
+ procedure To_C
+ (Item : Wide_Wide_String;
+ Target : out char32_array;
+ Count : out size_t;
+ Append_Nul : Boolean := True)
+ is
+ To : size_t;
+
+ begin
+ if Target'Length < Item'Length then
+ raise Constraint_Error;
+
+ else
+ To := Target'First;
+ for From in Item'Range loop
+ Target (To) := To_C (Item (From));
+ To := To + 1;
+ end loop;
+
+ if Append_Nul then
+ if To > Target'Last then
+ raise Constraint_Error;
+ else
+ Target (To) := char32_t'Val (0);
Count := Item'Length + 1;
end if;
diff --git a/gcc/ada/i-c.ads b/gcc/ada/i-c.ads
index bcd77a897e4..f264850589e 100644
--- a/gcc/ada/i-c.ads
+++ b/gcc/ada/i-c.ads
@@ -6,32 +6,10 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 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. --
+-- This specification is adapted from the Ada Reference Manual for use with --
+-- 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. --
-- --
------------------------------------------------------------------------------
@@ -104,26 +82,24 @@ pragma Pure (C);
function Is_Nul_Terminated (Item : in char_array) return Boolean;
function To_C
- (Item : in String;
- Append_Nul : in Boolean := True)
- return char_array;
+ (Item : String;
+ Append_Nul : Boolean := True) return char_array;
function To_Ada
- (Item : in char_array;
- Trim_Nul : in Boolean := True)
- return String;
+ (Item : char_array;
+ Trim_Nul : Boolean := True) return String;
procedure To_C
- (Item : in String;
+ (Item : String;
Target : out char_array;
Count : out size_t;
- Append_Nul : in Boolean := True);
+ Append_Nul : Boolean := True);
procedure To_Ada
- (Item : in char_array;
+ (Item : char_array;
Target : out String;
Count : out Natural;
- Trim_Nul : in Boolean := True);
+ Trim_Nul : Boolean := True);
------------------------------------
-- Wide Character and Wide String --
@@ -134,37 +110,121 @@ pragma Pure (C);
wide_nul : constant wchar_t := wchar_t'First;
- function To_C (Item : in Wide_Character) return wchar_t;
- function To_Ada (Item : in wchar_t) return Wide_Character;
+ function To_C (Item : Wide_Character) return wchar_t;
+ function To_Ada (Item : wchar_t) return Wide_Character;
type wchar_array is array (size_t range <>) of aliased wchar_t;
- function Is_Nul_Terminated (Item : in wchar_array) return Boolean;
+ function Is_Nul_Terminated (Item : wchar_array) return Boolean;
function To_C
- (Item : in Wide_String;
- Append_Nul : in Boolean := True)
- return wchar_array;
+ (Item : Wide_String;
+ Append_Nul : Boolean := True) return wchar_array;
function To_Ada
- (Item : in wchar_array;
- Trim_Nul : in Boolean := True)
- return Wide_String;
+ (Item : wchar_array;
+ Trim_Nul : Boolean := True) return Wide_String;
procedure To_C
- (Item : in Wide_String;
+ (Item : Wide_String;
Target : out wchar_array;
Count : out size_t;
- Append_Nul : in Boolean := True);
+ Append_Nul : Boolean := True);
procedure To_Ada
- (Item : in wchar_array;
+ (Item : wchar_array;
Target : out Wide_String;
Count : out Natural;
- Trim_Nul : in Boolean := True);
+ Trim_Nul : Boolean := True);
Terminator_Error : exception;
-private
- -- No private declarations required
+ -- The remaining declarations are for Ada 2005 (AI-285)
+
+ -- ISO/IEC 10646:2003 compatible types defined by SC22/WG14 document N1010
+
+ type char16_t is new Wide_Character;
+ pragma Ada_05 (char16_t);
+
+ char16_nul : constant char16_t := char16_t'Val (0);
+ pragma Ada_05 (char16_nul);
+
+ function To_C (Item : Wide_Character) return char16_t;
+ pragma Ada_05 (To_C);
+
+ function To_Ada (Item : char16_t) return Wide_Character;
+ pragma Ada_05 (To_Ada);
+
+ type char16_array is array (size_t range <>) of aliased char16_t;
+ pragma Ada_05 (char16_array);
+
+ function Is_Nul_Terminated (Item : char16_array) return Boolean;
+ pragma Ada_05 (Is_Nul_Terminated);
+
+ function To_C
+ (Item : Wide_String;
+ Append_Nul : Boolean := True) return char16_array;
+ pragma Ada_05 (To_C);
+
+ function To_Ada
+ (Item : char16_array;
+ Trim_Nul : Boolean := True) return Wide_String;
+ pragma Ada_05 (To_Ada);
+
+ procedure To_C
+ (Item : Wide_String;
+ Target : out char16_array;
+ Count : out size_t;
+ Append_Nul : Boolean := True);
+ pragma Ada_05 (To_C);
+
+ procedure To_Ada
+ (Item : char16_array;
+ Target : out Wide_String;
+ Count : out Natural;
+ Trim_Nul : Boolean := True);
+ pragma Ada_05 (To_Ada);
+
+ type char32_t is new Wide_Wide_Character;
+ pragma Ada_05 (char32_t);
+
+ char32_nul : constant char32_t := char32_t'Val (0);
+ pragma Ada_05 (char32_nul);
+
+ function To_C (Item : Wide_Wide_Character) return char32_t;
+ pragma Ada_05 (To_C);
+
+ function To_Ada (Item : char32_t) return Wide_Wide_Character;
+ pragma Ada_05 (To_Ada);
+
+ type char32_array is array (size_t range <>) of aliased char32_t;
+ pragma Ada_05 (char32_array);
+
+ function Is_Nul_Terminated (Item : char32_array) return Boolean;
+ pragma Ada_05 (Is_Nul_Terminated);
+
+ function To_C
+ (Item : Wide_Wide_String;
+ Append_Nul : Boolean := True) return char32_array;
+ pragma Ada_05 (To_C);
+
+ function To_Ada
+ (Item : char32_array;
+ Trim_Nul : Boolean := True) return Wide_Wide_String;
+ pragma Ada_05 (To_Ada);
+
+ procedure To_C
+ (Item : Wide_Wide_String;
+ Target : out char32_array;
+ Count : out size_t;
+ Append_Nul : Boolean := True);
+ pragma Ada_05 (To_C);
+
+ procedure To_Ada
+ (Item : char32_array;
+ Target : out Wide_Wide_String;
+ Count : out Natural;
+ Trim_Nul : Boolean := True);
+ pragma Ada_05 (To_Ada);
+
end Interfaces.C;
diff --git a/gcc/ada/i-cobol.adb b/gcc/ada/i-cobol.adb
index 38de23d8119..025e6b263b0 100644
--- a/gcc/ada/i-cobol.adb
+++ b/gcc/ada/i-cobol.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -107,8 +107,7 @@ package body Interfaces.COBOL is
function To_Display
(Item : Integer_64;
Format : Display_Format;
- Length : Natural)
- return Numeric;
+ Length : Natural) return Numeric;
-- This function converts the given integer value into display format,
-- using the given format, with the length in bytes of the result given
-- by the last parameter. This is the non-generic implementation of
@@ -118,8 +117,7 @@ package body Interfaces.COBOL is
function To_Packed
(Item : Integer_64;
Format : Packed_Format;
- Length : Natural)
- return Packed_Decimal;
+ Length : Natural) return Packed_Decimal;
-- This function converts the given integer value into packed format,
-- using the given format, with the length in digits of the result given
-- by the last parameter. This is the non-generic implementation of
@@ -128,15 +126,13 @@ package body Interfaces.COBOL is
function Valid_Numeric
(Item : Numeric;
- Format : Display_Format)
- return Boolean;
+ Format : Display_Format) return Boolean;
-- This is the non-generic implementation of Decimal_Conversions.Valid
-- for the display case.
function Valid_Packed
(Item : Packed_Decimal;
- Format : Packed_Format)
- return Boolean;
+ Format : Packed_Format) return Boolean;
-- This is the non-generic implementation of Decimal_Conversions.Valid
-- for the packed case.
@@ -146,8 +142,7 @@ package body Interfaces.COBOL is
function Binary_To_Decimal
(Item : Byte_Array;
- Format : Binary_Format)
- return Integer_64
+ Format : Binary_Format) return Integer_64
is
Len : constant Natural := Item'Length;
@@ -229,8 +224,7 @@ package body Interfaces.COBOL is
function Numeric_To_Decimal
(Item : Numeric;
- Format : Display_Format)
- return Integer_64
+ Format : Display_Format) return Integer_64
is
pragma Unsuppress (Range_Check);
Sign : COBOL_Character := COBOL_Plus;
@@ -288,8 +282,7 @@ package body Interfaces.COBOL is
function Packed_To_Decimal
(Item : Packed_Decimal;
- Format : Packed_Format)
- return Integer_64
+ Format : Packed_Format) return Integer_64
is
pragma Unsuppress (Range_Check);
Result : Integer_64 := 0;
@@ -449,8 +442,7 @@ package body Interfaces.COBOL is
function To_Display
(Item : Integer_64;
Format : Display_Format;
- Length : Natural)
- return Numeric
+ Length : Natural) return Numeric
is
Result : Numeric (1 .. Length);
Val : Integer_64 := Item;
@@ -560,8 +552,7 @@ package body Interfaces.COBOL is
function To_Packed
(Item : Integer_64;
Format : Packed_Format;
- Length : Natural)
- return Packed_Decimal
+ Length : Natural) return Packed_Decimal
is
Result : Packed_Decimal (1 .. Length);
Val : Integer_64;
@@ -628,8 +619,7 @@ package body Interfaces.COBOL is
function Valid_Numeric
(Item : Numeric;
- Format : Display_Format)
- return Boolean
+ Format : Display_Format) return Boolean
is
begin
if Item'Length = 0 then
@@ -681,8 +671,7 @@ package body Interfaces.COBOL is
function Valid_Packed
(Item : Packed_Decimal;
- Format : Packed_Format)
- return Boolean
+ Format : Packed_Format) return Boolean
is
begin
case Packed_Representation is
@@ -720,17 +709,13 @@ package body Interfaces.COBOL is
function Length (Format : Binary_Format) return Natural is
pragma Warnings (Off, Format);
-
begin
if Num'Digits <= 2 then
return 1;
-
elsif Num'Digits <= 4 then
return 2;
-
elsif Num'Digits <= 9 then
return 4;
-
else -- Num'Digits in 10 .. 18
return 8;
end if;
@@ -756,8 +741,7 @@ package body Interfaces.COBOL is
-- Note that the tests here are all compile time checks
function Length
- (Format : Packed_Format)
- return Natural
+ (Format : Packed_Format) return Natural
is
pragma Warnings (Off, Format);
@@ -774,8 +758,7 @@ package body Interfaces.COBOL is
function To_Binary
(Item : Num;
- Format : Binary_Format)
- return Byte_Array
+ Format : Binary_Format) return Byte_Array
is
begin
-- Note: all these tests are compile time tests
@@ -824,7 +807,6 @@ package body Interfaces.COBOL is
pragma Unsuppress (Range_Check);
begin
return Binary'Integer_Value (Item);
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -836,14 +818,11 @@ package body Interfaces.COBOL is
function To_Decimal
(Item : Byte_Array;
- Format : Binary_Format)
- return Num
+ Format : Binary_Format) return Num
is
pragma Unsuppress (Range_Check);
-
begin
return Num'Fixed_Value (Binary_To_Decimal (Item, Format));
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -855,10 +834,8 @@ package body Interfaces.COBOL is
function To_Decimal (Item : Binary) return Num is
pragma Unsuppress (Range_Check);
-
begin
return Num'Fixed_Value (Item);
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -889,10 +866,8 @@ package body Interfaces.COBOL is
function To_Decimal (Item : Long_Binary) return Num is
pragma Unsuppress (Range_Check);
-
begin
return Num'Fixed_Value (Item);
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -904,14 +879,11 @@ package body Interfaces.COBOL is
function To_Decimal
(Item : Packed_Decimal;
- Format : Packed_Format)
- return Num
+ Format : Packed_Format) return Num
is
pragma Unsuppress (Range_Check);
-
begin
return Num'Fixed_Value (Packed_To_Decimal (Item, Format));
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -923,18 +895,15 @@ package body Interfaces.COBOL is
function To_Display
(Item : Num;
- Format : Display_Format)
- return Numeric
+ Format : Display_Format) return Numeric
is
pragma Unsuppress (Range_Check);
-
begin
return
To_Display
(Integer_64'Integer_Value (Item),
Format,
Length (Format));
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -946,10 +915,8 @@ package body Interfaces.COBOL is
function To_Long_Binary (Item : Num) return Long_Binary is
pragma Unsuppress (Range_Check);
-
begin
return Long_Binary'Integer_Value (Item);
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -961,18 +928,15 @@ package body Interfaces.COBOL is
function To_Packed
(Item : Num;
- Format : Packed_Format)
- return Packed_Decimal
+ Format : Packed_Format) return Packed_Decimal
is
pragma Unsuppress (Range_Check);
-
begin
return
To_Packed
(Integer_64'Integer_Value (Item),
Format,
Length (Format));
-
exception
when Constraint_Error =>
raise Conversion_Error;
@@ -984,16 +948,13 @@ package body Interfaces.COBOL is
function Valid
(Item : Byte_Array;
- Format : Binary_Format)
- return Boolean
+ Format : Binary_Format) return Boolean
is
Val : Num;
pragma Unreferenced (Val);
-
begin
Val := To_Decimal (Item, Format);
return True;
-
exception
when Conversion_Error =>
return False;
@@ -1005,8 +966,7 @@ package body Interfaces.COBOL is
function Valid
(Item : Numeric;
- Format : Display_Format)
- return Boolean
+ Format : Display_Format) return Boolean
is
begin
return Valid_Numeric (Item, Format);
@@ -1018,8 +978,7 @@ package body Interfaces.COBOL is
function Valid
(Item : Packed_Decimal;
- Format : Packed_Format)
- return Boolean
+ Format : Packed_Format) return Boolean
is
begin
return Valid_Packed (Item, Format);
diff --git a/gcc/ada/i-cpp.adb b/gcc/ada/i-cpp.adb
index 24015f10d0b..7eaa2197b9f 100644
--- a/gcc/ada/i-cpp.adb
+++ b/gcc/ada/i-cpp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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,10 +34,33 @@
with Ada.Tags; use Ada.Tags;
with System; use System;
with System.Storage_Elements; use System.Storage_Elements;
-with Unchecked_Conversion;
package body Interfaces.CPP is
+-- Structure of the Dispatch Table
+
+-- +-----------------------+
+-- | Offset_To_Top |
+-- +-----------------------+
+-- | Typeinfo_Ptr/TSD_Ptr |----> Type Specific Data
+-- Tag ---> +-----------------------+ +-------------------+
+-- | table of | | inheritance depth |
+-- : primitive ops : +-------------------+
+-- | pointers | | expanded name |
+-- +-----------------------+ +-------------------+
+-- | external tag |
+-- +-------------------+
+-- | Hash table link |
+-- +-------------------+
+-- | Remotely Callable |
+-- +-------------------+
+-- | Rec Ctrler offset |
+-- +-------------------+
+-- | table of |
+-- : ancestor :
+-- | tags |
+-- +-------------------+
+
-- The declarations below need (extensive) comments ???
subtype Cstring is String (Positive);
@@ -57,27 +80,32 @@ package body Interfaces.CPP is
Pfn : System.Address;
end record;
- type Type_Specific_Data_Ptr is access all Type_Specific_Data;
type Vtable_Entry_Array is array (Positive range <>) of Vtable_Entry;
type VTable is record
- Prims_Ptr : Vtable_Entry_Array (Positive);
- TSD : Type_Specific_Data_Ptr;
+ -- Offset_To_Top : Integer;
+ -- Typeinfo_Ptr : System.Address; -- TSD is currently also here???
+ Prims_Ptr : Vtable_Entry_Array (Positive);
end record;
+ -- Note: See comment in a-tags.adb explaining why the components
+ -- Offset_To_Top and Typeinfo_Ptr have been commented out.
+ -- -----------------------------------------------------------------------
+ -- The size of the Prims_Ptr array actually depends on the tagged type to
+ -- which it applies. For each tagged type, the expander computes the
+ -- actual array size, allocates the Dispatch_Table record accordingly, and
+ -- generates code that displaces the base of the record after the
+ -- Typeinfo_Ptr component. For this reason the first two components have
+ -- been commented in the previous declaration. The access to these
+ -- components is done by means of local functions.
- --------------------------------------------------------
- -- Unchecked Conversions for Tag, Vtable_Ptr, and TSD --
- --------------------------------------------------------
-
- function To_Type_Specific_Data_Ptr is
- new Unchecked_Conversion (Address, Type_Specific_Data_Ptr);
+ ---------------------------
+ -- Unchecked Conversions --
+ ---------------------------
- function To_Address is
- new Unchecked_Conversion (Type_Specific_Data_Ptr, Address);
+ type Int_Ptr is access Integer;
- ---------------------------------------------
- -- Unchecked Conversions for String Fields --
- ---------------------------------------------
+ function To_Int_Ptr is
+ new Unchecked_Conversion (System.Address, Int_Ptr);
function To_Cstring_Ptr is
new Unchecked_Conversion (Address, Cstring_Ptr);
@@ -90,8 +118,20 @@ package body Interfaces.CPP is
-----------------------
function Length (Str : Cstring_Ptr) return Natural;
- -- Length of string represented by the given pointer (treating the
- -- string as a C-style string, which is Nul terminated).
+ -- Length of string represented by the given pointer (treating the string
+ -- as a C-style string, which is Nul terminated).
+
+ function Offset_To_Top (T : Vtable_Ptr) return Integer;
+ -- Returns the current value of the offset_to_top component available in
+ -- the prologue of the dispatch table.
+
+ function Typeinfo_Ptr (T : Vtable_Ptr) return System.Address;
+ -- Returns the current value of the typeinfo_ptr component available in
+ -- the prologue of the dispatch table.
+
+ pragma Unreferenced (Offset_To_Top);
+ pragma Unreferenced (Typeinfo_Ptr);
+ -- These functions will be used for full compatibility with the C++ ABI
-----------------------
-- CPP_CW_Membership --
@@ -101,9 +141,9 @@ package body Interfaces.CPP is
(Obj_Tag : Vtable_Ptr;
Typ_Tag : Vtable_Ptr) return Boolean
is
- Pos : constant Integer := Obj_Tag.TSD.Idepth - Typ_Tag.TSD.Idepth;
+ Pos : constant Integer := TSD (Obj_Tag).Idepth - TSD (Typ_Tag).Idepth;
begin
- return Pos >= 0 and then Obj_Tag.TSD.Ancestor_Tags (Pos) = Typ_Tag;
+ return Pos >= 0 and then TSD (Obj_Tag).Ancestor_Tags (Pos) = Typ_Tag;
end CPP_CW_Membership;
---------------------------
@@ -112,7 +152,7 @@ package body Interfaces.CPP is
function CPP_Get_Expanded_Name (T : Vtable_Ptr) return Address is
begin
- return To_Address (T.TSD.Expanded_Name);
+ return To_Address (TSD (T).Expanded_Name);
end CPP_Get_Expanded_Name;
--------------------------
@@ -121,7 +161,7 @@ package body Interfaces.CPP is
function CPP_Get_External_Tag (T : Vtable_Ptr) return Address is
begin
- return To_Address (T.TSD.External_Tag);
+ return To_Address (TSD (T).External_Tag);
end CPP_Get_External_Tag;
-------------------------------
@@ -130,7 +170,7 @@ package body Interfaces.CPP is
function CPP_Get_Inheritance_Depth (T : Vtable_Ptr) return Natural is
begin
- return T.TSD.Idepth;
+ return TSD (T).Idepth;
end CPP_Get_Inheritance_Depth;
-------------------------
@@ -170,8 +210,11 @@ package body Interfaces.CPP is
-----------------
function CPP_Get_TSD (T : Vtable_Ptr) return Address is
+ use type System.Storage_Elements.Storage_Offset;
+ TSD_Ptr : constant Addr_Ptr :=
+ To_Addr_Ptr (To_Address (T) - CPP_DT_Typeinfo_Ptr_Size);
begin
- return To_Address (T.TSD);
+ return TSD_Ptr.all;
end CPP_Get_TSD;
--------------------
@@ -198,21 +241,22 @@ package body Interfaces.CPP is
(Old_TSD : Address;
New_Tag : Vtable_Ptr)
is
- TSD : constant Type_Specific_Data_Ptr :=
- To_Type_Specific_Data_Ptr (Old_TSD);
+ Old_TSD_Ptr : constant Type_Specific_Data_Ptr :=
+ To_Type_Specific_Data_Ptr (Old_TSD);
- New_TSD : Type_Specific_Data renames New_Tag.TSD.all;
+ New_TSD_Ptr : constant Type_Specific_Data_Ptr :=
+ TSD (New_Tag);
begin
- if TSD /= null then
- New_TSD.Idepth := TSD.Idepth + 1;
- New_TSD.Ancestor_Tags (1 .. New_TSD.Idepth)
- := TSD.Ancestor_Tags (0 .. TSD.Idepth);
+ if Old_TSD_Ptr /= null then
+ New_TSD_Ptr.Idepth := Old_TSD_Ptr.Idepth + 1;
+ New_TSD_Ptr.Ancestor_Tags (1 .. New_TSD_Ptr.Idepth) :=
+ Old_TSD_Ptr.Ancestor_Tags (0 .. Old_TSD_Ptr.Idepth);
else
- New_TSD.Idepth := 0;
+ New_TSD_Ptr.Idepth := 0;
end if;
- New_TSD.Ancestor_Tags (0) := New_Tag;
+ New_TSD_Ptr.Ancestor_Tags (0) := New_Tag;
end CPP_Inherit_TSD;
---------------------------
@@ -221,7 +265,7 @@ package body Interfaces.CPP is
procedure CPP_Set_Expanded_Name (T : Vtable_Ptr; Value : Address) is
begin
- T.TSD.Expanded_Name := To_Cstring_Ptr (Value);
+ TSD (T).Expanded_Name := To_Cstring_Ptr (Value);
end CPP_Set_Expanded_Name;
--------------------------
@@ -230,7 +274,7 @@ package body Interfaces.CPP is
procedure CPP_Set_External_Tag (T : Vtable_Ptr; Value : Address) is
begin
- T.TSD.External_Tag := To_Cstring_Ptr (Value);
+ TSD (T).External_Tag := To_Cstring_Ptr (Value);
end CPP_Set_External_Tag;
-------------------------------
@@ -242,7 +286,7 @@ package body Interfaces.CPP is
Value : Natural)
is
begin
- T.TSD.Idepth := Value;
+ TSD (T).Idepth := Value;
end CPP_Set_Inheritance_Depth;
-----------------------------
@@ -285,8 +329,11 @@ package body Interfaces.CPP is
-----------------
procedure CPP_Set_TSD (T : Vtable_Ptr; Value : Address) is
+ use type System.Storage_Elements.Storage_Offset;
+ TSD_Ptr : constant Addr_Ptr :=
+ To_Addr_Ptr (To_Address (T) - CPP_DT_Typeinfo_Ptr_Size);
begin
- T.TSD := To_Type_Specific_Data_Ptr (Value);
+ TSD_Ptr.all := Value;
end CPP_Set_TSD;
--------------------
@@ -314,7 +361,7 @@ package body Interfaces.CPP is
-------------------
function Expanded_Name (T : Vtable_Ptr) return String is
- Result : constant Cstring_Ptr := T.TSD.Expanded_Name;
+ Result : constant Cstring_Ptr := TSD (T).Expanded_Name;
begin
return Result (1 .. Length (Result));
end Expanded_Name;
@@ -324,7 +371,7 @@ package body Interfaces.CPP is
------------------
function External_Tag (T : Vtable_Ptr) return String is
- Result : constant Cstring_Ptr := T.TSD.External_Tag;
+ Result : constant Cstring_Ptr := TSD (T).External_Tag;
begin
return Result (1 .. Length (Result));
end External_Tag;
@@ -344,4 +391,38 @@ package body Interfaces.CPP is
return Len - 1;
end Length;
+ ------------------
+ -- Offset_To_Top --
+ ------------------
+
+ function Offset_To_Top (T : Vtable_Ptr) return Integer is
+ use type System.Storage_Elements.Storage_Offset;
+
+ TSD_Ptr : constant Int_Ptr
+ := To_Int_Ptr (To_Address (T) - CPP_DT_Prologue_Size);
+ begin
+ return TSD_Ptr.all;
+ end Offset_To_Top;
+
+ ------------------
+ -- Typeinfo_Ptr --
+ ------------------
+
+ function Typeinfo_Ptr (T : Vtable_Ptr) return System.Address is
+ use type System.Storage_Elements.Storage_Offset;
+ TSD_Ptr : constant Addr_Ptr :=
+ To_Addr_Ptr (To_Address (T) - CPP_DT_Typeinfo_Ptr_Size);
+ begin
+ return TSD_Ptr.all;
+ end Typeinfo_Ptr;
+
+ ---------
+ -- TSD --
+ ---------
+
+ function TSD (T : Vtable_Ptr) return Type_Specific_Data_Ptr is
+ begin
+ return To_Type_Specific_Data_Ptr (CPP_Get_TSD (T));
+ end TSD;
+
end Interfaces.CPP;
diff --git a/gcc/ada/i-cpp.ads b/gcc/ada/i-cpp.ads
index a53c38b2242..df39bdb4df0 100644
--- a/gcc/ada/i-cpp.ads
+++ b/gcc/ada/i-cpp.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -45,18 +45,25 @@
with System;
with System.Storage_Elements;
+with Unchecked_Conversion;
package Interfaces.CPP is
- package S renames System;
- package SSE renames System.Storage_Elements;
-
type Vtable_Ptr is private;
function Expanded_Name (T : Vtable_Ptr) return String;
function External_Tag (T : Vtable_Ptr) return String;
private
+ package S renames System;
+ package SSE renames System.Storage_Elements;
+
+ type Vtable;
+ type Vtable_Ptr is access all Vtable;
+
+ type Type_Specific_Data;
+ type Type_Specific_Data_Ptr is access all Type_Specific_Data;
+
-- These subprograms are in the private part. They are never accessed
-- directly except from compiler generated code, which has access to
-- private components of packages via the Rtsfind interface.
@@ -98,9 +105,14 @@ private
CPP_DT_Prologue_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
- (1 * (Standard'Address_Size / S.Storage_Unit));
+ (2 * (Standard'Address_Size / S.Storage_Unit));
-- Size of the first part of the dispatch table
+ CPP_DT_Typeinfo_Ptr_Size : constant SSE.Storage_Count :=
+ SSE.Storage_Count
+ (Standard'Address_Size / System.Storage_Unit);
+ -- Size of the Typeinfo_Ptr field of the Dispatch Table.
+
CPP_DT_Entry_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
(1 * (Standard'Address_Size / S.Storage_Unit));
@@ -174,8 +186,21 @@ private
-- compatible with MI.
-- (used for virtual function calls)
- type Vtable;
- type Vtable_Ptr is access all Vtable;
+ function TSD (T : Vtable_Ptr) return Type_Specific_Data_Ptr;
+ -- This function is conceptually equivalent to Get_TSD, but
+ -- returning a Type_Specific_Data_Ptr type (rather than an Address)
+ -- simplifies the implementation of the other subprograms.
+
+ type Addr_Ptr is access System.Address;
+
+ function To_Address is
+ new Unchecked_Conversion (Vtable_Ptr, System.Address);
+
+ function To_Addr_Ptr is
+ new Unchecked_Conversion (System.Address, Addr_Ptr);
+
+ function To_Type_Specific_Data_Ptr is
+ new Unchecked_Conversion (System.Address, Type_Specific_Data_Ptr);
pragma Inline (CPP_Set_Prim_Op_Address);
pragma Inline (CPP_Get_Prim_Op_Address);
@@ -192,5 +217,6 @@ private
pragma Inline (CPP_Set_Remotely_Callable);
pragma Inline (CPP_Get_Remotely_Callable);
pragma Inline (Displaced_This);
+ pragma Inline (TSD);
end Interfaces.CPP;
diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb
index d2e1d5daea3..2202ac3a14e 100644
--- a/gcc/ada/impunit.adb
+++ b/gcc/ada/impunit.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2005 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- --
@@ -26,25 +26,29 @@
with Lib; use Lib;
with Namet; use Namet;
-with Opt; use Opt;
package body Impunit is
subtype File_Name_8 is String (1 .. 8);
type File_List is array (Nat range <>) of File_Name_8;
- -- The following is a giant string containing the concenated names
- -- of all non-implementation internal files, i.e. the complete list
- -- of files for internal units which a program may legitimately WITH.
+ ------------------
+ -- Ada 95 Units --
+ ------------------
- -- Note that this list should match the list of units documented in
- -- the "GNAT Library" section of the GNAT Reference Manual.
+ -- 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.
- Non_Imp_File_Names : constant File_List := (
+ -- Note that this list should match the list of units documented in the
+ -- "GNAT Library" section of the GNAT Reference Manual.
- -----------------------------------------------
- -- Ada Hierarchy Units from Reference Manual --
- -----------------------------------------------
+ Non_Imp_File_Names_95 : constant File_List := (
+
+ ------------------------------------------------------
+ -- Ada Hierarchy Units from Ada-83 Reference Manual --
+ ------------------------------------------------------
"a-astaco", -- Ada.Asynchronous_Task_Control
"a-calend", -- Ada.Calendar
@@ -53,7 +57,6 @@ package body Impunit is
"a-chlat1", -- Ada.Characters.Latin_1
"a-comlin", -- Ada.Command_Line
"a-decima", -- Ada.Decimal
- "a-direct", -- Ada.Directories
"a-direio", -- Ada.Direct_IO
"a-dynpri", -- Ada.Dynamic_Priorities
"a-except", -- Ada.Exceptions
@@ -144,6 +147,7 @@ package body Impunit is
"a-cwila9", -- Ada.Characters.Wide_Latin_9
"a-diocst", -- Ada.Direct_IO.C_Streams
"a-einuoc", -- Ada.Exceptions.Is_Null_Occurrence
+ "a-elchha", -- Ada.Exceptions.Last_Chance_Handler
"a-exctra", -- Ada.Exceptions.Traceback
"a-siocst", -- Ada.Sequential_IO.C_Streams
"a-ssicst", -- Ada.Streams.Stream_IO.C_Streams
@@ -305,32 +309,126 @@ package body Impunit is
"s-wchcnv", -- System.Wch_Cnv
"s-wchcon"); -- System.Wch_Con
- -------------------------
- -- Implementation_Unit --
- -------------------------
+ --------------------
+ -- Ada 2005 Units --
+ --------------------
+
+ -- The following units should be used only in Ada 05 mode
+
+ Non_Imp_File_Names_05 : constant File_List := (
+
+ --------------------------------------------------------
+ -- Ada Hierarchy Units from Ada 2005 Reference Manual --
+ --------------------------------------------------------
+
+ "a-cdlili", -- Ada.Containers.Doubly_Linked_Lists
+ "a-cgaaso", -- Ada.Containers.Generic_Anonymous_Array_Sort
+ "a-cgarso", -- Ada.Containers.Generic_Array_Sort
+ "a-cgcaso", -- Ada.Containers.Generic_Constrained_Array_Sort
+ "a-chtgke", -- Ada.Containers.Hash_Tables.Generic_Keys
+ "a-chtgop", -- Ada.Containers.Hash_Tables.Generic_Operations
+ "a-cidlli", -- Ada.Containers.Indefinite_Doubly_Linked_Lists
+ "a-cihama", -- Ada.Containers.Indefinite_Hashed_Maps
+ "a-cihase", -- Ada.Containers.Indefinite_Hashed_Sets
+ "a-ciorma", -- Ada.Containers.Indefinite_Ordered_Maps
+ "a-ciormu", -- Ada.Containers.Indefinite_Ordered_Multisets
+ "a-ciorse", -- Ada.Containers.Indefinite_Ordered_Sets
+ "a-cohama", -- Ada.Containers.Hashed_Maps
+ "a-cohase", -- Ada.Containers.Hashed_Sets
+ "a-cohata", -- Ada.Containers.Hash_Tables
+ "a-coinve", -- Ada.Containers.Indefinite_Vectors
+ "a-contai", -- Ada.Containers
+ "a-convec", -- Ada.Containers.Vectors
+ "a-coorma", -- Ada.Containers.Ordered_Maps
+ "a-coormu", -- Ada.Containers.Ordered_Multisets
+ "a-coorse", -- Ada.Containers.Ordered_Sets
+ "a-coprnu", -- Ada.Containers.Prime_Numbers
+ "a-crbltr", -- Ada.Containers.Red_Black_Trees
+ "a-crbtgk", -- Ada.Containers.Red_Black_Trees.Generic_Keys
+ "a-crbtgo", -- Ada.Containers.Red_Black_Trees.Generic_Operations
+ "a-direct", -- Ada.Directories
+ "a-rbtgso", -- Ada.Containers.Red_Black_Trees.Generic_Set_Operations
+ "a-secain", -- Ada.Strings.Equal_Case_Insensitive
+ "a-shcain", -- Ada.Strings.Hash_Case_Insensitive
+ "a-slcain", -- Ada.Strings.Less_Case_Insensitive
+ "a-strhas", -- Ada.Strings.Hash
+ "a-stunha", -- Ada.Strings.Unbounded.Hash
+ "a-stwiha", -- Ada.Strings.Wide_Hash
+ "a-stzbou", -- Ada.Strings.Wide_Wide_Bounded
+ "a-stzfix", -- Ada.Strings.Wide_Wide_Fixed
+ "a-stzhas", -- Ada.Strings.Wide_Wide_Hash
+ "a-stzmap", -- Ada.Strings.Wide_Wide_Maps
+ "a-stzunb", -- Ada.Strings.Wide_Wide_Unbounded
+ "a-swunha", -- Ada.Strings.Wide_Unbounded.Hash
+ "a-szmzco", -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants;
+ "a-szunha", -- Ada.Strings.Wide_Wide_Unbounded.Hash
+ "a-tiunio", -- Ada.Text_IO.Unbounded_IO;
+ "a-wwunio", -- Ada.Wide_Text_IO.Wide_Unbounded_IO;
+ "a-zttest", -- Ada.Wide_Wide_Text_IO.Text_Streams
+ "a-ztexio", -- Ada.Wide_Wide_Text_IO
+ "a-zzunio", -- Ada.Wide_Wide_Text_IO.Wide_Wide_Unbounded_IO
+
+ ------------------------------------------------------
+ -- RM Required Additions to Ada 2005 for GNAT Types --
+ ------------------------------------------------------
+
+ "a-lfztio", -- Ada.Long_Float_Wide_Wide_Text_IO
+ "a-liztio", -- Ada.Long_Integer_Wide_Wide_Text_IO
+ "a-llfzti", -- Ada.Long_Long_Float_Wide_Wide_Text_IO
+ "a-llizti", -- Ada.Long_Long_Integer_Wide_Wide_Text_IO
+ "a-sfztio", -- Ada.Short_Float_Wide_Wide_Text_IO
+ "a-siztio", -- Ada.Short_Integer_Wide_Wide_Text_IO
+ "a-ssizti", -- Ada.Short_Short_Integer_Wide_Wide_Text_IO
+ "a-ztcstr", -- Ada.Wide_Wide_Text_IO.C_Streams
+
+ ----------------------------------------
+ -- GNAT Defined Additions to Ada 2005 --
+ ----------------------------------------
+
+ "a-chzla1", -- Ada.Characters.Wide_Wide_Latin_1
+ "a-chzla9", -- Ada.Characters.Wide_Wide_Latin_9
+ "a-szuzti", -- Ada.Strings.Wide_Wide_Unbounded.Wide_Wide_Text_IO
- function Implementation_Unit (U : Unit_Number_Type) return Boolean is
- Fname : constant File_Name_Type := Unit_File_Name (U);
+ ---------------------------
+ -- GNAT Special IO Units --
+ ---------------------------
- begin
- -- All units are OK in GNAT mode
+ -- See Ada 95 section for further information. These packages are for the
+ -- implementation of the Wide_Wide_Text_IO generic packages.
- if GNAT_Mode then
- return False;
- end if;
+ "a-ztdeio", -- Ada.Wide_Wide_Text_IO.Decimal_IO
+ "a-ztenio", -- Ada.Wide_Wide_Text_IO.Enumeration_IO
+ "a-ztfiio", -- Ada.Wide_Wide_Text_IO.Fixed_IO
+ "a-ztflio", -- Ada.Wide_Wide_Text_IO.Float_IO
+ "a-ztinio", -- Ada.Wide_Wide_Text_IO.Integer_IO
+ "a-ztmoio", -- Ada.Wide_Wide_Text_IO.Modular_IO
- -- If length of file name is greater than 12, definitely OK!
+ ------------------------
+ -- GNAT Library Units --
+ ------------------------
+
+ "g-zstspl"); -- GNAT.Wide_Wide_String_Split
+
+ ----------------------
+ -- Get_Kind_Of_Unit --
+ ----------------------
+
+ function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit is
+ Fname : constant File_Name_Type := Unit_File_Name (U);
+
+ begin
+ -- If length of file name is greater than 12, not predefined.
-- The value 12 here is an 8 char name with extension .ads.
if Length_Of_Name (Fname) > 12 then
- return False;
+ return Not_Predefined_Unit;
end if;
-- Otherwise test file name
Get_Name_String (Fname);
- -- Definitely OK if file name does not start with a- g- s- i-
+ -- Not predefined if file name does not start with a- g- s- i-
if Name_Len < 3
or else Name_Buffer (2) /= '-'
@@ -342,14 +440,14 @@ package body Impunit is
and then
Name_Buffer (1) /= 's')
then
- return False;
+ return Not_Predefined_Unit;
end if;
- -- Definitely OK if file name does not end in .ads. This can
+ -- Not predefined if file name does not end in .ads. This can
-- happen when non-standard file names are being used.
if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads" then
- return False;
+ return Not_Predefined_Unit;
end if;
-- Otherwise normalize file name to 8 characters
@@ -360,42 +458,48 @@ package body Impunit is
Name_Buffer (Name_Len) := ' ';
end loop;
- -- Definitely OK if name is in list
+ -- See if name is in 95 list
- for J in Non_Imp_File_Names'Range loop
- if Name_Buffer (1 .. 8) = Non_Imp_File_Names (J) then
- return False;
+ for J in Non_Imp_File_Names_95'Range loop
+ if Name_Buffer (1 .. 8) = Non_Imp_File_Names_95 (J) then
+ return Ada_95_Unit;
end if;
end loop;
- -- Only remaining special possibilities are children of
- -- System.RPC and System.Garlic and special files of the
- -- form System.Aux...
+ -- See if name is in 05 list
+
+ for J in Non_Imp_File_Names_05'Range loop
+ if Name_Buffer (1 .. 8) = Non_Imp_File_Names_05 (J) then
+ return Ada_05_Unit;
+ end if;
+ end loop;
+
+ -- Only remaining special possibilities are children of System.RPC and
+ -- System.Garlic and special files of the form System.Aux...
Get_Name_String (Unit_Name (U));
if Name_Len > 12
and then Name_Buffer (1 .. 11) = "system.rpc."
then
- return False;
+ return Ada_95_Unit;
end if;
if Name_Len > 15
and then Name_Buffer (1 .. 14) = "system.garlic."
then
- return False;
+ return Ada_95_Unit;
end if;
if Name_Len > 11
and then Name_Buffer (1 .. 10) = "system.aux"
then
- return False;
+ return Ada_95_Unit;
end if;
-- All tests failed, this is definitely an implementation unit
- return True;
-
- end Implementation_Unit;
+ return Implementation_Unit;
+ end Get_Kind_Of_Unit;
end Impunit;
diff --git a/gcc/ada/impunit.ads b/gcc/ada/impunit.ads
index 02917ccd8d8..075772b7323 100644
--- a/gcc/ada/impunit.ads
+++ b/gcc/ada/impunit.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000 Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2005 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- --
@@ -26,17 +26,36 @@
-- This package contains data and functions used to determine if a given
-- unit is an internal unit intended only for use by the implementation
--- and which should not be directly WITH'ed by user code.
+-- and which should not be directly WITH'ed by user code. It also checks
+-- for Ada 05 units that should only be WITH'ed in Ada 05 mode.
with Types; use Types;
package Impunit is
- function Implementation_Unit (U : Unit_Number_Type) return Boolean;
- -- Given the unit number of a unit, this function determines if it is a
- -- unit that is intended to be used only internally by the implementation.
- -- This is used for posting warnings for improper WITH's of such units
- -- (such WITH's are allowed without warnings only in GNAT_Mode set by
- -- the use of -gnatg). True is returned if a warning should be posted.
+ type Kind_Of_Unit is
+ (Implementation_Unit,
+ -- Unit from predefined library intended to be used only by the
+ -- compiler generated code, or from the implementation of the run time.
+ -- Use of such a unit generates a warning unless the client is compiled
+ -- with the -gnatg switch. If we are being super strict, this should be
+ -- an error for the case of Ada units, but that seems over strenuous.
+
+ Not_Predefined_Unit,
+ -- This is not a predefined unit, so no checks are needed
+
+ Ada_95_Unit,
+ -- This unit is defined in the Ada 95 RM, and can be freely with'ed
+ -- in both Ada 95 mode and Ada 05 mode. Note that in Ada 83 mode, no
+ -- child units are allowed, so you can't even name such a unit.
+
+ Ada_05_Unit);
+ -- This unit is defined in the Ada 05 RM. Withing this unit from a
+ -- Ada 95 mode program will generate a warning (again, strictly speaking
+ -- this should be an error, but that seems over-strenuous).
+
+ function Get_Kind_Of_Unit (U : Unit_Number_Type) return Kind_Of_Unit;
+ -- Given the unit number of a unit, this function determines the type
+ -- of the unit, as defined above.
end Impunit;
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 7858a2bec5c..e41c509c18e 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2005 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -403,7 +403,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
@@ -418,7 +418,7 @@ extern void __gnat_install_handler (void);
/* For RTEMS, each bsp will provide a custom __gnat_install_handler (). */
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
__gnat_install_handler ();
}
@@ -543,7 +543,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
@@ -657,7 +657,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
@@ -806,7 +806,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
@@ -817,142 +817,27 @@ __gnat_initialize (void)
#elif defined (__MINGW32__)
#include <windows.h>
-static LONG WINAPI __gnat_error_handler (PEXCEPTION_POINTERS);
-
-/* __gnat_initialize (mingw32). */
-
-static LONG WINAPI
-__gnat_error_handler (PEXCEPTION_POINTERS info)
-{
- struct Exception_Data *exception;
- const char *msg;
-
- switch (info->ExceptionRecord->ExceptionCode)
- {
- case EXCEPTION_ACCESS_VIOLATION:
- /* If the failing address isn't maximally-aligned or if the page
- before the faulting page is not accessible, this is a program error.
- */
- if ((info->ExceptionRecord->ExceptionInformation[1] & 3) != 0
- || IsBadCodePtr
- ((void *)(info->ExceptionRecord->ExceptionInformation[1] + 4096)))
- {
- exception = &program_error;
- msg = "EXCEPTION_ACCESS_VIOLATION";
- }
- else
- {
- /* otherwise it is a stack overflow */
- exception = &storage_error;
- msg = "stack overflow (or erroneous memory access)";
- }
- break;
-
- case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
- exception = &constraint_error;
- msg = "EXCEPTION_ARRAY_BOUNDS_EXCEEDED";
- break;
-
- case EXCEPTION_DATATYPE_MISALIGNMENT:
- exception = &constraint_error;
- msg = "EXCEPTION_DATATYPE_MISALIGNMENT";
- break;
-
- case EXCEPTION_FLT_DENORMAL_OPERAND:
- exception = &constraint_error;
- msg = "EXCEPTION_FLT_DENORMAL_OPERAND";
- break;
-
- case EXCEPTION_FLT_DIVIDE_BY_ZERO:
- exception = &constraint_error;
- msg = "EXCEPTION_FLT_DENORMAL_OPERAND";
- break;
-
- case EXCEPTION_FLT_INVALID_OPERATION:
- exception = &constraint_error;
- msg = "EXCEPTION_FLT_INVALID_OPERATION";
- break;
-
- case EXCEPTION_FLT_OVERFLOW:
- exception = &constraint_error;
- msg = "EXCEPTION_FLT_OVERFLOW";
- break;
-
- case EXCEPTION_FLT_STACK_CHECK:
- exception = &program_error;
- msg = "EXCEPTION_FLT_STACK_CHECK";
- break;
-
- case EXCEPTION_FLT_UNDERFLOW:
- exception = &constraint_error;
- msg = "EXCEPTION_FLT_UNDERFLOW";
- break;
-
- case EXCEPTION_INT_DIVIDE_BY_ZERO:
- exception = &constraint_error;
- msg = "EXCEPTION_INT_DIVIDE_BY_ZERO";
- break;
-
- case EXCEPTION_INT_OVERFLOW:
- exception = &constraint_error;
- msg = "EXCEPTION_INT_OVERFLOW";
- break;
-
- case EXCEPTION_INVALID_DISPOSITION:
- exception = &program_error;
- msg = "EXCEPTION_INVALID_DISPOSITION";
- break;
-
- case EXCEPTION_NONCONTINUABLE_EXCEPTION:
- exception = &program_error;
- msg = "EXCEPTION_NONCONTINUABLE_EXCEPTION";
- break;
-
- case EXCEPTION_PRIV_INSTRUCTION:
- exception = &program_error;
- msg = "EXCEPTION_PRIV_INSTRUCTION";
- break;
-
- case EXCEPTION_SINGLE_STEP:
- exception = &program_error;
- msg = "EXCEPTION_SINGLE_STEP";
- break;
-
- case EXCEPTION_STACK_OVERFLOW:
- exception = &storage_error;
- msg = "EXCEPTION_STACK_OVERFLOW";
- break;
-
- default:
- exception = &program_error;
- msg = "unhandled signal";
- }
-
- Raise_From_Signal_Handler (exception, msg);
- return 0; /* This is never reached, avoid compiler warning */
-}
-
void
__gnat_install_handler (void)
{
- SetUnhandledExceptionFilter (__gnat_error_handler);
- __gnat_handler_installed = 1;
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
-
/* Initialize floating-point coprocessor. This call is needed because
the MS libraries default to 64-bit precision instead of 80-bit
precision, and we require the full precision for proper operation,
given that we have set Max_Digits etc with this in mind */
-
__gnat_init_float ();
- /* initialize a lock for a process handle list - see a-adaint.c for the
+ /* Initialize a lock for a process handle list - see a-adaint.c for the
implementation of __gnat_portable_no_block_spawn, __gnat_portable_wait */
__gnat_plist_init();
+
+ /* Install the Structured Exception handler. */
+ if (eh)
+ __gnat_install_SEH_handler (eh);
}
/***************************************/
@@ -1023,7 +908,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
__gnat_init_float ();
}
@@ -1035,7 +920,7 @@ __gnat_initialize (void)
#elif defined (__Lynx__)
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
__gnat_init_float ();
}
@@ -1057,7 +942,7 @@ __gnat_install_handler (void)
#elif defined (__EMX__) /* OS/2 dependent initialization */
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
@@ -1224,7 +1109,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
@@ -1332,7 +1217,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
@@ -1564,7 +1449,7 @@ __gnat_install_handler (void)
}
void
-__gnat_initialize(void)
+__gnat_initialize(void *eh ATTRIBUTE_UNUSED)
{
}
@@ -1636,7 +1521,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
__gnat_install_handler ();
@@ -1694,7 +1579,9 @@ void
__gnat_clear_exception_count (void)
{
#ifdef VTHREADS
- taskIdCurrent->vThreads.excCnt = 0;
+ WIND_TCB *currentTask = (WIND_TCB *) taskIdSelf();
+
+ currentTask->vThreads.excCnt = 0;
#endif
}
@@ -1824,7 +1711,7 @@ __gnat_init_float (void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
__gnat_init_float ();
@@ -1832,20 +1719,20 @@ __gnat_initialize (void)
the frame tables.
For applications loaded as a set of "modules", the crtstuff objects
- linked in (crtbegin/endS) are tailored to provide this service a-la C++
- static constructor fashion, typically triggered by the VxWorks loader.
- This is achieved by way of a special variable declaration in the crt
- object, the name of which has been deduced by analyzing the output of the
- "munching" step documented for C++. The de-registration call is handled
- symetrically, a-la C++ destructor fashion and typically triggered by the
- dynamic unloader. Note that since the tables shall be registered against
- a common datastructure, libgcc should be one of the modules (vs beeing
+ linked in (crtbegin/end) are tailored to provide this service a-la C++
+ constructor fashion, typically triggered by the VxWorks loader. This is
+ achieved by way of a special variable declaration in the crt object, the
+ name of which has been deduced by analyzing the output of the "munching"
+ step documented for C++. The de-registration is handled symetrically,
+ a-la C++ destructor fashion and typically triggered by the dynamic
+ unloader. Note that since the tables shall be registered against a
+ common datastructure, libgcc should be one of the modules (vs beeing
partially linked against all the others at build time) and shall be
loaded first.
For applications linked with the kernel, the scheme above would lead to
duplicated symbols because the VxWorks kernel build "munches" by default.
- To prevent those conflicts, we link against crtbegin/end objects that
+ To prevent those conflicts, we link against crtbegin/endS objects that
don't include the special variable and directly call the appropriate
function here. We'll never unload that, so there is no de-registration to
worry about.
@@ -1856,15 +1743,15 @@ __gnat_initialize (void)
We can differentiate by looking at the __module_has_ctors value provided
by each class of crt objects. As of today, selecting the crt set with the
- static ctors/dtors capabilities (first scheme above) is triggered by
- adding "-static" to the gcc *link* command line options. Without this,
- the other set of crt objects is fetched.
+ ctors/dtors capabilities (first scheme above) is triggered by adding
+ "-dynamic" to the gcc *link* command line options. Selecting the other
+ set of crt objects is achieved by "-static" instead.
This is a first approach, tightly synchronized with a number of GCC
configuration and crtstuff changes. We need to ensure that those changes
are there to activate this circuitry. */
-#if DWARF2_UNWIND_INFO && defined (_ARCH_PPC)
+#if (__GNUC__ >= 3) && (defined (_ARCH_PPC) || defined (__ppc))
{
/* The scheme described above is only useful for the actual ZCX case, and
we don't want any reference to the crt provided symbols otherwise. We
@@ -1947,7 +1834,7 @@ __gnat_install_handler(void)
}
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
__gnat_install_handler ();
__gnat_init_float ();
@@ -1963,7 +1850,7 @@ __gnat_initialize (void)
/***************************************/
void
-__gnat_initialize (void)
+__gnat_initialize (void *eh ATTRIBUTE_UNUSED)
{
}
diff --git a/gcc/ada/krunch.adb b/gcc/ada/krunch.adb
index da0929c49d4..a325063d2f5 100644
--- a/gcc/ada/krunch.adb
+++ b/gcc/ada/krunch.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -44,6 +44,7 @@ is
Krlen : Natural;
Num_Seps : Natural;
Startloc : Natural;
+ J : Natural;
begin
-- Deal with special predefined children cases. Startloc is the first
@@ -64,6 +65,15 @@ begin
Curlen := Len - 12;
Krlen := 8;
+ elsif Len >= 23
+ and then Buffer (1 .. 22) = "ada-wide_wide_text_io-"
+ then
+ Startloc := 3;
+ Buffer (2 .. 5) := "-zt-";
+ Buffer (6 .. Len - 17) := Buffer (23 .. Len);
+ Curlen := Len - 17;
+ Krlen := 8;
+
elsif Len >= 4 and then Buffer (1 .. 4) = "ada-" then
Startloc := 3;
Buffer (2 .. Len - 2) := Buffer (4 .. Len);
@@ -138,6 +148,26 @@ begin
return;
end if;
+ -- If string contains Wide_Wide, replace by a single z
+
+ J := Startloc;
+ while J <= Curlen - 8 loop
+ if Buffer (J .. J + 8) = "wide_wide"
+ and then (J = Startloc
+ or else Buffer (J - 1) = '-'
+ or else Buffer (J - 1) = '_')
+ and then (J + 8 = Curlen
+ or else Buffer (J + 9) = '-'
+ or else Buffer (J + 9) = '_')
+ then
+ Buffer (J) := 'z';
+ Buffer (J + 1 .. Curlen - 8) := Buffer (J + 9 .. Curlen);
+ Curlen := Curlen - 8;
+ end if;
+
+ J := J + 1;
+ end loop;
+
-- For now, refuse to krunch a name that contains an ESC character (wide
-- character sequence) since it's too much trouble to do this right ???
@@ -152,7 +182,6 @@ begin
-- the krunching process, and then we eliminate them as the last step
Num_Seps := 0;
-
for J in Startloc .. Curlen loop
if Buffer (J) = '-' or else Buffer (J) = '_' then
Buffer (J) := ' ';
diff --git a/gcc/ada/krunch.ads b/gcc/ada/krunch.ads
index 2cf94360cee..f4637fbc788 100644
--- a/gcc/ada/krunch.ads
+++ b/gcc/ada/krunch.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -111,7 +111,12 @@
-- a-wtflio
--- This is the only irregularity required (so far!) to keep the file names
+-- More problems arise with Wide_Wide, so we replace this sequence by
+-- a z (which is not used much) and also (as in the Wide_Text_IO case),
+-- we replace the prefix ada.wide_wide_text_io- by a-zt- and then
+-- the normal crunching rules are applied.
+
+-- These are the only irregularity required (so far!) to keep the file names
-- unique in the standard predefined libraries.
procedure Krunch
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index eae80ff022c..5afc12bf13f 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2005, 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- --
@@ -261,10 +261,18 @@ package body Lib.Xref is
begin
pragma Assert (Nkind (E) in N_Entity);
+ -- Check for obsolescent reference to ASCII
+
if E = Standard_ASCII then
Check_Restriction (No_Obsolescent_Features, N);
end if;
+ -- Warn if reference to Ada 2005 entity not in Ada 2005 mode
+
+ if Is_Ada_2005 (E) and then Ada_Version < Ada_05 then
+ Error_Msg_NE ("& is only defined in Ada 2005?", N, E);
+ end if;
+
-- Never collect references if not in main source unit. However,
-- we omit this test if Typ is 'e' or 'k', since these entries are
-- really structural, and it is useful to have them in units
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index eb57773fe89..e799e05d8da 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -4079,63 +4079,65 @@ package body Make is
if Main_Project /= No_Project then
- if Projects.Table (Main_Project).Object_Directory = No_Name then
- Make_Failed ("no sources to compile");
- end if;
+ if Projects.Table (Main_Project).Object_Directory /= No_Name then
- -- Change the current directory to the object directory of the main
- -- project.
+ -- Change the current directory to the object directory of
+ -- the main project.
- begin
- Project_Object_Directory := No_Project;
- Change_To_Object_Directory (Main_Project);
+ begin
+ Project_Object_Directory := No_Project;
+ Change_To_Object_Directory (Main_Project);
- exception
- when Directory_Error =>
+ exception
+ when Directory_Error =>
- -- This should never happen. But, if it does, display the
- -- content of the parent directory of the obj dir.
+ -- This should never happen. But, if it does, display the
+ -- content of the parent directory of the obj dir.
- declare
- Parent : constant Dir_Name_Str :=
- Dir_Name
- (Get_Name_String
- (Projects.Table (Main_Project).Object_Directory));
- Dir : Dir_Type;
- Str : String (1 .. 200);
- Last : Natural;
+ declare
+ Parent : constant Dir_Name_Str :=
+ Dir_Name
+ (Get_Name_String
+ (Projects.Table
+ (Main_Project).Object_Directory));
- begin
- Write_Str ("Contents of directory """);
- Write_Str (Parent);
- Write_Line (""":");
+ Dir : Dir_Type;
+ Str : String (1 .. 200);
+ Last : Natural;
- Open (Dir, Parent);
+ begin
+ Write_Str ("Contents of directory """);
+ Write_Str (Parent);
+ Write_Line (""":");
- loop
- Read (Dir, Str, Last);
- exit when Last = 0;
- Write_Str (" ");
- Write_Line (Str (1 .. Last));
- end loop;
+ Open (Dir, Parent);
- Close (Dir);
+ loop
+ Read (Dir, Str, Last);
+ exit when Last = 0;
+ Write_Str (" ");
+ Write_Line (Str (1 .. Last));
+ end loop;
- exception
- when X : others =>
- Write_Line ("(unexpected exception)");
- Write_Line (Exception_Information (X));
+ Close (Dir);
- if Is_Open (Dir) then
- Close (Dir);
- end if;
- end;
+ exception
+ when X : others =>
+ Write_Line ("(unexpected exception)");
+ Write_Line (Exception_Information (X));
- Make_Failed ("unable to change working directory to """,
- Get_Name_String
- (Projects.Table (Main_Project).Object_Directory),
- """");
- end;
+ if Is_Open (Dir) then
+ Close (Dir);
+ end if;
+ end;
+
+ Make_Failed
+ ("unable to change working directory to """,
+ Get_Name_String
+ (Projects.Table (Main_Project).Object_Directory),
+ """");
+ end;
+ end if;
-- Source file lookups should be cached for efficiency.
-- Source files are not supposed to change.
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 8c444217759..e63277dc345 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2004 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -217,7 +217,7 @@ extern char **gnat_argv;
/* Declare functions we use as part of startup. */
-extern void __gnat_initialize (void);
+extern void __gnat_initialize (void *);
extern void adainit (void);
extern void _ada_gnat1drv (void);
@@ -227,7 +227,7 @@ static void
gnat_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
{
/* call the target specific initializations */
- __gnat_initialize();
+ __gnat_initialize (NULL);
/* Call the front-end elaboration procedures */
adainit ();
diff --git a/gcc/ada/mlib-prj.adb b/gcc/ada/mlib-prj.adb
index c33559c3968..03ca2d0ee96 100644
--- a/gcc/ada/mlib-prj.adb
+++ b/gcc/ada/mlib-prj.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2004, Ada Core Technologies, Inc. --
+-- Copyright (C) 2001-2005, Ada Core Technologies, 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- --
@@ -1419,19 +1419,19 @@ package body MLib.Prj is
Data := Projects.Table (For_Project);
declare
- Interface : String_List_Id := Data.Lib_Interface_ALIs;
- ALI : File_Name_Type;
+ Iface : String_List_Id := Data.Lib_Interface_ALIs;
+ ALI : File_Name_Type;
begin
- while Interface /= Nil_String loop
- ALI := String_Elements.Table (Interface).Value;
+ while Iface /= Nil_String loop
+ ALI := String_Elements.Table (Iface).Value;
Interface_ALIs.Set (ALI, True);
- Get_Name_String (String_Elements.Table (Interface).Value);
+ Get_Name_String (String_Elements.Table (Iface).Value);
Add_Argument (Name_Buffer (1 .. Name_Len));
- Interface := String_Elements.Table (Interface).Next;
+ Iface := String_Elements.Table (Iface).Next;
end loop;
- Interface := Data.Lib_Interface_ALIs;
+ Iface := Data.Lib_Interface_ALIs;
if not Opt.Quiet_Output then
@@ -1439,10 +1439,10 @@ package body MLib.Prj is
-- library that is needed by an interface should also be an
-- interface. If it is not the case, output a warning.
- while Interface /= Nil_String loop
- ALI := String_Elements.Table (Interface).Value;
+ while Iface /= Nil_String loop
+ ALI := String_Elements.Table (Iface).Value;
Process (ALI);
- Interface := String_Elements.Table (Interface).Next;
+ Iface := String_Elements.Table (Iface).Next;
end loop;
end if;
end;
diff --git a/gcc/ada/mlib-tgt-vms-ia64.adb b/gcc/ada/mlib-tgt-vms-ia64.adb
index cad8ae1401b..e921566473c 100644
--- a/gcc/ada/mlib-tgt-vms-ia64.adb
+++ b/gcc/ada/mlib-tgt-vms-ia64.adb
@@ -7,7 +7,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2005 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- --
@@ -77,10 +77,10 @@ package body MLib.Tgt is
------------------------------
function Popen (Command, Mode : System.Address) return System.Address;
- pragma Import (C, Popen);
+ pragma Import (C, Popen, "decc$popen");
function Pclose (File : System.Address) return Integer;
- pragma Import (C, Pclose);
+ pragma Import (C, Pclose, "decc$pclose");
---------------------
-- Archive_Builder --
diff --git a/gcc/ada/mlib.adb b/gcc/ada/mlib.adb
index df8796f30cd..65efb4c65a7 100644
--- a/gcc/ada/mlib.adb
+++ b/gcc/ada/mlib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2004, Ada Core Technologies, Inc. --
+-- Copyright (C) 1999-2005, Ada Core Technologies, 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- --
@@ -101,9 +101,9 @@ package body MLib is
To : Name_Id;
Interfaces : String_List)
is
- Success : Boolean := False;
- To_Dir : constant String := Get_Name_String (To);
- Interface : Boolean := False;
+ Success : Boolean := False;
+ To_Dir : constant String := Get_Name_String (To);
+ Is_Interface : Boolean := False;
procedure Verbose_Copy (Index : Positive);
-- In verbose mode, output a message that the indexed file is copied
@@ -154,11 +154,11 @@ package body MLib is
-- Check if this is one of the interface ALIs
- Interface := False;
+ Is_Interface := False;
for Index in Interfaces'Range loop
if File_Name = Interfaces (Index).all then
- Interface := True;
+ Is_Interface := True;
exit;
end if;
end loop;
@@ -167,7 +167,7 @@ package body MLib is
-- the interface indication at the end of the P line.
-- Do not copy ALI files that are not Interfaces.
- if Interface then
+ if Is_Interface then
Success := False;
Verbose_Copy (Index);
diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb
index 8bd712754f9..d462d1152e5 100644
--- a/gcc/ada/namet.adb
+++ b/gcc/ada/namet.adb
@@ -273,9 +273,9 @@ package body Namet is
procedure Copy_One_Character;
-- Copy a character from Name_Buffer to New_Buf. Includes case
- -- of copying a Uhh or Whhhh sequence and decoding it.
+ -- of copying a Uhh,Whhhh,WWhhhhhhhh sequence and decoding it.
- function Hex (N : Natural) return Natural;
+ function Hex (N : Natural) return Word;
-- Scans past N digits using Old pointer and returns hex value
procedure Insert_Character (C : Character);
@@ -301,6 +301,15 @@ package body Namet is
Old := Old + 1;
Insert_Character (Character'Val (Hex (2)));
+ -- WW (wide wide character insertion)
+
+ elsif C = 'W'
+ and then Old < Name_Len
+ and then Name_Buffer (Old + 1) = 'W'
+ then
+ Old := Old + 2;
+ Widechar.Set_Wide (Char_Code (Hex (8)), New_Buf, New_Len);
+
-- W (wide character insertion)
elsif C = 'W'
@@ -323,8 +332,8 @@ package body Namet is
-- Hex --
---------
- function Hex (N : Natural) return Natural is
- T : Natural := 0;
+ function Hex (N : Natural) return Word is
+ T : Word := 0;
C : Character;
begin
@@ -492,7 +501,7 @@ package body Namet is
elsif Name_Buffer (1) = 'Q' then
Get_Decoded_Name_String (Id);
- -- Only remaining issue is U/W sequences
+ -- Only remaining issue is U/W/WW sequences
else
Get_Name_String (Id);
@@ -502,6 +511,8 @@ package body Namet is
if Name_Buffer (P + 1) in 'A' .. 'Z' then
P := P + 1;
+ -- Uhh encoding
+
elsif Name_Buffer (P) = 'U' then
for J in reverse P + 3 .. P + Name_Len loop
Name_Buffer (J + 3) := Name_Buffer (J);
@@ -516,22 +527,38 @@ package body Namet is
Name_Buffer (P + 5) := ']';
P := P + 6;
+ -- WWhhhhhhhh encoding
+
+ elsif Name_Buffer (P) = 'W'
+ and then P + 9 <= Name_Len
+ and then Name_Buffer (P + 1) = 'W'
+ and then Name_Buffer (P + 2) not in 'A' .. 'Z'
+ and then Name_Buffer (P + 2) /= '_'
+ then
+ Name_Buffer (P + 12 .. Name_Len + 2) :=
+ Name_Buffer (P + 10 .. Name_Len);
+ Name_Buffer (P) := '[';
+ Name_Buffer (P + 1) := '"';
+ Name_Buffer (P + 10) := '"';
+ Name_Buffer (P + 11) := ']';
+ Name_Len := Name_Len + 2;
+ P := P + 12;
+
+ -- Whhhh encoding
+
elsif Name_Buffer (P) = 'W'
and then P < Name_Len
and then Name_Buffer (P + 1) not in 'A' .. 'Z'
and then Name_Buffer (P + 1) /= '_'
then
- Name_Buffer (P + 8 .. P + Name_Len + 5) :=
+ Name_Buffer (P + 8 .. P + Name_Len + 3) :=
Name_Buffer (P + 5 .. Name_Len);
- Name_Buffer (P + 5) := Name_Buffer (P + 4);
- Name_Buffer (P + 4) := Name_Buffer (P + 3);
- Name_Buffer (P + 3) := Name_Buffer (P + 2);
- Name_Buffer (P + 2) := Name_Buffer (P + 1);
+ Name_Buffer (P + 2 .. P + 5) := Name_Buffer (P + 1 .. P + 4);
Name_Buffer (P) := '[';
Name_Buffer (P + 1) := '"';
Name_Buffer (P + 6) := '"';
Name_Buffer (P + 7) := ']';
- Name_Len := Name_Len + 5;
+ Name_Len := Name_Len + 3;
P := P + 8;
else
@@ -1135,19 +1162,25 @@ package body Namet is
procedure Store_Encoded_Character (C : Char_Code) is
- procedure Set_Hex_Chars (N : Natural);
+ procedure Set_Hex_Chars (C : Char_Code);
-- Stores given value, which is in the range 0 .. 255, as two hex
- -- digits (using lower case a-f) in Name_Buffer, incrementing Name_Len
+ -- digits (using lower case a-f) in Name_Buffer, incrementing Name_Len.
- procedure Set_Hex_Chars (N : Natural) is
- Hexd : constant String := "0123456789abcdef";
+ -------------------
+ -- Set_Hex_Chars --
+ -------------------
+ procedure Set_Hex_Chars (C : Char_Code) is
+ Hexd : constant String := "0123456789abcdef";
+ N : constant Natural := Natural (C);
begin
Name_Buffer (Name_Len + 1) := Hexd (N / 16 + 1);
Name_Buffer (Name_Len + 2) := Hexd (N mod 16 + 1);
Name_Len := Name_Len + 2;
end Set_Hex_Chars;
+ -- Start of processing for Store_Encoded_Character
+
begin
Name_Len := Name_Len + 1;
@@ -1159,16 +1192,24 @@ package body Namet is
Name_Buffer (Name_Len) := CC;
else
Name_Buffer (Name_Len) := 'U';
- Set_Hex_Chars (Natural (C));
+ Set_Hex_Chars (C);
end if;
end;
+ elsif In_Wide_Character_Range (C) then
+ Name_Buffer (Name_Len) := 'W';
+ Set_Hex_Chars (C / 256);
+ Set_Hex_Chars (C mod 256);
+
else
Name_Buffer (Name_Len) := 'W';
- Set_Hex_Chars (Natural (C) / 256);
- Set_Hex_Chars (Natural (C) mod 256);
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := 'W';
+ Set_Hex_Chars (C / 2 ** 24);
+ Set_Hex_Chars ((C / 2 ** 16) mod 256);
+ Set_Hex_Chars ((C / 256) mod 256);
+ Set_Hex_Chars (C mod 256);
end if;
-
end Store_Encoded_Character;
--------------------------------------
diff --git a/gcc/ada/namet.ads b/gcc/ada/namet.ads
index bf4ec2cc261..3a3e5e03748 100644
--- a/gcc/ada/namet.ads
+++ b/gcc/ada/namet.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -48,17 +48,18 @@ package Namet is
-- The forms of the entries are as follows:
--- Identifiers Stored with upper case letters folded to lower case.
--- Upper half (16#80# bit set) and wide characters are
--- stored in an encoded form (Uhh for upper half and
--- Whhhh for wide characters, as provided by the routine
--- Store_Encoded_Character, where hh are hex digits for
--- the character code using lower case a-f). Normally
--- the use of U or W in other internal names is avoided,
--- but these letters may be used in internal names
--- (without this special meaning), if the appear as
--- the last character of the name, or they are followed
--- by an upper case letter or an underscore.
+-- Identifiers Stored with upper case letters folded to lower case. Upper
+-- half (16#80# bit set) and wide characters are stored
+-- in an encoded form (Uhh for upper half char, Whhhh
+-- for wide characters, WWhhhhhhhh as provided by the
+-- routine Store_Encoded_Character, where hh are hex
+-- digits for the character code using lower case a-f).
+-- Normally the use of U or W in other internal names is
+-- avoided, but these letters may be used in internal
+-- names (without this special meaning), if they appear
+-- as the last character of the name, or they are
+-- followed by an upper case letter (other than the WW
+-- sequence), or an underscore.
-- Operator symbols Stored with an initial letter O, and the remainder
@@ -73,7 +74,7 @@ package Namet is
-- Character literals Character literals have names that are used only for
-- debugging and error message purposes. The form is a
-- upper case Q followed by a single lower case letter,
--- or by a Uxx or Wxxxx encoding as described for
+-- or by a Uxx/Wxxxx/WWxxxxxxx encoding as described for
-- identifiers. The Set_Character_Literal_Name procedure
-- should be used to construct these encodings. Normally
-- the use of O in other internal names is avoided, but
@@ -83,9 +84,9 @@ package Namet is
-- underscore.
-- Unit names Stored with upper case letters folded to lower case,
--- using Uhh/Whhhh encoding as described for identifiers,
--- and a %s or %b suffix for specs/bodies. See package
--- Uname for further details.
+-- using Uhh/Whhhh/WWhhhhhhhh encoding as described for
+-- identifiers, and a %s or %b suffix for specs/bodies.
+-- See package Uname for further details.
-- File names Are stored in the form provided by Osint. Typically
-- they may include wide character escape sequences and
@@ -100,12 +101,12 @@ package Namet is
-- characters may appear for such entries.
-- Note: the encodings Uhh (upper half characters), Whhhh (wide characters),
--- and Qx (character literal names) are described in the spec, since they are
--- visible throughout the system (e.g. in debugging output). However, no code
--- should depend on these particular encodings, so it should be possible to
--- change the encodings by making changes only to the Namet specification (to
--- change these comments) and the body (which actually implements the
--- encodings).
+-- WWhhhhhhhh (wide wide characters) and Qx (character literal names) are
+-- described in the spec, since they are visible throughout the system (e.g.
+-- in debugging output). However, no code should depend on these particular
+-- encodings, so it should be possible to change the encodings by making
+-- changes only to the Namet specification (to change these comments) and the
+-- body (which actually implements the encodings).
-- The names are hashed so that a given name appears only once in the table,
-- except that names entered with Name_Enter as opposed to Name_Find are
@@ -188,13 +189,14 @@ package Namet is
procedure Get_Decoded_Name_String_With_Brackets (Id : Name_Id);
-- This routine is similar to Decoded_Name, except that the brackets
- -- notation (Uhh replaced by ["hh"], Whhhh replaced by ["hhhh"]) is used
- -- for all non-lower half characters, regardless of the setting of
- -- Opt.Wide_Character_Encoding_Method, and also in that characters in the
- -- range 16#80# .. 16#FF# are converted to brackets notation in all cases.
- -- This routine can be used when there is a requirement for a canonical
- -- representation not affected by the character set options (e.g. in the
- -- binder generation of symbols).
+ -- notation (Uhh replaced by ["hh"], Whhhh replaced by ["hhhh"],
+ -- WWhhhhhhhh replaced by ["hhhhhhhh"]) is used for all non-lower half
+ -- characters, regardless of how Opt.Wide_Character_Encoding_Method is
+ -- set, and also in that characters in the range 16#80# .. 16#FF# are
+ -- converted to brackets notation in all cases. This routine can be used
+ -- when there is a requirement for a canonical representation not affected
+ -- by the character set options (e.g. in the binder generation of
+ -- symbols).
function Get_Name_Table_Byte (Id : Name_Id) return Byte;
pragma Inline (Get_Name_Table_Byte);
@@ -328,11 +330,12 @@ package Namet is
-- Stores given character code at the end of Name_Buffer, updating the
-- value in Name_Len appropriately. Lower case letters and digits are
-- stored unchanged. Other 8-bit characters are stored using the Uhh
- -- encoding (hh = hex code), and other 16-bit wide-character values are
- -- stored using the Whhhh (hhhh = hex code) encoding. Note that this
- -- procedure does not fold upper case letters (they are stored using the
- -- Uhh encoding). If folding is required, it must be done by the caller
- -- prior to the call.
+ -- encoding (hh = hex code), other 16-bit wide character values are stored
+ -- using the Whhhh (hhhh = hex code) encoding, and other 32-bit wide wide
+ -- character values are stored using the WWhhhhhhhh (hhhhhhhh = hex code).
+ -- Note that this procedure does not fold upper case letters (they are
+ -- stored using the Uhh encoding). If folding is required, it must be done
+ -- by the caller prior to the call.
procedure Tree_Read;
-- Initializes internal tables from current tree file using the relevant
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index e710275b74a..1627831ab17 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -271,6 +271,11 @@ package Opt is
-- of the original source code. Causes debugging information to be
-- written with respect to the generated code file that is written.
+ Default_Exit_Status : Int := 0;
+ -- GNATBIND
+ -- Set the default exit status value. Set by the -Xnnn switch for the
+ -- binder.
+
Default_Sec_Stack_Size : Int := -1;
-- GNATBIND
-- Set to default secondary stack size in units of kilobytes. Set by
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb
index e9fe5537136..7dcc6ba08e1 100644
--- a/gcc/ada/par-ch12.adb
+++ b/gcc/ada/par-ch12.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -808,8 +808,15 @@ package body Ch12 is
-----------------------------------------
-- FORMAL_SUBPROGRAM_DECLARATION ::=
+ -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
+ -- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
+
+ -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT];
+ -- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
+ -- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT];
+
-- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
-- DEFAULT_NAME ::= NAME
@@ -817,32 +824,55 @@ package body Ch12 is
-- The caller has checked that the initial tokens are WITH FUNCTION or
-- WITH PROCEDURE, and the initial WITH has been scanned out.
- -- Note: we separate this into two procedures because the name is allowed
- -- to be an operator symbol for a function, but not for a procedure.
-
-- Error recovery: cannot raise Error_Resync
function P_Formal_Subprogram_Declaration return Node_Id is
- Def_Node : Node_Id;
+ Prev_Sloc : constant Source_Ptr := Prev_Token_Ptr;
+ Spec_Node : constant Node_Id := P_Subprogram_Specification;
+ Def_Node : Node_Id;
begin
- Def_Node := New_Node (N_Formal_Subprogram_Declaration, Prev_Token_Ptr);
- Set_Specification (Def_Node, P_Subprogram_Specification);
-
if Token = Tok_Is then
T_Is; -- past IS, skip extra IS or ";"
- if Token = Tok_Box then
+ if Token = Tok_Abstract then
+ Def_Node :=
+ New_Node (N_Formal_Abstract_Subprogram_Declaration, Prev_Sloc);
+ Scan; -- past ABSTRACT
+
+ if Ada_Version < Ada_05 then
+ Error_Msg_SP
+ ("formal abstract subprograms are an Ada 2005 extension");
+ Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
+ end if;
+
+ else
+ Def_Node :=
+ New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
+ end if;
+
+ Set_Specification (Def_Node, Spec_Node);
+
+ if Token = Tok_Semicolon then
+ Scan; -- past ";"
+
+ elsif Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past <>
+ T_Semicolon;
else
Set_Default_Name (Def_Node, P_Name);
+ T_Semicolon;
end if;
+ else
+ Def_Node :=
+ New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
+ Set_Specification (Def_Node, Spec_Node);
+ T_Semicolon;
end if;
- T_Semicolon;
return Def_Node;
end P_Formal_Subprogram_Declaration;
diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb
index dd58e1f9cdc..8b843e56c88 100644
--- a/gcc/ada/par-ch2.adb
+++ b/gcc/ada/par-ch2.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -54,6 +54,21 @@ package body Ch2 is
-- All set if we do indeed have an identifier
if Token = Tok_Identifier then
+
+ -- Ada 2005 (AI-284): Compiling in Ada95 mode we notify
+ -- that interface, overriding, and synchronized are
+ -- new reserved words
+
+ if Ada_Version = Ada_95 then
+ if Token_Name = Name_Overriding
+ or else Token_Name = Name_Synchronized
+ or else (Token_Name = Name_Interface
+ and then Prev_Token /= Tok_Pragma)
+ then
+ Error_Msg_N ("& is a reserved word in Ada 2005?", Token_Node);
+ end if;
+ end if;
+
Ident_Node := Token_Node;
Scan; -- past Identifier
return Ident_Node;
@@ -251,9 +266,21 @@ package body Ch2 is
Style.Check_Pragma_Name;
end if;
- Ident_Node := P_Identifier;
+ -- Ada 2005 (AI-284): INTERFACE is a new reserved word but it is
+ -- allowed as a pragma name.
+
+ if Ada_Version >= Ada_05
+ and then Token = Tok_Interface
+ then
+ Pragma_Name := Name_Interface;
+ Ident_Node := Token_Node;
+ Scan; -- past INTERFACE
+ else
+ Ident_Node := P_Identifier;
+ Delete_Node (Ident_Node);
+ end if;
+
Set_Chars (Pragma_Node, Pragma_Name);
- Delete_Node (Ident_Node);
-- See if special INTERFACE/IMPORT check is required
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index 440f6468637..5da4a3e10e1 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -174,7 +174,20 @@ package body Ch3 is
-- separate declaration (but not use) of a reserved identifier.
if Token = Tok_Identifier then
- null;
+
+ -- Ada 2005 (AI-284): Compiling in Ada95 mode we notify
+ -- that interface, overriding, and synchronized are
+ -- new reserved words
+
+ if Ada_Version = Ada_95 then
+ if Token_Name = Name_Overriding
+ or else Token_Name = Name_Synchronized
+ or else (Token_Name = Name_Interface
+ and then Prev_Token /= Tok_Pragma)
+ then
+ Error_Msg_N ("& is a reserved word in Ada 2005?", Token_Node);
+ end if;
+ end if;
-- If we have a reserved identifier, manufacture an identifier with
-- a corresponding name after posting an appropriate error message
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb
index d22c5243cee..3288aadec6a 100644
--- a/gcc/ada/par-prag.adb
+++ b/gcc/ada/par-prag.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -306,10 +306,13 @@ begin
-- This pragma must be processed at parse time, since we want to set
-- the Ada version properly at parse time to recognize the appropriate
- -- Ada version syntax.
+ -- Ada version syntax. However, it is only the zero argument form that
+ -- must be processed at parse time.
when Pragma_Ada_05 =>
- Ada_Version := Ada_05;
+ if Arg_Count = 0 then
+ Ada_Version := Ada_05;
+ end if;
-----------
-- Debug --
@@ -1060,7 +1063,6 @@ begin
Pragma_Normalize_Scalars |
Pragma_Optimize |
Pragma_Optional_Overriding |
- Pragma_Overriding |
Pragma_Pack |
Pragma_Passive |
Pragma_Polling |
diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb
index 671b3156835..22f94aeae4c 100644
--- a/gcc/ada/prj-makr.adb
+++ b/gcc/ada/prj-makr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005 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- --
@@ -44,14 +44,13 @@ with GNAT.OS_Lib; use GNAT.OS_Lib;
with GNAT.Regexp; use GNAT.Regexp;
with System.Case_Util; use System.Case_Util;
+with System.CRTL;
package body Prj.Makr is
function Dup (Fd : File_Descriptor) return File_Descriptor;
- pragma Import (C, Dup);
procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
- pragma Import (C, Dup2);
Gcc : constant String := "gcc";
Gcc_Path : String_Access := null;
@@ -64,11 +63,11 @@ package body Prj.Makr is
Naming_File_Suffix : constant String := "_naming";
Source_List_File_Suffix : constant String := "_source_list.txt";
- Output_FD : File_Descriptor;
- -- To save the project file and its naming project file.
+ Output_FD : File_Descriptor;
+ -- To save the project file and its naming project file
procedure Write_Eol;
- -- Output an empty line.
+ -- Output an empty line
procedure Write_A_Char (C : Character);
-- Write one character to Output_FD
@@ -84,6 +83,26 @@ package body Prj.Makr is
Table_Increment => 10,
Table_Name => "Prj.Makr.Processed_Directories");
+ ---------
+ -- Dup --
+ ---------
+
+ function Dup (Fd : File_Descriptor) return File_Descriptor is
+ begin
+ return File_Descriptor (System.CRTL.dup (Integer (Fd)));
+ end Dup;
+
+ ----------
+ -- Dup2 --
+ ----------
+
+ procedure Dup2 (Old_Fd, New_Fd : File_Descriptor) is
+ Fd : Integer;
+ pragma Warnings (Off, Fd);
+ begin
+ Fd := System.CRTL.dup2 (Integer (Old_Fd), Integer (New_Fd));
+ end Dup2;
+
----------
-- Make --
----------
@@ -160,19 +179,17 @@ package body Prj.Makr is
-----------------------
procedure Process_Directory (Dir_Name : String; Recursively : Boolean) is
- Matched : Matched_Type := False;
- Str : String (1 .. 2_000);
- Last : Natural;
- Dir : Dir_Type;
- Process : Boolean := True;
-
- Temp_File_Name : String_Access := null;
-
+ Matched : Matched_Type := False;
+ Str : String (1 .. 2_000);
+ Canon : String (1 .. 2_000);
+ Last : Natural;
+ Dir : Dir_Type;
+ Process : Boolean := True;
+
+ Temp_File_Name : String_Access := null;
Save_Last_Pragma_Index : Natural := 0;
-
- File_Name_Id : Name_Id := No_Name;
-
- SFN_Prag : SFN_Pragma;
+ File_Name_Id : Name_Id := No_Name;
+ SFN_Prag : SFN_Pragma;
begin
-- Avoid processing the same directory more than once
@@ -195,12 +212,11 @@ package body Prj.Makr is
Processed_Directories.Table (Processed_Directories.Last) :=
new String'(Dir_Name);
- -- Get the source file names from the directory.
- -- Fails if the directory does not exist.
+ -- Get the source file names from the directory. Fails if the
+ -- directory does not exist.
begin
Open (Dir, Dir_Name);
-
exception
when Directory_Error =>
Prj.Com.Fail ("cannot open directory """, Dir_Name, """");
@@ -212,6 +228,13 @@ package body Prj.Makr is
Read (Dir, Str, Last);
exit File_Loop when Last = 0;
+ -- Copy the file name and put it in canonical case to match
+ -- against the patterns that have themselves already been put
+ -- in canonical case.
+
+ Canon (1 .. Last) := Str (1 .. Last);
+ Canonical_Case_File_Name (Canon (1 .. Last));
+
if Is_Regular_File
(Dir_Name & Directory_Separator & Str (1 .. Last))
then
@@ -226,7 +249,7 @@ package body Prj.Makr is
for Index in Excluded_Expressions'Range loop
if
- Match (Str (1 .. Last), Excluded_Expressions (Index))
+ Match (Canon (1 .. Last), Excluded_Expressions (Index))
then
Matched := Excluded;
exit;
@@ -242,7 +265,8 @@ package body Prj.Makr is
for Index in Regular_Expressions'Range loop
if
- Match (Str (1 .. Last), Regular_Expressions (Index))
+ Match
+ (Canon (1 .. Last), Regular_Expressions (Index))
then
Matched := True;
exit;
@@ -270,10 +294,18 @@ package body Prj.Makr is
begin
-- If we don't have the path of the compiler yet,
- -- get it now.
+ -- get it now. The compiler name may have a prefix,
+ -- so we get the potentially prefixed name.
if Gcc_Path = null then
- Gcc_Path := Locate_Exec_On_Path (Gcc);
+ declare
+ Prefix_Gcc : String_Access :=
+ Program_Name (Gcc);
+ begin
+ Gcc_Path :=
+ Locate_Exec_On_Path (Prefix_Gcc.all);
+ Free (Prefix_Gcc);
+ end;
if Gcc_Path = null then
Prj.Com.Fail ("could not locate " & Gcc);
@@ -538,7 +570,7 @@ package body Prj.Makr is
if Matched /= Excluded then
for Index in Foreign_Expressions'Range loop
- if Match (Str (1 .. Last),
+ if Match (Canon (1 .. Last),
Foreign_Expressions (Index))
then
Matched := True;
diff --git a/gcc/ada/raise.h b/gcc/ada/raise.h
index 4a6ffbe2dbf..8ef77d7f5c6 100644
--- a/gcc/ada/raise.h
+++ b/gcc/ada/raise.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -66,8 +66,9 @@ extern void __gnat_set_globals (int, int,
char, char, char, char,
char *, char *,
int, int, int, int, int);
-extern void __gnat_initialize (void);
+extern void __gnat_initialize (void *);
extern void __gnat_init_float (void);
extern void __gnat_install_handler (void);
+extern void __gnat_install_SEH_handler (void *);
extern int gnat_exit_status;
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb
index edf3a38155a..15a2fd1c86d 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -159,7 +159,7 @@ package body Rtsfind is
-- A value of False means nothing special need be done. A value of
-- True indicates that this flag must be set to True. It is needed
-- only in the Text_IO_Kludge procedure, which may materialize an
- -- entity of Text_IO (or Wide_Text_IO) that was previously unknown.
+ -- entity of Text_IO (or [Wide_]Wide_Text_IO) that was previously unknown.
-- Id is the RE_Id value of the entity which was originally requested.
-- Id is used only for error message detail, and if it is RE_Null, then
-- the attempt to output the entity name is ignored.
@@ -248,6 +248,9 @@ package body Rtsfind is
elsif U_Id in Ada_Wide_Text_IO_Child then
Name_Buffer (17) := '.';
+
+ elsif U_Id in Ada_Wide_Wide_Text_IO_Child then
+ Name_Buffer (22) := '.';
end if;
elsif U_Id in Interfaces_Child then
@@ -435,7 +438,11 @@ package body Rtsfind is
return
Nkind (Prf) = N_Identifier
and then
- (Chars (Prf) = Name_Text_IO or else Chars (Prf) = Name_Wide_Text_IO)
+ (Chars (Prf) = Name_Text_IO
+ or else
+ Chars (Prf) = Name_Wide_Text_IO
+ or else
+ Chars (Prf) = Name_Wide_Wide_Text_IO)
and then
Nkind (Sel) = N_Identifier
and then
@@ -830,7 +837,7 @@ package body Rtsfind is
or else
E = RE_Params_Stream_Type
or else
- E = RE_RPC_Receiver)
+ E = RE_Request_Access)
then
declare
DSA_Implementation : constant Entity_Id :=
@@ -1143,6 +1150,14 @@ package body Rtsfind is
Name_Integer_IO => Ada_Wide_Text_IO_Integer_IO,
Name_Modular_IO => Ada_Wide_Text_IO_Modular_IO);
+ Wide_Wide_Name_Map : constant Name_Map_Type := Name_Map_Type'(
+ Name_Decimal_IO => Ada_Wide_Wide_Text_IO_Decimal_IO,
+ Name_Enumeration_IO => Ada_Wide_Wide_Text_IO_Enumeration_IO,
+ Name_Fixed_IO => Ada_Wide_Wide_Text_IO_Fixed_IO,
+ Name_Float_IO => Ada_Wide_Wide_Text_IO_Float_IO,
+ Name_Integer_IO => Ada_Wide_Wide_Text_IO_Integer_IO,
+ Name_Modular_IO => Ada_Wide_Wide_Text_IO_Modular_IO);
+
begin
-- Nothing to do if name is not identifier or a selected component
-- whose selector_name is not an identifier.
@@ -1161,7 +1176,7 @@ package body Rtsfind is
-- Nothing to do if name is not one of the Text_IO subpackages
-- Otherwise look through loaded units, and if we find Text_IO
- -- or Wide_Text_IO already loaded, then load the proper child.
+ -- or [Wide_]Wide_Text_IO already loaded, then load the proper child.
if Chrs in Text_IO_Package_Name then
for U in Main_Unit .. Last_Unit loop
@@ -1169,17 +1184,17 @@ package body Rtsfind is
if Name_Len = 12 then
- -- Here is where we do the loads if we find one of the
- -- units Ada.Text_IO or Ada.Wide_Text_IO. An interesting
- -- detail is that these units may already be used (i.e.
- -- their In_Use flags may be set). Normally when the In_Use
- -- flag is set, the Is_Potentially_Use_Visible flag of all
- -- entities in the package is set, but the new entity we
- -- are mysteriously adding was not there to have its flag
- -- set at the time. So that's why we pass the extra parameter
- -- to RTU_Find, to make sure the flag does get set now.
- -- Given that those generic packages are in fact child units,
- -- we must indicate that they are visible.
+ -- Here is where we do the loads if we find one of the units
+ -- Ada.Text_IO or Ada.[Wide_]Wide_Text_IO. An interesting
+ -- detail is that these units may already be used (i.e. their
+ -- In_Use flags may be set). Normally when the In_Use flag is
+ -- set, the Is_Potentially_Use_Visible flag of all entities in
+ -- the package is set, but the new entity we are mysteriously
+ -- adding was not there to have its flag set at the time. So
+ -- that's why we pass the extra parameter to RTU_Find, to make
+ -- sure the flag does get set now. Given that those generic
+ -- packages are in fact child units, we must indicate that
+ -- they are visible.
if Name_Buffer (1 .. 12) = "a-textio.ads" then
Load_RTU
@@ -1194,6 +1209,13 @@ package body Rtsfind is
Use_Setting => In_Use (Cunit_Entity (U)));
Set_Is_Visible_Child_Unit
(RT_Unit_Table (Wide_Name_Map (Chrs)).Entity);
+
+ elsif Name_Buffer (1 .. 12) = "a-ztexio.ads" then
+ Load_RTU
+ (Wide_Wide_Name_Map (Chrs),
+ Use_Setting => In_Use (Cunit_Entity (U)));
+ Set_Is_Visible_Child_Unit
+ (RT_Unit_Table (Wide_Wide_Name_Map (Chrs)).Entity);
end if;
end if;
end loop;
diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads
index 2faf0b91b70..ac1e94a7164 100644
--- a/gcc/ada/rtsfind.ads
+++ b/gcc/ada/rtsfind.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -69,6 +69,9 @@ package Rtsfind is
-- Names of the form Ada_Wide_Text_IO_xxx are second level children
-- of Ada.Wide_Text_IO.
+ -- Names of the form Ada_Wide_Wide_Text_IO_xxx are second level children
+ -- of Ada.Wide_Wide_Text_IO.
+
-- Names of the form Interfaces_xxx are first level children of
-- Interfaces_CPP refers to package Interfaces.CPP
@@ -156,6 +159,15 @@ package Rtsfind is
Ada_Wide_Text_IO_Integer_IO,
Ada_Wide_Text_IO_Modular_IO,
+ -- Children of Ada.Wide_Wide_Text_IO (for Text_IO_Kludge)
+
+ Ada_Wide_Wide_Text_IO_Decimal_IO,
+ Ada_Wide_Wide_Text_IO_Enumeration_IO,
+ Ada_Wide_Wide_Text_IO_Fixed_IO,
+ Ada_Wide_Wide_Text_IO_Float_IO,
+ Ada_Wide_Wide_Text_IO_Integer_IO,
+ Ada_Wide_Wide_Text_IO_Modular_IO,
+
-- Interfaces
Interfaces,
@@ -343,7 +355,7 @@ package Rtsfind is
System_Tasking_Stages);
subtype Ada_Child is RTU_Id
- range Ada_Calendar .. Ada_Wide_Text_IO_Modular_IO;
+ range Ada_Calendar .. Ada_Wide_Wide_Text_IO_Modular_IO;
-- Range of values for children or grand-children of Ada
subtype Ada_Calendar_Child is Ada_Child
@@ -373,6 +385,10 @@ package Rtsfind is
range Ada_Wide_Text_IO_Decimal_IO .. Ada_Wide_Text_IO_Modular_IO;
-- Range of values for children of Ada.Text_IO
+ subtype Ada_Wide_Wide_Text_IO_Child is Ada_Child
+ range Ada_Wide_Wide_Text_IO_Decimal_IO ..
+ Ada_Wide_Wide_Text_IO_Modular_IO;
+
subtype Interfaces_Child is RTU_Id
range Interfaces_CPP .. Interfaces_Packed_Decimal;
-- Range of values for children of Interfaces
@@ -700,6 +716,7 @@ package Rtsfind is
RE_Image_Unsigned, -- System.Img_Uns
RE_Image_Wide_Character, -- System.Img_WChar
+ RE_Image_Wide_Wide_Character, -- System.Img_WChar
RE_Bind_Interrupt_To_Entry, -- System.Interrupts
RE_Default_Interrupt_Priority, -- System.Interrupts
@@ -1033,7 +1050,6 @@ package Rtsfind is
RE_Do_Rpc, -- System.RPC
RE_Params_Stream_Type, -- System.RPC
RE_Partition_ID, -- System.RPC
- RE_RPC_Receiver, -- System.RPC
RE_To_PolyORB_String, -- System.PolyORB_Interface
RE_To_Standard_String, -- System.PolyORB_Interface
@@ -1103,6 +1119,7 @@ package Rtsfind is
RE_FA_SU, -- System.PolyORB_Interface
RE_FA_U, -- System.PolyORB_Interface
RE_FA_WC, -- System.PolyORB_Interface
+ RE_FA_WWC, -- System.PolyORB_Interface
RE_FA_String, -- System.PolyORB_Interface
RE_FA_ObjRef, -- System.PolyORB_Interface
@@ -1125,6 +1142,7 @@ package Rtsfind is
RE_TA_SU, -- System.PolyORB_Interface
RE_TA_U, -- System.PolyORB_Interface
RE_TA_WC, -- System.PolyORB_Interface
+ RE_TA_WWC, -- System.PolyORB_Interface
RE_TA_String, -- System.PolyORB_Interface
RE_TA_ObjRef, -- System.PolyORB_Interface
RE_TA_TC, -- System.PolyORB_Interface
@@ -1154,6 +1172,7 @@ package Rtsfind is
RE_TC_Void, -- System.PolyORB_Interface
RE_TC_Opaque, -- System.PolyORB_Interface,
RE_TC_WC, -- System.PolyORB_Interface
+ RE_TC_WWC, -- System.PolyORB_Interface
RE_TC_Array, -- System.PolyORB_Interface,
RE_TC_Sequence, -- System.PolyORB_Interface,
RE_TC_String, -- System.PolyORB_Interface,
@@ -1169,6 +1188,10 @@ package Rtsfind is
RE_IS_Iu2, -- System.Scalar_Values
RE_IS_Iu4, -- System.Scalar_Values
RE_IS_Iu8, -- System.Scalar_Values
+ RE_IS_Iz1, -- System.Scalar_Values
+ RE_IS_Iz2, -- System.Scalar_Values
+ RE_IS_Iz4, -- System.Scalar_Values
+ RE_IS_Iz8, -- System.Scalar_Values
RE_IS_Isf, -- System.Scalar_Values
RE_IS_Ifl, -- System.Scalar_Values
RE_IS_Ilf, -- System.Scalar_Values
@@ -1222,6 +1245,7 @@ package Rtsfind is
RE_I_SU, -- System.Stream_Attributes
RE_I_U, -- System.Stream_Attributes
RE_I_WC, -- System.Stream_Attributes
+ RE_I_WWC, -- System.Stream_Attributes
RE_W_AD, -- System.Stream_Attributes
RE_W_AS, -- System.Stream_Attributes
@@ -1242,6 +1266,7 @@ package Rtsfind is
RE_W_SU, -- System.Stream_Attributes
RE_W_U, -- System.Stream_Attributes
RE_W_WC, -- System.Stream_Attributes
+ RE_W_WWC, -- System.Stream_Attributes
RE_Block_Stream_Ops_OK, -- System.Stream_Attributes
@@ -1249,8 +1274,6 @@ package Rtsfind is
RE_Str_Concat_CC, -- System.String_Ops
RE_Str_Concat_CS, -- System.String_Ops
RE_Str_Concat_SC, -- System.String_Ops
- RE_Str_Normalize, -- System.String_Ops
- RE_Wide_Str_Normalize, -- System.String_Ops
RE_Str_Concat_3, -- System.String_Ops_Concat_3
@@ -1350,6 +1373,7 @@ package Rtsfind is
RE_Value_Unsigned, -- System.Val_Uns
RE_Value_Wide_Character, -- System.Val_WChar
+ RE_Value_Wide_Wide_Character, -- System.Val_WChar
RE_D, -- System.Vax_Float_Operations
RE_F, -- System.Vax_Float_Operations
@@ -1398,16 +1422,26 @@ package Rtsfind is
RE_Register_VMS_Exception, -- System.VMS_Exception_Table
RE_String_To_Wide_String, -- System.WCh_StW
+ RE_String_To_Wide_Wide_String, -- System.WCh_StW
RE_Wide_String_To_String, -- System.WCh_WtS
+ RE_Wide_Wide_String_To_String, -- System.WCh_WtS
RE_Wide_Width_Character, -- System.WWd_Char
+ RE_Wide_Wide_Width_Character, -- System.WWd_Char
+
+ RE_Wide_Wide_Width_Enumeration_8, -- System.WWd_Enum
+ RE_Wide_Wide_Width_Enumeration_16, -- System.WWd_Enum
+ RE_Wide_Wide_Width_Enumeration_32, -- System.WWd_Enum
RE_Wide_Width_Enumeration_8, -- System.WWd_Enum
RE_Wide_Width_Enumeration_16, -- System.WWd_Enum
RE_Wide_Width_Enumeration_32, -- System.WWd_Enum
+ RE_Wide_Wide_Width_Wide_Character, -- System.WWd_Wchar
+ RE_Wide_Wide_Width_Wide_Wide_Char, -- System.WWd_Wchar
RE_Wide_Width_Wide_Character, -- System.WWd_Wchar
+ RE_Wide_Width_Wide_Wide_Character, -- System.WWd_Wchar
RE_Width_Boolean, -- System.Wid_Bool
@@ -1422,6 +1456,7 @@ package Rtsfind is
RE_Width_Long_Long_Unsigned, -- System.Wid_LLU
RE_Width_Wide_Character, -- System.Wid_WChar
+ RE_Width_Wide_Wide_Character, -- System.Wid_WChar
RE_Protected_Entry_Body_Array, -- Tasking.Protected_Objects.Entries
RE_Protection_Entries, -- Tasking.Protected_Objects.Entries
@@ -1781,6 +1816,7 @@ package Rtsfind is
RE_Image_Unsigned => System_Img_Uns,
RE_Image_Wide_Character => System_Img_WChar,
+ RE_Image_Wide_Wide_Character => System_Img_WChar,
RE_Bind_Interrupt_To_Entry => System_Interrupts,
RE_Default_Interrupt_Priority => System_Interrupts,
@@ -2174,6 +2210,7 @@ package Rtsfind is
RE_FA_SU => System_PolyORB_Interface,
RE_FA_U => System_PolyORB_Interface,
RE_FA_WC => System_PolyORB_Interface,
+ RE_FA_WWC => System_PolyORB_Interface,
RE_FA_String => System_PolyORB_Interface,
RE_FA_ObjRef => System_PolyORB_Interface,
@@ -2196,6 +2233,7 @@ package Rtsfind is
RE_TA_SU => System_PolyORB_Interface,
RE_TA_U => System_PolyORB_Interface,
RE_TA_WC => System_PolyORB_Interface,
+ RE_TA_WWC => System_PolyORB_Interface,
RE_TA_String => System_PolyORB_Interface,
RE_TA_ObjRef => System_PolyORB_Interface,
RE_TA_TC => System_PolyORB_Interface,
@@ -2225,6 +2263,7 @@ package Rtsfind is
RE_TC_Void => System_PolyORB_Interface,
RE_TC_Opaque => System_PolyORB_Interface,
RE_TC_WC => System_PolyORB_Interface,
+ RE_TC_WWC => System_PolyORB_Interface,
RE_TC_Array => System_PolyORB_Interface,
RE_TC_Sequence => System_PolyORB_Interface,
RE_TC_String => System_PolyORB_Interface,
@@ -2240,7 +2279,6 @@ package Rtsfind is
RE_Do_Rpc => System_RPC,
RE_Params_Stream_Type => System_RPC,
RE_Partition_ID => System_RPC,
- RE_RPC_Receiver => System_RPC,
RE_IS_Is1 => System_Scalar_Values,
RE_IS_Is2 => System_Scalar_Values,
@@ -2250,6 +2288,10 @@ package Rtsfind is
RE_IS_Iu2 => System_Scalar_Values,
RE_IS_Iu4 => System_Scalar_Values,
RE_IS_Iu8 => System_Scalar_Values,
+ RE_IS_Iz1 => System_Scalar_Values,
+ RE_IS_Iz2 => System_Scalar_Values,
+ RE_IS_Iz4 => System_Scalar_Values,
+ RE_IS_Iz8 => System_Scalar_Values,
RE_IS_Isf => System_Scalar_Values,
RE_IS_Ifl => System_Scalar_Values,
RE_IS_Ilf => System_Scalar_Values,
@@ -2303,6 +2345,7 @@ package Rtsfind is
RE_I_SU => System_Stream_Attributes,
RE_I_U => System_Stream_Attributes,
RE_I_WC => System_Stream_Attributes,
+ RE_I_WWC => System_Stream_Attributes,
RE_W_AD => System_Stream_Attributes,
RE_W_AS => System_Stream_Attributes,
@@ -2323,12 +2366,10 @@ package Rtsfind is
RE_W_SU => System_Stream_Attributes,
RE_W_U => System_Stream_Attributes,
RE_W_WC => System_Stream_Attributes,
-
+ RE_W_WWC => System_Stream_Attributes,
RE_Block_Stream_Ops_OK => System_Stream_Attributes,
RE_Str_Concat => System_String_Ops,
- RE_Str_Normalize => System_String_Ops,
- RE_Wide_Str_Normalize => System_String_Ops,
RE_Str_Concat_CC => System_String_Ops,
RE_Str_Concat_CS => System_String_Ops,
RE_Str_Concat_SC => System_String_Ops,
@@ -2431,6 +2472,7 @@ package Rtsfind is
RE_Value_Unsigned => System_Val_Uns,
RE_Value_Wide_Character => System_Val_WChar,
+ RE_Value_Wide_Wide_Character => System_Val_WChar,
RE_D => System_Vax_Float_Operations,
RE_F => System_Vax_Float_Operations,
@@ -2479,16 +2521,27 @@ package Rtsfind is
RE_Register_VMS_Exception => System_VMS_Exception_Table,
RE_String_To_Wide_String => System_WCh_StW,
+ RE_String_To_Wide_Wide_String => System_WCh_StW,
RE_Wide_String_To_String => System_WCh_WtS,
+ RE_Wide_Wide_String_To_String => System_WCh_WtS,
+ RE_Wide_Wide_Width_Character => System_WWd_Char,
RE_Wide_Width_Character => System_WWd_Char,
+ RE_Wide_Wide_Width_Enumeration_8 => System_WWd_Enum,
+ RE_Wide_Wide_Width_Enumeration_16 => System_WWd_Enum,
+ RE_Wide_Wide_Width_Enumeration_32 => System_WWd_Enum,
+
RE_Wide_Width_Enumeration_8 => System_WWd_Enum,
RE_Wide_Width_Enumeration_16 => System_WWd_Enum,
RE_Wide_Width_Enumeration_32 => System_WWd_Enum,
+ RE_Wide_Wide_Width_Wide_Character => System_WWd_Wchar,
+ RE_Wide_Wide_Width_Wide_Wide_Char => System_WWd_Wchar,
+
RE_Wide_Width_Wide_Character => System_WWd_Wchar,
+ RE_Wide_Width_Wide_Wide_Character => System_WWd_Wchar,
RE_Width_Boolean => System_Wid_Bool,
@@ -2503,6 +2556,7 @@ package Rtsfind is
RE_Width_Long_Long_Unsigned => System_Wid_LLU,
RE_Width_Wide_Character => System_Wid_WChar,
+ RE_Width_Wide_Wide_Character => System_Wid_WChar,
RE_Protected_Entry_Body_Array =>
System_Tasking_Protected_Objects_Entries,
@@ -2754,13 +2808,13 @@ package Rtsfind is
-- with'ed automatically. The important result of this approach is that
-- Text_IO does not drag in all the code for the subpackages unless they
-- are used. Our test is a little crude, and could drag in stuff when it
- -- is not necessary, but that doesn't matter. Wide_Text_IO is handled in
- -- a similar manner.
+ -- is not necessary, but that doesn't matter. Wide_[Wide_]Text_IO is
+ -- handled in a similar manner.
function Is_Text_IO_Kludge_Unit (Nam : Node_Id) return Boolean;
- -- Returns True if the given Nam is an Expanded Name, whose Prefix is
- -- Ada, and whose selector is either Text_IO.xxx or Wide_Text_IO.xxx
- -- where xxx is one of the subpackages of Text_IO that is specially
- -- handled as described above for Text_IO_Kludge.
+ -- Returns True if the given Nam is an Expanded Name, whose Prefix is Ada,
+ -- and whose selector is either Text_IO.xxx or Wide_Text_IO.xxx or
+ -- Wide_Wide_Text_IO.xxx, where xxx is one of the subpackages of Text_IO
+ -- that is specially handled as described above for Text_IO_Kludge.
end Rtsfind;
diff --git a/gcc/ada/s-asthan-vms.adb b/gcc/ada/s-asthan-vms.adb
deleted file mode 100644
index 7d66ad822c1..00000000000
--- a/gcc/ada/s-asthan-vms.adb
+++ /dev/null
@@ -1,597 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT RUN-TIME COMPONENTS --
--- --
--- S Y S T E M . A S T _ H A N D L I N G --
--- --
--- B o d y --
--- --
--- Copyright (C) 1996-2004 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- --
--- 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. --
--- --
-------------------------------------------------------------------------------
-
--- This is the OpenVMS/Alpha version.
-
-with System; use System;
-
-with System.IO;
-
-with System.Machine_Code;
-with System.Parameters;
-with System.Storage_Elements;
-
-with System.Tasking;
-with System.Tasking.Rendezvous;
-with System.Tasking.Initialization;
-with System.Tasking.Utilities;
-
-with System.Task_Primitives;
-with System.Task_Primitives.Operations;
-with System.Task_Primitives.Operations.DEC;
-
--- with Ada.Finalization;
--- removed, because of problem with controlled attribute ???
-
-with Ada.Task_Attributes;
-with Ada.Task_Identification;
-
-with Ada.Exceptions; use Ada.Exceptions;
-
-with Ada.Unchecked_Conversion;
-
-package body System.AST_Handling is
-
- package ATID renames Ada.Task_Identification;
-
- package SP renames System.Parameters;
- package ST renames System.Tasking;
- package STR renames System.Tasking.Rendezvous;
- package STI renames System.Tasking.Initialization;
- package STU renames System.Tasking.Utilities;
-
- package SSE renames System.Storage_Elements;
- package STPO renames System.Task_Primitives.Operations;
- package STPOD renames System.Task_Primitives.Operations.DEC;
-
- AST_Lock : aliased System.Task_Primitives.RTS_Lock;
- -- This is a global lock; it is used to execute in mutual exclusion
- -- from all other AST tasks. It is only used by Lock_AST and
- -- Unlock_AST.
-
- procedure Lock_AST (Self_ID : ST.Task_Id);
- -- Locks out other AST tasks. Preceding a section of code by Lock_AST and
- -- following it by Unlock_AST creates a critical region.
-
- procedure Unlock_AST (Self_ID : ST.Task_Id);
- -- Releases lock previously set by call to Lock_AST.
- -- All nested locks must be released before other tasks competing for the
- -- tasking lock are released.
-
- --------------
- -- Lock_AST --
- --------------
-
- procedure Lock_AST (Self_ID : ST.Task_Id) is
- begin
- STI.Defer_Abort_Nestable (Self_ID);
- STPO.Write_Lock (AST_Lock'Access, Global_Lock => True);
- end Lock_AST;
-
- ----------------
- -- Unlock_AST --
- ----------------
-
- procedure Unlock_AST (Self_ID : ST.Task_Id) is
- begin
- STPO.Unlock (AST_Lock'Access, Global_Lock => True);
- STI.Undefer_Abort_Nestable (Self_ID);
- end Unlock_AST;
-
- ---------------------------------
- -- AST_Handler Data Structures --
- ---------------------------------
-
- -- As noted in the private part of the spec of System.Aux_DEC, the
- -- AST_Handler type is simply a pointer to a procedure that takes
- -- a single 64bit parameter. The following is a local copy
- -- of that definition.
-
- -- We need our own copy because we need to get our hands on this
- -- and we cannot see the private part of System.Aux_DEC. We don't
- -- want to be a child of Aux_Dec because of complications resulting
- -- from the use of pragma Extend_System. We will use unchecked
- -- conversions between the two versions of the declarations.
-
- type AST_Handler is access procedure (Param : Long_Integer);
-
- -- However, this declaration is somewhat misleading, since the values
- -- referenced by AST_Handler values (all produced in this package by
- -- calls to Create_AST_Handler) are highly stylized.
-
- -- The first point is that in VMS/Alpha, procedure pointers do not in
- -- fact point to code, but rather to a 48-byte procedure descriptor.
- -- So a value of type AST_Handler is in fact a pointer to one of these
- -- 48-byte descriptors.
-
- type Descriptor_Type is new SSE.Storage_Array (1 .. 48);
- for Descriptor_Type'Alignment use Standard'Maximum_Alignment;
- pragma Warnings (Off, Descriptor_Type);
- -- Suppress harmless warnings about alignment.
- -- Should explain why this warning is harmless ???
-
- type Descriptor_Ref is access all Descriptor_Type;
-
- -- Normally, there is only one such descriptor for a given procedure, but
- -- it works fine to make a copy of the single allocated descriptor, and
- -- use the copy itself, and we take advantage of this in the design here.
- -- The idea is that AST_Handler values will all point to a record with the
- -- following structure:
-
- -- Note: When we say it works fine, there is one delicate point, which
- -- is that the code for the AST procedure itself requires the original
- -- descriptor address. We handle this by saving the orignal descriptor
- -- address in this structure and restoring in Process_AST.
-
- type AST_Handler_Data is record
- Descriptor : Descriptor_Type;
- Original_Descriptor_Ref : Descriptor_Ref;
- Taskid : ATID.Task_Id;
- Entryno : Natural;
- end record;
-
- type AST_Handler_Data_Ref is access all AST_Handler_Data;
-
- function To_AST_Handler is new Ada.Unchecked_Conversion
- (AST_Handler_Data_Ref, System.Aux_DEC.AST_Handler);
-
- -- Each time Create_AST_Handler is called, a new value of this record
- -- type is created, containing a copy of the procedure descriptor for
- -- the routine used to handle all AST's (Process_AST), and the Task_Id
- -- and entry number parameters identifying the task entry involved.
-
- -- The AST_Handler value returned is a pointer to this record. Since
- -- the record starts with the procedure descriptor, it can be used
- -- by the system in the normal way to call the procedure. But now
- -- when the procedure gets control, it can determine the address of
- -- the procedure descriptor used to call it (since the ABI specifies
- -- that this is left sitting in register r27 on entry), and then use
- -- that address to retrieve the Task_Id and entry number so that it
- -- knows on which entry to queue the AST request.
-
- -- The next issue is where are these records placed. Since we intend
- -- to pass pointers to these records to asynchronous system service
- -- routines, they have to be on the heap, which means we have to worry
- -- about when to allocate them and deallocate them.
-
- -- We solve this problem by introducing a task attribute that points to
- -- a vector, indexed by the entry number, of AST_Handler_Data records
- -- for a given task. The pointer itself is a controlled object allowing
- -- us to write a finalization routine that frees the referenced vector.
-
- -- An entry in this vector is either initialized (Entryno non-zero) and
- -- can be used for any subsequent reference to the same entry, or it is
- -- unused, marked by the Entryno value being zero.
-
- type AST_Handler_Vector is array (Natural range <>) of AST_Handler_Data;
- type AST_Handler_Vector_Ref is access all AST_Handler_Vector;
-
--- type AST_Vector_Ptr is new Ada.Finalization.Controlled with record
--- removed due to problem with controlled attribute, consequence is that
--- we have a memory leak if a task that has AST attribute entries is
--- terminated. ???
-
- type AST_Vector_Ptr is record
- Vector : AST_Handler_Vector_Ref;
- end record;
-
- AST_Vector_Init : AST_Vector_Ptr;
- -- Initial value, treated as constant, Vector will be null.
-
- package AST_Attribute is new Ada.Task_Attributes
- (Attribute => AST_Vector_Ptr,
- Initial_Value => AST_Vector_Init);
-
- use AST_Attribute;
-
- -----------------------
- -- AST Service Queue --
- -----------------------
-
- -- The following global data structures are used to queue pending
- -- AST requests. When an AST is signalled, the AST service routine
- -- Process_AST is called, and it makes an entry in this structure.
-
- type AST_Instance is record
- Taskid : ATID.Task_Id;
- Entryno : Natural;
- Param : Long_Integer;
- end record;
- -- The Taskid and Entryno indicate the entry on which this AST is to
- -- be queued, and Param is the parameter provided from the AST itself.
-
- AST_Service_Queue_Size : constant := 256;
- AST_Service_Queue_Limit : constant := 250;
- type AST_Service_Queue_Index is mod AST_Service_Queue_Size;
- -- Index used to refer to entries in the circular buffer which holds
- -- active AST_Instance values. The upper bound reflects the maximum
- -- number of AST instances that can be stored in the buffer. Since
- -- these entries are immediately serviced by the high priority server
- -- task that does the actual entry queuing, it is very unusual to have
- -- any significant number of entries simulaneously queued.
-
- AST_Service_Queue : array (AST_Service_Queue_Index) of AST_Instance;
- pragma Volatile_Components (AST_Service_Queue);
- -- The circular buffer used to store active AST requests.
-
- AST_Service_Queue_Put : AST_Service_Queue_Index := 0;
- AST_Service_Queue_Get : AST_Service_Queue_Index := 0;
- pragma Atomic (AST_Service_Queue_Put);
- pragma Atomic (AST_Service_Queue_Get);
- -- These two variables point to the next slots in the AST_Service_Queue
- -- to be used for putting a new entry in and taking an entry out. This
- -- is a circular buffer, so these pointers wrap around. If the two values
- -- are equal the buffer is currently empty. The pointers are atomic to
- -- ensure proper synchronization between the single producer (namely the
- -- Process_AST procedure), and the single consumer (the AST_Service_Task).
-
- --------------------------------
- -- AST Server Task Structures --
- --------------------------------
-
- -- The basic approach is that when an AST comes in, a call is made to
- -- the Process_AST procedure. It queues the request in the service queue
- -- and then wakes up an AST server task to perform the actual call to the
- -- required entry. We use this intermediate server task, since the AST
- -- procedure itself cannot wait to return, and we need some caller for
- -- the rendezvous so that we can use the normal rendezvous mechanism.
-
- -- It would work to have only one AST server task, but then we would lose
- -- all overlap in AST processing, and furthermore, we could get priority
- -- inversion effects resulting in starvation of AST requests.
-
- -- We therefore maintain a small pool of AST server tasks. We adjust
- -- the size of the pool dynamically to reflect traffic, so that we have
- -- a sufficient number of server tasks to avoid starvation.
-
- Max_AST_Servers : constant Natural := 16;
- -- Maximum number of AST server tasks that can be allocated
-
- Num_AST_Servers : Natural := 0;
- -- Number of AST server tasks currently active
-
- Num_Waiting_AST_Servers : Natural := 0;
- -- This is the number of AST server tasks that are either waiting for
- -- work, or just about to go to sleep and wait for work.
-
- Is_Waiting : array (1 .. Max_AST_Servers) of Boolean := (others => False);
- -- An array of flags showing which AST server tasks are currently waiting
-
- AST_Task_Ids : array (1 .. Max_AST_Servers) of ST.Task_Id;
- -- Task Id's of allocated AST server tasks
-
- task type AST_Server_Task (Num : Natural) is
- pragma Priority (Priority'Last);
- end AST_Server_Task;
- -- Declaration for AST server task. This task has no entries, it is
- -- controlled by sleep and wakeup calls at the task primitives level.
-
- type AST_Server_Task_Ptr is access all AST_Server_Task;
- -- Type used to allocate server tasks
-
- -----------------------
- -- Local Subprograms --
- -----------------------
-
- procedure Allocate_New_AST_Server;
- -- Allocate an additional AST server task
-
- procedure Process_AST (Param : Long_Integer);
- -- This is the central routine for processing all AST's, it is referenced
- -- as the code address of all created AST_Handler values. See detailed
- -- description in body to understand how it works to have a single such
- -- procedure for all AST's even though it does not get any indication of
- -- the entry involved passed as an explicit parameter. The single explicit
- -- parameter Param is the parameter passed by the system with the AST.
-
- -----------------------------
- -- Allocate_New_AST_Server --
- -----------------------------
-
- procedure Allocate_New_AST_Server is
- Dummy : AST_Server_Task_Ptr;
- pragma Unreferenced (Dummy);
-
- begin
- if Num_AST_Servers = Max_AST_Servers then
- return;
-
- else
- -- Note: it is safe to increment Num_AST_Servers immediately, since
- -- no one will try to activate this task until it indicates that it
- -- is sleeping by setting its entry in Is_Waiting to True.
-
- Num_AST_Servers := Num_AST_Servers + 1;
- Dummy := new AST_Server_Task (Num_AST_Servers);
- end if;
- end Allocate_New_AST_Server;
-
- ---------------------
- -- AST_Server_Task --
- ---------------------
-
- task body AST_Server_Task is
- Taskid : ATID.Task_Id;
- Entryno : Natural;
- Param : aliased Long_Integer;
- Self_Id : constant ST.Task_Id := ST.Self;
-
- pragma Volatile (Param);
-
- begin
- -- By making this task independent of master, when the environment
- -- task is finalizing, the AST_Server_Task will be notified that it
- -- should terminate.
-
- STU.Make_Independent;
-
- -- Record our task Id for access by Process_AST
-
- AST_Task_Ids (Num) := Self_Id;
-
- -- Note: this entire task operates with the main task lock set, except
- -- when it is sleeping waiting for work, or busy doing a rendezvous
- -- with an AST server. This lock protects the data structures that
- -- are shared by multiple instances of the server task.
-
- Lock_AST (Self_Id);
-
- -- This is the main infinite loop of the task. We go to sleep and
- -- wait to be woken up by Process_AST when there is some work to do.
-
- loop
- Num_Waiting_AST_Servers := Num_Waiting_AST_Servers + 1;
-
- Unlock_AST (Self_Id);
-
- STI.Defer_Abort (Self_Id);
-
- if SP.Single_Lock then
- STPO.Lock_RTS;
- end if;
-
- STPO.Write_Lock (Self_Id);
-
- Is_Waiting (Num) := True;
-
- Self_Id.Common.State := ST.AST_Server_Sleep;
- STPO.Sleep (Self_Id, ST.AST_Server_Sleep);
- Self_Id.Common.State := ST.Runnable;
-
- STPO.Unlock (Self_Id);
-
- if SP.Single_Lock then
- STPO.Unlock_RTS;
- end if;
-
- -- If the process is finalizing, Undefer_Abort will simply end
- -- this task.
-
- STI.Undefer_Abort (Self_Id);
-
- -- We are awake, there is something to do!
-
- Lock_AST (Self_Id);
- Num_Waiting_AST_Servers := Num_Waiting_AST_Servers - 1;
-
- -- Loop here to service outstanding requests. We are always
- -- locked on entry to this loop.
-
- while AST_Service_Queue_Get /= AST_Service_Queue_Put loop
- Taskid := AST_Service_Queue (AST_Service_Queue_Get).Taskid;
- Entryno := AST_Service_Queue (AST_Service_Queue_Get).Entryno;
- Param := AST_Service_Queue (AST_Service_Queue_Get).Param;
-
- AST_Service_Queue_Get := AST_Service_Queue_Get + 1;
-
- -- This is a manual expansion of the normal call simple code
-
- declare
- type AA is access all Long_Integer;
- P : AA := Param'Unrestricted_Access;
-
- function To_ST_Task_Id is new Ada.Unchecked_Conversion
- (ATID.Task_Id, ST.Task_Id);
-
- begin
- Unlock_AST (Self_Id);
- STR.Call_Simple
- (Acceptor => To_ST_Task_Id (Taskid),
- E => ST.Task_Entry_Index (Entryno),
- Uninterpreted_Data => P'Address);
-
- exception
- when E : others =>
- System.IO.Put_Line ("%Debugging event");
- System.IO.Put_Line (Exception_Name (E) &
- " raised when trying to deliver an AST.");
-
- if Exception_Message (E)'Length /= 0 then
- System.IO.Put_Line (Exception_Message (E));
- end if;
-
- System.IO.Put_Line ("Task type is " & "Receiver_Type");
- System.IO.Put_Line ("Task id is " & ATID.Image (Taskid));
- end;
-
- Lock_AST (Self_Id);
- end loop;
- end loop;
- end AST_Server_Task;
-
- ------------------------
- -- Create_AST_Handler --
- ------------------------
-
- function Create_AST_Handler
- (Taskid : ATID.Task_Id;
- Entryno : Natural) return System.Aux_DEC.AST_Handler
- is
- Attr_Ref : Attribute_Handle;
-
- Process_AST_Ptr : constant AST_Handler := Process_AST'Access;
- -- Reference to standard procedure descriptor for Process_AST
-
- function To_Descriptor_Ref is new Ada.Unchecked_Conversion
- (AST_Handler, Descriptor_Ref);
-
- Original_Descriptor_Ref : constant Descriptor_Ref :=
- To_Descriptor_Ref (Process_AST_Ptr);
-
- begin
- if ATID.Is_Terminated (Taskid) then
- raise Program_Error;
- end if;
-
- Attr_Ref := Reference (Taskid);
-
- -- Allocate another server if supply is getting low
-
- if Num_Waiting_AST_Servers < 2 then
- Allocate_New_AST_Server;
- end if;
-
- -- No point in creating more if we have zillions waiting to
- -- be serviced.
-
- while AST_Service_Queue_Put - AST_Service_Queue_Get
- > AST_Service_Queue_Limit
- loop
- delay 0.01;
- end loop;
-
- -- If no AST vector allocated, or the one we have is too short, then
- -- allocate one of right size and initialize all entries except the
- -- one we will use to unused. Note that the assignment automatically
- -- frees the old allocated table if there is one.
-
- if Attr_Ref.Vector = null
- or else Attr_Ref.Vector'Length < Entryno
- then
- Attr_Ref.Vector := new AST_Handler_Vector (1 .. Entryno);
-
- for E in 1 .. Entryno loop
- Attr_Ref.Vector (E).Descriptor :=
- Original_Descriptor_Ref.all;
- Attr_Ref.Vector (E).Original_Descriptor_Ref :=
- Original_Descriptor_Ref;
- Attr_Ref.Vector (E).Taskid := Taskid;
- Attr_Ref.Vector (E).Entryno := E;
- end loop;
- end if;
-
- return To_AST_Handler (Attr_Ref.Vector (Entryno)'Unrestricted_Access);
- end Create_AST_Handler;
-
- ----------------------------
- -- Expand_AST_Packet_Pool --
- ----------------------------
-
- procedure Expand_AST_Packet_Pool
- (Requested_Packets : in Natural;
- Actual_Number : out Natural;
- Total_Number : out Natural)
- is
- pragma Unreferenced (Requested_Packets);
- begin
- -- The AST implementation of GNAT does not permit dynamic expansion
- -- of the pool, so we simply add no entries and return the total. If
- -- it is necessary to expand the allocation, then this package body
- -- must be recompiled with a larger value for AST_Service_Queue_Size.
-
- Actual_Number := 0;
- Total_Number := AST_Service_Queue_Size;
- end Expand_AST_Packet_Pool;
-
- -----------------
- -- Process_AST --
- -----------------
-
- procedure Process_AST (Param : Long_Integer) is
-
- Handler_Data_Ptr : AST_Handler_Data_Ref;
- -- This variable is set to the address of the descriptor through
- -- which Process_AST is called. Since the descriptor is part of
- -- an AST_Handler value, this is also the address of this value,
- -- from which we can obtain the task and entry number information.
-
- function To_Address is new Ada.Unchecked_Conversion
- (ST.Task_Id, System.Address);
-
- begin
- System.Machine_Code.Asm
- (Template => "addl $27,0,%0",
- Outputs => AST_Handler_Data_Ref'Asm_Output ("=r", Handler_Data_Ptr),
- Volatile => True);
-
- System.Machine_Code.Asm
- (Template => "ldl $27,%0",
- Inputs => Descriptor_Ref'Asm_Input
- ("m", Handler_Data_Ptr.Original_Descriptor_Ref),
- Volatile => True);
-
- AST_Service_Queue (AST_Service_Queue_Put) := AST_Instance'
- (Taskid => Handler_Data_Ptr.Taskid,
- Entryno => Handler_Data_Ptr.Entryno,
- Param => Param);
-
- -- OpenVMS Programming Concepts manual, chapter 8.2.3:
- -- "Implicit synchronization can be achieved for data that is shared
- -- for write by using only AST routines to write the data, since only
- -- one AST can be running at any one time."
-
- -- This subprogram runs at AST level so is guaranteed to be
- -- called sequentially at a given access level.
-
- AST_Service_Queue_Put := AST_Service_Queue_Put + 1;
-
- -- Need to wake up processing task. If there is no waiting server
- -- then we have temporarily run out, but things should still be
- -- OK, since one of the active ones will eventually pick up the
- -- service request queued in the AST_Service_Queue.
-
- for J in 1 .. Num_AST_Servers loop
- if Is_Waiting (J) then
- Is_Waiting (J) := False;
-
- -- Sleeps are handled by ASTs on VMS, so don't call Wakeup.
-
- STPOD.Interrupt_AST_Handler (To_Address (AST_Task_Ids (J)));
- exit;
- end if;
- end loop;
- end Process_AST;
-
-begin
- STPO.Initialize_Lock (AST_Lock'Access, STPO.Global_Task_Level);
-end System.AST_Handling;
diff --git a/gcc/ada/s-atacco.adb b/gcc/ada/s-atacco.adb
index 1be1f2a83ab..474a18d84ee 100644
--- a/gcc/ada/s-atacco.adb
+++ b/gcc/ada/s-atacco.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,10 +31,10 @@
-- --
------------------------------------------------------------------------------
+-- This is a dummy version of this package that is needed to solve bootstrap
+-- problems when compiling a library that doesn't require s-atacco.adb from
+-- a compiler that contains one.
+
package body System.Address_To_Access_Conversions is
- -- This body is now superfluous and should be removed.
- procedure Nothing is
- begin
- null;
- end Nothing;
+
end System.Address_To_Access_Conversions;
diff --git a/gcc/ada/s-atacco.ads b/gcc/ada/s-atacco.ads
index baf37b776a2..6f8bd94b81a 100644
--- a/gcc/ada/s-atacco.ads
+++ b/gcc/ada/s-atacco.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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 --
@@ -41,6 +41,12 @@ generic
package System.Address_To_Access_Conversions is
pragma Preelaborate (Address_To_Access_Conversions);
+pragma Elaborate_Body;
+-- This pragma Elaborate_Body is there to ensure the requirement of what is
+-- at the moment a dummy null body. The reason this null body is there is
+-- that we used to have a real body, and it causes bootstrap problems with
+-- old compilers if we try to remove the corresponding file.
+
pragma Compile_Time_Warning
(Object'Unconstrained_Array,
"Object is unconstrained array type" & ASCII.LF &
@@ -62,6 +68,4 @@ pragma Preelaborate (Address_To_Access_Conversions);
pragma Import (Intrinsic, To_Pointer);
pragma Import (Intrinsic, To_Address);
-private
- procedure Nothing; -- For now, until body is removed ???
end System.Address_To_Access_Conversions;
diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads
index 9fef16b4f24..42bdf02c73e 100644
--- a/gcc/ada/s-crtl.ads
+++ b/gcc/ada/s-crtl.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2005 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- --
@@ -41,6 +41,9 @@ pragma Preelaborate (CRTL);
subtype chars is System.Address;
-- Pointer to null-terminated array of characters
+ subtype DIRs is System.Address;
+ -- Corresponds to the C type DIR*
+
subtype FILEs is System.Address;
-- Corresponds to the C type FILE*
@@ -59,6 +62,15 @@ pragma Preelaborate (CRTL);
procedure clearerr (stream : FILEs);
pragma Import (C, clearerr, "clearerr");
+ function closedir (directory : DIRs) return Integer;
+ pragma Import (C, closedir, "closedir");
+
+ function dup (handle : int) return int;
+ pragma Import (C, dup, "dup");
+
+ function dup2 (from, to : int) return int;
+ pragma Import (C, dup2, "dup2");
+
function fclose (stream : FILEs) return int;
pragma Import (C, fclose, "fclose");
@@ -124,6 +136,9 @@ pragma Preelaborate (CRTL);
procedure mktemp (template : chars);
pragma Import (C, mktemp, "mktemp");
+ function opendir (file_name : String) return DIRs;
+ pragma Import (C, opendir, "opendir");
+
function read (fd : int; buffer : chars; nbytes : int) return int;
pragma Import (C, read, "read");
@@ -134,6 +149,9 @@ pragma Preelaborate (CRTL);
procedure rewind (stream : FILEs);
pragma Import (C, rewind, "rewind");
+ procedure rmdir (dir_name : String);
+ pragma Import (C, rmdir, "rmdir");
+
function setvbuf
(stream : FILEs;
buffer : chars;
diff --git a/gcc/ada/s-finimp.adb b/gcc/ada/s-finimp.adb
index a98196ace81..e2a8aaa0b5d 100644
--- a/gcc/ada/s-finimp.adb
+++ b/gcc/ada/s-finimp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,6 +38,7 @@ with System.Storage_Elements;
with System.Soft_Links;
with Unchecked_Conversion;
+with System.Restrictions;
package body System.Finalization_Implementation is
@@ -137,10 +138,10 @@ package body System.Finalization_Implementation is
-- Start of processing for Adjust
begin
- -- Adjust the components and their finalization pointers next.
- -- We must protect against an exception in some call to Adjust, so
- -- we keep pointing to the list of successfully adjusted components,
- -- which can be finalized if an exception is raised.
+ -- Adjust the components and their finalization pointers next. We must
+ -- protect against an exception in some call to Adjust, so we keep
+ -- pointing to the list of successfully adjusted components, which can
+ -- be finalized if an exception is raised.
First_Comp := Object.F;
Object.F := null; -- nothing adjusted yet.
@@ -155,8 +156,8 @@ package body System.Finalization_Implementation is
when others =>
-- Finalize those components that were successfully adjusted, and
-- propagate exception. The object itself is not yet attached to
- -- global finalization list, so we cannot rely on the outer call
- -- to Clean to take care of these components.
+ -- global finalization list, so we cannot rely on the outer call to
+ -- Clean to take care of these components.
Finalize (Object);
raise;
@@ -178,10 +179,10 @@ package body System.Finalization_Implementation is
Obj.Next := L;
L := Obj'Unchecked_Access;
- -- Dynamically allocated objects: they are attached to a doubly
- -- linked list, so that an element can be finalized at any moment
- -- by means of an unchecked deallocation. Attachement is
- -- protected against multi-threaded access.
+ -- Dynamically allocated objects: they are attached to a doubly linked
+ -- list, so that an element can be finalized at any moment by means of
+ -- an unchecked deallocation. Attachement is protected against
+ -- multi-threaded access.
elsif Nb_Link = 2 then
@@ -348,10 +349,10 @@ package body System.Finalization_Implementation is
procedure Detach_From_Final_List (Obj : in out Finalizable) is
begin
- -- When objects are not properly attached to a doubly linked
- -- list do not try to detach them. The only case where it can
- -- happen is when dealing with Finalize_Storage_Only objects
- -- which are not always attached.
+ -- When objects are not properly attached to a doubly linked list do
+ -- not try to detach them. The only case where it can happen is when
+ -- dealing with Finalize_Storage_Only objects which are not always
+ -- attached to the finalization list.
if Obj.Next /= null and then Obj.Prev /= null then
SSL.Lock_Task.all;
@@ -414,17 +415,22 @@ package body System.Finalization_Implementation is
end record;
type Ptr is access all Fake_Exception_Occurence;
- -- Let's get the current exception before starting to finalize in
- -- order to check if we are in the abort case if an exception is
- -- raised.
-
function To_Ptr is new
- Unchecked_Conversion (Exception_Occurrence_Access, Ptr);
+ Unchecked_Conversion (Exception_Occurrence_Access, Ptr);
- X : constant Exception_Id :=
- To_Ptr (System.Soft_Links.Get_Current_Excep.all).Id;
+ X : Exception_Id := Null_Id;
begin
+ -- If abort is allowed, we get the current exception before starting
+ -- to finalize in order to check if we are in the abort case if an
+ -- exception is raised. When abort is not allowed, avoid accessing the
+ -- current exception since this can be a pretty costly operation in
+ -- programs using controlled types heavily.
+
+ if System.Restrictions.Abort_Allowed then
+ X := To_Ptr (System.Soft_Links.Get_Current_Excep.all).Id;
+ end if;
+
while P /= null loop
Q := P.Next;
Finalize (P.all);
@@ -447,7 +453,6 @@ package body System.Finalization_Implementation is
begin
Detach_From_Final_List (Obj);
Finalize (Obj);
-
exception
when E_Occ : others => Raise_From_Finalize (null, False, E_Occ);
end Finalize_One;
@@ -461,7 +466,6 @@ package body System.Finalization_Implementation is
Offset : SSE.Storage_Offset := RC_Offset (The_Tag);
begin
-
-- Fetch the controller from the Parent or above if necessary
-- when there are no controller at this level
@@ -484,7 +488,8 @@ package body System.Finalization_Implementation is
-- ancestor corresponding to the tag "The_Tag" and that its parent
-- is variable sized. We assume that the _controller is the first
-- compoment right after the parent.
- -- ??? note that it may not be true if there are new discriminants.
+
+ -- ??? note that it may not be true if there are new discriminants
else -- Offset = -1
@@ -527,7 +532,6 @@ package body System.Finalization_Implementation is
procedure Initialize (Object : in out Limited_Record_Controller) is
pragma Warnings (Off, Object);
-
begin
null;
end Initialize;
diff --git a/gcc/ada/s-imgwch.adb b/gcc/ada/s-imgwch.adb
index 61bf08fa130..09d4e5844c4 100644
--- a/gcc/ada/s-imgwch.adb
+++ b/gcc/ada/s-imgwch.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -42,9 +42,8 @@ package body System.Img_WChar is
--------------------------
function Image_Wide_Character
- (V : Wide_Character;
- EM : WC_Encoding_Method)
- return String
+ (V : Wide_Character;
+ EM : WC_Encoding_Method) return String
is
Val : constant Natural := Wide_Character'Pos (V);
WS : Wide_String (1 .. 3);
@@ -79,7 +78,38 @@ package body System.Img_WChar is
return Wide_String_To_String (WS, EM);
end if;
-
end Image_Wide_Character;
+ -------------------------------
+ -- Image_Wide_Wide_Character --
+ -------------------------------
+
+ function Image_Wide_Wide_Character
+ (V : Wide_Wide_Character;
+ EM : WC_Encoding_Method) return String
+ is
+ Val : constant Natural := Wide_Wide_Character'Pos (V);
+ WS : Wide_Wide_String (1 .. 3);
+
+ begin
+ -- If in range of standard Wide_Character, then we use the
+ -- Wide_Character routine
+
+ if Val <= 16#FFFF# then
+ return Image_Wide_Character (Wide_Character'Val (Val), EM);
+
+ -- Otherwise return an appropriate escape sequence (i.e. one matching
+ -- the convention implemented by Scn.Wide_Wide_Char). The easiest thing
+ -- is to build a wide string for the result, and then use the
+ -- Wide_Wide_Value function to build the resulting String.
+
+ else
+ WS (1) := ''';
+ WS (2) := V;
+ WS (3) := ''';
+
+ return Wide_Wide_String_To_String (WS, EM);
+ end if;
+ end Image_Wide_Wide_Character;
+
end System.Img_WChar;
diff --git a/gcc/ada/s-imgwch.ads b/gcc/ada/s-imgwch.ads
index f6dc11fb477..fa472aa26d4 100644
--- a/gcc/ada/s-imgwch.ads
+++ b/gcc/ada/s-imgwch.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,7 +31,7 @@
-- --
------------------------------------------------------------------------------
--- Wide_Character'Image
+-- Wide_[Wide_]Character'Image
with System.WCh_Con;
@@ -39,10 +39,18 @@ package System.Img_WChar is
pragma Pure (Img_WChar);
function Image_Wide_Character
- (V : Wide_Character;
- EM : System.WCh_Con.WC_Encoding_Method)
- return String;
- -- Computes Wode_Character'Image (V) and returns the computed result,
+ (V : Wide_Character;
+ EM : System.WCh_Con.WC_Encoding_Method) return String;
+ -- Computes Wide_Character'Image (V) and returns the computed result,
+ -- The argument EM is a constant representing the encoding method in use.
+ -- The encoding method used is guaranteed to be consistent across a
+ -- given program execution and to correspond to the method used in the
+ -- source programs.
+
+ function Image_Wide_Wide_Character
+ (V : Wide_Wide_Character;
+ EM : System.WCh_Con.WC_Encoding_Method) return String;
+ -- Computes Wide_Wide_Character'Image (V) and returns the computed result,
-- The argument EM is a constant representing the encoding method in use.
-- The encoding method used is guaranteed to be consistent across a
-- given program execution and to correspond to the method used in the
diff --git a/gcc/ada/s-osinte-vxworks.ads b/gcc/ada/s-osinte-vxworks.ads
index 09ace65013a..324db3e4d30 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-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2005, 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- --
@@ -287,8 +287,10 @@ package System.OS_Interface is
function kernelTimeSlice (ticks : int) return int;
pragma Import (C, kernelTimeSlice, "kernelTimeSlice");
- function taskPrioritySet
- (tid : t_id; newPriority : int) return int;
+ function taskPriorityGet (tid : t_id; pPriority : access int) return int;
+ pragma Import (C, taskPriorityGet, "taskPriorityGet");
+
+ function taskPrioritySet (tid : t_id; newPriority : int) return int;
pragma Import (C, taskPrioritySet, "taskPrioritySet");
-- Semaphore creation flags.
diff --git a/gcc/ada/s-scaval.adb b/gcc/ada/s-scaval.adb
index 97a5f87d9ba..b6ca08c16dd 100644
--- a/gcc/ada/s-scaval.adb
+++ b/gcc/ada/s-scaval.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003-2005 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- --
@@ -159,6 +159,11 @@ package body System.Scalar_Values is
IS_Iu4 := 16#FFFF_FFFF#;
IS_Iu8 := 16#FFFF_FFFF_FFFF_FFFF#;
+ IS_Iz1 := 16#00#;
+ IS_Iz2 := 16#0000#;
+ IS_Iz4 := 16#0000_0000#;
+ IS_Iz8 := 16#0000_0000_0000_0000#;
+
IV_Isf := IS_Iu4;
IV_Ifl := IS_Iu4;
IV_Ilf := IS_Iu8;
@@ -180,6 +185,11 @@ package body System.Scalar_Values is
IS_Iu4 := 16#0000_0000#;
IS_Iu8 := 16#0000_0000_0000_0000#;
+ IS_Iz1 := 16#00#;
+ IS_Iz2 := 16#0000#;
+ IS_Iz4 := 16#0000_0000#;
+ IS_Iz8 := 16#0000_0000_0000_0000#;
+
IV_Isf := 16#FF80_0000#;
IV_Ifl := 16#FF80_0000#;
IV_Ilf := 16#FFF0_0000_0000_0000#;
@@ -201,6 +211,11 @@ package body System.Scalar_Values is
IS_Iu4 := 16#FFFF_FFFF#;
IS_Iu8 := 16#FFFF_FFFF_FFFF_FFFF#;
+ IS_Iz1 := 16#FF#;
+ IS_Iz2 := 16#FFFF#;
+ IS_Iz4 := 16#FFFF_FFFF#;
+ IS_Iz8 := 16#FFFF_FFFF_FFFF_FFFF#;
+
IV_Isf := 16#7F80_0000#;
IV_Ifl := 16#7F80_0000#;
IV_Ilf := 16#7FF0_0000_0000_0000#;
@@ -238,6 +253,11 @@ package body System.Scalar_Values is
IS_Iu4 := IS_Is4;
IS_Iu8 := IS_Is8;
+ IS_Iz1 := IS_Is1;
+ IS_Iz2 := IS_Is2;
+ IS_Iz4 := IS_Is4;
+ IS_Iz8 := IS_Is8;
+
IV_Isf := IS_Is4;
IV_Ifl := IS_Is4;
IV_Ilf := IS_Is8;
@@ -259,8 +279,6 @@ package body System.Scalar_Values is
IV_Ill := To_ByteLF (IV_Ilf);
end;
end if;
-
-
end Initialize;
end System.Scalar_Values;
diff --git a/gcc/ada/s-scaval.ads b/gcc/ada/s-scaval.ads
index 9db3c9830d8..da8e809baea 100644
--- a/gcc/ada/s-scaval.ads
+++ b/gcc/ada/s-scaval.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005 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- --
@@ -53,14 +53,27 @@ package System.Scalar_Values is
-- The explicit initializations here are not really required, since these
-- variables are always set by System.Scalar_Values.Initialize.
- IS_Is1 : Byte1 := 0; -- Initialize 1 byte signed
- IS_Is2 : Byte2 := 0; -- Initialize 2 byte signed
- IS_Is4 : Byte4 := 0; -- Initialize 4 byte signed
- IS_Is8 : Byte8 := 0; -- Initialize 8 byte signed
- IS_Iu1 : Byte1 := 0; -- Initialize 1 byte unsigned
- IS_Iu2 : Byte2 := 0; -- Initialize 2 byte unsigned
- IS_Iu4 : Byte4 := 0; -- Initialize 4 byte unsigned
- IS_Iu8 : Byte8 := 0; -- Initialize 8 byte unsigned
+ IS_Is1 : Byte1 := 0; -- Initialize 1 byte signed
+ IS_Is2 : Byte2 := 0; -- Initialize 2 byte signed
+ IS_Is4 : Byte4 := 0; -- Initialize 4 byte signed
+ IS_Is8 : Byte8 := 0; -- Initialize 8 byte signed
+ -- For the above cases, the undefined value (set by the binder -Sin switch)
+ -- is the largest negative number (1 followed by all zero bits).
+
+ IS_Iu1 : Byte1 := 0; -- Initialize 1 byte unsigned
+ IS_Iu2 : Byte2 := 0; -- Initialize 2 byte unsigned
+ IS_Iu4 : Byte4 := 0; -- Initialize 4 byte unsigned
+ IS_Iu8 : Byte8 := 0; -- Initialize 8 byte unsigned
+ -- For the above cases, the undefined value (set by the binder -Sin switch)
+ -- is the largest unsigned number (all 1 bits).
+
+ IS_Iz1 : Byte1 := 0; -- Initialize 1 byte zeroes
+ IS_Iz2 : Byte2 := 0; -- Initialize 2 byte zeroes
+ IS_Iz4 : Byte4 := 0; -- Initialize 4 byte zeroes
+ IS_Iz8 : Byte8 := 0; -- Initialize 8 byte zeroes
+ -- For the above cases, the undefined value (set by the binder -Sin switch)
+ -- is the zero (all 0 bits). This is used when zero is known to be an
+ -- invalid value.
-- The float definitions are aliased, because we use overlays to set them
diff --git a/gcc/ada/s-soflin.ads b/gcc/ada/s-soflin.ads
index 2b74bec1932..256039d924b 100644
--- a/gcc/ada/s-soflin.ads
+++ b/gcc/ada/s-soflin.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -121,8 +121,7 @@ package System.Soft_Links is
-- Handle task abortion (non-tasking case, does nothing). Currently,
-- only VMS uses this.
- procedure Update_Exception_NT
- (X : EO := Current_Target_Exception);
+ procedure Update_Exception_NT (X : EO := Current_Target_Exception);
-- Handle exception setting. This routine is provided for targets
-- which have built-in exception handling such as the Java Virtual
-- Machine. Currently, only JGNAT uses this. See 4jexcept.ads for
diff --git a/gcc/ada/s-strops.adb b/gcc/ada/s-strops.adb
index 5440f72f53e..ae7e267cb9c 100644
--- a/gcc/ada/s-strops.adb
+++ b/gcc/ada/s-strops.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -102,26 +102,4 @@ package body System.String_Ops is
end if;
end Str_Concat_SC;
- -------------------
- -- Str_Normalize --
- -------------------
-
- procedure Str_Normalize (A : in out String) is
- begin
- for J in A'Range loop
- A (J) := Character'Last;
- end loop;
- end Str_Normalize;
-
- ------------------------
- -- Wide_Str_Normalize --
- ------------------------
-
- procedure Wide_Str_Normalize (A : in out Wide_String) is
- begin
- for J in A'Range loop
- A (J) := Wide_Character'Last;
- end loop;
- end Wide_Str_Normalize;
-
end System.String_Ops;
diff --git a/gcc/ada/s-strops.ads b/gcc/ada/s-strops.ads
index aac2fd66f81..da5fcdfbddf 100644
--- a/gcc/ada/s-strops.ads
+++ b/gcc/ada/s-strops.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,12 +49,4 @@ pragma Pure (String_Ops);
function Str_Concat_CC (X, Y : Character) return String;
-- Concatenate two characters
- procedure Str_Normalize (A : in out String);
- -- Initialize String object if pragma Normalize_Scalars is in effect.
-
- procedure Wide_Str_Normalize (A : in out Wide_String);
- -- Ditto for Wide_String.
-
- pragma Inline (Str_Normalize);
- pragma Inline (Wide_Str_Normalize);
end System.String_Ops;
diff --git a/gcc/ada/s-taprop-mingw.adb b/gcc/ada/s-taprop-mingw.adb
index e85d90320b7..d6a1a61ca9e 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-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -99,7 +99,7 @@ package body System.Task_Primitives.Operations is
----------------
Environment_Task_Id : Task_Id;
- -- A variable to hold Task_Id for the environment task.
+ -- A variable to hold Task_Id for the environment task
Single_RTS_Lock : aliased RTS_Lock;
-- This is a lock to allow only one thread of control in the RTS at
@@ -113,10 +113,10 @@ package body System.Task_Primitives.Operations is
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
FIFO_Within_Priorities : constant Boolean := Dispatching_Policy = 'F';
- -- Indicates whether FIFO_Within_Priorities is set.
+ -- Indicates whether FIFO_Within_Priorities is set
Foreign_Task_Elaborated : aliased Boolean := True;
- -- Used to identified fake tasks (i.e., non-Ada Threads).
+ -- Used to identified fake tasks (i.e., non-Ada Threads)
------------------------------------
-- The thread local storage index --
diff --git a/gcc/ada/s-taprop.ads b/gcc/ada/s-taprop.ads
index 41101095814..8cea06be6cc 100644
--- a/gcc/ada/s-taprop.ads
+++ b/gcc/ada/s-taprop.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -50,9 +50,9 @@ package System.Task_Primitives.Operations is
package OSI renames System.OS_Interface;
procedure Initialize (Environment_Task : ST.Task_Id);
- pragma Inline (Initialize);
- -- This must be called once, before any other subprograms of this
- -- package are called.
+ -- Perform initialization and set up of the environment task for proper
+ -- operation of the tasking run-time. This must be called once, before any
+ -- other subprograms of this package are called.
procedure Create_Task
(T : ST.Task_Id;
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb
index e09b6a56459..0355e61e4c5 100644
--- a/gcc/ada/s-tassta.adb
+++ b/gcc/ada/s-tassta.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -910,6 +910,13 @@ package body System.Tasking.Stages is
Secondary_Stack_Address : System.Address := Secondary_Stack'Address;
+ SEH_Table : aliased SSE.Storage_Array (1 .. 8);
+ -- Structured Exception Registration table (2 words)
+
+ procedure Install_SEH_Handler (Addr : System.Address);
+ pragma Import (C, Install_SEH_Handler, "__gnat_install_SEH_handler");
+ -- Install the SEH (Structured Exception Handling) handler
+
begin
pragma Assert (Self_ID.Deferral_Level = 1);
@@ -930,6 +937,11 @@ package body System.Tasking.Stages is
Enter_Task (Self_ID);
+ -- We setup the SEH (Structured Exception Handling) handler if supported
+ -- on the target.
+
+ Install_SEH_Handler (SEH_Table'Address);
+
-- We lock RTS_Lock to wait for activator to finish activating
-- the rest of the chain, so that everyone in the chain comes out
-- in priority order.
diff --git a/gcc/ada/s-tpopde-vms.adb b/gcc/ada/s-tpopde-vms.adb
index 5fa9a92e21d..c492c1b4cf9 100644
--- a/gcc/ada/s-tpopde-vms.adb
+++ b/gcc/ada/s-tpopde-vms.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 2000-2005 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- --
@@ -69,12 +69,17 @@ package body System.Task_Primitives.Operations.DEC is
-- Local Subprograms --
-----------------------
+ pragma Warnings (Off);
+ -- Task_Id is 64 bits wide (but only 32 bits significant) on Integrity/VMS
+
function To_Unsigned_Longword is new
Unchecked_Conversion (Task_Id, Unsigned_Longword);
function To_Task_Id is new
Unchecked_Conversion (Unsigned_Longword, Task_Id);
+ pragma Warnings (On);
+
function To_FAB_RAB is new
Unchecked_Conversion (Address, FAB_RAB_Access_Type);
diff --git a/gcc/ada/s-tporft.adb b/gcc/ada/s-tporft.adb
index feb922a6ce6..bcd7f97fd96 100644
--- a/gcc/ada/s-tporft.adb
+++ b/gcc/ada/s-tporft.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2005, 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- --
@@ -83,6 +83,9 @@ begin
Self_Id.Common.State := Runnable;
Self_Id.Awake_Count := 1;
+ Self_Id.Common.Task_Image (1 .. 14) := "foreign thread";
+ Self_Id.Common.Task_Image_Len := 14;
+
-- Since this is not an ordinary Ada task, we will start out undeferred
Self_Id.Deferral_Level := 0;
diff --git a/gcc/ada/s-vaflop.adb b/gcc/ada/s-vaflop.adb
index 35b5353e06a..10dbaef9f4c 100644
--- a/gcc/ada/s-vaflop.adb
+++ b/gcc/ada/s-vaflop.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005 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- --
@@ -40,6 +40,8 @@
with System.IO; use System.IO;
package body System.Vax_Float_Operations is
+ pragma Warnings (Off);
+ -- Warnings about infinite recursion when the -gnatdm switch is used.
-----------
-- Abs_F --
diff --git a/gcc/ada/s-valwch.adb b/gcc/ada/s-valwch.adb
index 5e75a979d5a..8d4604552dc 100644
--- a/gcc/ada/s-valwch.adb
+++ b/gcc/ada/s-valwch.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-1997, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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,7 @@
-- --
------------------------------------------------------------------------------
+with Interfaces; use Interfaces;
with System.Val_Util; use System.Val_Util;
with System.WCh_Con; use System.WCh_Con;
with System.WCh_StW; use System.WCh_StW;
@@ -42,9 +43,27 @@ package body System.Val_WChar is
--------------------------
function Value_Wide_Character
- (Str : String;
- EM : WC_Encoding_Method)
- return Wide_Character
+ (Str : String;
+ EM : WC_Encoding_Method) return Wide_Character
+ is
+ WWC : constant Wide_Wide_Character :=
+ Value_Wide_Wide_Character (Str, EM);
+ WWV : constant Unsigned_32 := Wide_Wide_Character'Pos (WWC);
+ begin
+ if WWV > 16#FFFF# then
+ raise Constraint_Error;
+ else
+ return Wide_Character'Val (WWV);
+ end if;
+ end Value_Wide_Character;
+
+ -------------------------------
+ -- Value_Wide_Wide_Character --
+ -------------------------------
+
+ function Value_Wide_Wide_Character
+ (Str : String;
+ EM : System.WCh_Con.WC_Encoding_Method) return Wide_Wide_Character
is
F : Natural;
L : Natural;
@@ -60,21 +79,20 @@ package body System.Val_WChar is
-- If just three characters, simple character case
if L - F = 2 then
- return Wide_Character'Val (Character'Pos (S (F + 1)));
+ return Wide_Wide_Character'Val (Character'Pos (S (F + 1)));
-- Otherwise must be a wide character in quotes. The easiest
- -- thing is to convert the string to a wide string and then
+ -- thing is to convert the string to a wide wide string and then
-- pick up the single character that it should contain.
else
declare
- WS : constant Wide_String :=
- String_To_Wide_String (S (F + 1 .. L - 1), EM);
+ WS : constant Wide_Wide_String :=
+ String_To_Wide_Wide_String (S (F + 1 .. L - 1), EM);
begin
if WS'Length /= 1 then
raise Constraint_Error;
-
else
return WS (WS'First);
end if;
@@ -84,29 +102,28 @@ package body System.Val_WChar is
-- the last two values of the type have language-defined names:
elsif S = "FFFE" then
- return Wide_Character'Val (16#FFFE#);
+ return Wide_Wide_Character'Val (16#FFFE#);
elsif S = "FFFF" then
- return Wide_Character'Val (16#FFFF#);
+ return Wide_Wide_Character'Val (16#FFFF#);
-- Otherwise must be a control character
else
for C in Character'Val (16#00#) .. Character'Val (16#1F#) loop
if S (F .. L) = Character'Image (C) then
- return Wide_Character'Val (Character'Pos (C));
+ return Wide_Wide_Character'Val (Character'Pos (C));
end if;
end loop;
for C in Character'Val (16#7F#) .. Character'Val (16#9F#) loop
if S (F .. L) = Character'Image (C) then
- return Wide_Character'Val (Character'Pos (C));
+ return Wide_Wide_Character'Val (Character'Pos (C));
end if;
end loop;
raise Constraint_Error;
end if;
-
- end Value_Wide_Character;
+ end Value_Wide_Wide_Character;
end System.Val_WChar;
diff --git a/gcc/ada/s-valwch.ads b/gcc/ada/s-valwch.ads
index d8d0a82e83e..5075f756c2e 100644
--- a/gcc/ada/s-valwch.ads
+++ b/gcc/ada/s-valwch.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,15 +31,21 @@
-- --
------------------------------------------------------------------------------
+-- Processing for Wide_[Wide_]Value attribute
+
with System.WCh_Con;
package System.Val_WChar is
pragma Pure (Val_WChar);
function Value_Wide_Character
- (Str : String;
- EM : System.WCh_Con.WC_Encoding_Method)
- return Wide_Character;
+ (Str : String;
+ EM : System.WCh_Con.WC_Encoding_Method) return Wide_Character;
+ -- Computes Wide_Character'Value (Str).
+
+ function Value_Wide_Wide_Character
+ (Str : String;
+ EM : System.WCh_Con.WC_Encoding_Method) return Wide_Wide_Character;
-- Computes Wide_Character'Value (Str).
end System.Val_WChar;
diff --git a/gcc/ada/s-wchcnv.adb b/gcc/ada/s-wchcnv.adb
index 3da16f854ea..77ee233b70f 100644
--- a/gcc/ada/s-wchcnv.adb
+++ b/gcc/ada/s-wchcnv.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -41,54 +41,70 @@ with System.WCh_JIS; use System.WCh_JIS;
package body System.WCh_Cnv is
- --------------------------------
- -- Char_Sequence_To_Wide_Char --
- --------------------------------
+ -----------------------------
+ -- Char_Sequence_To_UTF_32 --
+ -----------------------------
- function Char_Sequence_To_Wide_Char
- (C : Character;
- EM : WC_Encoding_Method)
- return Wide_Character
+ function Char_Sequence_To_UTF_32
+ (C : Character;
+ EM : WC_Encoding_Method) return UTF_32_Code
is
- B1 : Integer;
+ B1 : Unsigned_32;
C1 : Character;
- U : Unsigned_16;
- W : Unsigned_16;
+ U : Unsigned_32;
+ W : Unsigned_32;
procedure Get_Hex (N : Character);
-- If N is a hex character, then set B1 to 16 * B1 + character N.
-- Raise Constraint_Error if character N is not a hex character.
+ procedure Get_UTF_Byte;
+ pragma Inline (Get_UTF_Byte);
+ -- Used to interpret a 2#10xxxxxx# continuation byte in UTF-8 mode.
+ -- Reads a byte, and raises CE if the first two bits are not 10.
+ -- Otherwise shifts W 6 bits left and or's in the 6 xxxxxx bits.
+
-------------
-- Get_Hex --
-------------
procedure Get_Hex (N : Character) is
- B2 : constant Integer := Character'Pos (N);
-
+ B2 : constant Unsigned_32 := Character'Pos (N);
begin
if B2 in Character'Pos ('0') .. Character'Pos ('9') then
B1 := B1 * 16 + B2 - Character'Pos ('0');
-
elsif B2 in Character'Pos ('A') .. Character'Pos ('F') then
B1 := B1 * 16 + B2 - (Character'Pos ('A') - 10);
-
elsif B2 in Character'Pos ('a') .. Character'Pos ('f') then
B1 := B1 * 16 + B2 - (Character'Pos ('a') - 10);
-
else
raise Constraint_Error;
end if;
end Get_Hex;
- -- Start of processing for Char_Sequence_To_Wide_Char
+ ------------------
+ -- Get_UTF_Byte --
+ ------------------
+
+ procedure Get_UTF_Byte is
+ begin
+ U := Unsigned_32 (Character'Pos (In_Char));
+
+ if (U and 2#11000000#) /= 2#10_000000# then
+ raise Constraint_Error;
+ end if;
+
+ W := Shift_Left (W, 6) or (U and 2#00111111#);
+ end Get_UTF_Byte;
+
+ -- Start of processing for Char_Sequence_To_Wide
begin
case EM is
when WCEM_Hex =>
if C /= ASCII.ESC then
- return Wide_Character'Val (Character'Pos (C));
+ return Character'Pos (C);
else
B1 := 0;
@@ -97,82 +113,106 @@ package body System.WCh_Cnv is
Get_Hex (In_Char);
Get_Hex (In_Char);
- return Wide_Character'Val (B1);
+ return UTF_32_Code (B1);
end if;
when WCEM_Upper =>
if C > ASCII.DEL then
- return
- Wide_Character'Val
- (Integer (256 * Character'Pos (C)) +
- Character'Pos (In_Char));
+ return 256 * Character'Pos (C) + Character'Pos (In_Char);
else
- return Wide_Character'Val (Character'Pos (C));
+ return Character'Pos (C);
end if;
when WCEM_Shift_JIS =>
if C > ASCII.DEL then
- return Shift_JIS_To_JIS (C, In_Char);
+ return Wide_Character'Pos (Shift_JIS_To_JIS (C, In_Char));
else
- return Wide_Character'Val (Character'Pos (C));
+ return Character'Pos (C);
end if;
when WCEM_EUC =>
if C > ASCII.DEL then
- return EUC_To_JIS (C, In_Char);
+ return Wide_Character'Pos (EUC_To_JIS (C, In_Char));
else
- return Wide_Character'Val (Character'Pos (C));
+ return Character'Pos (C);
end if;
when WCEM_UTF8 =>
- if C > ASCII.DEL then
- -- 16#0080#-16#07ff#: 2#110xxxxx# 2#10xxxxxx#
- -- 16#0800#-16#ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
+ -- Note: for details of UTF8 encoding see RFC 3629
- U := Unsigned_16 (Character'Pos (C));
+ U := Unsigned_32 (Character'Pos (C));
- if (U and 2#11100000#) = 2#11000000# then
- W := Shift_Left (U and 2#00011111#, 6);
- U := Unsigned_16 (Character'Pos (In_Char));
+ -- 16#00_0000#-16#00_007F#: 0xxxxxxx
- if (U and 2#11000000#) /= 2#10000000# then
- raise Constraint_Error;
- end if;
+ if (U and 2#10000000#) = 2#00000000# then
+ return Character'Pos (C);
- W := W or (U and 2#00111111#);
+ -- 16#00_0080#-16#00_07FF#: 110xxxxx 10xxxxxx
- elsif (U and 2#11110000#) = 2#11100000# then
- W := Shift_Left (U and 2#00001111#, 12);
- U := Unsigned_16 (Character'Pos (In_Char));
+ elsif (U and 2#11100000#) = 2#110_00000# then
+ W := Shift_Left (U and 2#00011111#, 6);
+ U := Unsigned_32 (Character'Pos (In_Char));
- if (U and 2#11000000#) /= 2#10000000# then
- raise Constraint_Error;
- end if;
+ if (U and 2#11000000#) /= 2#10_000000# then
+ raise Constraint_Error;
+ end if;
- W := W or Shift_Left (U and 2#00111111#, 6);
- U := Unsigned_16 (Character'Pos (In_Char));
+ W := W or (U and 2#00111111#);
- if (U and 2#11000000#) /= 2#10000000# then
- raise Constraint_Error;
- end if;
+ return UTF_32_Code (W);
- W := W or (U and 2#00111111#);
+ -- 16#00_0800#-16#00_ffff#: 1110xxxx 10xxxxxx 10xxxxxx
- else
- raise Constraint_Error;
- end if;
+ elsif (U and 2#11110000#) = 2#1110_0000# then
+ W := U and 2#00001111#;
+ Get_UTF_Byte;
+ Get_UTF_Byte;
+ return UTF_32_Code (W);
+
+ -- 16#01_0000#-16#10_FFFF#: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+
+ elsif (U and 2#11111000#) = 2#11110_000# then
+ W := U and 2#00000111#;
+
+ for K in 1 .. 3 loop
+ Get_UTF_Byte;
+ end loop;
- return Wide_Character'Val (W);
+ return UTF_32_Code (W);
+
+ -- 16#0020_0000#-16#03FF_FFFF#: 111110xx 10xxxxxx 10xxxxxx
+ -- 10xxxxxx 10xxxxxx
+
+ elsif (U and 2#11111100#) = 2#111110_00# then
+ W := U and 2#00000011#;
+
+ for K in 1 .. 4 loop
+ Get_UTF_Byte;
+ end loop;
+
+ return UTF_32_Code (W);
+
+ -- 16#0400_0000#-16#7FFF_FFFF#: 1111110x 10xxxxxx 10xxxxxx
+ -- 10xxxxxx 10xxxxxx 10xxxxxx
+
+ elsif (U and 2#11111110#) = 2#1111110_0# then
+ W := U and 2#00000001#;
+
+ for K in 1 .. 5 loop
+ Get_UTF_Byte;
+ end loop;
+
+ return UTF_32_Code (W);
else
- return Wide_Character'Val (Character'Pos (C));
+ raise Constraint_Error;
end if;
when WCEM_Brackets =>
if C /= '[' then
- return Wide_Character'Val (Character'Pos (C));
+ return Character'Pos (C);
end if;
if In_Char /= '"' then
@@ -182,15 +222,33 @@ package body System.WCh_Cnv is
B1 := 0;
Get_Hex (In_Char);
Get_Hex (In_Char);
+
C1 := In_Char;
if C1 /= '"' then
Get_Hex (C1);
Get_Hex (In_Char);
+
C1 := In_Char;
if C1 /= '"' then
- raise Constraint_Error;
+ Get_Hex (C1);
+ Get_Hex (In_Char);
+
+ C1 := In_Char;
+
+ if C1 /= '"' then
+ Get_Hex (C1);
+ Get_Hex (In_Char);
+
+ if B1 > Unsigned_32 (UTF_32_Code'Last) then
+ raise Constraint_Error;
+ end if;
+
+ if In_Char /= '"' then
+ raise Constraint_Error;
+ end if;
+ end if;
end if;
end if;
@@ -198,23 +256,44 @@ package body System.WCh_Cnv is
raise Constraint_Error;
end if;
- return Wide_Character'Val (B1);
+ return UTF_32_Code (B1);
end case;
- end Char_Sequence_To_Wide_Char;
+ end Char_Sequence_To_UTF_32;
--------------------------------
- -- Wide_Char_To_Char_Sequence --
+ -- Char_Sequence_To_Wide_Char --
--------------------------------
- procedure Wide_Char_To_Char_Sequence
- (WC : Wide_Character;
- EM : WC_Encoding_Method)
+ function Char_Sequence_To_Wide_Char
+ (C : Character;
+ EM : System.WCh_Con.WC_Encoding_Method) return Wide_Character
+ is
+ function Char_Sequence_To_UTF is new Char_Sequence_To_UTF_32 (In_Char);
+
+ U : constant UTF_32_Code := Char_Sequence_To_UTF (C, EM);
+
+ begin
+ if U > 16#FFFF# then
+ raise Constraint_Error;
+ else
+ return Wide_Character'Val (U);
+ end if;
+ end Char_Sequence_To_Wide_Char;
+
+ -----------------------------
+ -- UTF_32_To_Char_Sequence --
+ -----------------------------
+
+ procedure UTF_32_To_Char_Sequence
+ (Val : UTF_32_Code;
+ EM : System.WCh_Con.WC_Encoding_Method)
is
- Val : constant Natural := Wide_Character'Pos (WC);
- Hexc : constant array (0 .. 15) of Character := "0123456789ABCDEF";
+ Hexc : constant array (UTF_32_Code range 0 .. 15) of Character :=
+ "0123456789ABCDEF";
+
C1, C2 : Character;
- U : Unsigned_16;
+ U : Unsigned_32;
begin
case EM is
@@ -222,22 +301,21 @@ package body System.WCh_Cnv is
when WCEM_Hex =>
if Val < 256 then
Out_Char (Character'Val (Val));
-
- else
+ elsif Val <= 16#FFFF# then
Out_Char (ASCII.ESC);
Out_Char (Hexc (Val / (16**3)));
Out_Char (Hexc ((Val / (16**2)) mod 16));
Out_Char (Hexc ((Val / 16) mod 16));
Out_Char (Hexc (Val mod 16));
+ else
+ raise Constraint_Error;
end if;
when WCEM_Upper =>
if Val < 128 then
Out_Char (Character'Val (Val));
-
- elsif Val < 16#8000# then
+ elsif Val < 16#8000# or else Val > 16#FFFF# then
raise Constraint_Error;
-
else
Out_Char (Character'Val (Val / 256));
Out_Char (Character'Val (Val mod 256));
@@ -246,58 +324,136 @@ package body System.WCh_Cnv is
when WCEM_Shift_JIS =>
if Val < 128 then
Out_Char (Character'Val (Val));
- else
- JIS_To_Shift_JIS (WC, C1, C2);
+ elsif Val <= 16#FFFF# then
+ JIS_To_Shift_JIS (Wide_Character'Val (Val), C1, C2);
Out_Char (C1);
Out_Char (C2);
+ else
+ raise Constraint_Error;
end if;
when WCEM_EUC =>
if Val < 128 then
Out_Char (Character'Val (Val));
- else
- JIS_To_EUC (WC, C1, C2);
+ elsif Val <= 16#FFFF# then
+ JIS_To_EUC (Wide_Character'Val (Val), C1, C2);
Out_Char (C1);
Out_Char (C2);
+ else
+ raise Constraint_Error;
end if;
when WCEM_UTF8 =>
- U := Unsigned_16 (Val);
- -- 16#0000#-16#007f#: 2#0xxxxxxx#
- -- 16#0080#-16#07ff#: 2#110xxxxx# 2#10xxxxxx#
- -- 16#0800#-16#ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
+ -- Note: for details of UTF8 encoding see RFC 3629
+
+ U := Unsigned_32 (Val);
+
+ -- 16#00_0000#-16#00_007F#: 0xxxxxxx
- if U < 16#80# then
+ if U <= 16#00_007F# then
Out_Char (Character'Val (U));
- elsif U < 16#0800# then
+ -- 16#00_0080#-16#00_07FF#: 110xxxxx 10xxxxxx
+
+ elsif U <= 16#00_07FF# then
Out_Char (Character'Val (2#11000000# or Shift_Right (U, 6)));
Out_Char (Character'Val (2#10000000# or (U and 2#00111111#)));
- else
+ -- 16#00_0800#-16#00_FFFF#: 1110xxxx 10xxxxxx 10xxxxxx
+
+ elsif U <= 16#00_FFFF# then
Out_Char (Character'Val (2#11100000# or Shift_Right (U, 12)));
Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 6)
- and 2#00111111#)));
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (U and 2#00111111#)));
+
+ -- 16#01_0000#-16#10_FFFF#: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+
+ elsif U <= 16#10_FFFF# then
+ Out_Char (Character'Val (2#11110000# or Shift_Right (U, 18)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 12)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 6)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (U and 2#00111111#)));
+
+ -- 16#0020_0000#-16#03FF_FFFF#: 111110xx 10xxxxxx 10xxxxxx
+ -- 10xxxxxx 10xxxxxx
+
+ elsif U <= 16#03FF_FFFF# then
+ Out_Char (Character'Val (2#11111000# or Shift_Right (U, 24)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 18)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 12)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 6)
+ and 2#00111111#)));
Out_Char (Character'Val (2#10000000# or (U and 2#00111111#)));
+
+ -- 16#0400_0000#-16#7FFF_FFFF#: 1111110x 10xxxxxx 10xxxxxx
+ -- 10xxxxxx 10xxxxxx 10xxxxxx
+
+ elsif U <= 16#7FFF_FFFF# then
+ Out_Char (Character'Val (2#11111100# or Shift_Right (U, 30)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 24)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 18)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 12)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (Shift_Right (U, 6)
+ and 2#00111111#)));
+ Out_Char (Character'Val (2#10000000# or (U and 2#00111111#)));
+
+ else
+ raise Constraint_Error;
end if;
when WCEM_Brackets =>
-
if Val < 256 then
Out_Char (Character'Val (Val));
else
Out_Char ('[');
Out_Char ('"');
- Out_Char (Hexc (Val / (16**3)));
- Out_Char (Hexc ((Val / (16**2)) mod 16));
+
+ if Val > 16#FFFF# then
+ if Val > 16#00FF_FFFF# then
+ if Val > 16#7FFF_FFFF# then
+ raise Constraint_Error;
+ end if;
+
+ Out_Char (Hexc (Val / 16 ** 7));
+ Out_Char (Hexc ((Val / 16 ** 6) mod 16));
+ end if;
+
+ Out_Char (Hexc ((Val / 16 ** 5) mod 16));
+ Out_Char (Hexc ((Val / 16 ** 4) mod 16));
+ end if;
+
+ Out_Char (Hexc ((Val / 16 ** 3) mod 16));
+ Out_Char (Hexc ((Val / 16 ** 2) mod 16));
Out_Char (Hexc ((Val / 16) mod 16));
Out_Char (Hexc (Val mod 16));
+
Out_Char ('"');
Out_Char (']');
end if;
end case;
+ end UTF_32_To_Char_Sequence;
+
+ --------------------------------
+ -- Wide_Char_To_Char_Sequence --
+ --------------------------------
+
+ procedure Wide_Char_To_Char_Sequence
+ (WC : Wide_Character;
+ EM : System.WCh_Con.WC_Encoding_Method)
+ is
+ procedure UTF_To_Char_Sequence is new UTF_32_To_Char_Sequence (Out_Char);
+ begin
+ UTF_To_Char_Sequence (Wide_Character'Pos (WC), EM);
end Wide_Char_To_Char_Sequence;
end System.WCh_Cnv;
diff --git a/gcc/ada/s-wchcnv.ads b/gcc/ada/s-wchcnv.ads
index 65180ca2a57..e0bde89604a 100644
--- a/gcc/ada/s-wchcnv.ads
+++ b/gcc/ada/s-wchcnv.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,24 +31,23 @@
-- --
------------------------------------------------------------------------------
--- This package contains generic subprograms used for converting between
--- sequences of Character and Wide_Character. All access to wide character
--- sequences is isolated in this unit.
-
-- This unit may be used directly from an application program by providing
-- an appropriate WITH, and the interface can be expected to remain stable.
with System.WCh_Con;
package System.WCh_Cnv is
-pragma Pure (WCh_Cnv);
+ pragma Pure (WCh_Cnv);
+
+ type UTF_32_Code is range 0 .. 16#7FFF_FFFF#;
+ for UTF_32_Code'Size use 32;
+ -- Range of allowed UTF-32 encoding values
generic
with function In_Char return Character;
function Char_Sequence_To_Wide_Char
- (C : Character;
- EM : System.WCh_Con.WC_Encoding_Method)
- return Wide_Character;
+ (C : Character;
+ EM : System.WCh_Con.WC_Encoding_Method) return Wide_Character;
-- C is the first character of a sequence of one or more characters which
-- represent a wide character sequence. Calling the function In_Char for
-- additional characters as required, Char_To_Wide_Char returns the
@@ -57,6 +56,16 @@ pragma Pure (WCh_Cnv);
-- sequence for the given encoding method.
generic
+ with function In_Char return Character;
+ function Char_Sequence_To_UTF_32
+ (C : Character;
+ EM : System.WCh_Con.WC_Encoding_Method) return UTF_32_Code;
+ -- This is similar to the above, but the function returns a code from
+ -- the full UTF_32 code set, which covers the full range of possible
+ -- values in Wide_Wide_Character. The result can be converted to
+ -- Wide_Wide_Character form using Wide_Wide_Character'Val.
+
+ generic
with procedure Out_Char (C : Character);
procedure Wide_Char_To_Char_Sequence
(WC : Wide_Character;
@@ -66,4 +75,14 @@ pragma Pure (WCh_Cnv);
-- Constraint_Error is raised if the given wide character value is
-- not a valid value for the given encoding method.
+ generic
+ with procedure Out_Char (C : Character);
+ procedure UTF_32_To_Char_Sequence
+ (Val : UTF_32_Code;
+ EM : System.WCh_Con.WC_Encoding_Method);
+ -- This is similar to the above, but the input value is a code from the
+ -- full UTF_32 code set, which covers the full range of possible values
+ -- in Wide_Wide_Character. To convert a Wide_Wide_Character value, the
+ -- caller can use Wide_Wide_Character'Pos in the call.
+
end System.WCh_Cnv;
diff --git a/gcc/ada/s-wchcon.ads b/gcc/ada/s-wchcon.ads
index 3c08176edf6..eecfe9f34ee 100644
--- a/gcc/ada/s-wchcon.ads
+++ b/gcc/ada/s-wchcon.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -46,8 +46,8 @@ pragma Pure (WCh_Con);
-------------------------------------
-- A wide character encoding method is a method for uniquely representing
- -- a Wide_Character value using a one or more Character values. Three
- -- types of encoding method are supported by GNAT:
+ -- a Wide_Character or Wide_Wide_Character value using a one or more
+ -- Character values. Three types of encoding method are supported by GNAT:
-- An escape encoding method uses ESC as the first character of the
-- sequence, and subsequent characters determine the wide character
@@ -62,9 +62,10 @@ pragma Pure (WCh_Con);
-- Any character in the lower half (16#00# .. 16#7F#) represents
-- itself as a single character.
- -- The brackets notation, where a wide character is represented
- -- by the sequence ["xx"] or ["xxxx"] where xx are hexadecimal
- -- characters.
+ -- The brackets notation, where a wide character is represented by the
+ -- sequence ["xx"] or ["xxxx"] or ["xxxxxx"] where xx are hexadecimal
+ -- characters. Note that currently this is the only encoding that
+ -- supports the full UTF-32 range.
-- Note that GNAT does not currently support escape-in, escape-out
-- encoding methods, where an escape sequence is used to set a mode
@@ -130,25 +131,32 @@ pragma Pure (WCh_Con);
-- An ISO 10646-1 BMP/Unicode wide character is represented in
-- UCS Transformation Format 8 (UTF-8) as defined in Annex R of ISO
-- 10646-1/Am.2. Depending on the character value, a Unicode character
- -- is represented as the one, two, or three byte sequence
+ -- is represented as the one to six byte sequence.
--
- -- 16#0000#-16#007f#: 2#0xxxxxxx#
- -- 16#0080#-16#07ff#: 2#110xxxxx# 2#10xxxxxx#
- -- 16#0800#-16#ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
+ -- 16#0000_0000#-16#0000_007f#: 2#0xxxxxxx#
+ -- 16#0000_0080#-16#0000_07ff#: 2#110xxxxx# 2#10xxxxxx#
+ -- 16#0000_0800#-16#0000_ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
+ -- 16#0001_0000#-16#001F_FFFF#: 2#11110xxx# 2#10xxxxxx# 2#10xxxxxx#
+ -- 2#10xxxxxx#
+ -- 16#0020_0000#-16#03FF_FFFF#: 2#111110xx# 2#10xxxxxx# 2#10xxxxxx#
+ -- 2#10xxxxxx# 2#10xxxxxx#
+ -- 16#0400_0000#-16#7FFF_FFFF#: 2#1111110x# 2#10xxxxxx# 2#10xxxxxx#
+ -- 2#10xxxxxx# 2#10xxxxxx# 2#10xxxxxx#
--
- -- where the xxx bits correspond to the left-padded bits of the the
+ -- where the xxx bits correspond to the left-padded bits of the
-- 16-bit character value. Note that all lower half ASCII characters
-- are represented as ASCII bytes and all upper half characters and
- -- other wide characters are represented as sequences of upper-half
- -- (The full UTF-8 scheme allows for encoding 31-bit characters as
- -- 6-byte sequences, but in this implementation, all UTF-8 sequences
- -- of four or more bytes length will raise a Constraint_Error, as
- -- will all illegal UTF-8 sequences.)
+ -- other wide characters are represented as sequences of upper-half.
WCEM_Brackets : constant WC_Encoding_Method := 6;
- -- A wide character is represented as the sequence ["abcd"] where abcd
- -- are four hexadecimal characters. In this mode, the sequence ["ab"]
- -- is also recognized for the case of character codes in the range 0-255.
+ -- A wide character is represented using one of the following sequences:
+ --
+ -- ["xx"]
+ -- ["xxxx"]
+ -- ["xxxxxx"]
+ -- ["xxxxxxxx"]
+ --
+ -- where xx are hexadecimal digits representing the character code.
WC_Encoding_Letters : constant array (WC_Encoding_Method) of Character :=
(WCEM_Hex => 'h',
@@ -170,8 +178,8 @@ pragma Pure (WCh_Con);
-- Encoding methods using an upper half character (16#80#..16#FF) at
-- the start of the sequence.
- WC_Longest_Sequence : constant := 8;
- -- The longest number of characters that can be used for a wide
- -- character sequence for any of the active encoding methods.
+ WC_Longest_Sequence : constant := 10;
+ -- The longest number of characters that can be used for a wide character
+ -- or wide wide character sequence for any of the active encoding methods.
end System.WCh_Con;
diff --git a/gcc/ada/s-wchstw.adb b/gcc/ada/s-wchstw.adb
index 6e8d5cb7b72..0deb55631e2 100644
--- a/gcc/ada/s-wchstw.adb
+++ b/gcc/ada/s-wchstw.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,189 +31,142 @@
-- --
------------------------------------------------------------------------------
-with Interfaces; use Interfaces;
with System.WCh_Con; use System.WCh_Con;
-with System.WCh_JIS; use System.WCh_JIS;
+with System.WCh_Cnv; use System.WCh_Cnv;
package body System.WCh_StW is
- ---------------------------
- -- String_To_Wide_String --
- ---------------------------
-
- function String_To_Wide_String
- (S : String;
- EM : WC_Encoding_Method)
- return Wide_String
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
+
+ procedure Get_Next_Code
+ (S : String;
+ P : in out Natural;
+ V : out UTF_32_Code;
+ EM : WC_Encoding_Method);
+ -- Scans next character starting at S(P) and returns its value in V. On
+ -- exit P is updated past the last character read. Raises Constraint_Error
+ -- if the string is not well formed. Raises Constraint_Error if the code
+ -- value is greater than 16#7FFF_FFFF#. On entry P <= S'Last.
+
+ -------------------
+ -- Get_Next_Code --
+ -------------------
+
+ procedure Get_Next_Code
+ (S : String;
+ P : in out Natural;
+ V : out UTF_32_Code;
+ EM : WC_Encoding_Method)
is
- R : Wide_String (1 .. S'Length);
- RP : Natural;
- SP : Natural;
- U1 : Unsigned_16;
- U2 : Unsigned_16;
- U3 : Unsigned_16;
- U : Unsigned_16;
-
- Last : constant Natural := S'Last;
+ function In_Char return Character;
+ -- Function to return a character, bumping P, raises Constraint_Error
+ -- if P > S'Last on entry.
- function Get_Hex (C : Character) return Unsigned_16;
- -- Converts character from hex digit to value in range 0-15. The
- -- input must be in 0-9, A-F, or a-f, and no check is needed.
+ function Get_UTF_32 is new Char_Sequence_To_UTF_32 (In_Char);
+ -- Function to get next UFT_32 value.
- procedure Get_Hex_4;
- -- Translates four hex characters starting at S (SP) to a single
- -- wide character. Used in WCEM_Hex and WCEM_Brackets mode. SP
- -- is not modified by the call. The resulting wide character value
- -- is stored in R (RP). RP is not modified by the call.
+ -------------
+ -- In_Char --
+ -------------
- function Get_Hex (C : Character) return Unsigned_16 is
+ function In_Char return Character is
begin
- if C in '0' .. '9' then
- return Character'Pos (C) - Character'Pos ('0');
- elsif C in 'A' .. 'F' then
- return Character'Pos (C) - Character'Pos ('A') + 10;
+ if P > S'Last then
+ raise Constraint_Error;
else
- return Character'Pos (C) - Character'Pos ('a') + 10;
+ P := P + 1;
+ return S (P - 1);
end if;
- end Get_Hex;
+ end In_Char;
- procedure Get_Hex_4 is
- begin
- R (RP) := Wide_Character'Val (
- Get_Hex (S (SP + 3)) + 16 *
- (Get_Hex (S (SP + 2)) + 16 *
- (Get_Hex (S (SP + 1)) + 16 *
- (Get_Hex (S (SP + 0))))));
- end Get_Hex_4;
+ begin
+ -- Check for wide character encoding
- -- Start of processing for String_To_Wide_String
+ case EM is
+ when WCEM_Hex =>
+ if S (P) = ASCII.ESC then
+ V := Get_UTF_32 (In_Char, EM);
+ return;
+ end if;
+
+ when WCEM_Upper | WCEM_Shift_JIS | WCEM_EUC | WCEM_UTF8 =>
+ if S (P) >= Character'Val (16#80#) then
+ V := Get_UTF_32 (In_Char, EM);
+ return;
+ end if;
+
+ when WCEM_Brackets =>
+ if P + 2 <= S'Last
+ and then S (P) = '['
+ and then S (P + 1) = '"'
+ and then S (P + 2) /= '"'
+ then
+ V := Get_UTF_32 (In_Char, EM);
+ return;
+ end if;
+ end case;
+
+ -- If it is not a wide character code, just get it
+
+ V := Character'Pos (S (P));
+ P := P + 1;
+ end Get_Next_Code;
+
+ ---------------------------
+ -- String_To_Wide_String --
+ ---------------------------
+
+ function String_To_Wide_String
+ (S : String;
+ EM : WC_Encoding_Method) return Wide_String
+ is
+ R : Wide_String (1 .. S'Length);
+ RP : Natural;
+ SP : Natural;
+ V : UTF_32_Code;
begin
SP := S'First;
RP := 0;
+ while SP <= S'Last loop
+ Get_Next_Code (S, SP, V, EM);
- case EM is
+ if V > 16#FFFF# then
+ raise Constraint_Error;
+ end if;
- -- ESC-Hex representation
+ RP := RP + 1;
+ R (RP) := Wide_Character'Val (V);
+ end loop;
- when WCEM_Hex =>
- while SP <= Last - 4 loop
- RP := RP + 1;
-
- if S (SP) = ASCII.ESC then
- SP := SP + 1;
- Get_Hex_4;
- SP := SP + 4;
- else
- R (RP) := Wide_Character'Val (Character'Pos (S (SP)));
- SP := SP + 1;
- end if;
- end loop;
-
- -- Upper bit shift, internal code = external code
-
- when WCEM_Upper =>
- while SP < Last loop
- RP := RP + 1;
-
- if S (SP) >= Character'Val (16#80#) then
- U1 := Character'Pos (S (SP));
- U2 := Character'Pos (S (SP + 1));
- R (RP) := Wide_Character'Val (256 * U1 + U2);
- SP := SP + 2;
- else
- R (RP) := Wide_Character'Val (Character'Pos (S (SP)));
- SP := SP + 1;
- end if;
- end loop;
-
- -- Upper bit shift, shift-JIS
-
- when WCEM_Shift_JIS =>
- while SP < Last loop
- RP := RP + 1;
-
- if S (SP) >= Character'Val (16#80#) then
- R (RP) := Shift_JIS_To_JIS (S (SP), S (SP + 1));
- SP := SP + 2;
- else
- R (RP) := Wide_Character'Val (Character'Pos (S (SP)));
- SP := SP + 1;
- end if;
- end loop;
-
- -- Upper bit shift, EUC
-
- when WCEM_EUC =>
- while SP < Last loop
- RP := RP + 1;
-
- if S (SP) >= Character'Val (16#80#) then
- R (RP) := EUC_To_JIS (S (SP), S (SP + 1));
- SP := SP + 2;
- else
- R (RP) := Wide_Character'Val (Character'Pos (S (SP)));
- SP := SP + 1;
- end if;
- end loop;
-
- -- Upper bit shift, UTF-8
-
- when WCEM_UTF8 =>
- while SP < Last loop
- RP := RP + 1;
-
- if S (SP) >= Character'Val (16#80#) then
- U1 := Character'Pos (S (SP));
- U2 := Character'Pos (S (SP + 1));
-
- U := Shift_Left (U1 and 2#00011111#, 6) +
- (U2 and 2#00111111#);
- SP := SP + 2;
-
- if U1 >= 2#11100000# then
- U3 := Character'Pos (S (SP));
- U := Shift_Left (U, 6) + (U3 and 2#00111111#);
- SP := SP + 1;
- end if;
-
- R (RP) := Wide_Character'Val (U);
-
- else
- R (RP) := Wide_Character'Val (Character'Pos (S (SP)));
- SP := SP + 1;
- end if;
- end loop;
-
- -- Brackets representation
+ return R (1 .. RP);
+ end String_To_Wide_String;
- when WCEM_Brackets =>
- while SP <= Last - 7 loop
- RP := RP + 1;
-
- if S (SP) = '['
- and then S (SP + 1) = '"'
- and then S (SP + 2) /= '"'
- then
- SP := SP + 2;
- Get_Hex_4;
- SP := SP + 6;
-
- else
- R (RP) := Wide_Character'Val (Character'Pos (S (SP)));
- SP := SP + 1;
- end if;
- end loop;
+ --------------------------------
+ -- String_To_Wide_Wide_String --
+ --------------------------------
- end case;
+ function String_To_Wide_Wide_String
+ (S : String;
+ EM : WC_Encoding_Method) return Wide_Wide_String
+ is
+ R : Wide_Wide_String (1 .. S'Length);
+ RP : Natural;
+ SP : Natural;
+ V : UTF_32_Code;
- while SP <= Last loop
+ begin
+ SP := S'First;
+ RP := 0;
+ while SP <= S'Last loop
+ Get_Next_Code (S, SP, V, EM);
RP := RP + 1;
- R (RP) := Wide_Character'Val (Character'Pos (S (SP)));
- SP := SP + 1;
+ R (RP) := Wide_Wide_Character'Val (V);
end loop;
return R (1 .. RP);
- end String_To_Wide_String;
+ end String_To_Wide_Wide_String;
end System.WCh_StW;
diff --git a/gcc/ada/s-wchstw.ads b/gcc/ada/s-wchstw.ads
index c58066c1204..c1d33eb3f85 100644
--- a/gcc/ada/s-wchstw.ads
+++ b/gcc/ada/s-wchstw.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,8 +31,8 @@
-- --
------------------------------------------------------------------------------
--- This package contains the routine used to convert strings to wide
--- strings for use by wide character attributes (value, image etc.)
+-- This package contains the routine used to convert strings to wide (wide)
+-- strings for use by wide (wide) character attributes (value, image etc.)
with System.WCh_Con;
@@ -40,9 +40,8 @@ package System.WCh_StW is
pragma Pure (WCh_StW);
function String_To_Wide_String
- (S : String;
- EM : System.WCh_Con.WC_Encoding_Method)
- return Wide_String;
+ (S : String;
+ EM : System.WCh_Con.WC_Encoding_Method) return Wide_String;
-- This routine simply takes its argument and converts it to wide string
-- format. In the context of the Wide_Image attribute, the argument is
-- the corresponding 'Image attribute. Any wide character escape sequences
@@ -57,4 +56,9 @@ pragma Pure (WCh_StW);
-- Note: in the WCEM_Brackets case, the brackets escape sequence is used
-- only for codes greater than 16#FF#.
+ function String_To_Wide_Wide_String
+ (S : String;
+ EM : System.WCh_Con.WC_Encoding_Method) return Wide_Wide_String;
+ -- Same function with Wide_Wide_String output
+
end System.WCh_StW;
diff --git a/gcc/ada/s-wchwts.adb b/gcc/ada/s-wchwts.adb
index c9894f7c038..21174aad370 100644
--- a/gcc/ada/s-wchwts.adb
+++ b/gcc/ada/s-wchwts.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,133 +31,94 @@
-- --
------------------------------------------------------------------------------
-with Interfaces; use Interfaces;
with System.WCh_Con; use System.WCh_Con;
-with System.WCh_JIS; use System.WCh_JIS;
+with System.WCh_Cnv; use System.WCh_Cnv;
package body System.WCh_WtS is
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
+
+ procedure Store_UTF_32_Character
+ (U : UTF_32_Code;
+ S : out String;
+ P : in out Integer;
+ EM : WC_Encoding_Method);
+ -- Stores the string representation of the wide or wide wide character
+ -- whose code is given as U, starting at S (P + 1). P is incremented to
+ -- point to the last character stored. Raises CE if character cannot be
+ -- stored using the given encoding method.
+
+ ----------------------------
+ -- Store_UTF_32_Character --
+ ----------------------------
+
+ procedure Store_UTF_32_Character
+ (U : UTF_32_Code;
+ S : out String;
+ P : in out Integer;
+ EM : WC_Encoding_Method)
+ is
+ procedure Out_Char (C : Character);
+ pragma Inline (Out_Char);
+ -- Procedure to increment P and store C at S (P)
+
+ procedure Store_Chars is new UTF_32_To_Char_Sequence (Out_Char);
+
+ --------------
+ -- Out_Char --
+ --------------
+
+ procedure Out_Char (C : Character) is
+ begin
+ P := P + 1;
+ S (P) := C;
+ end Out_Char;
+
+ begin
+ Store_Chars (U, EM);
+ end Store_UTF_32_Character;
+
---------------------------
-- Wide_String_To_String --
---------------------------
function Wide_String_To_String
- (S : Wide_String;
- EM : WC_Encoding_Method)
- return String
+ (S : Wide_String;
+ EM : WC_Encoding_Method) return String
is
R : String (1 .. 5 * S'Length); -- worst case length!
RP : Natural;
- C1 : Character;
- C2 : Character;
begin
RP := 0;
-
for SP in S'Range loop
- declare
- C : constant Wide_Character := S (SP);
- CV : constant Unsigned_16 := Wide_Character'Pos (C);
- Hex : constant array (Unsigned_16 range 0 .. 15) of Character :=
- "0123456789ABCDEF";
-
- begin
- if CV <= 127 then
- RP := RP + 1;
- R (RP) := Character'Val (CV);
-
- else
- case EM is
-
- -- Hex ESC sequence encoding
-
- when WCEM_Hex =>
- if CV <= 16#FF# then
- RP := RP + 1;
- R (RP) := Character'Val (CV);
-
- else
- R (RP + 1) := ASCII.ESC;
- R (RP + 2) := Hex (Shift_Right (CV, 12));
- R (RP + 3) := Hex (Shift_Right (CV, 8) and 16#000F#);
- R (RP + 4) := Hex (Shift_Right (CV, 4) and 16#000F#);
- R (RP + 5) := Hex (CV and 16#000F#);
- RP := RP + 5;
- end if;
-
- -- Upper bit shift (internal code = external code)
-
- when WCEM_Upper =>
- R (RP + 1) := Character'Val (Shift_Right (CV, 8));
- R (RP + 2) := Character'Val (CV and 16#FF#);
- RP := RP + 2;
-
- -- Upper bit shift (EUC)
-
- when WCEM_EUC =>
- JIS_To_EUC (C, C1, C2);
- R (RP + 1) := C1;
- R (RP + 2) := C2;
- RP := RP + 2;
-
- -- Upper bit shift (Shift-JIS)
-
- when WCEM_Shift_JIS =>
- JIS_To_Shift_JIS (C, C1, C2);
- R (RP + 1) := C1;
- R (RP + 2) := C2;
- RP := RP + 2;
-
- -- Upper bit shift (UTF-8)
-
- -- 16#0080#-16#07ff#: 2#110xxxxx# 2#10xxxxxx#
- -- 16#0800#-16#ffff#: 2#1110xxxx# 2#10xxxxxx# 2#10xxxxxx#
-
- when WCEM_UTF8 =>
- if CV < 16#0800# then
- R (RP + 1) :=
- Character'Val (2#11000000# or Shift_Right (CV, 6));
- R (RP + 2) :=
- Character'Val (2#10000000# or (CV and 2#00111111#));
- RP := RP + 2;
-
- else
- R (RP + 1) :=
- Character'Val (2#11100000# or Shift_Right (CV, 12));
- R (RP + 2) :=
- Character'Val (2#10000000# or
- (Shift_Right (CV, 6) and
- 2#00111111#));
- R (RP + 3) :=
- Character'Val (2#10000000# or (CV and 2#00111111#));
- RP := RP + 3;
- end if;
-
- -- Brackets encoding
-
- when WCEM_Brackets =>
- if CV <= 16#FF# then
- RP := RP + 1;
- R (RP) := Character'Val (CV);
-
- else
- R (RP + 1) := '[';
- R (RP + 2) := '"';
- R (RP + 3) := Hex (Shift_Right (CV, 12));
- R (RP + 4) := Hex (Shift_Right (CV, 8) and 16#000F#);
- R (RP + 5) := Hex (Shift_Right (CV, 4) and 16#000F#);
- R (RP + 6) := Hex (CV and 16#000F#);
- R (RP + 7) := '"';
- R (RP + 8) := ']';
- RP := RP + 8;
- end if;
-
- end case;
- end if;
- end;
+ Store_UTF_32_Character (Wide_Character'Pos (S (SP)), R, RP, EM);
end loop;
return R (1 .. RP);
end Wide_String_To_String;
+ --------------------------------
+ -- Wide_Wide_Sring_To_String --
+ --------------------------------
+
+ function Wide_Wide_String_To_String
+ (S : Wide_Wide_String;
+ EM : WC_Encoding_Method) return String
+ is
+ R : String (1 .. 7 * S'Length); -- worst case length!
+ RP : Natural;
+
+ begin
+ RP := 0;
+
+ for SP in S'Range loop
+ Store_UTF_32_Character (Wide_Wide_Character'Pos (S (SP)), R, RP, EM);
+ end loop;
+
+ return R (1 .. RP);
+ end Wide_Wide_String_To_String;
+
end System.WCh_WtS;
diff --git a/gcc/ada/s-wchwts.ads b/gcc/ada/s-wchwts.ads
index 053d4132fca..936045992df 100644
--- a/gcc/ada/s-wchwts.ads
+++ b/gcc/ada/s-wchwts.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,9 +31,10 @@
-- --
------------------------------------------------------------------------------
--- This package contains the routine used to convert wide strings to
--- strings for use by wide character attributes (value, image etc.) and
--- also by the numeric IO subpackages of Ada.Text_IO.Wide_Text_IO.
+-- This package contains the routine used to convert wide strings and wide
+-- wide stringsto strings for use by wide and wide wide character attributes
+-- (value, image etc.) and also by the numeric IO subpackages of
+-- Ada.Text_IO.Wide_Text_IO and Ada.Text_IO.Wide_Wide_Text_IO.
with System.WCh_Con;
@@ -41,9 +42,8 @@ package System.WCh_WtS is
pragma Pure (WCh_WtS);
function Wide_String_To_String
- (S : Wide_String;
- EM : System.WCh_Con.WC_Encoding_Method)
- return String;
+ (S : Wide_String;
+ EM : System.WCh_Con.WC_Encoding_Method) return String;
-- This routine simply takes its argument and converts it to a string,
-- using the internal compiler escape sequence convention (defined in
-- package Widechar) to translate characters that are out of range
@@ -56,4 +56,9 @@ pragma Pure (WCh_WtS);
-- Note: in the WCEM_Brackets case, we only use the brackets encoding
-- for characters greater than 16#FF#.
+ function Wide_Wide_String_To_String
+ (S : Wide_Wide_String;
+ EM : System.WCh_Con.WC_Encoding_Method) return String;
+ -- Same processing, except for Wide_Wide_String
+
end System.WCh_WtS;
diff --git a/gcc/ada/s-widwch.adb b/gcc/ada/s-widwch.adb
index a5eaa0451b3..3797bf52c99 100644
--- a/gcc/ada/s-widwch.adb
+++ b/gcc/ada/s-widwch.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -41,15 +41,13 @@ package body System.Wid_WChar is
function Width_Wide_Character
(Lo, Hi : Wide_Character;
- EM : WC_Encoding_Method)
- return Natural
+ EM : WC_Encoding_Method) return Natural
is
W : Natural;
P : Natural;
begin
W := 0;
-
for C in Lo .. Hi loop
P := Wide_Character'Pos (C);
@@ -97,4 +95,64 @@ package body System.Wid_WChar is
return W;
end Width_Wide_Character;
+ -------------------------------
+ -- Width_Wide_Wide_Character --
+ -------------------------------
+
+ function Width_Wide_Wide_Character
+ (Lo, Hi : Wide_Wide_Character;
+ EM : WC_Encoding_Method) return Natural
+ is
+ W : Natural;
+ P : Natural;
+
+ begin
+ W := 0;
+ for C in Lo .. Hi loop
+ P := Wide_Wide_Character'Pos (C);
+
+ -- Here if we find a character in wide wide character range
+
+ if P > 16#FF# then
+ case EM is
+ when WCEM_Hex =>
+ return Natural'Max (W, 5);
+
+ when WCEM_Upper =>
+ return Natural'Max (W, 2);
+
+ when WCEM_Shift_JIS =>
+ return Natural'Max (W, 2);
+
+ when WCEM_EUC =>
+ return Natural'Max (W, 2);
+
+ when WCEM_UTF8 =>
+ if Hi > Wide_Wide_Character'Val (16#FFFF#) then
+ return Natural'Max (W, 4);
+ elsif Hi > Wide_Wide_Character'Val (16#07FF#) then
+ return Natural'Max (W, 3);
+ else
+ return Natural'Max (W, 2);
+ end if;
+
+ when WCEM_Brackets =>
+ return Natural'Max (W, 10);
+
+ end case;
+
+ -- If we are in character range then use length of character image
+
+ else
+ declare
+ S : constant String := Character'Image (Character'Val (P));
+ begin
+ W := Natural'Max (W, S'Length);
+ end;
+ end if;
+ end loop;
+
+ return W;
+ end Width_Wide_Wide_Character;
+
end System.Wid_WChar;
diff --git a/gcc/ada/s-widwch.ads b/gcc/ada/s-widwch.ads
index ab5649abf61..15c8705053d 100644
--- a/gcc/ada/s-widwch.ads
+++ b/gcc/ada/s-widwch.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,7 +31,7 @@
-- --
------------------------------------------------------------------------------
--- This package contains the routine used for Wide_Character'Width
+-- This package contains the routines used for Wide_[Wide_]Character'Width
with System.WCh_Con;
@@ -40,10 +40,14 @@ pragma Pure (Wid_WChar);
function Width_Wide_Character
(Lo, Hi : Wide_Character;
- EM : System.WCh_Con.WC_Encoding_Method)
- return Natural;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
-- Compute Width attribute for non-static type derived from Wide_Character.
-- The arguments are the low and high bounds for the type. EM is the
-- wide-character encoding method.
+ function Width_Wide_Wide_Character
+ (Lo, Hi : Wide_Wide_Character;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
+ -- Same function for type derived from Wide_Wide_Character
+
end System.Wid_WChar;
diff --git a/gcc/ada/s-wwdcha.adb b/gcc/ada/s-wwdcha.adb
index 18928fdf848..82db6f39758 100644
--- a/gcc/ada/s-wwdcha.adb
+++ b/gcc/ada/s-wwdcha.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -42,11 +42,9 @@ package body System.WWd_Char is
begin
W := 0;
-
for C in Lo .. Hi loop
declare
S : constant Wide_String := Character'Wide_Image (C);
-
begin
W := Natural'Max (W, S'Length);
end;
@@ -55,4 +53,24 @@ package body System.WWd_Char is
return W;
end Wide_Width_Character;
+ -------------------------------
+ -- Wide_Wide_Width_Character --
+ -------------------------------
+
+ function Wide_Wide_Width_Character (Lo, Hi : Character) return Natural is
+ W : Natural;
+
+ begin
+ W := 0;
+ for C in Lo .. Hi loop
+ declare
+ S : constant Wide_Wide_String := Character'Wide_Wide_Image (C);
+ begin
+ W := Natural'Max (W, S'Length);
+ end;
+ end loop;
+
+ return W;
+ end Wide_Wide_Width_Character;
+
end System.WWd_Char;
diff --git a/gcc/ada/s-wwdcha.ads b/gcc/ada/s-wwdcha.ads
index 9981cff710e..9431fb7f12d 100644
--- a/gcc/ada/s-wwdcha.ads
+++ b/gcc/ada/s-wwdcha.ads
@@ -6,8 +6,8 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. --
--- --
+-- Copyright (C) 1992-2005 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- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
@@ -31,7 +31,7 @@
-- --
------------------------------------------------------------------------------
--- This package contains the routine used for Character'Wide_Width
+-- This package contains the routine used for Character'Wide_[Wide_]Width
package System.WWd_Char is
pragma Pure (WWd_Char);
@@ -40,4 +40,8 @@ pragma Pure (WWd_Char);
-- Compute Wide_Width attribute for non-static type derived from
-- Character. The arguments are the low and high bounds for the type.
+ function Wide_Wide_Width_Character (Lo, Hi : Character) return Natural;
+ -- Compute Wide_Wide_Width attribute for non-static type derived from
+ -- Character. The arguments are the low and high bounds for the type.
+
end System.WWd_Char;
diff --git a/gcc/ada/s-wwdenu.adb b/gcc/ada/s-wwdenu.adb
index 9a942591d2b..444d018da36 100644
--- a/gcc/ada/s-wwdenu.adb
+++ b/gcc/ada/s-wwdenu.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,6 +38,117 @@ with Unchecked_Conversion;
package body System.WWd_Enum is
+ -----------------------------------
+ -- Wide_Wide_Width_Enumeration_8 --
+ -----------------------------------
+
+ function Wide_Wide_Width_Enumeration_8
+ (Names : String;
+ Indexes : System.Address;
+ Lo, Hi : Natural;
+ EM : WC_Encoding_Method) return Natural
+ is
+ W : Natural;
+
+ type Natural_8 is range 0 .. 2 ** 7 - 1;
+ type Index_Table is array (Natural) of Natural_8;
+ type Index_Table_Ptr is access Index_Table;
+
+ function To_Index_Table_Ptr is
+ new Unchecked_Conversion (System.Address, Index_Table_Ptr);
+
+ IndexesT : constant Index_Table_Ptr := To_Index_Table_Ptr (Indexes);
+
+ begin
+ W := 0;
+ for J in Lo .. Hi loop
+ declare
+ WS : constant Wide_Wide_String :=
+ String_To_Wide_Wide_String
+ (Names (Natural (IndexesT (J)) ..
+ Natural (IndexesT (J + 1)) - 1), EM);
+ begin
+ W := Natural'Max (W, WS'Length);
+ end;
+ end loop;
+
+ return W;
+ end Wide_Wide_Width_Enumeration_8;
+
+ ------------------------------------
+ -- Wide_Wide_Width_Enumeration_16 --
+ ------------------------------------
+
+ function Wide_Wide_Width_Enumeration_16
+ (Names : String;
+ Indexes : System.Address;
+ Lo, Hi : Natural;
+ EM : WC_Encoding_Method) return Natural
+ is
+ W : Natural;
+
+ type Natural_16 is range 0 .. 2 ** 15 - 1;
+ type Index_Table is array (Natural) of Natural_16;
+ type Index_Table_Ptr is access Index_Table;
+
+ function To_Index_Table_Ptr is
+ new Unchecked_Conversion (System.Address, Index_Table_Ptr);
+
+ IndexesT : constant Index_Table_Ptr := To_Index_Table_Ptr (Indexes);
+
+ begin
+ W := 0;
+ for J in Lo .. Hi loop
+ declare
+ WS : constant Wide_Wide_String :=
+ String_To_Wide_Wide_String
+ (Names (Natural (IndexesT (J)) ..
+ Natural (IndexesT (J + 1)) - 1), EM);
+ begin
+ W := Natural'Max (W, WS'Length);
+ end;
+ end loop;
+
+ return W;
+ end Wide_Wide_Width_Enumeration_16;
+
+ ------------------------------------
+ -- Wide_Wide_Width_Enumeration_32 --
+ ------------------------------------
+
+ function Wide_Wide_Width_Enumeration_32
+ (Names : String;
+ Indexes : System.Address;
+ Lo, Hi : Natural;
+ EM : WC_Encoding_Method) return Natural
+ is
+ W : Natural;
+
+ type Natural_32 is range 0 .. 2 ** 31 - 1;
+ type Index_Table is array (Natural) of Natural_32;
+ type Index_Table_Ptr is access Index_Table;
+
+ function To_Index_Table_Ptr is
+ new Unchecked_Conversion (System.Address, Index_Table_Ptr);
+
+ IndexesT : constant Index_Table_Ptr := To_Index_Table_Ptr (Indexes);
+
+ begin
+ W := 0;
+ for J in Lo .. Hi loop
+ declare
+ WS : constant Wide_Wide_String :=
+ String_To_Wide_Wide_String
+ (Names (Natural (IndexesT (J)) ..
+ Natural (IndexesT (J + 1)) - 1), EM);
+ begin
+ W := Natural'Max (W, WS'Length);
+ end;
+ end loop;
+
+ return W;
+ end Wide_Wide_Width_Enumeration_32;
+
------------------------------
-- Wide_Width_Enumeration_8 --
------------------------------
@@ -46,8 +157,7 @@ package body System.WWd_Enum is
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural;
- EM : WC_Encoding_Method)
- return Natural
+ EM : WC_Encoding_Method) return Natural
is
W : Natural;
@@ -62,14 +172,12 @@ package body System.WWd_Enum is
begin
W := 0;
-
for J in Lo .. Hi loop
declare
WS : constant Wide_String :=
- String_To_Wide_String
- (Names (Natural (IndexesT (J)) ..
- Natural (IndexesT (J + 1)) - 1), EM);
-
+ String_To_Wide_String
+ (Names (Natural (IndexesT (J)) ..
+ Natural (IndexesT (J + 1)) - 1), EM);
begin
W := Natural'Max (W, WS'Length);
end;
@@ -86,8 +194,7 @@ package body System.WWd_Enum is
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural;
- EM : WC_Encoding_Method)
- return Natural
+ EM : WC_Encoding_Method) return Natural
is
W : Natural;
@@ -102,14 +209,12 @@ package body System.WWd_Enum is
begin
W := 0;
-
for J in Lo .. Hi loop
declare
WS : constant Wide_String :=
- String_To_Wide_String
- (Names (Natural (IndexesT (J)) ..
- Natural (IndexesT (J + 1)) - 1), EM);
-
+ String_To_Wide_String
+ (Names (Natural (IndexesT (J)) ..
+ Natural (IndexesT (J + 1)) - 1), EM);
begin
W := Natural'Max (W, WS'Length);
end;
@@ -126,8 +231,7 @@ package body System.WWd_Enum is
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural;
- EM : WC_Encoding_Method)
- return Natural
+ EM : WC_Encoding_Method) return Natural
is
W : Natural;
@@ -142,14 +246,12 @@ package body System.WWd_Enum is
begin
W := 0;
-
for J in Lo .. Hi loop
declare
WS : constant Wide_String :=
- String_To_Wide_String
- (Names (Natural (IndexesT (J)) ..
- Natural (IndexesT (J + 1)) - 1), EM);
-
+ String_To_Wide_String
+ (Names (Natural (IndexesT (J)) ..
+ Natural (IndexesT (J + 1)) - 1), EM);
begin
W := Natural'Max (W, WS'Length);
end;
diff --git a/gcc/ada/s-wwdenu.ads b/gcc/ada/s-wwdenu.ads
index 9bb400fefb3..3c64764915d 100644
--- a/gcc/ada/s-wwdenu.ads
+++ b/gcc/ada/s-wwdenu.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,7 +31,7 @@
-- --
------------------------------------------------------------------------------
--- This package contains the routine used for Enumeration_Type'Wide_Width
+-- This package contains routines used for Enumeration_Type'Wide_[Wide_]Width
with System.WCh_Con;
@@ -42,8 +42,7 @@ pragma Pure (WWd_Enum);
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural;
- EM : System.WCh_Con.WC_Encoding_Method)
- return Natural;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
-- Used to compute Enum'Wide_Width where Enum is an enumeration subtype
-- other than those defined in package Standard. Names is a string with
-- a lower bound of 1 containing the characters of all the enumeration
@@ -65,8 +64,7 @@ pragma Pure (WWd_Enum);
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural;
- EM : System.WCh_Con.WC_Encoding_Method)
- return Natural;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
-- Identical to Wide_Width_Enumeration_8 except that it handles types
-- using array (0 .. Num) of Natural_16 for the Indexes table.
@@ -74,9 +72,29 @@ pragma Pure (WWd_Enum);
(Names : String;
Indexes : System.Address;
Lo, Hi : Natural;
- EM : System.WCh_Con.WC_Encoding_Method)
- return Natural;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
-- Identical to Wide_Width_Enumeration_8 except that it handles types
-- using array (0 .. Num) of Natural_32 for the Indexes table.
+ function Wide_Wide_Width_Enumeration_8
+ (Names : String;
+ Indexes : System.Address;
+ Lo, Hi : Natural;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
+ -- Same function for Wide_Wide_Width attribute
+
+ function Wide_Wide_Width_Enumeration_16
+ (Names : String;
+ Indexes : System.Address;
+ Lo, Hi : Natural;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
+ -- Same function for Wide_Wide_Width attribute
+
+ function Wide_Wide_Width_Enumeration_32
+ (Names : String;
+ Indexes : System.Address;
+ Lo, Hi : Natural;
+ EM : System.WCh_Con.WC_Encoding_Method) return Natural;
+ -- Same function for Wide_Wide_Width attribute
+
end System.WWd_Enum;
diff --git a/gcc/ada/s-wwdwch.adb b/gcc/ada/s-wwdwch.adb
index eb9d2fb6ac4..ac3d1e9cc45 100644
--- a/gcc/ada/s-wwdwch.adb
+++ b/gcc/ada/s-wwdwch.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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,46 +31,147 @@
-- --
------------------------------------------------------------------------------
+with Interfaces; use Interfaces;
+
+with System.WWd_Char;
+
package body System.Wwd_WChar is
+ ------------------------------------
+ -- Wide_Wide_Width_Wide_Character --
+ ------------------------------------
+
+ -- This is the case where we are talking about the Wide_Wide_Image of
+ -- a Wide_Character, which is always the same character sequence as the
+ -- Wide_Image of the same Wide_Character.
+
+ function Wide_Wide_Width_Wide_Character
+ (Lo, Hi : Wide_Character) return Natural
+ is
+ begin
+ return Wide_Width_Wide_Character (Lo, Hi);
+ end Wide_Wide_Width_Wide_Character;
+
+ ------------------------------------
+ -- Wide_Wide_Width_Wide_Wide_Char --
+ ------------------------------------
+
+ function Wide_Wide_Width_Wide_Wide_Char
+ (Lo, Hi : Wide_Wide_Character) return Natural
+ is
+ W : Natural := 0;
+ LV : constant Unsigned_32 := Wide_Wide_Character'Pos (Lo);
+ HV : constant Unsigned_32 := Wide_Wide_Character'Pos (Hi);
+
+ begin
+ -- Return zero if empty range
+
+ if LV > HV then
+ return 0;
+ end if;
+
+ -- If any characters in normal character range, then use normal
+ -- Wide_Wide_Width attribute on this range to find out a starting point.
+ -- Otherwise start with zero.
+
+ if LV <= 255 then
+ W :=
+ System.WWd_Char.Wide_Wide_Width_Character
+ (Lo => Character'Val (LV),
+ Hi => Character'Val (Unsigned_32'Min (255, HV)));
+ else
+ W := 0;
+ end if;
+
+ -- Increase to at least 4 if FFFE or FFFF present. These correspond
+ -- to the special language defined names FFFE/FFFF for these values.
+
+ if 16#FFFF# in LV .. HV or else 16#FFFE# in LV .. HV then
+ W := Natural'Max (W, 4);
+ end if;
+
+ -- Increase to at least 3 if any wide characters, corresponding to
+ -- the normal ' character ' sequence. We know that the character fits.
+
+ if HV > 255 then
+ W := Natural'Max (W, 3);
+ end if;
+
+ return W;
+ end Wide_Wide_Width_Wide_Wide_Char;
+
-------------------------------
-- Wide_Width_Wide_Character --
-------------------------------
function Wide_Width_Wide_Character
- (Lo, Hi : Wide_Character)
- return Natural
+ (Lo, Hi : Wide_Character) return Natural
is
- W : Natural;
- P : Natural;
+ W : Natural := 0;
+ LV : constant Unsigned_32 := Wide_Character'Pos (Lo);
+ HV : constant Unsigned_32 := Wide_Character'Pos (Hi);
begin
- W := 0;
+ -- Return zero if empty range
- for C in Lo .. Hi loop
- P := Wide_Character'Pos (C);
+ if LV > HV then
+ return 0;
+ end if;
- -- If we are in wide character range, the length is always 3
- -- and we are done, since all remaining characters are the same.
+ -- If any characters in normal character range, then use normal
+ -- Wide_Wide_Width attribute on this range to find out a starting point.
+ -- Otherwise start with zero.
- if P > 255 then
- return Natural'Max (W, 3);
+ if LV <= 255 then
+ W :=
+ System.WWd_Char.Wide_Width_Character
+ (Lo => Character'Val (LV),
+ Hi => Character'Val (Unsigned_32'Min (255, HV)));
+ else
+ W := 0;
+ end if;
- -- If we are in character range then use length of character image
- -- Is this right, what about wide char encodings of 80-FF???
+ -- Increase to at least 4 if FFFE or FFFF present. These correspond
+ -- to the special language defined names FFFE/FFFF for these values.
- else
- declare
- S : constant Wide_String :=
- Character'Wide_Image (Character'Val (P));
+ if 16#FFFF# in LV .. HV or else 16#FFFE# in LV .. HV then
+ W := Natural'Max (W, 4);
+ end if;
- begin
- W := Natural'Max (W, S'Length);
- end;
- end if;
- end loop;
+ -- Increase to at least 3 if any wide characters, corresponding to
+ -- the normal 'character' sequence. We know that the character fits.
+
+ if HV > 255 then
+ W := Natural'Max (W, 3);
+ end if;
return W;
end Wide_Width_Wide_Character;
+ ------------------------------------
+ -- Wide_Width_Wide_Wide_Character --
+ ------------------------------------
+
+ -- This is a nasty case, because we get into the business of representing
+ -- out of range wide wide characters as wide strings. Let's let image do
+ -- the work here. Too bad if this takes lots of time. It's silly anyway!
+
+ function Wide_Width_Wide_Wide_Character
+ (Lo, Hi : Wide_Wide_Character) return Natural
+ is
+ W : Natural;
+
+ begin
+ W := 0;
+ for J in Lo .. Hi loop
+ declare
+ S : constant Wide_String := Wide_Wide_Character'Wide_Image (J);
+ begin
+ W := Natural'Max (W, S'Length);
+ end;
+ end loop;
+
+ return W;
+ end Wide_Width_Wide_Wide_Character;
+
end System.Wwd_WChar;
diff --git a/gcc/ada/s-wwdwch.ads b/gcc/ada/s-wwdwch.ads
index e8f06679804..b158be26292 100644
--- a/gcc/ada/s-wwdwch.ads
+++ b/gcc/ada/s-wwdwch.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,33 @@
-- --
------------------------------------------------------------------------------
--- This package contains the routine used for Wide_Character'Wide_Width
+-- This package contains routines for [Wide_]Wide_Character'[Wide_]Wide_Width
package System.Wwd_WChar is
pragma Pure (Wwd_WChar);
function Wide_Width_Wide_Character
- (Lo, Hi : Wide_Character)
- return Natural;
+ (Lo, Hi : Wide_Character) return Natural;
-- Compute Wide_Width attribute for non-static type derived from
-- Wide_Character. The arguments are the low and high bounds for
-- the type. EM is the wide-character encoding method.
+ function Wide_Width_Wide_Wide_Character
+ (Lo, Hi : Wide_Wide_Character) return Natural;
+ -- Compute Wide_Width attribute for non-static type derived from
+ -- Wide_Wide_Character. The arguments are the low and high bounds for
+ -- the type. EM is the wide-character encoding method.
+
+ function Wide_Wide_Width_Wide_Character
+ (Lo, Hi : Wide_Character) return Natural;
+ -- Compute Wide_Wide_Width attribute for non-static type derived from
+ -- Wide_Character. The arguments are the low and high bounds for
+ -- the type. EM is the wide-character encoding method.
+
+ function Wide_Wide_Width_Wide_Wide_Char
+ (Lo, Hi : Wide_Wide_Character) return Natural;
+ -- Compute Wide_Wide_Width attribute for non-static type derived from
+ -- Wide_Wide_Character. The arguments are the low and high bounds for
+ -- the type. EM is the wide-character encoding method.
+
end System.Wwd_WChar;
diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads
index b8f5c397654..8c7870fbc57 100644
--- a/gcc/ada/scans.ads
+++ b/gcc/ada/scans.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -124,6 +124,7 @@ package Scans is
Tok_Constant, -- CONSTANT Eterm, Sterm
Tok_Do, -- DO Eterm, Sterm
Tok_Is, -- IS Eterm, Sterm
+ Tok_Interface, -- INTERFACE Eterm, Sterm
Tok_Limited, -- LIMITED Eterm, Sterm
Tok_Of, -- OF Eterm, Sterm
Tok_Out, -- OUT Eterm, Sterm
@@ -166,6 +167,8 @@ package Scans is
Tok_Task, -- TASK Eterm, Sterm, Declk, Deckn, After_SM
Tok_Type, -- TYPE Eterm, Sterm, Declk, Deckn, After_SM
Tok_Subtype, -- SUBTYPE Eterm, Sterm, Declk, Deckn, After_SM
+ Tok_Overriding, -- OVERRIDING Eterm, Sterm, Declk, Declk, After_SM
+ Tok_Synchronized, -- SYNCHRONIZED Eterm, Sterm, Declk, Deckn, After_SM
Tok_Use, -- USE Eterm, Sterm, Declk, Deckn, After_SM
Tok_Function, -- FUNCTION Eterm, Sterm, Cunit, Declk, After_SM
diff --git a/gcc/ada/scn.adb b/gcc/ada/scn.adb
index a60d28e1fe8..b83be649810 100644
--- a/gcc/ada/scn.adb
+++ b/gcc/ada/scn.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,6 +33,7 @@ with Rident; use Rident;
with Scans; use Scans;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
+with Uintp; use Uintp;
package body Scn is
@@ -64,7 +65,7 @@ package body Scn is
case Token is
when Tok_Char_Literal =>
Token_Node := New_Node (N_Character_Literal, Token_Ptr);
- Set_Char_Literal_Value (Token_Node, Character_Code);
+ Set_Char_Literal_Value (Token_Node, UI_From_CC (Character_Code));
Set_Chars (Token_Node, Token_Name);
when Tok_Identifier =>
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb
index 486fbffe45d..158524df989 100644
--- a/gcc/ada/scng.adb
+++ b/gcc/ada/scng.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -94,7 +94,13 @@ package body Scng is
procedure Accumulate_Checksum (C : Char_Code) is
begin
- Accumulate_Checksum (Character'Val (C / 256));
+ if C > 16#FFFF# then
+ Accumulate_Checksum (Character'Val (C / 2 ** 16));
+ Accumulate_Checksum (Character'Val ((C / 256) mod 256));
+ else
+ Accumulate_Checksum (Character'Val (C / 256));
+ end if;
+
Accumulate_Checksum (Character'Val (C mod 256));
end Accumulate_Checksum;
@@ -135,80 +141,103 @@ package body Scng is
(Unit : Unit_Number_Type;
Index : Source_File_Index)
is
+ procedure Set_Reserved (N : Name_Id; T : Token_Type);
+ pragma Inline (Set_Reserved);
+ -- Set given name as a reserved keyword (T is the corresponding token)
+
+ -------------
+ -- Set_NTB --
+ -------------
+
+ procedure Set_Reserved (N : Name_Id; T : Token_Type) is
+ begin
+ -- Set up Token_Type values in Names Table entries for reserved
+ -- keywords We use the Pos value of the Token_Type value. Note we
+ -- rely on the fact that Token_Type'Val (0) is not a reserved word!
+
+ Set_Name_Table_Byte (N, Token_Type'Pos (T));
+ end Set_Reserved;
+
+ -- Start of processing for Initialize_Scanner
+
begin
- -- Set up Token_Type values in Names Table entries for reserved keywords
- -- We use the Pos value of the Token_Type value. Note we are relying on
- -- the fact that Token_Type'Val (0) is not a reserved word!
-
- Set_Name_Table_Byte (Name_Abort, Token_Type'Pos (Tok_Abort));
- Set_Name_Table_Byte (Name_Abs, Token_Type'Pos (Tok_Abs));
- Set_Name_Table_Byte (Name_Abstract, Token_Type'Pos (Tok_Abstract));
- Set_Name_Table_Byte (Name_Accept, Token_Type'Pos (Tok_Accept));
- Set_Name_Table_Byte (Name_Access, Token_Type'Pos (Tok_Access));
- Set_Name_Table_Byte (Name_And, Token_Type'Pos (Tok_And));
- Set_Name_Table_Byte (Name_Aliased, Token_Type'Pos (Tok_Aliased));
- Set_Name_Table_Byte (Name_All, Token_Type'Pos (Tok_All));
- Set_Name_Table_Byte (Name_Array, Token_Type'Pos (Tok_Array));
- Set_Name_Table_Byte (Name_At, Token_Type'Pos (Tok_At));
- Set_Name_Table_Byte (Name_Begin, Token_Type'Pos (Tok_Begin));
- Set_Name_Table_Byte (Name_Body, Token_Type'Pos (Tok_Body));
- Set_Name_Table_Byte (Name_Case, Token_Type'Pos (Tok_Case));
- Set_Name_Table_Byte (Name_Constant, Token_Type'Pos (Tok_Constant));
- Set_Name_Table_Byte (Name_Declare, Token_Type'Pos (Tok_Declare));
- Set_Name_Table_Byte (Name_Delay, Token_Type'Pos (Tok_Delay));
- Set_Name_Table_Byte (Name_Delta, Token_Type'Pos (Tok_Delta));
- Set_Name_Table_Byte (Name_Digits, Token_Type'Pos (Tok_Digits));
- Set_Name_Table_Byte (Name_Do, Token_Type'Pos (Tok_Do));
- Set_Name_Table_Byte (Name_Else, Token_Type'Pos (Tok_Else));
- Set_Name_Table_Byte (Name_Elsif, Token_Type'Pos (Tok_Elsif));
- Set_Name_Table_Byte (Name_End, Token_Type'Pos (Tok_End));
- Set_Name_Table_Byte (Name_Entry, Token_Type'Pos (Tok_Entry));
- Set_Name_Table_Byte (Name_Exception, Token_Type'Pos (Tok_Exception));
- Set_Name_Table_Byte (Name_Exit, Token_Type'Pos (Tok_Exit));
- Set_Name_Table_Byte (Name_For, Token_Type'Pos (Tok_For));
- Set_Name_Table_Byte (Name_Function, Token_Type'Pos (Tok_Function));
- Set_Name_Table_Byte (Name_Generic, Token_Type'Pos (Tok_Generic));
- Set_Name_Table_Byte (Name_Goto, Token_Type'Pos (Tok_Goto));
- Set_Name_Table_Byte (Name_If, Token_Type'Pos (Tok_If));
- Set_Name_Table_Byte (Name_In, Token_Type'Pos (Tok_In));
- Set_Name_Table_Byte (Name_Is, Token_Type'Pos (Tok_Is));
- Set_Name_Table_Byte (Name_Limited, Token_Type'Pos (Tok_Limited));
- Set_Name_Table_Byte (Name_Loop, Token_Type'Pos (Tok_Loop));
- Set_Name_Table_Byte (Name_Mod, Token_Type'Pos (Tok_Mod));
- Set_Name_Table_Byte (Name_New, Token_Type'Pos (Tok_New));
- Set_Name_Table_Byte (Name_Not, Token_Type'Pos (Tok_Not));
- Set_Name_Table_Byte (Name_Null, Token_Type'Pos (Tok_Null));
- Set_Name_Table_Byte (Name_Of, Token_Type'Pos (Tok_Of));
- Set_Name_Table_Byte (Name_Or, Token_Type'Pos (Tok_Or));
- Set_Name_Table_Byte (Name_Others, Token_Type'Pos (Tok_Others));
- Set_Name_Table_Byte (Name_Out, Token_Type'Pos (Tok_Out));
- Set_Name_Table_Byte (Name_Package, Token_Type'Pos (Tok_Package));
- Set_Name_Table_Byte (Name_Pragma, Token_Type'Pos (Tok_Pragma));
- Set_Name_Table_Byte (Name_Private, Token_Type'Pos (Tok_Private));
- Set_Name_Table_Byte (Name_Procedure, Token_Type'Pos (Tok_Procedure));
- Set_Name_Table_Byte (Name_Protected, Token_Type'Pos (Tok_Protected));
- Set_Name_Table_Byte (Name_Raise, Token_Type'Pos (Tok_Raise));
- Set_Name_Table_Byte (Name_Range, Token_Type'Pos (Tok_Range));
- Set_Name_Table_Byte (Name_Record, Token_Type'Pos (Tok_Record));
- Set_Name_Table_Byte (Name_Rem, Token_Type'Pos (Tok_Rem));
- Set_Name_Table_Byte (Name_Renames, Token_Type'Pos (Tok_Renames));
- Set_Name_Table_Byte (Name_Requeue, Token_Type'Pos (Tok_Requeue));
- Set_Name_Table_Byte (Name_Return, Token_Type'Pos (Tok_Return));
- Set_Name_Table_Byte (Name_Reverse, Token_Type'Pos (Tok_Reverse));
- Set_Name_Table_Byte (Name_Select, Token_Type'Pos (Tok_Select));
- Set_Name_Table_Byte (Name_Separate, Token_Type'Pos (Tok_Separate));
- Set_Name_Table_Byte (Name_Subtype, Token_Type'Pos (Tok_Subtype));
- Set_Name_Table_Byte (Name_Tagged, Token_Type'Pos (Tok_Tagged));
- Set_Name_Table_Byte (Name_Task, Token_Type'Pos (Tok_Task));
- Set_Name_Table_Byte (Name_Terminate, Token_Type'Pos (Tok_Terminate));
- Set_Name_Table_Byte (Name_Then, Token_Type'Pos (Tok_Then));
- Set_Name_Table_Byte (Name_Type, Token_Type'Pos (Tok_Type));
- Set_Name_Table_Byte (Name_Until, Token_Type'Pos (Tok_Until));
- Set_Name_Table_Byte (Name_Use, Token_Type'Pos (Tok_Use));
- Set_Name_Table_Byte (Name_When, Token_Type'Pos (Tok_When));
- Set_Name_Table_Byte (Name_While, Token_Type'Pos (Tok_While));
- Set_Name_Table_Byte (Name_With, Token_Type'Pos (Tok_With));
- Set_Name_Table_Byte (Name_Xor, Token_Type'Pos (Tok_Xor));
+ -- Establish reserved words
+
+ Set_Reserved (Name_Abort, Tok_Abort);
+ Set_Reserved (Name_Abs, Tok_Abs);
+ Set_Reserved (Name_Abstract, Tok_Abstract);
+ Set_Reserved (Name_Accept, Tok_Accept);
+ Set_Reserved (Name_Access, Tok_Access);
+ Set_Reserved (Name_And, Tok_And);
+ Set_Reserved (Name_Aliased, Tok_Aliased);
+ Set_Reserved (Name_All, Tok_All);
+ Set_Reserved (Name_Array, Tok_Array);
+ Set_Reserved (Name_At, Tok_At);
+ Set_Reserved (Name_Begin, Tok_Begin);
+ Set_Reserved (Name_Body, Tok_Body);
+ Set_Reserved (Name_Case, Tok_Case);
+ Set_Reserved (Name_Constant, Tok_Constant);
+ Set_Reserved (Name_Declare, Tok_Declare);
+ Set_Reserved (Name_Delay, Tok_Delay);
+ Set_Reserved (Name_Delta, Tok_Delta);
+ Set_Reserved (Name_Digits, Tok_Digits);
+ Set_Reserved (Name_Do, Tok_Do);
+ Set_Reserved (Name_Else, Tok_Else);
+ Set_Reserved (Name_Elsif, Tok_Elsif);
+ Set_Reserved (Name_End, Tok_End);
+ Set_Reserved (Name_Entry, Tok_Entry);
+ Set_Reserved (Name_Exception, Tok_Exception);
+ Set_Reserved (Name_Exit, Tok_Exit);
+ Set_Reserved (Name_For, Tok_For);
+ Set_Reserved (Name_Function, Tok_Function);
+ Set_Reserved (Name_Generic, Tok_Generic);
+ Set_Reserved (Name_Goto, Tok_Goto);
+ Set_Reserved (Name_If, Tok_If);
+ Set_Reserved (Name_In, Tok_In);
+ Set_Reserved (Name_Is, Tok_Is);
+ Set_Reserved (Name_Limited, Tok_Limited);
+ Set_Reserved (Name_Loop, Tok_Loop);
+ Set_Reserved (Name_Mod, Tok_Mod);
+ Set_Reserved (Name_New, Tok_New);
+ Set_Reserved (Name_Not, Tok_Not);
+ Set_Reserved (Name_Null, Tok_Null);
+ Set_Reserved (Name_Of, Tok_Of);
+ Set_Reserved (Name_Or, Tok_Or);
+ Set_Reserved (Name_Others, Tok_Others);
+ Set_Reserved (Name_Out, Tok_Out);
+ Set_Reserved (Name_Package, Tok_Package);
+ Set_Reserved (Name_Pragma, Tok_Pragma);
+ Set_Reserved (Name_Private, Tok_Private);
+ Set_Reserved (Name_Procedure, Tok_Procedure);
+ Set_Reserved (Name_Protected, Tok_Protected);
+ Set_Reserved (Name_Raise, Tok_Raise);
+ Set_Reserved (Name_Range, Tok_Range);
+ Set_Reserved (Name_Record, Tok_Record);
+ Set_Reserved (Name_Rem, Tok_Rem);
+ Set_Reserved (Name_Renames, Tok_Renames);
+ Set_Reserved (Name_Requeue, Tok_Requeue);
+ Set_Reserved (Name_Return, Tok_Return);
+ Set_Reserved (Name_Reverse, Tok_Reverse);
+ Set_Reserved (Name_Select, Tok_Select);
+ Set_Reserved (Name_Separate, Tok_Separate);
+ Set_Reserved (Name_Subtype, Tok_Subtype);
+ Set_Reserved (Name_Tagged, Tok_Tagged);
+ Set_Reserved (Name_Task, Tok_Task);
+ Set_Reserved (Name_Terminate, Tok_Terminate);
+ Set_Reserved (Name_Then, Tok_Then);
+ Set_Reserved (Name_Type, Tok_Type);
+ Set_Reserved (Name_Until, Tok_Until);
+ Set_Reserved (Name_Use, Tok_Use);
+ Set_Reserved (Name_When, Tok_When);
+ Set_Reserved (Name_While, Tok_While);
+ Set_Reserved (Name_With, Tok_With);
+ Set_Reserved (Name_Xor, Tok_Xor);
+
+ -- Ada 2005 reserved words
+
+ Set_Reserved (Name_Interface, Tok_Interface);
+ Set_Reserved (Name_Overriding, Tok_Overriding);
+ Set_Reserved (Name_Synchronized, Tok_Synchronized);
-- Initialize scan control variables
@@ -246,10 +275,22 @@ package body Scng is
procedure Scan is
Start_Of_Comment : Source_Ptr;
+ -- Record start of comment position
+
+ Underline_Found : Boolean;
+ -- During scanning of an identifier, set to True if last character
+ -- scanned was an underline or other punctuation character. This
+ -- is used to flag the error of two underlines/punctuations in a
+ -- row or ending an identifier with a underline/punctuation. Here
+ -- punctuation means any UTF_32 character in the Unicode category
+ -- Punctuation,Connector.
+
+ Wptr : Source_Ptr;
+ -- Used to remember start of last wide character scanned
procedure Check_End_Of_Line;
- -- Called when end of line encountered. Checks that line is not
- -- too long, and that other style checks for the end of line are met.
+ -- Called when end of line encountered. Checks that line is not too
+ -- long, and that other style checks for the end of line are met.
function Double_Char_Token (C : Character) return Boolean;
-- This function is used for double character tokens like := or <>. It
@@ -262,8 +303,8 @@ package body Scng is
-- since we do not want a junk message for a case like &-space-&).
procedure Error_Illegal_Character;
- -- Give illegal character error, Scan_Ptr points to character.
- -- On return, Scan_Ptr is bumped past the illegal character.
+ -- Give illegal character error, Scan_Ptr points to character. On
+ -- return, Scan_Ptr is bumped past the illegal character.
procedure Error_Illegal_Wide_Character;
-- Give illegal wide character message. On return, Scan_Ptr is bumped
@@ -274,7 +315,8 @@ package body Scng is
-- Signal error of excessively long line
procedure Error_No_Double_Underline;
- -- Signal error of double underline character
+ -- Signal error of two underline or punctuation characters in a row.
+ -- Called with Scan_Ptr pointing to second underline/punctuation char.
procedure Nlit;
-- This is the procedure for scanning out numeric literals. On entry,
@@ -353,8 +395,7 @@ package body Scng is
procedure Error_Illegal_Wide_Character is
begin
- Error_Msg_S ("illegal wide character, check -gnatW switch");
- Scan_Ptr := Scan_Ptr + 1;
+ Error_Msg ("illegal wide character", Wptr);
end Error_Illegal_Wide_Character;
---------------------
@@ -374,7 +415,28 @@ package body Scng is
procedure Error_No_Double_Underline is
begin
- Error_Msg_S ("two consecutive underlines not permitted");
+ Underline_Found := False;
+
+ -- There are four cases, and we special case the messages
+
+ if Source (Scan_Ptr) = '_' then
+ if Source (Scan_Ptr - 1) = '_' then
+ Error_Msg_S
+ ("two consecutive underlines not permitted");
+ else
+ Error_Msg_S
+ ("underline cannot follow punctuation character");
+ end if;
+
+ else
+ if Source (Scan_Ptr - 1) = '_' then
+ Error_Msg_S
+ ("punctuation character cannot follow underline");
+ else
+ Error_Msg_S
+ ("two consecutive punctuation characters not permitted");
+ end if;
+ end if;
end Error_No_Double_Underline;
----------
@@ -425,13 +487,13 @@ package body Scng is
-- which the digit was expected on input, and is unchanged on return.
procedure Scan_Integer;
- -- Procedure to scan integer literal. On entry, Scan_Ptr points to
- -- a digit, on exit Scan_Ptr points past the last character of
- -- the integer.
+ -- Procedure to scan integer literal. On entry, Scan_Ptr points to a
+ -- digit, on exit Scan_Ptr points past the last character of the
+ -- integer.
--
- -- For each digit encountered, UI_Int_Value is multiplied by 10,
- -- and the value of the digit added to the result. In addition,
- -- the value in Scale is decremented by one for each actual digit
+ -- For each digit encountered, UI_Int_Value is multiplied by 10, and
+ -- the value of the digit added to the result. In addition, the
+ -- value in Scale is decremented by one for each actual digit
-- scanned.
--------------------------
@@ -464,6 +526,8 @@ package body Scng is
Scale := Scale - 1;
C := Source (Scan_Ptr);
+ -- Case of underline encountered
+
if C = '_' then
-- We do not accumulate the '_' in the checksum, so that
@@ -486,12 +550,9 @@ package body Scng is
exit when C not in '0' .. '9';
end if;
end loop;
-
end Scan_Integer;
- ----------------------------------
- -- Start of Processing for Nlit --
- ----------------------------------
+ -- Start of Processing for Nlit
begin
Base := 10;
@@ -503,8 +564,8 @@ package body Scng is
Point_Scanned := False;
UI_Num_Value := UI_Int_Value;
- -- Various possibilities now for continuing the literal are
- -- period, E/e (for exponent), or :/# (for based literal).
+ -- Various possibilities now for continuing the literal are period,
+ -- E/e (for exponent), or :/# (for based literal).
Scale := 0;
C := Source (Scan_Ptr);
@@ -534,11 +595,11 @@ package body Scng is
end if;
end loop;
- -- Based literal case. The base is the value we already scanned.
- -- In the case of colon, we insist that the following character
- -- is indeed an extended digit or a period. This catches a number
- -- of common errors, as well as catching the well known tricky
- -- bug otherwise arising from "x : integer range 1 .. 10:= 6;"
+ -- Based literal case. The base is the value we already scanned.
+ -- In the case of colon, we insist that the following character
+ -- is indeed an extended digit or a period. This catches a number
+ -- of common errors, as well as catching the well known tricky
+ -- bug otherwise arising from "x : integer range 1 .. 10:= 6;"
elsif C = '#'
or else (C = ':' and then
@@ -561,7 +622,6 @@ package body Scng is
end if;
end if;
-
Accumulate_Checksum (C);
Base_Char := C;
UI_Base := UI_Int_Value;
@@ -712,7 +772,7 @@ package body Scng is
Den => -UI_Scale,
Rbase => Base);
- -- Case of integer literal to be returned
+ -- Case of integer literal to be returned
else
Token := Tok_Integer_Literal;
@@ -720,9 +780,9 @@ package body Scng is
if UI_Scale = 0 then
Int_Literal_Value := UI_Num_Value;
- -- Avoid doing possibly expensive calculations in cases like
- -- parsing 163E800_000# when semantics will not be done anyway.
- -- This is especially useful when parsing garbled input.
+ -- Avoid doing possibly expensive calculations in cases like
+ -- parsing 163E800_000# when semantics will not be done anyway.
+ -- This is especially useful when parsing garbled input.
elsif Operating_Mode /= Check_Syntax
and then (Serious_Errors_Detected = 0 or else Try_Semantics)
@@ -731,15 +791,12 @@ package body Scng is
else
Int_Literal_Value := No_Uint;
-
end if;
-
end if;
Accumulate_Token_Checksum;
return;
-
end Nlit;
----------
@@ -762,8 +819,8 @@ package body Scng is
procedure Error_Bad_String_Char;
-- Signal bad character in string/character literal. On entry
- -- Scan_Ptr points to the improper character encountered during
- -- the scan. Scan_Ptr is not modified, so it still points to the bad
+ -- Scan_Ptr points to the improper character encountered during the
+ -- scan. Scan_Ptr is not modified, so it still points to the bad
-- character on return.
procedure Error_Unterminated_String;
@@ -773,11 +830,11 @@ package body Scng is
procedure Set_String;
-- Procedure used to distinguish between string and operator symbol.
- -- On entry the string has been scanned out, and its characters start
- -- at Token_Ptr and end one character before Scan_Ptr. On exit Token
- -- is set to Tok_String_Literal or Tok_Operator_Symbol as
- -- appropriate, and Token_Node is appropriately initialized.
- -- In addition, in the operator symbol case, Token_Name is
+ -- On entry the string has been scanned out, and its characters
+ -- start at Token_Ptr and end one character before Scan_Ptr. On exit
+ -- Token is set to Tok_String_Literal or Tok_Operator_Symbol as
+ -- appropriate, and Token_Node is appropriately initialized. In
+ -- addition, in the operator symbol case, Token_Name is
-- appropriately set.
---------------------------
@@ -981,9 +1038,9 @@ package body Scng is
end if;
- -- If it is an operator symbol, then Token_Name is set.
- -- If it is some other string value, then Token_Name still
- -- contains Error_Name.
+ -- If it is an operator symbol, then Token_Name is set. If it is
+ -- some other string value, then Token_Name still contains
+ -- Error_Name.
if Token_Name = Error_Name then
Token := Tok_String_Literal;
@@ -991,18 +1048,15 @@ package body Scng is
else
Token := Tok_Operator_Symbol;
end if;
-
end Set_String;
- ----------
- -- Slit --
- ----------
+ -- Start of processing for Slit
begin
-- On entry, Scan_Ptr points to the opening character of the string
- -- which is either a percent, double quote, or apostrophe
- -- (single quote). The latter case is an error detected by
- -- the character literal circuit.
+ -- which is either a percent, double quote, or apostrophe (single
+ -- quote). The latter case is an error detected by the character
+ -- literal circuit.
Delimiter := Source (Scan_Ptr);
Accumulate_Checksum (Delimiter);
@@ -1030,28 +1084,32 @@ package body Scng is
Scan_Ptr := Scan_Ptr + 1;
elsif (C = ESC
- and then
- Wide_Character_Encoding_Method
- in WC_ESC_Encoding_Method)
- or else
- (C in Upper_Half_Character
- and then
- Upper_Half_Encoding)
- or else
- (C = '['
- and then
- Source (Scan_Ptr + 1) = '"'
- and then
- Identifier_Char (Source (Scan_Ptr + 2)))
+ and then Wide_Character_Encoding_Method
+ in WC_ESC_Encoding_Method)
+ or else (C in Upper_Half_Character
+ and then Upper_Half_Encoding)
+ or else (C = '['
+ and then Source (Scan_Ptr + 1) = '"'
+ and then Identifier_Char (Source (Scan_Ptr + 2)))
then
+ Wptr := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
- Accumulate_Checksum (Code);
if Err then
Error_Illegal_Wide_Character;
Code := Get_Char_Code (' ');
end if;
+ Accumulate_Checksum (Code);
+
+ if Ada_Version >= Ada_05
+ and then Is_UTF_32_Non_Graphic (Code)
+ then
+ Error_Msg
+ ("(Ada 2005) non-graphic character not permitted " &
+ "in string literal", Wptr);
+ end if;
+
else
Accumulate_Checksum (C);
@@ -1085,10 +1143,9 @@ package body Scng is
String_Literal_Id := End_String;
Set_String;
return;
-
end Slit;
- -- Start of body of Scan
+ -- Start of processing for Scan
begin
Prev_Token := Token;
@@ -1100,11 +1157,12 @@ package body Scng is
-- encountered and skipped, or some error situation, such as an
-- illegal character, is encountered.
+ <<Scan_Next_Character>>
+
loop
-- Skip past blanks, loop is opened up for speed
while Source (Scan_Ptr) = ' ' loop
-
if Source (Scan_Ptr + 1) /= ' ' then
Scan_Ptr := Scan_Ptr + 1;
exit;
@@ -1148,50 +1206,15 @@ package body Scng is
Token_Ptr := Scan_Ptr;
- -- Here begins the main case statement which transfers control on
- -- the basis of the non-blank character we have encountered.
+ -- Here begins the main case statement which transfers control on the
+ -- basis of the non-blank character we have encountered.
case Source (Scan_Ptr) is
-- Line terminator characters
- when CR | LF | FF | VT => Line_Terminator_Case : begin
-
- -- Check line too long
-
- Check_End_Of_Line;
-
- -- Set Token_Ptr, if End_Of_Line is a token, for the case when
- -- it is a physical line.
-
- if End_Of_Line_Is_Token then
- Token_Ptr := Scan_Ptr;
- end if;
-
- declare
- Physical : Boolean;
-
- begin
- Skip_Line_Terminators (Scan_Ptr, Physical);
-
- -- If we are at start of physical line, update scan pointers
- -- to reflect the start of the new line.
-
- if Physical then
- Current_Line_Start := Scan_Ptr;
- Start_Column := Set_Start_Column;
- First_Non_Blank_Location := Scan_Ptr;
-
- -- If End_Of_Line is a token, we return it as it is
- -- a physical line.
-
- if End_Of_Line_Is_Token then
- Token := Tok_End_Of_Line;
- return;
- end if;
- end if;
- end;
- end Line_Terminator_Case;
+ when CR | LF | FF | VT =>
+ goto Scan_Line_Terminator;
-- Horizontal tab, just skip past it
@@ -1199,15 +1222,14 @@ package body Scng is
if Style_Check then Style.Check_HT; end if;
Scan_Ptr := Scan_Ptr + 1;
- -- End of file character, treated as an end of file only if it
- -- is the last character in the buffer, otherwise it is ignored.
+ -- End of file character, treated as an end of file only if it is
+ -- the last character in the buffer, otherwise it is ignored.
when EOF =>
if Scan_Ptr = Source_Last (Current_Source_File) then
Check_End_Of_Line;
Token := Tok_EOF;
return;
-
else
Scan_Ptr := Scan_Ptr + 1;
end if;
@@ -1229,8 +1251,8 @@ package body Scng is
return;
end if;
- -- Asterisk (can be multiplication operator or double asterisk
- -- which is the exponentiation compound delimiter).
+ -- Asterisk (can be multiplication operator or double asterisk which
+ -- is the exponentiation compound delimiter).
when '*' =>
Accumulate_Checksum ('*');
@@ -1286,8 +1308,7 @@ package body Scng is
when '[' =>
if Source (Scan_Ptr + 1) = '"' then
- Name_Len := 0;
- goto Scan_Identifier;
+ goto Scan_Wide_Character;
else
Error_Msg_S ("illegal character, replaced by ""(""");
@@ -1313,9 +1334,9 @@ package body Scng is
if Style_Check then Style.Check_Comma; end if;
return;
- -- Dot, which is either an isolated period, or part of a double
- -- dot compound delimiter sequence. We also check for the case of
- -- a digit following the period, to give a better error message.
+ -- Dot, which is either an isolated period, or part of a double dot
+ -- compound delimiter sequence. We also check for the case of a
+ -- digit following the period, to give a better error message.
when '.' =>
Accumulate_Checksum ('.');
@@ -1430,6 +1451,15 @@ package body Scng is
loop
-- Scan to non graphic character (opened up for speed)
+ -- Note that we just eat left brackets, which means that
+ -- bracket notation cannot be used for end of line
+ -- characters in comments. This seems a reasonable choice,
+ -- since no one would ever use brackets notation in a real
+ -- program in this situation, and if we allow brackets
+ -- notation, we forbid some valid comments which contain a
+ -- brackets sequence that happens to match an end of line
+ -- character.
+
loop
exit when Source (Scan_Ptr) not in Graphic_Character;
Scan_Ptr := Scan_Ptr + 1;
@@ -1460,13 +1490,44 @@ package body Scng is
elsif Source (Scan_Ptr) = EOF then
exit;
+ -- If we have a wide character, we have to scan it out,
+ -- because it might be a legitimate line terminator
+
+ elsif (Source (Scan_Ptr) = ESC
+ and then Identifier_Char (ESC))
+ or else
+ (Source (Scan_Ptr) in Upper_Half_Character
+ and then Upper_Half_Encoding)
+ then
+ declare
+ Wptr : constant Source_Ptr := Scan_Ptr;
+ Code : Char_Code;
+ Err : Boolean;
+
+ begin
+ Scan_Wide (Source, Scan_Ptr, Code, Err);
+
+ -- If not well formed wide character, then just skip
+ -- past it and ignore it.
+
+ if Err then
+ Scan_Ptr := Wptr + 1;
+
+ -- If UTF_32 terminator, terminate comment scan
+
+ elsif Is_UTF_32_Line_Terminator (Code) then
+ Scan_Ptr := Wptr;
+ exit;
+ end if;
+ end;
+
-- Keep going if character in 80-FF range, or is ESC. These
-- characters are allowed in comments by RM-2.1(1), 2.7(2).
-- They are allowed even in Ada 83 mode according to the
-- approved AI. ESC was added to the AI in June 93.
elsif Source (Scan_Ptr) in Upper_Half_Character
- or else Source (Scan_Ptr) = ESC
+ or else Source (Scan_Ptr) = ESC
then
Scan_Ptr := Scan_Ptr + 1;
@@ -1475,7 +1536,6 @@ package body Scng is
else
Error_Illegal_Character;
end if;
-
end loop;
-- Note that, except when comments are tokens, we do NOT
@@ -1538,10 +1598,10 @@ package body Scng is
-- Here is where we make the test to distinguish the cases. Treat
-- as apostrophe if previous token is an identifier, right paren
-- or the reserved word "all" (latter case as in A.all'Address)
- -- (or the reserved word "project" in project files).
- -- Also treat it as apostrophe after a literal (this catches
- -- some legitimate cases, like A."abs"'Address, and also gives
- -- better error behavior for impossible cases like 123'xxx).
+ -- (or the reserved word "project" in project files). Also treat
+ -- it as apostrophe after a literal (this catches some legitimate
+ -- cases, like A."abs"'Address, and also gives better error
+ -- behavior for impossible cases like 123'xxx).
if Prev_Token = Tok_Identifier
or else Prev_Token = Tok_Right_Paren
@@ -1556,7 +1616,7 @@ package body Scng is
-- Otherwise the apostrophe starts a character literal
else
- -- Case of wide character literal with ESC or [ encoding
+ -- Case of wide character literal
if (Source (Scan_Ptr) = ESC
and then
@@ -1570,11 +1630,20 @@ package body Scng is
and then
Source (Scan_Ptr + 1) = '"')
then
+ Wptr := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
Accumulate_Checksum (Code);
if Err then
Error_Illegal_Wide_Character;
+ Code := Character'Pos (' ');
+
+ elsif Ada_Version >= Ada_05
+ and then Is_UTF_32_Non_Graphic (Code)
+ then
+ Error_Msg
+ ("(Ada 2005) non-graphic character not permitted " &
+ "in character literal", Wptr);
end if;
if Source (Scan_Ptr) /= ''' then
@@ -1590,7 +1659,6 @@ package body Scng is
-- apostrophe instead since this gives better error recovery
elsif Source (Scan_Ptr + 1) /= ''' then
-
if Prev_Token = Tok_Range then
Token := Tok_Apostrophe;
return;
@@ -1722,7 +1790,6 @@ package body Scng is
Token := Tok_Vertical_Bar;
return;
end if;
-
end Exclamation_Case;
-- Plus
@@ -1750,6 +1817,7 @@ package body Scng is
when 'a' .. 'z' =>
Name_Len := 1;
+ Underline_Found := False;
Name_Buffer (1) := Source (Scan_Ptr);
Accumulate_Checksum (Name_Buffer (1));
Scan_Ptr := Scan_Ptr + 1;
@@ -1759,6 +1827,7 @@ package body Scng is
when 'A' .. 'Z' =>
Name_Len := 1;
+ Underline_Found := False;
Name_Buffer (1) :=
Character'Val (Character'Pos (Source (Scan_Ptr)) + 32);
Accumulate_Checksum (Name_Buffer (1));
@@ -1780,6 +1849,7 @@ package body Scng is
Name_Len := 1;
Name_Buffer (1) := '_';
Scan_Ptr := Scan_Ptr + 1;
+ Underline_Found := False;
goto Scan_Identifier;
-- Space (not possible, because we scanned past blanks)
@@ -1791,23 +1861,21 @@ package body Scng is
when Upper_Half_Character =>
- -- Wide character case. Note that Scan_Identifier will issue
- -- an appropriate message if wide characters are not allowed
- -- in identifiers.
+ -- Wide character case
if Upper_Half_Encoding then
- Name_Len := 0;
- goto Scan_Identifier;
+ goto Scan_Wide_Character;
-- Otherwise we have OK Latin-1 character
else
-- Upper half characters may possibly be identifier letters
- -- but can never be digits, so Identifier_Char can be used
- -- to test for a valid start of identifier character.
+ -- but can never be digits, so Identifier_Char can be used to
+ -- test for a valid start of identifier character.
if Identifier_Char (Source (Scan_Ptr)) then
Name_Len := 0;
+ Underline_Found := False;
goto Scan_Identifier;
else
Error_Illegal_Character;
@@ -1819,13 +1887,14 @@ package body Scng is
-- ESC character, possible start of identifier if wide characters
-- using ESC encoding are allowed in identifiers, which we can
-- tell by looking at the Identifier_Char flag for ESC, which is
- -- only true if these conditions are met.
+ -- only true if these conditions are met. In Ada 2005 mode, may
+ -- also be valid UTF_32 space or line terminator character.
if Identifier_Char (ESC) then
Name_Len := 0;
- goto Scan_Identifier;
+ goto Scan_Wide_Character;
else
- Error_Illegal_Wide_Character;
+ Error_Illegal_Character;
end if;
-- Invalid control characters
@@ -1839,6 +1908,7 @@ package body Scng is
-- Invalid graphic characters
when '#' | '$' | '?' | '@' | '`' | '\' | '^' | '~' =>
+
-- If Set_Special_Character has been called for this character,
-- set Scans.Special_Character and return a Special token.
@@ -1849,7 +1919,7 @@ package body Scng is
Scan_Ptr := Scan_Ptr + 1;
return;
- -- otherwise, this is an illegal character
+ -- Otherwise, this is an illegal character
else
Error_Illegal_Character;
@@ -1865,95 +1935,177 @@ package body Scng is
end loop;
- -- Identifier scanning routine. On entry, some initial characters
- -- of the identifier may have already been stored in Name_Buffer.
- -- If so, Name_Len has the number of characters stored. otherwise
- -- Name_Len is set to zero on entry.
+ -- Wide_Character scanning routine. On entry we have encountered the
+ -- initial character of a wide character sequence.
- <<Scan_Identifier>>
+ <<Scan_Wide_Character>>
- -- This loop scans as fast as possible past lower half letters
- -- and digits, which we expect to be the most common characters.
+ declare
+ Code : Char_Code;
+ Err : Boolean;
- loop
- if Source (Scan_Ptr) in 'a' .. 'z'
- or else Source (Scan_Ptr) in '0' .. '9'
- then
- Name_Buffer (Name_Len + 1) := Source (Scan_Ptr);
- Accumulate_Checksum (Source (Scan_Ptr));
+ begin
+ Wptr := Scan_Ptr;
+ Scan_Wide (Source, Scan_Ptr, Code, Err);
- elsif Source (Scan_Ptr) in 'A' .. 'Z' then
- Name_Buffer (Name_Len + 1) :=
- Character'Val (Character'Pos (Source (Scan_Ptr)) + 32);
- Accumulate_Checksum (Name_Buffer (Name_Len + 1));
- else
- exit;
- end if;
+ -- If bad wide character, signal error and continue scan
- -- Open out the loop a couple of times for speed
+ if Err then
+ Error_Illegal_Wide_Character;
+ goto Scan_Next_Character;
- if Source (Scan_Ptr + 1) in 'a' .. 'z'
- or else Source (Scan_Ptr + 1) in '0' .. '9'
- then
- Name_Buffer (Name_Len + 2) := Source (Scan_Ptr + 1);
- Accumulate_Checksum (Source (Scan_Ptr + 1));
+ -- If OK letter, reset scan ptr and go scan identifier
+
+ elsif Is_UTF_32_Letter (Code) then
+ Scan_Ptr := Wptr;
+ Name_Len := 0;
+ Underline_Found := False;
+ goto Scan_Identifier;
- elsif Source (Scan_Ptr + 1) in 'A' .. 'Z' then
- Name_Buffer (Name_Len + 2) :=
- Character'Val (Character'Pos (Source (Scan_Ptr + 1)) + 32);
- Accumulate_Checksum (Name_Buffer (Name_Len + 2));
+ -- If OK wide space, ignore and keep scanning (we do not include
+ -- any ignored spaces in checksum)
+
+ elsif Is_UTF_32_Space (Code) then
+ goto Scan_Next_Character;
+
+ -- If OK wide line terminator, terminate current line
+
+ elsif Is_UTF_32_Line_Terminator (Code) then
+ Scan_Ptr := Wptr;
+ goto Scan_Line_Terminator;
+
+ -- Punctuation is an error (at start of identifier)
+
+ elsif Is_UTF_32_Punctuation (Code) then
+ Error_Msg
+ ("identifier cannot start with punctuation", Wptr);
+ Scan_Ptr := Wptr;
+ Name_Len := 0;
+ Underline_Found := False;
+ goto Scan_Identifier;
+
+ -- Mark character is an error (at start of identifer)
+
+ elsif Is_UTF_32_Mark (Code) then
+ Error_Msg
+ ("identifier cannot start with mark character", Wptr);
+ Scan_Ptr := Wptr;
+ Name_Len := 0;
+ Underline_Found := False;
+ goto Scan_Identifier;
+
+ -- Other format character is an error (at start of identifer)
+
+ elsif Is_UTF_32_Other (Code) then
+ Error_Msg
+ ("identifier cannot start with other format character", Wptr);
+ Scan_Ptr := Wptr;
+ Name_Len := 0;
+ Underline_Found := False;
+ goto Scan_Identifier;
+
+ -- Extended digit character is an error. Could be bad start of
+ -- identifier or bad literal. Not worth doing too much to try to
+ -- distinguish these cases, but we will do a little bit.
+
+ elsif Is_UTF_32_Digit (Code) then
+ Error_Msg
+ ("identifier cannot start with digit character", Wptr);
+ Scan_Ptr := Wptr;
+ Name_Len := 0;
+ Underline_Found := False;
+ goto Scan_Identifier;
+
+ -- All other wide characters are illegal here
else
- Scan_Ptr := Scan_Ptr + 1;
- Name_Len := Name_Len + 1;
- exit;
+ Error_Illegal_Wide_Character;
+ goto Scan_Next_Character;
end if;
+ end;
- if Source (Scan_Ptr + 2) in 'a' .. 'z'
- or else Source (Scan_Ptr + 2) in '0' .. '9'
- then
- Name_Buffer (Name_Len + 3) := Source (Scan_Ptr + 2);
- Accumulate_Checksum (Source (Scan_Ptr + 2));
+ -- Routine to scan line terminator. On entry Scan_Ptr points to a
+ -- character which is one of FF,LR,CR,VT, or one of the wide characters
+ -- that is treated as a line termiantor.
- elsif Source (Scan_Ptr + 2) in 'A' .. 'Z' then
- Name_Buffer (Name_Len + 3) :=
- Character'Val (Character'Pos (Source (Scan_Ptr + 2)) + 32);
- Accumulate_Checksum (Name_Buffer (Name_Len + 3));
- else
- Scan_Ptr := Scan_Ptr + 2;
- Name_Len := Name_Len + 2;
- exit;
+ <<Scan_Line_Terminator>>
+
+ -- Check line too long
+
+ Check_End_Of_Line;
+
+ -- Set Token_Ptr, if End_Of_Line is a token, for the case when it is
+ -- a physical line.
+
+ if End_Of_Line_Is_Token then
+ Token_Ptr := Scan_Ptr;
+ end if;
+
+ declare
+ Physical : Boolean;
+
+ begin
+ Skip_Line_Terminators (Scan_Ptr, Physical);
+
+ -- If we are at start of physical line, update scan pointers to
+ -- reflect the start of the new line.
+
+ if Physical then
+ Current_Line_Start := Scan_Ptr;
+ Start_Column := Set_Start_Column;
+ First_Non_Blank_Location := Scan_Ptr;
+
+ -- If End_Of_Line is a token, we return it as it is a
+ -- physical line.
+
+ if End_Of_Line_Is_Token then
+ Token := Tok_End_Of_Line;
+ return;
+ end if;
end if;
+ end;
+
+ goto Scan_Next_Character;
- if Source (Scan_Ptr + 3) in 'a' .. 'z'
- or else Source (Scan_Ptr + 3) in '0' .. '9'
+ -- Identifier scanning routine. On entry, some initial characters of
+ -- the identifier may have already been stored in Name_Buffer. If so,
+ -- Name_Len has the number of characters stored. otherwise Name_Len is
+ -- set to zero on entry. Underline_Found is also set False on entry.
+
+ <<Scan_Identifier>>
+
+ -- This loop scans as fast as possible past lower half letters and
+ -- digits, which we expect to be the most common characters.
+
+ loop
+ if Source (Scan_Ptr) in 'a' .. 'z'
+ or else Source (Scan_Ptr) in '0' .. '9'
then
- Name_Buffer (Name_Len + 4) := Source (Scan_Ptr + 3);
- Accumulate_Checksum (Source (Scan_Ptr + 3));
+ Name_Buffer (Name_Len + 1) := Source (Scan_Ptr);
+ Accumulate_Checksum (Source (Scan_Ptr));
- elsif Source (Scan_Ptr + 3) in 'A' .. 'Z' then
- Name_Buffer (Name_Len + 4) :=
- Character'Val (Character'Pos (Source (Scan_Ptr + 3)) + 32);
- Accumulate_Checksum (Name_Buffer (Name_Len + 4));
+ elsif Source (Scan_Ptr) in 'A' .. 'Z' then
+ Name_Buffer (Name_Len + 1) :=
+ Character'Val (Character'Pos (Source (Scan_Ptr)) + 32);
+ Accumulate_Checksum (Name_Buffer (Name_Len + 1));
else
- Scan_Ptr := Scan_Ptr + 3;
- Name_Len := Name_Len + 3;
exit;
end if;
- Scan_Ptr := Scan_Ptr + 4;
- Name_Len := Name_Len + 4;
+ Underline_Found := False;
+ Scan_Ptr := Scan_Ptr + 1;
+ Name_Len := Name_Len + 1;
end loop;
-- If we fall through, then we have encountered either an underline
-- character, or an extended identifier character (i.e. one from the
- -- upper half), or a wide character, or an identifier terminator.
- -- The initial test speeds us up in the most common case where we
- -- have an identifier terminator. Note that ESC is an identifier
- -- character only if a wide character encoding method that uses
- -- ESC encoding is active, so if we find an ESC character we know
- -- that we have a wide character.
+ -- upper half), or a wide character, or an identifier terminator. The
+ -- initial test speeds us up in the most common case where we have
+ -- an identifier terminator. Note that ESC is an identifier character
+ -- only if a wide character encoding method that uses ESC encoding
+ -- is active, so if we find an ESC character we know that we have a
+ -- wide character.
if Identifier_Char (Source (Scan_Ptr)) then
@@ -1962,22 +2114,10 @@ package body Scng is
if Source (Scan_Ptr) = '_' then
Accumulate_Checksum ('_');
- -- Check error case of identifier ending with underscore
- -- In this case we ignore the underscore and do not store it.
-
- if not Identifier_Char (Source (Scan_Ptr + 1)) then
- Error_Msg_S ("identifier cannot end with underline");
- Scan_Ptr := Scan_Ptr + 1;
-
- -- Check error case of two underscores. In this case we do
- -- not store the first underscore (we will store the second)
-
- elsif Source (Scan_Ptr + 1) = '_' then
- Error_No_Double_Underline;
-
- -- Normal case of legal underscore
-
+ if Underline_Found then
+ Error_No_Double_Underline;
else
+ Underline_Found := True;
Name_Len := Name_Len + 1;
Name_Buffer (Name_Len) := '_';
end if;
@@ -1994,6 +2134,7 @@ package body Scng is
Store_Encoded_Character
(Get_Char_Code (Fold_Lower (Source (Scan_Ptr))));
Scan_Ptr := Scan_Ptr + 1;
+ Underline_Found := False;
goto Scan_Identifier;
-- Left bracket not followed by a quote terminates an identifier.
@@ -2014,12 +2155,12 @@ package body Scng is
-- encoding into the name table entry for the identifier.
declare
- Sptr : constant Source_Ptr := Scan_Ptr;
- Code : Char_Code;
- Err : Boolean;
- Chr : Character;
+ Code : Char_Code;
+ Err : Boolean;
+ Chr : Character;
begin
+ Wptr := Scan_Ptr;
Scan_Wide (Source, Scan_Ptr, Code, Err);
-- If error, signal error
@@ -2037,19 +2178,16 @@ package body Scng is
Accumulate_Checksum (Chr);
Store_Encoded_Character
(Get_Char_Code (Fold_Lower (Chr)));
+ Underline_Found := False;
- -- Character is not normal identifier character, store
- -- it in encoded form.
+ -- Here if not a normal identifier character
else
- Accumulate_Checksum (Code);
- Store_Encoded_Character (Code);
-
-- Make sure we are allowing wide characters in
-- identifiers. Note that we allow wide character
- -- notation for an OK identifier character. This
- -- in particular allows bracket or other notation
- -- to be used for upper half letters.
+ -- notation for an OK identifier character. This in
+ -- particular allows bracket or other notation to be
+ -- used for upper half letters.
-- Wide characters are always allowed in Ada 2005
@@ -2057,32 +2195,110 @@ package body Scng is
and then Ada_Version < Ada_05
then
Error_Msg
- ("wide character not allowed in identifier", Sptr);
+ ("wide character not allowed in identifier", Wptr);
+ end if;
+
+ -- If OK letter, store it folding to upper case. Note
+ -- that we include the folded letter in the checksum.
+
+ if Is_UTF_32_Letter (Code) then
+ Code := UTF_32_To_Upper_Case (Code);
+ Accumulate_Checksum (Code);
+ Store_Encoded_Character (Code);
+ Underline_Found := False;
+
+ -- If OK extended digit or mark, then store it
+
+ elsif Is_UTF_32_Digit (Code)
+ or else Is_UTF_32_Mark (Code)
+ then
+ Accumulate_Checksum (Code);
+ Store_Encoded_Character (Code);
+ Underline_Found := False;
+
+ -- Wide punctuation is also stored, but counts as an
+ -- underline character for error checking purposes.
+
+ elsif Is_UTF_32_Punctuation (Code) then
+ Accumulate_Checksum (Code);
+
+ if Underline_Found then
+ declare
+ Cend : constant Source_Ptr := Scan_Ptr;
+ begin
+ Scan_Ptr := Wptr;
+ Error_No_Double_Underline;
+ Scan_Ptr := Cend;
+ end;
+
+ else
+ Store_Encoded_Character (Code);
+ Underline_Found := True;
+ end if;
+
+ -- Wide character in Unicode cateogory "Other, Format"
+ -- is accepted in an identifier, but is ignored and not
+ -- stored. It seems reasonable to exclude it from the
+ -- checksum.
+
+ elsif Is_UTF_32_Other (Code) then
+ null;
+
+ -- Wide character in category Separator,Space terminates
+
+ elsif Is_UTF_32_Space (Code) then
+ goto Scan_Identifier_Complete;
+
+ -- Any other wide character is not acceptable
+
+ else
+ Error_Msg
+ ("invalid wide character in identifier", Wptr);
end if;
end if;
- end;
- goto Scan_Identifier;
+ goto Scan_Identifier;
+ end;
end if;
end if;
- -- Scan of identifier is complete. The identifier is stored in
- -- Name_Buffer, and Scan_Ptr points past the last character.
+ -- Scan of identifier is complete. The identifier is stored in
+ -- Name_Buffer, and Scan_Ptr points past the last character.
+ <<Scan_Identifier_Complete>>
Token_Name := Name_Find;
+ -- Check for identifier ending with underline or punctuation char
+
+ if Underline_Found then
+ Underline_Found := False;
+
+ if Source (Scan_Ptr - 1) = '_' then
+ Error_Msg
+ ("identifier cannot end with underline", Scan_Ptr - 1);
+ else
+ Error_Msg
+ ("identifier cannot end with punctuation character", Wptr);
+ end if;
+ end if;
+
-- Here is where we check if it was a keyword
if Get_Name_Table_Byte (Token_Name) /= 0
and then (Ada_Version >= Ada_95
or else Token_Name not in Ada_95_Reserved_Words)
+ and then (Ada_Version >= Ada_05
+ or else Token_Name not in Ada_2005_Reserved_Words)
then
Token := Token_Type'Val (Get_Name_Table_Byte (Token_Name));
- -- Deal with possible style check for non-lower case keyword,
- -- but we don't treat ACCESS, DELTA, DIGITS, RANGE as keywords
- -- for this purpose if they appear as attribute designators.
- -- Actually we only check the first character for speed.
+ -- Deal with possible style check for non-lower case keyword, but
+ -- we don't treat ACCESS, DELTA, DIGITS, RANGE as keywords for
+ -- this purpose if they appear as attribute designators. Actually
+ -- we only check the first character for speed.
+
+ -- Ada 2005 (AI-284): Do not apply the style check in case of
+ -- "pragma Interface"
if Style_Check
and then Source (Token_Ptr) <= 'Z'
@@ -2092,14 +2308,18 @@ package body Scng is
and then Token /= Tok_Delta
and then Token /= Tok_Digits
and then Token /= Tok_Range))
+ and then (Token /= Tok_Interface
+ or else
+ (Token = Tok_Interface
+ and then Prev_Token /= Tok_Pragma))
then
Style.Non_Lower_Case_Keyword;
end if;
- -- We must reset Token_Name since this is not an identifier
- -- and if we leave Token_Name set, the parser gets confused
- -- because it thinks it is dealing with an identifier instead
- -- of the corresponding keyword.
+ -- We must reset Token_Name since this is not an identifier and
+ -- if we leave Token_Name set, the parser gets confused because
+ -- it thinks it is dealing with an identifier instead of the
+ -- corresponding keyword.
Token_Name := No_Name;
Accumulate_Token_Checksum;
diff --git a/gcc/ada/seh_init.c b/gcc/ada/seh_init.c
index 15cda4fdbf4..cf1ada8a497 100644
--- a/gcc/ada/seh_init.c
+++ b/gcc/ada/seh_init.c
@@ -74,8 +74,8 @@ EXCEPTION_DISPOSITION __gnat_SEH_error_handler
EXCEPTION_DISPOSITION
__gnat_SEH_error_handler (struct _EXCEPTION_RECORD* ExceptionRecord,
void *EstablisherFrame,
- struct _CONTEXT* ContextRecord ATTRIBUTE_UNUSED,
- void *DispatcherContext ATTRIBUTE_UNUSED)
+ struct _CONTEXT* ContextRecord,
+ void *DispatcherContext)
{
struct Exception_Data *exception;
const char *msg;
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 44c80e0910f..aa7cddff6a1 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -837,7 +837,10 @@ package body Sem_Aggr is
C := Get_String_Char (Str, J);
Set_Character_Literal_Name (C);
- C_Node := Make_Character_Literal (P, Name_Find, C);
+ C_Node :=
+ Make_Character_Literal (P,
+ Chars => Name_Find,
+ Char_Literal_Value => UI_From_CC (C));
Set_Etype (C_Node, Any_Character);
Append_To (Exprs, C_Node);
@@ -915,8 +918,10 @@ package body Sem_Aggr is
if Number_Dimensions (Typ) = 1
and then
(Root_Type (Component_Type (Typ)) = Standard_Character
- or else
- Root_Type (Component_Type (Typ)) = Standard_Wide_Character)
+ or else
+ Root_Type (Component_Type (Typ)) = Standard_Wide_Character
+ or else
+ Root_Type (Component_Type (Typ)) = Standard_Wide_Wide_Character)
and then No (Component_Associations (N))
and then not Is_Limited_Composite (Typ)
and then not Is_Private_Composite (Typ)
@@ -939,7 +944,7 @@ package body Sem_Aggr is
Expr := First (Expressions (N));
while Present (Expr) loop
- Store_String_Char (Char_Literal_Value (Expr));
+ Store_String_Char (UI_To_CC (Char_Literal_Value (Expr)));
Next (Expr);
end loop;
@@ -1672,7 +1677,9 @@ package body Sem_Aggr is
-- Ada 2005 (AI-231)
- Check_Can_Never_Be_Null (N, Expression (Assoc));
+ if Ada_Version >= Ada_05 then
+ Check_Can_Never_Be_Null (Etype (N), Expression (Assoc));
+ end if;
-- Ada 2005 (AI-287): In case of default initialized component
-- we delay the resolution to the expansion phase
@@ -1798,7 +1805,11 @@ package body Sem_Aggr is
while Present (Expr) loop
Nb_Elements := Nb_Elements + 1;
- Check_Can_Never_Be_Null (N, Expr); -- Ada 2005 (AI-231)
+ -- Ada 2005 (AI-231)
+
+ if Ada_Version >= Ada_05 then
+ Check_Can_Never_Be_Null (Etype (N), Expr);
+ end if;
if not Resolve_Aggr_Expr (Expr, Single_Elmt => True) then
return Failure;
@@ -1810,8 +1821,12 @@ package body Sem_Aggr is
if Others_Present then
Assoc := Last (Component_Associations (N));
- Check_Can_Never_Be_Null
- (N, Expression (Assoc)); -- Ada 2005 (AI-231)
+ -- Ada 2005 (AI-231)
+
+ if Ada_Version >= Ada_05 then
+ Check_Can_Never_Be_Null
+ (Etype (N), Expression (Assoc));
+ end if;
-- Ada 2005 (AI-287): In case of default initialized component
-- we delay the resolution to the expansion phase.
@@ -2051,6 +2066,9 @@ package body Sem_Aggr is
-- less which ancestor). It is not possible to determine the
-- required components of the extension part.
+ -- This check implements AI-306, which in fact was motivated
+ -- by an ACT query to the ARG after this test was added.
+
Error_Msg_N ("ancestor part must be statically tagged", A);
else
Resolve_Record_Aggregate (N, Typ);
@@ -2358,13 +2376,9 @@ package body Sem_Aggr is
-- Ada 2005 (AI-231)
if Ada_Version >= Ada_05
- and then Present (Expression (Assoc))
and then Nkind (Expression (Assoc)) = N_Null
- and then Can_Never_Be_Null (Compon)
then
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding " &
- "components", Expression (Assoc));
+ Check_Can_Never_Be_Null (Compon, Expression (Assoc));
end if;
-- We need to duplicate the expression when several
@@ -2679,13 +2693,8 @@ package body Sem_Aggr is
-- Ada 2005 (AI-231)
- if Ada_Version >= Ada_05
- and then Nkind (Positional_Expr) = N_Null
- and then Can_Never_Be_Null (Discrim)
- then
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding " &
- "components", Positional_Expr);
+ if Ada_Version >= Ada_05 then
+ Check_Can_Never_Be_Null (Discrim, Positional_Expr);
end if;
Next (Positional_Expr);
@@ -2921,13 +2930,8 @@ package body Sem_Aggr is
-- Ada 2005 (AI-231)
- if Ada_Version >= Ada_05
- and then Nkind (Positional_Expr) = N_Null
- and then Can_Never_Be_Null (Component)
- then
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding components",
- Positional_Expr);
+ if Ada_Version >= Ada_05 then
+ Check_Can_Never_Be_Null (Component, Positional_Expr);
end if;
if Present (Get_Value (Component, Component_Associations (N))) then
@@ -3081,12 +3085,17 @@ package body Sem_Aggr is
procedure Check_Can_Never_Be_Null (N : Node_Id; Expr : Node_Id) is
begin
- if Ada_Version >= Ada_05
- and then Nkind (Expr) = N_Null
- and then Can_Never_Be_Null (Etype (N))
+ pragma Assert (Ada_Version >= Ada_05);
+
+ if Nkind (Expr) = N_Null
+ and then Can_Never_Be_Null (N)
then
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding components", Expr);
+ Apply_Compile_Time_Constraint_Error
+ (N => Expr,
+ Msg => "(Ada 2005) NULL not allowed in"
+ & " null-excluding components?",
+ Reason => CE_Null_Not_Allowed,
+ Rep => False);
end if;
end Check_Can_Never_Be_Null;
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 553fb7138a1..8780f6b08f8 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -3458,6 +3458,22 @@ package body Sem_Attr is
when Attribute_Storage_Unit =>
Standard_Attribute (Ttypes.System_Storage_Unit);
+ -----------------
+ -- Stream_Size --
+ -----------------
+
+ when Attribute_Stream_Size =>
+ Check_E0;
+ Check_Type;
+
+ if Is_Entity_Name (P)
+ and then Is_Elementary_Type (Entity (P))
+ then
+ Set_Etype (N, Universal_Integer);
+ else
+ Error_Attr ("invalid prefix for % attribute", P);
+ end if;
+
----------
-- Succ --
----------
@@ -3801,6 +3817,19 @@ package body Sem_Attr is
Validate_Non_Static_Attribute_Function_Call;
end Wide_Image;
+ ---------------------
+ -- Wide_Wide_Image --
+ ---------------------
+
+ when Attribute_Wide_Wide_Image => Wide_Wide_Image :
+ begin
+ Check_Scalar_Type;
+ Set_Etype (N, Standard_Wide_Wide_String);
+ Check_E1;
+ Resolve (E1, P_Base_Type);
+ Validate_Non_Static_Attribute_Function_Call;
+ end Wide_Wide_Image;
+
----------------
-- Wide_Value --
----------------
@@ -3817,6 +3846,31 @@ package body Sem_Attr is
Validate_Non_Static_Attribute_Function_Call;
end Wide_Value;
+ ---------------------
+ -- Wide_Wide_Value --
+ ---------------------
+
+ when Attribute_Wide_Wide_Value => Wide_Wide_Value :
+ begin
+ Check_E1;
+ Check_Scalar_Type;
+
+ -- Set Etype before resolving expression because expansion
+ -- of expression may require enclosing type.
+
+ Set_Etype (N, P_Type);
+ Validate_Non_Static_Attribute_Function_Call;
+ end Wide_Wide_Value;
+
+ ---------------------
+ -- Wide_Wide_Width --
+ ---------------------
+
+ when Attribute_Wide_Wide_Width =>
+ Check_E0;
+ Check_Scalar_Type;
+ Set_Etype (N, Universal_Integer);
+
----------------
-- Wide_Width --
----------------
@@ -4919,12 +4973,12 @@ package body Sem_Attr is
when Attribute_Enum_Rep =>
- -- For an enumeration type with a non-standard representation
- -- use the Enumeration_Rep field of the proper constant. Note
- -- that this would not work for types Character/Wide_Character,
- -- since no real entities are created for the enumeration
- -- literals, but that does not matter since these two types
- -- do not have non-standard representations anyway.
+ -- For an enumeration type with a non-standard representation use
+ -- the Enumeration_Rep field of the proper constant. Note that this
+ -- will not work for types Character/Wide_[Wide-]Character, since no
+ -- real entities are created for the enumeration literals, but that
+ -- does not matter since these two types do not have non-standard
+ -- representations anyway.
if Is_Enumeration_Type (P_Type)
and then Has_Non_Standard_Rep (P_Type)
@@ -5653,11 +5707,23 @@ package body Sem_Attr is
-- Remainder --
---------------
- when Attribute_Remainder =>
- Fold_Ureal (N,
- Eval_Fat.Remainder
- (P_Root_Type, Expr_Value_R (E1), Expr_Value_R (E2)),
- Static);
+ when Attribute_Remainder => Remainder : declare
+ X : constant Ureal := Expr_Value_R (E1);
+ Y : constant Ureal := Expr_Value_R (E2);
+
+ begin
+ if UR_Is_Zero (Y) then
+ Apply_Compile_Time_Constraint_Error
+ (N, "division by zero in Remainder",
+ CE_Overflow_Check_Failed,
+ Warn => not Static);
+
+ Check_Expressions;
+ return;
+ end if;
+
+ Fold_Ureal (N, Eval_Fat.Remainder (P_Root_Type, X, Y), Static);
+ end Remainder;
-----------
-- Round --
@@ -5832,7 +5898,7 @@ package body Sem_Attr is
-- Size_Clause field for a subtype when Has_Size_Clause
-- is False. Consider:
- -- type x is range 1 .. 64; g
+ -- type x is range 1 .. 64;
-- for x'size use 12;
-- subtype y is x range 0 .. 3;
@@ -5893,6 +5959,13 @@ package body Sem_Attr is
Fold_Ureal (N, Small_Value (P_Type), True);
end if;
+ -----------------
+ -- Stream_Size --
+ -----------------
+
+ when Attribute_Stream_Size =>
+ null;
+
----------
-- Succ --
----------
@@ -6100,6 +6173,22 @@ package body Sem_Attr is
when Attribute_Wide_Image =>
null;
+ ---------------------
+ -- Wide_Wide_Image --
+ ---------------------
+
+ -- Wide_Wide_Image is a scalar attribute but is never static, because it
+ -- is not a static function (having a non-scalar argument (RM 4.9(22)).
+
+ when Attribute_Wide_Wide_Image =>
+ null;
+
+ ---------------------
+ -- Wide_Wide_Width --
+ ---------------------
+
+ -- Processing for Wide_Wide_Width is combined with Width
+
----------------
-- Wide_Width --
----------------
@@ -6110,9 +6199,11 @@ package body Sem_Attr is
-- Width --
-----------
- -- This processing also handles the case of Wide_Width
+ -- This processing also handles the case of Wide_[Wide_]Width
- when Attribute_Width | Attribute_Wide_Width => Width :
+ when Attribute_Width |
+ Attribute_Wide_Width |
+ Attribute_Wide_Wide_Width => Width :
begin
if Compile_Time_Known_Bounds (P_Type) then
@@ -6193,10 +6284,11 @@ package body Sem_Attr is
W := 0;
-- Width for types derived from Standard.Character
- -- and Standard.Wide_Character.
+ -- and Standard.Wide_[Wide_]Character.
elsif R = Standard_Character
- or else R = Standard_Wide_Character
+ or else R = Standard_Wide_Character
+ or else R = Standard_Wide_Wide_Character
then
W := 0;
@@ -6207,6 +6299,8 @@ package body Sem_Attr is
-- Assume all wide-character escape sequences are
-- same length, so we can quit when we reach one.
+ -- Is this right for UTF-8?
+
if J > 255 then
if Id = Attribute_Wide_Width then
W := Int'Max (W, 3);
@@ -6299,8 +6393,8 @@ package body Sem_Attr is
Get_Decoded_Name_String (Chars (L));
Wt := Nat (Name_Len);
- -- For Wide_Width, use encoded name, and then
- -- adjust for the encoding.
+ -- For Wide_[Wide_]Width, use encoded name, and
+ -- then adjust for the encoding.
else
Get_Name_String (Chars (L));
@@ -6386,11 +6480,11 @@ package body Sem_Attr is
Attribute_Value |
Attribute_Wchar_T_Size |
Attribute_Wide_Value |
+ Attribute_Wide_Wide_Value |
Attribute_Word_Size |
Attribute_Write =>
raise Program_Error;
-
end case;
-- At the end of the case, one more check. If we did a static evaluation
@@ -7348,6 +7442,9 @@ package body Sem_Attr is
when Attribute_Wide_Value =>
Resolve (First (Expressions (N)), Standard_Wide_String);
+ when Attribute_Wide_Wide_Value =>
+ Resolve (First (Expressions (N)), Standard_Wide_Wide_String);
+
when others => null;
end case;
end case;
diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb
index b06ab1e2919..a113ac91e19 100644
--- a/gcc/ada/sem_case.adb
+++ b/gcc/ada/sem_case.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2005 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- --
@@ -267,11 +267,12 @@ package body Sem_Case is
C : Int;
begin
- -- For character, or wide character. If we are in 7-bit ASCII graphic
+ -- For character, or wide [wide] character. If 7-bit ASCII graphic
-- range, then build and return appropriate character literal name
if Rtp = Standard_Character
or else Rtp = Standard_Wide_Character
+ or else Rtp = Standard_Wide_Wide_Character
then
C := UI_To_Int (Value);
@@ -429,11 +430,13 @@ package body Sem_Case is
if Root_Type (Choice_Type) = Standard_Character
or else
Root_Type (Choice_Type) = Standard_Wide_Character
+ or else
+ Root_Type (Choice_Type) = Standard_Wide_Wide_Character
then
Set_Character_Literal_Name (Char_Code (UI_To_Int (Value)));
Lit := New_Node (N_Character_Literal, Loc);
Set_Chars (Lit, Name_Find);
- Set_Char_Literal_Value (Lit, Char_Code (UI_To_Int (Value)));
+ Set_Char_Literal_Value (Lit, Value);
Set_Etype (Lit, Choice_Type);
Set_Is_Static_Expression (Lit, True);
return Lit;
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 5d9e5caa34d..a9700fb1dcc 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -1692,14 +1692,26 @@ package body Sem_Ch10 is
if Implementation_Unit_Warnings
and then Current_Sem_Unit = Main_Unit
- and then Implementation_Unit (Get_Source_Unit (U))
and then not Intunit
and then not Implicit_With (N)
+ and then not GNAT_Mode
then
- Error_Msg_N ("& is an internal 'G'N'A'T unit?", Name (N));
- Error_Msg_N
- ("\use of this unit is non-portable and version-dependent?",
- Name (N));
+ declare
+ U_Kind : constant Kind_Of_Unit :=
+ Get_Kind_Of_Unit (Get_Source_Unit (U));
+
+ begin
+ if U_Kind = Implementation_Unit then
+ Error_Msg_N ("& is an internal 'G'N'A'T unit?", Name (N));
+ Error_Msg_N
+ ("\use of this unit is non-portable " &
+ "and version-dependent?",
+ Name (N));
+
+ elsif U_Kind = Ada_05_Unit and then Ada_Version = Ada_95 then
+ Error_Msg_N ("& is an Ada 2005 unit?", Name (N));
+ end if;
+ end;
end if;
end if;
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 588ce993dfb..04e2f8d567b 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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,6 +51,7 @@ with Sem_Ch7; use Sem_Ch7;
with Sem_Ch8; use Sem_Ch8;
with Sem_Ch10; use Sem_Ch10;
with Sem_Ch13; use Sem_Ch13;
+with Sem_Disp; use Sem_Disp;
with Sem_Elab; use Sem_Elab;
with Sem_Elim; use Sem_Elim;
with Sem_Eval; use Sem_Eval;
@@ -261,7 +262,11 @@ package body Sem_Ch12 is
T : Entity_Id;
Def : Node_Id);
- -- All the following need comments???
+ -- The following subprograms create abbreviated declarations for formal
+ -- scalar types. We introduce an anonymous base of the proper class for
+ -- each of them, and define the formals as constrained first subtypes of
+ -- their bases. The bounds are expressions that are non-static in the
+ -- generic.
procedure Analyze_Formal_Decimal_Fixed_Point_Type
(T : Entity_Id; Def : Node_Id);
@@ -879,7 +884,7 @@ package body Sem_Ch12 is
case Nkind (Formal) is
when N_Formal_Subprogram_Declaration =>
- exit when Kind = N_Formal_Subprogram_Declaration
+ exit when Kind in N_Formal_Subprogram_Declaration
and then
Chars
(Defining_Unit_Name (Specification (Formal))) =
@@ -900,7 +905,7 @@ package body Sem_Ch12 is
-- unrecognized pragmas.
exit when
- Kind /= N_Formal_Subprogram_Declaration
+ 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
@@ -1038,7 +1043,7 @@ package body Sem_Ch12 is
then
Temp_Formal := First (Formals);
while Present (Temp_Formal) loop
- if Nkind (Temp_Formal) =
+ if Nkind (Temp_Formal) in
N_Formal_Subprogram_Declaration
and then Temp_Formal /= Formal
and then
@@ -1279,6 +1284,7 @@ package body Sem_Ch12 is
Set_Delta_Value (T, Delta_Val);
Set_Small_Value (T, Delta_Val);
Set_Scalar_Range (T, Scalar_Range (Base));
+ Set_Is_Constrained (T);
Check_Restriction (No_Fixed_Point, Def);
end Analyze_Formal_Decimal_Fixed_Point_Type;
@@ -1357,12 +1363,17 @@ package body Sem_Ch12 is
Lo : Node_Id;
Hi : Node_Id;
+ Base : constant Entity_Id :=
+ New_Internal_Entity
+ (E_Floating_Point_Type, Current_Scope, Sloc (Def), 'G');
begin
- Enter_Name (T);
- Set_Ekind (T, E_Enumeration_Type);
- Set_Etype (T, T);
- Init_Size (T, 8);
- Init_Alignment (T);
+ Enter_Name (T);
+ Set_Ekind (T, E_Enumeration_Subtype);
+ Set_Etype (T, Base);
+ Init_Size (T, 8);
+ Init_Alignment (T);
+ Set_Is_Generic_Type (T);
+ Set_Is_Constrained (T);
-- For semantic analysis, the bounds of the type must be set to some
-- non-static value. The simplest is to create attribute nodes for
@@ -1386,6 +1397,14 @@ package body Sem_Ch12 is
Low_Bound => Lo,
High_Bound => Hi));
+ Set_Ekind (Base, E_Enumeration_Type);
+ Set_Etype (Base, Base);
+ Init_Size (Base, 8);
+ Init_Alignment (Base);
+ Set_Is_Generic_Type (Base);
+ Set_Scalar_Range (Base, Scalar_Range (T));
+ Set_Parent (Base, Parent (Def));
+
end Analyze_Formal_Discrete_Type;
----------------------------------
@@ -1404,12 +1423,13 @@ package body Sem_Ch12 is
-- the generic itself.
Enter_Name (T);
- Set_Ekind (T, E_Floating_Point_Subtype);
- Set_Etype (T, Base);
- Set_Size_Info (T, (Standard_Float));
- Set_RM_Size (T, RM_Size (Standard_Float));
- Set_Digits_Value (T, Digits_Value (Standard_Float));
- Set_Scalar_Range (T, Scalar_Range (Standard_Float));
+ Set_Ekind (T, E_Floating_Point_Subtype);
+ Set_Etype (T, Base);
+ Set_Size_Info (T, (Standard_Float));
+ Set_RM_Size (T, RM_Size (Standard_Float));
+ Set_Digits_Value (T, Digits_Value (Standard_Float));
+ Set_Scalar_Range (T, Scalar_Range (Standard_Float));
+ Set_Is_Constrained (T);
Set_Is_Generic_Type (Base);
Set_Etype (Base, Base);
@@ -1562,6 +1582,7 @@ package body Sem_Ch12 is
Make_Range (Loc,
Low_Bound => Make_Real_Literal (Loc, Ureal_1),
High_Bound => Make_Real_Literal (Loc, Ureal_1)));
+ Set_Is_Constrained (T);
Set_Is_Generic_Type (Base);
Set_Etype (Base, Base);
@@ -1773,11 +1794,12 @@ package body Sem_Ch12 is
begin
Enter_Name (T);
- Set_Ekind (T, E_Signed_Integer_Subtype);
- Set_Etype (T, Base);
- Set_Size_Info (T, Standard_Integer);
- Set_RM_Size (T, RM_Size (Standard_Integer));
- Set_Scalar_Range (T, Scalar_Range (Standard_Integer));
+ Set_Ekind (T, E_Signed_Integer_Subtype);
+ Set_Etype (T, Base);
+ Set_Size_Info (T, Standard_Integer);
+ Set_RM_Size (T, RM_Size (Standard_Integer));
+ Set_Scalar_Range (T, Scalar_Range (Standard_Integer));
+ Set_Is_Constrained (T);
Set_Is_Generic_Type (Base);
Set_Size_Info (Base, Standard_Integer);
@@ -1811,6 +1833,25 @@ package body Sem_Ch12 is
Set_Is_Formal_Subprogram (Nam);
Set_Has_Completion (Nam);
+ if Nkind (N) = N_Formal_Abstract_Subprogram_Declaration then
+ Set_Is_Abstract (Nam);
+ Set_Is_Dispatching_Operation (Nam);
+
+ declare
+ Ctrl_Type : constant Entity_Id := Find_Dispatching_Type (Nam);
+
+ begin
+ if not Present (Ctrl_Type) then
+ Error_Msg_N
+ ("abstract formal subprogram must have a controlling type",
+ N);
+
+ else
+ Check_Controlling_Formals (Ctrl_Type, Nam);
+ end if;
+ end;
+ end if;
+
-- Default name is resolved at the point of instantiation
if Box_Present (N) then
@@ -6966,10 +7007,12 @@ package body Sem_Ch12 is
-- The generic instantiation freezes the actual. This can only be
-- done once the actual is resolved, in the analysis of the renaming
- -- declaration. To indicate that must be done, we set the corresponding
- -- spec of the node to point to the formal subprogram entity.
+ -- declaration. To make the formal subprogram entity available, we set
+ -- Corresponding_Formal_Spec to point to the formal subprogram entity.
+ -- This is also needed in Analyze_Subprogram_Renaming for the processing
+ -- of formal abstract subprograms.
- Set_Corresponding_Spec (Decl_Node, Analyzed_S);
+ Set_Corresponding_Formal_Spec (Decl_Node, Analyzed_S);
-- We cannot analyze the renaming declaration, and thus find the
-- actual, until the all the actuals are assembled in the instance.
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index e620044b762..dbd1c7eef06 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1,12 +1,12 @@
------------------------------------------------------------------------------
--- c --
+-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ C H 1 3 --
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -301,7 +301,6 @@ package body Sem_Ch13 is
then
Error_Msg_N ("cannot specify attribute for subtype", Nam);
return;
-
end if;
-- Switch on particular attribute
@@ -1364,6 +1363,45 @@ package body Sem_Ch13 is
end if;
end Storage_Pool;
+ -----------------
+ -- Stream_Size --
+ -----------------
+
+ when Attribute_Stream_Size => Stream_Size : declare
+ Size : constant Uint := Static_Integer (Expr);
+
+ begin
+ if Has_Stream_Size_Clause (U_Ent) then
+ Error_Msg_N ("Stream_Size already given for &", Nam);
+
+ elsif Is_Elementary_Type (U_Ent) then
+ if Size /= System_Storage_Unit
+ and then
+ Size /= System_Storage_Unit * 2
+ and then
+ Size /= System_Storage_Unit * 4
+ and then
+ Size /= System_Storage_Unit * 8
+ then
+ Error_Msg_Uint_1 := UI_From_Int (System_Storage_Unit);
+ Error_Msg_N
+ ("stream size for elementary type must be a"
+ & " power of 2 and at least ^", N);
+
+ elsif RM_Size (U_Ent) > Size then
+ Error_Msg_Uint_1 := RM_Size (U_Ent);
+ Error_Msg_N
+ ("stream size for elementary type must be a"
+ & " power of 2 and at least ^", N);
+ end if;
+
+ Set_Has_Stream_Size_Clause (U_Ent);
+
+ else
+ Error_Msg_N ("Stream_Size cannot be given for &", Nam);
+ end if;
+ end Stream_Size;
+
----------------
-- Value_Size --
----------------
@@ -1499,7 +1537,6 @@ package body Sem_Ch13 is
when others =>
Error_Msg_N
("attribute& cannot be set with definition clause", N);
-
end case;
-- The test for the type being frozen must be performed after
@@ -1669,10 +1706,11 @@ package body Sem_Ch13 is
Error_Msg_N ("duplicate enumeration rep clause ignored", N);
return;
- -- Don't allow rep clause if root type is standard [wide_]character
+ -- Don't allow rep clause for standard [wide_[wide_]]character
elsif Root_Type (Enumtype) = Standard_Character
or else Root_Type (Enumtype) = Standard_Wide_Character
+ or else Root_Type (Enumtype) = Standard_Wide_Wide_Character
then
Error_Msg_N ("enumeration rep clause not allowed for this type", N);
return;
diff --git a/gcc/ada/sem_ch2.adb b/gcc/ada/sem_ch2.adb
index 7015fbd2096..091d087c831 100644
--- a/gcc/ada/sem_ch2.adb
+++ b/gcc/ada/sem_ch2.adb
@@ -32,6 +32,7 @@ with Rident; use Rident;
with Sem_Ch8; use Sem_Ch8;
with Sinfo; use Sinfo;
with Stand; use Stand;
+with Uintp; use Uintp;
package body Sem_Ch2 is
@@ -51,7 +52,7 @@ package body Sem_Ch2 is
Set_Is_Static_Expression (N);
if Comes_From_Source (N)
- and then not In_Character_Range (Char_Literal_Value (N))
+ and then not In_Character_Range (UI_To_CC (Char_Literal_Value (N)))
then
Check_Restriction (No_Wide_Characters, N);
end if;
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 65a0ae94591..7ac6e268b2d 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -1970,8 +1970,9 @@ package body Sem_Ch3 is
Remove_Side_Effects (E);
end if;
- if T = Standard_Wide_Character
+ if T = Standard_Wide_Character or else T = Standard_Wide_Wide_Character
or else Root_Type (T) = Standard_Wide_String
+ or else Root_Type (T) = Standard_Wide_Wide_String
then
Check_Restriction (No_Wide_Characters, Object_Definition (N));
end if;
@@ -3705,6 +3706,7 @@ package body Sem_Ch3 is
if Root_Type (Parent_Type) = Standard_Character
or else Root_Type (Parent_Type) = Standard_Wide_Character
+ or else Root_Type (Parent_Type) = Standard_Wide_Wide_Character
then
Derived_Standard_Character (N, Parent_Type, Derived_Type);
@@ -4122,10 +4124,12 @@ package body Sem_Ch3 is
begin
if Ekind (Parent_Type) in Record_Kind
- or else (Ekind (Parent_Type) in Enumeration_Kind
- and then Root_Type (Parent_Type) /= Standard_Character
- and then Root_Type (Parent_Type) /= Standard_Wide_Character
- and then not Is_Generic_Type (Root_Type (Parent_Type)))
+ or else
+ (Ekind (Parent_Type) in Enumeration_Kind
+ and then Root_Type (Parent_Type) /= Standard_Character
+ and then Root_Type (Parent_Type) /= Standard_Wide_Character
+ and then Root_Type (Parent_Type) /= Standard_Wide_Wide_Character
+ and then not Is_Generic_Type (Root_Type (Parent_Type)))
then
Full_N := New_Copy_Tree (N);
Insert_After (N, Full_N);
@@ -10192,7 +10196,9 @@ package body Sem_Ch3 is
end if;
if Typ = Standard_Wide_Character
+ or else Typ = Standard_Wide_Wide_Character
or else Typ = Standard_Wide_String
+ or else Typ = Standard_Wide_Wide_String
then
Check_Restriction (No_Wide_Characters, S);
end if;
@@ -12707,6 +12713,12 @@ package body Sem_Ch3 is
Rewrite (S, New_Copy_Tree (Subtype_Mark (S)));
+ -- Set Ekind of orphan itype, to prevent cascaded errors.
+
+ if Present (Def_Id) then
+ Set_Ekind (Def_Id, Ekind (Any_Type));
+ end if;
+
-- Make recursive call, having got rid of the bogus constraint
return Process_Subtype (S, Related_Nod, Related_Id, Suffix);
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 417c8c7c490..17d9993f329 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -2650,10 +2650,7 @@ package body Sem_Ch4 is
-- not make an actual subtype, we end up getting a direct
-- reference to a discriminant which will not do.
- -- Comment needs revision, "in all other cases" does not
- -- reasonably describe the situation below with an elsif???
-
- elsif Expander_Active then
+ else
Act_Decl :=
Build_Actual_Subtype_Of_Component (Etype (Comp), N);
Insert_Action (N, Act_Decl);
@@ -2675,9 +2672,6 @@ package body Sem_Ch4 is
Set_Etype (N, Subt);
end;
end if;
-
- else
- Set_Etype (N, Etype (Comp));
end if;
return;
@@ -4400,7 +4394,7 @@ package body Sem_Ch4 is
and then not Is_Overloaded (R)
and then Base_Type (Etype (L)) = Base_Type (Etype (R))
then
- Error_Msg_Node_2 := Etype (R);
+ Error_Msg_Node_2 := First_Subtype (Etype (R));
Error_Msg_N ("there is no applicable operator& for}", N);
else
@@ -4799,7 +4793,7 @@ package body Sem_Ch4 is
begin
Set_Name (Call_Node, New_Copy_Tree (Subprog));
Set_Analyzed (Call_Node, False);
- Replace (Node_To_Replace, Call_Node);
+ Rewrite (Node_To_Replace, Call_Node);
Analyze (Node_To_Replace);
end Complete_Object_Operation;
@@ -4830,8 +4824,19 @@ package body Sem_Ch4 is
then
Node_To_Replace := Parent_Node;
- Append_List_To (Actuals,
- New_Copy_List (Parameter_Associations (Parent_Node)));
+ -- Copy list of actuals in full before attempting to resolve call.
+ -- This is necessary to ensure that the chaining of named actuals
+ -- that happens during matching is done on a separate copy.
+
+ declare
+ Actual : Node_Id;
+ begin
+ Actual := First (Parameter_Associations (Parent_Node));
+ while Present (Actual) loop
+ Append (New_Copy_Tree (Actual), Actuals);
+ Next (Actual);
+ end loop;
+ end;
if Nkind (Parent_Node) = N_Procedure_Call_Statement then
Call_Node :=
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 2a4cf9d7ef8..3f16dca9396 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -410,8 +410,10 @@ package body Sem_Ch5 is
and then Can_Never_Be_Null (Entity (Lhs)))
or else Can_Never_Be_Null (Etype (Lhs)))
then
- Error_Msg_N
- ("(Ada 2005) NULL not allowed in null-excluding objects", Lhs);
+ Apply_Compile_Time_Constraint_Error
+ (N => Lhs,
+ Msg => "(Ada 2005) NULL not allowed in null-excluding objects?",
+ Reason => CE_Null_Not_Allowed);
end if;
if Is_Scalar_Type (T1) then
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index bc069fa4065..45a20158507 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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,9 +79,14 @@ package body Sem_Ch6 is
-- Local Subprograms --
-----------------------
+ procedure Analyze_Return_Type (N : Node_Id);
+ -- Subsidiary to Process_Formals: analyze subtype mark in function
+ -- specification, in a context where the formals are visible and hide
+ -- outer homographs.
+
procedure Analyze_Generic_Subprogram_Body (N : Node_Id; Gen_Id : Entity_Id);
- -- Analyze a generic subprogram body. N is the body to be analyzed,
- -- and Gen_Id is the defining entity Id for the corresponding spec.
+ -- Analyze a generic subprogram body. N is the body to be analyzed, and
+ -- Gen_Id is the defining entity Id for the corresponding spec.
procedure Build_Body_To_Inline (N : Node_Id; Subp : Entity_Id);
-- If a subprogram has pragma Inline and inlining is active, use generic
@@ -133,35 +138,34 @@ package body Sem_Ch6 is
(HSS : Node_Id;
Mode : Character;
Err : out Boolean);
- -- Called to check for missing return statements in a function body,
- -- or for returns present in a procedure body which has No_Return set.
- -- L is the handled statement sequence for the subprogram body. This
- -- procedure checks all flow paths to make sure they either have a
- -- return (Mode = 'F') or do not have a return (Mode = 'P'). The flag
- -- Err is set if there are any control paths not explicitly terminated
- -- by a return in the function case, and is True otherwise.
+ -- Called to check for missing return statements in a function body, or
+ -- for returns present in a procedure body which has No_Return set. L is
+ -- the handled statement sequence for the subprogram body. This procedure
+ -- checks all flow paths to make sure they either have return (Mode = 'F')
+ -- or do not have a return (Mode = 'P'). The flag Err is set if there are
+ -- any control paths not explicitly terminated by a return in the function
+ -- case, and is True otherwise.
function Conforming_Types
(T1 : Entity_Id;
T2 : Entity_Id;
Ctype : Conformance_Type;
Get_Inst : Boolean := False) return Boolean;
- -- Check that two formal parameter types conform, checking both
- -- for equality of base types, and where required statically
- -- matching subtypes, depending on the setting of Ctype.
+ -- Check that two formal parameter types conform, checking both for
+ -- equality of base types, and where required statically matching
+ -- subtypes, depending on the setting of Ctype.
procedure Enter_Overloaded_Entity (S : Entity_Id);
- -- This procedure makes S, a new overloaded entity, into the first
- -- visible entity with that name.
+ -- This procedure makes S, a new overloaded entity, into the first visible
+ -- entity with that name.
procedure Install_Entity (E : Entity_Id);
-- Make single entity visible. Used for generic formals as well
procedure Install_Formals (Id : Entity_Id);
- -- On entry to a subprogram body, make the formals visible. Note
- -- that simply placing the subprogram on the scope stack is not
- -- sufficient: the formals must become the current entities for
- -- their names.
+ -- On entry to a subprogram body, make the formals visible. Note that
+ -- simply placing the subprogram on the scope stack is not sufficient:
+ -- the formals must become the current entities for their names.
function Is_Non_Overriding_Operation
(Prev_E : Entity_Id;
@@ -181,8 +185,8 @@ package body Sem_Ch6 is
-- have no parameters, or those for which defaults exist for all parameters
procedure Reference_Body_Formals (Spec : Entity_Id; Bod : Entity_Id);
- -- If there is a separate spec for a subprogram or generic subprogram,
- -- the formals of the body are treated as references to the corresponding
+ -- If there is a separate spec for a subprogram or generic subprogram, the
+ -- formals of the body are treated as references to the corresponding
-- formals of the spec. This reference does not count as an actual use of
-- the formal, in order to diagnose formals that are unused in the body.
@@ -228,6 +232,18 @@ package body Sem_Ch6 is
begin
Analyze (P);
+ -- A call of the form A.B (X) may be an Ada05 call, which is rewritten
+ -- as B(A, X). If the rewriting is successful, the call has been
+ -- analyzed and we just return.
+
+ if Nkind (P) = N_Selected_Component
+ and then Name (N) /= P
+ and then Is_Rewrite_Substitution (N)
+ and then Present (Etype (N))
+ then
+ return;
+ end if;
+
-- If error analyzing name, then set Any_Type as result type and return
if Etype (P) = Any_Type then
@@ -265,9 +281,9 @@ package body Sem_Ch6 is
Spec : Node_Id;
begin
- -- Copy body and disable expansion while analyzing the generic
- -- For a stub, do not copy the stub (which would load the proper body),
- -- this will be done when the proper body is analyzed.
+ -- Copy body and disable expansion while analyzing the generic For a
+ -- stub, do not copy the stub (which would load the proper body), this
+ -- will be done when the proper body is analyzed.
if Nkind (N) /= N_Subprogram_Body_Stub then
New_N := Copy_Generic_Node (N, Empty, Instantiating => False);
@@ -379,10 +395,10 @@ package body Sem_Ch6 is
return;
end if;
- -- If this is a compilation unit, it must be made visible
- -- explicitly, because the compilation of the declaration,
- -- unlike other library unit declarations, does not. If it
- -- is not a unit, the following is redundant but harmless.
+ -- If this is a compilation unit, it must be made visible explicitly,
+ -- because the compilation of the declaration, unlike other library
+ -- unit declarations, does not. If it is not a unit, the following
+ -- is redundant but harmless.
Set_Is_Immediately_Visible (Gen_Id);
Reference_Body_Formals (Gen_Id, Body_Id);
@@ -394,8 +410,8 @@ package body Sem_Ch6 is
Save_Global_References (Original_Node (N));
- -- Prior to exiting the scope, include generic formals again
- -- (if any are present) in the set of local entities.
+ -- Prior to exiting the scope, include generic formals again (if any
+ -- are present) in the set of local entities.
if Present (First_Ent) then
Set_First_Entity (Gen_Id, First_Ent);
@@ -420,12 +436,12 @@ package body Sem_Ch6 is
-- Analyze_Operator_Symbol --
-----------------------------
- -- An operator symbol such as "+" or "and" may appear in context where
- -- the literal denotes an entity name, such as "+"(x, y) or in a
- -- context when it is just a string, as in (conjunction = "or"). In
- -- these cases the parser generates this node, and the semantics does
- -- the disambiguation. Other such case are actuals in an instantiation,
- -- the generic unit in an instantiation, and pragma arguments.
+ -- An operator symbol such as "+" or "and" may appear in context where the
+ -- literal denotes an entity name, such as "+"(x, y) or in context when it
+ -- is just a string, as in (conjunction = "or"). In these cases the parser
+ -- generates this node, and the semantics does the disambiguation. Other
+ -- such case are actuals in an instantiation, the generic unit in an
+ -- instantiation, and pragma arguments.
procedure Analyze_Operator_Symbol (N : Node_Id) is
Par : constant Node_Id := Parent (N);
@@ -561,9 +577,9 @@ package body Sem_Ch6 is
and then Present (Actuals)
and then No (Next (First (Actuals)))
then
- -- Can be call to parameterless entry family. What appears to be
- -- the sole argument is in fact the entry index. Rewrite prefix
- -- of node accordingly. Source representation is unchanged by this
+ -- Can be call to parameterless entry family. What appears to be the
+ -- sole argument is in fact the entry index. Rewrite prefix of node
+ -- accordingly. Source representation is unchanged by this
-- transformation.
New_N :=
@@ -585,9 +601,9 @@ package body Sem_Ch6 is
Error_Msg_N ("expect access to procedure in call", P);
end if;
- -- The name can be a selected component or an indexed component
- -- that yields an access to subprogram. Such a prefix is legal if
- -- the call has parameter associations.
+ -- The name can be a selected component or an indexed component that
+ -- yields an access to subprogram. Such a prefix is legal if the call
+ -- has parameter associations.
elsif Is_Access_Type (Etype (P))
and then Ekind (Designated_Type (Etype (P))) = E_Subprogram_Type
@@ -598,15 +614,14 @@ package body Sem_Ch6 is
Error_Msg_N ("missing explicit dereference in call ", N);
end if;
- -- If not an access to subprogram, then the prefix must resolve to
- -- the name of an entry, entry family, or protected operation.
+ -- If not an access to subprogram, then the prefix must resolve to the
+ -- name of an entry, entry family, or protected operation.
- -- For the case of a simple entry call, P is a selected component
- -- where the prefix is the task and the selector name is the entry.
- -- A call to a protected procedure will have the same syntax. If
- -- the protected object contains overloaded operations, the entity
- -- may appear as a function, the context will select the operation
- -- whose type is Void.
+ -- For the case of a simple entry call, P is a selected component where
+ -- the prefix is the task and the selector name is the entry. A call to
+ -- a protected procedure will have the same syntax. If the protected
+ -- object contains overloaded operations, the entity may appear as a
+ -- function, the context will select the operation whose type is Void.
elsif Nkind (P) = N_Selected_Component
and then (Ekind (Entity (Selector_Name (P))) = E_Entry
@@ -622,9 +637,9 @@ package body Sem_Ch6 is
and then Present (Actuals)
and then No (Next (First (Actuals)))
then
- -- Can be call to parameterless entry family. What appears to be
- -- the sole argument is in fact the entry index. Rewrite prefix
- -- of node accordingly. Source representation is unchanged by this
+ -- Can be call to parameterless entry family. What appears to be the
+ -- sole argument is in fact the entry index. Rewrite prefix of node
+ -- accordingly. Source representation is unchanged by this
-- transformation.
New_N :=
@@ -720,9 +735,9 @@ package body Sem_Ch6 is
Apply_Constraint_Check (Expr, R_Type);
- -- ??? A real run-time accessibility check is needed
- -- in cases involving dereferences of access parameters.
- -- For now we just check the static cases.
+ -- ??? A real run-time accessibility check is needed in cases
+ -- involving dereferences of access parameters. For now we just
+ -- check the static cases.
if Is_Return_By_Reference_Type (Etype (Scope_Id))
and then Object_Access_Level (Expr)
@@ -766,6 +781,34 @@ package body Sem_Ch6 is
Check_Unreachable_Code (N);
end Analyze_Return_Statement;
+ -------------------------
+ -- Analyze_Return_Type --
+ -------------------------
+
+ procedure Analyze_Return_Type (N : Node_Id) is
+ Designator : constant Entity_Id := Defining_Entity (N);
+ Typ : Entity_Id := Empty;
+
+ begin
+ if Subtype_Mark (N) /= Error then
+ Find_Type (Subtype_Mark (N));
+ Typ := Entity (Subtype_Mark (N));
+ Set_Etype (Designator, Typ);
+
+ if Ekind (Typ) = E_Incomplete_Type
+ or else (Is_Class_Wide_Type (Typ)
+ and then
+ Ekind (Root_Type (Typ)) = E_Incomplete_Type)
+ then
+ Error_Msg_N
+ ("invalid use of incomplete type", Subtype_Mark (N));
+ end if;
+
+ else
+ Set_Etype (Designator, Any_Type);
+ end if;
+ end Analyze_Return_Type;
+
-----------------------------
-- Analyze_Subprogram_Body --
-----------------------------
@@ -831,13 +874,13 @@ package body Sem_Ch6 is
Trace_Scope (N, Body_Id, " Analyze subprogram");
- -- Generic subprograms are handled separately. They always have
- -- a generic specification. Determine whether current scope has
- -- a previous declaration.
+ -- Generic subprograms are handled separately. They always have a
+ -- generic specification. Determine whether current scope has a
+ -- previous declaration.
- -- If the subprogram body is defined within an instance of the
- -- same name, the instance appears as a package renaming, and
- -- will be hidden within the subprogram.
+ -- If the subprogram body is defined within an instance of the same
+ -- name, the instance appears as a package renaming, and will be hidden
+ -- within the subprogram.
if Present (Prev_Id)
and then not Is_Overloadable (Prev_Id)
@@ -853,18 +896,18 @@ package body Sem_Ch6 is
return;
else
- -- Previous entity conflicts with subprogram name.
- -- Attempting to enter name will post error.
+ -- Previous entity conflicts with subprogram name. Attempting to
+ -- enter name will post error.
Enter_Name (Body_Id);
return;
end if;
- -- Non-generic case, find the subprogram declaration, if one was
- -- seen, or enter new overloaded entity in the current scope.
- -- If the current_entity is the body_id itself, the unit is being
- -- analyzed as part of the context of one of its subunits. No need
- -- to redo the analysis.
+ -- Non-generic case, find the subprogram declaration, if one was seen,
+ -- or enter new overloaded entity in the current scope. If the
+ -- Current_Entity is the Body_Id itself, the unit is being analyzed as
+ -- part of the context of one of its subunits. No need to redo the
+ -- analysis.
elsif Prev_Id = Body_Id
and then Has_Completion (Body_Id)
@@ -885,13 +928,13 @@ package body Sem_Ch6 is
return;
end if;
- -- A subprogram body should cause freezing of its own
- -- declaration, but if there was no previous explicit
- -- declaration, then the 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.
+ -- A subprogram body should cause freezing of its own declaration,
+ -- but if there was no previous explicit declaration, then the
+ -- 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.
if No (Spec_Id) then
Freeze_Before (N, Body_Id);
@@ -904,18 +947,23 @@ package body Sem_Ch6 is
end if;
end if;
- -- Do not inline any subprogram that contains nested subprograms,
- -- since the backend inlining circuit seems to generate uninitialized
+ -- Do not inline any subprogram that contains nested subprograms, since
+ -- the backend inlining circuit seems to generate uninitialized
-- references in this case. We know this happens in the case of front
- -- end ZCX support, but it also appears it can happen in other cases
- -- as well. The backend often rejects attempts to inline in the case
- -- of nested procedures anyway, so little if anything is lost by this.
+ -- end ZCX support, but it also appears it can happen in other cases as
+ -- well. The backend often rejects attempts to inline in the case of
+ -- nested procedures anyway, so little if anything is lost by this.
+ -- Note that this is test is for the benefit of the back-end. There is
+ -- a separate test for front-end inlining that also rejects nested
+ -- subprograms.
-- Do not do this test if errors have been detected, because in some
-- error cases, this code blows up, and we don't need it anyway if
-- there have been errors, since we won't get to the linker anyway.
- if Serious_Errors_Detected = 0 then
+ if Comes_From_Source (Body_Id)
+ and then Serious_Errors_Detected = 0
+ then
P_Ent := Body_Id;
loop
P_Ent := Scope (P_Ent);
@@ -952,9 +1000,9 @@ package body Sem_Ch6 is
begin
Formal := First_Formal (Body_Id);
- -- The protected operation always has at least one formal,
- -- namely the object itself, but it is only placed in the
- -- parameter list if expansion is enabled.
+ -- The protected operation always has at least one formal, namely
+ -- the object itself, but it is only placed in the parameter list
+ -- if expansion is enabled.
if Present (Formal)
or else Expander_Active
@@ -1006,9 +1054,9 @@ package body Sem_Ch6 is
Spec_Id := Defining_Unit_Name (New_Spec);
-- Indicate that the entity comes from source, to ensure that
- -- cross-reference information is properly generated.
- -- The body itself is rewritten during expansion, and the
- -- body entity will not appear in calls to the operation.
+ -- cross-reference information is properly generated. The body
+ -- itself is rewritten during expansion, and the body entity will
+ -- not appear in calls to the operation.
Set_Comes_From_Source (Spec_Id, True);
Analyze (Decl);
@@ -1211,9 +1259,9 @@ package body Sem_Ch6 is
if Present (Spec_Id) then
- -- If a parent unit is categorized, the context of a subunit
- -- must conform to the categorization. Conversely, if a child
- -- unit is categorized, the parents themselves must conform.
+ -- If a parent unit is categorized, the context of a subunit must
+ -- conform to the categorization. Conversely, if a child unit is
+ -- categorized, the parents themselves must conform.
if Nkind (Parent (N)) = N_Subunit then
Validate_Categorization_Dependency (N, Spec_Id);
@@ -1274,11 +1322,11 @@ package body Sem_Ch6 is
Check_Returns (HSS, 'P', Missing_Ret);
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
- -- 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
+ -- 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
+ -- 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
-- function F (A : Integer) return Some_Type;
-- X : Some_Type;
@@ -1288,16 +1336,16 @@ package body Sem_Ch6 is
-- 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!
+ -- 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!
declare
Stm : Node_Id := First (Statements (HSS));
begin
- -- Skip an initial label (for one thing this occurs when we
- -- are in front end ZCX mode, but in any case it is irrelevant).
+ -- Skip an initial label (for one thing this occurs when we are in
+ -- front end ZCX mode, but in any case it is irrelevant).
if Nkind (Stm) = N_Label then
Next (Stm);
@@ -1477,7 +1525,6 @@ package body Sem_Ch6 is
function Analyze_Subprogram_Specification (N : Node_Id) return Entity_Id is
Designator : constant Entity_Id := Defining_Entity (N);
Formals : constant List_Id := Parameter_Specifications (N);
- Typ : Entity_Id;
begin
Generate_Definition (Designator);
@@ -1486,34 +1533,23 @@ package body Sem_Ch6 is
Set_Ekind (Designator, E_Function);
Set_Mechanism (Designator, Default_Mechanism);
- if Subtype_Mark (N) /= Error then
- Find_Type (Subtype_Mark (N));
- Typ := Entity (Subtype_Mark (N));
- Set_Etype (Designator, Typ);
-
- if Ekind (Typ) = E_Incomplete_Type
- or else (Is_Class_Wide_Type (Typ)
- and then
- Ekind (Root_Type (Typ)) = E_Incomplete_Type)
- then
- Error_Msg_N
- ("invalid use of incomplete type", Subtype_Mark (N));
- end if;
-
- else
- Set_Etype (Designator, Any_Type);
- end if;
-
else
Set_Ekind (Designator, E_Procedure);
Set_Etype (Designator, Standard_Void_Type);
end if;
+ -- Introduce new scope for analysis of the formals and of the
+ -- return type.
+
+ Set_Scope (Designator, Current_Scope);
+
if Present (Formals) then
- Set_Scope (Designator, Current_Scope);
New_Scope (Designator);
Process_Formals (Formals, N);
End_Scope;
+
+ elsif Nkind (N) = N_Function_Specification then
+ Analyze_Return_Type (N);
end if;
if Nkind (N) = N_Function_Specification then
@@ -1524,7 +1560,13 @@ package body Sem_Ch6 is
May_Need_Actuals (Designator);
if Is_Abstract (Etype (Designator))
- and then Nkind (Parent (N)) /= N_Abstract_Subprogram_Declaration
+ and then Nkind (Parent (N))
+ /= N_Abstract_Subprogram_Declaration
+ and then (Nkind (Parent (N)))
+ /= N_Formal_Abstract_Subprogram_Declaration
+ and then (Nkind (Parent (N)) /= N_Subprogram_Renaming_Declaration
+ or else not Is_Entity_Name (Name (Parent (N)))
+ or else not Is_Abstract (Entity (Name (Parent (N)))))
then
Error_Msg_N
("function that returns abstract type must be abstract", N);
@@ -1549,9 +1591,9 @@ package body Sem_Ch6 is
-- Check for declarations that make inlining not worthwhile
function Has_Excluded_Statement (Stats : List_Id) return Boolean;
- -- Check for statements that make inlining not worthwhile: any
- -- tasking statement, nested at any level. Keep track of total
- -- number of elementary statements, as a measure of acceptable size.
+ -- Check for statements that make inlining not worthwhile: any tasking
+ -- statement, nested at any level. Keep track of total number of
+ -- elementary statements, as a measure of acceptable size.
function Has_Pending_Instantiation return Boolean;
-- If some enclosing body contains instantiations that appear before
@@ -1563,8 +1605,8 @@ package body Sem_Ch6 is
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.
+ -- 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
@@ -1579,14 +1621,17 @@ package body Sem_Ch6 is
D : Node_Id;
function Is_Unchecked_Conversion (D : Node_Id) return Boolean;
- -- Nested subprograms make a given body ineligible for inlining,
- -- but we make an exception for instantiations of unchecked
- -- conversion. The body has not been analyzed yet, so we check
- -- the name, and verify that the visible entity with that name is
- -- the predefined unit.
+ -- Nested subprograms make a given body ineligible for inlining, but
+ -- we make an exception for instantiations of unchecked conversion.
+ -- The body has not been analyzed yet, so check the name, and verify
+ -- that the visible entity with that name is the predefined unit.
+
+ -----------------------------
+ -- Is_Unchecked_Conversion --
+ -----------------------------
function Is_Unchecked_Conversion (D : Node_Id) return Boolean is
- Id : constant Node_Id := Name (D);
+ Id : constant Node_Id := Name (D);
Conv : Entity_Id;
begin
@@ -1681,7 +1726,6 @@ package body Sem_Ch6 is
elsif Nkind (S) = N_Case_Statement then
E := First (Alternatives (S));
-
while Present (E) loop
if Has_Excluded_Statement (Statements (E)) then
return True;
@@ -1697,7 +1741,6 @@ package body Sem_Ch6 is
if Present (Elsif_Parts (S)) then
E := First (Elsif_Parts (S));
-
while Present (E) loop
if Has_Excluded_Statement (Then_Statements (E)) then
return True;
@@ -1989,13 +2032,12 @@ package body Sem_Ch6 is
New_Formal : Entity_Id;
procedure Conformance_Error (Msg : String; N : Node_Id := New_Id);
- -- Post error message for conformance error on given node.
- -- Two messages are output. The first points to the previous
- -- declaration with a general "no conformance" message.
- -- The second is the detailed reason, supplied as Msg. The
- -- parameter N provide information for a possible & insertion
- -- in the message, and also provides the location for posting
- -- the message in the absence of a specified Err_Loc location.
+ -- Post error message for conformance error on given node. Two messages
+ -- are output. The first points to the previous declaration with a
+ -- general "no conformance" message. The second is the detailed reason,
+ -- supplied as Msg. The parameter N provide information for a possible
+ -- & insertion in the message, and also provides the location for
+ -- posting the message in the absence of a specified Err_Loc location.
-----------------------
-- Conformance_Error --
@@ -2043,8 +2085,8 @@ package body Sem_Ch6 is
begin
Conforms := True;
- -- We need a special case for operators, since they don't
- -- appear explicitly.
+ -- We need a special case for operators, since they don't appear
+ -- explicitly.
if Ctype = Type_Conformant then
if Ekind (New_Id) = E_Operator
@@ -2171,8 +2213,8 @@ package body Sem_Ch6 is
if Ctype = Fully_Conformant then
- -- We have checked already that names match.
- -- Check default expressions for in parameters
+ -- We have checked already that names match. Check default
+ -- expressions for in parameters
if Parameter_Mode (Old_Formal) = E_In_Parameter then
declare
@@ -2183,11 +2225,11 @@ package body Sem_Ch6 is
begin
if NewD or OldD then
- -- The old default value has been analyzed because
- -- the current full declaration will have frozen
- -- everything before. The new default values have not
- -- been analyzed, so analyze them now before we check
- -- for conformance.
+ -- The old default value has been analyzed because the
+ -- current full declaration will have frozen everything
+ -- before. The new default values have not been
+ -- analyzed, so analyze them now before we check for
+ -- conformance.
if NewD then
New_Scope (New_Id);
@@ -2284,6 +2326,10 @@ package body Sem_Ch6 is
-- If T is not yet frozen and needs a delayed freeze, then the
-- subprogram itself must be delayed.
+ ---------------------
+ -- Possible_Freeze --
+ ---------------------
+
procedure Possible_Freeze (T : Entity_Id) is
begin
if Has_Delayed_Freeze (T)
@@ -2361,12 +2407,11 @@ package body Sem_Ch6 is
New_Discr_Type : Entity_Id;
procedure Conformance_Error (Msg : String; N : Node_Id);
- -- Post error message for conformance error on given node.
- -- Two messages are output. The first points to the previous
- -- declaration with a general "no conformance" message.
- -- The second is the detailed reason, supplied as Msg. The
- -- parameter N provide information for a possible & insertion
- -- in the message.
+ -- Post error message for conformance error on given node. Two messages
+ -- are output. The first points to the previous declaration with a
+ -- general "no conformance" message. The second is the detailed reason,
+ -- supplied as Msg. The parameter N provide information for a possible
+ -- & insertion in the message.
-----------------------
-- Conformance_Error --
@@ -2386,9 +2431,9 @@ package body Sem_Ch6 is
New_Discr_Id := Defining_Identifier (New_Discr);
- -- The subtype mark of the discriminant on the full type
- -- has not been analyzed so we do it here. For an access
- -- discriminant a new type is created.
+ -- The subtype mark of the discriminant on the full type has not
+ -- been analyzed so we do it here. For an access discriminant a new
+ -- type is created.
if Nkind (Discriminant_Type (New_Discr)) = N_Access_Definition then
New_Discr_Type :=
@@ -2405,8 +2450,8 @@ package body Sem_Ch6 is
Conformance_Error ("type of & does not match!", New_Discr_Id);
return;
else
- -- Treat the new discriminant as an occurrence of the old
- -- one, for navigation purposes, and fill in some semantic
+ -- Treat the new discriminant as an occurrence of the old one,
+ -- for navigation purposes, and fill in some semantic
-- information, for completeness.
Generate_Reference (Old_Discr, New_Discr_Id, 'r');
@@ -2434,8 +2479,8 @@ package body Sem_Ch6 is
-- The old default value has been analyzed and expanded,
-- because the current full declaration will have frozen
- -- everything before. The new default values have not
- -- been expanded, so expand now to check conformance.
+ -- everything before. The new default values have not been
+ -- expanded, so expand now to check conformance.
if NewD then
Analyze_Per_Use_Expression
@@ -2927,6 +2972,10 @@ package body Sem_Ch6 is
-- This is used to check if S1 > S2 in the sense required by this
-- test, for example nameab < namec, but name2 < name10.
+ -----------------------------
+ -- Subprogram_Name_Greater --
+ -----------------------------
+
function Subprogram_Name_Greater (S1, S2 : String) return Boolean is
L1, L2 : Positive;
N1, N2 : Natural;
@@ -3019,7 +3068,6 @@ package body Sem_Ch6 is
Err_Loc : Node_Id := Empty)
is
Result : Boolean;
-
begin
Check_Conformance
(New_Id, Old_Id, Subtype_Conformant, True, Result, Err_Loc);
@@ -3035,7 +3083,6 @@ package body Sem_Ch6 is
Err_Loc : Node_Id := Empty)
is
Result : Boolean;
-
begin
Check_Conformance
(New_Id, Old_Id, Type_Conformant, True, Result, Err_Loc);
@@ -3101,9 +3148,9 @@ package body Sem_Ch6 is
begin
-- The context is an instance association for a formal
- -- access-to-subprogram type; the formal parameter types
- -- require mapping because they may denote other formal
- -- parameters of the generic unit.
+ -- access-to-subprogram type; the formal parameter types require
+ -- mapping because they may denote other formal parameters of the
+ -- generic unit.
if Get_Inst then
Type_1 := Get_Instance_Of (T1);
@@ -3196,21 +3243,21 @@ package body Sem_Ch6 is
end if;
-- The context is an instance association for a formal
- -- access-to-subprogram type; formal access parameter
- -- designated types require mapping because they may
- -- denote other formal parameters of the generic unit.
+ -- access-to-subprogram type; formal access parameter designated
+ -- types require mapping because they may denote other formal
+ -- parameters of the generic unit.
if Get_Inst then
Desig_1 := Get_Instance_Of (Desig_1);
Desig_2 := Get_Instance_Of (Desig_2);
end if;
- -- It is possible for a Class_Wide_Type to be introduced for
- -- an incomplete type, in which case there is a separate class_
- -- wide type for the full view. The types conform if their
- -- Etypes conform, i.e. one may be the full view of the other.
- -- This can only happen in the context of an access parameter,
- -- other uses of an incomplete Class_Wide_Type are illegal.
+ -- It is possible for a Class_Wide_Type to be introduced for an
+ -- incomplete type, in which case there is a separate class_ wide
+ -- type for the full view. The types conform if their Etypes
+ -- conform, i.e. one may be the full view of the other. This can
+ -- only happen in the context of an access parameter, other uses
+ -- of an incomplete Class_Wide_Type are illegal.
if Is_Class_Wide_Type (Desig_1)
and then Is_Class_Wide_Type (Desig_2)
@@ -3252,9 +3299,9 @@ package body Sem_Ch6 is
P_Formal : Entity_Id := Empty;
function Add_Extra_Formal (Typ : Entity_Id) return Entity_Id;
- -- Add an extra formal, associated with the current Formal. The
- -- extra formal is added to the list of extra formals, and also
- -- returned as the result. These formals are always of mode IN.
+ -- Add an extra formal, associated with the current Formal. The extra
+ -- formal is added to the list of extra formals, and also returned as
+ -- the result. These formals are always of mode IN.
----------------------
-- Add_Extra_Formal --
@@ -3273,9 +3320,9 @@ package body Sem_Ch6 is
return Empty;
end if;
- -- A little optimization. Never generate an extra formal for
- -- the _init operand of an initialization procedure, since it
- -- could never be used.
+ -- A little optimization. Never generate an extra formal for the
+ -- _init operand of an initialization procedure, since it could
+ -- never be used.
if Chars (Formal) = Name_uInit then
return Empty;
@@ -3296,9 +3343,9 @@ package body Sem_Ch6 is
-- Start of processing for Create_Extra_Formals
begin
- -- If this is a derived subprogram then the subtypes of the
- -- parent subprogram's formal parameters will be used to
- -- to determine the need for extra formals.
+ -- If this is a derived subprogram then the subtypes of the parent
+ -- subprogram's formal parameters will be used to to determine the need
+ -- for extra formals.
if Is_Overloadable (E) and then Present (Alias (E)) then
P_Formal := First_Formal (Alias (E));
@@ -3311,9 +3358,9 @@ package body Sem_Ch6 is
Next_Formal (Formal);
end loop;
- -- If Extra_formals where already created, don't do it again
- -- This situation may arise for subprogram types created as part
- -- of dispatching calls (see Expand_Dispatch_Call)
+ -- If Extra_formals where already created, don't do it again. This
+ -- situation may arise for subprogram types created as part of
+ -- dispatching calls (see Expand_Dispatching_Call)
if Present (Last_Extra) and then
Present (Extra_Formal (Last_Extra))
@@ -3381,10 +3428,9 @@ package body Sem_Ch6 is
(not Present (P_Formal)
or else Present (Extra_Accessibility (P_Formal)))
then
- -- Temporary kludge: for now we avoid creating the extra
- -- formal for access parameters of protected operations
- -- because of problem with the case of internal protected
- -- calls. ???
+ -- Temporary kludge: for now we avoid creating the extra formal
+ -- for access parameters of protected operations because of
+ -- problem with the case of internal protected calls. ???
if Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Definition
and then Nkind (Parent (Parent (Parent (E)))) /= N_Protected_Body
@@ -3449,8 +3495,8 @@ package body Sem_Ch6 is
if Debug_Flag_E then
Write_Str ("New overloaded entity chain: ");
Write_Name (Chars (S));
- E := S;
+ E := S;
while Present (E) loop
Write_Str (" "); Write_Int (Int (E));
E := Homonym (E);
@@ -3710,8 +3756,8 @@ package body Sem_Ch6 is
if Paren_Count (E1) /= Paren_Count (E2) then
return False;
- -- If same entities are referenced, then they are conformant
- -- even if they have different forms (RM 8.3.1(19-20)).
+ -- If same entities are referenced, then they are conformant even if
+ -- they have different forms (RM 8.3.1(19-20)).
elsif Is_Entity_Name (E1) and then Is_Entity_Name (E2) then
if Present (Entity (E1)) then
@@ -3987,8 +4033,8 @@ package body Sem_Ch6 is
S2 : constant Node_Id := Original_Node (Given_S2);
function Conforming_Bounds (B1, B2 : Node_Id) return Boolean;
- -- Special-case for a bound given by a discriminant, which in the
- -- body is replaced with the discriminal of the enclosing type.
+ -- Special-case for a bound given by a discriminant, which in the body
+ -- is replaced with the discriminal of the enclosing type.
function Conforming_Ranges (R1, R2 : Node_Id) return Boolean;
-- Check both bounds
@@ -4081,15 +4127,15 @@ package body Sem_Ch6 is
function Get_Generic_Parent_Type (F_Typ : Entity_Id) return Entity_Id;
-- If F_Type is a derived type associated with a generic actual
- -- subtype, then return its Generic_Parent_Type attribute, else
- -- return Empty.
+ -- subtype, then return its Generic_Parent_Type attribute, else return
+ -- Empty.
function Types_Correspond
(P_Type : Entity_Id;
N_Type : Entity_Id) return Boolean;
- -- Returns true if and only if the types (or designated types
- -- in the case of anonymous access types) are the same or N_Type
- -- is derived directly or indirectly from P_Type.
+ -- Returns true if and only if the types (or designated types in the
+ -- case of anonymous access types) are the same or N_Type is derived
+ -- directly or indirectly from P_Type.
-----------------------------
-- Get_Generic_Parent_Type --
@@ -4103,11 +4149,11 @@ package body Sem_Ch6 is
if Is_Derived_Type (F_Typ)
and then Nkind (Parent (F_Typ)) = N_Full_Type_Declaration
then
- -- The tree must be traversed to determine the parent
- -- subtype in the generic unit, which unfortunately isn't
- -- always available via semantic attributes. ???
- -- (Note: The use of Original_Node is needed for cases
- -- where a full derived type has been rewritten.)
+ -- The tree must be traversed to determine the parent subtype in
+ -- the generic unit, which unfortunately isn't always available
+ -- via semantic attributes. ??? (Note: The use of Original_Node
+ -- is needed for cases where a full derived type has been
+ -- rewritten.)
Indic := Subtype_Indication
(Type_Definition (Original_Node (Parent (F_Typ))));
@@ -4165,10 +4211,10 @@ package body Sem_Ch6 is
-- Start of processing for Is_Non_Overriding_Operation
begin
- -- In the case where both operations are implicit derived
- -- subprograms then neither overrides the other. This can
- -- only occur in certain obscure cases (e.g., derivation
- -- from homographs created in a generic instantiation).
+ -- In the case where both operations are implicit derived subprograms
+ -- then neither overrides the other. This can only occur in certain
+ -- obscure cases (e.g., derivation from homographs created in a generic
+ -- instantiation).
if Present (Alias (Prev_E)) and then Present (Alias (New_E)) then
return True;
@@ -4179,8 +4225,8 @@ package body Sem_Ch6 is
and then Comes_From_Source (New_E)
then
-- We examine the formals and result subtype of the inherited
- -- operation, to determine whether their type is derived from
- -- (the instance of) a generic type.
+ -- operation, to determine whether their type is derived from (the
+ -- instance of) a generic type.
Formal := First_Formal (Prev_E);
@@ -4248,9 +4294,9 @@ package body Sem_Ch6 is
Next_Entity (N_Formal);
end loop;
- -- Found a matching primitive operation belonging to
- -- the formal ancestor type, so the new subprogram
- -- is overriding.
+ -- Found a matching primitive operation belonging to the
+ -- formal ancestor type, so the new subprogram is
+ -- overriding.
if not Present (P_Formal)
and then not Present (N_Formal)
@@ -4266,8 +4312,8 @@ package body Sem_Ch6 is
Next_Elmt (Prim_Elt);
end loop;
- -- If no match found, then the new subprogram does
- -- not override in the generic (nor in the instance).
+ -- If no match found, then the new subprogram does not
+ -- override in the generic (nor in the instance).
return True;
end;
@@ -4379,7 +4425,6 @@ package body Sem_Ch6 is
function Mode_Conformant (New_Id, Old_Id : Entity_Id) return Boolean is
Result : Boolean;
-
begin
Check_Conformance (New_Id, Old_Id, Mode_Conformant, False, Result);
return Result;
@@ -4406,7 +4451,7 @@ package body Sem_Ch6 is
-- set when freezing entities, so we must examine the place of the
-- declaration in the tree, and recognize wrapper packages as well.
- procedure Maybe_Primitive_Operation (Overriding : Boolean := False);
+ procedure Maybe_Primitive_Operation (Is_Overriding : Boolean := False);
-- If the subprogram being analyzed is a primitive operation of
-- the type of one of its formals, set the corresponding flag.
@@ -4442,7 +4487,7 @@ package body Sem_Ch6 is
-- Maybe_Primitive_Operation --
-------------------------------
- procedure Maybe_Primitive_Operation (Overriding : Boolean := False) is
+ procedure Maybe_Primitive_Operation (Is_Overriding : Boolean := False) is
Formal : Entity_Id;
F_Typ : Entity_Id;
B_Typ : Entity_Id;
@@ -4473,7 +4518,7 @@ package body Sem_Ch6 is
then
if Is_Abstract (T)
and then Is_Abstract (S)
- and then (not Overriding or else not Is_Abstract (E))
+ and then (not Is_Overriding or else not Is_Abstract (E))
then
Error_Msg_N ("abstract subprograms must be visible "
& "('R'M 3.9.3(10))!", S);
@@ -4481,7 +4526,7 @@ package body Sem_Ch6 is
elsif Ekind (S) = E_Function
and then Is_Tagged_Type (T)
and then T = Base_Type (Etype (S))
- and then not Overriding
+ and then not Is_Overriding
then
Error_Msg_N
("private function with tagged result must"
@@ -4544,15 +4589,15 @@ package body Sem_Ch6 is
if not Comes_From_Source (S) then
null;
- -- If the subprogram is at library level, it is not a
- -- primitive operation.
+ -- If the subprogram is at library level, it is not primitive
+ -- operation.
elsif Current_Scope = Standard_Standard then
null;
elsif (Ekind (Current_Scope) = E_Package
and then not In_Package_Body (Current_Scope))
- or else Overriding
+ or else Is_Overriding
then
-- For function, check return type
@@ -4628,9 +4673,9 @@ package body Sem_Ch6 is
Check_Dispatching_Operation (S, Empty);
-- If the subprogram is implicit it is hidden by the previous
- -- declaration. However if it is dispatching, it must appear in
- -- the dispatch table anyway, because it can be dispatched to
- -- even if it cannot be called directly.
+ -- declaration. However if it is dispatching, it must appear in the
+ -- dispatch table anyway, because it can be dispatched to even if it
+ -- cannot be called directly.
elsif Present (Alias (S))
and then not Comes_From_Source (S)
@@ -4659,8 +4704,8 @@ package body Sem_Ch6 is
-- E exists and is overloadable
else
- -- Loop through E and its homonyms to determine if any of them
- -- is the candidate for overriding by S.
+ -- Loop through E and its homonyms to determine if any of them is
+ -- the candidate for overriding by S.
while Present (E) loop
@@ -4673,25 +4718,25 @@ package body Sem_Ch6 is
elsif Type_Conformant (E, S) then
- -- If the old and new entities have the same profile and
- -- one is not the body of the other, then this is an error,
- -- unless one of them is implicitly declared.
+ -- If the old and new entities have the same profile and one
+ -- is not the body of the other, then this is an error, unless
+ -- one of them is implicitly declared.
-- There are some cases when both can be implicit, for example
-- when both a literal and a function that overrides it are
-- inherited in a derivation, or when an inhertited operation
-- of a tagged full type overrides the ineherited operation of
- -- a private extension. Ada 83 had a special rule for the
- -- the literal case. In Ada95, the later implicit operation
- -- hides the former, and the literal is always the former.
- -- In the odd case where both are derived operations declared
- -- at the same point, both operations should be declared,
- -- and in that case we bypass the following test and proceed
- -- to the next part (this can only occur for certain obscure
- -- cases involving homographs in instances and can't occur for
+ -- a private extension. Ada 83 had a special rule for the the
+ -- literal case. In Ada95, the later implicit operation hides
+ -- the former, and the literal is always the former. In the
+ -- odd case where both are derived operations declared at the
+ -- same point, both operations should be declared, and in that
+ -- case we bypass the following test and proceed to the next
+ -- part (this can only occur for certain obscure cases
+ -- involving homographs in instances and can't occur for
-- dispatching operations ???). Note that the following
- -- condition is less than clear. For example, it's not at
- -- all clear why there's a test for E_Entry here. ???
+ -- condition is less than clear. For example, it's not at all
+ -- clear why there's a test for E_Entry here. ???
if Present (Alias (S))
and then (No (Alias (E))
@@ -4701,8 +4746,8 @@ package body Sem_Ch6 is
(Ekind (E) = E_Entry
or else Ekind (E) /= E_Enumeration_Literal)
then
- -- When an derived operation is overloaded it may be due
- -- to the fact that the full view of a private extension
+ -- When an derived operation is overloaded it may be due to
+ -- the fact that the full view of a private extension
-- re-inherits. It has to be dealt with.
if Is_Package (Current_Scope)
@@ -4799,17 +4844,17 @@ package body Sem_Ch6 is
then
-- For nondispatching derived operations that are
-- overridden by a subprogram declared in the private
- -- part of a package, we retain the derived subprogram
- -- but mark it as not immediately visible. If the
- -- derived operation was declared in the visible part
- -- then this ensures that it will still be visible
- -- outside the package with the proper signature
- -- (calls from outside must also be directed to this
- -- version rather than the overriding one, unlike the
- -- dispatching case). Calls from inside the package
- -- will still resolve to the overriding subprogram
- -- since the derived one is marked as not visible
- -- within the package.
+ -- part of a package, we retain the derived
+ -- subprogram but mark it as not immediately visible.
+ -- If the derived operation was declared in the
+ -- visible part then this ensures that it will still
+ -- be visible outside the package with the proper
+ -- signature (calls from outside must also be
+ -- directed to this version rather than the
+ -- overriding one, unlike the dispatching case).
+ -- Calls from inside the package will still resolve
+ -- to the overriding subprogram since the derived one
+ -- is marked as not visible within the package.
-- If the private operation is dispatching, we achieve
-- the overriding by keeping the implicit operation
@@ -4868,9 +4913,9 @@ package body Sem_Ch6 is
if Is_Dispatching_Operation (E) then
- -- An overriding dispatching subprogram inherits
- -- the convention of the overridden subprogram
- -- (by AI-117).
+ -- An overriding dispatching subprogram inherits the
+ -- convention of the overridden subprogram (by
+ -- AI-117).
Set_Convention (S, Convention (E));
@@ -4879,7 +4924,7 @@ package body Sem_Ch6 is
Check_Dispatching_Operation (S, Empty);
end if;
- Maybe_Primitive_Operation (Overriding => True);
+ Maybe_Primitive_Operation (Is_Overriding => True);
goto Check_Inequality;
end;
@@ -4932,10 +4977,10 @@ package body Sem_Ch6 is
Enter_Overloaded_Entity (S);
Maybe_Primitive_Operation;
- -- If S is a derived operation for an untagged type then
- -- by definition it's not a dispatching operation (even
- -- if the parent operation was dispatching), so we don't
- -- call Check_Dispatching_Operation in that case.
+ -- If S is a derived operation for an untagged type then by
+ -- definition it's not a dispatching operation (even if the parent
+ -- operation was dispatching), so we don't call
+ -- Check_Dispatching_Operation in that case.
if not Present (Derived_Type)
or else Is_Tagged_Type (Derived_Type)
@@ -4944,11 +4989,10 @@ package body Sem_Ch6 is
end if;
end if;
- -- If this is a user-defined equality operator that is not
- -- a derived subprogram, create the corresponding inequality.
- -- If the operation is dispatching, the expansion is done
- -- elsewhere, and we do not create an explicit inequality
- -- operation.
+ -- If this is a user-defined equality operator that is not a derived
+ -- subprogram, create the corresponding inequality. If the operation is
+ -- dispatching, the expansion is done elsewhere, and we do not create
+ -- an explicit inequality operation.
<<Check_Inequality>>
if Chars (S) = Name_Op_Eq
@@ -4975,9 +5019,9 @@ package body Sem_Ch6 is
Ptype : Entity_Id;
function Is_Class_Wide_Default (D : Node_Id) return Boolean;
- -- Check whether the default has a class-wide type. After analysis
- -- the default has the type of the formal, so we must also check
- -- explicitly for an access attribute.
+ -- Check whether the default has a class-wide type. After analysis the
+ -- default has the type of the formal, so we must also check explicitly
+ -- for an access attribute.
---------------------------
-- Is_Class_Wide_Default --
@@ -5163,6 +5207,14 @@ package body Sem_Ch6 is
Next (Param_Spec);
end loop;
+ -- If this is the formal part of a function specification, analyze the
+ -- subtype mark in the context where the formals are visible but not
+ -- yet usable, and may hide outer homographs.
+
+ if Nkind (Related_Nod) = N_Function_Specification then
+ Analyze_Return_Type (Related_Nod);
+ end if;
+
-- Now set the kind (mode) of each formal
Param_Spec := First (T);
@@ -5259,32 +5311,32 @@ package body Sem_Ch6 is
if Is_Constrained (T) then
AS_Needed := False;
- -- If we have unknown discriminants, then we do not need an
- -- actual subtype, or more accurately we cannot figure it out!
- -- Note that all class-wide types have unknown discriminants.
+ -- If we have unknown discriminants, then we do not need an actual
+ -- subtype, or more accurately we cannot figure it out! Note that
+ -- all class-wide types have unknown discriminants.
elsif Has_Unknown_Discriminants (T) then
AS_Needed := False;
- -- At this stage we have an unconstrained type that may need
- -- an actual subtype. For sure the actual subtype is needed
- -- if we have an unconstrained array type.
+ -- At this stage we have an unconstrained type that may need an
+ -- actual subtype. For sure the actual subtype is needed if we have
+ -- an unconstrained array type.
elsif Is_Array_Type (T) then
AS_Needed := True;
-- The only other case which needs an actual subtype is an
- -- unconstrained record type which is an IN parameter (we
- -- cannot generate actual subtypes for the OUT or IN OUT case,
- -- since an assignment can change the discriminant values.
- -- However we exclude the case of initialization procedures,
- -- since discriminants are handled very specially in this context,
- -- see the section entitled "Handling of Discriminants" in Einfo.
- -- We also exclude the case of Discrim_SO_Functions (functions
- -- used in front end layout mode for size/offset values), since
- -- in such functions only discriminants are referenced, and not
- -- only are such subtypes not needed, but they cannot always
- -- be generated, because of order of elaboration issues.
+ -- unconstrained record type which is an IN parameter (we cannot
+ -- generate actual subtypes for the OUT or IN OUT case, since an
+ -- assignment can change the discriminant values. However we exclude
+ -- the case of initialization procedures, since discriminants are
+ -- handled very specially in this context, see the section entitled
+ -- "Handling of Discriminants" in Einfo. We also exclude the case of
+ -- Discrim_SO_Functions (functions used in front end layout mode for
+ -- size/offset values), since in such functions only discriminants
+ -- are referenced, and not only are such subtypes not needed, but
+ -- they cannot always be generated, because of order of elaboration
+ -- issues.
elsif Is_Record_Type (T)
and then Ekind (Formal) = E_In_Parameter
@@ -5323,9 +5375,9 @@ package body Sem_Ch6 is
Prepend (Decl, Statements (Handled_Statement_Sequence (N)));
Mark_Rewrite_Insertion (Decl);
else
- -- If the accept statement has no body, there will be
- -- no reference to the actuals, so no need to compute
- -- actual subtypes.
+ -- If the accept statement has no body, there will be no
+ -- reference to the actuals, so no need to compute actual
+ -- subtypes.
return;
end if;
@@ -5336,8 +5388,8 @@ package body Sem_Ch6 is
Mark_Rewrite_Insertion (Decl);
end if;
- -- The declaration uses the bounds of an existing object,
- -- and therefore needs no constraint checks.
+ -- The declaration uses the bounds of an existing object, and
+ -- therefore needs no constraint checks.
Analyze (Decl, Suppress => All_Checks);
@@ -5397,8 +5449,8 @@ package body Sem_Ch6 is
end if;
-- Set Is_Known_Non_Null for access parameters since the language
- -- guarantees that access parameters are always non-null. We also
- -- set Can_Never_Be_Null, since there is no way to change the value.
+ -- guarantees that access parameters are always non-null. We also set
+ -- Can_Never_Be_Null, since there is no way to change the value.
if Nkind (Parameter_Type (Spec)) = N_Access_Definition then
@@ -5423,9 +5475,9 @@ package body Sem_Ch6 is
procedure Set_Formal_Validity (Formal_Id : Entity_Id) is
begin
- -- If no validity checking, then we cannot assume anything about
- -- the validity of parameters, since we do not know there is any
- -- checking of the validity on the call side.
+ -- If no validity checking, then we cannot assume anything about the
+ -- validity of parameters, since we do not know there is any checking
+ -- of the validity on the call side.
if not Validity_Checks_On then
return;
diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb
index 5ffa86396c4..b56917d4bad 100644
--- a/gcc/ada/sem_ch7.adb
+++ b/gcc/ada/sem_ch7.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -1905,7 +1905,6 @@ package body Sem_Ch7 is
end if;
Priv_Elmt := First_Elmt (Private_Dependents (Id));
- Exchange_Declarations (Id);
-- Swap out the subtypes and derived types of Id that were
-- compiled in this scope, or installed previously by
@@ -1937,6 +1936,10 @@ package body Sem_Ch7 is
Next_Elmt (Priv_Elmt);
end loop;
+ -- Now restore the type itself to its private view.
+
+ Exchange_Declarations (Id);
+
elsif Ekind (Id) = E_Incomplete_Type
and then No (Full_View (Id))
then
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 7c9e607becb..f5090e44441 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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 Sem_Ch3; use Sem_Ch3;
with Sem_Ch4; use Sem_Ch4;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch12; use Sem_Ch12;
+with Sem_Disp; use Sem_Disp;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sem_Type; use Sem_Type;
@@ -1170,8 +1171,7 @@ package body Sem_Ch8 is
end if;
-- Check whether this declaration corresponds to the instantiation
- -- of a formal subprogram. This is indicated by the presence of a
- -- Corresponding_Spec that is the instantiation declaration.
+ -- of a formal subprogram.
-- If this is an instantiation, the corresponding actual is frozen
-- and error messages can be made more precise. If this is a default
@@ -1182,9 +1182,9 @@ package body Sem_Ch8 is
-- is determined in Find_Renamed_Entity. If the entity is an operator,
-- Find_Renamed_Entity applies additional visibility checks.
- if Present (Corresponding_Spec (N)) then
+ if Present (Corresponding_Formal_Spec (N)) then
Is_Actual := True;
- Inst_Node := Unit_Declaration_Node (Corresponding_Spec (N));
+ Inst_Node := Unit_Declaration_Node (Corresponding_Formal_Spec (N));
if Is_Entity_Name (Nam)
and then Present (Entity (Nam))
@@ -1244,8 +1244,6 @@ package body Sem_Ch8 is
New_S := Analyze_Subprogram_Specification (Spec);
end if;
- Set_Corresponding_Spec (N, Empty);
-
else
-- Renamed entity must be analyzed first, to avoid being hidden by
-- new name (which might be the same in a generic instance).
@@ -1460,6 +1458,48 @@ package body Sem_Ch8 is
Set_Has_Delayed_Freeze (New_S, False);
end if;
+ -- If the renaming corresponds to an association for an abstract
+ -- formal subprogram, then various attributes must be set to
+ -- indicate that the renaming is an abstract dispatching operation
+ -- with a controlling type.
+
+ if Is_Actual
+ and then Is_Abstract (Corresponding_Formal_Spec (N))
+ then
+ -- Mark the renaming as abstract here, so Find_Dispatching_Type
+ -- see it as corresponding to a generic association for a
+ -- formal abstract subprogram
+
+ Set_Is_Abstract (New_S);
+
+ declare
+ New_S_Ctrl_Type : constant Entity_Id :=
+ Find_Dispatching_Type (New_S);
+ Old_S_Ctrl_Type : constant Entity_Id :=
+ Find_Dispatching_Type (Old_S);
+
+ begin
+ if Old_S_Ctrl_Type /= New_S_Ctrl_Type then
+ Error_Msg_NE
+ ("actual must be dispatching subprogram for type&",
+ Nam, New_S_Ctrl_Type);
+
+ else
+ Set_Is_Dispatching_Operation (New_S);
+ Check_Controlling_Formals (New_S_Ctrl_Type, New_S);
+
+ -- In the case where the actual in the formal subprogram
+ -- is itself a formal abstract subprogram association,
+ -- there's no dispatch table component or position to
+ -- inherit.
+
+ if Present (DTC_Entity (Old_S)) then
+ Set_DTC_Entity (New_S, DTC_Entity (Old_S));
+ Set_DT_Position (New_S, DT_Position (Old_S));
+ end if;
+ end if;
+ end;
+ end if;
end if;
if not Is_Actual
@@ -1488,8 +1528,12 @@ package body Sem_Ch8 is
Set_Has_Delayed_Freeze (New_S, False);
Freeze_Before (N, New_S);
+ -- An abstract subprogram is only allowed as an actual in the case
+ -- where the formal subprogram is also abstract.
+
if (Ekind (Old_S) = E_Procedure or else Ekind (Old_S) = E_Function)
and then Is_Abstract (Old_S)
+ and then not Is_Abstract (Corresponding_Formal_Spec (N))
then
Error_Msg_N
("abstract subprogram not allowed as generic actual", Nam);
@@ -1816,9 +1860,7 @@ package body Sem_Ch8 is
Aname = Name_Val
then
if Nkind (N) = N_Subprogram_Renaming_Declaration
- and then Present (Corresponding_Spec (N))
- and then Nkind (Unit_Declaration_Node (Corresponding_Spec (N))) =
- N_Formal_Subprogram_Declaration
+ and then Present (Corresponding_Formal_Spec (N))
then
Error_Msg_N
("generic actual cannot be attribute involving universal type",
@@ -2752,6 +2794,7 @@ package body Sem_Ch8 is
if Is_Enumeration_Type (Case_Typ)
and then Case_Typ /= Standard_Character
and then Case_Typ /= Standard_Wide_Character
+ and then Case_Typ /= Standard_Wide_Wide_Character
then
Lit := First_Literal (Case_Typ);
Get_Name_String (Chars (Lit));
@@ -4494,7 +4537,8 @@ package body Sem_Ch8 is
loop
if Is_Character_Type (Id)
and then (Root_Type (Id) = Standard_Character
- or else Root_Type (Id) = Standard_Wide_Character)
+ or else Root_Type (Id) = Standard_Wide_Character
+ or else Root_Type (Id) = Standard_Wide_Wide_Character)
and then Id = Base_Type (Id)
then
-- We replace the node with the literal itself, resolve as a
@@ -5562,7 +5606,13 @@ package body Sem_Ch8 is
-- instance is declared in the wrapper package but will not be
-- hidden by a use-visible entity.
+ -- If Id is called Standard, the predefined package with the
+ -- same name is in the homonym chain. It has to be ignored
+ -- because it has no defined scope (being the only entity in
+ -- the system with this mandated behavior).
+
elsif not Is_Hidden (Id)
+ and then Present (Scope (Prev))
and then not Is_Wrapper_Package (Scope (Prev))
and then Scope_Depth (Scope (Prev)) <
Scope_Depth (Current_Instance)
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb
index 7ea68f85699..9f8521bb427 100644
--- a/gcc/ada/sem_disp.adb
+++ b/gcc/ada/sem_disp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,15 +34,18 @@ with Exp_Tss; use Exp_Tss;
with Errout; use Errout;
with Hostparm; use Hostparm;
with Nlists; use Nlists;
+with Nmake; use Nmake;
with Opt; use Opt;
with Output; use Output;
with Sem; use Sem;
with Sem_Ch6; use Sem_Ch6;
with Sem_Eval; use Sem_Eval;
+with Sem_Type; use Sem_Type;
with Sem_Util; use Sem_Util;
with Snames; use Snames;
with Stand; use Stand;
with Sinfo; use Sinfo;
+with Tbuild; use Tbuild;
with Uintp; use Uintp;
package body Sem_Disp is
@@ -67,8 +70,11 @@ package body Sem_Disp is
function Check_Controlling_Type
(T : Entity_Id;
Subp : Entity_Id) return Entity_Id;
- -- T is the type of a formal parameter of subp. Returns the tagged
- -- if the parameter can be a controlling argument, empty otherwise
+ -- T is the tagged type of a formal parameter or the result of Subp.
+ -- If the subprogram has a controlling parameter or result that matches
+ -- the type, then returns the tagged type of that parameter or result
+ -- (returning the designated tagged type in the case of an access
+ -- parameter); otherwise returns empty.
-------------------------------
-- Add_Dispatching_Operation --
@@ -228,13 +234,20 @@ package body Sem_Disp is
return Empty;
-- The dispatching type and the primitive operation must be defined
- -- in the same scope except for internal operations.
+ -- in the same scope, except in the case of internal operations and
+ -- formal abstract subprograms.
- elsif (Scope (Subp) = Scope (Tagged_Type)
- or else Is_Internal (Subp))
- and then
- (not Is_Generic_Type (Tagged_Type)
- or else not Comes_From_Source (Subp))
+ elsif ((Scope (Subp) = Scope (Tagged_Type) or else Is_Internal (Subp))
+ and then (not Is_Generic_Type (Tagged_Type)
+ or else not Comes_From_Source (Subp)))
+ or else
+ (Is_Formal_Subprogram (Subp) and then Is_Abstract (Subp))
+ or else
+ (Nkind (Parent (Parent (Subp))) = N_Subprogram_Renaming_Declaration
+ and then
+ Present (Corresponding_Formal_Spec (Parent (Parent (Subp))))
+ and then
+ Is_Abstract (Subp))
then
return Tagged_Type;
@@ -248,9 +261,14 @@ package body Sem_Disp is
----------------------------
procedure Check_Dispatching_Call (N : Node_Id) is
- Actual : Node_Id;
- Control : Node_Id := Empty;
- Func : Entity_Id;
+ Actual : Node_Id;
+ Formal : Entity_Id;
+ Control : Node_Id := Empty;
+ Func : Entity_Id;
+ Subp_Entity : Entity_Id;
+ Loc : constant Source_Ptr := Sloc (N);
+ Indeterm_Ancestor_Call : Boolean := False;
+ Indeterm_Ctrl_Type : Entity_Id;
procedure Check_Dispatching_Context;
-- If the call is tag-indeterminate and the entity being called is
@@ -262,21 +280,21 @@ package body Sem_Disp is
-------------------------------
procedure Check_Dispatching_Context is
- Func : constant Entity_Id := Entity (Name (N));
+ Subp : constant Entity_Id := Entity (Name (N));
Par : Node_Id;
begin
- if Is_Abstract (Func)
+ if Is_Abstract (Subp)
and then No (Controlling_Argument (N))
then
- if Present (Alias (Func))
- and then not Is_Abstract (Alias (Func))
- and then No (DTC_Entity (Func))
+ if Present (Alias (Subp))
+ and then not Is_Abstract (Alias (Subp))
+ and then No (DTC_Entity (Subp))
then
-- Private overriding of inherited abstract operation,
-- call is legal.
- Set_Entity (Name (N), Alias (Func));
+ Set_Entity (Name (N), Alias (Subp));
return;
else
@@ -289,7 +307,7 @@ package body Sem_Disp is
Nkind (Par) = N_Assignment_Statement or else
Nkind (Par) = N_Op_Eq or else
Nkind (Par) = N_Op_Ne)
- and then Is_Tagged_Type (Etype (Func))
+ and then Is_Tagged_Type (Etype (Subp))
then
return;
@@ -299,8 +317,20 @@ package body Sem_Disp is
Par := Parent (Par);
else
- Error_Msg_N
- ("call to abstract function must be dispatching", N);
+ if Ekind (Subp) = E_Function then
+ Error_Msg_N
+ ("call to abstract function must be dispatching", N);
+
+ -- This error can occur for a procedure in the case of a
+ -- call to an abstract formal procedure with a statically
+ -- tagged operand.
+
+ else
+ Error_Msg_N
+ ("call to abstract procedure must be dispatching",
+ N);
+ end if;
+
return;
end if;
end loop;
@@ -316,12 +346,53 @@ package body Sem_Disp is
if Present (Parameter_Associations (N)) then
Actual := First_Actual (N);
+ Subp_Entity := Entity (Name (N));
+ Formal := First_Formal (Subp_Entity);
+
while Present (Actual) loop
Control := Find_Controlling_Arg (Actual);
exit when Present (Control);
+
+ -- Check for the case where the actual is a tag-indeterminate call
+ -- whose result type is different than the tagged type associated
+ -- with the containing call, but is an ancestor of the type.
+
+ if Is_Controlling_Formal (Formal)
+ and then Is_Tag_Indeterminate (Actual)
+ and then Base_Type (Etype (Actual)) /= Base_Type (Etype (Formal))
+ and then Is_Ancestor (Etype (Actual), Etype (Formal))
+ then
+ Indeterm_Ancestor_Call := True;
+ Indeterm_Ctrl_Type := Etype (Formal);
+ end if;
+
Next_Actual (Actual);
+ Next_Formal (Formal);
end loop;
+ -- If the call doesn't have a controlling actual but does have
+ -- an indeterminate actual that requires dispatching treatment,
+ -- then an object is needed that will serve as the controlling
+ -- argument for a dispatching call on the indeterminate actual.
+ -- This can only occur in the unusual situation of a default
+ -- actual given by a tag-indeterminate call and where the type
+ -- of the call is an ancestor of the type associated with a
+ -- containing call to an inherited operation (see AI-239).
+ -- Rather than create an object of the tagged type, which would
+ -- be problematic for various reasons (default initialization,
+ -- discriminants), the tag of the containing call's associated
+ -- tagged type is directly used to control the dispatching.
+
+ if not Present (Control)
+ and then Indeterm_Ancestor_Call
+ then
+ Control :=
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (Indeterm_Ctrl_Type, Loc),
+ Attribute_Name => Name_Tag);
+ Analyze (Control);
+ end if;
+
if Present (Control) then
-- Verify that no controlling arguments are statically tagged
@@ -338,10 +409,10 @@ package body Sem_Disp is
if Actual /= Control then
if not Is_Controlling_Actual (Actual) then
- null; -- can be anything
+ null; -- Can be anything
elsif Is_Dynamically_Tagged (Actual) then
- null; -- valid parameter
+ null; -- Valid parameter
elsif Is_Tag_Indeterminate (Actual) then
@@ -369,8 +440,8 @@ package body Sem_Disp is
Set_Controlling_Argument (N, Control);
else
- -- The call is not dispatching, check that there isn't any
- -- tag indeterminate abstract call left
+ -- The call is not dispatching, so check that there aren't any
+ -- tag-indeterminate abstract calls left.
Actual := First_Actual (N);
@@ -1159,7 +1230,7 @@ package body Sem_Disp is
-- calls and would have to undo any expansion to an indirect call.
if not Java_VM then
- Expand_Dispatch_Call (Call_Node);
+ Expand_Dispatching_Call (Call_Node);
end if;
end Propagate_Tag;
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 5c8b3e611b6..f7236abe20e 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005 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- --
@@ -159,7 +159,7 @@ package body Sem_Elab is
-- Local Subprograms --
-----------------------
- -- Note: Outer_Scope in all these calls represents the scope of
+ -- Note: Outer_Scope in all following specs represents the scope of
-- interest of the outer level call. If it is set to Standard_Standard,
-- then it means the outer level call was at elaboration level, and that
-- thus all calls are of interest. If it was set to some other scope,
@@ -224,6 +224,29 @@ package body Sem_Elab is
-- to Check_Internal_Call. Outer_Scope is the outer level scope for
-- the original call.
+ procedure Set_Elaboration_Constraint
+ (Call : Node_Id;
+ Subp : Entity_Id;
+ Scop : Entity_Id);
+ -- The current unit U may depend semantically on some unit P which is not
+ -- in the current context. If there is an elaboration call that reaches P,
+ -- we need to indicate that P requires an Elaborate_All, but this is not
+ -- effective in U's ali file, if there is no with_clause for P. In this
+ -- case we add the Elaborate_All on the unit Q that directly or indirectly
+ -- makes P available. This can happen in two cases:
+ --
+ -- a) Q declares a subtype of a type declared in P, and the call is an
+ -- initialization call for an object of that subtype.
+ --
+ -- b) Q declares an object of some tagged type whose root type is
+ -- declared in P, and the initialization call uses object notation on
+ -- that object to reach a primitive operation or a classwide operation
+ -- declared in P.
+ --
+ -- If P appears in the context of U, the current processing is correct.
+ -- Otherwise we must identify these two cases to retrieve Q and place the
+ -- Elaborate_All_Desirable on it.
+
function Has_Generic_Body (N : Node_Id) return Boolean;
-- N is a generic package instantiation node, and this routine determines
-- if this package spec does in fact have a generic body. If so, then
@@ -308,11 +331,16 @@ package body Sem_Elab is
-- elaboration check is required.
W_Scope : Entity_Id;
- -- Top level scope of directly called entity for subprogram.
- -- This differs from E_Scope in the case where renamings or
- -- derivations are involved, since it does not follow these
- -- links, thus W_Scope is always in a visible unit. This is
- -- the scope for the Elaborate_All if one is needed.
+ -- Top level scope of directly called entity for subprogram. This
+ -- differs from E_Scope in the case where renamings or derivations
+ -- are involved, since it does not follow these links. W_Scope is
+ -- generally in a visible unit, and it is this scope that may require
+ -- an Elaborate_All. However, there are some cases (initialization
+ -- calls and calls involving object notation) where W_Scope might not
+ -- be in the context of the current unit, and there is an intermediate
+ -- package that is, in which case the Elaborate_All has to be placed
+ -- on this intedermediate package. These special cases are handled in
+ -- Set_Elaboration_Constraint.
Body_Acts_As_Spec : Boolean;
-- Set to true if call is to body acting as spec (no separate spec)
@@ -751,8 +779,7 @@ package body Sem_Elab is
-- Set indication for binder to generate Elaborate_All
- Set_Elaborate_All_Desirable (W_Scope);
- Set_Suppress_Elaboration_Warnings (W_Scope, True);
+ Set_Elaboration_Constraint (N, E, W_Scope);
end if;
end if;
@@ -1345,6 +1372,12 @@ package body Sem_Elab is
return;
end if;
+ -- Nothing to do if the instantiation is not in the main unit.
+
+ if not In_Extended_Main_Code_Unit (N) then
+ return;
+ end if;
+
Ent := Get_Generic_Entity (N);
From_Elab_Code := not In_Subprogram_Or_Concurrent_Unit;
@@ -2000,6 +2033,96 @@ package body Sem_Elab is
In_Task_Activation := False;
end Check_Task_Activation;
+ --------------------------------
+ -- Set_Elaboration_Constraint --
+ --------------------------------
+
+ procedure Set_Elaboration_Constraint
+ (Call : Node_Id;
+ Subp : Entity_Id;
+ Scop : Entity_Id)
+ is
+ Elab_Unit : Entity_Id;
+ Init_Call : constant Boolean :=
+ Chars (Subp) = Name_Initialize
+ and then Comes_From_Source (Subp)
+ and then Present (Parameter_Associations (Call))
+ and then Is_Controlled
+ (Etype (First (Parameter_Associations (Call))));
+ begin
+ -- If the unit is mentioned in a with_clause of the current
+ -- unit, it is visible, and we can set the elaboration flag.
+
+ if Is_Immediately_Visible (Scop)
+ or else
+ (Is_Child_Unit (Scop) and then Is_Visible_Child_Unit (Scop))
+ then
+ Set_Elaborate_All_Desirable (Scop);
+ Set_Suppress_Elaboration_Warnings (Scop, True);
+ return;
+ end if;
+
+ -- If this is not an initialization call or a call using object notation
+ -- we know that the unit of the called entity is in the context, and
+ -- we can set the flag as well. The unit need not be visible if the call
+ -- occurs within an instantiation.
+
+ if Is_Init_Proc (Subp)
+ or else Init_Call
+ or else Nkind (Original_Node (Call)) = N_Selected_Component
+ then
+ null; -- detailed processing follows.
+
+ else
+ Set_Elaborate_All_Desirable (Scop);
+ Set_Suppress_Elaboration_Warnings (Scop, True);
+ return;
+ end if;
+
+ -- If the unit is not in the context, there must be an intermediate
+ -- unit that is, on which we need to place to elaboration flag.
+
+ if Is_Init_Proc (Subp)
+ or else Init_Call
+ then
+ -- The initialization call is on an object whose type is not
+ -- declared in the same scope as the subprogram. The type of
+ -- the object must be a subtype of the type of operation. This
+ -- object is the first actual in the call.
+
+ declare
+ Typ : constant Entity_Id :=
+ Etype (First (Parameter_Associations (Call)));
+ begin
+ Elab_Unit := Scope (Typ);
+
+ while (Present (Elab_Unit))
+ and then not Is_Compilation_Unit (Elab_Unit)
+ loop
+ Elab_Unit := Scope (Elab_Unit);
+ end loop;
+ end;
+ elsif Nkind (Original_Node (Call)) = N_Selected_Component then
+
+ -- If original node uses selected component notation, the
+ -- prefix is visible and determines the scope that must be
+ -- elaborated. After rewriting, the prefix is the first actual
+ -- in the call.
+
+ Elab_Unit := Scope (Etype (First (Parameter_Associations (Call))));
+
+ else
+ -- Using previously computed scope. If the elaboration check is
+ -- done after analysis, the scope is not visible any longer, but
+ -- must still be in the context.
+
+ Elab_Unit := Scop;
+ end if;
+
+ Set_Elaborate_All_Desirable (Elab_Unit);
+ Set_Suppress_Elaboration_Warnings (Elab_Unit, True);
+ end Set_Elaboration_Constraint;
+
----------------------
-- Has_Generic_Body --
----------------------
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index 5416e969658..d0d536d68b6 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -1115,8 +1115,27 @@ package body Sem_Eval is
if Is_Modular_Integer_Type (Ltype) then
Result := Result mod Modulus (Ltype);
+
+ -- For a signed integer type, check non-static overflow
+
+ elsif (not Stat) and then Is_Signed_Integer_Type (Ltype) then
+ declare
+ BT : constant Entity_Id := Base_Type (Ltype);
+ Lo : constant Uint := Expr_Value (Type_Low_Bound (BT));
+ Hi : constant Uint := Expr_Value (Type_High_Bound (BT));
+ begin
+ if Result < Lo or else Result > Hi then
+ Apply_Compile_Time_Constraint_Error
+ (N, "value not in range of }?",
+ CE_Overflow_Check_Failed,
+ Ent => BT);
+ return;
+ end if;
+ end;
end if;
+ -- If we get here we can fold the result
+
Fold_Uint (N, Result, Stat);
end;
@@ -1175,7 +1194,6 @@ package body Sem_Eval is
procedure Eval_Character_Literal (N : Node_Id) is
pragma Warnings (Off, N);
-
begin
null;
end Eval_Character_Literal;
@@ -1259,7 +1277,8 @@ package body Sem_Eval is
Test_Expression_Is_Foldable (N, Left, Right, Stat, Fold);
if (C_Typ = Standard_Character
- or else C_Typ = Standard_Wide_Character)
+ or else C_Typ = Standard_Wide_Character
+ or else C_Typ = Standard_Wide_Wide_Character)
and then Fold
then
null;
@@ -1268,7 +1287,7 @@ package body Sem_Eval is
return;
end if;
- -- Compile time string concatenation.
+ -- Compile time string concatenation
-- ??? Note that operands that are aggregates can be marked as
-- static, so we should attempt at a later stage to fold
@@ -1292,7 +1311,7 @@ package body Sem_Eval is
Start_String (Strval (Left_Str));
else
Start_String;
- Store_String_Char (Char_Literal_Value (Left_Str));
+ Store_String_Char (UI_To_CC (Char_Literal_Value (Left_Str)));
Left_Len := 1;
end if;
@@ -1308,7 +1327,7 @@ package body Sem_Eval is
end loop;
end;
else
- Store_String_Char (Char_Literal_Value (Right_Str));
+ Store_String_Char (UI_To_CC (Char_Literal_Value (Right_Str)));
end if;
Set_Is_Static_Expression (N, Stat);
@@ -1402,7 +1421,7 @@ package body Sem_Eval is
end if;
end if;
- -- Fall through if the name is not static.
+ -- Fall through if the name is not static
Validate_Static_Object_Name (N);
end Eval_Entity_Name;
@@ -2500,7 +2519,7 @@ package body Sem_Eval is
-- Start of processing for Eval_Type_Conversion
begin
- -- Cannot fold if target type is non-static or if semantic error.
+ -- Cannot fold if target type is non-static or if semantic error
if not Is_Static_Subtype (Target_Type) then
Check_Non_Static_Context (Operand);
@@ -2528,7 +2547,7 @@ package body Sem_Eval is
-- following type test, fixed-point counts as real unless the flag
-- Conversion_OK is set, in which case it counts as integer.
- -- Fold conversion, case of string type. The result is not static.
+ -- Fold conversion, case of string type. The result is not static
if Is_String_Type (Target_Type) then
Fold_Str (N, Strval (Get_String_Val (Operand)), False);
@@ -2747,7 +2766,7 @@ package body Sem_Eval is
-- their Pos value as usual which is the same as the Rep value.
if No (Ent) then
- return UI_From_Int (Int (Char_Literal_Value (N)));
+ return Char_Literal_Value (N);
else
return Enumeration_Rep (Ent);
end if;
@@ -2827,7 +2846,7 @@ package body Sem_Eval is
-- their Pos value as usual.
if No (Ent) then
- Val := UI_From_Int (Int (Char_Literal_Value (N)));
+ Val := Char_Literal_Value (N);
else
Val := Enumeration_Pos (Ent);
end if;
@@ -3207,7 +3226,7 @@ package body Sem_Eval is
Valr : Ureal;
begin
- -- Universal types have no range limits, so always in range.
+ -- Universal types have no range limits, so always in range
if Typ = Universal_Integer or else Typ = Universal_Real then
return True;
@@ -3218,7 +3237,7 @@ package body Sem_Eval is
elsif not Is_Scalar_Type (Typ) then
return False;
- -- Never in range unless we have a compile time known value.
+ -- Never in range unless we have a compile time known value
elsif not Compile_Time_Known_Value (N) then
return False;
@@ -3388,7 +3407,7 @@ package body Sem_Eval is
Valr : Ureal;
begin
- -- Universal types have no range limits, so always in range.
+ -- Universal types have no range limits, so always in range
if Typ = Universal_Integer or else Typ = Universal_Real then
return False;
@@ -3477,7 +3496,7 @@ package body Sem_Eval is
-- Is_Static_Subtype --
-----------------------
- -- Determines if Typ is a static subtype as defined in (RM 4.9(26)).
+ -- Determines if Typ is a static subtype as defined in (RM 4.9(26))
function Is_Static_Subtype (Typ : Entity_Id) return Boolean is
Base_T : constant Entity_Id := Base_Type (Typ);
@@ -3794,6 +3813,16 @@ package body Sem_Eval is
or else Comes_From_Source (T2))
then
return False;
+
+ -- A generic scalar type does not statically match its base
+ -- type (AI-311). In this case we make sure that the formals,
+ -- which are first subtypes of their bases, are constrained.
+
+ elsif Is_Generic_Type (T1)
+ and then Is_Generic_Type (T2)
+ and then (Is_Constrained (T1) /= Is_Constrained (T2))
+ then
+ return False;
end if;
-- If there was an error in either range, then just assume
@@ -3905,7 +3934,7 @@ package body Sem_Eval is
return True;
- -- A definite type does not match an indefinite or classwide type.
+ -- A definite type does not match an indefinite or classwide type
elsif
Has_Unknown_Discriminants (T1) /= Has_Unknown_Discriminants (T2)
@@ -4085,7 +4114,7 @@ package body Sem_Eval is
Fold := False;
return;
- -- Exclude expressions of a generic modular type, as above.
+ -- Exclude expressions of a generic modular type, as above
elsif Is_Modular_Integer_Type (Etype (Op1))
and then Is_Generic_Type (Etype (Op1))
diff --git a/gcc/ada/sem_eval.ads b/gcc/ada/sem_eval.ads
index 0945a4dbc7d..c7b9e907c95 100644
--- a/gcc/ada/sem_eval.ads
+++ b/gcc/ada/sem_eval.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -411,7 +411,6 @@ private
pragma Inline (Eval_Character_Literal);
pragma Inline (Eval_Conditional_Expression);
pragma Inline (Eval_Indexed_Component);
- pragma Inline (Eval_Integer_Literal);
pragma Inline (Eval_Named_Integer);
pragma Inline (Eval_Named_Real);
pragma Inline (Eval_Real_Literal);
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 6ece74120d0..408024b3715 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -4306,14 +4306,32 @@ package body Sem_Prag is
------------
-- pragma Ada_05;
+ -- pragma Ada_05 (LOCAL_NAME);
-- Note: this pragma also has some specific processing in Par.Prag
- -- because we want to set the Ada 83 version mode during parsing.
+ -- because we want to set the Ada 2005 version mode during parsing.
+
+ when Pragma_Ada_05 => declare
+ E_Id : Node_Id;
- when Pragma_Ada_05 =>
+ begin
GNAT_Pragma;
- Ada_Version := Ada_05;
- Check_Arg_Count (0);
+
+ if Arg_Count = 1 then
+ Check_Arg_Is_Local_Name (Arg1);
+ E_Id := Expression (Arg1);
+
+ if Etype (E_Id) = Any_Type then
+ return;
+ end if;
+
+ Set_Is_Ada_2005 (Entity (E_Id));
+
+ else
+ Ada_Version := Ada_05;
+ Check_Arg_Count (0);
+ end if;
+ end;
----------------------
-- All_Calls_Remote --
@@ -5623,7 +5641,19 @@ package body Sem_Prag is
then
Set_Elaborate_Present (Citem, True);
Set_Unit_Name (Expression (Arg), Name (Citem));
- Set_Suppress_Elaboration_Warnings (Entity (Name (Citem)));
+
+ -- With the pragma present, elaboration calls on
+ -- subprograms from the named unit need no further
+ -- checks, as long as the pragma appears in the current
+ -- compilation unit. If the pragma appears in some unit
+ -- in the context, there might still be a need for an
+ -- Elaborate_All_Desirable from the current compilation
+ -- to the the named unit, so we keep the check enabled.
+
+ if In_Extended_Main_Source_Unit (N) then
+ Set_Suppress_Elaboration_Warnings
+ (Entity (Name (Citem)));
+ end if;
exit Inner;
end if;
@@ -5708,7 +5738,15 @@ package body Sem_Prag is
then
Set_Elaborate_All_Present (Citem, True);
Set_Unit_Name (Expression (Arg), Name (Citem));
- Set_Suppress_Elaboration_Warnings (Entity (Name (Citem)));
+
+ -- Suppress warnings and elaboration checks on the named
+ -- unit if the pragma is in the current compilation, as
+ -- for pragma Elaborate.
+
+ if In_Extended_Main_Source_Unit (N) then
+ Set_Suppress_Elaboration_Warnings
+ (Entity (Name (Citem)));
+ end if;
exit Innr;
end if;
@@ -7935,21 +7973,63 @@ package body Sem_Prag is
-- pragma Obsolescent [(static_string_EXPRESSION)];
when Pragma_Obsolescent => Obsolescent : declare
+ Subp : Node_Or_Entity_Id;
+ S : String_Id;
+
begin
GNAT_Pragma;
Check_At_Most_N_Arguments (1);
Check_No_Identifiers;
- if Arg_Count = 1 then
- Check_Arg_Is_Static_Expression (Arg1, Standard_String);
- end if;
+ -- Check OK placement
- if No (Prev (N))
- or else (Nkind (Prev (N))) /= N_Subprogram_Declaration
+ -- First possibility is within a declarative region, where the
+ -- pragma immediately follows a subprogram declaration.
+
+ if Present (Prev (N)) then
+ Subp := Prev (N);
+
+ -- Second possibility, stand alone subprogram declaration with the
+ -- pragma immediately following the declaration.
+
+ elsif No (Prev (N))
+ and then Nkind (Parent (N)) = N_Compilation_Unit_Aux
then
+ Subp := Unit (Parent (Parent (N)));
+
+ -- Any other possibility is a misplacement
+
+ else
+ Subp := Empty;
+ end if;
+
+ -- Check correct placement
+
+ if Nkind (Subp) /= N_Subprogram_Declaration then
Error_Pragma
("pragma% misplaced, must immediately " &
"follow subprogram spec");
+
+ -- If OK placement, set flag and acquire argument
+
+ else
+ Subp := Defining_Entity (Subp);
+ Set_Is_Obsolescent (Subp);
+
+ if Arg_Count = 1 then
+ Check_Arg_Is_Static_Expression (Arg1, Standard_String);
+ S := Strval (Expression (Arg1));
+
+ for J in 1 .. String_Length (S) loop
+ if not In_Character_Range (Get_String_Char (S, J)) then
+ Error_Pragma_Arg
+ ("pragma% argument does not allow wide characters",
+ Arg1);
+ end if;
+ end loop;
+
+ Set_Obsolescent_Warning (Subp, Expression (Arg1));
+ end if;
end if;
end Obsolescent;
@@ -8023,13 +8103,6 @@ package body Sem_Prag is
when Pragma_Optional_Overriding =>
Error_Msg_N ("pragma must appear immediately after subprogram", N);
- ----------------
- -- Overriding --
- ----------------
-
- when Pragma_Overriding =>
- Error_Msg_N ("pragma must appear immediately after subprogram", N);
-
----------
-- Pack --
----------
@@ -10325,7 +10398,6 @@ package body Sem_Prag is
Pragma_Obsolescent => 0,
Pragma_Optimize => -1,
Pragma_Optional_Overriding => -1,
- Pragma_Overriding => -1,
Pragma_Pack => 0,
Pragma_Page => -1,
Pragma_Passive => -1,
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index b89f82b0097..af752663422 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -1449,7 +1449,8 @@ package body Sem_Res is
Rewrite (N,
Make_Character_Literal (Sloc (N),
Chars => Name_Find,
- Char_Literal_Value => Char_Code (Character'Pos ('A'))));
+ Char_Literal_Value =>
+ UI_From_Int (Character'Pos ('A'))));
Set_Etype (N, Any_Character);
Set_Is_Static_Expression (N);
@@ -2721,9 +2722,11 @@ package body Sem_Res is
or else Can_Never_Be_Null (F_Typ))
then
if Nkind (A) = N_Null then
- Error_Msg_NE
- ("(Ada 2005) not allowed for " &
- "null-exclusion formal", A, F_Typ);
+ Apply_Compile_Time_Constraint_Error
+ (N => A,
+ Msg => "(Ada 2005) NULL not allowed in "
+ & "null-excluding formal?",
+ Reason => CE_Null_Not_Allowed);
end if;
end if;
end if;
@@ -2807,7 +2810,7 @@ package body Sem_Res is
then
Error_Msg_Node_2 := F_Typ;
Error_Msg_NE
- ("& is not a primitive operation of &!", A, Nam);
+ ("& is not a dispatching operation of &!", A, Nam);
end if;
elsif Is_Access_Type (A_Typ)
@@ -2828,7 +2831,7 @@ package body Sem_Res is
then
Error_Msg_Node_2 := Designated_Type (F_Typ);
Error_Msg_NE
- ("& is not a primitive operation of &!", A, Nam);
+ ("& is not a dispatching operation of &!", A, Nam);
end if;
end if;
@@ -3433,7 +3436,7 @@ package body Sem_Res is
It : Interp;
Norm_OK : Boolean;
Scop : Entity_Id;
- Decl : Node_Id;
+ W : Node_Id;
begin
-- The context imposes a unique interpretation with type Typ on
@@ -3576,31 +3579,30 @@ package body Sem_Res is
-- Check for call to obsolescent subprogram
- if Warn_On_Obsolescent_Feature then
- Decl := Parent (Parent (Nam));
+ if Warn_On_Obsolescent_Feature
+ and then Is_Subprogram (Nam)
+ and then Is_Obsolescent (Nam)
+ then
+ Error_Msg_NE ("call to obsolescent subprogram&?", N, Nam);
- if Nkind (Decl) = N_Subprogram_Declaration
- and then Is_List_Member (Decl)
- and then Nkind (Next (Decl)) = N_Pragma
- then
- declare
- P : constant Node_Id := Next (Decl);
+ -- Output additional warning if present
- begin
- if Chars (P) = Name_Obsolescent then
- Error_Msg_NE ("call to obsolescent subprogram&?", N, Nam);
-
- if Pragma_Argument_Associations (P) /= No_List then
- Name_Buffer (1) := '|';
- Name_Buffer (2) := '?';
- Name_Len := 2;
- Add_String_To_Name_Buffer
- (Strval (Expression
- (First (Pragma_Argument_Associations (P)))));
- Error_Msg_N (Name_Buffer (1 .. Name_Len), N);
- end if;
- end if;
- end;
+ W := Obsolescent_Warning (Nam);
+
+ if Present (W) then
+ Name_Buffer (1) := '|';
+ Name_Buffer (2) := '?';
+ Name_Len := 2;
+
+ -- Add characters to message, protecting all of them
+
+ for J in 1 .. String_Length (Strval (W)) loop
+ Add_Char_To_Name_Buffer (''');
+ Add_Char_To_Name_Buffer
+ (Get_Character (Get_String_Char (Strval (W), J)));
+ end loop;
+
+ Error_Msg_N (Name_Buffer (1 .. Name_Len), N);
end if;
end if;
@@ -3906,11 +3908,12 @@ package body Sem_Res is
Set_Etype (N, B_Typ);
Eval_Character_Literal (N);
- -- Wide_Character literals must always be defined, since the set of
- -- wide character literals is complete, i.e. if a character literal
- -- is accepted by the parser, then it is OK for wide character.
+ -- Wide_Wide_Character literals must always be defined, since the set
+ -- of wide wide character literals is complete, i.e. if a character
+ -- literal is accepted by the parser, then it is OK for wide wide
+ -- character (out of range character literals are rejected).
- if Root_Type (B_Typ) = Standard_Wide_Character then
+ if Root_Type (B_Typ) = Standard_Wide_Wide_Character then
return;
-- Always accept character literal for type Any_Character, which
@@ -3924,10 +3927,24 @@ package body Sem_Res is
-- the literal is in range
elsif Root_Type (B_Typ) = Standard_Character then
- if In_Character_Range (Char_Literal_Value (N)) then
+ if In_Character_Range (UI_To_CC (Char_Literal_Value (N))) then
+ return;
+ end if;
+
+ -- For Standard.Wide_Character or a type derived from it, check
+ -- that the literal is in range
+
+ elsif Root_Type (B_Typ) = Standard_Wide_Character then
+ if In_Wide_Character_Range (UI_To_CC (Char_Literal_Value (N))) then
return;
end if;
+ -- For Standard.Wide_Wide_Character or a type derived from it, we
+ -- know the literal is in range, since the parser checked!
+
+ elsif Root_Type (B_Typ) = Standard_Wide_Wide_Character then
+ return;
+
-- If the entity is already set, this has already been resolved in
-- a generic context, or comes from expansion. Nothing else to do.
@@ -5823,10 +5840,11 @@ package body Sem_Res is
Resolve (P, T);
end if;
- -- Deal with access type case
+ -- If prefix is an access type, the node will be transformed into
+ -- an explicit dereference during expansion. The type of the node
+ -- is the designated type of that of the prefix.
if Is_Access_Type (Etype (P)) then
- Apply_Access_Check (N);
T := Designated_Type (Etype (P));
else
T := Etype (P);
@@ -5977,6 +5995,26 @@ package body Sem_Res is
Apply_Access_Check (N);
Array_Type := Designated_Type (Array_Type);
+ -- If the prefix is an access to an unconstrained array, we must
+ -- use the actual subtype of the object to perform the index checks.
+ -- The object denoted by the prefix is implicit in the node, so we
+ -- build an explicit representation for it in order to compute the
+ -- actual subtype.
+
+ if not Is_Constrained (Array_Type) then
+ Remove_Side_Effects (Prefix (N));
+
+ declare
+ Obj : constant Node_Id :=
+ Make_Explicit_Dereference (Sloc (N),
+ Prefix => New_Copy_Tree (Prefix (N)));
+ begin
+ Set_Etype (Obj, Array_Type);
+ Set_Parent (Obj, Parent (N));
+ Array_Type := Get_Actual_Subtype (Obj);
+ end;
+ end if;
+
elsif Is_Entity_Name (Name)
or else (Nkind (Name) = N_Function_Call
and then not Is_Constrained (Etype (Name)))
@@ -5989,7 +6027,7 @@ package body Sem_Res is
Set_Etype (N, Array_Type);
-- If the range is specified by a subtype mark, no resolution
- -- is necessary.
+ -- is necessary. Else resolve the bounds, and apply needed checks.
if not Is_Entity_Name (Drange) then
Index := First_Index (Array_Type);
@@ -6037,7 +6075,8 @@ package body Sem_Res is
or else Nkind (Parent (N)) /= N_Op_Concat
or else (N /= Left_Opnd (Parent (N))
and then N /= Right_Opnd (Parent (N)))
- or else (Typ = Standard_Wide_String
+ or else ((Typ = Standard_Wide_String
+ or else Typ = Standard_Wide_Wide_String)
and then Nkind (Original_Node (N)) /= N_String_Literal);
-- If the resolving type is itself a string literal subtype, we
@@ -6097,21 +6136,21 @@ package body Sem_Res is
elsif Is_Bit_Packed_Array (Typ) then
null;
- -- Deal with cases of Wide_String and String
+ -- Deal with cases of Wide_Wide_String, Wide_String, and String
else
- -- For Standard.Wide_String, or any other type whose component
- -- type is Standard.Wide_Character, we know that all the
+ -- For Standard.Wide_Wide_String, or any other type whose component
+ -- type is Standard.Wide_Wide_Character, we know that all the
-- characters in the string must be acceptable, since the parser
-- accepted the characters as valid character literals.
- if R_Typ = Standard_Wide_Character then
+ if R_Typ = Standard_Wide_Wide_Character then
null;
-- For the case of Standard.String, or any other type whose
-- component type is Standard.Character, we must make sure that
-- there are no wide characters in the string, i.e. that it is
- -- entirely composed of characters in range of type String.
+ -- entirely composed of characters in range of type Character.
-- If the string literal is the result of a static concatenation,
-- the test has already been performed on the components, and need
@@ -6128,7 +6167,36 @@ package body Sem_Res is
-- a token, right under the offending wide character.
Error_Msg
- ("literal out of range of type Character",
+ ("literal out of range of type Standard.Character",
+ Source_Ptr (Int (Loc) + J));
+ return;
+ end if;
+ end loop;
+
+ -- For the case of Standard.Wide_String, or any other type whose
+ -- component type is Standard.Wide_Character, we must make sure that
+ -- there are no wide characters in the string, i.e. that it is
+ -- entirely composed of characters in range of type Wide_Character.
+
+ -- If the string literal is the result of a static concatenation,
+ -- the test has already been performed on the components, and need
+ -- not be repeated.
+
+ elsif R_Typ = Standard_Wide_Character
+ and then Nkind (Original_Node (N)) /= N_Op_Concat
+ then
+ for J in 1 .. Strlen loop
+ if not In_Wide_Character_Range (Get_String_Char (Str, J)) then
+
+ -- If we are out of range, post error. This is one of the
+ -- very few places that we place the flag in the middle of
+ -- a token, right under the offending wide character.
+
+ -- This is not quite right, because characters in general
+ -- will take more than one character position ???
+
+ Error_Msg
+ ("literal out of range of type Standard.Wide_Character",
Source_Ptr (Int (Loc) + J));
return;
end if;
@@ -6136,11 +6204,10 @@ package body Sem_Res is
-- If the root type is not a standard character, then we will convert
-- the string into an aggregate and will let the aggregate code do
- -- the checking.
+ -- the checking. Standard Wide_Wide_Character is also OK here.
else
null;
-
end if;
-- See if the component type of the array corresponding to the
@@ -6150,8 +6217,9 @@ package body Sem_Res is
-- the corresponding character aggregate and let the aggregate
-- code do the checking.
- if R_Typ = Standard_Wide_Character
- or else R_Typ = Standard_Character
+ if R_Typ = Standard_Character
+ or else R_Typ = Standard_Wide_Character
+ or else R_Typ = Standard_Wide_Wide_Character
then
-- Check for the case of full range, where we are definitely OK
@@ -6210,7 +6278,9 @@ package body Sem_Res is
Set_Character_Literal_Name (C);
Append_To (Lits,
- Make_Character_Literal (P, Name_Find, C));
+ Make_Character_Literal (P,
+ Chars => Name_Find,
+ Char_Literal_Value => UI_From_CC (C)));
if In_Character_Range (C) then
P := P + 1;
@@ -6280,9 +6350,13 @@ package body Sem_Res is
if Unique_Fixed_Point_Type (N) = Any_Type then
return; -- expression is ambiguous.
else
+ -- If nothing else, the available fixed type is Duration.
+
Set_Etype (Operand, Standard_Duration);
end if;
+ -- Resolve the real operand with largest available precision.
+
if Etype (Right_Opnd (Operand)) = Universal_Real then
Rop := New_Copy_Tree (Right_Opnd (Operand));
else
@@ -6291,7 +6365,12 @@ package body Sem_Res is
Resolve (Rop, Standard_Long_Long_Float);
- if Realval (Rop) /= Ureal_0
+ -- If the operand is a literal (it could be a non-static and
+ -- illegal exponentiation) check whether the use of Duration
+ -- is potentially inaccurate.
+
+ if Nkind (Rop) = N_Real_Literal
+ and then Realval (Rop) /= Ureal_0
and then abs (Realval (Rop)) < Delta_Value (Standard_Duration)
then
Error_Msg_N ("universal real operand can only be interpreted?",
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index cc0cc6fd43b..5993fbb371c 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -985,7 +985,7 @@ package body Sem_Util is
if Is_Overloadable (Id)
and then Nkind (Parent (Parent (Id)))
- /= N_Formal_Subprogram_Declaration
+ not in N_Formal_Subprogram_Declaration
then
Is_Prim := False;
@@ -2526,23 +2526,23 @@ package body Sem_Util is
Loc : Source_Ptr) return Node_Id
is
Lit : Node_Id;
- P : constant Nat := UI_To_Int (Pos);
begin
- -- In the case where the literal is either of type Wide_Character
- -- or Character or of a type derived from them, there needs to be
- -- some special handling since there is no explicit chain of
- -- literals to search. Instead, an N_Character_Literal node is
- -- created with the appropriate Char_Code and Chars fields.
+ -- In the case where the literal is of type Character, Wide_Character
+ -- or Wide_Wide_Character or of a type derived from them, there needs
+ -- to be some special handling since there is no explicit chain of
+ -- literals to search. Instead, an N_Character_Literal node is created
+ -- with the appropriate Char_Code and Chars fields.
if Root_Type (T) = Standard_Character
or else Root_Type (T) = Standard_Wide_Character
+ or else Root_Type (T) = Standard_Wide_Wide_Character
then
- Set_Character_Literal_Name (Char_Code (P));
+ Set_Character_Literal_Name (UI_To_CC (Pos));
return
Make_Character_Literal (Loc,
- Chars => Name_Find,
- Char_Literal_Value => Char_Code (P));
+ Chars => Name_Find,
+ Char_Literal_Value => Pos);
-- For all other cases, we have a complete table of literals, and
-- we simply iterate through the chain of literal until the one
@@ -2551,7 +2551,7 @@ package body Sem_Util is
else
Lit := First_Literal (Base_Type (T));
- for J in 1 .. P loop
+ for J in 1 .. UI_To_Int (Pos) loop
Next_Literal (Lit);
end loop;
@@ -2565,7 +2565,6 @@ package body Sem_Util is
function Get_Generic_Entity (N : Node_Id) return Entity_Id is
Ent : constant Entity_Id := Entity (Name (N));
-
begin
if Present (Renamed_Object (Ent)) then
return Renamed_Object (Ent);
@@ -4591,6 +4590,18 @@ package body Sem_Util is
begin
if Is_Access_Type (Etype (P)) then
return not Is_Access_Constant (Root_Type (Etype (P)));
+
+ -- For the case of an indexed component whose prefix has a packed
+ -- array type, the prefix has been rewritten into a type conversion.
+ -- Determine variable-ness from the converted expression.
+
+ elsif Nkind (P) = N_Type_Conversion
+ and then not Comes_From_Source (P)
+ and then Is_Array_Type (Etype (P))
+ and then Is_Packed (Etype (P))
+ then
+ return Is_Variable (Expression (P));
+
else
return Is_Variable (P);
end if;
@@ -6465,7 +6476,6 @@ package body Sem_Util is
while Nkind (N) /= N_Abstract_Subprogram_Declaration
and then Nkind (N) /= N_Formal_Package_Declaration
- and then Nkind (N) /= N_Formal_Subprogram_Declaration
and then Nkind (N) /= N_Function_Instantiation
and then Nkind (N) /= N_Generic_Package_Declaration
and then Nkind (N) /= N_Generic_Subprogram_Declaration
@@ -6481,6 +6491,7 @@ package body Sem_Util is
and then Nkind (N) /= N_Subprogram_Renaming_Declaration
and then Nkind (N) /= N_Task_Body
and then Nkind (N) /= N_Task_Type_Declaration
+ and then Nkind (N) not in N_Formal_Subprogram_Declaration
and then Nkind (N) not in N_Generic_Renaming_Declaration
loop
N := Parent (N);
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 65ee94ef2c0..33f330143e5 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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,7 +315,7 @@ package body Sinfo is
pragma Assert (False
or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Formal_Package_Declaration
- or else NT (N).Nkind = N_Formal_Subprogram_Declaration);
+ or else NT (N).Nkind in N_Formal_Subprogram_Declaration);
return Flag15 (N);
end Box_Present;
@@ -328,11 +328,11 @@ package body Sinfo is
end By_Ref;
function Char_Literal_Value
- (N : Node_Id) return Char_Code is
+ (N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Character_Literal);
- return Char_Code2 (N);
+ return Uint2 (N);
end Char_Literal_Value;
function Chars
@@ -539,6 +539,14 @@ package body Sinfo is
return Node5 (N);
end Corresponding_Body;
+ function Corresponding_Formal_Spec
+ (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
+ return Node3 (N);
+ end Corresponding_Formal_Spec;
+
function Corresponding_Generic_Association
(N : Node_Id) return Node_Id is
begin
@@ -620,7 +628,7 @@ package body Sinfo is
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
- or else NT (N).Nkind = N_Formal_Subprogram_Declaration);
+ or else NT (N).Nkind in N_Formal_Subprogram_Declaration);
return Node2 (N);
end Default_Name;
@@ -2288,14 +2296,14 @@ package body Sinfo is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abstract_Subprogram_Declaration
- or else NT (N).Nkind = N_Formal_Subprogram_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Subprogram_Declaration
- or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
+ or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
+ or else NT (N).Nkind in N_Formal_Subprogram_Declaration);
return Node1 (N);
end Specification;
@@ -2809,7 +2817,7 @@ package body Sinfo is
pragma Assert (False
or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Formal_Package_Declaration
- or else NT (N).Nkind = N_Formal_Subprogram_Declaration);
+ or else NT (N).Nkind in N_Formal_Subprogram_Declaration);
Set_Flag15 (N, Val);
end Set_Box_Present;
@@ -2822,11 +2830,11 @@ package body Sinfo is
end Set_By_Ref;
procedure Set_Char_Literal_Value
- (N : Node_Id; Val : Char_Code) is
+ (N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Character_Literal);
- Set_Char_Code2 (N, Val);
+ Set_Uint2 (N, Val);
end Set_Char_Literal_Value;
procedure Set_Chars
@@ -3033,6 +3041,14 @@ package body Sinfo is
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Corresponding_Body;
+ procedure Set_Corresponding_Formal_Spec
+ (N : Node_Id; Val : Node_Id) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
+ Set_Node3 (N, Val); -- semantic field, no parent set
+ end Set_Corresponding_Formal_Spec;
+
procedure Set_Corresponding_Generic_Association
(N : Node_Id; Val : Node_Id) is
begin
@@ -3041,6 +3057,7 @@ package body Sinfo is
or else NT (N).Nkind = N_Object_Renaming_Declaration);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Corresponding_Generic_Association;
+
procedure Set_Corresponding_Integer_Value
(N : Node_Id; Val : Uint) is
begin
@@ -3113,7 +3130,7 @@ package body Sinfo is
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
- or else NT (N).Nkind = N_Formal_Subprogram_Declaration);
+ or else NT (N).Nkind in N_Formal_Subprogram_Declaration);
Set_Node2_With_Parent (N, Val);
end Set_Default_Name;
@@ -4772,14 +4789,14 @@ package body Sinfo is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abstract_Subprogram_Declaration
- or else NT (N).Nkind = N_Formal_Subprogram_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Subprogram_Declaration
- or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
+ or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
+ or else NT (N).Nkind in N_Formal_Subprogram_Declaration);
Set_Node1_With_Parent (N, Val);
end Set_Specification;
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 7048cd48d02..bfbbdf838e2 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -650,7 +650,9 @@ package Sinfo is
-- Procedure calls, the Controlling_Argument is one of the actuals.
-- For a function that has a dispatching result, it is an entity in
-- the context of the call that can provide a tag, or else it is the
- -- tag of the root type of the class.
+ -- tag of the root type of the class. It can also specify a tag
+ -- directly rather than being a tagged object. The latter is needed
+ -- by the implementations of AI-239 and AI-260.
-- Conversion_OK (Flag14-Sem)
-- A flag set on type conversion nodes to indicate that the conversion
@@ -670,6 +672,13 @@ package Sinfo is
-- points to the defining entity for the corresponding body (NOT the
-- node for the body itself).
+ -- Corresponding_Formal_Spec (Node3-Sem)
+ -- This field is set in subprogram renaming declarations, where it points
+ -- to the defining entity for a formal subprogram in the case where the
+ -- renaming corresponds to a generic formal subprogram association in an
+ -- instantiation. The field is Empty if the renaming does not correspond
+ -- to such a formal association.
+
-- Corresponding_Generic_Association (Node5-Sem)
-- This field is defined for object declarations and object renaming
-- declarations. It is set for the declarations within an instance that
@@ -1666,6 +1675,12 @@ package Sinfo is
-- using the standard literal format. Such literals are listed by
-- Sprint using the notation [numerator / denominator].
+ -- Note: the value of an integer literal node created by the front end
+ -- is never outside the range of values of the base type. However, it
+ -- can be the case that the value is outside the range of the
+ -- particular subtype. This happens in the case of integer overflows
+ -- with checks suppressed.
+
-- N_Integer_Literal
-- Sloc points to literal
-- Original_Entity (Node2-Sem) If not Empty, holds Named_Number that
@@ -1709,7 +1724,7 @@ package Sinfo is
-- N_Character_Literal
-- Sloc points to literal
-- Chars (Name1) contains the Name_Id for the identifier
- -- Char_Literal_Value (Char_Code2) contains the literal value
+ -- Char_Literal_Value (Uint2) contains the literal value
-- Entity (Node4-Sem)
-- Associated_Node (Node4-Sem)
-- Has_Private_View (Flag11-Sem) set in generic units.
@@ -4382,6 +4397,7 @@ package Sinfo is
-- Name (Node2)
-- Parent_Spec (Node4-Sem)
-- Corresponding_Spec (Node5-Sem)
+ -- Corresponding_Formal_Spec (Node3-Sem)
-- From_Default (Flag6-Sem)
-----------------------------------------
@@ -5679,9 +5695,33 @@ package Sinfo is
-----------------------------------------
-- FORMAL_SUBPROGRAM_DECLARATION ::=
+ -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
+ -- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
+
+ --------------------------------------------------
+ -- 12.6 Formal Concrete Subprogram Declaration --
+ --------------------------------------------------
+
+ -- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT];
- -- N_Formal_Subprogram_Declaration
+ -- N_Formal_Concrete_Subprogram_Declaration
+ -- Sloc points to WITH
+ -- Specification (Node1)
+ -- Default_Name (Node2) (set to Empty if no subprogram default)
+ -- Box_Present (Flag15)
+
+ -- Note: if no subprogram default is present, then Name is set
+ -- to Empty, and Box_Present is False.
+
+ --------------------------------------------------
+ -- 12.6 Formal Abstract Subprogram Declaration --
+ --------------------------------------------------
+
+ -- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
+ -- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT];
+
+ -- N_Formal_Abstract_Subprogram_Declaration
-- Sloc points to WITH
-- Specification (Node1)
-- Default_Name (Node2) (set to Empty if no subprogram default)
@@ -5697,8 +5737,9 @@ package Sinfo is
-- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
-- There is no separate node in the tree for a subprogram default.
- -- Instead the parent (N_Formal_Subprogram_Declaration) node contains
- -- the default name or box indication, as needed.
+ -- Instead the parent (N_Formal_Concrete_Subprogram_Declaration
+ -- or N_Formal_Abstract_Subprogram_Declaration) node contains the
+ -- default name or box indication, as needed.
------------------------
-- 12.6 Default Name --
@@ -6720,6 +6761,8 @@ package Sinfo is
N_Exception_Declaration,
N_Exception_Handler,
N_Floating_Point_Definition,
+ N_Formal_Abstract_Subprogram_Declaration,
+ N_Formal_Concrete_Subprogram_Declaration,
N_Formal_Decimal_Fixed_Point_Definition,
N_Formal_Derived_Type_Definition,
N_Formal_Discrete_Type_Definition,
@@ -6729,7 +6772,6 @@ package Sinfo is
N_Formal_Package_Declaration,
N_Formal_Private_Type_Definition,
N_Formal_Signed_Integer_Type_Definition,
- N_Formal_Subprogram_Declaration,
N_Generic_Association,
N_Handled_Sequence_Of_Statements,
N_Index_Or_Discriminant_Constraint,
@@ -6796,6 +6838,10 @@ package Sinfo is
N_Defining_Character_Literal ..
N_Defining_Operator_Symbol;
+ subtype N_Formal_Subprogram_Declaration is Node_Kind range
+ N_Formal_Abstract_Subprogram_Declaration ..
+ N_Formal_Concrete_Subprogram_Declaration;
+
subtype N_Generic_Declaration is Node_Kind range
N_Generic_Package_Declaration ..
N_Generic_Subprogram_Declaration;
@@ -7005,7 +7051,7 @@ package Sinfo is
(N : Node_Id) return Boolean; -- Flag15
function Char_Literal_Value
- (N : Node_Id) return Char_Code; -- Char_Code2
+ (N : Node_Id) return Uint; -- Uint2
function Chars
(N : Node_Id) return Name_Id; -- Name1
@@ -7073,6 +7119,9 @@ package Sinfo is
function Corresponding_Body
(N : Node_Id) return Node_Id; -- Node5
+ function Corresponding_Formal_Spec
+ (N : Node_Id) return Node_Id; -- Node3
+
function Corresponding_Generic_Association
(N : Node_Id) return Node_Id; -- Node5
@@ -7800,7 +7849,7 @@ package Sinfo is
(N : Node_Id; Val : Boolean := True); -- Flag5
procedure Set_Char_Literal_Value
- (N : Node_Id; Val : Char_Code); -- Char_Code2
+ (N : Node_Id; Val : Uint); -- Uint2
procedure Set_Chars
(N : Node_Id; Val : Name_Id); -- Name1
@@ -7868,6 +7917,9 @@ package Sinfo is
procedure Set_Corresponding_Body
(N : Node_Id; Val : Node_Id); -- Node5
+ procedure Set_Corresponding_Formal_Spec
+ (N : Node_Id; Val : Node_Id); -- Node3
+
procedure Set_Corresponding_Generic_Association
(N : Node_Id; Val : Node_Id); -- Node5
@@ -8572,6 +8624,7 @@ package Sinfo is
pragma Inline (Controlling_Argument);
pragma Inline (Conversion_OK);
pragma Inline (Corresponding_Body);
+ pragma Inline (Corresponding_Formal_Spec);
pragma Inline (Corresponding_Generic_Association);
pragma Inline (Corresponding_Integer_Value);
pragma Inline (Corresponding_Spec);
@@ -8834,6 +8887,7 @@ package Sinfo is
pragma Inline (Set_Controlling_Argument);
pragma Inline (Set_Conversion_OK);
pragma Inline (Set_Corresponding_Body);
+ pragma Inline (Set_Corresponding_Formal_Spec);
pragma Inline (Set_Corresponding_Generic_Association);
pragma Inline (Set_Corresponding_Integer_Value);
pragma Inline (Set_Corresponding_Spec);
diff --git a/gcc/ada/sinput.adb b/gcc/ada/sinput.adb
index f7fb3ced3e1..6eabba27599 100644
--- a/gcc/ada/sinput.adb
+++ b/gcc/ada/sinput.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,12 +34,13 @@
pragma Style_Checks (All_Checks);
-- Subprograms not all in alpha order
-with Debug; use Debug;
-with Namet; use Namet;
-with Opt; use Opt;
-with Output; use Output;
-with Tree_IO; use Tree_IO;
-with System; use System;
+with Debug; use Debug;
+with Namet; use Namet;
+with Opt; use Opt;
+with Output; use Output;
+with Tree_IO; use Tree_IO;
+with System; use System;
+with Widechar; use Widechar;
with System.Memory;
@@ -644,53 +645,36 @@ package body Sinput is
-- Skip_Line_Terminators --
---------------------------
- -- There are two distinct concepts of line terminator in GNAT
-
- -- A logical line terminator is what corresponds to the "end of a line"
- -- as described in RM 2.2 (13). Any of the characters FF, LF, CR or VT
- -- acts as an end of logical line in this sense, and it is essentially
- -- irrelevant whether one or more appears in sequence (since if a
- -- sequence of such characters is regarded as separate ends of line,
- -- then the intervening logical lines are null in any case).
-
- -- A physical line terminator is a sequence of format effectors that
- -- is treated as ending a physical line. Physical lines have no Ada
- -- semantic significance, but they are significant for error reporting
- -- purposes, since errors are identified by line and column location.
-
- -- In GNAT, a physical line is ended by any of the sequences LF, CR/LF,
- -- CR or LF/CR. LF is used in typical Unix systems, CR/LF in DOS systems,
- -- and CR alone in System 7. We don't know of any system using LF/CR, but
- -- it seems reasonable to include this case for consistency. In addition,
- -- we recognize any of these sequences in any of the operating systems,
- -- for better behavior in treating foreign files (e.g. a Unix file with
- -- LF terminators transferred to a DOS system).
-
procedure Skip_Line_Terminators
(P : in out Source_Ptr;
Physical : out Boolean)
is
- begin
- pragma Assert (Source (P) in Line_Terminator);
+ Chr : constant Character := Source (P);
- if Source (P) = CR then
+ begin
+ if Chr = CR then
if Source (P + 1) = LF then
P := P + 2;
else
P := P + 1;
end if;
- elsif Source (P) = LF then
- if Source (P + 1) = CR then
+ elsif Chr = LF then
+ if Source (P) = CR then
P := P + 2;
else
P := P + 1;
end if;
- else -- Source (P) = FF or else Source (P) = VT
+ elsif Chr = FF or else Chr = VT then
P := P + 1;
Physical := False;
return;
+
+ -- Otherwise we have a wide character
+
+ else
+ Skip_Wide (Source, P);
end if;
-- Fall through in the physical line terminator case. First deal with
diff --git a/gcc/ada/sinput.ads b/gcc/ada/sinput.ads
index 53e8889b424..b47b4dc2f89 100644
--- a/gcc/ada/sinput.ads
+++ b/gcc/ada/sinput.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -37,8 +37,32 @@
-- General Note: throughout the compiler, we use the term line or source
-- line to refer to a physical line in the source, terminated by the end of
--- physical line sequence. See Skip_Line_Terminators procedure for a full
--- description of the difference between logical and physical lines.
+-- physical line sequence.
+
+-- There are two distinct concepts of line terminator in GNAT
+
+-- A logical line terminator is what corresponds to the "end of a line" as
+-- described in RM 2.2 (13). Any of the characters FF, LF, CR or VT or any
+-- wide character that is a Line or Paragraph Separator acts as an end of
+-- logical line in this sense, and it is essentially irrelevant whether one
+-- or more appears in sequence (since if sequence of such characters is
+-- regarded as separate ends of line, then the intervening logical lines
+-- are null in any case).
+
+-- A physical line terminator is a sequence of format effectors that is
+-- treated as ending a physical line. Physical lines have no Ada semantic
+-- significance, but they are significant for error reporting purposes,
+-- since errors are identified by line and column location.
+
+-- In GNAT, a physical line is ended by any of the sequences LF, CR/LF, CR or
+-- LF/CR. LF is used in typical Unix systems, CR/LF in DOS systems, and CR
+-- alone in System 7. We don't know of any system using LF/CR, but it seems
+-- reasonable to include this case for consistency. In addition, we recognize
+-- any of these sequences in any of the operating systems, for better
+-- behavior in treating foreign files (e.g. a Unix file with LF terminators
+-- transferred to a DOS system). Finally, wide character codes in cagtegories
+-- Separator, Line and Separator, Paragraph are considered to be physical
+-- line terminators.
with Alloc;
with Casing; use Casing;
@@ -293,7 +317,7 @@ package Sinput is
procedure Lock;
-- Lock internal tables
- Main_Source_File : Source_File_Index;
+ Main_Source_File : Source_File_Index := No_Source_File;
-- This is set to the source file index of the main unit
-----------------------------
@@ -531,16 +555,29 @@ package Sinput is
procedure Skip_Line_Terminators
(P : in out Source_Ptr;
Physical : out Boolean);
- -- On entry, Source (P) points to the line terminator character that
- -- terminates a line. The result set in P is the location of the first
- -- character of the following line (after skipping the sequence of line
- -- terminator characters terminating the current line). In addition, if
- -- the terminator sequence ends a physical line (the definition of what
- -- constitutes a physical line is embodied in the implementation of this
- -- function), and it is the first time this sequence is encountered, then
- -- an entry is made in the lines table to record the location for further
- -- use by functions such as Get_Line_Number. Physical is set to True if
- -- the line terminator was the end of a physical line.
+ -- On entry, P points to a line terminator that has been encountered,
+ -- which is one of FF,LF,VT,CR or a wide character sequence whose value is
+ -- in category Separator,Line or Separator,Paragraph. The purpose of this
+ -- P points just past the character that was scanned. The purpose of this
+ -- routine is to distinguish physical and logical line endings. A physical
+ -- line ending is one of:
+ --
+ -- CR on its own (MAC System 7)
+ -- LF on its own (Unix and unix-like systems)
+ -- CR/LF (DOS, Windows)
+ -- LF/CR (not used, but recognized in any case)
+ -- Wide character in Separator,Line or Separator,Paragraph category
+ --
+ -- A logical line ending (that is not a physical line ending) is one of:
+ --
+ -- VT on its own
+ -- FF on its own
+ --
+ -- On return, P is bumped past the line ending sequence (one of the above
+ -- seven possibilities). Physical is set to True to indicate that a
+ -- physical end of line was encountered, in which case this routine also
+ -- makes sure that the lines table for the current source file has an
+ -- appropriate entry for the start of the new physical line.
function Source_Offset (S : Source_Ptr) return Nat;
-- Returns the zero-origin offset of the given source location from the
diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb
index bdb73ce1595..c80da272b76 100644
--- a/gcc/ada/snames.adb
+++ b/gcc/ada/snames.adb
@@ -1,1042 +1,1049 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- S N A M E S --
--- --
--- B o d y --
--- --
--- Copyright (C) 1992-2004, 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- --
--- 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. --
--- --
-------------------------------------------------------------------------------
-
-with Namet; use Namet;
-with Table;
-
-package body Snames is
-
- -- Table used to record convention identifiers
-
- type Convention_Id_Entry is record
- Name : Name_Id;
- Convention : Convention_Id;
- end record;
-
- package Convention_Identifiers is new Table.Table (
- Table_Component_Type => Convention_Id_Entry,
- Table_Index_Type => Int,
- Table_Low_Bound => 1,
- Table_Initial => 50,
- Table_Increment => 200,
- Table_Name => "Name_Convention_Identifiers");
-
- -- Table of names to be set by Initialize. Each name is terminated by a
- -- single #, and the end of the list is marked by a null entry, i.e. by
- -- two # marks in succession. Note that the table does not include the
- -- entries for a-z, since these are initialized by Namet itself.
-
- Preset_Names : constant String :=
- "_parent#" &
- "_tag#" &
- "off#" &
- "space#" &
- "time#" &
- "_abort_signal#" &
- "_alignment#" &
- "_assign#" &
- "_atcb#" &
- "_chain#" &
- "_clean#" &
- "_controller#" &
- "_entry_bodies#" &
- "_expunge#" &
- "_final_list#" &
- "_idepth#" &
- "_init#" &
- "_local_final_list#" &
- "_master#" &
- "_object#" &
- "_priority#" &
- "_process_atsd#" &
- "_secondary_stack#" &
- "_service#" &
- "_size#" &
- "_stack#" &
- "_tags#" &
- "_task#" &
- "_task_id#" &
- "_task_info#" &
- "_task_name#" &
- "_trace_sp#" &
- "initialize#" &
- "adjust#" &
- "finalize#" &
- "next#" &
- "prev#" &
- "_typecode#" &
- "_from_any#" &
- "_to_any#" &
- "allocate#" &
- "deallocate#" &
- "dereference#" &
- "decimal_io#" &
- "enumeration_io#" &
- "fixed_io#" &
- "float_io#" &
- "integer_io#" &
- "modular_io#" &
- "a_textio#" &
- "a_witeio#" &
- "const#" &
- "<error>#" &
- "go#" &
- "put#" &
- "put_line#" &
- "to#" &
- "finalization#" &
- "finalization_root#" &
- "interfaces#" &
- "standard#" &
- "system#" &
- "text_io#" &
- "wide_text_io#" &
- "no_dsa#" &
- "garlic_dsa#" &
- "polyorb_dsa#" &
- "addr#" &
- "async#" &
- "get_active_partition_id#" &
- "get_rci_package_receiver#" &
- "get_rci_package_ref#" &
- "origin#" &
- "params#" &
- "partition#" &
- "partition_interface#" &
- "ras#" &
- "call#" &
- "rci_name#" &
- "receiver#" &
- "result#" &
- "rpc#" &
- "subp_id#" &
- "operation#" &
- "argument#" &
- "arg_modes#" &
- "handler#" &
- "target#" &
- "req#" &
- "obj_typecode#" &
- "stub#" &
- "Oabs#" &
- "Oand#" &
- "Omod#" &
- "Onot#" &
- "Oor#" &
- "Orem#" &
- "Oxor#" &
- "Oeq#" &
- "One#" &
- "Olt#" &
- "Ole#" &
- "Ogt#" &
- "Oge#" &
- "Oadd#" &
- "Osubtract#" &
- "Oconcat#" &
- "Omultiply#" &
- "Odivide#" &
- "Oexpon#" &
- "ada_83#" &
- "ada_95#" &
- "ada_05#" &
- "c_pass_by_copy#" &
- "compile_time_warning#" &
- "component_alignment#" &
- "convention_identifier#" &
- "detect_blocking#" &
- "discard_names#" &
- "elaboration_checks#" &
- "eliminate#" &
- "explicit_overriding#" &
- "extend_system#" &
- "extensions_allowed#" &
- "external_name_casing#" &
- "float_representation#" &
- "initialize_scalars#" &
- "interrupt_state#" &
- "license#" &
- "locking_policy#" &
- "long_float#" &
- "no_run_time#" &
- "no_strict_aliasing#" &
- "normalize_scalars#" &
- "polling#" &
- "persistent_data#" &
- "persistent_object#" &
- "profile#" &
- "profile_warnings#" &
- "propagate_exceptions#" &
- "queuing_policy#" &
- "ravenscar#" &
- "restricted_run_time#" &
- "restrictions#" &
- "restriction_warnings#" &
- "reviewable#" &
- "source_file_name#" &
- "source_file_name_project#" &
- "style_checks#" &
- "suppress#" &
- "suppress_exception_locations#" &
- "task_dispatching_policy#" &
- "universal_data#" &
- "unsuppress#" &
- "use_vads_size#" &
- "validity_checks#" &
- "warnings#" &
- "abort_defer#" &
- "all_calls_remote#" &
- "annotate#" &
- "assert#" &
- "asynchronous#" &
- "atomic#" &
- "atomic_components#" &
- "attach_handler#" &
- "comment#" &
- "common_object#" &
- "complex_representation#" &
- "controlled#" &
- "convention#" &
- "cpp_class#" &
- "cpp_constructor#" &
- "cpp_virtual#" &
- "cpp_vtable#" &
- "debug#" &
- "elaborate#" &
- "elaborate_all#" &
- "elaborate_body#" &
- "export#" &
- "export_exception#" &
- "export_function#" &
- "export_object#" &
- "export_procedure#" &
- "export_value#" &
- "export_valued_procedure#" &
- "external#" &
- "finalize_storage_only#" &
- "ident#" &
- "import#" &
- "import_exception#" &
- "import_function#" &
- "import_object#" &
- "import_procedure#" &
- "import_valued_procedure#" &
- "inline#" &
- "inline_always#" &
- "inline_generic#" &
- "inspection_point#" &
- "interface#" &
- "interface_name#" &
- "interrupt_handler#" &
- "interrupt_priority#" &
- "java_constructor#" &
- "java_interface#" &
- "keep_names#" &
- "link_with#" &
- "linker_alias#" &
- "linker_options#" &
- "linker_section#" &
- "list#" &
- "machine_attribute#" &
- "main#" &
- "main_storage#" &
- "memory_size#" &
- "no_return#" &
- "obsolescent#" &
- "optimize#" &
- "optional_overriding#" &
- "overriding#" &
- "pack#" &
- "page#" &
- "passive#" &
- "preelaborate#" &
- "priority#" &
- "psect_object#" &
- "pure#" &
- "pure_function#" &
- "remote_call_interface#" &
- "remote_types#" &
- "share_generic#" &
- "shared#" &
- "shared_passive#" &
- "source_reference#" &
- "stream_convert#" &
- "subtitle#" &
- "suppress_all#" &
- "suppress_debug_info#" &
- "suppress_initialization#" &
- "system_name#" &
- "task_info#" &
- "task_name#" &
- "task_storage#" &
- "thread_body#" &
- "time_slice#" &
- "title#" &
- "unchecked_union#" &
- "unimplemented_unit#" &
- "unreferenced#" &
- "unreserve_all_interrupts#" &
- "volatile#" &
- "volatile_components#" &
- "weak_external#" &
- "ada#" &
- "assembler#" &
- "cobol#" &
- "cpp#" &
- "fortran#" &
- "intrinsic#" &
- "java#" &
- "stdcall#" &
- "stubbed#" &
- "asm#" &
- "assembly#" &
- "default#" &
- "dll#" &
- "win32#" &
- "as_is#" &
- "body_file_name#" &
- "boolean_entry_barriers#" &
- "casing#" &
- "code#" &
- "component#" &
- "component_size_4#" &
- "copy#" &
- "d_float#" &
- "descriptor#" &
- "dot_replacement#" &
- "dynamic#" &
- "entity#" &
- "external_name#" &
- "first_optional_parameter#" &
- "form#" &
- "g_float#" &
- "gcc#" &
- "gnat#" &
- "gpl#" &
- "ieee_float#" &
- "internal#" &
- "link_name#" &
- "lowercase#" &
- "max_entry_queue_depth#" &
- "max_entry_queue_length#" &
- "max_size#" &
- "mechanism#" &
- "mixedcase#" &
- "modified_gpl#" &
- "name#" &
- "nca#" &
- "no#" &
- "no_dependence#" &
- "no_dynamic_attachment#" &
- "no_dynamic_interrupts#" &
- "no_requeue#" &
- "no_requeue_statements#" &
- "no_task_attributes#" &
- "no_task_attributes_package#" &
- "on#" &
- "parameter_types#" &
- "reference#" &
- "restricted#" &
- "result_mechanism#" &
- "result_type#" &
- "runtime#" &
- "sb#" &
- "secondary_stack_size#" &
- "section#" &
- "semaphore#" &
- "simple_barriers#" &
- "spec_file_name#" &
- "static#" &
- "stack_size#" &
- "subunit_file_name#" &
- "task_stack_size_default#" &
- "task_type#" &
- "time_slicing_enabled#" &
- "top_guard#" &
- "uba#" &
- "ubs#" &
- "ubsb#" &
- "unit_name#" &
- "unknown#" &
- "unrestricted#" &
- "uppercase#" &
- "user#" &
- "vax_float#" &
- "vms#" &
- "working_storage#" &
- "abort_signal#" &
- "access#" &
- "address#" &
- "address_size#" &
- "aft#" &
- "alignment#" &
- "asm_input#" &
- "asm_output#" &
- "ast_entry#" &
- "bit#" &
- "bit_order#" &
- "bit_position#" &
- "body_version#" &
- "callable#" &
- "caller#" &
- "code_address#" &
- "component_size#" &
- "compose#" &
- "constrained#" &
- "count#" &
- "default_bit_order#" &
- "definite#" &
- "delta#" &
- "denorm#" &
- "digits#" &
- "elaborated#" &
- "emax#" &
- "enum_rep#" &
- "epsilon#" &
- "exponent#" &
- "external_tag#" &
- "first#" &
- "first_bit#" &
- "fixed_value#" &
- "fore#" &
- "has_access_values#" &
- "has_discriminants#" &
- "identity#" &
- "img#" &
- "integer_value#" &
- "large#" &
- "last#" &
- "last_bit#" &
- "leading_part#" &
- "length#" &
- "machine_emax#" &
- "machine_emin#" &
- "machine_mantissa#" &
- "machine_overflows#" &
- "machine_radix#" &
- "machine_rounds#" &
- "machine_size#" &
- "mantissa#" &
- "max_size_in_storage_elements#" &
- "maximum_alignment#" &
- "mechanism_code#" &
- "mod#" &
- "model_emin#" &
- "model_epsilon#" &
- "model_mantissa#" &
- "model_small#" &
- "modulus#" &
- "null_parameter#" &
- "object_size#" &
- "partition_id#" &
- "passed_by_reference#" &
- "pool_address#" &
- "pos#" &
- "position#" &
- "range#" &
- "range_length#" &
- "round#" &
- "safe_emax#" &
- "safe_first#" &
- "safe_large#" &
- "safe_last#" &
- "safe_small#" &
- "scale#" &
- "scaling#" &
- "signed_zeros#" &
- "size#" &
- "small#" &
- "storage_size#" &
- "storage_unit#" &
- "tag#" &
- "target_name#" &
- "terminated#" &
- "to_address#" &
- "type_class#" &
- "uet_address#" &
- "unbiased_rounding#" &
- "unchecked_access#" &
- "unconstrained_array#" &
- "universal_literal_string#" &
- "unrestricted_access#" &
- "vads_size#" &
- "val#" &
- "valid#" &
- "value_size#" &
- "version#" &
- "wchar_t_size#" &
- "wide_width#" &
- "width#" &
- "word_size#" &
- "adjacent#" &
- "ceiling#" &
- "copy_sign#" &
- "floor#" &
- "fraction#" &
- "image#" &
- "input#" &
- "machine#" &
- "max#" &
- "min#" &
- "model#" &
- "pred#" &
- "remainder#" &
- "rounding#" &
- "succ#" &
- "truncation#" &
- "value#" &
- "wide_image#" &
- "wide_value#" &
- "output#" &
- "read#" &
- "write#" &
- "elab_body#" &
- "elab_spec#" &
- "storage_pool#" &
- "base#" &
- "class#" &
- "ceiling_locking#" &
- "inheritance_locking#" &
- "fifo_queuing#" &
- "priority_queuing#" &
- "fifo_within_priorities#" &
- "access_check#" &
- "accessibility_check#" &
- "discriminant_check#" &
- "division_check#" &
- "elaboration_check#" &
- "index_check#" &
- "length_check#" &
- "overflow_check#" &
- "range_check#" &
- "storage_check#" &
- "tag_check#" &
- "all_checks#" &
- "abort#" &
- "abs#" &
- "accept#" &
- "and#" &
- "all#" &
- "array#" &
- "at#" &
- "begin#" &
- "body#" &
- "case#" &
- "constant#" &
- "declare#" &
- "delay#" &
- "do#" &
- "else#" &
- "elsif#" &
- "end#" &
- "entry#" &
- "exception#" &
- "exit#" &
- "for#" &
- "function#" &
- "generic#" &
- "goto#" &
- "if#" &
- "in#" &
- "is#" &
- "limited#" &
- "loop#" &
- "new#" &
- "not#" &
- "null#" &
- "of#" &
- "or#" &
- "others#" &
- "out#" &
- "package#" &
- "pragma#" &
- "private#" &
- "procedure#" &
- "raise#" &
- "record#" &
- "rem#" &
- "renames#" &
- "return#" &
- "reverse#" &
- "select#" &
- "separate#" &
- "subtype#" &
- "task#" &
- "terminate#" &
- "then#" &
- "type#" &
- "use#" &
- "when#" &
- "while#" &
- "with#" &
- "xor#" &
- "divide#" &
- "enclosing_entity#" &
- "exception_information#" &
- "exception_message#" &
- "exception_name#" &
- "file#" &
- "import_address#" &
- "import_largest_value#" &
- "import_value#" &
- "is_negative#" &
- "line#" &
- "rotate_left#" &
- "rotate_right#" &
- "shift_left#" &
- "shift_right#" &
- "shift_right_arithmetic#" &
- "source_location#" &
- "unchecked_conversion#" &
- "unchecked_deallocation#" &
- "to_pointer#" &
- "abstract#" &
- "aliased#" &
- "protected#" &
- "until#" &
- "requeue#" &
- "tagged#" &
- "raise_exception#" &
- "ada_roots#" &
- "binder#" &
- "binder_driver#" &
- "body_suffix#" &
- "builder#" &
- "compiler#" &
- "compiler_driver#" &
- "compiler_kind#" &
- "compute_dependency#" &
- "cross_reference#" &
- "default_linker#" &
- "default_switches#" &
- "dependency_option#" &
- "exec_dir#" &
- "executable#" &
- "executable_suffix#" &
- "extends#" &
- "externally_built#" &
- "finder#" &
- "global_configuration_pragmas#" &
- "gnatls#" &
- "gnatstub#" &
- "implementation#" &
- "implementation_exceptions#" &
- "implementation_suffix#" &
- "include_option#" &
- "language_processing#" &
- "languages#" &
- "library_dir#" &
- "library_auto_init#" &
- "library_gcc#" &
- "library_interface#" &
- "library_kind#" &
- "library_name#" &
- "library_options#" &
- "library_reference_symbol_file#" &
- "library_src_dir#" &
- "library_symbol_file#" &
- "library_symbol_policy#" &
- "library_version#" &
- "linker#" &
- "local_configuration_pragmas#" &
- "locally_removed_files#" &
- "metrics#" &
- "naming#" &
- "object_dir#" &
- "pretty_printer#" &
- "project#" &
- "separate_suffix#" &
- "source_dirs#" &
- "source_files#" &
- "source_list_file#" &
- "spec#" &
- "spec_suffix#" &
- "specification#" &
- "specification_exceptions#" &
- "specification_suffix#" &
- "switches#" &
- "unaligned_valid#" &
- "#";
-
- ---------------------
- -- Generated Names --
- ---------------------
-
- -- This section lists the various cases of generated names which are
- -- built from existing names by adding unique leading and/or trailing
- -- upper case letters. In some cases these names are built recursively,
- -- in particular names built from types may be built from types which
- -- themselves have generated names. In this list, xxx represents an
- -- existing name to which identifying letters are prepended or appended,
- -- and a trailing n represents a serial number in an external name that
- -- has some semantic significance (e.g. the n'th index type of an array).
-
- -- xxxA access type for formal xxx in entry param record (Exp_Ch9)
- -- xxxB tag table for tagged type xxx (Exp_Ch3)
- -- xxxB task body procedure for task xxx (Exp_Ch9)
- -- xxxD dispatch table for tagged type xxx (Exp_Ch3)
- -- xxxD discriminal for discriminant xxx (Sem_Ch3)
- -- xxxDn n'th discr check function for rec type xxx (Exp_Ch3)
- -- xxxE elaboration boolean flag for task xxx (Exp_Ch9)
- -- xxxE dispatch table pointer type for tagged type xxx (Exp_Ch3)
- -- xxxE parameters for accept body for entry xxx (Exp_Ch9)
- -- xxxFn n'th primitive of a tagged type (named xxx) (Exp_Ch3)
- -- xxxJ tag table type index for tagged type xxx (Exp_Ch3)
- -- xxxM master Id value for access type xxx (Exp_Ch3)
- -- xxxP tag table pointer type for tagged type xxx (Exp_Ch3)
- -- xxxP parameter record type for entry xxx (Exp_Ch9)
- -- xxxPA access to parameter record type for entry xxx (Exp_Ch9)
- -- xxxPn pointer type for n'th primitive of tagged type xxx (Exp_Ch3)
- -- xxxR dispatch table pointer for tagged type xxx (Exp_Ch3)
- -- xxxT tag table type for tagged type xxx (Exp_Ch3)
- -- xxxT literal table for enumeration type xxx (Sem_Ch3)
- -- xxxV type for task value record for task xxx (Exp_Ch9)
- -- xxxX entry index constant (Exp_Ch9)
- -- xxxY dispatch table type for tagged type xxx (Exp_Ch3)
- -- xxxZ size variable for task xxx (Exp_Ch9)
-
- -- TSS names
-
- -- xxxDA deep adjust routine for type xxx (Exp_TSS)
- -- xxxDF deep finalize routine for type xxx (Exp_TSS)
- -- xxxDI deep initialize routine for type xxx (Exp_TSS)
- -- xxxEQ composite equality routine for record type xxx (Exp_TSS)
- -- xxxIP initialization procedure for type xxx (Exp_TSS)
- -- xxxRA RAs type access routine for type xxx (Exp_TSS)
- -- xxxRD RAs type dereference routine for type xxx (Exp_TSS)
- -- xxxRP Rep to Pos conversion for enumeration type xxx (Exp_TSS)
- -- xxxSA array/slice assignment for controlled comp. arrays (Exp_TSS)
- -- xxxSI stream input attribute subprogram for type xxx (Exp_TSS)
- -- xxxSO stream output attribute subprogram for type xxx (Exp_TSS)
- -- xxxSR stream read attribute subprogram for type xxx (Exp_TSS)
- -- xxxSW stream write attribute subprogram for type xxx (Exp_TSS)
-
- -- Implicit type names
-
- -- TxxxT type of literal table for enumeration type xxx (Sem_Ch3)
-
- -- (Note: this list is not complete or accurate ???)
-
- ----------------------
- -- Get_Attribute_Id --
- ----------------------
-
- function Get_Attribute_Id (N : Name_Id) return Attribute_Id is
- begin
- return Attribute_Id'Val (N - First_Attribute_Name);
- end Get_Attribute_Id;
-
- ------------------
- -- Get_Check_Id --
- ------------------
-
- function Get_Check_Id (N : Name_Id) return Check_Id is
- begin
- return Check_Id'Val (N - First_Check_Name);
- end Get_Check_Id;
-
- -----------------------
- -- Get_Convention_Id --
- -----------------------
-
- function Get_Convention_Id (N : Name_Id) return Convention_Id is
- begin
- case N is
- when Name_Ada => return Convention_Ada;
- when Name_Assembler => return Convention_Assembler;
- when Name_C => return Convention_C;
- when Name_COBOL => return Convention_COBOL;
- when Name_CPP => return Convention_CPP;
- when Name_Fortran => return Convention_Fortran;
- when Name_Intrinsic => return Convention_Intrinsic;
- when Name_Java => return Convention_Java;
- when Name_Stdcall => return Convention_Stdcall;
- when Name_Stubbed => return Convention_Stubbed;
-
- -- If no direct match, then we must have a convention
- -- identifier pragma that has specified this name.
-
- when others =>
- for J in 1 .. Convention_Identifiers.Last loop
- if N = Convention_Identifiers.Table (J).Name then
- return Convention_Identifiers.Table (J).Convention;
- end if;
- end loop;
-
- raise Program_Error;
- end case;
- end Get_Convention_Id;
-
- ---------------------------
- -- Get_Locking_Policy_Id --
- ---------------------------
-
- function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id is
- begin
- return Locking_Policy_Id'Val (N - First_Locking_Policy_Name);
- end Get_Locking_Policy_Id;
-
- -------------------
- -- Get_Pragma_Id --
- -------------------
-
- function Get_Pragma_Id (N : Name_Id) return Pragma_Id is
- begin
- if N = Name_AST_Entry then
- return Pragma_AST_Entry;
- elsif N = Name_Storage_Size then
- return Pragma_Storage_Size;
- elsif N = Name_Storage_Unit then
- return Pragma_Storage_Unit;
- elsif N not in First_Pragma_Name .. Last_Pragma_Name then
- return Unknown_Pragma;
- else
- return Pragma_Id'Val (N - First_Pragma_Name);
- end if;
- end Get_Pragma_Id;
-
- ---------------------------
- -- Get_Queuing_Policy_Id --
- ---------------------------
-
- function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id is
- begin
- return Queuing_Policy_Id'Val (N - First_Queuing_Policy_Name);
- end Get_Queuing_Policy_Id;
-
- ------------------------------------
- -- Get_Task_Dispatching_Policy_Id --
- ------------------------------------
-
- function Get_Task_Dispatching_Policy_Id (N : Name_Id)
- return Task_Dispatching_Policy_Id is
- begin
- return Task_Dispatching_Policy_Id'Val
- (N - First_Task_Dispatching_Policy_Name);
- end Get_Task_Dispatching_Policy_Id;
-
- ----------------
- -- Initialize --
- ----------------
-
- procedure Initialize is
- P_Index : Natural;
- Discard_Name : Name_Id;
-
- begin
- P_Index := Preset_Names'First;
-
- loop
- Name_Len := 0;
-
- while Preset_Names (P_Index) /= '#' loop
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) := Preset_Names (P_Index);
- P_Index := P_Index + 1;
- end loop;
-
- -- We do the Name_Find call to enter the name into the table, but
- -- we don't need to do anything with the result, since we already
- -- initialized all the preset names to have the right value (we
- -- are depending on the order of the names and Preset_Names).
-
- Discard_Name := Name_Find;
- P_Index := P_Index + 1;
- exit when Preset_Names (P_Index) = '#';
- end loop;
-
- -- Make sure that number of names in standard table is correct. If
- -- this check fails, run utility program XSNAMES to construct a new
- -- properly matching version of the body.
-
- pragma Assert (Discard_Name = Last_Predefined_Name);
-
- -- Initialize the convention identifiers table with the standard
- -- set of synonyms that we recognize for conventions.
-
- Convention_Identifiers.Init;
-
- Convention_Identifiers.Append ((Name_Asm, Convention_Assembler));
- Convention_Identifiers.Append ((Name_Assembly, Convention_Assembler));
-
- Convention_Identifiers.Append ((Name_Default, Convention_C));
- Convention_Identifiers.Append ((Name_External, Convention_C));
-
- Convention_Identifiers.Append ((Name_DLL, Convention_Stdcall));
- Convention_Identifiers.Append ((Name_Win32, Convention_Stdcall));
- end Initialize;
-
- -----------------------
- -- Is_Attribute_Name --
- -----------------------
-
- function Is_Attribute_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Attribute_Name .. Last_Attribute_Name;
- end Is_Attribute_Name;
-
- -------------------
- -- Is_Check_Name --
- -------------------
-
- function Is_Check_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Check_Name .. Last_Check_Name;
- end Is_Check_Name;
-
- ------------------------
- -- Is_Convention_Name --
- ------------------------
-
- function Is_Convention_Name (N : Name_Id) return Boolean is
- begin
- -- Check if this is one of the standard conventions
-
- if N in First_Convention_Name .. Last_Convention_Name
- or else N = Name_C
- then
- return True;
-
- -- Otherwise check if it is in convention identifier table
-
- else
- for J in 1 .. Convention_Identifiers.Last loop
- if N = Convention_Identifiers.Table (J).Name then
- return True;
- end if;
- end loop;
-
- return False;
- end if;
- end Is_Convention_Name;
-
- ------------------------------
- -- Is_Entity_Attribute_Name --
- ------------------------------
-
- function Is_Entity_Attribute_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Entity_Attribute_Name .. Last_Entity_Attribute_Name;
- end Is_Entity_Attribute_Name;
-
- --------------------------------
- -- Is_Function_Attribute_Name --
- --------------------------------
-
- function Is_Function_Attribute_Name (N : Name_Id) return Boolean is
- begin
- return N in
- First_Renamable_Function_Attribute ..
- Last_Renamable_Function_Attribute;
- end Is_Function_Attribute_Name;
-
- ----------------------------
- -- Is_Locking_Policy_Name --
- ----------------------------
-
- function Is_Locking_Policy_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name;
- end Is_Locking_Policy_Name;
-
- -----------------------------
- -- Is_Operator_Symbol_Name --
- -----------------------------
-
- function Is_Operator_Symbol_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Operator_Name .. Last_Operator_Name;
- end Is_Operator_Symbol_Name;
-
- --------------------
- -- Is_Pragma_Name --
- --------------------
-
- function Is_Pragma_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Pragma_Name .. Last_Pragma_Name
- or else N = Name_AST_Entry
- or else N = Name_Storage_Size
- or else N = Name_Storage_Unit;
- end Is_Pragma_Name;
-
- ---------------------------------
- -- Is_Procedure_Attribute_Name --
- ---------------------------------
-
- function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Procedure_Attribute .. Last_Procedure_Attribute;
- end Is_Procedure_Attribute_Name;
-
- ----------------------------
- -- Is_Queuing_Policy_Name --
- ----------------------------
-
- function Is_Queuing_Policy_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Queuing_Policy_Name .. Last_Queuing_Policy_Name;
- end Is_Queuing_Policy_Name;
-
- -------------------------------------
- -- Is_Task_Dispatching_Policy_Name --
- -------------------------------------
-
- function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Task_Dispatching_Policy_Name ..
- Last_Task_Dispatching_Policy_Name;
- end Is_Task_Dispatching_Policy_Name;
-
- ----------------------------
- -- Is_Type_Attribute_Name --
- ----------------------------
-
- function Is_Type_Attribute_Name (N : Name_Id) return Boolean is
- begin
- return N in First_Type_Attribute_Name .. Last_Type_Attribute_Name;
- end Is_Type_Attribute_Name;
-
- ----------------------------------
- -- Record_Convention_Identifier --
- ----------------------------------
-
- procedure Record_Convention_Identifier
- (Id : Name_Id;
- Convention : Convention_Id)
- is
- begin
- Convention_Identifiers.Append ((Id, Convention));
- end Record_Convention_Identifier;
-
-end Snames;
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S N A M E S --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 1992-2005, 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- --
+-- 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. --
+-- --
+------------------------------------------------------------------------------
+
+with Namet; use Namet;
+with Table;
+
+package body Snames is
+
+ -- Table used to record convention identifiers
+
+ type Convention_Id_Entry is record
+ Name : Name_Id;
+ Convention : Convention_Id;
+ end record;
+
+ package Convention_Identifiers is new Table.Table (
+ Table_Component_Type => Convention_Id_Entry,
+ Table_Index_Type => Int,
+ Table_Low_Bound => 1,
+ Table_Initial => 50,
+ Table_Increment => 200,
+ Table_Name => "Name_Convention_Identifiers");
+
+ -- Table of names to be set by Initialize. Each name is terminated by a
+ -- single #, and the end of the list is marked by a null entry, i.e. by
+ -- two # marks in succession. Note that the table does not include the
+ -- entries for a-z, since these are initialized by Namet itself.
+
+ Preset_Names : constant String :=
+ "_parent#" &
+ "_tag#" &
+ "off#" &
+ "space#" &
+ "time#" &
+ "_abort_signal#" &
+ "_alignment#" &
+ "_assign#" &
+ "_atcb#" &
+ "_chain#" &
+ "_clean#" &
+ "_controller#" &
+ "_entry_bodies#" &
+ "_expunge#" &
+ "_final_list#" &
+ "_idepth#" &
+ "_init#" &
+ "_local_final_list#" &
+ "_master#" &
+ "_object#" &
+ "_priority#" &
+ "_process_atsd#" &
+ "_secondary_stack#" &
+ "_service#" &
+ "_size#" &
+ "_stack#" &
+ "_tags#" &
+ "_task#" &
+ "_task_id#" &
+ "_task_info#" &
+ "_task_name#" &
+ "_trace_sp#" &
+ "initialize#" &
+ "adjust#" &
+ "finalize#" &
+ "next#" &
+ "prev#" &
+ "_typecode#" &
+ "_from_any#" &
+ "_to_any#" &
+ "allocate#" &
+ "deallocate#" &
+ "dereference#" &
+ "decimal_io#" &
+ "enumeration_io#" &
+ "fixed_io#" &
+ "float_io#" &
+ "integer_io#" &
+ "modular_io#" &
+ "const#" &
+ "<error>#" &
+ "go#" &
+ "put#" &
+ "put_line#" &
+ "to#" &
+ "finalization#" &
+ "finalization_root#" &
+ "interfaces#" &
+ "standard#" &
+ "system#" &
+ "text_io#" &
+ "wide_text_io#" &
+ "wide_wide_text_io#" &
+ "no_dsa#" &
+ "garlic_dsa#" &
+ "polyorb_dsa#" &
+ "addr#" &
+ "async#" &
+ "get_active_partition_id#" &
+ "get_rci_package_receiver#" &
+ "get_rci_package_ref#" &
+ "origin#" &
+ "params#" &
+ "partition#" &
+ "partition_interface#" &
+ "ras#" &
+ "call#" &
+ "rci_name#" &
+ "receiver#" &
+ "result#" &
+ "rpc#" &
+ "subp_id#" &
+ "operation#" &
+ "argument#" &
+ "arg_modes#" &
+ "handler#" &
+ "target#" &
+ "req#" &
+ "obj_typecode#" &
+ "stub#" &
+ "Oabs#" &
+ "Oand#" &
+ "Omod#" &
+ "Onot#" &
+ "Oor#" &
+ "Orem#" &
+ "Oxor#" &
+ "Oeq#" &
+ "One#" &
+ "Olt#" &
+ "Ole#" &
+ "Ogt#" &
+ "Oge#" &
+ "Oadd#" &
+ "Osubtract#" &
+ "Oconcat#" &
+ "Omultiply#" &
+ "Odivide#" &
+ "Oexpon#" &
+ "ada_83#" &
+ "ada_95#" &
+ "ada_05#" &
+ "c_pass_by_copy#" &
+ "compile_time_warning#" &
+ "component_alignment#" &
+ "convention_identifier#" &
+ "detect_blocking#" &
+ "discard_names#" &
+ "elaboration_checks#" &
+ "eliminate#" &
+ "explicit_overriding#" &
+ "extend_system#" &
+ "extensions_allowed#" &
+ "external_name_casing#" &
+ "float_representation#" &
+ "initialize_scalars#" &
+ "interrupt_state#" &
+ "license#" &
+ "locking_policy#" &
+ "long_float#" &
+ "no_run_time#" &
+ "no_strict_aliasing#" &
+ "normalize_scalars#" &
+ "polling#" &
+ "persistent_data#" &
+ "persistent_object#" &
+ "profile#" &
+ "profile_warnings#" &
+ "propagate_exceptions#" &
+ "queuing_policy#" &
+ "ravenscar#" &
+ "restricted_run_time#" &
+ "restrictions#" &
+ "restriction_warnings#" &
+ "reviewable#" &
+ "source_file_name#" &
+ "source_file_name_project#" &
+ "style_checks#" &
+ "suppress#" &
+ "suppress_exception_locations#" &
+ "task_dispatching_policy#" &
+ "universal_data#" &
+ "unsuppress#" &
+ "use_vads_size#" &
+ "validity_checks#" &
+ "warnings#" &
+ "abort_defer#" &
+ "all_calls_remote#" &
+ "annotate#" &
+ "assert#" &
+ "asynchronous#" &
+ "atomic#" &
+ "atomic_components#" &
+ "attach_handler#" &
+ "comment#" &
+ "common_object#" &
+ "complex_representation#" &
+ "controlled#" &
+ "convention#" &
+ "cpp_class#" &
+ "cpp_constructor#" &
+ "cpp_virtual#" &
+ "cpp_vtable#" &
+ "debug#" &
+ "elaborate#" &
+ "elaborate_all#" &
+ "elaborate_body#" &
+ "export#" &
+ "export_exception#" &
+ "export_function#" &
+ "export_object#" &
+ "export_procedure#" &
+ "export_value#" &
+ "export_valued_procedure#" &
+ "external#" &
+ "finalize_storage_only#" &
+ "ident#" &
+ "import#" &
+ "import_exception#" &
+ "import_function#" &
+ "import_object#" &
+ "import_procedure#" &
+ "import_valued_procedure#" &
+ "inline#" &
+ "inline_always#" &
+ "inline_generic#" &
+ "inspection_point#" &
+ "interface_name#" &
+ "interrupt_handler#" &
+ "interrupt_priority#" &
+ "java_constructor#" &
+ "java_interface#" &
+ "keep_names#" &
+ "link_with#" &
+ "linker_alias#" &
+ "linker_options#" &
+ "linker_section#" &
+ "list#" &
+ "machine_attribute#" &
+ "main#" &
+ "main_storage#" &
+ "memory_size#" &
+ "no_return#" &
+ "obsolescent#" &
+ "optimize#" &
+ "optional_overriding#" &
+ "pack#" &
+ "page#" &
+ "passive#" &
+ "preelaborate#" &
+ "priority#" &
+ "psect_object#" &
+ "pure#" &
+ "pure_function#" &
+ "remote_call_interface#" &
+ "remote_types#" &
+ "share_generic#" &
+ "shared#" &
+ "shared_passive#" &
+ "source_reference#" &
+ "stream_convert#" &
+ "subtitle#" &
+ "suppress_all#" &
+ "suppress_debug_info#" &
+ "suppress_initialization#" &
+ "system_name#" &
+ "task_info#" &
+ "task_name#" &
+ "task_storage#" &
+ "thread_body#" &
+ "time_slice#" &
+ "title#" &
+ "unchecked_union#" &
+ "unimplemented_unit#" &
+ "unreferenced#" &
+ "unreserve_all_interrupts#" &
+ "volatile#" &
+ "volatile_components#" &
+ "weak_external#" &
+ "ada#" &
+ "assembler#" &
+ "cobol#" &
+ "cpp#" &
+ "fortran#" &
+ "intrinsic#" &
+ "java#" &
+ "stdcall#" &
+ "stubbed#" &
+ "asm#" &
+ "assembly#" &
+ "default#" &
+ "dll#" &
+ "win32#" &
+ "as_is#" &
+ "body_file_name#" &
+ "boolean_entry_barriers#" &
+ "casing#" &
+ "code#" &
+ "component#" &
+ "component_size_4#" &
+ "copy#" &
+ "d_float#" &
+ "descriptor#" &
+ "dot_replacement#" &
+ "dynamic#" &
+ "entity#" &
+ "external_name#" &
+ "first_optional_parameter#" &
+ "form#" &
+ "g_float#" &
+ "gcc#" &
+ "gnat#" &
+ "gpl#" &
+ "ieee_float#" &
+ "internal#" &
+ "link_name#" &
+ "lowercase#" &
+ "max_entry_queue_depth#" &
+ "max_entry_queue_length#" &
+ "max_size#" &
+ "mechanism#" &
+ "mixedcase#" &
+ "modified_gpl#" &
+ "name#" &
+ "nca#" &
+ "no#" &
+ "no_dependence#" &
+ "no_dynamic_attachment#" &
+ "no_dynamic_interrupts#" &
+ "no_requeue#" &
+ "no_requeue_statements#" &
+ "no_task_attributes#" &
+ "no_task_attributes_package#" &
+ "on#" &
+ "parameter_types#" &
+ "reference#" &
+ "restricted#" &
+ "result_mechanism#" &
+ "result_type#" &
+ "runtime#" &
+ "sb#" &
+ "secondary_stack_size#" &
+ "section#" &
+ "semaphore#" &
+ "simple_barriers#" &
+ "spec_file_name#" &
+ "static#" &
+ "stack_size#" &
+ "subunit_file_name#" &
+ "task_stack_size_default#" &
+ "task_type#" &
+ "time_slicing_enabled#" &
+ "top_guard#" &
+ "uba#" &
+ "ubs#" &
+ "ubsb#" &
+ "unit_name#" &
+ "unknown#" &
+ "unrestricted#" &
+ "uppercase#" &
+ "user#" &
+ "vax_float#" &
+ "vms#" &
+ "working_storage#" &
+ "abort_signal#" &
+ "access#" &
+ "address#" &
+ "address_size#" &
+ "aft#" &
+ "alignment#" &
+ "asm_input#" &
+ "asm_output#" &
+ "ast_entry#" &
+ "bit#" &
+ "bit_order#" &
+ "bit_position#" &
+ "body_version#" &
+ "callable#" &
+ "caller#" &
+ "code_address#" &
+ "component_size#" &
+ "compose#" &
+ "constrained#" &
+ "count#" &
+ "default_bit_order#" &
+ "definite#" &
+ "delta#" &
+ "denorm#" &
+ "digits#" &
+ "elaborated#" &
+ "emax#" &
+ "enum_rep#" &
+ "epsilon#" &
+ "exponent#" &
+ "external_tag#" &
+ "first#" &
+ "first_bit#" &
+ "fixed_value#" &
+ "fore#" &
+ "has_access_values#" &
+ "has_discriminants#" &
+ "identity#" &
+ "img#" &
+ "integer_value#" &
+ "large#" &
+ "last#" &
+ "last_bit#" &
+ "leading_part#" &
+ "length#" &
+ "machine_emax#" &
+ "machine_emin#" &
+ "machine_mantissa#" &
+ "machine_overflows#" &
+ "machine_radix#" &
+ "machine_rounds#" &
+ "machine_size#" &
+ "mantissa#" &
+ "max_size_in_storage_elements#" &
+ "maximum_alignment#" &
+ "mechanism_code#" &
+ "mod#" &
+ "model_emin#" &
+ "model_epsilon#" &
+ "model_mantissa#" &
+ "model_small#" &
+ "modulus#" &
+ "null_parameter#" &
+ "object_size#" &
+ "partition_id#" &
+ "passed_by_reference#" &
+ "pool_address#" &
+ "pos#" &
+ "position#" &
+ "range#" &
+ "range_length#" &
+ "round#" &
+ "safe_emax#" &
+ "safe_first#" &
+ "safe_large#" &
+ "safe_last#" &
+ "safe_small#" &
+ "scale#" &
+ "scaling#" &
+ "signed_zeros#" &
+ "size#" &
+ "small#" &
+ "storage_size#" &
+ "storage_unit#" &
+ "stream_size#" &
+ "tag#" &
+ "target_name#" &
+ "terminated#" &
+ "to_address#" &
+ "type_class#" &
+ "uet_address#" &
+ "unbiased_rounding#" &
+ "unchecked_access#" &
+ "unconstrained_array#" &
+ "universal_literal_string#" &
+ "unrestricted_access#" &
+ "vads_size#" &
+ "val#" &
+ "valid#" &
+ "value_size#" &
+ "version#" &
+ "wchar_t_size#" &
+ "wide_wide_width#" &
+ "wide_width#" &
+ "width#" &
+ "word_size#" &
+ "adjacent#" &
+ "ceiling#" &
+ "copy_sign#" &
+ "floor#" &
+ "fraction#" &
+ "image#" &
+ "input#" &
+ "machine#" &
+ "max#" &
+ "min#" &
+ "model#" &
+ "pred#" &
+ "remainder#" &
+ "rounding#" &
+ "succ#" &
+ "truncation#" &
+ "value#" &
+ "wide_image#" &
+ "wide_wide_image#" &
+ "wide_value#" &
+ "wide_wide_value#" &
+ "output#" &
+ "read#" &
+ "write#" &
+ "elab_body#" &
+ "elab_spec#" &
+ "storage_pool#" &
+ "base#" &
+ "class#" &
+ "ceiling_locking#" &
+ "inheritance_locking#" &
+ "fifo_queuing#" &
+ "priority_queuing#" &
+ "fifo_within_priorities#" &
+ "access_check#" &
+ "accessibility_check#" &
+ "discriminant_check#" &
+ "division_check#" &
+ "elaboration_check#" &
+ "index_check#" &
+ "length_check#" &
+ "overflow_check#" &
+ "range_check#" &
+ "storage_check#" &
+ "tag_check#" &
+ "all_checks#" &
+ "abort#" &
+ "abs#" &
+ "accept#" &
+ "and#" &
+ "all#" &
+ "array#" &
+ "at#" &
+ "begin#" &
+ "body#" &
+ "case#" &
+ "constant#" &
+ "declare#" &
+ "delay#" &
+ "do#" &
+ "else#" &
+ "elsif#" &
+ "end#" &
+ "entry#" &
+ "exception#" &
+ "exit#" &
+ "for#" &
+ "function#" &
+ "generic#" &
+ "goto#" &
+ "if#" &
+ "in#" &
+ "is#" &
+ "limited#" &
+ "loop#" &
+ "new#" &
+ "not#" &
+ "null#" &
+ "of#" &
+ "or#" &
+ "others#" &
+ "out#" &
+ "package#" &
+ "pragma#" &
+ "private#" &
+ "procedure#" &
+ "raise#" &
+ "record#" &
+ "rem#" &
+ "renames#" &
+ "return#" &
+ "reverse#" &
+ "select#" &
+ "separate#" &
+ "subtype#" &
+ "task#" &
+ "terminate#" &
+ "then#" &
+ "type#" &
+ "use#" &
+ "when#" &
+ "while#" &
+ "with#" &
+ "xor#" &
+ "divide#" &
+ "enclosing_entity#" &
+ "exception_information#" &
+ "exception_message#" &
+ "exception_name#" &
+ "file#" &
+ "import_address#" &
+ "import_largest_value#" &
+ "import_value#" &
+ "is_negative#" &
+ "line#" &
+ "rotate_left#" &
+ "rotate_right#" &
+ "shift_left#" &
+ "shift_right#" &
+ "shift_right_arithmetic#" &
+ "source_location#" &
+ "unchecked_conversion#" &
+ "unchecked_deallocation#" &
+ "to_pointer#" &
+ "abstract#" &
+ "aliased#" &
+ "protected#" &
+ "until#" &
+ "requeue#" &
+ "tagged#" &
+ "raise_exception#" &
+ "ada_roots#" &
+ "binder#" &
+ "binder_driver#" &
+ "body_suffix#" &
+ "builder#" &
+ "compiler#" &
+ "compiler_driver#" &
+ "compiler_kind#" &
+ "compute_dependency#" &
+ "cross_reference#" &
+ "default_linker#" &
+ "default_switches#" &
+ "dependency_option#" &
+ "exec_dir#" &
+ "executable#" &
+ "executable_suffix#" &
+ "extends#" &
+ "externally_built#" &
+ "finder#" &
+ "global_configuration_pragmas#" &
+ "gnatls#" &
+ "gnatstub#" &
+ "implementation#" &
+ "implementation_exceptions#" &
+ "implementation_suffix#" &
+ "include_option#" &
+ "language_processing#" &
+ "languages#" &
+ "library_dir#" &
+ "library_auto_init#" &
+ "library_gcc#" &
+ "library_interface#" &
+ "library_kind#" &
+ "library_name#" &
+ "library_options#" &
+ "library_reference_symbol_file#" &
+ "library_src_dir#" &
+ "library_symbol_file#" &
+ "library_symbol_policy#" &
+ "library_version#" &
+ "linker#" &
+ "local_configuration_pragmas#" &
+ "locally_removed_files#" &
+ "metrics#" &
+ "naming#" &
+ "object_dir#" &
+ "pretty_printer#" &
+ "project#" &
+ "separate_suffix#" &
+ "source_dirs#" &
+ "source_files#" &
+ "source_list_file#" &
+ "spec#" &
+ "spec_suffix#" &
+ "specification#" &
+ "specification_exceptions#" &
+ "specification_suffix#" &
+ "switches#" &
+ "unaligned_valid#" &
+ "interface#" &
+ "overriding#" &
+ "synchronized#" &
+ "#";
+
+ ---------------------
+ -- Generated Names --
+ ---------------------
+
+ -- This section lists the various cases of generated names which are
+ -- built from existing names by adding unique leading and/or trailing
+ -- upper case letters. In some cases these names are built recursively,
+ -- in particular names built from types may be built from types which
+ -- themselves have generated names. In this list, xxx represents an
+ -- existing name to which identifying letters are prepended or appended,
+ -- and a trailing n represents a serial number in an external name that
+ -- has some semantic significance (e.g. the n'th index type of an array).
+
+ -- xxxA access type for formal xxx in entry param record (Exp_Ch9)
+ -- xxxB tag table for tagged type xxx (Exp_Ch3)
+ -- xxxB task body procedure for task xxx (Exp_Ch9)
+ -- xxxD dispatch table for tagged type xxx (Exp_Ch3)
+ -- xxxD discriminal for discriminant xxx (Sem_Ch3)
+ -- xxxDn n'th discr check function for rec type xxx (Exp_Ch3)
+ -- xxxE elaboration boolean flag for task xxx (Exp_Ch9)
+ -- xxxE dispatch table pointer type for tagged type xxx (Exp_Ch3)
+ -- xxxE parameters for accept body for entry xxx (Exp_Ch9)
+ -- xxxFn n'th primitive of a tagged type (named xxx) (Exp_Ch3)
+ -- xxxJ tag table type index for tagged type xxx (Exp_Ch3)
+ -- xxxM master Id value for access type xxx (Exp_Ch3)
+ -- xxxP tag table pointer type for tagged type xxx (Exp_Ch3)
+ -- xxxP parameter record type for entry xxx (Exp_Ch9)
+ -- xxxPA access to parameter record type for entry xxx (Exp_Ch9)
+ -- xxxPn pointer type for n'th primitive of tagged type xxx (Exp_Ch3)
+ -- xxxR dispatch table pointer for tagged type xxx (Exp_Ch3)
+ -- xxxT tag table type for tagged type xxx (Exp_Ch3)
+ -- xxxT literal table for enumeration type xxx (Sem_Ch3)
+ -- xxxV type for task value record for task xxx (Exp_Ch9)
+ -- xxxX entry index constant (Exp_Ch9)
+ -- xxxY dispatch table type for tagged type xxx (Exp_Ch3)
+ -- xxxZ size variable for task xxx (Exp_Ch9)
+
+ -- TSS names
+
+ -- xxxDA deep adjust routine for type xxx (Exp_TSS)
+ -- xxxDF deep finalize routine for type xxx (Exp_TSS)
+ -- xxxDI deep initialize routine for type xxx (Exp_TSS)
+ -- xxxEQ composite equality routine for record type xxx (Exp_TSS)
+ -- xxxIP initialization procedure for type xxx (Exp_TSS)
+ -- xxxRA RAs type access routine for type xxx (Exp_TSS)
+ -- xxxRD RAs type dereference routine for type xxx (Exp_TSS)
+ -- xxxRP Rep to Pos conversion for enumeration type xxx (Exp_TSS)
+ -- xxxSA array/slice assignment for controlled comp. arrays (Exp_TSS)
+ -- xxxSI stream input attribute subprogram for type xxx (Exp_TSS)
+ -- xxxSO stream output attribute subprogram for type xxx (Exp_TSS)
+ -- xxxSR stream read attribute subprogram for type xxx (Exp_TSS)
+ -- xxxSW stream write attribute subprogram for type xxx (Exp_TSS)
+
+ -- Implicit type names
+
+ -- TxxxT type of literal table for enumeration type xxx (Sem_Ch3)
+
+ -- (Note: this list is not complete or accurate ???)
+
+ ----------------------
+ -- Get_Attribute_Id --
+ ----------------------
+
+ function Get_Attribute_Id (N : Name_Id) return Attribute_Id is
+ begin
+ return Attribute_Id'Val (N - First_Attribute_Name);
+ end Get_Attribute_Id;
+
+ ------------------
+ -- Get_Check_Id --
+ ------------------
+
+ function Get_Check_Id (N : Name_Id) return Check_Id is
+ begin
+ return Check_Id'Val (N - First_Check_Name);
+ end Get_Check_Id;
+
+ -----------------------
+ -- Get_Convention_Id --
+ -----------------------
+
+ function Get_Convention_Id (N : Name_Id) return Convention_Id is
+ begin
+ case N is
+ when Name_Ada => return Convention_Ada;
+ when Name_Assembler => return Convention_Assembler;
+ when Name_C => return Convention_C;
+ when Name_COBOL => return Convention_COBOL;
+ when Name_CPP => return Convention_CPP;
+ when Name_Fortran => return Convention_Fortran;
+ when Name_Intrinsic => return Convention_Intrinsic;
+ when Name_Java => return Convention_Java;
+ when Name_Stdcall => return Convention_Stdcall;
+ when Name_Stubbed => return Convention_Stubbed;
+
+ -- If no direct match, then we must have a convention
+ -- identifier pragma that has specified this name.
+
+ when others =>
+ for J in 1 .. Convention_Identifiers.Last loop
+ if N = Convention_Identifiers.Table (J).Name then
+ return Convention_Identifiers.Table (J).Convention;
+ end if;
+ end loop;
+
+ raise Program_Error;
+ end case;
+ end Get_Convention_Id;
+
+ ---------------------------
+ -- Get_Locking_Policy_Id --
+ ---------------------------
+
+ function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id is
+ begin
+ return Locking_Policy_Id'Val (N - First_Locking_Policy_Name);
+ end Get_Locking_Policy_Id;
+
+ -------------------
+ -- Get_Pragma_Id --
+ -------------------
+
+ function Get_Pragma_Id (N : Name_Id) return Pragma_Id is
+ begin
+ if N = Name_AST_Entry then
+ return Pragma_AST_Entry;
+ elsif N = Name_Interface then
+ return Pragma_Interface;
+ elsif N = Name_Storage_Size then
+ return Pragma_Storage_Size;
+ elsif N = Name_Storage_Unit then
+ return Pragma_Storage_Unit;
+ elsif N not in First_Pragma_Name .. Last_Pragma_Name then
+ return Unknown_Pragma;
+ else
+ return Pragma_Id'Val (N - First_Pragma_Name);
+ end if;
+ end Get_Pragma_Id;
+
+ ---------------------------
+ -- Get_Queuing_Policy_Id --
+ ---------------------------
+
+ function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id is
+ begin
+ return Queuing_Policy_Id'Val (N - First_Queuing_Policy_Name);
+ end Get_Queuing_Policy_Id;
+
+ ------------------------------------
+ -- Get_Task_Dispatching_Policy_Id --
+ ------------------------------------
+
+ function Get_Task_Dispatching_Policy_Id (N : Name_Id)
+ return Task_Dispatching_Policy_Id is
+ begin
+ return Task_Dispatching_Policy_Id'Val
+ (N - First_Task_Dispatching_Policy_Name);
+ end Get_Task_Dispatching_Policy_Id;
+
+ ----------------
+ -- Initialize --
+ ----------------
+
+ procedure Initialize is
+ P_Index : Natural;
+ Discard_Name : Name_Id;
+
+ begin
+ P_Index := Preset_Names'First;
+
+ loop
+ Name_Len := 0;
+
+ while Preset_Names (P_Index) /= '#' loop
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) := Preset_Names (P_Index);
+ P_Index := P_Index + 1;
+ end loop;
+
+ -- We do the Name_Find call to enter the name into the table, but
+ -- we don't need to do anything with the result, since we already
+ -- initialized all the preset names to have the right value (we
+ -- are depending on the order of the names and Preset_Names).
+
+ Discard_Name := Name_Find;
+ P_Index := P_Index + 1;
+ exit when Preset_Names (P_Index) = '#';
+ end loop;
+
+ -- Make sure that number of names in standard table is correct. If
+ -- this check fails, run utility program XSNAMES to construct a new
+ -- properly matching version of the body.
+
+ pragma Assert (Discard_Name = Last_Predefined_Name);
+
+ -- Initialize the convention identifiers table with the standard
+ -- set of synonyms that we recognize for conventions.
+
+ Convention_Identifiers.Init;
+
+ Convention_Identifiers.Append ((Name_Asm, Convention_Assembler));
+ Convention_Identifiers.Append ((Name_Assembly, Convention_Assembler));
+
+ Convention_Identifiers.Append ((Name_Default, Convention_C));
+ Convention_Identifiers.Append ((Name_External, Convention_C));
+
+ Convention_Identifiers.Append ((Name_DLL, Convention_Stdcall));
+ Convention_Identifiers.Append ((Name_Win32, Convention_Stdcall));
+ end Initialize;
+
+ -----------------------
+ -- Is_Attribute_Name --
+ -----------------------
+
+ function Is_Attribute_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Attribute_Name .. Last_Attribute_Name;
+ end Is_Attribute_Name;
+
+ -------------------
+ -- Is_Check_Name --
+ -------------------
+
+ function Is_Check_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Check_Name .. Last_Check_Name;
+ end Is_Check_Name;
+
+ ------------------------
+ -- Is_Convention_Name --
+ ------------------------
+
+ function Is_Convention_Name (N : Name_Id) return Boolean is
+ begin
+ -- Check if this is one of the standard conventions
+
+ if N in First_Convention_Name .. Last_Convention_Name
+ or else N = Name_C
+ then
+ return True;
+
+ -- Otherwise check if it is in convention identifier table
+
+ else
+ for J in 1 .. Convention_Identifiers.Last loop
+ if N = Convention_Identifiers.Table (J).Name then
+ return True;
+ end if;
+ end loop;
+
+ return False;
+ end if;
+ end Is_Convention_Name;
+
+ ------------------------------
+ -- Is_Entity_Attribute_Name --
+ ------------------------------
+
+ function Is_Entity_Attribute_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Entity_Attribute_Name .. Last_Entity_Attribute_Name;
+ end Is_Entity_Attribute_Name;
+
+ --------------------------------
+ -- Is_Function_Attribute_Name --
+ --------------------------------
+
+ function Is_Function_Attribute_Name (N : Name_Id) return Boolean is
+ begin
+ return N in
+ First_Renamable_Function_Attribute ..
+ Last_Renamable_Function_Attribute;
+ end Is_Function_Attribute_Name;
+
+ ----------------------------
+ -- Is_Locking_Policy_Name --
+ ----------------------------
+
+ function Is_Locking_Policy_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Locking_Policy_Name .. Last_Locking_Policy_Name;
+ end Is_Locking_Policy_Name;
+
+ -----------------------------
+ -- Is_Operator_Symbol_Name --
+ -----------------------------
+
+ function Is_Operator_Symbol_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Operator_Name .. Last_Operator_Name;
+ end Is_Operator_Symbol_Name;
+
+ --------------------
+ -- Is_Pragma_Name --
+ --------------------
+
+ function Is_Pragma_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Pragma_Name .. Last_Pragma_Name
+ or else N = Name_AST_Entry
+ or else N = Name_Interface
+ or else N = Name_Storage_Size
+ or else N = Name_Storage_Unit;
+ end Is_Pragma_Name;
+
+ ---------------------------------
+ -- Is_Procedure_Attribute_Name --
+ ---------------------------------
+
+ function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Procedure_Attribute .. Last_Procedure_Attribute;
+ end Is_Procedure_Attribute_Name;
+
+ ----------------------------
+ -- Is_Queuing_Policy_Name --
+ ----------------------------
+
+ function Is_Queuing_Policy_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Queuing_Policy_Name .. Last_Queuing_Policy_Name;
+ end Is_Queuing_Policy_Name;
+
+ -------------------------------------
+ -- Is_Task_Dispatching_Policy_Name --
+ -------------------------------------
+
+ function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Task_Dispatching_Policy_Name ..
+ Last_Task_Dispatching_Policy_Name;
+ end Is_Task_Dispatching_Policy_Name;
+
+ ----------------------------
+ -- Is_Type_Attribute_Name --
+ ----------------------------
+
+ function Is_Type_Attribute_Name (N : Name_Id) return Boolean is
+ begin
+ return N in First_Type_Attribute_Name .. Last_Type_Attribute_Name;
+ end Is_Type_Attribute_Name;
+
+ ----------------------------------
+ -- Record_Convention_Identifier --
+ ----------------------------------
+
+ procedure Record_Convention_Identifier
+ (Id : Name_Id;
+ Convention : Convention_Id)
+ is
+ begin
+ Convention_Identifiers.Append ((Id, Convention));
+ end Record_Convention_Identifier;
+
+end Snames;
diff --git a/gcc/ada/snames.ads b/gcc/ada/snames.ads
index 5d4800752d3..85c2f467cf0 100644
--- a/gcc/ada/snames.ads
+++ b/gcc/ada/snames.ads
@@ -1,1485 +1,1496 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- S N A M E S --
--- --
--- S p e c --
--- --
--- Copyright (C) 1992-2004, 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- --
--- 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. --
--- --
-------------------------------------------------------------------------------
-
-with Types; use Types;
-
-package Snames is
-
--- This package contains definitions of standard names (i.e. entries in the
--- Names table) that are used throughout the GNAT compiler). It also contains
--- the definitions of some enumeration types whose definitions are tied to
--- the order of these preset names.
-
--- WARNING: There is a C file, a-snames.h which duplicates some of the
--- definitions in this file and must be kept properly synchronized.
-
- ------------------
- -- Preset Names --
- ------------------
-
- -- The following are preset entries in the names table, which are
- -- entered at the start of every compilation for easy access. Note
- -- that the order of initialization of these names in the body must
- -- be coordinated with the order of names in this table.
-
- -- Note: a name may not appear more than once in the following list.
- -- If additional pragmas or attributes are introduced which might
- -- otherwise cause a duplicate, then list it only once in this table,
- -- and adjust the definition of the functions for testing for pragma
- -- names and attribute names, and returning their ID values. Of course
- -- everything is simpler if no such duplications occur!
-
- -- First we have the one character names used to optimize the lookup
- -- process for one character identifiers (to avoid the hashing in this
- -- case) There are a full 256 of these, but only the entries for lower
- -- case and upper case letters have identifiers
-
- -- The lower case letter entries are used for one character identifiers
- -- appearing in the source, for example in pragma Interface (C).
-
- Name_A : constant Name_Id := First_Name_Id + Character'Pos ('a');
- Name_B : constant Name_Id := First_Name_Id + Character'Pos ('b');
- Name_C : constant Name_Id := First_Name_Id + Character'Pos ('c');
- Name_D : constant Name_Id := First_Name_Id + Character'Pos ('d');
- Name_E : constant Name_Id := First_Name_Id + Character'Pos ('e');
- Name_F : constant Name_Id := First_Name_Id + Character'Pos ('f');
- Name_G : constant Name_Id := First_Name_Id + Character'Pos ('g');
- Name_H : constant Name_Id := First_Name_Id + Character'Pos ('h');
- Name_I : constant Name_Id := First_Name_Id + Character'Pos ('i');
- Name_J : constant Name_Id := First_Name_Id + Character'Pos ('j');
- Name_K : constant Name_Id := First_Name_Id + Character'Pos ('k');
- Name_L : constant Name_Id := First_Name_Id + Character'Pos ('l');
- Name_M : constant Name_Id := First_Name_Id + Character'Pos ('m');
- Name_N : constant Name_Id := First_Name_Id + Character'Pos ('n');
- Name_O : constant Name_Id := First_Name_Id + Character'Pos ('o');
- Name_P : constant Name_Id := First_Name_Id + Character'Pos ('p');
- Name_Q : constant Name_Id := First_Name_Id + Character'Pos ('q');
- Name_R : constant Name_Id := First_Name_Id + Character'Pos ('r');
- Name_S : constant Name_Id := First_Name_Id + Character'Pos ('s');
- Name_T : constant Name_Id := First_Name_Id + Character'Pos ('t');
- Name_U : constant Name_Id := First_Name_Id + Character'Pos ('u');
- Name_V : constant Name_Id := First_Name_Id + Character'Pos ('v');
- Name_W : constant Name_Id := First_Name_Id + Character'Pos ('w');
- Name_X : constant Name_Id := First_Name_Id + Character'Pos ('x');
- Name_Y : constant Name_Id := First_Name_Id + Character'Pos ('y');
- Name_Z : constant Name_Id := First_Name_Id + Character'Pos ('z');
-
- -- The upper case letter entries are used by expander code for local
- -- variables that do not require unique names (e.g. formal parameter
- -- names in constructed procedures)
-
- Name_uA : constant Name_Id := First_Name_Id + Character'Pos ('A');
- Name_uB : constant Name_Id := First_Name_Id + Character'Pos ('B');
- Name_uC : constant Name_Id := First_Name_Id + Character'Pos ('C');
- Name_uD : constant Name_Id := First_Name_Id + Character'Pos ('D');
- Name_uE : constant Name_Id := First_Name_Id + Character'Pos ('E');
- Name_uF : constant Name_Id := First_Name_Id + Character'Pos ('F');
- Name_uG : constant Name_Id := First_Name_Id + Character'Pos ('G');
- Name_uH : constant Name_Id := First_Name_Id + Character'Pos ('H');
- Name_uI : constant Name_Id := First_Name_Id + Character'Pos ('I');
- Name_uJ : constant Name_Id := First_Name_Id + Character'Pos ('J');
- Name_uK : constant Name_Id := First_Name_Id + Character'Pos ('K');
- Name_uL : constant Name_Id := First_Name_Id + Character'Pos ('L');
- Name_uM : constant Name_Id := First_Name_Id + Character'Pos ('M');
- Name_uN : constant Name_Id := First_Name_Id + Character'Pos ('N');
- Name_uO : constant Name_Id := First_Name_Id + Character'Pos ('O');
- Name_uP : constant Name_Id := First_Name_Id + Character'Pos ('P');
- Name_uQ : constant Name_Id := First_Name_Id + Character'Pos ('Q');
- Name_uR : constant Name_Id := First_Name_Id + Character'Pos ('R');
- Name_uS : constant Name_Id := First_Name_Id + Character'Pos ('S');
- Name_uT : constant Name_Id := First_Name_Id + Character'Pos ('T');
- Name_uU : constant Name_Id := First_Name_Id + Character'Pos ('U');
- Name_uV : constant Name_Id := First_Name_Id + Character'Pos ('V');
- Name_uW : constant Name_Id := First_Name_Id + Character'Pos ('W');
- Name_uX : constant Name_Id := First_Name_Id + Character'Pos ('X');
- Name_uY : constant Name_Id := First_Name_Id + Character'Pos ('Y');
- Name_uZ : constant Name_Id := First_Name_Id + Character'Pos ('Z');
-
- -- Note: the following table is read by the utility program XSNAMES and
- -- its format should not be changed without coordinating with this program.
-
- N : constant Name_Id := First_Name_Id + 256;
- -- Synonym used in standard name definitions
-
- -- Some names that are used by gigi, and whose definitions are reflected
- -- in the C header file a-snames.h. They are placed at the start so that
- -- the need to modify a-snames.h is minimized.
-
- Name_uParent : constant Name_Id := N + 000;
- Name_uTag : constant Name_Id := N + 001;
- Name_Off : constant Name_Id := N + 002;
- Name_Space : constant Name_Id := N + 003;
- Name_Time : constant Name_Id := N + 004;
-
- -- Some special names used by the expander. Note that the lower case u's
- -- at the start of these names get translated to extra underscores. These
- -- names are only referenced internally by expander generated code.
-
- Name_uAbort_Signal : constant Name_Id := N + 005;
- Name_uAlignment : constant Name_Id := N + 006;
- Name_uAssign : constant Name_Id := N + 007;
- Name_uATCB : constant Name_Id := N + 008;
- Name_uChain : constant Name_Id := N + 009;
- Name_uClean : constant Name_Id := N + 010;
- Name_uController : constant Name_Id := N + 011;
- Name_uEntry_Bodies : constant Name_Id := N + 012;
- Name_uExpunge : constant Name_Id := N + 013;
- Name_uFinal_List : constant Name_Id := N + 014;
- Name_uIdepth : constant Name_Id := N + 015;
- Name_uInit : constant Name_Id := N + 016;
- Name_uLocal_Final_List : constant Name_Id := N + 017;
- Name_uMaster : constant Name_Id := N + 018;
- Name_uObject : constant Name_Id := N + 019;
- Name_uPriority : constant Name_Id := N + 020;
- Name_uProcess_ATSD : constant Name_Id := N + 021;
- Name_uSecondary_Stack : constant Name_Id := N + 022;
- Name_uService : constant Name_Id := N + 023;
- Name_uSize : constant Name_Id := N + 024;
- Name_uStack : constant Name_Id := N + 025;
- Name_uTags : constant Name_Id := N + 026;
- Name_uTask : constant Name_Id := N + 027;
- Name_uTask_Id : constant Name_Id := N + 028;
- Name_uTask_Info : constant Name_Id := N + 029;
- Name_uTask_Name : constant Name_Id := N + 030;
- Name_uTrace_Sp : constant Name_Id := N + 031;
-
- -- Names of routines in Ada.Finalization, needed by expander
-
- Name_Initialize : constant Name_Id := N + 032;
- Name_Adjust : constant Name_Id := N + 033;
- Name_Finalize : constant Name_Id := N + 034;
-
- -- Names of fields declared in System.Finalization_Implementation,
- -- needed by the expander when generating code for finalization.
-
- Name_Next : constant Name_Id := N + 035;
- Name_Prev : constant Name_Id := N + 036;
-
- -- Names of TSS routines for implementation of DSA over PolyORB
-
- Name_uTypeCode : constant Name_Id := N + 037;
- Name_uFrom_Any : constant Name_Id := N + 038;
- Name_uTo_Any : constant Name_Id := N + 039;
-
- -- Names of allocation routines, also needed by expander
-
- Name_Allocate : constant Name_Id := N + 040;
- Name_Deallocate : constant Name_Id := N + 041;
- Name_Dereference : constant Name_Id := N + 042;
-
- -- Names of Text_IO generic subpackages (see Rtsfind.Text_IO_Kludge)
-
- First_Text_IO_Package : constant Name_Id := N + 043;
- Name_Decimal_IO : constant Name_Id := N + 043;
- Name_Enumeration_IO : constant Name_Id := N + 044;
- Name_Fixed_IO : constant Name_Id := N + 045;
- Name_Float_IO : constant Name_Id := N + 046;
- Name_Integer_IO : constant Name_Id := N + 047;
- Name_Modular_IO : constant Name_Id := N + 048;
- Last_Text_IO_Package : constant Name_Id := N + 048;
-
- subtype Text_IO_Package_Name is Name_Id
- range First_Text_IO_Package .. Last_Text_IO_Package;
-
- -- Names of files in library for Ada.Text_IO and Ada.Wide_Text_IO
-
- Name_a_textio : constant Name_Id := N + 049;
- Name_a_witeio : constant Name_Id := N + 050;
-
- -- Some miscellaneous names used for error detection/recovery
-
- Name_Const : constant Name_Id := N + 051;
- Name_Error : constant Name_Id := N + 052;
- Name_Go : constant Name_Id := N + 053;
- Name_Put : constant Name_Id := N + 054;
- Name_Put_Line : constant Name_Id := N + 055;
- Name_To : constant Name_Id := N + 056;
-
- -- Names for packages that are treated specially by the compiler
-
- Name_Finalization : constant Name_Id := N + 057;
- Name_Finalization_Root : constant Name_Id := N + 058;
- Name_Interfaces : constant Name_Id := N + 059;
- Name_Standard : constant Name_Id := N + 060;
- Name_System : constant Name_Id := N + 061;
- Name_Text_IO : constant Name_Id := N + 062;
- Name_Wide_Text_IO : constant Name_Id := N + 063;
-
- -- Names of implementations of the distributed systems annex
-
- First_PCS_Name : constant Name_Id := N + 064;
- Name_No_DSA : constant Name_Id := N + 064;
- Name_GARLIC_DSA : constant Name_Id := N + 065;
- Name_PolyORB_DSA : constant Name_Id := N + 066;
- Last_PCS_Name : constant Name_Id := N + 066;
-
- subtype PCS_Names is Name_Id
- range First_PCS_Name .. Last_PCS_Name;
-
- -- Names of identifiers used in expanding distribution stubs
-
- Name_Addr : constant Name_Id := N + 067;
- Name_Async : constant Name_Id := N + 068;
- Name_Get_Active_Partition_ID : constant Name_Id := N + 069;
- Name_Get_RCI_Package_Receiver : constant Name_Id := N + 070;
- Name_Get_RCI_Package_Ref : constant Name_Id := N + 071;
- Name_Origin : constant Name_Id := N + 072;
- Name_Params : constant Name_Id := N + 073;
- Name_Partition : constant Name_Id := N + 074;
- Name_Partition_Interface : constant Name_Id := N + 075;
- Name_Ras : constant Name_Id := N + 076;
- Name_Call : constant Name_Id := N + 077;
- Name_RCI_Name : constant Name_Id := N + 078;
- Name_Receiver : constant Name_Id := N + 079;
- Name_Result : constant Name_Id := N + 080;
- Name_Rpc : constant Name_Id := N + 081;
- Name_Subp_Id : constant Name_Id := N + 082;
- Name_Operation : constant Name_Id := N + 083;
- Name_Argument : constant Name_Id := N + 084;
- Name_Arg_Modes : constant Name_Id := N + 085;
- Name_Handler : constant Name_Id := N + 086;
- Name_Target : constant Name_Id := N + 087;
- Name_Req : constant Name_Id := N + 088;
- Name_Obj_TypeCode : constant Name_Id := N + 089;
- Name_Stub : constant Name_Id := N + 090;
-
- -- Operator Symbol entries. The actual names have an upper case O at
- -- the start in place of the Op_ prefix (e.g. the actual name that
- -- corresponds to Name_Op_Abs is "Oabs".
-
- First_Operator_Name : constant Name_Id := N + 091;
- Name_Op_Abs : constant Name_Id := N + 091; -- "abs"
- Name_Op_And : constant Name_Id := N + 092; -- "and"
- Name_Op_Mod : constant Name_Id := N + 093; -- "mod"
- Name_Op_Not : constant Name_Id := N + 094; -- "not"
- Name_Op_Or : constant Name_Id := N + 095; -- "or"
- Name_Op_Rem : constant Name_Id := N + 096; -- "rem"
- Name_Op_Xor : constant Name_Id := N + 097; -- "xor"
- Name_Op_Eq : constant Name_Id := N + 098; -- "="
- Name_Op_Ne : constant Name_Id := N + 099; -- "/="
- Name_Op_Lt : constant Name_Id := N + 100; -- "<"
- Name_Op_Le : constant Name_Id := N + 101; -- "<="
- Name_Op_Gt : constant Name_Id := N + 102; -- ">"
- Name_Op_Ge : constant Name_Id := N + 103; -- ">="
- Name_Op_Add : constant Name_Id := N + 104; -- "+"
- Name_Op_Subtract : constant Name_Id := N + 105; -- "-"
- Name_Op_Concat : constant Name_Id := N + 106; -- "&"
- Name_Op_Multiply : constant Name_Id := N + 107; -- "*"
- Name_Op_Divide : constant Name_Id := N + 108; -- "/"
- Name_Op_Expon : constant Name_Id := N + 109; -- "**"
- Last_Operator_Name : constant Name_Id := N + 109;
-
- -- Names for all pragmas recognized by GNAT. The entries with the comment
- -- "Ada 83" are pragmas that are defined in Ada 83, but not in Ada 95.
- -- These pragmas are fully implemented in both Ada 83 and Ada 95 modes
- -- in GNAT.
-
- -- The entries marked GNAT are pragmas that are defined by GNAT
- -- and implemented in both Ada 83 and Ada 95 modes. Full descriptions
- -- of these implementation dependent pragmas may be found in the
- -- appropriate section in unit Sem_Prag in file sem-prag.adb.
-
- -- The entries marked Ada05 are technically implementation dependent
- -- pragmas, but they correspond to standard proposals for Ada 2005.
-
- -- The entries marked VMS are VMS specific pragmas that are recognized
- -- only in OpenVMS versions of GNAT. They are ignored in other versions
- -- with an appropriate warning.
-
- -- The entries marked AAMP are AAMP specific pragmas that are recognized
- -- only in GNAT for the AAMP. They are ignored in other versions with
- -- appropriate warnings.
-
- First_Pragma_Name : constant Name_Id := N + 110;
-
- -- Configuration pragmas are grouped at start
-
- Name_Ada_83 : constant Name_Id := N + 110; -- GNAT
- Name_Ada_95 : constant Name_Id := N + 111; -- GNAT
- Name_Ada_05 : constant Name_Id := N + 112; -- GNAT
- Name_C_Pass_By_Copy : constant Name_Id := N + 113; -- GNAT
- Name_Compile_Time_Warning : constant Name_Id := N + 114; -- GNAT
- Name_Component_Alignment : constant Name_Id := N + 115; -- GNAT
- Name_Convention_Identifier : constant Name_Id := N + 116; -- GNAT
- Name_Detect_Blocking : constant Name_Id := N + 117; -- Ada05
- Name_Discard_Names : constant Name_Id := N + 118;
- Name_Elaboration_Checks : constant Name_Id := N + 119; -- GNAT
- Name_Eliminate : constant Name_Id := N + 120; -- GNAT
- Name_Explicit_Overriding : constant Name_Id := N + 121;
- Name_Extend_System : constant Name_Id := N + 122; -- GNAT
- Name_Extensions_Allowed : constant Name_Id := N + 123; -- GNAT
- Name_External_Name_Casing : constant Name_Id := N + 124; -- GNAT
- Name_Float_Representation : constant Name_Id := N + 125; -- GNAT
- Name_Initialize_Scalars : constant Name_Id := N + 126; -- GNAT
- Name_Interrupt_State : constant Name_Id := N + 127; -- GNAT
- Name_License : constant Name_Id := N + 128; -- GNAT
- Name_Locking_Policy : constant Name_Id := N + 129;
- Name_Long_Float : constant Name_Id := N + 130; -- VMS
- Name_No_Run_Time : constant Name_Id := N + 131; -- GNAT
- Name_No_Strict_Aliasing : constant Name_Id := N + 132; -- GNAT
- Name_Normalize_Scalars : constant Name_Id := N + 133;
- Name_Polling : constant Name_Id := N + 134; -- GNAT
- Name_Persistent_Data : constant Name_Id := N + 135; -- GNAT
- Name_Persistent_Object : constant Name_Id := N + 136; -- GNAT
- Name_Profile : constant Name_Id := N + 137; -- Ada05
- Name_Profile_Warnings : constant Name_Id := N + 138; -- GNAT
- Name_Propagate_Exceptions : constant Name_Id := N + 139; -- GNAT
- Name_Queuing_Policy : constant Name_Id := N + 140;
- Name_Ravenscar : constant Name_Id := N + 141;
- Name_Restricted_Run_Time : constant Name_Id := N + 142;
- Name_Restrictions : constant Name_Id := N + 143;
- Name_Restriction_Warnings : constant Name_Id := N + 144; -- GNAT
- Name_Reviewable : constant Name_Id := N + 145;
- Name_Source_File_Name : constant Name_Id := N + 146; -- GNAT
- Name_Source_File_Name_Project : constant Name_Id := N + 147; -- GNAT
- Name_Style_Checks : constant Name_Id := N + 148; -- GNAT
- Name_Suppress : constant Name_Id := N + 149;
- Name_Suppress_Exception_Locations : constant Name_Id := N + 150; -- GNAT
- Name_Task_Dispatching_Policy : constant Name_Id := N + 151;
- Name_Universal_Data : constant Name_Id := N + 152; -- AAMP
- Name_Unsuppress : constant Name_Id := N + 153; -- GNAT
- Name_Use_VADS_Size : constant Name_Id := N + 154; -- GNAT
- Name_Validity_Checks : constant Name_Id := N + 155; -- GNAT
- Name_Warnings : constant Name_Id := N + 156; -- GNAT
- Last_Configuration_Pragma_Name : constant Name_Id := N + 156;
-
- -- Remaining pragma names
-
- Name_Abort_Defer : constant Name_Id := N + 157; -- GNAT
- Name_All_Calls_Remote : constant Name_Id := N + 158;
- Name_Annotate : constant Name_Id := N + 159; -- GNAT
-
- -- Note: AST_Entry is not in this list because its name matches the
- -- name of the corresponding attribute. However, it is included in the
- -- definition of the type Attribute_Id, and the functions Get_Pragma_Id
- -- and Check_Pragma_Id correctly recognize and process Name_AST_Entry.
- -- AST_Entry is a VMS specific pragma.
-
- Name_Assert : constant Name_Id := N + 160; -- GNAT
- Name_Asynchronous : constant Name_Id := N + 161;
- Name_Atomic : constant Name_Id := N + 162;
- Name_Atomic_Components : constant Name_Id := N + 163;
- Name_Attach_Handler : constant Name_Id := N + 164;
- Name_Comment : constant Name_Id := N + 165; -- GNAT
- Name_Common_Object : constant Name_Id := N + 166; -- GNAT
- Name_Complex_Representation : constant Name_Id := N + 167; -- GNAT
- Name_Controlled : constant Name_Id := N + 168;
- Name_Convention : constant Name_Id := N + 169;
- Name_CPP_Class : constant Name_Id := N + 170; -- GNAT
- Name_CPP_Constructor : constant Name_Id := N + 171; -- GNAT
- Name_CPP_Virtual : constant Name_Id := N + 172; -- GNAT
- Name_CPP_Vtable : constant Name_Id := N + 173; -- GNAT
- Name_Debug : constant Name_Id := N + 174; -- GNAT
- Name_Elaborate : constant Name_Id := N + 175; -- Ada 83
- Name_Elaborate_All : constant Name_Id := N + 176;
- Name_Elaborate_Body : constant Name_Id := N + 177;
- Name_Export : constant Name_Id := N + 178;
- Name_Export_Exception : constant Name_Id := N + 179; -- VMS
- Name_Export_Function : constant Name_Id := N + 180; -- GNAT
- Name_Export_Object : constant Name_Id := N + 181; -- GNAT
- Name_Export_Procedure : constant Name_Id := N + 182; -- GNAT
- Name_Export_Value : constant Name_Id := N + 183; -- GNAT
- Name_Export_Valued_Procedure : constant Name_Id := N + 184; -- GNAT
- Name_External : constant Name_Id := N + 185; -- GNAT
- Name_Finalize_Storage_Only : constant Name_Id := N + 186; -- GNAT
- Name_Ident : constant Name_Id := N + 187; -- VMS
- Name_Import : constant Name_Id := N + 188;
- Name_Import_Exception : constant Name_Id := N + 189; -- VMS
- Name_Import_Function : constant Name_Id := N + 190; -- GNAT
- Name_Import_Object : constant Name_Id := N + 191; -- GNAT
- Name_Import_Procedure : constant Name_Id := N + 192; -- GNAT
- Name_Import_Valued_Procedure : constant Name_Id := N + 193; -- GNAT
- Name_Inline : constant Name_Id := N + 194;
- Name_Inline_Always : constant Name_Id := N + 195; -- GNAT
- Name_Inline_Generic : constant Name_Id := N + 196; -- GNAT
- Name_Inspection_Point : constant Name_Id := N + 197;
- Name_Interface : constant Name_Id := N + 198; -- Ada 83
- Name_Interface_Name : constant Name_Id := N + 199; -- GNAT
- Name_Interrupt_Handler : constant Name_Id := N + 200;
- Name_Interrupt_Priority : constant Name_Id := N + 201;
- Name_Java_Constructor : constant Name_Id := N + 202; -- GNAT
- Name_Java_Interface : constant Name_Id := N + 203; -- GNAT
- Name_Keep_Names : constant Name_Id := N + 204; -- GNAT
- Name_Link_With : constant Name_Id := N + 205; -- GNAT
- Name_Linker_Alias : constant Name_Id := N + 206; -- GNAT
- Name_Linker_Options : constant Name_Id := N + 207;
- Name_Linker_Section : constant Name_Id := N + 208; -- GNAT
- Name_List : constant Name_Id := N + 209;
- Name_Machine_Attribute : constant Name_Id := N + 210; -- GNAT
- Name_Main : constant Name_Id := N + 211; -- GNAT
- Name_Main_Storage : constant Name_Id := N + 212; -- GNAT
- Name_Memory_Size : constant Name_Id := N + 213; -- Ada 83
- Name_No_Return : constant Name_Id := N + 214; -- GNAT
- Name_Obsolescent : constant Name_Id := N + 215; -- GNAT
- Name_Optimize : constant Name_Id := N + 216;
- Name_Optional_Overriding : constant Name_Id := N + 217;
- Name_Overriding : constant Name_Id := N + 218;
- Name_Pack : constant Name_Id := N + 219;
- Name_Page : constant Name_Id := N + 220;
- Name_Passive : constant Name_Id := N + 221; -- GNAT
- Name_Preelaborate : constant Name_Id := N + 222;
- Name_Priority : constant Name_Id := N + 223;
- Name_Psect_Object : constant Name_Id := N + 224; -- VMS
- Name_Pure : constant Name_Id := N + 225;
- Name_Pure_Function : constant Name_Id := N + 226; -- GNAT
- Name_Remote_Call_Interface : constant Name_Id := N + 227;
- Name_Remote_Types : constant Name_Id := N + 228;
- Name_Share_Generic : constant Name_Id := N + 229; -- GNAT
- Name_Shared : constant Name_Id := N + 230; -- Ada 83
- Name_Shared_Passive : constant Name_Id := N + 231;
-
- -- Note: Storage_Size is not in this list because its name matches the
- -- name of the corresponding attribute. However, it is included in the
- -- definition of the type Attribute_Id, and the functions Get_Pragma_Id
- -- and Check_Pragma_Id correctly recognize and process Name_Storage_Size.
-
- -- 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 + 232; -- GNAT
- Name_Stream_Convert : constant Name_Id := N + 233; -- GNAT
- Name_Subtitle : constant Name_Id := N + 234; -- GNAT
- Name_Suppress_All : constant Name_Id := N + 235; -- GNAT
- Name_Suppress_Debug_Info : constant Name_Id := N + 236; -- GNAT
- Name_Suppress_Initialization : constant Name_Id := N + 237; -- GNAT
- Name_System_Name : constant Name_Id := N + 238; -- Ada 83
- Name_Task_Info : constant Name_Id := N + 239; -- GNAT
- Name_Task_Name : constant Name_Id := N + 240; -- GNAT
- Name_Task_Storage : constant Name_Id := N + 241; -- VMS
- Name_Thread_Body : constant Name_Id := N + 242; -- GNAT
- Name_Time_Slice : constant Name_Id := N + 243; -- GNAT
- Name_Title : constant Name_Id := N + 244; -- GNAT
- Name_Unchecked_Union : constant Name_Id := N + 245; -- GNAT
- Name_Unimplemented_Unit : constant Name_Id := N + 246; -- GNAT
- Name_Unreferenced : constant Name_Id := N + 247; -- GNAT
- Name_Unreserve_All_Interrupts : constant Name_Id := N + 248; -- GNAT
- Name_Volatile : constant Name_Id := N + 249;
- Name_Volatile_Components : constant Name_Id := N + 250;
- Name_Weak_External : constant Name_Id := N + 251; -- GNAT
- Last_Pragma_Name : constant Name_Id := N + 251;
-
- -- Language convention names for pragma Convention/Export/Import/Interface
- -- Note that Name_C is not included in this list, since it was already
- -- declared earlier in the context of one-character identifier names
- -- (where the order is critical to the fast look up process).
-
- -- Note: there are no convention names corresponding to the conventions
- -- Entry and Protected, this is because these conventions cannot be
- -- specified by a pragma.
-
- First_Convention_Name : constant Name_Id := N + 252;
- Name_Ada : constant Name_Id := N + 252;
- Name_Assembler : constant Name_Id := N + 253;
- Name_COBOL : constant Name_Id := N + 254;
- Name_CPP : constant Name_Id := N + 255;
- Name_Fortran : constant Name_Id := N + 256;
- Name_Intrinsic : constant Name_Id := N + 257;
- Name_Java : constant Name_Id := N + 258;
- Name_Stdcall : constant Name_Id := N + 259;
- Name_Stubbed : constant Name_Id := N + 260;
- Last_Convention_Name : constant Name_Id := N + 260;
-
- -- The following names are preset as synonyms for Assembler
-
- Name_Asm : constant Name_Id := N + 261;
- Name_Assembly : constant Name_Id := N + 262;
-
- -- The following names are preset as synonyms for C
-
- Name_Default : constant Name_Id := N + 263;
- -- Name_Exernal (previously defined as pragma)
-
- -- The following names are present as synonyms for Stdcall
-
- Name_DLL : constant Name_Id := N + 264;
- Name_Win32 : constant Name_Id := N + 265;
-
- -- Other special names used in processing pragmas
-
- Name_As_Is : constant Name_Id := N + 266;
- Name_Body_File_Name : constant Name_Id := N + 267;
- Name_Boolean_Entry_Barriers : constant Name_Id := N + 268;
- Name_Casing : constant Name_Id := N + 269;
- Name_Code : constant Name_Id := N + 270;
- Name_Component : constant Name_Id := N + 271;
- Name_Component_Size_4 : constant Name_Id := N + 272;
- Name_Copy : constant Name_Id := N + 273;
- Name_D_Float : constant Name_Id := N + 274;
- Name_Descriptor : constant Name_Id := N + 275;
- Name_Dot_Replacement : constant Name_Id := N + 276;
- Name_Dynamic : constant Name_Id := N + 277;
- Name_Entity : constant Name_Id := N + 278;
- Name_External_Name : constant Name_Id := N + 279;
- Name_First_Optional_Parameter : constant Name_Id := N + 280;
- Name_Form : constant Name_Id := N + 281;
- Name_G_Float : constant Name_Id := N + 282;
- Name_Gcc : constant Name_Id := N + 283;
- Name_Gnat : constant Name_Id := N + 284;
- Name_GPL : constant Name_Id := N + 285;
- Name_IEEE_Float : constant Name_Id := N + 286;
- Name_Internal : constant Name_Id := N + 287;
- Name_Link_Name : constant Name_Id := N + 288;
- Name_Lowercase : constant Name_Id := N + 289;
- Name_Max_Entry_Queue_Depth : constant Name_Id := N + 290;
- Name_Max_Entry_Queue_Length : constant Name_Id := N + 291;
- Name_Max_Size : constant Name_Id := N + 292;
- Name_Mechanism : constant Name_Id := N + 293;
- Name_Mixedcase : constant Name_Id := N + 294;
- Name_Modified_GPL : constant Name_Id := N + 295;
- Name_Name : constant Name_Id := N + 296;
- Name_NCA : constant Name_Id := N + 297;
- Name_No : constant Name_Id := N + 298;
- Name_No_Dependence : constant Name_Id := N + 299;
- Name_No_Dynamic_Attachment : constant Name_Id := N + 300;
- Name_No_Dynamic_Interrupts : constant Name_Id := N + 301;
- Name_No_Requeue : constant Name_Id := N + 302;
- Name_No_Requeue_Statements : constant Name_Id := N + 303;
- Name_No_Task_Attributes : constant Name_Id := N + 304;
- Name_No_Task_Attributes_Package : constant Name_Id := N + 305;
- Name_On : constant Name_Id := N + 306;
- Name_Parameter_Types : constant Name_Id := N + 307;
- Name_Reference : constant Name_Id := N + 308;
- Name_Restricted : constant Name_Id := N + 309;
- Name_Result_Mechanism : constant Name_Id := N + 310;
- Name_Result_Type : constant Name_Id := N + 311;
- Name_Runtime : constant Name_Id := N + 312;
- Name_SB : constant Name_Id := N + 313;
- Name_Secondary_Stack_Size : constant Name_Id := N + 314;
- Name_Section : constant Name_Id := N + 315;
- Name_Semaphore : constant Name_Id := N + 316;
- Name_Simple_Barriers : constant Name_Id := N + 317;
- Name_Spec_File_Name : constant Name_Id := N + 318;
- Name_Static : constant Name_Id := N + 319;
- Name_Stack_Size : constant Name_Id := N + 320;
- Name_Subunit_File_Name : constant Name_Id := N + 321;
- Name_Task_Stack_Size_Default : constant Name_Id := N + 322;
- Name_Task_Type : constant Name_Id := N + 323;
- Name_Time_Slicing_Enabled : constant Name_Id := N + 324;
- Name_Top_Guard : constant Name_Id := N + 325;
- Name_UBA : constant Name_Id := N + 326;
- Name_UBS : constant Name_Id := N + 327;
- Name_UBSB : constant Name_Id := N + 328;
- Name_Unit_Name : constant Name_Id := N + 329;
- Name_Unknown : constant Name_Id := N + 330;
- Name_Unrestricted : constant Name_Id := N + 331;
- Name_Uppercase : constant Name_Id := N + 332;
- Name_User : constant Name_Id := N + 333;
- Name_VAX_Float : constant Name_Id := N + 334;
- Name_VMS : constant Name_Id := N + 335;
- Name_Working_Storage : constant Name_Id := N + 336;
-
- -- 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
- -- attributes are implemented in both Ada 83 and Ada 95 modes in GNAT.
-
- -- The entries marked GNAT are attributes that are defined by GNAT
- -- and implemented in both Ada 83 and Ada 95 modes. Full descriptions
- -- of these implementation dependent attributes may be found in the
- -- appropriate section in package Sem_Attr in file sem-attr.ads.
-
- -- 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 + 337;
- Name_Abort_Signal : constant Name_Id := N + 337; -- GNAT
- Name_Access : constant Name_Id := N + 338;
- Name_Address : constant Name_Id := N + 339;
- Name_Address_Size : constant Name_Id := N + 340; -- GNAT
- Name_Aft : constant Name_Id := N + 341;
- Name_Alignment : constant Name_Id := N + 342;
- Name_Asm_Input : constant Name_Id := N + 343; -- GNAT
- Name_Asm_Output : constant Name_Id := N + 344; -- GNAT
- Name_AST_Entry : constant Name_Id := N + 345; -- VMS
- Name_Bit : constant Name_Id := N + 346; -- GNAT
- Name_Bit_Order : constant Name_Id := N + 347;
- Name_Bit_Position : constant Name_Id := N + 348; -- GNAT
- Name_Body_Version : constant Name_Id := N + 349;
- Name_Callable : constant Name_Id := N + 350;
- Name_Caller : constant Name_Id := N + 351;
- Name_Code_Address : constant Name_Id := N + 352; -- GNAT
- Name_Component_Size : constant Name_Id := N + 353;
- Name_Compose : constant Name_Id := N + 354;
- Name_Constrained : constant Name_Id := N + 355;
- Name_Count : constant Name_Id := N + 356;
- Name_Default_Bit_Order : constant Name_Id := N + 357; -- GNAT
- Name_Definite : constant Name_Id := N + 358;
- Name_Delta : constant Name_Id := N + 359;
- Name_Denorm : constant Name_Id := N + 360;
- Name_Digits : constant Name_Id := N + 361;
- Name_Elaborated : constant Name_Id := N + 362; -- GNAT
- Name_Emax : constant Name_Id := N + 363; -- Ada 83
- Name_Enum_Rep : constant Name_Id := N + 364; -- GNAT
- Name_Epsilon : constant Name_Id := N + 365; -- Ada 83
- Name_Exponent : constant Name_Id := N + 366;
- Name_External_Tag : constant Name_Id := N + 367;
- Name_First : constant Name_Id := N + 368;
- Name_First_Bit : constant Name_Id := N + 369;
- Name_Fixed_Value : constant Name_Id := N + 370; -- GNAT
- Name_Fore : constant Name_Id := N + 371;
- Name_Has_Access_Values : constant Name_Id := N + 372; -- GNAT
- Name_Has_Discriminants : constant Name_Id := N + 373; -- GNAT
- Name_Identity : constant Name_Id := N + 374;
- Name_Img : constant Name_Id := N + 375; -- GNAT
- Name_Integer_Value : constant Name_Id := N + 376; -- GNAT
- Name_Large : constant Name_Id := N + 377; -- Ada 83
- Name_Last : constant Name_Id := N + 378;
- Name_Last_Bit : constant Name_Id := N + 379;
- Name_Leading_Part : constant Name_Id := N + 380;
- Name_Length : constant Name_Id := N + 381;
- Name_Machine_Emax : constant Name_Id := N + 382;
- Name_Machine_Emin : constant Name_Id := N + 383;
- Name_Machine_Mantissa : constant Name_Id := N + 384;
- Name_Machine_Overflows : constant Name_Id := N + 385;
- Name_Machine_Radix : constant Name_Id := N + 386;
- Name_Machine_Rounds : constant Name_Id := N + 387;
- Name_Machine_Size : constant Name_Id := N + 388; -- GNAT
- Name_Mantissa : constant Name_Id := N + 389; -- Ada 83
- Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 390;
- Name_Maximum_Alignment : constant Name_Id := N + 391; -- GNAT
- Name_Mechanism_Code : constant Name_Id := N + 392; -- GNAT
- Name_Mod : constant Name_Id := N + 393;
- Name_Model_Emin : constant Name_Id := N + 394;
- Name_Model_Epsilon : constant Name_Id := N + 395;
- Name_Model_Mantissa : constant Name_Id := N + 396;
- Name_Model_Small : constant Name_Id := N + 397;
- Name_Modulus : constant Name_Id := N + 398;
- Name_Null_Parameter : constant Name_Id := N + 399; -- GNAT
- Name_Object_Size : constant Name_Id := N + 400; -- GNAT
- Name_Partition_ID : constant Name_Id := N + 401;
- Name_Passed_By_Reference : constant Name_Id := N + 402; -- GNAT
- Name_Pool_Address : constant Name_Id := N + 403;
- Name_Pos : constant Name_Id := N + 404;
- Name_Position : constant Name_Id := N + 405;
- Name_Range : constant Name_Id := N + 406;
- Name_Range_Length : constant Name_Id := N + 407; -- GNAT
- Name_Round : constant Name_Id := N + 408;
- Name_Safe_Emax : constant Name_Id := N + 409; -- Ada 83
- Name_Safe_First : constant Name_Id := N + 410;
- Name_Safe_Large : constant Name_Id := N + 411; -- Ada 83
- Name_Safe_Last : constant Name_Id := N + 412;
- Name_Safe_Small : constant Name_Id := N + 413; -- Ada 83
- Name_Scale : constant Name_Id := N + 414;
- Name_Scaling : constant Name_Id := N + 415;
- Name_Signed_Zeros : constant Name_Id := N + 416;
- Name_Size : constant Name_Id := N + 417;
- Name_Small : constant Name_Id := N + 418;
- Name_Storage_Size : constant Name_Id := N + 419;
- Name_Storage_Unit : constant Name_Id := N + 420; -- GNAT
- Name_Tag : constant Name_Id := N + 421;
- Name_Target_Name : constant Name_Id := N + 422; -- GNAT
- Name_Terminated : constant Name_Id := N + 423;
- Name_To_Address : constant Name_Id := N + 424; -- GNAT
- Name_Type_Class : constant Name_Id := N + 425; -- GNAT
- Name_UET_Address : constant Name_Id := N + 426; -- GNAT
- Name_Unbiased_Rounding : constant Name_Id := N + 427;
- Name_Unchecked_Access : constant Name_Id := N + 428;
- Name_Unconstrained_Array : constant Name_Id := N + 429;
- Name_Universal_Literal_String : constant Name_Id := N + 430; -- GNAT
- Name_Unrestricted_Access : constant Name_Id := N + 431; -- GNAT
- Name_VADS_Size : constant Name_Id := N + 432; -- GNAT
- Name_Val : constant Name_Id := N + 433;
- Name_Valid : constant Name_Id := N + 434;
- Name_Value_Size : constant Name_Id := N + 435; -- GNAT
- Name_Version : constant Name_Id := N + 436;
- Name_Wchar_T_Size : constant Name_Id := N + 437; -- GNAT
- Name_Wide_Width : constant Name_Id := N + 438;
- Name_Width : constant Name_Id := N + 439;
- Name_Word_Size : constant Name_Id := N + 440; -- 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 + 441;
- Name_Adjacent : constant Name_Id := N + 441;
- Name_Ceiling : constant Name_Id := N + 442;
- Name_Copy_Sign : constant Name_Id := N + 443;
- Name_Floor : constant Name_Id := N + 444;
- Name_Fraction : constant Name_Id := N + 445;
- Name_Image : constant Name_Id := N + 446;
- Name_Input : constant Name_Id := N + 447;
- Name_Machine : constant Name_Id := N + 448;
- Name_Max : constant Name_Id := N + 449;
- Name_Min : constant Name_Id := N + 450;
- Name_Model : constant Name_Id := N + 451;
- Name_Pred : constant Name_Id := N + 452;
- Name_Remainder : constant Name_Id := N + 453;
- Name_Rounding : constant Name_Id := N + 454;
- Name_Succ : constant Name_Id := N + 455;
- Name_Truncation : constant Name_Id := N + 456;
- Name_Value : constant Name_Id := N + 457;
- Name_Wide_Image : constant Name_Id := N + 458;
- Name_Wide_Value : constant Name_Id := N + 459;
- Last_Renamable_Function_Attribute : constant Name_Id := N + 459;
-
- -- Attributes that designate procedures
-
- First_Procedure_Attribute : constant Name_Id := N + 460;
- Name_Output : constant Name_Id := N + 460;
- Name_Read : constant Name_Id := N + 461;
- Name_Write : constant Name_Id := N + 462;
- Last_Procedure_Attribute : constant Name_Id := N + 462;
-
- -- Remaining attributes are ones that return entities
-
- First_Entity_Attribute_Name : constant Name_Id := N + 463;
- Name_Elab_Body : constant Name_Id := N + 463; -- GNAT
- Name_Elab_Spec : constant Name_Id := N + 464; -- GNAT
- Name_Storage_Pool : constant Name_Id := N + 465;
-
- -- These attributes are the ones that return types
-
- First_Type_Attribute_Name : constant Name_Id := N + 466;
- Name_Base : constant Name_Id := N + 466;
- Name_Class : constant Name_Id := N + 467;
- Last_Type_Attribute_Name : constant Name_Id := N + 467;
- Last_Entity_Attribute_Name : constant Name_Id := N + 467;
- Last_Attribute_Name : constant Name_Id := N + 467;
-
- -- Names of recognized locking policy identifiers
-
- -- Note: policies are identified by the first character of the
- -- 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 + 468;
- Name_Ceiling_Locking : constant Name_Id := N + 468;
- Name_Inheritance_Locking : constant Name_Id := N + 469;
- Last_Locking_Policy_Name : constant Name_Id := N + 469;
-
- -- Names of recognized queuing policy identifiers.
-
- -- Note: policies are identified by the first character of the
- -- 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 + 470;
- Name_FIFO_Queuing : constant Name_Id := N + 470;
- Name_Priority_Queuing : constant Name_Id := N + 471;
- Last_Queuing_Policy_Name : constant Name_Id := N + 471;
-
- -- Names of recognized task dispatching policy identifiers
-
- -- Note: policies are identified by the first character of the
- -- name (e.g. F for FIFO_WIthinn_Priorities). If new policy names
- -- are added, the first character must be distinct.
-
- First_Task_Dispatching_Policy_Name : constant Name_Id := N + 472;
- Name_FIFO_Within_Priorities : constant Name_Id := N + 472;
- Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 472;
-
- -- Names of recognized checks for pragma Suppress
-
- First_Check_Name : constant Name_Id := N + 473;
- Name_Access_Check : constant Name_Id := N + 473;
- Name_Accessibility_Check : constant Name_Id := N + 474;
- Name_Discriminant_Check : constant Name_Id := N + 475;
- Name_Division_Check : constant Name_Id := N + 476;
- Name_Elaboration_Check : constant Name_Id := N + 477;
- Name_Index_Check : constant Name_Id := N + 478;
- Name_Length_Check : constant Name_Id := N + 479;
- Name_Overflow_Check : constant Name_Id := N + 480;
- Name_Range_Check : constant Name_Id := N + 481;
- Name_Storage_Check : constant Name_Id := N + 482;
- Name_Tag_Check : constant Name_Id := N + 483;
- Name_All_Checks : constant Name_Id := N + 484;
- Last_Check_Name : constant Name_Id := N + 484;
-
- -- Names corresponding to reserved keywords, excluding those already
- -- declared in the attribute list (Access, Delta, Digits, Mod, Range).
-
- Name_Abort : constant Name_Id := N + 485;
- Name_Abs : constant Name_Id := N + 486;
- Name_Accept : constant Name_Id := N + 487;
- Name_And : constant Name_Id := N + 488;
- Name_All : constant Name_Id := N + 489;
- Name_Array : constant Name_Id := N + 490;
- Name_At : constant Name_Id := N + 491;
- Name_Begin : constant Name_Id := N + 492;
- Name_Body : constant Name_Id := N + 493;
- Name_Case : constant Name_Id := N + 494;
- Name_Constant : constant Name_Id := N + 495;
- Name_Declare : constant Name_Id := N + 496;
- Name_Delay : constant Name_Id := N + 497;
- Name_Do : constant Name_Id := N + 498;
- Name_Else : constant Name_Id := N + 499;
- Name_Elsif : constant Name_Id := N + 500;
- Name_End : constant Name_Id := N + 501;
- Name_Entry : constant Name_Id := N + 502;
- Name_Exception : constant Name_Id := N + 503;
- Name_Exit : constant Name_Id := N + 504;
- Name_For : constant Name_Id := N + 505;
- Name_Function : constant Name_Id := N + 506;
- Name_Generic : constant Name_Id := N + 507;
- Name_Goto : constant Name_Id := N + 508;
- Name_If : constant Name_Id := N + 509;
- Name_In : constant Name_Id := N + 510;
- Name_Is : constant Name_Id := N + 511;
- Name_Limited : constant Name_Id := N + 512;
- Name_Loop : constant Name_Id := N + 513;
- Name_New : constant Name_Id := N + 514;
- Name_Not : constant Name_Id := N + 515;
- Name_Null : constant Name_Id := N + 516;
- Name_Of : constant Name_Id := N + 517;
- Name_Or : constant Name_Id := N + 518;
- Name_Others : constant Name_Id := N + 519;
- Name_Out : constant Name_Id := N + 520;
- Name_Package : constant Name_Id := N + 521;
- Name_Pragma : constant Name_Id := N + 522;
- Name_Private : constant Name_Id := N + 523;
- Name_Procedure : constant Name_Id := N + 524;
- Name_Raise : constant Name_Id := N + 525;
- Name_Record : constant Name_Id := N + 526;
- Name_Rem : constant Name_Id := N + 527;
- Name_Renames : constant Name_Id := N + 528;
- Name_Return : constant Name_Id := N + 529;
- Name_Reverse : constant Name_Id := N + 530;
- Name_Select : constant Name_Id := N + 531;
- Name_Separate : constant Name_Id := N + 532;
- Name_Subtype : constant Name_Id := N + 533;
- Name_Task : constant Name_Id := N + 534;
- Name_Terminate : constant Name_Id := N + 535;
- Name_Then : constant Name_Id := N + 536;
- Name_Type : constant Name_Id := N + 537;
- Name_Use : constant Name_Id := N + 538;
- Name_When : constant Name_Id := N + 539;
- Name_While : constant Name_Id := N + 540;
- Name_With : constant Name_Id := N + 541;
- Name_Xor : constant Name_Id := N + 542;
-
- -- 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 + 543;
- Name_Divide : constant Name_Id := N + 543;
- Name_Enclosing_Entity : constant Name_Id := N + 544;
- Name_Exception_Information : constant Name_Id := N + 545;
- Name_Exception_Message : constant Name_Id := N + 546;
- Name_Exception_Name : constant Name_Id := N + 547;
- Name_File : constant Name_Id := N + 548;
- Name_Import_Address : constant Name_Id := N + 549;
- Name_Import_Largest_Value : constant Name_Id := N + 550;
- Name_Import_Value : constant Name_Id := N + 551;
- Name_Is_Negative : constant Name_Id := N + 552;
- Name_Line : constant Name_Id := N + 553;
- Name_Rotate_Left : constant Name_Id := N + 554;
- Name_Rotate_Right : constant Name_Id := N + 555;
- Name_Shift_Left : constant Name_Id := N + 556;
- Name_Shift_Right : constant Name_Id := N + 557;
- Name_Shift_Right_Arithmetic : constant Name_Id := N + 558;
- Name_Source_Location : constant Name_Id := N + 559;
- Name_Unchecked_Conversion : constant Name_Id := N + 560;
- Name_Unchecked_Deallocation : constant Name_Id := N + 561;
- Name_To_Pointer : constant Name_Id := N + 562;
- Last_Intrinsic_Name : constant Name_Id := N + 562;
-
- -- Reserved words used only in Ada 95
-
- First_95_Reserved_Word : constant Name_Id := N + 563;
- Name_Abstract : constant Name_Id := N + 563;
- Name_Aliased : constant Name_Id := N + 564;
- Name_Protected : constant Name_Id := N + 565;
- Name_Until : constant Name_Id := N + 566;
- Name_Requeue : constant Name_Id := N + 567;
- Name_Tagged : constant Name_Id := N + 568;
- Last_95_Reserved_Word : constant Name_Id := N + 568;
-
- 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 + 569;
-
- -- 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 + 570;
- Name_Binder : constant Name_Id := N + 571;
- Name_Binder_Driver : constant Name_Id := N + 572;
- Name_Body_Suffix : constant Name_Id := N + 573;
- Name_Builder : constant Name_Id := N + 574;
- Name_Compiler : constant Name_Id := N + 575;
- Name_Compiler_Driver : constant Name_Id := N + 576;
- Name_Compiler_Kind : constant Name_Id := N + 577;
- Name_Compute_Dependency : constant Name_Id := N + 578;
- Name_Cross_Reference : constant Name_Id := N + 579;
- Name_Default_Linker : constant Name_Id := N + 580;
- Name_Default_Switches : constant Name_Id := N + 581;
- Name_Dependency_Option : constant Name_Id := N + 582;
- Name_Exec_Dir : constant Name_Id := N + 583;
- Name_Executable : constant Name_Id := N + 584;
- Name_Executable_Suffix : constant Name_Id := N + 585;
- Name_Extends : constant Name_Id := N + 586;
- Name_Externally_Built : constant Name_Id := N + 587;
- Name_Finder : constant Name_Id := N + 588;
- Name_Global_Configuration_Pragmas : constant Name_Id := N + 589;
- Name_Gnatls : constant Name_Id := N + 590;
- Name_Gnatstub : constant Name_Id := N + 591;
- Name_Implementation : constant Name_Id := N + 592;
- Name_Implementation_Exceptions : constant Name_Id := N + 593;
- Name_Implementation_Suffix : constant Name_Id := N + 594;
- Name_Include_Option : constant Name_Id := N + 595;
- Name_Language_Processing : constant Name_Id := N + 596;
- Name_Languages : constant Name_Id := N + 597;
- Name_Library_Dir : constant Name_Id := N + 598;
- Name_Library_Auto_Init : constant Name_Id := N + 599;
- Name_Library_GCC : constant Name_Id := N + 600;
- Name_Library_Interface : constant Name_Id := N + 601;
- Name_Library_Kind : constant Name_Id := N + 602;
- Name_Library_Name : constant Name_Id := N + 603;
- Name_Library_Options : constant Name_Id := N + 604;
- Name_Library_Reference_Symbol_File : constant Name_Id := N + 605;
- Name_Library_Src_Dir : constant Name_Id := N + 606;
- Name_Library_Symbol_File : constant Name_Id := N + 607;
- Name_Library_Symbol_Policy : constant Name_Id := N + 608;
- Name_Library_Version : constant Name_Id := N + 609;
- Name_Linker : constant Name_Id := N + 610;
- Name_Local_Configuration_Pragmas : constant Name_Id := N + 611;
- Name_Locally_Removed_Files : constant Name_Id := N + 612;
- Name_Metrics : constant Name_Id := N + 613;
- Name_Naming : constant Name_Id := N + 614;
- Name_Object_Dir : constant Name_Id := N + 615;
- Name_Pretty_Printer : constant Name_Id := N + 616;
- Name_Project : constant Name_Id := N + 617;
- Name_Separate_Suffix : constant Name_Id := N + 618;
- Name_Source_Dirs : constant Name_Id := N + 619;
- Name_Source_Files : constant Name_Id := N + 620;
- Name_Source_List_File : constant Name_Id := N + 621;
- Name_Spec : constant Name_Id := N + 622;
- Name_Spec_Suffix : constant Name_Id := N + 623;
- Name_Specification : constant Name_Id := N + 624;
- Name_Specification_Exceptions : constant Name_Id := N + 625;
- Name_Specification_Suffix : constant Name_Id := N + 626;
- Name_Switches : constant Name_Id := N + 627;
-
- -- Other miscellaneous names used in front end
-
- Name_Unaligned_Valid : constant Name_Id := N + 628;
-
- -- Mark last defined name for consistency check in Snames body
-
- Last_Predefined_Name : constant Name_Id := N + 628;
-
- subtype Any_Operator_Name is Name_Id range
- First_Operator_Name .. Last_Operator_Name;
-
- ------------------------------
- -- Attribute ID Definitions --
- ------------------------------
-
- type Attribute_Id is (
- Attribute_Abort_Signal,
- Attribute_Access,
- Attribute_Address,
- Attribute_Address_Size,
- Attribute_Aft,
- Attribute_Alignment,
- Attribute_Asm_Input,
- Attribute_Asm_Output,
- Attribute_AST_Entry,
- Attribute_Bit,
- Attribute_Bit_Order,
- Attribute_Bit_Position,
- Attribute_Body_Version,
- Attribute_Callable,
- Attribute_Caller,
- Attribute_Code_Address,
- Attribute_Component_Size,
- Attribute_Compose,
- Attribute_Constrained,
- Attribute_Count,
- Attribute_Default_Bit_Order,
- Attribute_Definite,
- Attribute_Delta,
- Attribute_Denorm,
- Attribute_Digits,
- Attribute_Elaborated,
- Attribute_Emax,
- Attribute_Enum_Rep,
- Attribute_Epsilon,
- Attribute_Exponent,
- Attribute_External_Tag,
- Attribute_First,
- Attribute_First_Bit,
- Attribute_Fixed_Value,
- Attribute_Fore,
- Attribute_Has_Access_Values,
- Attribute_Has_Discriminants,
- Attribute_Identity,
- Attribute_Img,
- Attribute_Integer_Value,
- Attribute_Large,
- Attribute_Last,
- Attribute_Last_Bit,
- Attribute_Leading_Part,
- Attribute_Length,
- Attribute_Machine_Emax,
- Attribute_Machine_Emin,
- Attribute_Machine_Mantissa,
- Attribute_Machine_Overflows,
- Attribute_Machine_Radix,
- Attribute_Machine_Rounds,
- Attribute_Machine_Size,
- Attribute_Mantissa,
- Attribute_Max_Size_In_Storage_Elements,
- Attribute_Maximum_Alignment,
- Attribute_Mechanism_Code,
- Attribute_Mod,
- Attribute_Model_Emin,
- Attribute_Model_Epsilon,
- Attribute_Model_Mantissa,
- Attribute_Model_Small,
- Attribute_Modulus,
- Attribute_Null_Parameter,
- Attribute_Object_Size,
- Attribute_Partition_ID,
- Attribute_Passed_By_Reference,
- Attribute_Pool_Address,
- Attribute_Pos,
- Attribute_Position,
- Attribute_Range,
- Attribute_Range_Length,
- Attribute_Round,
- Attribute_Safe_Emax,
- Attribute_Safe_First,
- Attribute_Safe_Large,
- Attribute_Safe_Last,
- Attribute_Safe_Small,
- Attribute_Scale,
- Attribute_Scaling,
- Attribute_Signed_Zeros,
- Attribute_Size,
- Attribute_Small,
- Attribute_Storage_Size,
- Attribute_Storage_Unit,
- Attribute_Tag,
- Attribute_Target_Name,
- Attribute_Terminated,
- Attribute_To_Address,
- Attribute_Type_Class,
- Attribute_UET_Address,
- Attribute_Unbiased_Rounding,
- Attribute_Unchecked_Access,
- Attribute_Unconstrained_Array,
- Attribute_Universal_Literal_String,
- Attribute_Unrestricted_Access,
- Attribute_VADS_Size,
- Attribute_Val,
- Attribute_Valid,
- Attribute_Value_Size,
- Attribute_Version,
- Attribute_Wchar_T_Size,
- Attribute_Wide_Width,
- Attribute_Width,
- Attribute_Word_Size,
-
- -- Attributes designating renamable functions
-
- Attribute_Adjacent,
- Attribute_Ceiling,
- Attribute_Copy_Sign,
- Attribute_Floor,
- Attribute_Fraction,
- Attribute_Image,
- Attribute_Input,
- Attribute_Machine,
- Attribute_Max,
- Attribute_Min,
- Attribute_Model,
- Attribute_Pred,
- Attribute_Remainder,
- Attribute_Rounding,
- Attribute_Succ,
- Attribute_Truncation,
- Attribute_Value,
- Attribute_Wide_Image,
- Attribute_Wide_Value,
-
- -- Attributes designating procedures
-
- Attribute_Output,
- Attribute_Read,
- Attribute_Write,
-
- -- Entity attributes (includes type attributes)
-
- Attribute_Elab_Body,
- Attribute_Elab_Spec,
- Attribute_Storage_Pool,
-
- -- Type attributes
-
- Attribute_Base,
- Attribute_Class);
-
- ------------------------------------
- -- Convention Name ID Definitions --
- ------------------------------------
-
- type Convention_Id is (
-
- -- The conventions that are defined by the RM come first
-
- Convention_Ada,
- Convention_Intrinsic,
- Convention_Entry,
- Convention_Protected,
-
- -- The remaining conventions are foreign language conventions
-
- Convention_Assembler, -- also Asm, Assembly
- Convention_C, -- also Default, External
- Convention_COBOL,
- Convention_CPP,
- Convention_Fortran,
- Convention_Java,
- Convention_Stdcall, -- also DLL, Win32
- Convention_Stubbed);
-
- -- Note: Convention C_Pass_By_Copy is allowed only for record
- -- types (where it is treated like C except that the appropriate
- -- flag is set in the record type). Recognizion of this convention
- -- is specially handled in Sem_Prag.
-
- for Convention_Id'Size use 8;
- -- Plenty of space for expansion
-
- subtype Foreign_Convention is
- Convention_Id range Convention_Assembler .. Convention_Stdcall;
-
- -----------------------------------
- -- Locking Policy ID Definitions --
- -----------------------------------
-
- type Locking_Policy_Id is (
- Locking_Policy_Inheritance_Locking,
- Locking_Policy_Ceiling_Locking);
-
- ---------------------------
- -- Pragma ID Definitions --
- ---------------------------
-
- type Pragma_Id is (
-
- -- Configuration pragmas
-
- Pragma_Ada_83,
- Pragma_Ada_95,
- Pragma_Ada_05,
- Pragma_C_Pass_By_Copy,
- Pragma_Compile_Time_Warning,
- Pragma_Component_Alignment,
- Pragma_Convention_Identifier,
- Pragma_Detect_Blocking,
- Pragma_Discard_Names,
- Pragma_Elaboration_Checks,
- Pragma_Eliminate,
- Pragma_Explicit_Overriding,
- Pragma_Extend_System,
- Pragma_Extensions_Allowed,
- Pragma_External_Name_Casing,
- Pragma_Float_Representation,
- Pragma_Initialize_Scalars,
- Pragma_Interrupt_State,
- Pragma_License,
- Pragma_Locking_Policy,
- Pragma_Long_Float,
- Pragma_No_Run_Time,
- Pragma_No_Strict_Aliasing,
- Pragma_Normalize_Scalars,
- Pragma_Polling,
- Pragma_Persistent_Data,
- Pragma_Persistent_Object,
- Pragma_Profile,
- Pragma_Profile_Warnings,
- Pragma_Propagate_Exceptions,
- Pragma_Queuing_Policy,
- Pragma_Ravenscar,
- Pragma_Restricted_Run_Time,
- Pragma_Restrictions,
- Pragma_Restriction_Warnings,
- Pragma_Reviewable,
- Pragma_Source_File_Name,
- Pragma_Source_File_Name_Project,
- Pragma_Style_Checks,
- Pragma_Suppress,
- Pragma_Suppress_Exception_Locations,
- Pragma_Task_Dispatching_Policy,
- Pragma_Universal_Data,
- Pragma_Unsuppress,
- Pragma_Use_VADS_Size,
- Pragma_Validity_Checks,
- Pragma_Warnings,
-
- -- Remaining (non-configuration) pragmas
-
- Pragma_Abort_Defer,
- Pragma_All_Calls_Remote,
- Pragma_Annotate,
- Pragma_Assert,
- Pragma_Asynchronous,
- Pragma_Atomic,
- Pragma_Atomic_Components,
- Pragma_Attach_Handler,
- Pragma_Comment,
- Pragma_Common_Object,
- Pragma_Complex_Representation,
- Pragma_Controlled,
- Pragma_Convention,
- Pragma_CPP_Class,
- Pragma_CPP_Constructor,
- Pragma_CPP_Virtual,
- Pragma_CPP_Vtable,
- Pragma_Debug,
- Pragma_Elaborate,
- Pragma_Elaborate_All,
- Pragma_Elaborate_Body,
- Pragma_Export,
- Pragma_Export_Exception,
- Pragma_Export_Function,
- Pragma_Export_Object,
- Pragma_Export_Procedure,
- Pragma_Export_Value,
- Pragma_Export_Valued_Procedure,
- Pragma_External,
- Pragma_Finalize_Storage_Only,
- Pragma_Ident,
- Pragma_Import,
- Pragma_Import_Exception,
- Pragma_Import_Function,
- Pragma_Import_Object,
- Pragma_Import_Procedure,
- Pragma_Import_Valued_Procedure,
- Pragma_Inline,
- Pragma_Inline_Always,
- Pragma_Inline_Generic,
- Pragma_Inspection_Point,
- Pragma_Interface,
- Pragma_Interface_Name,
- Pragma_Interrupt_Handler,
- Pragma_Interrupt_Priority,
- Pragma_Java_Constructor,
- Pragma_Java_Interface,
- Pragma_Keep_Names,
- Pragma_Link_With,
- Pragma_Linker_Alias,
- Pragma_Linker_Options,
- Pragma_Linker_Section,
- Pragma_List,
- Pragma_Machine_Attribute,
- Pragma_Main,
- Pragma_Main_Storage,
- Pragma_Memory_Size,
- Pragma_No_Return,
- Pragma_Obsolescent,
- Pragma_Optimize,
- Pragma_Optional_Overriding,
- Pragma_Overriding,
- Pragma_Pack,
- Pragma_Page,
- Pragma_Passive,
- Pragma_Preelaborate,
- Pragma_Priority,
- Pragma_Psect_Object,
- Pragma_Pure,
- Pragma_Pure_Function,
- Pragma_Remote_Call_Interface,
- Pragma_Remote_Types,
- Pragma_Share_Generic,
- Pragma_Shared,
- Pragma_Shared_Passive,
- Pragma_Source_Reference,
- Pragma_Stream_Convert,
- Pragma_Subtitle,
- Pragma_Suppress_All,
- Pragma_Suppress_Debug_Info,
- Pragma_Suppress_Initialization,
- Pragma_System_Name,
- Pragma_Task_Info,
- Pragma_Task_Name,
- Pragma_Task_Storage,
- Pragma_Thread_Body,
- Pragma_Time_Slice,
- Pragma_Title,
- Pragma_Unchecked_Union,
- Pragma_Unimplemented_Unit,
- Pragma_Unreferenced,
- Pragma_Unreserve_All_Interrupts,
- Pragma_Volatile,
- Pragma_Volatile_Components,
- Pragma_Weak_External,
-
- -- The following pragmas are on their own, out of order, because of
- -- the special processing required to deal with the fact that their
- -- names match existing attribute names.
-
- Pragma_AST_Entry,
- Pragma_Storage_Size,
- Pragma_Storage_Unit,
-
- -- The value to represent an unknown or unrecognized pragma
-
- Unknown_Pragma);
-
- -----------------------------------
- -- Queuing Policy ID definitions --
- -----------------------------------
-
- type Queuing_Policy_Id is (
- Queuing_Policy_FIFO_Queuing,
- Queuing_Policy_Priority_Queuing);
-
- --------------------------------------------
- -- Task Dispatching Policy ID definitions --
- --------------------------------------------
-
- type Task_Dispatching_Policy_Id is (
- Task_Dispatching_FIFO_Within_Priorities);
- -- Id values used to identify task dispatching policies
-
- -----------------
- -- Subprograms --
- -----------------
-
- procedure Initialize;
- -- Called to initialize the preset names in the names table.
-
- function Is_Attribute_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized attribute
-
- function Is_Entity_Attribute_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized entity attribute,
- -- i.e. an attribute reference that returns an entity.
-
- function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized attribute that
- -- designates a procedure (and can therefore appear as a statement).
-
- function Is_Function_Attribute_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized attribute
- -- that designates a renameable function, and can therefore appear in
- -- a renaming statement. Note that not all attributes designating
- -- functions are renamable, in particular, thos returning a universal
- -- value cannot be renamed.
-
- function Is_Type_Attribute_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized type attribute,
- -- i.e. an attribute reference that returns a type
-
- function Is_Check_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized suppress check
- -- as required by pragma Suppress.
-
- function Is_Convention_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of one of the recognized
- -- language conventions, as required by pragma Convention, Import,
- -- Export, Interface. Returns True if so. Also returns True for a
- -- name that has been specified by a Convention_Identifier pragma.
- -- If neither case holds, returns False.
-
- function Is_Locking_Policy_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized locking policy
-
- function Is_Operator_Symbol_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of an operator symbol
-
- function Is_Pragma_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized pragma. Note
- -- that pragmas AST_Entry, Storage_Size, and Storage_Unit are recognized
- -- as pragmas by this function even though their names are separate from
- -- the other pragma names.
-
- function Is_Queuing_Policy_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized queuing policy
-
- function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean;
- -- Test to see if the name N is the name of a recognized task
- -- dispatching policy.
-
- function Get_Attribute_Id (N : Name_Id) return Attribute_Id;
- -- Returns Id of attribute corresponding to given name. It is an error to
- -- call this function with a name that is not the name of a attribute.
-
- function Get_Convention_Id (N : Name_Id) return Convention_Id;
- -- Returns Id of language convention corresponding to given name. It is an
- -- to call this function with a name that is not the name of a convention,
- -- or one previously given in a call to Record_Convention_Identifier.
-
- function Get_Check_Id (N : Name_Id) return Check_Id;
- -- Returns Id of suppress check corresponding to given name. It is an error
- -- to call this function with a name that is not the name of a check.
-
- function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id;
- -- Returns Id of locking policy corresponding to given name. It is an error
- -- to call this function with a name that is not the name of a check.
-
- function Get_Pragma_Id (N : Name_Id) return Pragma_Id;
- -- Returns Id of pragma corresponding to given name. Returns Unknown_Pragma
- -- if N is not a name of a known (Ada defined or GNAT-specific) pragma.
- -- Note that the function also works correctly for names of pragmas that
- -- are not in the main list of pragma Names (AST_Entry, Storage_Size, and
- -- Storage_Unit (e.g. Name_Storage_Size returns Pragma_Storage_Size).
-
- function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id;
- -- Returns Id of queuing policy corresponding to given name. It is an error
- -- to call this function with a name that is not the name of a check.
-
- function Get_Task_Dispatching_Policy_Id
- (N : Name_Id)
- return Task_Dispatching_Policy_Id;
- -- Returns Id of task dispatching policy corresponding to given name.
- -- It is an error to call this function with a name that is not the
- -- name of a check.
-
- procedure Record_Convention_Identifier
- (Id : Name_Id;
- Convention : Convention_Id);
- -- A call to this procedure, resulting from an occurrence of a pragma
- -- Convention_Identifier, records that from now on an occurrence of
- -- Id will be recognized as a name for the specified convention.
-
-private
- pragma Inline (Is_Attribute_Name);
- pragma Inline (Is_Entity_Attribute_Name);
- pragma Inline (Is_Type_Attribute_Name);
- pragma Inline (Is_Check_Name);
- pragma Inline (Is_Locking_Policy_Name);
- pragma Inline (Is_Operator_Symbol_Name);
- pragma Inline (Is_Queuing_Policy_Name);
- pragma Inline (Is_Pragma_Name);
- pragma Inline (Is_Task_Dispatching_Policy_Name);
-
-end Snames;
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- S N A M E S --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 1992-2005, 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- --
+-- 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. --
+-- --
+------------------------------------------------------------------------------
+
+with Types; use Types;
+
+package Snames is
+
+-- This package contains definitions of standard names (i.e. entries in the
+-- Names table) that are used throughout the GNAT compiler). It also contains
+-- the definitions of some enumeration types whose definitions are tied to
+-- the order of these preset names.
+
+-- WARNING: There is a C file, a-snames.h which duplicates some of the
+-- definitions in this file and must be kept properly synchronized.
+
+ ------------------
+ -- Preset Names --
+ ------------------
+
+ -- The following are preset entries in the names table, which are
+ -- entered at the start of every compilation for easy access. Note
+ -- that the order of initialization of these names in the body must
+ -- be coordinated with the order of names in this table.
+
+ -- Note: a name may not appear more than once in the following list.
+ -- If additional pragmas or attributes are introduced which might
+ -- otherwise cause a duplicate, then list it only once in this table,
+ -- and adjust the definition of the functions for testing for pragma
+ -- names and attribute names, and returning their ID values. Of course
+ -- everything is simpler if no such duplications occur!
+
+ -- First we have the one character names used to optimize the lookup
+ -- process for one character identifiers (to avoid the hashing in this
+ -- case) There are a full 256 of these, but only the entries for lower
+ -- case and upper case letters have identifiers
+
+ -- The lower case letter entries are used for one character identifiers
+ -- appearing in the source, for example in pragma Interface (C).
+
+ Name_A : constant Name_Id := First_Name_Id + Character'Pos ('a');
+ Name_B : constant Name_Id := First_Name_Id + Character'Pos ('b');
+ Name_C : constant Name_Id := First_Name_Id + Character'Pos ('c');
+ Name_D : constant Name_Id := First_Name_Id + Character'Pos ('d');
+ Name_E : constant Name_Id := First_Name_Id + Character'Pos ('e');
+ Name_F : constant Name_Id := First_Name_Id + Character'Pos ('f');
+ Name_G : constant Name_Id := First_Name_Id + Character'Pos ('g');
+ Name_H : constant Name_Id := First_Name_Id + Character'Pos ('h');
+ Name_I : constant Name_Id := First_Name_Id + Character'Pos ('i');
+ Name_J : constant Name_Id := First_Name_Id + Character'Pos ('j');
+ Name_K : constant Name_Id := First_Name_Id + Character'Pos ('k');
+ Name_L : constant Name_Id := First_Name_Id + Character'Pos ('l');
+ Name_M : constant Name_Id := First_Name_Id + Character'Pos ('m');
+ Name_N : constant Name_Id := First_Name_Id + Character'Pos ('n');
+ Name_O : constant Name_Id := First_Name_Id + Character'Pos ('o');
+ Name_P : constant Name_Id := First_Name_Id + Character'Pos ('p');
+ Name_Q : constant Name_Id := First_Name_Id + Character'Pos ('q');
+ Name_R : constant Name_Id := First_Name_Id + Character'Pos ('r');
+ Name_S : constant Name_Id := First_Name_Id + Character'Pos ('s');
+ Name_T : constant Name_Id := First_Name_Id + Character'Pos ('t');
+ Name_U : constant Name_Id := First_Name_Id + Character'Pos ('u');
+ Name_V : constant Name_Id := First_Name_Id + Character'Pos ('v');
+ Name_W : constant Name_Id := First_Name_Id + Character'Pos ('w');
+ Name_X : constant Name_Id := First_Name_Id + Character'Pos ('x');
+ Name_Y : constant Name_Id := First_Name_Id + Character'Pos ('y');
+ Name_Z : constant Name_Id := First_Name_Id + Character'Pos ('z');
+
+ -- The upper case letter entries are used by expander code for local
+ -- variables that do not require unique names (e.g. formal parameter
+ -- names in constructed procedures)
+
+ Name_uA : constant Name_Id := First_Name_Id + Character'Pos ('A');
+ Name_uB : constant Name_Id := First_Name_Id + Character'Pos ('B');
+ Name_uC : constant Name_Id := First_Name_Id + Character'Pos ('C');
+ Name_uD : constant Name_Id := First_Name_Id + Character'Pos ('D');
+ Name_uE : constant Name_Id := First_Name_Id + Character'Pos ('E');
+ Name_uF : constant Name_Id := First_Name_Id + Character'Pos ('F');
+ Name_uG : constant Name_Id := First_Name_Id + Character'Pos ('G');
+ Name_uH : constant Name_Id := First_Name_Id + Character'Pos ('H');
+ Name_uI : constant Name_Id := First_Name_Id + Character'Pos ('I');
+ Name_uJ : constant Name_Id := First_Name_Id + Character'Pos ('J');
+ Name_uK : constant Name_Id := First_Name_Id + Character'Pos ('K');
+ Name_uL : constant Name_Id := First_Name_Id + Character'Pos ('L');
+ Name_uM : constant Name_Id := First_Name_Id + Character'Pos ('M');
+ Name_uN : constant Name_Id := First_Name_Id + Character'Pos ('N');
+ Name_uO : constant Name_Id := First_Name_Id + Character'Pos ('O');
+ Name_uP : constant Name_Id := First_Name_Id + Character'Pos ('P');
+ Name_uQ : constant Name_Id := First_Name_Id + Character'Pos ('Q');
+ Name_uR : constant Name_Id := First_Name_Id + Character'Pos ('R');
+ Name_uS : constant Name_Id := First_Name_Id + Character'Pos ('S');
+ Name_uT : constant Name_Id := First_Name_Id + Character'Pos ('T');
+ Name_uU : constant Name_Id := First_Name_Id + Character'Pos ('U');
+ Name_uV : constant Name_Id := First_Name_Id + Character'Pos ('V');
+ Name_uW : constant Name_Id := First_Name_Id + Character'Pos ('W');
+ Name_uX : constant Name_Id := First_Name_Id + Character'Pos ('X');
+ Name_uY : constant Name_Id := First_Name_Id + Character'Pos ('Y');
+ Name_uZ : constant Name_Id := First_Name_Id + Character'Pos ('Z');
+
+ -- Note: the following table is read by the utility program XSNAMES and
+ -- its format should not be changed without coordinating with this program.
+
+ N : constant Name_Id := First_Name_Id + 256;
+ -- Synonym used in standard name definitions
+
+ -- Some names that are used by gigi, and whose definitions are reflected
+ -- in the C header file a-snames.h. They are placed at the start so that
+ -- the need to modify a-snames.h is minimized.
+
+ Name_uParent : constant Name_Id := N + 000;
+ Name_uTag : constant Name_Id := N + 001;
+ Name_Off : constant Name_Id := N + 002;
+ Name_Space : constant Name_Id := N + 003;
+ Name_Time : constant Name_Id := N + 004;
+
+ -- Some special names used by the expander. Note that the lower case u's
+ -- at the start of these names get translated to extra underscores. These
+ -- names are only referenced internally by expander generated code.
+
+ Name_uAbort_Signal : constant Name_Id := N + 005;
+ Name_uAlignment : constant Name_Id := N + 006;
+ Name_uAssign : constant Name_Id := N + 007;
+ Name_uATCB : constant Name_Id := N + 008;
+ Name_uChain : constant Name_Id := N + 009;
+ Name_uClean : constant Name_Id := N + 010;
+ Name_uController : constant Name_Id := N + 011;
+ Name_uEntry_Bodies : constant Name_Id := N + 012;
+ Name_uExpunge : constant Name_Id := N + 013;
+ Name_uFinal_List : constant Name_Id := N + 014;
+ Name_uIdepth : constant Name_Id := N + 015;
+ Name_uInit : constant Name_Id := N + 016;
+ Name_uLocal_Final_List : constant Name_Id := N + 017;
+ Name_uMaster : constant Name_Id := N + 018;
+ Name_uObject : constant Name_Id := N + 019;
+ Name_uPriority : constant Name_Id := N + 020;
+ Name_uProcess_ATSD : constant Name_Id := N + 021;
+ Name_uSecondary_Stack : constant Name_Id := N + 022;
+ Name_uService : constant Name_Id := N + 023;
+ Name_uSize : constant Name_Id := N + 024;
+ Name_uStack : constant Name_Id := N + 025;
+ Name_uTags : constant Name_Id := N + 026;
+ Name_uTask : constant Name_Id := N + 027;
+ Name_uTask_Id : constant Name_Id := N + 028;
+ Name_uTask_Info : constant Name_Id := N + 029;
+ Name_uTask_Name : constant Name_Id := N + 030;
+ Name_uTrace_Sp : constant Name_Id := N + 031;
+
+ -- Names of routines in Ada.Finalization, needed by expander
+
+ Name_Initialize : constant Name_Id := N + 032;
+ Name_Adjust : constant Name_Id := N + 033;
+ Name_Finalize : constant Name_Id := N + 034;
+
+ -- Names of fields declared in System.Finalization_Implementation,
+ -- needed by the expander when generating code for finalization.
+
+ Name_Next : constant Name_Id := N + 035;
+ Name_Prev : constant Name_Id := N + 036;
+
+ -- Names of TSS routines for implementation of DSA over PolyORB
+
+ Name_uTypeCode : constant Name_Id := N + 037;
+ Name_uFrom_Any : constant Name_Id := N + 038;
+ Name_uTo_Any : constant Name_Id := N + 039;
+
+ -- Names of allocation routines, also needed by expander
+
+ Name_Allocate : constant Name_Id := N + 040;
+ Name_Deallocate : constant Name_Id := N + 041;
+ Name_Dereference : constant Name_Id := N + 042;
+
+ -- Names of Text_IO generic subpackages (see Rtsfind.Text_IO_Kludge)
+
+ First_Text_IO_Package : constant Name_Id := N + 043;
+ Name_Decimal_IO : constant Name_Id := N + 043;
+ Name_Enumeration_IO : constant Name_Id := N + 044;
+ Name_Fixed_IO : constant Name_Id := N + 045;
+ Name_Float_IO : constant Name_Id := N + 046;
+ Name_Integer_IO : constant Name_Id := N + 047;
+ Name_Modular_IO : constant Name_Id := N + 048;
+ Last_Text_IO_Package : constant Name_Id := N + 048;
+
+ subtype Text_IO_Package_Name is Name_Id
+ range First_Text_IO_Package .. Last_Text_IO_Package;
+
+ -- Some miscellaneous names used for error detection/recovery
+
+ Name_Const : constant Name_Id := N + 049;
+ Name_Error : constant Name_Id := N + 050;
+ Name_Go : constant Name_Id := N + 051;
+ Name_Put : constant Name_Id := N + 052;
+ Name_Put_Line : constant Name_Id := N + 053;
+ Name_To : constant Name_Id := N + 054;
+
+ -- Names for packages that are treated specially by the compiler
+
+ Name_Finalization : constant Name_Id := N + 055;
+ Name_Finalization_Root : constant Name_Id := N + 056;
+ Name_Interfaces : constant Name_Id := N + 057;
+ Name_Standard : constant Name_Id := N + 058;
+ Name_System : constant Name_Id := N + 059;
+ Name_Text_IO : constant Name_Id := N + 060;
+ Name_Wide_Text_IO : constant Name_Id := N + 061;
+ Name_Wide_Wide_Text_IO : constant Name_Id := N + 062;
+
+ -- Names of implementations of the distributed systems annex
+
+ First_PCS_Name : constant Name_Id := N + 063;
+ Name_No_DSA : constant Name_Id := N + 063;
+ Name_GARLIC_DSA : constant Name_Id := N + 064;
+ Name_PolyORB_DSA : constant Name_Id := N + 065;
+ Last_PCS_Name : constant Name_Id := N + 065;
+
+ subtype PCS_Names is Name_Id
+ range First_PCS_Name .. Last_PCS_Name;
+
+ -- Names of identifiers used in expanding distribution stubs
+
+ Name_Addr : constant Name_Id := N + 066;
+ Name_Async : constant Name_Id := N + 067;
+ Name_Get_Active_Partition_ID : constant Name_Id := N + 068;
+ Name_Get_RCI_Package_Receiver : constant Name_Id := N + 069;
+ Name_Get_RCI_Package_Ref : constant Name_Id := N + 070;
+ Name_Origin : constant Name_Id := N + 071;
+ Name_Params : constant Name_Id := N + 072;
+ Name_Partition : constant Name_Id := N + 073;
+ Name_Partition_Interface : constant Name_Id := N + 074;
+ Name_Ras : constant Name_Id := N + 075;
+ Name_Call : constant Name_Id := N + 076;
+ Name_RCI_Name : constant Name_Id := N + 077;
+ Name_Receiver : constant Name_Id := N + 078;
+ Name_Result : constant Name_Id := N + 079;
+ Name_Rpc : constant Name_Id := N + 080;
+ Name_Subp_Id : constant Name_Id := N + 081;
+ Name_Operation : constant Name_Id := N + 082;
+ Name_Argument : constant Name_Id := N + 083;
+ Name_Arg_Modes : constant Name_Id := N + 084;
+ Name_Handler : constant Name_Id := N + 085;
+ Name_Target : constant Name_Id := N + 086;
+ Name_Req : constant Name_Id := N + 087;
+ Name_Obj_TypeCode : constant Name_Id := N + 088;
+ Name_Stub : constant Name_Id := N + 089;
+
+ -- Operator Symbol entries. The actual names have an upper case O at
+ -- the start in place of the Op_ prefix (e.g. the actual name that
+ -- corresponds to Name_Op_Abs is "Oabs".
+
+ First_Operator_Name : constant Name_Id := N + 090;
+ Name_Op_Abs : constant Name_Id := N + 090; -- "abs"
+ Name_Op_And : constant Name_Id := N + 091; -- "and"
+ Name_Op_Mod : constant Name_Id := N + 092; -- "mod"
+ Name_Op_Not : constant Name_Id := N + 093; -- "not"
+ Name_Op_Or : constant Name_Id := N + 094; -- "or"
+ Name_Op_Rem : constant Name_Id := N + 095; -- "rem"
+ Name_Op_Xor : constant Name_Id := N + 096; -- "xor"
+ Name_Op_Eq : constant Name_Id := N + 097; -- "="
+ Name_Op_Ne : constant Name_Id := N + 098; -- "/="
+ Name_Op_Lt : constant Name_Id := N + 099; -- "<"
+ Name_Op_Le : constant Name_Id := N + 100; -- "<="
+ Name_Op_Gt : constant Name_Id := N + 101; -- ">"
+ Name_Op_Ge : constant Name_Id := N + 102; -- ">="
+ Name_Op_Add : constant Name_Id := N + 103; -- "+"
+ Name_Op_Subtract : constant Name_Id := N + 104; -- "-"
+ Name_Op_Concat : constant Name_Id := N + 105; -- "&"
+ Name_Op_Multiply : constant Name_Id := N + 106; -- "*"
+ Name_Op_Divide : constant Name_Id := N + 107; -- "/"
+ Name_Op_Expon : constant Name_Id := N + 108; -- "**"
+ Last_Operator_Name : constant Name_Id := N + 108;
+
+ -- Names for all pragmas recognized by GNAT. The entries with the comment
+ -- "Ada 83" are pragmas that are defined in Ada 83, but not in Ada 95.
+ -- These pragmas are fully implemented in both Ada 83 and Ada 95 modes
+ -- in GNAT.
+
+ -- The entries marked GNAT are pragmas that are defined by GNAT
+ -- and implemented in both Ada 83 and Ada 95 modes. Full descriptions
+ -- of these implementation dependent pragmas may be found in the
+ -- appropriate section in unit Sem_Prag in file sem-prag.adb.
+
+ -- The entries marked Ada05 are technically implementation dependent
+ -- pragmas, but they correspond to standard proposals for Ada 2005.
+
+ -- The entries marked VMS are VMS specific pragmas that are recognized
+ -- only in OpenVMS versions of GNAT. They are ignored in other versions
+ -- with an appropriate warning.
+
+ -- The entries marked AAMP are AAMP specific pragmas that are recognized
+ -- only in GNAT for the AAMP. They are ignored in other versions with
+ -- appropriate warnings.
+
+ First_Pragma_Name : constant Name_Id := N + 109;
+
+ -- Configuration pragmas are grouped at start
+
+ Name_Ada_83 : constant Name_Id := N + 109; -- GNAT
+ Name_Ada_95 : constant Name_Id := N + 110; -- GNAT
+ Name_Ada_05 : constant Name_Id := N + 111; -- GNAT
+ Name_C_Pass_By_Copy : constant Name_Id := N + 112; -- GNAT
+ Name_Compile_Time_Warning : constant Name_Id := N + 113; -- GNAT
+ Name_Component_Alignment : constant Name_Id := N + 114; -- GNAT
+ Name_Convention_Identifier : constant Name_Id := N + 115; -- GNAT
+ Name_Detect_Blocking : constant Name_Id := N + 116; -- Ada05
+ Name_Discard_Names : constant Name_Id := N + 117;
+ Name_Elaboration_Checks : constant Name_Id := N + 118; -- GNAT
+ Name_Eliminate : constant Name_Id := N + 119; -- GNAT
+ Name_Explicit_Overriding : constant Name_Id := N + 120;
+ Name_Extend_System : constant Name_Id := N + 121; -- GNAT
+ Name_Extensions_Allowed : constant Name_Id := N + 122; -- GNAT
+ Name_External_Name_Casing : constant Name_Id := N + 123; -- GNAT
+ Name_Float_Representation : constant Name_Id := N + 124; -- GNAT
+ Name_Initialize_Scalars : constant Name_Id := N + 125; -- GNAT
+ Name_Interrupt_State : constant Name_Id := N + 126; -- GNAT
+ Name_License : constant Name_Id := N + 127; -- GNAT
+ Name_Locking_Policy : constant Name_Id := N + 128;
+ Name_Long_Float : constant Name_Id := N + 129; -- VMS
+ Name_No_Run_Time : constant Name_Id := N + 130; -- GNAT
+ Name_No_Strict_Aliasing : constant Name_Id := N + 131; -- GNAT
+ Name_Normalize_Scalars : constant Name_Id := N + 132;
+ Name_Polling : constant Name_Id := N + 133; -- GNAT
+ Name_Persistent_Data : constant Name_Id := N + 134; -- GNAT
+ Name_Persistent_Object : constant Name_Id := N + 135; -- GNAT
+ Name_Profile : constant Name_Id := N + 136; -- Ada05
+ Name_Profile_Warnings : constant Name_Id := N + 137; -- GNAT
+ Name_Propagate_Exceptions : constant Name_Id := N + 138; -- GNAT
+ Name_Queuing_Policy : constant Name_Id := N + 139;
+ Name_Ravenscar : constant Name_Id := N + 140;
+ Name_Restricted_Run_Time : constant Name_Id := N + 141;
+ Name_Restrictions : constant Name_Id := N + 142;
+ Name_Restriction_Warnings : constant Name_Id := N + 143; -- GNAT
+ Name_Reviewable : constant Name_Id := N + 144;
+ Name_Source_File_Name : constant Name_Id := N + 145; -- GNAT
+ Name_Source_File_Name_Project : constant Name_Id := N + 146; -- GNAT
+ Name_Style_Checks : constant Name_Id := N + 147; -- GNAT
+ Name_Suppress : constant Name_Id := N + 148;
+ Name_Suppress_Exception_Locations : constant Name_Id := N + 149; -- GNAT
+ Name_Task_Dispatching_Policy : constant Name_Id := N + 150;
+ Name_Universal_Data : constant Name_Id := N + 151; -- AAMP
+ Name_Unsuppress : constant Name_Id := N + 152; -- GNAT
+ Name_Use_VADS_Size : constant Name_Id := N + 153; -- GNAT
+ Name_Validity_Checks : constant Name_Id := N + 154; -- GNAT
+ Name_Warnings : constant Name_Id := N + 155; -- GNAT
+ Last_Configuration_Pragma_Name : constant Name_Id := N + 155;
+
+ -- Remaining pragma names
+
+ Name_Abort_Defer : constant Name_Id := N + 156; -- GNAT
+ Name_All_Calls_Remote : constant Name_Id := N + 157;
+ Name_Annotate : constant Name_Id := N + 158; -- GNAT
+
+ -- Note: AST_Entry is not in this list because its name matches the
+ -- name of the corresponding attribute. However, it is included in the
+ -- definition of the type Attribute_Id, and the functions Get_Pragma_Id
+ -- and Check_Pragma_Id correctly recognize and process Name_AST_Entry.
+ -- AST_Entry is a VMS specific pragma.
+
+ Name_Assert : constant Name_Id := N + 159; -- GNAT
+ Name_Asynchronous : constant Name_Id := N + 160;
+ Name_Atomic : constant Name_Id := N + 161;
+ Name_Atomic_Components : constant Name_Id := N + 162;
+ Name_Attach_Handler : constant Name_Id := N + 163;
+ Name_Comment : constant Name_Id := N + 164; -- GNAT
+ Name_Common_Object : constant Name_Id := N + 165; -- GNAT
+ Name_Complex_Representation : constant Name_Id := N + 166; -- GNAT
+ Name_Controlled : constant Name_Id := N + 167;
+ Name_Convention : constant Name_Id := N + 168;
+ Name_CPP_Class : constant Name_Id := N + 169; -- GNAT
+ Name_CPP_Constructor : constant Name_Id := N + 170; -- GNAT
+ Name_CPP_Virtual : constant Name_Id := N + 171; -- GNAT
+ Name_CPP_Vtable : constant Name_Id := N + 172; -- GNAT
+ Name_Debug : constant Name_Id := N + 173; -- GNAT
+ Name_Elaborate : constant Name_Id := N + 174; -- Ada 83
+ Name_Elaborate_All : constant Name_Id := N + 175;
+ Name_Elaborate_Body : constant Name_Id := N + 176;
+ Name_Export : constant Name_Id := N + 177;
+ Name_Export_Exception : constant Name_Id := N + 178; -- VMS
+ Name_Export_Function : constant Name_Id := N + 179; -- GNAT
+ Name_Export_Object : constant Name_Id := N + 180; -- GNAT
+ Name_Export_Procedure : constant Name_Id := N + 181; -- GNAT
+ Name_Export_Value : constant Name_Id := N + 182; -- GNAT
+ Name_Export_Valued_Procedure : constant Name_Id := N + 183; -- GNAT
+ Name_External : constant Name_Id := N + 184; -- GNAT
+ Name_Finalize_Storage_Only : constant Name_Id := N + 185; -- GNAT
+ Name_Ident : constant Name_Id := N + 186; -- VMS
+ Name_Import : constant Name_Id := N + 187;
+ Name_Import_Exception : constant Name_Id := N + 188; -- VMS
+ Name_Import_Function : constant Name_Id := N + 189; -- GNAT
+ Name_Import_Object : constant Name_Id := N + 190; -- GNAT
+ Name_Import_Procedure : constant Name_Id := N + 191; -- GNAT
+ Name_Import_Valued_Procedure : constant Name_Id := N + 192; -- GNAT
+ Name_Inline : constant Name_Id := N + 193;
+ Name_Inline_Always : constant Name_Id := N + 194; -- GNAT
+ Name_Inline_Generic : constant Name_Id := N + 195; -- GNAT
+ Name_Inspection_Point : constant Name_Id := N + 196;
+ Name_Interface_Name : constant Name_Id := N + 197; -- GNAT
+ Name_Interrupt_Handler : constant Name_Id := N + 198;
+ Name_Interrupt_Priority : constant Name_Id := N + 199;
+ Name_Java_Constructor : constant Name_Id := N + 200; -- GNAT
+ Name_Java_Interface : constant Name_Id := N + 201; -- GNAT
+ Name_Keep_Names : constant Name_Id := N + 202; -- GNAT
+ Name_Link_With : constant Name_Id := N + 203; -- GNAT
+ Name_Linker_Alias : constant Name_Id := N + 204; -- GNAT
+ Name_Linker_Options : constant Name_Id := N + 205;
+ Name_Linker_Section : constant Name_Id := N + 206; -- GNAT
+ Name_List : constant Name_Id := N + 207;
+ Name_Machine_Attribute : constant Name_Id := N + 208; -- GNAT
+ Name_Main : constant Name_Id := N + 209; -- GNAT
+ Name_Main_Storage : constant Name_Id := N + 210; -- GNAT
+ Name_Memory_Size : constant Name_Id := N + 211; -- Ada 83
+ Name_No_Return : constant Name_Id := N + 212; -- GNAT
+ Name_Obsolescent : constant Name_Id := N + 213; -- GNAT
+ Name_Optimize : constant Name_Id := N + 214;
+ Name_Optional_Overriding : constant Name_Id := N + 215;
+ Name_Pack : constant Name_Id := N + 216;
+ Name_Page : constant Name_Id := N + 217;
+ Name_Passive : constant Name_Id := N + 218; -- GNAT
+ Name_Preelaborate : constant Name_Id := N + 219;
+ Name_Priority : constant Name_Id := N + 220;
+ Name_Psect_Object : constant Name_Id := N + 221; -- VMS
+ Name_Pure : constant Name_Id := N + 222;
+ Name_Pure_Function : constant Name_Id := N + 223; -- GNAT
+ Name_Remote_Call_Interface : constant Name_Id := N + 224;
+ Name_Remote_Types : constant Name_Id := N + 225;
+ Name_Share_Generic : constant Name_Id := N + 226; -- GNAT
+ Name_Shared : constant Name_Id := N + 227; -- Ada 83
+ Name_Shared_Passive : constant Name_Id := N + 228;
+
+ -- Note: Storage_Size is not in this list because its name matches the
+ -- name of the corresponding attribute. However, it is included in the
+ -- definition of the type Attribute_Id, and the functions Get_Pragma_Id
+ -- and Check_Pragma_Id correctly recognize and process Name_Storage_Size.
+
+ -- 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 + 229; -- GNAT
+ Name_Stream_Convert : constant Name_Id := N + 230; -- GNAT
+ Name_Subtitle : constant Name_Id := N + 231; -- GNAT
+ Name_Suppress_All : constant Name_Id := N + 232; -- GNAT
+ Name_Suppress_Debug_Info : constant Name_Id := N + 233; -- GNAT
+ Name_Suppress_Initialization : constant Name_Id := N + 234; -- GNAT
+ Name_System_Name : constant Name_Id := N + 235; -- Ada 83
+ Name_Task_Info : constant Name_Id := N + 236; -- GNAT
+ Name_Task_Name : constant Name_Id := N + 237; -- GNAT
+ Name_Task_Storage : constant Name_Id := N + 238; -- VMS
+ Name_Thread_Body : constant Name_Id := N + 239; -- GNAT
+ Name_Time_Slice : constant Name_Id := N + 240; -- GNAT
+ Name_Title : constant Name_Id := N + 241; -- GNAT
+ Name_Unchecked_Union : constant Name_Id := N + 242; -- GNAT
+ Name_Unimplemented_Unit : constant Name_Id := N + 243; -- GNAT
+ Name_Unreferenced : constant Name_Id := N + 244; -- GNAT
+ Name_Unreserve_All_Interrupts : constant Name_Id := N + 245; -- GNAT
+ Name_Volatile : constant Name_Id := N + 246;
+ Name_Volatile_Components : constant Name_Id := N + 247;
+ Name_Weak_External : constant Name_Id := N + 248; -- GNAT
+ Last_Pragma_Name : constant Name_Id := N + 248;
+
+ -- Language convention names for pragma Convention/Export/Import/Interface
+ -- Note that Name_C is not included in this list, since it was already
+ -- declared earlier in the context of one-character identifier names
+ -- (where the order is critical to the fast look up process).
+
+ -- Note: there are no convention names corresponding to the conventions
+ -- Entry and Protected, this is because these conventions cannot be
+ -- specified by a pragma.
+
+ First_Convention_Name : constant Name_Id := N + 249;
+ Name_Ada : constant Name_Id := N + 249;
+ Name_Assembler : constant Name_Id := N + 250;
+ Name_COBOL : constant Name_Id := N + 251;
+ Name_CPP : constant Name_Id := N + 252;
+ Name_Fortran : constant Name_Id := N + 253;
+ Name_Intrinsic : constant Name_Id := N + 254;
+ Name_Java : constant Name_Id := N + 255;
+ Name_Stdcall : constant Name_Id := N + 256;
+ Name_Stubbed : constant Name_Id := N + 257;
+ Last_Convention_Name : constant Name_Id := N + 257;
+
+ -- The following names are preset as synonyms for Assembler
+
+ Name_Asm : constant Name_Id := N + 258;
+ Name_Assembly : constant Name_Id := N + 259;
+
+ -- The following names are preset as synonyms for C
+
+ Name_Default : constant Name_Id := N + 260;
+ -- Name_Exernal (previously defined as pragma)
+
+ -- The following names are present as synonyms for Stdcall
+
+ Name_DLL : constant Name_Id := N + 261;
+ Name_Win32 : constant Name_Id := N + 262;
+
+ -- Other special names used in processing pragmas
+
+ Name_As_Is : constant Name_Id := N + 263;
+ Name_Body_File_Name : constant Name_Id := N + 264;
+ Name_Boolean_Entry_Barriers : constant Name_Id := N + 265;
+ Name_Casing : constant Name_Id := N + 266;
+ Name_Code : constant Name_Id := N + 267;
+ Name_Component : constant Name_Id := N + 268;
+ Name_Component_Size_4 : constant Name_Id := N + 269;
+ Name_Copy : constant Name_Id := N + 270;
+ Name_D_Float : constant Name_Id := N + 271;
+ Name_Descriptor : constant Name_Id := N + 272;
+ Name_Dot_Replacement : constant Name_Id := N + 273;
+ Name_Dynamic : constant Name_Id := N + 274;
+ Name_Entity : constant Name_Id := N + 275;
+ Name_External_Name : constant Name_Id := N + 276;
+ Name_First_Optional_Parameter : constant Name_Id := N + 277;
+ Name_Form : constant Name_Id := N + 278;
+ Name_G_Float : constant Name_Id := N + 279;
+ Name_Gcc : constant Name_Id := N + 280;
+ Name_Gnat : constant Name_Id := N + 281;
+ Name_GPL : constant Name_Id := N + 282;
+ Name_IEEE_Float : constant Name_Id := N + 283;
+ Name_Internal : constant Name_Id := N + 284;
+ Name_Link_Name : constant Name_Id := N + 285;
+ Name_Lowercase : constant Name_Id := N + 286;
+ Name_Max_Entry_Queue_Depth : constant Name_Id := N + 287;
+ Name_Max_Entry_Queue_Length : constant Name_Id := N + 288;
+ Name_Max_Size : constant Name_Id := N + 289;
+ Name_Mechanism : constant Name_Id := N + 290;
+ Name_Mixedcase : constant Name_Id := N + 291;
+ Name_Modified_GPL : constant Name_Id := N + 292;
+ Name_Name : constant Name_Id := N + 293;
+ Name_NCA : constant Name_Id := N + 294;
+ Name_No : constant Name_Id := N + 295;
+ Name_No_Dependence : constant Name_Id := N + 296;
+ Name_No_Dynamic_Attachment : constant Name_Id := N + 297;
+ Name_No_Dynamic_Interrupts : constant Name_Id := N + 298;
+ Name_No_Requeue : constant Name_Id := N + 299;
+ Name_No_Requeue_Statements : constant Name_Id := N + 300;
+ Name_No_Task_Attributes : constant Name_Id := N + 301;
+ Name_No_Task_Attributes_Package : constant Name_Id := N + 302;
+ Name_On : constant Name_Id := N + 303;
+ Name_Parameter_Types : constant Name_Id := N + 304;
+ Name_Reference : constant Name_Id := N + 305;
+ Name_Restricted : constant Name_Id := N + 306;
+ Name_Result_Mechanism : constant Name_Id := N + 307;
+ Name_Result_Type : constant Name_Id := N + 308;
+ Name_Runtime : constant Name_Id := N + 309;
+ Name_SB : constant Name_Id := N + 310;
+ Name_Secondary_Stack_Size : constant Name_Id := N + 311;
+ Name_Section : constant Name_Id := N + 312;
+ Name_Semaphore : constant Name_Id := N + 313;
+ Name_Simple_Barriers : constant Name_Id := N + 314;
+ Name_Spec_File_Name : constant Name_Id := N + 315;
+ Name_Static : constant Name_Id := N + 316;
+ Name_Stack_Size : constant Name_Id := N + 317;
+ Name_Subunit_File_Name : constant Name_Id := N + 318;
+ Name_Task_Stack_Size_Default : constant Name_Id := N + 319;
+ Name_Task_Type : constant Name_Id := N + 320;
+ Name_Time_Slicing_Enabled : constant Name_Id := N + 321;
+ Name_Top_Guard : constant Name_Id := N + 322;
+ Name_UBA : constant Name_Id := N + 323;
+ Name_UBS : constant Name_Id := N + 324;
+ Name_UBSB : constant Name_Id := N + 325;
+ Name_Unit_Name : constant Name_Id := N + 326;
+ Name_Unknown : constant Name_Id := N + 327;
+ Name_Unrestricted : constant Name_Id := N + 328;
+ Name_Uppercase : constant Name_Id := N + 329;
+ Name_User : constant Name_Id := N + 330;
+ Name_VAX_Float : constant Name_Id := N + 331;
+ Name_VMS : constant Name_Id := N + 332;
+ Name_Working_Storage : constant Name_Id := N + 333;
+
+ -- 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
+ -- attributes are implemented in both Ada 83 and Ada 95 modes in GNAT.
+
+ -- The entries marked GNAT are attributes that are defined by GNAT
+ -- and implemented in both Ada 83 and Ada 95 modes. Full descriptions
+ -- of these implementation dependent attributes may be found in the
+ -- appropriate section in package Sem_Attr in file sem-attr.ads.
+
+ -- 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 + 334;
+ Name_Abort_Signal : constant Name_Id := N + 334; -- GNAT
+ Name_Access : constant Name_Id := N + 335;
+ Name_Address : constant Name_Id := N + 336;
+ Name_Address_Size : constant Name_Id := N + 337; -- GNAT
+ Name_Aft : constant Name_Id := N + 338;
+ Name_Alignment : constant Name_Id := N + 339;
+ Name_Asm_Input : constant Name_Id := N + 340; -- GNAT
+ Name_Asm_Output : constant Name_Id := N + 341; -- GNAT
+ Name_AST_Entry : constant Name_Id := N + 342; -- VMS
+ Name_Bit : constant Name_Id := N + 343; -- GNAT
+ Name_Bit_Order : constant Name_Id := N + 344;
+ Name_Bit_Position : constant Name_Id := N + 345; -- GNAT
+ Name_Body_Version : constant Name_Id := N + 346;
+ Name_Callable : constant Name_Id := N + 347;
+ Name_Caller : constant Name_Id := N + 348;
+ Name_Code_Address : constant Name_Id := N + 349; -- GNAT
+ Name_Component_Size : constant Name_Id := N + 350;
+ Name_Compose : constant Name_Id := N + 351;
+ Name_Constrained : constant Name_Id := N + 352;
+ Name_Count : constant Name_Id := N + 353;
+ Name_Default_Bit_Order : constant Name_Id := N + 354; -- GNAT
+ Name_Definite : constant Name_Id := N + 355;
+ Name_Delta : constant Name_Id := N + 356;
+ Name_Denorm : constant Name_Id := N + 357;
+ Name_Digits : constant Name_Id := N + 358;
+ Name_Elaborated : constant Name_Id := N + 359; -- GNAT
+ Name_Emax : constant Name_Id := N + 360; -- Ada 83
+ Name_Enum_Rep : constant Name_Id := N + 361; -- GNAT
+ Name_Epsilon : constant Name_Id := N + 362; -- Ada 83
+ Name_Exponent : constant Name_Id := N + 363;
+ Name_External_Tag : constant Name_Id := N + 364;
+ Name_First : constant Name_Id := N + 365;
+ Name_First_Bit : constant Name_Id := N + 366;
+ Name_Fixed_Value : constant Name_Id := N + 367; -- GNAT
+ Name_Fore : constant Name_Id := N + 368;
+ Name_Has_Access_Values : constant Name_Id := N + 369; -- GNAT
+ Name_Has_Discriminants : constant Name_Id := N + 370; -- GNAT
+ Name_Identity : constant Name_Id := N + 371;
+ Name_Img : constant Name_Id := N + 372; -- GNAT
+ Name_Integer_Value : constant Name_Id := N + 373; -- GNAT
+ Name_Large : constant Name_Id := N + 374; -- Ada 83
+ Name_Last : constant Name_Id := N + 375;
+ Name_Last_Bit : constant Name_Id := N + 376;
+ Name_Leading_Part : constant Name_Id := N + 377;
+ Name_Length : constant Name_Id := N + 378;
+ Name_Machine_Emax : constant Name_Id := N + 379;
+ Name_Machine_Emin : constant Name_Id := N + 380;
+ Name_Machine_Mantissa : constant Name_Id := N + 381;
+ Name_Machine_Overflows : constant Name_Id := N + 382;
+ Name_Machine_Radix : constant Name_Id := N + 383;
+ Name_Machine_Rounds : constant Name_Id := N + 384;
+ Name_Machine_Size : constant Name_Id := N + 385; -- GNAT
+ Name_Mantissa : constant Name_Id := N + 386; -- Ada 83
+ Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 387;
+ Name_Maximum_Alignment : constant Name_Id := N + 388; -- GNAT
+ Name_Mechanism_Code : constant Name_Id := N + 389; -- GNAT
+ Name_Mod : constant Name_Id := N + 390;
+ Name_Model_Emin : constant Name_Id := N + 391;
+ Name_Model_Epsilon : constant Name_Id := N + 392;
+ Name_Model_Mantissa : constant Name_Id := N + 393;
+ Name_Model_Small : constant Name_Id := N + 394;
+ Name_Modulus : constant Name_Id := N + 395;
+ Name_Null_Parameter : constant Name_Id := N + 396; -- GNAT
+ Name_Object_Size : constant Name_Id := N + 397; -- GNAT
+ Name_Partition_ID : constant Name_Id := N + 398;
+ Name_Passed_By_Reference : constant Name_Id := N + 399; -- GNAT
+ Name_Pool_Address : constant Name_Id := N + 400;
+ Name_Pos : constant Name_Id := N + 401;
+ Name_Position : constant Name_Id := N + 402;
+ Name_Range : constant Name_Id := N + 403;
+ Name_Range_Length : constant Name_Id := N + 404; -- GNAT
+ Name_Round : constant Name_Id := N + 405;
+ Name_Safe_Emax : constant Name_Id := N + 406; -- Ada 83
+ Name_Safe_First : constant Name_Id := N + 407;
+ Name_Safe_Large : constant Name_Id := N + 408; -- Ada 83
+ Name_Safe_Last : constant Name_Id := N + 409;
+ Name_Safe_Small : constant Name_Id := N + 410; -- Ada 83
+ Name_Scale : constant Name_Id := N + 411;
+ Name_Scaling : constant Name_Id := N + 412;
+ Name_Signed_Zeros : constant Name_Id := N + 413;
+ Name_Size : constant Name_Id := N + 414;
+ Name_Small : constant Name_Id := N + 415;
+ Name_Storage_Size : constant Name_Id := N + 416;
+ Name_Storage_Unit : constant Name_Id := N + 417; -- GNAT
+ Name_Stream_Size : constant Name_Id := N + 418; -- Ada 05
+ Name_Tag : constant Name_Id := N + 419;
+ Name_Target_Name : constant Name_Id := N + 420; -- GNAT
+ Name_Terminated : constant Name_Id := N + 421;
+ Name_To_Address : constant Name_Id := N + 422; -- GNAT
+ Name_Type_Class : constant Name_Id := N + 423; -- GNAT
+ Name_UET_Address : constant Name_Id := N + 424; -- GNAT
+ Name_Unbiased_Rounding : constant Name_Id := N + 425;
+ Name_Unchecked_Access : constant Name_Id := N + 426;
+ Name_Unconstrained_Array : constant Name_Id := N + 427;
+ Name_Universal_Literal_String : constant Name_Id := N + 428; -- GNAT
+ Name_Unrestricted_Access : constant Name_Id := N + 429; -- GNAT
+ Name_VADS_Size : constant Name_Id := N + 430; -- GNAT
+ Name_Val : constant Name_Id := N + 431;
+ Name_Valid : constant Name_Id := N + 432;
+ Name_Value_Size : constant Name_Id := N + 433; -- GNAT
+ Name_Version : constant Name_Id := N + 434;
+ Name_Wchar_T_Size : constant Name_Id := N + 435; -- GNAT
+ Name_Wide_Wide_Width : constant Name_Id := N + 436; -- Ada 05
+ Name_Wide_Width : constant Name_Id := N + 437;
+ Name_Width : constant Name_Id := N + 438;
+ Name_Word_Size : constant Name_Id := N + 439; -- 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 + 440;
+ Name_Adjacent : constant Name_Id := N + 440;
+ Name_Ceiling : constant Name_Id := N + 441;
+ Name_Copy_Sign : constant Name_Id := N + 442;
+ Name_Floor : constant Name_Id := N + 443;
+ Name_Fraction : constant Name_Id := N + 444;
+ Name_Image : constant Name_Id := N + 445;
+ Name_Input : constant Name_Id := N + 446;
+ Name_Machine : constant Name_Id := N + 447;
+ Name_Max : constant Name_Id := N + 448;
+ Name_Min : constant Name_Id := N + 449;
+ Name_Model : constant Name_Id := N + 450;
+ Name_Pred : constant Name_Id := N + 451;
+ Name_Remainder : constant Name_Id := N + 452;
+ Name_Rounding : constant Name_Id := N + 453;
+ Name_Succ : constant Name_Id := N + 454;
+ Name_Truncation : constant Name_Id := N + 455;
+ Name_Value : constant Name_Id := N + 456;
+ Name_Wide_Image : constant Name_Id := N + 457;
+ Name_Wide_Wide_Image : constant Name_Id := N + 458;
+ Name_Wide_Value : constant Name_Id := N + 459;
+ Name_Wide_Wide_Value : constant Name_Id := N + 460;
+ Last_Renamable_Function_Attribute : constant Name_Id := N + 460;
+
+ -- Attributes that designate procedures
+
+ First_Procedure_Attribute : constant Name_Id := N + 461;
+ Name_Output : constant Name_Id := N + 461;
+ Name_Read : constant Name_Id := N + 462;
+ Name_Write : constant Name_Id := N + 463;
+ Last_Procedure_Attribute : constant Name_Id := N + 463;
+
+ -- Remaining attributes are ones that return entities
+
+ First_Entity_Attribute_Name : constant Name_Id := N + 464;
+ Name_Elab_Body : constant Name_Id := N + 464; -- GNAT
+ Name_Elab_Spec : constant Name_Id := N + 465; -- GNAT
+ Name_Storage_Pool : constant Name_Id := N + 466;
+
+ -- These attributes are the ones that return types
+
+ First_Type_Attribute_Name : constant Name_Id := N + 467;
+ Name_Base : constant Name_Id := N + 467;
+ Name_Class : constant Name_Id := N + 468;
+ Last_Type_Attribute_Name : constant Name_Id := N + 468;
+ Last_Entity_Attribute_Name : constant Name_Id := N + 468;
+ Last_Attribute_Name : constant Name_Id := N + 468;
+
+ -- Names of recognized locking policy identifiers
+
+ -- Note: policies are identified by the first character of the
+ -- 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 + 469;
+ Name_Ceiling_Locking : constant Name_Id := N + 469;
+ Name_Inheritance_Locking : constant Name_Id := N + 470;
+ Last_Locking_Policy_Name : constant Name_Id := N + 470;
+
+ -- Names of recognized queuing policy identifiers.
+
+ -- Note: policies are identified by the first character of the
+ -- 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 + 471;
+ Name_FIFO_Queuing : constant Name_Id := N + 471;
+ Name_Priority_Queuing : constant Name_Id := N + 472;
+ Last_Queuing_Policy_Name : constant Name_Id := N + 472;
+
+ -- Names of recognized task dispatching policy identifiers
+
+ -- Note: policies are identified by the first character of the
+ -- name (e.g. F for FIFO_WIthinn_Priorities). If new policy names
+ -- are added, the first character must be distinct.
+
+ First_Task_Dispatching_Policy_Name : constant Name_Id := N + 473;
+ Name_FIFO_Within_Priorities : constant Name_Id := N + 473;
+ Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 473;
+
+ -- Names of recognized checks for pragma Suppress
+
+ First_Check_Name : constant Name_Id := N + 474;
+ Name_Access_Check : constant Name_Id := N + 474;
+ Name_Accessibility_Check : constant Name_Id := N + 475;
+ Name_Discriminant_Check : constant Name_Id := N + 476;
+ Name_Division_Check : constant Name_Id := N + 477;
+ Name_Elaboration_Check : constant Name_Id := N + 478;
+ Name_Index_Check : constant Name_Id := N + 479;
+ Name_Length_Check : constant Name_Id := N + 480;
+ Name_Overflow_Check : constant Name_Id := N + 481;
+ Name_Range_Check : constant Name_Id := N + 482;
+ Name_Storage_Check : constant Name_Id := N + 483;
+ Name_Tag_Check : constant Name_Id := N + 484;
+ Name_All_Checks : constant Name_Id := N + 485;
+ Last_Check_Name : constant Name_Id := N + 485;
+
+ -- Names corresponding to reserved keywords, excluding those already
+ -- declared in the attribute list (Access, Delta, Digits, Mod, Range).
+
+ Name_Abort : constant Name_Id := N + 486;
+ Name_Abs : constant Name_Id := N + 487;
+ Name_Accept : constant Name_Id := N + 488;
+ Name_And : constant Name_Id := N + 489;
+ Name_All : constant Name_Id := N + 490;
+ Name_Array : constant Name_Id := N + 491;
+ Name_At : constant Name_Id := N + 492;
+ Name_Begin : constant Name_Id := N + 493;
+ Name_Body : constant Name_Id := N + 494;
+ Name_Case : constant Name_Id := N + 495;
+ Name_Constant : constant Name_Id := N + 496;
+ Name_Declare : constant Name_Id := N + 497;
+ Name_Delay : constant Name_Id := N + 498;
+ Name_Do : constant Name_Id := N + 499;
+ Name_Else : constant Name_Id := N + 500;
+ Name_Elsif : constant Name_Id := N + 501;
+ Name_End : constant Name_Id := N + 502;
+ Name_Entry : constant Name_Id := N + 503;
+ Name_Exception : constant Name_Id := N + 504;
+ Name_Exit : constant Name_Id := N + 505;
+ Name_For : constant Name_Id := N + 506;
+ Name_Function : constant Name_Id := N + 507;
+ Name_Generic : constant Name_Id := N + 508;
+ Name_Goto : constant Name_Id := N + 509;
+ Name_If : constant Name_Id := N + 510;
+ Name_In : constant Name_Id := N + 511;
+ Name_Is : constant Name_Id := N + 512;
+ Name_Limited : constant Name_Id := N + 513;
+ Name_Loop : constant Name_Id := N + 514;
+ Name_New : constant Name_Id := N + 515;
+ Name_Not : constant Name_Id := N + 516;
+ Name_Null : constant Name_Id := N + 517;
+ Name_Of : constant Name_Id := N + 518;
+ Name_Or : constant Name_Id := N + 519;
+ Name_Others : constant Name_Id := N + 520;
+ Name_Out : constant Name_Id := N + 521;
+ Name_Package : constant Name_Id := N + 522;
+ Name_Pragma : constant Name_Id := N + 523;
+ Name_Private : constant Name_Id := N + 524;
+ Name_Procedure : constant Name_Id := N + 525;
+ Name_Raise : constant Name_Id := N + 526;
+ Name_Record : constant Name_Id := N + 527;
+ Name_Rem : constant Name_Id := N + 528;
+ Name_Renames : constant Name_Id := N + 529;
+ Name_Return : constant Name_Id := N + 530;
+ Name_Reverse : constant Name_Id := N + 531;
+ Name_Select : constant Name_Id := N + 532;
+ Name_Separate : constant Name_Id := N + 533;
+ Name_Subtype : constant Name_Id := N + 534;
+ Name_Task : constant Name_Id := N + 535;
+ Name_Terminate : constant Name_Id := N + 536;
+ Name_Then : constant Name_Id := N + 537;
+ Name_Type : constant Name_Id := N + 538;
+ Name_Use : constant Name_Id := N + 539;
+ Name_When : constant Name_Id := N + 540;
+ Name_While : constant Name_Id := N + 541;
+ Name_With : constant Name_Id := N + 542;
+ Name_Xor : constant Name_Id := N + 543;
+
+ -- 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 + 544;
+ Name_Divide : constant Name_Id := N + 544;
+ Name_Enclosing_Entity : constant Name_Id := N + 545;
+ Name_Exception_Information : constant Name_Id := N + 546;
+ Name_Exception_Message : constant Name_Id := N + 547;
+ Name_Exception_Name : constant Name_Id := N + 548;
+ Name_File : constant Name_Id := N + 549;
+ Name_Import_Address : constant Name_Id := N + 550;
+ Name_Import_Largest_Value : constant Name_Id := N + 551;
+ Name_Import_Value : constant Name_Id := N + 552;
+ Name_Is_Negative : constant Name_Id := N + 553;
+ Name_Line : constant Name_Id := N + 554;
+ Name_Rotate_Left : constant Name_Id := N + 555;
+ Name_Rotate_Right : constant Name_Id := N + 556;
+ Name_Shift_Left : constant Name_Id := N + 557;
+ Name_Shift_Right : constant Name_Id := N + 558;
+ Name_Shift_Right_Arithmetic : constant Name_Id := N + 559;
+ Name_Source_Location : constant Name_Id := N + 560;
+ Name_Unchecked_Conversion : constant Name_Id := N + 561;
+ Name_Unchecked_Deallocation : constant Name_Id := N + 562;
+ Name_To_Pointer : constant Name_Id := N + 563;
+ Last_Intrinsic_Name : constant Name_Id := N + 563;
+
+ -- Reserved words used only in Ada 95
+
+ First_95_Reserved_Word : constant Name_Id := N + 564;
+ Name_Abstract : constant Name_Id := N + 564;
+ Name_Aliased : constant Name_Id := N + 565;
+ Name_Protected : constant Name_Id := N + 566;
+ Name_Until : constant Name_Id := N + 567;
+ Name_Requeue : constant Name_Id := N + 568;
+ Name_Tagged : constant Name_Id := N + 569;
+ Last_95_Reserved_Word : constant Name_Id := N + 569;
+
+ 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 + 570;
+
+ -- 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 + 571;
+ Name_Binder : constant Name_Id := N + 572;
+ Name_Binder_Driver : constant Name_Id := N + 573;
+ Name_Body_Suffix : constant Name_Id := N + 574;
+ Name_Builder : constant Name_Id := N + 575;
+ Name_Compiler : constant Name_Id := N + 576;
+ Name_Compiler_Driver : constant Name_Id := N + 577;
+ Name_Compiler_Kind : constant Name_Id := N + 578;
+ Name_Compute_Dependency : constant Name_Id := N + 579;
+ Name_Cross_Reference : constant Name_Id := N + 580;
+ Name_Default_Linker : constant Name_Id := N + 581;
+ Name_Default_Switches : constant Name_Id := N + 582;
+ Name_Dependency_Option : constant Name_Id := N + 583;
+ Name_Exec_Dir : constant Name_Id := N + 584;
+ Name_Executable : constant Name_Id := N + 585;
+ Name_Executable_Suffix : constant Name_Id := N + 586;
+ Name_Extends : constant Name_Id := N + 587;
+ Name_Externally_Built : constant Name_Id := N + 588;
+ Name_Finder : constant Name_Id := N + 589;
+ Name_Global_Configuration_Pragmas : constant Name_Id := N + 590;
+ Name_Gnatls : constant Name_Id := N + 591;
+ Name_Gnatstub : constant Name_Id := N + 592;
+ Name_Implementation : constant Name_Id := N + 593;
+ Name_Implementation_Exceptions : constant Name_Id := N + 594;
+ Name_Implementation_Suffix : constant Name_Id := N + 595;
+ Name_Include_Option : constant Name_Id := N + 596;
+ Name_Language_Processing : constant Name_Id := N + 597;
+ Name_Languages : constant Name_Id := N + 598;
+ Name_Library_Dir : constant Name_Id := N + 599;
+ Name_Library_Auto_Init : constant Name_Id := N + 600;
+ Name_Library_GCC : constant Name_Id := N + 601;
+ Name_Library_Interface : constant Name_Id := N + 602;
+ Name_Library_Kind : constant Name_Id := N + 603;
+ Name_Library_Name : constant Name_Id := N + 604;
+ Name_Library_Options : constant Name_Id := N + 605;
+ Name_Library_Reference_Symbol_File : constant Name_Id := N + 606;
+ Name_Library_Src_Dir : constant Name_Id := N + 607;
+ Name_Library_Symbol_File : constant Name_Id := N + 608;
+ Name_Library_Symbol_Policy : constant Name_Id := N + 609;
+ Name_Library_Version : constant Name_Id := N + 610;
+ Name_Linker : constant Name_Id := N + 611;
+ Name_Local_Configuration_Pragmas : constant Name_Id := N + 612;
+ Name_Locally_Removed_Files : constant Name_Id := N + 613;
+ Name_Metrics : constant Name_Id := N + 614;
+ Name_Naming : constant Name_Id := N + 615;
+ Name_Object_Dir : constant Name_Id := N + 616;
+ Name_Pretty_Printer : constant Name_Id := N + 617;
+ Name_Project : constant Name_Id := N + 618;
+ Name_Separate_Suffix : constant Name_Id := N + 619;
+ Name_Source_Dirs : constant Name_Id := N + 620;
+ Name_Source_Files : constant Name_Id := N + 621;
+ Name_Source_List_File : constant Name_Id := N + 622;
+ Name_Spec : constant Name_Id := N + 623;
+ Name_Spec_Suffix : constant Name_Id := N + 624;
+ Name_Specification : constant Name_Id := N + 625;
+ Name_Specification_Exceptions : constant Name_Id := N + 626;
+ Name_Specification_Suffix : constant Name_Id := N + 627;
+ Name_Switches : constant Name_Id := N + 628;
+
+ -- Other miscellaneous names used in front end
+
+ Name_Unaligned_Valid : constant Name_Id := N + 629;
+
+ -- ----------------------------------------------------------------
+ First_2005_Reserved_Word : constant Name_Id := N + 630;
+ Name_Interface : constant Name_Id := N + 630;
+ Name_Overriding : constant Name_Id := N + 631;
+ Name_Synchronized : constant Name_Id := N + 632;
+ Last_2005_Reserved_Word : constant Name_Id := N + 632;
+
+ 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 + 632;
+
+ subtype Any_Operator_Name is Name_Id range
+ First_Operator_Name .. Last_Operator_Name;
+
+ ------------------------------
+ -- Attribute ID Definitions --
+ ------------------------------
+
+ type Attribute_Id is (
+ Attribute_Abort_Signal,
+ Attribute_Access,
+ Attribute_Address,
+ Attribute_Address_Size,
+ Attribute_Aft,
+ Attribute_Alignment,
+ Attribute_Asm_Input,
+ Attribute_Asm_Output,
+ Attribute_AST_Entry,
+ Attribute_Bit,
+ Attribute_Bit_Order,
+ Attribute_Bit_Position,
+ Attribute_Body_Version,
+ Attribute_Callable,
+ Attribute_Caller,
+ Attribute_Code_Address,
+ Attribute_Component_Size,
+ Attribute_Compose,
+ Attribute_Constrained,
+ Attribute_Count,
+ Attribute_Default_Bit_Order,
+ Attribute_Definite,
+ Attribute_Delta,
+ Attribute_Denorm,
+ Attribute_Digits,
+ Attribute_Elaborated,
+ Attribute_Emax,
+ Attribute_Enum_Rep,
+ Attribute_Epsilon,
+ Attribute_Exponent,
+ Attribute_External_Tag,
+ Attribute_First,
+ Attribute_First_Bit,
+ Attribute_Fixed_Value,
+ Attribute_Fore,
+ Attribute_Has_Access_Values,
+ Attribute_Has_Discriminants,
+ Attribute_Identity,
+ Attribute_Img,
+ Attribute_Integer_Value,
+ Attribute_Large,
+ Attribute_Last,
+ Attribute_Last_Bit,
+ Attribute_Leading_Part,
+ Attribute_Length,
+ Attribute_Machine_Emax,
+ Attribute_Machine_Emin,
+ Attribute_Machine_Mantissa,
+ Attribute_Machine_Overflows,
+ Attribute_Machine_Radix,
+ Attribute_Machine_Rounds,
+ Attribute_Machine_Size,
+ Attribute_Mantissa,
+ Attribute_Max_Size_In_Storage_Elements,
+ Attribute_Maximum_Alignment,
+ Attribute_Mechanism_Code,
+ Attribute_Mod,
+ Attribute_Model_Emin,
+ Attribute_Model_Epsilon,
+ Attribute_Model_Mantissa,
+ Attribute_Model_Small,
+ Attribute_Modulus,
+ Attribute_Null_Parameter,
+ Attribute_Object_Size,
+ Attribute_Partition_ID,
+ Attribute_Passed_By_Reference,
+ Attribute_Pool_Address,
+ Attribute_Pos,
+ Attribute_Position,
+ Attribute_Range,
+ Attribute_Range_Length,
+ Attribute_Round,
+ Attribute_Safe_Emax,
+ Attribute_Safe_First,
+ Attribute_Safe_Large,
+ Attribute_Safe_Last,
+ Attribute_Safe_Small,
+ Attribute_Scale,
+ Attribute_Scaling,
+ Attribute_Signed_Zeros,
+ Attribute_Size,
+ Attribute_Small,
+ Attribute_Storage_Size,
+ Attribute_Storage_Unit,
+ Attribute_Stream_Size,
+ Attribute_Tag,
+ Attribute_Target_Name,
+ Attribute_Terminated,
+ Attribute_To_Address,
+ Attribute_Type_Class,
+ Attribute_UET_Address,
+ Attribute_Unbiased_Rounding,
+ Attribute_Unchecked_Access,
+ Attribute_Unconstrained_Array,
+ Attribute_Universal_Literal_String,
+ Attribute_Unrestricted_Access,
+ Attribute_VADS_Size,
+ Attribute_Val,
+ Attribute_Valid,
+ Attribute_Value_Size,
+ Attribute_Version,
+ Attribute_Wchar_T_Size,
+ Attribute_Wide_Wide_Width,
+ Attribute_Wide_Width,
+ Attribute_Width,
+ Attribute_Word_Size,
+
+ -- Attributes designating renamable functions
+
+ Attribute_Adjacent,
+ Attribute_Ceiling,
+ Attribute_Copy_Sign,
+ Attribute_Floor,
+ Attribute_Fraction,
+ Attribute_Image,
+ Attribute_Input,
+ Attribute_Machine,
+ Attribute_Max,
+ Attribute_Min,
+ Attribute_Model,
+ Attribute_Pred,
+ Attribute_Remainder,
+ Attribute_Rounding,
+ Attribute_Succ,
+ Attribute_Truncation,
+ Attribute_Value,
+ Attribute_Wide_Image,
+ Attribute_Wide_Wide_Image,
+ Attribute_Wide_Value,
+ Attribute_Wide_Wide_Value,
+
+ -- Attributes designating procedures
+
+ Attribute_Output,
+ Attribute_Read,
+ Attribute_Write,
+
+ -- Entity attributes (includes type attributes)
+
+ Attribute_Elab_Body,
+ Attribute_Elab_Spec,
+ Attribute_Storage_Pool,
+
+ -- Type attributes
+
+ Attribute_Base,
+ Attribute_Class);
+
+ ------------------------------------
+ -- Convention Name ID Definitions --
+ ------------------------------------
+
+ type Convention_Id is (
+
+ -- The conventions that are defined by the RM come first
+
+ Convention_Ada,
+ Convention_Intrinsic,
+ Convention_Entry,
+ Convention_Protected,
+
+ -- The remaining conventions are foreign language conventions
+
+ Convention_Assembler, -- also Asm, Assembly
+ Convention_C, -- also Default, External
+ Convention_COBOL,
+ Convention_CPP,
+ Convention_Fortran,
+ Convention_Java,
+ Convention_Stdcall, -- also DLL, Win32
+ Convention_Stubbed);
+
+ -- Note: Convention C_Pass_By_Copy is allowed only for record
+ -- types (where it is treated like C except that the appropriate
+ -- flag is set in the record type). Recognizion of this convention
+ -- is specially handled in Sem_Prag.
+
+ for Convention_Id'Size use 8;
+ -- Plenty of space for expansion
+
+ subtype Foreign_Convention is
+ Convention_Id range Convention_Assembler .. Convention_Stdcall;
+
+ -----------------------------------
+ -- Locking Policy ID Definitions --
+ -----------------------------------
+
+ type Locking_Policy_Id is (
+ Locking_Policy_Inheritance_Locking,
+ Locking_Policy_Ceiling_Locking);
+
+ ---------------------------
+ -- Pragma ID Definitions --
+ ---------------------------
+
+ type Pragma_Id is (
+
+ -- Configuration pragmas
+
+ Pragma_Ada_83,
+ Pragma_Ada_95,
+ Pragma_Ada_05,
+ Pragma_C_Pass_By_Copy,
+ Pragma_Compile_Time_Warning,
+ Pragma_Component_Alignment,
+ Pragma_Convention_Identifier,
+ Pragma_Detect_Blocking,
+ Pragma_Discard_Names,
+ Pragma_Elaboration_Checks,
+ Pragma_Eliminate,
+ Pragma_Explicit_Overriding,
+ Pragma_Extend_System,
+ Pragma_Extensions_Allowed,
+ Pragma_External_Name_Casing,
+ Pragma_Float_Representation,
+ Pragma_Initialize_Scalars,
+ Pragma_Interrupt_State,
+ Pragma_License,
+ Pragma_Locking_Policy,
+ Pragma_Long_Float,
+ Pragma_No_Run_Time,
+ Pragma_No_Strict_Aliasing,
+ Pragma_Normalize_Scalars,
+ Pragma_Polling,
+ Pragma_Persistent_Data,
+ Pragma_Persistent_Object,
+ Pragma_Profile,
+ Pragma_Profile_Warnings,
+ Pragma_Propagate_Exceptions,
+ Pragma_Queuing_Policy,
+ Pragma_Ravenscar,
+ Pragma_Restricted_Run_Time,
+ Pragma_Restrictions,
+ Pragma_Restriction_Warnings,
+ Pragma_Reviewable,
+ Pragma_Source_File_Name,
+ Pragma_Source_File_Name_Project,
+ Pragma_Style_Checks,
+ Pragma_Suppress,
+ Pragma_Suppress_Exception_Locations,
+ Pragma_Task_Dispatching_Policy,
+ Pragma_Universal_Data,
+ Pragma_Unsuppress,
+ Pragma_Use_VADS_Size,
+ Pragma_Validity_Checks,
+ Pragma_Warnings,
+
+ -- Remaining (non-configuration) pragmas
+
+ Pragma_Abort_Defer,
+ Pragma_All_Calls_Remote,
+ Pragma_Annotate,
+ Pragma_Assert,
+ Pragma_Asynchronous,
+ Pragma_Atomic,
+ Pragma_Atomic_Components,
+ Pragma_Attach_Handler,
+ Pragma_Comment,
+ Pragma_Common_Object,
+ Pragma_Complex_Representation,
+ Pragma_Controlled,
+ Pragma_Convention,
+ Pragma_CPP_Class,
+ Pragma_CPP_Constructor,
+ Pragma_CPP_Virtual,
+ Pragma_CPP_Vtable,
+ Pragma_Debug,
+ Pragma_Elaborate,
+ Pragma_Elaborate_All,
+ Pragma_Elaborate_Body,
+ Pragma_Export,
+ Pragma_Export_Exception,
+ Pragma_Export_Function,
+ Pragma_Export_Object,
+ Pragma_Export_Procedure,
+ Pragma_Export_Value,
+ Pragma_Export_Valued_Procedure,
+ Pragma_External,
+ Pragma_Finalize_Storage_Only,
+ Pragma_Ident,
+ Pragma_Import,
+ Pragma_Import_Exception,
+ Pragma_Import_Function,
+ Pragma_Import_Object,
+ Pragma_Import_Procedure,
+ Pragma_Import_Valued_Procedure,
+ Pragma_Inline,
+ Pragma_Inline_Always,
+ Pragma_Inline_Generic,
+ Pragma_Inspection_Point,
+ Pragma_Interface_Name,
+ Pragma_Interrupt_Handler,
+ Pragma_Interrupt_Priority,
+ Pragma_Java_Constructor,
+ Pragma_Java_Interface,
+ Pragma_Keep_Names,
+ Pragma_Link_With,
+ Pragma_Linker_Alias,
+ Pragma_Linker_Options,
+ Pragma_Linker_Section,
+ Pragma_List,
+ Pragma_Machine_Attribute,
+ Pragma_Main,
+ Pragma_Main_Storage,
+ Pragma_Memory_Size,
+ Pragma_No_Return,
+ Pragma_Obsolescent,
+ Pragma_Optimize,
+ Pragma_Optional_Overriding,
+ Pragma_Pack,
+ Pragma_Page,
+ Pragma_Passive,
+ Pragma_Preelaborate,
+ Pragma_Priority,
+ Pragma_Psect_Object,
+ Pragma_Pure,
+ Pragma_Pure_Function,
+ Pragma_Remote_Call_Interface,
+ Pragma_Remote_Types,
+ Pragma_Share_Generic,
+ Pragma_Shared,
+ Pragma_Shared_Passive,
+ Pragma_Source_Reference,
+ Pragma_Stream_Convert,
+ Pragma_Subtitle,
+ Pragma_Suppress_All,
+ Pragma_Suppress_Debug_Info,
+ Pragma_Suppress_Initialization,
+ Pragma_System_Name,
+ Pragma_Task_Info,
+ Pragma_Task_Name,
+ Pragma_Task_Storage,
+ Pragma_Thread_Body,
+ Pragma_Time_Slice,
+ Pragma_Title,
+ Pragma_Unchecked_Union,
+ Pragma_Unimplemented_Unit,
+ Pragma_Unreferenced,
+ Pragma_Unreserve_All_Interrupts,
+ Pragma_Volatile,
+ Pragma_Volatile_Components,
+ Pragma_Weak_External,
+
+ -- The following pragmas are on their own, out of order, because of
+ -- the special processing required to deal with the fact that their
+ -- names match existing attribute names.
+
+ Pragma_AST_Entry,
+ Pragma_Interface,
+ Pragma_Storage_Size,
+ Pragma_Storage_Unit,
+
+ -- The value to represent an unknown or unrecognized pragma
+
+ Unknown_Pragma);
+
+ -----------------------------------
+ -- Queuing Policy ID definitions --
+ -----------------------------------
+
+ type Queuing_Policy_Id is (
+ Queuing_Policy_FIFO_Queuing,
+ Queuing_Policy_Priority_Queuing);
+
+ --------------------------------------------
+ -- Task Dispatching Policy ID definitions --
+ --------------------------------------------
+
+ type Task_Dispatching_Policy_Id is (
+ Task_Dispatching_FIFO_Within_Priorities);
+ -- Id values used to identify task dispatching policies
+
+ -----------------
+ -- Subprograms --
+ -----------------
+
+ procedure Initialize;
+ -- Called to initialize the preset names in the names table.
+
+ function Is_Attribute_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized attribute
+
+ function Is_Entity_Attribute_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized entity attribute,
+ -- i.e. an attribute reference that returns an entity.
+
+ function Is_Procedure_Attribute_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized attribute that
+ -- designates a procedure (and can therefore appear as a statement).
+
+ function Is_Function_Attribute_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized attribute
+ -- that designates a renameable function, and can therefore appear in
+ -- a renaming statement. Note that not all attributes designating
+ -- functions are renamable, in particular, thos returning a universal
+ -- value cannot be renamed.
+
+ function Is_Type_Attribute_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized type attribute,
+ -- i.e. an attribute reference that returns a type
+
+ function Is_Check_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized suppress check
+ -- as required by pragma Suppress.
+
+ function Is_Convention_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of one of the recognized
+ -- language conventions, as required by pragma Convention, Import,
+ -- Export, Interface. Returns True if so. Also returns True for a
+ -- name that has been specified by a Convention_Identifier pragma.
+ -- If neither case holds, returns False.
+
+ function Is_Locking_Policy_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized locking policy
+
+ function Is_Operator_Symbol_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of an operator symbol
+
+ function Is_Pragma_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized pragma. Note
+ -- that pragmas AST_Entry, Storage_Size, and Storage_Unit are recognized
+ -- as pragmas by this function even though their names are separate from
+ -- the other pragma names.
+
+ function Is_Queuing_Policy_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized queuing policy
+
+ function Is_Task_Dispatching_Policy_Name (N : Name_Id) return Boolean;
+ -- Test to see if the name N is the name of a recognized task
+ -- dispatching policy.
+
+ function Get_Attribute_Id (N : Name_Id) return Attribute_Id;
+ -- Returns Id of attribute corresponding to given name. It is an error to
+ -- call this function with a name that is not the name of a attribute.
+
+ function Get_Convention_Id (N : Name_Id) return Convention_Id;
+ -- Returns Id of language convention corresponding to given name. It is an
+ -- to call this function with a name that is not the name of a convention,
+ -- or one previously given in a call to Record_Convention_Identifier.
+
+ function Get_Check_Id (N : Name_Id) return Check_Id;
+ -- Returns Id of suppress check corresponding to given name. It is an error
+ -- to call this function with a name that is not the name of a check.
+
+ function Get_Locking_Policy_Id (N : Name_Id) return Locking_Policy_Id;
+ -- Returns Id of locking policy corresponding to given name. It is an error
+ -- to call this function with a name that is not the name of a check.
+
+ function Get_Pragma_Id (N : Name_Id) return Pragma_Id;
+ -- Returns Id of pragma corresponding to given name. Returns Unknown_Pragma
+ -- if N is not a name of a known (Ada defined or GNAT-specific) pragma.
+ -- Note that the function also works correctly for names of pragmas that
+ -- are not in the main list of pragma Names (AST_Entry, Storage_Size, and
+ -- Storage_Unit (e.g. Name_Storage_Size returns Pragma_Storage_Size).
+
+ function Get_Queuing_Policy_Id (N : Name_Id) return Queuing_Policy_Id;
+ -- Returns Id of queuing policy corresponding to given name. It is an error
+ -- to call this function with a name that is not the name of a check.
+
+ function Get_Task_Dispatching_Policy_Id
+ (N : Name_Id)
+ return Task_Dispatching_Policy_Id;
+ -- Returns Id of task dispatching policy corresponding to given name.
+ -- It is an error to call this function with a name that is not the
+ -- name of a check.
+
+ procedure Record_Convention_Identifier
+ (Id : Name_Id;
+ Convention : Convention_Id);
+ -- A call to this procedure, resulting from an occurrence of a pragma
+ -- Convention_Identifier, records that from now on an occurrence of
+ -- Id will be recognized as a name for the specified convention.
+
+private
+ pragma Inline (Is_Attribute_Name);
+ pragma Inline (Is_Entity_Attribute_Name);
+ pragma Inline (Is_Type_Attribute_Name);
+ pragma Inline (Is_Check_Name);
+ pragma Inline (Is_Locking_Policy_Name);
+ pragma Inline (Is_Operator_Symbol_Name);
+ pragma Inline (Is_Queuing_Policy_Name);
+ pragma Inline (Is_Pragma_Name);
+ pragma Inline (Is_Task_Dispatching_Policy_Name);
+
+end Snames;
diff --git a/gcc/ada/snames.h b/gcc/ada/snames.h
index 18cb4edc31a..e7ecb5d8d35 100644
--- a/gcc/ada/snames.h
+++ b/gcc/ada/snames.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2004 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -129,57 +129,61 @@ extern unsigned char Get_Attribute_Id (int);
#define Attr_Small 81
#define Attr_Storage_Size 82
#define Attr_Storage_Unit 83
-#define Attr_Tag 84
-#define Attr_Target_Name 85
-#define Attr_Terminated 86
-#define Attr_To_Address 87
-#define Attr_Type_Class 88
-#define Attr_UET_Address 89
-#define Attr_Unbiased_Rounding 90
-#define Attr_Unchecked_Access 91
-#define Attr_Unconstrained_Array 92
-#define Attr_Universal_Literal_String 93
-#define Attr_Unrestricted_Access 94
-#define Attr_VADS_Size 95
-#define Attr_Val 96
-#define Attr_Valid 97
-#define Attr_Value_Size 98
-#define Attr_Version 99
-#define Attr_Wide_Character_Size 100
-#define Attr_Wide_Width 101
-#define Attr_Width 102
-#define Attr_Word_Size 103
+#define Attr_Stream_Size 84
+#define Attr_Tag 85
+#define Attr_Target_Name 86
+#define Attr_Terminated 87
+#define Attr_To_Address 88
+#define Attr_Type_Class 89
+#define Attr_UET_Address 90
+#define Attr_Unbiased_Rounding 91
+#define Attr_Unchecked_Access 92
+#define Attr_Unconstrained_Array 93
+#define Attr_Universal_Literal_String 94
+#define Attr_Unrestricted_Access 95
+#define Attr_VADS_Size 96
+#define Attr_Val 97
+#define Attr_Valid 98
+#define Attr_Value_Size 99
+#define Attr_Version 100
+#define Attr_Wchar_T_Size 101
+#define Attr_Wide_Wide_Width 102
+#define Attr_Wide_Width 103
+#define Attr_Width 104
+#define Attr_Word_Size 105
-#define Attr_Adjacent 104
-#define Attr_Ceiling 105
-#define Attr_Copy_Sign 106
-#define Attr_Floor 107
-#define Attr_Fraction 108
-#define Attr_Image 109
-#define Attr_Input 110
-#define Attr_Machine 111
-#define Attr_Max 112
-#define Attr_Min 113
-#define Attr_Model 114
-#define Attr_Pred 115
-#define Attr_Remainder 116
-#define Attr_Rounding 117
-#define Attr_Succ 118
-#define Attr_Truncation 119
-#define Attr_Value 120
-#define Attr_Wide_Image 121
-#define Attr_Wide_Value 122
+#define Attr_Adjacent 106
+#define Attr_Ceiling 107
+#define Attr_Copy_Sign 108
+#define Attr_Floor 109
+#define Attr_Fraction 110
+#define Attr_Image 111
+#define Attr_Input 112
+#define Attr_Machine 113
+#define Attr_Max 114
+#define Attr_Min 115
+#define Attr_Model 116
+#define Attr_Pred 117
+#define Attr_Remainder 118
+#define Attr_Rounding 119
+#define Attr_Succ 120
+#define Attr_Truncation 121
+#define Attr_Value 122
+#define Attr_Wide_Image 123
+#define Attr_Wide_Wide_Image 124
+#define Attr_Wide_Value 125
+#define Attr_Wide_Wide_Value 126
-#define Attr_Output 123
-#define Attr_Read 124
-#define Attr_Write 125
+#define Attr_Output 127
+#define Attr_Read 128
+#define Attr_Write 129
-#define Attr_Elab_Body 126
-#define Attr_Elab_Spec 127
-#define Attr_Storage_Pool 128
+#define Attr_Elab_Body 130
+#define Attr_Elab_Spec 131
+#define Attr_Storage_Pool 132
-#define Attr_Base 129
-#define Attr_Class 130
+#define Attr_Base 133
+#define Attr_Class 134
/* Define the function to check if a Name_Id value is a valid pragma */
@@ -289,66 +293,65 @@ extern unsigned char Get_Pragma_Id (int);
#define Pragma_Inline_Always 85
#define Pragma_Inline_Generic 86
#define Pragma_Inspection_Point 87
-#define Pragma_Interface 88
-#define Pragma_Interface_Name 89
-#define Pragma_Interrupt_Handler 90
-#define Pragma_Interrupt_Priority 91
-#define Pragma_Java_Constructor 92
-#define Pragma_Java_Interface 93
-#define Pragma_Keep_Names 94
-#define Pragma_Link_With 95
-#define Pragma_Linker_Alias 96
-#define Pragma_Linker_Options 97
-#define Pragma_Linker_Section 98
-#define Pragma_List 99
-#define Pragma_Machine_Attribute 100
-#define Pragma_Main 101
-#define Pragma_Main_Storage 102
-#define Pragma_Memory_Size 103
-#define Pragma_No_Return 104
-#define Pragma_Obsolescent 105
-#define Pragma_Optimize 106
-#define Pragma_Optional_Overriding 107
-#define Pragma_Overriding 108
-#define Pragma_Pack 109
-#define Pragma_Page 110
-#define Pragma_Passive 111
-#define Pragma_Preelaborate 112
-#define Pragma_Priority 113
-#define Pragma_Psect_Object 114
-#define Pragma_Pure 115
-#define Pragma_Pure_Function 116
-#define Pragma_Remote_Call_Interface 117
-#define Pragma_Remote_Types 118
-#define Pragma_Share_Generic 119
-#define Pragma_Shared 120
-#define Pragma_Shared_Passive 121
-#define Pragma_Source_Reference 122
-#define Pragma_Stream_Convert 123
-#define Pragma_Subtitle 124
-#define Pragma_Suppress_All 125
-#define Pragma_Suppress_Debug_Info 126
-#define Pragma_Suppress_Initialization 127
-#define Pragma_System_Name 128
-#define Pragma_Task_Info 129
-#define Pragma_Task_Name 130
-#define Pragma_Task_Storage 131
-#define Pragma_Thread_Body 132
-#define Pragma_Time_Slice 133
-#define Pragma_Title 134
-#define Pragma_Unchecked_Union 135
-#define Pragma_Unimplemented_Unit 136
-#define Pragma_Unreferenced 137
-#define Pragma_Unreserve_All_Interrupts 138
-#define Pragma_Volatile 139
-#define Pragma_Volatile_Components 140
-#define Pragma_Weak_External 141
+#define Pragma_Interface_Name 88
+#define Pragma_Interrupt_Handler 89
+#define Pragma_Interrupt_Priority 90
+#define Pragma_Java_Constructor 91
+#define Pragma_Java_Interface 92
+#define Pragma_Keep_Names 93
+#define Pragma_Link_With 94
+#define Pragma_Linker_Alias 95
+#define Pragma_Linker_Options 96
+#define Pragma_Linker_Section 97
+#define Pragma_List 98
+#define Pragma_Machine_Attribute 99
+#define Pragma_Main 100
+#define Pragma_Main_Storage 101
+#define Pragma_Memory_Size 102
+#define Pragma_No_Return 103
+#define Pragma_Obsolescent 104
+#define Pragma_Optimize 105
+#define Pragma_Optional_Overriding 106
+#define Pragma_Pack 107
+#define Pragma_Page 108
+#define Pragma_Passive 109
+#define Pragma_Preelaborate 110
+#define Pragma_Priority 111
+#define Pragma_Psect_Object 112
+#define Pragma_Pure 113
+#define Pragma_Pure_Function 114
+#define Pragma_Remote_Call_Interface 115
+#define Pragma_Remote_Types 116
+#define Pragma_Share_Generic 117
+#define Pragma_Shared 118
+#define Pragma_Shared_Passive 119
+#define Pragma_Source_Reference 120
+#define Pragma_Stream_Convert 121
+#define Pragma_Subtitle 122
+#define Pragma_Suppress_All 123
+#define Pragma_Suppress_Debug_Info 124
+#define Pragma_Suppress_Initialization 125
+#define Pragma_System_Name 126
+#define Pragma_Task_Info 127
+#define Pragma_Task_Name 128
+#define Pragma_Task_Storage 129
+#define Pragma_Thread_Body 130
+#define Pragma_Time_Slice 131
+#define Pragma_Title 132
+#define Pragma_Unchecked_Union 133
+#define Pragma_Unimplemented_Unit 134
+#define Pragma_Unreferenced 135
+#define Pragma_Unreserve_All_Interrupts 136
+#define Pragma_Volatile 137
+#define Pragma_Volatile_Components 138
+#define Pragma_Weak_External 139
/* The following are deliberately out of alphabetical order, see Snames */
-#define Pragma_AST_Entry 142
-#define Pragma_Storage_Size 143
-#define Pragma_Storage_Unit 144
+#define Pragma_AST_Entry 140
+#define Pragma_Interface 141
+#define Pragma_Storage_Size 142
+#define Pragma_Storage_Unit 143
/* Define the numeric values for the conventions. */
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 0d814441c49..24998600727 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -938,7 +938,7 @@ package body Sprint is
end if;
Write_Char_Sloc (''');
- Write_Char_Code (Char_Literal_Value (Node));
+ Write_Char_Code (UI_To_CC (Char_Literal_Value (Node)));
Write_Char (''');
when N_Code_Statement =>
@@ -1363,6 +1363,34 @@ package body Sprint is
Write_Str_With_Col_Check (" with private");
end if;
+ when N_Formal_Abstract_Subprogram_Declaration =>
+ Write_Indent_Str_Sloc ("with ");
+ Sprint_Node (Specification (Node));
+
+ Write_Str_With_Col_Check (" is abstract");
+
+ if Box_Present (Node) then
+ Write_Str_With_Col_Check (" <>");
+ elsif Present (Default_Name (Node)) then
+ Write_Str_With_Col_Check (" ");
+ Sprint_Node (Default_Name (Node));
+ end if;
+
+ Write_Char (';');
+
+ when N_Formal_Concrete_Subprogram_Declaration =>
+ Write_Indent_Str_Sloc ("with ");
+ Sprint_Node (Specification (Node));
+
+ if Box_Present (Node) then
+ Write_Str_With_Col_Check (" is <>");
+ elsif Present (Default_Name (Node)) then
+ Write_Str_With_Col_Check (" is ");
+ Sprint_Node (Default_Name (Node));
+ end if;
+
+ Write_Char (';');
+
when N_Formal_Discrete_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("<>");
@@ -1424,19 +1452,6 @@ package body Sprint is
when N_Formal_Signed_Integer_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("range <>");
- when N_Formal_Subprogram_Declaration =>
- Write_Indent_Str_Sloc ("with ");
- Sprint_Node (Specification (Node));
-
- if Box_Present (Node) then
- Write_Str_With_Col_Check (" is <>");
- elsif Present (Default_Name (Node)) then
- Write_Str_With_Col_Check (" is ");
- Sprint_Node (Default_Name (Node));
- end if;
-
- Write_Char (';');
-
when N_Formal_Type_Declaration =>
Write_Indent_Str_Sloc ("type ");
Write_Id (Defining_Identifier (Node));
diff --git a/gcc/ada/stand.ads b/gcc/ada/stand.ads
index 0970a06a6ee..9c7d6e82d45 100644
--- a/gcc/ada/stand.ads
+++ b/gcc/ada/stand.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,10 @@ package Stand is
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,
@@ -92,12 +94,13 @@ package Stand is
S_Storage_Error,
S_Tasking_Error,
- -- Binary Operators declared in package Standard.
+ -- Binary Operators declared in package Standard
S_Op_Add,
S_Op_And,
S_Op_Concat,
S_Op_Concatw,
+ S_Op_Concatww,
S_Op_Divide,
S_Op_Eq,
S_Op_Expon,
@@ -250,8 +253,10 @@ package Stand is
Standard_ASCII : Entity_Id renames SE (S_ASCII);
Standard_Character : Entity_Id renames SE (S_Character);
Standard_Wide_Character : Entity_Id renames SE (S_Wide_Character);
+ Standard_Wide_Wide_Character : Entity_Id renames SE (S_Wide_Wide_Character);
Standard_String : Entity_Id renames SE (S_String);
Standard_Wide_String : Entity_Id renames SE (S_Wide_String);
+ Standard_Wide_Wide_String : Entity_Id renames SE (S_Wide_Wide_String);
Standard_Boolean : Entity_Id renames SE (S_Boolean);
Standard_False : Entity_Id renames SE (S_False);
@@ -283,6 +288,7 @@ package Stand is
Standard_Op_And : Entity_Id renames SE (S_Op_And);
Standard_Op_Concat : Entity_Id renames SE (S_Op_Concat);
Standard_Op_Concatw : Entity_Id renames SE (S_Op_Concatw);
+ Standard_Op_Concatww : Entity_Id renames SE (S_Op_Concatww);
Standard_Op_Divide : Entity_Id renames SE (S_Op_Divide);
Standard_Op_Eq : Entity_Id renames SE (S_Op_Eq);
Standard_Op_Expon : Entity_Id renames SE (S_Op_Expon);
diff --git a/gcc/ada/stringt.adb b/gcc/ada/stringt.adb
index 5f6fd969cba..5727080ceaf 100644
--- a/gcc/ada/stringt.adb
+++ b/gcc/ada/stringt.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -355,19 +355,19 @@ package body Stringt is
procedure Write_Char_Code (Code : Char_Code) is
- procedure Write_Hex_Byte (J : Natural);
- -- Write single hex digit
+ procedure Write_Hex_Byte (J : Char_Code);
+ -- Write single hex byte (value in range 0 .. 255) as two digits
--------------------
-- Write_Hex_Byte --
--------------------
- procedure Write_Hex_Byte (J : Natural) is
- Hexd : constant String := "0123456789abcdef";
-
+ procedure Write_Hex_Byte (J : Char_Code) is
+ Hexd : constant array (Char_Code range 0 .. 15) of Character :=
+ "0123456789abcdef";
begin
- Write_Char (Hexd (J / 16 + 1));
- Write_Char (Hexd (J mod 16 + 1));
+ Write_Char (Hexd (J / 16));
+ Write_Char (Hexd (J mod 16));
end Write_Hex_Byte;
-- Start of processing for Write_Char_Code
@@ -380,11 +380,19 @@ package body Stringt is
Write_Char ('[');
Write_Char ('"');
+ if Code > 16#FF_FFFF# then
+ Write_Hex_Byte (Code / 2 ** 24);
+ end if;
+
+ if Code > 16#FFFF# then
+ Write_Hex_Byte ((Code / 2 ** 16) mod 256);
+ end if;
+
if Code > 16#FF# then
- Write_Hex_Byte (Natural (Code / 256));
+ Write_Hex_Byte ((Code / 256) mod 256);
end if;
- Write_Hex_Byte (Natural (Code mod 256));
+ Write_Hex_Byte (Code mod 256);
Write_Char ('"');
Write_Char (']');
end if;
diff --git a/gcc/ada/stringt.ads b/gcc/ada/stringt.ads
index 6a6291a5829..d6ab3893579 100644
--- a/gcc/ada/stringt.ads
+++ b/gcc/ada/stringt.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -154,8 +154,8 @@ package Stringt is
-- ASCII graphics (except for double quote) are output literally.
-- The double quote appears as two successive double quotes.
-- All other codes, are output as described for Write_Char_Code. For
- -- example, the string created by folding "A" & ASCII.LF & "Hello" will
- -- print as "A["0a"]Hello". A No_String value prints simply as "no string"
+ -- example, the string created by folding "A" & ASCII.HT & "Hello" will
+ -- print as "A["09"]Hello". A No_String value prints simply as "no string"
-- without surrounding quote marks.
private
diff --git a/gcc/ada/switch-b.adb b/gcc/ada/switch-b.adb
index 8cf9cf4fdbe..5c2f525d924 100644
--- a/gcc/ada/switch-b.adb
+++ b/gcc/ada/switch-b.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005 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- --
@@ -350,6 +350,12 @@ package body Switch.B is
All_Sources := False;
Check_Source_Files := False;
+ -- Processing for X switch
+
+ when 'X' =>
+ Ptr := Ptr + 1;
+ Scan_Pos (Switch_Chars, Max, Ptr, Default_Exit_Status);
+
-- Processing for z switch
when 'z' =>
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 94aa9dc8926..7446359e90e 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -250,7 +250,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
/* Set the current function to be the elaboration procedure and gimplify
what we have. */
current_function_decl = info->elab_proc;
- gimplify_body (&gnu_body, info->elab_proc, false);
+ gimplify_body (&gnu_body, info->elab_proc, true);
/* We should have a BIND_EXPR, but it may or may not have any statements
in it. If it doesn't have any, we have nothing to do. */
@@ -2549,7 +2549,8 @@ gnat_to_gnu (Node_Id gnat_node)
else
gnu_result
= force_fit_type
- (build_int_cst (gnu_result_type, Char_Literal_Value (gnat_node)),
+ (build_int_cst
+ (gnu_result_type, UI_To_CC (Char_Literal_Value (gnat_node))),
false, false, false);
break;
@@ -2747,7 +2748,7 @@ gnat_to_gnu (Node_Id gnat_node)
case N_Object_Renaming_Declaration:
gnat_temp = Defining_Entity (gnat_node);
- /* Don't do anything if this renaming is handled by the front end. or if
+ /* Don't do anything if this renaming is handled by the front end or if
we are just annotating types and this object has a composite or task
type, don't elaborate it. We return the result in case it has any
SAVE_EXPRs in it that need to be evaluated here. */
@@ -3023,11 +3024,8 @@ gnat_to_gnu (Node_Id gnat_node)
if (Null_Record_Present (gnat_node))
gnu_result = gnat_build_constructor (gnu_aggr_type, NULL_TREE);
- else if (TREE_CODE (gnu_aggr_type) == RECORD_TYPE)
- gnu_result
- = assoc_to_constructor (First (Component_Associations (gnat_node)),
- gnu_aggr_type);
- else if (TREE_CODE (gnu_aggr_type) == UNION_TYPE)
+ else if (TREE_CODE (gnu_aggr_type) == UNION_TYPE
+ && TYPE_UNCHECKED_UNION_P (gnu_aggr_type))
{
/* The first element is the discrimant, which we ignore. The
next is the field we're building. Convert the expression
@@ -3041,6 +3039,11 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_result = convert (gnu_field_type,
gnat_to_gnu (Expression (gnat_assoc)));
}
+ else if (TREE_CODE (gnu_aggr_type) == RECORD_TYPE
+ || TREE_CODE (gnu_aggr_type) == UNION_TYPE)
+ gnu_result
+ = assoc_to_constructor (First (Component_Associations (gnat_node)),
+ gnu_aggr_type);
else if (TREE_CODE (gnu_aggr_type) == ARRAY_TYPE)
gnu_result = pos_to_constructor (First (Expressions (gnat_node)),
gnu_aggr_type,
@@ -3542,7 +3545,6 @@ gnat_to_gnu (Node_Id gnat_node)
&& Nkind (Expression (gnat_node)) == N_Function_Call)
gnu_ret_val = call_to_gnu (Expression (gnat_node),
&gnu_result_type, gnu_lhs);
-
else
{
gnu_ret_val = gnat_to_gnu (Expression (gnat_node));
diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb
index 2c52b5c98cc..3ed7fcc4351 100644
--- a/gcc/ada/treepr.adb
+++ b/gcc/ada/treepr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -628,19 +628,6 @@ package body Treepr is
Write_Int (Int (Val));
Write_Char (')');
- elsif Val in Char_Code_Range then
- Write_Str ("Character code = ");
-
- declare
- C : constant Char_Code := Char_Code (Val - Char_Code_Bias);
-
- begin
- Write_Int (Int (C));
- Write_Str (" ('");
- Write_Char_Code (C);
- Write_Str ("')");
- end;
-
else
Print_Str ("****** Incorrect value = ");
Print_Int (Int (Val));
diff --git a/gcc/ada/ttypes.ads b/gcc/ada/ttypes.ads
index 2d31034e503..1be56738290 100644
--- a/gcc/ada/ttypes.ads
+++ b/gcc/ada/ttypes.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -142,11 +142,8 @@ package Ttypes is
Standard_Character_Size : constant Pos := Get_Char_Size;
Standard_Wide_Character_Size : constant Pos := 16;
- -- The Standard.Wide_Character type is special in the sense that
- -- it is not defined in terms of its corresponding C type (wchar_t).
- -- Unfortunately this makes the representation of Wide_Character
- -- incompatible with the C wchar_t type.
- -- ??? This is required by the RM or backward compatibility
+ Standard_Wide_Wide_Character_Size : constant Pos := 32;
+ -- Standard wide character sizes.
-- Note: there is no specific control over the representation of
-- enumeration types. The convention used is that if an enumeration
diff --git a/gcc/ada/types.adb b/gcc/ada/types.adb
index 69b019ed086..9334c311a65 100644
--- a/gcc/ada/types.adb
+++ b/gcc/ada/types.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -153,6 +153,16 @@ package body Types is
end Get_Hex_String;
------------------------
+ -- Get_Wide_Character --
+ ------------------------
+
+ function Get_Wide_Character (C : Char_Code) return Wide_Character is
+ begin
+ pragma Assert (C <= 65535);
+ return Wide_Character'Val (C);
+ end Get_Wide_Character;
+
+ ------------------------
-- In_Character_Range --
------------------------
@@ -161,6 +171,15 @@ package body Types is
return (C <= 255);
end In_Character_Range;
+ -----------------------------
+ -- In_Wide_Character_Range --
+ -----------------------------
+
+ function In_Wide_Character_Range (C : Char_Code) return Boolean is
+ begin
+ return (C <= 65535);
+ end In_Wide_Character_Range;
+
---------------------
-- Make_Time_Stamp --
---------------------
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index 75a2acbc16d..3d649baa8ae 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -106,6 +106,10 @@ pragma Preelaborate (Types);
subtype Line_Terminator is Character range ASCII.LF .. ASCII.CR;
-- Line terminator characters (LF, VT, FF, CR)
+ -- This definition is dubious now that we have two more wide character
+ -- sequences that constitute a line terminator. Every reference to
+ -- this subtype needs checking to make sure the wide character case
+ -- is handled appropriately.
subtype Upper_Half_Character is
Character range Character'Val (16#80#) .. Character'Val (16#FF#);
@@ -234,7 +238,6 @@ pragma Preelaborate (Types);
-- Strings (type String_Id)
-- Universal integers (type Uint)
-- Universal reals (type Ureal)
- -- Character codes (type Char_Code stored with a bias)
-- In most contexts, the strongly typed interface determines which of
-- these types is present. However, there are some situations (involving
@@ -325,10 +328,6 @@ pragma Preelaborate (Types);
-- The range of Uint values is very large, since a substantial part
-- of this range is used to store direct values, see Uintp for details.
- Char_Code_Bias : constant := 2_100_000_000;
- -- A bias value added to character code values stored in the tree which
- -- ensures that they have different values from any of the above types.
-
-- The following subtype definitions are used to provide convenient names
-- for membership tests on Int values to see what data type range they
-- lie in. Such tests appear only in the lowest level packages.
@@ -357,9 +356,6 @@ pragma Preelaborate (Types);
subtype Ureal_Range is Union_Id
range Ureal_Low_Bound .. Ureal_High_Bound;
- subtype Char_Code_Range is Union_Id
- range Char_Code_Bias .. Char_Code_Bias + 2**16 - 1;
-
-----------------------------
-- Types for Namet Package --
-----------------------------
@@ -525,16 +521,19 @@ pragma Preelaborate (Types);
-- The type Char is used for character data internally in the compiler,
-- but character codes in the source are represented by the Char_Code
-- type. Each character literal in the source is interpreted as being one
- -- of the 2**16 possible Wide_Character codes, and a unique integer value
- -- is assigned, corresponding to the POS value in the Wide_Character type.
- -- String literals are similarly interpreted as a sequence of such codes.
+ -- of the 16#8000_0000 possible Wide_Wide_Character codes, and a unique
+ -- Integer Value is assigned, corresponding to the UTF_32 value, which
+ -- also correspondds to the POS value in the Wide_Wide_Character type,
+ -- and also corresponds to the POS value in the Wide_Character and
+ -- Character types for values that are in appropriate range. String
+ -- literals are similarly interpreted as a sequence of such codes.
- -- Note: when character code values are stored in the tree, they are stored
- -- by adding a bias value (Char_Code_Bias) that results in values that can
- -- be distinguished from other types of values stored in the tree.
+ type Char_Code_Base is mod 2 ** 32;
+ for Char_Code_Base'Size use 32;
- type Char_Code is mod 2 ** 16;
- for Char_Code'Size use 16;
+ subtype Char_Code is Char_Code_Base range 0 .. 16#7FFF_FFFF#;
+ for Char_Code'Value_Size use 32;
+ for Char_Code'Object_Size use 32;
function Get_Char_Code (C : Character) return Char_Code;
pragma Inline (Get_Char_Code);
@@ -548,11 +547,21 @@ pragma Preelaborate (Types);
-- Determines if the given character code is in range of type Character,
-- and if so, returns True. If not, returns False.
+ function In_Wide_Character_Range (C : Char_Code) return Boolean;
+ pragma Inline (In_Wide_Character_Range);
+ -- Determines if the given character code is in range of the type
+ -- Wide_Character, and if so, returns True. If not, returns False.
+
function Get_Character (C : Char_Code) return Character;
pragma Inline (Get_Character);
- -- For a character C that is in character range (see above function), this
+ -- For a character C that is in Character range (see above function), this
-- function returns the corresponding Character value. It is an error to
- -- call Get_Character if C is not in character range
+ -- call Get_Character if C is not in C haracter range
+
+ function Get_Wide_Character (C : Char_Code) return Wide_Character;
+ -- For a character C that is in Wide_Character range (see above function),
+ -- this function returns the corresponding Wide_Character value. It is an
+ -- error to call Get_Wide_Character if C is not in Wide_Character range.
---------------------------------------
-- Types used for Library Management --
@@ -768,6 +777,7 @@ pragma Preelaborate (Types);
CE_Index_Check_Failed,
CE_Invalid_Data,
CE_Length_Check_Failed,
+ CE_Null_Not_Allowed,
CE_Overflow_Check_Failed,
CE_Partition_Check_Failed,
CE_Range_Check_Failed,
diff --git a/gcc/ada/types.h b/gcc/ada/types.h
index b4c4eb4419f..04d4a7e24d9 100644
--- a/gcc/ada/types.h
+++ b/gcc/ada/types.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -161,8 +161,6 @@ typedef int Union_Id;
#define Uint_Table_Start 2000000000
#define Uint_High_Bound 2099999999
-#define Char_Code_Bias 2100000000
-
SUBTYPE (List_Range, Int, List_Low_Bound, List_High_Bound)
SUBTYPE (Node_Range, Int, Node_Low_Bound, Node_High_Bound)
SUBTYPE (Elist_Range, Int, Elist_Low_Bound, Elist_High_Bound)
@@ -171,7 +169,6 @@ SUBTYPE (Names_Range, Int, Names_Low_Bound, Names_High_Bound)
SUBTYPE (Strings_Range, Int, Strings_Low_Bound, Strings_High_Bound)
SUBTYPE (Uint_Range, Int, Uint_Low_Bound, Uint_High_Bound)
SUBTYPE (Ureal_Range, Int, Ureal_Low_Bound, Ureal_High_Bound)
-SUBTYPE (Char_Code_Range, Int, Char_Code_Bias, (Char_Code_Bias + 65535))
/* Types for Names_Table Package: */
@@ -286,8 +283,8 @@ typedef Int Ureal;
/* Character Code Type: */
-/* Character code value, intended to be 16 bits. */
-typedef short Char_Code;
+/* Character code value, intended to be 32 bits. */
+typedef unsigned Char_Code;
/* Types Used for Library Management: */
@@ -341,27 +338,28 @@ typedef Int Mechanism_Type;
#define CE_Index_Check_Failed 5
#define CE_Invalid_Data 6
#define CE_Length_Check_Failed 7
-#define CE_Overflow_Check_Failed 8
-#define CE_Partition_Check_Failed 9
-#define CE_Range_Check_Failed 10
-#define CE_Tag_Check_Failed 11
-#define PE_Access_Before_Elaboration 12
-#define PE_Accessibility_Check_Failed 13
-#define PE_All_Guards_Closed 14
-#define PE_Duplicated_Entry_Address 15
-#define PE_Explicit_Raise 16
-#define PE_Finalize_Raised_Exception 17
-#define PE_Misaligned_Address_Value 18
-#define PE_Missing_Return 19
-#define PE_Overlaid_Controlled_Object 20
-#define PE_Potentially_Blocking_Operation 21
-#define PE_Stubbed_Subprogram_Called 22
-#define PE_Unchecked_Union_Restriction 23
-#define PE_Illegal_RACW_E_4_18 24
-#define SE_Empty_Storage_Pool 25
-#define SE_Explicit_Raise 26
-#define SE_Infinite_Recursion 27
-#define SE_Object_Too_Large 28
-#define SE_Restriction_Violation 29
-
-#define LAST_REASON_CODE 29
+#define CE_Null_Not_Allowed 8
+#define CE_Overflow_Check_Failed 9
+#define CE_Partition_Check_Failed 10
+#define CE_Range_Check_Failed 11
+#define CE_Tag_Check_Failed 12
+#define PE_Access_Before_Elaboration 13
+#define PE_Accessibility_Check_Failed 14
+#define PE_All_Guards_Closed 15
+#define PE_Duplicated_Entry_Address 16
+#define PE_Explicit_Raise 17
+#define PE_Finalize_Raised_Exception 18
+#define PE_Misaligned_Address_Value 19
+#define PE_Missing_Return 20
+#define PE_Overlaid_Controlled_Object 21
+#define PE_Potentially_Blocking_Operation 22
+#define PE_Stubbed_Subprogram_Called 23
+#define PE_Unchecked_Union_Restriction 24
+#define PE_Illegal_RACW_E_4_18 25
+#define SE_Empty_Storage_Pool 26
+#define SE_Explicit_Raise 27
+#define SE_Infinite_Recursion 28
+#define SE_Object_Too_Large 29
+#define SE_Restriction_Violation 30
+
+#define LAST_REASON_CODE 30
diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb
index 7b4e7139640..10b2b1367d9 100644
--- a/gcc/ada/uintp.adb
+++ b/gcc/ada/uintp.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -1559,6 +1559,15 @@ package body Uintp is
end;
end UI_Expon;
+ ----------------
+ -- UI_From_CC --
+ ----------------
+
+ function UI_From_CC (Input : Char_Code) return Uint is
+ begin
+ return UI_From_Dint (Dint (Input));
+ end UI_From_CC;
+
------------------
-- UI_From_Dint --
------------------
@@ -2384,6 +2393,39 @@ package body Uintp is
end if;
end UI_Sub;
+ --------------
+ -- UI_To_CC --
+ --------------
+
+ function UI_To_CC (Input : Uint) return Char_Code is
+ begin
+ if Direct (Input) then
+ return Char_Code (Direct_Val (Input));
+
+ -- Case of input is more than one digit
+
+ else
+ declare
+ In_Length : constant Int := N_Digits (Input);
+ In_Vec : UI_Vector (1 .. In_Length);
+ Ret_CC : Char_Code;
+
+ begin
+ Init_Operand (Input, In_Vec);
+
+ -- We assume value is positive
+
+ Ret_CC := 0;
+ for Idx in In_Vec'Range loop
+ Ret_CC := Ret_CC * Char_Code (Base) +
+ Char_Code (abs In_Vec (Idx));
+ end loop;
+
+ return Ret_CC;
+ end;
+ end if;
+ end UI_To_CC;
+
----------------
-- UI_To_Int --
----------------
diff --git a/gcc/ada/uintp.ads b/gcc/ada/uintp.ads
index f1babd179de..97206ade7d7 100644
--- a/gcc/ada/uintp.ads
+++ b/gcc/ada/uintp.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -222,14 +222,21 @@ package Uintp is
-- Returns difference of two integer values
function UI_From_Dint (Input : Dint) return Uint;
- -- Converts Dint value to universal integer form.
+ -- Converts Dint value to universal integer form
function UI_From_Int (Input : Int) return Uint;
- -- Converts Int value to universal integer form.
+ -- Converts Int value to universal integer form
+
+ function UI_From_CC (Input : Char_Code) return Uint;
+ -- Converts Char_Code value to universal integer form
function UI_To_Int (Input : Uint) return Int;
- -- Converts universal integer value to Int. Fatal error
- -- if value is not in appropriate range.
+ -- Converts universal integer value to Int. Fatal error if value is not in
+ -- appropriate range.
+
+ function UI_To_CC (Input : Uint) return Char_Code;
+ -- Converts universal integer value to Char_Code. Fatal error if value is
+ -- not in Char_Code range.
function Num_Bits (Input : Uint) return Nat;
-- Approximate number of binary bits in given universal integer.
diff --git a/gcc/ada/uintp.h b/gcc/ada/uintp.h
index 35f5c9f8bc8..b055a9ed012 100644
--- a/gcc/ada/uintp.h
+++ b/gcc/ada/uintp.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2002, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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,6 +39,10 @@ struct Uint_Entry
#define UI_Is_In_Int_Range uintp__ui_is_in_int_range
extern Boolean UI_Is_In_Int_Range (Uint);
+/* Obtain Char_Code value from Uint input. Value must be in range. */
+#define UI_To_CC uintp__ui_to_cc
+extern Char_Code UI_To_CC (Uint);
+
/* Obtain Int value from Uint input. This will abort if the result is
out of range. */
#define UI_To_Int uintp__ui_to_int
@@ -48,6 +52,10 @@ extern Int UI_To_Int (Uint);
#define UI_From_Int uintp__ui_from_int
extern Uint UI_From_Int (int);
+/* Convert a Char_Code into a Uint. */
+#define UI_From_CC uintp__ui_from_cc
+extern Uint UI_From_CC (Char_Code);
+
/* Similarly, but return a GCC INTEGER_CST. Overflow is tested by the
constant-folding used to build the node. TYPE is the GCC type of the
resulting node. */
diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb
index 44d8df730e7..4441490ac0c 100644
--- a/gcc/ada/usage.adb
+++ b/gcc/ada/usage.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, 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- --
@@ -422,8 +422,7 @@ begin
-- Lines for -gnaty switch
Write_Switch_Char ("y");
- Write_Line ("Enable all style checks except 'o', indent=3");
-
+ Write_Line ("Enable default style checks (same as -gnaty3abcefhiklmnprst)");
Write_Switch_Char ("yxx");
Write_Line ("Enable selected style checks xx = list of parameters:");
Write_Line (" 1-9 check indentation");
@@ -467,4 +466,9 @@ begin
Write_Switch_Char ("83");
Write_Line ("Enforce Ada 83 restrictions");
+ -- Line for -gnat05 switch
+
+ Write_Switch_Char ("05");
+ Write_Line ("Allow Ada 2005 extensions");
+
end Usage;
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index b92fe4bd7c6..6b44189f7d0 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -118,7 +118,6 @@ struct language_function GTY(())
int unused;
};
-static void gnat_define_builtin (const char *, tree, int, const char *, bool);
static void gnat_install_builtins (void);
static tree merge_sizes (tree, tree, tree, bool, bool);
static tree compute_related_constant (tree, tree);
@@ -310,7 +309,7 @@ insert_block (tree block)
}
/* Records a ..._DECL node DECL as belonging to the current lexical scope
- and uses GNAT_NODE for location information. */
+ and uses GNAT_NODE for location information and propagating flags. */
void
gnat_pushdecl (tree decl, Node_Id gnat_node)
@@ -322,6 +321,8 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
else
DECL_CONTEXT (decl) = current_function_decl;
+ TREE_NO_WARNING (decl) = (gnat_node == Empty || Warnings_Off (gnat_node));
+
/* Set the location of DECL and emit a declaration for it. */
if (Present (gnat_node))
Sloc_to_locus (Sloc (gnat_node), &DECL_SOURCE_LOCATION (decl));
@@ -405,110 +406,13 @@ gnat_init_decl_processing (void)
gnat_install_builtins ();
}
-/* Define a builtin function. This is temporary and is just being done
- to initialize *_built_in_decls for the middle-end. We'll want
- to do full builtin processing soon. */
-
-static void
-gnat_define_builtin (const char *name, tree type,
- int function_code, const char *library_name, bool const_p)
-{
- tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
-
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- if (library_name)
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
- make_decl_rtl (decl);
- gnat_pushdecl (decl, Empty);
- DECL_BUILT_IN_CLASS (decl) = BUILT_IN_NORMAL;
- DECL_FUNCTION_CODE (decl) = function_code;
- TREE_READONLY (decl) = const_p;
-
- implicit_built_in_decls[function_code] = decl;
- built_in_decls[function_code] = decl;
-}
-
/* Install the builtin functions the middle-end needs. */
static void
gnat_install_builtins ()
{
- tree ftype;
- tree tmp;
-
- tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, long_integer_type_node, tmp);
- ftype = build_function_type (long_integer_type_node, tmp);
- gnat_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT,
- "__builtin_expect", true);
-
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
- ftype = build_function_type (ptr_void_type_node, tmp);
- gnat_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY,
- "memcpy", false);
-
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
- ftype = build_function_type (integer_type_node, tmp);
- gnat_define_builtin ("__builtin_memcmp", ftype, BUILT_IN_MEMCMP,
- "memcmp", false);
-
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, integer_type_node, tmp);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
- ftype = build_function_type (integer_type_node, tmp);
- gnat_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET,
- "memset", false);
-
- tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node);
- ftype = build_function_type (integer_type_node, tmp);
- gnat_define_builtin ("__builtin_clz", ftype, BUILT_IN_CLZ, "clz", true);
-
- tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node);
- ftype = build_function_type (integer_type_node, tmp);
- gnat_define_builtin ("__builtin_clzl", ftype, BUILT_IN_CLZL, "clzl", true);
-
- tmp = tree_cons (NULL_TREE, long_long_integer_type_node, void_list_node);
- ftype = build_function_type (integer_type_node, tmp);
- gnat_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL, "clzll",
- true);
-
- /* The init_trampoline and adjust_trampoline builtins aren't used directly.
- They are inserted during lowering of nested functions. */
-
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
- ftype = build_function_type (void_type_node, tmp);
- gnat_define_builtin ("__builtin_init_trampoline", ftype,
- BUILT_IN_INIT_TRAMPOLINE, "init_trampoline", false);
-
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node);
- ftype = build_function_type (ptr_void_type_node, tmp);
- gnat_define_builtin ("__builtin_adjust_trampoline", ftype,
- BUILT_IN_ADJUST_TRAMPOLINE, "adjust_trampoline", true);
-
- /* The stack_save, stack_restore, and alloca builtins aren't used directly.
- They are inserted during gimplification to implement variable sized stack
- allocation. */
-
- ftype = build_function_type (ptr_void_type_node, void_list_node);
- gnat_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE,
- "stack_save", false);
-
- tmp = tree_cons (NULL_TREE, ptr_void_type_node, void_list_node);
- ftype = build_function_type (void_type_node, tmp);
- gnat_define_builtin ("__builtin_stack_restore", ftype,
- BUILT_IN_STACK_RESTORE, "stack_restore", false);
-
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- ftype = build_function_type (ptr_void_type_node, tmp);
- gnat_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
- "alloca", false);
+ /* Builtins used by generic optimizers. */
+ build_common_builtin_nodes ();
/* Target specific builtins, such as the AltiVec family on ppc. */
targetm.init_builtins ();
@@ -1280,8 +1184,8 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list,
|| !debug_info_p)
DECL_IGNORED_P (type_decl) = 1;
else if (code != ENUMERAL_TYPE && code != RECORD_TYPE
- && !((code == POINTER_TYPE || code == REFERENCE_TYPE)
- && TYPE_IS_DUMMY_P (TREE_TYPE (type))))
+ && !((code == POINTER_TYPE || code == REFERENCE_TYPE)
+ && TYPE_IS_DUMMY_P (TREE_TYPE (type))))
rest_of_decl_compilation (type_decl, global_bindings_p (), 0);
if (!TYPE_IS_DUMMY_P (type))
@@ -1924,10 +1828,14 @@ gnat_type_for_mode (enum machine_mode mode, int unsignedp)
return NULL_TREE;
else if (mode == VOIDmode)
return void_type_node;
- else if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+ else if (COMPLEX_MODE_P (mode))
+ return NULL_TREE;
+ else if (SCALAR_FLOAT_MODE_P (mode))
return float_type_for_precision (GET_MODE_PRECISION (mode), mode);
- else
+ else if (SCALAR_INT_MODE_P (mode))
return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
+ else
+ return NULL_TREE;
}
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
@@ -3003,21 +2911,29 @@ convert (tree type, tree expr)
return unchecked_convert (type, expr, false);
case UNION_TYPE:
- /* Just validate that the type is indeed that of a field
- of the type. Then make the simple conversion. */
- for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
+ /* For unchecked unions, just validate that the type is indeed that of
+ a field of the type. Then make the simple conversion. */
+ if (TYPE_UNCHECKED_UNION_P (type))
{
- if (TREE_TYPE (tem) == etype)
- return build1 (CONVERT_EXPR, type, expr);
- else if (TREE_CODE (TREE_TYPE (tem)) == RECORD_TYPE
- && (TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (tem))
- || TYPE_IS_PADDING_P (TREE_TYPE (tem)))
- && TREE_TYPE (TYPE_FIELDS (TREE_TYPE (tem))) == etype)
- return build1 (CONVERT_EXPR, type,
- convert (TREE_TYPE (tem), expr));
- }
+ for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
+ {
+ if (TREE_TYPE (tem) == etype)
+ return build1 (CONVERT_EXPR, type, expr);
+ else if (TREE_CODE (TREE_TYPE (tem)) == RECORD_TYPE
+ && (TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (tem))
+ || TYPE_IS_PADDING_P (TREE_TYPE (tem)))
+ && TREE_TYPE (TYPE_FIELDS (TREE_TYPE (tem))) == etype)
+ return build1 (CONVERT_EXPR, type,
+ convert (TREE_TYPE (tem), expr));
+ }
- gcc_unreachable ();
+ gcc_unreachable ();
+ }
+ else
+ /* Otherwise, this is a conversion between a tagged type and some
+ subtype, which we have to mark as a UNION_TYPE because of
+ overlapping fields. */
+ return unchecked_convert (type, expr, false);
case UNCONSTRAINED_ARRAY_TYPE:
/* If EXPR is a constrained array, take its address, convert it to a
@@ -3312,6 +3228,7 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
/* Search the chain of currently reachable declarations for a builtin
FUNCTION_DECL node corresponding to function NAME (an IDENTIFIER_NODE).
Return the first node found, if any, or NULL_TREE otherwise. */
+
tree
builtin_decl_for (tree name __attribute__ ((unused)))
{
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 04ab0cb4ad0..008ac6e3ab2 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2005, 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- *
@@ -660,13 +660,16 @@ build_binary_op (enum tree_code op_code, tree result_type,
might indicate a conversion between a root type and a class-wide
type, which we must not remove. */
while (TREE_CODE (right_operand) == VIEW_CONVERT_EXPR
- && ((TREE_CODE (right_type) == RECORD_TYPE
+ && (((TREE_CODE (right_type) == RECORD_TYPE
+ || TREE_CODE (right_type) == UNION_TYPE)
&& !TYPE_JUSTIFIED_MODULAR_P (right_type)
&& !TYPE_ALIGN_OK (right_type)
&& !TYPE_IS_FAT_POINTER_P (right_type))
|| TREE_CODE (right_type) == ARRAY_TYPE)
- && (((TREE_CODE (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
- == RECORD_TYPE)
+ && ((((TREE_CODE (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
+ == RECORD_TYPE)
+ || (TREE_CODE (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
+ == UNION_TYPE))
&& !(TYPE_JUSTIFIED_MODULAR_P
(TREE_TYPE (TREE_OPERAND (right_operand, 0))))
&& !(TYPE_ALIGN_OK
@@ -695,7 +698,9 @@ build_binary_op (enum tree_code op_code, tree result_type,
operation_type = best_type;
/* If a class-wide type may be involved, force use of the RHS type. */
- if (TREE_CODE (right_type) == RECORD_TYPE && TYPE_ALIGN_OK (right_type))
+ if ((TREE_CODE (right_type) == RECORD_TYPE
+ || TREE_CODE (right_type) == UNION_TYPE)
+ && TYPE_ALIGN_OK (right_type))
operation_type = right_type;
/* Ensure everything on the LHS is valid. If we have a field reference,
@@ -1087,7 +1092,8 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
int unsignedp, volatilep;
inner = get_inner_reference (operand, &bitsize, &bitpos, &offset,
- &mode, &unsignedp, &volatilep, false);
+ &mode, &unsignedp, &volatilep,
+ false);
/* If INNER is a padding type whose field has a self-referential
size, convert to that inner type. We know the offset is zero
diff --git a/gcc/ada/vms_conv.adb b/gcc/ada/vms_conv.adb
index f623727a986..ac66690eadc 100644
--- a/gcc/ada/vms_conv.adb
+++ b/gcc/ada/vms_conv.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2005 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- --
@@ -89,10 +89,10 @@ package body VMS_Conv is
-- the allocated result on the heap.
function Is_Extensionless (F : String) return Boolean;
- -- Returns true if the filename has no extension.
+ -- Returns true if the filename has no extension
function Match (S1, S2 : String) return Boolean;
- -- Determines whether S1 and S2 match. This is a case insensitive match.
+ -- Determines whether S1 and S2 match (this is a case insensitive match)
function Match_Prefix (S1, S2 : String) return Boolean;
-- Determines whether S1 matches a prefix of S2. This is also a case
@@ -662,7 +662,7 @@ package body VMS_Conv is
begin
Put ("GNAT ");
Put_Line (Gnatvsn.Gnat_Version_String);
- Put_Line ("Copyright 1996-2004 Free Software Foundation, Inc.");
+ Put_Line ("Copyright 1996-2005 Free Software Foundation, Inc.");
end Output_Version;
-----------
diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads
index 0dbd0f19a32..2b028bbe2a5 100644
--- a/gcc/ada/vms_data.ads
+++ b/gcc/ada/vms_data.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1996-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2005 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- --
@@ -498,6 +498,21 @@ package VMS_Data is
-- current unit. This is useful for code audit purposes, and also may be
-- used to improve code generation in some cases.
+ S_Bind_Return : aliased constant S := "/RETURN_CODES=" &
+ "POSIX " &
+ "!-X1 " &
+ "VMS " &
+ "-X1";
+ -- /RETURN_CODES=POSIX (D)
+ -- /RETURN_CODES=VMS
+ --
+ -- Specifies the style of default exit code returned. Must be used in
+ -- conjunction with and match the Link qualifer with same name.
+ --
+ -- POSIX (D) Return Posix success (0) by default.
+ --
+ -- VMS Return VMS success (1) by default.
+
S_Bind_RTS : aliased constant S := "/RUNTIME_SYSTEM=|" &
"--RTS=|";
-- /RUNTIME_SYSTEM=xxx
@@ -636,6 +651,7 @@ package VMS_Data is
S_Bind_Report 'Access,
S_Bind_ReportX 'Access,
S_Bind_Restr 'Access,
+ S_Bind_Return 'Access,
S_Bind_RTS 'Access,
S_Bind_Search 'Access,
S_Bind_Shared 'Access,
@@ -3368,7 +3384,8 @@ package VMS_Data is
-- /RETURN_CODES=VMS
--
-- Specifies the style of codes returned by
- -- Ada.Command_Line.Set_Exit_Status.
+ -- Ada.Command_Line.Set_Exit_Status. Must be used in conjunction with
+ -- and match the Bind qualifer with the same name.
--
-- POSIX (D) Return Posix compatible exit codes.
--
@@ -4473,7 +4490,7 @@ package VMS_Data is
S_Pretty_Align : aliased constant S := "/ALIGN=" &
"DEFAULT " &
- "-A1234 " &
+ "-A12345 " &
"OFF " &
"-A0 " &
"COLONS " &
@@ -4483,7 +4500,9 @@ package VMS_Data is
"STATEMENTS " &
"-A3 " &
"ARROWS " &
- "-A4";
+ "-A4 " &
+ "COMPONENT_CLAUSES " &
+ "-A5";
-- /ALIGN[=align-option, align-option, ...]
--
-- Set alignments. By default, all alignments (colons in declarations,
@@ -4492,11 +4511,14 @@ package VMS_Data is
--
-- align-option may be one of the following:
--
- -- OFF (D) Set all alignments to OFF
- -- COLONS Set alignments of colons in declarations to ON
- -- DECLARATIONS Set alignments of initialisations in declarations to ON
- -- STATEMENTS Set alignments of assignments statements to ON
- -- ARROWS Set alignments of arrow delimiters to ON.
+ -- OFF (D) Set all alignments to OFF
+ -- COLONS Set alignments of colons in declarations to ON
+ -- DECLARATIONS Set alignments of initialisations in declarations
+ -- to ON
+ -- STATEMENTS Set alignments of assignments statements to ON
+ -- ARROWS Set alignments of arrow delimiters to ON.
+ -- COMPONENT_CLAUSES Set alignments of AT keywords in component
+ -- clauses ON
--
-- Specifying one of the ON options without first specifying the OFF
-- option has no effect, because by default all alignments are set to ON.
diff --git a/gcc/ada/widechar.adb b/gcc/ada/widechar.adb
index 89514359e53..72cfb4ab63b 100644
--- a/gcc/ada/widechar.adb
+++ b/gcc/ada/widechar.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -42,14 +42,1550 @@ with System.WCh_Con; use System.WCh_Con;
package body Widechar is
+ pragma Style_Checks (Off);
+ -- Allow long lines in this unit
+
+ -----------------------------------------------
+ -- Tables for UTF_32 Categorization Routines --
+ -----------------------------------------------
+
+ -- Note these tables are derived from those given in AI-285. For details
+ -- see //www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00285.TXT?rev=1.22.
+
+ type UTF_32_Range is record
+ Lo : Char_Code;
+ Hi : Char_Code;
+ end record;
+
+ type UTF_32_Ranges is array (Positive range <>) of UTF_32_Range;
+
+ -- The following array includes all characters considered digits, i.e.
+ -- all characters from the Unicode table with categories:
+
+ -- Number, Decimal Digit (Nd)
+
+ UTF_32_Digits : constant UTF_32_Ranges := (
+ (16#00030#, 16#00039#), -- DIGIT ZERO .. DIGIT NINE
+ (16#00660#, 16#00669#), -- ARABIC-INDIC DIGIT ZERO .. ARABIC-INDIC DIGIT NINE
+ (16#006F0#, 16#006F9#), -- EXTENDED ARABIC-INDIC DIGIT ZERO .. EXTENDED ARABIC-INDIC DIGIT NINE
+ (16#00966#, 16#0096F#), -- DEVANAGARI DIGIT ZERO .. DEVANAGARI DIGIT NINE
+ (16#009E6#, 16#009EF#), -- BENGALI DIGIT ZERO .. BENGALI DIGIT NINE
+ (16#00A66#, 16#00A6F#), -- GURMUKHI DIGIT ZERO .. GURMUKHI DIGIT NINE
+ (16#00AE6#, 16#00AEF#), -- GUJARATI DIGIT ZERO .. GUJARATI DIGIT NINE
+ (16#00B66#, 16#00B6F#), -- ORIYA DIGIT ZERO .. ORIYA DIGIT NINE
+ (16#00BE7#, 16#00BEF#), -- TAMIL DIGIT ONE .. TAMIL DIGIT NINE
+ (16#00C66#, 16#00C6F#), -- TELUGU DIGIT ZERO .. TELUGU DIGIT NINE
+ (16#00CE6#, 16#00CEF#), -- KANNADA DIGIT ZERO .. KANNADA DIGIT NINE
+ (16#00D66#, 16#00D6F#), -- MALAYALAM DIGIT ZERO .. MALAYALAM DIGIT NINE
+ (16#00E50#, 16#00E59#), -- THAI DIGIT ZERO .. THAI DIGIT NINE
+ (16#00ED0#, 16#00ED9#), -- LAO DIGIT ZERO .. LAO DIGIT NINE
+ (16#00F20#, 16#00F29#), -- TIBETAN DIGIT ZERO .. TIBETAN DIGIT NINE
+ (16#01040#, 16#01049#), -- MYANMAR DIGIT ZERO .. MYANMAR DIGIT NINE
+ (16#01369#, 16#01371#), -- ETHIOPIC DIGIT ONE .. ETHIOPIC DIGIT NINE
+ (16#017E0#, 16#017E9#), -- KHMER DIGIT ZERO .. KHMER DIGIT NINE
+ (16#01810#, 16#01819#), -- MONGOLIAN DIGIT ZERO .. MONGOLIAN DIGIT NINE
+ (16#01946#, 16#0194F#), -- LIMBU DIGIT ZERO .. LIMBU DIGIT NINE
+ (16#0FF10#, 16#0FF19#), -- FULLWIDTH DIGIT ZERO .. FULLWIDTH DIGIT NINE
+ (16#104A0#, 16#104A9#), -- OSMANYA DIGIT ZERO .. OSMANYA DIGIT NINE
+ (16#1D7CE#, 16#1D7FF#)); -- MATHEMATICAL BOLD DIGIT ZERO .. MATHEMATICAL MONOSPACE DIGIT NINE
+
+ -- The following table includes all characters considered letters, i.e.
+ -- all characters from the Unicode table with categories:
+
+ -- Letter, Uppercase (Lu)
+ -- Letter, Lowercase (Ll)
+ -- Letter, Titlecase (Lt)
+ -- Letter, Modifier (Lm)
+ -- Letter, Other (Lo)
+ -- Number, Letter (Nl)
+
+ UTF_32_Letters : constant UTF_32_Ranges := (
+ (16#00041#, 16#0005A#), -- LATIN CAPITAL LETTER A .. LATIN CAPITAL LETTER Z
+ (16#00061#, 16#0007A#), -- LATIN SMALL LETTER A .. LATIN SMALL LETTER Z
+ (16#000AA#, 16#000AA#), -- FEMININE ORDINAL INDICATOR .. FEMININE ORDINAL INDICATOR
+ (16#000B5#, 16#000B5#), -- MICRO SIGN .. MICRO SIGN
+ (16#000BA#, 16#000BA#), -- MASCULINE ORDINAL INDICATOR .. MASCULINE ORDINAL INDICATOR
+ (16#000C0#, 16#000D6#), -- LATIN CAPITAL LETTER A WITH GRAVE .. LATIN CAPITAL LETTER O WITH DIAERESIS
+ (16#000D8#, 16#000F6#), -- LATIN CAPITAL LETTER O WITH STROKE .. LATIN SMALL LETTER O WITH DIAERESIS
+ (16#000F8#, 16#00236#), -- LATIN SMALL LETTER O WITH STROKE .. LATIN SMALL LETTER T WITH CURL
+ (16#00250#, 16#002C1#), -- LATIN SMALL LETTER TURNED A .. MODIFIER LETTER REVERSED GLOTTAL STOP
+ (16#002C6#, 16#002D1#), -- MODIFIER LETTER CIRCUMFLEX ACCENT .. MODIFIER LETTER HALF TRIANGULAR COLON
+ (16#002E0#, 16#002E4#), -- MODIFIER LETTER SMALL GAMMA .. MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+ (16#002EE#, 16#002EE#), -- MODIFIER LETTER DOUBLE APOSTROPHE .. MODIFIER LETTER DOUBLE APOSTROPHE
+ (16#0037A#, 16#0037A#), -- GREEK YPOGEGRAMMENI .. GREEK YPOGEGRAMMENI
+ (16#00386#, 16#00386#), -- GREEK CAPITAL LETTER ALPHA WITH TONOS .. GREEK CAPITAL LETTER ALPHA WITH TONOS
+ (16#00388#, 16#0038A#), -- GREEK CAPITAL LETTER EPSILON WITH TONOS .. GREEK CAPITAL LETTER IOTA WITH TONOS
+ (16#0038C#, 16#0038C#), -- GREEK CAPITAL LETTER OMICRON WITH TONOS .. GREEK CAPITAL LETTER OMICRON WITH TONOS
+ (16#0038E#, 16#003A1#), -- GREEK CAPITAL LETTER UPSILON WITH TONOS .. GREEK CAPITAL LETTER RHO
+ (16#003A3#, 16#003CE#), -- GREEK CAPITAL LETTER SIGMA .. GREEK SMALL LETTER OMEGA WITH TONOS
+ (16#003D0#, 16#003F5#), -- GREEK BETA SYMBOL .. GREEK LUNATE EPSILON SYMBOL
+ (16#003F7#, 16#003FB#), -- GREEK CAPITAL LETTER SHO .. GREEK SMALL LETTER SAN
+ (16#00400#, 16#00481#), -- CYRILLIC CAPITAL LETTER IE WITH GRAVE .. CYRILLIC SMALL LETTER KOPPA
+ (16#0048A#, 16#004CE#), -- CYRILLIC CAPITAL LETTER SHORT I WITH TAIL .. CYRILLIC SMALL LETTER EM WITH TAIL
+ (16#004D0#, 16#004F5#), -- CYRILLIC CAPITAL LETTER A WITH BREVE .. CYRILLIC SMALL LETTER CHE WITH DIAERESIS
+ (16#004F8#, 16#004F9#), -- CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS .. CYRILLIC SMALL LETTER YERU WITH DIAERESIS
+ (16#00500#, 16#0050F#), -- CYRILLIC CAPITAL LETTER KOMI DE .. CYRILLIC SMALL LETTER KOMI TJE
+ (16#00531#, 16#00556#), -- ARMENIAN CAPITAL LETTER AYB .. ARMENIAN CAPITAL LETTER FEH
+ (16#00559#, 16#00559#), -- ARMENIAN MODIFIER LETTER LEFT HALF RING .. ARMENIAN MODIFIER LETTER LEFT HALF RING
+ (16#00561#, 16#00587#), -- ARMENIAN SMALL LETTER AYB .. ARMENIAN SMALL LIGATURE ECH YIWN
+ (16#005D0#, 16#005EA#), -- HEBREW LETTER ALEF .. HEBREW LETTER TAV
+ (16#005F0#, 16#005F2#), -- HEBREW LIGATURE YIDDISH DOUBLE VAV .. HEBREW LIGATURE YIDDISH DOUBLE YOD
+ (16#00621#, 16#0063A#), -- ARABIC LETTER HAMZA .. ARABIC LETTER GHAIN
+ (16#00640#, 16#0064A#), -- ARABIC TATWEEL .. ARABIC LETTER YEH
+ (16#0066E#, 16#0066F#), -- ARABIC LETTER DOTLESS BEH .. ARABIC LETTER DOTLESS QAF
+ (16#00671#, 16#006D3#), -- ARABIC LETTER ALEF WASLA .. ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
+ (16#006D5#, 16#006D5#), -- ARABIC LETTER AE .. ARABIC LETTER AE
+ (16#006E5#, 16#006E6#), -- ARABIC SMALL WAW .. ARABIC SMALL YEH
+ (16#006EE#, 16#006EF#), -- ARABIC LETTER DAL WITH INVERTED V .. ARABIC LETTER REH WITH INVERTED V
+ (16#006FA#, 16#006FC#), -- ARABIC LETTER SHEEN WITH DOT BELOW .. ARABIC LETTER GHAIN WITH DOT BELOW
+ (16#006FF#, 16#006FF#), -- ARABIC LETTER HEH WITH INVERTED V .. ARABIC LETTER HEH WITH INVERTED V
+ (16#00710#, 16#00710#), -- SYRIAC LETTER ALAPH .. SYRIAC LETTER ALAPH
+ (16#00712#, 16#0072F#), -- SYRIAC LETTER BETH .. SYRIAC LETTER PERSIAN DHALATH
+ (16#0074D#, 16#0074F#), -- SYRIAC LETTER SOGDIAN ZHAIN .. SYRIAC LETTER SOGDIAN FE
+ (16#00780#, 16#007A5#), -- THAANA LETTER HAA .. THAANA LETTER WAAVU
+ (16#007B1#, 16#007B1#), -- THAANA LETTER NAA .. THAANA LETTER NAA
+ (16#00904#, 16#00939#), -- DEVANAGARI LETTER SHORT A .. DEVANAGARI LETTER HA
+ (16#0093D#, 16#0093D#), -- DEVANAGARI SIGN AVAGRAHA .. DEVANAGARI SIGN AVAGRAHA
+ (16#00950#, 16#00950#), -- DEVANAGARI OM .. DEVANAGARI OM
+ (16#00958#, 16#00961#), -- DEVANAGARI LETTER QA .. DEVANAGARI LETTER VOCALIC LL
+ (16#00985#, 16#0098C#), -- BENGALI LETTER A .. BENGALI LETTER VOCALIC L
+ (16#0098F#, 16#00990#), -- BENGALI LETTER E .. BENGALI LETTER AI
+ (16#00993#, 16#009A8#), -- BENGALI LETTER O .. BENGALI LETTER NA
+ (16#009AA#, 16#009B0#), -- BENGALI LETTER PA .. BENGALI LETTER RA
+ (16#009B2#, 16#009B2#), -- BENGALI LETTER LA .. BENGALI LETTER LA
+ (16#009B6#, 16#009B9#), -- BENGALI LETTER SHA .. BENGALI LETTER HA
+ (16#009BD#, 16#009BD#), -- BENGALI SIGN AVAGRAHA .. BENGALI SIGN AVAGRAHA
+ (16#009DC#, 16#009DD#), -- BENGALI LETTER RRA .. BENGALI LETTER RHA
+ (16#009DF#, 16#009E1#), -- BENGALI LETTER YYA .. BENGALI LETTER VOCALIC LL
+ (16#009F0#, 16#009F1#), -- BENGALI LETTER RA WITH MIDDLE DIAGONAL .. BENGALI LETTER RA WITH LOWER DIAGONAL
+ (16#00A05#, 16#00A0A#), -- GURMUKHI LETTER A .. GURMUKHI LETTER UU
+ (16#00A0F#, 16#00A10#), -- GURMUKHI LETTER EE .. GURMUKHI LETTER AI
+ (16#00A13#, 16#00A28#), -- GURMUKHI LETTER OO .. GURMUKHI LETTER NA
+ (16#00A2A#, 16#00A30#), -- GURMUKHI LETTER PA .. GURMUKHI LETTER RA
+ (16#00A32#, 16#00A33#), -- GURMUKHI LETTER LA .. GURMUKHI LETTER LLA
+ (16#00A35#, 16#00A36#), -- GURMUKHI LETTER VA .. GURMUKHI LETTER SHA
+ (16#00A38#, 16#00A39#), -- GURMUKHI LETTER SA .. GURMUKHI LETTER HA
+ (16#00A59#, 16#00A5C#), -- GURMUKHI LETTER KHHA .. GURMUKHI LETTER RRA
+ (16#00A5E#, 16#00A5E#), -- GURMUKHI LETTER FA .. GURMUKHI LETTER FA
+ (16#00A72#, 16#00A74#), -- GURMUKHI IRI .. GURMUKHI EK ONKAR
+ (16#00A85#, 16#00A8D#), -- GUJARATI LETTER A .. GUJARATI VOWEL CANDRA E
+ (16#00A8F#, 16#00A91#), -- GUJARATI LETTER E .. GUJARATI VOWEL CANDRA O
+ (16#00A93#, 16#00AA8#), -- GUJARATI LETTER O .. GUJARATI LETTER NA
+ (16#00AAA#, 16#00AB0#), -- GUJARATI LETTER PA .. GUJARATI LETTER RA
+ (16#00AB2#, 16#00AB3#), -- GUJARATI LETTER LA .. GUJARATI LETTER LLA
+ (16#00AB5#, 16#00AB9#), -- GUJARATI LETTER VA .. GUJARATI LETTER HA
+ (16#00ABD#, 16#00ABD#), -- GUJARATI SIGN AVAGRAHA .. GUJARATI SIGN AVAGRAHA
+ (16#00AD0#, 16#00AD0#), -- GUJARATI OM .. GUJARATI OM
+ (16#00AE0#, 16#00AE1#), -- GUJARATI LETTER VOCALIC RR .. GUJARATI LETTER VOCALIC LL
+ (16#00B05#, 16#00B0C#), -- ORIYA LETTER A .. ORIYA LETTER VOCALIC L
+ (16#00B0F#, 16#00B10#), -- ORIYA LETTER E .. ORIYA LETTER AI
+ (16#00B13#, 16#00B28#), -- ORIYA LETTER O .. ORIYA LETTER NA
+ (16#00B2A#, 16#00B30#), -- ORIYA LETTER PA .. ORIYA LETTER RA
+ (16#00B32#, 16#00B33#), -- ORIYA LETTER LA .. ORIYA LETTER LLA
+ (16#00B35#, 16#00B39#), -- ORIYA LETTER VA .. ORIYA LETTER HA
+ (16#00B3D#, 16#00B3D#), -- ORIYA SIGN AVAGRAHA .. ORIYA SIGN AVAGRAHA
+ (16#00B5C#, 16#00B5D#), -- ORIYA LETTER RRA .. ORIYA LETTER RHA
+ (16#00B5F#, 16#00B61#), -- ORIYA LETTER YYA .. ORIYA LETTER VOCALIC LL
+ (16#00B71#, 16#00B71#), -- ORIYA LETTER WA .. ORIYA LETTER WA
+ (16#00B83#, 16#00B83#), -- TAMIL SIGN VISARGA .. TAMIL SIGN VISARGA
+ (16#00B85#, 16#00B8A#), -- TAMIL LETTER A .. TAMIL LETTER UU
+ (16#00B8E#, 16#00B90#), -- TAMIL LETTER E .. TAMIL LETTER AI
+ (16#00B92#, 16#00B95#), -- TAMIL LETTER O .. TAMIL LETTER KA
+ (16#00B99#, 16#00B9A#), -- TAMIL LETTER NGA .. TAMIL LETTER CA
+ (16#00B9C#, 16#00B9C#), -- TAMIL LETTER JA .. TAMIL LETTER JA
+ (16#00B9E#, 16#00B9F#), -- TAMIL LETTER NYA .. TAMIL LETTER TTA
+ (16#00BA3#, 16#00BA4#), -- TAMIL LETTER NNA .. TAMIL LETTER TA
+ (16#00BA8#, 16#00BAA#), -- TAMIL LETTER NA .. TAMIL LETTER PA
+ (16#00BAE#, 16#00BB5#), -- TAMIL LETTER MA .. TAMIL LETTER VA
+ (16#00BB7#, 16#00BB9#), -- TAMIL LETTER SSA .. TAMIL LETTER HA
+ (16#00C05#, 16#00C0C#), -- TELUGU LETTER A .. TELUGU LETTER VOCALIC L
+ (16#00C0E#, 16#00C10#), -- TELUGU LETTER E .. TELUGU LETTER AI
+ (16#00C12#, 16#00C28#), -- TELUGU LETTER O .. TELUGU LETTER NA
+ (16#00C2A#, 16#00C33#), -- TELUGU LETTER PA .. TELUGU LETTER LLA
+ (16#00C35#, 16#00C39#), -- TELUGU LETTER VA .. TELUGU LETTER HA
+ (16#00C60#, 16#00C61#), -- TELUGU LETTER VOCALIC RR .. TELUGU LETTER VOCALIC LL
+ (16#00C85#, 16#00C8C#), -- KANNADA LETTER A .. KANNADA LETTER VOCALIC L
+ (16#00C8E#, 16#00C90#), -- KANNADA LETTER E .. KANNADA LETTER AI
+ (16#00C92#, 16#00CA8#), -- KANNADA LETTER O .. KANNADA LETTER NA
+ (16#00CAA#, 16#00CB3#), -- KANNADA LETTER PA .. KANNADA LETTER LLA
+ (16#00CB5#, 16#00CB9#), -- KANNADA LETTER VA .. KANNADA LETTER HA
+ (16#00CBD#, 16#00CBD#), -- KANNADA SIGN AVAGRAHA .. KANNADA SIGN AVAGRAHA
+ (16#00CDE#, 16#00CDE#), -- KANNADA LETTER FA .. KANNADA LETTER FA
+ (16#00CE0#, 16#00CE1#), -- KANNADA LETTER VOCALIC RR .. KANNADA LETTER VOCALIC LL
+ (16#00D05#, 16#00D0C#), -- MALAYALAM LETTER A .. MALAYALAM LETTER VOCALIC L
+ (16#00D0E#, 16#00D10#), -- MALAYALAM LETTER E .. MALAYALAM LETTER AI
+ (16#00D12#, 16#00D28#), -- MALAYALAM LETTER O .. MALAYALAM LETTER NA
+ (16#00D2A#, 16#00D39#), -- MALAYALAM LETTER PA .. MALAYALAM LETTER HA
+ (16#00D60#, 16#00D61#), -- MALAYALAM LETTER VOCALIC RR .. MALAYALAM LETTER VOCALIC LL
+ (16#00D85#, 16#00D96#), -- SINHALA LETTER AYANNA .. SINHALA LETTER AUYANNA
+ (16#00D9A#, 16#00DB1#), -- SINHALA LETTER ALPAPRAANA KAYANNA .. SINHALA LETTER DANTAJA NAYANNA
+ (16#00DB3#, 16#00DBB#), -- SINHALA LETTER SANYAKA DAYANNA .. SINHALA LETTER RAYANNA
+ (16#00DBD#, 16#00DBD#), -- SINHALA LETTER DANTAJA LAYANNA .. SINHALA LETTER DANTAJA LAYANNA
+ (16#00DC0#, 16#00DC6#), -- SINHALA LETTER VAYANNA .. SINHALA LETTER FAYANNA
+ (16#00E01#, 16#00E30#), -- THAI CHARACTER KO KAI .. THAI CHARACTER SARA A
+ (16#00E32#, 16#00E33#), -- THAI CHARACTER SARA AA .. THAI CHARACTER SARA AM
+ (16#00E40#, 16#00E46#), -- THAI CHARACTER SARA E .. THAI CHARACTER MAIYAMOK
+ (16#00E81#, 16#00E82#), -- LAO LETTER KO .. LAO LETTER KHO SUNG
+ (16#00E84#, 16#00E84#), -- LAO LETTER KHO TAM .. LAO LETTER KHO TAM
+ (16#00E87#, 16#00E88#), -- LAO LETTER NGO .. LAO LETTER CO
+ (16#00E8A#, 16#00E8A#), -- LAO LETTER SO TAM .. LAO LETTER SO TAM
+ (16#00E8D#, 16#00E8D#), -- LAO LETTER NYO .. LAO LETTER NYO
+ (16#00E94#, 16#00E97#), -- LAO LETTER DO .. LAO LETTER THO TAM
+ (16#00E99#, 16#00E9F#), -- LAO LETTER NO .. LAO LETTER FO SUNG
+ (16#00EA1#, 16#00EA3#), -- LAO LETTER MO .. LAO LETTER LO LING
+ (16#00EA5#, 16#00EA5#), -- LAO LETTER LO LOOT .. LAO LETTER LO LOOT
+ (16#00EA7#, 16#00EA7#), -- LAO LETTER WO .. LAO LETTER WO
+ (16#00EAA#, 16#00EAB#), -- LAO LETTER SO SUNG .. LAO LETTER HO SUNG
+ (16#00EAD#, 16#00EB0#), -- LAO LETTER O .. LAO VOWEL SIGN A
+ (16#00EB2#, 16#00EB3#), -- LAO VOWEL SIGN AA .. LAO VOWEL SIGN AM
+ (16#00EBD#, 16#00EBD#), -- LAO SEMIVOWEL SIGN NYO .. LAO SEMIVOWEL SIGN NYO
+ (16#00EC0#, 16#00EC4#), -- LAO VOWEL SIGN E .. LAO VOWEL SIGN AI
+ (16#00EC6#, 16#00EC6#), -- LAO KO LA .. LAO KO LA
+ (16#00EDC#, 16#00EDD#), -- LAO HO NO .. LAO HO MO
+ (16#00F00#, 16#00F00#), -- TIBETAN SYLLABLE OM .. TIBETAN SYLLABLE OM
+ (16#00F40#, 16#00F47#), -- TIBETAN LETTER KA .. TIBETAN LETTER JA
+ (16#00F49#, 16#00F6A#), -- TIBETAN LETTER NYA .. TIBETAN LETTER FIXED-FORM RA
+ (16#00F88#, 16#00F8B#), -- TIBETAN SIGN LCE TSA CAN .. TIBETAN SIGN GRU MED RGYINGS
+ (16#01000#, 16#01021#), -- MYANMAR LETTER KA .. MYANMAR LETTER A
+ (16#01023#, 16#01027#), -- MYANMAR LETTER I .. MYANMAR LETTER E
+ (16#01029#, 16#0102A#), -- MYANMAR LETTER O .. MYANMAR LETTER AU
+ (16#01050#, 16#01055#), -- MYANMAR LETTER SHA .. MYANMAR LETTER VOCALIC LL
+ (16#010A0#, 16#010C5#), -- GEORGIAN CAPITAL LETTER AN .. GEORGIAN CAPITAL LETTER HOE
+ (16#010D0#, 16#010F8#), -- GEORGIAN LETTER AN .. GEORGIAN LETTER ELIFI
+ (16#01100#, 16#01159#), -- HANGUL CHOSEONG KIYEOK .. HANGUL CHOSEONG YEORINHIEUH
+ (16#0115F#, 16#011A2#), -- HANGUL CHOSEONG FILLER .. HANGUL JUNGSEONG SSANGARAEA
+ (16#011A8#, 16#011F9#), -- HANGUL JONGSEONG KIYEOK .. HANGUL JONGSEONG YEORINHIEUH
+ (16#01200#, 16#01206#), -- ETHIOPIC SYLLABLE HA .. ETHIOPIC SYLLABLE HO
+ (16#01208#, 16#01246#), -- ETHIOPIC SYLLABLE LA .. ETHIOPIC SYLLABLE QO
+ (16#01248#, 16#01248#), -- ETHIOPIC SYLLABLE QWA .. ETHIOPIC SYLLABLE QWA
+ (16#0124A#, 16#0124D#), -- ETHIOPIC SYLLABLE QWI .. ETHIOPIC SYLLABLE QWE
+ (16#01250#, 16#01256#), -- ETHIOPIC SYLLABLE QHA .. ETHIOPIC SYLLABLE QHO
+ (16#01258#, 16#01258#), -- ETHIOPIC SYLLABLE QHWA .. ETHIOPIC SYLLABLE QHWA
+ (16#0125A#, 16#0125D#), -- ETHIOPIC SYLLABLE QHWI .. ETHIOPIC SYLLABLE QHWE
+ (16#01260#, 16#01286#), -- ETHIOPIC SYLLABLE BA .. ETHIOPIC SYLLABLE XO
+ (16#01288#, 16#01288#), -- ETHIOPIC SYLLABLE XWA .. ETHIOPIC SYLLABLE XWA
+ (16#0128A#, 16#0128D#), -- ETHIOPIC SYLLABLE XWI .. ETHIOPIC SYLLABLE XWE
+ (16#01290#, 16#012AE#), -- ETHIOPIC SYLLABLE NA .. ETHIOPIC SYLLABLE KO
+ (16#012B0#, 16#012B0#), -- ETHIOPIC SYLLABLE KWA .. ETHIOPIC SYLLABLE KWA
+ (16#012B2#, 16#012B5#), -- ETHIOPIC SYLLABLE KWI .. ETHIOPIC SYLLABLE KWE
+ (16#012B8#, 16#012BE#), -- ETHIOPIC SYLLABLE KXA .. ETHIOPIC SYLLABLE KXO
+ (16#012C0#, 16#012C0#), -- ETHIOPIC SYLLABLE KXWA .. ETHIOPIC SYLLABLE KXWA
+ (16#012C2#, 16#012C5#), -- ETHIOPIC SYLLABLE KXWI .. ETHIOPIC SYLLABLE KXWE
+ (16#012C8#, 16#012CE#), -- ETHIOPIC SYLLABLE WA .. ETHIOPIC SYLLABLE WO
+ (16#012D0#, 16#012D6#), -- ETHIOPIC SYLLABLE PHARYNGEAL A .. ETHIOPIC SYLLABLE PHARYNGEAL O
+ (16#012D8#, 16#012EE#), -- ETHIOPIC SYLLABLE ZA .. ETHIOPIC SYLLABLE YO
+ (16#012F0#, 16#0130E#), -- ETHIOPIC SYLLABLE DA .. ETHIOPIC SYLLABLE GO
+ (16#01310#, 16#01310#), -- ETHIOPIC SYLLABLE GWA .. ETHIOPIC SYLLABLE GWA
+ (16#01312#, 16#01315#), -- ETHIOPIC SYLLABLE GWI .. ETHIOPIC SYLLABLE GWE
+ (16#01318#, 16#0131E#), -- ETHIOPIC SYLLABLE GGA .. ETHIOPIC SYLLABLE GGO
+ (16#01320#, 16#01346#), -- ETHIOPIC SYLLABLE THA .. ETHIOPIC SYLLABLE TZO
+ (16#01348#, 16#0135A#), -- ETHIOPIC SYLLABLE FA .. ETHIOPIC SYLLABLE FYA
+ (16#013A0#, 16#013F4#), -- CHEROKEE LETTER A .. CHEROKEE LETTER YV
+ (16#01401#, 16#0166C#), -- CANADIAN SYLLABICS E .. CANADIAN SYLLABICS CARRIER TTSA
+ (16#0166F#, 16#01676#), -- CANADIAN SYLLABICS QAI .. CANADIAN SYLLABICS NNGAA
+ (16#01681#, 16#0169A#), -- OGHAM LETTER BEITH .. OGHAM LETTER PEITH
+ (16#016A0#, 16#016EA#), -- RUNIC LETTER FEHU FEOH FE F .. RUNIC LETTER X
+ (16#016EE#, 16#016F0#), -- RUNIC ARLAUG SYMBOL .. RUNIC BELGTHOR SYMBOL
+ (16#01700#, 16#0170C#), -- TAGALOG LETTER A .. TAGALOG LETTER YA
+ (16#0170E#, 16#01711#), -- TAGALOG LETTER LA .. TAGALOG LETTER HA
+ (16#01720#, 16#01731#), -- HANUNOO LETTER A .. HANUNOO LETTER HA
+ (16#01740#, 16#01751#), -- BUHID LETTER A .. BUHID LETTER HA
+ (16#01760#, 16#0176C#), -- TAGBANWA LETTER A .. TAGBANWA LETTER YA
+ (16#0176E#, 16#01770#), -- TAGBANWA LETTER LA .. TAGBANWA LETTER SA
+ (16#01780#, 16#017B3#), -- KHMER LETTER KA .. KHMER INDEPENDENT VOWEL QAU
+ (16#017D7#, 16#017D7#), -- KHMER SIGN LEK TOO .. KHMER SIGN LEK TOO
+ (16#017DC#, 16#017DC#), -- KHMER SIGN AVAKRAHASANYA .. KHMER SIGN AVAKRAHASANYA
+ (16#01820#, 16#01877#), -- MONGOLIAN LETTER A .. MONGOLIAN LETTER MANCHU ZHA
+ (16#01880#, 16#018A8#), -- MONGOLIAN LETTER ALI GALI ANUSVARA ONE .. MONGOLIAN LETTER MANCHU ALI GALI BHA
+ (16#01900#, 16#0191C#), -- LIMBU VOWEL-CARRIER LETTER .. LIMBU LETTER HA
+ (16#01950#, 16#0196D#), -- TAI LE LETTER KA .. TAI LE LETTER AI
+ (16#01970#, 16#01974#), -- TAI LE LETTER TONE-2 .. TAI LE LETTER TONE-6
+ (16#01D00#, 16#01D6B#), -- LATIN LETTER SMALL CAPITAL A .. LATIN SMALL LETTER UE
+ (16#01E00#, 16#01E9B#), -- LATIN CAPITAL LETTER A WITH RING BELOW .. LATIN SMALL LETTER LONG S WITH DOT ABOVE
+ (16#01EA0#, 16#01EF9#), -- LATIN CAPITAL LETTER A WITH DOT BELOW .. LATIN SMALL LETTER Y WITH TILDE
+ (16#01F00#, 16#01F15#), -- GREEK SMALL LETTER ALPHA WITH PSILI .. GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+ (16#01F18#, 16#01F1D#), -- GREEK CAPITAL LETTER EPSILON WITH PSILI .. GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+ (16#01F20#, 16#01F45#), -- GREEK SMALL LETTER ETA WITH PSILI .. GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+ (16#01F48#, 16#01F4D#), -- GREEK CAPITAL LETTER OMICRON WITH PSILI .. GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+ (16#01F50#, 16#01F57#), -- GREEK SMALL LETTER UPSILON WITH PSILI .. GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+ (16#01F59#, 16#01F59#), -- GREEK CAPITAL LETTER UPSILON WITH DASIA .. GREEK CAPITAL LETTER UPSILON WITH DASIA
+ (16#01F5B#, 16#01F5B#), -- GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA .. GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+ (16#01F5D#, 16#01F5D#), -- GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA .. GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+ (16#01F5F#, 16#01F7D#), -- GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI .. GREEK SMALL LETTER OMEGA WITH OXIA
+ (16#01F80#, 16#01FB4#), -- GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI .. GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+ (16#01FB6#, 16#01FBC#), -- GREEK SMALL LETTER ALPHA WITH PERISPOMENI .. GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+ (16#01FBE#, 16#01FBE#), -- GREEK PROSGEGRAMMENI .. GREEK PROSGEGRAMMENI
+ (16#01FC2#, 16#01FC4#), -- GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI .. GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+ (16#01FC6#, 16#01FCC#), -- GREEK SMALL LETTER ETA WITH PERISPOMENI .. GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+ (16#01FD0#, 16#01FD3#), -- GREEK SMALL LETTER IOTA WITH VRACHY .. GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
+ (16#01FD6#, 16#01FDB#), -- GREEK SMALL LETTER IOTA WITH PERISPOMENI .. GREEK CAPITAL LETTER IOTA WITH OXIA
+ (16#01FE0#, 16#01FEC#), -- GREEK SMALL LETTER UPSILON WITH VRACHY .. GREEK CAPITAL LETTER RHO WITH DASIA
+ (16#01FF2#, 16#01FF4#), -- GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI .. GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+ (16#01FF6#, 16#01FFC#), -- GREEK SMALL LETTER OMEGA WITH PERISPOMENI .. GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+ (16#02071#, 16#02071#), -- SUPERSCRIPT LATIN SMALL LETTER I .. SUPERSCRIPT LATIN SMALL LETTER I
+ (16#0207F#, 16#0207F#), -- SUPERSCRIPT LATIN SMALL LETTER N .. SUPERSCRIPT LATIN SMALL LETTER N
+ (16#02102#, 16#02102#), -- DOUBLE-STRUCK CAPITAL C .. DOUBLE-STRUCK CAPITAL C
+ (16#02107#, 16#02107#), -- EULER CONSTANT .. EULER CONSTANT
+ (16#0210A#, 16#02113#), -- SCRIPT SMALL G .. SCRIPT SMALL L
+ (16#02115#, 16#02115#), -- DOUBLE-STRUCK CAPITAL N .. DOUBLE-STRUCK CAPITAL N
+ (16#02119#, 16#0211D#), -- DOUBLE-STRUCK CAPITAL P .. DOUBLE-STRUCK CAPITAL R
+ (16#02124#, 16#02124#), -- DOUBLE-STRUCK CAPITAL Z .. DOUBLE-STRUCK CAPITAL Z
+ (16#02126#, 16#02126#), -- OHM SIGN .. OHM SIGN
+ (16#02128#, 16#02128#), -- BLACK-LETTER CAPITAL Z .. BLACK-LETTER CAPITAL Z
+ (16#0212A#, 16#0212D#), -- KELVIN SIGN .. BLACK-LETTER CAPITAL C
+ (16#0212F#, 16#02131#), -- SCRIPT SMALL E .. SCRIPT CAPITAL F
+ (16#02133#, 16#02139#), -- SCRIPT CAPITAL M .. INFORMATION SOURCE
+ (16#0213D#, 16#0213F#), -- DOUBLE-STRUCK SMALL GAMMA .. DOUBLE-STRUCK CAPITAL PI
+ (16#02145#, 16#02149#), -- DOUBLE-STRUCK ITALIC CAPITAL D .. DOUBLE-STRUCK ITALIC SMALL J
+ (16#02160#, 16#02183#), -- ROMAN NUMERAL ONE .. ROMAN NUMERAL REVERSED ONE HUNDRED
+ (16#03005#, 16#03007#), -- IDEOGRAPHIC ITERATION MARK .. IDEOGRAPHIC NUMBER ZERO
+ (16#03021#, 16#03029#), -- HANGZHOU NUMERAL ONE .. HANGZHOU NUMERAL NINE
+ (16#03031#, 16#03035#), -- VERTICAL KANA REPEAT MARK .. VERTICAL KANA REPEAT MARK LOWER HALF
+ (16#03038#, 16#0303C#), -- HANGZHOU NUMERAL TEN .. MASU MARK
+ (16#03041#, 16#03096#), -- HIRAGANA LETTER SMALL A .. HIRAGANA LETTER SMALL KE
+ (16#0309D#, 16#0309F#), -- HIRAGANA ITERATION MARK .. HIRAGANA DIGRAPH YORI
+ (16#030A1#, 16#030FA#), -- KATAKANA LETTER SMALL A .. KATAKANA LETTER VO
+ (16#030FC#, 16#030FF#), -- KATAKANA-HIRAGANA PROLONGED SOUND MARK .. KATAKANA DIGRAPH KOTO
+ (16#03105#, 16#0312C#), -- BOPOMOFO LETTER B .. BOPOMOFO LETTER GN
+ (16#03131#, 16#0318E#), -- HANGUL LETTER KIYEOK .. HANGUL LETTER ARAEAE
+ (16#031A0#, 16#031B7#), -- BOPOMOFO LETTER BU .. BOPOMOFO FINAL LETTER H
+ (16#031F0#, 16#031FF#), -- KATAKANA LETTER SMALL KU .. KATAKANA LETTER SMALL RO
+ (16#03400#, 16#04DB5#), -- <CJK Ideograph Extension A, First> .. <CJK Ideograph Extension A, Last>
+ (16#04E00#, 16#09FA5#), -- <CJK Ideograph, First> .. <CJK Ideograph, Last>
+ (16#0A000#, 16#0A48C#), -- YI SYLLABLE IT .. YI SYLLABLE YYR
+ (16#0AC00#, 16#0D7A3#), -- <Hangul Syllable, First> .. <Hangul Syllable, Last>
+ (16#0F900#, 16#0FA2D#), -- CJK COMPATIBILITY IDEOGRAPH-F900 .. CJK COMPATIBILITY IDEOGRAPH-FA2D
+ (16#0FA30#, 16#0FA6A#), -- CJK COMPATIBILITY IDEOGRAPH-FA30 .. CJK COMPATIBILITY IDEOGRAPH-FA6A
+ (16#0FB00#, 16#0FB06#), -- LATIN SMALL LIGATURE FF .. LATIN SMALL LIGATURE ST
+ (16#0FB13#, 16#0FB17#), -- ARMENIAN SMALL LIGATURE MEN NOW .. ARMENIAN SMALL LIGATURE MEN XEH
+ (16#0FB1D#, 16#0FB1D#), -- HEBREW LETTER YOD WITH HIRIQ .. HEBREW LETTER YOD WITH HIRIQ
+ (16#0FB1F#, 16#0FB28#), -- HEBREW LIGATURE YIDDISH YOD YOD PATAH .. HEBREW LETTER WIDE TAV
+ (16#0FB2A#, 16#0FB36#), -- HEBREW LETTER SHIN WITH SHIN DOT .. HEBREW LETTER ZAYIN WITH DAGESH
+ (16#0FB38#, 16#0FB3C#), -- HEBREW LETTER TET WITH DAGESH .. HEBREW LETTER LAMED WITH DAGESH
+ (16#0FB3E#, 16#0FB3E#), -- HEBREW LETTER MEM WITH DAGESH .. HEBREW LETTER MEM WITH DAGESH
+ (16#0FB40#, 16#0FB41#), -- HEBREW LETTER NUN WITH DAGESH .. HEBREW LETTER SAMEKH WITH DAGESH
+ (16#0FB43#, 16#0FB44#), -- HEBREW LETTER FINAL PE WITH DAGESH .. HEBREW LETTER PE WITH DAGESH
+ (16#0FB46#, 16#0FBB1#), -- HEBREW LETTER TSADI WITH DAGESH .. ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM
+ (16#0FBD3#, 16#0FD3D#), -- ARABIC LETTER NG ISOLATED FORM .. ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM
+ (16#0FD50#, 16#0FD8F#), -- ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM .. ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM
+ (16#0FD92#, 16#0FDC7#), -- ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM .. ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM
+ (16#0FDF0#, 16#0FDFB#), -- ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM .. ARABIC LIGATURE JALLAJALALOUHOU
+ (16#0FE70#, 16#0FE74#), -- ARABIC FATHATAN ISOLATED FORM .. ARABIC KASRATAN ISOLATED FORM
+ (16#0FE76#, 16#0FEFC#), -- ARABIC FATHA ISOLATED FORM .. ARABIC LIGATURE LAM WITH ALEF FINAL FORM
+ (16#0FF21#, 16#0FF3A#), -- FULLWIDTH LATIN CAPITAL LETTER A .. FULLWIDTH LATIN CAPITAL LETTER Z
+ (16#0FF41#, 16#0FF5A#), -- FULLWIDTH LATIN SMALL LETTER A .. FULLWIDTH LATIN SMALL LETTER Z
+ (16#0FF66#, 16#0FFBE#), -- HALFWIDTH KATAKANA LETTER WO .. HALFWIDTH HANGUL LETTER HIEUH
+ (16#0FFC2#, 16#0FFC7#), -- HALFWIDTH HANGUL LETTER A .. HALFWIDTH HANGUL LETTER E
+ (16#0FFCA#, 16#0FFCF#), -- HALFWIDTH HANGUL LETTER YEO .. HALFWIDTH HANGUL LETTER OE
+ (16#0FFD2#, 16#0FFD7#), -- HALFWIDTH HANGUL LETTER YO .. HALFWIDTH HANGUL LETTER YU
+ (16#0FFDA#, 16#0FFDC#), -- HALFWIDTH HANGUL LETTER EU .. HALFWIDTH HANGUL LETTER I
+ (16#10000#, 16#1000B#), -- LINEAR B SYLLABLE B008 A .. LINEAR B SYLLABLE B046 JE
+ (16#1000D#, 16#10026#), -- LINEAR B SYLLABLE B036 JO .. LINEAR B SYLLABLE B032 QO
+ (16#10028#, 16#1003A#), -- LINEAR B SYLLABLE B060 RA .. LINEAR B SYLLABLE B042 WO
+ (16#1003C#, 16#1003D#), -- LINEAR B SYLLABLE B017 ZA .. LINEAR B SYLLABLE B074 ZE
+ (16#1003F#, 16#1004D#), -- LINEAR B SYLLABLE B020 ZO .. LINEAR B SYLLABLE B091 TWO
+ (16#10050#, 16#1005D#), -- LINEAR B SYMBOL B018 .. LINEAR B SYMBOL B089
+ (16#10080#, 16#100FA#), -- LINEAR B IDEOGRAM B100 MAN .. LINEAR B IDEOGRAM VESSEL B305
+ (16#10300#, 16#1031E#), -- OLD ITALIC LETTER A .. OLD ITALIC LETTER UU
+ (16#10330#, 16#1034A#), -- GOTHIC LETTER AHSA .. GOTHIC LETTER NINE HUNDRED
+ (16#10380#, 16#1039D#), -- UGARITIC LETTER ALPA .. UGARITIC LETTER SSU
+ (16#10400#, 16#1049D#), -- DESERET CAPITAL LETTER LONG I .. OSMANYA LETTER OO
+ (16#10800#, 16#10805#), -- CYPRIOT SYLLABLE A .. CYPRIOT SYLLABLE JA
+ (16#10808#, 16#10808#), -- CYPRIOT SYLLABLE JO .. CYPRIOT SYLLABLE JO
+ (16#1080A#, 16#10835#), -- CYPRIOT SYLLABLE KA .. CYPRIOT SYLLABLE WO
+ (16#10837#, 16#10838#), -- CYPRIOT SYLLABLE XA .. CYPRIOT SYLLABLE XE
+ (16#1083C#, 16#1083C#), -- CYPRIOT SYLLABLE ZA .. CYPRIOT SYLLABLE ZA
+ (16#1083F#, 16#1083F#), -- CYPRIOT SYLLABLE ZO .. CYPRIOT SYLLABLE ZO
+ (16#1D400#, 16#1D454#), -- MATHEMATICAL BOLD CAPITAL A .. MATHEMATICAL ITALIC SMALL G
+ (16#1D456#, 16#1D49C#), -- MATHEMATICAL ITALIC SMALL I .. MATHEMATICAL SCRIPT CAPITAL A
+ (16#1D49E#, 16#1D49F#), -- MATHEMATICAL SCRIPT CAPITAL C .. MATHEMATICAL SCRIPT CAPITAL D
+ (16#1D4A2#, 16#1D4A2#), -- MATHEMATICAL SCRIPT CAPITAL G .. MATHEMATICAL SCRIPT CAPITAL G
+ (16#1D4A5#, 16#1D4A6#), -- MATHEMATICAL SCRIPT CAPITAL J .. MATHEMATICAL SCRIPT CAPITAL K
+ (16#1D4A9#, 16#1D4AC#), -- MATHEMATICAL SCRIPT CAPITAL N .. MATHEMATICAL SCRIPT CAPITAL Q
+ (16#1D4AE#, 16#1D4B9#), -- MATHEMATICAL SCRIPT CAPITAL S .. MATHEMATICAL SCRIPT SMALL D
+ (16#1D4BB#, 16#1D4BB#), -- MATHEMATICAL SCRIPT SMALL F .. MATHEMATICAL SCRIPT SMALL F
+ (16#1D4BD#, 16#1D4C3#), -- MATHEMATICAL SCRIPT SMALL H .. MATHEMATICAL SCRIPT SMALL N
+ (16#1D4C5#, 16#1D505#), -- MATHEMATICAL SCRIPT SMALL P .. MATHEMATICAL FRAKTUR CAPITAL B
+ (16#1D507#, 16#1D50A#), -- MATHEMATICAL FRAKTUR CAPITAL D .. MATHEMATICAL FRAKTUR CAPITAL G
+ (16#1D50D#, 16#1D514#), -- MATHEMATICAL FRAKTUR CAPITAL J .. MATHEMATICAL FRAKTUR CAPITAL Q
+ (16#1D516#, 16#1D51C#), -- MATHEMATICAL FRAKTUR CAPITAL S .. MATHEMATICAL FRAKTUR CAPITAL Y
+ (16#1D51E#, 16#1D539#), -- MATHEMATICAL FRAKTUR SMALL A .. MATHEMATICAL DOUBLE-STRUCK CAPITAL B
+ (16#1D53B#, 16#1D53E#), -- MATHEMATICAL DOUBLE-STRUCK CAPITAL D .. MATHEMATICAL DOUBLE-STRUCK CAPITAL G
+ (16#1D540#, 16#1D544#), -- MATHEMATICAL DOUBLE-STRUCK CAPITAL I .. MATHEMATICAL DOUBLE-STRUCK CAPITAL M
+ (16#1D546#, 16#1D546#), -- MATHEMATICAL DOUBLE-STRUCK CAPITAL O .. MATHEMATICAL DOUBLE-STRUCK CAPITAL O
+ (16#1D54A#, 16#1D550#), -- MATHEMATICAL DOUBLE-STRUCK CAPITAL S .. MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
+ (16#1D552#, 16#1D6A3#), -- MATHEMATICAL DOUBLE-STRUCK SMALL A .. MATHEMATICAL MONOSPACE SMALL Z
+ (16#1D6A8#, 16#1D6C0#), -- MATHEMATICAL BOLD CAPITAL ALPHA .. MATHEMATICAL BOLD CAPITAL OMEGA
+ (16#1D6C2#, 16#1D6DA#), -- MATHEMATICAL BOLD SMALL ALPHA .. MATHEMATICAL BOLD SMALL OMEGA
+ (16#1D6DC#, 16#1D6FA#), -- MATHEMATICAL BOLD EPSILON SYMBOL .. MATHEMATICAL ITALIC CAPITAL OMEGA
+ (16#1D6FC#, 16#1D714#), -- MATHEMATICAL ITALIC SMALL ALPHA .. MATHEMATICAL ITALIC SMALL OMEGA
+ (16#1D716#, 16#1D734#), -- MATHEMATICAL ITALIC EPSILON SYMBOL .. MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
+ (16#1D736#, 16#1D74E#), -- MATHEMATICAL BOLD ITALIC SMALL ALPHA .. MATHEMATICAL BOLD ITALIC SMALL OMEGA
+ (16#1D750#, 16#1D76E#), -- MATHEMATICAL BOLD ITALIC EPSILON SYMBOL .. MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
+ (16#1D770#, 16#1D788#), -- MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA .. MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
+ (16#1D78A#, 16#1D7A8#), -- MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL .. MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
+ (16#1D7AA#, 16#1D7C2#), -- MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA .. MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
+ (16#1D7C4#, 16#1D7C9#), -- MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL .. MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
+ (16#20000#, 16#2A6D6#), -- <CJK Ideograph Extension B, First> .. <CJK Ideograph Extension B, Last>
+ (16#2F800#, 16#2FA1D#)); -- CJK COMPATIBILITY IDEOGRAPH-2F800 .. CJK COMPATIBILITY IDEOGRAPH-2FA1D
+
+ -- The following table includes all characters considered spaces, i.e.
+ -- all characters from the Unicode table with categories:
+
+ -- Separator, Space (Zs)
+
+ UTF_32_Spaces : constant UTF_32_Ranges := (
+ (16#00020#, 16#00020#), -- SPACE .. SPACE
+ (16#000A0#, 16#000A0#), -- NO-BREAK SPACE .. NO-BREAK SPACE
+ (16#01680#, 16#01680#), -- OGHAM SPACE MARK .. OGHAM SPACE MARK
+ (16#0180E#, 16#0180E#), -- MONGOLIAN VOWEL SEPARATOR .. MONGOLIAN VOWEL SEPARATOR
+ (16#02000#, 16#0200B#), -- EN QUAD .. ZERO WIDTH SPACE
+ (16#0202F#, 16#0202F#), -- NARROW NO-BREAK SPACE .. NARROW NO-BREAK SPACE
+ (16#0205F#, 16#0205F#), -- MEDIUM MATHEMATICAL SPACE .. MEDIUM MATHEMATICAL SPACE
+ (16#03000#, 16#03000#)); -- IDEOGRAPHIC SPACE .. IDEOGRAPHIC SPACE
+
+ -- The following table includes all characters considered punctuation,
+ -- i.e. all characters from the Unicode table with categories:
+
+ -- Punctuation, Connector (Pc)
+
+ UTF_32_Punctuation : constant UTF_32_Ranges := (
+ (16#0005F#, 16#0005F#), -- LOW LINE .. LOW LINE
+ (16#0203F#, 16#02040#), -- UNDERTIE .. CHARACTER TIE
+ (16#02054#, 16#02054#), -- INVERTED UNDERTIE .. INVERTED UNDERTIE
+ (16#030FB#, 16#030FB#), -- KATAKANA MIDDLE DOT .. KATAKANA MIDDLE DOT
+ (16#0FE33#, 16#0FE34#), -- PRESENTATION FORM FOR VERTICAL LOW LINE .. PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
+ (16#0FE4D#, 16#0FE4F#), -- DASHED LOW LINE .. WAVY LOW LINE
+ (16#0FF3F#, 16#0FF3F#), -- FULLWIDTH LOW LINE .. FULLWIDTH LOW LINE
+ (16#0FF65#, 16#0FF65#)); -- HALFWIDTH KATAKANA MIDDLE DOT .. HALFWIDTH KATAKANA MIDDLE DOT
+
+ -- The following table includes all characters considered as other format,
+ -- i.e. all characters from the Unicode table with categories:
+
+ -- Other, Format (Cf)
+
+ UTF_32_Other_Format : constant UTF_32_Ranges := (
+ (16#000AD#, 16#000AD#), -- SOFT HYPHEN .. SOFT HYPHEN
+ (16#00600#, 16#00603#), -- ARABIC NUMBER SIGN .. ARABIC SIGN SAFHA
+ (16#006DD#, 16#006DD#), -- ARABIC END OF AYAH .. ARABIC END OF AYAH
+
+ (16#0070F#, 16#0070F#), -- SYRIAC ABBREVIATION MARK .. SYRIAC ABBREVIATION MARK
+ (16#017B4#, 16#017B5#), -- KHMER VOWEL INHERENT AQ .. KHMER VOWEL INHERENT AA
+ (16#0200C#, 16#0200F#), -- ZERO WIDTH NON-JOINER .. RIGHT-TO-LEFT MARK
+ (16#0202A#, 16#0202E#), -- LEFT-TO-RIGHT EMBEDDING .. RIGHT-TO-LEFT OVERRIDE
+ (16#02060#, 16#02063#), -- WORD JOINER .. INVISIBLE SEPARATOR
+ (16#0206A#, 16#0206F#), -- INHIBIT SYMMETRIC SWAPPING .. NOMINAL DIGIT SHAPES
+ (16#0FEFF#, 16#0FEFF#), -- ZERO WIDTH NO-BREAK SPACE .. ZERO WIDTH NO-BREAK SPACE
+ (16#0FFF9#, 16#0FFFB#), -- INTERLINEAR ANNOTATION ANCHOR .. INTERLINEAR ANNOTATION TERMINATOR
+ (16#1D173#, 16#1D17A#), -- MUSICAL SYMBOL BEGIN BEAM .. MUSICAL SYMBOL END PHRASE
+ (16#E0001#, 16#E0001#), -- LANGUAGE TAG .. LANGUAGE TAG
+ (16#E0020#, 16#E007F#)); -- TAG SPACE .. CANCEL TAG
+
+ -- The following table includes all characters considered marks i.e.
+ -- all characters from the Unicode table with categories:
+
+ -- Mark, Nonspacing (Mn)
+ -- Mark, Spacing Combining (Mc)
+
+ UTF_32_Marks : constant UTF_32_Ranges := (
+ (16#00300#, 16#00357#), -- COMBINING GRAVE ACCENT .. COMBINING RIGHT HALF RING ABOVE
+ (16#0035D#, 16#0036F#), -- COMBINING DOUBLE BREVE .. COMBINING LATIN SMALL LETTER X
+ (16#00483#, 16#00486#), -- COMBINING CYRILLIC TITLO .. COMBINING CYRILLIC PSILI PNEUMATA
+ (16#00591#, 16#005A1#), -- HEBREW ACCENT ETNAHTA .. HEBREW ACCENT PAZER
+ (16#005A3#, 16#005B9#), -- HEBREW ACCENT MUNAH .. HEBREW POINT HOLAM
+ (16#005BB#, 16#005BD#), -- HEBREW POINT QUBUTS .. HEBREW POINT METEG
+ (16#005BF#, 16#005BF#), -- HEBREW POINT RAFE .. HEBREW POINT RAFE
+ (16#005C1#, 16#005C2#), -- HEBREW POINT SHIN DOT .. HEBREW POINT SIN DOT
+ (16#005C4#, 16#005C4#), -- HEBREW MARK UPPER DOT .. HEBREW MARK UPPER DOT
+ (16#00610#, 16#00615#), -- ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM .. ARABIC SMALL HIGH TAH
+ (16#0064B#, 16#00658#), -- ARABIC FATHATAN .. ARABIC MARK NOON GHUNNA
+ (16#00670#, 16#00670#), -- ARABIC LETTER SUPERSCRIPT ALEF .. ARABIC LETTER SUPERSCRIPT ALEF
+ (16#006D6#, 16#006DC#), -- ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA .. ARABIC SMALL HIGH SEEN
+ (16#006DF#, 16#006E4#), -- ARABIC SMALL HIGH ROUNDED ZERO .. ARABIC SMALL HIGH MADDA
+ (16#006E7#, 16#006E8#), -- ARABIC SMALL HIGH YEH .. ARABIC SMALL HIGH NOON
+ (16#006EA#, 16#006ED#), -- ARABIC EMPTY CENTRE LOW STOP .. ARABIC SMALL LOW MEEM
+ (16#00711#, 16#00711#), -- SYRIAC LETTER SUPERSCRIPT ALAPH .. SYRIAC LETTER SUPERSCRIPT ALAPH
+ (16#00730#, 16#0074A#), -- SYRIAC PTHAHA ABOVE .. SYRIAC BARREKH
+ (16#007A6#, 16#007B0#), -- THAANA ABAFILI .. THAANA SUKUN
+ (16#00901#, 16#00903#), -- DEVANAGARI SIGN CANDRABINDU .. DEVANAGARI SIGN VISARGA
+ (16#0093C#, 16#0093C#), -- DEVANAGARI SIGN NUKTA .. DEVANAGARI SIGN NUKTA
+ (16#0093E#, 16#0094D#), -- DEVANAGARI VOWEL SIGN AA .. DEVANAGARI SIGN VIRAMA
+ (16#00951#, 16#00954#), -- DEVANAGARI STRESS SIGN UDATTA .. DEVANAGARI ACUTE ACCENT
+ (16#00962#, 16#00963#), -- DEVANAGARI VOWEL SIGN VOCALIC L .. DEVANAGARI VOWEL SIGN VOCALIC LL
+ (16#00981#, 16#00983#), -- BENGALI SIGN CANDRABINDU .. BENGALI SIGN VISARGA
+ (16#009BC#, 16#009BC#), -- BENGALI SIGN NUKTA .. BENGALI SIGN NUKTA
+ (16#009BE#, 16#009C4#), -- BENGALI VOWEL SIGN AA .. BENGALI VOWEL SIGN VOCALIC RR
+ (16#009C7#, 16#009C8#), -- BENGALI VOWEL SIGN E .. BENGALI VOWEL SIGN AI
+ (16#009CB#, 16#009CD#), -- BENGALI VOWEL SIGN O .. BENGALI SIGN VIRAMA
+ (16#009D7#, 16#009D7#), -- BENGALI AU LENGTH MARK .. BENGALI AU LENGTH MARK
+ (16#009E2#, 16#009E3#), -- BENGALI VOWEL SIGN VOCALIC L .. BENGALI VOWEL SIGN VOCALIC LL
+ (16#00A01#, 16#00A03#), -- GURMUKHI SIGN ADAK BINDI .. GURMUKHI SIGN VISARGA
+ (16#00A3C#, 16#00A3C#), -- GURMUKHI SIGN NUKTA .. GURMUKHI SIGN NUKTA
+ (16#00A3E#, 16#00A42#), -- GURMUKHI VOWEL SIGN AA .. GURMUKHI VOWEL SIGN UU
+ (16#00A47#, 16#00A48#), -- GURMUKHI VOWEL SIGN EE .. GURMUKHI VOWEL SIGN AI
+ (16#00A4B#, 16#00A4D#), -- GURMUKHI VOWEL SIGN OO .. GURMUKHI SIGN VIRAMA
+ (16#00A70#, 16#00A71#), -- GURMUKHI TIPPI .. GURMUKHI ADDAK
+ (16#00A81#, 16#00A83#), -- GUJARATI SIGN CANDRABINDU .. GUJARATI SIGN VISARGA
+ (16#00ABC#, 16#00ABC#), -- GUJARATI SIGN NUKTA .. GUJARATI SIGN NUKTA
+ (16#00ABE#, 16#00AC5#), -- GUJARATI VOWEL SIGN AA .. GUJARATI VOWEL SIGN CANDRA E
+ (16#00AC7#, 16#00AC9#), -- GUJARATI VOWEL SIGN E .. GUJARATI VOWEL SIGN CANDRA O
+ (16#00ACB#, 16#00ACD#), -- GUJARATI VOWEL SIGN O .. GUJARATI SIGN VIRAMA
+ (16#00AE2#, 16#00AE3#), -- GUJARATI VOWEL SIGN VOCALIC L .. GUJARATI VOWEL SIGN VOCALIC LL
+ (16#00B01#, 16#00B03#), -- ORIYA SIGN CANDRABINDU .. ORIYA SIGN VISARGA
+ (16#00B3C#, 16#00B3C#), -- ORIYA SIGN NUKTA .. ORIYA SIGN NUKTA
+ (16#00B3E#, 16#00B43#), -- ORIYA VOWEL SIGN AA .. ORIYA VOWEL SIGN VOCALIC R
+ (16#00B47#, 16#00B48#), -- ORIYA VOWEL SIGN E .. ORIYA VOWEL SIGN AI
+ (16#00B4B#, 16#00B4D#), -- ORIYA VOWEL SIGN O .. ORIYA SIGN VIRAMA
+ (16#00B56#, 16#00B57#), -- ORIYA AI LENGTH MARK .. ORIYA AU LENGTH MARK
+ (16#00B82#, 16#00B82#), -- TAMIL SIGN ANUSVARA .. TAMIL SIGN ANUSVARA
+ (16#00BBE#, 16#00BC2#), -- TAMIL VOWEL SIGN AA .. TAMIL VOWEL SIGN UU
+ (16#00BC6#, 16#00BC8#), -- TAMIL VOWEL SIGN E .. TAMIL VOWEL SIGN AI
+ (16#00BCA#, 16#00BCD#), -- TAMIL VOWEL SIGN O .. TAMIL SIGN VIRAMA
+ (16#00BD7#, 16#00BD7#), -- TAMIL AU LENGTH MARK .. TAMIL AU LENGTH MARK
+ (16#00C01#, 16#00C03#), -- TELUGU SIGN CANDRABINDU .. TELUGU SIGN VISARGA
+ (16#00C3E#, 16#00C44#), -- TELUGU VOWEL SIGN AA .. TELUGU VOWEL SIGN VOCALIC RR
+ (16#00C46#, 16#00C48#), -- TELUGU VOWEL SIGN E .. TELUGU VOWEL SIGN AI
+ (16#00C4A#, 16#00C4D#), -- TELUGU VOWEL SIGN O .. TELUGU SIGN VIRAMA
+ (16#00C55#, 16#00C56#), -- TELUGU LENGTH MARK .. TELUGU AI LENGTH MARK
+ (16#00C82#, 16#00C83#), -- KANNADA SIGN ANUSVARA .. KANNADA SIGN VISARGA
+ (16#00CBC#, 16#00CBC#), -- KANNADA SIGN NUKTA .. KANNADA SIGN NUKTA
+ (16#00CBE#, 16#00CC4#), -- KANNADA VOWEL SIGN AA .. KANNADA VOWEL SIGN VOCALIC RR
+ (16#00CC6#, 16#00CC8#), -- KANNADA VOWEL SIGN E .. KANNADA VOWEL SIGN AI
+ (16#00CCA#, 16#00CCD#), -- KANNADA VOWEL SIGN O .. KANNADA SIGN VIRAMA
+ (16#00CD5#, 16#00CD6#), -- KANNADA LENGTH MARK .. KANNADA AI LENGTH MARK
+ (16#00D02#, 16#00D03#), -- MALAYALAM SIGN ANUSVARA .. MALAYALAM SIGN VISARGA
+ (16#00D3E#, 16#00D43#), -- MALAYALAM VOWEL SIGN AA .. MALAYALAM VOWEL SIGN VOCALIC R
+ (16#00D46#, 16#00D48#), -- MALAYALAM VOWEL SIGN E .. MALAYALAM VOWEL SIGN AI
+ (16#00D4A#, 16#00D4D#), -- MALAYALAM VOWEL SIGN O .. MALAYALAM SIGN VIRAMA
+ (16#00D57#, 16#00D57#), -- MALAYALAM AU LENGTH MARK .. MALAYALAM AU LENGTH MARK
+ (16#00D82#, 16#00D83#), -- SINHALA SIGN ANUSVARAYA .. SINHALA SIGN VISARGAYA
+ (16#00DCA#, 16#00DCA#), -- SINHALA SIGN AL-LAKUNA .. SINHALA SIGN AL-LAKUNA
+ (16#00DCF#, 16#00DD4#), -- SINHALA VOWEL SIGN AELA-PILLA .. SINHALA VOWEL SIGN KETTI PAA-PILLA
+ (16#00DD6#, 16#00DD6#), -- SINHALA VOWEL SIGN DIGA PAA-PILLA .. SINHALA VOWEL SIGN DIGA PAA-PILLA
+ (16#00DD8#, 16#00DDF#), -- SINHALA VOWEL SIGN GAETTA-PILLA .. SINHALA VOWEL SIGN GAYANUKITTA
+ (16#00DF2#, 16#00DF3#), -- SINHALA VOWEL SIGN DIGA GAETTA-PILLA .. SINHALA VOWEL SIGN DIGA GAYANUKITTA
+ (16#00E31#, 16#00E31#), -- THAI CHARACTER MAI HAN-AKAT .. THAI CHARACTER MAI HAN-AKAT
+ (16#00E34#, 16#00E3A#), -- THAI CHARACTER SARA I .. THAI CHARACTER PHINTHU
+ (16#00E47#, 16#00E4E#), -- THAI CHARACTER MAITAIKHU .. THAI CHARACTER YAMAKKAN
+ (16#00EB1#, 16#00EB1#), -- LAO VOWEL SIGN MAI KAN .. LAO VOWEL SIGN MAI KAN
+ (16#00EB4#, 16#00EB9#), -- LAO VOWEL SIGN I .. LAO VOWEL SIGN UU
+ (16#00EBB#, 16#00EBC#), -- LAO VOWEL SIGN MAI KON .. LAO SEMIVOWEL SIGN LO
+ (16#00EC8#, 16#00ECD#), -- LAO TONE MAI EK .. LAO NIGGAHITA
+ (16#00F18#, 16#00F19#), -- TIBETAN ASTROLOGICAL SIGN -KHYUD PA .. TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS
+ (16#00F35#, 16#00F35#), -- TIBETAN MARK NGAS BZUNG NYI ZLA .. TIBETAN MARK NGAS BZUNG NYI ZLA
+ (16#00F37#, 16#00F37#), -- TIBETAN MARK NGAS BZUNG SGOR RTAGS .. TIBETAN MARK NGAS BZUNG SGOR RTAGS
+ (16#00F39#, 16#00F39#), -- TIBETAN MARK TSA -PHRU .. TIBETAN MARK TSA -PHRU
+ (16#00F3E#, 16#00F3F#), -- TIBETAN SIGN YAR TSHES .. TIBETAN SIGN MAR TSHES
+ (16#00F71#, 16#00F84#), -- TIBETAN VOWEL SIGN AA .. TIBETAN MARK HALANTA
+ (16#00F86#, 16#00F87#), -- TIBETAN SIGN LCI RTAGS .. TIBETAN SIGN YANG RTAGS
+ (16#00F90#, 16#00F97#), -- TIBETAN SUBJOINED LETTER KA .. TIBETAN SUBJOINED LETTER JA
+ (16#00F99#, 16#00FBC#), -- TIBETAN SUBJOINED LETTER NYA .. TIBETAN SUBJOINED LETTER FIXED-FORM RA
+ (16#00FC6#, 16#00FC6#), -- TIBETAN SYMBOL PADMA GDAN .. TIBETAN SYMBOL PADMA GDAN
+ (16#0102C#, 16#01032#), -- MYANMAR VOWEL SIGN AA .. MYANMAR VOWEL SIGN AI
+ (16#01036#, 16#01039#), -- MYANMAR SIGN ANUSVARA .. MYANMAR SIGN VIRAMA
+ (16#01056#, 16#01059#), -- MYANMAR VOWEL SIGN VOCALIC R .. MYANMAR VOWEL SIGN VOCALIC LL
+ (16#01712#, 16#01714#), -- TAGALOG VOWEL SIGN I .. TAGALOG SIGN VIRAMA
+ (16#01732#, 16#01734#), -- HANUNOO VOWEL SIGN I .. HANUNOO SIGN PAMUDPOD
+ (16#01752#, 16#01753#), -- BUHID VOWEL SIGN I .. BUHID VOWEL SIGN U
+ (16#01772#, 16#01773#), -- TAGBANWA VOWEL SIGN I .. TAGBANWA VOWEL SIGN U
+ (16#017B6#, 16#017D3#), -- KHMER VOWEL SIGN AA .. KHMER SIGN BATHAMASAT
+ (16#017DD#, 16#017DD#), -- KHMER SIGN ATTHACAN .. KHMER SIGN ATTHACAN
+ (16#0180B#, 16#0180D#), -- MONGOLIAN FREE VARIATION SELECTOR ONE .. MONGOLIAN FREE VARIATION SELECTOR THREE
+ (16#018A9#, 16#018A9#), -- MONGOLIAN LETTER ALI GALI DAGALGA .. MONGOLIAN LETTER ALI GALI DAGALGA
+ (16#01920#, 16#0192B#), -- LIMBU VOWEL SIGN A .. LIMBU SUBJOINED LETTER WA
+ (16#01930#, 16#0193B#), -- LIMBU SMALL LETTER KA .. LIMBU SIGN SA-I
+ (16#020D0#, 16#020DC#), -- COMBINING LEFT HARPOON ABOVE .. COMBINING FOUR DOTS ABOVE
+ (16#020E1#, 16#020E1#), -- COMBINING LEFT RIGHT ARROW ABOVE .. COMBINING LEFT RIGHT ARROW ABOVE
+ (16#020E5#, 16#020EA#), -- COMBINING REVERSE SOLIDUS OVERLAY .. COMBINING LEFTWARDS ARROW OVERLAY
+ (16#0302A#, 16#0302F#), -- IDEOGRAPHIC LEVEL TONE MARK .. HANGUL DOUBLE DOT TONE MARK
+ (16#03099#, 16#0309A#), -- COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK .. COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+ (16#0FB1E#, 16#0FB1E#), -- HEBREW POINT JUDEO-SPANISH VARIKA .. HEBREW POINT JUDEO-SPANISH VARIKA
+ (16#0FE00#, 16#0FE0F#), -- VARIATION SELECTOR-1 .. VARIATION SELECTOR-16
+ (16#0FE20#, 16#0FE23#), -- COMBINING LIGATURE LEFT HALF .. COMBINING DOUBLE TILDE RIGHT HALF
+ (16#1D165#, 16#1D169#), -- MUSICAL SYMBOL COMBINING STEM .. MUSICAL SYMBOL COMBINING TREMOLO-3
+ (16#1D16D#, 16#1D172#), -- MUSICAL SYMBOL COMBINING AUGMENTATION DOT .. MUSICAL SYMBOL COMBINING FLAG-5
+ (16#1D17B#, 16#1D182#), -- MUSICAL SYMBOL COMBINING ACCENT .. MUSICAL SYMBOL COMBINING LOURE
+ (16#1D185#, 16#1D18B#), -- MUSICAL SYMBOL COMBINING DOIT .. MUSICAL SYMBOL COMBINING TRIPLE TONGUE
+ (16#1D1AA#, 16#1D1AD#), -- MUSICAL SYMBOL COMBINING DOWN BOW .. MUSICAL SYMBOL COMBINING SNAP PIZZICATO
+ (16#E0100#, 16#E01EF#)); -- VARIATION SELECTOR-17 .. VARIATION SELECTOR-256
+
+ -- The following table includes all characters considered non-graphic,
+ -- i.e. all characters from the Unicode table with categories:
+
+ -- Other, Control (Cc)
+ -- Other, Private Use (Co)
+ -- Other, Surrogate (Cs)
+ -- Other, Format (Cf)
+ -- Separator, Line (Zl)
+ -- Separator, Paragraph (Zp)
+
+ -- In addition, the characters FFFE and FFFF are excluded. Note that the
+ -- defined Ada category of format effector is subsumed by the above set
+ -- of Unicode categories.
+
+ UTF_32_Non_Graphic : constant UTF_32_Ranges := (
+ (16#00000#, 16#0001F#), -- <control> .. <control>
+ (16#0007F#, 16#0009F#), -- <control> .. <control>
+ (16#000AD#, 16#000AD#), -- SOFT HYPHEN .. SOFT HYPHEN
+ (16#00600#, 16#00603#), -- ARABIC NUMBER SIGN .. ARABIC SIGN SAFHA
+ (16#006DD#, 16#006DD#), -- ARABIC END OF AYAH .. ARABIC END OF AYAH
+ (16#0070F#, 16#0070F#), -- SYRIAC ABBREVIATION MARK .. SYRIAC ABBREVIATION MARK
+ (16#017B4#, 16#017B5#), -- KHMER VOWEL INHERENT AQ .. KHMER VOWEL INHERENT AA
+ (16#0200C#, 16#0200F#), -- ZERO WIDTH NON-JOINER .. RIGHT-TO-LEFT MARK
+ (16#02028#, 16#0202E#), -- LINE SEPARATOR .. RIGHT-TO-LEFT OVERRIDE
+ (16#02060#, 16#02063#), -- WORD JOINER .. INVISIBLE SEPARATOR
+ (16#0206A#, 16#0206F#), -- INHIBIT SYMMETRIC SWAPPING .. NOMINAL DIGIT SHAPES
+ (16#0D800#, 16#0F8FF#), -- <Non Private Use High Surrogate, First> .. <Private Use, Last>
+ (16#0FEFF#, 16#0FEFF#), -- ZERO WIDTH NO-BREAK SPACE .. ZERO WIDTH NO-BREAK SPACE
+ (16#0FFF9#, 16#0FFFB#), -- INTERLINEAR ANNOTATION ANCHOR .. INTERLINEAR ANNOTATION TERMINATOR
+ (16#0FFFE#, 16#0FFFF#), -- excluded code positions
+ (16#1D173#, 16#1D17A#), -- MUSICAL SYMBOL BEGIN BEAM .. MUSICAL SYMBOL END PHRASE
+ (16#E0001#, 16#E0001#), -- LANGUAGE TAG .. LANGUAGE TAG
+ (16#E0020#, 16#E007F#), -- TAG SPACE .. CANCEL TAG
+ (16#F0000#, 16#FFFFD#), -- <Plane 15 Private Use, First> .. <Plane 15 Private Use, Last>
+ (16#100000#, 16#10FFFD#)); -- <Plane 16 Private Use, First> .. <Plane 16 Private Use, Last>
+
+ -- The following two tables define the mapping to upper case. The first
+ -- table gives the ranges of lower case letters. The corresponding entry
+ -- in Uppercase_Adjust shows the amount to be added (or subtracted) from
+ -- the code value to get the corresponding upper case letter.
+
+ -- Note that this folding is not reversible, for example lower case
+ -- dotless i folds to normal upper case I, and that cannot be reversed.
+
+ Lower_Case_Letters : constant UTF_32_Ranges := (
+ (16#00061#, 16#0007A#), -- LATIN SMALL LETTER A .. LATIN SMALL LETTER Z
+ (16#000B5#, 16#000B5#), -- MICRO SIGN .. MICRO SIGN
+ (16#000E0#, 16#000F6#), -- LATIN SMALL LETTER A WITH GRAVE .. LATIN SMALL LETTER O WITH DIAERESIS
+ (16#000F8#, 16#000FE#), -- LATIN SMALL LETTER O WITH STROKE .. LATIN SMALL LETTER THORN
+ (16#000FF#, 16#000FF#), -- LATIN SMALL LETTER Y WITH DIAERESIS .. LATIN SMALL LETTER Y WITH DIAERESIS
+ (16#00101#, 16#00101#), -- LATIN SMALL LETTER A WITH MACRON .. LATIN SMALL LETTER A WITH MACRON
+ (16#00103#, 16#00103#), -- LATIN SMALL LETTER A WITH BREVE .. LATIN SMALL LETTER A WITH BREVE
+ (16#00105#, 16#00105#), -- LATIN SMALL LETTER A WITH OGONEK .. LATIN SMALL LETTER A WITH OGONEK
+ (16#00107#, 16#00107#), -- LATIN SMALL LETTER C WITH ACUTE .. LATIN SMALL LETTER C WITH ACUTE
+ (16#00109#, 16#00109#), -- LATIN SMALL LETTER C WITH CIRCUMFLEX .. LATIN SMALL LETTER C WITH CIRCUMFLEX
+ (16#0010B#, 16#0010B#), -- LATIN SMALL LETTER C WITH DOT ABOVE .. LATIN SMALL LETTER C WITH DOT ABOVE
+ (16#0010D#, 16#0010D#), -- LATIN SMALL LETTER C WITH CARON .. LATIN SMALL LETTER C WITH CARON
+ (16#0010F#, 16#0010F#), -- LATIN SMALL LETTER D WITH CARON .. LATIN SMALL LETTER D WITH CARON
+ (16#00111#, 16#00111#), -- LATIN SMALL LETTER D WITH STROKE .. LATIN SMALL LETTER D WITH STROKE
+ (16#00113#, 16#00113#), -- LATIN SMALL LETTER E WITH MACRON .. LATIN SMALL LETTER E WITH MACRON
+ (16#00115#, 16#00115#), -- LATIN SMALL LETTER E WITH BREVE .. LATIN SMALL LETTER E WITH BREVE
+ (16#00117#, 16#00117#), -- LATIN SMALL LETTER E WITH DOT ABOVE .. LATIN SMALL LETTER E WITH DOT ABOVE
+ (16#00119#, 16#00119#), -- LATIN SMALL LETTER E WITH OGONEK .. LATIN SMALL LETTER E WITH OGONEK
+ (16#0011B#, 16#0011B#), -- LATIN SMALL LETTER E WITH CARON .. LATIN SMALL LETTER E WITH CARON
+ (16#0011D#, 16#0011D#), -- LATIN SMALL LETTER G WITH CIRCUMFLEX .. LATIN SMALL LETTER G WITH CIRCUMFLEX
+ (16#0011F#, 16#0011F#), -- LATIN SMALL LETTER G WITH BREVE .. LATIN SMALL LETTER G WITH BREVE
+ (16#00121#, 16#00121#), -- LATIN SMALL LETTER G WITH DOT ABOVE .. LATIN SMALL LETTER G WITH DOT ABOVE
+ (16#00123#, 16#00123#), -- LATIN SMALL LETTER G WITH CEDILLA .. LATIN SMALL LETTER G WITH CEDILLA
+ (16#00125#, 16#00125#), -- LATIN SMALL LETTER H WITH CIRCUMFLEX .. LATIN SMALL LETTER H WITH CIRCUMFLEX
+ (16#00127#, 16#00127#), -- LATIN SMALL LETTER H WITH STROKE .. LATIN SMALL LETTER H WITH STROKE
+ (16#00129#, 16#00129#), -- LATIN SMALL LETTER I WITH TILDE .. LATIN SMALL LETTER I WITH TILDE
+ (16#0012B#, 16#0012B#), -- LATIN SMALL LETTER I WITH MACRON .. LATIN SMALL LETTER I WITH MACRON
+ (16#0012D#, 16#0012D#), -- LATIN SMALL LETTER I WITH BREVE .. LATIN SMALL LETTER I WITH BREVE
+ (16#0012F#, 16#0012F#), -- LATIN SMALL LETTER I WITH OGONEK .. LATIN SMALL LETTER I WITH OGONEK
+ (16#00131#, 16#00131#), -- LATIN SMALL LETTER DOTLESS I .. LATIN SMALL LETTER DOTLESS I
+ (16#00133#, 16#00133#), -- LATIN SMALL LIGATURE IJ .. LATIN SMALL LIGATURE IJ
+ (16#00135#, 16#00135#), -- LATIN SMALL LETTER J WITH CIRCUMFLEX .. LATIN SMALL LETTER J WITH CIRCUMFLEX
+ (16#00137#, 16#00137#), -- LATIN SMALL LETTER K WITH CEDILLA .. LATIN SMALL LETTER K WITH CEDILLA
+ (16#0013A#, 16#0013A#), -- LATIN SMALL LETTER L WITH ACUTE .. LATIN SMALL LETTER L WITH ACUTE
+ (16#0013C#, 16#0013C#), -- LATIN SMALL LETTER L WITH CEDILLA .. LATIN SMALL LETTER L WITH CEDILLA
+ (16#0013E#, 16#0013E#), -- LATIN SMALL LETTER L WITH CARON .. LATIN SMALL LETTER L WITH CARON
+ (16#00140#, 16#00140#), -- LATIN SMALL LETTER L WITH MIDDLE DOT .. LATIN SMALL LETTER L WITH MIDDLE DOT
+ (16#00142#, 16#00142#), -- LATIN SMALL LETTER L WITH STROKE .. LATIN SMALL LETTER L WITH STROKE
+ (16#00144#, 16#00144#), -- LATIN SMALL LETTER N WITH ACUTE .. LATIN SMALL LETTER N WITH ACUTE
+ (16#00146#, 16#00146#), -- LATIN SMALL LETTER N WITH CEDILLA .. LATIN SMALL LETTER N WITH CEDILLA
+ (16#00148#, 16#00148#), -- LATIN SMALL LETTER N WITH CARON .. LATIN SMALL LETTER N WITH CARON
+ (16#0014B#, 16#0014B#), -- LATIN SMALL LETTER ENG .. LATIN SMALL LETTER ENG
+ (16#0014D#, 16#0014D#), -- LATIN SMALL LETTER O WITH MACRON .. LATIN SMALL LETTER O WITH MACRON
+ (16#0014F#, 16#0014F#), -- LATIN SMALL LETTER O WITH BREVE .. LATIN SMALL LETTER O WITH BREVE
+ (16#00151#, 16#00151#), -- LATIN SMALL LETTER O WITH DOUBLE ACUTE .. LATIN SMALL LETTER O WITH DOUBLE ACUTE
+ (16#00153#, 16#00153#), -- LATIN SMALL LIGATURE OE .. LATIN SMALL LIGATURE OE
+ (16#00155#, 16#00155#), -- LATIN SMALL LETTER R WITH ACUTE .. LATIN SMALL LETTER R WITH ACUTE
+ (16#00157#, 16#00157#), -- LATIN SMALL LETTER R WITH CEDILLA .. LATIN SMALL LETTER R WITH CEDILLA
+ (16#00159#, 16#00159#), -- LATIN SMALL LETTER R WITH CARON .. LATIN SMALL LETTER R WITH CARON
+ (16#0015B#, 16#0015B#), -- LATIN SMALL LETTER S WITH ACUTE .. LATIN SMALL LETTER S WITH ACUTE
+ (16#0015D#, 16#0015D#), -- LATIN SMALL LETTER S WITH CIRCUMFLEX .. LATIN SMALL LETTER S WITH CIRCUMFLEX
+ (16#0015F#, 16#0015F#), -- LATIN SMALL LETTER S WITH CEDILLA .. LATIN SMALL LETTER S WITH CEDILLA
+ (16#00161#, 16#00161#), -- LATIN SMALL LETTER S WITH CARON .. LATIN SMALL LETTER S WITH CARON
+ (16#00163#, 16#00163#), -- LATIN SMALL LETTER T WITH CEDILLA .. LATIN SMALL LETTER T WITH CEDILLA
+ (16#00165#, 16#00165#), -- LATIN SMALL LETTER T WITH CARON .. LATIN SMALL LETTER T WITH CARON
+ (16#00167#, 16#00167#), -- LATIN SMALL LETTER T WITH STROKE .. LATIN SMALL LETTER T WITH STROKE
+ (16#00169#, 16#00169#), -- LATIN SMALL LETTER U WITH TILDE .. LATIN SMALL LETTER U WITH TILDE
+ (16#0016B#, 16#0016B#), -- LATIN SMALL LETTER U WITH MACRON .. LATIN SMALL LETTER U WITH MACRON
+ (16#0016D#, 16#0016D#), -- LATIN SMALL LETTER U WITH BREVE .. LATIN SMALL LETTER U WITH BREVE
+ (16#0016F#, 16#0016F#), -- LATIN SMALL LETTER U WITH RING ABOVE .. LATIN SMALL LETTER U WITH RING ABOVE
+ (16#00171#, 16#00171#), -- LATIN SMALL LETTER U WITH DOUBLE ACUTE .. LATIN SMALL LETTER U WITH DOUBLE ACUTE
+ (16#00173#, 16#00173#), -- LATIN SMALL LETTER U WITH OGONEK .. LATIN SMALL LETTER U WITH OGONEK
+ (16#00175#, 16#00175#), -- LATIN SMALL LETTER W WITH CIRCUMFLEX .. LATIN SMALL LETTER W WITH CIRCUMFLEX
+ (16#00177#, 16#00177#), -- LATIN SMALL LETTER Y WITH CIRCUMFLEX .. LATIN SMALL LETTER Y WITH CIRCUMFLEX
+ (16#0017A#, 16#0017A#), -- LATIN SMALL LETTER Z WITH ACUTE .. LATIN SMALL LETTER Z WITH ACUTE
+ (16#0017C#, 16#0017C#), -- LATIN SMALL LETTER Z WITH DOT ABOVE .. LATIN SMALL LETTER Z WITH DOT ABOVE
+ (16#0017E#, 16#0017E#), -- LATIN SMALL LETTER Z WITH CARON .. LATIN SMALL LETTER Z WITH CARON
+ (16#0017F#, 16#0017F#), -- LATIN SMALL LETTER LONG S .. LATIN SMALL LETTER LONG S
+ (16#00183#, 16#00183#), -- LATIN SMALL LETTER B WITH TOPBAR .. LATIN SMALL LETTER B WITH TOPBAR
+ (16#00185#, 16#00185#), -- LATIN SMALL LETTER TONE SIX .. LATIN SMALL LETTER TONE SIX
+ (16#00188#, 16#00188#), -- LATIN SMALL LETTER C WITH HOOK .. LATIN SMALL LETTER C WITH HOOK
+ (16#0018C#, 16#0018C#), -- LATIN SMALL LETTER D WITH TOPBAR .. LATIN SMALL LETTER D WITH TOPBAR
+ (16#00192#, 16#00192#), -- LATIN SMALL LETTER F WITH HOOK .. LATIN SMALL LETTER F WITH HOOK
+ (16#00195#, 16#00195#), -- LATIN SMALL LETTER HV .. LATIN SMALL LETTER HV
+ (16#00199#, 16#00199#), -- LATIN SMALL LETTER K WITH HOOK .. LATIN SMALL LETTER K WITH HOOK
+ (16#0019E#, 16#0019E#), -- LATIN SMALL LETTER N WITH LONG RIGHT LEG .. LATIN SMALL LETTER N WITH LONG RIGHT LEG
+ (16#001A1#, 16#001A1#), -- LATIN SMALL LETTER O WITH HORN .. LATIN SMALL LETTER O WITH HORN
+ (16#001A3#, 16#001A3#), -- LATIN SMALL LETTER OI .. LATIN SMALL LETTER OI
+ (16#001A5#, 16#001A5#), -- LATIN SMALL LETTER P WITH HOOK .. LATIN SMALL LETTER P WITH HOOK
+ (16#001A8#, 16#001A8#), -- LATIN SMALL LETTER TONE TWO .. LATIN SMALL LETTER TONE TWO
+ (16#001AD#, 16#001AD#), -- LATIN SMALL LETTER T WITH HOOK .. LATIN SMALL LETTER T WITH HOOK
+ (16#001B0#, 16#001B0#), -- LATIN SMALL LETTER U WITH HORN .. LATIN SMALL LETTER U WITH HORN
+ (16#001B4#, 16#001B4#), -- LATIN SMALL LETTER Y WITH HOOK .. LATIN SMALL LETTER Y WITH HOOK
+ (16#001B6#, 16#001B6#), -- LATIN SMALL LETTER Z WITH STROKE .. LATIN SMALL LETTER Z WITH STROKE
+ (16#001B9#, 16#001B9#), -- LATIN SMALL LETTER EZH REVERSED .. LATIN SMALL LETTER EZH REVERSED
+ (16#001BD#, 16#001BD#), -- LATIN SMALL LETTER TONE FIVE .. LATIN SMALL LETTER TONE FIVE
+ (16#001BF#, 16#001BF#), -- LATIN LETTER WYNN .. LATIN LETTER WYNN
+ (16#001C5#, 16#001C5#), -- LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON .. LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+ (16#001C6#, 16#001C6#), -- LATIN SMALL LETTER DZ WITH CARON .. LATIN SMALL LETTER DZ WITH CARON
+ (16#001C8#, 16#001C8#), -- LATIN CAPITAL LETTER L WITH SMALL LETTER J .. LATIN CAPITAL LETTER L WITH SMALL LETTER J
+ (16#001C9#, 16#001C9#), -- LATIN SMALL LETTER LJ .. LATIN SMALL LETTER LJ
+ (16#001CB#, 16#001CB#), -- LATIN CAPITAL LETTER N WITH SMALL LETTER J .. LATIN CAPITAL LETTER N WITH SMALL LETTER J
+ (16#001CC#, 16#001CC#), -- LATIN SMALL LETTER NJ .. LATIN SMALL LETTER NJ
+ (16#001CE#, 16#001CE#), -- LATIN SMALL LETTER A WITH CARON .. LATIN SMALL LETTER A WITH CARON
+ (16#001D0#, 16#001D0#), -- LATIN SMALL LETTER I WITH CARON .. LATIN SMALL LETTER I WITH CARON
+ (16#001D2#, 16#001D2#), -- LATIN SMALL LETTER O WITH CARON .. LATIN SMALL LETTER O WITH CARON
+ (16#001D4#, 16#001D4#), -- LATIN SMALL LETTER U WITH CARON .. LATIN SMALL LETTER U WITH CARON
+ (16#001D6#, 16#001D6#), -- LATIN SMALL LETTER U WITH DIAERESIS AND MACRON .. LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+ (16#001D8#, 16#001D8#), -- LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE .. LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+ (16#001DA#, 16#001DA#), -- LATIN SMALL LETTER U WITH DIAERESIS AND CARON .. LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+ (16#001DC#, 16#001DC#), -- LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE .. LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+ (16#001DD#, 16#001DD#), -- LATIN SMALL LETTER TURNED E .. LATIN SMALL LETTER TURNED E
+ (16#001DF#, 16#001DF#), -- LATIN SMALL LETTER A WITH DIAERESIS AND MACRON .. LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+ (16#001E1#, 16#001E1#), -- LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON .. LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+ (16#001E3#, 16#001E3#), -- LATIN SMALL LETTER AE WITH MACRON .. LATIN SMALL LETTER AE WITH MACRON
+ (16#001E5#, 16#001E5#), -- LATIN SMALL LETTER G WITH STROKE .. LATIN SMALL LETTER G WITH STROKE
+ (16#001E7#, 16#001E7#), -- LATIN SMALL LETTER G WITH CARON .. LATIN SMALL LETTER G WITH CARON
+ (16#001E9#, 16#001E9#), -- LATIN SMALL LETTER K WITH CARON .. LATIN SMALL LETTER K WITH CARON
+ (16#001EB#, 16#001EB#), -- LATIN SMALL LETTER O WITH OGONEK .. LATIN SMALL LETTER O WITH OGONEK
+ (16#001ED#, 16#001ED#), -- LATIN SMALL LETTER O WITH OGONEK AND MACRON .. LATIN SMALL LETTER O WITH OGONEK AND MACRON
+ (16#001EF#, 16#001EF#), -- LATIN SMALL LETTER EZH WITH CARON .. LATIN SMALL LETTER EZH WITH CARON
+ (16#001F2#, 16#001F2#), -- LATIN CAPITAL LETTER D WITH SMALL LETTER Z .. LATIN CAPITAL LETTER D WITH SMALL LETTER Z
+ (16#001F3#, 16#001F3#), -- LATIN SMALL LETTER DZ .. LATIN SMALL LETTER DZ
+ (16#001F5#, 16#001F5#), -- LATIN SMALL LETTER G WITH ACUTE .. LATIN SMALL LETTER G WITH ACUTE
+ (16#001F9#, 16#001F9#), -- LATIN SMALL LETTER N WITH GRAVE .. LATIN SMALL LETTER N WITH GRAVE
+ (16#001FB#, 16#001FB#), -- LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE .. LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+ (16#001FD#, 16#001FD#), -- LATIN SMALL LETTER AE WITH ACUTE .. LATIN SMALL LETTER AE WITH ACUTE
+ (16#001FF#, 16#001FF#), -- LATIN SMALL LETTER O WITH STROKE AND ACUTE .. LATIN SMALL LETTER O WITH STROKE AND ACUTE
+ (16#00201#, 16#00201#), -- LATIN SMALL LETTER A WITH DOUBLE GRAVE .. LATIN SMALL LETTER A WITH DOUBLE GRAVE
+ (16#00203#, 16#00203#), -- LATIN SMALL LETTER A WITH INVERTED BREVE .. LATIN SMALL LETTER A WITH INVERTED BREVE
+ (16#00205#, 16#00205#), -- LATIN SMALL LETTER E WITH DOUBLE GRAVE .. LATIN SMALL LETTER E WITH DOUBLE GRAVE
+ (16#00207#, 16#00207#), -- LATIN SMALL LETTER E WITH INVERTED BREVE .. LATIN SMALL LETTER E WITH INVERTED BREVE
+ (16#00209#, 16#00209#), -- LATIN SMALL LETTER I WITH DOUBLE GRAVE .. LATIN SMALL LETTER I WITH DOUBLE GRAVE
+ (16#0020B#, 16#0020B#), -- LATIN SMALL LETTER I WITH INVERTED BREVE .. LATIN SMALL LETTER I WITH INVERTED BREVE
+ (16#0020D#, 16#0020D#), -- LATIN SMALL LETTER O WITH DOUBLE GRAVE .. LATIN SMALL LETTER O WITH DOUBLE GRAVE
+ (16#0020F#, 16#0020F#), -- LATIN SMALL LETTER O WITH INVERTED BREVE .. LATIN SMALL LETTER O WITH INVERTED BREVE
+ (16#00211#, 16#00211#), -- LATIN SMALL LETTER R WITH DOUBLE GRAVE .. LATIN SMALL LETTER R WITH DOUBLE GRAVE
+ (16#00213#, 16#00213#), -- LATIN SMALL LETTER R WITH INVERTED BREVE .. LATIN SMALL LETTER R WITH INVERTED BREVE
+ (16#00215#, 16#00215#), -- LATIN SMALL LETTER U WITH DOUBLE GRAVE .. LATIN SMALL LETTER U WITH DOUBLE GRAVE
+ (16#00217#, 16#00217#), -- LATIN SMALL LETTER U WITH INVERTED BREVE .. LATIN SMALL LETTER U WITH INVERTED BREVE
+ (16#00219#, 16#00219#), -- LATIN SMALL LETTER S WITH COMMA BELOW .. LATIN SMALL LETTER S WITH COMMA BELOW
+ (16#0021B#, 16#0021B#), -- LATIN SMALL LETTER T WITH COMMA BELOW .. LATIN SMALL LETTER T WITH COMMA BELOW
+ (16#0021D#, 16#0021D#), -- LATIN SMALL LETTER YOGH .. LATIN SMALL LETTER YOGH
+ (16#0021F#, 16#0021F#), -- LATIN SMALL LETTER H WITH CARON .. LATIN SMALL LETTER H WITH CARON
+ (16#00223#, 16#00223#), -- LATIN SMALL LETTER OU .. LATIN SMALL LETTER OU
+ (16#00225#, 16#00225#), -- LATIN SMALL LETTER Z WITH HOOK .. LATIN SMALL LETTER Z WITH HOOK
+ (16#00227#, 16#00227#), -- LATIN SMALL LETTER A WITH DOT ABOVE .. LATIN SMALL LETTER A WITH DOT ABOVE
+ (16#00229#, 16#00229#), -- LATIN SMALL LETTER E WITH CEDILLA .. LATIN SMALL LETTER E WITH CEDILLA
+ (16#0022B#, 16#0022B#), -- LATIN SMALL LETTER O WITH DIAERESIS AND MACRON .. LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+ (16#0022D#, 16#0022D#), -- LATIN SMALL LETTER O WITH TILDE AND MACRON .. LATIN SMALL LETTER O WITH TILDE AND MACRON
+ (16#0022F#, 16#0022F#), -- LATIN SMALL LETTER O WITH DOT ABOVE .. LATIN SMALL LETTER O WITH DOT ABOVE
+ (16#00231#, 16#00231#), -- LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON .. LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+ (16#00233#, 16#00233#), -- LATIN SMALL LETTER Y WITH MACRON .. LATIN SMALL LETTER Y WITH MACRON
+ (16#00253#, 16#00253#), -- LATIN SMALL LETTER B WITH HOOK .. LATIN SMALL LETTER B WITH HOOK
+ (16#00254#, 16#00254#), -- LATIN SMALL LETTER OPEN O .. LATIN SMALL LETTER OPEN O
+ (16#00256#, 16#00257#), -- LATIN SMALL LETTER D WITH TAIL .. LATIN SMALL LETTER D WITH HOOK
+ (16#00259#, 16#00259#), -- LATIN SMALL LETTER SCHWA .. LATIN SMALL LETTER SCHWA
+ (16#0025B#, 16#0025B#), -- LATIN SMALL LETTER OPEN E .. LATIN SMALL LETTER OPEN E
+ (16#00260#, 16#00260#), -- LATIN SMALL LETTER G WITH HOOK .. LATIN SMALL LETTER G WITH HOOK
+ (16#00263#, 16#00263#), -- LATIN SMALL LETTER GAMMA .. LATIN SMALL LETTER GAMMA
+ (16#00268#, 16#00268#), -- LATIN SMALL LETTER I WITH STROKE .. LATIN SMALL LETTER I WITH STROKE
+ (16#00269#, 16#00269#), -- LATIN SMALL LETTER IOTA .. LATIN SMALL LETTER IOTA
+ (16#0026F#, 16#0026F#), -- LATIN SMALL LETTER TURNED M .. LATIN SMALL LETTER TURNED M
+ (16#00272#, 16#00272#), -- LATIN SMALL LETTER N WITH LEFT HOOK .. LATIN SMALL LETTER N WITH LEFT HOOK
+ (16#00275#, 16#00275#), -- LATIN SMALL LETTER BARRED O .. LATIN SMALL LETTER BARRED O
+ (16#00280#, 16#00280#), -- LATIN LETTER SMALL CAPITAL R .. LATIN LETTER SMALL CAPITAL R
+ (16#00283#, 16#00283#), -- LATIN SMALL LETTER ESH .. LATIN SMALL LETTER ESH
+ (16#00288#, 16#00288#), -- LATIN SMALL LETTER T WITH RETROFLEX HOOK .. LATIN SMALL LETTER T WITH RETROFLEX HOOK
+ (16#0028A#, 16#0028B#), -- LATIN SMALL LETTER UPSILON .. LATIN SMALL LETTER V WITH HOOK
+ (16#00292#, 16#00292#), -- LATIN SMALL LETTER EZH .. LATIN SMALL LETTER EZH
+ (16#003AC#, 16#003AC#), -- GREEK SMALL LETTER ALPHA WITH TONOS .. GREEK SMALL LETTER ALPHA WITH TONOS
+ (16#003AD#, 16#003AF#), -- GREEK SMALL LETTER EPSILON WITH TONOS .. GREEK SMALL LETTER IOTA WITH TONOS
+ (16#003B1#, 16#003C1#), -- GREEK SMALL LETTER ALPHA .. GREEK SMALL LETTER RHO
+ (16#003C2#, 16#003C2#), -- GREEK SMALL LETTER FINAL SIGMA .. GREEK SMALL LETTER FINAL SIGMA
+ (16#003C3#, 16#003CB#), -- GREEK SMALL LETTER SIGMA .. GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+ (16#003CC#, 16#003CC#), -- GREEK SMALL LETTER OMICRON WITH TONOS .. GREEK SMALL LETTER OMICRON WITH TONOS
+ (16#003CD#, 16#003CE#), -- GREEK SMALL LETTER UPSILON WITH TONOS .. GREEK SMALL LETTER OMEGA WITH TONOS
+ (16#003D0#, 16#003D0#), -- GREEK BETA SYMBOL .. GREEK BETA SYMBOL
+ (16#003D1#, 16#003D1#), -- GREEK THETA SYMBOL .. GREEK THETA SYMBOL
+ (16#003D5#, 16#003D5#), -- GREEK PHI SYMBOL .. GREEK PHI SYMBOL
+ (16#003D6#, 16#003D6#), -- GREEK PI SYMBOL .. GREEK PI SYMBOL
+ (16#003D9#, 16#003D9#), -- GREEK SMALL LETTER ARCHAIC KOPPA .. GREEK SMALL LETTER ARCHAIC KOPPA
+ (16#003DB#, 16#003DB#), -- GREEK SMALL LETTER STIGMA .. GREEK SMALL LETTER STIGMA
+ (16#003DD#, 16#003DD#), -- GREEK SMALL LETTER DIGAMMA .. GREEK SMALL LETTER DIGAMMA
+ (16#003DF#, 16#003DF#), -- GREEK SMALL LETTER KOPPA .. GREEK SMALL LETTER KOPPA
+ (16#003E1#, 16#003E1#), -- GREEK SMALL LETTER SAMPI .. GREEK SMALL LETTER SAMPI
+ (16#003E3#, 16#003E3#), -- COPTIC SMALL LETTER SHEI .. COPTIC SMALL LETTER SHEI
+ (16#003E5#, 16#003E5#), -- COPTIC SMALL LETTER FEI .. COPTIC SMALL LETTER FEI
+ (16#003E7#, 16#003E7#), -- COPTIC SMALL LETTER KHEI .. COPTIC SMALL LETTER KHEI
+ (16#003E9#, 16#003E9#), -- COPTIC SMALL LETTER HORI .. COPTIC SMALL LETTER HORI
+ (16#003EB#, 16#003EB#), -- COPTIC SMALL LETTER GANGIA .. COPTIC SMALL LETTER GANGIA
+ (16#003ED#, 16#003ED#), -- COPTIC SMALL LETTER SHIMA .. COPTIC SMALL LETTER SHIMA
+ (16#003EF#, 16#003EF#), -- COPTIC SMALL LETTER DEI .. COPTIC SMALL LETTER DEI
+ (16#003F0#, 16#003F0#), -- GREEK KAPPA SYMBOL .. GREEK KAPPA SYMBOL
+ (16#003F1#, 16#003F1#), -- GREEK RHO SYMBOL .. GREEK RHO SYMBOL
+ (16#003F2#, 16#003F2#), -- GREEK LUNATE SIGMA SYMBOL .. GREEK LUNATE SIGMA SYMBOL
+ (16#003F5#, 16#003F5#), -- GREEK LUNATE EPSILON SYMBOL .. GREEK LUNATE EPSILON SYMBOL
+ (16#00430#, 16#0044F#), -- CYRILLIC SMALL LETTER A .. CYRILLIC SMALL LETTER YA
+ (16#00450#, 16#0045F#), -- CYRILLIC SMALL LETTER IE WITH GRAVE .. CYRILLIC SMALL LETTER DZHE
+ (16#00461#, 16#00461#), -- CYRILLIC SMALL LETTER OMEGA .. CYRILLIC SMALL LETTER OMEGA
+ (16#00463#, 16#00463#), -- CYRILLIC SMALL LETTER YAT .. CYRILLIC SMALL LETTER YAT
+ (16#00465#, 16#00465#), -- CYRILLIC SMALL LETTER IOTIFIED E .. CYRILLIC SMALL LETTER IOTIFIED E
+ (16#00467#, 16#00467#), -- CYRILLIC SMALL LETTER LITTLE YUS .. CYRILLIC SMALL LETTER LITTLE YUS
+ (16#00469#, 16#00469#), -- CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS .. CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS
+ (16#0046B#, 16#0046B#), -- CYRILLIC SMALL LETTER BIG YUS .. CYRILLIC SMALL LETTER BIG YUS
+ (16#0046D#, 16#0046D#), -- CYRILLIC SMALL LETTER IOTIFIED BIG YUS .. CYRILLIC SMALL LETTER IOTIFIED BIG YUS
+ (16#0046F#, 16#0046F#), -- CYRILLIC SMALL LETTER KSI .. CYRILLIC SMALL LETTER KSI
+ (16#00471#, 16#00471#), -- CYRILLIC SMALL LETTER PSI .. CYRILLIC SMALL LETTER PSI
+ (16#00473#, 16#00473#), -- CYRILLIC SMALL LETTER FITA .. CYRILLIC SMALL LETTER FITA
+ (16#00475#, 16#00475#), -- CYRILLIC SMALL LETTER IZHITSA .. CYRILLIC SMALL LETTER IZHITSA
+ (16#00477#, 16#00477#), -- CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT .. CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+ (16#00479#, 16#00479#), -- CYRILLIC SMALL LETTER UK .. CYRILLIC SMALL LETTER UK
+ (16#0047B#, 16#0047B#), -- CYRILLIC SMALL LETTER ROUND OMEGA .. CYRILLIC SMALL LETTER ROUND OMEGA
+ (16#0047D#, 16#0047D#), -- CYRILLIC SMALL LETTER OMEGA WITH TITLO .. CYRILLIC SMALL LETTER OMEGA WITH TITLO
+ (16#0047F#, 16#0047F#), -- CYRILLIC SMALL LETTER OT .. CYRILLIC SMALL LETTER OT
+ (16#00481#, 16#00481#), -- CYRILLIC SMALL LETTER KOPPA .. CYRILLIC SMALL LETTER KOPPA
+ (16#0048B#, 16#0048B#), -- CYRILLIC SMALL LETTER SHORT I WITH TAIL .. CYRILLIC SMALL LETTER SHORT I WITH TAIL
+ (16#0048D#, 16#0048D#), -- CYRILLIC SMALL LETTER SEMISOFT SIGN .. CYRILLIC SMALL LETTER SEMISOFT SIGN
+ (16#0048F#, 16#0048F#), -- CYRILLIC SMALL LETTER ER WITH TICK .. CYRILLIC SMALL LETTER ER WITH TICK
+ (16#00491#, 16#00491#), -- CYRILLIC SMALL LETTER GHE WITH UPTURN .. CYRILLIC SMALL LETTER GHE WITH UPTURN
+ (16#00493#, 16#00493#), -- CYRILLIC SMALL LETTER GHE WITH STROKE .. CYRILLIC SMALL LETTER GHE WITH STROKE
+ (16#00495#, 16#00495#), -- CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK .. CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK
+ (16#00497#, 16#00497#), -- CYRILLIC SMALL LETTER ZHE WITH DESCENDER .. CYRILLIC SMALL LETTER ZHE WITH DESCENDER
+ (16#00499#, 16#00499#), -- CYRILLIC SMALL LETTER ZE WITH DESCENDER .. CYRILLIC SMALL LETTER ZE WITH DESCENDER
+ (16#0049B#, 16#0049B#), -- CYRILLIC SMALL LETTER KA WITH DESCENDER .. CYRILLIC SMALL LETTER KA WITH DESCENDER
+ (16#0049D#, 16#0049D#), -- CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE .. CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
+ (16#0049F#, 16#0049F#), -- CYRILLIC SMALL LETTER KA WITH STROKE .. CYRILLIC SMALL LETTER KA WITH STROKE
+ (16#004A1#, 16#004A1#), -- CYRILLIC SMALL LETTER BASHKIR KA .. CYRILLIC SMALL LETTER BASHKIR KA
+ (16#004A3#, 16#004A3#), -- CYRILLIC SMALL LETTER EN WITH DESCENDER .. CYRILLIC SMALL LETTER EN WITH DESCENDER
+ (16#004A5#, 16#004A5#), -- CYRILLIC SMALL LIGATURE EN GHE .. CYRILLIC SMALL LIGATURE EN GHE
+ (16#004A7#, 16#004A7#), -- CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK .. CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK
+ (16#004A9#, 16#004A9#), -- CYRILLIC SMALL LETTER ABKHASIAN HA .. CYRILLIC SMALL LETTER ABKHASIAN HA
+ (16#004AB#, 16#004AB#), -- CYRILLIC SMALL LETTER ES WITH DESCENDER .. CYRILLIC SMALL LETTER ES WITH DESCENDER
+ (16#004AD#, 16#004AD#), -- CYRILLIC SMALL LETTER TE WITH DESCENDER .. CYRILLIC SMALL LETTER TE WITH DESCENDER
+ (16#004AF#, 16#004AF#), -- CYRILLIC SMALL LETTER STRAIGHT U .. CYRILLIC SMALL LETTER STRAIGHT U
+ (16#004B1#, 16#004B1#), -- CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE .. CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
+ (16#004B3#, 16#004B3#), -- CYRILLIC SMALL LETTER HA WITH DESCENDER .. CYRILLIC SMALL LETTER HA WITH DESCENDER
+ (16#004B5#, 16#004B5#), -- CYRILLIC SMALL LIGATURE TE TSE .. CYRILLIC SMALL LIGATURE TE TSE
+ (16#004B7#, 16#004B7#), -- CYRILLIC SMALL LETTER CHE WITH DESCENDER .. CYRILLIC SMALL LETTER CHE WITH DESCENDER
+ (16#004B9#, 16#004B9#), -- CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE .. CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
+ (16#004BB#, 16#004BB#), -- CYRILLIC SMALL LETTER SHHA .. CYRILLIC SMALL LETTER SHHA
+ (16#004BD#, 16#004BD#), -- CYRILLIC SMALL LETTER ABKHASIAN CHE .. CYRILLIC SMALL LETTER ABKHASIAN CHE
+ (16#004BF#, 16#004BF#), -- CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER .. CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER
+ (16#004C2#, 16#004C2#), -- CYRILLIC SMALL LETTER ZHE WITH BREVE .. CYRILLIC SMALL LETTER ZHE WITH BREVE
+ (16#004C4#, 16#004C4#), -- CYRILLIC SMALL LETTER KA WITH HOOK .. CYRILLIC SMALL LETTER KA WITH HOOK
+ (16#004C6#, 16#004C6#), -- CYRILLIC SMALL LETTER EL WITH TAIL .. CYRILLIC SMALL LETTER EL WITH TAIL
+ (16#004C8#, 16#004C8#), -- CYRILLIC SMALL LETTER EN WITH HOOK .. CYRILLIC SMALL LETTER EN WITH HOOK
+ (16#004CA#, 16#004CA#), -- CYRILLIC SMALL LETTER EN WITH TAIL .. CYRILLIC SMALL LETTER EN WITH TAIL
+ (16#004CC#, 16#004CC#), -- CYRILLIC SMALL LETTER KHAKASSIAN CHE .. CYRILLIC SMALL LETTER KHAKASSIAN CHE
+ (16#004CE#, 16#004CE#), -- CYRILLIC SMALL LETTER EM WITH TAIL .. CYRILLIC SMALL LETTER EM WITH TAIL
+ (16#004D1#, 16#004D1#), -- CYRILLIC SMALL LETTER A WITH BREVE .. CYRILLIC SMALL LETTER A WITH BREVE
+ (16#004D3#, 16#004D3#), -- CYRILLIC SMALL LETTER A WITH DIAERESIS .. CYRILLIC SMALL LETTER A WITH DIAERESIS
+ (16#004D5#, 16#004D5#), -- CYRILLIC SMALL LIGATURE A IE .. CYRILLIC SMALL LIGATURE A IE
+ (16#004D7#, 16#004D7#), -- CYRILLIC SMALL LETTER IE WITH BREVE .. CYRILLIC SMALL LETTER IE WITH BREVE
+ (16#004D9#, 16#004D9#), -- CYRILLIC SMALL LETTER SCHWA .. CYRILLIC SMALL LETTER SCHWA
+ (16#004DB#, 16#004DB#), -- CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS .. CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
+ (16#004DD#, 16#004DD#), -- CYRILLIC SMALL LETTER ZHE WITH DIAERESIS .. CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
+ (16#004DF#, 16#004DF#), -- CYRILLIC SMALL LETTER ZE WITH DIAERESIS .. CYRILLIC SMALL LETTER ZE WITH DIAERESIS
+ (16#004E1#, 16#004E1#), -- CYRILLIC SMALL LETTER ABKHASIAN DZE .. CYRILLIC SMALL LETTER ABKHASIAN DZE
+ (16#004E3#, 16#004E3#), -- CYRILLIC SMALL LETTER I WITH MACRON .. CYRILLIC SMALL LETTER I WITH MACRON
+ (16#004E5#, 16#004E5#), -- CYRILLIC SMALL LETTER I WITH DIAERESIS .. CYRILLIC SMALL LETTER I WITH DIAERESIS
+ (16#004E7#, 16#004E7#), -- CYRILLIC SMALL LETTER O WITH DIAERESIS .. CYRILLIC SMALL LETTER O WITH DIAERESIS
+ (16#004E9#, 16#004E9#), -- CYRILLIC SMALL LETTER BARRED O .. CYRILLIC SMALL LETTER BARRED O
+ (16#004EB#, 16#004EB#), -- CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS .. CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
+ (16#004ED#, 16#004ED#), -- CYRILLIC SMALL LETTER E WITH DIAERESIS .. CYRILLIC SMALL LETTER E WITH DIAERESIS
+ (16#004EF#, 16#004EF#), -- CYRILLIC SMALL LETTER U WITH MACRON .. CYRILLIC SMALL LETTER U WITH MACRON
+ (16#004F1#, 16#004F1#), -- CYRILLIC SMALL LETTER U WITH DIAERESIS .. CYRILLIC SMALL LETTER U WITH DIAERESIS
+ (16#004F3#, 16#004F3#), -- CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE .. CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
+ (16#004F5#, 16#004F5#), -- CYRILLIC SMALL LETTER CHE WITH DIAERESIS .. CYRILLIC SMALL LETTER CHE WITH DIAERESIS
+ (16#004F9#, 16#004F9#), -- CYRILLIC SMALL LETTER YERU WITH DIAERESIS .. CYRILLIC SMALL LETTER YERU WITH DIAERESIS
+ (16#00501#, 16#00501#), -- CYRILLIC SMALL LETTER KOMI DE .. CYRILLIC SMALL LETTER KOMI DE
+ (16#00503#, 16#00503#), -- CYRILLIC SMALL LETTER KOMI DJE .. CYRILLIC SMALL LETTER KOMI DJE
+ (16#00505#, 16#00505#), -- CYRILLIC SMALL LETTER KOMI ZJE .. CYRILLIC SMALL LETTER KOMI ZJE
+ (16#00507#, 16#00507#), -- CYRILLIC SMALL LETTER KOMI DZJE .. CYRILLIC SMALL LETTER KOMI DZJE
+ (16#00509#, 16#00509#), -- CYRILLIC SMALL LETTER KOMI LJE .. CYRILLIC SMALL LETTER KOMI LJE
+ (16#0050B#, 16#0050B#), -- CYRILLIC SMALL LETTER KOMI NJE .. CYRILLIC SMALL LETTER KOMI NJE
+ (16#0050D#, 16#0050D#), -- CYRILLIC SMALL LETTER KOMI SJE .. CYRILLIC SMALL LETTER KOMI SJE
+ (16#0050F#, 16#0050F#), -- CYRILLIC SMALL LETTER KOMI TJE .. CYRILLIC SMALL LETTER KOMI TJE
+ (16#00561#, 16#00586#), -- ARMENIAN SMALL LETTER AYB .. ARMENIAN SMALL LETTER FEH
+ (16#01E01#, 16#01E01#), -- LATIN SMALL LETTER A WITH RING BELOW .. LATIN SMALL LETTER A WITH RING BELOW
+ (16#01E03#, 16#01E03#), -- LATIN SMALL LETTER B WITH DOT ABOVE .. LATIN SMALL LETTER B WITH DOT ABOVE
+ (16#01E05#, 16#01E05#), -- LATIN SMALL LETTER B WITH DOT BELOW .. LATIN SMALL LETTER B WITH DOT BELOW
+ (16#01E07#, 16#01E07#), -- LATIN SMALL LETTER B WITH LINE BELOW .. LATIN SMALL LETTER B WITH LINE BELOW
+ (16#01E09#, 16#01E09#), -- LATIN SMALL LETTER C WITH CEDILLA AND ACUTE .. LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+ (16#01E0B#, 16#01E0B#), -- LATIN SMALL LETTER D WITH DOT ABOVE .. LATIN SMALL LETTER D WITH DOT ABOVE
+ (16#01E0D#, 16#01E0D#), -- LATIN SMALL LETTER D WITH DOT BELOW .. LATIN SMALL LETTER D WITH DOT BELOW
+ (16#01E0F#, 16#01E0F#), -- LATIN SMALL LETTER D WITH LINE BELOW .. LATIN SMALL LETTER D WITH LINE BELOW
+ (16#01E11#, 16#01E11#), -- LATIN SMALL LETTER D WITH CEDILLA .. LATIN SMALL LETTER D WITH CEDILLA
+ (16#01E13#, 16#01E13#), -- LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
+ (16#01E15#, 16#01E15#), -- LATIN SMALL LETTER E WITH MACRON AND GRAVE .. LATIN SMALL LETTER E WITH MACRON AND GRAVE
+ (16#01E17#, 16#01E17#), -- LATIN SMALL LETTER E WITH MACRON AND ACUTE .. LATIN SMALL LETTER E WITH MACRON AND ACUTE
+ (16#01E19#, 16#01E19#), -- LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
+ (16#01E1B#, 16#01E1B#), -- LATIN SMALL LETTER E WITH TILDE BELOW .. LATIN SMALL LETTER E WITH TILDE BELOW
+ (16#01E1D#, 16#01E1D#), -- LATIN SMALL LETTER E WITH CEDILLA AND BREVE .. LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+ (16#01E1F#, 16#01E1F#), -- LATIN SMALL LETTER F WITH DOT ABOVE .. LATIN SMALL LETTER F WITH DOT ABOVE
+ (16#01E21#, 16#01E21#), -- LATIN SMALL LETTER G WITH MACRON .. LATIN SMALL LETTER G WITH MACRON
+ (16#01E23#, 16#01E23#), -- LATIN SMALL LETTER H WITH DOT ABOVE .. LATIN SMALL LETTER H WITH DOT ABOVE
+ (16#01E25#, 16#01E25#), -- LATIN SMALL LETTER H WITH DOT BELOW .. LATIN SMALL LETTER H WITH DOT BELOW
+ (16#01E27#, 16#01E27#), -- LATIN SMALL LETTER H WITH DIAERESIS .. LATIN SMALL LETTER H WITH DIAERESIS
+ (16#01E29#, 16#01E29#), -- LATIN SMALL LETTER H WITH CEDILLA .. LATIN SMALL LETTER H WITH CEDILLA
+ (16#01E2B#, 16#01E2B#), -- LATIN SMALL LETTER H WITH BREVE BELOW .. LATIN SMALL LETTER H WITH BREVE BELOW
+ (16#01E2D#, 16#01E2D#), -- LATIN SMALL LETTER I WITH TILDE BELOW .. LATIN SMALL LETTER I WITH TILDE BELOW
+ (16#01E2F#, 16#01E2F#), -- LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE .. LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+ (16#01E31#, 16#01E31#), -- LATIN SMALL LETTER K WITH ACUTE .. LATIN SMALL LETTER K WITH ACUTE
+ (16#01E33#, 16#01E33#), -- LATIN SMALL LETTER K WITH DOT BELOW .. LATIN SMALL LETTER K WITH DOT BELOW
+ (16#01E35#, 16#01E35#), -- LATIN SMALL LETTER K WITH LINE BELOW .. LATIN SMALL LETTER K WITH LINE BELOW
+ (16#01E37#, 16#01E37#), -- LATIN SMALL LETTER L WITH DOT BELOW .. LATIN SMALL LETTER L WITH DOT BELOW
+ (16#01E39#, 16#01E39#), -- LATIN SMALL LETTER L WITH DOT BELOW AND MACRON .. LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+ (16#01E3B#, 16#01E3B#), -- LATIN SMALL LETTER L WITH LINE BELOW .. LATIN SMALL LETTER L WITH LINE BELOW
+ (16#01E3D#, 16#01E3D#), -- LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
+ (16#01E3F#, 16#01E3F#), -- LATIN SMALL LETTER M WITH ACUTE .. LATIN SMALL LETTER M WITH ACUTE
+ (16#01E41#, 16#01E41#), -- LATIN SMALL LETTER M WITH DOT ABOVE .. LATIN SMALL LETTER M WITH DOT ABOVE
+ (16#01E43#, 16#01E43#), -- LATIN SMALL LETTER M WITH DOT BELOW .. LATIN SMALL LETTER M WITH DOT BELOW
+ (16#01E45#, 16#01E45#), -- LATIN SMALL LETTER N WITH DOT ABOVE .. LATIN SMALL LETTER N WITH DOT ABOVE
+ (16#01E47#, 16#01E47#), -- LATIN SMALL LETTER N WITH DOT BELOW .. LATIN SMALL LETTER N WITH DOT BELOW
+ (16#01E49#, 16#01E49#), -- LATIN SMALL LETTER N WITH LINE BELOW .. LATIN SMALL LETTER N WITH LINE BELOW
+ (16#01E4B#, 16#01E4B#), -- LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
+ (16#01E4D#, 16#01E4D#), -- LATIN SMALL LETTER O WITH TILDE AND ACUTE .. LATIN SMALL LETTER O WITH TILDE AND ACUTE
+ (16#01E4F#, 16#01E4F#), -- LATIN SMALL LETTER O WITH TILDE AND DIAERESIS .. LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+ (16#01E51#, 16#01E51#), -- LATIN SMALL LETTER O WITH MACRON AND GRAVE .. LATIN SMALL LETTER O WITH MACRON AND GRAVE
+ (16#01E53#, 16#01E53#), -- LATIN SMALL LETTER O WITH MACRON AND ACUTE .. LATIN SMALL LETTER O WITH MACRON AND ACUTE
+ (16#01E55#, 16#01E55#), -- LATIN SMALL LETTER P WITH ACUTE .. LATIN SMALL LETTER P WITH ACUTE
+ (16#01E57#, 16#01E57#), -- LATIN SMALL LETTER P WITH DOT ABOVE .. LATIN SMALL LETTER P WITH DOT ABOVE
+ (16#01E59#, 16#01E59#), -- LATIN SMALL LETTER R WITH DOT ABOVE .. LATIN SMALL LETTER R WITH DOT ABOVE
+ (16#01E5B#, 16#01E5B#), -- LATIN SMALL LETTER R WITH DOT BELOW .. LATIN SMALL LETTER R WITH DOT BELOW
+ (16#01E5D#, 16#01E5D#), -- LATIN SMALL LETTER R WITH DOT BELOW AND MACRON .. LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+ (16#01E5F#, 16#01E5F#), -- LATIN SMALL LETTER R WITH LINE BELOW .. LATIN SMALL LETTER R WITH LINE BELOW
+ (16#01E61#, 16#01E61#), -- LATIN SMALL LETTER S WITH DOT ABOVE .. LATIN SMALL LETTER S WITH DOT ABOVE
+ (16#01E63#, 16#01E63#), -- LATIN SMALL LETTER S WITH DOT BELOW .. LATIN SMALL LETTER S WITH DOT BELOW
+ (16#01E65#, 16#01E65#), -- LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE .. LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+ (16#01E67#, 16#01E67#), -- LATIN SMALL LETTER S WITH CARON AND DOT ABOVE .. LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+ (16#01E69#, 16#01E69#), -- LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE .. LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+ (16#01E6B#, 16#01E6B#), -- LATIN SMALL LETTER T WITH DOT ABOVE .. LATIN SMALL LETTER T WITH DOT ABOVE
+ (16#01E6D#, 16#01E6D#), -- LATIN SMALL LETTER T WITH DOT BELOW .. LATIN SMALL LETTER T WITH DOT BELOW
+ (16#01E6F#, 16#01E6F#), -- LATIN SMALL LETTER T WITH LINE BELOW .. LATIN SMALL LETTER T WITH LINE BELOW
+ (16#01E71#, 16#01E71#), -- LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
+ (16#01E73#, 16#01E73#), -- LATIN SMALL LETTER U WITH DIAERESIS BELOW .. LATIN SMALL LETTER U WITH DIAERESIS BELOW
+ (16#01E75#, 16#01E75#), -- LATIN SMALL LETTER U WITH TILDE BELOW .. LATIN SMALL LETTER U WITH TILDE BELOW
+ (16#01E77#, 16#01E77#), -- LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
+ (16#01E79#, 16#01E79#), -- LATIN SMALL LETTER U WITH TILDE AND ACUTE .. LATIN SMALL LETTER U WITH TILDE AND ACUTE
+ (16#01E7B#, 16#01E7B#), -- LATIN SMALL LETTER U WITH MACRON AND DIAERESIS .. LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+ (16#01E7D#, 16#01E7D#), -- LATIN SMALL LETTER V WITH TILDE .. LATIN SMALL LETTER V WITH TILDE
+ (16#01E7F#, 16#01E7F#), -- LATIN SMALL LETTER V WITH DOT BELOW .. LATIN SMALL LETTER V WITH DOT BELOW
+ (16#01E81#, 16#01E81#), -- LATIN SMALL LETTER W WITH GRAVE .. LATIN SMALL LETTER W WITH GRAVE
+ (16#01E83#, 16#01E83#), -- LATIN SMALL LETTER W WITH ACUTE .. LATIN SMALL LETTER W WITH ACUTE
+ (16#01E85#, 16#01E85#), -- LATIN SMALL LETTER W WITH DIAERESIS .. LATIN SMALL LETTER W WITH DIAERESIS
+ (16#01E87#, 16#01E87#), -- LATIN SMALL LETTER W WITH DOT ABOVE .. LATIN SMALL LETTER W WITH DOT ABOVE
+ (16#01E89#, 16#01E89#), -- LATIN SMALL LETTER W WITH DOT BELOW .. LATIN SMALL LETTER W WITH DOT BELOW
+ (16#01E8B#, 16#01E8B#), -- LATIN SMALL LETTER X WITH DOT ABOVE .. LATIN SMALL LETTER X WITH DOT ABOVE
+ (16#01E8D#, 16#01E8D#), -- LATIN SMALL LETTER X WITH DIAERESIS .. LATIN SMALL LETTER X WITH DIAERESIS
+ (16#01E8F#, 16#01E8F#), -- LATIN SMALL LETTER Y WITH DOT ABOVE .. LATIN SMALL LETTER Y WITH DOT ABOVE
+ (16#01E91#, 16#01E91#), -- LATIN SMALL LETTER Z WITH CIRCUMFLEX .. LATIN SMALL LETTER Z WITH CIRCUMFLEX
+ (16#01E93#, 16#01E93#), -- LATIN SMALL LETTER Z WITH DOT BELOW .. LATIN SMALL LETTER Z WITH DOT BELOW
+ (16#01E95#, 16#01E95#), -- LATIN SMALL LETTER Z WITH LINE BELOW .. LATIN SMALL LETTER Z WITH LINE BELOW
+ (16#01E9B#, 16#01E9B#), -- LATIN SMALL LETTER LONG S WITH DOT ABOVE .. LATIN SMALL LETTER LONG S WITH DOT ABOVE
+ (16#01EA1#, 16#01EA1#), -- LATIN SMALL LETTER A WITH DOT BELOW .. LATIN SMALL LETTER A WITH DOT BELOW
+ (16#01EA3#, 16#01EA3#), -- LATIN SMALL LETTER A WITH HOOK ABOVE .. LATIN SMALL LETTER A WITH HOOK ABOVE
+ (16#01EA5#, 16#01EA5#), -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+ (16#01EA7#, 16#01EA7#), -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+ (16#01EA9#, 16#01EA9#), -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+ (16#01EAB#, 16#01EAB#), -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+ (16#01EAD#, 16#01EAD#), -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+ (16#01EAF#, 16#01EAF#), -- LATIN SMALL LETTER A WITH BREVE AND ACUTE .. LATIN SMALL LETTER A WITH BREVE AND ACUTE
+ (16#01EB1#, 16#01EB1#), -- LATIN SMALL LETTER A WITH BREVE AND GRAVE .. LATIN SMALL LETTER A WITH BREVE AND GRAVE
+ (16#01EB3#, 16#01EB3#), -- LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE .. LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+ (16#01EB5#, 16#01EB5#), -- LATIN SMALL LETTER A WITH BREVE AND TILDE .. LATIN SMALL LETTER A WITH BREVE AND TILDE
+ (16#01EB7#, 16#01EB7#), -- LATIN SMALL LETTER A WITH BREVE AND DOT BELOW .. LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+ (16#01EB9#, 16#01EB9#), -- LATIN SMALL LETTER E WITH DOT BELOW .. LATIN SMALL LETTER E WITH DOT BELOW
+ (16#01EBB#, 16#01EBB#), -- LATIN SMALL LETTER E WITH HOOK ABOVE .. LATIN SMALL LETTER E WITH HOOK ABOVE
+ (16#01EBD#, 16#01EBD#), -- LATIN SMALL LETTER E WITH TILDE .. LATIN SMALL LETTER E WITH TILDE
+ (16#01EBF#, 16#01EBF#), -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+ (16#01EC1#, 16#01EC1#), -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+ (16#01EC3#, 16#01EC3#), -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+ (16#01EC5#, 16#01EC5#), -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+ (16#01EC7#, 16#01EC7#), -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+ (16#01EC9#, 16#01EC9#), -- LATIN SMALL LETTER I WITH HOOK ABOVE .. LATIN SMALL LETTER I WITH HOOK ABOVE
+ (16#01ECB#, 16#01ECB#), -- LATIN SMALL LETTER I WITH DOT BELOW .. LATIN SMALL LETTER I WITH DOT BELOW
+ (16#01ECD#, 16#01ECD#), -- LATIN SMALL LETTER O WITH DOT BELOW .. LATIN SMALL LETTER O WITH DOT BELOW
+ (16#01ECF#, 16#01ECF#), -- LATIN SMALL LETTER O WITH HOOK ABOVE .. LATIN SMALL LETTER O WITH HOOK ABOVE
+ (16#01ED1#, 16#01ED1#), -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+ (16#01ED3#, 16#01ED3#), -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+ (16#01ED5#, 16#01ED5#), -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+ (16#01ED7#, 16#01ED7#), -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+ (16#01ED9#, 16#01ED9#), -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+ (16#01EDB#, 16#01EDB#), -- LATIN SMALL LETTER O WITH HORN AND ACUTE .. LATIN SMALL LETTER O WITH HORN AND ACUTE
+ (16#01EDD#, 16#01EDD#), -- LATIN SMALL LETTER O WITH HORN AND GRAVE .. LATIN SMALL LETTER O WITH HORN AND GRAVE
+ (16#01EDF#, 16#01EDF#), -- LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE .. LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+ (16#01EE1#, 16#01EE1#), -- LATIN SMALL LETTER O WITH HORN AND TILDE .. LATIN SMALL LETTER O WITH HORN AND TILDE
+ (16#01EE3#, 16#01EE3#), -- LATIN SMALL LETTER O WITH HORN AND DOT BELOW .. LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+ (16#01EE5#, 16#01EE5#), -- LATIN SMALL LETTER U WITH DOT BELOW .. LATIN SMALL LETTER U WITH DOT BELOW
+ (16#01EE7#, 16#01EE7#), -- LATIN SMALL LETTER U WITH HOOK ABOVE .. LATIN SMALL LETTER U WITH HOOK ABOVE
+ (16#01EE9#, 16#01EE9#), -- LATIN SMALL LETTER U WITH HORN AND ACUTE .. LATIN SMALL LETTER U WITH HORN AND ACUTE
+ (16#01EEB#, 16#01EEB#), -- LATIN SMALL LETTER U WITH HORN AND GRAVE .. LATIN SMALL LETTER U WITH HORN AND GRAVE
+ (16#01EED#, 16#01EED#), -- LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE .. LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+ (16#01EEF#, 16#01EEF#), -- LATIN SMALL LETTER U WITH HORN AND TILDE .. LATIN SMALL LETTER U WITH HORN AND TILDE
+ (16#01EF1#, 16#01EF1#), -- LATIN SMALL LETTER U WITH HORN AND DOT BELOW .. LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+ (16#01EF3#, 16#01EF3#), -- LATIN SMALL LETTER Y WITH GRAVE .. LATIN SMALL LETTER Y WITH GRAVE
+ (16#01EF5#, 16#01EF5#), -- LATIN SMALL LETTER Y WITH DOT BELOW .. LATIN SMALL LETTER Y WITH DOT BELOW
+ (16#01EF7#, 16#01EF7#), -- LATIN SMALL LETTER Y WITH HOOK ABOVE .. LATIN SMALL LETTER Y WITH HOOK ABOVE
+ (16#01EF9#, 16#01EF9#), -- LATIN SMALL LETTER Y WITH TILDE .. LATIN SMALL LETTER Y WITH TILDE
+ (16#01F00#, 16#01F07#), -- GREEK SMALL LETTER ALPHA WITH PSILI .. GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+ (16#01F10#, 16#01F15#), -- GREEK SMALL LETTER EPSILON WITH PSILI .. GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+ (16#01F20#, 16#01F27#), -- GREEK SMALL LETTER ETA WITH PSILI .. GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+ (16#01F30#, 16#01F37#), -- GREEK SMALL LETTER IOTA WITH PSILI .. GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+ (16#01F40#, 16#01F45#), -- GREEK SMALL LETTER OMICRON WITH PSILI .. GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+ (16#01F51#, 16#01F51#), -- GREEK SMALL LETTER UPSILON WITH DASIA .. GREEK SMALL LETTER UPSILON WITH DASIA
+ (16#01F53#, 16#01F53#), -- GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA .. GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+ (16#01F55#, 16#01F55#), -- GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA .. GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+ (16#01F57#, 16#01F57#), -- GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI .. GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+ (16#01F60#, 16#01F67#), -- GREEK SMALL LETTER OMEGA WITH PSILI .. GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+ (16#01F70#, 16#01F71#), -- GREEK SMALL LETTER ALPHA WITH VARIA .. GREEK SMALL LETTER ALPHA WITH OXIA
+ (16#01F72#, 16#01F75#), -- GREEK SMALL LETTER EPSILON WITH VARIA .. GREEK SMALL LETTER ETA WITH OXIA
+ (16#01F76#, 16#01F77#), -- GREEK SMALL LETTER IOTA WITH VARIA .. GREEK SMALL LETTER IOTA WITH OXIA
+ (16#01F78#, 16#01F79#), -- GREEK SMALL LETTER OMICRON WITH VARIA .. GREEK SMALL LETTER OMICRON WITH OXIA
+ (16#01F7A#, 16#01F7B#), -- GREEK SMALL LETTER UPSILON WITH VARIA .. GREEK SMALL LETTER UPSILON WITH OXIA
+ (16#01F7C#, 16#01F7D#), -- GREEK SMALL LETTER OMEGA WITH VARIA .. GREEK SMALL LETTER OMEGA WITH OXIA
+ (16#01F80#, 16#01F87#), -- GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI .. GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+ (16#01F90#, 16#01F97#), -- GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI .. GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+ (16#01FA0#, 16#01FA7#), -- GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI .. GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+ (16#01FB0#, 16#01FB1#), -- GREEK SMALL LETTER ALPHA WITH VRACHY .. GREEK SMALL LETTER ALPHA WITH MACRON
+ (16#01FB3#, 16#01FB3#), -- GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI .. GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
+ (16#01FBE#, 16#01FBE#), -- GREEK PROSGEGRAMMENI .. GREEK PROSGEGRAMMENI
+ (16#01FC3#, 16#01FC3#), -- GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI .. GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
+ (16#01FD0#, 16#01FD1#), -- GREEK SMALL LETTER IOTA WITH VRACHY .. GREEK SMALL LETTER IOTA WITH MACRON
+ (16#01FE0#, 16#01FE1#), -- GREEK SMALL LETTER UPSILON WITH VRACHY .. GREEK SMALL LETTER UPSILON WITH MACRON
+ (16#01FE5#, 16#01FE5#), -- GREEK SMALL LETTER RHO WITH DASIA .. GREEK SMALL LETTER RHO WITH DASIA
+ (16#01FF3#, 16#01FF3#), -- GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI .. GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
+ (16#0FF41#, 16#0FF5A#), -- FULLWIDTH LATIN SMALL LETTER A .. FULLWIDTH LATIN SMALL LETTER Z
+ (16#10428#, 16#1044D#)); -- DESERET SMALL LETTER LONG I .. DESERET SMALL LETTER ENG
+
+ Upper_Case_Adjust : constant array
+ (Lower_Case_Letters'Range) of Char_Code'Base := (
+ -32, -- LATIN SMALL LETTER A .. LATIN SMALL LETTER Z
+ 743, -- MICRO SIGN .. MICRO SIGN
+ -32, -- LATIN SMALL LETTER A WITH GRAVE .. LATIN SMALL LETTER O WITH DIAERESIS
+ -32, -- LATIN SMALL LETTER O WITH STROKE .. LATIN SMALL LETTER THORN
+ 121, -- LATIN SMALL LETTER Y WITH DIAERESIS .. LATIN SMALL LETTER Y WITH DIAERESIS
+ -1, -- LATIN SMALL LETTER A WITH MACRON .. LATIN SMALL LETTER A WITH MACRON
+ -1, -- LATIN SMALL LETTER A WITH BREVE .. LATIN SMALL LETTER A WITH BREVE
+ -1, -- LATIN SMALL LETTER A WITH OGONEK .. LATIN SMALL LETTER A WITH OGONEK
+ -1, -- LATIN SMALL LETTER C WITH ACUTE .. LATIN SMALL LETTER C WITH ACUTE
+ -1, -- LATIN SMALL LETTER C WITH CIRCUMFLEX .. LATIN SMALL LETTER C WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER C WITH DOT ABOVE .. LATIN SMALL LETTER C WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER C WITH CARON .. LATIN SMALL LETTER C WITH CARON
+ -1, -- LATIN SMALL LETTER D WITH CARON .. LATIN SMALL LETTER D WITH CARON
+ -1, -- LATIN SMALL LETTER D WITH STROKE .. LATIN SMALL LETTER D WITH STROKE
+ -1, -- LATIN SMALL LETTER E WITH MACRON .. LATIN SMALL LETTER E WITH MACRON
+ -1, -- LATIN SMALL LETTER E WITH BREVE .. LATIN SMALL LETTER E WITH BREVE
+ -1, -- LATIN SMALL LETTER E WITH DOT ABOVE .. LATIN SMALL LETTER E WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER E WITH OGONEK .. LATIN SMALL LETTER E WITH OGONEK
+ -1, -- LATIN SMALL LETTER E WITH CARON .. LATIN SMALL LETTER E WITH CARON
+ -1, -- LATIN SMALL LETTER G WITH CIRCUMFLEX .. LATIN SMALL LETTER G WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER G WITH BREVE .. LATIN SMALL LETTER G WITH BREVE
+ -1, -- LATIN SMALL LETTER G WITH DOT ABOVE .. LATIN SMALL LETTER G WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER G WITH CEDILLA .. LATIN SMALL LETTER G WITH CEDILLA
+ -1, -- LATIN SMALL LETTER H WITH CIRCUMFLEX .. LATIN SMALL LETTER H WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER H WITH STROKE .. LATIN SMALL LETTER H WITH STROKE
+ -1, -- LATIN SMALL LETTER I WITH TILDE .. LATIN SMALL LETTER I WITH TILDE
+ -1, -- LATIN SMALL LETTER I WITH MACRON .. LATIN SMALL LETTER I WITH MACRON
+ -1, -- LATIN SMALL LETTER I WITH BREVE .. LATIN SMALL LETTER I WITH BREVE
+ -1, -- LATIN SMALL LETTER I WITH OGONEK .. LATIN SMALL LETTER I WITH OGONEK
+ -232, -- LATIN SMALL LETTER DOTLESS I .. LATIN SMALL LETTER DOTLESS I
+ -1, -- LATIN SMALL LIGATURE IJ .. LATIN SMALL LIGATURE IJ
+ -1, -- LATIN SMALL LETTER J WITH CIRCUMFLEX .. LATIN SMALL LETTER J WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER K WITH CEDILLA .. LATIN SMALL LETTER K WITH CEDILLA
+ -1, -- LATIN SMALL LETTER L WITH ACUTE .. LATIN SMALL LETTER L WITH ACUTE
+ -1, -- LATIN SMALL LETTER L WITH CEDILLA .. LATIN SMALL LETTER L WITH CEDILLA
+ -1, -- LATIN SMALL LETTER L WITH CARON .. LATIN SMALL LETTER L WITH CARON
+ -1, -- LATIN SMALL LETTER L WITH MIDDLE DOT .. LATIN SMALL LETTER L WITH MIDDLE DOT
+ -1, -- LATIN SMALL LETTER L WITH STROKE .. LATIN SMALL LETTER L WITH STROKE
+ -1, -- LATIN SMALL LETTER N WITH ACUTE .. LATIN SMALL LETTER N WITH ACUTE
+ -1, -- LATIN SMALL LETTER N WITH CEDILLA .. LATIN SMALL LETTER N WITH CEDILLA
+ -1, -- LATIN SMALL LETTER N WITH CARON .. LATIN SMALL LETTER N WITH CARON
+ -1, -- LATIN SMALL LETTER ENG .. LATIN SMALL LETTER ENG
+ -1, -- LATIN SMALL LETTER O WITH MACRON .. LATIN SMALL LETTER O WITH MACRON
+ -1, -- LATIN SMALL LETTER O WITH BREVE .. LATIN SMALL LETTER O WITH BREVE
+ -1, -- LATIN SMALL LETTER O WITH DOUBLE ACUTE .. LATIN SMALL LETTER O WITH DOUBLE ACUTE
+ -1, -- LATIN SMALL LIGATURE OE .. LATIN SMALL LIGATURE OE
+ -1, -- LATIN SMALL LETTER R WITH ACUTE .. LATIN SMALL LETTER R WITH ACUTE
+ -1, -- LATIN SMALL LETTER R WITH CEDILLA .. LATIN SMALL LETTER R WITH CEDILLA
+ -1, -- LATIN SMALL LETTER R WITH CARON .. LATIN SMALL LETTER R WITH CARON
+ -1, -- LATIN SMALL LETTER S WITH ACUTE .. LATIN SMALL LETTER S WITH ACUTE
+ -1, -- LATIN SMALL LETTER S WITH CIRCUMFLEX .. LATIN SMALL LETTER S WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER S WITH CEDILLA .. LATIN SMALL LETTER S WITH CEDILLA
+ -1, -- LATIN SMALL LETTER S WITH CARON .. LATIN SMALL LETTER S WITH CARON
+ -1, -- LATIN SMALL LETTER T WITH CEDILLA .. LATIN SMALL LETTER T WITH CEDILLA
+ -1, -- LATIN SMALL LETTER T WITH CARON .. LATIN SMALL LETTER T WITH CARON
+ -1, -- LATIN SMALL LETTER T WITH STROKE .. LATIN SMALL LETTER T WITH STROKE
+ -1, -- LATIN SMALL LETTER U WITH TILDE .. LATIN SMALL LETTER U WITH TILDE
+ -1, -- LATIN SMALL LETTER U WITH MACRON .. LATIN SMALL LETTER U WITH MACRON
+ -1, -- LATIN SMALL LETTER U WITH BREVE .. LATIN SMALL LETTER U WITH BREVE
+ -1, -- LATIN SMALL LETTER U WITH RING ABOVE .. LATIN SMALL LETTER U WITH RING ABOVE
+ -1, -- LATIN SMALL LETTER U WITH DOUBLE ACUTE .. LATIN SMALL LETTER U WITH DOUBLE ACUTE
+ -1, -- LATIN SMALL LETTER U WITH OGONEK .. LATIN SMALL LETTER U WITH OGONEK
+ -1, -- LATIN SMALL LETTER W WITH CIRCUMFLEX .. LATIN SMALL LETTER W WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER Y WITH CIRCUMFLEX .. LATIN SMALL LETTER Y WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER Z WITH ACUTE .. LATIN SMALL LETTER Z WITH ACUTE
+ -1, -- LATIN SMALL LETTER Z WITH DOT ABOVE .. LATIN SMALL LETTER Z WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER Z WITH CARON .. LATIN SMALL LETTER Z WITH CARON
+ -300, -- LATIN SMALL LETTER LONG S .. LATIN SMALL LETTER LONG S
+ -1, -- LATIN SMALL LETTER B WITH TOPBAR .. LATIN SMALL LETTER B WITH TOPBAR
+ -1, -- LATIN SMALL LETTER TONE SIX .. LATIN SMALL LETTER TONE SIX
+ -1, -- LATIN SMALL LETTER C WITH HOOK .. LATIN SMALL LETTER C WITH HOOK
+ -1, -- LATIN SMALL LETTER D WITH TOPBAR .. LATIN SMALL LETTER D WITH TOPBAR
+ -1, -- LATIN SMALL LETTER F WITH HOOK .. LATIN SMALL LETTER F WITH HOOK
+ 97, -- LATIN SMALL LETTER HV .. LATIN SMALL LETTER HV
+ -1, -- LATIN SMALL LETTER K WITH HOOK .. LATIN SMALL LETTER K WITH HOOK
+ 130, -- LATIN SMALL LETTER N WITH LONG RIGHT LEG .. LATIN SMALL LETTER N WITH LONG RIGHT LEG
+ -1, -- LATIN SMALL LETTER O WITH HORN .. LATIN SMALL LETTER O WITH HORN
+ -1, -- LATIN SMALL LETTER OI .. LATIN SMALL LETTER OI
+ -1, -- LATIN SMALL LETTER P WITH HOOK .. LATIN SMALL LETTER P WITH HOOK
+ -1, -- LATIN SMALL LETTER TONE TWO .. LATIN SMALL LETTER TONE TWO
+ -1, -- LATIN SMALL LETTER T WITH HOOK .. LATIN SMALL LETTER T WITH HOOK
+ -1, -- LATIN SMALL LETTER U WITH HORN .. LATIN SMALL LETTER U WITH HORN
+ -1, -- LATIN SMALL LETTER Y WITH HOOK .. LATIN SMALL LETTER Y WITH HOOK
+ -1, -- LATIN SMALL LETTER Z WITH STROKE .. LATIN SMALL LETTER Z WITH STROKE
+ -1, -- LATIN SMALL LETTER EZH REVERSED .. LATIN SMALL LETTER EZH REVERSED
+ -1, -- LATIN SMALL LETTER TONE FIVE .. LATIN SMALL LETTER TONE FIVE
+ 56, -- LATIN LETTER WYNN .. LATIN LETTER WYNN
+ -1, -- LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON .. LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+ -2, -- LATIN SMALL LETTER DZ WITH CARON .. LATIN SMALL LETTER DZ WITH CARON
+ -1, -- LATIN CAPITAL LETTER L WITH SMALL LETTER J .. LATIN CAPITAL LETTER L WITH SMALL LETTER J
+ -2, -- LATIN SMALL LETTER LJ .. LATIN SMALL LETTER LJ
+ -1, -- LATIN CAPITAL LETTER N WITH SMALL LETTER J .. LATIN CAPITAL LETTER N WITH SMALL LETTER J
+ -2, -- LATIN SMALL LETTER NJ .. LATIN SMALL LETTER NJ
+ -1, -- LATIN SMALL LETTER A WITH CARON .. LATIN SMALL LETTER A WITH CARON
+ -1, -- LATIN SMALL LETTER I WITH CARON .. LATIN SMALL LETTER I WITH CARON
+ -1, -- LATIN SMALL LETTER O WITH CARON .. LATIN SMALL LETTER O WITH CARON
+ -1, -- LATIN SMALL LETTER U WITH CARON .. LATIN SMALL LETTER U WITH CARON
+ -1, -- LATIN SMALL LETTER U WITH DIAERESIS AND MACRON .. LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+ -1, -- LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE .. LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+ -1, -- LATIN SMALL LETTER U WITH DIAERESIS AND CARON .. LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+ -1, -- LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE .. LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+ -79, -- LATIN SMALL LETTER TURNED E .. LATIN SMALL LETTER TURNED E
+ -1, -- LATIN SMALL LETTER A WITH DIAERESIS AND MACRON .. LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+ -1, -- LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON .. LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+ -1, -- LATIN SMALL LETTER AE WITH MACRON .. LATIN SMALL LETTER AE WITH MACRON
+ -1, -- LATIN SMALL LETTER G WITH STROKE .. LATIN SMALL LETTER G WITH STROKE
+ -1, -- LATIN SMALL LETTER G WITH CARON .. LATIN SMALL LETTER G WITH CARON
+ -1, -- LATIN SMALL LETTER K WITH CARON .. LATIN SMALL LETTER K WITH CARON
+ -1, -- LATIN SMALL LETTER O WITH OGONEK .. LATIN SMALL LETTER O WITH OGONEK
+ -1, -- LATIN SMALL LETTER O WITH OGONEK AND MACRON .. LATIN SMALL LETTER O WITH OGONEK AND MACRON
+ -1, -- LATIN SMALL LETTER EZH WITH CARON .. LATIN SMALL LETTER EZH WITH CARON
+ -1, -- LATIN CAPITAL LETTER D WITH SMALL LETTER Z .. LATIN CAPITAL LETTER D WITH SMALL LETTER Z
+ -2, -- LATIN SMALL LETTER DZ .. LATIN SMALL LETTER DZ
+ -1, -- LATIN SMALL LETTER G WITH ACUTE .. LATIN SMALL LETTER G WITH ACUTE
+ -1, -- LATIN SMALL LETTER N WITH GRAVE .. LATIN SMALL LETTER N WITH GRAVE
+ -1, -- LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE .. LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+ -1, -- LATIN SMALL LETTER AE WITH ACUTE .. LATIN SMALL LETTER AE WITH ACUTE
+ -1, -- LATIN SMALL LETTER O WITH STROKE AND ACUTE .. LATIN SMALL LETTER O WITH STROKE AND ACUTE
+ -1, -- LATIN SMALL LETTER A WITH DOUBLE GRAVE .. LATIN SMALL LETTER A WITH DOUBLE GRAVE
+ -1, -- LATIN SMALL LETTER A WITH INVERTED BREVE .. LATIN SMALL LETTER A WITH INVERTED BREVE
+ -1, -- LATIN SMALL LETTER E WITH DOUBLE GRAVE .. LATIN SMALL LETTER E WITH DOUBLE GRAVE
+ -1, -- LATIN SMALL LETTER E WITH INVERTED BREVE .. LATIN SMALL LETTER E WITH INVERTED BREVE
+ -1, -- LATIN SMALL LETTER I WITH DOUBLE GRAVE .. LATIN SMALL LETTER I WITH DOUBLE GRAVE
+ -1, -- LATIN SMALL LETTER I WITH INVERTED BREVE .. LATIN SMALL LETTER I WITH INVERTED BREVE
+ -1, -- LATIN SMALL LETTER O WITH DOUBLE GRAVE .. LATIN SMALL LETTER O WITH DOUBLE GRAVE
+ -1, -- LATIN SMALL LETTER O WITH INVERTED BREVE .. LATIN SMALL LETTER O WITH INVERTED BREVE
+ -1, -- LATIN SMALL LETTER R WITH DOUBLE GRAVE .. LATIN SMALL LETTER R WITH DOUBLE GRAVE
+ -1, -- LATIN SMALL LETTER R WITH INVERTED BREVE .. LATIN SMALL LETTER R WITH INVERTED BREVE
+ -1, -- LATIN SMALL LETTER U WITH DOUBLE GRAVE .. LATIN SMALL LETTER U WITH DOUBLE GRAVE
+ -1, -- LATIN SMALL LETTER U WITH INVERTED BREVE .. LATIN SMALL LETTER U WITH INVERTED BREVE
+ -1, -- LATIN SMALL LETTER S WITH COMMA BELOW .. LATIN SMALL LETTER S WITH COMMA BELOW
+ -1, -- LATIN SMALL LETTER T WITH COMMA BELOW .. LATIN SMALL LETTER T WITH COMMA BELOW
+ -1, -- LATIN SMALL LETTER YOGH .. LATIN SMALL LETTER YOGH
+ -1, -- LATIN SMALL LETTER H WITH CARON .. LATIN SMALL LETTER H WITH CARON
+ -1, -- LATIN SMALL LETTER OU .. LATIN SMALL LETTER OU
+ -1, -- LATIN SMALL LETTER Z WITH HOOK .. LATIN SMALL LETTER Z WITH HOOK
+ -1, -- LATIN SMALL LETTER A WITH DOT ABOVE .. LATIN SMALL LETTER A WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER E WITH CEDILLA .. LATIN SMALL LETTER E WITH CEDILLA
+ -1, -- LATIN SMALL LETTER O WITH DIAERESIS AND MACRON .. LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+ -1, -- LATIN SMALL LETTER O WITH TILDE AND MACRON .. LATIN SMALL LETTER O WITH TILDE AND MACRON
+ -1, -- LATIN SMALL LETTER O WITH DOT ABOVE .. LATIN SMALL LETTER O WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON .. LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+ -1, -- LATIN SMALL LETTER Y WITH MACRON .. LATIN SMALL LETTER Y WITH MACRON
+ -210, -- LATIN SMALL LETTER B WITH HOOK .. LATIN SMALL LETTER B WITH HOOK
+ -206, -- LATIN SMALL LETTER OPEN O .. LATIN SMALL LETTER OPEN O
+ -205, -- LATIN SMALL LETTER D WITH TAIL .. LATIN SMALL LETTER D WITH HOOK
+ -202, -- LATIN SMALL LETTER SCHWA .. LATIN SMALL LETTER SCHWA
+ -203, -- LATIN SMALL LETTER OPEN E .. LATIN SMALL LETTER OPEN E
+ -205, -- LATIN SMALL LETTER G WITH HOOK .. LATIN SMALL LETTER G WITH HOOK
+ -207, -- LATIN SMALL LETTER GAMMA .. LATIN SMALL LETTER GAMMA
+ -209, -- LATIN SMALL LETTER I WITH STROKE .. LATIN SMALL LETTER I WITH STROKE
+ -211, -- LATIN SMALL LETTER IOTA .. LATIN SMALL LETTER IOTA
+ -211, -- LATIN SMALL LETTER TURNED M .. LATIN SMALL LETTER TURNED M
+ -213, -- LATIN SMALL LETTER N WITH LEFT HOOK .. LATIN SMALL LETTER N WITH LEFT HOOK
+ -214, -- LATIN SMALL LETTER BARRED O .. LATIN SMALL LETTER BARRED O
+ -218, -- LATIN LETTER SMALL CAPITAL R .. LATIN LETTER SMALL CAPITAL R
+ -218, -- LATIN SMALL LETTER ESH .. LATIN SMALL LETTER ESH
+ -218, -- LATIN SMALL LETTER T WITH RETROFLEX HOOK .. LATIN SMALL LETTER T WITH RETROFLEX HOOK
+ -217, -- LATIN SMALL LETTER UPSILON .. LATIN SMALL LETTER V WITH HOOK
+ -219, -- LATIN SMALL LETTER EZH .. LATIN SMALL LETTER EZH
+ -38, -- GREEK SMALL LETTER ALPHA WITH TONOS .. GREEK SMALL LETTER ALPHA WITH TONOS
+ -37, -- GREEK SMALL LETTER EPSILON WITH TONOS .. GREEK SMALL LETTER IOTA WITH TONOS
+ -32, -- GREEK SMALL LETTER ALPHA .. GREEK SMALL LETTER RHO
+ -31, -- GREEK SMALL LETTER FINAL SIGMA .. GREEK SMALL LETTER FINAL SIGMA
+ -32, -- GREEK SMALL LETTER SIGMA .. GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+ -64, -- GREEK SMALL LETTER OMICRON WITH TONOS .. GREEK SMALL LETTER OMICRON WITH TONOS
+ -63, -- GREEK SMALL LETTER UPSILON WITH TONOS .. GREEK SMALL LETTER OMEGA WITH TONOS
+ -62, -- GREEK BETA SYMBOL .. GREEK BETA SYMBOL
+ -57, -- GREEK THETA SYMBOL .. GREEK THETA SYMBOL
+ -47, -- GREEK PHI SYMBOL .. GREEK PHI SYMBOL
+ -54, -- GREEK PI SYMBOL .. GREEK PI SYMBOL
+ -1, -- GREEK SMALL LETTER ARCHAIC KOPPA .. GREEK SMALL LETTER ARCHAIC KOPPA
+ -1, -- GREEK SMALL LETTER STIGMA .. GREEK SMALL LETTER STIGMA
+ -1, -- GREEK SMALL LETTER DIGAMMA .. GREEK SMALL LETTER DIGAMMA
+ -1, -- GREEK SMALL LETTER KOPPA .. GREEK SMALL LETTER KOPPA
+ -1, -- GREEK SMALL LETTER SAMPI .. GREEK SMALL LETTER SAMPI
+ -1, -- COPTIC SMALL LETTER SHEI .. COPTIC SMALL LETTER SHEI
+ -1, -- COPTIC SMALL LETTER FEI .. COPTIC SMALL LETTER FEI
+ -1, -- COPTIC SMALL LETTER KHEI .. COPTIC SMALL LETTER KHEI
+ -1, -- COPTIC SMALL LETTER HORI .. COPTIC SMALL LETTER HORI
+ -1, -- COPTIC SMALL LETTER GANGIA .. COPTIC SMALL LETTER GANGIA
+ -1, -- COPTIC SMALL LETTER SHIMA .. COPTIC SMALL LETTER SHIMA
+ -1, -- COPTIC SMALL LETTER DEI .. COPTIC SMALL LETTER DEI
+ -86, -- GREEK KAPPA SYMBOL .. GREEK KAPPA SYMBOL
+ -80, -- GREEK RHO SYMBOL .. GREEK RHO SYMBOL
+ -79, -- GREEK LUNATE SIGMA SYMBOL .. GREEK LUNATE SIGMA SYMBOL
+ -96, -- GREEK LUNATE EPSILON SYMBOL .. GREEK LUNATE EPSILON SYMBOL
+ -32, -- CYRILLIC SMALL LETTER A .. CYRILLIC SMALL LETTER YA
+ -80, -- CYRILLIC SMALL LETTER IE WITH GRAVE .. CYRILLIC SMALL LETTER DZHE
+ -1, -- CYRILLIC SMALL LETTER OMEGA .. CYRILLIC SMALL LETTER OMEGA
+ -1, -- CYRILLIC SMALL LETTER YAT .. CYRILLIC SMALL LETTER YAT
+ -1, -- CYRILLIC SMALL LETTER IOTIFIED E .. CYRILLIC SMALL LETTER IOTIFIED E
+ -1, -- CYRILLIC SMALL LETTER LITTLE YUS .. CYRILLIC SMALL LETTER LITTLE YUS
+ -1, -- CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS .. CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS
+ -1, -- CYRILLIC SMALL LETTER BIG YUS .. CYRILLIC SMALL LETTER BIG YUS
+ -1, -- CYRILLIC SMALL LETTER IOTIFIED BIG YUS .. CYRILLIC SMALL LETTER IOTIFIED BIG YUS
+ -1, -- CYRILLIC SMALL LETTER KSI .. CYRILLIC SMALL LETTER KSI
+ -1, -- CYRILLIC SMALL LETTER PSI .. CYRILLIC SMALL LETTER PSI
+ -1, -- CYRILLIC SMALL LETTER FITA .. CYRILLIC SMALL LETTER FITA
+ -1, -- CYRILLIC SMALL LETTER IZHITSA .. CYRILLIC SMALL LETTER IZHITSA
+ -1, -- CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT .. CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+ -1, -- CYRILLIC SMALL LETTER UK .. CYRILLIC SMALL LETTER UK
+ -1, -- CYRILLIC SMALL LETTER ROUND OMEGA .. CYRILLIC SMALL LETTER ROUND OMEGA
+ -1, -- CYRILLIC SMALL LETTER OMEGA WITH TITLO .. CYRILLIC SMALL LETTER OMEGA WITH TITLO
+ -1, -- CYRILLIC SMALL LETTER OT .. CYRILLIC SMALL LETTER OT
+ -1, -- CYRILLIC SMALL LETTER KOPPA .. CYRILLIC SMALL LETTER KOPPA
+ -1, -- CYRILLIC SMALL LETTER SHORT I WITH TAIL .. CYRILLIC SMALL LETTER SHORT I WITH TAIL
+ -1, -- CYRILLIC SMALL LETTER SEMISOFT SIGN .. CYRILLIC SMALL LETTER SEMISOFT SIGN
+ -1, -- CYRILLIC SMALL LETTER ER WITH TICK .. CYRILLIC SMALL LETTER ER WITH TICK
+ -1, -- CYRILLIC SMALL LETTER GHE WITH UPTURN .. CYRILLIC SMALL LETTER GHE WITH UPTURN
+ -1, -- CYRILLIC SMALL LETTER GHE WITH STROKE .. CYRILLIC SMALL LETTER GHE WITH STROKE
+ -1, -- CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK .. CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK
+ -1, -- CYRILLIC SMALL LETTER ZHE WITH DESCENDER .. CYRILLIC SMALL LETTER ZHE WITH DESCENDER
+ -1, -- CYRILLIC SMALL LETTER ZE WITH DESCENDER .. CYRILLIC SMALL LETTER ZE WITH DESCENDER
+ -1, -- CYRILLIC SMALL LETTER KA WITH DESCENDER .. CYRILLIC SMALL LETTER KA WITH DESCENDER
+ -1, -- CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE .. CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
+ -1, -- CYRILLIC SMALL LETTER KA WITH STROKE .. CYRILLIC SMALL LETTER KA WITH STROKE
+ -1, -- CYRILLIC SMALL LETTER BASHKIR KA .. CYRILLIC SMALL LETTER BASHKIR KA
+ -1, -- CYRILLIC SMALL LETTER EN WITH DESCENDER .. CYRILLIC SMALL LETTER EN WITH DESCENDER
+ -1, -- CYRILLIC SMALL LIGATURE EN GHE .. CYRILLIC SMALL LIGATURE EN GHE
+ -1, -- CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK .. CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK
+ -1, -- CYRILLIC SMALL LETTER ABKHASIAN HA .. CYRILLIC SMALL LETTER ABKHASIAN HA
+ -1, -- CYRILLIC SMALL LETTER ES WITH DESCENDER .. CYRILLIC SMALL LETTER ES WITH DESCENDER
+ -1, -- CYRILLIC SMALL LETTER TE WITH DESCENDER .. CYRILLIC SMALL LETTER TE WITH DESCENDER
+ -1, -- CYRILLIC SMALL LETTER STRAIGHT U .. CYRILLIC SMALL LETTER STRAIGHT U
+ -1, -- CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE .. CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
+ -1, -- CYRILLIC SMALL LETTER HA WITH DESCENDER .. CYRILLIC SMALL LETTER HA WITH DESCENDER
+ -1, -- CYRILLIC SMALL LIGATURE TE TSE .. CYRILLIC SMALL LIGATURE TE TSE
+ -1, -- CYRILLIC SMALL LETTER CHE WITH DESCENDER .. CYRILLIC SMALL LETTER CHE WITH DESCENDER
+ -1, -- CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE .. CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
+ -1, -- CYRILLIC SMALL LETTER SHHA .. CYRILLIC SMALL LETTER SHHA
+ -1, -- CYRILLIC SMALL LETTER ABKHASIAN CHE .. CYRILLIC SMALL LETTER ABKHASIAN CHE
+ -1, -- CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER .. CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER
+ -1, -- CYRILLIC SMALL LETTER ZHE WITH BREVE .. CYRILLIC SMALL LETTER ZHE WITH BREVE
+ -1, -- CYRILLIC SMALL LETTER KA WITH HOOK .. CYRILLIC SMALL LETTER KA WITH HOOK
+ -1, -- CYRILLIC SMALL LETTER EL WITH TAIL .. CYRILLIC SMALL LETTER EL WITH TAIL
+ -1, -- CYRILLIC SMALL LETTER EN WITH HOOK .. CYRILLIC SMALL LETTER EN WITH HOOK
+ -1, -- CYRILLIC SMALL LETTER EN WITH TAIL .. CYRILLIC SMALL LETTER EN WITH TAIL
+ -1, -- CYRILLIC SMALL LETTER KHAKASSIAN CHE .. CYRILLIC SMALL LETTER KHAKASSIAN CHE
+ -1, -- CYRILLIC SMALL LETTER EM WITH TAIL .. CYRILLIC SMALL LETTER EM WITH TAIL
+ -1, -- CYRILLIC SMALL LETTER A WITH BREVE .. CYRILLIC SMALL LETTER A WITH BREVE
+ -1, -- CYRILLIC SMALL LETTER A WITH DIAERESIS .. CYRILLIC SMALL LETTER A WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LIGATURE A IE .. CYRILLIC SMALL LIGATURE A IE
+ -1, -- CYRILLIC SMALL LETTER IE WITH BREVE .. CYRILLIC SMALL LETTER IE WITH BREVE
+ -1, -- CYRILLIC SMALL LETTER SCHWA .. CYRILLIC SMALL LETTER SCHWA
+ -1, -- CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS .. CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER ZHE WITH DIAERESIS .. CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER ZE WITH DIAERESIS .. CYRILLIC SMALL LETTER ZE WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER ABKHASIAN DZE .. CYRILLIC SMALL LETTER ABKHASIAN DZE
+ -1, -- CYRILLIC SMALL LETTER I WITH MACRON .. CYRILLIC SMALL LETTER I WITH MACRON
+ -1, -- CYRILLIC SMALL LETTER I WITH DIAERESIS .. CYRILLIC SMALL LETTER I WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER O WITH DIAERESIS .. CYRILLIC SMALL LETTER O WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER BARRED O .. CYRILLIC SMALL LETTER BARRED O
+ -1, -- CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS .. CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER E WITH DIAERESIS .. CYRILLIC SMALL LETTER E WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER U WITH MACRON .. CYRILLIC SMALL LETTER U WITH MACRON
+ -1, -- CYRILLIC SMALL LETTER U WITH DIAERESIS .. CYRILLIC SMALL LETTER U WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE .. CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
+ -1, -- CYRILLIC SMALL LETTER CHE WITH DIAERESIS .. CYRILLIC SMALL LETTER CHE WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER YERU WITH DIAERESIS .. CYRILLIC SMALL LETTER YERU WITH DIAERESIS
+ -1, -- CYRILLIC SMALL LETTER KOMI DE .. CYRILLIC SMALL LETTER KOMI DE
+ -1, -- CYRILLIC SMALL LETTER KOMI DJE .. CYRILLIC SMALL LETTER KOMI DJE
+ -1, -- CYRILLIC SMALL LETTER KOMI ZJE .. CYRILLIC SMALL LETTER KOMI ZJE
+ -1, -- CYRILLIC SMALL LETTER KOMI DZJE .. CYRILLIC SMALL LETTER KOMI DZJE
+ -1, -- CYRILLIC SMALL LETTER KOMI LJE .. CYRILLIC SMALL LETTER KOMI LJE
+ -1, -- CYRILLIC SMALL LETTER KOMI NJE .. CYRILLIC SMALL LETTER KOMI NJE
+ -1, -- CYRILLIC SMALL LETTER KOMI SJE .. CYRILLIC SMALL LETTER KOMI SJE
+ -1, -- CYRILLIC SMALL LETTER KOMI TJE .. CYRILLIC SMALL LETTER KOMI TJE
+ -48, -- ARMENIAN SMALL LETTER AYB .. ARMENIAN SMALL LETTER FEH
+ -1, -- LATIN SMALL LETTER A WITH RING BELOW .. LATIN SMALL LETTER A WITH RING BELOW
+ -1, -- LATIN SMALL LETTER B WITH DOT ABOVE .. LATIN SMALL LETTER B WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER B WITH DOT BELOW .. LATIN SMALL LETTER B WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER B WITH LINE BELOW .. LATIN SMALL LETTER B WITH LINE BELOW
+ -1, -- LATIN SMALL LETTER C WITH CEDILLA AND ACUTE .. LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+ -1, -- LATIN SMALL LETTER D WITH DOT ABOVE .. LATIN SMALL LETTER D WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER D WITH DOT BELOW .. LATIN SMALL LETTER D WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER D WITH LINE BELOW .. LATIN SMALL LETTER D WITH LINE BELOW
+ -1, -- LATIN SMALL LETTER D WITH CEDILLA .. LATIN SMALL LETTER D WITH CEDILLA
+ -1, -- LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
+ -1, -- LATIN SMALL LETTER E WITH MACRON AND GRAVE .. LATIN SMALL LETTER E WITH MACRON AND GRAVE
+ -1, -- LATIN SMALL LETTER E WITH MACRON AND ACUTE .. LATIN SMALL LETTER E WITH MACRON AND ACUTE
+ -1, -- LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
+ -1, -- LATIN SMALL LETTER E WITH TILDE BELOW .. LATIN SMALL LETTER E WITH TILDE BELOW
+ -1, -- LATIN SMALL LETTER E WITH CEDILLA AND BREVE .. LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+ -1, -- LATIN SMALL LETTER F WITH DOT ABOVE .. LATIN SMALL LETTER F WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER G WITH MACRON .. LATIN SMALL LETTER G WITH MACRON
+ -1, -- LATIN SMALL LETTER H WITH DOT ABOVE .. LATIN SMALL LETTER H WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER H WITH DOT BELOW .. LATIN SMALL LETTER H WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER H WITH DIAERESIS .. LATIN SMALL LETTER H WITH DIAERESIS
+ -1, -- LATIN SMALL LETTER H WITH CEDILLA .. LATIN SMALL LETTER H WITH CEDILLA
+ -1, -- LATIN SMALL LETTER H WITH BREVE BELOW .. LATIN SMALL LETTER H WITH BREVE BELOW
+ -1, -- LATIN SMALL LETTER I WITH TILDE BELOW .. LATIN SMALL LETTER I WITH TILDE BELOW
+ -1, -- LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE .. LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+ -1, -- LATIN SMALL LETTER K WITH ACUTE .. LATIN SMALL LETTER K WITH ACUTE
+ -1, -- LATIN SMALL LETTER K WITH DOT BELOW .. LATIN SMALL LETTER K WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER K WITH LINE BELOW .. LATIN SMALL LETTER K WITH LINE BELOW
+ -1, -- LATIN SMALL LETTER L WITH DOT BELOW .. LATIN SMALL LETTER L WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER L WITH DOT BELOW AND MACRON .. LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+ -1, -- LATIN SMALL LETTER L WITH LINE BELOW .. LATIN SMALL LETTER L WITH LINE BELOW
+ -1, -- LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
+ -1, -- LATIN SMALL LETTER M WITH ACUTE .. LATIN SMALL LETTER M WITH ACUTE
+ -1, -- LATIN SMALL LETTER M WITH DOT ABOVE .. LATIN SMALL LETTER M WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER M WITH DOT BELOW .. LATIN SMALL LETTER M WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER N WITH DOT ABOVE .. LATIN SMALL LETTER N WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER N WITH DOT BELOW .. LATIN SMALL LETTER N WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER N WITH LINE BELOW .. LATIN SMALL LETTER N WITH LINE BELOW
+ -1, -- LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
+ -1, -- LATIN SMALL LETTER O WITH TILDE AND ACUTE .. LATIN SMALL LETTER O WITH TILDE AND ACUTE
+ -1, -- LATIN SMALL LETTER O WITH TILDE AND DIAERESIS .. LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+ -1, -- LATIN SMALL LETTER O WITH MACRON AND GRAVE .. LATIN SMALL LETTER O WITH MACRON AND GRAVE
+ -1, -- LATIN SMALL LETTER O WITH MACRON AND ACUTE .. LATIN SMALL LETTER O WITH MACRON AND ACUTE
+ -1, -- LATIN SMALL LETTER P WITH ACUTE .. LATIN SMALL LETTER P WITH ACUTE
+ -1, -- LATIN SMALL LETTER P WITH DOT ABOVE .. LATIN SMALL LETTER P WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER R WITH DOT ABOVE .. LATIN SMALL LETTER R WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER R WITH DOT BELOW .. LATIN SMALL LETTER R WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER R WITH DOT BELOW AND MACRON .. LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+ -1, -- LATIN SMALL LETTER R WITH LINE BELOW .. LATIN SMALL LETTER R WITH LINE BELOW
+ -1, -- LATIN SMALL LETTER S WITH DOT ABOVE .. LATIN SMALL LETTER S WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER S WITH DOT BELOW .. LATIN SMALL LETTER S WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE .. LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+ -1, -- LATIN SMALL LETTER S WITH CARON AND DOT ABOVE .. LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+ -1, -- LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE .. LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+ -1, -- LATIN SMALL LETTER T WITH DOT ABOVE .. LATIN SMALL LETTER T WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER T WITH DOT BELOW .. LATIN SMALL LETTER T WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER T WITH LINE BELOW .. LATIN SMALL LETTER T WITH LINE BELOW
+ -1, -- LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
+ -1, -- LATIN SMALL LETTER U WITH DIAERESIS BELOW .. LATIN SMALL LETTER U WITH DIAERESIS BELOW
+ -1, -- LATIN SMALL LETTER U WITH TILDE BELOW .. LATIN SMALL LETTER U WITH TILDE BELOW
+ -1, -- LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW .. LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
+ -1, -- LATIN SMALL LETTER U WITH TILDE AND ACUTE .. LATIN SMALL LETTER U WITH TILDE AND ACUTE
+ -1, -- LATIN SMALL LETTER U WITH MACRON AND DIAERESIS .. LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+ -1, -- LATIN SMALL LETTER V WITH TILDE .. LATIN SMALL LETTER V WITH TILDE
+ -1, -- LATIN SMALL LETTER V WITH DOT BELOW .. LATIN SMALL LETTER V WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER W WITH GRAVE .. LATIN SMALL LETTER W WITH GRAVE
+ -1, -- LATIN SMALL LETTER W WITH ACUTE .. LATIN SMALL LETTER W WITH ACUTE
+ -1, -- LATIN SMALL LETTER W WITH DIAERESIS .. LATIN SMALL LETTER W WITH DIAERESIS
+ -1, -- LATIN SMALL LETTER W WITH DOT ABOVE .. LATIN SMALL LETTER W WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER W WITH DOT BELOW .. LATIN SMALL LETTER W WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER X WITH DOT ABOVE .. LATIN SMALL LETTER X WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER X WITH DIAERESIS .. LATIN SMALL LETTER X WITH DIAERESIS
+ -1, -- LATIN SMALL LETTER Y WITH DOT ABOVE .. LATIN SMALL LETTER Y WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER Z WITH CIRCUMFLEX .. LATIN SMALL LETTER Z WITH CIRCUMFLEX
+ -1, -- LATIN SMALL LETTER Z WITH DOT BELOW .. LATIN SMALL LETTER Z WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER Z WITH LINE BELOW .. LATIN SMALL LETTER Z WITH LINE BELOW
+ -59, -- LATIN SMALL LETTER LONG S WITH DOT ABOVE .. LATIN SMALL LETTER LONG S WITH DOT ABOVE
+ -1, -- LATIN SMALL LETTER A WITH DOT BELOW .. LATIN SMALL LETTER A WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER A WITH HOOK ABOVE .. LATIN SMALL LETTER A WITH HOOK ABOVE
+ -1, -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+ -1, -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+ -1, -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+ -1, -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+ -1, -- LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW .. LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+ -1, -- LATIN SMALL LETTER A WITH BREVE AND ACUTE .. LATIN SMALL LETTER A WITH BREVE AND ACUTE
+ -1, -- LATIN SMALL LETTER A WITH BREVE AND GRAVE .. LATIN SMALL LETTER A WITH BREVE AND GRAVE
+ -1, -- LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE .. LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+ -1, -- LATIN SMALL LETTER A WITH BREVE AND TILDE .. LATIN SMALL LETTER A WITH BREVE AND TILDE
+ -1, -- LATIN SMALL LETTER A WITH BREVE AND DOT BELOW .. LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+ -1, -- LATIN SMALL LETTER E WITH DOT BELOW .. LATIN SMALL LETTER E WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER E WITH HOOK ABOVE .. LATIN SMALL LETTER E WITH HOOK ABOVE
+ -1, -- LATIN SMALL LETTER E WITH TILDE .. LATIN SMALL LETTER E WITH TILDE
+ -1, -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+ -1, -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+ -1, -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+ -1, -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+ -1, -- LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW .. LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+ -1, -- LATIN SMALL LETTER I WITH HOOK ABOVE .. LATIN SMALL LETTER I WITH HOOK ABOVE
+ -1, -- LATIN SMALL LETTER I WITH DOT BELOW .. LATIN SMALL LETTER I WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER O WITH DOT BELOW .. LATIN SMALL LETTER O WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER O WITH HOOK ABOVE .. LATIN SMALL LETTER O WITH HOOK ABOVE
+ -1, -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+ -1, -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+ -1, -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+ -1, -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+ -1, -- LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW .. LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+ -1, -- LATIN SMALL LETTER O WITH HORN AND ACUTE .. LATIN SMALL LETTER O WITH HORN AND ACUTE
+ -1, -- LATIN SMALL LETTER O WITH HORN AND GRAVE .. LATIN SMALL LETTER O WITH HORN AND GRAVE
+ -1, -- LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE .. LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+ -1, -- LATIN SMALL LETTER O WITH HORN AND TILDE .. LATIN SMALL LETTER O WITH HORN AND TILDE
+ -1, -- LATIN SMALL LETTER O WITH HORN AND DOT BELOW .. LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+ -1, -- LATIN SMALL LETTER U WITH DOT BELOW .. LATIN SMALL LETTER U WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER U WITH HOOK ABOVE .. LATIN SMALL LETTER U WITH HOOK ABOVE
+ -1, -- LATIN SMALL LETTER U WITH HORN AND ACUTE .. LATIN SMALL LETTER U WITH HORN AND ACUTE
+ -1, -- LATIN SMALL LETTER U WITH HORN AND GRAVE .. LATIN SMALL LETTER U WITH HORN AND GRAVE
+ -1, -- LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE .. LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+ -1, -- LATIN SMALL LETTER U WITH HORN AND TILDE .. LATIN SMALL LETTER U WITH HORN AND TILDE
+ -1, -- LATIN SMALL LETTER U WITH HORN AND DOT BELOW .. LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+ -1, -- LATIN SMALL LETTER Y WITH GRAVE .. LATIN SMALL LETTER Y WITH GRAVE
+ -1, -- LATIN SMALL LETTER Y WITH DOT BELOW .. LATIN SMALL LETTER Y WITH DOT BELOW
+ -1, -- LATIN SMALL LETTER Y WITH HOOK ABOVE .. LATIN SMALL LETTER Y WITH HOOK ABOVE
+ -1, -- LATIN SMALL LETTER Y WITH TILDE .. LATIN SMALL LETTER Y WITH TILDE
+ 8, -- GREEK SMALL LETTER ALPHA WITH PSILI .. GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+ 8, -- GREEK SMALL LETTER EPSILON WITH PSILI .. GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+ 8, -- GREEK SMALL LETTER ETA WITH PSILI .. GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+ 8, -- GREEK SMALL LETTER IOTA WITH PSILI .. GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+ 8, -- GREEK SMALL LETTER OMICRON WITH PSILI .. GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+ 8, -- GREEK SMALL LETTER UPSILON WITH DASIA .. GREEK SMALL LETTER UPSILON WITH DASIA
+ 8, -- GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA .. GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+ 8, -- GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA .. GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+ 8, -- GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI .. GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+ 8, -- GREEK SMALL LETTER OMEGA WITH PSILI .. GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+ 74, -- GREEK SMALL LETTER ALPHA WITH VARIA .. GREEK SMALL LETTER ALPHA WITH OXIA
+ 86, -- GREEK SMALL LETTER EPSILON WITH VARIA .. GREEK SMALL LETTER ETA WITH OXIA
+ 100, -- GREEK SMALL LETTER IOTA WITH VARIA .. GREEK SMALL LETTER IOTA WITH OXIA
+ 128, -- GREEK SMALL LETTER OMICRON WITH VARIA .. GREEK SMALL LETTER OMICRON WITH OXIA
+ 112, -- GREEK SMALL LETTER UPSILON WITH VARIA .. GREEK SMALL LETTER UPSILON WITH OXIA
+ 126, -- GREEK SMALL LETTER OMEGA WITH VARIA .. GREEK SMALL LETTER OMEGA WITH OXIA
+ 8, -- GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI .. GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+ 8, -- GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI .. GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+ 8, -- GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI .. GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+ 8, -- GREEK SMALL LETTER ALPHA WITH VRACHY .. GREEK SMALL LETTER ALPHA WITH MACRON
+ 9, -- GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI .. GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
+ -7205, -- GREEK PROSGEGRAMMENI .. GREEK PROSGEGRAMMENI
+ 9, -- GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI .. GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
+ 8, -- GREEK SMALL LETTER IOTA WITH VRACHY .. GREEK SMALL LETTER IOTA WITH MACRON
+ 8, -- GREEK SMALL LETTER UPSILON WITH VRACHY .. GREEK SMALL LETTER UPSILON WITH MACRON
+ 7, -- GREEK SMALL LETTER RHO WITH DASIA .. GREEK SMALL LETTER RHO WITH DASIA
+ 9, -- GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI .. GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
+ -32, -- FULLWIDTH LATIN SMALL LETTER A .. FULLWIDTH LATIN SMALL LETTER Z
+ -40); -- DESERET SMALL LETTER LONG I .. DESERET SMALL LETTER ENG
+
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
+
+ function Range_Search (U : Char_Code; R : UTF_32_Ranges) return Natural;
+ -- Searches the given ranges (which must be in ascending order by Lo value)
+ -- and returns the index of the matching range in R if U matches one of the
+ -- ranges. If U matches none of the ranges, returns zero.
+
+ ---------------------
+ -- Is_UTF_32_Digit --
+ ---------------------
+
+ function Is_UTF_32_Digit (U : Char_Code) return Boolean is
+ begin
+ return Range_Search (U, UTF_32_Digits) /= 0;
+ end Is_UTF_32_Digit;
+
+ ----------------------
+ -- Is_UTF_32_Letter --
+ ----------------------
+
+ function Is_UTF_32_Letter (U : Char_Code) return Boolean is
+ begin
+ return Range_Search (U, UTF_32_Letters) /= 0;
+ end Is_UTF_32_Letter;
+
+ -------------------------------
+ -- Is_UTF_32_Line_Terminator --
+ -------------------------------
+
+ function Is_UTF_32_Line_Terminator (U : Char_Code) return Boolean is
+ begin
+ return U in 10 .. 13 -- Ascii.LF Ascii.VT Ascii.FF Ascii.CR
+ or else U = 16#02028# -- LINE SEPARATOR
+ or else U = 16#02029#; -- PARAGRAPH SEPARATOR
+ end Is_UTF_32_Line_Terminator;
+
+ --------------------
+ -- Is_UTF_32_Mark --
+ --------------------
+
+ function Is_UTF_32_Mark (U : Char_Code) return Boolean is
+ begin
+ return Range_Search (U, UTF_32_Marks) /= 0;
+ end Is_UTF_32_Mark;
+
+ ---------------------------
+ -- Is_UTF_32_Non_Graphic --
+ ---------------------------
+
+ function Is_UTF_32_Non_Graphic (U : Char_Code) return Boolean is
+ begin
+ return Range_Search (U, UTF_32_Non_Graphic) /= 0;
+ end Is_UTF_32_Non_Graphic;
+
+ ---------------------
+ -- Is_UTF_32_Other --
+ ---------------------
+
+ function Is_UTF_32_Other (U : Char_Code) return Boolean is
+ begin
+ return Range_Search (U, UTF_32_Other_Format) /= 0;
+ end Is_UTF_32_Other;
+
+ ---------------------------
+ -- Is_UTF_32_Punctuation --
+ ---------------------------
+
+ function Is_UTF_32_Punctuation (U : Char_Code) return Boolean is
+ begin
+ return Range_Search (U, UTF_32_Punctuation) /= 0;
+ end Is_UTF_32_Punctuation;
+
+ ---------------------
+ -- Is_UTF_32_Space --
+ ---------------------
+
+ function Is_UTF_32_Space (U : Char_Code) return Boolean is
+ begin
+ return Range_Search (U, UTF_32_Spaces) /= 0;
+ end Is_UTF_32_Space;
+
---------------------------
-- Is_Start_Of_Wide_Char --
---------------------------
function Is_Start_Of_Wide_Char
- (S : Source_Buffer_Ptr;
- P : Source_Ptr)
- return Boolean
+ (S : Source_Buffer_Ptr;
+ P : Source_Ptr) return Boolean
is
begin
case Wide_Character_Encoding_Method is
@@ -79,6 +1615,42 @@ package body Widechar is
return WC_Longest_Sequence;
end Length_Wide;
+ ------------------
+ -- Range_Search --
+ ------------------
+
+ function Range_Search (U : Char_Code; R : UTF_32_Ranges) return Natural is
+ Lo : Integer;
+ Hi : Integer;
+ Mid : Integer;
+
+ begin
+ Lo := R'First;
+ Hi := R'Last;
+
+ loop
+ Mid := (Lo + Hi) / 2;
+
+ if U < R (Mid).Lo then
+ Hi := Mid - 1;
+
+ if Hi < Lo then
+ return 0;
+ end if;
+
+ elsif R (Mid).Hi < U then
+ Lo := Mid + 1;
+
+ if Hi < Lo then
+ return 0;
+ end if;
+
+ else
+ return Mid;
+ end if;
+ end loop;
+ end Range_Search;
+
---------------
-- Scan_Wide --
---------------
@@ -92,17 +1664,22 @@ package body Widechar is
function In_Char return Character;
-- Function to obtain characters of wide character escape sequence
+ -------------
+ -- In_Char --
+ -------------
+
function In_Char return Character is
begin
P := P + 1;
return S (P - 1);
end In_Char;
- function WC_In is new Char_Sequence_To_Wide_Char (In_Char);
+ function WC_In is new Char_Sequence_To_UTF_32 (In_Char);
+
+ -- Start of processingf for Scan_Wide
begin
- C := Char_Code (Wide_Character'Pos
- (WC_In (In_Char, Wide_Character_Encoding_Method)));
+ C := Char_Code (WC_In (In_Char, Wide_Character_Encoding_Method));
Err := False;
exception
@@ -124,16 +1701,22 @@ package body Widechar is
procedure Out_Char (C : Character);
-- Procedure to store one character of wide character sequence
+ --------------
+ -- Out_Char --
+ --------------
+
procedure Out_Char (C : Character) is
begin
P := P + 1;
S (P) := C;
end Out_Char;
- procedure WC_Out is new Wide_Char_To_Char_Sequence (Out_Char);
+ procedure WC_Out is new UTF_32_To_Char_Sequence (Out_Char);
+
+ -- Start of processing for Set_Wide
begin
- WC_Out (Wide_Character'Val (C), Wide_Character_Encoding_Method);
+ WC_Out (UTF_32_Code (C), Wide_Character_Encoding_Method);
end Set_Wide;
---------------
@@ -144,19 +1727,68 @@ package body Widechar is
function Skip_Char return Character;
-- Function to skip one character of wide character escape sequence
+ ---------------
+ -- Skip_Char --
+ ---------------
+
function Skip_Char return Character is
begin
P := P + 1;
return S (P - 1);
end Skip_Char;
- function WC_Skip is new Char_Sequence_To_Wide_Char (Skip_Char);
+ function WC_Skip is new Char_Sequence_To_UTF_32 (Skip_Char);
- Discard : Wide_Character;
+ Discard : UTF_32_Code;
pragma Warnings (Off, Discard);
+ -- Start of processing for Skip_Wide
+
begin
Discard := WC_Skip (Skip_Char, Wide_Character_Encoding_Method);
end Skip_Wide;
+ ---------------
+ -- Skip_Wide --
+ ---------------
+
+ procedure Skip_Wide (S : Source_Buffer_Ptr; P : in out Source_Ptr) is
+ function Skip_Char return Character;
+ -- Function to skip one character of wide character escape sequence
+
+ ---------------
+ -- Skip_Char --
+ ---------------
+
+ function Skip_Char return Character is
+ begin
+ P := P + 1;
+ return S (P - 1);
+ end Skip_Char;
+
+ function WC_Skip is new Char_Sequence_To_UTF_32 (Skip_Char);
+
+ Discard : UTF_32_Code;
+ pragma Warnings (Off, Discard);
+
+ -- Start of processing for Skip_Wide
+
+ begin
+ Discard := WC_Skip (Skip_Char, Wide_Character_Encoding_Method);
+ end Skip_Wide;
+
+ --------------------------
+ -- UTF_32_To_Upper_Case --
+ --------------------------
+
+ function UTF_32_To_Upper_Case (U : Char_Code) return Char_Code is
+ Index : constant Integer := Range_Search (U, Lower_Case_Letters);
+ begin
+ if Index = 0 then
+ return U;
+ else
+ return U + Upper_Case_Adjust (Index);
+ end if;
+ end UTF_32_To_Upper_Case;
+
end Widechar;
diff --git a/gcc/ada/widechar.ads b/gcc/ada/widechar.ads
index 5126d4c758a..f70fb72d680 100644
--- a/gcc/ada/widechar.ads
+++ b/gcc/ada/widechar.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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,7 +31,10 @@
-- --
------------------------------------------------------------------------------
--- Subprograms for manipulation of wide character sequences
+-- Subprograms for manipulation of wide character sequences. Note that in
+-- this package, wide character and wide wide character are not distinguished
+-- since this package is basically concerned with syntactic notions, and it
+-- deals with Char_Code values, rather than values of actual Ada types.
with Types; use Types;
@@ -40,7 +43,8 @@ package Widechar is
function Length_Wide return Nat;
-- Returns the maximum length in characters for the escape sequence that
-- is used to encode wide character literals outside the ASCII range. Used
- -- only in the implementation of the attribute Width for Wide_Character.
+ -- only in the implementation of the attribute Width for Wide_Character
+ -- and Wide_Wide_Character.
procedure Scan_Wide
(S : Source_Buffer_Ptr;
@@ -76,10 +80,88 @@ package Widechar is
-- checking is done, since this is only used on escape sequences generated
-- by Set_Wide, which are known to be correct.
+ procedure Skip_Wide (S : Source_Buffer_Ptr; P : in out Source_Ptr);
+ -- Similar to the above procedure, but operates on a source buffer
+ -- instead of a string, with P being a Source_Ptr referencing the
+ -- contents of the source buffer.
+
function Is_Start_Of_Wide_Char
- (S : Source_Buffer_Ptr;
- P : Source_Ptr)
- return Boolean;
+ (S : Source_Buffer_Ptr;
+ P : Source_Ptr) return Boolean;
-- Determines if S (P) is the start of a wide character sequence
+ function Is_UTF_32_Letter (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Letter);
+ -- Returns true iff U is a letter that can be used to start an identifier.
+ -- This means that it is in one of the following categories:
+ -- Letter, Uppercase (Lu)
+ -- Letter, Lowercase (Ll)
+ -- Letter, Titlecase (Lt)
+ -- Letter, Modifier (Lm)
+ -- Letter, Other (Lo)
+ -- Number, Letter (Nl)
+
+ function Is_UTF_32_Digit (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Digit);
+ -- Returns true iff U is a digit that can be used to extend an identifer,
+ -- which means it is in one of the following categories:
+ -- Number, Decimal_Digit (Nd)
+
+ function Is_UTF_32_Line_Terminator (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Line_Terminator);
+ -- Returns true iff U is an allowed line terminator for source programs,
+ -- which means it is in one of the following categories:
+ -- Separator, Line (Zl)
+ -- Separator, Paragraph (Zp)
+ -- or that it is a conventional line terminator (CR, LF, VT, FF)
+
+ function Is_UTF_32_Mark (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Mark);
+ -- Returns true iff U is a mark character which can be used to extend
+ -- an identifier. This means it is in one of the following categories:
+ -- Mark, Non-Spacing (Mn)
+ -- Mark, Spacing Combining (Mc)
+
+ function Is_UTF_32_Other (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Other);
+ -- Returns true iff U is an other format character, which means that it
+ -- can be used to extend an identifier, but is ignored for the purposes of
+ -- matching of identiers. This means that it is in one of the following
+ -- categories:
+ -- Other, Format (Cf)
+
+ function Is_UTF_32_Punctuation (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Punctuation);
+ -- Returns true iff U is a punctuation character that can be used to
+ -- separate pices of an identifier. This means that it is in one of the
+ -- following categories:
+ -- Punctuation, Connector (Pc)
+
+ function Is_UTF_32_Space (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Space);
+ -- Returns true iff U is considered a space to be ignored, which means
+ -- that it is in one of the following categories:
+ -- Separator, Space (Zs)
+
+ function Is_UTF_32_Non_Graphic (U : Char_Code) return Boolean;
+ pragma Inline (Is_UTF_32_Non_Graphic);
+ -- Returns true iff U is considered to be a non-graphic character,
+ -- which means that it is in one of the following categories:
+ -- Other, Control (Cc)
+ -- Other, Private Use (Co)
+ -- Other, Surrogate (Cs)
+ -- Other, Format (Cf)
+ -- Separator, Line (Zl)
+ -- Separator, Paragraph (Zp)
+ --
+ -- Note that the Ada category format effector is subsumed by the above
+ -- list of Unicode categories.
+
+ function UTF_32_To_Upper_Case (U : Char_Code) return Char_Code;
+ pragma Inline (UTF_32_To_Upper_Case);
+ -- If U represents a lower case letter, returns the corresponding upper
+ -- case letter, otherwise U is returned unchanged. The folding is locale
+ -- independent as defined by documents referenced in the note in section
+ -- 1 of ISO/IEC 10646:2003
+
end Widechar;
diff --git a/gcc/ada/xr_tabls.ads b/gcc/ada/xr_tabls.ads
index 2b19944e7b4..effdd8a54dd 100644
--- a/gcc/ada/xr_tabls.ads
+++ b/gcc/ada/xr_tabls.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1998-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2005 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- --
@@ -24,6 +24,8 @@
-- --
------------------------------------------------------------------------------
+-- We need comment here saying what this package is???
+
with GNAT.OS_Lib;
package Xr_Tabls is
diff --git a/gcc/ada/xsinfo.adb b/gcc/ada/xsinfo.adb
index 011a2759594..c6ade51f7a4 100644
--- a/gcc/ada/xsinfo.adb
+++ b/gcc/ada/xsinfo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -24,7 +24,7 @@
-- --
------------------------------------------------------------------------------
--- Program to construct C header file a-sinfo.h (C version of sinfo.ads spec,
+-- Program to construct C header file sinfo.h (C version of sinfo.ads spec,
-- for use by Gigi, contains all definitions and access functions, but does
-- not contain set procedures, since Gigi never modifies the GNAT tree)
@@ -34,14 +34,14 @@
-- Output files:
--- a-sinfo.h Corresponding c header file
+-- sinfo.h Corresponding c header file
-- Note: this program assumes that sinfo.ads has passed the error checks
-- which are carried out by the CSinfo utility, so it does not duplicate
-- these checks and assumes the soruce is correct.
-- An optional argument allows the specification of an output file name to
--- override the default a-sinfo.h file name for the generated output file.
+-- override the default sinfo.h file name for the generated output file.
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
@@ -118,7 +118,7 @@ begin
if Argument_Count > 0 then
Create (Ofile, Out_File, Argument (1));
else
- Create (Ofile, Out_File, "a-sinfo.h");
+ Create (Ofile, Out_File, "sinfo.h");
end if;
Open (InS, In_File, "sinfo.ads");
diff --git a/gcc/ada/xsnames.adb b/gcc/ada/xsnames.adb
index 60368ed6fa8..d93cfbd8d3e 100644
--- a/gcc/ada/xsnames.adb
+++ b/gcc/ada/xsnames.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -138,7 +138,7 @@ begin
loop
Line := Get_Line (InB);
- exit when Match (Line, " ""#"";");
+ exit when Match (Line, " ""#"";");
end loop;
Put_Line (OutB, Line);
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 47cd99d22c4..3382cd7321e 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -779,7 +779,7 @@ extern void alloc_aux_for_edge (edge, int);
extern void alloc_aux_for_edges (int);
extern void clear_aux_for_edges (void);
extern void free_aux_for_edges (void);
-extern void find_basic_blocks (rtx, int, FILE *);
+extern void find_basic_blocks (rtx);
extern bool cleanup_cfg (int);
extern bool delete_unreachable_blocks (void);
extern bool merge_seq_blocks (void);
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index f454ce0a3c3..44a501161ab 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -488,6 +488,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
do
{
int prob, freq;
+ bool ends_in_call;
/* The probability and frequency of the best edge. */
int best_prob = INT_MIN / 2;
@@ -501,6 +502,8 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
fprintf (dump_file, "Basic block %d was visited in trace %d\n",
bb->index, *n_traces - 1);
+ ends_in_call = block_ends_with_call_p (bb);
+
/* Select the successor that will be placed after BB. */
FOR_EACH_EDGE (e, ei, bb->succs)
{
@@ -520,6 +523,19 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
prob = e->probability;
freq = EDGE_FREQUENCY (e);
+ /* The only sensible preference for a call instruction is the
+ fallthru edge. Don't bother selecting anything else. */
+ if (ends_in_call)
+ {
+ if (e->flags & EDGE_CAN_FALLTHRU)
+ {
+ best_edge = e;
+ best_prob = prob;
+ best_freq = freq;
+ }
+ continue;
+ }
+
/* Edge that cannot be fallthru or improbable or infrequent
successor (i.e. it is unsuitable successor). */
if (!(e->flags & EDGE_CAN_FALLTHRU) || (e->flags & EDGE_COMPLEX)
@@ -2015,7 +2031,7 @@ duplicate_computed_gotos (void)
uncond_jump_length = get_uncond_jump_length ();
max_size = uncond_jump_length * PARAM_VALUE (PARAM_MAX_GOTO_DUPLICATION_INSNS);
- candidates = BITMAP_XMALLOC ();
+ candidates = BITMAP_ALLOC (NULL);
/* Build the reorder chain for the original order of blocks.
Look for a computed jump while we are at it. */
@@ -2034,7 +2050,17 @@ duplicate_computed_gotos (void)
FOR_BB_INSNS (bb, insn)
{
if (INSN_P (insn))
- size += get_attr_length (insn);
+ {
+ /* If the insn isn't copyable, don't duplicate
+ the block. */
+ if (targetm.cannot_copy_insn_p
+ && targetm.cannot_copy_insn_p (insn))
+ {
+ size = max_size + 1;
+ break;
+ }
+ size += get_attr_length (insn);
+ }
if (size > max_size)
break;
}
@@ -2078,7 +2104,7 @@ duplicate_computed_gotos (void)
done:
cfg_layout_finalize ();
- BITMAP_XFREE (candidates);
+ BITMAP_FREE (candidates);
timevar_pop (TV_REORDER_BLOCKS);
}
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 140dd007e79..198b756fb7a 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -1,5 +1,5 @@
/* Functions to support general ended bitmaps.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -700,14 +700,15 @@ bitmap_and_compl (bitmap dst, bitmap a, bitmap b)
dst->indx = dst->current->indx;
}
-/* A &= ~B */
+/* A &= ~B. Returns true if A changes */
-void
+bool
bitmap_and_compl_into (bitmap a, bitmap b)
{
bitmap_element *a_elt = a->first;
bitmap_element *b_elt = b->first;
bitmap_element *next;
+ BITMAP_WORD changed = 0;
gcc_assert (a != b);
while (a_elt && b_elt)
@@ -724,9 +725,11 @@ bitmap_and_compl_into (bitmap a, bitmap b)
for (ix = BITMAP_ELEMENT_WORDS; ix--;)
{
- BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix];
+ BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix];
+ BITMAP_WORD r = a_elt->bits[ix] ^ cleared;
a_elt->bits[ix] = r;
+ changed |= cleared;
ior |= r;
}
next = a_elt->next;
@@ -738,6 +741,7 @@ bitmap_and_compl_into (bitmap a, bitmap b)
}
gcc_assert (!a->current == !a->first);
gcc_assert (!a->current || a->indx == a->current->indx);
+ return changed != 0;
}
/* DST = A | B. Return true if DST changes. */
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index beb59d85f86..2915623fa41 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -1,5 +1,5 @@
/* Functions to support general ended bitmaps.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -102,7 +102,7 @@ extern bool bitmap_intersect_compl_p (bitmap, bitmap);
extern void bitmap_and (bitmap, bitmap, bitmap);
extern void bitmap_and_into (bitmap, bitmap);
extern void bitmap_and_compl (bitmap, bitmap, bitmap);
-extern void bitmap_and_compl_into (bitmap, bitmap);
+extern bool bitmap_and_compl_into (bitmap, bitmap);
extern bool bitmap_ior (bitmap, bitmap, bitmap);
extern bool bitmap_ior_into (bitmap, bitmap);
extern void bitmap_xor (bitmap, bitmap, bitmap);
@@ -159,16 +159,10 @@ extern unsigned bitmap_first_set_bit (bitmap);
/* Allocate a gc'd bitmap. */
#define BITMAP_GGC_ALLOC() bitmap_gc_alloc ()
-/* Allocate a bitmap with xmalloc. */
-#define BITMAP_XMALLOC() BITMAP_ALLOC (NULL)
-
/* Do any cleanup needed on a bitmap when it is no longer used. */
#define BITMAP_FREE(BITMAP) \
((void)(bitmap_obstack_free (BITMAP), (BITMAP) = NULL))
-/* Do any cleanup needed on an xmalloced bitmap when it is no longer used. */
-#define BITMAP_XFREE(BITMAP) BITMAP_FREE (BITMAP)
-
/* Iterator for bitmaps. */
typedef struct
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index c3bc3fab542..0fc47a0c88b 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -1,5 +1,5 @@
/* Perform branch target register load optimizations.
- Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -996,7 +996,7 @@ btr_def_live_range (btr_def def, HARD_REG_SET *btrs_live_in_range)
{
btr_user user;
- def->live_range = BITMAP_XMALLOC ();
+ def->live_range = BITMAP_ALLOC (NULL);
bitmap_set_bit (def->live_range, def->bb->index);
COPY_HARD_REG_SET (*btrs_live_in_range,
@@ -1056,7 +1056,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range)
target registers live over the merged range. */
int btr;
HARD_REG_SET combined_btrs_live;
- bitmap combined_live_range = BITMAP_XMALLOC ();
+ bitmap combined_live_range = BITMAP_ALLOC (NULL);
btr_user user;
if (other_def->live_range == NULL)
@@ -1114,7 +1114,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range)
delete_insn (other_def->insn);
}
- BITMAP_XFREE (combined_live_range);
+ BITMAP_FREE (combined_live_range);
}
}
}
@@ -1287,7 +1287,7 @@ migrate_btr_def (btr_def def, int min_cost)
}
btr_def_live_range (def, &btrs_live_in_range);
- live_range = BITMAP_XMALLOC ();
+ live_range = BITMAP_ALLOC (NULL);
bitmap_copy (live_range, def->live_range);
#ifdef INSN_SCHEDULING
@@ -1361,7 +1361,7 @@ migrate_btr_def (btr_def def, int min_cost)
if (dump_file)
fprintf (dump_file, "failed to move\n");
}
- BITMAP_XFREE (live_range);
+ BITMAP_FREE (live_range);
return !give_up;
}
@@ -1420,7 +1420,7 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
}
}
else
- BITMAP_XFREE (def->live_range);
+ BITMAP_FREE (def->live_range);
}
free (btrs_live);
diff --git a/gcc/builtins.c b/gcc/builtins.c
index dada41ef848..078edc39b51 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -59,8 +59,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
const char *const built_in_class_names[4]
= {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"};
-#define DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM) #X,
-const char *const built_in_names[(int) END_BUILTINS] =
+#define DEF_BUILTIN(X, N, C, T, LT, B, F, NA, AT, IM, COND) #X,
+const char * built_in_names[(int) END_BUILTINS] =
{
#include "builtins.def"
};
@@ -124,10 +124,10 @@ static rtx builtin_memset_gen_str (void *, HOST_WIDE_INT, enum machine_mode);
static rtx expand_builtin_memset (tree, rtx, enum machine_mode);
static rtx expand_builtin_bzero (tree);
static rtx expand_builtin_strlen (tree, rtx, enum machine_mode);
-static rtx expand_builtin_strstr (tree, rtx, enum machine_mode);
-static rtx expand_builtin_strpbrk (tree, rtx, enum machine_mode);
-static rtx expand_builtin_strchr (tree, rtx, enum machine_mode);
-static rtx expand_builtin_strrchr (tree, rtx, enum machine_mode);
+static rtx expand_builtin_strstr (tree, tree, rtx, enum machine_mode);
+static rtx expand_builtin_strpbrk (tree, tree, rtx, enum machine_mode);
+static rtx expand_builtin_strchr (tree, tree, rtx, enum machine_mode);
+static rtx expand_builtin_strrchr (tree, tree, rtx, enum machine_mode);
static rtx expand_builtin_alloca (tree, rtx);
static rtx expand_builtin_unop (enum machine_mode, tree, rtx, rtx, optab);
static rtx expand_builtin_frame_address (tree, tree);
@@ -152,6 +152,7 @@ static tree fold_builtin_cabs (tree, tree);
static tree fold_builtin_sqrt (tree, tree);
static tree fold_builtin_cbrt (tree, tree);
static tree fold_builtin_pow (tree, tree, tree);
+static tree fold_builtin_powi (tree, tree, tree);
static tree fold_builtin_sin (tree);
static tree fold_builtin_cos (tree, tree, tree);
static tree fold_builtin_tan (tree);
@@ -164,12 +165,12 @@ static tree fold_builtin_bitop (tree);
static tree fold_builtin_memcpy (tree);
static tree fold_builtin_mempcpy (tree, tree, int);
static tree fold_builtin_memmove (tree, tree);
-static tree fold_builtin_strchr (tree);
+static tree fold_builtin_strchr (tree, tree);
static tree fold_builtin_memcmp (tree);
static tree fold_builtin_strcmp (tree);
static tree fold_builtin_strncmp (tree);
static tree fold_builtin_signbit (tree);
-static tree fold_builtin_copysign (tree, tree);
+static tree fold_builtin_copysign (tree, tree, tree);
static tree fold_builtin_isascii (tree);
static tree fold_builtin_toascii (tree);
static tree fold_builtin_isdigit (tree);
@@ -178,9 +179,9 @@ static tree fold_builtin_abs (tree, tree);
static tree fold_builtin_unordered_cmp (tree, enum tree_code, enum tree_code);
static tree fold_builtin_1 (tree, bool);
-static tree fold_builtin_strpbrk (tree);
-static tree fold_builtin_strstr (tree);
-static tree fold_builtin_strrchr (tree);
+static tree fold_builtin_strpbrk (tree, tree);
+static tree fold_builtin_strstr (tree, tree);
+static tree fold_builtin_strrchr (tree, tree);
static tree fold_builtin_strcat (tree);
static tree fold_builtin_strncat (tree);
static tree fold_builtin_strspn (tree);
@@ -452,11 +453,16 @@ builtin_save_expr (tree exp)
address located within it (depending on FNDECL_CODE). */
static rtx
-expand_builtin_return_addr (enum built_in_function fndecl_code, int count,
- rtx tem)
+expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
{
int i;
+#ifdef INITIAL_FRAME_ADDRESS_RTX
+ rtx tem = INITIAL_FRAME_ADDRESS_RTX;
+#else
+ rtx tem = hard_frame_pointer_rtx;
+#endif
+
/* Some machines need special handling before we can access
arbitrary frames. For example, on the sparc, we must first flush
all register windows to the stack. */
@@ -1563,6 +1569,7 @@ mathfn_built_in (tree type, enum built_in_function fn)
CASE_MATHFN (BUILT_IN_NEXTAFTER)
CASE_MATHFN (BUILT_IN_NEXTTOWARD)
CASE_MATHFN (BUILT_IN_POW)
+ CASE_MATHFN (BUILT_IN_POWI)
CASE_MATHFN (BUILT_IN_POW10)
CASE_MATHFN (BUILT_IN_REMAINDER)
CASE_MATHFN (BUILT_IN_REMQUO)
@@ -1860,6 +1867,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
{
optab builtin_optab;
rtx op0, op1, insns;
+ int op1_type = REAL_TYPE;
tree fndecl = get_callee_fndecl (exp);
tree arglist = TREE_OPERAND (exp, 1);
tree arg0, arg1, temp, narg;
@@ -1867,7 +1875,12 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
bool errno_set = true;
bool stable = true;
- if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE))
+ if ((DECL_FUNCTION_CODE (fndecl) == BUILT_IN_LDEXP)
+ || (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_LDEXPF)
+ || (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_LDEXPL))
+ op1_type = INTEGER_TYPE;
+
+ if (!validate_arglist (arglist, REAL_TYPE, op1_type, VOID_TYPE))
return 0;
arg0 = TREE_VALUE (arglist);
@@ -1883,6 +1896,10 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
case BUILT_IN_ATAN2F:
case BUILT_IN_ATAN2L:
builtin_optab = atan2_optab; break;
+ case BUILT_IN_LDEXP:
+ case BUILT_IN_LDEXPF:
+ case BUILT_IN_LDEXPL:
+ builtin_optab = ldexp_optab; break;
case BUILT_IN_FMOD:
case BUILT_IN_FMODF:
case BUILT_IN_FMODL:
@@ -2349,6 +2366,66 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
return expand_builtin_mathfn_2 (exp, target, subtarget);
}
+/* Expand a call to the powi built-in mathematical function. Return 0 if
+ a normal call should be emitted rather than expanding the function
+ in-line. EXP is the expression that is a call to the builtin
+ function; if convenient, the result should be placed in TARGET. */
+
+static rtx
+expand_builtin_powi (tree exp, rtx target, rtx subtarget)
+{
+ tree arglist = TREE_OPERAND (exp, 1);
+ tree arg0, arg1;
+ rtx op0, op1;
+ enum machine_mode mode;
+
+ if (! validate_arglist (arglist, REAL_TYPE, INTEGER_TYPE, VOID_TYPE))
+ return 0;
+
+ arg0 = TREE_VALUE (arglist);
+ arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+ mode = TYPE_MODE (TREE_TYPE (exp));
+
+ /* Handle constant power. */
+
+ if (TREE_CODE (arg1) == INTEGER_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg1))
+ {
+ HOST_WIDE_INT n = TREE_INT_CST_LOW (arg1);
+
+ /* If the exponent is -1, 0, 1 or 2, then expand_powi is exact.
+ Otherwise, check the number of multiplications required. */
+ if ((TREE_INT_CST_HIGH (arg1) == 0
+ || TREE_INT_CST_HIGH (arg1) == -1)
+ && ((n >= -1 && n <= 2)
+ || (! optimize_size
+ && powi_cost (n) <= POWI_MAX_MULTS)))
+ {
+ op0 = expand_expr (arg0, subtarget, VOIDmode, 0);
+ op0 = force_reg (mode, op0);
+ return expand_powi (op0, mode, n);
+ }
+ }
+
+ /* Emit a libcall to libgcc. */
+
+ if (target == NULL_RTX)
+ target = gen_reg_rtx (mode);
+
+ op0 = expand_expr (arg0, subtarget, mode, 0);
+ if (GET_MODE (op0) != mode)
+ op0 = convert_to_mode (mode, op0, 0);
+ op1 = expand_expr (arg1, 0, word_mode, 0);
+ if (GET_MODE (op1) != word_mode)
+ op1 = convert_to_mode (word_mode, op1, 0);
+
+ target = emit_library_call_value (powi_optab->handlers[(int) mode].libfunc,
+ target, LCT_CONST_MAKE_BLOCK, mode, 2,
+ op0, mode, op1, word_mode);
+
+ return target;
+}
+
/* Expand expression EXP which is a call to the strlen builtin. Return 0
if we failed the caller should emit a normal call, otherwise
try to get the result in TARGET, if convenient. */
@@ -2462,11 +2539,11 @@ expand_builtin_strlen (tree arglist, rtx target,
in TARGET, if convenient (and in mode MODE if that's convenient). */
static rtx
-expand_builtin_strstr (tree arglist, rtx target, enum machine_mode mode)
+expand_builtin_strstr (tree arglist, tree type, rtx target, enum machine_mode mode)
{
if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
{
- tree result = fold_builtin_strstr (arglist);
+ tree result = fold_builtin_strstr (arglist, type);
if (result)
return expand_expr (result, target, mode, EXPAND_NORMAL);
}
@@ -2478,11 +2555,11 @@ expand_builtin_strstr (tree arglist, rtx target, enum machine_mode mode)
in TARGET, if convenient (and in mode MODE if that's convenient). */
static rtx
-expand_builtin_strchr (tree arglist, rtx target, enum machine_mode mode)
+expand_builtin_strchr (tree arglist, tree type, rtx target, enum machine_mode mode)
{
if (validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
{
- tree result = fold_builtin_strchr (arglist);
+ tree result = fold_builtin_strchr (arglist, type);
if (result)
return expand_expr (result, target, mode, EXPAND_NORMAL);
@@ -2496,11 +2573,11 @@ expand_builtin_strchr (tree arglist, rtx target, enum machine_mode mode)
in TARGET, if convenient (and in mode MODE if that's convenient). */
static rtx
-expand_builtin_strrchr (tree arglist, rtx target, enum machine_mode mode)
+expand_builtin_strrchr (tree arglist, tree type, rtx target, enum machine_mode mode)
{
if (validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
{
- tree result = fold_builtin_strrchr (arglist);
+ tree result = fold_builtin_strrchr (arglist, type);
if (result)
return expand_expr (result, target, mode, EXPAND_NORMAL);
}
@@ -2512,11 +2589,11 @@ expand_builtin_strrchr (tree arglist, rtx target, enum machine_mode mode)
in TARGET, if convenient (and in mode MODE if that's convenient). */
static rtx
-expand_builtin_strpbrk (tree arglist, rtx target, enum machine_mode mode)
+expand_builtin_strpbrk (tree arglist, tree type, rtx target, enum machine_mode mode)
{
if (validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
{
- tree result = fold_builtin_strpbrk (arglist);
+ tree result = fold_builtin_strpbrk (arglist, type);
if (result)
return expand_expr (result, target, mode, EXPAND_NORMAL);
}
@@ -4149,8 +4226,7 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
{
rtx tem
= expand_builtin_return_addr (DECL_FUNCTION_CODE (fndecl),
- tree_low_cst (TREE_VALUE (arglist), 1),
- hard_frame_pointer_rtx);
+ tree_low_cst (TREE_VALUE (arglist), 1));
/* Some ports cannot access arbitrary stack frames. */
if (tem == NULL)
@@ -4783,7 +4859,7 @@ expand_builtin_profile_func (bool exitp)
emit_library_call (which, LCT_NORMAL, VOIDmode, 2, this, Pmode,
expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
- 0, hard_frame_pointer_rtx),
+ 0),
Pmode);
return const0_rtx;
@@ -5186,9 +5262,20 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
return target;
break;
+ case BUILT_IN_POWI:
+ case BUILT_IN_POWIF:
+ case BUILT_IN_POWIL:
+ target = expand_builtin_powi (exp, target, subtarget);
+ if (target)
+ return target;
+ break;
+
case BUILT_IN_ATAN2:
case BUILT_IN_ATAN2F:
case BUILT_IN_ATAN2L:
+ case BUILT_IN_LDEXP:
+ case BUILT_IN_LDEXPF:
+ case BUILT_IN_LDEXPL:
case BUILT_IN_FMOD:
case BUILT_IN_FMODF:
case BUILT_IN_FMODL:
@@ -5399,27 +5486,27 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
break;
case BUILT_IN_STRSTR:
- target = expand_builtin_strstr (arglist, target, mode);
+ target = expand_builtin_strstr (arglist, TREE_TYPE (exp), target, mode);
if (target)
return target;
break;
case BUILT_IN_STRPBRK:
- target = expand_builtin_strpbrk (arglist, target, mode);
+ target = expand_builtin_strpbrk (arglist, TREE_TYPE (exp), target, mode);
if (target)
return target;
break;
case BUILT_IN_INDEX:
case BUILT_IN_STRCHR:
- target = expand_builtin_strchr (arglist, target, mode);
+ target = expand_builtin_strchr (arglist, TREE_TYPE (exp), target, mode);
if (target)
return target;
break;
case BUILT_IN_RINDEX:
case BUILT_IN_STRRCHR:
- target = expand_builtin_strrchr (arglist, target, mode);
+ target = expand_builtin_strrchr (arglist, TREE_TYPE (exp), target, mode);
if (target)
return target;
break;
@@ -6186,7 +6273,7 @@ fold_builtin_sqrt (tree arglist, tree type)
}
}
- /* Optimize sqrt(pow(x,y)) = pow(x,y*0.5). */
+ /* Optimize sqrt(pow(x,y)) = pow(|x|,y*0.5). */
if (flag_unsafe_math_optimizations
&& (fcode == BUILT_IN_POW
|| fcode == BUILT_IN_POWF
@@ -6195,8 +6282,11 @@ fold_builtin_sqrt (tree arglist, tree type)
tree powfn = TREE_OPERAND (TREE_OPERAND (arg, 0), 0);
tree arg0 = TREE_VALUE (TREE_OPERAND (arg, 1));
tree arg1 = TREE_VALUE (TREE_CHAIN (TREE_OPERAND (arg, 1)));
- tree narg1 = fold (build2 (MULT_EXPR, type, arg1,
- build_real (type, dconsthalf)));
+ tree narg1;
+ if (!tree_expr_nonnegative_p (arg0))
+ arg0 = build1 (ABS_EXPR, type, arg0);
+ narg1 = fold (build2 (MULT_EXPR, type, arg1,
+ build_real (type, dconsthalf)));
arglist = tree_cons (NULL_TREE, arg0,
build_tree_list (NULL_TREE, narg1));
return build_function_call_expr (powfn, arglist);
@@ -6772,7 +6862,10 @@ fold_builtin_pow (tree fndecl, tree arglist, tree type)
if (TREE_CODE (arg1) == REAL_CST
&& ! TREE_CONSTANT_OVERFLOW (arg1))
{
+ REAL_VALUE_TYPE cint;
REAL_VALUE_TYPE c;
+ HOST_WIDE_INT n;
+
c = TREE_REAL_CST (arg1);
/* Optimize pow(x,0.0) = 1.0. */
@@ -6802,17 +6895,14 @@ fold_builtin_pow (tree fndecl, tree arglist, tree type)
}
}
- /* Attempt to evaluate pow at compile-time. */
- if (TREE_CODE (arg0) == REAL_CST
- && ! TREE_CONSTANT_OVERFLOW (arg0))
+ /* Check for an integer exponent. */
+ n = real_to_integer (&c);
+ real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0);
+ if (real_identical (&c, &cint))
{
- REAL_VALUE_TYPE cint;
- HOST_WIDE_INT n;
-
- n = real_to_integer (&c);
- real_from_integer (&cint, VOIDmode, n,
- n < 0 ? -1 : 0, 0);
- if (real_identical (&c, &cint))
+ /* Attempt to evaluate pow at compile-time. */
+ if (TREE_CODE (arg0) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg0))
{
REAL_VALUE_TYPE x;
bool inexact;
@@ -6822,6 +6912,18 @@ fold_builtin_pow (tree fndecl, tree arglist, tree type)
if (flag_unsafe_math_optimizations || !inexact)
return build_real (type, x);
}
+
+ /* Strip sign ops from even integer powers. */
+ if ((n & 1) == 0 && flag_unsafe_math_optimizations)
+ {
+ tree narg0 = fold_strip_sign_ops (arg0);
+ if (narg0)
+ {
+ arglist = build_tree_list (NULL_TREE, arg1);
+ arglist = tree_cons (NULL_TREE, narg0, arglist);
+ return build_function_call_expr (fndecl, arglist);
+ }
+ }
}
}
@@ -6864,6 +6966,53 @@ fold_builtin_pow (tree fndecl, tree arglist, tree type)
return NULL_TREE;
}
+/* Fold a builtin function call to powi, powif, or powil. Return
+ NULL_TREE if no simplification can be made. */
+static tree
+fold_builtin_powi (tree fndecl ATTRIBUTE_UNUSED, tree arglist, tree type)
+{
+ tree arg0 = TREE_VALUE (arglist);
+ tree arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+
+ if (!validate_arglist (arglist, REAL_TYPE, INTEGER_TYPE, VOID_TYPE))
+ return NULL_TREE;
+
+ /* Optimize pow(1.0,y) = 1.0. */
+ if (real_onep (arg0))
+ return omit_one_operand (type, build_real (type, dconst1), arg1);
+
+ if (host_integerp (arg1, 0))
+ {
+ HOST_WIDE_INT c = TREE_INT_CST_LOW (arg1);
+
+ /* Evaluate powi at compile-time. */
+ if (TREE_CODE (arg0) == REAL_CST
+ && ! TREE_CONSTANT_OVERFLOW (arg0))
+ {
+ REAL_VALUE_TYPE x;
+ x = TREE_REAL_CST (arg0);
+ real_powi (&x, TYPE_MODE (type), &x, c);
+ return build_real (type, x);
+ }
+
+ /* Optimize pow(x,0) = 1.0. */
+ if (c == 0)
+ return omit_one_operand (type, build_real (type, dconst1),
+ arg0);
+
+ /* Optimize pow(x,1) = x. */
+ if (c == 1)
+ return arg0;
+
+ /* Optimize pow(x,-1) = 1.0/x. */
+ if (c == -1)
+ return fold (build2 (RDIV_EXPR, type,
+ build_real (type, dconst1), arg0));
+ }
+
+ return NULL_TREE;
+}
+
/* A subroutine of fold_builtin to fold the various exponent
functions. EXP is the CALL_EXPR of a call to a builtin function.
VALUE is the value which will be raised to a power. */
@@ -7375,9 +7524,9 @@ fold_builtin_signbit (tree exp)
Return NULL_TREE if no simplification can be made. */
static tree
-fold_builtin_copysign (tree arglist, tree type)
+fold_builtin_copysign (tree fndecl, tree arglist, tree type)
{
- tree arg1, arg2;
+ tree arg1, arg2, tem;
if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, VOID_TYPE))
return NULL_TREE;
@@ -7411,6 +7560,14 @@ fold_builtin_copysign (tree arglist, tree type)
fold (build1 (ABS_EXPR, type, arg1)),
arg2);
+ /* Strip sign changing operations for the first argument. */
+ tem = fold_strip_sign_ops (arg1);
+ if (tem)
+ {
+ arglist = tree_cons (NULL_TREE, tem, TREE_CHAIN (arglist));
+ return build_function_call_expr (fndecl, arglist);
+ }
+
return NULL_TREE;
}
@@ -7466,11 +7623,18 @@ fold_builtin_isdigit (tree arglist)
else
{
/* Transform isdigit(c) -> (unsigned)(c) - '0' <= 9. */
- /* According to the C standard, isdigit is unaffected by locale. */
- tree arg = TREE_VALUE (arglist);
- arg = fold_convert (unsigned_type_node, arg);
+ /* According to the C standard, isdigit is unaffected by locale.
+ However, it definitely is affected by the target character set. */
+ tree arg;
+ unsigned HOST_WIDE_INT target_digit0
+ = lang_hooks.to_target_charset ('0');
+
+ if (target_digit0 == 0)
+ return NULL_TREE;
+
+ arg = fold_convert (unsigned_type_node, TREE_VALUE (arglist));
arg = build2 (MINUS_EXPR, unsigned_type_node, arg,
- build_int_cst (unsigned_type_node, TARGET_DIGIT0));
+ build_int_cst (unsigned_type_node, target_digit0));
arg = build2 (LE_EXPR, integer_type_node, arg,
build_int_cst (unsigned_type_node, 9));
arg = fold (arg);
@@ -7679,6 +7843,44 @@ fold_builtin_unordered_cmp (tree exp,
fold (build2 (code, type, arg0, arg1))));
}
+/* Fold a call to one of the external complex multiply libcalls. */
+
+static tree
+fold_builtin_complex_mul (tree type, tree arglist)
+{
+ tree ar, ai, br, bi;
+
+ if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, REAL_TYPE,
+ REAL_TYPE, VOID_TYPE))
+ return NULL;
+
+ ar = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ ai = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ br = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ bi = TREE_VALUE (arglist);
+
+ return fold_complex_mult_parts (type, ar, ai, br, bi);
+}
+
+/* Fold a call to one of the external complex division libcalls. */
+
+static tree
+fold_builtin_complex_div (tree type, tree arglist)
+{
+ tree ar, ai, br, bi;
+
+ if (!validate_arglist (arglist, REAL_TYPE, REAL_TYPE, REAL_TYPE,
+ REAL_TYPE, VOID_TYPE))
+ return NULL;
+
+ ar = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ ai = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ br = TREE_VALUE (arglist); arglist = TREE_CHAIN (arglist);
+ bi = TREE_VALUE (arglist);
+
+ return fold_complex_div_parts (type, ar, ai, br, bi, RDIV_EXPR);
+}
+
/* Used by constant folding to simplify calls to builtin functions. EXP is
the CALL_EXPR of a call to a builtin function. IGNORE is true if the
result of the function call is ignored. This function returns NULL_TREE
@@ -7690,11 +7892,13 @@ fold_builtin_1 (tree exp, bool ignore)
tree fndecl = get_callee_fndecl (exp);
tree arglist = TREE_OPERAND (exp, 1);
tree type = TREE_TYPE (TREE_TYPE (fndecl));
+ enum built_in_function fcode;
if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
return targetm.fold_builtin (exp, ignore);
- switch (DECL_FUNCTION_CODE (fndecl))
+ fcode = DECL_FUNCTION_CODE (fndecl);
+ switch (fcode)
{
case BUILT_IN_FPUTS:
return fold_builtin_fputs (arglist, ignore, false, NULL_TREE);
@@ -7703,7 +7907,7 @@ fold_builtin_1 (tree exp, bool ignore)
return fold_builtin_fputs (arglist, ignore, true, NULL_TREE);
case BUILT_IN_STRSTR:
- return fold_builtin_strstr (arglist);
+ return fold_builtin_strstr (arglist, type);
case BUILT_IN_STRCAT:
return fold_builtin_strcat (arglist);
@@ -7719,11 +7923,11 @@ fold_builtin_1 (tree exp, bool ignore)
case BUILT_IN_STRCHR:
case BUILT_IN_INDEX:
- return fold_builtin_strchr (arglist);
+ return fold_builtin_strchr (arglist, type);
case BUILT_IN_STRRCHR:
case BUILT_IN_RINDEX:
- return fold_builtin_strrchr (arglist);
+ return fold_builtin_strrchr (arglist, type);
case BUILT_IN_STRCPY:
return fold_builtin_strcpy (exp, NULL_TREE);
@@ -7738,7 +7942,7 @@ fold_builtin_1 (tree exp, bool ignore)
return fold_builtin_strncmp (arglist);
case BUILT_IN_STRPBRK:
- return fold_builtin_strpbrk (arglist);
+ return fold_builtin_strpbrk (arglist, type);
case BUILT_IN_BCMP:
case BUILT_IN_MEMCMP:
@@ -7877,6 +8081,11 @@ fold_builtin_1 (tree exp, bool ignore)
case BUILT_IN_POWL:
return fold_builtin_pow (fndecl, arglist, type);
+ case BUILT_IN_POWI:
+ case BUILT_IN_POWIF:
+ case BUILT_IN_POWIL:
+ return fold_builtin_powi (fndecl, arglist, type);
+
case BUILT_IN_INF:
case BUILT_IN_INFF:
case BUILT_IN_INFL:
@@ -7984,7 +8193,7 @@ fold_builtin_1 (tree exp, bool ignore)
case BUILT_IN_COPYSIGN:
case BUILT_IN_COPYSIGNF:
case BUILT_IN_COPYSIGNL:
- return fold_builtin_copysign (arglist, type);
+ return fold_builtin_copysign (fndecl, arglist, type);
case BUILT_IN_FINITE:
case BUILT_IN_FINITEF:
@@ -8019,6 +8228,12 @@ fold_builtin_1 (tree exp, bool ignore)
break;
default:
+ if (fcode >= BUILT_IN_COMPLEX_MUL_MIN
+ && fcode <= BUILT_IN_COMPLEX_MUL_MAX)
+ return fold_builtin_complex_mul (type, arglist);
+ if (fcode >= BUILT_IN_COMPLEX_DIV_MIN
+ && fcode <= BUILT_IN_COMPLEX_DIV_MAX)
+ return fold_builtin_complex_div (type, arglist);
break;
}
@@ -8168,7 +8383,7 @@ readonly_data_expr (tree exp)
form of the builtin function call. */
static tree
-fold_builtin_strstr (tree arglist)
+fold_builtin_strstr (tree arglist, tree type)
{
if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
@@ -8186,13 +8401,15 @@ fold_builtin_strstr (tree arglist)
if (p1 != NULL)
{
const char *r = strstr (p1, p2);
+ tree tem;
if (r == NULL)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- return fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
- s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ tem = fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
+ s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ return fold_convert (type, tem);
}
if (p2[0] == '\0')
@@ -8232,7 +8449,7 @@ fold_builtin_strstr (tree arglist)
form of the builtin function call. */
static tree
-fold_builtin_strchr (tree arglist)
+fold_builtin_strchr (tree arglist, tree type)
{
if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return 0;
@@ -8249,6 +8466,7 @@ fold_builtin_strchr (tree arglist)
{
char c;
const char *r;
+ tree tem;
if (target_char_cast (s2, &c))
return 0;
@@ -8259,8 +8477,9 @@ fold_builtin_strchr (tree arglist)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- return fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
- s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ tem = fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
+ s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ return fold_convert (type, tem);
}
return 0;
}
@@ -8284,7 +8503,7 @@ fold_builtin_strchr (tree arglist)
form of the builtin function call. */
static tree
-fold_builtin_strrchr (tree arglist)
+fold_builtin_strrchr (tree arglist, tree type)
{
if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE))
return 0;
@@ -8302,6 +8521,7 @@ fold_builtin_strrchr (tree arglist)
{
char c;
const char *r;
+ tree tem;
if (target_char_cast (s2, &c))
return 0;
@@ -8312,8 +8532,9 @@ fold_builtin_strrchr (tree arglist)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- return fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
- s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ tem = fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
+ s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ return fold_convert (type, tem);
}
if (! integer_zerop (s2))
@@ -8346,7 +8567,7 @@ fold_builtin_strrchr (tree arglist)
form of the builtin function call. */
static tree
-fold_builtin_strpbrk (tree arglist)
+fold_builtin_strpbrk (tree arglist, tree type)
{
if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
return 0;
@@ -8364,13 +8585,15 @@ fold_builtin_strpbrk (tree arglist)
if (p1 != NULL)
{
const char *r = strpbrk (p1, p2);
+ tree tem;
if (r == NULL)
return build_int_cst (TREE_TYPE (s1), 0);
/* Return an offset into the constant string argument. */
- return fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
- s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ tem = fold (build2 (PLUS_EXPR, TREE_TYPE (s1),
+ s1, build_int_cst (TREE_TYPE (s1), r - p1)));
+ return fold_convert (type, tem);
}
if (p2[0] == '\0')
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 9fc347f7369..d422783f91e 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -1,6 +1,6 @@
/* This file contains the definitions and documentation for the
builtins used in the GNU compiler.
- Copyright (C) 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -69,7 +69,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef DEF_GCC_BUILTIN
#define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
- false, false, false, ATTRS, true)
+ false, false, false, ATTRS, true, true)
/* A library builtin (like __builtin_strchr) is a builtin equivalent
of an ANSI/ISO standard library function. In addition to the
@@ -80,7 +80,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef DEF_LIB_BUILTIN
#define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, true, false, ATTRS, true)
+ true, true, false, ATTRS, true, true)
/* Like DEF_LIB_BUILTIN, except that the function is not one that is
specified by ANSI/ISO C. So, when we're being fully conformant we
@@ -89,21 +89,21 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef DEF_EXT_LIB_BUILTIN
#define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, true, true, ATTRS, false)
+ true, true, true, ATTRS, false, true)
/* Like DEF_LIB_BUILTIN, except that the function is only a part of
the standard in C94 or above. */
#undef DEF_C94_BUILTIN
#define DEF_C94_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, true, !flag_isoc94, ATTRS, TARGET_C99_FUNCTIONS)
+ true, true, !flag_isoc94, ATTRS, TARGET_C99_FUNCTIONS, true)
/* Like DEF_LIB_BUILTIN, except that the function is only a part of
the standard in C99 or above. */
#undef DEF_C99_BUILTIN
#define DEF_C99_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
+ true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true)
/* Builtin that is specified by C99 and C90 reserve the name for future use.
We can still recognize the builtin in C90 mode but we can't produce it
@@ -111,7 +111,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef DEF_C99_C90RES_BUILTIN
#define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
- true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS)
+ true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true)
+
+/* Allocate the enum and the name for a builtin, but do not actually
+ define it here at all. */
+#undef DEF_BUILTIN_STUB
+#define DEF_BUILTIN_STUB(ENUM, NAME) \
+ DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, 0, 0, false, false, \
+ false, 0, false, false)
/* Define an attribute list for math functions that are normally
"impure" because some of them may write into global memory for
@@ -306,6 +313,9 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10, "pow10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHF
DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10F, "pow10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10L, "pow10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_POWF, "powf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_GCC_BUILTIN (BUILT_IN_POWI, "powi", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING)
+DEF_GCC_BUILTIN (BUILT_IN_POWIF, "powif", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING)
+DEF_GCC_BUILTIN (BUILT_IN_POWIL, "powil", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING)
DEF_C99_C90RES_BUILTIN (BUILT_IN_POWL, "powl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_REMAINDER, "remainder", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_REMAINDERF, "remainderf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
@@ -607,8 +617,6 @@ DEF_GCC_BUILTIN (BUILT_IN_RETURN, "return", BT_FN_VOID_PTR, ATTR_NORETURN
DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UINT, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_SAVEREGS, "saveregs", BT_FN_PTR_VAR, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_SETJMP, "setjmp", BT_FN_INT_PTR, ATTR_NULL)
-DEF_GCC_BUILTIN (BUILT_IN_STACK_SAVE, "stack_save", BT_FN_PTR, ATTR_NULL)
-DEF_GCC_BUILTIN (BUILT_IN_STACK_RESTORE, "stack_restore", BT_FN_VOID_PTR, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_STDARG_START, "stdarg_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL)
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRFMON, "strfmon", BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_STRFMON_3_4)
DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, ATTR_FORMAT_STRFTIME_3_0)
@@ -620,12 +628,16 @@ DEF_GCC_BUILTIN (BUILT_IN_VA_END, "va_end", BT_FN_VOID_VALIST_REF, ATTR_N
DEF_GCC_BUILTIN (BUILT_IN_VA_START, "va_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL)
DEF_EXT_LIB_BUILTIN (BUILT_IN__EXIT, "_exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
DEF_C99_BUILTIN (BUILT_IN__EXIT2, "_Exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
-DEF_GCC_BUILTIN (BUILT_IN_INIT_TRAMPOLINE, "init_trampoline", BT_FN_VOID_PTR_PTR_PTR, ATTR_NOTHROW_LIST)
-DEF_GCC_BUILTIN (BUILT_IN_ADJUST_TRAMPOLINE, "adjust_trampoline", BT_FN_PTR_PTR, ATTR_CONST_NOTHROW_LIST)
-DEF_GCC_BUILTIN (BUILT_IN_NONLOCAL_GOTO, "nonlocal_goto", BT_FN_PTR_PTR, ATTR_NORETURN_NOTHROW_LIST)
+
+/* Implementing nested functions. */
+DEF_BUILTIN_STUB (BUILT_IN_INIT_TRAMPOLINE, "__builtin_init_trampoline")
+DEF_BUILTIN_STUB (BUILT_IN_ADJUST_TRAMPOLINE, "__builtin_adjust_trampoline")
+DEF_BUILTIN_STUB (BUILT_IN_NONLOCAL_GOTO, "__builtin_nonlocal_goto")
+
+/* Implementing variable sized local variables. */
+DEF_BUILTIN_STUB (BUILT_IN_STACK_SAVE, "__builtin_stack_save")
+DEF_BUILTIN_STUB (BUILT_IN_STACK_RESTORE, "__builtin_stack_restore")
/* Profiling hooks. */
-DEF_GCC_BUILTIN (BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter",
- BT_FN_VOID, ATTR_NULL)
-DEF_GCC_BUILTIN (BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit",
- BT_FN_VOID, ATTR_NULL)
+DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter")
+DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit")
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 72fd8466df7..39868e88659 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1606,12 +1606,36 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp)
return void_type_node;
if (mode == TYPE_MODE (build_pointer_type (char_type_node)))
- return unsignedp ? make_unsigned_type (mode) : make_signed_type (mode);
+ return (unsignedp
+ ? make_unsigned_type (GET_MODE_PRECISION (mode))
+ : make_signed_type (GET_MODE_PRECISION (mode)));
if (mode == TYPE_MODE (build_pointer_type (integer_type_node)))
- return unsignedp ? make_unsigned_type (mode) : make_signed_type (mode);
+ return (unsignedp
+ ? make_unsigned_type (GET_MODE_PRECISION (mode))
+ : make_signed_type (GET_MODE_PRECISION (mode)));
- if (VECTOR_MODE_P (mode))
+ if (COMPLEX_MODE_P (mode))
+ {
+ enum machine_mode inner_mode;
+ tree inner_type;
+
+ if (mode == TYPE_MODE (complex_float_type_node))
+ return complex_float_type_node;
+ if (mode == TYPE_MODE (complex_double_type_node))
+ return complex_double_type_node;
+ if (mode == TYPE_MODE (complex_long_double_type_node))
+ return complex_long_double_type_node;
+
+ if (mode == TYPE_MODE (complex_integer_type_node) && !unsignedp)
+ return complex_integer_type_node;
+
+ inner_mode = GET_MODE_INNER (mode);
+ inner_type = c_common_type_for_mode (inner_mode, unsignedp);
+ if (inner_type != NULL_TREE)
+ return build_complex_type (inner_type);
+ }
+ else if (VECTOR_MODE_P (mode))
{
enum machine_mode inner_mode = GET_MODE_INNER (mode);
tree inner_type = c_common_type_for_mode (inner_mode, unsignedp);
@@ -3199,9 +3223,9 @@ c_common_nodes_and_builtins (void)
c_init_attributes ();
-#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, \
- BOTH_P, FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT) \
- if (NAME) \
+#define DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P, \
+ NONANSI_P, ATTRS, IMPLICIT, COND) \
+ if (NAME && COND) \
{ \
tree decl; \
\
@@ -3234,6 +3258,8 @@ c_common_nodes_and_builtins (void)
#include "builtins.def"
#undef DEF_BUILTIN
+ build_common_builtin_nodes ();
+
targetm.init_builtins ();
if (flag_mudflap)
mudflap_init ();
@@ -5598,6 +5624,27 @@ c_warn_unused_result (tree *top_p)
}
}
+/* Convert a character from the host to the target execution character
+ set. cpplib handles this, mostly. */
+
+HOST_WIDE_INT
+c_common_to_target_charset (HOST_WIDE_INT c)
+{
+ /* Character constants in GCC proper are sign-extended under -fsigned-char,
+ zero-extended under -fno-signed-char. cpplib insists that characters
+ and character constants are always unsigned. Hence we must convert
+ back and forth. */
+ cppchar_t uc = ((cppchar_t)c) & ((((cppchar_t)1) << CHAR_BIT)-1);
+
+ uc = cpp_host_to_exec_charset (parse_in, uc);
+
+ if (flag_signed_char)
+ return ((HOST_WIDE_INT)uc) << (HOST_BITS_PER_WIDE_INT - CHAR_TYPE_SIZE)
+ >> (HOST_BITS_PER_WIDE_INT - CHAR_TYPE_SIZE);
+ else
+ return uc;
+}
+
/* Build the result of __builtin_offsetof. EXPR is a nested sequence of
component references, with an INDIRECT_REF at the bottom; much like
the traditional rendering of offsetof as a macro. Returns the folded
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 13377f167fa..91be602066b 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -688,12 +688,14 @@ extern bool c_promoting_integer_type_p (tree);
extern int self_promoting_args_p (tree);
extern tree strip_array_types (tree);
extern tree strip_pointer_operator (tree);
+extern HOST_WIDE_INT c_common_to_target_charset (HOST_WIDE_INT);
/* This is the basic parsing function. */
extern void c_parse_file (void);
/* This is misnamed, it actually performs end-of-compilation processing. */
extern void finish_file (void);
+
/* These macros provide convenient access to the various _STMT nodes. */
/* Nonzero if this statement should be considered a full-expression,
diff --git a/gcc/c-config-lang.in b/gcc/c-config-lang.in
index c0a786f53fd..6b5edc2a2d3 100644
--- a/gcc/c-config-lang.in
+++ b/gcc/c-config-lang.in
@@ -1,5 +1,5 @@
# Top level configure fragment for GNU C - C language.
-# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -23,4 +23,4 @@
# files used by C that have garbage collection GTY macros in them
# which therefore need to be scanned by gengtype.c.
-gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-objc-common.c"
+gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-parser.c"
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 0b7b97ede23..690d3b3bc80 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2581,7 +2581,7 @@ c_init_decl_processing (void)
tree ptr_ftype_void, ptr_ftype_ptr;
location_t save_loc = input_location;
- /* Adds some ggc roots, and reserved words for c-parse.in. */
+ /* Initialize reserved words for parser. */
c_parse_init ();
current_function_decl = 0;
@@ -6746,6 +6746,8 @@ build_null_declspecs (void)
ret->attrs = 0;
ret->typespec_word = cts_none;
ret->storage_class = csc_none;
+ ret->declspecs_seen_p = false;
+ ret->type_seen_p = false;
ret->non_sc_seen_p = false;
ret->typedef_p = false;
ret->tag_defined_p = false;
@@ -6775,6 +6777,7 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual)
enum rid i;
bool dupe = false;
specs->non_sc_seen_p = true;
+ specs->declspecs_seen_p = true;
gcc_assert (TREE_CODE (qual) == IDENTIFIER_NODE
&& C_IS_RESERVED_WORD (qual));
i = C_RID_CODE (qual);
@@ -6808,6 +6811,8 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
{
tree type = spec.spec;
specs->non_sc_seen_p = true;
+ specs->declspecs_seen_p = true;
+ specs->type_seen_p = true;
if (TREE_DEPRECATED (type))
specs->deprecated_p = true;
@@ -7102,6 +7107,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec)
enum rid i;
enum c_storage_class n = csc_none;
bool dupe = false;
+ specs->declspecs_seen_p = true;
gcc_assert (TREE_CODE (scspec) == IDENTIFIER_NODE
&& C_IS_RESERVED_WORD (scspec));
i = C_RID_CODE (scspec);
@@ -7184,6 +7190,7 @@ struct c_declspecs *
declspecs_add_attrs (struct c_declspecs *specs, tree attrs)
{
specs->attrs = chainon (attrs, specs->attrs);
+ specs->declspecs_seen_p = true;
return specs;
}
diff --git a/gcc/c-objc-common.h b/gcc/c-objc-common.h
index 4c7be6327ab..5107dce068d 100644
--- a/gcc/c-objc-common.h
+++ b/gcc/c-objc-common.h
@@ -1,5 +1,5 @@
/* Language hooks common to C and ObjC front ends.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
This file is part of GCC.
@@ -117,6 +117,8 @@ extern void c_initialize_diagnostics (diagnostic_context *);
#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to
#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
+#undef LANG_HOOKS_TO_TARGET_CHARSET
+#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
/* The C front end's scoping structure is very different from
that expected by the language-independent code; it is best
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 36c3f5bd68e..575ff4d485b 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -978,6 +978,11 @@ c_common_post_options (const char **pfilename)
if (warn_missing_format_attribute && !warn_format)
warning ("-Wmissing-format-attribute ignored without -Wformat");
+ /* C99 requires special handling of complex multiplication and division;
+ -ffast-math and -fcx-limited-range are handled in process_options. */
+ if (flag_isoc99)
+ flag_complex_method = 2;
+
if (flag_preprocess_only)
{
/* Open the output now. We must do so even if flag_no_output is
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
deleted file mode 100644
index fe0d51709eb..00000000000
--- a/gcc/c-parse.in
+++ /dev/null
@@ -1,3588 +0,0 @@
-/* YACC parser for C syntax and for Objective C. -*-c-*-
- Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT 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
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-/* This file defines the grammar of C and that of Objective C.
- @@ifobjc ... @@end_ifobjc conditionals contain code for Objective C only.
- @@ifc ... @@end_ifc conditionals contain code for C only.
- Sed commands in Makefile.in are used to convert this file into
- c-parse.y and into objc-parse.y. */
-
-/* To whomever it may concern: I have heard that such a thing was once
- written by AT&T, but I have never seen it. */
-
-@@ifc
-%expect 13 /* shift/reduce conflicts, and no reduce/reduce conflicts. */
-@@end_ifc
-
-%{
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "tree.h"
-#include "langhooks.h"
-#include "input.h"
-#include "cpplib.h"
-#include "intl.h"
-#include "timevar.h"
-#include "c-pragma.h" /* For YYDEBUG definition, and parse_in. */
-#include "c-tree.h"
-#include "flags.h"
-#include "varray.h"
-#include "output.h"
-#include "toplev.h"
-#include "ggc.h"
-#include "c-common.h"
-
-#define YYERROR1 { yyerror ("syntax error"); YYERROR; }
-
-/* Like the default stack expander, except (1) use realloc when possible,
- (2) impose no hard maxiumum on stack size, (3) REALLY do not use alloca.
-
- Irritatingly, YYSTYPE is defined after this %{ %} block, so we cannot
- give malloced_yyvs its proper type. This is ok since all we need from
- it is to be able to free it. */
-
-static short *malloced_yyss;
-static void *malloced_yyvs;
-
-#define yyoverflow(MSG, SS, SSSIZE, VS, VSSIZE, YYSSZ) \
-do { \
- size_t newsize; \
- short *newss; \
- YYSTYPE *newvs; \
- newsize = *(YYSSZ) *= 2; \
- if (malloced_yyss) \
- { \
- newss = really_call_realloc (*(SS), newsize * sizeof (short)); \
- newvs = really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
- } \
- else \
- { \
- newss = really_call_malloc (newsize * sizeof (short)); \
- newvs = really_call_malloc (newsize * sizeof (YYSTYPE)); \
- if (newss) \
- memcpy (newss, *(SS), (SSSIZE)); \
- if (newvs) \
- memcpy (newvs, *(VS), (VSSIZE)); \
- } \
- if (!newss || !newvs) \
- { \
- yyerror (MSG); \
- return 2; \
- } \
- *(SS) = newss; \
- *(VS) = newvs; \
- malloced_yyss = newss; \
- malloced_yyvs = (void *) newvs; \
-} while (0)
-%}
-
-%start program
-
-%union {long itype; tree ttype; void *otype; struct c_expr exprtype;
- struct c_arg_info *arginfotype; struct c_declarator *dtrtype;
- struct c_type_name *typenametype; struct c_parm *parmtype;
- struct c_declspecs *dsptype; struct c_typespec tstype;
- enum tree_code code; location_t location; }
-
-/* All identifiers that are not reserved words
- and are not declared typedefs in the current block */
-%token IDENTIFIER
-
-/* All identifiers that are declared typedefs in the current block.
- In some contexts, they are treated just like IDENTIFIER,
- but they can also serve as typespecs in declarations. */
-%token TYPENAME
-
-/* Reserved words that specify storage class.
- yylval contains an IDENTIFIER_NODE which indicates which one. */
-%token SCSPEC /* Storage class other than static. */
-%token STATIC /* Static storage class. */
-
-/* Reserved words that specify type.
- yylval contains an IDENTIFIER_NODE which indicates which one. */
-%token TYPESPEC
-
-/* Reserved words that qualify type: "const", "volatile", or "restrict".
- yylval contains an IDENTIFIER_NODE which indicates which one. */
-%token TYPE_QUAL
-
-/* Objective-C protocol qualifiers. These acquire their magic powers
- only in certain contexts. */
-%token OBJC_TYPE_QUAL
-
-/* Character or numeric constants.
- yylval is the node for the constant. */
-%token CONSTANT
-
-/* String constants in raw form.
- yylval is a STRING_CST node. */
-
-%token STRING
-
-/* "...", used for functions with variable arglists. */
-%token ELLIPSIS
-
-/* the reserved words */
-/* SCO include files test "ASM", so use something else. */
-%token SIZEOF ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
-%token BREAK CONTINUE RETURN GOTO ASM_KEYWORD TYPEOF ALIGNOF
-%token ATTRIBUTE EXTENSION LABEL
-%token REALPART IMAGPART VA_ARG CHOOSE_EXPR TYPES_COMPATIBLE_P
-%token FUNC_NAME OFFSETOF
-
-/* Add precedence rules to solve dangling else s/r conflict */
-%nonassoc IF
-%nonassoc ELSE
-
-/* Define the operator tokens and their precedences.
- The value is an integer because, if used, it is the tree code
- to use in the expression made from the operator. */
-
-%right <code> ASSIGN '='
-%right <code> '?' ':'
-%left <code> OROR
-%left <code> ANDAND
-%left <code> '|'
-%left <code> '^'
-%left <code> '&'
-%left <code> EQCOMPARE
-%left <code> ARITHCOMPARE
-%left <code> LSHIFT RSHIFT
-%left <code> '+' '-'
-%left <code> '*' '/' '%'
-%right <code> UNARY PLUSPLUS MINUSMINUS
-%left HYPERUNARY
-%left <code> POINTSAT '.' '(' '['
-
-/* The Objective-C keywords. These are included in C and in
- Objective C, so that the token codes are the same in both. */
-%token AT_INTERFACE AT_IMPLEMENTATION AT_END AT_SELECTOR AT_DEFS AT_ENCODE
-%token CLASSNAME AT_PUBLIC AT_PRIVATE AT_PROTECTED AT_PROTOCOL
-%token AT_CLASS AT_ALIAS
-%token AT_THROW AT_TRY AT_CATCH AT_FINALLY AT_SYNCHRONIZED
-%token OBJC_STRING
-
-%type <code> unop
-%type <ttype> ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
-%type <ttype> BREAK CONTINUE RETURN GOTO ASM_KEYWORD SIZEOF TYPEOF ALIGNOF
-
-%type <ttype> identifier IDENTIFIER TYPENAME CONSTANT STRING FUNC_NAME
-%type <ttype> nonnull_exprlist exprlist
-%type <exprtype> expr expr_no_commas cast_expr unary_expr primary
-%type <dsptype> declspecs_nosc_nots_nosa_noea declspecs_nosc_nots_nosa_ea
-%type <dsptype> declspecs_nosc_nots_sa_noea declspecs_nosc_nots_sa_ea
-%type <dsptype> declspecs_nosc_ts_nosa_noea declspecs_nosc_ts_nosa_ea
-%type <dsptype> declspecs_nosc_ts_sa_noea declspecs_nosc_ts_sa_ea
-%type <dsptype> declspecs_sc_nots_nosa_noea declspecs_sc_nots_nosa_ea
-%type <dsptype> declspecs_sc_nots_sa_noea declspecs_sc_nots_sa_ea
-%type <dsptype> declspecs_sc_ts_nosa_noea declspecs_sc_ts_nosa_ea
-%type <dsptype> declspecs_sc_ts_sa_noea declspecs_sc_ts_sa_ea
-%type <dsptype> declspecs_ts declspecs_nots
-%type <dsptype> declspecs_ts_nosa declspecs_nots_nosa
-%type <dsptype> declspecs_nosc_ts declspecs_nosc_nots declspecs_nosc declspecs
-%type <dsptype> maybe_type_quals_attrs
-%type <tstype> typespec_nonattr typespec_attr
-%type <tstype> typespec_reserved_nonattr typespec_reserved_attr
-%type <tstype> typespec_nonreserved_nonattr
-%type <ttype> offsetof_member_designator
-
-%type <ttype> scspec SCSPEC STATIC TYPESPEC TYPE_QUAL maybe_volatile
-%type <ttype> initdecls notype_initdecls initdcl notype_initdcl
-%type <exprtype> init
-%type <ttype> simple_asm_expr maybeasm asm_stmt asm_argument asm_string
-%type <ttype> asm_operands nonnull_asm_operands asm_operand asm_clobbers
-%type <ttype> maybe_attribute attributes attribute attribute_list attrib
-%type <ttype> any_word
-
-%type <ttype> compstmt compstmt_start compstmt_primary_start
-%type <ttype> stmt label stmt_nocomp start_break start_continue
-
-%type <ttype> c99_block_start c99_block_lineno_labeled_stmt
-%type <ttype> if_statement_1 if_statement_2
-%type <dtrtype> declarator
-%type <dtrtype> notype_declarator after_type_declarator
-%type <dtrtype> parm_declarator
-%type <dtrtype> parm_declarator_starttypename parm_declarator_nostarttypename
-%type <dtrtype> array_declarator
-
-%type <tstype> structsp_attr structsp_nonattr
-%type <ttype> component_decl_list component_decl_list2
-%type <ttype> component_decl components components_notype component_declarator
-%type <ttype> component_notype_declarator
-%type <ttype> enumlist enumerator
-%type <ttype> struct_head union_head enum_head
-%type <typenametype> typename
-%type <dtrtype> absdcl absdcl1 absdcl1_ea absdcl1_noea direct_absdcl1
-%type <parmtype> absdcl_maybe_attribute
-%type <ttype> condition xexpr for_cond_expr for_incr_expr
-%type <parmtype> parm firstparm
-%type <ttype> identifiers
-
-%type <arginfotype> parms parmlist parmlist_1 parmlist_2
-%type <arginfotype> parmlist_or_identifiers parmlist_or_identifiers_1
-%type <ttype> identifiers_or_typenames
-
-%type <itype> setspecs setspecs_fp extension
-
-%type <location> save_location
-
-%type <otype> save_obstack_position
-
-@@ifobjc
-/* the Objective-C nonterminals */
-
-%type <ttype> methoddecl unaryselector keywordselector selector
-%type <code> methodtype
-%type <ttype> keyworddecl receiver objcmessageexpr messageargs
-%type <ttype> keywordexpr keywordarglist keywordarg
-%type <ttype> optparmlist optparms reservedwords objcselectorexpr
-%type <ttype> selectorarg keywordnamelist keywordname objcencodeexpr
-%type <ttype> non_empty_protocolrefs protocolrefs identifier_list objcprotocolexpr
-
-%type <ttype> CLASSNAME OBJC_STRING OBJC_TYPE_QUAL
-
-%type <ttype> superclass objc_quals objc_qual objc_typename
-%type <itype> objc_try_catch_stmt optellipsis
-@@end_ifobjc
-
-%{
-/* Declaration specifiers of the current declaration. */
-static struct c_declspecs *current_declspecs;
-static GTY(()) tree prefix_attributes;
-
-/* List of all the attributes applying to the identifier currently being
- declared; includes prefix_attributes and possibly some more attributes
- just after a comma. */
-static GTY(()) tree all_prefix_attributes;
-
-/* Structure to save declaration specifiers. */
-struct c_declspec_stack {
- /* Saved value of current_declspecs. */
- struct c_declspecs *current_declspecs;
- /* Saved value of prefix_attributes. */
- tree prefix_attributes;
- /* Saved value of all_prefix_attributes. */
- tree all_prefix_attributes;
- /* Next level of stack. */
- struct c_declspec_stack *next;
-};
-
-/* Stack of saved values of current_declspecs, prefix_attributes and
- all_prefix_attributes. */
-static struct c_declspec_stack *declspec_stack;
-
-/* INDIRECT_REF with a TREE_TYPE of the type being queried for offsetof. */
-static tree offsetof_base;
-
-/* PUSH_DECLSPEC_STACK is called from setspecs; POP_DECLSPEC_STACK
- should be called from the productions making use of setspecs. */
-#define PUSH_DECLSPEC_STACK \
- do { \
- struct c_declspec_stack *t = XOBNEW (&parser_obstack, \
- struct c_declspec_stack); \
- t->current_declspecs = current_declspecs; \
- t->prefix_attributes = prefix_attributes; \
- t->all_prefix_attributes = all_prefix_attributes; \
- t->next = declspec_stack; \
- declspec_stack = t; \
- } while (0)
-
-#define POP_DECLSPEC_STACK \
- do { \
- current_declspecs = declspec_stack->current_declspecs; \
- prefix_attributes = declspec_stack->prefix_attributes; \
- all_prefix_attributes = declspec_stack->all_prefix_attributes; \
- declspec_stack = declspec_stack->next; \
- } while (0)
-
-/* For __extension__, save/restore the warning flags which are
- controlled by __extension__. */
-#define SAVE_EXT_FLAGS() \
- (pedantic \
- | (warn_pointer_arith << 1) \
- | (warn_traditional << 2) \
- | (flag_iso << 3))
-
-#define RESTORE_EXT_FLAGS(val) \
- do { \
- pedantic = val & 1; \
- warn_pointer_arith = (val >> 1) & 1; \
- warn_traditional = (val >> 2) & 1; \
- flag_iso = (val >> 3) & 1; \
- } while (0)
-
-@@ifobjc
-/* Objective-C specific parser/lexer information */
-
-static int objc_pq_context = 0;
-
-/* The following flag is needed to contextualize ObjC lexical analysis.
- In some cases (e.g., 'int NSObject;'), it is undesirable to bind
- an identifier to an ObjC class, even if a class with that name
- exists. */
-static int objc_need_raw_identifier;
-#define OBJC_NEED_RAW_IDENTIFIER(VAL) objc_need_raw_identifier = VAL
-@@end_ifobjc
-
-@@ifc
-#define OBJC_NEED_RAW_IDENTIFIER(VAL) /* nothing */
-@@end_ifc
-
-/* Tell yyparse how to print a token's value, if yydebug is set. */
-
-#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
-
-static void yyprint (FILE *, int, YYSTYPE);
-static void yyerror (const char *);
-static int yylexname (void);
-static inline int _yylex (void);
-static int yylex (void);
-static void init_reswords (void);
-
- /* Initialization routine for this file. */
-void
-c_parse_init (void)
-{
- init_reswords ();
-}
-
-%}
-
-%%
-program: /* empty */
- { if (pedantic)
- pedwarn ("ISO C forbids an empty source file");
- }
- | extdefs
- ;
-
-/* the reason for the strange actions in this rule
- is so that notype_initdecls when reached via datadef
- can find valid declaration specifiers in $0. */
-
-extdefs:
- save_obstack_position { $<dsptype>$ = NULL; } extdef
- { obstack_free (&parser_obstack, $1); }
- | extdefs save_obstack_position
- { $<dsptype>$ = NULL; ggc_collect (); } extdef
- { obstack_free (&parser_obstack, $2); }
- ;
-
-extdef:
- fndef
- | datadef
- | asmdef
- | extension extdef
- { RESTORE_EXT_FLAGS ($1); }
-@@ifobjc
- | objcdef
-@@end_ifobjc
- ;
-
-/* Record the current position of parser_obstack before a
- declaration to restore it afterwards. */
-save_obstack_position:
- { $$ = obstack_alloc (&parser_obstack, 0); }
- ;
-
-datadef:
- setspecs notype_initdecls ';'
- { pedwarn ("data definition has no type or storage class");
- POP_DECLSPEC_STACK; }
- | declspecs_nots setspecs notype_initdecls ';'
- { POP_DECLSPEC_STACK; }
- | declspecs_ts setspecs initdecls ';'
- { POP_DECLSPEC_STACK; }
- | declspecs ';'
- { shadow_tag (finish_declspecs ($1)); }
- | error ';'
- | error '}'
- | ';'
- { if (pedantic)
- pedwarn ("ISO C does not allow extra %<;%> outside of a function"); }
- ;
-
-fndef:
- declspecs_ts setspecs declarator
- { if (!start_function (current_declspecs, $3,
- all_prefix_attributes))
- YYERROR1;
- }
- old_style_parm_decls save_location
- { DECL_SOURCE_LOCATION (current_function_decl) = $6;
- store_parm_decls (); }
- compstmt_or_error
- { finish_function ();
- POP_DECLSPEC_STACK; }
- | declspecs_ts setspecs declarator error
- { POP_DECLSPEC_STACK; }
- | declspecs_nots setspecs notype_declarator
- { if (!start_function (current_declspecs, $3,
- all_prefix_attributes))
- YYERROR1;
- }
- old_style_parm_decls save_location
- { DECL_SOURCE_LOCATION (current_function_decl) = $6;
- store_parm_decls (); }
- compstmt_or_error
- { finish_function ();
- POP_DECLSPEC_STACK; }
- | declspecs_nots setspecs notype_declarator error
- { POP_DECLSPEC_STACK; }
- | setspecs notype_declarator
- { if (!start_function (current_declspecs, $2,
- all_prefix_attributes))
- YYERROR1;
- }
- old_style_parm_decls save_location
- { DECL_SOURCE_LOCATION (current_function_decl) = $5;
- store_parm_decls (); }
- compstmt_or_error
- { finish_function ();
- POP_DECLSPEC_STACK; }
- | setspecs notype_declarator error
- { POP_DECLSPEC_STACK; }
- ;
-
-identifier:
- IDENTIFIER
- | TYPENAME
-@@ifobjc
- | CLASSNAME
-@@end_ifobjc
- ;
-
-unop: '&'
- { $$ = ADDR_EXPR; }
- | '-'
- { $$ = NEGATE_EXPR; }
- | '+'
- { $$ = CONVERT_EXPR;
-@@ifc
- if (warn_traditional && !in_system_header)
- warning ("traditional C rejects the unary plus operator");
-@@end_ifc
- }
- | PLUSPLUS
- { $$ = PREINCREMENT_EXPR; }
- | MINUSMINUS
- { $$ = PREDECREMENT_EXPR; }
- | '~'
- { $$ = BIT_NOT_EXPR; }
- | '!'
- { $$ = TRUTH_NOT_EXPR; }
- ;
-
-expr: expr_no_commas
- | expr ',' expr_no_commas
- { $$.value = build_compound_expr ($1.value, $3.value);
- $$.original_code = COMPOUND_EXPR; }
- ;
-
-exprlist:
- /* empty */
- { $$ = NULL_TREE; }
- | nonnull_exprlist
- ;
-
-nonnull_exprlist:
- expr_no_commas
- { $$ = build_tree_list (NULL_TREE, $1.value); }
- | nonnull_exprlist ',' expr_no_commas
- { chainon ($1, build_tree_list (NULL_TREE, $3.value)); }
- ;
-
-unary_expr:
- primary
- | '*' cast_expr %prec UNARY
- { $$.value = build_indirect_ref ($2.value, "unary *");
- $$.original_code = ERROR_MARK; }
- /* __extension__ turns off -pedantic for following primary. */
- | extension cast_expr %prec UNARY
- { $$ = $2;
- RESTORE_EXT_FLAGS ($1); }
- | unop cast_expr %prec UNARY
- { $$.value = build_unary_op ($1, $2.value, 0);
- overflow_warning ($$.value);
- $$.original_code = ERROR_MARK; }
- /* Refer to the address of a label as a pointer. */
- | ANDAND identifier
- { $$.value = finish_label_address_expr ($2);
- $$.original_code = ERROR_MARK; }
- | sizeof unary_expr %prec UNARY
- { skip_evaluation--;
- in_sizeof--;
- if (TREE_CODE ($2.value) == COMPONENT_REF
- && DECL_C_BIT_FIELD (TREE_OPERAND ($2.value, 1)))
- error ("%<sizeof%> applied to a bit-field");
- $$ = c_expr_sizeof_expr ($2); }
- | sizeof '(' typename ')' %prec HYPERUNARY
- { skip_evaluation--;
- in_sizeof--;
- $$ = c_expr_sizeof_type ($3); }
- | alignof unary_expr %prec UNARY
- { skip_evaluation--;
- in_alignof--;
- $$.value = c_alignof_expr ($2.value);
- $$.original_code = ERROR_MARK; }
- | alignof '(' typename ')' %prec HYPERUNARY
- { skip_evaluation--;
- in_alignof--;
- $$.value = c_alignof (groktypename ($3));
- $$.original_code = ERROR_MARK; }
- | REALPART cast_expr %prec UNARY
- { $$.value = build_unary_op (REALPART_EXPR, $2.value, 0);
- $$.original_code = ERROR_MARK; }
- | IMAGPART cast_expr %prec UNARY
- { $$.value = build_unary_op (IMAGPART_EXPR, $2.value, 0);
- $$.original_code = ERROR_MARK; }
- ;
-
-sizeof:
- SIZEOF { skip_evaluation++; in_sizeof++; }
- ;
-
-alignof:
- ALIGNOF { skip_evaluation++; in_alignof++; }
- ;
-
-typeof:
- TYPEOF { skip_evaluation++; in_typeof++; }
- ;
-
-cast_expr:
- unary_expr
- | '(' typename ')' cast_expr %prec UNARY
- { $$.value = c_cast_expr ($2, $4.value);
- $$.original_code = ERROR_MARK; }
- ;
-
-expr_no_commas:
- cast_expr
- | expr_no_commas '+' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas '-' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas '*' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas '/' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas '%' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas LSHIFT expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas RSHIFT expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas ARITHCOMPARE expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas EQCOMPARE expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas '&' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas '|' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas '^' expr_no_commas
- { $$ = parser_build_binary_op ($2, $1, $3); }
- | expr_no_commas ANDAND
- { $1.value = lang_hooks.truthvalue_conversion
- (default_conversion ($1.value));
- skip_evaluation += $1.value == truthvalue_false_node; }
- expr_no_commas
- { skip_evaluation -= $1.value == truthvalue_false_node;
- $$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $4); }
- | expr_no_commas OROR
- { $1.value = lang_hooks.truthvalue_conversion
- (default_conversion ($1.value));
- skip_evaluation += $1.value == truthvalue_true_node; }
- expr_no_commas
- { skip_evaluation -= $1.value == truthvalue_true_node;
- $$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $4); }
- | expr_no_commas '?'
- { $1.value = lang_hooks.truthvalue_conversion
- (default_conversion ($1.value));
- skip_evaluation += $1.value == truthvalue_false_node; }
- expr ':'
- { skip_evaluation += (($1.value == truthvalue_true_node)
- - ($1.value == truthvalue_false_node)); }
- expr_no_commas
- { skip_evaluation -= $1.value == truthvalue_true_node;
- $$.value = build_conditional_expr ($1.value, $4.value,
- $7.value);
- $$.original_code = ERROR_MARK; }
- | expr_no_commas '?'
- { if (pedantic)
- pedwarn ("ISO C forbids omitting the middle term of a ?: expression");
- /* Make sure first operand is calculated only once. */
- $<ttype>2 = save_expr (default_conversion ($1.value));
- $1.value = lang_hooks.truthvalue_conversion ($<ttype>2);
- skip_evaluation += $1.value == truthvalue_true_node; }
- ':' expr_no_commas
- { skip_evaluation -= $1.value == truthvalue_true_node;
- $$.value = build_conditional_expr ($1.value, $<ttype>2,
- $5.value);
- $$.original_code = ERROR_MARK; }
- | expr_no_commas '=' expr_no_commas
- { $$.value = build_modify_expr ($1.value, NOP_EXPR, $3.value);
- $$.original_code = MODIFY_EXPR;
- }
- | expr_no_commas ASSIGN expr_no_commas
- { $$.value = build_modify_expr ($1.value, $2, $3.value);
- TREE_NO_WARNING ($$.value) = 1;
- $$.original_code = ERROR_MARK;
- }
- ;
-
-primary:
- IDENTIFIER
- {
- if (yychar == YYEMPTY)
- yychar = YYLEX;
- $$.value = build_external_ref ($1, yychar == '(');
- $$.original_code = ERROR_MARK;
- }
- | CONSTANT
- { $$.value = $1; $$.original_code = ERROR_MARK; }
- | STRING
- { $$.value = $1; $$.original_code = STRING_CST; }
- | FUNC_NAME
- { $$.value = fname_decl (C_RID_CODE ($1), $1);
- $$.original_code = ERROR_MARK; }
- | '(' typename ')' '{'
- { start_init (NULL_TREE, NULL, 0);
- $<ttype>$ = groktypename ($2);
- if (C_TYPE_VARIABLE_SIZE ($<ttype>$))
- {
- error ("compound literal has variable size");
- $<ttype>$ = error_mark_node;
- }
- really_start_incremental_init ($<ttype>$); }
- initlist_maybe_comma '}' %prec UNARY
- { struct c_expr init = pop_init_level (0);
- tree constructor = init.value;
- tree type = $<ttype>5;
- finish_init ();
- maybe_warn_string_init (type, init);
-
- if (pedantic && !flag_isoc99)
- pedwarn ("ISO C90 forbids compound literals");
- $$.value = build_compound_literal (type, constructor);
- $$.original_code = ERROR_MARK;
- }
- | '(' expr ')'
- { $$.value = $2.value;
- if (TREE_CODE ($$.value) == MODIFY_EXPR)
- TREE_NO_WARNING ($$.value) = 1;
- $$.original_code = ERROR_MARK; }
- | '(' error ')'
- { $$.value = error_mark_node; $$.original_code = ERROR_MARK; }
- | compstmt_primary_start compstmt_nostart ')'
- { if (pedantic)
- pedwarn ("ISO C forbids braced-groups within expressions");
- $$.value = c_finish_stmt_expr ($1);
- $$.original_code = ERROR_MARK;
- }
- | compstmt_primary_start error ')'
- { c_finish_stmt_expr ($1);
- $$.value = error_mark_node;
- $$.original_code = ERROR_MARK;
- }
- | primary '(' exprlist ')' %prec '.'
- { $$.value = build_function_call ($1.value, $3);
- $$.original_code = ERROR_MARK; }
- | VA_ARG '(' expr_no_commas ',' typename ')'
- { $$.value = build_va_arg ($3.value, groktypename ($5));
- $$.original_code = ERROR_MARK; }
-
- | OFFSETOF '(' typename ','
- { tree type = groktypename ($3);
- if (type == error_mark_node)
- offsetof_base = error_mark_node;
- else
- offsetof_base = build1 (INDIRECT_REF, type, NULL);
- }
- offsetof_member_designator ')'
- { $$.value = fold_offsetof ($6);
- $$.original_code = ERROR_MARK; }
- | OFFSETOF '(' error ')'
- { $$.value = error_mark_node; $$.original_code = ERROR_MARK; }
- | CHOOSE_EXPR '(' expr_no_commas ',' expr_no_commas ','
- expr_no_commas ')'
- {
- tree c;
-
- c = fold ($3.value);
- STRIP_NOPS (c);
- if (TREE_CODE (c) != INTEGER_CST)
- error ("first argument to %<__builtin_choose_expr%> not"
- " a constant");
- $$ = integer_zerop (c) ? $7 : $5;
- }
- | CHOOSE_EXPR '(' error ')'
- { $$.value = error_mark_node; $$.original_code = ERROR_MARK; }
- | TYPES_COMPATIBLE_P '(' typename ',' typename ')'
- {
- tree e1, e2;
-
- e1 = TYPE_MAIN_VARIANT (groktypename ($3));
- e2 = TYPE_MAIN_VARIANT (groktypename ($5));
-
- $$.value = comptypes (e1, e2)
- ? build_int_cst (NULL_TREE, 1)
- : build_int_cst (NULL_TREE, 0);
- $$.original_code = ERROR_MARK;
- }
- | TYPES_COMPATIBLE_P '(' error ')'
- { $$.value = error_mark_node; $$.original_code = ERROR_MARK; }
- | primary '[' expr ']' %prec '.'
- { $$.value = build_array_ref ($1.value, $3.value);
- $$.original_code = ERROR_MARK; }
- | primary '.' identifier
- { $$.value = build_component_ref ($1.value, $3);
- $$.original_code = ERROR_MARK; }
- | primary POINTSAT identifier
- {
- tree expr = build_indirect_ref ($1.value, "->");
- $$.value = build_component_ref (expr, $3);
- $$.original_code = ERROR_MARK;
- }
- | primary PLUSPLUS
- { $$.value = build_unary_op (POSTINCREMENT_EXPR, $1.value, 0);
- $$.original_code = ERROR_MARK; }
- | primary MINUSMINUS
- { $$.value = build_unary_op (POSTDECREMENT_EXPR, $1.value, 0);
- $$.original_code = ERROR_MARK; }
-@@ifobjc
- | objcmessageexpr
- { $$.value = objc_build_message_expr ($1);
- $$.original_code = ERROR_MARK; }
- | objcselectorexpr
- { $$.value = objc_build_selector_expr ($1);
- $$.original_code = ERROR_MARK; }
- | objcprotocolexpr
- { $$.value = objc_build_protocol_expr ($1);
- $$.original_code = ERROR_MARK; }
- | objcencodeexpr
- { $$.value = objc_build_encode_expr ($1);
- $$.original_code = ERROR_MARK; }
- | OBJC_STRING
- { $$.value = objc_build_string_object ($1);
- $$.original_code = ERROR_MARK; }
-@@end_ifobjc
- ;
-
-/* This is the second argument to __builtin_offsetof. We must have one
- identifier, and beyond that we want to accept sub structure and sub
- array references. */
-
-offsetof_member_designator:
- identifier
- { $$ = build_component_ref (offsetof_base, $1); }
- | offsetof_member_designator '.' identifier
- { $$ = build_component_ref ($1, $3); }
- | offsetof_member_designator '[' expr ']'
- { $$ = build_array_ref ($1, $3.value); }
- ;
-
-old_style_parm_decls:
- /* empty */
- | datadecls
- ;
-
-/* The following are analogous to lineno_decl, decls and decl
- except that they do not allow nested functions.
- They are used for old-style parm decls. */
-lineno_datadecl:
- save_location datadecl
- { }
- ;
-
-datadecls:
- lineno_datadecl
- | errstmt
- | datadecls lineno_datadecl
- | lineno_datadecl errstmt
- ;
-
-/* We don't allow prefix attributes here because they cause reduce/reduce
- conflicts: we can't know whether we're parsing a function decl with
- attribute suffix, or function defn with attribute prefix on first old
- style parm. */
-datadecl:
- declspecs_ts_nosa setspecs initdecls ';'
- { POP_DECLSPEC_STACK; }
- | declspecs_nots_nosa setspecs notype_initdecls ';'
- { POP_DECLSPEC_STACK; }
- | declspecs_ts_nosa ';'
- { shadow_tag_warned (finish_declspecs ($1), 1);
- pedwarn ("empty declaration"); }
- | declspecs_nots_nosa ';'
- { pedwarn ("empty declaration"); }
- ;
-
-/* This combination which saves a lineno before a decl
- is the normal thing to use, rather than decl itself.
- This is to avoid shift/reduce conflicts in contexts
- where statement labels are allowed. */
-lineno_decl:
- save_location decl
- { }
- ;
-
-/* records the type and storage class specs to use for processing
- the declarators that follow.
- Maintains a stack of outer-level values of current_declspecs,
- for the sake of parm declarations nested in function declarators. */
-setspecs: /* empty */
- { pending_xref_error ();
- PUSH_DECLSPEC_STACK;
- if ($<dsptype>0)
- {
- prefix_attributes = $<dsptype>0->attrs;
- $<dsptype>0->attrs = NULL_TREE;
- current_declspecs = $<dsptype>0;
- }
- else
- {
- prefix_attributes = NULL_TREE;
- current_declspecs = build_null_declspecs ();
- }
- current_declspecs = finish_declspecs (current_declspecs);
- all_prefix_attributes = prefix_attributes; }
- ;
-
-/* Possibly attributes after a comma, which should reset all_prefix_attributes
- to prefix_attributes with these ones chained on the front. */
-maybe_resetattrs:
- maybe_attribute
- { all_prefix_attributes = chainon ($1, prefix_attributes); }
- ;
-
-decl:
- declspecs_ts setspecs initdecls ';'
- { POP_DECLSPEC_STACK; }
- | declspecs_nots setspecs notype_initdecls ';'
- { POP_DECLSPEC_STACK; }
- | declspecs_ts setspecs nested_function
- { POP_DECLSPEC_STACK; }
- | declspecs_nots setspecs notype_nested_function
- { POP_DECLSPEC_STACK; }
- | declspecs ';'
- { shadow_tag (finish_declspecs ($1)); }
- | extension decl
- { RESTORE_EXT_FLAGS ($1); }
- ;
-
-/* A list of declaration specifiers. These are:
-
- - Storage class specifiers (scspec), which for GCC currently includes
- function specifiers ("inline").
-
- - Type specifiers (typespec_*).
-
- - Type qualifiers (TYPE_QUAL).
-
- - Attribute specifier lists (attributes).
-
- The various cases below are classified according to:
-
- (a) Whether a storage class specifier is included or not; some
- places in the grammar disallow storage class specifiers (_sc or _nosc).
-
- (b) Whether a type specifier has been seen; after a type specifier,
- a typedef name is an identifier to redeclare (_ts or _nots).
-
- (c) Whether the list starts with an attribute; in certain places,
- the grammar requires specifiers that don't start with an attribute
- (_sa or _nosa).
-
- (d) Whether the list ends with an attribute (or a specifier such that
- any following attribute would have been parsed as part of that specifier);
- this avoids shift-reduce conflicts in the parsing of attributes
- (_ea or _noea).
-
- TODO:
-
- (i) Distinguish between function specifiers and storage class specifiers,
- at least for the purpose of warnings about obsolescent usage.
-
- (ii) Halve the number of productions here by eliminating the _sc/_nosc
- distinction and instead checking where required that storage class
- specifiers aren't present. */
-
-/* Declspecs which contain at least one type specifier or typedef name.
- (Just `const' or `volatile' is not enough.)
- A typedef'd name following these is taken as a name to be declared. */
-
-declspecs_nosc_nots_nosa_noea:
- TYPE_QUAL
- { $$ = declspecs_add_qual (build_null_declspecs (), $1); }
- | declspecs_nosc_nots_nosa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_nots_nosa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- ;
-
-declspecs_nosc_nots_nosa_ea:
- declspecs_nosc_nots_nosa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- ;
-
-declspecs_nosc_nots_sa_noea:
- declspecs_nosc_nots_sa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_nots_sa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- ;
-
-declspecs_nosc_nots_sa_ea:
- attributes
- { $$ = declspecs_add_attrs (build_null_declspecs (), $1); }
- | declspecs_nosc_nots_sa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- ;
-
-declspecs_nosc_ts_nosa_noea:
- typespec_nonattr
- { $$ = declspecs_add_type (build_null_declspecs (), $1); }
- | declspecs_nosc_ts_nosa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_ts_nosa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_ts_nosa_noea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_ts_nosa_ea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_nosa_noea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_nosa_ea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- ;
-
-declspecs_nosc_ts_nosa_ea:
- typespec_attr
- { $$ = declspecs_add_type (build_null_declspecs (), $1); }
- | declspecs_nosc_ts_nosa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- | declspecs_nosc_ts_nosa_noea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_ts_nosa_ea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_nosa_noea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_nosa_ea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- ;
-
-declspecs_nosc_ts_sa_noea:
- declspecs_nosc_ts_sa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_ts_sa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_ts_sa_noea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_ts_sa_ea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_sa_noea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_sa_ea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- ;
-
-declspecs_nosc_ts_sa_ea:
- declspecs_nosc_ts_sa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- | declspecs_nosc_ts_sa_noea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_ts_sa_ea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_sa_noea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_nots_sa_ea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- ;
-
-declspecs_sc_nots_nosa_noea:
- scspec
- { $$ = declspecs_add_scspec (build_null_declspecs (), $1); }
- | declspecs_sc_nots_nosa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_sc_nots_nosa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_nots_nosa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_nosc_nots_nosa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_nots_nosa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_nots_nosa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- ;
-
-declspecs_sc_nots_nosa_ea:
- declspecs_sc_nots_nosa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- ;
-
-declspecs_sc_nots_sa_noea:
- declspecs_sc_nots_sa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_sc_nots_sa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_nosc_nots_sa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_nosc_nots_sa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_nots_sa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_nots_sa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- ;
-
-declspecs_sc_nots_sa_ea:
- declspecs_sc_nots_sa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- ;
-
-declspecs_sc_ts_nosa_noea:
- declspecs_sc_ts_nosa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_sc_ts_nosa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_sc_ts_nosa_noea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_ts_nosa_ea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_nosa_noea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_nosa_ea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_ts_nosa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_nosc_ts_nosa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_ts_nosa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_ts_nosa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- ;
-
-declspecs_sc_ts_nosa_ea:
- declspecs_sc_ts_nosa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- | declspecs_sc_ts_nosa_noea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_ts_nosa_ea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_nosa_noea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_nosa_ea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- ;
-
-declspecs_sc_ts_sa_noea:
- declspecs_sc_ts_sa_noea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_sc_ts_sa_ea TYPE_QUAL
- { $$ = declspecs_add_qual ($1, $2); }
- | declspecs_sc_ts_sa_noea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_ts_sa_ea typespec_reserved_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_sa_noea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_sa_ea typespec_nonattr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_nosc_ts_sa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_nosc_ts_sa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_ts_sa_noea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- | declspecs_sc_ts_sa_ea scspec
- { $$ = declspecs_add_scspec ($1, $2); }
- ;
-
-declspecs_sc_ts_sa_ea:
- declspecs_sc_ts_sa_noea attributes
- { $$ = declspecs_add_attrs ($1, $2); }
- | declspecs_sc_ts_sa_noea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_ts_sa_ea typespec_reserved_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_sa_noea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- | declspecs_sc_nots_sa_ea typespec_attr
- { $$ = declspecs_add_type ($1, $2); }
- ;
-
-/* Particular useful classes of declspecs. */
-declspecs_ts:
- declspecs_nosc_ts_nosa_noea
- | declspecs_nosc_ts_nosa_ea
- | declspecs_nosc_ts_sa_noea
- | declspecs_nosc_ts_sa_ea
- | declspecs_sc_ts_nosa_noea
- | declspecs_sc_ts_nosa_ea
- | declspecs_sc_ts_sa_noea
- | declspecs_sc_ts_sa_ea
- ;
-
-declspecs_nots:
- declspecs_nosc_nots_nosa_noea
- | declspecs_nosc_nots_nosa_ea
- | declspecs_nosc_nots_sa_noea
- | declspecs_nosc_nots_sa_ea
- | declspecs_sc_nots_nosa_noea
- | declspecs_sc_nots_nosa_ea
- | declspecs_sc_nots_sa_noea
- | declspecs_sc_nots_sa_ea
- ;
-
-declspecs_ts_nosa:
- declspecs_nosc_ts_nosa_noea
- | declspecs_nosc_ts_nosa_ea
- | declspecs_sc_ts_nosa_noea
- | declspecs_sc_ts_nosa_ea
- ;
-
-declspecs_nots_nosa:
- declspecs_nosc_nots_nosa_noea
- | declspecs_nosc_nots_nosa_ea
- | declspecs_sc_nots_nosa_noea
- | declspecs_sc_nots_nosa_ea
- ;
-
-declspecs_nosc_ts:
- declspecs_nosc_ts_nosa_noea
- | declspecs_nosc_ts_nosa_ea
- | declspecs_nosc_ts_sa_noea
- | declspecs_nosc_ts_sa_ea
- ;
-
-declspecs_nosc_nots:
- declspecs_nosc_nots_nosa_noea
- | declspecs_nosc_nots_nosa_ea
- | declspecs_nosc_nots_sa_noea
- | declspecs_nosc_nots_sa_ea
- ;
-
-declspecs_nosc:
- declspecs_nosc_ts_nosa_noea
- | declspecs_nosc_ts_nosa_ea
- | declspecs_nosc_ts_sa_noea
- | declspecs_nosc_ts_sa_ea
- | declspecs_nosc_nots_nosa_noea
- | declspecs_nosc_nots_nosa_ea
- | declspecs_nosc_nots_sa_noea
- | declspecs_nosc_nots_sa_ea
- ;
-
-declspecs:
- declspecs_nosc_nots_nosa_noea
- | declspecs_nosc_nots_nosa_ea
- | declspecs_nosc_nots_sa_noea
- | declspecs_nosc_nots_sa_ea
- | declspecs_nosc_ts_nosa_noea
- | declspecs_nosc_ts_nosa_ea
- | declspecs_nosc_ts_sa_noea
- | declspecs_nosc_ts_sa_ea
- | declspecs_sc_nots_nosa_noea
- | declspecs_sc_nots_nosa_ea
- | declspecs_sc_nots_sa_noea
- | declspecs_sc_nots_sa_ea
- | declspecs_sc_ts_nosa_noea
- | declspecs_sc_ts_nosa_ea
- | declspecs_sc_ts_sa_noea
- | declspecs_sc_ts_sa_ea
- ;
-
-/* A (possibly empty) sequence of type qualifiers and attributes. */
-maybe_type_quals_attrs:
- /* empty */
- { $$ = NULL; }
- | declspecs_nosc_nots
- { $$ = $1; }
- ;
-
-/* A type specifier (but not a type qualifier).
- Once we have seen one of these in a declaration,
- if a typedef name appears then it is being redeclared.
-
- The _reserved versions start with a reserved word and may appear anywhere
- in the declaration specifiers; the _nonreserved versions may only
- appear before any other type specifiers, and after that are (if names)
- being redeclared.
-
- FIXME: should the _nonreserved version be restricted to names being
- redeclared only? The other entries there relate only the GNU extensions
- and Objective C, and are historically parsed thus, and don't make sense
- after other type specifiers, but it might be cleaner to count them as
- _reserved.
-
- _attr means: specifiers that either end with attributes,
- or are such that any following attributes would
- be parsed as part of the specifier.
-
- _nonattr: other specifiers not ending with attributes. */
-
-typespec_nonattr:
- typespec_reserved_nonattr
- | typespec_nonreserved_nonattr
- ;
-
-typespec_attr:
- typespec_reserved_attr
- ;
-
-typespec_reserved_nonattr:
- TYPESPEC
- { OBJC_NEED_RAW_IDENTIFIER (1);
- $$.kind = ctsk_resword;
- $$.spec = $1; }
- | structsp_nonattr
- ;
-
-typespec_reserved_attr:
- structsp_attr
- ;
-
-typespec_nonreserved_nonattr:
- TYPENAME
- { /* For a typedef name, record the meaning, not the name.
- In case of `foo foo, bar;'. */
- $$.kind = ctsk_typedef;
- $$.spec = lookup_name ($1); }
-@@ifobjc
- | CLASSNAME protocolrefs
- { $$.kind = ctsk_objc;
- $$.spec = objc_get_protocol_qualified_type ($1, $2); }
- | TYPENAME non_empty_protocolrefs
- { $$.kind = ctsk_objc;
- $$.spec = objc_get_protocol_qualified_type ($1, $2); }
-
-/* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>"
- - nisse@lysator.liu.se */
- | non_empty_protocolrefs
- { $$.kind = ctsk_objc;
- $$.spec = objc_get_protocol_qualified_type (NULL_TREE, $1); }
-@@end_ifobjc
- | typeof '(' expr ')'
- { skip_evaluation--;
- in_typeof--;
- if (TREE_CODE ($3.value) == COMPONENT_REF
- && DECL_C_BIT_FIELD (TREE_OPERAND ($3.value, 1)))
- error ("%<typeof%> applied to a bit-field");
- $$.kind = ctsk_typeof;
- $$.spec = TREE_TYPE ($3.value);
- pop_maybe_used (variably_modified_type_p ($$.spec,
- NULL_TREE)); }
- | typeof '(' typename ')'
- { skip_evaluation--;
- in_typeof--;
- $$.kind = ctsk_typeof;
- $$.spec = groktypename ($3);
- pop_maybe_used (variably_modified_type_p ($$.spec,
- NULL_TREE)); }
- ;
-
-/* typespec_nonreserved_attr does not exist. */
-
-initdecls:
- initdcl
- | initdecls ',' maybe_resetattrs initdcl
- ;
-
-notype_initdecls:
- notype_initdcl
- | notype_initdecls ',' maybe_resetattrs notype_initdcl
- ;
-
-initdcl:
- declarator maybeasm maybe_attribute '='
- { $<ttype>$ = start_decl ($1, current_declspecs, true,
- chainon ($3, all_prefix_attributes));
- if (!$<ttype>$)
- $<ttype>$ = error_mark_node;
- start_init ($<ttype>$, $2, global_bindings_p ()); }
- init
-/* Note how the declaration of the variable is in effect while its init is parsed! */
- { finish_init ();
- if ($<ttype>5 != error_mark_node)
- {
- maybe_warn_string_init (TREE_TYPE ($<ttype>5), $6);
- finish_decl ($<ttype>5, $6.value, $2);
- }
- }
- | declarator maybeasm maybe_attribute
- { tree d = start_decl ($1, current_declspecs, false,
- chainon ($3, all_prefix_attributes));
- if (d)
- finish_decl (d, NULL_TREE, $2);
- }
- ;
-
-notype_initdcl:
- notype_declarator maybeasm maybe_attribute '='
- { $<ttype>$ = start_decl ($1, current_declspecs, true,
- chainon ($3, all_prefix_attributes));
- if (!$<ttype>$)
- $<ttype>$ = error_mark_node;
- start_init ($<ttype>$, $2, global_bindings_p ()); }
- init
-/* Note how the declaration of the variable is in effect while its init is parsed! */
- { finish_init ();
- if ($<ttype>5 != error_mark_node)
- {
- maybe_warn_string_init (TREE_TYPE ($<ttype>5), $6);
- finish_decl ($<ttype>5, $6.value, $2);
- }
- }
- | notype_declarator maybeasm maybe_attribute
- { tree d = start_decl ($1, current_declspecs, false,
- chainon ($3, all_prefix_attributes));
- if (d)
- finish_decl (d, NULL_TREE, $2); }
- ;
-/* the * rules are dummies to accept the Apollo extended syntax
- so that the header files compile. */
-maybe_attribute:
- /* empty */
- { $$ = NULL_TREE; }
- | attributes
- { $$ = $1; }
- ;
-
-attributes:
- attribute
- { $$ = $1; }
- | attributes attribute
- { $$ = chainon ($1, $2); }
- ;
-
-attribute:
- ATTRIBUTE stop_string_translation
- '(' '(' attribute_list ')' ')' start_string_translation
- { $$ = $5; }
- | ATTRIBUTE error start_string_translation
- { $$ = NULL_TREE; }
- ;
-
-attribute_list:
- attrib
- { $$ = $1; }
- | attribute_list ',' attrib
- { $$ = chainon ($1, $3); }
- ;
-
-attrib:
- /* empty */
- { $$ = NULL_TREE; }
- | any_word
- { $$ = build_tree_list ($1, NULL_TREE); }
- | any_word '(' IDENTIFIER ')'
- { $$ = build_tree_list ($1, build_tree_list (NULL_TREE, $3)); }
- | any_word '(' IDENTIFIER ',' nonnull_exprlist ')'
- { $$ = build_tree_list ($1, tree_cons (NULL_TREE, $3, $5)); }
- | any_word '(' exprlist ')'
- { $$ = build_tree_list ($1, $3); }
- ;
-
-/* This still leaves out most reserved keywords,
- shouldn't we include them? */
-
-any_word:
- identifier
- | scspec
- | TYPESPEC
- | TYPE_QUAL
- ;
-
-scspec:
- STATIC
- | SCSPEC
- ;
-
-/* Initializers. `init' is the entry point. */
-
-init:
- expr_no_commas
- { $$ = $1; }
- | '{'
- { really_start_incremental_init (NULL_TREE); }
- initlist_maybe_comma '}'
- { $$ = pop_init_level (0); }
- | error
- { $$.value = error_mark_node; $$.original_code = ERROR_MARK; }
- ;
-
-/* `initlist_maybe_comma' is the guts of an initializer in braces. */
-initlist_maybe_comma:
- /* empty */
- { if (pedantic)
- pedwarn ("ISO C forbids empty initializer braces"); }
- | initlist1 maybecomma
- ;
-
-initlist1:
- initelt
- | initlist1 ',' initelt
- ;
-
-/* `initelt' is a single element of an initializer.
- It may use braces. */
-initelt:
- designator_list '=' initval
- { if (pedantic && !flag_isoc99)
- pedwarn ("ISO C90 forbids specifying subobject to initialize"); }
- | array_designator initval
- { if (pedantic)
- pedwarn ("obsolete use of designated initializer without %<=%>"); }
- | identifier ':'
- { set_init_label ($1);
- if (pedantic)
- pedwarn ("obsolete use of designated initializer with %<:%>"); }
- initval
- {}
- | initval
- ;
-
-initval:
- '{'
- { push_init_level (0); }
- initlist_maybe_comma '}'
- { process_init_element (pop_init_level (0)); }
- | expr_no_commas
- { process_init_element ($1); }
- | error
- ;
-
-designator_list:
- designator
- | designator_list designator
- ;
-
-designator:
- '.' identifier
- { set_init_label ($2); }
- | array_designator
- ;
-
-array_designator:
- '[' expr_no_commas ELLIPSIS expr_no_commas ']'
- { set_init_index ($2.value, $4.value);
- if (pedantic)
- pedwarn ("ISO C forbids specifying range of elements to initialize"); }
- | '[' expr_no_commas ']'
- { set_init_index ($2.value, NULL_TREE); }
- ;
-
-nested_function:
- declarator
- { if (pedantic)
- pedwarn ("ISO C forbids nested functions");
-
- push_function_context ();
- if (!start_function (current_declspecs, $1,
- all_prefix_attributes))
- {
- pop_function_context ();
- YYERROR1;
- }
- }
- old_style_parm_decls save_location
- { tree decl = current_function_decl;
- DECL_SOURCE_LOCATION (decl) = $4;
- store_parm_decls (); }
- /* This used to use compstmt_or_error. That caused a bug with
- input `f(g) int g {}', where the use of YYERROR1 above caused
- an error which then was handled by compstmt_or_error. There
- followed a repeated execution of that same rule, which called
- YYERROR1 again, and so on. */
- compstmt
- { tree decl = current_function_decl;
- add_stmt ($6);
- finish_function ();
- pop_function_context ();
- add_stmt (build_stmt (DECL_EXPR, decl)); }
- ;
-
-notype_nested_function:
- notype_declarator
- { if (pedantic)
- pedwarn ("ISO C forbids nested functions");
-
- push_function_context ();
- if (!start_function (current_declspecs, $1,
- all_prefix_attributes))
- {
- pop_function_context ();
- YYERROR1;
- }
- }
- old_style_parm_decls save_location
- { tree decl = current_function_decl;
- DECL_SOURCE_LOCATION (decl) = $4;
- store_parm_decls (); }
- /* This used to use compstmt_or_error. That caused a bug with
- input `f(g) int g {}', where the use of YYERROR1 above caused
- an error which then was handled by compstmt_or_error. There
- followed a repeated execution of that same rule, which called
- YYERROR1 again, and so on. */
- compstmt
- { tree decl = current_function_decl;
- add_stmt ($6);
- finish_function ();
- pop_function_context ();
- add_stmt (build_stmt (DECL_EXPR, decl)); }
- ;
-
-/* Any kind of declarator (thus, all declarators allowed
- after an explicit typespec). */
-
-declarator:
- after_type_declarator
- | notype_declarator
- ;
-
-/* A declarator that is allowed only after an explicit typespec. */
-
-after_type_declarator:
- '(' maybe_attribute after_type_declarator ')'
- { $$ = $2 ? build_attrs_declarator ($2, $3) : $3; }
- | after_type_declarator '(' parmlist_or_identifiers %prec '.'
- { $$ = build_function_declarator ($3, $1); }
- | after_type_declarator array_declarator %prec '.'
- { $$ = set_array_declarator_inner ($2, $1, false); }
- | '*' maybe_type_quals_attrs after_type_declarator %prec UNARY
- { $$ = make_pointer_declarator ($2, $3); }
- | TYPENAME
- { $$ = build_id_declarator ($1); }
- ;
-
-/* Kinds of declarator that can appear in a parameter list
- in addition to notype_declarator. This is like after_type_declarator
- but does not allow a typedef name in parentheses as an identifier
- (because it would conflict with a function with that typedef as arg). */
-parm_declarator:
- parm_declarator_starttypename
- | parm_declarator_nostarttypename
- ;
-
-parm_declarator_starttypename:
- parm_declarator_starttypename '(' parmlist_or_identifiers %prec '.'
- { $$ = build_function_declarator ($3, $1); }
- | parm_declarator_starttypename array_declarator %prec '.'
- { $$ = set_array_declarator_inner ($2, $1, false); }
- | TYPENAME
- { $$ = build_id_declarator ($1); }
- ;
-
-parm_declarator_nostarttypename:
- parm_declarator_nostarttypename '(' parmlist_or_identifiers %prec '.'
- { $$ = build_function_declarator ($3, $1); }
- | parm_declarator_nostarttypename array_declarator %prec '.'
- { $$ = set_array_declarator_inner ($2, $1, false); }
- | '*' maybe_type_quals_attrs parm_declarator_starttypename %prec UNARY
- { $$ = make_pointer_declarator ($2, $3); }
- | '*' maybe_type_quals_attrs parm_declarator_nostarttypename %prec UNARY
- { $$ = make_pointer_declarator ($2, $3); }
- | '(' maybe_attribute parm_declarator_nostarttypename ')'
- { $$ = $2 ? build_attrs_declarator ($2, $3) : $3; }
- ;
-
-/* A declarator allowed whether or not there has been
- an explicit typespec. These cannot redeclare a typedef-name. */
-
-notype_declarator:
- notype_declarator '(' parmlist_or_identifiers %prec '.'
- { $$ = build_function_declarator ($3, $1); }
- | '(' maybe_attribute notype_declarator ')'
- { $$ = $2 ? build_attrs_declarator ($2, $3) : $3; }
- | '*' maybe_type_quals_attrs notype_declarator %prec UNARY
- { $$ = make_pointer_declarator ($2, $3); }
- | notype_declarator array_declarator %prec '.'
- { $$ = set_array_declarator_inner ($2, $1, false); }
- | IDENTIFIER
- { $$ = build_id_declarator ($1); }
- ;
-
-struct_head:
- STRUCT
- { $$ = NULL_TREE; }
- | STRUCT attributes
- { $$ = $2; }
- ;
-
-union_head:
- UNION
- { $$ = NULL_TREE; }
- | UNION attributes
- { $$ = $2; }
- ;
-
-enum_head:
- ENUM
- { $$ = NULL_TREE; }
- | ENUM attributes
- { $$ = $2; }
- ;
-
-/* structsp_attr: struct/union/enum specifiers that either
- end with attributes, or are such that any following attributes would
- be parsed as part of the struct/union/enum specifier.
-
- structsp_nonattr: other struct/union/enum specifiers. */
-
-structsp_attr:
- struct_head identifier '{'
- { $<ttype>$ = start_struct (RECORD_TYPE, $2);
- /* Start scope of tag before parsing components. */
- }
- component_decl_list '}' maybe_attribute
- { $$.spec = finish_struct ($<ttype>4, nreverse ($5),
- chainon ($1, $7));
- $$.kind = ctsk_tagdef; }
- | struct_head '{' component_decl_list '}' maybe_attribute
- { $$.spec = finish_struct (start_struct (RECORD_TYPE,
- NULL_TREE),
- nreverse ($3), chainon ($1, $5));
- $$.kind = ctsk_tagdef;
- }
- | union_head identifier '{'
- { $<ttype>$ = start_struct (UNION_TYPE, $2); }
- component_decl_list '}' maybe_attribute
- { $$.spec = finish_struct ($<ttype>4, nreverse ($5),
- chainon ($1, $7));
- $$.kind = ctsk_tagdef; }
- | union_head '{' component_decl_list '}' maybe_attribute
- { $$.spec = finish_struct (start_struct (UNION_TYPE,
- NULL_TREE),
- nreverse ($3), chainon ($1, $5));
- $$.kind = ctsk_tagdef;
- }
- | enum_head identifier '{'
- { $<ttype>$ = start_enum ($2); }
- enumlist maybecomma_warn '}' maybe_attribute
- { $$.spec = finish_enum ($<ttype>4, nreverse ($5),
- chainon ($1, $8));
- $$.kind = ctsk_tagdef; }
- | enum_head '{'
- { $<ttype>$ = start_enum (NULL_TREE); }
- enumlist maybecomma_warn '}' maybe_attribute
- { $$.spec = finish_enum ($<ttype>3, nreverse ($4),
- chainon ($1, $7));
- $$.kind = ctsk_tagdef; }
- ;
-
-structsp_nonattr:
- struct_head identifier
- { $$ = parser_xref_tag (RECORD_TYPE, $2); }
- | union_head identifier
- { $$ = parser_xref_tag (UNION_TYPE, $2); }
- | enum_head identifier
- { $$ = parser_xref_tag (ENUMERAL_TYPE, $2);
- /* In ISO C, enumerated types can be referred to
- only if already defined. */
- if (pedantic && !COMPLETE_TYPE_P ($$.spec))
- pedwarn ("ISO C forbids forward references to %<enum%> types"); }
- ;
-
-maybecomma:
- /* empty */
- | ','
- ;
-
-maybecomma_warn:
- /* empty */
- | ','
- { if (pedantic && !flag_isoc99)
- pedwarn ("comma at end of enumerator list"); }
- ;
-
-/* We chain the components in reverse order. They are put in forward
- order in structsp_attr.
-
- Note that component_declarator returns single decls, so components
- and components_notype can use TREE_CHAIN directly, wheras components
- and components_notype return lists (of comma separated decls), so
- component_decl_list and component_decl_list2 must use chainon.
-
- The theory behind all this is that there will be more semicolon
- separated fields than comma separated fields, and so we'll be
- minimizing the number of node traversals required by chainon. */
-
-component_decl_list:
- component_decl_list2
- { $$ = $1; }
- | component_decl_list2 component_decl
- { $$ = chainon ($2, $1);
- pedwarn ("no semicolon at end of struct or union"); }
- ;
-
-component_decl_list2: /* empty */
- { $$ = NULL_TREE; }
- | component_decl_list2 component_decl ';'
- { $$ = chainon ($2, $1); }
- | component_decl_list2 ';'
- { if (pedantic)
- pedwarn ("extra semicolon in struct or union specified"); }
-@@ifobjc
- /* foo(sizeof(struct{ @defs(ClassName)})); */
- | AT_DEFS '(' CLASSNAME ')'
- { $$ = nreverse (objc_get_class_ivars ($3)); }
-@@end_ifobjc
- ;
-
-component_decl:
- declspecs_nosc_ts setspecs components
- { $$ = $3;
- POP_DECLSPEC_STACK; }
- | declspecs_nosc_ts setspecs
- {
- /* Support for unnamed structs or unions as members of
- structs or unions (which is [a] useful and [b] supports
- MS P-SDK). */
- $$ = grokfield (build_id_declarator (NULL_TREE),
- current_declspecs, NULL_TREE);
- POP_DECLSPEC_STACK; }
- | declspecs_nosc_nots setspecs components_notype
- { $$ = $3;
- POP_DECLSPEC_STACK; }
- | declspecs_nosc_nots
- { if (pedantic)
- pedwarn ("ISO C forbids member declarations with no members");
- shadow_tag_warned (finish_declspecs ($1), pedantic);
- $$ = NULL_TREE; }
- | error
- { $$ = NULL_TREE; }
- | extension component_decl
- { $$ = $2;
- RESTORE_EXT_FLAGS ($1); }
- ;
-
-components:
- component_declarator
- | components ',' maybe_resetattrs component_declarator
- { TREE_CHAIN ($4) = $1; $$ = $4; }
- ;
-
-components_notype:
- component_notype_declarator
- | components_notype ',' maybe_resetattrs component_notype_declarator
- { TREE_CHAIN ($4) = $1; $$ = $4; }
- ;
-
-component_declarator:
- declarator maybe_attribute
- { $$ = grokfield ($1, current_declspecs, NULL_TREE);
- decl_attributes (&$$,
- chainon ($2, all_prefix_attributes), 0); }
- | declarator ':' expr_no_commas maybe_attribute
- { $$ = grokfield ($1, current_declspecs, $3.value);
- decl_attributes (&$$,
- chainon ($4, all_prefix_attributes), 0); }
- | ':' expr_no_commas maybe_attribute
- { $$ = grokfield (build_id_declarator (NULL_TREE),
- current_declspecs, $2.value);
- decl_attributes (&$$,
- chainon ($3, all_prefix_attributes), 0); }
- ;
-
-component_notype_declarator:
- notype_declarator maybe_attribute
- { $$ = grokfield ($1, current_declspecs, NULL_TREE);
- decl_attributes (&$$,
- chainon ($2, all_prefix_attributes), 0); }
- | notype_declarator ':' expr_no_commas maybe_attribute
- { $$ = grokfield ($1, current_declspecs, $3.value);
- decl_attributes (&$$,
- chainon ($4, all_prefix_attributes), 0); }
- | ':' expr_no_commas maybe_attribute
- { $$ = grokfield (build_id_declarator (NULL_TREE),
- current_declspecs, $2.value);
- decl_attributes (&$$,
- chainon ($3, all_prefix_attributes), 0); }
- ;
-
-/* We chain the enumerators in reverse order.
- They are put in forward order in structsp_attr. */
-
-enumlist:
- enumerator
- | enumlist ',' enumerator
- { if ($1 == error_mark_node)
- $$ = $1;
- else
- TREE_CHAIN ($3) = $1, $$ = $3; }
- | error
- { $$ = error_mark_node; }
- ;
-
-
-enumerator:
- identifier
- { $$ = build_enumerator ($1, NULL_TREE); }
- | identifier '=' expr_no_commas
- { $$ = build_enumerator ($1, $3.value); }
- ;
-
-typename:
- declspecs_nosc
- { pending_xref_error ();
- $<dsptype>$ = finish_declspecs ($1); }
- absdcl
- { $$ = XOBNEW (&parser_obstack, struct c_type_name);
- $$->specs = $<dsptype>2;
- $$->declarator = $3; }
- ;
-
-absdcl: /* an absolute declarator */
- /* empty */
- { $$ = build_id_declarator (NULL_TREE); }
- | absdcl1
- ;
-
-absdcl_maybe_attribute: /* absdcl maybe_attribute, but not just attributes */
- /* empty */
- { $$ = build_c_parm (current_declspecs, all_prefix_attributes,
- build_id_declarator (NULL_TREE)); }
- | absdcl1
- { $$ = build_c_parm (current_declspecs, all_prefix_attributes,
- $1); }
- | absdcl1_noea attributes
- { $$ = build_c_parm (current_declspecs,
- chainon ($2, all_prefix_attributes),
- $1); }
- ;
-
-absdcl1: /* a nonempty absolute declarator */
- absdcl1_ea
- | absdcl1_noea
- ;
-
-absdcl1_noea:
- direct_absdcl1
- | '*' maybe_type_quals_attrs absdcl1_noea
- { $$ = make_pointer_declarator ($2, $3); }
- ;
-
-absdcl1_ea:
- '*' maybe_type_quals_attrs
- { $$ = make_pointer_declarator
- ($2, build_id_declarator (NULL_TREE)); }
- | '*' maybe_type_quals_attrs absdcl1_ea
- { $$ = make_pointer_declarator ($2, $3); }
- ;
-
-direct_absdcl1:
- '(' maybe_attribute absdcl1 ')'
- { $$ = $2 ? build_attrs_declarator ($2, $3) : $3; }
- | direct_absdcl1 '(' parmlist
- { $$ = build_function_declarator ($3, $1); }
- | direct_absdcl1 array_declarator
- { $$ = set_array_declarator_inner ($2, $1, true); }
- | '(' parmlist
- { $$ = build_function_declarator
- ($2, build_id_declarator (NULL_TREE)); }
- | array_declarator
- { $$ = set_array_declarator_inner
- ($1, build_id_declarator (NULL_TREE), true); }
- ;
-
-/* The [...] part of a declarator for an array type. */
-
-array_declarator:
- '[' maybe_type_quals_attrs expr_no_commas ']'
- { $$ = build_array_declarator ($3.value, $2, false, false); }
- | '[' maybe_type_quals_attrs ']'
- { $$ = build_array_declarator (NULL_TREE, $2, false, false); }
- | '[' maybe_type_quals_attrs '*' ']'
- { $$ = build_array_declarator (NULL_TREE, $2, false, true); }
- | '[' STATIC maybe_type_quals_attrs expr_no_commas ']'
- { $$ = build_array_declarator ($4.value, $3, true, false); }
- /* declspecs_nosc_nots is a synonym for type_quals_attrs. */
- | '[' declspecs_nosc_nots STATIC expr_no_commas ']'
- { $$ = build_array_declarator ($4.value, $2, true, false); }
- ;
-
-/* A nonempty series of declarations and statements (possibly followed by
- some labels) that can form the body of a compound statement.
- NOTE: we don't allow labels on declarations; this might seem like a
- natural extension, but there would be a conflict between attributes
- on the label and prefix attributes on the declaration. */
-
-stmts_and_decls:
- lineno_stmt_decl_or_labels_ending_stmt
- | lineno_stmt_decl_or_labels_ending_decl
- | lineno_stmt_decl_or_labels_ending_label
- {
- error ("label at end of compound statement");
- }
- | lineno_stmt_decl_or_labels_ending_error
- ;
-
-lineno_stmt_decl_or_labels_ending_stmt:
- lineno_stmt
- | lineno_stmt_decl_or_labels_ending_stmt lineno_stmt
- | lineno_stmt_decl_or_labels_ending_decl lineno_stmt
- | lineno_stmt_decl_or_labels_ending_label lineno_stmt
- | lineno_stmt_decl_or_labels_ending_error lineno_stmt
- ;
-
-lineno_stmt_decl_or_labels_ending_decl:
- lineno_decl
- | lineno_stmt_decl_or_labels_ending_stmt lineno_decl
- {
- if ((pedantic && !flag_isoc99)
- || warn_declaration_after_statement)
- pedwarn_c90 ("ISO C90 forbids mixed declarations and code");
- }
- | lineno_stmt_decl_or_labels_ending_decl lineno_decl
- | lineno_stmt_decl_or_labels_ending_error lineno_decl
- ;
-
-lineno_stmt_decl_or_labels_ending_label:
- lineno_label
- | lineno_stmt_decl_or_labels_ending_stmt lineno_label
- | lineno_stmt_decl_or_labels_ending_decl lineno_label
- | lineno_stmt_decl_or_labels_ending_label lineno_label
- | lineno_stmt_decl_or_labels_ending_error lineno_label
- ;
-
-lineno_stmt_decl_or_labels_ending_error:
- errstmt
- | lineno_stmt_decl_or_labels errstmt
- ;
-
-lineno_stmt_decl_or_labels:
- lineno_stmt_decl_or_labels_ending_stmt
- | lineno_stmt_decl_or_labels_ending_decl
- | lineno_stmt_decl_or_labels_ending_label
- | lineno_stmt_decl_or_labels_ending_error
- ;
-
-errstmt: error ';'
- ;
-
-/* Start and end blocks created for the new scopes of C99. */
-c99_block_start: /* empty */
- { $$ = c_begin_compound_stmt (flag_isoc99); }
- ;
-
-/* Read zero or more forward-declarations for labels
- that nested functions can jump to. */
-maybe_label_decls:
- /* empty */
- | label_decls
- { if (pedantic)
- pedwarn ("ISO C forbids label declarations"); }
- ;
-
-label_decls:
- label_decl
- | label_decls label_decl
- ;
-
-label_decl:
- LABEL identifiers_or_typenames ';'
- { tree link;
- for (link = $2; link; link = TREE_CHAIN (link))
- {
- tree label = declare_label (TREE_VALUE (link));
- C_DECLARED_LABEL_FLAG (label) = 1;
- add_stmt (build_stmt (DECL_EXPR, label));
- }
- }
- ;
-
-/* This is the body of a function definition.
- It causes syntax errors to ignore to the next openbrace. */
-compstmt_or_error:
- compstmt
- { add_stmt ($1); }
- | error compstmt
- ;
-
-compstmt_start: '{' { $$ = c_begin_compound_stmt (true); }
- ;
-
-compstmt_nostart: '}'
- | maybe_label_decls compstmt_contents_nonempty '}'
- ;
-
-compstmt_contents_nonempty:
- stmts_and_decls
- | error
- ;
-
-compstmt_primary_start:
- '(' '{'
- { if (cur_stmt_list == NULL)
- {
- error ("braced-group within expression allowed "
- "only inside a function");
- YYERROR;
- }
- $$ = c_begin_stmt_expr ();
- }
- ;
-
-compstmt: compstmt_start compstmt_nostart
- { $$ = c_end_compound_stmt ($1, true); }
- ;
-
-/* The forced readahead in here is because we might be at the end of a
- line, and the line and file won't be bumped until yylex absorbs the
- first token on the next line. */
-
-save_location:
- { if (yychar == YYEMPTY)
- yychar = YYLEX;
- $$ = input_location; }
- ;
-
-lineno_labels:
- /* empty */
- | lineno_labels lineno_label
- ;
-
-/* A labeled statement. In C99 it also generates an implicit block. */
-c99_block_lineno_labeled_stmt:
- c99_block_start lineno_labels lineno_stmt
- { $$ = c_end_compound_stmt ($1, flag_isoc99); }
- ;
-
-lineno_stmt:
- save_location stmt
- {
- /* Two cases cannot and do not have line numbers associated:
- If stmt is degenerate, such as "2;", then stmt is an
- INTEGER_CST, which cannot hold line numbers. But that's
- ok because the statement will either be changed to a
- MODIFY_EXPR during gimplification of the statement expr,
- or discarded. If stmt was compound, but without new
- variables, we will have skipped the creation of a BIND
- and will have a bare STATEMENT_LIST. But that's ok
- because (recursively) all of the component statments
- should already have line numbers assigned. */
- if ($2 && EXPR_P ($2))
- SET_EXPR_LOCATION ($2, $1);
- }
- ;
-
-lineno_label:
- save_location label
- { if ($2) SET_EXPR_LOCATION ($2, $1); }
- ;
-
-condition: save_location expr
- { $$ = lang_hooks.truthvalue_conversion ($2.value);
- if (EXPR_P ($$))
- SET_EXPR_LOCATION ($$, $1); }
- ;
-
-/* Implement -Wparenthesis by special casing IF statement directly nested
- within IF statement. This requires some amount of duplication of the
- productions under c99_block_lineno_labeled_stmt in order to work out.
- But it's still likely more maintainable than lots of state outside the
- parser... */
-
-if_statement_1:
- c99_block_start lineno_labels if_statement
- { $$ = c_end_compound_stmt ($1, flag_isoc99); }
- ;
-
-if_statement_2:
- c99_block_start lineno_labels ';'
- { if (extra_warnings)
- add_stmt (build (NOP_EXPR, NULL_TREE, NULL_TREE));
- $$ = c_end_compound_stmt ($1, flag_isoc99); }
- | c99_block_lineno_labeled_stmt
- ;
-
-if_statement:
- IF c99_block_start save_location '(' condition ')'
- if_statement_1 ELSE if_statement_2
- { c_finish_if_stmt ($3, $5, $7, $9, true);
- add_stmt (c_end_compound_stmt ($2, flag_isoc99)); }
- | IF c99_block_start save_location '(' condition ')'
- if_statement_2 ELSE if_statement_2
- { c_finish_if_stmt ($3, $5, $7, $9, false);
- add_stmt (c_end_compound_stmt ($2, flag_isoc99)); }
- | IF c99_block_start save_location '(' condition ')'
- if_statement_1 %prec IF
- { c_finish_if_stmt ($3, $5, $7, NULL, true);
- add_stmt (c_end_compound_stmt ($2, flag_isoc99)); }
- | IF c99_block_start save_location '(' condition ')'
- if_statement_2 %prec IF
- { c_finish_if_stmt ($3, $5, $7, NULL, false);
- add_stmt (c_end_compound_stmt ($2, flag_isoc99)); }
- ;
-
-start_break: /* empty */
- { $$ = c_break_label; c_break_label = NULL; }
- ;
-
-start_continue: /* empty */
- { $$ = c_cont_label; c_cont_label = NULL; }
- ;
-
-while_statement:
- WHILE c99_block_start save_location '(' condition ')'
- start_break start_continue c99_block_lineno_labeled_stmt
- { c_finish_loop ($3, $5, NULL, $9, c_break_label,
- c_cont_label, true);
- add_stmt (c_end_compound_stmt ($2, flag_isoc99));
- c_break_label = $7; c_cont_label = $8; }
- ;
-
-do_statement:
- DO c99_block_start save_location start_break start_continue
- c99_block_lineno_labeled_stmt WHILE
- { $<ttype>$ = c_break_label; c_break_label = $4; }
- { $<ttype>$ = c_cont_label; c_cont_label = $5; }
- '(' condition ')' ';'
- { c_finish_loop ($3, $11, NULL, $6, $<ttype>8,
- $<ttype>9, false);
- add_stmt (c_end_compound_stmt ($2, flag_isoc99)); }
- ;
-
-xexpr:
- /* empty */
- { $$ = NULL_TREE; }
- | expr
- { $$ = $1.value; }
- ;
-
-for_init_stmt:
- xexpr ';'
- { c_finish_expr_stmt ($1); }
- | decl
- { check_for_loop_decls (); }
- ;
-
-for_cond_expr: save_location xexpr
- { if ($2)
- {
- $$ = lang_hooks.truthvalue_conversion ($2);
- if (EXPR_P ($$))
- SET_EXPR_LOCATION ($$, $1);
- }
- else
- $$ = NULL;
- }
- ;
-
-for_incr_expr: xexpr
- { $$ = c_process_expr_stmt ($1); }
- ;
-
-for_statement:
- FOR c99_block_start '(' for_init_stmt
- save_location for_cond_expr ';' for_incr_expr ')'
- start_break start_continue c99_block_lineno_labeled_stmt
- { c_finish_loop ($5, $6, $8, $12, c_break_label,
- c_cont_label, true);
- add_stmt (c_end_compound_stmt ($2, flag_isoc99));
- c_break_label = $10; c_cont_label = $11; }
- ;
-
-switch_statement:
- SWITCH c99_block_start '(' expr ')'
- { $<ttype>$ = c_start_case ($4.value); }
- start_break c99_block_lineno_labeled_stmt
- { c_finish_case ($8);
- if (c_break_label)
- add_stmt (build (LABEL_EXPR, void_type_node,
- c_break_label));
- c_break_label = $7;
- add_stmt (c_end_compound_stmt ($2, flag_isoc99)); }
- ;
-
-/* Parse a single real statement, not including any labels or compounds. */
-stmt_nocomp:
- expr ';'
- { $$ = c_finish_expr_stmt ($1.value); }
- | if_statement
- { $$ = NULL_TREE; }
- | while_statement
- { $$ = NULL_TREE; }
- | do_statement
- { $$ = NULL_TREE; }
- | for_statement
- { $$ = NULL_TREE; }
- | switch_statement
- { $$ = NULL_TREE; }
- | BREAK ';'
- { $$ = c_finish_bc_stmt (&c_break_label, true); }
- | CONTINUE ';'
- { $$ = c_finish_bc_stmt (&c_cont_label, false); }
- | RETURN ';'
- { $$ = c_finish_return (NULL_TREE); }
- | RETURN expr ';'
- { $$ = c_finish_return ($2.value); }
- | asm_stmt
- | GOTO identifier ';'
- { $$ = c_finish_goto_label ($2); }
- | GOTO '*' expr ';'
- { $$ = c_finish_goto_ptr ($3.value); }
- | ';'
- { $$ = NULL_TREE; }
-@@ifobjc
- | AT_THROW expr ';'
- { $$ = objc_build_throw_stmt ($2.value); }
- | AT_THROW ';'
- { $$ = objc_build_throw_stmt (NULL_TREE); }
- | objc_try_catch_stmt
- { $$ = NULL_TREE; }
- | AT_SYNCHRONIZED save_location '(' expr ')' compstmt
- { objc_build_synchronized ($2, $4.value, $6); $$ = NULL_TREE; }
- ;
-
-objc_catch_prefix:
- AT_CATCH '(' parm ')'
- { objc_begin_catch_clause (grokparm ($3)); }
- ;
-
-objc_catch_clause:
- objc_catch_prefix '{' compstmt_nostart
- { objc_finish_catch_clause (); }
- | objc_catch_prefix '{' error '}'
- { objc_finish_catch_clause (); }
- ;
-
-objc_opt_catch_list:
- /* empty */
- | objc_opt_catch_list objc_catch_clause
- ;
-
-objc_try_catch_clause:
- AT_TRY save_location compstmt
- { objc_begin_try_stmt ($2, $3); }
- objc_opt_catch_list
- ;
-
-objc_finally_clause:
- AT_FINALLY save_location compstmt
- { objc_build_finally_clause ($2, $3); }
- ;
-
-objc_try_catch_stmt:
- objc_try_catch_clause
- { objc_finish_try_stmt (); }
- | objc_try_catch_clause objc_finally_clause
- { objc_finish_try_stmt (); }
-@@end_ifobjc
- ;
-
-/* Parse a single or compound real statement, not including any labels. */
-stmt:
- compstmt
- { add_stmt ($1); $$ = NULL_TREE; }
- | stmt_nocomp
- ;
-
-/* Any kind of label, including jump labels and case labels.
- ANSI C accepts labels only before statements, but we allow them
- also at the end of a compound statement. */
-
-label: CASE expr_no_commas ':'
- { $$ = do_case ($2.value, NULL_TREE); }
- | CASE expr_no_commas ELLIPSIS expr_no_commas ':'
- { $$ = do_case ($2.value, $4.value); }
- | DEFAULT ':'
- { $$ = do_case (NULL_TREE, NULL_TREE); }
- | identifier save_location ':' maybe_attribute
- { tree label = define_label ($2, $1);
- if (label)
- {
- decl_attributes (&label, $4, 0);
- $$ = add_stmt (build_stmt (LABEL_EXPR, label));
- }
- else
- $$ = NULL_TREE;
- }
- ;
-
-/* Asm expressions and statements */
-
-/* simple_asm_expr is used in restricted contexts, where a full
- expression with inputs and outputs does not make sense. */
-simple_asm_expr:
- ASM_KEYWORD stop_string_translation
- '(' asm_string ')' start_string_translation
- { $$ = $4; }
- ;
-
-/* maybeasm: used for assembly names for declarations */
-maybeasm:
- /* empty */
- { $$ = NULL_TREE; }
- | simple_asm_expr
- ;
-
-/* asmdef: asm() outside a function body. */
-asmdef:
- simple_asm_expr ';'
- { assemble_asm ($1); }
- | ASM_KEYWORD error start_string_translation ';'
- {}
- ;
-
-/* Full-blown asm statement with inputs, outputs, clobbers, and
- volatile tag allowed. */
-asm_stmt:
- ASM_KEYWORD maybe_volatile stop_string_translation
- '(' asm_argument ')' start_string_translation ';'
- { $$ = build_asm_stmt ($2, $5); }
- ;
-
-asm_argument:
- /* no operands */
- asm_string
- { $$ = build_asm_expr ($1, 0, 0, 0, true); }
- /* output operands */
- | asm_string ':' asm_operands
- { $$ = build_asm_expr ($1, $3, 0, 0, false); }
- /* output and input operands */
- | asm_string ':' asm_operands ':' asm_operands
- { $$ = build_asm_expr ($1, $3, $5, 0, false); }
- /* output and input operands and clobbers */
- | asm_string ':' asm_operands ':' asm_operands ':' asm_clobbers
- { $$ = build_asm_expr ($1, $3, $5, $7, false); }
- ;
-
-/* Either 'volatile' or nothing. First thing in an `asm' statement. */
-
-maybe_volatile:
- /* empty */
- { $$ = 0; }
- | TYPE_QUAL
- { if ($1 != ridpointers[RID_VOLATILE])
- {
- warning ("%E qualifier ignored on asm", $1);
- $$ = 0;
- }
- else
- $$ = $1;
- }
- ;
-
-/* These are the operands other than the first string and colon
- in asm ("addextend %2,%1": "=dm" (x), "0" (y), "g" (*x)) */
-asm_operands: /* empty */
- { $$ = NULL_TREE; }
- | nonnull_asm_operands
- ;
-
-nonnull_asm_operands:
- asm_operand
- | nonnull_asm_operands ',' asm_operand
- { $$ = chainon ($1, $3); }
- ;
-
-asm_operand:
- asm_string start_string_translation '(' expr ')'
- stop_string_translation
- { $$ = build_tree_list (build_tree_list (NULL_TREE, $1),
- $4.value); }
- | '[' identifier ']' asm_string start_string_translation
- '(' expr ')' stop_string_translation
- { $2 = build_string (IDENTIFIER_LENGTH ($2),
- IDENTIFIER_POINTER ($2));
- $$ = build_tree_list (build_tree_list ($2, $4), $7.value); }
- ;
-
-asm_clobbers:
- asm_string
- { $$ = tree_cons (NULL_TREE, $1, NULL_TREE); }
- | asm_clobbers ',' asm_string
- { $$ = tree_cons (NULL_TREE, $3, $1); }
- ;
-
-/* Strings in 'asm' must be narrow strings. */
-asm_string:
- STRING
- { if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE ($1)))
- != char_type_node)
- {
- error ("wide string literal in %<asm%>");
- $$ = build_string (1, "");
- }
- else
- $$ = $1; }
- ;
-
-stop_string_translation:
- { c_lex_string_translate = 0; }
- ;
-
-start_string_translation:
- { c_lex_string_translate = 1; }
- ;
-
-
-/* This is what appears inside the parens in a function declarator.
- Its value is a list of ..._TYPE nodes. Attributes must appear here
- to avoid a conflict with their appearance after an open parenthesis
- in an abstract declarator, as in
- "void bar (int (__attribute__((__mode__(SI))) int foo));". */
-parmlist:
- maybe_attribute
- { push_scope ();
- declare_parm_level (); }
- parmlist_1
- { $$ = $3;
- pop_scope (); }
- ;
-
-parmlist_1:
- parmlist_2 ')'
- | parms ';'
- { mark_forward_parm_decls (); }
- maybe_attribute
- { /* Dummy action so attributes are in known place
- on parser stack. */ }
- parmlist_1
- { $$ = $6; }
- | error ')'
- { $$ = XOBNEW (&parser_obstack, struct c_arg_info);
- $$->parms = 0;
- $$->tags = 0;
- $$->types = 0;
- $$->others = 0; }
- ;
-
-/* This is what appears inside the parens in a function declarator.
- Its value is represented in the format that grokdeclarator expects. */
-parmlist_2: /* empty */
- { $$ = XOBNEW (&parser_obstack, struct c_arg_info);
- $$->parms = 0;
- $$->tags = 0;
- $$->types = 0;
- $$->others = 0; }
- | ELLIPSIS
- { $$ = XOBNEW (&parser_obstack, struct c_arg_info);
- $$->parms = 0;
- $$->tags = 0;
- $$->others = 0;
- /* Suppress -Wold-style-definition for this case. */
- $$->types = error_mark_node;
- error ("ISO C requires a named argument before %<...%>");
- }
- | parms
- { $$ = get_parm_info (/*ellipsis=*/false); }
- | parms ',' ELLIPSIS
- { $$ = get_parm_info (/*ellipsis=*/true); }
- ;
-
-parms:
- firstparm
- { push_parm_decl ($1); }
- | parms ',' parm
- { push_parm_decl ($3); }
- ;
-
-/* A single parameter declaration or parameter type name,
- as found in a parmlist. */
-parm:
- declspecs_ts setspecs parm_declarator maybe_attribute
- { $$ = build_c_parm (current_declspecs,
- chainon ($4, all_prefix_attributes), $3);
- POP_DECLSPEC_STACK; }
- | declspecs_ts setspecs notype_declarator maybe_attribute
- { $$ = build_c_parm (current_declspecs,
- chainon ($4, all_prefix_attributes), $3);
- POP_DECLSPEC_STACK; }
- | declspecs_ts setspecs absdcl_maybe_attribute
- { $$ = $3;
- POP_DECLSPEC_STACK; }
- | declspecs_nots setspecs notype_declarator maybe_attribute
- { $$ = build_c_parm (current_declspecs,
- chainon ($4, all_prefix_attributes), $3);
- POP_DECLSPEC_STACK; }
-
- | declspecs_nots setspecs absdcl_maybe_attribute
- { $$ = $3;
- POP_DECLSPEC_STACK; }
- ;
-
-/* The first parm, which must suck attributes from off the top of the parser
- stack. */
-firstparm:
- declspecs_ts_nosa setspecs_fp parm_declarator maybe_attribute
- { $$ = build_c_parm (current_declspecs,
- chainon ($4, all_prefix_attributes), $3);
- POP_DECLSPEC_STACK; }
- | declspecs_ts_nosa setspecs_fp notype_declarator maybe_attribute
- { $$ = build_c_parm (current_declspecs,
- chainon ($4, all_prefix_attributes), $3);
- POP_DECLSPEC_STACK; }
- | declspecs_ts_nosa setspecs_fp absdcl_maybe_attribute
- { $$ = $3;
- POP_DECLSPEC_STACK; }
- | declspecs_nots_nosa setspecs_fp notype_declarator maybe_attribute
- { $$ = build_c_parm (current_declspecs,
- chainon ($4, all_prefix_attributes), $3);
- POP_DECLSPEC_STACK; }
-
- | declspecs_nots_nosa setspecs_fp absdcl_maybe_attribute
- { $$ = $3;
- POP_DECLSPEC_STACK; }
- ;
-
-setspecs_fp:
- setspecs
- { prefix_attributes = chainon (prefix_attributes, $<ttype>-2);
- all_prefix_attributes = prefix_attributes; }
- ;
-
-/* This is used in a function definition
- where either a parmlist or an identifier list is ok.
- Its value is a list of ..._TYPE nodes or a list of identifiers. */
-parmlist_or_identifiers:
- maybe_attribute
- { push_scope ();
- declare_parm_level (); }
- parmlist_or_identifiers_1
- { $$ = $3;
- pop_scope (); }
- ;
-
-parmlist_or_identifiers_1:
- parmlist_1
- | identifiers ')'
- { $$ = XOBNEW (&parser_obstack, struct c_arg_info);
- $$->parms = 0;
- $$->tags = 0;
- $$->types = $1;
- $$->others = 0;
-
- /* Make sure we have a parmlist after attributes. */
- if ($<ttype>-1 != 0)
- YYERROR1;
- }
- ;
-
-/* A nonempty list of identifiers. */
-identifiers:
- IDENTIFIER
- { $$ = build_tree_list (NULL_TREE, $1); }
- | identifiers ',' IDENTIFIER
- { $$ = chainon ($1, build_tree_list (NULL_TREE, $3)); }
- ;
-
-/* A nonempty list of identifiers, including typenames. */
-identifiers_or_typenames:
- identifier
- { $$ = build_tree_list (NULL_TREE, $1); }
- | identifiers_or_typenames ',' identifier
- { $$ = chainon ($1, build_tree_list (NULL_TREE, $3)); }
- ;
-
-extension:
- EXTENSION
- { $$ = SAVE_EXT_FLAGS ();
- pedantic = 0;
- warn_pointer_arith = 0;
- warn_traditional = 0;
- flag_iso = 0; }
- ;
-
-@@ifobjc
-/* Objective-C productions. */
-
-objcdef:
- classdef
- | classdecl
- | aliasdecl
- | protocoldef
- | methoddef
- | AT_END
- {
- objc_finish_implementation ();
- }
- ;
-
-/* A nonempty list of identifiers. */
-identifier_list:
- identifier
- { $$ = build_tree_list (NULL_TREE, $1); }
- | identifier_list ',' identifier
- { $$ = chainon ($1, build_tree_list (NULL_TREE, $3)); }
- ;
-
-classdecl:
- AT_CLASS identifier_list ';'
- {
- objc_declare_class ($2);
- }
- ;
-
-aliasdecl:
- AT_ALIAS identifier identifier ';'
- {
- objc_declare_alias ($2, $3);
- }
- ;
-
-superclass:
- ':' identifier { $$ = $2; }
- | /* NULL */ %prec HYPERUNARY { $$ = NULL_TREE; }
- ;
-
-class_ivars:
- '{' ivar_decl_list '}'
- | /* NULL */
- ;
-
-classdef:
- AT_INTERFACE identifier superclass protocolrefs
- {
- objc_start_class_interface ($2, $3, $4);
- }
- class_ivars
- {
- objc_continue_interface ();
- }
- methodprotolist AT_END
- {
- objc_finish_interface ();
- }
-
- | AT_IMPLEMENTATION identifier superclass
- {
- objc_start_class_implementation ($2, $3);
- }
- class_ivars
- {
- objc_continue_implementation ();
- }
-
- | AT_INTERFACE identifier '(' identifier ')' protocolrefs
- {
- objc_start_category_interface ($2, $4, $6);
- }
- methodprotolist AT_END
- {
- objc_finish_interface ();
- }
-
- | AT_IMPLEMENTATION identifier '(' identifier ')'
- {
- objc_start_category_implementation ($2, $4);
- }
- ;
-
-protocoldef:
- AT_PROTOCOL identifier protocolrefs
- {
- objc_pq_context = 1;
- objc_start_protocol ($2, $3);
- }
- methodprotolist AT_END
- {
- objc_pq_context = 0;
- objc_finish_interface ();
- }
- /* The @protocol forward-declaration production introduces a
- reduce/reduce conflict on ';', which should be resolved in
- favor of the production 'identifier_list -> identifier'. */
- | AT_PROTOCOL identifier_list ';'
- {
- objc_declare_protocols ($2);
- }
- ;
-
-protocolrefs:
- /* empty */
- {
- $$ = NULL_TREE;
- }
- | non_empty_protocolrefs
- ;
-
-non_empty_protocolrefs:
- ARITHCOMPARE identifier_list ARITHCOMPARE
- {
- if ($1 == LT_EXPR && $3 == GT_EXPR)
- $$ = $2;
- else
- YYERROR1;
- }
- ;
-
-ivar_decl_list:
- /* empty */
- | ivar_decl_list visibility_spec ivar_decls
- ;
-
-visibility_spec:
- /* empty */
- | AT_PRIVATE { objc_set_visibility (2); }
- | AT_PROTECTED { objc_set_visibility (0); }
- | AT_PUBLIC { objc_set_visibility (1); }
- ;
-
-ivar_decls:
- /* empty */
- | ivar_decls ivar_decl ';'
- | ivar_decls ';'
- {
- if (pedantic)
- pedwarn ("extra semicolon in struct or union specified");
- }
- ;
-
-ivar_decl:
- component_decl
- {
- /* Comma-separated ivars are chained together in
- reverse order; add them one by one. */
- tree ivar = nreverse ($1);
-
- for (; ivar; ivar = TREE_CHAIN (ivar))
- objc_add_instance_variable (copy_node (ivar));
- }
- ;
-
-opt_semi:
- /* NULL */
- | ';'
- {
- if (pedantic)
- pedwarn ("extra semicolon in method definition specified");
- }
- ;
-
-methodtype:
- '+'
- | '-'
- ;
-
-methoddef:
- methodtype
- {
- objc_set_method_type ($1);
- objc_pq_context = 1;
- }
- methoddecl opt_semi
- {
- objc_pq_context = 0;
- objc_start_method_definition ($3);
- }
- compstmt_or_error
- {
- objc_finish_method_definition (current_function_decl);
- }
- ;
-
-/* the reason for the strange actions in this rule
- is so that notype_initdecls when reached via datadef
- can find a valid list of type and sc specs in $0. */
-
-methodprotolist:
- /* empty */
- | methodprotolist methodproto
- | methodprotolist { $<ttype>$ = NULL_TREE; } datadef
- ;
-
-semi_or_error:
- ';'
- | error
- ;
-
-methodproto:
- methodtype
- {
- objc_set_method_type ($1);
- /* Remember protocol qualifiers in prototypes. */
- objc_pq_context = 1;
- }
- methoddecl
- {
- /* Forget protocol qualifiers here. */
- objc_pq_context = 0;
- objc_add_method_declaration ($3);
- }
- semi_or_error
- ;
-
-methoddecl:
- '(' objc_typename ')' unaryselector
- {
- $$ = objc_build_method_signature ($2, $4, NULL_TREE);
- }
-
- | unaryselector
- {
- $$ = objc_build_method_signature (NULL_TREE, $1, NULL_TREE);
- }
-
- | '(' objc_typename ')' keywordselector optparmlist
- {
- $$ = objc_build_method_signature ($2, $4, $5);
- }
-
- | keywordselector optparmlist
- {
- $$ = objc_build_method_signature (NULL_TREE, $1, $2);
- }
- ;
-
-/* Optional ObjC method parameters follow the C syntax, and may include '...'
- to denote a variable number of arguments. */
-
-optparmlist:
- optparms optellipsis
- {
- TREE_OVERFLOW ($$) = $2;
- }
- ;
-
-optparms:
- /* NULL */
- {
- $$ = make_node (TREE_LIST);
- }
- | optparms ',' parm
- {
- $$ = chainon ($1, build_tree_list (NULL_TREE,
- grokparm ($3)));
- }
- ;
-
-optellipsis:
- /* NULL */
- {
- $$ = 0;
- }
- | ',' ELLIPSIS
- {
- $$ = 1;
- }
- ;
-
-unaryselector:
- selector
- ;
-
-keywordselector:
- keyworddecl
-
- | keywordselector keyworddecl
- {
- $$ = chainon ($1, $2);
- }
- ;
-
-selector:
- IDENTIFIER
- | TYPENAME
- | CLASSNAME
- | reservedwords
- ;
-
-reservedwords:
- ENUM | STRUCT | UNION | IF | ELSE | WHILE | DO | FOR
- | SWITCH | CASE | DEFAULT | BREAK | CONTINUE | RETURN
- | GOTO | ASM_KEYWORD | SIZEOF | TYPEOF | ALIGNOF
- | TYPESPEC | TYPE_QUAL | OBJC_TYPE_QUAL
- ;
-
-objc_qual:
- OBJC_TYPE_QUAL
- ;
-
-objc_quals:
- objc_quals objc_qual
- {
- $$ = chainon ($1, build_tree_list (NULL_TREE, $2));
- }
- | /* NULL */
- {
- $$ = NULL_TREE;
- }
- ;
-
-objc_typename:
- objc_quals typename
- {
- $$ = build_tree_list ($1, groktypename ($2));
- }
- | objc_quals
- {
- $$ = build_tree_list ($1, NULL_TREE);
- }
- ;
-
-keyworddecl:
- selector ':' '(' objc_typename ')' identifier
- {
- $$ = objc_build_keyword_decl ($1, $4, $6);
- }
-
- | selector ':' identifier
- {
- $$ = objc_build_keyword_decl ($1, NULL_TREE, $3);
- }
-
- | ':' '(' objc_typename ')' identifier
- {
- $$ = objc_build_keyword_decl (NULL_TREE, $3, $5);
- }
-
- | ':' identifier
- {
- $$ = objc_build_keyword_decl (NULL_TREE, NULL_TREE, $2);
- }
- ;
-
-messageargs:
- selector
- | keywordarglist
- ;
-
-keywordarglist:
- keywordarg
- | keywordarglist keywordarg
- {
- $$ = chainon ($1, $2);
- }
- ;
-
-
-keywordexpr:
- nonnull_exprlist
- {
- if (TREE_CHAIN ($1) == NULL_TREE)
- /* just return the expr., remove a level of indirection */
- $$ = TREE_VALUE ($1);
- else
- /* we have a comma expr., we will collapse later */
- $$ = $1;
- }
- ;
-
-keywordarg:
- selector ':' keywordexpr
- {
- $$ = build_tree_list ($1, $3);
- }
- | ':' keywordexpr
- {
- $$ = build_tree_list (NULL_TREE, $2);
- }
- ;
-
-receiver:
- expr
- { $$ = $1.value; }
- | CLASSNAME
- {
- $$ = objc_get_class_reference ($1);
- }
- | TYPENAME
- {
- $$ = objc_get_class_reference ($1);
- }
- ;
-
-objcmessageexpr:
- '[' receiver messageargs ']'
- { $$ = build_tree_list ($2, $3); }
- ;
-
-selectorarg:
- selector
- | keywordnamelist
- ;
-
-keywordnamelist:
- keywordname
- | keywordnamelist keywordname
- {
- $$ = chainon ($1, $2);
- }
- ;
-
-keywordname:
- selector ':'
- {
- $$ = build_tree_list ($1, NULL_TREE);
- }
- | ':'
- {
- $$ = build_tree_list (NULL_TREE, NULL_TREE);
- }
- ;
-
-objcselectorexpr:
- AT_SELECTOR '(' selectorarg ')'
- {
- $$ = $3;
- }
- ;
-
-objcprotocolexpr:
- AT_PROTOCOL '(' identifier ')'
- {
- $$ = $3;
- }
- ;
-
-/* extension to support C-structures in the archiver */
-
-objcencodeexpr:
- AT_ENCODE '(' typename ')'
- {
- $$ = groktypename ($3);
- }
- ;
-
-@@end_ifobjc
-%%
-
-/* yylex() is a thin wrapper around c_lex(), all it does is translate
- cpplib.h's token codes into yacc's token codes. */
-
-static enum cpp_ttype last_token;
-
-/* The reserved keyword table. */
-struct resword
-{
- const char *word;
- ENUM_BITFIELD(rid) rid : 16;
- unsigned int disable : 16;
-};
-
-/* Disable mask. Keywords are disabled if (reswords[i].disable & mask) is
- _true_. */
-#define D_C89 0x01 /* not in C89 */
-#define D_EXT 0x02 /* GCC extension */
-#define D_EXT89 0x04 /* GCC extension incorporated in C99 */
-#define D_OBJC 0x08 /* Objective C only */
-
-static const struct resword reswords[] =
-{
- { "_Bool", RID_BOOL, 0 },
- { "_Complex", RID_COMPLEX, 0 },
- { "__FUNCTION__", RID_FUNCTION_NAME, 0 },
- { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 },
- { "__alignof", RID_ALIGNOF, 0 },
- { "__alignof__", RID_ALIGNOF, 0 },
- { "__asm", RID_ASM, 0 },
- { "__asm__", RID_ASM, 0 },
- { "__attribute", RID_ATTRIBUTE, 0 },
- { "__attribute__", RID_ATTRIBUTE, 0 },
- { "__builtin_choose_expr", RID_CHOOSE_EXPR, 0 },
- { "__builtin_offsetof", RID_OFFSETOF, 0 },
- { "__builtin_types_compatible_p", RID_TYPES_COMPATIBLE_P, 0 },
- { "__builtin_va_arg", RID_VA_ARG, 0 },
- { "__complex", RID_COMPLEX, 0 },
- { "__complex__", RID_COMPLEX, 0 },
- { "__const", RID_CONST, 0 },
- { "__const__", RID_CONST, 0 },
- { "__extension__", RID_EXTENSION, 0 },
- { "__func__", RID_C99_FUNCTION_NAME, 0 },
- { "__imag", RID_IMAGPART, 0 },
- { "__imag__", RID_IMAGPART, 0 },
- { "__inline", RID_INLINE, 0 },
- { "__inline__", RID_INLINE, 0 },
- { "__label__", RID_LABEL, 0 },
- { "__real", RID_REALPART, 0 },
- { "__real__", RID_REALPART, 0 },
- { "__restrict", RID_RESTRICT, 0 },
- { "__restrict__", RID_RESTRICT, 0 },
- { "__signed", RID_SIGNED, 0 },
- { "__signed__", RID_SIGNED, 0 },
- { "__thread", RID_THREAD, 0 },
- { "__typeof", RID_TYPEOF, 0 },
- { "__typeof__", RID_TYPEOF, 0 },
- { "__volatile", RID_VOLATILE, 0 },
- { "__volatile__", RID_VOLATILE, 0 },
- { "asm", RID_ASM, D_EXT },
- { "auto", RID_AUTO, 0 },
- { "break", RID_BREAK, 0 },
- { "case", RID_CASE, 0 },
- { "char", RID_CHAR, 0 },
- { "const", RID_CONST, 0 },
- { "continue", RID_CONTINUE, 0 },
- { "default", RID_DEFAULT, 0 },
- { "do", RID_DO, 0 },
- { "double", RID_DOUBLE, 0 },
- { "else", RID_ELSE, 0 },
- { "enum", RID_ENUM, 0 },
- { "extern", RID_EXTERN, 0 },
- { "float", RID_FLOAT, 0 },
- { "for", RID_FOR, 0 },
- { "goto", RID_GOTO, 0 },
- { "if", RID_IF, 0 },
- { "inline", RID_INLINE, D_EXT89 },
- { "int", RID_INT, 0 },
- { "long", RID_LONG, 0 },
- { "register", RID_REGISTER, 0 },
- { "restrict", RID_RESTRICT, D_C89 },
- { "return", RID_RETURN, 0 },
- { "short", RID_SHORT, 0 },
- { "signed", RID_SIGNED, 0 },
- { "sizeof", RID_SIZEOF, 0 },
- { "static", RID_STATIC, 0 },
- { "struct", RID_STRUCT, 0 },
- { "switch", RID_SWITCH, 0 },
- { "typedef", RID_TYPEDEF, 0 },
- { "typeof", RID_TYPEOF, D_EXT },
- { "union", RID_UNION, 0 },
- { "unsigned", RID_UNSIGNED, 0 },
- { "void", RID_VOID, 0 },
- { "volatile", RID_VOLATILE, 0 },
- { "while", RID_WHILE, 0 },
-
-@@ifobjc
-
- /* These objc keywords are recognized only immediately after
- an '@'. */
- { "class", RID_AT_CLASS, D_OBJC },
- { "compatibility_alias", RID_AT_ALIAS, D_OBJC },
- { "defs", RID_AT_DEFS, D_OBJC },
- { "encode", RID_AT_ENCODE, D_OBJC },
- { "end", RID_AT_END, D_OBJC },
- { "implementation", RID_AT_IMPLEMENTATION, D_OBJC },
- { "interface", RID_AT_INTERFACE, D_OBJC },
- { "private", RID_AT_PRIVATE, D_OBJC },
- { "protected", RID_AT_PROTECTED, D_OBJC },
- { "protocol", RID_AT_PROTOCOL, D_OBJC },
- { "public", RID_AT_PUBLIC, D_OBJC },
- { "selector", RID_AT_SELECTOR, D_OBJC },
- { "throw", RID_AT_THROW, D_OBJC },
- { "try", RID_AT_TRY, D_OBJC },
- { "catch", RID_AT_CATCH, D_OBJC },
- { "finally", RID_AT_FINALLY, D_OBJC },
- { "synchronized", RID_AT_SYNCHRONIZED, D_OBJC },
- /* These are recognized only in protocol-qualifier context
- (see above) */
- { "bycopy", RID_BYCOPY, D_OBJC },
- { "byref", RID_BYREF, D_OBJC },
- { "in", RID_IN, D_OBJC },
- { "inout", RID_INOUT, D_OBJC },
- { "oneway", RID_ONEWAY, D_OBJC },
- { "out", RID_OUT, D_OBJC },
-@@end_ifobjc
-};
-#define N_reswords (sizeof reswords / sizeof (struct resword))
-
-/* Table mapping from RID_* constants to yacc token numbers.
- Unfortunately we have to have entries for all the keywords in all
- three languages. */
-static const short rid_to_yy[RID_MAX] =
-{
- /* RID_STATIC */ STATIC,
- /* RID_UNSIGNED */ TYPESPEC,
- /* RID_LONG */ TYPESPEC,
- /* RID_CONST */ TYPE_QUAL,
- /* RID_EXTERN */ SCSPEC,
- /* RID_REGISTER */ SCSPEC,
- /* RID_TYPEDEF */ SCSPEC,
- /* RID_SHORT */ TYPESPEC,
- /* RID_INLINE */ SCSPEC,
- /* RID_VOLATILE */ TYPE_QUAL,
- /* RID_SIGNED */ TYPESPEC,
- /* RID_AUTO */ SCSPEC,
- /* RID_RESTRICT */ TYPE_QUAL,
-
- /* C extensions */
- /* RID_COMPLEX */ TYPESPEC,
- /* RID_THREAD */ SCSPEC,
-
- /* C++ */
- /* RID_FRIEND */ 0,
- /* RID_VIRTUAL */ 0,
- /* RID_EXPLICIT */ 0,
- /* RID_EXPORT */ 0,
- /* RID_MUTABLE */ 0,
-
- /* ObjC */
- /* RID_IN */ OBJC_TYPE_QUAL,
- /* RID_OUT */ OBJC_TYPE_QUAL,
- /* RID_INOUT */ OBJC_TYPE_QUAL,
- /* RID_BYCOPY */ OBJC_TYPE_QUAL,
- /* RID_BYREF */ OBJC_TYPE_QUAL,
- /* RID_ONEWAY */ OBJC_TYPE_QUAL,
-
- /* C */
- /* RID_INT */ TYPESPEC,
- /* RID_CHAR */ TYPESPEC,
- /* RID_FLOAT */ TYPESPEC,
- /* RID_DOUBLE */ TYPESPEC,
- /* RID_VOID */ TYPESPEC,
- /* RID_ENUM */ ENUM,
- /* RID_STRUCT */ STRUCT,
- /* RID_UNION */ UNION,
- /* RID_IF */ IF,
- /* RID_ELSE */ ELSE,
- /* RID_WHILE */ WHILE,
- /* RID_DO */ DO,
- /* RID_FOR */ FOR,
- /* RID_SWITCH */ SWITCH,
- /* RID_CASE */ CASE,
- /* RID_DEFAULT */ DEFAULT,
- /* RID_BREAK */ BREAK,
- /* RID_CONTINUE */ CONTINUE,
- /* RID_RETURN */ RETURN,
- /* RID_GOTO */ GOTO,
- /* RID_SIZEOF */ SIZEOF,
-
- /* C extensions */
- /* RID_ASM */ ASM_KEYWORD,
- /* RID_TYPEOF */ TYPEOF,
- /* RID_ALIGNOF */ ALIGNOF,
- /* RID_ATTRIBUTE */ ATTRIBUTE,
- /* RID_VA_ARG */ VA_ARG,
- /* RID_EXTENSION */ EXTENSION,
- /* RID_IMAGPART */ IMAGPART,
- /* RID_REALPART */ REALPART,
- /* RID_LABEL */ LABEL,
-
- /* RID_CHOOSE_EXPR */ CHOOSE_EXPR,
- /* RID_TYPES_COMPATIBLE_P */ TYPES_COMPATIBLE_P,
-
- /* RID_FUNCTION_NAME */ FUNC_NAME,
- /* RID_PRETTY_FUNCTION_NAME */ FUNC_NAME,
- /* RID_C99_FUNCTION_NAME */ FUNC_NAME,
-
- /* C++ */
- /* RID_BOOL */ TYPESPEC,
- /* RID_WCHAR */ 0,
- /* RID_CLASS */ 0,
- /* RID_PUBLIC */ 0,
- /* RID_PRIVATE */ 0,
- /* RID_PROTECTED */ 0,
- /* RID_TEMPLATE */ 0,
- /* RID_NULL */ 0,
- /* RID_CATCH */ 0,
- /* RID_DELETE */ 0,
- /* RID_FALSE */ 0,
- /* RID_NAMESPACE */ 0,
- /* RID_NEW */ 0,
- /* RID_OFFSETOF */ OFFSETOF,
- /* RID_OPERATOR */ 0,
- /* RID_THIS */ 0,
- /* RID_THROW */ 0,
- /* RID_TRUE */ 0,
- /* RID_TRY */ 0,
- /* RID_TYPENAME */ 0,
- /* RID_TYPEID */ 0,
- /* RID_USING */ 0,
-
- /* casts */
- /* RID_CONSTCAST */ 0,
- /* RID_DYNCAST */ 0,
- /* RID_REINTCAST */ 0,
- /* RID_STATCAST */ 0,
-
- /* Objective C */
- /* RID_AT_ENCODE */ AT_ENCODE,
- /* RID_AT_END */ AT_END,
- /* RID_AT_CLASS */ AT_CLASS,
- /* RID_AT_ALIAS */ AT_ALIAS,
- /* RID_AT_DEFS */ AT_DEFS,
- /* RID_AT_PRIVATE */ AT_PRIVATE,
- /* RID_AT_PROTECTED */ AT_PROTECTED,
- /* RID_AT_PUBLIC */ AT_PUBLIC,
- /* RID_AT_PROTOCOL */ AT_PROTOCOL,
- /* RID_AT_SELECTOR */ AT_SELECTOR,
- /* RID_AT_THROW */ AT_THROW,
- /* RID_AT_TRY */ AT_TRY,
- /* RID_AT_CATCH */ AT_CATCH,
- /* RID_AT_FINALLY */ AT_FINALLY,
- /* RID_AT_SYNCHRONIZED */ AT_SYNCHRONIZED,
- /* RID_AT_INTERFACE */ AT_INTERFACE,
- /* RID_AT_IMPLEMENTATION */ AT_IMPLEMENTATION
-};
-
-static void
-init_reswords (void)
-{
- unsigned int i;
- tree id;
- int mask = (flag_isoc99 ? 0 : D_C89)
- | (flag_no_asm ? (flag_isoc99 ? D_EXT : D_EXT|D_EXT89) : 0);
-
- if (!c_dialect_objc ())
- mask |= D_OBJC;
-
- ridpointers = GGC_CNEWVEC (tree, (int) RID_MAX);
- for (i = 0; i < N_reswords; i++)
- {
- /* If a keyword is disabled, do not enter it into the table
- and so create a canonical spelling that isn't a keyword. */
- if (reswords[i].disable & mask)
- continue;
-
- id = get_identifier (reswords[i].word);
- C_RID_CODE (id) = reswords[i].rid;
- C_IS_RESERVED_WORD (id) = 1;
- ridpointers [(int) reswords[i].rid] = id;
- }
-}
-
-#define NAME(type) cpp_type2name (type)
-
-static void
-yyerror (const char *msgid)
-{
- c_parse_error (msgid, last_token, yylval.ttype);
-}
-
-static int
-yylexname (void)
-{
- tree decl;
-
-@@ifobjc
- int objc_force_identifier = objc_need_raw_identifier;
- OBJC_NEED_RAW_IDENTIFIER (0);
-@@end_ifobjc
-
- if (C_IS_RESERVED_WORD (yylval.ttype))
- {
- enum rid rid_code = C_RID_CODE (yylval.ttype);
-
-@@ifobjc
- if (!OBJC_IS_AT_KEYWORD (rid_code)
- && (!OBJC_IS_PQ_KEYWORD (rid_code) || objc_pq_context))
-@@end_ifobjc
- {
- /* Return the canonical spelling for this keyword. */
- yylval.ttype = ridpointers[(int) rid_code];
- return rid_to_yy[(int) rid_code];
- }
- }
-
- decl = lookup_name (yylval.ttype);
- if (decl)
- {
- if (TREE_CODE (decl) == TYPE_DECL)
- return TYPENAME;
- }
-@@ifobjc
- else
- {
- tree objc_interface_decl = objc_is_class_name (yylval.ttype);
- /* ObjC class names are in the same namespace as variables and
- typedefs, and hence are shadowed by local declarations. */
- if (objc_interface_decl
- && (global_bindings_p ()
- || (!objc_force_identifier && !decl)))
- {
- yylval.ttype = objc_interface_decl;
- return CLASSNAME;
- }
- }
-@@end_ifobjc
-
- return IDENTIFIER;
-}
-
-static inline int
-_yylex (void)
-{
- get_next:
- last_token = c_lex (&yylval.ttype);
- switch (last_token)
- {
- case CPP_EQ: return '=';
- case CPP_NOT: return '!';
- case CPP_GREATER: yylval.code = GT_EXPR; return ARITHCOMPARE;
- case CPP_LESS: yylval.code = LT_EXPR; return ARITHCOMPARE;
- case CPP_PLUS: yylval.code = PLUS_EXPR; return '+';
- case CPP_MINUS: yylval.code = MINUS_EXPR; return '-';
- case CPP_MULT: yylval.code = MULT_EXPR; return '*';
- case CPP_DIV: yylval.code = TRUNC_DIV_EXPR; return '/';
- case CPP_MOD: yylval.code = TRUNC_MOD_EXPR; return '%';
- case CPP_AND: yylval.code = BIT_AND_EXPR; return '&';
- case CPP_OR: yylval.code = BIT_IOR_EXPR; return '|';
- case CPP_XOR: yylval.code = BIT_XOR_EXPR; return '^';
- case CPP_RSHIFT: yylval.code = RSHIFT_EXPR; return RSHIFT;
- case CPP_LSHIFT: yylval.code = LSHIFT_EXPR; return LSHIFT;
-
- case CPP_COMPL: return '~';
- case CPP_AND_AND: return ANDAND;
- case CPP_OR_OR: return OROR;
- case CPP_QUERY: return '?';
- case CPP_OPEN_PAREN: return '(';
- case CPP_EQ_EQ: yylval.code = EQ_EXPR; return EQCOMPARE;
- case CPP_NOT_EQ: yylval.code = NE_EXPR; return EQCOMPARE;
- case CPP_GREATER_EQ:yylval.code = GE_EXPR; return ARITHCOMPARE;
- case CPP_LESS_EQ: yylval.code = LE_EXPR; return ARITHCOMPARE;
-
- case CPP_PLUS_EQ: yylval.code = PLUS_EXPR; return ASSIGN;
- case CPP_MINUS_EQ: yylval.code = MINUS_EXPR; return ASSIGN;
- case CPP_MULT_EQ: yylval.code = MULT_EXPR; return ASSIGN;
- case CPP_DIV_EQ: yylval.code = TRUNC_DIV_EXPR; return ASSIGN;
- case CPP_MOD_EQ: yylval.code = TRUNC_MOD_EXPR; return ASSIGN;
- case CPP_AND_EQ: yylval.code = BIT_AND_EXPR; return ASSIGN;
- case CPP_OR_EQ: yylval.code = BIT_IOR_EXPR; return ASSIGN;
- case CPP_XOR_EQ: yylval.code = BIT_XOR_EXPR; return ASSIGN;
- case CPP_RSHIFT_EQ: yylval.code = RSHIFT_EXPR; return ASSIGN;
- case CPP_LSHIFT_EQ: yylval.code = LSHIFT_EXPR; return ASSIGN;
-
- case CPP_OPEN_SQUARE: return '[';
- case CPP_CLOSE_SQUARE: return ']';
- case CPP_OPEN_BRACE: return '{';
- case CPP_CLOSE_BRACE: return '}';
- case CPP_ELLIPSIS: return ELLIPSIS;
-
- case CPP_PLUS_PLUS: return PLUSPLUS;
- case CPP_MINUS_MINUS: return MINUSMINUS;
- case CPP_DEREF: return POINTSAT;
- case CPP_DOT: return '.';
-
- /* The following tokens may affect the interpretation of any
- identifiers following, if doing Objective-C. */
- case CPP_COLON: OBJC_NEED_RAW_IDENTIFIER (0); return ':';
- case CPP_COMMA: OBJC_NEED_RAW_IDENTIFIER (0); return ',';
- case CPP_CLOSE_PAREN: OBJC_NEED_RAW_IDENTIFIER (0); return ')';
- case CPP_SEMICOLON: OBJC_NEED_RAW_IDENTIFIER (0); return ';';
-
- case CPP_EOF:
- return 0;
-
- case CPP_NAME:
- return yylexname ();
-
- case CPP_AT_NAME:
- /* This only happens in Objective-C; it must be a keyword. */
- return rid_to_yy [(int) C_RID_CODE (yylval.ttype)];
-
- case CPP_NUMBER:
- case CPP_CHAR:
- case CPP_WCHAR:
- return CONSTANT;
-
- case CPP_STRING:
- case CPP_WSTRING:
- return STRING;
-
- case CPP_OBJC_STRING:
- return OBJC_STRING;
-
- /* These tokens are C++ specific (and will not be generated
- in C mode, but let's be cautious). */
- case CPP_SCOPE:
- case CPP_DEREF_STAR:
- case CPP_DOT_STAR:
- case CPP_MIN_EQ:
- case CPP_MAX_EQ:
- case CPP_MIN:
- case CPP_MAX:
- /* These tokens should not survive translation phase 4. */
- case CPP_HASH:
- case CPP_PASTE:
- error ("syntax error at %qs token", NAME(last_token));
- goto get_next;
-
- default:
- abort ();
- }
- /* NOTREACHED */
-}
-
-static int
-yylex (void)
-{
- int r;
- timevar_push (TV_LEX);
- r = _yylex();
- timevar_pop (TV_LEX);
- return r;
-}
-
-/* Function used when yydebug is set, to print a token in more detail. */
-
-static void
-yyprint (FILE *file, int yychar, YYSTYPE yyl)
-{
- tree t = yyl.ttype;
-
- fprintf (file, " [%s]", NAME(last_token));
-
- switch (yychar)
- {
- case IDENTIFIER:
- case TYPENAME:
- case TYPESPEC:
- case TYPE_QUAL:
- case SCSPEC:
- case STATIC:
- if (IDENTIFIER_POINTER (t))
- fprintf (file, " '%s'", IDENTIFIER_POINTER (t));
- break;
-
- case CONSTANT:
- fprintf (file, " %s", GET_MODE_NAME (TYPE_MODE (TREE_TYPE (t))));
- if (TREE_CODE (t) == INTEGER_CST)
- {
- fputs (" ", file);
- fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
- TREE_INT_CST_HIGH (t), TREE_INT_CST_LOW (t));
- }
- break;
- }
-}
-
-/* This is not the ideal place to put this, but we have to get it out
- of c-lex.c because cp/lex.c has its own version. */
-
-/* Parse the file. */
-void
-c_parse_file (void)
-{
- yyparse ();
-
- if (malloced_yyss)
- {
- free (malloced_yyss);
- free (malloced_yyvs);
- malloced_yyss = 0;
- }
-}
-
-#ifdef __XGETTEXT__
-/* Depending on the version of Bison used to compile this grammar,
- it may issue generic diagnostics spelled "syntax error" or
- "parse error". To prevent this from changing the translation
- template randomly, we list all the variants of this particular
- diagnostic here. Translators: there is no fine distinction
- between diagnostics with "syntax error" in them, and diagnostics
- with "parse error" in them. It's okay to give them both the same
- translation. */
-const char d1[] = N_("syntax error");
-const char d2[] = N_("parse error");
-const char d3[] = N_("syntax error; also virtual memory exhausted");
-const char d4[] = N_("parse error; also virtual memory exhausted");
-const char d5[] = N_("syntax error: cannot back up");
-const char d6[] = N_("parse error: cannot back up");
-#endif
-
-#include "gt-c-parse.h"
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 7b741244bbf..2176e34850b 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -1,5 +1,5 @@
/* Subroutines common to both C and C++ pretty-printers.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -712,50 +712,37 @@ pp_c_function_definition (c_pretty_printer *pp, tree t)
/* Expressions. */
-/* Print out a c-char. */
+/* Print out a c-char. This is called solely for characters which are
+ in the *target* execution character set. We ought to convert them
+ back to the *host* execution character set before printing, but we
+ have no way to do this at present. A decent compromise is to print
+ all characters as if they were in the host execution character set,
+ and not attempt to recover any named escape characters, but render
+ all unprintables as octal escapes. If the host and target character
+ sets are the same, this produces relatively readable output. If they
+ are not the same, strings may appear as gibberish, but that's okay
+ (in fact, it may well be what the reader wants, e.g. if they are looking
+ to see if conversion to the target character set happened correctly).
+
+ A special case: we need to prefix \, ", and ' with backslashes. It is
+ correct to do so for the *host*'s \, ", and ', because the rest of the
+ file appears in the host character set. */
static void
pp_c_char (c_pretty_printer *pp, int c)
{
- switch (c)
+ if (ISPRINT (c))
{
- case TARGET_NEWLINE:
- pp_string (pp, "\\n");
- break;
- case TARGET_TAB:
- pp_string (pp, "\\t");
- break;
- case TARGET_VT:
- pp_string (pp, "\\v");
- break;
- case TARGET_BS:
- pp_string (pp, "\\b");
- break;
- case TARGET_CR:
- pp_string (pp, "\\r");
- break;
- case TARGET_FF:
- pp_string (pp, "\\f");
- break;
- case TARGET_BELL:
- pp_string (pp, "\\a");
- break;
- case '\\':
- pp_string (pp, "\\\\");
- break;
- case '\'':
- pp_string (pp, "\\'");
- break;
- case '\"':
- pp_string (pp, "\\\"");
- break;
- default:
- if (ISPRINT (c))
- pp_character (pp, c);
- else
- pp_scalar (pp, "\\%03o", (unsigned) c);
- break;
+ switch (c)
+ {
+ case '\\': pp_string (pp, "\\\\"); break;
+ case '\'': pp_string (pp, "\\\'"); break;
+ case '\"': pp_string (pp, "\\\""); break;
+ default: pp_character (pp, c);
+ }
}
+ else
+ pp_scalar (pp, "\\%03o", (unsigned) c);
}
/* Print out a STRING literal. */
@@ -785,7 +772,7 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
{
if (tree_int_cst_sgn (i) < 0)
{
- pp_c_char (pp, '-');
+ pp_character (pp, '-');
i = build_int_cst_wide (NULL_TREE,
-TREE_INT_CST_LOW (i),
~TREE_INT_CST_HIGH (i)
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 073f93ec385..d16d6a6892d 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -126,7 +126,7 @@ struct c_expr
/* The value of the expression. */
tree value;
/* Record the original binary operator of an expression, which may
- have been changed by fold, STRING_CST for unparenthesised string
+ have been changed by fold, STRING_CST for unparenthesized string
constants, or ERROR_MARK for other expressions (including
parenthesized expressions). */
enum tree_code original_code;
@@ -205,6 +205,10 @@ struct c_declspecs {
enum c_typespec_keyword typespec_word;
/* The storage class specifier, or csc_none if none. */
enum c_storage_class storage_class;
+ /* Whether any declaration specifiers have been seen at all. */
+ BOOL_BITFIELD declspecs_seen_p : 1;
+ /* Whether a type specifier has been seen. */
+ BOOL_BITFIELD type_seen_p : 1;
/* Whether something other than a storage class specifier or
attribute has been seen. This is used to warn for the
obsolescent usage of storage class specifiers other than at the
@@ -346,7 +350,7 @@ struct language_function GTY(())
};
-/* in c-parse.in */
+/* in c-parser.c */
extern void c_parse_init (void);
/* in c-aux-info.c */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index f04ba73ad75..3a38d22923b 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -375,29 +375,51 @@ composite_type (tree t1, tree t2)
&& TREE_VALUE (p1) != TREE_VALUE (p2))
{
tree memb;
+ tree mv2 = TREE_VALUE (p2);
+ if (mv2 && mv2 != error_mark_node
+ && TREE_CODE (mv2) != ARRAY_TYPE)
+ mv2 = TYPE_MAIN_VARIANT (mv2);
for (memb = TYPE_FIELDS (TREE_VALUE (p1));
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), TREE_VALUE (p2)))
- {
- TREE_VALUE (n) = TREE_VALUE (p2);
- if (pedantic)
- pedwarn ("function types not truly compatible in ISO C");
- goto parm_done;
- }
+ {
+ tree mv3 = TREE_TYPE (memb);
+ if (mv3 && mv3 != error_mark_node
+ && TREE_CODE (mv3) != ARRAY_TYPE)
+ mv3 = TYPE_MAIN_VARIANT (mv3);
+ if (comptypes (mv3, mv2))
+ {
+ TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
+ TREE_VALUE (p2));
+ if (pedantic)
+ pedwarn ("function types not truly compatible in ISO C");
+ goto parm_done;
+ }
+ }
}
if (TREE_CODE (TREE_VALUE (p2)) == UNION_TYPE
&& TREE_VALUE (p2) != TREE_VALUE (p1))
{
tree memb;
+ tree mv1 = TREE_VALUE (p1);
+ if (mv1 && mv1 != error_mark_node
+ && TREE_CODE (mv1) != ARRAY_TYPE)
+ mv1 = TYPE_MAIN_VARIANT (mv1);
for (memb = TYPE_FIELDS (TREE_VALUE (p2));
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), TREE_VALUE (p1)))
- {
- TREE_VALUE (n) = TREE_VALUE (p1);
- if (pedantic)
- pedwarn ("function types not truly compatible in ISO C");
- goto parm_done;
- }
+ {
+ tree mv3 = TREE_TYPE (memb);
+ if (mv3 && mv3 != error_mark_node
+ && TREE_CODE (mv3) != ARRAY_TYPE)
+ mv3 = TYPE_MAIN_VARIANT (mv3);
+ if (comptypes (mv3, mv1))
+ {
+ TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
+ TREE_VALUE (p1));
+ if (pedantic)
+ pedwarn ("function types not truly compatible in ISO C");
+ goto parm_done;
+ }
+ }
}
TREE_VALUE (n) = composite_type (TREE_VALUE (p1), TREE_VALUE (p2));
parm_done: ;
@@ -470,8 +492,8 @@ common_pointer_type (tree t1, tree t2)
This is the type for the result of most arithmetic operations
if the operands have the given two types. */
-tree
-common_type (tree t1, tree t2)
+static tree
+c_common_type (tree t1, tree t2)
{
enum tree_code code1;
enum tree_code code2;
@@ -522,7 +544,7 @@ common_type (tree t1, tree t2)
{
tree subtype1 = code1 == COMPLEX_TYPE ? TREE_TYPE (t1) : t1;
tree subtype2 = code2 == COMPLEX_TYPE ? TREE_TYPE (t2) : t2;
- tree subtype = common_type (subtype1, subtype2);
+ tree subtype = c_common_type (subtype1, subtype2);
if (code1 == COMPLEX_TYPE && TREE_TYPE (t1) == subtype)
return t1;
@@ -592,6 +614,18 @@ common_type (tree t1, tree t2)
return t2;
}
+/* Wrapper around c_common_type that is used by c-common.c. ENUMERAL_TYPEs
+ are allowed here and are converted to their compatible integer types. */
+tree
+common_type (tree t1, tree t2)
+{
+ if (TREE_CODE (t1) == ENUMERAL_TYPE)
+ t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1);
+ if (TREE_CODE (t2) == ENUMERAL_TYPE)
+ t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1);
+ return c_common_type (t1, t2);
+}
+
/* Return 1 if TYPE1 and TYPE2 are compatible types for assignment
or various other operations. Return 2 if they are compatible
but a warning may be needed if you use them together. */
@@ -1110,8 +1144,14 @@ type_lists_compatible_p (tree args1, tree args2)
tree memb;
for (memb = TYPE_FIELDS (a1);
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), a2))
- break;
+ {
+ tree mv3 = TREE_TYPE (memb);
+ if (mv3 && mv3 != error_mark_node
+ && TREE_CODE (mv3) != ARRAY_TYPE)
+ mv3 = TYPE_MAIN_VARIANT (mv3);
+ if (comptypes (mv3, mv2))
+ break;
+ }
if (memb == 0)
return 0;
}
@@ -1125,8 +1165,14 @@ type_lists_compatible_p (tree args1, tree args2)
tree memb;
for (memb = TYPE_FIELDS (a2);
memb; memb = TREE_CHAIN (memb))
- if (comptypes (TREE_TYPE (memb), a1))
- break;
+ {
+ tree mv3 = TREE_TYPE (memb);
+ if (mv3 && mv3 != error_mark_node
+ && TREE_CODE (mv3) != ARRAY_TYPE)
+ mv3 = TYPE_MAIN_VARIANT (mv3);
+ if (comptypes (mv3, mv1))
+ break;
+ }
if (memb == 0)
return 0;
}
@@ -2893,7 +2939,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
&& (code2 == INTEGER_TYPE || code2 == REAL_TYPE
|| code2 == COMPLEX_TYPE))
{
- result_type = common_type (type1, type2);
+ result_type = c_common_type (type1, type2);
/* If -Wsign-compare, warn here if type1 and type2 have
different signedness. We'll promote the signed to unsigned
@@ -7461,7 +7507,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
int none_complex = (code0 != COMPLEX_TYPE && code1 != COMPLEX_TYPE);
if (shorten || common || short_compare)
- result_type = common_type (type0, type1);
+ result_type = c_common_type (type0, type1);
/* For certain operations (which identify themselves by shorten != 0)
if both args were extended from the same smaller type,
@@ -7519,7 +7565,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
&& (unsigned0 || !uns))
result_type
= c_common_signed_or_unsigned_type
- (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
+ (unsigned0, c_common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
else if (TREE_CODE (arg0) == INTEGER_CST
&& (unsigned1 || !uns)
&& (TYPE_PRECISION (TREE_TYPE (arg1))
diff --git a/gcc/cfg.c b/gcc/cfg.c
index bc68faab799..6737003e60c 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -273,43 +273,29 @@ unchecked_make_edge (basic_block src, basic_block dst, int flags)
edge
cached_make_edge (sbitmap *edge_cache, basic_block src, basic_block dst, int flags)
{
- int use_edge_cache;
- edge e;
-
- /* Don't bother with edge cache for ENTRY or EXIT, if there aren't that
- many edges to them, or we didn't allocate memory for it. */
- use_edge_cache = (edge_cache
- && src != ENTRY_BLOCK_PTR && dst != EXIT_BLOCK_PTR);
+ if (edge_cache == NULL
+ || src == ENTRY_BLOCK_PTR
+ || dst == EXIT_BLOCK_PTR)
+ return make_edge (src, dst, flags);
- /* Make sure we don't add duplicate edges. */
- switch (use_edge_cache)
+ /* Does the requested edge already exist? */
+ if (! TEST_BIT (edge_cache[src->index], dst->index))
{
- default:
- /* Quick test for non-existence of the edge. */
- if (! TEST_BIT (edge_cache[src->index], dst->index))
- break;
-
- /* The edge exists; early exit if no work to do. */
- if (flags == 0)
- return NULL;
-
- /* Fall through. */
- case 0:
- e = find_edge (src, dst);
- if (e)
- {
- e->flags |= flags;
- return NULL;
- }
- break;
+ /* The edge does not exist. Create one and update the
+ cache. */
+ SET_BIT (edge_cache[src->index], dst->index);
+ return unchecked_make_edge (src, dst, flags);
}
- e = unchecked_make_edge (src, dst, flags);
-
- if (use_edge_cache)
- SET_BIT (edge_cache[src->index], dst->index);
+ /* At this point, we know that the requested edge exists. Adjust
+ flags if necessary. */
+ if (flags)
+ {
+ edge e = find_edge (src, dst);
+ e->flags |= flags;
+ }
- return e;
+ return NULL;
}
/* Create an edge connecting SRC and DEST with flags FLAGS. Return newly
@@ -318,7 +304,16 @@ cached_make_edge (sbitmap *edge_cache, basic_block src, basic_block dst, int fla
edge
make_edge (basic_block src, basic_block dest, int flags)
{
- return cached_make_edge (NULL, src, dest, flags);
+ edge e = find_edge (src, dest);
+
+ /* Make sure we don't add duplicate edges. */
+ if (e)
+ {
+ e->flags |= flags;
+ return NULL;
+ }
+
+ return unchecked_make_edge (src, dest, flags);
}
/* Create an edge connecting SRC to DEST and set probability by knowing
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index f2322535243..45e9590b3a3 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -308,11 +308,15 @@ find_unreachable_blocks (void)
basic_block b = *--tos;
FOR_EACH_EDGE (e, ei, b->succs)
- if (!(e->dest->flags & BB_REACHABLE))
- {
- *tos++ = e->dest;
- e->dest->flags |= BB_REACHABLE;
- }
+ {
+ basic_block dest = e->dest;
+
+ if (!(dest->flags & BB_REACHABLE))
+ {
+ *tos++ = dest;
+ dest->flags |= BB_REACHABLE;
+ }
+ }
}
free (worklist);
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 7f3e72b9ff5..ac8a941452e 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -482,12 +482,10 @@ find_basic_blocks_1 (rtx f)
/* Find basic blocks of the current function.
- F is the first insn of the function and NREGS the number of register
- numbers in use. */
+ F is the first insn of the function. */
void
-find_basic_blocks (rtx f, int nregs ATTRIBUTE_UNUSED,
- FILE *file ATTRIBUTE_UNUSED)
+find_basic_blocks (rtx f)
{
basic_block bb;
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 3d04a55b2d5..4cf2577309c 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1,6 +1,6 @@
/* Control flow optimization code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -353,7 +353,7 @@ thread_jump (int mode, edge e, basic_block b)
if (INSN_P (insn))
cselib_process_insn (insn);
- nonequal = BITMAP_XMALLOC();
+ nonequal = BITMAP_ALLOC (NULL);
CLEAR_REG_SET (nonequal);
/* Now assume that we've continued by the edge E to B and continue
@@ -401,7 +401,7 @@ thread_jump (int mode, edge e, basic_block b)
EXECUTE_IF_SET_IN_REG_SET (nonequal, 0, i, rsi)
goto failed_exit;
- BITMAP_XFREE (nonequal);
+ BITMAP_FREE (nonequal);
cselib_finish ();
if ((comparison_dominates_p (code1, code2) != 0)
!= (XEXP (SET_SRC (set2), 1) == pc_rtx))
@@ -410,7 +410,7 @@ thread_jump (int mode, edge e, basic_block b)
return FALLTHRU_EDGE (b);
failed_exit:
- BITMAP_XFREE (nonequal);
+ BITMAP_FREE (nonequal);
cselib_finish ();
return NULL;
}
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index e5776c68947..d429c69661e 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1138,7 +1138,7 @@ expand_gimple_basic_block (basic_block bb, FILE * dump_file)
do_pending_stack_adjust ();
- /* Find the the block tail. The last insn is the block is the insn
+ /* Find the block tail. The last insn in the block is the insn
before a barrier and/or table jump insn. */
last = get_last_insn ();
if (BARRIER_P (last))
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 26a9cdee898..40a6de489cc 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -1,5 +1,5 @@
/* Natural loop discovery code for GNU compiler.
- Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -25,6 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "rtl.h"
#include "hard-reg-set.h"
#include "obstack.h"
+#include "function.h"
#include "basic-block.h"
#include "toplev.h"
#include "cfgloop.h"
@@ -510,6 +511,10 @@ establish_preds (struct loop *loop)
struct loop *ploop, *father = loop->outer;
loop->depth = father->depth + 1;
+
+ /* Remember the current loop depth if it is the largest seen so far. */
+ cfun->max_loop_depth = MAX (cfun->max_loop_depth, loop->depth);
+
if (loop->pred)
free (loop->pred);
loop->pred = xmalloc (sizeof (struct loop *) * loop->depth);
@@ -819,6 +824,10 @@ flow_loops_find (struct loops *loops, int flags)
memset (loops, 0, sizeof *loops);
+ /* We are going to recount the maximum loop depth,
+ so throw away the last count. */
+ cfun->max_loop_depth = 0;
+
/* Taking care of this degenerate case makes the rest of
this code simpler. */
if (n_basic_blocks == 0)
@@ -1103,7 +1112,7 @@ get_loop_body_in_bfs_order (const struct loop *loop)
gcc_assert (loop->latch != EXIT_BLOCK_PTR);
blocks = xcalloc (loop->num_nodes, sizeof (basic_block));
- visited = BITMAP_XMALLOC ();
+ visited = BITMAP_ALLOC (NULL);
bb = loop->header;
while (i < loop->num_nodes)
@@ -1135,7 +1144,7 @@ get_loop_body_in_bfs_order (const struct loop *loop)
bb = blocks[vc++];
}
- BITMAP_XFREE (visited);
+ BITMAP_FREE (visited);
return blocks;
}
@@ -1213,7 +1222,7 @@ remove_bb_from_loops (basic_block bb)
loop->pred[i]->num_nodes--;
bb->loop_father = NULL;
bb->loop_depth = 0;
- }
+}
/* Finds nearest common ancestor in loop tree for given loops. */
struct loop *
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index fa0af4ba654..8de76449941 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1470,6 +1470,16 @@ safe_insert_insn_on_edge (rtx insn, edge e)
for (x = insn; x; x = NEXT_INSN (x))
if (INSN_P (x))
note_stores (PATTERN (x), mark_killed_regs, killed);
+
+ /* Mark all hard registers as killed. Register allocator/reload cannot
+ cope with the situation when life range of hard register spans operation
+ for that the appropriate register is needed, i.e. it would be unsafe to
+ extend the life ranges of hard registers. */
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (!fixed_regs[regno]
+ && !REGNO_PTR_FRAME_P (regno))
+ SET_REGNO_REG_SET (killed, regno);
+
bitmap_and_into (killed, e->dest->global_live_at_start);
EXECUTE_IF_SET_IN_REG_SET (killed, 0, regno, rsi)
@@ -1515,6 +1525,7 @@ safe_insert_insn_on_edge (rtx insn, edge e)
insert_insn_on_edge (insn, e);
FREE_REG_SET (killed);
+
return true;
}
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 22b33816caa..3df79a45f37 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1,5 +1,5 @@
/* Callgraph based intraprocedural optimizations.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
@@ -346,6 +346,16 @@ cgraph_finalize_function (tree decl, bool nested)
memset (&node->rtl, 0, sizeof (node->rtl));
node->analyzed = false;
node->local.redefined_extern_inline = true;
+
+ if (!flag_unit_at_a_time)
+ {
+ struct cgraph_node *n;
+
+ for (n = cgraph_nodes; n; n = n->next)
+ if (n->global.inlined_to == node)
+ cgraph_remove_node (n);
+ }
+
while (node->callees)
cgraph_remove_edge (node->callees);
diff --git a/gcc/combine.c b/gcc/combine.c
index ae773b96517..73b12bb4f0c 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1276,7 +1276,7 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ,
/* If the clobber represents an earlyclobber operand, we must not
substitute an expression containing the clobbered register.
- As we do not analyse the constraint strings here, we have to
+ As we do not analyze the constraint strings here, we have to
make the conservative assumption. However, if the register is
a fixed hard reg, the clobber cannot represent any operand;
we leave it up to the machine description to either accept or
diff --git a/gcc/common.opt b/gcc/common.opt
index ea66c108a81..f94643d509e 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -310,6 +310,10 @@ fcse-skip-blocks
Common Report Var(flag_cse_skip_blocks)
When running CSE, follow conditional jumps
+fcx-limited-range
+Common Report Var(flag_cx_limited_range)
+Omit range reduction step when performing complex division
+
fdata-sections
Common Report Var(flag_data_sections)
Place data items into their own section
@@ -916,6 +920,10 @@ ftree-vectorize
Common Report Var(flag_tree_vectorize)
Enable loop vectorization on trees
+ftree-vectorizer-verbose=
+Common RejectNegative Joined
+-ftree-vectorizer-verbose=<number> Set the verbosity level of the vectorizer
+
; -fverbose-asm causes extra commentary information to be produced in
; the generated assembly code (to make it more readable). This option
; is generally only of use to those who actually need to read the
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 51300e25e5b..0bbd958bacc 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1549,6 +1549,11 @@ powerpc-*-beos*)
powerpc-*-darwin*)
tm_file="${tm_file} rs6000/darwin.h"
tmake_file="${tmake_file} rs6000/t-darwin"
+ case ${target} in
+ *-darwin1[0-9]*) tmake_file="${tmake_file} rs6000/t-darwin8" ;;
+ *-darwin[0-7]*) ;;
+ *-darwin[8-9]*) tmake_file="${tmake_file} rs6000/t-darwin8" ;;
+ esac
extra_headers=altivec.h
;;
powerpc*-*-freebsd*)
diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
index ec0af1a6bee..f18b9602146 100644
--- a/gcc/config/alpha/linux-unwind.h
+++ b/gcc/config/alpha/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for Alpha Linux.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file with other programs, and to distribute
+those programs without any restriction coming from the use of this
+file. (The General Public License restrictions do apply in other
+respects; for example, they cover modification of the file, and
+distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 5c040bda1ce..e7811ca8c8e 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -123,6 +123,7 @@ extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
extern bool arm_needs_doubleword_align (enum machine_mode, tree);
extern rtx arm_function_value(tree, tree);
#endif
+extern int arm_apply_result_size (void);
#if defined AOF_ASSEMBLER
extern rtx aof_pic_entry (rtx);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 95fe7fe48f1..f8907befd61 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2283,7 +2283,8 @@ arm_canonicalize_comparison (enum rtx_code code, rtx * op1)
/* Define how to find the value returned by a function. */
-rtx arm_function_value(tree type, tree func ATTRIBUTE_UNUSED)
+rtx
+arm_function_value(tree type, tree func ATTRIBUTE_UNUSED)
{
enum machine_mode mode;
int unsignedp ATTRIBUTE_UNUSED;
@@ -2297,6 +2298,28 @@ rtx arm_function_value(tree type, tree func ATTRIBUTE_UNUSED)
return LIBCALL_VALUE(mode);
}
+/* Determine the amount of memory needed to store the possible return
+ registers of an untyped call. */
+int
+arm_apply_result_size (void)
+{
+ int size = 16;
+
+ if (TARGET_ARM)
+ {
+ if (TARGET_HARD_FLOAT_ABI)
+ {
+ if (TARGET_FPA)
+ size += 12;
+ if (TARGET_MAVERICK)
+ size += 8;
+ }
+ if (TARGET_IWMMXT_ABI)
+ size += 8;
+ }
+
+ return size;
+}
/* Decide whether a type should be returned in memory (true)
or in a register (false). This is called by the macro
@@ -8634,8 +8657,14 @@ int_log2 (HOST_WIDE_INT power)
return shift;
}
-/* Output a .ascii pseudo-op, keeping track of lengths. This is because
- /bin/as is horribly restrictive. */
+/* Output a .ascii pseudo-op, keeping track of lengths. This is
+ because /bin/as is horribly restrictive. The judgement about
+ whether or not each character is 'printable' (and can be output as
+ is) or not (and must be printed with an octal escape) must be made
+ with reference to the *host* character set -- the situation is
+ similar to that discussed in the comments above pp_c_char in
+ c-pretty-print.c. */
+
#define MAX_ASCII_LEN 51
void
@@ -8656,57 +8685,20 @@ output_ascii_pseudo_op (FILE *stream, const unsigned char *p, int len)
len_so_far = 0;
}
- switch (c)
+ if (ISPRINT (c))
{
- case TARGET_TAB:
- fputs ("\\t", stream);
- len_so_far += 2;
- break;
-
- case TARGET_FF:
- fputs ("\\f", stream);
- len_so_far += 2;
- break;
-
- case TARGET_BS:
- fputs ("\\b", stream);
- len_so_far += 2;
- break;
-
- case TARGET_CR:
- fputs ("\\r", stream);
- len_so_far += 2;
- break;
-
- case TARGET_NEWLINE:
- fputs ("\\n", stream);
- c = p [i + 1];
- if ((c >= ' ' && c <= '~')
- || c == TARGET_TAB)
- /* This is a good place for a line break. */
- len_so_far = MAX_ASCII_LEN;
- else
- len_so_far += 2;
- break;
-
- case '\"':
- case '\\':
- putc ('\\', stream);
- len_so_far++;
- /* Drop through. */
-
- default:
- if (c >= ' ' && c <= '~')
+ if (c == '\\' || c == '\"')
{
- putc (c, stream);
+ putc ('\\', stream);
len_so_far++;
}
- else
- {
- fprintf (stream, "\\%03o", c);
- len_so_far += 4;
- }
- break;
+ putc (c, stream);
+ len_so_far++;
+ }
+ else
+ {
+ fprintf (stream, "\\%03o", c);
+ len_so_far += 4;
}
}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 5955d3ced66..2db95373c9f 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1617,6 +1617,10 @@ enum reg_class
|| (TARGET_ARM && ((REGNO) == FIRST_FPA_REGNUM) \
&& TARGET_HARD_FLOAT_ABI && TARGET_FPA))
+/* Amount of memory needed for an untyped call to save all possible return
+ registers. */
+#define APPLY_RESULT_SIZE arm_apply_result_size()
+
/* How large values are returned */
/* A C expression which can inhibit the returning of certain function values
in registers, based on the type of value. */
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 17b88a64a77..f25846675ee 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -30,12 +30,15 @@
;; Register numbers
(define_constants
- [(IP_REGNUM 12) ; Scratch register
+ [(R0_REGNUM 0) ; First CORE register
+ (IP_REGNUM 12) ; Scratch register
(SP_REGNUM 13) ; Stack pointer
(LR_REGNUM 14) ; Return address register
(PC_REGNUM 15) ; Program counter
(CC_REGNUM 24) ; Condition code pseudo register
- (LAST_ARM_REGNUM 15)
+ (LAST_ARM_REGNUM 15) ;
+ (FPA_F0_REGNUM 16) ; FIRST_FPA_REGNUM
+ (FPA_F7_REGNUM 23) ; LAST_FPA_REGNUM
]
)
;; 3rd operand to select_dominance_cc_mode
@@ -5216,6 +5219,16 @@
(set_attr "pool_range" "*,*,*,1020,*,*")]
)
+(define_expand "movxf"
+ [(set (match_operand:XF 0 "general_operand" "")
+ (match_operand:XF 1 "general_operand" ""))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
+ "
+ if (GET_CODE (operands[0]) == MEM)
+ operands[1] = force_reg (XFmode, operands[1]);
+ "
+)
+
;; Vector Moves
(define_expand "movv2si"
[(set (match_operand:V2SI 0 "nonimmediate_operand" "")
@@ -5288,6 +5301,24 @@
(set_attr "predicable" "yes")]
)
+(define_insn "*ldmsi_postinc4_thumb"
+ [(match_parallel 0 "load_multiple_operation"
+ [(set (match_operand:SI 1 "s_register_operand" "=l")
+ (plus:SI (match_operand:SI 2 "s_register_operand" "1")
+ (const_int 16)))
+ (set (match_operand:SI 3 "arm_hard_register_operand" "")
+ (mem:SI (match_dup 2)))
+ (set (match_operand:SI 4 "arm_hard_register_operand" "")
+ (mem:SI (plus:SI (match_dup 2) (const_int 4))))
+ (set (match_operand:SI 5 "arm_hard_register_operand" "")
+ (mem:SI (plus:SI (match_dup 2) (const_int 8))))
+ (set (match_operand:SI 6 "arm_hard_register_operand" "")
+ (mem:SI (plus:SI (match_dup 2) (const_int 12))))])]
+ "TARGET_THUMB && XVECLEN (operands[0], 0) == 5"
+ "ldmia\\t%1!, {%3, %4, %5, %6}"
+ [(set_attr "type" "load4")]
+)
+
(define_insn "*ldmsi_postinc3"
[(match_parallel 0 "load_multiple_operation"
[(set (match_operand:SI 1 "s_register_operand" "=r")
@@ -5409,6 +5440,24 @@
(set_attr "type" "store4")]
)
+(define_insn "*stmsi_postinc4_thumb"
+ [(match_parallel 0 "store_multiple_operation"
+ [(set (match_operand:SI 1 "s_register_operand" "=l")
+ (plus:SI (match_operand:SI 2 "s_register_operand" "1")
+ (const_int 16)))
+ (set (mem:SI (match_dup 2))
+ (match_operand:SI 3 "arm_hard_register_operand" ""))
+ (set (mem:SI (plus:SI (match_dup 2) (const_int 4)))
+ (match_operand:SI 4 "arm_hard_register_operand" ""))
+ (set (mem:SI (plus:SI (match_dup 2) (const_int 8)))
+ (match_operand:SI 5 "arm_hard_register_operand" ""))
+ (set (mem:SI (plus:SI (match_dup 2) (const_int 12)))
+ (match_operand:SI 6 "arm_hard_register_operand" ""))])]
+ "TARGET_THUMB && XVECLEN (operands[0], 0) == 5"
+ "stmia\\t%1!, {%3, %4, %5, %6}"
+ [(set_attr "type" "store4")]
+)
+
(define_insn "*stmsi_postinc3"
[(match_parallel 0 "store_multiple_operation"
[(set (match_operand:SI 1 "s_register_operand" "=r")
@@ -7560,7 +7609,7 @@
)
(define_insn "*call_value_symbol"
- [(set (match_operand 0 "s_register_operand" "")
+ [(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "" ""))
(match_operand:SI 2 "" "")))
(use (match_operand 3 "" ""))
@@ -7589,7 +7638,7 @@
)
(define_insn "*call_value_insn"
- [(set (match_operand 0 "register_operand" "")
+ [(set (match_operand 0 "" "")
(call (mem:SI (match_operand 1 "" ""))
(match_operand 2 "" "")))
(use (match_operand 3 "" ""))
@@ -7617,7 +7666,7 @@
)
(define_expand "sibcall_value"
- [(parallel [(set (match_operand 0 "register_operand" "")
+ [(parallel [(set (match_operand 0 "" "")
(call (match_operand 1 "memory_operand" "")
(match_operand 2 "general_operand" "")))
(return)
@@ -7643,7 +7692,7 @@
)
(define_insn "*sibcall_value_insn"
- [(set (match_operand 0 "s_register_operand" "")
+ [(set (match_operand 0 "" "")
(call (mem:SI (match_operand:SI 1 "" "X"))
(match_operand 2 "" "")))
(return)
@@ -7749,18 +7798,59 @@
(const_int 0))
(match_operand 1 "" "")
(match_operand 2 "" "")])]
- "TARGET_ARM"
+ "TARGET_EITHER"
"
{
int i;
+ rtx par = gen_rtx_PARALLEL (VOIDmode,
+ rtvec_alloc (XVECLEN (operands[2], 0)));
+ rtx addr = gen_reg_rtx (Pmode);
+ rtx mem;
+ int size = 0;
- emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
+ emit_move_insn (addr, XEXP (operands[1], 0));
+ mem = change_address (operands[1], BLKmode, addr);
for (i = 0; i < XVECLEN (operands[2], 0); i++)
{
- rtx set = XVECEXP (operands[2], 0, i);
+ rtx src = SET_SRC (XVECEXP (operands[2], 0, i));
- emit_move_insn (SET_DEST (set), SET_SRC (set));
+ /* Default code only uses r0 as a return value, but we could
+ be using anything up to 4 registers. */
+ if (REGNO (src) == R0_REGNUM)
+ src = gen_rtx_REG (TImode, R0_REGNUM);
+
+ XVECEXP (par, 0, i) = gen_rtx_EXPR_LIST (VOIDmode, src,
+ GEN_INT (size));
+ size += GET_MODE_SIZE (GET_MODE (src));
+ }
+
+ emit_call_insn (GEN_CALL_VALUE (par, operands[0], const0_rtx, NULL,
+ const0_rtx));
+
+ size = 0;
+
+ for (i = 0; i < XVECLEN (par, 0); i++)
+ {
+ HOST_WIDE_INT offset = 0;
+ rtx reg = XEXP (XVECEXP (par, 0, i), 0);
+
+ if (size != 0)
+ emit_move_insn (addr, plus_constant (addr, size));
+
+ mem = change_address (mem, GET_MODE (reg), NULL);
+ if (REGNO (reg) == R0_REGNUM)
+ {
+ /* On thumb we have to use a write-back instruction. */
+ emit_insn (arm_gen_store_multiple (R0_REGNUM, 4, addr, TRUE,
+ TARGET_THUMB ? TRUE : FALSE, mem, &offset));
+ size = TARGET_ARM ? 16 : 0;
+ }
+ else
+ {
+ emit_move_insn (mem, reg);
+ size = GET_MODE_SIZE (GET_MODE (reg));
+ }
}
/* The optimizer does not know that the call sets the function value
@@ -7773,6 +7863,55 @@
}"
)
+(define_expand "untyped_return"
+ [(match_operand:BLK 0 "memory_operand" "")
+ (match_operand 1 "" "")]
+ "TARGET_EITHER"
+ "
+ {
+ int i;
+ rtx addr = gen_reg_rtx (Pmode);
+ rtx mem;
+ int size = 0;
+
+ emit_move_insn (addr, XEXP (operands[0], 0));
+ mem = change_address (operands[0], BLKmode, addr);
+
+ for (i = 0; i < XVECLEN (operands[1], 0); i++)
+ {
+ HOST_WIDE_INT offset = 0;
+ rtx reg = SET_DEST (XVECEXP (operands[1], 0, i));
+
+ if (size != 0)
+ emit_move_insn (addr, plus_constant (addr, size));
+
+ mem = change_address (mem, GET_MODE (reg), NULL);
+ if (REGNO (reg) == R0_REGNUM)
+ {
+ /* On thumb we have to use a write-back instruction. */
+ emit_insn (arm_gen_load_multiple (R0_REGNUM, 4, addr, TRUE,
+ TARGET_THUMB ? TRUE : FALSE, mem, &offset));
+ size = TARGET_ARM ? 16 : 0;
+ }
+ else
+ {
+ emit_move_insn (reg, mem);
+ size = GET_MODE_SIZE (GET_MODE (reg));
+ }
+ }
+
+ /* Emit USE insns before the return. */
+ for (i = 0; i < XVECLEN (operands[1], 0); i++)
+ emit_insn (gen_rtx_USE (VOIDmode,
+ SET_DEST (XVECEXP (operands[1], 0, i))));
+
+ /* Construct the return. */
+ expand_naked_return ();
+
+ DONE;
+ }"
+)
+
;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
;; all of memory. This blocks insns from being moved across this point.
diff --git a/gcc/config/arm/fpa.md b/gcc/config/arm/fpa.md
index 886bba151e3..02d0804b5f0 100644
--- a/gcc/config/arm/fpa.md
+++ b/gcc/config/arm/fpa.md
@@ -1,6 +1,6 @@
;;- Machine description for FPA co-processor for ARM cpus.
;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
;; and Martin Simmons (@harleqn.co.uk).
;; More major hacks by Richard Earnshaw (rearnsha@arm.com).
@@ -581,33 +581,31 @@
(set_attr "neg_pool_range" "*,*,*,*,1008,*,*,1008,*,*,*")]
)
-;; Saving and restoring the floating point registers in the prologue should
-;; be done in XFmode, even though we don't support that for anything else
-;; (Well, strictly it's 'internal representation', but that's effectively
-;; XFmode).
-
+;; We treat XFmode as meaning 'internal format'. It's the right size and we
+;; don't use it for anything else. We only support moving between FPA
+;; registers and moving an FPA register to/from memory.
(define_insn "*movxf_fpa"
- [(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,f,m,f,r,r")
- (match_operand:XF 1 "general_operand" "fG,H,m,f,r,f,r"))]
- "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA && reload_completed"
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,m")
+ (match_operand:XF 1 "general_operand" "f,m,f"))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA
+ && (register_operand (operands[0], XFmode)
+ || register_operand (operands[1], XFmode))"
"*
switch (which_alternative)
{
default:
case 0: return \"mvf%?e\\t%0, %1\";
- case 1: return \"mnf%?e\\t%0, #%N1\";
- case 2: return \"ldf%?e\\t%0, %1\";
- case 3: return \"stf%?e\\t%1, %0\";
- case 4: return output_mov_long_double_fpa_from_arm (operands);
- case 5: return output_mov_long_double_arm_from_fpa (operands);
- case 6: return output_mov_long_double_arm_from_arm (operands);
+ case 1: if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ return \"ldf%?e\\t%0, %1\";
+ return \"lfm%?\\t%0, 1, %1\";
+ case 2: if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ return \"stf%?e\\t%1, %0\";
+ return \"sfm%?\\t%1, 1, %0\";
}
"
- [(set_attr "length" "4,4,4,4,8,8,12")
+ [(set_attr "length" "4,4,4")
(set_attr "predicable" "yes")
- (set_attr "type" "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*")
- (set_attr "pool_range" "*,*,1024,*,*,*,*")
- (set_attr "neg_pool_range" "*,*,1004,*,*,*,*")]
+ (set_attr "type" "ffarith,f_load,f_store")]
)
(define_insn "*cmpsf_fpa"
@@ -749,4 +747,3 @@
(set_attr "type" "ffarith")
(set_attr "conds" "use")]
)
-
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm
index d6bf195ee2d..b8df889d600 100644
--- a/gcc/config/arm/lib1funcs.asm
+++ b/gcc/config/arm/lib1funcs.asm
@@ -1,7 +1,7 @@
@ libgcc routines for ARM cpu.
@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
@@ -223,6 +223,11 @@ SYM (__\name):
.endm
#endif
+.macro FUNC_ALIAS new old
+ .globl SYM (__\new)
+ EQUIV SYM (__\new), SYM (__\old)
+.endm
+
.macro ARM_FUNC_ALIAS new old
.globl SYM (__\new)
EQUIV SYM (__\new), SYM (__\old)
@@ -885,8 +890,8 @@ LSYM(Lover12):
#ifdef L_dvmd_tls
FUNC_START div0
- ARM_FUNC_ALIAS aeabi_idiv0 div0
- ARM_FUNC_ALIAS aeabi_ldiv0 div0
+ FUNC_ALIAS aeabi_idiv0 div0
+ FUNC_ALIAS aeabi_ldiv0 div0
RET
@@ -939,7 +944,7 @@ LSYM(Lover12):
#ifdef L_lshrdi3
FUNC_START lshrdi3
- ARM_FUNC_ALIAS aeabi_llsr lshrdi3
+ FUNC_ALIAS aeabi_llsr lshrdi3
#ifdef __thumb__
lsr al, r2
@@ -971,7 +976,7 @@ LSYM(Lover12):
#ifdef L_ashrdi3
FUNC_START ashrdi3
- ARM_FUNC_ALIAS aeabi_lasr ashrdi3
+ FUNC_ALIAS aeabi_lasr ashrdi3
#ifdef __thumb__
lsr al, r2
@@ -1008,7 +1013,7 @@ LSYM(Lover12):
#ifdef L_ashldi3
FUNC_START ashldi3
- ARM_FUNC_ALIAS aeabi_llsl ashldi3
+ FUNC_ALIAS aeabi_llsl ashldi3
#ifdef __thumb__
lsl ah, r2
diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h
index a736ee1ea10..adad59af8a9 100644
--- a/gcc/config/arm/rtems-elf.h
+++ b/gcc/config/arm/rtems-elf.h
@@ -29,3 +29,11 @@
builtin_define ("__rtems__"); \
builtin_assert ("system=rtems"); \
} while (0)
+
+/*
+ * The default in gcc now is soft-float, but gcc misses it to
+ * pass it to the assembler.
+ */
+#undef SUBTARGET_EXTRA_ASM_SPEC
+#define SUBTARGET_EXTRA_ASM_SPEC "\
+ %{!mhard-float: %{!msoft-float:-mfpu=softfpa}}"
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index fffb7badabe..42dbf0295c7 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -74,7 +74,7 @@ static unsigned int avr_section_type_flags (tree, const char *, int);
static void avr_reorg (void);
static void avr_asm_out_ctor (rtx, int);
static void avr_asm_out_dtor (rtx, int);
-static int default_rtx_costs (rtx, enum rtx_code, enum rtx_code);
+static int avr_operand_rtx_cost (rtx, enum machine_mode, enum rtx_code);
static bool avr_rtx_costs (rtx, int, int, int *);
static int avr_address_cost (rtx);
static bool avr_return_in_memory (tree, tree);
@@ -4820,110 +4820,558 @@ order_regs_for_local_alloc (void)
reg_alloc_order[i] = order[i];
}
-/* Calculate the cost of X code of the expression in which it is contained,
- found in OUTER_CODE */
+
+/* Mutually recursive subroutine of avr_rtx_cost for calculating the
+ cost of an RTX operand given its context. X is the rtx of the
+ operand, MODE is its mode, and OUTER is the rtx_code of this
+ operand's parent operator. */
static int
-default_rtx_costs (rtx X, enum rtx_code code, enum rtx_code outer_code)
+avr_operand_rtx_cost (rtx x, enum machine_mode mode, enum rtx_code outer)
{
- int cost=0;
+ enum rtx_code code = GET_CODE (x);
+ int total;
+
switch (code)
{
- case SYMBOL_REF:
- case LABEL_REF:
- cost = 2 * GET_MODE_SIZE (GET_MODE (X));
- break;
- case MEM:
- if (outer_code != SET)
- cost = 1;
- if (GET_CODE (XEXP (X,0)) == SYMBOL_REF)
- cost += 2 * GET_MODE_SIZE (GET_MODE (X));
- else
- cost += GET_MODE_SIZE (GET_MODE (X));
- break;
+ case REG:
+ case SUBREG:
+ return 0;
+
case CONST_INT:
- cost = 0;
- break;
- case SIGN_EXTEND:
- if (outer_code == SET)
- cost = GET_MODE_SIZE (GET_MODE (X));
- else
- cost = -GET_MODE_SIZE (GET_MODE (X));
- break;
- case ZERO_EXTEND:
- if (outer_code == SET)
- cost = GET_MODE_SIZE (GET_MODE (X));
- else
- cost = -1;
- break;
- case PLUS:
- case MINUS:
- if (outer_code == SET)
- {
- if (X == stack_pointer_rtx)
- cost = -10;
- else if (GET_CODE (XEXP (X,1)) == CONST_INT)
- cost = (INTVAL (XEXP (X,1)) <= 63 ? 1 :
- GET_MODE_SIZE (GET_MODE (X)));
- else
- cost = GET_MODE_SIZE (GET_MODE (X));
- }
- break;
- case COMPARE:
- if (GET_CODE (XEXP (X,1)) == CONST_INT)
- cost = GET_MODE_SIZE (GET_MODE (XEXP (X,0)));
- break;
+ case CONST_DOUBLE:
+ return COSTS_N_INSNS (GET_MODE_SIZE (mode));
+
default:
break;
}
- return cost;
+
+ total = 0;
+ avr_rtx_costs (x, code, outer, &total);
+ return total;
}
+/* The AVR backend's rtx_cost function. X is rtx expression whose cost
+ is to be calculated. Return true if the complete cost has been
+ computed, and false if subexpressions should be scanned. In either
+ case, *TOTAL contains the cost result. */
+
static bool
avr_rtx_costs (rtx x, int code, int outer_code, int *total)
{
- int cst;
+ enum machine_mode mode = GET_MODE (x);
+ HOST_WIDE_INT val;
switch (code)
{
case CONST_INT:
- if (outer_code == PLUS
- || outer_code == IOR
- || outer_code == AND
- || outer_code == MINUS
- || outer_code == SET
- || INTVAL (x) == 0)
+ case CONST_DOUBLE:
+ /* Immediate constants are as cheap as registers. */
+ *total = 0;
+ return true;
+
+ case MEM:
+ case CONST:
+ case LABEL_REF:
+ case SYMBOL_REF:
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
+ return true;
+
+ case NEG:
+ switch (mode)
{
- *total = 2;
- return true;
+ case QImode:
+ case SFmode:
+ *total = COSTS_N_INSNS (1);
+ break;
+
+ case HImode:
+ *total = COSTS_N_INSNS (3);
+ break;
+
+ case SImode:
+ *total = COSTS_N_INSNS (7);
+ break;
+
+ default:
+ return false;
}
- if (outer_code == COMPARE
- && INTVAL (x) >= 0
- && INTVAL (x) <= 255)
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ case ABS:
+ switch (mode)
{
- *total = 2;
- return true;
+ case QImode:
+ case SFmode:
+ *total = COSTS_N_INSNS (1);
+ break;
+
+ default:
+ return false;
}
- /* FALLTHRU */
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
- case CONST:
- case LABEL_REF:
- case SYMBOL_REF:
- case CONST_DOUBLE:
- *total = 4;
+ case NOT:
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
return true;
- default:
- cst = default_rtx_costs (x, code, outer_code);
- if (cst > 0)
+ case ZERO_EXTEND:
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode)
+ - GET_MODE_SIZE (GET_MODE (XEXP (x, 0))));
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ case SIGN_EXTEND:
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode) + 2
+ - GET_MODE_SIZE (GET_MODE (XEXP (x, 0))));
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ case PLUS:
+ switch (mode)
+ {
+ case QImode:
+ *total = COSTS_N_INSNS (1);
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ break;
+
+ case HImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (2);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else if (INTVAL (XEXP (x, 1)) >= -63 && INTVAL (XEXP (x, 1)) <= 63)
+ *total = COSTS_N_INSNS (1);
+ else
+ *total = COSTS_N_INSNS (2);
+ break;
+
+ case SImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (4);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else if (INTVAL (XEXP (x, 1)) >= -63 && INTVAL (XEXP (x, 1)) <= 63)
+ *total = COSTS_N_INSNS (1);
+ else
+ *total = COSTS_N_INSNS (4);
+ break;
+
+ default:
+ return false;
+ }
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ case MINUS:
+ case AND:
+ case IOR:
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ return true;
+
+ case XOR:
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ return true;
+
+ case MULT:
+ switch (mode)
+ {
+ case QImode:
+ if (AVR_ENHANCED)
+ *total = COSTS_N_INSNS (optimize_size ? 3 : 4);
+ else if (optimize_size)
+ *total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1);
+ else
+ return false;
+
+ case HImode:
+ if (AVR_ENHANCED)
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 10);
+ else if (optimize_size)
+ *total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1);
+ else
+ return false;
+
+ default:
+ return false;
+ }
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ return true;
+
+ case DIV:
+ case MOD:
+ case UDIV:
+ case UMOD:
+ if (optimize_size)
+ *total = COSTS_N_INSNS (AVR_MEGA ? 2 : 1);
+ else
+ return false;
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ return true;
+
+ case ASHIFT:
+ switch (mode)
+ {
+ case QImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 4 : 17);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ {
+ val = INTVAL (XEXP (x, 1));
+ if (val == 7)
+ *total = COSTS_N_INSNS (3);
+ else if (val >= 0 && val <= 7)
+ *total = COSTS_N_INSNS (val);
+ else
+ *total = COSTS_N_INSNS (1);
+ }
+ break;
+
+ case HImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 41);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ case 8:
+ *total = COSTS_N_INSNS (2);
+ break;
+ case 9:
+ *total = COSTS_N_INSNS (3);
+ break;
+ case 2:
+ case 3:
+ case 10:
+ case 15:
+ *total = COSTS_N_INSNS (4);
+ break;
+ case 7:
+ case 11:
+ case 12:
+ *total = COSTS_N_INSNS (5);
+ break;
+ case 4:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 8);
+ break;
+ case 6:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 9);
+ break;
+ case 5:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 10);
+ break;
+ default:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 41);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ break;
+
+ case SImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 113);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 24:
+ *total = COSTS_N_INSNS (3);
+ break;
+ case 1:
+ case 8:
+ case 16:
+ *total = COSTS_N_INSNS (4);
+ break;
+ case 31:
+ *total = COSTS_N_INSNS (6);
+ break;
+ case 2:
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 8);
+ break;
+ default:
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 113);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ break;
+
+ default:
+ return false;
+ }
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ case ASHIFTRT:
+ switch (mode)
+ {
+ case QImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 4 : 17);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ {
+ val = INTVAL (XEXP (x, 1));
+ if (val == 6)
+ *total = COSTS_N_INSNS (4);
+ else if (val == 7)
+ *total = COSTS_N_INSNS (2);
+ else if (val >= 0 && val <= 7)
+ *total = COSTS_N_INSNS (val);
+ else
+ *total = COSTS_N_INSNS (1);
+ }
+ break;
+
+ case HImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 41);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ *total = COSTS_N_INSNS (2);
+ break;
+ case 15:
+ *total = COSTS_N_INSNS (3);
+ break;
+ case 2:
+ case 7:
+ case 8:
+ case 9:
+ *total = COSTS_N_INSNS (4);
+ break;
+ case 10:
+ case 14:
+ *total = COSTS_N_INSNS (5);
+ break;
+ case 11:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 6);
+ break;
+ case 12:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 7);
+ break;
+ case 6:
+ case 13:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 8);
+ break;
+ default:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 41);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ break;
+
+ case SImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 113);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ *total = COSTS_N_INSNS (4);
+ break;
+ case 8:
+ case 16:
+ case 24:
+ *total = COSTS_N_INSNS (6);
+ break;
+ case 2:
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 8);
+ break;
+ case 31:
+ *total = COSTS_N_INSNS (AVR_ENHANCED ? 4 : 5);
+ break;
+ default:
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 113);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ break;
+
+ default:
+ return false;
+ }
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ case LSHIFTRT:
+ switch (mode)
+ {
+ case QImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 4 : 17);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ {
+ val = INTVAL (XEXP (x, 1));
+ if (val == 7)
+ *total = COSTS_N_INSNS (3);
+ else if (val >= 0 && val <= 7)
+ *total = COSTS_N_INSNS (val);
+ else
+ *total = COSTS_N_INSNS (1);
+ }
+ break;
+
+ case HImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 41);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ case 8:
+ *total = COSTS_N_INSNS (2);
+ break;
+ case 9:
+ *total = COSTS_N_INSNS (3);
+ break;
+ case 2:
+ case 10:
+ case 15:
+ *total = COSTS_N_INSNS (4);
+ break;
+ case 7:
+ case 11:
+ *total = COSTS_N_INSNS (5);
+ break;
+ case 3:
+ case 12:
+ case 13:
+ case 14:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 6);
+ break;
+ case 4:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 7);
+ break;
+ case 5:
+ case 6:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 9);
+ break;
+ default:
+ *total = COSTS_N_INSNS (optimize_size ? 5 : 41);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ break;
+
+ case SImode:
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ {
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 113);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ else
+ switch (INTVAL (XEXP (x, 1)))
+ {
+ case 0:
+ *total = 0;
+ break;
+ case 1:
+ *total = COSTS_N_INSNS (4);
+ break;
+ case 2:
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 8);
+ break;
+ case 8:
+ case 16:
+ case 24:
+ *total = COSTS_N_INSNS (4);
+ break;
+ case 31:
+ *total = COSTS_N_INSNS (6);
+ break;
+ default:
+ *total = COSTS_N_INSNS (optimize_size ? 7 : 113);
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ }
+ break;
+
+ default:
+ return false;
+ }
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ case COMPARE:
+ switch (GET_MODE (XEXP (x, 0)))
{
- *total = cst;
- return true;
+ case QImode:
+ *total = COSTS_N_INSNS (1);
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ break;
+
+ case HImode:
+ *total = COSTS_N_INSNS (2);
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ else if (INTVAL (XEXP (x, 1)) != 0)
+ *total += COSTS_N_INSNS (1);
+ break;
+
+ case SImode:
+ *total = COSTS_N_INSNS (4);
+ if (GET_CODE (XEXP (x, 1)) != CONST_INT)
+ *total += avr_operand_rtx_cost (XEXP (x, 1), mode, code);
+ else if (INTVAL (XEXP (x, 1)) != 0)
+ *total += COSTS_N_INSNS (3);
+ break;
+
+ default:
+ return false;
}
- else if (cst < 0)
- *total += -cst;
- return false;
+ *total += avr_operand_rtx_cost (XEXP (x, 0), mode, code);
+ return true;
+
+ default:
+ break;
}
+ return false;
}
/* Calculate the cost of a memory address. */
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index e87ce43d5ea..6b54c37626b 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for ATMEL AVR at90s8515, ATmega103/103L, ATmega603/603L microcontrollers.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Denis Chertykov (denisc@overta.ru)
@@ -216,7 +216,7 @@ extern int avr_asm_only_p;
#define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)
-#define MODES_TIEABLE_P(MODE1, MODE2) 0
+#define MODES_TIEABLE_P(MODE1, MODE2) 1
enum reg_class {
NO_REGS,
diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h
index f085e5d741b..a05ddedbbba 100644
--- a/gcc/config/cris/cris-protos.h
+++ b/gcc/config/cris/cris-protos.h
@@ -1,5 +1,5 @@
/* Definitions for GCC. Part of the machine description for CRIS.
- Copyright (C) 1998, 1999, 2000, 2001, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005
Free Software Foundation, Inc.
Contributed by Axis Communications.
@@ -42,9 +42,11 @@ extern int cris_legitimate_pic_operand (rtx);
extern int cris_gotless_symbol (rtx);
extern int cris_got_symbol (rtx);
extern int cris_symbol (rtx);
-extern void cris_output_addr_const (FILE *, rtx);
+extern void cris_asm_output_symbol_ref (FILE *, rtx);
+extern bool cris_output_addr_const_extra (FILE *, rtx);
extern int cris_cfun_uses_pic_table (void);
#endif /* RTX_CODE */
+extern void cris_asm_output_label_ref (FILE *, char *);
extern void cris_target_asm_named_section (const char *, unsigned int, tree);
extern int cris_return_address_on_stack (void);
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index d023d009f64..3599e2dae05 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1,5 +1,5 @@
/* Definitions for GCC. Part of the machine description for CRIS.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
@@ -83,6 +83,10 @@ static char cris_output_insn_is_bound = 0;
just the "sym:GOTOFF" part. */
static int cris_pic_sympart_only = 0;
+/* In code for output macros, this is how we know whether e.g. constant
+ goes in code or in a static initializer. */
+static int in_code = 0;
+
/* Fix for reg_overlap_mentioned_p. */
static int cris_reg_overlap_mentioned_p (rtx, rtx);
@@ -90,6 +94,8 @@ static void cris_print_base (rtx, FILE *);
static void cris_print_index (rtx, FILE *);
+static void cris_output_addr_const (FILE *, rtx);
+
static struct machine_function * cris_init_machine_status (void);
static rtx cris_struct_value_rtx (tree, int);
@@ -650,6 +656,10 @@ cris_fatal (char *arg)
return 0;
}
+/* This variable belongs to cris_target_asm_function_prologue but must
+ be located outside it for GTY reasons. */
+static GTY(()) unsigned long cfa_label_num = 0;
+
/* Textual function prologue. */
static void
@@ -664,7 +674,7 @@ cris_target_asm_function_prologue (FILE *file, HOST_WIDE_INT size)
int framesize;
int faked_args_size = 0;
int cfa_write_offset = 0;
- char *cfa_label = NULL;
+ static char cfa_label[30];
int return_address_on_stack
= regs_ever_live[CRIS_SRP_REGNUM]
|| cfun->machine->needs_return_address_on_stack != 0;
@@ -717,7 +727,8 @@ cris_target_asm_function_prologue (FILE *file, HOST_WIDE_INT size)
cfa_offset += cris_initial_frame_pointer_offset ();
}
- cfa_label = dwarf2out_cfi_label ();
+ ASM_GENERATE_INTERNAL_LABEL (cfa_label, "LCFIT",
+ cfa_label_num++);
dwarf2out_def_cfa (cfa_label, cfa_reg, cfa_offset);
cfa_write_offset = - faked_args_size - 4;
@@ -915,6 +926,9 @@ cris_target_asm_function_prologue (FILE *file, HOST_WIDE_INT size)
reg_names[PIC_OFFSET_TABLE_REGNUM],
reg_names[PIC_OFFSET_TABLE_REGNUM]);
+ if (doing_dwarf)
+ ASM_OUTPUT_LABEL (file, cfa_label);
+
if (TARGET_PDEBUG)
fprintf (file,
"; parm #%d @ %d; frame " HOST_WIDE_INT_PRINT_DEC
@@ -1828,13 +1842,11 @@ cris_notice_update_cc (rtx exp, rtx insn)
if (GET_CODE (exp) == SET)
{
if (cc_status.value1
- && cris_reg_overlap_mentioned_p (SET_DEST (exp),
- cc_status.value1))
+ && modified_in_p (cc_status.value1, insn))
cc_status.value1 = 0;
if (cc_status.value2
- && cris_reg_overlap_mentioned_p (SET_DEST (exp),
- cc_status.value2))
+ && modified_in_p (cc_status.value2, insn))
cc_status.value2 = 0;
}
return;
@@ -1964,14 +1976,12 @@ cris_notice_update_cc (rtx exp, rtx insn)
{
/* There's no CC0 change when clearing a register or
memory. Just check for overlap. */
- if ((cc_status.value1
- && cris_reg_overlap_mentioned_p (SET_DEST (exp),
- cc_status.value1)))
+ if (cc_status.value1
+ && modified_in_p (cc_status.value1, insn))
cc_status.value1 = 0;
- if ((cc_status.value2
- && cris_reg_overlap_mentioned_p (SET_DEST (exp),
- cc_status.value2)))
+ if (cc_status.value2
+ && modified_in_p (cc_status.value2, insn))
cc_status.value2 = 0;
return;
@@ -2003,14 +2013,12 @@ cris_notice_update_cc (rtx exp, rtx insn)
{
/* When SET to MEM, then CC is not changed (except for
overlap). */
- if ((cc_status.value1
- && cris_reg_overlap_mentioned_p (SET_DEST (exp),
- cc_status.value1)))
+ if (cc_status.value1
+ && modified_in_p (cc_status.value1, insn))
cc_status.value1 = 0;
- if ((cc_status.value2
- && cris_reg_overlap_mentioned_p (SET_DEST (exp),
- cc_status.value2)))
+ if (cc_status.value2
+ && modified_in_p (cc_status.value2, insn))
cc_status.value2 = 0;
return;
@@ -2047,31 +2055,11 @@ cris_notice_update_cc (rtx exp, rtx insn)
/* For "move.S rz,[rx=ry+o]" and "clear.S [rx=ry+o]",
say flags are not changed, except for overlap. */
if (cc_status.value1
- && cris_reg_overlap_mentioned_p (XEXP
- (XVECEXP
- (exp, 0, 0), 0),
- cc_status.value1))
- cc_status.value1 = 0;
-
- if (cc_status.value1
- && cris_reg_overlap_mentioned_p (XEXP
- (XVECEXP
- (exp, 0, 1), 0),
- cc_status.value1))
+ && modified_in_p (cc_status.value1, insn))
cc_status.value1 = 0;
if (cc_status.value2
- && cris_reg_overlap_mentioned_p (XEXP
- (XVECEXP
- (exp, 0, 0), 0),
- cc_status.value2))
- cc_status.value2 = 0;
-
- if (cc_status.value2
- && cris_reg_overlap_mentioned_p (XEXP
- (XVECEXP
- (exp, 0, 1), 0),
- cc_status.value2))
+ && modified_in_p (cc_status.value2, insn))
cc_status.value2 = 0;
return;
@@ -2972,178 +2960,120 @@ cris_split_movdx (rtx *operands)
return val;
}
-/* This is in essence a copy of output_addr_const altered to output
- symbolic operands as PIC.
-
- FIXME: Add hooks similar to ASM_OUTPUT_SYMBOL_REF to get this effect in
- the "real" output_addr_const. All we need is one for LABEL_REF (and
- one for CODE_LABEL?). */
+/* Use from within code, from e.g. PRINT_OPERAND and
+ PRINT_OPERAND_ADDRESS. Macros used in output_addr_const need to emit
+ different things depending on whether code operand or constant is
+ emitted. */
-void
+static void
cris_output_addr_const (FILE *file, rtx x)
{
- int is_plt = 0;
-
-restart:
- switch (GET_CODE (x))
- {
- case UNSPEC:
- ASSERT_PLT_UNSPEC (x);
- x = XVECEXP (x, 0, 0);
- is_plt = 1;
-
- /* Fall through. */
- case SYMBOL_REF:
- if (flag_pic)
- {
- const char *origstr = XSTR (x, 0);
- const char *str;
+ in_code++;
+ output_addr_const (file, x);
+ in_code--;
+}
- str = (* targetm.strip_name_encoding) (origstr);
+/* Worker function for ASM_OUTPUT_SYMBOL_REF. */
- if (is_plt)
- {
- if (cris_pic_sympart_only)
- {
- assemble_name (file, str);
- fprintf (file, ":PLTG");
- }
- else
- {
- if (TARGET_AVOID_GOTPLT)
- /* We shouldn't get here. */
- abort ();
+void
+cris_asm_output_symbol_ref (FILE *file, rtx x)
+{
+ if (flag_pic && in_code > 0)
+ {
+ const char *origstr = XSTR (x, 0);
+ const char *str;
- fprintf (file, "[$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
- assemble_name (file, XSTR (x, 0));
+ str = (* targetm.strip_name_encoding) (origstr);
- if (flag_pic == 1)
- fprintf (file, ":GOTPLT16]");
- else
- fprintf (file, ":GOTPLT]");
- }
- }
- else if (cris_gotless_symbol (x))
- {
- if (! cris_pic_sympart_only)
- fprintf (file, "$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
- assemble_name (file, str);
- fprintf (file, ":GOTOFF");
- }
- else if (cris_got_symbol (x))
- {
- if (cris_pic_sympart_only)
- abort ();
- fprintf (file, "[$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
- assemble_name (file, XSTR (x, 0));
+ if (cris_gotless_symbol (x))
+ {
+ if (! cris_pic_sympart_only)
+ fprintf (file, "$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
+ assemble_name (file, str);
+ fprintf (file, ":GOTOFF");
+ }
+ else if (cris_got_symbol (x))
+ {
+ if (cris_pic_sympart_only)
+ abort ();
+ fprintf (file, "[$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
+ assemble_name (file, XSTR (x, 0));
- if (flag_pic == 1)
- fprintf (file, ":GOT16]");
- else
- fprintf (file, ":GOT]");
- }
+ if (flag_pic == 1)
+ fprintf (file, ":GOT16]");
else
- LOSE_AND_RETURN ("unexpected PIC symbol", x);
-
- /* Sanity check. */
- if (! current_function_uses_pic_offset_table)
- output_operand_lossage ("PIC register isn't set up");
+ fprintf (file, ":GOT]");
}
else
- assemble_name (file, XSTR (x, 0));
- break;
+ LOSE_AND_RETURN ("unexpected PIC symbol", x);
- case LABEL_REF:
- /* If we get one of those here, it should be dressed as PIC. Branch
- labels are normally output with the 'l' specifier, which means it
- will go directly to output_asm_label and not end up here. */
- if (GET_CODE (XEXP (x, 0)) != CODE_LABEL
- && (GET_CODE (XEXP (x, 0)) != NOTE
- || NOTE_LINE_NUMBER (XEXP (x, 0)) != NOTE_INSN_DELETED_LABEL))
- fatal_insn ("unexpected address expression", x);
+ /* Sanity check. */
+ if (! current_function_uses_pic_offset_table)
+ output_operand_lossage ("PIC register isn't set up");
+ }
+ else
+ assemble_name (file, XSTR (x, 0));
+}
- if (flag_pic)
- {
- if (cris_gotless_symbol (x))
- {
- if (! cris_pic_sympart_only)
- fprintf (file, "$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
- cris_output_addr_const (file, XEXP (x, 0));
+/* Worker function for ASM_OUTPUT_LABEL_REF. */
- fprintf (file, ":GOTOFF");
- }
- else
- /* Labels are never marked as global symbols. */
- fatal_insn ("unexpected PIC symbol", x);
+void
+cris_asm_output_label_ref (FILE *file, char *buf)
+{
+ if (flag_pic && in_code > 0)
+ {
+ if (! cris_pic_sympart_only)
+ fprintf (file, "$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
+ assemble_name (file, buf);
- /* Sanity check. */
- if (! current_function_uses_pic_offset_table)
- internal_error ("emitting PIC operand, but PIC register isn't set up");
- break;
- }
+ fprintf (file, ":GOTOFF");
- output_addr_const (file, x);
- break;
+ /* Sanity check. */
+ if (! current_function_uses_pic_offset_table)
+ internal_error ("emitting PIC operand, but PIC register isn't set up");
+ }
+ else
+ assemble_name (file, buf);
+}
- case NOTE:
- if (NOTE_LINE_NUMBER (x) != NOTE_INSN_DELETED_LABEL)
- fatal_insn ("unexpected NOTE as addr_const:", x);
- case CODE_LABEL:
- case CONST_INT:
- case CONST_DOUBLE:
- case ZERO_EXTEND:
- case SIGN_EXTEND:
- output_addr_const (file, x);
- break;
+/* Worker function for OUTPUT_ADDR_CONST_EXTRA. */
- case CONST:
- /* This used to output parentheses around the expression,
- but that does not work on the 386 (either ATT or BSD assembler). */
- cris_output_addr_const (file, XEXP (x, 0));
- break;
+bool
+cris_output_addr_const_extra (FILE *file, rtx x)
+{
+ switch (GET_CODE (x))
+ {
+ const char *origstr;
+ const char *str;
- case PLUS:
- /* Some assemblers need integer constants to appear last (e.g. masm). */
- if (GET_CODE (XEXP (x, 0)) == CONST_INT)
+ case UNSPEC:
+ ASSERT_PLT_UNSPEC (x);
+ x = XVECEXP (x, 0, 0);
+ origstr = XSTR (x, 0);
+ str = (* targetm.strip_name_encoding) (origstr);
+ if (cris_pic_sympart_only)
{
- cris_output_addr_const (file, XEXP (x, 1));
- if (INTVAL (XEXP (x, 0)) >= 0)
- fprintf (file, "+");
- output_addr_const (file, XEXP (x, 0));
+ assemble_name (file, str);
+ fprintf (file, ":PLTG");
}
else
{
- cris_output_addr_const (file, XEXP (x, 0));
- if (GET_CODE (XEXP (x, 1)) != CONST_INT
- || INTVAL (XEXP (x, 1)) >= 0)
- fprintf (file, "+");
- cris_output_addr_const (file, XEXP (x, 1));
- }
- break;
+ if (TARGET_AVOID_GOTPLT)
+ /* We shouldn't get here. */
+ abort ();
- case MINUS:
- /* Avoid outputting things like x-x or x+5-x,
- since some assemblers can't handle that. */
- x = simplify_subtraction (x);
- if (GET_CODE (x) != MINUS)
- goto restart;
-
- cris_output_addr_const (file, XEXP (x, 0));
- fprintf (file, "-");
- if ((GET_CODE (XEXP (x, 1)) == CONST_INT
- && INTVAL (XEXP (x, 1)) < 0)
- || GET_CODE (XEXP (x, 1)) != CONST_INT)
- {
- fprintf (file, "%s", targetm.asm_out.open_paren);
- cris_output_addr_const (file, XEXP (x, 1));
- fprintf (file, "%s", targetm.asm_out.close_paren);
+ fprintf (file, "[$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]);
+ assemble_name (file, XSTR (x, 0));
+
+ if (flag_pic == 1)
+ fprintf (file, ":GOTPLT16]");
+ else
+ fprintf (file, ":GOTPLT]");
}
- else
- output_addr_const (file, XEXP (x, 1));
- break;
+ return true;
default:
- LOSE_AND_RETURN ("unexpected address expression", x);
+ return false;
}
}
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 95cefc78fb9..c0435f7e65c 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -1352,6 +1352,9 @@ struct cum_args {int regs;};
/* Node: Data Output */
+#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL) \
+ do { if (!cris_output_addr_const_extra (STREAM, X)) goto FAIL; } while (0)
+
#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) (C) == '@'
/* Node: Uninitialized Data */
@@ -1422,6 +1425,12 @@ struct cum_args {int regs;};
#define SUPPORTS_WEAK 1
+#define ASM_OUTPUT_SYMBOL_REF(STREAM, SYM) \
+ cris_asm_output_symbol_ref (STREAM, SYM)
+
+#define ASM_OUTPUT_LABEL_REF(STREAM, BUF) \
+ cris_asm_output_label_ref (STREAM, BUF)
+
/* Remove any previous definition (elfos.h). */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index d4e4a5a5eed..03ca50aedb7 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -2470,7 +2470,7 @@
(define_insn "umulhisi3"
[(set (match_operand:SI 0 "register_operand" "=r")
(mult:SI
- (zero_extend:SI (match_operand:HI 1 "register_operand" "0"))
+ (zero_extend:SI (match_operand:HI 1 "register_operand" "%0"))
(zero_extend:SI (match_operand:HI 2 "register_operand" "r"))))]
"TARGET_HAS_MUL_INSNS"
"%!mulu.w %2,%0"
@@ -2484,7 +2484,7 @@
(define_insn "umulqihi3"
[(set (match_operand:HI 0 "register_operand" "=r")
(mult:HI
- (zero_extend:HI (match_operand:QI 1 "register_operand" "0"))
+ (zero_extend:HI (match_operand:QI 1 "register_operand" "%0"))
(zero_extend:HI (match_operand:QI 2 "register_operand" "r"))))]
"TARGET_HAS_MUL_INSNS"
"%!mulu.b %2,%0"
@@ -2503,7 +2503,7 @@
(define_insn "mulsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
- (mult:SI (match_operand:SI 1 "register_operand" "0")
+ (mult:SI (match_operand:SI 1 "register_operand" "%0")
(match_operand:SI 2 "register_operand" "r")))]
"TARGET_HAS_MUL_INSNS"
"%!muls.d %2,%0"
@@ -2521,7 +2521,7 @@
(define_insn "mulqihi3"
[(set (match_operand:HI 0 "register_operand" "=r")
(mult:HI
- (sign_extend:HI (match_operand:QI 1 "register_operand" "0"))
+ (sign_extend:HI (match_operand:QI 1 "register_operand" "%0"))
(sign_extend:HI (match_operand:QI 2 "register_operand" "r"))))]
"TARGET_HAS_MUL_INSNS"
"%!muls.b %2,%0"
@@ -2534,7 +2534,7 @@
(define_insn "mulhisi3"
[(set (match_operand:SI 0 "register_operand" "=r")
(mult:SI
- (sign_extend:SI (match_operand:HI 1 "register_operand" "0"))
+ (sign_extend:SI (match_operand:HI 1 "register_operand" "%0"))
(sign_extend:SI (match_operand:HI 2 "register_operand" "r"))))]
"TARGET_HAS_MUL_INSNS"
"%!muls.w %2,%0"
@@ -2554,7 +2554,7 @@
(define_insn "mulsidi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI
- (sign_extend:DI (match_operand:SI 1 "register_operand" "0"))
+ (sign_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(sign_extend:DI (match_operand:SI 2 "register_operand" "r"))))]
"TARGET_HAS_MUL_INSNS"
"%!muls.d %2,%M0\;move $mof,%H0")
@@ -2562,7 +2562,7 @@
(define_insn "umulsidi3"
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI
- (zero_extend:DI (match_operand:SI 1 "register_operand" "0"))
+ (zero_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(zero_extend:DI (match_operand:SI 2 "register_operand" "r"))))]
"TARGET_HAS_MUL_INSNS"
"%!mulu.d %2,%M0\;move $mof,%H0")
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index de2f6e3e0b6..6a547384aae 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1156,7 +1156,9 @@ void
machopic_select_rtx_section (enum machine_mode mode, rtx x,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
- if (GET_MODE_SIZE (mode) == 8)
+ if (GET_MODE_SIZE (mode) == 8
+ && (GET_CODE (x) == CONST_INT
+ || GET_CODE (x) == CONST_DOUBLE))
literal8_section ();
else if (GET_MODE_SIZE (mode) == 4
&& (GET_CODE (x) == CONST_INT
diff --git a/gcc/config/darwin7.h b/gcc/config/darwin7.h
index f9ee65f9823..d54ca88f47b 100644
--- a/gcc/config/darwin7.h
+++ b/gcc/config/darwin7.h
@@ -1,5 +1,5 @@
/* Target definitions for Darwin 7.x (Mac OS X) systems.
- Copyright (C) 2004
+ Copyright (C) 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 9eed0d13fe3..6e41bb26936 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -212,7 +212,15 @@ Boston, MA 02111-1307, USA. */
fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
#endif
-#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+/* Don't use weak for entities with vague linkage when HAVE_GAS_COMDAT_GROUP
+ is true. */
+#define MAKE_DECL_ONE_ONLY(DECL) \
+ do \
+ { \
+ if (!HAVE_GAS_COMDAT_GROUP) \
+ DECL_WEAK(DECL) = 1; \
+ } \
+ while (0)
/* Switch into a generic section. */
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 833ccee686a..25b2f7610d9 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1876,7 +1876,7 @@ frv_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
memset (&frv_ifcvt.tmp_reg, 0, sizeof (frv_ifcvt.tmp_reg));
/* Release the bitmap of created insns. */
- BITMAP_XFREE (frv_ifcvt.scratch_insns_bitmap);
+ BITMAP_FREE (frv_ifcvt.scratch_insns_bitmap);
}
@@ -3481,8 +3481,7 @@ gen_inlined_tls_plt (rtx addr)
}
retval = gen_reg_rtx (Pmode);
- emit_insn (gen_tls_indirect_call (retval, addr, dest, gen_reg_rtx (Pmode),
- picreg));
+ emit_insn (gen_tls_indirect_call (retval, addr, dest, picreg));
return retval;
}
@@ -7723,7 +7722,7 @@ frv_ifcvt_modify_final (ce_if_block_t *ce_info ATTRIBUTE_UNUSED)
{
rtx insn = emit_insn_before (frv_ifcvt.scratch_regs[i], existing_insn);
if (! frv_ifcvt.scratch_insns_bitmap)
- frv_ifcvt.scratch_insns_bitmap = BITMAP_XMALLOC ();
+ frv_ifcvt.scratch_insns_bitmap = BITMAP_ALLOC (NULL);
bitmap_set_bit (frv_ifcvt.scratch_insns_bitmap, INSN_UID (insn));
frv_ifcvt.scratch_regs[i] = NULL_RTX;
}
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index 94520ef46a9..4515c0b44dd 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -8203,25 +8203,42 @@
[(set_attr "length" "4")
(set_attr "type" "load_or_call")])
-;; Reads GR8 and GR9.
-;; Clobbers GR8.
-;; Modifies GR9.
-(define_insn "tls_indirect_call"
- [(set (match_operand:SI 0 "register_operand" "=D09")
+;; We have to expand this like a libcall (it sort of actually is)
+;; because otherwise sched may move, for example, an insn that sets up
+;; GR8 for a subsequence call before the *tls_indirect_call insn, and
+;; then reload won't be able to fix things up.
+(define_expand "tls_indirect_call"
+ [(set (reg:DI GR8_REG)
+ (match_operand:DI 2 "register_operand" ""))
+ (parallel
+ [(set (reg:SI GR9_REG)
+ (unspec:SI
+ [(match_operand:SI 1 "symbolic_operand" "")
+ (reg:DI GR8_REG)]
+ UNSPEC_TLS_INDIRECT_CALL))
+ (clobber (reg:SI GR8_REG))
+ (clobber (reg:SI LRREG))
+ (use (match_operand:SI 3 "register_operand" ""))])
+ (set (match_operand:SI 0 "register_operand" "")
+ (reg:SI GR9_REG))]
+ "HAVE_AS_TLS")
+
+(define_insn "*tls_indirect_call"
+ [(set (reg:SI GR9_REG)
(unspec:SI
- [(match_operand:SI 1 "symbolic_operand" "")
- (match_operand:DI 2 "register_operand" "D89")]
+ [(match_operand:SI 0 "symbolic_operand" "")
+ (reg:DI GR8_REG)]
UNSPEC_TLS_INDIRECT_CALL))
- (clobber (match_operand:SI 3 "register_operand" "=D08"))
+ (clobber (reg:SI GR8_REG))
(clobber (reg:SI LRREG))
;; If there was a way to represent the fact that we don't need GR9
;; or GR15 to be set before this instruction (it could be in
;; parallel), we could use it here. This change wouldn't apply to
;; call_gettlsoff, thought, since the linker may turn the latter
;; into ldi @(gr15,offset),gr9.
- (use (match_operand:SI 4 "register_operand" "D15"))]
+ (use (match_operand:SI 1 "register_operand" "D15"))]
"HAVE_AS_TLS"
- "calll #gettlsoff(%a1)@(%2,gr0)"
+ "calll #gettlsoff(%a0)@(gr8,gr0)"
[(set_attr "length" "4")
(set_attr "type" "jumpl")])
diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c
index 717f96cdc66..0b17c6a19cd 100644
--- a/gcc/config/host-linux.c
+++ b/gcc/config/host-linux.c
@@ -1,5 +1,5 @@
/* Linux host-specific hook definitions.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -61,6 +61,9 @@
#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
#define HOST_HOOKS_GT_PCH_GET_ADDRESS linux_gt_pch_get_address
+#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
+#define HOST_HOOKS_GT_PCH_USE_ADDRESS linux_gt_pch_use_address
+
/* For various ports, try to guess a fixed spot in the vm space
that's probably free. */
#if defined(__alpha)
@@ -143,5 +146,68 @@ linux_gt_pch_get_address (size_t size, int fd)
return addr;
}
+/* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
+ mapping the data at BASE, -1 if we couldn't.
+
+ It's not possibly to reliably mmap a file using MAP_PRIVATE to
+ a specific START address on either hpux or linux. First we see
+ if mmap with MAP_PRIVATE works. If it does, we are off to the
+ races. If it doesn't, we try an anonymous private mmap since the
+ kernel is more likely to honor the BASE address in anonymous maps.
+ We then copy the data to the anonymous private map. This assumes
+ of course that we don't need to change the data in the PCH file
+ after it is created.
+
+ This approach obviously causes a performance penalty but there is
+ little else we can do given the current PCH implementation. */
+
+static int
+linux_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
+{
+ void *addr;
+
+ /* We're called with size == 0 if we're not planning to load a PCH
+ file at all. This allows the hook to free any static space that
+ we might have allocated at link time. */
+ if (size == 0)
+ return -1;
+
+ /* Try to map the file with MAP_PRIVATE. */
+ addr = mmap (base, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, offset);
+
+ if (addr == base)
+ return 1;
+
+ if (addr != (void *) MAP_FAILED)
+ munmap (addr, size);
+
+ /* Try to make an anonymous private mmap at the desired location. */
+ addr = mmap (base, size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+
+ if (addr != base)
+ {
+ if (addr != (void *) MAP_FAILED)
+ munmap (addr, size);
+ return -1;
+ }
+
+ if (lseek (fd, offset, SEEK_SET) == (off_t)-1)
+ return -1;
+
+ while (size)
+ {
+ ssize_t nbytes;
+
+ nbytes = read (fd, base, MIN (size, SSIZE_MAX));
+ if (nbytes <= 0)
+ return -1;
+ base = (char *) base + nbytes;
+ size -= nbytes;
+ }
+
+ return 1;
+}
+
const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3fdf441291d..d9a4ce599ed 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -16176,6 +16176,71 @@
emit_move_insn (operands[2], temp);
emit_move_insn (operands[9], CONST1_RTX (XFmode)); /* fld1 */
})
+
+(define_expand "ldexpdf3"
+ [(set (match_dup 3)
+ (float_extend:XF (match_operand:DF 1 "register_operand" "")))
+ (set (match_dup 4)
+ (float:XF (match_operand:SI 2 "register_operand" "")))
+ (parallel [(set (match_dup 5)
+ (unspec:XF [(match_dup 3) (match_dup 4)]
+ UNSPEC_FSCALE_FRACT))
+ (set (match_dup 6)
+ (unspec:XF [(match_dup 3) (match_dup 4)]
+ UNSPEC_FSCALE_EXP))])
+ (set (match_operand:DF 0 "register_operand" "")
+ (float_truncate:DF (match_dup 5)))]
+ "TARGET_USE_FANCY_MATH_387
+ && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387)
+ && flag_unsafe_math_optimizations"
+{
+ int i;
+
+ for (i=3; i<7; i++)
+ operands[i] = gen_reg_rtx (XFmode);
+})
+
+(define_expand "ldexpsf3"
+ [(set (match_dup 3)
+ (float_extend:XF (match_operand:SF 1 "register_operand" "")))
+ (set (match_dup 4)
+ (float:XF (match_operand:SI 2 "register_operand" "")))
+ (parallel [(set (match_dup 5)
+ (unspec:XF [(match_dup 3) (match_dup 4)]
+ UNSPEC_FSCALE_FRACT))
+ (set (match_dup 6)
+ (unspec:XF [(match_dup 3) (match_dup 4)]
+ UNSPEC_FSCALE_EXP))])
+ (set (match_operand:SF 0 "register_operand" "")
+ (float_truncate:SF (match_dup 5)))]
+ "TARGET_USE_FANCY_MATH_387
+ && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)
+ && flag_unsafe_math_optimizations"
+{
+ int i;
+
+ for (i=3; i<7; i++)
+ operands[i] = gen_reg_rtx (XFmode);
+})
+
+(define_expand "ldexpxf3"
+ [(set (match_dup 3)
+ (float:XF (match_operand:SI 2 "register_operand" "")))
+ (parallel [(set (match_operand:XF 0 " register_operand" "")
+ (unspec:XF [(match_operand:XF 1 "register_operand" "")
+ (match_dup 3)]
+ UNSPEC_FSCALE_FRACT))
+ (set (match_dup 4)
+ (unspec:XF [(match_dup 1) (match_dup 3)]
+ UNSPEC_FSCALE_EXP))])]
+ "TARGET_USE_FANCY_MATH_387
+ && flag_unsafe_math_optimizations"
+{
+ int i;
+
+ for (i=3; i<5; i++)
+ operands[i] = gen_reg_rtx (XFmode);
+})
(define_insn "frndintxf2"
diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
index c746f4fcd6b..0957a690822 100644
--- a/gcc/config/i386/linux-unwind.h
+++ b/gcc/config/i386/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for AMD x86-64 and x86.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file with other programs, and to distribute
+those programs without any restriction coming from the use of this
+file. (The General Public License restrictions do apply in other
+respects; for example, they cover modification of the file, and
+distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
diff --git a/gcc/config/i386/t-nwld b/gcc/config/i386/t-nwld
index 25355632c00..ec12d12251c 100644
--- a/gcc/config/i386/t-nwld
+++ b/gcc/config/i386/t-nwld
@@ -29,7 +29,6 @@ s-crt0: $(srcdir)/unwind-dw2-fde.h
# Build a shared libgcc library for NetWare.
SHLIB_EXT = .nlm
-SHLIB_SONAME = @shlib_so_name@.nlm
SHLIB_NAME = @shlib_base_name@.nlm
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_DEF = $(srcdir)/config/i386/netware-libgcc.def
@@ -37,25 +36,25 @@ SHLIB_MAP = $(srcdir)/config/i386/netware-libgcc.exp
SHLIB_SRC = $(srcdir)/config/i386/netware-libgcc.c
SHLIB_LINK = set -e; \
- cat $(SHLIB_DEF) >@shlib_so_name@.def; \
- echo "name $(SHLIB_NAME)" >>@shlib_so_name@.def; \
- echo "version $(gcc_version)" | sed "s!\.!,!g" >>@shlib_so_name@.def; \
+ cat $(SHLIB_DEF) >@shlib_base_name@.def; \
+ echo "name $(SHLIB_NAME)" >>@shlib_base_name@.def; \
+ echo "version $(gcc_version)" | sed "s!\.!,!g" >>@shlib_base_name@.def; \
touch libgcc/build; \
- echo "build $$$$(($$$$(<libgcc/build)+0))" >>@shlib_so_name@.def; \
- echo "export @$(SHLIB_MAP)" >>@shlib_so_name@.def; \
- if mpkxdc -n -p @shlib_so_name@.xdc; \
- then echo "xdcdata @shlib_so_name@.xdc" >>@shlib_so_name@.def; \
+ echo "build $$$$(($$$$(<libgcc/build)+0))" >>@shlib_base_name@.def; \
+ echo "export @$(SHLIB_MAP)" >>@shlib_base_name@.def; \
+ if mpkxdc -n -p @shlib_base_name@.xdc; \
+ then echo "xdcdata @shlib_base_name@.xdc" >>@shlib_base_name@.def; \
else echo "WARNING: $(SHLIB_NAME) built without XDC data will not work well." 1>&2; \
fi; \
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -o $(SHLIB_NAME) \
$(SHLIB_SRC) -posix -static-libgcc -lnetware \
- -Wl,--Map,--map-info,full,--strip-all,--def-file,@shlib_so_name@.def; \
- rm -f @shlib_so_name@.imp; $(LN_S) $(SHLIB_MAP) @shlib_so_name@.imp; \
+ -Wl,--Map,--map-info,full,--strip-all,--def-file,@shlib_base_name@.def; \
+ rm -f @shlib_base_name@.imp; $(LN_S) $(SHLIB_MAP) @shlib_base_name@.imp; \
echo $$$$(($$$$(<libgcc/build)+1)) >libgcc/build
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(SHELL) $(srcdir)/mkinstalldirs $$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $$(INSTALL_DATA) $(SHLIB_NAME) $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
- $$(INSTALL_DATA) @shlib_so_name@.imp $$(DESTDIR)$$(libsubdir)/
+ $$(INSTALL_DATA) $(SHLIB_NAME) $$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME); \
+ $$(INSTALL_DATA) @shlib_base_name@.imp $$(DESTDIR)$$(libsubdir)/
diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h
index 9ae420f84fc..5b4f0470f08 100644
--- a/gcc/config/ia64/hpux.h
+++ b/gcc/config/ia64/hpux.h
@@ -30,6 +30,12 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_HPUX
#define TARGET_HPUX 1
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "unsigned int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
/* Target OS builtins. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
@@ -85,13 +91,6 @@ do { \
%{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
%{!symbolic:-lc}}"
-#ifndef CROSS_COMPILE
-#undef LIBGCC_SPEC
-#define LIBGCC_SPEC \
- "%{shared-libgcc:%{!mlp64:-lgcc_s}%{mlp64:-lgcc_s_hpux64} -lgcc} \
- %{!shared-libgcc:-lgcc}"
-#endif
-
#undef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES \
{ "ilp32", MASK_ILP32, "Generate ILP32 code" }, \
@@ -203,3 +202,11 @@ do { \
#define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
+
+/* Put all *xf routines in libgcc, regardless of long double size. */
+#undef LIBGCC2_HAS_XF_MODE
+#define LIBGCC2_HAS_XF_MODE 1
+
+/* Put all *tf routines in libgcc, regardless of long double size. */
+#undef LIBGCC2_HAS_TF_MODE
+#define LIBGCC2_HAS_TF_MODE 1
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 4502a4600fb..d67bb1f9620 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -5684,147 +5684,6 @@ emit_all_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED)
}
-static int errata_find_address_regs (rtx *, void *);
-static void errata_emit_nops (rtx);
-static void fixup_errata (void);
-
-/* This structure is used to track some details about the previous insns
- groups so we can determine if it may be necessary to insert NOPs to
- workaround hardware errata. */
-static struct group
-{
- HARD_REG_SET p_reg_set;
- HARD_REG_SET gr_reg_conditionally_set;
-} last_group[2];
-
-/* Index into the last_group array. */
-static int group_idx;
-
-/* Called through for_each_rtx; determines if a hard register that was
- conditionally set in the previous group is used as an address register.
- It ensures that for_each_rtx returns 1 in that case. */
-static int
-errata_find_address_regs (rtx *xp, void *data ATTRIBUTE_UNUSED)
-{
- rtx x = *xp;
- if (GET_CODE (x) != MEM)
- return 0;
- x = XEXP (x, 0);
- if (GET_CODE (x) == POST_MODIFY)
- x = XEXP (x, 0);
- if (GET_CODE (x) == REG)
- {
- struct group *prev_group = last_group + (group_idx ^ 1);
- if (TEST_HARD_REG_BIT (prev_group->gr_reg_conditionally_set,
- REGNO (x)))
- return 1;
- return -1;
- }
- return 0;
-}
-
-/* Called for each insn; this function keeps track of the state in
- last_group and emits additional NOPs if necessary to work around
- an Itanium A/B step erratum. */
-static void
-errata_emit_nops (rtx insn)
-{
- struct group *this_group = last_group + group_idx;
- struct group *prev_group = last_group + (group_idx ^ 1);
- rtx pat = PATTERN (insn);
- rtx cond = GET_CODE (pat) == COND_EXEC ? COND_EXEC_TEST (pat) : 0;
- rtx real_pat = cond ? COND_EXEC_CODE (pat) : pat;
- enum attr_type type;
- rtx set = real_pat;
-
- if (GET_CODE (real_pat) == USE
- || GET_CODE (real_pat) == CLOBBER
- || GET_CODE (real_pat) == ASM_INPUT
- || GET_CODE (real_pat) == ADDR_VEC
- || GET_CODE (real_pat) == ADDR_DIFF_VEC
- || asm_noperands (PATTERN (insn)) >= 0)
- return;
-
- /* single_set doesn't work for COND_EXEC insns, so we have to duplicate
- parts of it. */
-
- if (GET_CODE (set) == PARALLEL)
- {
- int i;
- set = XVECEXP (real_pat, 0, 0);
- for (i = 1; i < XVECLEN (real_pat, 0); i++)
- if (GET_CODE (XVECEXP (real_pat, 0, i)) != USE
- && GET_CODE (XVECEXP (real_pat, 0, i)) != CLOBBER)
- {
- set = 0;
- break;
- }
- }
-
- if (set && GET_CODE (set) != SET)
- set = 0;
-
- type = get_attr_type (insn);
-
- if (type == TYPE_F
- && set && REG_P (SET_DEST (set)) && PR_REGNO_P (REGNO (SET_DEST (set))))
- SET_HARD_REG_BIT (this_group->p_reg_set, REGNO (SET_DEST (set)));
-
- if ((type == TYPE_M || type == TYPE_A) && cond && set
- && REG_P (SET_DEST (set))
- && GET_CODE (SET_SRC (set)) != PLUS
- && GET_CODE (SET_SRC (set)) != MINUS
- && (GET_CODE (SET_SRC (set)) != ASHIFT
- || !shladd_operand (XEXP (SET_SRC (set), 1), VOIDmode))
- && (GET_CODE (SET_SRC (set)) != MEM
- || GET_CODE (XEXP (SET_SRC (set), 0)) != POST_MODIFY)
- && GENERAL_REGNO_P (REGNO (SET_DEST (set))))
- {
- if (!COMPARISON_P (cond)
- || !REG_P (XEXP (cond, 0)))
- abort ();
-
- if (TEST_HARD_REG_BIT (prev_group->p_reg_set, REGNO (XEXP (cond, 0))))
- SET_HARD_REG_BIT (this_group->gr_reg_conditionally_set, REGNO (SET_DEST (set)));
- }
- if (for_each_rtx (&real_pat, errata_find_address_regs, NULL))
- {
- emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn);
- emit_insn_before (gen_nop (), insn);
- emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn);
- group_idx = 0;
- memset (last_group, 0, sizeof last_group);
- }
-}
-
-/* Emit extra nops if they are required to work around hardware errata. */
-
-static void
-fixup_errata (void)
-{
- rtx insn;
-
- if (! TARGET_B_STEP)
- return;
-
- group_idx = 0;
- memset (last_group, 0, sizeof last_group);
-
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- {
- if (!INSN_P (insn))
- continue;
-
- if (ia64_safe_type (insn) == TYPE_S)
- {
- group_idx ^= 1;
- memset (last_group + group_idx, 0, sizeof last_group[group_idx]);
- }
- else
- errata_emit_nops (insn);
- }
-}
-
/* Instruction scheduling support. */
@@ -7583,7 +7442,6 @@ ia64_reorg (void)
}
}
- fixup_errata ();
emit_predicate_relation_info ();
if (ia64_flag_var_tracking)
@@ -7726,7 +7584,8 @@ process_epilogue (void)
if (!last_block)
{
- fprintf (asm_out_file, "\t.label_state 1\n");
+ fprintf (asm_out_file, "\t.label_state %d\n",
+ ++cfun->machine->state_num);
need_copy_state = true;
}
@@ -7974,7 +7833,8 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn)
if (need_copy_state)
{
fprintf (asm_out_file, "\t.body\n");
- fprintf (asm_out_file, "\t.copy_state 1\n");
+ fprintf (asm_out_file, "\t.copy_state %d\n",
+ cfun->machine->state_num);
need_copy_state = false;
}
}
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 255f9f29fdf..a81cd2c9fe2 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -75,8 +75,6 @@ extern int target_flags;
#define MASK_ILP32 0x00000020 /* Generate ILP32 code. */
-#define MASK_B_STEP 0x00000040 /* Emit code for Itanium B step. */
-
#define MASK_REG_NAMES 0x00000080 /* Use in/loc/out register names. */
#define MASK_NO_SDATA 0x00000100 /* Disable sdata/scommon/sbss. */
@@ -113,8 +111,6 @@ extern int target_flags;
#define TARGET_ILP32 (target_flags & MASK_ILP32)
-#define TARGET_B_STEP (target_flags & MASK_B_STEP)
-
#define TARGET_REG_NAMES (target_flags & MASK_REG_NAMES)
#define TARGET_NO_SDATA (target_flags & MASK_NO_SDATA)
@@ -196,8 +192,6 @@ extern int ia64_tls_size;
N_("Emit stop bits before and after volatile extended asms") }, \
{ "no-volatile-asm-stop", -MASK_VOL_ASM_STOP, \
N_("Don't emit stop bits before and after volatile extended asms") }, \
- { "b-step", MASK_B_STEP, \
- N_("Emit code for Itanium (TM) processor B step")}, \
{ "register-names", MASK_REG_NAMES, \
N_("Use in/loc/out register names")}, \
{ "no-sdata", MASK_NO_SDATA, \
@@ -2199,6 +2193,9 @@ struct machine_function GTY(())
/* The number of varargs registers to save. */
int n_varargs;
+
+ /* The number of the next unwind state to copy. */
+ int state_num;
};
diff --git a/gcc/config/ia64/lib1funcs.asm b/gcc/config/ia64/lib1funcs.asm
index e3d348ba722..68ee421ff65 100644
--- a/gcc/config/ia64/lib1funcs.asm
+++ b/gcc/config/ia64/lib1funcs.asm
@@ -706,9 +706,8 @@ __ia64_trampoline:
.endp __ia64_trampoline
#endif
-#ifdef L__compat
// Thunks for backward compatibility.
-
+#ifdef L_fixtfdi
.text
.align 16
.global __fixtfti
@@ -719,7 +718,8 @@ __fixtfti:
;;
}
.endp __fixtfti
-
+#endif
+#ifdef L_fixunstfdi
.align 16
.global __fixunstfti
.proc __fixunstfti
@@ -729,7 +729,8 @@ __fixunstfti:
;;
}
.endp __fixunstfti
-
+#endif
+#if L_floatditf
.align 16
.global __floattitf
.proc __floattitf
@@ -739,5 +740,4 @@ __floattitf:
;;
}
.endp __floattitf
-
#endif
diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
index 801597ce311..2b2808524a5 100644
--- a/gcc/config/ia64/linux-unwind.h
+++ b/gcc/config/ia64/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for IA64 Linux.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@
by the Free Software Foundation; either version 2, or (at your
option) any later version.
+ In addition to the permissions in the GNU General Public License,
+ the Free Software Foundation gives you unlimited permission to link
+ the compiled version of this file with other programs, and to
+ distribute those programs without any restriction coming from the
+ use of this file. (The General Public License restrictions do
+ apply in other respects; for example, they cover modification of
+ the file, and distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
diff --git a/gcc/config/ia64/t-hpux b/gcc/config/ia64/t-hpux
index d89f174592c..e84a09a7476 100644
--- a/gcc/config/ia64/t-hpux
+++ b/gcc/config/ia64/t-hpux
@@ -32,14 +32,17 @@ SHLIB_EXT = .so
# DT_NEEDED entry for libunwind.
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,+h,@shlib_base_name@.so.0 \
- -o @shlib_base_name@.so @multilib_flags@ @shlib_objs@ -lunwind -lc && \
- rm -f @shlib_base_name@.so.0 && \
- $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.0
+ -o @multilib_dir@/@shlib_base_name@.so @multilib_flags@ \
+ @shlib_objs@ -lunwind -lc && \
+ rm -f @multilib_dir@/@shlib_base_name@.so.0 && \
+ $(LN_S) @shlib_base_name@.so @multilib_dir@/@shlib_base_name@.so.0
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so.0; \
- rm -f $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so; \
- $(LN_S) @shlib_base_name@.so.0 $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so; \
- chmod +x $$(DESTDIR)$$(slibdir)/@shlib_base_name@.so
+SHLIB_INSTALL = $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.so \
+ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so.0; \
+ rm -f $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \
+ $(LN_S) @shlib_base_name@.so.0 \
+ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so; \
+ chmod +x $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/@shlib_base_name@.so
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
index 04cfc21592d..824cc4113c4 100644
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -8,7 +8,8 @@ LIB1ASMSRC = ia64/lib1funcs.asm
LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
__divdi3 __moddi3 __udivdi3 __umoddi3 \
__divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
- __nonlocal_goto __restore_stack_nonlocal __trampoline __compat
+ __nonlocal_goto __restore_stack_nonlocal __trampoline \
+ _fixtfdi _fixunstfdi _floatditf
# ??? Hack to get -P option used when compiling lib1funcs.asm, because Intel
# assembler does not accept # line number as a comment.
diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c
index 70b23d0f755..06345c5d2f3 100644
--- a/gcc/config/ip2k/ip2k.c
+++ b/gcc/config/ip2k/ip2k.c
@@ -5318,7 +5318,7 @@ ip2k_reorg (void)
/* There's a good chance that since we last did CSE that we've rearranged
things in such a way that another go will win. Do so now! */
reload_cse_regs (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_REG_INFO | PROP_DEATH_NOTES);
/* Look for where absurd things are happening with DP. */
@@ -5330,7 +5330,7 @@ ip2k_reorg (void)
split_all_insns (0);
reload_cse_regs (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_REG_INFO | PROP_DEATH_NOTES);
if (flag_peephole2)
peephole2_optimize (NULL);
@@ -5357,7 +5357,7 @@ ip2k_reorg (void)
mdr_try_move_dp_reload (first_insn);
mdr_try_move_pushes (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
mdr_try_propagate_move (first_insn);
@@ -5371,14 +5371,14 @@ ip2k_reorg (void)
mdr_try_propagate_move (first_insn);
reload_cse_regs (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
if (flag_peephole2)
peephole2_optimize (NULL);
mdr_try_propagate_move (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
ip2k_reorg_split_simode = 1;
@@ -5389,14 +5389,14 @@ ip2k_reorg (void)
mdr_try_propagate_move (first_insn);
reload_cse_regs (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
if (flag_peephole2)
peephole2_optimize (NULL);
mdr_try_propagate_move (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
ip2k_reorg_split_himode = 1;
@@ -5414,21 +5414,21 @@ ip2k_reorg (void)
/* Call to jump_optimize (...) was here, but now I removed it. */
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
if (flag_peephole2)
peephole2_optimize (NULL);
mdr_try_propagate_move (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
mdr_try_remove_redundant_insns (first_insn);
mdr_try_propagate_clr (first_insn);
mdr_try_propagate_move (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
ip2k_reorg_split_qimode = 1;
@@ -5437,7 +5437,7 @@ ip2k_reorg (void)
mdr_try_wreg_elim (first_insn);
mdr_try_propagate_move (first_insn);
- find_basic_blocks (first_insn, max_reg_num (), 0);
+ find_basic_blocks (first_insn);
life_analysis (0, PROP_FINAL);
#endif
}
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index d3e661b4c5a..2011f122d84 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -928,14 +928,11 @@ extern void sbss_section (void);
#undef ASM_SPEC
-/* The mapping from gcc register number to DWARF 2 CFA column number.
- This mapping does not allow for tracking register 0, since
- register 0 is fixed. */
-#define DWARF_FRAME_REGNUM(REG) \
- (REG == GP_REG_FIRST + 31 ? DWARF_FRAME_RETURN_COLUMN : REG)
+/* The mapping from gcc register number to DWARF 2 CFA column number. */
+#define DWARF_FRAME_REGNUM(REG) (REG)
/* The DWARF 2 CFA column which tracks the return address. */
-#define DWARF_FRAME_RETURN_COLUMN ( GP_REG_FIRST + 26)
+#define DWARF_FRAME_RETURN_COLUMN (GP_REG_FIRST + 31)
/* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + GP_ARG_FIRST : INVALID_REGNUM)
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 1db78d93d21..e3ac6fada85 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -371,9 +371,13 @@ m68k_initial_elimination_offset (int from, int to)
static bool
m68k_save_reg (unsigned int regno, bool interrupt_handler)
{
- if (flag_pic && current_function_uses_pic_offset_table
- && regno == PIC_OFFSET_TABLE_REGNUM)
- return true;
+ if (flag_pic && regno == PIC_OFFSET_TABLE_REGNUM)
+ {
+ if (current_function_uses_pic_offset_table)
+ return true;
+ if (!current_function_is_leaf && TARGET_ID_SHARED_LIBRARY)
+ return true;
+ }
if (current_function_calls_eh_return)
{
diff --git a/gcc/config/m68k/t-rtems b/gcc/config/m68k/t-rtems
index d0e50e22ea9..e660da2d637 100644
--- a/gcc/config/m68k/t-rtems
+++ b/gcc/config/m68k/t-rtems
@@ -3,4 +3,5 @@
MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68030/m68040/m68060 m68881/msoft-float
MULTILIB_DIRNAMES =
MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68030=mc68030
+MULTILIB_MATCHES += m5200=m528x
MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68881 m68060/m68881
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 0468a114d78..ff051255c9c 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -98,9 +98,7 @@ Boston, MA 02111-1307, USA. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
- "%{!shared:%{!ffast-math:%{!funsafe-math-optimizations: \
- %{mabi=n32|mabi=64:irix-csr.o%s}}}} \
- crtend.o%s irix-crtn.o%s \
+ "crtend.o%s irix-crtn.o%s \
%{!shared: \
%{mabi=32:crtn.o%s}\
%{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
diff --git a/gcc/config/mips/irix-csr.c b/gcc/config/mips/irix-csr.c
deleted file mode 100644
index ef37345cd73..00000000000
--- a/gcc/config/mips/irix-csr.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-#include <sys/fpu.h>
-
-/* n32 and n64 applications usually run with the MIPS IV Flush to Zero
- bit set. Clear it here so that gcc-generated code will handle
- subnormals correctly by default. */
-
-static void __attribute__((constructor))
-clear_flush_to_zero (void)
-{
- union fpc_csr csr;
-
- csr.fc_word = get_fpc_csr ();
- csr.fc_struct.flush = 0;
- set_fpc_csr (csr.fc_word);
-}
-#endif
diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
index 5c136c14109..8a41c8c7757 100644
--- a/gcc/config/mips/linux-unwind.h
+++ b/gcc/config/mips/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for MIPS Linux.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file with other programs, and to distribute
+those programs without any restriction coming from the use of this
+file. (The General Public License restrictions do apply in other
+respects; for example, they cover modification of the file, and
+distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -78,6 +86,13 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
fs->cfa_reg = STACK_POINTER_REGNUM;
fs->cfa_offset = new_cfa - (_Unwind_Ptr) context->cfa;
+#if _MIPS_SIM == _ABIO32 && defined __MIPSEB__
+ /* On o32 Linux, the register save slots in the sigcontext are
+ eight bytes. We need the lower half of each register slot,
+ so slide our view of the structure back four bytes. */
+ new_cfa -= 4;
+#endif
+
for (i = 0; i < 32; i++) {
fs->regs.reg[i].how = REG_SAVED_OFFSET;
fs->regs.reg[i].loc.offset
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index e3b4b312f9c..acd6ae0a704 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1,6 +1,6 @@
/* Subroutines used for MIPS code generation.
Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by A. Lichnewsky, lich@inria.inria.fr.
Changes by Michael Meissner, meissner@osf.org.
64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
@@ -5135,56 +5135,20 @@ mips_output_ascii (FILE *stream, const char *string_param, size_t len,
{
register int c = string[i];
- switch (c)
+ if (ISPRINT (c))
{
- case '\"':
- case '\\':
- putc ('\\', stream);
- putc (c, stream);
- cur_pos += 2;
- break;
-
- case TARGET_NEWLINE:
- fputs ("\\n", stream);
- if (i+1 < len
- && (((c = string[i+1]) >= '\040' && c <= '~')
- || c == TARGET_TAB))
- cur_pos = 32767; /* break right here */
- else
- cur_pos += 2;
- break;
-
- case TARGET_TAB:
- fputs ("\\t", stream);
- cur_pos += 2;
- break;
-
- case TARGET_FF:
- fputs ("\\f", stream);
- cur_pos += 2;
- break;
-
- case TARGET_BS:
- fputs ("\\b", stream);
- cur_pos += 2;
- break;
-
- case TARGET_CR:
- fputs ("\\r", stream);
- cur_pos += 2;
- break;
-
- default:
- if (c >= ' ' && c < 0177)
+ if (c == '\\' || c == '\"')
{
- putc (c, stream);
+ putc ('\\', stream);
cur_pos++;
}
- else
- {
- fprintf (stream, "\\%03o", c);
- cur_pos += 4;
- }
+ putc (c, stream);
+ cur_pos++;
+ }
+ else
+ {
+ fprintf (stream, "\\%03o", c);
+ cur_pos += 4;
}
if (cur_pos > 72 && i+1 < len)
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index ba99796fc47..8c3a80ab634 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -1,6 +1,6 @@
;; Mips.md Machine Description for MIPS based processors
;; Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-;; 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+;; 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Contributed by A. Lichnewsky, lich@inria.inria.fr
;; Changes by Michael Meissner, meissner@osf.org
;; 64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
@@ -2903,9 +2903,9 @@ beq\t%2,%.,1b\;\
;; dsll32 op1,op1,0
;; daddu op1,op1,op0
(define_peephole2
- [(match_scratch:DI 0 "d")
- (set (match_operand:DI 1 "register_operand")
- (high:DI (match_operand:DI 2 "general_symbolic_operand")))]
+ [(set (match_operand:DI 1 "register_operand")
+ (high:DI (match_operand:DI 2 "general_symbolic_operand")))
+ (match_scratch:DI 0 "d")]
"TARGET_EXPLICIT_RELOCS && ABI_HAS_64BIT_SYMBOLS"
[(set (match_dup 1) (high:DI (match_dup 3)))
(set (match_dup 0) (high:DI (match_dup 4)))
diff --git a/gcc/config/mips/t-iris6 b/gcc/config/mips/t-iris6
index 93837887f46..254480cb43f 100644
--- a/gcc/config/mips/t-iris6
+++ b/gcc/config/mips/t-iris6
@@ -19,9 +19,3 @@ tp-bit.c: $(srcdir)/config/fp-bit.c
echo '# define TFLOAT' >> tp-bit.c
cat $(srcdir)/config/fp-bit.c >> tp-bit.c
echo '#endif' >> tp-bit.c
-
-$(T)irix-csr.o: $(srcdir)/config/mips/irix-csr.c $(GCC_PASSES)
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
- -c -o $@ $<
-
-EXTRA_MULTILIB_PARTS += irix-csr.o
diff --git a/gcc/config/mips/t-slibgcc-irix b/gcc/config/mips/t-slibgcc-irix
index 71e5094103f..cfb4bf4d8cc 100644
--- a/gcc/config/mips/t-slibgcc-irix
+++ b/gcc/config/mips/t-slibgcc-irix
@@ -3,29 +3,29 @@
SHLIB_EXT = .so
SHLIB_SOLINK = @shlib_base_name@.so
SHLIB_SOVERSION = 1
-SHLIB_SONAME = @shlib_so_name@.so.$(SHLIB_SOVERSION)
-SHLIB_NAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
+SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
+SHLIB_DIR = @multilib_dir@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_LC = -lc
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-soname,$(SHLIB_SONAME) \
- -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
- rm -f $(SHLIB_SOLINK) && \
- if [ -f $(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
+ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
else true; fi && \
- mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
- $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK) && \
- { test "@multilib_dir@" = "." || \
- $(INSTALL_DATA) $(SHLIB_NAME) @multilib_dir@/$(SHLIB_SONAME); }
+ mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
+ $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_NAME) \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIB_SONAME) \
diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h
index 217812d93f3..4a67179eb7f 100644
--- a/gcc/config/mn10300/linux.h
+++ b/gcc/config/mn10300/linux.h
@@ -40,20 +40,6 @@
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
%{static:-static}"
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{shared: -lc} \
- %{!shared: %{pthread:-lpthread} \
- %{profile:-lc_p} %{!profile: -lc}}"
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
#undef TARGET_SWITCHES
#define TARGET_SWITCHES \
{{ "am33", -0x4, N_("Target the AM33 processor") }, \
diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
index 41ec61caa9e..3e23f62fa32 100644
--- a/gcc/config/pa/linux-unwind.h
+++ b/gcc/config/pa/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for PA Linux.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file with other programs, and to distribute
+those programs without any restriction coming from the use of this
+file. (The General Public License restrictions do apply in other
+respects; for example, they cover modification of the file, and
+distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -78,7 +86,22 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
off = 10 * 4;
}
else
- return _URC_END_OF_STACK;
+ {
+ /* We may have to unwind through an alternate signal stack.
+ We assume that the alignment of the alternate signal stack
+ is BIGGEST_ALIGNMENT (i.e., that it has been allocated using
+ malloc). As a result, we can't distinguish trampolines
+ used prior to 2.6.5-rc2-pa4. However after 2.6.5-rc2-pa4,
+ the return address of a signal trampoline will be on an odd
+ word boundary and we can then determine the frame offset. */
+ sp = (unsigned long)context->ra;
+ pc = (unsigned int *)sp;
+ if ((pc[0] == 0x34190000 || pc[0] == 0x34190002) && (sp & 4))
+ off = 5 * 4;
+ else
+ return _URC_END_OF_STACK;
+ }
+
if (pc[1] != 0x3414015a
|| pc[2] != 0xe4008200
|| pc[3] != 0x08000240)
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index c326786aed8..06f5b9832b0 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -3315,13 +3315,14 @@ output_64bit_ior (rtx *operands)
}
/* Target hook for assembling integer objects. This code handles
- aligned SI and DI integers specially, since function references must
- be preceded by P%. */
+ aligned SI and DI integers specially since function references
+ must be preceded by P%. */
static bool
pa_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
- if (size == UNITS_PER_WORD && aligned_p
+ if (size == UNITS_PER_WORD
+ && aligned_p
&& function_label_operand (x, VOIDmode))
{
fputs (size == 8? "\t.dword\tP%" : "\t.word\tP%", asm_out_file);
@@ -5608,8 +5609,6 @@ get_plabel (const char *fname)
on the list, create a new entry on the list. */
if (deferred_plabels == NULL || i == n_deferred_plabels)
{
- const char *real_name;
-
if (deferred_plabels == 0)
deferred_plabels = (struct deferred_plabel *)
ggc_alloc (sizeof (struct deferred_plabel));
@@ -5623,10 +5622,10 @@ get_plabel (const char *fname)
deferred_plabels[i].internal_label = gen_label_rtx ();
deferred_plabels[i].name = ggc_strdup (fname);
- /* Gross. We have just implicitly taken the address of this function,
- mark it as such. */
- real_name = (*targetm.strip_name_encoding) (fname);
- TREE_SYMBOL_REFERENCED (get_identifier (real_name)) = 1;
+ /* Gross. We have just implicitly taken the address of
+ this function, mark it as such. */
+ fname = targetm.strip_name_encoding (fname);
+ TREE_SYMBOL_REFERENCED (get_identifier (fname)) = 1;
}
return &deferred_plabels[i];
@@ -7916,18 +7915,18 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree function)
{
- const char *fname = XSTR (XEXP (DECL_RTL (function), 0), 0);
- const char *tname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
+ static unsigned int current_thunk_number;
int val_14 = VAL_14_BITS_P (delta);
int nbytes = 0;
- static unsigned int current_thunk_number;
char label[16];
+ rtx xoperands[4];
- ASM_OUTPUT_LABEL (file, tname);
- fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
+ xoperands[0] = XEXP (DECL_RTL (function), 0);
+ xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
+ xoperands[2] = GEN_INT (delta);
- fname = (*targetm.strip_name_encoding) (fname);
- tname = (*targetm.strip_name_encoding) (tname);
+ ASM_OUTPUT_LABEL (file, XSTR (xoperands[1], 0));
+ fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
/* Output the thunk. We know that the function is in the same
translation unit (i.e., the same space) as the thunk, and that
@@ -7959,18 +7958,19 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
&& last_address < 262132)))
|| (!targetm.have_named_sections && last_address < 262132))))
{
+ if (!val_14)
+ output_asm_insn ("addil L'%2,%%r26", xoperands);
+
+ output_asm_insn ("b %0", xoperands);
+
if (val_14)
{
- fprintf (file, "\tb %s\n\tldo " HOST_WIDE_INT_PRINT_DEC
- "(%%r26),%%r26\n", fname, delta);
+ output_asm_insn ("ldo %2(%%r26),%%r26", xoperands);
nbytes += 8;
}
else
{
- fprintf (file, "\taddil L'" HOST_WIDE_INT_PRINT_DEC
- ",%%r26\n", delta);
- fprintf (file, "\tb %s\n\tldo R'" HOST_WIDE_INT_PRINT_DEC
- "(%%r1),%%r26\n", fname, delta);
+ output_asm_insn ("ldo R'%2(%%r1),%%r26", xoperands);
nbytes += 12;
}
}
@@ -7979,53 +7979,54 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
/* We only have one call-clobbered scratch register, so we can't
make use of the delay slot if delta doesn't fit in 14 bits. */
if (!val_14)
- fprintf (file, "\taddil L'" HOST_WIDE_INT_PRINT_DEC
- ",%%r26\n\tldo R'" HOST_WIDE_INT_PRINT_DEC
- "(%%r1),%%r26\n", delta, delta);
+ {
+ output_asm_insn ("addil L'%2,%%r26", xoperands);
+ output_asm_insn ("ldo R'%2(%%r1),%%r26", xoperands);
+ }
- fprintf (file, "\tb,l .+8,%%r1\n");
+ output_asm_insn ("b,l .+8,%%r1", xoperands);
if (TARGET_GAS)
{
- fprintf (file, "\taddil L'%s-$PIC_pcrel$0+4,%%r1\n", fname);
- fprintf (file, "\tldo R'%s-$PIC_pcrel$0+8(%%r1),%%r1\n", fname);
+ output_asm_insn ("addil L'%0-$PIC_pcrel$0+4,%%r1", xoperands);
+ output_asm_insn ("ldo R'%0-$PIC_pcrel$0+8(%%r1),%%r1", xoperands);
}
else
{
- int off = val_14 ? 8 : 16;
- fprintf (file, "\taddil L'%s-%s-%d,%%r1\n", fname, tname, off);
- fprintf (file, "\tldo R'%s-%s-%d(%%r1),%%r1\n", fname, tname, off);
+ xoperands[3] = GEN_INT (val_14 ? 8 : 16);
+ output_asm_insn ("addil L'%0-%1-%3,%%r1", xoperands);
}
if (val_14)
{
- fprintf (file, "\tbv %%r0(%%r1)\n\tldo ");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC "(%%r26),%%r26\n", delta);
+ output_asm_insn ("bv %%r0(%%r1)", xoperands);
+ output_asm_insn ("ldo %2(%%r26),%%r26", xoperands);
nbytes += 20;
}
else
{
- fprintf (file, "\tbv,n %%r0(%%r1)\n");
+ output_asm_insn ("bv,n %%r0(%%r1)", xoperands);
nbytes += 24;
}
}
else if (TARGET_PORTABLE_RUNTIME)
{
- fprintf (file, "\tldil L'%s,%%r1\n", fname);
- fprintf (file, "\tldo R'%s(%%r1),%%r22\n", fname);
+ output_asm_insn ("ldil L'%0,%%r1", xoperands);
+ output_asm_insn ("ldo R'%0(%%r1),%%r22", xoperands);
+
+ if (!val_14)
+ output_asm_insn ("addil L'%2,%%r26", xoperands);
+
+ output_asm_insn ("bv %%r0(%%r22)", xoperands);
if (val_14)
{
- fprintf (file, "\tbv %%r0(%%r22)\n\tldo ");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC "(%%r26),%%r26\n", delta);
+ output_asm_insn ("ldo %2(%%r26),%%r26", xoperands);
nbytes += 16;
}
else
{
- fprintf (file, "\taddil L'" HOST_WIDE_INT_PRINT_DEC
- ",%%r26\n", delta);
- fprintf (file, "\tbv %%r0(%%r22)\n\tldo ");
- fprintf (file, "R'" HOST_WIDE_INT_PRINT_DEC "(%%r1),%%r26\n", delta);
+ output_asm_insn ("ldo R'%2(%%r1),%%r26", xoperands);
nbytes += 20;
}
}
@@ -8036,99 +8037,92 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
call the function directly with an indirect sequence similar to
that used by $$dyncall. This is possible because $$dyncall acts
as the import stub in an indirect call. */
- const char *lab;
-
ASM_GENERATE_INTERNAL_LABEL (label, "LTHN", current_thunk_number);
- lab = (*targetm.strip_name_encoding) (label);
-
- fprintf (file, "\taddil LT'%s,%%r19\n", lab);
- fprintf (file, "\tldw RT'%s(%%r1),%%r22\n", lab);
- fprintf (file, "\tldw 0(%%sr0,%%r22),%%r22\n");
- fprintf (file, "\tbb,>=,n %%r22,30,.+16\n");
- fprintf (file, "\tdepi 0,31,2,%%r22\n");
- fprintf (file, "\tldw 4(%%sr0,%%r22),%%r19\n");
- fprintf (file, "\tldw 0(%%sr0,%%r22),%%r22\n");
+ xoperands[3] = gen_rtx_SYMBOL_REF (Pmode, label);
+ output_asm_insn ("addil LT'%3,%%r19", xoperands);
+ output_asm_insn ("ldw RT'%3(%%r1),%%r22", xoperands);
+ output_asm_insn ("ldw 0(%%sr0,%%r22),%%r22", xoperands);
+ output_asm_insn ("bb,>=,n %%r22,30,.+16", xoperands);
+ output_asm_insn ("depi 0,31,2,%%r22", xoperands);
+ output_asm_insn ("ldw 4(%%sr0,%%r22),%%r19", xoperands);
+ output_asm_insn ("ldw 0(%%sr0,%%r22),%%r22", xoperands);
+
if (!val_14)
{
- fprintf (file, "\taddil L'" HOST_WIDE_INT_PRINT_DEC
- ",%%r26\n", delta);
+ output_asm_insn ("addil L'%2,%%r26", xoperands);
nbytes += 4;
}
+
if (TARGET_PA_20)
{
- fprintf (file, "\tbve (%%r22)\n\tldo ");
+ output_asm_insn ("bve (%%r22)", xoperands);
+ nbytes += 36;
+ }
+ else if (TARGET_NO_SPACE_REGS)
+ {
+ output_asm_insn ("be 0(%%sr4,%%r22)", xoperands);
nbytes += 36;
}
else
{
- if (TARGET_NO_SPACE_REGS)
- {
- fprintf (file, "\tbe 0(%%sr4,%%r22)\n\tldo ");
- nbytes += 36;
- }
- else
- {
- fprintf (file, "\tldsid (%%sr0,%%r22),%%r21\n");
- fprintf (file, "\tmtsp %%r21,%%sr0\n");
- fprintf (file, "\tbe 0(%%sr0,%%r22)\n\tldo ");
- nbytes += 44;
- }
+ output_asm_insn ("ldsid (%%sr0,%%r22),%%r21", xoperands);
+ output_asm_insn ("mtsp %%r21,%%sr0", xoperands);
+ output_asm_insn ("be 0(%%sr0,%%r22)", xoperands);
+ nbytes += 44;
}
if (val_14)
- fprintf (file, HOST_WIDE_INT_PRINT_DEC "(%%r26),%%r26\n", delta);
+ output_asm_insn ("ldo %2(%%r26),%%r26", xoperands);
else
- fprintf (file, "R'" HOST_WIDE_INT_PRINT_DEC "(%%r1),%%r26\n", delta);
+ output_asm_insn ("ldo R'%2(%%r1),%%r26", xoperands);
}
else if (flag_pic)
{
- if (TARGET_PA_20)
- fprintf (file, "\tb,l .+8,%%r1\n");
- else
- fprintf (file, "\tbl .+8,%%r1\n");
+ output_asm_insn ("{bl|b,l} .+8,%%r1", xoperands);
if (TARGET_SOM || !TARGET_GAS)
{
- fprintf (file, "\taddil L'%s-%s-8,%%r1\n", fname, tname);
- fprintf (file, "\tldo R'%s-%s-8(%%r1),%%r22\n", fname, tname);
+ output_asm_insn ("addil L'%0-%1-8,%%r1", xoperands);
+ output_asm_insn ("ldo R'%0-%1-8(%%r1),%%r22", xoperands);
}
else
{
- fprintf (file, "\taddil L'%s-$PIC_pcrel$0+4,%%r1\n", fname);
- fprintf (file, "\tldo R'%s-$PIC_pcrel$0+8(%%r1),%%r22\n", fname);
+ output_asm_insn ("addil L'%0-$PIC_pcrel$0+4,%%r1", xoperands);
+ output_asm_insn ("ldo R'%0-$PIC_pcrel$0+8(%%r1),%%r22", xoperands);
}
+ if (!val_14)
+ output_asm_insn ("addil L'%2,%%r26", xoperands);
+
+ output_asm_insn ("bv %%r0(%%r22)", xoperands);
+
if (val_14)
{
- fprintf (file, "\tbv %%r0(%%r22)\n\tldo ");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC "(%%r26),%%r26\n", delta);
+ output_asm_insn ("ldo %2(%%r26),%%r26", xoperands);
nbytes += 20;
}
else
{
- fprintf (file, "\taddil L'" HOST_WIDE_INT_PRINT_DEC
- ",%%r26\n", delta);
- fprintf (file, "\tbv %%r0(%%r22)\n\tldo ");
- fprintf (file, "R'" HOST_WIDE_INT_PRINT_DEC "(%%r1),%%r26\n", delta);
+ output_asm_insn ("ldo R'%2(%%r1),%%r26", xoperands);
nbytes += 24;
}
}
else
{
if (!val_14)
- fprintf (file, "\taddil L'" HOST_WIDE_INT_PRINT_DEC ",%%r26\n", delta);
+ output_asm_insn ("addil L'%2,%%r26", xoperands);
- fprintf (file, "\tldil L'%s,%%r22\n", fname);
- fprintf (file, "\tbe R'%s(%%sr4,%%r22)\n\tldo ", fname);
+ output_asm_insn ("ldil L'%0,%%r22", xoperands);
+ output_asm_insn ("be R'%0(%%sr4,%%r22)", xoperands);
if (val_14)
{
- fprintf (file, HOST_WIDE_INT_PRINT_DEC "(%%r26),%%r26\n", delta);
+ output_asm_insn ("ldo %2(%%r26),%%r26", xoperands);
nbytes += 12;
}
else
{
- fprintf (file, "R'" HOST_WIDE_INT_PRINT_DEC "(%%r1),%%r26\n", delta);
+ output_asm_insn ("ldo R'%2(%%r1),%%r26", xoperands);
nbytes += 16;
}
}
@@ -8138,9 +8132,9 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
{
data_section ();
- fprintf (file, "\t.align 4\n");
+ output_asm_insn (".align 4", xoperands);
ASM_OUTPUT_LABEL (file, label);
- fprintf (file, "\t.word P'%s\n", fname);
+ output_asm_insn (".word P'%0", xoperands);
}
else if (TARGET_SOM && TARGET_GAS)
forget_section ();
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 985a253ab00..e06a0912493 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -256,9 +256,9 @@ do { \
if (!function_label_operand (RTL, VOIDmode)) \
hppa_encode_label (RTL); \
\
- name = (*targetm.strip_name_encoding) (XSTR ((RTL), 0)); \
+ name = targetm.strip_name_encoding (XSTR ((RTL), 0)); \
id = maybe_get_identifier (name); \
- if (! id || ! TREE_SYMBOL_REFERENCED (id)) \
+ if (!id || !TREE_SYMBOL_REFERENCED (id)) \
{ \
fputs ("\t.IMPORT ", FILE); \
assemble_name (FILE, XSTR ((RTL), 0)); \
diff --git a/gcc/config/pa/t-hpux-shlib b/gcc/config/pa/t-hpux-shlib
index 5183b062584..2a42ed6efc9 100644
--- a/gcc/config/pa/t-hpux-shlib
+++ b/gcc/config/pa/t-hpux-shlib
@@ -3,21 +3,25 @@ SHLIB_EXT = .sl
SHLIB_NAME = @shlib_base_name@.sl
SHLIB_SONAME = @shlib_base_name@.1
SHLIB_OBJS = @shlib_objs@
+SHLIB_DIR = @multilib_dir@
+SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
- rm -f $(SHLIB_SONAME) && \
- if [ -f $(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ -o $(SHLIB_DIR)/$(SHLIB_NAME).tmp @multilib_flags@ \
+ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SONAME) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIB_NAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIB_NAME) $(SHLIB_DIR)/$(SHLIB_NAME).backup; \
else true; fi && \
- mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
- $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
+ mv $(SHLIB_DIR)/$(SHLIB_NAME).tmp $(SHLIB_DIR)/$(SHLIB_NAME) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_DIR)/$(SHLIB_SONAME)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) -m 555 $(SHLIB_NAME) \
- $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \
- rm -f $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME); \
- $(LN_S) $(SHLIB_SONAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME)
+SHLIB_INSTALL = $(INSTALL_DATA) -m 555 $(SHLIB_DIR)/$(SHLIB_NAME) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
+ rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME); \
+ $(LN_S) $(SHLIB_SONAME) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_NAME)
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index cb674c82841..82d7ec7f375 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -1,6 +1,7 @@
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -194,15 +195,15 @@
#define JUMP_TABLES_IN_TEXT_SECTION 1
/* Enable AIX XL compiler calling convention breakage compatibility. */
-#undef TARGET_XL_CALL
-#define MASK_XL_CALL 0x40000000
-#define TARGET_XL_CALL (target_flags & MASK_XL_CALL)
+#undef TARGET_XL_COMPAT
+#define MASK_XL_COMPAT 0x40000000
+#define TARGET_XL_COMPAT (target_flags & MASK_XL_COMPAT)
#undef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES \
- {"xl-call", MASK_XL_CALL, \
- N_("Always pass floating-point arguments in memory") }, \
- {"no-xl-call", - MASK_XL_CALL, \
- N_("Don't always pass floating-point arguments in memory") }, \
+ {"xl-compat", MASK_XL_COMPAT, \
+ N_("Conform more closely to IBM XLC semantics") }, \
+ {"no-xl-compat", - MASK_XL_COMPAT, \
+ N_("Default GCC semantics that differ from IBM XLC") }, \
SUBSUBTARGET_SWITCHES
#define SUBSUBTARGET_SWITCHES
@@ -263,3 +264,6 @@
32-bit mode. */
#define OS_MISSING_POWERPC64 1
#define OS_MISSING_ALTIVEC 1
+
+/* WINT_TYPE */
+#define WINT_TYPE "int"
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 1b3beffadfc..9e98ffe1a6b 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -1,5 +1,5 @@
;; AltiVec patterns.
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Contributed by Aldy Hernandez (aldy@quesejoda.com)
;; This file is part of GCC.
diff --git a/gcc/config/rs6000/beos.h b/gcc/config/rs6000/beos.h
index 1ce36bf70aa..b7a05e4dd8e 100644
--- a/gcc/config/rs6000/beos.h
+++ b/gcc/config/rs6000/beos.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler, for BeOS.
- Copyright (C) 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2001, 2002, 2003, 2005
+ Free Software Foundation, Inc.
Contributed by Fred Fish (fnf@cygnus.com), based on aix41.h
from David Edelsohn (edelsohn@npac.syr.edu).
@@ -23,18 +24,6 @@
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (BeOS/PowerPC)");
-/* Enable AIX XL compiler calling convention breakage compatibility. */
-#define MASK_XL_CALL 0x40000000
-#define TARGET_XL_CALL (target_flags & MASK_XL_CALL)
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
- {"xl-call", MASK_XL_CALL, \
- N_("Always pass floating-point arguments in memory") }, \
- {"no-xl-call", - MASK_XL_CALL, \
- N_("Don't always pass floating-point arguments in memory") }, \
- {"threads", 0}, \
- {"pe", 0},
-
#undef ASM_SPEC
#define ASM_SPEC "-u %(asm_cpu)"
diff --git a/gcc/config/rs6000/darwin-ldouble.c b/gcc/config/rs6000/darwin-ldouble.c
index 91c00281585..b394d5d99bf 100644
--- a/gcc/config/rs6000/darwin-ldouble.c
+++ b/gcc/config/rs6000/darwin-ldouble.c
@@ -1,5 +1,5 @@
/* 128-bit long double support routines for Darwin.
- Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -30,12 +30,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Implementations of floating-point long double basic arithmetic
functions called by the IBM C compiler when generating code for
PowerPC platforms. In particular, the following functions are
- implemented: _xlqadd, _xlqsub, _xlqmul, and _xlqdiv. Double-double
- algorithms are based on the paper "Doubled-Precision IEEE Standard
- 754 Floating-Point Arithmetic" by W. Kahan, February 26, 1987. An
- alternative published reference is "Software for Doubled-Precision
- Floating-Point Computations", by Seppo Linnainmaa, ACM TOMS vol 7
- no 3, September 1981, pages 272-283. */
+ implemented: __gcc_qadd, __gcc_qsub, __gcc_qmul, and __gcc_qdiv.
+ Double-double algorithms are based on the paper "Doubled-Precision
+ IEEE Standard 754 Floating-Point Arithmetic" by W. Kahan, February 26,
+ 1987. An alternative published reference is "Software for
+ Doubled-Precision Floating-Point Computations", by Seppo Linnainmaa,
+ ACM TOMS vol 7 no 3, September 1981, pages 272-283. */
/* Each long double is made up of two IEEE doubles. The value of the
long double is the sum of the values of the two parts. The most
@@ -48,7 +48,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
This code currently assumes big-endian. */
-#if !_SOFT_FLOAT && (defined (__MACH__) || defined (__powerpc64__))
+#if !_SOFT_FLOAT && (defined (__MACH__) || defined (__powerpc64__) || defined (_AIX))
#define fabs(x) __builtin_fabs(x)
#define isless(x, y) __builtin_isless (x, y)
@@ -62,10 +62,27 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
but GCC currently generates poor code when a union is used to turn
a long double into a pair of doubles. */
-extern long double _xlqadd (double, double, double, double);
-extern long double _xlqsub (double, double, double, double);
-extern long double _xlqmul (double, double, double, double);
-extern long double _xlqdiv (double, double, double, double);
+extern long double __gcc_qadd (double, double, double, double);
+extern long double __gcc_qsub (double, double, double, double);
+extern long double __gcc_qmul (double, double, double, double);
+extern long double __gcc_qdiv (double, double, double, double);
+
+#if defined __ELF__ && defined SHARED
+/* Provide definitions of the old symbol names to statisfy apps and
+ shared libs built against an older libgcc. To access the _xlq
+ symbols an explicit version reference is needed, so these won't
+ satisfy an unadorned reference like _xlqadd. If dot symbols are
+ not needed, the assembler will remove the aliases from the symbol
+ table. */
+__asm__ (".symver __gcc_qadd,_xlqadd@GCC_3.4\n\t"
+ ".symver __gcc_qsub,_xlqsub@GCC_3.4\n\t"
+ ".symver __gcc_qmul,_xlqmul@GCC_3.4\n\t"
+ ".symver __gcc_qdiv,_xlqdiv@GCC_3.4\n\t"
+ ".symver .__gcc_qadd,._xlqadd@GCC_3.4\n\t"
+ ".symver .__gcc_qsub,._xlqsub@GCC_3.4\n\t"
+ ".symver .__gcc_qmul,._xlqmul@GCC_3.4\n\t"
+ ".symver .__gcc_qdiv,._xlqdiv@GCC_3.4");
+#endif
typedef union
{
@@ -75,7 +92,7 @@ typedef union
/* Add two 'long double' values and return the result. */
long double
-_xlqadd (double a, double aa, double c, double cc)
+__gcc_qadd (double a, double aa, double c, double cc)
{
longDblUnion x;
double z, q, zz, xh;
@@ -110,13 +127,13 @@ _xlqadd (double a, double aa, double c, double cc)
}
long double
-_xlqsub (double a, double b, double c, double d)
+__gcc_qsub (double a, double b, double c, double d)
{
- return _xlqadd (a, b, -c, -d);
+ return __gcc_qadd (a, b, -c, -d);
}
long double
-_xlqmul (double a, double b, double c, double d)
+__gcc_qmul (double a, double b, double c, double d)
{
longDblUnion z;
double t, tau, u, v, w;
@@ -145,7 +162,7 @@ _xlqmul (double a, double b, double c, double d)
}
long double
-_xlqdiv (double a, double b, double c, double d)
+__gcc_qdiv (double a, double b, double c, double d)
{
longDblUnion z;
double s, sigma, t, tau, u, v, w;
diff --git a/gcc/config/rs6000/darwin-tramp.asm b/gcc/config/rs6000/darwin-tramp.asm
index a8125527bfd..a2e2f4c7434 100644
--- a/gcc/config/rs6000/darwin-tramp.asm
+++ b/gcc/config/rs6000/darwin-tramp.asm
@@ -1,6 +1,6 @@
/* Special support for trampolines
*
- * Copyright (C) 1996, 1997, 2000, 2004 Free Software Foundation, Inc.
+ * Copyright (C) 1996, 1997, 2000, 2004, 2005 Free Software Foundation, Inc.
* Written By Michael Meissner
*
* This file is free software; you can redistribute it and/or modify it
@@ -33,8 +33,6 @@
* executable file might be covered by the GNU General Public License.
*/
-/* APPLE LOCAL mainline throughout this file */
-
#include "darwin-asm.h"
/* Set up trampolines. */
diff --git a/gcc/config/rs6000/libgcc-ppc64.ver b/gcc/config/rs6000/libgcc-ppc64.ver
index 116d5e73fa0..b27b4b49249 100644
--- a/gcc/config/rs6000/libgcc-ppc64.ver
+++ b/gcc/config/rs6000/libgcc-ppc64.ver
@@ -1,7 +1,7 @@
-GCC_3.4 {
+GCC_3.4.4 {
# long double support
- _xlqadd
- _xlqsub
- _xlqmul
- _xlqdiv
+ __gcc_qadd
+ __gcc_qsub
+ __gcc_qmul
+ __gcc_qdiv
}
diff --git a/gcc/config/rs6000/linux-unwind.h b/gcc/config/rs6000/linux-unwind.h
index 3e12cc691ae..1acf738123e 100644
--- a/gcc/config/rs6000/linux-unwind.h
+++ b/gcc/config/rs6000/linux-unwind.h
@@ -8,6 +8,14 @@
by the Free Software Foundation; either version 2, or (at your
option) any later version.
+ In addition to the permissions in the GNU General Public License,
+ the Free Software Foundation gives you unlimited permission to link
+ the compiled version of this file with other programs, and to
+ distribute those programs without any restriction coming from the
+ use of this file. (The General Public License restrictions do
+ apply in other respects; for example, they cover modification of
+ the file, and distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
@@ -194,7 +202,7 @@ get_regs (struct _Unwind_Context *context)
}
#endif
-/* Find an entry in the process auxilliary vector. The canonical way to
+/* Find an entry in the process auxiliary vector. The canonical way to
test for VMX is to look at AT_HWCAP. */
static long
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index f1bb23f84bd..e07ac501107 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1316,6 +1316,8 @@ rs6000_override_options (const char *default_cpu)
#if TARGET_MACHO
darwin_one_byte_bool = "";
#endif
+ /* Default to natural alignment, for better performance. */
+ rs6000_alignment_flags = MASK_ALIGN_NATURAL;
}
/* Handle -mabi= options. */
@@ -1684,7 +1686,16 @@ rs6000_parse_alignment_option (void)
if (rs6000_alignment_string == 0)
return;
else if (! strcmp (rs6000_alignment_string, "power"))
- rs6000_alignment_flags = MASK_ALIGN_POWER;
+ {
+ /* On 64-bit Darwin, power alignment is ABI-incompatible with
+ some C library functions, so warn about it. The flag may be
+ useful for performance studies from time to time though, so
+ don't disable it entirely. */
+ if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT)
+ warning ("-malign-power is not supported for 64-bit Darwin;"
+ " it is incompatible with the installed C and C++ libraries");
+ rs6000_alignment_flags = MASK_ALIGN_POWER;
+ }
else if (! strcmp (rs6000_alignment_string, "natural"))
rs6000_alignment_flags = MASK_ALIGN_NATURAL;
else
@@ -3870,6 +3881,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
&& REG_MODE_OK_FOR_BASE_P (XEXP (x, 0), mode)
&& GET_CODE (XEXP (x, 1)) == CONST_INT
&& (INTVAL (XEXP (x, 1)) & 3) != 0
+ && !ALTIVEC_VECTOR_MODE (mode)
&& GET_MODE_SIZE (mode) >= UNITS_PER_WORD
&& TARGET_POWERPC64)
{
@@ -5604,7 +5616,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
needs_psave = (type
&& (cum->nargs_prototype <= 0
|| (DEFAULT_ABI == ABI_AIX
- && TARGET_XL_CALL
+ && TARGET_XL_COMPAT
&& align_words >= GP_ARG_NUM_REG)));
if (!needs_psave && mode == fmode)
@@ -5712,7 +5724,7 @@ rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
&& !(type
&& (cum->nargs_prototype <= 0
|| (DEFAULT_ABI == ABI_AIX
- && TARGET_XL_CALL
+ && TARGET_XL_COMPAT
&& align_words >= GP_ARG_NUM_REG))))
{
if (cum->fregno + ((GET_MODE_SIZE (mode) + 7) >> 3) > FP_ARG_MAX_REG + 1)
@@ -8871,10 +8883,10 @@ rs6000_init_libfuncs (void)
}
/* Standard AIX/Darwin/64-bit SVR4 quad floating point routines. */
- set_optab_libfunc (add_optab, TFmode, "_xlqadd");
- set_optab_libfunc (sub_optab, TFmode, "_xlqsub");
- set_optab_libfunc (smul_optab, TFmode, "_xlqmul");
- set_optab_libfunc (sdiv_optab, TFmode, "_xlqdiv");
+ set_optab_libfunc (add_optab, TFmode, "__gcc_qadd");
+ set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub");
+ set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul");
+ set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv");
}
else
{
@@ -11458,10 +11470,34 @@ rs6000_generate_compare (enum rtx_code code)
emit_insn (cmp);
}
else
- emit_insn (gen_rtx_SET (VOIDmode, compare_result,
- gen_rtx_COMPARE (comp_mode,
- rs6000_compare_op0,
- rs6000_compare_op1)));
+ {
+ /* Generate XLC-compatible TFmode compare as PARALLEL with extra
+ CLOBBERs to match cmptf_internal2 pattern. */
+ if (comp_mode == CCFPmode && TARGET_XL_COMPAT
+ && GET_MODE (rs6000_compare_op0) == TFmode
+ && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128)
+ emit_insn (gen_rtx_PARALLEL (VOIDmode,
+ gen_rtvec (9,
+ gen_rtx_SET (VOIDmode,
+ compare_result,
+ gen_rtx_COMPARE (comp_mode,
+ rs6000_compare_op0,
+ rs6000_compare_op1)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)),
+ gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (DFmode)))));
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, compare_result,
+ gen_rtx_COMPARE (comp_mode,
+ rs6000_compare_op0,
+ rs6000_compare_op1)));
+ }
/* Some kinds of FP comparisons need an OR operation;
under flag_unsafe_math_optimizations we don't bother. */
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 0ccec58f8a4..1a2d12df2ce 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -262,7 +262,7 @@ extern int target_flags;
#define TARGET_POWERPC64 (target_flags & MASK_POWERPC64)
#endif
-#define TARGET_XL_CALL 0
+#define TARGET_XL_COMPAT 0
/* Run-time compilation parameters selecting different hardware subsets.
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index c2dd678d767..bf2bf4ce37b 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -8325,14 +8325,36 @@
DONE;
})
-(define_insn "trunctfdf2"
+(define_expand "trunctfdf2"
+ [(set (match_operand:DF 0 "gpc_reg_operand" "")
+ (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))]
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+ "")
+
+(define_insn_and_split "trunctfdf2_internal1"
+ [(set (match_operand:DF 0 "gpc_reg_operand" "=f,?f")
+ (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "0,f")))]
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && !TARGET_XL_COMPAT
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+ "@
+ #
+ fmr %0,%1"
+ "&& reload_completed && REGNO (operands[0]) == REGNO (operands[1])"
+ [(const_int 0)]
+{
+ emit_note (NOTE_INSN_DELETED);
+ DONE;
+}
+ [(set_attr "type" "fp")])
+
+(define_insn "trunctfdf2_internal2"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
(float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))]
- "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_XL_COMPAT
&& TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"fadd %0,%1,%L1"
- [(set_attr "type" "fp")
- (set_attr "length" "4")])
+ [(set_attr "type" "fp")])
(define_insn_and_split "trunctfsf2"
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
@@ -11364,11 +11386,70 @@
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f")
(match_operand:TF 2 "gpc_reg_operand" "f")))]
- "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && !TARGET_XL_COMPAT
&& TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"fcmpu %0,%1,%2\;bne %0,$+8\;fcmpu %0,%L1,%L2"
[(set_attr "type" "fpcompare")
(set_attr "length" "12")])
+
+(define_insn_and_split "*cmptf_internal2"
+ [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
+ (compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f")
+ (match_operand:TF 2 "gpc_reg_operand" "f")))
+ (clobber (match_scratch:DF 3 "=f"))
+ (clobber (match_scratch:DF 4 "=f"))
+ (clobber (match_scratch:DF 5 "=f"))
+ (clobber (match_scratch:DF 6 "=f"))
+ (clobber (match_scratch:DF 7 "=f"))
+ (clobber (match_scratch:DF 8 "=f"))
+ (clobber (match_scratch:DF 9 "=f"))
+ (clobber (match_scratch:DF 10 "=f"))]
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_XL_COMPAT
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 3) (match_dup 13))
+ (set (match_dup 4) (match_dup 14))
+ (set (match_dup 9) (abs:DF (match_dup 5)))
+ (set (match_dup 0) (compare:CCFP (match_dup 9) (match_dup 3)))
+ (set (pc) (if_then_else (ne (match_dup 0) (const_int 0))
+ (label_ref (match_dup 11))
+ (pc)))
+ (set (match_dup 0) (compare:CCFP (match_dup 5) (match_dup 7)))
+ (set (pc) (label_ref (match_dup 12)))
+ (match_dup 11)
+ (set (match_dup 10) (minus:DF (match_dup 5) (match_dup 7)))
+ (set (match_dup 9) (minus:DF (match_dup 6) (match_dup 8)))
+ (set (match_dup 9) (plus:DF (match_dup 10) (match_dup 9)))
+ (set (match_dup 0) (compare:CCFP (match_dup 7) (match_dup 4)))
+ (match_dup 12)]
+{
+ REAL_VALUE_TYPE rv;
+ const int lo_word = FLOAT_WORDS_BIG_ENDIAN ? GET_MODE_SIZE (DFmode) : 0;
+ const int hi_word = FLOAT_WORDS_BIG_ENDIAN ? 0 : GET_MODE_SIZE (DFmode);
+
+ operands[5] = simplify_gen_subreg (DFmode, operands[1], TFmode, hi_word);
+ operands[6] = simplify_gen_subreg (DFmode, operands[1], TFmode, lo_word);
+ operands[7] = simplify_gen_subreg (DFmode, operands[2], TFmode, hi_word);
+ operands[8] = simplify_gen_subreg (DFmode, operands[2], TFmode, lo_word);
+ operands[11] = gen_label_rtx ();
+ operands[12] = gen_label_rtx ();
+ real_inf (&rv);
+ operands[13] = force_const_mem (DFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (rv, DFmode));
+ operands[14] = force_const_mem (DFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (dconst0,
+ DFmode));
+ if (TARGET_TOC)
+ {
+ operands[13] = gen_const_mem (DFmode,
+ create_TOC_reference (XEXP (operands[13], 0)));
+ operands[14] = gen_const_mem (DFmode,
+ create_TOC_reference (XEXP (operands[14], 0)));
+ set_mem_alias_set (operands[13], get_TOC_alias_set ());
+ set_mem_alias_set (operands[14], get_TOC_alias_set ());
+ }
+})
;; Now we have the scc insns. We can do some combinations because of the
;; way the machine works.
@@ -12589,25 +12670,25 @@
"")
(define_insn_and_split ""
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
(plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
(match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
(match_operand:SI 3 "reg_or_short_operand" "rI,rI")))]
"TARGET_32BIT"
"#"
- "TARGET_32BIT"
+ "&& !reg_overlap_mentioned_p (operands[0], operands[3])"
[(set (match_dup 0) (neg:SI (ltu:SI (match_dup 1) (match_dup 2))))
(set (match_dup 0) (minus:SI (match_dup 3) (match_dup 0)))]
"")
(define_insn_and_split ""
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
(plus:DI (ltu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
(match_operand:DI 2 "reg_or_neg_short_operand" "r,P"))
(match_operand:DI 3 "reg_or_short_operand" "rI,rI")))]
"TARGET_64BIT"
"#"
- "TARGET_64BIT"
+ "&& !reg_overlap_mentioned_p (operands[0], operands[3])"
[(set (match_dup 0) (neg:DI (ltu:DI (match_dup 1) (match_dup 2))))
(set (match_dup 0) (minus:DI (match_dup 3) (match_dup 0)))]
"")
@@ -13547,25 +13628,25 @@
"")
(define_insn_and_split ""
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
(plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "reg_or_short_operand" "rI"))
(match_operand:SI 3 "reg_or_short_operand" "rI")))]
"TARGET_32BIT"
"#"
- "TARGET_32BIT"
+ "&& !reg_overlap_mentioned_p (operands[0], operands[3])"
[(set (match_dup 0) (neg:SI (gtu:SI (match_dup 1) (match_dup 2))))
(set (match_dup 0) (minus:SI (match_dup 3) (match_dup 0)))]
"")
(define_insn_and_split ""
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
(plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
(match_operand:DI 2 "reg_or_short_operand" "rI"))
(match_operand:DI 3 "reg_or_short_operand" "rI")))]
"TARGET_64BIT"
"#"
- "TARGET_64BIT"
+ "&& !reg_overlap_mentioned_p (operands[0], operands[3])"
[(set (match_dup 0) (neg:DI (gtu:DI (match_dup 1) (match_dup 2))))
(set (match_dup 0) (minus:DI (match_dup 3) (match_dup 0)))]
"")
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index d2b3cef8054..db9abeae735 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -1,6 +1,6 @@
/* Target definitions for GNU compiler for PowerPC running System V.4
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004 Free Software Foundation, Inc.
+ 2004, 2005 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GCC.
@@ -1124,8 +1124,9 @@ extern int fixuplabelno;
%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
-#define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
-%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}"
+#define ENDFILE_LINUX_SPEC "\
+%{shared|pie:crtendS.o%s;:crtend.o%s} \
+%{mnewlib:ecrtn.o%s;:crtn.o%s}"
#define LINK_START_LINUX_SPEC ""
diff --git a/gcc/config/rs6000/t-aix43 b/gcc/config/rs6000/t-aix43
index ba6ead8113a..b163ef8af2c 100644
--- a/gcc/config/rs6000/t-aix43
+++ b/gcc/config/rs6000/t-aix43
@@ -46,21 +46,29 @@ SHLIB_EXT = .a
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \
@multilib_flags@ @shlib_objs@ -lc \
- `case @shlib_base_name@ in \
+ `case @multilib_dir@ in \
*pthread*) echo -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a ;; \
*) echo -lc ;; esac` ; \
- rm -f tmp-@shlib_base_name@.a ; \
- $(AR_CREATE_FOR_TARGET) tmp-@shlib_base_name@.a @multilib_dir@/shr.o ; \
- mv tmp-@shlib_base_name@.a @shlib_base_name@.a ; \
+ rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \
+ $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \
+ @multilib_dir@/shr.o ; \
+ mv @multilib_dir@/tmp-@shlib_base_name@.a \
+ @multilib_dir@/@shlib_base_name@.a ; \
rm -f @multilib_dir@/shr.o
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.a $$(DESTDIR)$$(slibdir)/
-SHLIB_LIBS = -lc `case @shlib_base_name@ in *pthread*) echo -lpthread ;; esac`
+SHLIB_INSTALL = \
+ $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \
+ $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \
+ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
+SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
-SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
+SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
SHLIB_NM_FLAGS = -Bpg -X32_64
+# GCC 128-bit long double support routines.
+LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
+
# Either 32-bit and 64-bit objects in archives.
AR_FLAGS_FOR_TARGET = -X32_64
diff --git a/gcc/config/rs6000/t-aix52 b/gcc/config/rs6000/t-aix52
index b3017c38ac3..6689eba56ab 100644
--- a/gcc/config/rs6000/t-aix52
+++ b/gcc/config/rs6000/t-aix52
@@ -27,21 +27,29 @@ SHLIB_EXT = .a
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-bE:@shlib_map_file@ -o @multilib_dir@/shr.o \
@multilib_flags@ @shlib_objs@ -lc \
- `case @shlib_base_name@ in \
+ `case @multilib_dir@ in \
*pthread*) echo -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a ;; \
*) echo -lc ;; esac` ; \
- rm -f tmp-@shlib_base_name@.a ; \
- $(AR_CREATE_FOR_TARGET) tmp-@shlib_base_name@.a @multilib_dir@/shr.o ; \
- mv tmp-@shlib_base_name@.a @shlib_base_name@.a ; \
+ rm -f @multilib_dir@/tmp-@shlib_base_name@.a ; \
+ $(AR_CREATE_FOR_TARGET) @multilib_dir@/tmp-@shlib_base_name@.a \
+ @multilib_dir@/shr.o ; \
+ mv @multilib_dir@/tmp-@shlib_base_name@.a \
+ @multilib_dir@/@shlib_base_name@.a ; \
rm -f @multilib_dir@/shr.o
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.a $$(DESTDIR)$$(slibdir)/
-SHLIB_LIBS = -lc `case @shlib_base_name@ in *pthread*) echo -lpthread ;; esac`
+SHLIB_INSTALL = \
+ $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@; \
+ $(INSTALL_DATA) @multilib_dir@/@shlib_base_name@.a \
+ $$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
+SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
-SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
+SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
SHLIB_NM_FLAGS = -Bpg -X32_64
+# GCC 128-bit long double support routines.
+LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
+
# Either 32-bit and 64-bit objects in archives.
AR_FLAGS_FOR_TARGET = -X32_64
diff --git a/gcc/config/rs6000/t-newas b/gcc/config/rs6000/t-newas
index a26ce39402c..d5d03a1c66f 100644
--- a/gcc/config/rs6000/t-newas
+++ b/gcc/config/rs6000/t-newas
@@ -27,6 +27,9 @@ MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT) \
mcpu?powerpc=mpowerpc-gpopt \
mcpu?powerpc=mpowerpc-gfxopt
+# GCC 128-bit long double support routines.
+LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
+
# Aix 3.2.x needs milli.exp for -mcpu=common
EXTRA_PARTS = milli.exp
milli.exp: $(srcdir)/config/rs6000/milli.exp
diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems
index 05d9a262364..3213c82f5c7 100644
--- a/gcc/config/rs6000/t-rtems
+++ b/gcc/config/rs6000/t-rtems
@@ -1,24 +1,38 @@
# Multilibs for powerpc RTEMS targets.
MULTILIB_OPTIONS = \
-mcpu=403/mcpu=505/mcpu=601/mcpu=602/mcpu=603/mcpu=603e/mcpu=604/mcpu=750/mcpu=821/mcpu=860 \
-Dmpc509/Dmpc8260 \
D_OLD_EXCEPTIONS \
+mcpu=403/mcpu=505/mcpu=601/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400 \
+Dmpc8260 \
msoft-float
MULTILIB_DIRNAMES = \
-m403 m505 m601 m602 m603 m603e m604 m750 m821 m860 \
-mpc509 \
-mpc8260 \
roe \
+m403 m505 m601 m603e m604 m860 m7400 \
+mpc8260 \
nof
MULTILIB_EXTRA_OPTS = mrelocatable-lib mno-eabi mstrict-align
# MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT}
-MULTILIB_MATCHES = ${MULTILIB_MATCHES_ENDIAN} \
- ${MULTILIB_MATCHES_SYSV} \
- mcpu?505/Dmpc505=mcpu?505/Dmpc509
+MULTILIB_MATCHES =
+MULTILIB_MATCHES += ${MULTILIB_MATCHES_ENDIAN}
+MULTILIB_MATCHES += ${MULTILIB_MATCHES_SYSV}
+# Map 405 to 403
+MULTILIB_MATCHES += mcpu?403=mcpu?405
+# Map 602, 603e, 603 to 603e
+MULTILIB_MATCHES += mcpu?603e=mcpu?602
+MULTILIB_MATCHES += mcpu?603e=mcpu?603
+# Map 801, 821, 823 to 860
+MULTILIB_MATCHES += mcpu?860=mcpu?801
+MULTILIB_MATCHES += mcpu?860=mcpu?821
+MULTILIB_MATCHES += mcpu?860=mcpu?823
+# Map 7450 to 7400
+MULTILIB_MATCHES += mcpu?7400=mcpu?7450
+
+# Map 750 to .
+MULTILIB_MATCHES += mcpu?750=
+
#
# RTEMS old/new-exceptions handling
@@ -33,29 +47,39 @@ MULTILIB_MATCHES = ${MULTILIB_MATCHES_ENDIAN} \
# Cpu-variants supporting new exception processing only
MULTILIB_NEW_EXCEPTIONS_ONLY = \
-*mcpu=505*/*D_OLD_EXCEPTIONS* \
-*mcpu=604*/*D_OLD_EXCEPTIONS* \
-*mcpu=750*/*D_OLD_EXCEPTIONS* \
-*mcpu=821*/*D_OLD_EXCEPTIONS* \
-*Dmpc8260*/*D_OLD_EXCEPTIONS* \
-*mcpu=860*/*D_OLD_EXCEPTIONS*
+D_OLD_EXCEPTIONS \
+D_OLD_EXCEPTIONS/msoft-float \
+D_OLD_EXCEPTIONS/mcpu=505 \
+D_OLD_EXCEPTIONS/mcpu=505/* \
+D_OLD_EXCEPTIONS/mcpu=601 \
+D_OLD_EXCEPTIONS/mcpu=601/* \
+D_OLD_EXCEPTIONS/mcpu=604 \
+D_OLD_EXCEPTIONS/mcpu=604/* \
+D_OLD_EXCEPTIONS/mcpu=750 \
+D_OLD_EXCEPTIONS/mcpu=750/* \
+D_OLD_EXCEPTIONS/mcpu=860 \
+D_OLD_EXCEPTIONS/mcpu=860/* \
+D_OLD_EXCEPTIONS/mcpu=7400 \
+D_OLD_EXCEPTIONS/mcpu=7400/* \
+D_OLD_EXCEPTIONS/*Dmpc*
# Soft-float only, default implies msoft-float
# NOTE: Must match with MULTILIB_MATCHES_FLOAT and MULTILIB_MATCHES
MULTILIB_SOFTFLOAT_ONLY = \
-mcpu=403/*msoft-float* \
-mcpu=821/*msoft-float* \
-mcpu=860/*msoft-float*
+*mcpu=401/*msoft-float* \
+*mcpu=403/*msoft-float* \
+*mcpu=405/*msoft-float* \
+*mcpu=801/*msoft-float* \
+*mcpu=821/*msoft-float* \
+*mcpu=823/*msoft-float* \
+*mcpu=860/*msoft-float*
# Hard-float only, take out msoft-float
MULTILIB_HARDFLOAT_ONLY = \
-mcpu=505/*msoft-float*
+*mcpu=505/*msoft-float*
MULTILIB_EXCEPTIONS =
-# Disallow -D_OLD_EXCEPTIONS without other options
-MULTILIB_EXCEPTIONS += D_OLD_EXCEPTIONS*
-
# Disallow -Dppc and -Dmpc without other options
MULTILIB_EXCEPTIONS += Dppc* Dmpc*
@@ -66,22 +90,10 @@ ${MULTILIB_HARDFLOAT_ONLY}
# Special rules
# Take out all variants we don't want
-MULTILIB_EXCEPTIONS += mcpu=403/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=403/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=505/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=505/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=601/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=601/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=602/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=602/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=603/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=603/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=603e/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=604/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=604/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=750/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=750/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=821/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=821/Dmpc8260*
-MULTILIB_EXCEPTIONS += mcpu=860/Dmpc509*
-MULTILIB_EXCEPTIONS += mcpu=860/Dmpc8260*
+MULTILIB_EXCEPTIONS += *mcpu=403/Dmpc*
+MULTILIB_EXCEPTIONS += *mcpu=505/Dmpc*
+MULTILIB_EXCEPTIONS += *mcpu=601/Dmpc*
+MULTILIB_EXCEPTIONS += *mcpu=604/Dmpc*
+MULTILIB_EXCEPTIONS += *mcpu=750/Dmpc*
+MULTILIB_EXCEPTIONS += *mcpu=860/Dmpc*
+MULTILIB_EXCEPTIONS += *mcpu=7400/Dmpc*
diff --git a/gcc/config/s390/linux-unwind.h b/gcc/config/s390/linux-unwind.h
index 3713f1821a9..088afb71820 100644
--- a/gcc/config/s390/linux-unwind.h
+++ b/gcc/config/s390/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for S/390 Linux.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@ the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file with other programs, and to distribute
+those programs without any restriction coming from the use of this
+file. (The General Public License restrictions do apply in other
+respects; for example, they cover modification of the file, and
+distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index f9be9cf0a6f..a5896e878d2 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -5437,7 +5437,7 @@ s390_alloc_pool (void)
pool->label = gen_label_rtx ();
pool->first_insn = NULL_RTX;
pool->pool_insn = NULL_RTX;
- pool->insns = BITMAP_XMALLOC ();
+ pool->insns = BITMAP_ALLOC (NULL);
pool->size = 0;
return pool;
@@ -5464,7 +5464,7 @@ s390_free_pool (struct constant_pool *pool)
free (c);
}
- BITMAP_XFREE (pool->insns);
+ BITMAP_FREE (pool->insns);
free (pool);
}
@@ -5821,7 +5821,7 @@ s390_chunkify_start (void)
/* Find all labels that are branched into
from an insn belonging to a different chunk. */
- far_labels = BITMAP_XMALLOC ();
+ far_labels = BITMAP_ALLOC (NULL);
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
@@ -5918,7 +5918,7 @@ s390_chunkify_start (void)
}
- BITMAP_XFREE (far_labels);
+ BITMAP_FREE (far_labels);
/* Recompute insn addresses. */
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 9a80e818ae9..a6b7a3afd51 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -612,20 +612,22 @@ extern int current_function_outgoing_args_size;
the argument area. */
#define FIRST_PARM_OFFSET(FNDECL) 0
+/* Defining this macro makes __builtin_frame_address(0) and
+ __builtin_return_address(0) work with -fomit-frame-pointer. */
+#define INITIAL_FRAME_ADDRESS_RTX \
+ (TARGET_PACKED_STACK ? \
+ plus_constant (arg_pointer_rtx, -UNITS_PER_WORD) : \
+ plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET))
+
/* The return address of the current frame is retrieved
from the initial value of register RETURN_REGNUM.
For frames farther back, we use the stack slot where
the corresponding RETURN_REGNUM register was saved. */
+#define DYNAMIC_CHAIN_ADDRESS(FRAME) \
+ (TARGET_PACKED_STACK ? \
+ plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) : (FRAME))
-#define DYNAMIC_CHAIN_ADDRESS(FRAME) \
- (TARGET_PACKED_STACK ? \
- ((FRAME) != hard_frame_pointer_rtx ? \
- plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_WORD) : \
- plus_constant (arg_pointer_rtx, -UNITS_PER_WORD)) : \
- ((FRAME) != hard_frame_pointer_rtx ? (FRAME) : \
- plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET)))
-
-#define RETURN_ADDR_RTX(COUNT, FRAME) \
+#define RETURN_ADDR_RTX(COUNT, FRAME) \
s390_return_addr_rtx ((COUNT), DYNAMIC_CHAIN_ADDRESS ((FRAME)))
/* In 31-bit mode, we need to mask off the high bit of return addresses. */
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 4b8b58ad45c..a0b9a3143a0 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -514,7 +514,7 @@
"s390_match_ccmode (insn, CCTmode) && TARGET_64BIT"
"@
cgr\t%0,%1
- cghi\t%0,%c1
+ cghi\t%0,%h1
cg\t%0,%1
#"
[(set_attr "op_type" "RRE,RI,RXY,SS")])
@@ -526,7 +526,7 @@
"s390_match_ccmode (insn, CCTmode)"
"@
cr\t%0,%1
- chi\t%0,%c1
+ chi\t%0,%h1
c\t%0,%1
cy\t%0,%1
#"
@@ -552,7 +552,7 @@
"s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
"@
cgr\t%0,%1
- cghi\t%0,%c1
+ cghi\t%0,%h1
cg\t%0,%1"
[(set_attr "op_type" "RRE,RI,RXY")])
@@ -573,7 +573,7 @@
"s390_match_ccmode(insn, CCSmode)"
"@
cr\t%0,%1
- chi\t%0,%c1
+ chi\t%0,%h1
c\t%0,%1
cy\t%0,%1"
[(set_attr "op_type" "RR,RI,RX,RXY")])
@@ -2660,6 +2660,27 @@
; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
;
+(define_insn "*llgt_sidi"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
+ (const_int 2147483647)))]
+ "TARGET_64BIT"
+ "llgt\t%0,%1"
+ [(set_attr "op_type" "RXE")])
+
+(define_insn_and_split "*llgt_sidi_split"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
+ (const_int 2147483647)))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0)
+ (and:DI (subreg:DI (match_dup 1) 0)
+ (const_int 2147483647)))]
+ "")
+
(define_insn "*llgt_sisi"
[(set (match_operand:SI 0 "register_operand" "=d,d")
(and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
@@ -2702,27 +2723,6 @@
(const_int 2147483647)))]
"")
-(define_insn "*llgt_sidi"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
- (const_int 2147483647)))]
- "TARGET_64BIT"
- "llgt\t%0,%1"
- [(set_attr "op_type" "RXE")])
-
-(define_insn_and_split "*llgt_sidi_split"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
- (const_int 2147483647)))
- (clobber (reg:CC 33))]
- "TARGET_64BIT"
- "#"
- "&& reload_completed"
- [(set (match_dup 0)
- (and:DI (subreg:DI (match_dup 1) 0)
- (const_int 2147483647)))]
- "")
-
;
; zero_extendqidi2 instruction pattern(s)
;
@@ -2776,7 +2776,7 @@
(define_insn "*zero_extendhisi2_64"
[(set (match_operand:SI 0 "register_operand" "=d")
(zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
- "TARGET_64BIT"
+ "TARGET_ZARCH"
"llgh\t%0,%1"
[(set_attr "op_type" "RXY")])
@@ -2784,7 +2784,7 @@
[(set (match_operand:SI 0 "register_operand" "=&d")
(zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
(clobber (reg:CC 33))]
- "!TARGET_64BIT"
+ "!TARGET_ZARCH"
"#"
"&& reload_completed"
[(set (match_dup 0) (const_int 0))
diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
index 82370e231e6..6ca9d567886 100644
--- a/gcc/config/sh/linux-unwind.h
+++ b/gcc/config/sh/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for SH Linux.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file with other programs, and to distribute
+those programs without any restriction coming from the use of this
+file. (The General Public License restrictions do apply in other
+respects; for example, they cover modification of the file, and
+distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 0617b2c3b5c..9587b5373aa 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -9855,7 +9855,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
if (! basic_block_info)
init_flow ();
rtl_register_cfg_hooks ();
- find_basic_blocks (insns, max_reg_num (), dump_file);
+ find_basic_blocks (insns);
life_analysis (dump_file, PROP_FINAL);
split_all_insns (1);
diff --git a/gcc/config/sh/t-linux b/gcc/config/sh/t-linux
index 71e96f53157..777d157909e 100644
--- a/gcc/config/sh/t-linux
+++ b/gcc/config/sh/t-linux
@@ -23,21 +23,23 @@ SHLIB_MAPFILES = \
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,--soname=$(SHLIB_SONAME) \
-Wl,--version-script=$(SHLIB_MAP) \
- -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
- rm -f $(SHLIB_SOLINK) && \
- if [ -f $(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
+ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
else true; fi && \
- mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
+ mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
(echo "/* GNU ld script"; \
echo " Use the shared library, but some functions are only in"; \
echo " the static library. */"; \
echo "GROUP ( $(SHLIB_SONAME) libgcc.a )" \
- ) > $(SHLIB_SOLINK)
+ ) > $(SHLIB_DIR)/$(SHLIB_SOLINK)
SHLIB_INSTALL = \
$$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_NAME) \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
- $(INSTALL_DATA) $(SHLIB_SOLINK) \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SOLINK) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
diff --git a/gcc/config/sparc/linux-unwind.h b/gcc/config/sparc/linux-unwind.h
index 3ce967d9171..55e26265681 100644
--- a/gcc/config/sparc/linux-unwind.h
+++ b/gcc/config/sparc/linux-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for SPARC Linux.
- Copyright 2004 Free Software Foundation, Inc.
+ Copyright 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8,6 +8,14 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file with other programs, and to distribute
+those programs without any restriction coming from the use of this
+file. (The General Public License restrictions do apply in other
+respects; for example, they cover modification of the file, and
+distribution when not linked into another program.)
+
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
diff --git a/gcc/config/sparc/t-elf b/gcc/config/sparc/t-elf
index 027940b10e4..6868736a178 100644
--- a/gcc/config/sparc/t-elf
+++ b/gcc/config/sparc/t-elf
@@ -24,6 +24,6 @@ INSTALL_LIBGCC = install-multilib
# Assemble startup files.
crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o crti.o -x assembler $(srcdir)/config/sparc/sol2-ci.asm
+ $(GCC_FOR_TARGET) -c -o crti.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-ci.asm
crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
- $(GCC_FOR_TARGET) -c -o crtn.o -x assembler $(srcdir)/config/sparc/sol2-cn.asm
+ $(GCC_FOR_TARGET) -c -o crtn.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-cn.asm
diff --git a/gcc/config/t-libunwind-elf b/gcc/config/t-libunwind-elf
index 428bc43ed2e..1fa8aa25251 100644
--- a/gcc/config/t-libunwind-elf
+++ b/gcc/config/t-libunwind-elf
@@ -5,25 +5,26 @@ LIBUNWIND = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c
LIBUNWINDDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
SHLIBUNWIND_SOVERSION = 7
-SHLIBUNWIND_SONAME = @shlib_so_name@.so.$(SHLIBUNWIND_SOVERSION)
-SHLIBUNWIND_NAME = @shlib_base_name@.so.$(SHLIBUNWIND_SOVERSION)
+SHLIBUNWIND_SONAME = @shlib_base_name@.so.$(SHLIBUNWIND_SOVERSION)
SHLIBUNWIND_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared \
-nodefaultlibs -Wl,-h,$(SHLIBUNWIND_SONAME) \
- -Wl,-z,text -Wl,-z,defs -o $(SHLIBUNWIND_NAME).tmp \
+ -Wl,-z,text -Wl,-z,defs -o $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).tmp \
@multilib_flags@ $(SHLIB_OBJS) -lc && \
- rm -f $(SHLIB_SOLINK) && \
- if [ -f $(SHLIBUNWIND_NAME) ]; then \
- mv -f $(SHLIBUNWIND_NAME) $(SHLIBUNWIND_NAME).backup; \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) \
+ $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).backup; \
else true; fi && \
- mv $(SHLIBUNWIND_NAME).tmp $(SHLIBUNWIND_NAME) && \
- $(LN_S) $(SHLIBUNWIND_NAME) $(SHLIB_SOLINK)
+ mv $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME).tmp \
+ $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) && \
+ $(LN_S) $(SHLIBUNWIND_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIBUNWIND_INSTALL = \
$$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIBUNWIND_NAME) \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIBUNWIND_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIBUNWIND_SONAME) \
diff --git a/gcc/config/t-slibgcc-darwin b/gcc/config/t-slibgcc-darwin
index 66d4e777dd5..46fb36f2bc3 100644
--- a/gcc/config/t-slibgcc-darwin
+++ b/gcc/config/t-slibgcc-darwin
@@ -4,29 +4,30 @@ SHLIB_REVISION = 0
SHLIB_VERSTRING = -compatibility_version $(SHLIB_MINOR) -current_version $(SHLIB_MINOR).$(SHLIB_REVISION)
SHLIB_EXT = .dylib
SHLIB_SOLINK = @shlib_base_name@.dylib
-SHLIB_SONAME = @shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
-SHLIB_NAME = @shlib_base_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
+SHLIB_SONAME = @shlib_base_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
+SHLIB_DIR = @multilib_dir@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
-Wl,-install_name,$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME) \
- -Wl,-flat_namespace -o $(SHLIB_NAME).tmp \
+ -Wl,-flat_namespace -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \
-Wl,-exported_symbols_list,$(SHLIB_MAP) \
$(SHLIB_VERSTRING) \
@multilib_flags@ $(SHLIB_OBJS) -lc && \
- rm -f $(SHLIB_SOLINK) && \
- if [ -f $(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
else true; fi && \
- mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
- $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+ mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
+ $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_NAME) \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIB_SONAME) \
diff --git a/gcc/config/t-slibgcc-elf-ver b/gcc/config/t-slibgcc-elf-ver
index e70647aa831..346143c5c53 100644
--- a/gcc/config/t-slibgcc-elf-ver
+++ b/gcc/config/t-slibgcc-elf-ver
@@ -4,28 +4,30 @@
SHLIB_EXT = .so
SHLIB_SOLINK = @shlib_base_name@.so
SHLIB_SOVERSION = 1
-SHLIB_SONAME = @shlib_so_name@.so.$(SHLIB_SOVERSION)
-SHLIB_NAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
+SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
+SHLIB_DIR = @multilib_dir@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_LC = -lc
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,--soname=$(SHLIB_SONAME) \
-Wl,--version-script=$(SHLIB_MAP) \
- -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
- rm -f $(SHLIB_SOLINK) && \
- if [ -f $(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
+ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
else true; fi && \
- mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
- $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+ mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
+ $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_NAME) \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIB_SONAME) \
diff --git a/gcc/config/t-slibgcc-sld b/gcc/config/t-slibgcc-sld
index 64c147806c9..02d21c6de67 100644
--- a/gcc/config/t-slibgcc-sld
+++ b/gcc/config/t-slibgcc-sld
@@ -2,27 +2,28 @@
SHLIB_EXT = .so
SHLIB_SOLINK = @shlib_base_name@.so
-SHLIB_SONAME = @shlib_so_name@.so.1
-SHLIB_NAME = @shlib_base_name@.so.1
+SHLIB_SONAME = @shlib_base_name@.so.1
SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
+SHLIB_DIR = @multilib_dir@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \
- -Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME).tmp \
+ -Wl,-M,$(SHLIB_MAP) -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \
@multilib_flags@ $(SHLIB_OBJS) -lc && \
- rm -f $(SHLIB_SOLINK) && \
- if [ -f $(SHLIB_NAME) ]; then \
- mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+ if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
+ mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
+ $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
else true; fi && \
- mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
- $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+ mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
+ $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
- $(INSTALL_DATA) $(SHLIB_NAME) \
+ $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIB_SONAME) \
diff --git a/gcc/configure b/gcc/configure
index 08868418fd2..a59f4520531 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_subdir host_subdir target_subdir gcc_version_trigger gcc_version_full gcc_version GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags WERROR nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path GMPLIBS GMPINC LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_subdir host_subdir target_subdir gcc_version_trigger gcc_version_full gcc_version GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags WERROR nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file PACKAGE VERSION USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS cc_for_cross_gnattools CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path GMPLIBS GMPINC LIBOBJS LTLIBOBJS'
ac_subst_files='language_hooks'
# Initialize some variables set by options.
@@ -1032,7 +1032,7 @@ esac
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi
- cd $ac_popdir
+ cd "$ac_popdir"
done
fi
@@ -2401,8 +2401,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2460,8 +2459,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2577,8 +2575,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2632,8 +2629,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2678,8 +2674,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2723,8 +2718,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3146,8 +3140,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3218,8 +3211,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3278,8 +3270,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3361,8 +3352,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3532,8 +3522,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3598,8 +3587,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3661,8 +3649,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3702,8 +3689,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3759,8 +3745,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3800,8 +3785,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3865,8 +3849,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3897,10 +3880,8 @@ See \`config.log' for more details." >&2;}
esac
else
if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
+echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
@@ -4012,8 +3993,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4075,8 +4055,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4116,8 +4095,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4173,8 +4151,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4214,8 +4191,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4279,8 +4255,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4311,10 +4286,8 @@ See \`config.log' for more details." >&2;}
esac
else
if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
+echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
@@ -4426,8 +4399,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4489,8 +4461,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4530,8 +4501,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4587,8 +4557,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4628,8 +4597,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4693,8 +4661,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4725,10 +4692,8 @@ See \`config.log' for more details." >&2;}
esac
else
if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
+echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
@@ -4840,8 +4805,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4903,8 +4867,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4944,8 +4907,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5001,8 +4963,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5042,8 +5003,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5107,8 +5067,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5139,10 +5098,8 @@ See \`config.log' for more details." >&2;}
esac
else
if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
+echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
@@ -5255,8 +5212,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5318,8 +5274,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5359,8 +5314,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5416,8 +5370,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5457,8 +5410,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5522,8 +5474,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5554,10 +5505,8 @@ See \`config.log' for more details." >&2;}
esac
else
if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
+echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
@@ -5671,8 +5620,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5734,8 +5682,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5775,8 +5722,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5832,8 +5778,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5873,8 +5818,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5938,8 +5882,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5970,10 +5913,8 @@ See \`config.log' for more details." >&2;}
esac
else
if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
+echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
@@ -6089,8 +6030,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -6140,8 +6080,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -6199,8 +6138,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -6418,8 +6356,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -7389,7 +7326,7 @@ if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then
else
ac_prog_version=`$MAKEINFO --version 2>&1 |
sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
- echo "configure:7392: version of makeinfo is $ac_prog_version" >&5
+ echo "configure:7329: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
4.[2-9]*)
@@ -7644,8 +7581,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -7715,8 +7651,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -7881,8 +7816,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -7943,8 +7877,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8014,8 +7947,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8290,8 +8222,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8364,8 +8295,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8406,8 +8336,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8609,8 +8538,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8684,8 +8612,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8739,8 +8666,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8818,8 +8744,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8873,8 +8798,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -8942,8 +8866,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -9073,8 +8996,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -9195,8 +9117,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -9547,8 +9468,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -9665,8 +9585,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -9778,8 +9697,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -9937,8 +9855,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -10810,8 +10727,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -10861,8 +10777,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -10952,8 +10867,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11022,8 +10936,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11086,8 +10999,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11190,8 +11102,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11276,8 +11187,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11346,8 +11256,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11422,8 +11331,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11506,8 +11414,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11583,8 +11490,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11650,8 +11556,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -11787,8 +11692,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -12097,8 +12001,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -12364,8 +12267,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -12419,8 +12321,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -12533,6 +12434,11 @@ case "$LN_S" in
;;
esac
+# This is a terrible hack which will go away when a gnattools directory
+# is created.
+cc_for_cross_gnattools=${CC}
+
+
out_object_file=`basename $out_file .c`.o
tm_file_list=
@@ -16096,6 +16002,7 @@ s,@XGETTEXT@,$XGETTEXT,;t t
s,@GMSGFMT@,$GMSGFMT,;t t
s,@POSUB@,$POSUB,;t t
s,@CATALOGS@,$CATALOGS,;t t
+s,@cc_for_cross_gnattools@,$cc_for_cross_gnattools,;t t
s,@CROSS@,$CROSS,;t t
s,@ALL@,$ALL,;t t
s,@SYSTEM_HEADER_DIR@,$SYSTEM_HEADER_DIR,;t t
@@ -16343,11 +16250,6 @@ esac
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
@@ -16386,6 +16288,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
fi;;
esac
done` || { (exit 1); exit 1; }
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 937676a573f..6c81f210474 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1519,6 +1519,11 @@ case "$LN_S" in
;;
esac
+# This is a terrible hack which will go away when a gnattools directory
+# is created.
+cc_for_cross_gnattools=${CC}
+AC_SUBST(cc_for_cross_gnattools)
+
out_object_file=`basename $out_file .c`.o
tm_file_list=
diff --git a/gcc/conflict.c b/gcc/conflict.c
index 1cd58600b1e..eff057e3fa4 100644
--- a/gcc/conflict.c
+++ b/gcc/conflict.c
@@ -208,7 +208,7 @@ conflict_graph_add (conflict_graph graph, int reg1, int reg2)
arc->smaller = smaller;
arc->larger = larger;
- /* Link the conflict into into two lists, one for each reg. */
+ /* Link the conflict into two lists, one for each reg. */
arc->smaller_next = graph->neighbor_heads[smaller];
graph->neighbor_heads[smaller] = arc;
arc->larger_next = graph->neighbor_heads[larger];
diff --git a/gcc/convert.c b/gcc/convert.c
index 005d3e2089b..f900ace21e4 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -1,6 +1,6 @@
/* Utility routines for data type conversion for GCC.
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1997, 1998,
- 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 32e664533d5..d11e3215997 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,284 @@
+2005-02-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * call.c, class.c, cp-tree.h, decl2.c, error.c, init.c, mangle.c,
+ parser.c: Fix comment typo(s).
+
+2005-02-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/20175
+ * decl.c (reshape_init): Don't warn about missing braces if STRING_CST
+ initializes a char/wchar_t array.
+
+2005-02-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19878
+ * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
+ with internal linkage.
+
+2005-02-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * decl.c (grokvardecl): Don't exempt anonymous types from having
+ linkage for variables that have linkage other than "C".
+
+2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-objcp-common.h, error.c: Update copyright.
+
+2005-02-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20073
+ * decl.c (start_decl_1): Don't clear TREE_READONLY.
+ (cp_finish_decl): Likewise.
+ (complete_vars): Call cp_apply_type_quals_to_decl.
+ * typeck.c (cp_apply_type_quals): Avoid setting TREE_READONLY in
+ cases where that's not valid.
+
+ PR c++/19991
+ * init.c (integral_constant_value): Iterate if the value of a decl
+ is itself a constant.
+
+ PR c++/20152
+ * parser.c (cp_parser_class_head): Check for redefintions here.
+ * semantics.c (begin_class_definition): Not here.
+
+ PR c++/20153
+ * decl2.c (build_anon_union_vars): Add type parameter.
+ (finish_anon_union): Pass it.
+
+ PR c++/20148
+ * error.c (dump_expr): Do not print the body of a BIND_EXPR.
+ Handle STATEMENT_LIST.
+
+ PR c++/19883
+ * parser.c (cp_parser_direct_declarator): Always complain about
+ non-constant array bounds when in a function scope.
+ * semantics.c (finish_id_expression): Do not mark dependent names
+ as non-constant.
+
+2005-02-21 Douglas Gregor <dgregor@cs.indiana.edu>
+
+ PR c++/19076
+ PR c++/6628
+ * cp-tree.h (cp_apply_type_quals_to_decl): Declared.
+ * decl.c (grokdeclarator): Pedwarn about qualifying a function
+ type.
+ Add qualifiers when declaring a typedef of a function type.
+ Member function pointers pick up the qualifiers of the typedef
+ used to declare them.
+ Don't complain about creating cv-qualified function types.
+ Complain about qualified function typedefs that are used to
+ declare non-static member functions or free functions.
+ Use cp_apply_type_quals_to_decl.
+ (start_preparsed_function): Use cp_apply_type_quals_to_decl.
+ (grokclassfn): Use cp_apply_type_quals_to_decl.
+ * error.c (dump_type_suffix): Print qualifiers for function
+ types.
+ * pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
+ (tsubst): When substituting a function type into a member
+ pointer type, pass along the qualifiers.
+ (unify): Unify member pointers to member function pointers.
+ * tree.c (cp_build_qualified_type_real): Function types may be
+ qualified. This includes restrict qualifiers.
+ * typeck.c (cp_apply_type_quals_to_decl): New function to replace
+ use of c_apply_type_quals_to_decl. Drops qualifiers that are being
+ added to function types.
+
+2005-02-20 Zack Weinberg <zack@codesourcery.com>
+
+ PR 18785
+ * cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
+ c_common_to_target_charset. Delete bogus comment.
+
+2005-02-18 Richard Henderson <rth@redhat.com>
+
+ PR libstdc++/10606
+ * except.c (do_get_exception_ptr): New.
+ (expand_start_catch_block): Use it.
+
+2005-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (start_decl_1): Only check TYPE_NEEDS_CONSTRUCTING
+ if type is not error_mark_node.
+
+2005-01-20 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/19508
+ * decl2.c (grokfield): Do not apply attributes to template parameters
+ as they are ignored by tsubst anyway.
+
+2005-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/19813
+ * decl.c (start_decl_1): Clear TREE_READONLY flag if
+ its type has TYPE_NEEDS_CONSTRUCTING.
+ (complete_vars): Likewise.
+
+2005-02-17 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/20028
+ * class.c (finish_struct): Initialize TYPE_SIZE_UNIT of a
+ template along with TYPE_SIZE.
+
+ PR c++/20022
+ * semantics.c (perform_deferred_access_checks): Use
+ get_deferred_access_checks to get the top of the stack.
+
+2005-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17788
+ * class.c (add_implicitly_declared_members, check_field_decl)
+ (check_field_decls, check_bases): Remove arguments, tests and
+ assignments of cant_have_default_ctor-related variables.
+
+2005-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * decl2.c (mark_used): Set the source location of the used decl to
+ the current input location here...
+ * method.c (synthesize_method): ... not here. Set input_location
+ from the decl instead.
+
+2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19608
+ * parser.c (cp_parser_late_parsing_for_member): Use
+ current_function_decl as scope to push to and from.
+
+ PR c++/19884
+ * pt.c (check_explicit_specialization): Make sure namespace
+ binding lookup found an overloaded function.
+ (lookup_template_function): Just assert FNS is an overloaded
+ function.
+
+ PR c++/19895
+ * decl.c (grokdeclarator): Check for error mark node in ptrmem
+ construction.
+
+2005-02-14 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17816
+ * decl.c (redeclaration_error_message): Report redefinition of
+ pure virtual function.
+
+2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19891
+ * class.c (build_simple_base_path): Build the component_ref
+ directly.
+ (update_vtable_entry_for_fn): Walk the covariant's binfo chain
+ rather than using lookup_base.
+ * search.c (dfs_walk_once): Add non-recursive assert check.
+ * typeck.c (build_class_member_access_expr): It is possible for
+ the member type to be both const and volatile.
+
+2005-02-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/14479
+ PR c++/19487
+ * pt.c (maybe_check_template_type): Remove.
+ * cp-tree.h (maybe_check_template_type): Remove prototype.
+ * name-lookup.c (maybe_process_template_type_declaration): Don't
+ use maybe_check_template_type.
+
+2005-02-11 Richard Henderson <rth@redhat.com>
+
+ PR c++/19632
+ * pt.c (get_mostly_instantiated_function_type): Save and restore
+ flag_access_control instead of push/pop_access_scope.
+
+2005-02-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19755
+ * decl.c (reshape_init): Issue warnings about missing braces.
+
+2005-02-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cp-tree.def, except.c, ptree.c: Update copyright.
+
+2005-02-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19811
+ * call.c (build_op_delete_call): Check COMPLETE_TYPE_P before
+ attempting name lookup.
+
+ * parser.c (cp_parser_unqualified_id): Initialize type_decl.
+
+ PR c++/19787
+ * call.c (initialize_reference): Robustify.
+
+ PR ++/19732
+ * decl.c (grokdeclarator): Check for invalid use of destructor
+ names.
+
+ PR c++/19762
+ * parser.c (cp_parser_unqualified_id): Avoid creating destructor
+ names with invalid types.
+
+ PR c++/19826
+ * parser.c (cp_parser_direct_declarator): Allow type-dependent
+ expressions as array bounds.
+
+ PR c++/19739
+ * parser.c (cp_parser_attributes_list): Allow empty lists.
+
+2005-02-08 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19733
+ * class.c (add_method): Don't set TYPE_HAS_DESTRUCTOR.
+ (check_bases): Give warnings about a base class with a
+ non-virtual destructor, even if it is implicit.
+ (finish_struct_bits): Don't copy TYPE_HAS_DESTRUCTOR.
+ (maybe_warn_about_overly_private_class): Don't use
+ TYPE_HAS_DESTRUCTOR.
+ (finish_struct_methods): Don't set TYPE_HAS_DESTRUCTOR.
+ (check_for_override): Give it external linkage.
+ (add_implicitly_declared_members): Generate destructors lazily.
+ (check_field_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
+ TYPE_HAS_DESTRUCTOR.
+ (check_bases_and_members): Call check_methods before
+ check_field_decls.
+ (check_bases_and_members): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR, not
+ TYPE_HAS_DESTRUCTOR.
+ (finish_struct_1): Do not use TYPE_HAS_DESTRUCTOR.
+ * cp-tree.def (PSEUDO_DTOR_EXPR): Document.
+ * cp-tree.h (TYPE_HAS_DESTRUCTOR): Remove.
+ (lang_type_class): Add lazy_destructor.
+ (CLASSTYPE_LAZY_DESTRUCTOR): New macro.
+ (CLASSTYPE_DESTRUCTORS): Robustify.
+ (TYPE_HAS_DESTRUCTOR): Remove.
+ (check_for_override): Declare.
+ (build_vbase_delete): Remove.
+ * cvt.c (convert_to_void): Issue errors about pseudo-destructor
+ expressions.
+ * decl.c (cxx_maybe_build_cleanup): Remove dead code.
+ * except.c (dtor_nothrow): Lazily create destructors if necessary.
+ (build_throw): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR.
+ * init.c (build_delete): Lazily create destructors, if necessary.
+ (build_vbase_delete): Remove.
+ * method.c (locate_dtor): Simplify.
+ (implicitly_declare_fn): Add support for destructors.
+ * parser.c (cp_parser_lookup_name): Lazily create destructors, if
+ necessary.
+ * pt.c (check_explicit_specialization): Don't use
+ TYPE_HAS_DESTRUCTOR.
+ (instantiate_class_template): Likewise.
+ * ptree.c (cxx_print_type): Don't print TYPE_HAS_DESTRUCTOR.
+ * rtti.c (emit_support_tinfos): Robustify.
+ * search.c (lookup_fnfields_1): Lazily create destructors.
+ * typeck.c (build_class_member_access_expr): Remove
+ PSEUDO_DTOR_EXPR handling.
+ (lookup_destructor): Likewise.
+
+2005-02-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cxx-pretty-print.c, cxx-pretty-print.h, decl.h: Update
+ copyright.
+
+2005-02-07 Mark Mitchell <mark@codesourcery.com>
+
+ * parser.c (cp_lexer_start_debugging): Avoid arithmetic operations
+ on boolean variables.
+ (cp_lexer_stop_debugging): Likewise.
+
2005-02-03 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/17401
@@ -13,13 +294,13 @@
* cp-tree.h (builtin_valid_in_constant_expr_p): Declare.
* parser.c (cp_parser_postfix_expression): Accept function call in
constant expression if builtin_valid_in_constant_expr_p is true
- for that function.
+ for that function.
* pt.c (value_dependent_expression_p): Handle CALL_EXPRs properly.
* semantics.c (finish_id_expression): Accept function call in constant
expression if builtin_valid_in_constant_expr_p is true for that
- function.
+ function.
* tree.c (builtin_valid_in_constant_expr_p): New.
-
+
2005-02-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/17413
@@ -52,7 +333,7 @@
2005-02-01 Alexandre Oliva <aoliva@redhat.com>
* parser.c (cp_parser_template_id): Revert comment patch too.
-
+
PR c++/18757
PR c++/19366
PR c++/19499
@@ -136,7 +417,7 @@
PR c++/19349
* name-lookup.c (pushdecl_namespace_level): Avoid accessing free'd
- memory.
+ memory.
2005-01-28 Mark Mitchell <mark@codesourcery.com>
@@ -209,7 +490,7 @@
* typeck.c (comptypes): Handle return code from objc_comptypes
correctly.
-
+
2005-01-19 Kazu Hirata <kazu@cs.umass.edu>
* cp-tree.h, name-lookup.h: Remove unused prototypes.
@@ -372,8 +653,8 @@
names.
(cp_parser_member_declaration): Adjust call to make_id_declarator.
(cp_parser_check_declarator_template_parameters): Do not expect a
- SCOPE_REF.
-
+ SCOPE_REF.
+
* decl.c (duplicate_decls): Call ggc_free on declarations we will
not be needing any longer.
@@ -427,7 +708,7 @@
* call.c (build_this): In templates, do not bother with
build_unary_op.
* typeck.c (unary_complex_lvalue): In a template, always refuse
- simplifications.
+ simplifications.
PR c++/18492
* cp-gimplify.c (cp_genericize): Relax assertion.
@@ -437,7 +718,7 @@
PR c++/18257
* rtti.c (emit_support_tinfos): On systems without weak symbols,
- emit the runtime library type-info objects as non-COMDAT.
+ emit the runtime library type-info objects as non-COMDAT.
2004-12-21 Mark Mitchell <mark@codesourcery.com>
@@ -480,14 +761,14 @@
* error.c (dump_expr): <STRING_CST case> Add parens, if needed.
* cp-tree.def (TEMPLATE_TYPE_PARM,
- BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder
+ BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder
for better code efficiency.
* cp-tree.h (CLASS_TYPE_P): Short circuit IS_AGGR_TYPE check.
(CAN_HAVE_FULL_LANG_DECL_P): Reorder for better optimization.
(INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P,
INTEGRAL_OR_ENUMERATION_TYPE_P, SCALAR_TYPE_P,
CP_AGGREGATE_TYPE_P, TYPE_PTROB_P, TYPE_REF_OBJ_P,
- TYPE_PTROBV_P): Likewise.
+ TYPE_PTROBV_P): Likewise.
PR c++/18975
* method.c (do_build_copy_constructor): Refactor. Don't const
@@ -499,7 +780,7 @@
PR c++/19044
* decl.c (make_rtl_for_nonlocal_decl): Use
set_builtin_user_assembler_name.
-
+
2004-12-19 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (note_decl_for_pch): New function.
@@ -636,7 +917,7 @@
PR c++/18514
* name-lookup.c (do_nonmember_using_decl): A real function
declaration takes precedence over an anticipated declaration.
-
+
2004-12-09 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* parser.c (cp_parser_member_declaration): Fix comment typo.
@@ -665,7 +946,7 @@
2004-12-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/18100
- * decl.c (lookup_and_check_tag): Diagnose nested class with
+ * decl.c (lookup_and_check_tag): Diagnose nested class with
the same name as enclosing class.
2004-12-08 Nathan Sidwell <nathan@codesourcery.com>
@@ -854,7 +1135,7 @@
make_typename_type.
(tsubst_decl): Do not pre-substitute the type of the declaration.
(tsubst): Hand off declarations more quickly. Adjust call to
- make_typename_type.
+ make_typename_type.
PR c++/18512
* parser.c (cp_parser_postfix_dot_deref_expression): Robustify.
@@ -950,7 +1231,7 @@
(lookup_type_scope): Adjust declaration.
* decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type):
Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE.
- (start_enum): Likewise. Add assertion test that NAME is
+ (start_enum): Likewise. Add assertion test that NAME is
IDENTIFIER_NODE. Use anonymous name for dummy ENUMERAL_TYPE in
case of error.
* cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations.
@@ -1090,7 +1371,7 @@
PR c++/18407
* pt.c (tsubst_copy_and_build): Handle qualified names used from a
derived class correctly.
-
+
* decl2.c (import_export_decl): Fix typo in comment.
* tree.c (pod_type_p): Likewise.
@@ -1100,7 +1381,7 @@
2004-11-10 Adam Nemet <anemet@lnxw.com>
- PR middle-end/18160
+ PR middle-end/18160
* typeck.c (cxx_mark_addressable): Issue an error if address of an
explicit register variable is requested.
@@ -1138,7 +1419,7 @@
search.c, typeck2.c: Fix comment formatting.
2004-11-04 Ulrich Weigand <uweigand@de.ibm.com>
-
+
PR tree-optimization/18184
* cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers
of different modes or alias-all flags as equivalent.
@@ -1190,26 +1471,26 @@
2004-10-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert diagnostics to use quoting flag q 9/n
- * typeck.c (build_x_unary_op, convert_member_func_to_ptr,
+ * typeck.c (build_x_unary_op, convert_member_func_to_ptr,
get_delta_difference): Use new quotation style.
* repo.c (reopen_repo_file_for_write): Likewise.
* pt.c (do_type_instantiation): Likewise.
- * parser.c (cp_parser_diagnose_invalid_type_name):
- * name-lookup.c (push_overloaded_decl, set_decl_namespace):
+ * parser.c (cp_parser_diagnose_invalid_type_name):
+ * name-lookup.c (push_overloaded_decl, set_decl_namespace):
* error.c (cp_print_error_function,
print_instantiation_full_context): Likewise.
- * decl.c (define_label, grok_reference_init,
- maybe_deduce_size_from_array_init, revert_static_member_fn):
+ * decl.c (define_label, grok_reference_init,
+ maybe_deduce_size_from_array_init, revert_static_member_fn):
* decl2.c (check_classfn): Likewise.
- * class.c (add_method, check_field_decls, layout_class_type,
+ * class.c (add_method, check_field_decls, layout_class_type,
resolve_address_of_overloaded_function): Likewise.
* call.c (build_x_va_arg, build_over_call): Likewise.
2004-10-31 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert diagnostics to use quoting flag q 8/n
- * cvt.c (cp_convert_to_pointer, warn_ref_binding,
- convert_to_reference, ocp_convert, convert_to_void
+ * cvt.c (cp_convert_to_pointer, warn_ref_binding,
+ convert_to_reference, ocp_convert, convert_to_void
cp_convert_to_pointer): Use new quotation style.
2004-10-31 Mark Mitchell <mark@codesourcery.com>
@@ -1217,7 +1498,7 @@
PR c++/15172
* typeck2.c (store_init_value): Use split_nonconstant_init even
for types that require construction.
-
+
1004-10-28 Matt Austern <austern@apple.com>
PR c++/17542
@@ -1226,7 +1507,7 @@
and remove static qualifier.
* decl.c (shadow_tag): Warn about ignored attributes in class/struct/
union/enum declaration.
-
+
2004-10-29 Kazu Hirata <kazu@cs.umass.edu>
* pt.c: Fix a comment typo.
@@ -1249,7 +1530,7 @@
PR c++/14124
* decl.c (finish_enum): Handle packed attribute.
* parser.c (cp_parser_enum_specifier): Process trailing attributes.
-
+
2004-10-28 Mark Mitchell <mark@codesourcery.com>
PR c++/17132
@@ -1389,7 +1670,7 @@
(build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter.
Allow function pointer conversions that DR195 suggests.
(build_reinterpret_cast, build_c_cast): Update
- build_reinterpret_cast_1 calls.
+ build_reinterpret_cast_1 calls.
2004-10-20 Kazu Hirata <kazu@cs.umass.edu>
@@ -1510,7 +1791,7 @@
* parser.c (cp_parser_simple_declaration): Do not diagnose invalid
type names if we have already found a valid type.
(cp_parser_member_declaration): Likewise.
-
+
PR c++/17916
* parser.c (cp_parser_member_specification_opt): Handle
CPP_PRAGMA.
@@ -1543,7 +1824,7 @@
* pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
(for_each_template_parm): Convert from htab_t to pointer_set_t.
* tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
-
+
2004-10-13 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17661
@@ -1575,7 +1856,7 @@
2004-10-11 Mark Mitchell <mark@codesourcery.com>
PR c++/15786
- * parser.c (cp_parser_declarator): Add member_p parameter.
+ * parser.c (cp_parser_declarator): Add member_p parameter.
(cp_parser_condition): Adjust calls to cp_parser_declarator.
(cp_parser_explicit_instantiation): Likewise.
(cp_parser_init_declarator): Likewise.
@@ -1659,34 +1940,34 @@
2004-10-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert diagnostics to use quoting flag q 7/n
- * typeck.c (composite_pointer_type_r, composite_pointer_type,
- cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr,
- string_conv_p, build_class_member_access_expr,
- build_class_member_access_expr, lookup_destructor,
- finish_class_member_access_expr, build_indirect_ref,
- get_member_function_from_ptrfunc, build_function_call,
- convert_arguments, build_binary_op, pointer_diff, build_unary_op,
- check_for_casting_away_constness, build_static_cast,
- build_reinterpret_cast, build_const_cast, build_c_cast,
- build_modify_expr, get_delta_difference, build_ptrmemfunc,
- dubious_conversion_warnings, convert_for_assignment,
- convert_for_initialization,
- maybe_warn_about_returning_address_of_local, check_return_expr):
+ * typeck.c (composite_pointer_type_r, composite_pointer_type,
+ cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr,
+ string_conv_p, build_class_member_access_expr,
+ build_class_member_access_expr, lookup_destructor,
+ finish_class_member_access_expr, build_indirect_ref,
+ get_member_function_from_ptrfunc, build_function_call,
+ convert_arguments, build_binary_op, pointer_diff, build_unary_op,
+ check_for_casting_away_constness, build_static_cast,
+ build_reinterpret_cast, build_const_cast, build_c_cast,
+ build_modify_expr, get_delta_difference, build_ptrmemfunc,
+ dubious_conversion_warnings, convert_for_assignment,
+ convert_for_initialization,
+ maybe_warn_about_returning_address_of_local, check_return_expr):
Use quoting marks.
- * typeck2.c (error_not_base_type, readonly_error,
- abstract_virtuals_error, cxx_incomplete_type_diagnostic,
- store_init_value, digest_init, build_x_arrow,
+ * typeck2.c (error_not_base_type, readonly_error,
+ abstract_virtuals_error, cxx_incomplete_type_diagnostic,
+ store_init_value, digest_init, build_x_arrow,
build_m_component_ref, require_complete_eh_spec_types): Likewise.
- * tree.c (cp_build_qualified_type_real,
+ * tree.c (cp_build_qualified_type_real,
handle_java_interface_attribute, handle_init_priority_attribute):
Likewise.
- * semantics.c (finish_asm_stmt, finish_non_static_data_member,
- finish_pseudo_destructor_expr,
- check_template_template_default_arg, begin_class_definition,
- finish_base_specifier, qualified_name_lookup_error,
+ * semantics.c (finish_asm_stmt, finish_non_static_data_member,
+ finish_pseudo_destructor_expr,
+ check_template_template_default_arg, begin_class_definition,
+ finish_base_specifier, qualified_name_lookup_error,
finish_id_expression, finish_typeof): Likewise.
* search.c (lookup_base, check_final_overrider,
@@ -1722,7 +2003,7 @@
PR c++/17685
* decl.c (grokdeclarator): Disallow declarations of operators as
non-functions.
-
+
2004-10-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/17868
@@ -1828,20 +2109,20 @@
2004-10-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert diagnostics to use quoting flag q 6/n
- * pt.c (finish_member_template_decl, check_specialization_scope,
- maybe_process_partial_specialization, determine_specialization,
- check_explicit_specialization, maybe_check_template_type,
- process_partial_specialization, check_default_tmpl_args,
- push_template_decl_real, redeclare_class_template,
- convert_nontype_argument, coerce_template_parms,
- lookup_template_class, push_tinst_level,
- instantiate_class_template, tsubst_arg_types,
- tsubst_function_type, tsubst, tsubst_qualified_id,
- tsubst_copy_and_build, check_instantiated_args,
- do_decl_instantiation, do_type_instantiation,
- invalid_nontype_parm_type_p, check_specialization_namespace,
- convert_template_argument, determine_specialization,
- check_template_shadow, tsubst_decl
+ * pt.c (finish_member_template_decl, check_specialization_scope,
+ maybe_process_partial_specialization, determine_specialization,
+ check_explicit_specialization, maybe_check_template_type,
+ process_partial_specialization, check_default_tmpl_args,
+ push_template_decl_real, redeclare_class_template,
+ convert_nontype_argument, coerce_template_parms,
+ lookup_template_class, push_tinst_level,
+ instantiate_class_template, tsubst_arg_types,
+ tsubst_function_type, tsubst, tsubst_qualified_id,
+ tsubst_copy_and_build, check_instantiated_args,
+ do_decl_instantiation, do_type_instantiation,
+ invalid_nontype_parm_type_p, check_specialization_namespace,
+ convert_template_argument, determine_specialization,
+ check_template_shadow, tsubst_decl
instantiate_pending_templates): Use quoting marks.
2004-10-05 Nathan Sidwell <nathan@codesourcery.com>
@@ -1853,41 +2134,41 @@
2004-10-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert diagnostics to use quoting flag q 5/n
- * parser.c (cp_parser_name_lookup_error,
- cp_parser_diagnose_invalid_type_name,
- cp_parser_primary_expression, cp_parser_unqualified_id,
- cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement,
- cp_parser_jump_statement, cp_parser_simple_declaration,
- cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id,
- cp_parser_type_parameter, cp_parser_template_id,
- cp_parser_template_name, cp_parser_direct_declarator,
- cp_parser_parameter_declaration_list, cp_parser_class_head,
- cp_parser_base_specifier, cp_parser_lookup_name,
- cp_parser_late_parsing_default_args,
- cp_parser_optional_template_keyword
- cp_parser_elaborated_type_specifier, cp_parser_check_class_key,
+ * parser.c (cp_parser_name_lookup_error,
+ cp_parser_diagnose_invalid_type_name,
+ cp_parser_primary_expression, cp_parser_unqualified_id,
+ cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement,
+ cp_parser_jump_statement, cp_parser_simple_declaration,
+ cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id,
+ cp_parser_type_parameter, cp_parser_template_id,
+ cp_parser_template_name, cp_parser_direct_declarator,
+ cp_parser_parameter_declaration_list, cp_parser_class_head,
+ cp_parser_base_specifier, cp_parser_lookup_name,
+ cp_parser_late_parsing_default_args,
+ cp_parser_optional_template_keyword
+ cp_parser_elaborated_type_specifier, cp_parser_check_class_key,
cp_parser_check_access_in_redeclaration): Use quoting marks.
- * name-lookup.c (supplement_binding, pushdecl,
- check_for_out_of_scope_variable, validate_nonmember_using_decl,
- do_nonmember_using_decl, lookup_tag, set_decl_namespace,
- push_namespace, do_namespace_alias, do_using_directive,
+ * name-lookup.c (supplement_binding, pushdecl,
+ check_for_out_of_scope_variable, validate_nonmember_using_decl,
+ do_nonmember_using_decl, lookup_tag, set_decl_namespace,
+ push_namespace, do_namespace_alias, do_using_directive,
ambiguous_decl, lookup_namespace_name, add_function): Likewise.
* method.c (use_thunk): Likewise.
- * lex.c (unqualified_name_lookup_error,
+ * lex.c (unqualified_name_lookup_error,
unqualified_fn_lookup_error): Likewise.
2004-10-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
Convert diagnostics to use quoting flag q 4/n
- * except.c (decl_is_java_type, build_throw,
- is_admissible_throw_operand, check_handlers_1, check_handlers):
+ * except.c (decl_is_java_type, build_throw,
+ is_admissible_throw_operand, check_handlers_1, check_handlers):
Use quoting formats.
* friend.c (add_friend, make_friend_class, do_friend): Likewise.
- * init.c (sort_mem_initializers, emit_mem_initializers,
- member_init_ok_or_else, expand_member_init, is_aggr_type,
+ * init.c (sort_mem_initializers, emit_mem_initializers,
+ member_init_ok_or_else, expand_member_init, is_aggr_type,
build_offset_ref, build_java_class_ref): Likewise.
2004-10-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
@@ -1896,20 +2177,20 @@
* decl.c (pop_label, duplicate_decls, redeclaration_error_message,
redeclaration_error_message, lookup_label, check_goto,
make_typename_type, make_unbound_class_template,
- fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1,
- grok_reference_init, layout_var_decl, maybe_commonize_var,
- check_for_uninitialized_const_var, reshape_init_array,
+ fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1,
+ grok_reference_init, layout_var_decl, maybe_commonize_var,
+ check_for_uninitialized_const_var, reshape_init_array,
reshape_init, check_initializer, cp_finish_decl,
- member_function_or_else, bad_specifiers, grokfndecl, grokvardecl,
- check_static_variable_definition, compute_array_index_type,
- create_array_type_for_decl, check_special_function_return_type,
- grokdeclarator, check_default_argument, grokparms,
- grok_ctor_properties, grok_op_properties,
- check_elaborated_type_specifier, xref_tag, finish_enum,
- build_enumerator, check_function_type, start_preparsed_function,
+ member_function_or_else, bad_specifiers, grokfndecl, grokvardecl,
+ check_static_variable_definition, compute_array_index_type,
+ create_array_type_for_decl, check_special_function_return_type,
+ grokdeclarator, check_default_argument, grokparms,
+ grok_ctor_properties, grok_op_properties,
+ check_elaborated_type_specifier, xref_tag, finish_enum,
+ build_enumerator, check_function_type, start_preparsed_function,
store_parm_decls): Use quoting formats.
- * decl2.c (grok_array_decl, delete_sanity, check_member_template,
- check_java_method, check_classfn, finish_static_data_member_decl,
+ * decl2.c (grok_array_decl, delete_sanity, check_member_template,
+ check_java_method, check_classfn, finish_static_data_member_decl,
grokfield, grokbitfield, grok_function_init,
build_anon_union_vars, coerce_new_type, coerce_delete_type,
check_default_args): Likewise.
@@ -2034,7 +2315,7 @@
header that was implicitly extern "C".
(cp_parser_declaration_seq_opt): Push/pop lang context as
required by the token's and parser's implicit_extern_c.
-
+
2004-09-27 Mark Mitchell <mark@codesourcery.com>
PR c++/17585
@@ -2056,11 +2337,11 @@
(dfs_depth_post, dfs_depth_q): Remove.
(find_final_overrider): Use number of vbase classes as depth
bound.
-
+
* cp-tree.h (types_overlap_p): Remove.
* search.c (struct overlap_info): Remove.
(dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove.
-
+
* pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove.
(get_template_base_recursive): Remove. Replace with ...
(get_template_base_r): ... this.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 599aecfa84a..5737e4fc0a1 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -538,8 +538,7 @@ build_conv (conversion_kind code, tree type, conversion *from)
}
/* Build a representation of the identity conversion from EXPR to
- itself. The TYPE should match the the type of EXPR, if EXPR is
- non-NULL. */
+ itself. The TYPE should match the type of EXPR, if EXPR is non-NULL. */
static conversion *
build_identity_conv (tree type, tree expr)
@@ -2450,7 +2449,7 @@ print_z_candidates (struct z_candidate *candidates)
/* USER_SEQ is a user-defined conversion sequence, beginning with a
USER_CONV. STD_SEQ is the standard conversion sequence applied to
the result of the conversion function to convert it to the final
- desired type. Merge the the two sequences into a single sequence,
+ desired type. Merge the two sequences into a single sequence,
and return the merged sequence. */
static conversion *
@@ -3924,7 +3923,9 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
fnname = ansi_opname (code);
- if (IS_AGGR_TYPE (type) && !global_p)
+ if (CLASS_TYPE_P (type)
+ && COMPLETE_TYPE_P (complete_type (type))
+ && !global_p)
/* In [class.free]
If the result of the lookup is ambiguous or inaccessible, or if
@@ -6534,81 +6535,86 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup)
/*inner=*/-1,
/*issue_conversion_warnings=*/true,
/*c_cast_p=*/false);
- if (!real_lvalue_p (expr))
+ if (error_operand_p (expr))
+ expr = error_mark_node;
+ else
{
- tree init;
- tree type;
-
- /* Create the temporary variable. */
- type = TREE_TYPE (expr);
- var = make_temporary_var_for_ref_to_temp (decl, type);
- layout_decl (var, 0);
- /* If the rvalue is the result of a function call it will be
- a TARGET_EXPR. If it is some other construct (such as a
- member access expression where the underlying object is
- itself the result of a function call), turn it into a
- TARGET_EXPR here. It is important that EXPR be a
- TARGET_EXPR below since otherwise the INIT_EXPR will
- attempt to make a bitwise copy of EXPR to initialize
- VAR. */
- if (TREE_CODE (expr) != TARGET_EXPR)
- expr = get_target_expr (expr);
- /* Create the INIT_EXPR that will initialize the temporary
- variable. */
- init = build2 (INIT_EXPR, type, var, expr);
- if (at_function_scope_p ())
+ if (!real_lvalue_p (expr))
{
- add_decl_expr (var);
- *cleanup = cxx_maybe_build_cleanup (var);
-
- /* We must be careful to destroy the temporary only
- after its initialization has taken place. If the
- initialization throws an exception, then the
- destructor should not be run. We cannot simply
- transform INIT into something like:
-
- (INIT, ({ CLEANUP_STMT; }))
-
- because emit_local_var always treats the
- initializer as a full-expression. Thus, the
- destructor would run too early; it would run at the
- end of initializing the reference variable, rather
- than at the end of the block enclosing the
- reference variable.
-
- The solution is to pass back a cleanup expression
- which the caller is responsible for attaching to
- the statement tree. */
+ tree init;
+ tree type;
+
+ /* Create the temporary variable. */
+ type = TREE_TYPE (expr);
+ var = make_temporary_var_for_ref_to_temp (decl, type);
+ layout_decl (var, 0);
+ /* If the rvalue is the result of a function call it will be
+ a TARGET_EXPR. If it is some other construct (such as a
+ member access expression where the underlying object is
+ itself the result of a function call), turn it into a
+ TARGET_EXPR here. It is important that EXPR be a
+ TARGET_EXPR below since otherwise the INIT_EXPR will
+ attempt to make a bitwise copy of EXPR to initialize
+ VAR. */
+ if (TREE_CODE (expr) != TARGET_EXPR)
+ expr = get_target_expr (expr);
+ /* Create the INIT_EXPR that will initialize the temporary
+ variable. */
+ init = build2 (INIT_EXPR, type, var, expr);
+ if (at_function_scope_p ())
+ {
+ add_decl_expr (var);
+ *cleanup = cxx_maybe_build_cleanup (var);
+
+ /* We must be careful to destroy the temporary only
+ after its initialization has taken place. If the
+ initialization throws an exception, then the
+ destructor should not be run. We cannot simply
+ transform INIT into something like:
+
+ (INIT, ({ CLEANUP_STMT; }))
+
+ because emit_local_var always treats the
+ initializer as a full-expression. Thus, the
+ destructor would run too early; it would run at the
+ end of initializing the reference variable, rather
+ than at the end of the block enclosing the
+ reference variable.
+
+ The solution is to pass back a cleanup expression
+ which the caller is responsible for attaching to
+ the statement tree. */
+ }
+ else
+ {
+ rest_of_decl_compilation (var, /*toplev=*/1, at_eof);
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
+ static_aggregates = tree_cons (NULL_TREE, var,
+ static_aggregates);
+ }
+ /* Use its address to initialize the reference variable. */
+ expr = build_address (var);
+ if (base_conv_type)
+ expr = convert_to_base (expr,
+ build_pointer_type (base_conv_type),
+ /*check_access=*/true,
+ /*nonnull=*/true);
+ expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), init, expr);
}
else
- {
- rest_of_decl_compilation (var, /*toplev=*/1, at_eof);
- if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
- static_aggregates = tree_cons (NULL_TREE, var,
- static_aggregates);
- }
- /* Use its address to initialize the reference variable. */
- expr = build_address (var);
+ /* Take the address of EXPR. */
+ expr = build_unary_op (ADDR_EXPR, expr, 0);
+ /* If a BASE_CONV was required, perform it now. */
if (base_conv_type)
- expr = convert_to_base (expr,
- build_pointer_type (base_conv_type),
- /*check_access=*/true,
- /*nonnull=*/true);
- expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), init, expr);
+ expr = (perform_implicit_conversion
+ (build_pointer_type (base_conv_type), expr));
+ expr = build_nop (type, expr);
}
- else
- /* Take the address of EXPR. */
- expr = build_unary_op (ADDR_EXPR, expr, 0);
- /* If a BASE_CONV was required, perform it now. */
- if (base_conv_type)
- expr = (perform_implicit_conversion
- (build_pointer_type (base_conv_type), expr));
- expr = build_nop (type, expr);
}
else
/* Perform the conversion. */
expr = convert_like (conv, expr);
-
+
/* Free all the conversions we allocated. */
obstack_free (&conversion_obstack, p);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 84db9e2169b..f6ba914cb84 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -116,7 +116,6 @@ static void modify_vtable_entry (tree, tree, tree, tree, tree *);
static void finish_struct_bits (tree);
static int alter_access (tree, tree, tree);
static void handle_using_decl (tree, tree);
-static void check_for_override (tree, tree);
static tree dfs_modify_vtables (tree, void *);
static tree modify_all_vtables (tree, tree);
static void determine_primary_bases (tree);
@@ -124,7 +123,7 @@ static void finish_struct_methods (tree);
static void maybe_warn_about_overly_private_class (tree);
static int method_name_cmp (const void *, const void *);
static int resort_method_name_cmp (const void *, const void *);
-static void add_implicitly_declared_members (tree, int, int, int);
+static void add_implicitly_declared_members (tree, int, int);
static tree fixed_type_or_null (tree, int *, int *);
static tree resolve_address_of_overloaded_function (tree, tree, tsubst_flags_t,
bool, tree);
@@ -134,13 +133,13 @@ static tree build_vtbl_initializer (tree, tree, tree, tree, int *);
static int count_fields (tree);
static int add_fields_to_record_type (tree, struct sorted_fields_type*, int);
static void check_bitfield_decl (tree);
-static void check_field_decl (tree, tree, int *, int *, int *, int *);
-static void check_field_decls (tree, tree *, int *, int *, int *);
+static void check_field_decl (tree, tree, int *, int *, int *);
+static void check_field_decls (tree, tree *, int *, int *);
static tree *build_base_field (record_layout_info, tree, splay_tree, tree *);
static void build_base_fields (record_layout_info, splay_tree, tree *);
static void check_methods (tree);
static void remove_zero_width_bit_fields (tree);
-static void check_bases (tree, int *, int *, int *);
+static void check_bases (tree, int *, int *);
static void check_bases_and_members (tree);
static tree create_vtable_ptr (tree, tree *);
static void include_empty_classes (record_layout_info);
@@ -409,7 +408,18 @@ build_simple_base_path (tree expr, tree binfo)
if (d_binfo == NULL_TREE)
{
+ tree temp;
+
gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type);
+
+ /* Transform `(a, b).x' into `(*(a, &b)).x', `(a ? b : c).x'
+ into `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only
+ an lvalue in the frontend; only _DECLs and _REFs are lvalues
+ in the backend. */
+ temp = unary_complex_lvalue (ADDR_EXPR, expr);
+ if (temp)
+ expr = build_indirect_ref (temp, NULL);
+
return expr;
}
@@ -422,8 +432,27 @@ build_simple_base_path (tree expr, tree binfo)
if (TREE_CODE (field) == FIELD_DECL
&& DECL_FIELD_IS_BASE (field)
&& TREE_TYPE (field) == type)
- return build_class_member_access_expr (expr, field,
- NULL_TREE, false);
+ {
+ /* We don't use build_class_member_access_expr here, as that
+ has unnecessary checks, and more importantly results in
+ recursive calls to dfs_walk_once. */
+ int type_quals = cp_type_quals (TREE_TYPE (expr));
+
+ expr = build3 (COMPONENT_REF,
+ cp_build_qualified_type (type, type_quals),
+ expr, field, NULL_TREE);
+ expr = fold_if_not_in_template (expr);
+
+ /* Mark the expression const or volatile, as appropriate.
+ Even though we've dealt with the type above, we still have
+ to mark the expression itself. */
+ if (type_quals & TYPE_QUAL_CONST)
+ TREE_READONLY (expr) = 1;
+ if (type_quals & TYPE_QUAL_VOLATILE)
+ TREE_THIS_VOLATILE (expr) = 1;
+
+ return expr;
+ }
/* Didn't find the base field?!? */
gcc_unreachable ();
@@ -893,13 +922,16 @@ add_method (tree type, tree method)
else if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (method))
{
slot = CLASSTYPE_DESTRUCTOR_SLOT;
- TYPE_HAS_DESTRUCTOR (type) = 1;
if (TYPE_FOR_JAVA (type))
- error (DECL_ARTIFICIAL (method)
- ? "Java class %qT cannot have an implicit non-trivial destructor"
- : "Java class %qT cannot have a destructor",
- DECL_CONTEXT (method));
+ {
+ if (!DECL_ARTIFICIAL (method))
+ error ("Java class %qT cannot have a destructor", type);
+ else if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
+ error ("Java class %qT cannot have an implicit non-trivial "
+ "destructor",
+ type);
+ }
}
else
{
@@ -1175,14 +1207,12 @@ handle_using_decl (tree using_decl, tree t)
alter_access (t, fdecl, access);
}
-/* Run through the base classes of T, updating
- CANT_HAVE_DEFAULT_CTOR_P, CANT_HAVE_CONST_CTOR_P, and
- NO_CONST_ASN_REF_P. Also set flag bits in T based on properties of
- the bases. */
+/* Run through the base classes of T, updating CANT_HAVE_CONST_CTOR_P,
+ and NO_CONST_ASN_REF_P. Also set flag bits in T based on
+ properties of the bases. */
static void
check_bases (tree t,
- int* cant_have_default_ctor_p,
int* cant_have_const_ctor_p,
int* no_const_asn_ref_p)
{
@@ -1203,8 +1233,7 @@ check_bases (tree t,
/* Effective C++ rule 14. We only need to check TYPE_POLYMORPHIC_P
here because the case of virtual functions but non-virtual
dtor is handled in finish_struct_1. */
- if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype)
- && TYPE_HAS_DESTRUCTOR (basetype))
+ if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype))
warning ("base class %q#T has a non-virtual destructor", basetype);
/* If the base class doesn't have copy constructors or
@@ -1216,18 +1245,6 @@ check_bases (tree t,
if (TYPE_HAS_ASSIGN_REF (basetype)
&& !TYPE_HAS_CONST_ASSIGN_REF (basetype))
*no_const_asn_ref_p = 1;
- /* Similarly, if the base class doesn't have a default
- constructor, then the derived class won't have an
- automatically generated default constructor. */
- if (TYPE_HAS_CONSTRUCTOR (basetype)
- && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (basetype))
- {
- *cant_have_default_ctor_p = 1;
- if (! TYPE_HAS_CONSTRUCTOR (t))
- pedwarn ("base %qT with only non-default constructor in class "
- "without a constructor",
- basetype);
- }
if (BINFO_VIRTUAL_P (base_binfo))
/* A virtual base does not effect nearly emptiness. */
@@ -1406,7 +1423,6 @@ finish_struct_bits (tree t)
/* These fields are in the _TYPE part of the node, not in
the TYPE_LANG_SPECIFIC component, so they are not shared. */
TYPE_HAS_CONSTRUCTOR (variants) = TYPE_HAS_CONSTRUCTOR (t);
- TYPE_HAS_DESTRUCTOR (variants) = TYPE_HAS_DESTRUCTOR (t);
TYPE_NEEDS_CONSTRUCTING (variants) = TYPE_NEEDS_CONSTRUCTING (t);
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (variants)
= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t);
@@ -1540,8 +1556,8 @@ maybe_warn_about_overly_private_class (tree t)
/* Even if some of the member functions are non-private, the class
won't be useful for much if all the constructors or destructors
are private: such an object can never be created or destroyed. */
- if (TYPE_HAS_DESTRUCTOR (t)
- && TREE_PRIVATE (CLASSTYPE_DESTRUCTORS (t)))
+ fn = CLASSTYPE_DESTRUCTORS (t);
+ if (fn && TREE_PRIVATE (fn))
{
warning ("%q#T only defines a private destructor and has no friends",
t);
@@ -1693,11 +1709,6 @@ finish_struct_methods (tree t)
fn_fields = TREE_CHAIN (fn_fields))
DECL_IN_AGGR_P (fn_fields) = 0;
- if (TYPE_HAS_DESTRUCTOR (t) && !CLASSTYPE_DESTRUCTORS (t))
- /* We thought there was a destructor, but there wasn't. Some
- parse errors cause this anomalous situation. */
- TYPE_HAS_DESTRUCTOR (t) = 0;
-
/* Issue warnings about private constructors and such. If there are
no methods, then some public defaults are generated. */
maybe_warn_about_overly_private_class (t);
@@ -2001,6 +2012,9 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
also be converting to the return type of FN, we have to
combine the two conversions here. */
tree fixed_offset, virtual_offset;
+
+ over_return = TREE_TYPE (over_return);
+ base_return = TREE_TYPE (base_return);
if (DECL_THUNK_P (fn))
{
@@ -2016,32 +2030,47 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
overriding function. We will want the vbase offset from
there. */
virtual_offset = binfo_for_vbase (BINFO_TYPE (virtual_offset),
- TREE_TYPE (over_return));
- else if (!same_type_p (TREE_TYPE (over_return),
- TREE_TYPE (base_return)))
+ over_return);
+ else if (!same_type_ignoring_top_level_qualifiers_p
+ (over_return, base_return))
{
/* There was no existing virtual thunk (which takes
- precedence). */
- tree thunk_binfo;
- base_kind kind;
-
- thunk_binfo = lookup_base (TREE_TYPE (over_return),
- TREE_TYPE (base_return),
- ba_check | ba_quiet, &kind);
+ precedence). So find the binfo of the base function's
+ return type within the overriding function's return type.
+ We cannot call lookup base here, because we're inside a
+ dfs_walk, and will therefore clobber the BINFO_MARKED
+ flags. Fortunately we know the covariancy is valid (it
+ has already been checked), so we can just iterate along
+ the binfos, which have been chained in inheritance graph
+ order. Of course it is lame that we have to repeat the
+ search here anyway -- we should really be caching pieces
+ of the vtable and avoiding this repeated work. */
+ tree thunk_binfo, base_binfo;
+
+ /* Find the base binfo within the overriding function's
+ return type. */
+ for (base_binfo = TYPE_BINFO (base_return),
+ thunk_binfo = TYPE_BINFO (over_return);
+ !SAME_BINFO_TYPE_P (BINFO_TYPE (thunk_binfo),
+ BINFO_TYPE (base_binfo));
+ thunk_binfo = TREE_CHAIN (thunk_binfo))
+ continue;
- if (thunk_binfo && (kind == bk_via_virtual
- || !BINFO_OFFSET_ZEROP (thunk_binfo)))
+ /* See if virtual inheritance is involved. */
+ for (virtual_offset = thunk_binfo;
+ virtual_offset;
+ virtual_offset = BINFO_INHERITANCE_CHAIN (virtual_offset))
+ if (BINFO_VIRTUAL_P (virtual_offset))
+ break;
+
+ if (virtual_offset || !BINFO_OFFSET_ZEROP (thunk_binfo))
{
tree offset = convert (ssizetype, BINFO_OFFSET (thunk_binfo));
- if (kind == bk_via_virtual)
+ if (virtual_offset)
{
- /* We convert via virtual base. Find the virtual
- base and adjust the fixed offset to be from there. */
- while (!BINFO_VIRTUAL_P (thunk_binfo))
- thunk_binfo = BINFO_INHERITANCE_CHAIN (thunk_binfo);
-
- virtual_offset = thunk_binfo;
+ /* We convert via virtual base. Adjust the fixed
+ offset to be from there. */
offset = size_diffop
(offset, convert
(ssizetype, BINFO_OFFSET (virtual_offset)));
@@ -2284,7 +2313,7 @@ get_basefndecls (tree name, tree t)
a method declared virtual in the base class, then
mark this field as being virtual as well. */
-static void
+void
check_for_override (tree decl, tree ctype)
{
if (TREE_CODE (decl) == TEMPLATE_DECL)
@@ -2460,43 +2489,67 @@ maybe_add_class_template_decl_list (tree type, tree t, int friend_p)
}
/* Create default constructors, assignment operators, and so forth for
- the type indicated by T, if they are needed.
- CANT_HAVE_DEFAULT_CTOR, CANT_HAVE_CONST_CTOR, and
- CANT_HAVE_CONST_ASSIGNMENT are nonzero if, for whatever reason, the
- class cannot have a default constructor, copy constructor taking a
- const reference argument, or an assignment operator taking a const
- reference, respectively. If a virtual destructor is created, its
- DECL is returned; otherwise the return value is NULL_TREE. */
+ the type indicated by T, if they are needed. CANT_HAVE_CONST_CTOR,
+ and CANT_HAVE_CONST_ASSIGNMENT are nonzero if, for whatever reason,
+ the class cannot have a default constructor, copy constructor
+ taking a const reference argument, or an assignment operator taking
+ a const reference, respectively. */
static void
add_implicitly_declared_members (tree t,
- int cant_have_default_ctor,
int cant_have_const_cctor,
int cant_have_const_assignment)
{
- tree default_fn;
- tree implicit_fns = NULL_TREE;
- tree virtual_dtor = NULL_TREE;
- tree *f;
-
/* Destructor. */
- if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) && !TYPE_HAS_DESTRUCTOR (t))
+ if (!CLASSTYPE_DESTRUCTORS (t))
{
- default_fn = implicitly_declare_fn (sfk_destructor, t, /*const_p=*/0);
- check_for_override (default_fn, t);
+ /* In general, we create destructors lazily. */
+ CLASSTYPE_LAZY_DESTRUCTOR (t) = 1;
+ /* However, if the implicit destructor is non-trivial
+ destructor, we sometimes have to create it at this point. */
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t))
+ {
+ bool lazy_p = true;
- TREE_CHAIN (default_fn) = implicit_fns;
- implicit_fns = default_fn;
-
- if (DECL_VINDEX (default_fn))
- virtual_dtor = default_fn;
+ if (TYPE_FOR_JAVA (t))
+ /* If this a Java class, any non-trivial destructor is
+ invalid, even if compiler-generated. Therefore, if the
+ destructor is non-trivial we create it now. */
+ lazy_p = false;
+ else
+ {
+ tree binfo;
+ tree base_binfo;
+ int ix;
+
+ /* If the implicit destructor will be virtual, then we must
+ generate it now because (unfortunately) we do not
+ generate virtual tables lazily. */
+ binfo = TYPE_BINFO (t);
+ for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
+ {
+ tree base_type;
+ tree dtor;
+
+ base_type = BINFO_TYPE (base_binfo);
+ dtor = CLASSTYPE_DESTRUCTORS (base_type);
+ if (dtor && DECL_VIRTUAL_P (dtor))
+ {
+ lazy_p = false;
+ break;
+ }
+ }
+ }
+
+ /* If we can't get away with being lazy, generate the destructor
+ now. */
+ if (!lazy_p)
+ lazily_declare_fn (sfk_destructor, t);
+ }
}
- else
- /* Any non-implicit destructor is non-trivial. */
- TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) |= TYPE_HAS_DESTRUCTOR (t);
/* Default constructor. */
- if (! TYPE_HAS_CONSTRUCTOR (t) && ! cant_have_default_ctor)
+ if (! TYPE_HAS_CONSTRUCTOR (t))
{
TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 1;
CLASSTYPE_LAZY_DEFAULT_CTOR (t) = 1;
@@ -2521,29 +2574,6 @@ add_implicitly_declared_members (tree t,
TYPE_HAS_CONST_ASSIGN_REF (t) = !cant_have_const_assignment;
CLASSTYPE_LAZY_ASSIGNMENT_OP (t) = 1;
}
-
- /* Now, hook all of the new functions on to TYPE_METHODS,
- and add them to the CLASSTYPE_METHOD_VEC. */
- for (f = &implicit_fns; *f; f = &TREE_CHAIN (*f))
- {
- add_method (t, *f);
- maybe_add_class_template_decl_list (current_class_type, *f, /*friend_p=*/0);
- }
- if (abi_version_at_least (2))
- /* G++ 3.2 put the implicit destructor at the *beginning* of the
- list, which cause the destructor to be emitted in an incorrect
- location in the vtable. */
- TYPE_METHODS (t) = chainon (TYPE_METHODS (t), implicit_fns);
- else
- {
- if (warn_abi && virtual_dtor)
- warning ("vtable layout for class %qT may not be ABI-compliant "
- "and may change in a future version of GCC due to implicit "
- "virtual destructor",
- t);
- *f = TYPE_METHODS (t);
- TYPE_METHODS (t) = implicit_fns;
- }
}
/* Subroutine of finish_struct_1. Recursively count the number of fields
@@ -2667,7 +2697,6 @@ static void
check_field_decl (tree field,
tree t,
int* cant_have_const_ctor,
- int* cant_have_default_ctor,
int* no_const_asn_ref,
int* any_default_members)
{
@@ -2686,8 +2715,7 @@ check_field_decl (tree field,
for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
if (TREE_CODE (fields) == FIELD_DECL && !DECL_C_BIT_FIELD (field))
check_field_decl (fields, t, cant_have_const_ctor,
- cant_have_default_ctor, no_const_asn_ref,
- any_default_members);
+ no_const_asn_ref, any_default_members);
}
/* Check members with class type for constructors, destructors,
etc. */
@@ -2723,10 +2751,6 @@ check_field_decl (tree field,
if (!TYPE_HAS_CONST_ASSIGN_REF (type))
*no_const_asn_ref = 1;
-
- if (TYPE_HAS_CONSTRUCTOR (type)
- && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
- *cant_have_default_ctor = 1;
}
if (DECL_INITIAL (field) != NULL_TREE)
{
@@ -2749,10 +2773,6 @@ check_field_decl (tree field,
EMPTY_P
The class is empty, i.e., contains no non-static data members.
- CANT_HAVE_DEFAULT_CTOR_P
- This class cannot have an implicitly generated default
- constructor.
-
CANT_HAVE_CONST_CTOR_P
This class cannot have an implicitly generated copy constructor
taking a const reference.
@@ -2769,7 +2789,6 @@ check_field_decl (tree field,
static void
check_field_decls (tree t, tree *access_decls,
- int *cant_have_default_ctor_p,
int *cant_have_const_ctor_p,
int *no_const_asn_ref_p)
{
@@ -2913,7 +2932,6 @@ check_field_decls (tree t, tree *access_decls,
aggregate, initialization by a brace-enclosed list) is the
only way to initialize nonstatic const and reference
members. */
- *cant_have_default_ctor_p = 1;
TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
@@ -2961,7 +2979,6 @@ check_field_decls (tree t, tree *access_decls,
aggregate, initialization by a brace-enclosed list) is the
only way to initialize nonstatic const and reference
members. */
- *cant_have_default_ctor_p = 1;
TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
@@ -2990,7 +3007,6 @@ check_field_decls (tree t, tree *access_decls,
else
check_field_decl (x, t,
cant_have_const_ctor_p,
- cant_have_default_ctor_p,
no_const_asn_ref_p,
&any_default_members);
}
@@ -3012,7 +3028,7 @@ check_field_decls (tree t, tree *access_decls,
if (warn_ecpp
&& has_pointers
&& TYPE_HAS_CONSTRUCTOR (t)
- && TYPE_HAS_DESTRUCTOR (t)
+ && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
&& !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t)))
{
warning ("%q#T has pointer data members", t);
@@ -3489,7 +3505,7 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets)
return atend;
}
-/* Layout the the base given by BINFO in the class indicated by RLI.
+/* Layout the base given by BINFO in the class indicated by RLI.
*BASE_ALIGN is a running maximum of the alignments of
any base class. OFFSETS gives the location of empty base
subobjects. T is the most derived type. Return nonzero if the new
@@ -3660,6 +3676,9 @@ check_methods (tree t)
if (DECL_PURE_VIRTUAL_P (x))
VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (t), x);
}
+ /* All user-declared destructors are non-trivial. */
+ if (DECL_DESTRUCTOR_P (x))
+ TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1;
}
}
@@ -4013,36 +4032,34 @@ type_requires_array_cookie (tree type)
static void
check_bases_and_members (tree t)
{
- /* Nonzero if we are not allowed to generate a default constructor
- for this case. */
- int cant_have_default_ctor;
/* Nonzero if the implicitly generated copy constructor should take
a non-const reference argument. */
int cant_have_const_ctor;
- /* Nonzero if the the implicitly generated assignment operator
+ /* Nonzero if the implicitly generated assignment operator
should take a non-const reference argument. */
int no_const_asn_ref;
tree access_decls;
/* By default, we use const reference arguments and generate default
constructors. */
- cant_have_default_ctor = 0;
cant_have_const_ctor = 0;
no_const_asn_ref = 0;
/* Check all the base-classes. */
- check_bases (t, &cant_have_default_ctor, &cant_have_const_ctor,
+ check_bases (t, &cant_have_const_ctor,
&no_const_asn_ref);
- /* Check all the data member declarations. */
+ /* Check all the method declarations. */
+ check_methods (t);
+
+ /* Check all the data member declarations. We cannot call
+ check_field_decls until we have called check_bases check_methods,
+ as check_field_decls depends on TYPE_HAS_NONTRIVIAL_DESTRUCTOR
+ being set appropriately. */
check_field_decls (t, &access_decls,
- &cant_have_default_ctor,
&cant_have_const_ctor,
&no_const_asn_ref);
- /* Check all the method declarations. */
- check_methods (t);
-
/* A nearly-empty class has to be vptr-containing; a nearly empty
class contains just a vptr. */
if (!TYPE_CONTAINS_VPTR_P (t))
@@ -4057,13 +4074,14 @@ check_bases_and_members (tree t)
CLASSTYPE_NON_AGGREGATE (t)
|= (TYPE_HAS_CONSTRUCTOR (t) || TYPE_POLYMORPHIC_P (t));
CLASSTYPE_NON_POD_P (t)
- |= (CLASSTYPE_NON_AGGREGATE (t) || TYPE_HAS_DESTRUCTOR (t)
+ |= (CLASSTYPE_NON_AGGREGATE (t)
+ || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
|| TYPE_HAS_ASSIGN_REF (t));
TYPE_HAS_COMPLEX_ASSIGN_REF (t)
|= TYPE_HAS_ASSIGN_REF (t) || TYPE_CONTAINS_VPTR_P (t);
/* Synthesize any needed methods. */
- add_implicitly_declared_members (t, cant_have_default_ctor,
+ add_implicitly_declared_members (t,
cant_have_const_ctor,
no_const_asn_ref);
@@ -5007,17 +5025,22 @@ finish_struct_1 (tree t)
/* Build the VTT for T. */
build_vtt (t);
- if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && TYPE_HAS_DESTRUCTOR (t)
- && !DECL_VINDEX (CLASSTYPE_DESTRUCTORS (t)))
-
- {
- tree dtor = CLASSTYPE_DESTRUCTORS (t);
-
- /* Warn only if the dtor is non-private or the class has friends */
- if (!TREE_PRIVATE (dtor) ||
- (CLASSTYPE_FRIEND_CLASSES (t) ||
- DECL_FRIENDLIST (TYPE_MAIN_DECL (t))))
- warning ("%q#T has virtual functions but non-virtual destructor", t);
+ if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t))
+ {
+ tree dtor;
+
+ dtor = CLASSTYPE_DESTRUCTORS (t);
+ /* Warn only if the dtor is non-private or the class has
+ friends. */
+ if (/* An implicitly declared destructor is always public. And,
+ if it were virtual, we would have created it by now. */
+ !dtor
+ || (!DECL_VINDEX (dtor)
+ && (!TREE_PRIVATE (dtor)
+ || CLASSTYPE_FRIEND_CLASSES (t)
+ || DECL_FRIENDLIST (TYPE_MAIN_DECL (t)))))
+ warning ("%q#T has virtual functions but non-virtual destructor",
+ t);
}
complete_vars (t);
@@ -5088,6 +5111,7 @@ finish_struct (tree t, tree attributes)
finish_struct_methods (t);
TYPE_SIZE (t) = bitsize_zero_node;
+ TYPE_SIZE_UNIT (t) = size_zero_node;
/* We need to emit an error message if this type was used as a parameter
and it is an abstract type, even if it is a template. We construct
@@ -7656,8 +7680,8 @@ build_rtti_vtbl_entries (tree binfo, vtbl_init_data* vid)
*vid->last_init = build_tree_list (NULL_TREE, init);
vid->last_init = &TREE_CHAIN (*vid->last_init);
- /* Add the offset-to-top entry. It comes earlier in the vtable that
- the the typeinfo entry. Convert the offset to look like a
+ /* Add the offset-to-top entry. It comes earlier in the vtable than
+ the typeinfo entry. Convert the offset to look like a
function pointer, so that we can put it in the vtable. */
init = build_nop (vfunc_ptr_type_node, offset);
*vid->last_init = build_tree_list (NULL_TREE, init);
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 7a2a2343b7c..210a383e461 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -1,5 +1,5 @@
/* Language hooks common to C++ and ObjC++ front ends.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
This file is part of GCC.
@@ -159,6 +159,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to
#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
+#undef LANG_HOOKS_TO_TARGET_CHARSET
+#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 74f0d37e850..1abc77bfcad 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -1,7 +1,7 @@
/* This file contains the definitions and documentation for the
additional tree codes used in the GNU C++ compiler (see tree.def
for the standard codes).
- Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004,
+ Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005,
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
@@ -222,6 +222,18 @@ DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", tcc_expression, 2)
the original name, and the parameter is the FUNCTION_DECL. */
DEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0)
+/* A pseudo-destructor, of the form "OBJECT.~DESTRUCTOR" or
+ "OBJECT.SCOPE::~DESTRUCTOR. The first operand is the OBJECT. The
+ second operand (if non-NULL) is the SCOPE. The third operand is
+ the TYPE node corresponding to the DESTRUCTOR. The type of the
+ first operand will always be a scalar type.
+
+ The type of a PSEUDO_DTOR_EXPR is always "void", even though it can
+ be used as if it were a zero-argument function. We handle the
+ function-call case specially, and giving it "void" type prevents it
+ being used in expressions in ways that are not permitted. */
+DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", tcc_expression, 3)
+
/* A whole bunch of tree codes for the initial, superficial parsing of
templates. */
DEFTREECODE (MODOP_EXPR, "modop_expr", tcc_expression, 3)
@@ -232,7 +244,6 @@ DEFTREECODE (STATIC_CAST_EXPR, "static_cast_expr", tcc_unary, 1)
DEFTREECODE (DYNAMIC_CAST_EXPR, "dynamic_cast_expr", tcc_unary, 1)
DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", tcc_expression, 2)
DEFTREECODE (TYPEID_EXPR, "typeid_expr", tcc_expression, 1)
-DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", tcc_expression, 3)
/* A placeholder for an expression that is not type-dependent, but
does occur in a template. When an expression that is not
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 58e0fa8066c..caac8b24fb6 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -80,7 +80,7 @@ struct diagnostic_context;
Usage of TYPE_LANG_FLAG_?:
0: TYPE_DEPENDENT_P
1: TYPE_HAS_CONSTRUCTOR.
- 2: TYPE_HAS_DESTRUCTOR.
+ 2: Unused
3: TYPE_FOR_JAVA.
4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR
5: IS_AGGR_TYPE.
@@ -1035,8 +1035,9 @@ struct lang_type_class GTY(())
unsigned lazy_default_ctor : 1;
unsigned lazy_copy_ctor : 1;
unsigned lazy_assignment_op : 1;
+ unsigned lazy_destructor : 1;
+
unsigned has_const_init_ref : 1;
-
unsigned has_complex_init_ref : 1;
unsigned has_complex_assign_ref : 1;
unsigned non_aggregate : 1;
@@ -1049,7 +1050,7 @@ struct lang_type_class GTY(())
/* There are some bits left to fill out a 32-bit word. Keep track
of this by updating the size of this bitfield whenever you add or
remove a flag. */
- unsigned dummy : 12;
+ unsigned dummy : 11;
tree primary_base;
VEC (tree_pair_s) *vcall_indices;
@@ -1153,6 +1154,11 @@ struct lang_type GTY(())
#define CLASSTYPE_LAZY_ASSIGNMENT_OP(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->lazy_assignment_op)
+/* Nonzero means that NODE (a class type) has a destructor -- but that
+ it has not yet been declared. */
+#define CLASSTYPE_LAZY_DESTRUCTOR(NODE) \
+ (LANG_TYPE_CLASS_CHECK (NODE)->lazy_destructor)
+
/* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */
#define TYPE_HAS_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_assign_ref)
@@ -1236,9 +1242,13 @@ struct lang_type GTY(())
(VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT))
/* A FUNCTION_DECL for the destructor for NODE. These are the
- destructors that take an in-charge parameter. */
+ destructors that take an in-charge parameter. If
+ CLASSTYPE_LAZY_DESTRUCTOR is true, then this entry will be NULL
+ until the destructor is created with lazily_declare_fn. */
#define CLASSTYPE_DESTRUCTORS(NODE) \
- (VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT))
+ (CLASSTYPE_METHOD_VEC (NODE) \
+ ? VEC_index (tree, CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT) \
+ : NULL_TREE)
/* A dictionary of the nested user-defined-types (class-types, or enums)
found within this class. This table includes nested member class
@@ -1673,7 +1683,7 @@ struct lang_decl GTY(())
/* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the
specialized in-charge constructor, in-charge deleting constructor,
- or the the base destructor. */
+ or the base destructor. */
#define DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P(NODE) \
(DECL_DESTRUCTOR_P (NODE) && !DECL_CLONED_FUNCTION_P (NODE))
@@ -2412,9 +2422,6 @@ struct lang_decl GTY(())
&& CONSTRUCTOR_ELTS (NODE) == NULL_TREE \
&& ! TREE_HAS_CONSTRUCTOR (NODE))
-/* Nonzero for _TYPE means that the _TYPE defines a destructor. */
-#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2 (NODE))
-
/* Nonzero means that an object of this type can not be initialized using
an initializer list. */
#define CLASSTYPE_NON_AGGREGATE(NODE) \
@@ -2829,7 +2836,7 @@ struct lang_decl GTY(())
/* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
instantiated, i.e. its definition has been generated from the
- pattern given in the the template. */
+ pattern given in the template. */
#define DECL_TEMPLATE_INSTANTIATED(NODE) \
DECL_LANG_FLAG_1 (VAR_OR_FUNCTION_DECL_CHECK (NODE))
@@ -3721,6 +3728,7 @@ extern void debug_thunks (tree);
extern tree cp_fold_obj_type_ref (tree, tree);
extern void set_linkage_according_to_type (tree, tree);
extern void determine_key_method (tree);
+extern void check_for_override (tree, tree);
/* in cvt.c */
extern tree convert_to_reference (tree, tree, int, int, tree);
@@ -3924,7 +3932,6 @@ extern tree build_vec_init (tree, tree, tree, int);
extern tree build_x_delete (tree, int, tree);
extern tree build_delete (tree, tree, special_function_kind, int, int);
extern void push_base_cleanups (void);
-extern tree build_vbase_delete (tree, tree);
extern tree build_vec_delete (tree, tree, special_function_kind, int);
extern tree create_temporary_var (tree);
extern void initialize_vtbl_ptrs (tree);
@@ -4003,7 +4010,6 @@ extern int is_specialization_of (tree, tree);
extern bool is_specialization_of_friend (tree, tree);
extern int comp_template_args (tree, tree);
extern void maybe_process_partial_specialization (tree);
-extern void maybe_check_template_type (tree);
extern tree most_specialized_instantiation (tree);
extern void print_candidates (tree);
extern void instantiate_pending_templates (int);
@@ -4304,6 +4310,7 @@ extern tree build_ptrmemfunc (tree, tree, int, bool);
extern int cp_type_quals (tree);
extern bool cp_has_mutable_p (tree);
extern bool at_least_as_qualified_p (tree, tree);
+extern void cp_apply_type_quals_to_decl (int, tree);
extern tree build_ptrmemfunc1 (tree, tree, tree);
extern void expand_ptrmemfunc_cst (tree, tree *, tree *);
extern tree pfn_from_ptrmemfunc (tree);
@@ -4364,7 +4371,7 @@ extern tree mangle_ref_init_variable (tree);
/* in dump.c */
extern bool cp_dump_tree (void *, tree);
-/* in cp-simplify.c */
+/* in cp-gimplify.c */
extern int cp_gimplify_expr (tree *, tree *, tree *);
extern void cp_genericize (tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 9bc86b20faf..32dc96d10c6 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -793,6 +793,11 @@ convert_to_void (tree expr, const char *implicit)
return expr;
if (invalid_nonstatic_memfn_p (expr))
return error_mark_node;
+ if (TREE_CODE (expr) == PSEUDO_DTOR_EXPR)
+ {
+ error ("pseudo-destructor is not called");
+ return error_mark_node;
+ }
if (VOID_TYPE_P (TREE_TYPE (expr)))
return expr;
switch (TREE_CODE (expr))
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 6c70fccc3d2..e799a8c9a54 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -1,5 +1,5 @@
/* Implementation of subroutines for the GNU C++ pretty-printer.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
index cb7f94d7b9b..4793de7a954 100644
--- a/gcc/cp/cxx-pretty-print.h
+++ b/gcc/cp/cxx-pretty-print.h
@@ -1,5 +1,5 @@
/* Interface for the GNU C++ pretty-printer.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9be5adf4af3..d767125ad10 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1913,7 +1913,8 @@ redeclaration_error_message (tree newdecl, tree olddecl)
/* If this is a pure function, its olddecl will actually be
the original initialization to `0' (which we force to call
abort()). Don't complain about redefinition in this case. */
- if (DECL_LANG_SPECIFIC (olddecl) && DECL_PURE_VIRTUAL_P (olddecl))
+ if (DECL_LANG_SPECIFIC (olddecl) && DECL_PURE_VIRTUAL_P (olddecl)
+ && DECL_INITIAL (olddecl) == NULL_TREE)
return 0;
/* If both functions come from different namespaces, this is not
@@ -4175,6 +4176,7 @@ reshape_init (tree type, tree *initp)
tree old_init_value;
tree new_init;
bool brace_enclosed_p;
+ bool string_init_p;
old_init = *initp;
old_init_value = (TREE_CODE (*initp) == TREE_LIST
@@ -4238,6 +4240,7 @@ reshape_init (tree type, tree *initp)
return old_init;
}
+ string_init_p = false;
if (TREE_CODE (old_init_value) == STRING_CST
&& TREE_CODE (type) == ARRAY_TYPE
&& char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type))))
@@ -4252,6 +4255,7 @@ reshape_init (tree type, tree *initp)
/* Move past the initializer. */
*initp = TREE_CHAIN (old_init);
TREE_CHAIN (old_init) = NULL_TREE;
+ string_init_p = true;
}
else
{
@@ -4352,10 +4356,15 @@ reshape_init (tree type, tree *initp)
new_init = build_tree_list (TREE_PURPOSE (old_init), new_init);
}
- /* If this was a brace-enclosed initializer and all of the
- initializers were not used up, there is a problem. */
- if (brace_enclosed_p && *initp)
- error ("too many initializers for %qT", type);
+ /* If there are more initializers than necessary, issue a
+ diagnostic. */
+ if (*initp)
+ {
+ if (brace_enclosed_p)
+ error ("too many initializers for %qT", type);
+ else if (warn_missing_braces && !string_init_p)
+ warning ("missing braces around initializer");
+ }
return new_init;
}
@@ -4743,9 +4752,6 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
if (type == error_mark_node)
goto finish_end;
- if (TYPE_HAS_MUTABLE_P (type))
- TREE_READONLY (decl) = 0;
-
if (processing_template_decl)
{
/* Add this declaration to the statement-tree. */
@@ -4792,16 +4798,13 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
ttype = target_type (type);
- /* Currently, GNU C++ puts constants in text space, making them
- impossible to initialize. In the future, one would hope for
- an operating system which understood the difference between
- initialization and the running of a program. */
- if (! DECL_EXTERNAL (decl) && TREE_READONLY (decl))
+ /* A reference will be modified here, as it is initialized. */
+ if (! DECL_EXTERNAL (decl)
+ && TREE_READONLY (decl)
+ && TREE_CODE (type) == REFERENCE_TYPE)
{
was_readonly = 1;
- if (TYPE_NEEDS_CONSTRUCTING (type)
- || TREE_CODE (type) == REFERENCE_TYPE)
- TREE_READONLY (decl) = 0;
+ TREE_READONLY (decl) = 0;
}
if (TREE_CODE (decl) == VAR_DECL)
@@ -5924,8 +5927,7 @@ grokvardecl (tree type,
declare an entity with linkage.
Only check this for public decls for now. */
- tree t1 = TREE_TYPE (decl);
- tree t = no_linkage_check (t1, /*relaxed_p=*/false);
+ tree t = no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false);
if (t)
{
if (TYPE_ANONYMOUS_P (t))
@@ -5933,31 +5935,26 @@ grokvardecl (tree type,
if (DECL_EXTERN_C_P (decl))
/* Allow this; it's pretty common in C. */
;
- else if (same_type_ignoring_top_level_qualifiers_p(t1, t))
- /* This is something like "enum { a = 3 } x;", which is
- well formed. The enum doesn't have "a name with no
- linkage", because it has no name. See closed CWG issue
- 132.
-
- Note that while this construct is well formed in C++03
- it is likely to become ill formed in C++0x. See open
- CWG issue 389 and related issues. */
- ;
else
{
- /* It's a typedef referring to an anonymous type. */
- pedwarn ("non-local variable %q#D uses anonymous type",
+ /* DRs 132, 319 and 389 seem to indicate types with
+ no linkage can only be used to declare extern "C"
+ entities. Since it's not always an error in the
+ ISO C++ 90 Standard, we only issue a warning. */
+ warning ("non-local variable %q#D uses anonymous type",
decl);
if (DECL_ORIGINAL_TYPE (TYPE_NAME (t)))
- cp_pedwarn_at ("%q#D does not refer to the unqualified "
- "type, so it is not used for linkage",
+ cp_warning_at ("%q#D does not refer to the unqualified "
+ "type, so it is not used for linkage",
TYPE_NAME (t));
}
}
else
- pedwarn ("non-local variable %q#D uses local type %qT", decl, t);
+ warning ("non-local variable %q#D uses local type %qT", decl, t);
}
}
+ else
+ DECL_INTERFACE_KNOWN (decl) = 1;
return decl;
}
@@ -6553,9 +6550,22 @@ grokdeclarator (const cp_declarator *declarator,
{
case BIT_NOT_EXPR:
{
- tree type = TREE_OPERAND (decl, 0);
- type = constructor_name (type);
- name = IDENTIFIER_POINTER (type);
+ tree type;
+
+ if (innermost_code != cdk_function)
+ {
+ error ("declaration of %qD as non-function", decl);
+ return error_mark_node;
+ }
+ else if (!qualifying_scope
+ && !(current_class_type && at_class_scope_p ()))
+ {
+ error ("declaration of %qD as non-member", decl);
+ return error_mark_node;
+ }
+
+ type = TREE_OPERAND (decl, 0);
+ name = IDENTIFIER_POINTER (constructor_name (type));
}
break;
@@ -6912,6 +6922,20 @@ grokdeclarator (const cp_declarator *declarator,
error ("qualifiers are not allowed on declaration of %<operator %T%>",
ctor_return_type);
+ if (TREE_CODE (type) == FUNCTION_TYPE
+ && type_quals != TYPE_UNQUALIFIED)
+ {
+ /* This was an error in C++98 (cv-qualifiers cannot be added to
+ a function type), but DR 295 makes the code well-formed by
+ dropping the extra qualifiers. */
+ if (pedantic)
+ {
+ tree bad_type = build_qualified_type (type, type_quals);
+ pedwarn ("ignoring %qV qualifiers added to function type %qT",
+ bad_type, type);
+ }
+ type_quals = TYPE_UNQUALIFIED;
+ }
type_quals |= cp_type_quals (type);
type = cp_build_qualified_type_real
(type, type_quals, ((typedef_decl && !DECL_ARTIFICIAL (typedef_decl)
@@ -7273,6 +7297,7 @@ grokdeclarator (const cp_declarator *declarator,
}
type = build_function_type (type, arg_types);
+ type = cp_build_qualified_type (type, quals);
}
break;
@@ -7305,7 +7330,15 @@ grokdeclarator (const cp_declarator *declarator,
&& (TREE_CODE (type) == FUNCTION_TYPE
|| (quals && TREE_CODE (type) == METHOD_TYPE)))
{
- tree dummy = build_decl (TYPE_DECL, NULL_TREE, type);
+ tree dummy;
+
+ /* If the type is a FUNCTION_TYPE, pick up the
+ qualifiers from that function type. No other
+ qualifiers may be supplied. */
+ if (TREE_CODE (type) == FUNCTION_TYPE)
+ quals = cp_type_quals (type);
+
+ dummy = build_decl (TYPE_DECL, NULL_TREE, type);
grok_method_quals (declarator->u.pointer.class_type,
dummy, quals);
type = TREE_TYPE (dummy);
@@ -7329,6 +7362,9 @@ grokdeclarator (const cp_declarator *declarator,
declarator->u.pointer.class_type);
type = build_pointer_type (type);
}
+ else if (declarator->u.pointer.class_type == error_mark_node)
+ /* We will already have complained. */
+ type = error_mark_node;
else
type = build_ptrmem_type (declarator->u.pointer.class_type,
type);
@@ -7599,11 +7635,12 @@ grokdeclarator (const cp_declarator *declarator,
{
if (ctype == NULL_TREE)
{
- if (TREE_CODE (type) != METHOD_TYPE)
- error ("%Jinvalid type qualifier for non-member function type",
- decl);
- else
+ if (TREE_CODE (type) == METHOD_TYPE)
ctype = TYPE_METHOD_BASETYPE (type);
+ /* Any qualifiers on a function type typedef have
+ already been dealt with. */
+ else if (TREE_CODE (type) == FUNCTION_TYPE)
+ quals = TYPE_UNQUALIFIED;
}
if (ctype != NULL_TREE)
grok_method_quals (ctype, decl, quals);
@@ -7646,6 +7683,23 @@ grokdeclarator (const cp_declarator *declarator,
}
parms = nreverse (decls);
+
+ if (decl_context != TYPENAME)
+ {
+ /* A cv-qualifier-seq shall only be part of the function type
+ for a non-static member function. [8.3.5/4 dcl.fct] */
+ if (cp_type_quals (type) != TYPE_UNQUALIFIED
+ && (current_class_type == NULL_TREE || staticp) )
+ {
+ error ("qualified function types cannot be used to declare %s functions",
+ (staticp? "static member" : "free"));
+ type = TYPE_MAIN_VARIANT (type);
+ }
+
+ /* The qualifiers on the function type become the qualifiers on
+ the non-static member function. */
+ quals |= cp_type_quals (type);
+ }
}
/* If this is a type name (such as, in a cast or sizeof),
@@ -7803,15 +7857,6 @@ grokdeclarator (const cp_declarator *declarator,
int publicp = 0;
tree function_context;
- /* We catch the others as conflicts with the builtin
- typedefs. */
- if (friendp && unqualified_id == ridpointers[(int) RID_SIGNED])
- {
- error ("function %qD cannot be declared friend",
- unqualified_id);
- friendp = 0;
- }
-
if (friendp == 0)
{
if (ctype == NULL_TREE)
@@ -7849,6 +7894,18 @@ grokdeclarator (const cp_declarator *declarator,
TYPE_ARG_TYPES (type));
}
+ /* Check that the name used for a destructor makes sense. */
+ if (sfk == sfk_destructor
+ && !same_type_p (TREE_OPERAND
+ (id_declarator->u.id.unqualified_name, 0),
+ ctype))
+ {
+ error ("declaration of %qD as member of %qT",
+ id_declarator->u.id.unqualified_name,
+ ctype);
+ return error_mark_node;
+ }
+
/* Tell grokfndecl if it needs to set TREE_PUBLIC on the node. */
function_context = (ctype != NULL_TREE) ?
decl_function_context (TYPE_MAIN_DECL (ctype)) : NULL_TREE;
@@ -8178,7 +8235,7 @@ grokdeclarator (const cp_declarator *declarator,
when processing a template; we'll do this for the instantiated
declaration based on the type of DECL. */
if (!processing_template_decl)
- c_apply_type_quals_to_decl (type_quals, decl);
+ cp_apply_type_quals_to_decl (type_quals, decl);
return decl;
}
@@ -9962,7 +10019,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
DECL_IGNORED_P (resdecl) = 1;
DECL_RESULT (decl1) = resdecl;
- c_apply_type_quals_to_decl (cp_type_quals (restype), resdecl);
+ cp_apply_type_quals_to_decl (cp_type_quals (restype), resdecl);
}
/* Initialize RTL machinery. We cannot do this until
@@ -10885,9 +10942,11 @@ complete_vars (tree type)
if (same_type_p (type, TREE_PURPOSE (*list)))
{
tree var = TREE_VALUE (*list);
+ tree type = TREE_TYPE (var);
/* Complete the type of the variable. The VAR_DECL itself
will be laid out in expand_expr. */
- complete_type (TREE_TYPE (var));
+ complete_type (type);
+ cp_apply_type_quals_to_decl (cp_type_quals (type), var);
/* Remove this entry from the list. */
*list = TREE_CHAIN (*list);
}
@@ -10929,9 +10988,6 @@ cxx_maybe_build_cleanup (tree decl)
rval = build_delete (TREE_TYPE (rval), rval,
sfk_complete_destructor, flags, 0);
- if (has_vbases && !TYPE_HAS_DESTRUCTOR (type))
- rval = build_compound_expr (rval, build_vbase_delete (type, decl));
-
return rval;
}
return NULL_TREE;
diff --git a/gcc/cp/decl.h b/gcc/cp/decl.h
index 463f73242d8..b852c504113 100644
--- a/gcc/cp/decl.h
+++ b/gcc/cp/decl.h
@@ -1,5 +1,5 @@
/* Variables and structures for declaration processing.
- Copyright (C) 1993, 2000, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1993, 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 0a74ed7f2a6..474e04e2faa 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -65,7 +65,6 @@ typedef struct priority_info_s {
static void mark_vtable_entries (tree);
static bool maybe_emit_vtables (tree);
-static tree build_anon_union_vars (tree);
static bool acceptable_java_type (tree);
static tree start_objects (int, int);
static void finish_objects (int, int, tree);
@@ -299,7 +298,7 @@ grokclassfn (tree ctype, tree function, enum overload_flags flags,
this_quals |= TYPE_QUAL_CONST;
qual_type = cp_build_qualified_type (type, this_quals);
parm = build_artificial_parm (this_identifier, qual_type);
- c_apply_type_quals_to_decl (this_quals, parm);
+ cp_apply_type_quals_to_decl (this_quals, parm);
TREE_CHAIN (parm) = DECL_ARGUMENTS (function);
DECL_ARGUMENTS (function) = parm;
}
@@ -878,7 +877,16 @@ grokfield (const cp_declarator *declarator,
value = push_template_decl (value);
if (attrlist)
- cplus_decl_attributes (&value, attrlist, 0);
+ {
+ /* Avoid storing attributes in template parameters:
+ tsubst is not ready to handle them. */
+ tree type = TREE_TYPE (value);
+ if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
+ || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
+ sorry ("applying attributes to template parameters is not implemented");
+ else
+ cplus_decl_attributes (&value, attrlist, 0);
+ }
return value;
}
@@ -1063,14 +1071,13 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags)
SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (*decl), TREE_TYPE (*decl));
}
-/* Walks through the namespace- or function-scope anonymous union OBJECT,
- building appropriate ALIAS_DECLs. Returns one of the fields for use in
- the mangled name. */
+/* Walks through the namespace- or function-scope anonymous union
+ OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs.
+ Returns one of the fields for use in the mangled name. */
static tree
-build_anon_union_vars (tree object)
+build_anon_union_vars (tree type, tree object)
{
- tree type = TREE_TYPE (object);
tree main_decl = NULL_TREE;
tree field;
@@ -1118,7 +1125,7 @@ build_anon_union_vars (tree object)
decl = pushdecl (decl);
}
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
- decl = build_anon_union_vars (ref);
+ decl = build_anon_union_vars (TREE_TYPE (field), ref);
else
decl = 0;
@@ -1158,7 +1165,7 @@ finish_anon_union (tree anon_union_decl)
return;
}
- main_decl = build_anon_union_vars (anon_union_decl);
+ main_decl = build_anon_union_vars (type, anon_union_decl);
if (main_decl == NULL_TREE)
{
warning ("anonymous union with no members");
@@ -2430,7 +2437,7 @@ do_static_initialization (tree decl, tree init)
if (init)
finish_expr_stmt (init);
- /* If we're using __cxa_atexit, register a a function that calls the
+ /* If we're using __cxa_atexit, register a function that calls the
destructor for the object. */
if (flag_use_cxa_atexit)
finish_expr_stmt (register_dtor_fn (decl));
@@ -3161,9 +3168,20 @@ mark_used (tree decl)
&& DECL_ARTIFICIAL (decl)
&& !DECL_THUNK_P (decl)
&& ! DECL_INITIAL (decl)
- /* Kludge: don't synthesize for default args. */
+ /* Kludge: don't synthesize for default args. Unfortunately this
+ rules out initializers of namespace-scoped objects too, but
+ it's sort-of ok if the implicit ctor or dtor decl keeps
+ pointing to the class location. */
&& current_function_decl)
{
+ /* Put the function definition at the position where it is needed,
+ rather than within the body of the class. That way, an error
+ during the generation of the implicit body points at the place
+ where the attempt to generate the function occurs, giving the
+ user a hint as to why we are attempting to generate the
+ function. */
+ DECL_SOURCE_LOCATION (decl) = input_location;
+
synthesize_method (decl);
/* If we've already synthesized the method we don't need to
instantiate it, so we can return right away. */
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index ec332f2273b..c53e0328cd0 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1,7 +1,7 @@
/* Call-backs for C++ error reporting.
This code is non-reentrant.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
@@ -613,6 +613,8 @@ dump_type_suffix (tree t, int flags)
if (TREE_CODE (t) == METHOD_TYPE)
pp_cxx_cv_qualifier_seq
(cxx_pp, TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (t))));
+ else
+ pp_cxx_cv_qualifier_seq(cxx_pp, t);
dump_exception_spec (TYPE_RAISES_EXCEPTIONS (t), flags);
dump_type_suffix (TREE_TYPE (t), flags);
break;
@@ -1813,18 +1815,14 @@ dump_expr (tree t, int flags)
dump_decl (t, flags);
break;
+ case BIND_EXPR:
case STMT_EXPR:
+ case STATEMENT_LIST:
/* We don't yet have a way of dumping statements in a
human-readable format. */
pp_string (cxx_pp, "({...})");
break;
- case BIND_EXPR:
- pp_cxx_left_brace (cxx_pp);
- dump_expr (TREE_OPERAND (t, 1), flags & ~TFF_EXPR_IN_PARENS);
- pp_cxx_right_brace (cxx_pp);
- break;
-
case LOOP_EXPR:
pp_string (cxx_pp, "while (1) { ");
dump_expr (TREE_OPERAND (t, 0), flags & ~TFF_EXPR_IN_PARENS);
@@ -2203,7 +2201,7 @@ print_instantiation_full_context (diagnostic_context *context)
else
{
if (current_function_decl == TINST_DECL (p))
- /* Avoid redundancy with the the "In function" line. */;
+ /* Avoid redundancy with the "In function" line. */;
else
pp_verbatim (context->printer,
"%s: In instantiation of %qs:\n",
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 649fab79105..ef4fb2193b5 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -1,6 +1,6 @@
/* Handle exceptional things in C++.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Michael Tiemann <tiemann@cygnus.com>
Rewritten by Mike Stump <mrs@cygnus.com>, based upon an
initial re-implementation courtesy Tad Hunt.
@@ -153,6 +153,26 @@ build_exc_ptr (void)
return build0 (EXC_PTR_EXPR, ptr_type_node);
}
+/* Build up a call to __cxa_get_exception_ptr so that we can build a
+ copy constructor for the thrown object. */
+
+static tree
+do_get_exception_ptr (void)
+{
+ tree fn;
+
+ fn = get_identifier ("__cxa_get_exception_ptr");
+ if (!get_global_value_if_present (fn, &fn))
+ {
+ /* Declare void* __cxa_get_exception_ptr (void *). */
+ tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ 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));
+}
+
/* Build up a call to __cxa_begin_catch, to tell the runtime that the
exception has been handled. */
@@ -182,9 +202,12 @@ dtor_nothrow (tree type)
if (type == NULL_TREE)
return 0;
- if (! TYPE_HAS_DESTRUCTOR (type))
+ if (!CLASS_TYPE_P (type))
return 1;
+ if (CLASSTYPE_LAZY_DESTRUCTOR (type))
+ lazily_declare_fn (sfk_destructor, type);
+
return TREE_NOTHROW (CLASSTYPE_DESTRUCTORS (type));
}
@@ -378,9 +401,8 @@ initialize_handler_parm (tree decl, tree exp)
tree
expand_start_catch_block (tree decl)
{
- tree exp = NULL_TREE;
+ tree exp;
tree type;
- bool is_java;
if (! doing_eh (1))
return NULL_TREE;
@@ -394,45 +416,50 @@ expand_start_catch_block (tree decl)
else
type = NULL_TREE;
- is_java = false;
- if (decl)
+ if (decl && decl_is_java_type (type, 1))
{
- tree init;
+ /* Java only passes object via pointer and doesn't require
+ adjusting. The java object is immediately before the
+ generic exception header. */
+ exp = build_exc_ptr ();
+ exp = build1 (NOP_EXPR, build_pointer_type (type), exp);
+ exp = build2 (MINUS_EXPR, TREE_TYPE (exp), exp,
+ TYPE_SIZE_UNIT (TREE_TYPE (exp)));
+ exp = build_indirect_ref (exp, NULL);
+ initialize_handler_parm (decl, exp);
+ return type;
+ }
- if (decl_is_java_type (type, 1))
- {
- /* Java only passes object via pointer and doesn't require
- adjusting. The java object is immediately before the
- generic exception header. */
- init = build_exc_ptr ();
- init = build1 (NOP_EXPR, build_pointer_type (type), init);
- init = build2 (MINUS_EXPR, TREE_TYPE (init), init,
- TYPE_SIZE_UNIT (TREE_TYPE (init)));
- init = build_indirect_ref (init, NULL);
- is_java = true;
- }
- else
- {
- /* C++ requires that we call __cxa_begin_catch to get the
- pointer to the actual object. */
- init = do_begin_catch ();
- }
-
+ /* Call __cxa_end_catch at the end of processing the exception. */
+ push_eh_cleanup (type);
+
+ /* If there's no decl at all, then all we need to do is make sure
+ to tell the runtime that we've begun handling the exception. */
+ if (decl == NULL)
+ finish_expr_stmt (do_begin_catch ());
+
+ /* If the C++ object needs constructing, we need to do that before
+ calling __cxa_begin_catch, so that std::uncaught_exception gets
+ the right value during the copy constructor. */
+ else if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))
+ {
+ exp = do_get_exception_ptr ();
+ initialize_handler_parm (decl, exp);
+ finish_expr_stmt (do_begin_catch ());
+ }
+
+ /* Otherwise the type uses a bitwise copy, and we don't have to worry
+ about the value of std::uncaught_exception and therefore can do the
+ copy with the return value of __cxa_end_catch instead. */
+ else
+ {
+ tree init = do_begin_catch ();
exp = create_temporary_var (ptr_type_node);
DECL_REGISTER (exp) = 1;
cp_finish_decl (exp, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
finish_expr_stmt (build_modify_expr (exp, INIT_EXPR, init));
+ initialize_handler_parm (decl, exp);
}
- else
- finish_expr_stmt (do_begin_catch ());
-
- /* C++ requires that we call __cxa_end_catch at the end of
- processing the exception. */
- if (! is_java)
- push_eh_cleanup (type);
-
- if (decl)
- initialize_handler_parm (decl, exp);
return type;
}
@@ -709,7 +736,7 @@ build_throw (tree exp)
throw_type = build_eh_type_type (prepare_eh_type (TREE_TYPE (object)));
- if (TYPE_HAS_DESTRUCTOR (TREE_TYPE (object)))
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (object)))
{
cleanup = lookup_fnfields (TYPE_BINFO (TREE_TYPE (object)),
complete_dtor_identifier, 0);
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index eb73980ecc4..087868674f3 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1570,17 +1570,17 @@ build_offset_ref (tree type, tree name, bool address_p)
tree
integral_constant_value (tree decl)
{
- if ((TREE_CODE (decl) == CONST_DECL
- || (TREE_CODE (decl) == VAR_DECL
- /* And so are variables with a 'const' type -- unless they
- are also 'volatile'. */
- && CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (decl))
- && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)))
- && DECL_INITIAL (decl)
- && DECL_INITIAL (decl) != error_mark_node
- && TREE_TYPE (DECL_INITIAL (decl))
- && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
- return DECL_INITIAL (decl);
+ while ((TREE_CODE (decl) == CONST_DECL
+ || (TREE_CODE (decl) == VAR_DECL
+ /* And so are variables with a 'const' type -- unless they
+ are also 'volatile'. */
+ && CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (decl))
+ && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl)))
+ && DECL_INITIAL (decl)
+ && DECL_INITIAL (decl) != error_mark_node
+ && TREE_TYPE (DECL_INITIAL (decl))
+ && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
+ decl = DECL_INITIAL (decl);
return decl;
}
@@ -1762,7 +1762,7 @@ build_new_1 (tree exp)
from ELT_TYPE for a multi-dimensional array; ELT_TYPE is never an
ARRAY_TYPE, but TYPE may be an ARRAY_TYPE. */
tree type;
- /* A pointer type pointing to to the FULL_TYPE. */
+ /* A pointer type pointing to the FULL_TYPE. */
tree full_pointer_type;
tree outer_nelts = NULL_TREE;
tree nelts = NULL_TREE;
@@ -2796,7 +2796,8 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
tree do_delete = NULL_TREE;
tree ifexp;
- gcc_assert (TYPE_HAS_DESTRUCTOR (type));
+ if (CLASSTYPE_LAZY_DESTRUCTOR (type))
+ lazily_declare_fn (sfk_destructor, type);
/* For `::delete x', we must not use the deleting destructor
since then we would not be sure to get the global `operator
@@ -2935,34 +2936,6 @@ push_base_cleanups (void)
}
}
-/* For type TYPE, delete the virtual baseclass objects of DECL. */
-
-tree
-build_vbase_delete (tree type, tree decl)
-{
- unsigned ix;
- tree binfo;
- tree result;
- VEC (tree) *vbases;
- tree addr = build_unary_op (ADDR_EXPR, decl, 0);
-
- gcc_assert (addr != error_mark_node);
-
- result = convert_to_void (integer_zero_node, NULL);
- for (vbases = CLASSTYPE_VBASECLASSES (type), ix = 0;
- VEC_iterate (tree, vbases, ix, binfo); ix++)
- {
- tree base_addr = convert_force
- (build_pointer_type (BINFO_TYPE (binfo)), addr, 0);
- tree base_delete = build_delete
- (TREE_TYPE (base_addr), base_addr, sfk_base_destructor,
- LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 0);
-
- result = build_compound_expr (result, base_delete);
- }
- return result;
-}
-
/* Build a C++ vector delete expression.
MAXINDEX is the number of elements to be deleted.
ELT_SIZE is the nominal size of each element in the vector.
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index eb9f8f075a2..1d49490a81d 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2230,7 +2230,7 @@ write_template_arg (tree node)
MANGLE_TRACE_TREE ("template-arg", node);
/* A template template parameter's argument list contains TREE_LIST
- nodes of which the value field is the the actual argument. */
+ nodes of which the value field is the actual argument. */
if (code == TREE_LIST)
{
node = TREE_VALUE (node);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 09317a7b02b..85e2b3f8787 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -705,12 +705,15 @@ synthesize_method (tree fndecl)
tree context = decl_function_context (fndecl);
bool need_body = true;
tree stmt;
+ location_t save_input_location = input_location;
/* If we've been asked to synthesize a clone, just synthesize the
cloned function instead. Doing so will automatically fill in the
body for the clone. */
if (DECL_CLONED_FUNCTION_P (fndecl))
{
+ DECL_SOURCE_LOCATION (DECL_CLONED_FUNCTION (fndecl)) =
+ DECL_SOURCE_LOCATION (fndecl);
synthesize_method (DECL_CLONED_FUNCTION (fndecl));
return;
}
@@ -724,13 +727,7 @@ synthesize_method (tree fndecl)
else if (nested)
push_function_context_to (context);
- /* Put the function definition at the position where it is needed,
- rather than within the body of the class. That way, an error
- during the generation of the implicit body points at the place
- where the attempt to generate the function occurs, giving the
- user a hint as to why we are attempting to generate the
- function. */
- DECL_SOURCE_LOCATION (fndecl) = input_location;
+ input_location = DECL_SOURCE_LOCATION (fndecl);
start_preparsed_function (fndecl, NULL_TREE, SF_DEFAULT | SF_PRE_PARSED);
stmt = begin_function_body ();
@@ -761,6 +758,8 @@ synthesize_method (tree fndecl)
finish_function_body (stmt);
expand_or_defer_fn (finish_function (0));
+ input_location = save_input_location;
+
if (! context)
pop_from_top_level ();
else if (nested)
@@ -823,9 +822,7 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*),
static tree
locate_dtor (tree type, void *client ATTRIBUTE_UNUSED)
{
- return (CLASSTYPE_METHOD_VEC (type)
- ? CLASSTYPE_DESTRUCTORS (type)
- : NULL_TREE);
+ return CLASSTYPE_DESTRUCTORS (type);
}
/* Locate the default ctor of TYPE. */
@@ -1035,7 +1032,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
DECL_DECLARED_INLINE_P (fn) = 1;
DECL_INLINE (fn) = 1;
gcc_assert (!TREE_USED (fn));
-
+
return fn;
}
@@ -1060,24 +1057,46 @@ lazily_declare_fn (special_function_kind sfk, tree type)
const_p = false;
/* Declare the function. */
fn = implicitly_declare_fn (sfk, type, const_p);
+ /* A destructor may be virtual. */
+ if (sfk == sfk_destructor)
+ check_for_override (fn, type);
/* Add it to CLASSTYPE_METHOD_VEC. */
add_method (type, fn);
/* Add it to TYPE_METHODS. */
- TREE_CHAIN (fn) = TYPE_METHODS (type);
- TYPE_METHODS (type) = fn;
+ if (sfk == sfk_destructor
+ && DECL_VIRTUAL_P (fn)
+ && abi_version_at_least (2))
+ /* The ABI requires that a virtual destructor go at the end of the
+ vtable. */
+ TYPE_METHODS (type) = chainon (TYPE_METHODS (type), fn);
+ else
+ {
+ /* G++ 3.2 put the implicit destructor at the *beginning* of the
+ TYPE_METHODS list, which cause the destructor to be emitted
+ in an incorrect location in the vtable. */
+ if (warn_abi && DECL_VIRTUAL_P (fn))
+ warning ("vtable layout for class %qT may not be ABI-compliant"
+ "and may change in a future version of GCC due to "
+ "implicit virtual destructor",
+ type);
+ TREE_CHAIN (fn) = TYPE_METHODS (type);
+ TYPE_METHODS (type) = fn;
+ }
maybe_add_class_template_decl_list (type, fn, /*friend_p=*/0);
- if (sfk == sfk_constructor || sfk == sfk_copy_constructor)
+ if (sfk == sfk_assignment_operator)
+ CLASSTYPE_LAZY_ASSIGNMENT_OP (type) = 0;
+ else
{
/* Remember that the function has been created. */
if (sfk == sfk_constructor)
CLASSTYPE_LAZY_DEFAULT_CTOR (type) = 0;
- else
+ else if (sfk == sfk_copy_constructor)
CLASSTYPE_LAZY_COPY_CTOR (type) = 0;
+ else if (sfk == sfk_destructor)
+ CLASSTYPE_LAZY_DESTRUCTOR (type) = 0;
/* Create appropriate clones. */
clone_function_decl (fn, /*update_method_vec=*/true);
}
- else if (sfk == sfk_assignment_operator)
- CLASSTYPE_LAZY_ASSIGNMENT_OP (type) = 0;
return fn;
}
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index b72ded0903b..7d944d05451 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -4514,8 +4514,6 @@ maybe_process_template_type_declaration (tree type, int globalize,
;
else
{
- maybe_check_template_type (type);
-
gcc_assert (IS_AGGR_TYPE (type) || TREE_CODE (type) == ENUMERAL_TYPE);
if (processing_template_decl)
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 82d665ed810..3db7f2ee9f6 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -706,7 +706,7 @@ cp_lexer_print_token (FILE * stream, cp_token *token)
static void
cp_lexer_start_debugging (cp_lexer* lexer)
{
- ++lexer->debugging_p;
+ lexer->debugging_p = true;
}
/* Stop emitting debugging information. */
@@ -714,7 +714,7 @@ cp_lexer_start_debugging (cp_lexer* lexer)
static void
cp_lexer_stop_debugging (cp_lexer* lexer)
{
- --lexer->debugging_p;
+ lexer->debugging_p = false;
}
#endif /* ENABLE_CHECKING */
@@ -3173,6 +3173,7 @@ cp_parser_unqualified_id (cp_parser* parser,
tree qualifying_scope;
tree object_scope;
tree scope;
+ bool done;
/* Consume the `~' token. */
cp_lexer_consume_token (parser->lexer);
@@ -3229,6 +3230,8 @@ cp_parser_unqualified_id (cp_parser* parser,
/* If there was an explicit qualification (S::~T), first look
in the scope given by the qualification (i.e., S). */
+ done = false;
+ type_decl = NULL_TREE;
if (scope)
{
cp_parser_parse_tentatively (parser);
@@ -3240,10 +3243,10 @@ cp_parser_unqualified_id (cp_parser* parser,
/*class_head_p=*/false,
declarator_p);
if (cp_parser_parse_definitely (parser))
- return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
+ done = true;
}
/* In "N::S::~S", look in "N" as well. */
- if (scope && qualifying_scope)
+ if (!done && scope && qualifying_scope)
{
cp_parser_parse_tentatively (parser);
parser->scope = qualifying_scope;
@@ -3258,10 +3261,10 @@ cp_parser_unqualified_id (cp_parser* parser,
/*class_head_p=*/false,
declarator_p);
if (cp_parser_parse_definitely (parser))
- return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
+ done = true;
}
/* In "p->S::~T", look in the scope given by "*p" as well. */
- else if (object_scope)
+ else if (!done && object_scope)
{
cp_parser_parse_tentatively (parser);
parser->scope = object_scope;
@@ -3276,20 +3279,23 @@ cp_parser_unqualified_id (cp_parser* parser,
/*class_head_p=*/false,
declarator_p);
if (cp_parser_parse_definitely (parser))
- return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
+ done = true;
}
/* Look in the surrounding context. */
- parser->scope = NULL_TREE;
- parser->object_scope = NULL_TREE;
- parser->qualifying_scope = NULL_TREE;
- type_decl
- = cp_parser_class_name (parser,
- /*typename_keyword_p=*/false,
- /*template_keyword_p=*/false,
- none_type,
- /*check_dependency=*/false,
- /*class_head_p=*/false,
- declarator_p);
+ if (!done)
+ {
+ parser->scope = NULL_TREE;
+ parser->object_scope = NULL_TREE;
+ parser->qualifying_scope = NULL_TREE;
+ type_decl
+ = cp_parser_class_name (parser,
+ /*typename_keyword_p=*/false,
+ /*template_keyword_p=*/false,
+ none_type,
+ /*check_dependency=*/false,
+ /*class_head_p=*/false,
+ declarator_p);
+ }
/* If an error occurred, assume that the name of the
destructor is the same as the name of the qualifying
class. That allows us to keep parsing after running
@@ -9574,7 +9580,7 @@ cp_parser_simple_type_specifier (cp_parser* parser,
typedef-name:
identifier
- Returns a TYPE_DECL for the the type. */
+ Returns a TYPE_DECL for the type. */
static tree
cp_parser_type_name (cp_parser* parser)
@@ -11099,6 +11105,9 @@ cp_parser_direct_declarator (cp_parser* parser,
&non_constant_p);
if (!non_constant_p)
bounds = fold_non_dependent_expr (bounds);
+ /* Normally, the array bound must be an integral constant
+ expression. However, as an extension, we allow VLAs
+ in function scopes. */
else if (!at_function_scope_p ())
{
error ("array bound is not an integer constant");
@@ -12833,9 +12842,17 @@ cp_parser_class_head (cp_parser* parser,
CLASSTYPE_DECLARED_CLASS (type) = (class_key == class_type);
cp_parser_check_class_key (class_key, type);
+ /* If this type was already complete, and we see another definition,
+ that's an error. */
+ if (type != error_mark_node && COMPLETE_TYPE_P (type))
+ {
+ error ("redefinition of %q#T", type);
+ cp_error_at ("previous definition of %q#T", type);
+ type = error_mark_node;
+ }
+
/* We will have entered the scope containing the class; the names of
- base classes should be looked up in that context. For example,
- given:
+ base classes should be looked up in that context. For example:
struct A { struct B {}; struct C; };
struct A::C : B {};
@@ -14042,10 +14059,10 @@ cp_parser_attributes_opt (cp_parser* parser)
identifier ( identifier , expression-list )
identifier ( expression-list )
- Returns a TREE_LIST. Each node corresponds to an attribute. THe
- TREE_PURPOSE of each node is the identifier indicating which
- attribute is in use. The TREE_VALUE represents the arguments, if
- any. */
+ Returns a TREE_LIST, or NULL_TREE on error. Each node corresponds
+ to an attribute. The TREE_PURPOSE of each node is the identifier
+ indicating which attribute is in use. The TREE_VALUE represents
+ the arguments, if any. */
static tree
cp_parser_attribute_list (cp_parser* parser)
@@ -14063,37 +14080,39 @@ cp_parser_attribute_list (cp_parser* parser)
/* Look for the identifier. We also allow keywords here; for
example `__attribute__ ((const))' is legal. */
token = cp_lexer_peek_token (parser->lexer);
- if (token->type != CPP_NAME
- && token->type != CPP_KEYWORD)
- return error_mark_node;
- /* Consume the token. */
- token = cp_lexer_consume_token (parser->lexer);
+ if (token->type == CPP_NAME
+ || token->type == CPP_KEYWORD)
+ {
+ /* Consume the token. */
+ token = cp_lexer_consume_token (parser->lexer);
- /* Save away the identifier that indicates which attribute this is. */
- identifier = token->value;
- attribute = build_tree_list (identifier, NULL_TREE);
+ /* Save away the identifier that indicates which attribute
+ this is. */
+ identifier = token->value;
+ attribute = build_tree_list (identifier, NULL_TREE);
- /* Peek at the next token. */
- token = cp_lexer_peek_token (parser->lexer);
- /* If it's an `(', then parse the attribute arguments. */
- if (token->type == CPP_OPEN_PAREN)
- {
- tree arguments;
+ /* Peek at the next token. */
+ token = cp_lexer_peek_token (parser->lexer);
+ /* If it's an `(', then parse the attribute arguments. */
+ if (token->type == CPP_OPEN_PAREN)
+ {
+ tree arguments;
- arguments = (cp_parser_parenthesized_expression_list
- (parser, true, /*cast_p=*/false,
- /*non_constant_p=*/NULL));
- /* Save the identifier and arguments away. */
- TREE_VALUE (attribute) = arguments;
- }
+ arguments = (cp_parser_parenthesized_expression_list
+ (parser, true, /*cast_p=*/false,
+ /*non_constant_p=*/NULL));
+ /* Save the identifier and arguments away. */
+ TREE_VALUE (attribute) = arguments;
+ }
- /* Add this attribute to the list. */
- TREE_CHAIN (attribute) = attribute_list;
- attribute_list = attribute;
+ /* Add this attribute to the list. */
+ TREE_CHAIN (attribute) = attribute_list;
+ attribute_list = attribute;
- /* Now, look for more attributes. */
- token = cp_lexer_peek_token (parser->lexer);
- /* If the next token isn't a `,', we're done. */
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+ /* Now, look for more attributes. If the next token isn't a
+ `,', we're done. */
if (token->type != CPP_COMMA)
break;
@@ -14252,6 +14271,8 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
/* If that's not a class type, there is no destructor. */
if (!type || !CLASS_TYPE_P (type))
return error_mark_node;
+ if (CLASSTYPE_LAZY_DESTRUCTOR (type))
+ lazily_declare_fn (sfk_destructor, type);
if (!CLASSTYPE_DESTRUCTORS (type))
return error_mark_node;
/* If it was a class type, return the destructor. */
@@ -14312,7 +14333,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
lookup_member, we must enter the scope here. */
if (dependent_p)
pushed_scope = push_scope (parser->scope);
- /* If the PARSER->SCOPE is a a template specialization, it
+ /* If the PARSER->SCOPE is a template specialization, it
may be instantiated during name lookup. In that case,
errors may be issued. Even if we rollback the current
tentative parse, those errors are valid. */
@@ -15266,9 +15287,10 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
tokens = DECL_PENDING_INLINE_INFO (member_function);
DECL_PENDING_INLINE_INFO (member_function) = NULL;
DECL_PENDING_INLINE_P (member_function) = 0;
- /* If this was an inline function in a local class, enter the scope
- of the containing function. */
- function_scope = decl_function_context (member_function);
+
+ /* If this is a local class, enter the scope of the containing
+ function. */
+ function_scope = current_function_decl;
if (function_scope)
push_function_context_to (function_scope);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d0cd2297db3..0d83bc1a4d2 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1883,6 +1883,11 @@ check_explicit_specialization (tree declarator,
/* Find the namespace binding, using the declaration
context. */
fns = namespace_binding (dname, CP_DECL_CONTEXT (decl));
+ if (!fns || !is_overloaded_fn (fns))
+ {
+ error ("%qD is not a template function", dname);
+ fns = error_mark_node;
+ }
}
declarator = lookup_template_function (fns, NULL_TREE);
@@ -1932,7 +1937,7 @@ check_explicit_specialization (tree declarator,
int is_constructor = DECL_CONSTRUCTOR_P (decl);
if (is_constructor ? !TYPE_HAS_CONSTRUCTOR (ctype)
- : !TYPE_HAS_DESTRUCTOR (ctype))
+ : !CLASSTYPE_DESTRUCTORS (ctype))
{
/* From [temp.expl.spec]:
@@ -2101,49 +2106,6 @@ check_explicit_specialization (tree declarator,
return decl;
}
-/* TYPE is being declared. Verify that the use of template headers
- and such is reasonable. Issue error messages if not. */
-
-void
-maybe_check_template_type (tree type)
-{
- if (template_header_count)
- {
- /* We are in the scope of some `template <...>' header. */
-
- int context_depth
- = template_class_depth_real (TYPE_CONTEXT (type),
- /*count_specializations=*/1);
-
- if (template_header_count <= context_depth)
- /* This is OK; the template headers are for the context. We
- are actually too lenient here; like
- check_explicit_specialization we should consider the number
- of template types included in the actual declaration. For
- example,
-
- template <class T> struct S {
- template <class U> template <class V>
- struct I {};
- };
-
- is invalid, but:
-
- template <class T> struct S {
- template <class U> struct I;
- };
-
- template <class T> template <class U.
- struct S<T>::I {};
-
- is not. */
- ;
- else if (template_header_count > context_depth + 1)
- /* There are two many template parameter lists. */
- error ("too many template parameter lists in declaration of %qT", type);
- }
-}
-
/* Returns 1 iff PARMS1 and PARMS2 are identical sets of template
parameters. These are represented in the same format used for
DECL_TEMPLATE_PARMS. */
@@ -4239,17 +4201,8 @@ lookup_template_function (tree fns, tree arglist)
return error_mark_node;
gcc_assert (!arglist || TREE_CODE (arglist) == TREE_VEC);
- if (fns == NULL_TREE
- || TREE_CODE (fns) == FUNCTION_DECL)
- {
- error ("non-template used as template");
- return error_mark_node;
- }
-
- gcc_assert (TREE_CODE (fns) == TEMPLATE_DECL
- || TREE_CODE (fns) == OVERLOAD
- || BASELINK_P (fns)
- || TREE_CODE (fns) == IDENTIFIER_NODE);
+ gcc_assert (fns && (is_overloaded_fn (fns)
+ || TREE_CODE (fns) == IDENTIFIER_NODE));
if (BASELINK_P (fns))
{
@@ -5541,7 +5494,6 @@ instantiate_class_template (tree type)
input_location = DECL_SOURCE_LOCATION (TYPE_NAME (pattern));
TYPE_HAS_CONSTRUCTOR (type) = TYPE_HAS_CONSTRUCTOR (pattern);
- TYPE_HAS_DESTRUCTOR (type) = TYPE_HAS_DESTRUCTOR (pattern);
TYPE_HAS_NEW_OPERATOR (type) = TYPE_HAS_NEW_OPERATOR (pattern);
TYPE_HAS_ARRAY_NEW_OPERATOR (type) = TYPE_HAS_ARRAY_NEW_OPERATOR (pattern);
TYPE_GETS_DELETE (type) = TYPE_GETS_DELETE (pattern);
@@ -6517,7 +6469,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
type = tsubst (TREE_TYPE (t), args, complain, in_decl);
TREE_TYPE (r) = type;
- c_apply_type_quals_to_decl (cp_type_quals (type), r);
+ cp_apply_type_quals_to_decl (cp_type_quals (type), r);
if (DECL_INITIAL (r))
{
@@ -6547,7 +6499,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
if (type == error_mark_node)
return error_mark_node;
TREE_TYPE (r) = type;
- c_apply_type_quals_to_decl (cp_type_quals (type), r);
+ cp_apply_type_quals_to_decl (cp_type_quals (type), r);
/* We don't have to set DECL_CONTEXT here; it is set by
finish_member_declaration. */
@@ -6647,7 +6599,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
else if (DECL_SELF_REFERENCE_P (t))
SET_DECL_SELF_REFERENCE_P (r);
TREE_TYPE (r) = type;
- c_apply_type_quals_to_decl (cp_type_quals (type), r);
+ cp_apply_type_quals_to_decl (cp_type_quals (type), r);
DECL_CONTEXT (r) = ctx;
/* Clear out the mangled name and RTL for the instantiation. */
SET_DECL_ASSEMBLER_NAME (r, NULL_TREE);
@@ -7266,22 +7218,18 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
gcc_assert (TREE_CODE (type) != METHOD_TYPE);
if (TREE_CODE (type) == FUNCTION_TYPE)
{
- /* This is really a method type. The cv qualifiers of the
- this pointer should _not_ be determined by the cv
- qualifiers of the class type. They should be held
- somewhere in the FUNCTION_TYPE, but we don't do that at
- the moment. Consider
- typedef void (Func) () const;
-
- template <typename T1> void Foo (Func T1::*);
-
- */
+ /* The type of the implicit object parameter gets its
+ cv-qualifiers from the FUNCTION_TYPE. */
tree method_type;
-
- method_type = build_method_type_directly (TYPE_MAIN_VARIANT (r),
+ tree this_type = cp_build_qualified_type (TYPE_MAIN_VARIANT (r),
+ cp_type_quals (type));
+ tree memptr;
+ method_type = build_method_type_directly (this_type,
TREE_TYPE (type),
TYPE_ARG_TYPES (type));
- return build_ptrmemfunc_type (build_pointer_type (method_type));
+ memptr = build_ptrmemfunc_type (build_pointer_type (method_type));
+ return cp_build_qualified_type_real (memptr, cp_type_quals (t),
+ complain);
}
else
return cp_build_qualified_type_real (build_ptrmem_type (r, type),
@@ -10299,6 +10247,37 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
DEDUCE_EXACT, 0, -1);
case OFFSET_TYPE:
+ /* Unify a pointer to member with a pointer to member function, which
+ deduces the type of the member as a function type. */
+ if (TYPE_PTRMEMFUNC_P (arg))
+ {
+ tree method_type;
+ tree fntype;
+ cp_cv_quals cv_quals;
+
+ /* Check top-level cv qualifiers */
+ if (!check_cv_quals_for_unify (UNIFY_ALLOW_NONE, arg, parm))
+ return 1;
+
+ if (unify (tparms, targs, TYPE_OFFSET_BASETYPE (parm),
+ TYPE_PTRMEMFUNC_OBJECT_TYPE (arg), UNIFY_ALLOW_NONE))
+ return 1;
+
+ /* Determine the type of the function we are unifying against. */
+ method_type = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (arg));
+ fntype =
+ build_function_type (TREE_TYPE (method_type),
+ TREE_CHAIN (TYPE_ARG_TYPES (method_type)));
+
+ /* Extract the cv-qualifiers of the member function from the
+ implicit object parameter and place them on the function
+ type to be restored later. */
+ cv_quals =
+ cp_type_quals(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (method_type))));
+ fntype = build_qualified_type (fntype, cv_quals);
+ return unify (tparms, targs, TREE_TYPE (parm), fntype, strict);
+ }
+
if (TREE_CODE (arg) != OFFSET_TYPE)
return 1;
if (unify (tparms, targs, TYPE_OFFSET_BASETYPE (parm),
@@ -11694,7 +11673,7 @@ get_mostly_instantiated_function_type (tree decl)
;
else
{
- int i;
+ int i, save_access_control;
tree partial_args;
/* Replace the innermost level of the TARGS with NULL_TREEs to
@@ -11707,12 +11686,10 @@ get_mostly_instantiated_function_type (tree decl)
TMPL_ARGS_DEPTH (targs),
make_tree_vec (DECL_NTPARMS (tmpl)));
- /* Make sure that we can see identifiers, and compute access
- correctly. We can just use the context of DECL for the
- partial substitution here. It depends only on outer template
- parameters, regardless of whether the innermost level is
- specialized or not. */
- push_access_scope (decl);
+ /* Disable access control as this function is used only during
+ name-mangling. */
+ save_access_control = flag_access_control;
+ flag_access_control = 0;
++processing_template_decl;
/* Now, do the (partial) substitution to figure out the
@@ -11727,7 +11704,7 @@ get_mostly_instantiated_function_type (tree decl)
TREE_VEC_LENGTH (partial_args)--;
tparms = tsubst_template_parms (tparms, partial_args, tf_error);
- pop_access_scope (decl);
+ flag_access_control = save_access_control;
}
return fn_type;
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index 31682413161..2ed91a3a79e 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -1,6 +1,6 @@
/* Prints out trees in human readable form.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
@@ -100,8 +100,6 @@ cxx_print_type (FILE *file, tree node, int indent)
fputs ( "needs-constructor", file);
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (node))
fputs (" needs-destructor", file);
- if (TYPE_HAS_DESTRUCTOR (node))
- fputs (" ~X()", file);
if (TYPE_HAS_DEFAULT_CONSTRUCTOR (node))
fputs (" X()", file);
if (TYPE_HAS_CONVERSION (node))
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 2d0569b00a8..a08a3ee5cb7 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1342,7 +1342,7 @@ emit_support_tinfos (void)
if (!COMPLETE_TYPE_P (bltn_type))
return;
dtor = CLASSTYPE_DESTRUCTORS (bltn_type);
- if (DECL_EXTERNAL (dtor))
+ if (!dtor || DECL_EXTERNAL (dtor))
return;
doing_runtime = 1;
for (ix = 0; fundamentals[ix]; ix++)
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 8d5ae655cea..f6a9b577dfc 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1367,6 +1367,12 @@ lookup_fnfields_1 (tree type, tree name)
else if (name == ansi_assopname(NOP_EXPR)
&& CLASSTYPE_LAZY_ASSIGNMENT_OP (type))
lazily_declare_fn (sfk_assignment_operator, type);
+ else if ((name == dtor_identifier
+ || name == base_dtor_identifier
+ || name == complete_dtor_identifier
+ || name == deleting_dtor_identifier)
+ && CLASSTYPE_LAZY_DESTRUCTOR (type))
+ lazily_declare_fn (sfk_destructor, type);
}
method_vec = CLASSTYPE_METHOD_VEC (type);
@@ -1633,9 +1639,12 @@ tree
dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *),
tree (*post_fn) (tree, void *), void *data)
{
+ static int active = 0; /* We must not be called recursively. */
tree rval;
gcc_assert (pre_fn || post_fn);
+ gcc_assert (!active);
+ active++;
if (!CLASSTYPE_DIAMOND_SHAPED_P (BINFO_TYPE (binfo)))
/* We are not diamond shaped, and therefore cannot encounter the
@@ -1660,6 +1669,9 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *),
else
dfs_unmark_r (binfo);
}
+
+ active--;
+
return rval;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ebc213d7812..2daff6f02e0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -285,8 +285,7 @@ perform_deferred_access_checks (void)
{
tree deferred_check;
- for (deferred_check = (VEC_last (deferred_access, deferred_access_stack)
- ->deferred_access_checks);
+ for (deferred_check = get_deferred_access_checks ();
deferred_check;
deferred_check = TREE_CHAIN (deferred_check))
/* Check access. */
@@ -2126,15 +2125,6 @@ begin_class_definition (tree t)
pushtag (make_anon_name (), t, 0);
}
- /* If this type was already complete, and we see another definition,
- that's an error. */
- if (COMPLETE_TYPE_P (t))
- {
- error ("redefinition of %q#T", t);
- cp_error_at ("previous definition of %q#T", t);
- return error_mark_node;
- }
-
/* Update the location of the decl. */
DECL_SOURCE_LOCATION (TYPE_NAME (t)) = input_location;
@@ -2630,11 +2620,6 @@ finish_id_expression (tree id_expression,
need. */
if (TREE_CODE (id_expression) == TEMPLATE_ID_EXPR)
return id_expression;
- /* Since this name was dependent, the expression isn't
- constant -- yet. No error is issued because it might be
- constant when things are instantiated. */
- if (integral_constant_expression_p)
- *non_integral_constant_expression_p = true;
*idk = CP_ID_KIND_UNQUALIFIED_DEPENDENT;
/* If we found a variable, then name lookup during the
instantiation will always resolve to the same VAR_DECL
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8a264d7afa9..321ba4bdbc7 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -499,11 +499,10 @@ cp_build_qualified_type_real (tree type,
return build_ptrmemfunc_type (t);
}
- /* A reference, function or method type shall not be cv qualified.
+ /* A reference or method type shall not be cv qualified.
[dcl.ref], [dct.fct] */
if (type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)
&& (TREE_CODE (type) == REFERENCE_TYPE
- || TREE_CODE (type) == FUNCTION_TYPE
|| TREE_CODE (type) == METHOD_TYPE))
{
bad_quals |= type_quals & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
@@ -511,10 +510,11 @@ cp_build_qualified_type_real (tree type,
}
/* A restrict-qualified type must be a pointer (or reference)
- to object or incomplete type. */
+ to object or incomplete type, or a function type. */
if ((type_quals & TYPE_QUAL_RESTRICT)
&& TREE_CODE (type) != TEMPLATE_TYPE_PARM
&& TREE_CODE (type) != TYPENAME_TYPE
+ && TREE_CODE (type) != FUNCTION_TYPE
&& !POINTER_TYPE_P (type))
{
bad_quals |= TYPE_QUAL_RESTRICT;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index b35ae979b6d..330e8f1ea1a 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1577,9 +1577,6 @@ build_class_member_access_expr (tree object, tree member,
if (object == error_mark_node || member == error_mark_node)
return error_mark_node;
- if (TREE_CODE (member) == PSEUDO_DTOR_EXPR)
- return member;
-
gcc_assert (DECL_P (member) || BASELINK_P (member));
/* [expr.ref]
@@ -1753,7 +1750,7 @@ build_class_member_access_expr (tree object, tree member,
expression itself. */
if (type_quals & TYPE_QUAL_CONST)
TREE_READONLY (result) = 1;
- else if (type_quals & TYPE_QUAL_VOLATILE)
+ if (type_quals & TYPE_QUAL_VOLATILE)
TREE_THIS_VOLATILE (result) = 1;
}
else if (BASELINK_P (member))
@@ -1822,9 +1819,6 @@ lookup_destructor (tree object, tree scope, tree dtor_name)
TYPE_MAIN_VARIANT (object_type), dtor_type);
return error_mark_node;
}
- if (!TYPE_HAS_DESTRUCTOR (dtor_type))
- return build3 (PSEUDO_DTOR_EXPR, void_type_node, object, scope,
- dtor_type);
expr = lookup_member (dtor_type, complete_dtor_identifier,
/*protect=*/1, /*want_type=*/false);
expr = (adjust_result_of_qualified_name_lookup
@@ -6389,6 +6383,47 @@ cp_has_mutable_p (tree type)
return CLASS_TYPE_P (type) && CLASSTYPE_HAS_MUTABLE (type);
}
+/* Apply the TYPE_QUALS to the new DECL. */
+void
+cp_apply_type_quals_to_decl (int type_quals, tree decl)
+{
+ tree type = TREE_TYPE (decl);
+
+ if (type == error_mark_node)
+ return;
+
+ if (TREE_CODE (type) == FUNCTION_TYPE
+ && type_quals != TYPE_UNQUALIFIED)
+ {
+ /* This was an error in C++98 (cv-qualifiers cannot be added to
+ a function type), but DR 295 makes the code well-formed by
+ dropping the extra qualifiers. */
+ if (pedantic)
+ {
+ tree bad_type = build_qualified_type (type, type_quals);
+ pedwarn ("ignoring %qV qualifiers added to function type %qT",
+ bad_type, type);
+ }
+
+ TREE_TYPE (decl) = TYPE_MAIN_VARIANT (type);
+ return;
+ }
+
+ /* Avoid setting TREE_READONLY incorrectly. */
+ if (/* If the object has a constructor, the constructor may modify
+ the object. */
+ TYPE_NEEDS_CONSTRUCTING (type)
+ /* If the type isn't complete, we don't know yet if it will need
+ constructing. */
+ || !COMPLETE_TYPE_P (type)
+ /* If the type has a mutable component, that component might be
+ modified. */
+ || TYPE_HAS_MUTABLE_P (type))
+ type_quals &= ~TYPE_QUAL_CONST;
+
+ c_apply_type_quals_to_decl (type_quals, decl);
+}
+
/* Subroutine of casts_away_constness. Make T1 and T2 point at
exemplar types such that casting T1 to T2 is casting away constness
if and only if there is no implicit conversion from T1 to T2. */
diff --git a/gcc/cse.c b/gcc/cse.c
index 1f71f4cfc54..60dc9a9484b 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -80,11 +80,11 @@ Registers and "quantity numbers":
copies one register into another, we copy the quantity number.
When a register is loaded in any other way, we allocate a new
quantity number to describe the value generated by this operation.
- `reg_qty' records what quantity a register is currently thought
+ `REG_QTY (N)' records what quantity register N is currently thought
of as containing.
All real quantity numbers are greater than or equal to zero.
- If register N has not been assigned a quantity, reg_qty[N] will
+ If register N has not been assigned a quantity, `REG_QTY (N)' will
equal -N - 1, which is always negative.
Quantity numbers below zero do not exist and none of the `qty_table'
@@ -172,18 +172,20 @@ Other expressions:
the register's new value. This sequence of circumstances is rare
within any one basic block.
- The vectors `reg_tick' and `reg_in_table' are used to detect this case.
- reg_tick[i] is incremented whenever a value is stored in register i.
- reg_in_table[i] holds -1 if no references to register i have been
- entered in the table; otherwise, it contains the value reg_tick[i] had
- when the references were entered. If we want to enter a reference
- and reg_in_table[i] != reg_tick[i], we must scan and remove old references.
- Until we want to enter a new entry, the mere fact that the two vectors
- don't match makes the entries be ignored if anyone tries to match them.
+ `REG_TICK' and `REG_IN_TABLE', accessors for members of
+ cse_reg_info, are used to detect this case. REG_TICK (i) is
+ incremented whenever a value is stored in register i.
+ REG_IN_TABLE (i) holds -1 if no references to register i have been
+ entered in the table; otherwise, it contains the value REG_TICK (i)
+ had when the references were entered. If we want to enter a
+ reference and REG_IN_TABLE (i) != REG_TICK (i), we must scan and
+ remove old references. Until we want to enter a new entry, the
+ mere fact that the two vectors don't match makes the entries be
+ ignored if anyone tries to match them.
Registers themselves are entered in the hash table as well as in
- the equivalent-register chains. However, the vectors `reg_tick'
- and `reg_in_table' do not apply to expressions which are simple
+ the equivalent-register chains. However, `REG_TICK' and
+ `REG_IN_TABLE' do not apply to expressions which are simple
register references. These expressions are removed from the table
immediately when they become invalid, and this can be done even if
we do not immediately search for all the expressions that refer to
@@ -289,7 +291,7 @@ static rtx this_insn;
Or -1 if this register is at the end of the chain.
- If reg_qty[N] == N, reg_eqv_table[N].next is undefined. */
+ If REG_QTY (N) == -N - 1, reg_eqv_table[N].next is undefined. */
/* Per-register equivalence chain. */
struct reg_eqv_elem
@@ -333,7 +335,7 @@ static unsigned int cse_reg_info_table_size;
static unsigned int cse_reg_info_table_first_uninitialized;
/* The timestamp at the beginning of the current run of
- cse_basic_block. We increment this variable at at the beginning of
+ cse_basic_block. We increment this variable at the beginning of
the current run of cse_basic_block. The timestamp field of a
cse_reg_info entry matches the value of this variable if and only
if the entry has been initialized during the current run of
@@ -862,10 +864,12 @@ init_cse_reg_info (unsigned int nregs)
}
/* Reallocate the table with NEW_SIZE entries. */
- cse_reg_info_table = xrealloc (cse_reg_info_table,
- (sizeof (struct cse_reg_info)
- * new_size));
+ if (cse_reg_info_table)
+ free (cse_reg_info_table);
+ cse_reg_info_table = xmalloc (sizeof (struct cse_reg_info)
+ * new_size);
cse_reg_info_table_size = new_size;
+ cse_reg_info_table_first_uninitialized = 0;
}
/* Do we have all of the first NREGS entries initialized? */
@@ -7280,8 +7284,9 @@ delete_trivially_dead_insns (rtx insns, int nreg)
timevar_push (TV_DELETE_TRIVIALLY_DEAD);
/* First count the number of times each register is used. */
counts = xcalloc (nreg, sizeof (int));
- for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
- count_reg_usage (insn, counts, 1);
+ for (insn = insns; insn; insn = NEXT_INSN (insn))
+ if (INSN_P (insn))
+ count_reg_usage (insn, counts, 1);
/* Go from the last insn to the first and delete insns that only set unused
registers or copy a register to itself. As we delete an insn, remove
@@ -7290,15 +7295,13 @@ delete_trivially_dead_insns (rtx insns, int nreg)
The first jump optimization pass may leave a real insn as the last
insn in the function. We must not skip that insn or we may end
up deleting code that is not really dead. */
- insn = get_last_insn ();
- if (! INSN_P (insn))
- insn = prev_real_insn (insn);
-
- for (; insn; insn = prev)
+ for (insn = get_last_insn (); insn; insn = prev)
{
int live_insn = 0;
- prev = prev_real_insn (insn);
+ prev = PREV_INSN (insn);
+ if (!INSN_P (insn))
+ continue;
/* Don't delete any insns that are part of a libcall block unless
we can delete the whole libcall block.
@@ -7326,7 +7329,7 @@ delete_trivially_dead_insns (rtx insns, int nreg)
ndead++;
}
- if (find_reg_note (insn, REG_LIBCALL, NULL_RTX))
+ if (in_libcall && find_reg_note (insn, REG_LIBCALL, NULL_RTX))
{
in_libcall = 0;
dead_libcall = 0;
diff --git a/gcc/cselib.c b/gcc/cselib.c
index c64e0874eef..f453489e12b 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1380,7 +1380,10 @@ cselib_process_insn (rtx insn)
if (CALL_P (insn))
{
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (call_used_regs[i])
+ if (call_used_regs[i]
+ || (REG_VALUES (i) && REG_VALUES (i)->elt
+ && HARD_REGNO_CALL_PART_CLOBBERED (i,
+ GET_MODE (REG_VALUES (i)->elt->u.val_rtx))))
cselib_invalidate_regno (i, reg_raw_mode[i]);
if (! CONST_OR_PURE_CALL_P (insn))
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index c595a84cb6f..6383d48d0e9 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -343,7 +343,7 @@ static void dbxout_handle_pch (unsigned);
static void dbxout_source_line (unsigned int, const char *);
static void dbxout_begin_prologue (unsigned int, const char *);
static void dbxout_source_file (const char *);
-static void dbxout_function_end (void);
+static void dbxout_function_end (tree);
static void dbxout_begin_function (tree);
static void dbxout_begin_block (unsigned, unsigned);
static void dbxout_end_block (unsigned, unsigned);
@@ -903,7 +903,7 @@ dbxout_finish_complex_stabs (tree sym, STAB_CODE_TYPE code,
#if defined (DBX_DEBUGGING_INFO)
static void
-dbxout_function_end (void)
+dbxout_function_end (tree decl)
{
char lscope_label_name[100];
@@ -923,7 +923,8 @@ dbxout_function_end (void)
named sections. */
if (!use_gnu_debug_info_extensions
|| NO_DBX_FUNCTION_END
- || !targetm.have_named_sections)
+ || !targetm.have_named_sections
+ || DECL_IGNORED_P (decl))
return;
/* By convention, GCC will mark the end of a function with an N_FUN
@@ -1296,7 +1297,7 @@ dbxout_function_decl (tree decl)
dbxout_begin_function (decl);
#endif
dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));
- dbxout_function_end ();
+ dbxout_function_end (decl);
}
#endif /* DBX_DEBUGGING_INFO */
@@ -2429,6 +2430,9 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
context = decl_function_context (decl);
if (context == current_function_decl)
break;
+ /* Don't mention an inline instance of a nested function. */
+ if (context && DECL_FROM_INLINE (decl))
+ break;
if (!MEM_P (DECL_RTL (decl))
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
break;
@@ -3355,7 +3359,12 @@ dbxout_block (tree block, int depth, tree args)
static void
dbxout_begin_function (tree decl)
{
- int saved_tree_used1 = TREE_USED (decl);
+ int saved_tree_used1;
+
+ if (DECL_IGNORED_P (decl))
+ return;
+
+ saved_tree_used1 = TREE_USED (decl);
TREE_USED (decl) = 1;
if (DECL_NAME (DECL_RESULT (decl)) != 0)
{
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 7c881296394..28a0d83adb6 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -36,19 +36,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
obstack_chunk_alloc, \
obstack_chunk_free)
-/* Define default standard character escape sequences. */
-#ifndef TARGET_BELL
-# define TARGET_BELL 007
-# define TARGET_BS 010
-# define TARGET_CR 015
-# define TARGET_DIGIT0 060
-# define TARGET_ESC 033
-# define TARGET_FF 014
-# define TARGET_NEWLINE 012
-# define TARGET_TAB 011
-# define TARGET_VT 013
-#endif
-
/* Store in OUTPUT a string (made with alloca) containing an
assembler-name for a local static variable or function named NAME.
LABELNO is an integer which is different for each call. */
@@ -768,7 +755,7 @@ do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \
#define REGISTER_MOVE_COST(m, x, y) 2
#endif
-/* Determine whether the the entire c99 runtime
+/* Determine whether the entire c99 runtime
is present in the runtime library. */
#ifndef TARGET_C99_FUNCTIONS
#define TARGET_C99_FUNCTIONS 0
diff --git a/gcc/df.c b/gcc/df.c
index 1fe44f20ef3..ad7852cb4d4 100644
--- a/gcc/df.c
+++ b/gcc/df.c
@@ -320,7 +320,7 @@ df_insn_table_realloc (struct df *df, unsigned int size)
if (! df->insns_modified)
{
- df->insns_modified = BITMAP_XMALLOC ();
+ df->insns_modified = BITMAP_ALLOC (NULL);
bitmap_zero (df->insns_modified);
}
}
@@ -392,10 +392,10 @@ df_bitmaps_alloc (struct df *df, bitmap blocks, int flags)
if (!bb_info->rd_in)
{
/* Allocate bitmaps for reaching definitions. */
- bb_info->rd_kill = BITMAP_XMALLOC ();
- bb_info->rd_gen = BITMAP_XMALLOC ();
- bb_info->rd_in = BITMAP_XMALLOC ();
- bb_info->rd_out = BITMAP_XMALLOC ();
+ bb_info->rd_kill = BITMAP_ALLOC (NULL);
+ bb_info->rd_gen = BITMAP_ALLOC (NULL);
+ bb_info->rd_in = BITMAP_ALLOC (NULL);
+ bb_info->rd_out = BITMAP_ALLOC (NULL);
}
else
{
@@ -411,10 +411,10 @@ df_bitmaps_alloc (struct df *df, bitmap blocks, int flags)
if (!bb_info->ru_in)
{
/* Allocate bitmaps for upward exposed uses. */
- bb_info->ru_kill = BITMAP_XMALLOC ();
- bb_info->ru_gen = BITMAP_XMALLOC ();
- bb_info->ru_in = BITMAP_XMALLOC ();
- bb_info->ru_out = BITMAP_XMALLOC ();
+ bb_info->ru_kill = BITMAP_ALLOC (NULL);
+ bb_info->ru_gen = BITMAP_ALLOC (NULL);
+ bb_info->ru_in = BITMAP_ALLOC (NULL);
+ bb_info->ru_out = BITMAP_ALLOC (NULL);
}
else
{
@@ -430,10 +430,10 @@ df_bitmaps_alloc (struct df *df, bitmap blocks, int flags)
if (!bb_info->lr_in)
{
/* Allocate bitmaps for live variables. */
- bb_info->lr_def = BITMAP_XMALLOC ();
- bb_info->lr_use = BITMAP_XMALLOC ();
- bb_info->lr_in = BITMAP_XMALLOC ();
- bb_info->lr_out = BITMAP_XMALLOC ();
+ bb_info->lr_def = BITMAP_ALLOC (NULL);
+ bb_info->lr_use = BITMAP_ALLOC (NULL);
+ bb_info->lr_in = BITMAP_ALLOC (NULL);
+ bb_info->lr_out = BITMAP_ALLOC (NULL);
}
else
{
@@ -463,39 +463,39 @@ df_bitmaps_free (struct df *df, int flags)
if ((flags & DF_RD) && bb_info->rd_in)
{
/* Free bitmaps for reaching definitions. */
- BITMAP_XFREE (bb_info->rd_kill);
+ BITMAP_FREE (bb_info->rd_kill);
bb_info->rd_kill = NULL;
- BITMAP_XFREE (bb_info->rd_gen);
+ BITMAP_FREE (bb_info->rd_gen);
bb_info->rd_gen = NULL;
- BITMAP_XFREE (bb_info->rd_in);
+ BITMAP_FREE (bb_info->rd_in);
bb_info->rd_in = NULL;
- BITMAP_XFREE (bb_info->rd_out);
+ BITMAP_FREE (bb_info->rd_out);
bb_info->rd_out = NULL;
}
if ((flags & DF_RU) && bb_info->ru_in)
{
/* Free bitmaps for upward exposed uses. */
- BITMAP_XFREE (bb_info->ru_kill);
+ BITMAP_FREE (bb_info->ru_kill);
bb_info->ru_kill = NULL;
- BITMAP_XFREE (bb_info->ru_gen);
+ BITMAP_FREE (bb_info->ru_gen);
bb_info->ru_gen = NULL;
- BITMAP_XFREE (bb_info->ru_in);
+ BITMAP_FREE (bb_info->ru_in);
bb_info->ru_in = NULL;
- BITMAP_XFREE (bb_info->ru_out);
+ BITMAP_FREE (bb_info->ru_out);
bb_info->ru_out = NULL;
}
if ((flags & DF_LR) && bb_info->lr_in)
{
/* Free bitmaps for live variables. */
- BITMAP_XFREE (bb_info->lr_def);
+ BITMAP_FREE (bb_info->lr_def);
bb_info->lr_def = NULL;
- BITMAP_XFREE (bb_info->lr_use);
+ BITMAP_FREE (bb_info->lr_use);
bb_info->lr_use = NULL;
- BITMAP_XFREE (bb_info->lr_in);
+ BITMAP_FREE (bb_info->lr_in);
bb_info->lr_in = NULL;
- BITMAP_XFREE (bb_info->lr_out);
+ BITMAP_FREE (bb_info->lr_out);
bb_info->lr_out = NULL;
}
}
@@ -538,14 +538,14 @@ df_alloc (struct df *df, int n_regs)
df_reg_table_realloc (df, df->n_regs);
- df->bbs_modified = BITMAP_XMALLOC ();
+ df->bbs_modified = BITMAP_ALLOC (NULL);
bitmap_zero (df->bbs_modified);
df->flags = 0;
df->bbs = xcalloc (last_basic_block, sizeof (struct bb_info));
- df->all_blocks = BITMAP_XMALLOC ();
+ df->all_blocks = BITMAP_ALLOC (NULL);
FOR_EACH_BB (bb)
bitmap_set_bit (df->all_blocks, bb->index);
}
@@ -583,13 +583,13 @@ df_free (struct df *df)
df->regs = 0;
df->reg_size = 0;
- BITMAP_XFREE (df->bbs_modified);
+ BITMAP_FREE (df->bbs_modified);
df->bbs_modified = 0;
- BITMAP_XFREE (df->insns_modified);
+ BITMAP_FREE (df->insns_modified);
df->insns_modified = 0;
- BITMAP_XFREE (df->all_blocks);
+ BITMAP_FREE (df->all_blocks);
df->all_blocks = 0;
free_alloc_pool (df_ref_pool);
@@ -1484,14 +1484,14 @@ df_du_chain_create (struct df *df, bitmap blocks)
bitmap ru;
basic_block bb;
- ru = BITMAP_XMALLOC ();
+ ru = BITMAP_ALLOC (NULL);
FOR_EACH_BB_IN_BITMAP (blocks, 0, bb,
{
df_bb_du_chain_create (df, bb, ru);
});
- BITMAP_XFREE (ru);
+ BITMAP_FREE (ru);
}
@@ -1615,7 +1615,7 @@ df_bb_rd_local_compute (struct df *df, basic_block bb, bitmap call_killed_defs)
{
struct bb_info *bb_info = DF_BB_INFO (df, bb);
rtx insn;
- bitmap seen = BITMAP_XMALLOC ();
+ bitmap seen = BITMAP_ALLOC (NULL);
bool call_seen = false;
FOR_BB_INSNS_REVERSE (bb, insn)
@@ -1661,7 +1661,7 @@ df_bb_rd_local_compute (struct df *df, basic_block bb, bitmap call_killed_defs)
}
}
- BITMAP_XFREE (seen);
+ BITMAP_FREE (seen);
}
@@ -1676,7 +1676,7 @@ df_rd_local_compute (struct df *df, bitmap blocks)
if (df->flags & DF_HARD_REGS)
{
- killed_by_call = BITMAP_XMALLOC ();
+ killed_by_call = BITMAP_ALLOC (NULL);
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
if (!TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
@@ -1695,7 +1695,7 @@ df_rd_local_compute (struct df *df, bitmap blocks)
});
if (df->flags & DF_HARD_REGS)
- BITMAP_XFREE (killed_by_call);
+ BITMAP_FREE (killed_by_call);
}
@@ -1872,14 +1872,14 @@ df_reg_info_compute (struct df *df, bitmap blocks)
basic_block bb;
bitmap live;
- live = BITMAP_XMALLOC ();
+ live = BITMAP_ALLOC (NULL);
FOR_EACH_BB_IN_BITMAP (blocks, 0, bb,
{
df_bb_reg_info_compute (df, bb, live);
});
- BITMAP_XFREE (live);
+ BITMAP_FREE (live);
}
diff --git a/gcc/df.h b/gcc/df.h
index a916bc5b2a7..60f6030fae1 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -1,6 +1,7 @@
/* Form lists of pseudo register references for autoinc optimization
for GNU compiler. This is part of flow optimization.
- Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz)
This file is part of GCC.
@@ -57,23 +58,10 @@ enum df_ref_flags
independent. */
DF_REF_READ_WRITE = 1,
- /* This flag is set on register references inside a subreg on
- machines which have CANNOT_CHANGE_MODE_CLASS.
- Note, that this flag can also be set on df_refs representing
- the REG itself (i.e., one might not see the subreg anymore).
- Also note, that this flag is set also for hardreg refs, i.e.,
- you must check yourself if it's a pseudo. */
- DF_REF_MODE_CHANGE = 2,
-
/* This flag is set, if we stripped the subreg from the reference.
In this case we must make conservative guesses, at what the
outer mode was. */
- DF_REF_STRIPPED = 4,
-
- /* This flag is set during register allocation if it's okay for
- the reference's INSN to have one of its operands replaced with a
- memory reference. */
- DF_REF_MEM_OK = 8
+ DF_REF_STRIPPED = 2
};
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index eb1037a5c3a..b047167bc49 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1,5 +1,5 @@
/* Language-independent diagnostic subroutines for the GNU Compiler Collection
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index fa94f48d77d..ea38218b8c1 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -6,10 +6,12 @@
@c @cropmarks
@c @finalout
+@include gcc-common.texi
+
@copying
@c man begin COPYRIGHT
Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
@@ -40,10 +42,6 @@ This manual contains no Invariant Sections. The Front-Cover Texts are
@c man end
@end copying
-@macro gcctabopt{body}
-@code{\body\}
-@end macro
-
@c Create a separate index for command line options.
@defcodeindex op
@syncodeindex vr op
@@ -60,8 +58,7 @@ This manual contains no Invariant Sections. The Front-Cover Texts are
@titlepage
@title The C Preprocessor
-@subtitle Last revised April 2001
-@subtitle for GCC version 3
+@subtitle for GCC version @value{version-GCC}
@author Richard M. Stallman
@author Zachary Weinberg
@page
@@ -1930,16 +1927,16 @@ These macros are defined by all GNU compilers that use the C
preprocessor: C, C++, and Objective-C@. Their values are the major
version, minor version, and patch level of the compiler, as integer
constants. For example, GCC 3.2.1 will define @code{__GNUC__} to 3,
-@code{__GNUC_MINOR__} to 2, and @code{__GNUC_PATCHLEVEL__} to 1. They
-are defined only when the entire compiler is in use; if you invoke the
-preprocessor directly, they are not defined.
+@code{__GNUC_MINOR__} to 2, and @code{__GNUC_PATCHLEVEL__} to 1. These
+macros are also defined if you invoke the preprocessor directly.
@code{__GNUC_PATCHLEVEL__} is new to GCC 3.0; it is also present in the
widely-used development snapshots leading up to 3.0 (which identify
themselves as GCC 2.96 or 2.97, depending on which snapshot you have).
If all you need to know is whether or not your program is being compiled
-by GCC, you can simply test @code{__GNUC__}. If you need to write code
+by GCC, or a non-GCC compiler that claims to accept the GNU C dialects,
+you can simply test @code{__GNUC__}. If you need to write code
which depends on a specific version, you must be more careful. Each
time the minor version is increased, the patch level is reset to zero;
each time the major version is increased (which happens rarely), the
diff --git a/gcc/doc/cppinternals.texi b/gcc/doc/cppinternals.texi
index 4b138a8a6ab..b5ee7844d2d 100644
--- a/gcc/doc/cppinternals.texi
+++ b/gcc/doc/cppinternals.texi
@@ -2,6 +2,8 @@
@setfilename cppinternals.info
@settitle The GNU C Preprocessor Internals
+@include gcc-common.texi
+
@ifinfo
@dircategory Programming
@direntry
@@ -16,7 +18,7 @@
@ifinfo
This file documents the internals of the GNU C Preprocessor.
-Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -41,13 +43,12 @@ into another language, under the above conditions for modified versions.
@titlepage
@c @finalout
@title Cpplib Internals
-@subtitle Last revised January 2002
-@subtitle for GCC version 3.1
+@subtitle for GCC version @value{version-GCC}
@author Neil Booth
@page
@vskip 0pt plus 1filll
@c man begin COPYRIGHT
-Copyright @copyright{} 2000, 2001, 2002, 2004
+Copyright @copyright{} 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
@@ -70,8 +71,8 @@ into another language, under the above conditions for modified versions.
@top
@chapter Cpplib---the GNU C Preprocessor
-The GNU C preprocessor in GCC 3.x has been completely rewritten. It is
-now implemented as a library, @dfn{cpplib}, so it can be easily shared between
+The GNU C preprocessor is
+implemented as a library, @dfn{cpplib}, so it can be easily shared between
a stand-alone preprocessor, and a preprocessor integrated with the C,
C++ and Objective-C front ends. It is also available for use by other
programs, though this is not recommended as its exposed interface has
@@ -111,7 +112,7 @@ other is for both internal and external use.
The convention is that functions and types that are exposed to multiple
files internally are prefixed with @samp{_cpp_}, and are to be found in
-the file @file{cpphash.h}. Functions and types exposed to external
+the file @file{internal.h}. Functions and types exposed to external
clients are in @file{cpplib.h}, and prefixed with @samp{cpp_}. For
historical reasons this is no longer quite true, but we should strive to
stick to it.
@@ -130,7 +131,7 @@ behavior.
@cindex escaped newlines
@section Overview
-The lexer is contained in the file @file{cpplex.c}. It is a hand-coded
+The lexer is contained in the file @file{lex.c}. It is a hand-coded
lexer, and not implemented as a state machine. It can understand C, C++
and Objective-C source code, and has been extended to allow reasonably
successful preprocessing of assembly language. The lexer does not make
@@ -995,7 +996,7 @@ is turned off.
@cindex files
Fairly obviously, the file handling code of cpplib resides in the file
-@file{cppfiles.c}. It takes care of the details of file searching,
+@file{files.c}. It takes care of the details of file searching,
opening, reading and caching, for both the main source file and all the
headers it recursively includes.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index eaea96e2245..c1510492690 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1549,7 +1549,7 @@ useful to override the effects of the @option{-mrtd} switch.
@cindex @code{const} function attribute
Many functions do not examine any values except their arguments, and
have no effects except the return value. Basically this is just slightly
-more strict class than the @code{pure} attribute above, since function is not
+more strict class than the @code{pure} attribute below, since function is not
allowed to read global memory.
@cindex pointer arguments
@@ -2034,6 +2034,8 @@ typedef void voidfn ();
volatile voidfn fatal;
@end smallexample
+This approach does not work in GNU C++.
+
@item nothrow
@cindex @code{nothrow} function attribute
The @code{nothrow} attribute is used to inform the compiler that a
@@ -4507,6 +4509,9 @@ identifier, or a sequence of member accesses and array references.
@findex __builtin_islessequal
@findex __builtin_islessgreater
@findex __builtin_isunordered
+@findex __builtin_powi
+@findex __builtin_powif
+@findex __builtin_powil
@findex _Exit
@findex _exit
@findex abort
@@ -5368,6 +5373,21 @@ Similar to @code{__builtin_parity}, except the argument type is
@code{unsigned long long}.
@end deftypefn
+@deftypefn {Built-in Function} double __builtin_powi (double, int)
+Returns the first argument raised to the power of the second. Unlike the
+@code{pow} function no guarantees about precision and rounding are made.
+@end deftypefn
+
+@deftypefn {Built-in Function} float __builtin_powif (float, int)
+Similar to @code{__builtin_powi}, except the argument and return types
+are @code{float}.
+@end deftypefn
+
+@deftypefn {Built-in Function} {long double} __builtin_powil (long double, int)
+Similar to @code{__builtin_powi}, except the argument and return types
+are @code{long double}.
+@end deftypefn
+
@node Target Builtins
@section Built-in Functions Specific to Particular Target Machines
@@ -9799,6 +9819,16 @@ The use of default arguments in function pointers, function typedefs and
and other places where they are not permitted by the standard is
deprecated and will be removed from a future version of G++.
+G++ allows floating-point literals to appear in integral constant expressions,
+e.g. @samp{ enum E @{ e = int(2.2 * 3.7) @} }
+This extension is deprecated and will be removed from a future version.
+
+G++ allows static data members of const floating-point type to be declared
+with an initializer in a class definition. The standard only allows
+initializers for static members of const integral types and const
+enumeration types so this extension has been deprecated and will be removed
+from a future version.
+
@node Backwards Compatibility
@section Backwards Compatibility
@cindex Backwards Compatibility
diff --git a/gcc/doc/gcc.texi b/gcc/doc/gcc.texi
index 6eac7efd6aa..66e22ed3b48 100644
--- a/gcc/doc/gcc.texi
+++ b/gcc/doc/gcc.texi
@@ -41,7 +41,7 @@
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
@@ -78,11 +78,6 @@ This file documents the use of the GNU compilers.
@center @titlefont{Using the GNU Compiler Collection}
@sp 2
@center by Richard M. Stallman and the GCC Developer Community
-@sp 3
-@center Last updated 23 May 2004
-@sp 1
-
-@center for GCC @value{version-GCC}
@page
@vskip 0pt plus 1filll
For GCC Version @value{version-GCC}@*
diff --git a/gcc/doc/gccint.texi b/gcc/doc/gccint.texi
index a72fc81747b..031c707a2ad 100644
--- a/gcc/doc/gccint.texi
+++ b/gcc/doc/gccint.texi
@@ -27,7 +27,7 @@
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
@@ -64,11 +64,6 @@ This file documents the internals of the GNU compilers.
@center @titlefont{GNU Compiler Collection Internals}
@sp 2
@center by Richard M. Stallman and the GCC Developer Community
-@sp 3
-@center Last updated 23 May 2004
-@sp 1
-
-@center for GCC @value{version-GCC}
@page
@vskip 0pt plus 1filll
For GCC Version @value{version-GCC}@*
diff --git a/gcc/doc/include/gcc-common.texi b/gcc/doc/include/gcc-common.texi
index e6396574936..f59b7557656 100644
--- a/gcc/doc/include/gcc-common.texi
+++ b/gcc/doc/include/gcc-common.texi
@@ -4,7 +4,7 @@
@c Common values used in the GCC manuals:
-@set version-GCC 4.0.0
+@set version-GCC 4.1.0
@c DEVELOPMENT is set to indicate an in-development version,
@c as compared to a release version. When making a release
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 9d5c0553360..0a629a73f29 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -64,7 +64,7 @@
@c Part 2 Summary Description and Copyright
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
@sp 1
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
@@ -1145,6 +1145,12 @@ When this option is specified more detailed information on memory
allocation is gathered. This information is printed when using
@option{-fmem-report}.
+@item --with-gc
+@itemx --with-gc=@var{choice}
+With this option you can specify the garbage collector implementation
+used during the compilation process. @var{choice} can be one of
+@samp{page} and @samp{zone}, where @samp{page} is the default.
+
@item --enable-nls
@itemx --disable-nls
The @option{--enable-nls} option enables Native Language Support (NLS),
@@ -3362,7 +3368,7 @@ PowerPC running Darwin (Mac OS X kernel).
Pre-installed versions of Mac OS X may not include any developer tools,
meaning that you will not be able to build GCC from source. Tool
binaries are available at
-@uref{http://developer.apple.com/tools/compilers.html} (free
+@uref{http://developer.apple.com/darwin/projects/compiler/} (free
registration required).
This version of GCC requires at least cctools-528.
@@ -3596,6 +3602,14 @@ ld: warning: relocation error: R_SPARC_UA32: @dots{}
To work around this problem, compile with @option{-gstabs+} instead of
plain @option{-g}.
+When configuring the GNU Multiple Precision Library (GMP) on a Solaris 7
+or later system, the canonical target triplet must be specified as the
+@command{build} parameter on the configure line:
+
+@smallexample
+./configure --build=sparc-sun-solaris2.7 --prefix=xxx --enable-mpfr
+@end smallexample
+
@html
<hr />
@end html
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index afc15583a0c..8cf5ed9493f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -49,8 +49,7 @@ and the Info entries for @file{gcc}, @file{cpp}, @file{as},
@c man end
@c man begin BUGS
For instructions on reporting bugs, see
-@w{@uref{http://gcc.gnu.org/bugs.html}}. Use of the @command{gccbug}
-script to report bugs is recommended.
+@w{@uref{http://gcc.gnu.org/bugs.html}}.
@c man end
@c man begin AUTHOR
See the Info entry for @command{gcc}, or
@@ -215,7 +214,7 @@ Objective-C and Objective-C++ Dialects}.
-w -Wextra -Wall -Waggregate-return @gol
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
-Wconversion -Wno-deprecated-declarations @gol
--Wdisabled-optimization -Wno-div-by-zero -Wendif-labels @gol
+-Wdisabled-optimization -Wno-div-by-zero -Wno-endif-labels @gol
-Werror -Werror-implicit-function-declaration @gol
-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
-Wno-format-extra-args -Wformat-nonliteral @gol
@@ -267,6 +266,7 @@ Objective-C and Objective-C++ Dialects}.
-fdump-tree-nrv -fdump-tree-vect @gol
-fdump-tree-sra@r{[}-@var{n}@r{]} @gol
-fdump-tree-fre@r{[}-@var{n}@r{]} @gol
+-ftree-vectorizer-verbose=@var{n} @gol
-feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
-feliminate-unused-debug-symbols -fmem-report -fprofile-arcs -ftree-based-profiling @gol
-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
@@ -285,8 +285,8 @@ Objective-C and Objective-C++ Dialects}.
-fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
-fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
-fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
--fcaller-saves -fcprop-registers @gol
--fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol
+-fcaller-saves -fcprop-registers -fcse-follow-jumps @gol
+-fcse-follow-jumps -fcse-skip-blocks -fcx-limited-range -fdata-sections @gol
-fdelayed-branch -fdelete-null-pointer-checks @gol
-fexpensive-optimizations -ffast-math -ffloat-store @gol
-fforce-addr -fforce-mem -ffunction-sections @gol
@@ -499,7 +499,7 @@ Objective-C and Objective-C++ Dialects}.
@emph{IA-64 Options}
@gccoptlist{-mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol
--mvolatile-asm-stop -mb-step -mregister-names -mno-sdata @gol
+-mvolatile-asm-stop -mregister-names -mno-sdata @gol
-mconstant-gp -mauto-pic -minline-float-divide-min-latency @gol
-minline-float-divide-max-throughput @gol
-minline-int-divide-min-latency @gol
@@ -602,7 +602,7 @@ See RS/6000 and PowerPC Options.
-mpowerpc-gfxopt -mno-powerpc-gfxopt @gol
-mnew-mnemonics -mold-mnemonics @gol
-mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc @gol
--m64 -m32 -mxl-call -mno-xl-call -mpe @gol
+-m64 -m32 -mxl-compat -mno-xl-compat -mpe @gol
-malign-power -malign-natural @gol
-msoft-float -mhard-float -mmultiple -mno-multiple @gol
-mstring -mno-string -mupdate -mno-update @gol
@@ -2166,11 +2166,13 @@ Inhibit warning messages about the use of @samp{#import}.
Warn if an array subscript has type @code{char}. This is a common cause
of error, as programmers often forget that this type is signed on some
machines.
+This warning is enabled by @option{-Wall}.
@item -Wcomment
@opindex Wcomment
Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
+This warning is enabled by @option{-Wall}.
@item -Wfatal-errors
@opindex Wfatal-errors
@@ -2291,6 +2293,7 @@ int f()
@item -Wimplicit-int
@opindex Wimplicit-int
Warn when a declaration does not specify a type.
+This warning is enabled by @option{-Wall}.
@item -Wimplicit-function-declaration
@itemx -Werror-implicit-function-declaration
@@ -2299,16 +2302,19 @@ Warn when a declaration does not specify a type.
Give a warning (or error) whenever a function is used before being
declared. The form @option{-Wno-error-implicit-function-declaration}
is not supported.
+This warning is enabled by @option{-Wall} (as a warning, not an error).
@item -Wimplicit
@opindex Wimplicit
Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
+This warning is enabled by @option{-Wall}.
@item -Wmain
@opindex Wmain
Warn if the type of @samp{main} is suspicious. @samp{main} should be a
function with external linkage, returning int, taking either zero
arguments, two, or three arguments of appropriate types.
+This warning is enabled by @option{-Wall}.
@item -Wmissing-braces
@opindex Wmissing-braces
@@ -2321,6 +2327,8 @@ int a[2][2] = @{ 0, 1, 2, 3 @};
int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
@end smallexample
+This warning is enabled by @option{-Wall}.
+
@item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Wmissing-include-dirs
Warn if a user-supplied include directory does not exist.
@@ -2377,6 +2385,8 @@ the enclosing @code{if}. The resulting code would look like this:
@end group
@end smallexample
+This warning is enabled by @option{-Wall}.
+
@item -Wsequence-point
@opindex Wsequence-point
Warn about code that may have undefined semantics because of violations
@@ -2423,6 +2433,8 @@ Links to discussions of the problem, including proposed formal
definitions, may be found on the GCC readings page, at
@w{@uref{http://gcc.gnu.org/readings.html}}.
+This warning is enabled by @option{-Wall}.
+
@item -Wreturn-type
@opindex Wreturn-type
Warn whenever a function is defined with a return-type that defaults to
@@ -2439,6 +2451,8 @@ For C++, a function without return type always produces a diagnostic
message, even when @option{-Wno-return-type} is specified. The only
exceptions are @samp{main} and functions defined in system headers.
+This warning is enabled by @option{-Wall}.
+
@item -Wswitch
@opindex Wswitch
Warn whenever a @code{switch} statement has an index of enumerated type
@@ -2446,6 +2460,7 @@ and lacks a @code{case} for one or more of the named codes of that
enumeration. (The presence of a @code{default} label prevents this
warning.) @code{case} labels outside the enumeration range also
provoke warnings when this option is used.
+This warning is enabled by @option{-Wall}.
@item -Wswitch-default
@opindex Wswitch-switch
@@ -2463,15 +2478,18 @@ provoke warnings when this option is used.
@opindex Wtrigraphs
Warn if any trigraphs are encountered that might change the meaning of
the program (trigraphs within comments are not warned about).
+This warning is enabled by @option{-Wall}.
@item -Wunused-function
@opindex Wunused-function
Warn whenever a static function is declared but not defined or a
non\-inline static function is unused.
+This warning is enabled by @option{-Wall}.
@item -Wunused-label
@opindex Wunused-label
Warn whenever a label is declared but not used.
+This warning is enabled by @option{-Wall}.
To suppress this warning use the @samp{unused} attribute
(@pxref{Variable Attributes}).
@@ -2487,6 +2505,7 @@ To suppress this warning use the @samp{unused} attribute
@opindex Wunused-variable
Warn whenever a local variable or non-constant static variable is unused
aside from its declaration
+This warning is enabled by @option{-Wall}.
To suppress this warning use the @samp{unused} attribute
(@pxref{Variable Attributes}).
@@ -2494,6 +2513,7 @@ To suppress this warning use the @samp{unused} attribute
@item -Wunused-value
@opindex Wunused-value
Warn whenever a statement computes a result that is explicitly not used.
+This warning is enabled by @option{-Wall}.
To suppress this warning cast the expression to @samp{void}.
@@ -2583,6 +2603,8 @@ Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
+This warning is enabled by @option{-Wall}.
+
@item -Wunknown-pragmas
@opindex Wunknown-pragmas
@cindex warning for unknown pragmas
@@ -2854,9 +2876,10 @@ GCC versions before GCC 3.0. @xref{Mixed Declarations}.
@opindex Wundef
Warn if an undefined identifier is evaluated in an @samp{#if} directive.
-@item -Wendif-labels
+@item -Wno-endif-labels
+@opindex Wno-endif-labels
@opindex Wendif-labels
-Warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
+Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
@item -Wshadow
@opindex Wshadow
@@ -3861,6 +3884,13 @@ made by appending @file{.vect} to the source file name.
Enable all the available tree dumps with the flags provided in this option.
@end table
+@item -ftree-vectorizer-verbose=@var{n}
+@opindex ftree-vectorizer-verbose
+This option controls the amount of debugging output the vectorizer prints.
+This information is written to standard error, unless @option{-fdump-tree-all}
+or @option{-fdump-tree-vect} is specified, in which case it is output to the
+usual dump listing file, @file{.vect}.
+
@item -frandom-seed=@var{string}
@opindex frandom-string
This option provides a seed that GCC uses when it would otherwise use
@@ -4816,8 +4846,8 @@ sections.
@item -freorder-functions
@opindex freorder-functions
-Reorder basic blocks in the compiled function in order to reduce number of
-taken branches and improve code locality. This is implemented by using special
+Reorder functions in the object file in order to
+improve code locality. This is implemented by using special
subsections @code{.text.hot} for most frequently executed functions and
@code{.text.unlikely} for unlikely executed functions. Reordering is done by
the linker so object file format must support named sections and linker must
@@ -5042,7 +5072,8 @@ them to store all pertinent intermediate computations into variables.
@opindex ffast-math
Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations}, @*
@option{-fno-trapping-math}, @option{-ffinite-math-only},
-@option{-fno-rounding-math} and @option{-fno-signaling-nans}.
+@option{-fno-rounding-math}, @option{-fno-signaling-nans}
+and @option{fcx-limited-range}.
This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
@@ -5146,6 +5177,17 @@ disable all GCC optimizations that affect signaling NaN behavior.
Treat floating point constant as single precision constant instead of
implicitly converting it to double precision constant.
+@item -fcx-limited-range
+@itemx -fno-cx-limited-range
+@opindex fcx-limited-range
+@opindex fno-cx-limited-range
+When enabled, this option states that a range reduction step is not
+needed when performing complex division. The default is
+@option{-fno-cx-limited-range}, but is enabled by @option{-ffast-math}.
+
+This option controls the default setting of the ISO C99
+@code{CX_LIMITED_RANGE} pragma. Nevertheless, the option applies to
+all languages.
@end table
@@ -6343,11 +6385,6 @@ Dump out a @option{-L} option for each directory that GCC believes might
contain startup files. If the target supports multilibs then the
current multilib directory will be prepended to each of these paths.
-@item %M
-Output the multilib directory with directory separators replaced with
-@samp{_}. If multilib directories are not set, or the multilib directory is
-@file{.} then this option emits nothing.
-
@item %L
Process the @code{lib} spec. This is a spec string for deciding which
libraries should be included on the command line to the linker.
@@ -8836,10 +8873,6 @@ is not position independent code, and violates the IA-64 ABI@.
Generate (or don't) a stop bit immediately before and after volatile asm
statements.
-@item -mb-step
-@opindex mb-step
-Generate code that works around Itanium B step errata.
-
@item -mregister-names
@itemx -mno-register-names
@opindex mregister-names
@@ -10472,13 +10505,17 @@ Specifying @option{-maix64} implies @option{-mpowerpc64} and
@option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
implies @option{-mno-powerpc64}. GCC defaults to @option{-maix32}.
-@item -mxl-call
-@itemx -mno-xl-call
-@opindex mxl-call
-@opindex mno-xl-call
-On AIX, pass floating-point arguments to prototyped functions beyond the
-register save area (RSA) on the stack in addition to argument FPRs. The
-AIX calling convention was extended but not initially documented to
+@item -mxl-compat
+@itemx -mno-xl-compat
+@opindex mxl-compat
+@opindex mno-xl-compat
+Produce code that conforms more closely to IBM XLC semantics when using
+AIX-compatible ABI. Pass floating-point arguments to prototyped
+functions beyond the register save area (RSA) on the stack in addition
+to argument FPRs. Do not assume that most significant double in 128
+bit long double value is properly rounded when comparing values.
+
+The AIX calling convention was extended but not initially documented to
handle an obscure K&R C case of calling a function that takes the
address of its arguments with fewer arguments than declared. AIX XL
compilers access floating point arguments which do not fit in the
@@ -10503,12 +10540,15 @@ option are incompatible.
@itemx -malign-power
@opindex malign-natural
@opindex malign-power
-On AIX, Darwin, and 64-bit PowerPC GNU/Linux, the option
+On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
@option{-malign-natural} overrides the ABI-defined alignment of larger
types, such as floating-point doubles, on their natural size-based boundary.
The option @option{-malign-power} instructs GCC to follow the ABI-specified
alignment rules. GCC defaults to the standard alignment defined in the ABI@.
+On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
+is not supported.
+
@item -msoft-float
@itemx -mhard-float
@opindex msoft-float
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 44dbfe8842a..a2b992e4323 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -5629,11 +5629,11 @@ full-word result.
For many machines, multiple types of branch instructions are provided, each
for different length branch displacements. In most cases, the assembler
will choose the correct instruction to use. However, when the assembler
-cannot do so, GCC can when a special attribute, the @samp{length}
+cannot do so, GCC can when a special attribute, the @code{length}
attribute, is defined. This attribute must be defined to have numeric
values by specifying a null string in its @code{define_attr}.
-In the case of the @samp{length} attribute, two additional forms of
+In the case of the @code{length} attribute, two additional forms of
arithmetic terms are allowed in test expressions:
@table @code
@@ -5653,7 +5653,7 @@ current insn is to be computed.
@cindex @code{addr_vec}, length of
@cindex @code{addr_diff_vec}, length of
For normal insns, the length will be determined by value of the
-@samp{length} attribute. In the case of @code{addr_vec} and
+@code{length} attribute. In the case of @code{addr_vec} and
@code{addr_diff_vec} insn patterns, the length is computed as
the number of vectors multiplied by the size of each vector.
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index c14ce5d5248..625af4b6278 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -31,7 +31,6 @@ through the macros defined in the @file{.h} file.
* Per-Function Data:: Defining data structures for per-function information.
* Storage Layout:: Defining sizes and alignments of data.
* Type Layout:: Defining sizes and properties of basic user data types.
-* Escape Sequences:: Defining the value of target character escape sequences
* Registers:: Naming and describing the hardware registers.
* Register Classes:: Defining the classes of hardware registers.
* Stack and Calling:: Defining which way the stack grows and by how much.
@@ -413,20 +412,10 @@ while the @file{config/rs6000/eabiaix.h} target file defines
@end smallexample
@end defmac
-@defmac LINK_LIBGCC_SPECIAL
-Define this macro if the driver program should find the library
-@file{libgcc.a} itself and should not pass @option{-L} options to the
-linker. If you do not define this macro, the driver program will pass
-the argument @option{-lgcc} to tell the linker to do the search and will
-pass @option{-L} options to it.
-@end defmac
-
@defmac LINK_LIBGCC_SPECIAL_1
Define this macro if the driver program should find the library
@file{libgcc.a}. If you do not define this macro, the driver program will pass
the argument @option{-lgcc} to tell the linker to do the search.
-This macro is similar to @code{LINK_LIBGCC_SPECIAL}, except that it does
-not affect @option{-L} options.
@end defmac
@defmac LINK_GCC_C_SEQUENCE_SPEC
@@ -1646,6 +1635,36 @@ the target machine. If you don't define this, the default is two
words.
@end defmac
+@defmac LIBGCC2_LONG_DOUBLE_TYPE_SIZE
+Define this macro if @code{LONG_DOUBLE_TYPE_SIZE} is not constant or
+if you want routines in @file{libgcc2.a} for a size other than
+@code{LONG_DOUBLE_TYPE_SIZE}. If you don't define this, the
+default is @code{LONG_DOUBLE_TYPE_SIZE}.
+@end defmac
+
+@defmac LIBGCC2_HAS_DF_MODE
+Define this macro if neither @code{LIBGCC2_DOUBLE_TYPE_SIZE} nor
+@code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is
+@code{DFmode} but you want @code{DFmode} routines in @file{libgcc2.a}
+anyway. If you don't define this and either @code{LIBGCC2_DOUBLE_TYPE_SIZE}
+or @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is 64 then the default is 1,
+otherwise it is 0.
+@end defmac
+
+@defmac LIBGCC2_HAS_XF_MODE
+Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
+@code{XFmode} but you want @code{XFmode} routines in @file{libgcc2.a}
+anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
+is 80 then the default is 1, otherwise it is 0.
+@end defmac
+
+@defmac LIBGCC2_HAS_TF_MODE
+Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
+@code{TFmode} but you want @code{TFmode} routines in @file{libgcc2.a}
+anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
+is 128 then the default is 1, otherwise it is 0.
+@end defmac
+
@defmac TARGET_FLT_EVAL_METHOD
A C expression for the value for @code{FLT_EVAL_METHOD} in @file{float.h},
assuming, if applicable, that the floating-point control word is in its
@@ -1816,42 +1835,6 @@ specified by @code{TARGET_VTABLE_ENTRY_ALIGN}), set this to the number
of words in each data entry.
@end defmac
-@node Escape Sequences
-@section Target Character Escape Sequences
-@cindex escape sequences
-
-By default, GCC assumes that the C character escape sequences and other
-characters take on their ASCII values for the target. If this is not
-correct, you must explicitly define all of the macros below. All of
-them must evaluate to constants; they are used in @code{case}
-statements.
-
-@findex TARGET_BELL
-@findex TARGET_BS
-@findex TARGET_CR
-@findex TARGET_DIGIT0
-@findex TARGET_ESC
-@findex TARGET_FF
-@findex TARGET_NEWLINE
-@findex TARGET_TAB
-@findex TARGET_VT
-@multitable {@code{TARGET_NEWLINE}} {Escape} {ASCII character}
-@item Macro @tab Escape @tab ASCII character
-@item @code{TARGET_BELL} @tab @kbd{\a} @tab @code{07}, @code{BEL}
-@item @code{TARGET_BS} @tab @kbd{\b} @tab @code{08}, @code{BS}
-@item @code{TARGET_CR} @tab @kbd{\r} @tab @code{0D}, @code{CR}
-@item @code{TARGET_DIGIT0} @tab @kbd{0} @tab @code{30}, @code{ZERO}
-@item @code{TARGET_ESC} @tab @kbd{\e}, @kbd{\E} @tab @code{1B}, @code{ESC}
-@item @code{TARGET_FF} @tab @kbd{\f} @tab @code{0C}, @code{FF}
-@item @code{TARGET_NEWLINE} @tab @kbd{\n} @tab @code{0A}, @code{LF}
-@item @code{TARGET_TAB} @tab @kbd{\t} @tab @code{09}, @code{HT}
-@item @code{TARGET_VT} @tab @kbd{\v} @tab @code{0B}, @code{VT}
-@end multitable
-
-@noindent
-Note that the @kbd{\e} and @kbd{\E} escapes are GNU extensions, not
-part of the C standard.
-
@node Registers
@section Register Usage
@cindex register usage
@@ -2931,6 +2914,18 @@ length of the outgoing arguments. The default is correct for most
machines. See @file{function.c} for details.
@end defmac
+@defmac INITIAL_FRAME_ADDRESS_RTX
+A C expression whose value is RTL representing the address of the initial
+ stack frame. This address is passed to @code{RETURN_ADDR_RTX} and
+@code{DYNAMIC_CHAIN_ADDRESS}.
+If you don't define this macro, the default is to return
+@code{hard_frame_pointer_rtx}.
+This default is usually correct unless @code{-fomit-frame-pointer} is in
+effect.
+Define this macro in order to make @code{__builtin_frame_address (0)} and
+@code{__builtin_return_address (0)} work even in absence of a hard frame pointer.
+@end defmac
+
@defmac DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
A C expression whose value is RTL representing the address in a stack
frame where the pointer to the caller's frame is stored. Assume that
diff --git a/gcc/dominance.c b/gcc/dominance.c
index 7970e242526..f001c680243 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -1,5 +1,5 @@
/* Calculate (post)dominators in slightly super-linear time.
- Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Michael Matz (matz@ifh.de).
This file is part of GCC.
@@ -170,7 +170,7 @@ init_dom_info (struct dom_info *di, enum cdi_direction dir)
di->dfsnum = 1;
di->nodes = 0;
- di->fake_exit_edge = dir ? BITMAP_XMALLOC () : NULL;
+ di->fake_exit_edge = dir ? BITMAP_ALLOC (NULL) : NULL;
}
#undef init_ar
@@ -191,7 +191,7 @@ free_dom_info (struct dom_info *di)
free (di->set_child);
free (di->dfs_order);
free (di->dfs_to_bb);
- BITMAP_XFREE (di->fake_exit_edge);
+ BITMAP_FREE (di->fake_exit_edge);
}
/* The nonrecursive variant of creating a DFS tree. DI is our working
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 49bca54c951..76661ba6d8b 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -4117,7 +4117,7 @@ static char ranges_section_label[2 * MAX_ARTIFICIAL_LABEL_BYTES];
#endif
/* We allow a language front-end to designate a function that is to be
- called to "demangle" any name before it it put into a DIE. */
+ called to "demangle" any name before it is put into a DIE. */
static const char *(*demangle_name_func) (const char *);
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 46d9183b92d..37bd66587d8 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1533,7 +1533,12 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
if (base && DECL_P (base)
&& TREE_READONLY (base)
&& (TREE_STATIC (base) || DECL_EXTERNAL (base)))
- MEM_READONLY_P (ref) = 1;
+ {
+ tree base_type = TREE_TYPE (base);
+ gcc_assert (!(base_type && TYPE_NEEDS_CONSTRUCTING (base_type))
+ || DECL_ARTIFICIAL (base));
+ MEM_READONLY_P (ref) = 1;
+ }
if (TREE_THIS_VOLATILE (t))
MEM_VOLATILE_P (ref) = 1;
diff --git a/gcc/except.c b/gcc/except.c
index 56bc2d79199..b2e4188d957 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1,6 +1,6 @@
/* Implements exception handling.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Mike Stump <mrs@cygnus.com>.
This file is part of GCC.
@@ -3248,6 +3248,7 @@ output_function_exception_table (void)
#ifdef TARGET_UNWIND_INFO
/* TODO: Move this into target file. */
+ assemble_external_libcall (eh_personality_libfunc);
fputs ("\t.personality\t", asm_out_file);
output_addr_const (asm_out_file, eh_personality_libfunc);
fputs ("\n\t.handlerdata\n", asm_out_file);
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 1a1bdf74b04..afbbaf53869 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -145,7 +145,8 @@ init_expmed (void)
memset (&all, 0, sizeof all);
PUT_CODE (&all.reg, REG);
- REGNO (&all.reg) = 10000;
+ /* Avoid using hard regs in ways which may be unsupported. */
+ REGNO (&all.reg) = LAST_VIRTUAL_REGISTER + 1;
PUT_CODE (&all.plus, PLUS);
XEXP (&all.plus, 0) = &all.reg;
@@ -1089,7 +1090,7 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
}
/* If we have an out-of-bounds access to a register, just return an
- uninitialised register of the required mode. This can occur if the
+ uninitialized register of the required mode. This can occur if the
source code contains an out-of-bounds access to a small array. */
if (REG_P (op0) && bitnum >= GET_MODE_BITSIZE (GET_MODE (op0)))
return gen_reg_rtx (tmode);
@@ -2231,9 +2232,8 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted,
tree type = TREE_TYPE (amount);
tree new_amount = make_tree (type, op1);
tree other_amount
- = fold (build2 (MINUS_EXPR, type, convert
- (type, build_int_cst
- (NULL_TREE, GET_MODE_BITSIZE (mode))),
+ = fold (build2 (MINUS_EXPR, type,
+ build_int_cst (type, GET_MODE_BITSIZE (mode)),
amount));
shifted = force_reg (mode, shifted);
@@ -4871,17 +4871,15 @@ make_tree (tree type, rtx x)
case LSHIFTRT:
t = lang_hooks.types.unsigned_type (type);
- return fold (convert (type,
- build2 (RSHIFT_EXPR, t,
- make_tree (t, XEXP (x, 0)),
- make_tree (type, XEXP (x, 1)))));
+ return fold_convert (type, build2 (RSHIFT_EXPR, t,
+ make_tree (t, XEXP (x, 0)),
+ make_tree (type, XEXP (x, 1))));
case ASHIFTRT:
t = lang_hooks.types.signed_type (type);
- return fold (convert (type,
- build2 (RSHIFT_EXPR, t,
- make_tree (t, XEXP (x, 0)),
- make_tree (type, XEXP (x, 1)))));
+ return fold_convert (type, build2 (RSHIFT_EXPR, t,
+ make_tree (t, XEXP (x, 0)),
+ make_tree (type, XEXP (x, 1))));
case DIV:
if (TREE_CODE (type) != REAL_TYPE)
@@ -4889,22 +4887,20 @@ make_tree (tree type, rtx x)
else
t = type;
- return fold (convert (type,
- build2 (TRUNC_DIV_EXPR, t,
- make_tree (t, XEXP (x, 0)),
- make_tree (t, XEXP (x, 1)))));
+ return fold_convert (type, build2 (TRUNC_DIV_EXPR, t,
+ make_tree (t, XEXP (x, 0)),
+ make_tree (t, XEXP (x, 1))));
case UDIV:
t = lang_hooks.types.unsigned_type (type);
- return fold (convert (type,
- build2 (TRUNC_DIV_EXPR, t,
- make_tree (t, XEXP (x, 0)),
- make_tree (t, XEXP (x, 1)))));
+ return fold_convert (type, build2 (TRUNC_DIV_EXPR, t,
+ make_tree (t, XEXP (x, 0)),
+ make_tree (t, XEXP (x, 1))));
case SIGN_EXTEND:
case ZERO_EXTEND:
t = lang_hooks.types.type_for_mode (GET_MODE (XEXP (x, 0)),
GET_CODE (x) == ZERO_EXTEND);
- return fold (convert (type, make_tree (t, XEXP (x, 0))));
+ return fold_convert (type, make_tree (t, XEXP (x, 0)));
default:
t = build_decl (VAR_DECL, NULL_TREE, type);
diff --git a/gcc/flags.h b/gcc/flags.h
index 91e719a0807..695d6228f65 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -1,6 +1,6 @@
/* Compilation switch flag definitions for GCC.
Copyright (C) 1987, 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
- 2003, 2004
+ 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -145,9 +145,9 @@ extern int flag_pcc_struct_return;
/* 0 means straightforward implementation of complex divide acceptable.
1 means wide ranges of inputs must work for complex divide.
- 2 means C99-like requirements for complex divide (not yet implemented). */
+ 2 means C99-like requirements for complex multiply and divide. */
-extern int flag_complex_divide_method;
+extern int flag_complex_method;
/* Nonzero means that we don't want inlining by virtue of -fno-inline,
not just because the tree inliner turned us off. */
diff --git a/gcc/flow.c b/gcc/flow.c
index 0aa23c03d22..d3850cc9618 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -165,6 +165,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
#endif
+/* This is the maximum number of times we process any given block if the
+ latest loop depth count is smaller than this number. Only used for the
+ failure strategy to avoid infinite loops in calculate_global_regs_live. */
+#define MAX_LIVENESS_ROUNDS 20
+
/* Nonzero if the second flow pass has completed. */
int flow2_completed;
@@ -729,21 +734,10 @@ update_life_info_in_dirty_blocks (enum update_life_extent extent, int prop_flags
sbitmap_zero (update_life_blocks);
FOR_EACH_BB (bb)
{
- if (extent == UPDATE_LIFE_LOCAL)
+ if (bb->flags & BB_DIRTY)
{
- if (bb->flags & BB_DIRTY)
- {
- SET_BIT (update_life_blocks, bb->index);
- n++;
- }
- }
- else
- {
- /* ??? Bootstrap with -march=pentium4 fails to terminate
- with only a partial life update. */
SET_BIT (update_life_blocks, bb->index);
- if (bb->flags & BB_DIRTY)
- n++;
+ n++;
}
}
@@ -823,21 +817,35 @@ delete_noop_moves (void)
void
delete_dead_jumptables (void)
{
- rtx insn, next;
- for (insn = get_insns (); insn; insn = next)
+ basic_block bb;
+
+ /* A dead jump table does not belong to any basic block. Scan insns
+ between two adjacent basic blocks. */
+ FOR_EACH_BB (bb)
{
- next = NEXT_INSN (insn);
- if (LABEL_P (insn)
- && LABEL_NUSES (insn) == LABEL_PRESERVE_P (insn)
- && JUMP_P (next)
- && (GET_CODE (PATTERN (next)) == ADDR_VEC
- || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
+ rtx insn, next;
+
+ for (insn = NEXT_INSN (BB_END (bb));
+ insn && !NOTE_INSN_BASIC_BLOCK_P (insn);
+ insn = next)
{
- if (dump_file)
- fprintf (dump_file, "Dead jumptable %i removed\n", INSN_UID (insn));
- delete_insn (NEXT_INSN (insn));
- delete_insn (insn);
- next = NEXT_INSN (next);
+ next = NEXT_INSN (insn);
+ if (LABEL_P (insn)
+ && LABEL_NUSES (insn) == LABEL_PRESERVE_P (insn)
+ && JUMP_P (next)
+ && (GET_CODE (PATTERN (next)) == ADDR_VEC
+ || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
+ {
+ rtx label = insn, jump = next;
+
+ if (dump_file)
+ fprintf (dump_file, "Dead jumptable %i removed\n",
+ INSN_UID (insn));
+
+ next = NEXT_INSN (next);
+ delete_insn (jump);
+ delete_insn (label);
+ }
}
}
}
@@ -1010,6 +1018,9 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
{
basic_block *queue, *qhead, *qtail, *qend, bb;
regset tmp, new_live_at_end, invalidated_by_call;
+ regset registers_made_dead;
+ bool failure_strategy_required = false;
+ int *block_accesses;
/* The registers that are modified within this in block. */
regset *local_sets;
@@ -1030,6 +1041,7 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
tmp = ALLOC_REG_SET (&reg_obstack);
new_live_at_end = ALLOC_REG_SET (&reg_obstack);
invalidated_by_call = ALLOC_REG_SET (&reg_obstack);
+ registers_made_dead = ALLOC_REG_SET (&reg_obstack);
/* Inconveniently, this is only readily available in hard reg set form. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
@@ -1070,6 +1082,8 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
}
}
+ block_accesses = xcalloc (last_basic_block, sizeof (int));
+
/* We clean aux when we remove the initially-enqueued bbs, but we
don't enqueue ENTRY and EXIT initially, so clean them upfront and
unconditionally. */
@@ -1095,7 +1109,41 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
from GLOBAL_LIVE_AT_START. In the former case, the register
could go away only if it disappeared from GLOBAL_LIVE_AT_START
for one of the successor blocks. By induction, that cannot
- occur. */
+ occur.
+
+ ??? This reasoning doesn't work if we start from non-empty initial
+ GLOBAL_LIVE_AT_START sets. And there are actually two problems:
+ 1) Updating may not terminate (endless oscillation).
+ 2) Even if it does (and it usually does), the resulting information
+ may be inaccurate. Consider for example the following case:
+
+ a = ...;
+ while (...) {...} -- 'a' not mentioned at all
+ ... = a;
+
+ If the use of 'a' is deleted between two calculations of liveness
+ information and the initial sets are not cleared, the information
+ about a's liveness will get stuck inside the loop and the set will
+ appear not to be dead.
+
+ We do not attempt to solve 2) -- the information is conservatively
+ correct (i.e. we never claim that something live is dead) and the
+ amount of optimization opportunities missed due to this problem is
+ not significant.
+
+ 1) is more serious. In order to fix it, we monitor the number of times
+ each block is processed. Once one of the blocks has been processed more
+ times than the maximum number of rounds, we use the following strategy:
+ When a register disappears from one of the sets, we add it to a MAKE_DEAD
+ set, remove all registers in this set from all GLOBAL_LIVE_AT_* sets and
+ add the blocks with changed sets into the queue. Thus we are guaranteed
+ to terminate (the worst case corresponds to all registers in MADE_DEAD,
+ in which case the original reasoning above is valid), but in general we
+ only fix up a few offending registers.
+
+ The maximum number of rounds for computing liveness is the largest of
+ MAX_LIVENESS_ROUNDS and the latest loop depth count for this function. */
+
while (qhead != qtail)
{
int rescan, changed;
@@ -1108,6 +1156,17 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
qhead = queue;
bb->aux = NULL;
+ /* Should we start using the failure strategy? */
+ if (bb != ENTRY_BLOCK_PTR)
+ {
+ int max_liveness_rounds =
+ MAX (MAX_LIVENESS_ROUNDS, cfun->max_loop_depth);
+
+ block_accesses[bb->index]++;
+ if (block_accesses[bb->index] > max_liveness_rounds)
+ failure_strategy_required = true;
+ }
+
/* Begin by propagating live_at_start from the successor blocks. */
CLEAR_REG_SET (new_live_at_end);
@@ -1263,6 +1322,62 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
if (REG_SET_EQUAL_P (bb->global_live_at_start, new_live_at_end))
continue;
+ if (failure_strategy_required)
+ {
+ /* Get the list of registers that were removed from the
+ bb->global_live_at_start set. */
+ bitmap_and_compl (tmp, bb->global_live_at_start,
+ new_live_at_end);
+ if (!bitmap_empty_p (tmp))
+ {
+ bool pbb_changed;
+ basic_block pbb;
+
+ /* It should not happen that one of registers we have
+ removed last time is disappears again before any other
+ register does. */
+ pbb_changed = bitmap_ior_into (registers_made_dead, tmp);
+ gcc_assert (pbb_changed);
+
+ /* Now remove the registers from all sets. */
+ FOR_EACH_BB (pbb)
+ {
+ pbb_changed = false;
+
+ pbb_changed
+ |= bitmap_and_compl_into (pbb->global_live_at_start,
+ registers_made_dead);
+ pbb_changed
+ |= bitmap_and_compl_into (pbb->global_live_at_end,
+ registers_made_dead);
+ if (!pbb_changed)
+ continue;
+
+ /* Note the (possible) change. */
+ if (blocks_out)
+ SET_BIT (blocks_out, pbb->index);
+
+ /* Makes sure to really rescan the block. */
+ if (local_sets[pbb->index - (INVALID_BLOCK + 1)])
+ {
+ FREE_REG_SET (local_sets[pbb->index - (INVALID_BLOCK + 1)]);
+ FREE_REG_SET (cond_local_sets[pbb->index - (INVALID_BLOCK + 1)]);
+ local_sets[pbb->index - (INVALID_BLOCK + 1)] = 0;
+ }
+
+ /* Add it to the queue. */
+ if (pbb->aux == NULL)
+ {
+ *qtail++ = pbb;
+ if (qtail == qend)
+ qtail = queue;
+ pbb->aux = pbb;
+ }
+ }
+ continue;
+ }
+ } /* end of failure_strategy_required */
+
COPY_REG_SET (bb->global_live_at_start, new_live_at_end);
}
@@ -1284,6 +1399,7 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
FREE_REG_SET (tmp);
FREE_REG_SET (new_live_at_end);
FREE_REG_SET (invalidated_by_call);
+ FREE_REG_SET (registers_made_dead);
if (blocks_out)
{
@@ -1303,6 +1419,7 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
}
}
+ free (block_accesses);
free (queue);
free (cond_local_sets);
free (local_sets);
@@ -1826,12 +1943,12 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
else
pbi->reg_next_use = NULL;
- pbi->new_set = BITMAP_XMALLOC ();
+ pbi->new_set = BITMAP_ALLOC (NULL);
#ifdef HAVE_conditional_execution
pbi->reg_cond_dead = splay_tree_new (splay_tree_compare_ints, NULL,
free_reg_cond_life_info);
- pbi->reg_cond_reg = BITMAP_XMALLOC ();
+ pbi->reg_cond_reg = BITMAP_ALLOC (NULL);
/* If this block ends in a conditional branch, for each register
live from one side of the branch and not the other, record the
@@ -1973,11 +2090,11 @@ free_propagate_block_info (struct propagate_block_info *pbi)
{
free_EXPR_LIST_list (&pbi->mem_set_list);
- BITMAP_XFREE (pbi->new_set);
+ BITMAP_FREE (pbi->new_set);
#ifdef HAVE_conditional_execution
splay_tree_delete (pbi->reg_cond_dead);
- BITMAP_XFREE (pbi->reg_cond_reg);
+ BITMAP_FREE (pbi->reg_cond_reg);
#endif
if (pbi->flags & PROP_REG_INFO)
@@ -2891,7 +3008,7 @@ mark_regno_cond_dead (struct propagate_block_info *pbi, int regno, rtx cond)
/* Otherwise this is a conditional set. Record that fact.
It may have been conditionally used, or there may be a
- subsequent set with a complimentary condition. */
+ subsequent set with a complementary condition. */
node = splay_tree_lookup (pbi->reg_cond_dead, regno);
if (node == NULL)
@@ -4205,17 +4322,11 @@ debug_regset (regset r)
register allocators to prioritize pseudos for allocation to hard regs.
More accurate reference counts generally lead to better register allocation.
- F is the first insn to be scanned.
-
- LOOP_STEP denotes how much loop_depth should be incremented per
- loop nesting level in order to increase the ref count more for
- references in a loop.
-
It might be worthwhile to update REG_LIVE_LENGTH, REG_BASIC_BLOCK and
possibly other information which is used by the register allocators. */
void
-recompute_reg_usage (rtx f ATTRIBUTE_UNUSED, int loop_step ATTRIBUTE_UNUSED)
+recompute_reg_usage (void)
{
allocate_reg_life_data ();
/* distribute_notes in combiner fails to convert some of the REG_UNUSED notes
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 1d2efbd2c23..5c3139ccb50 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2936,8 +2936,7 @@ invert_truthvalue (tree arg)
switch (code)
{
case INTEGER_CST:
- return fold_convert (type,
- build_int_cst (NULL_TREE, integer_zerop (arg)));
+ return constant_boolean_node (integer_zerop (arg), type);
case TRUTH_AND_EXPR:
return build2 (TRUTH_OR_EXPR, type,
@@ -3076,8 +3075,20 @@ static tree
make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos,
int unsignedp)
{
- tree result = build3 (BIT_FIELD_REF, type, inner,
- size_int (bitsize), bitsize_int (bitpos));
+ tree result;
+
+ if (bitpos == 0)
+ {
+ tree size = TYPE_SIZE (TREE_TYPE (inner));
+ if ((INTEGRAL_TYPE_P (TREE_TYPE (inner))
+ || POINTER_TYPE_P (TREE_TYPE (inner)))
+ && host_integerp (size, 0)
+ && tree_low_cst (size, 0) == bitsize)
+ return fold_convert (type, inner);
+ }
+
+ result = build3 (BIT_FIELD_REF, type, inner,
+ size_int (bitsize), bitsize_int (bitpos));
BIT_FIELD_REF_UNSIGNED (result) = unsignedp;
@@ -5370,9 +5381,6 @@ constant_boolean_node (int value, tree type)
return value ? integer_one_node : integer_zero_node;
else if (type == boolean_type_node)
return value ? boolean_true_node : boolean_false_node;
- else if (TREE_CODE (type) == BOOLEAN_TYPE)
- return lang_hooks.truthvalue_conversion (value ? integer_one_node
- : integer_zero_node);
else
return build_int_cst (type, value);
}
@@ -6172,12 +6180,12 @@ fold_sign_changed_comparison (enum tree_code code, tree type,
}
/* Tries to replace &a[idx] CODE s * delta with &a[idx CODE delta], if s is
- step of the array. TYPE is the type of the expression. ADDR is the address.
- MULT is the multiplicative expression. If the function succeeds, the new
- address expression is returned. Otherwise NULL_TREE is returned. */
+ step of the array. ADDR is the address. MULT is the multiplicative expression.
+ If the function succeeds, the new address expression is returned. Otherwise
+ NULL_TREE is returned. */
static tree
-try_move_mult_to_index (tree type, enum tree_code code, tree addr, tree mult)
+try_move_mult_to_index (enum tree_code code, tree addr, tree mult)
{
tree s, delta, step;
tree arg0 = TREE_OPERAND (mult, 0), arg1 = TREE_OPERAND (mult, 1);
@@ -6214,7 +6222,7 @@ try_move_mult_to_index (tree type, enum tree_code code, tree addr, tree mult)
/* If the type sizes do not match, we might run into problems
when one of them would overflow. */
- if (TYPE_PRECISION (itype) != TYPE_PRECISION (type))
+ if (TYPE_PRECISION (itype) != TYPE_PRECISION (TREE_TYPE (s)))
continue;
if (!operand_equal_p (step, fold_convert (itype, s), 0))
@@ -6246,7 +6254,7 @@ try_move_mult_to_index (tree type, enum tree_code code, tree addr, tree mult)
TREE_OPERAND (pos, 1),
delta));
- return build1 (ADDR_EXPR, type, ret);
+ return build1 (ADDR_EXPR, TREE_TYPE (addr), ret);
}
@@ -6294,6 +6302,300 @@ fold_to_nonsharp_ineq_using_bound (tree ineq, tree bound)
return fold (build2 (GE_EXPR, type, a, y));
}
+/* Fold complex addition when both components are accessible by parts.
+ Return non-null if successful. CODE should be PLUS_EXPR for addition,
+ or MINUS_EXPR for subtraction. */
+
+static tree
+fold_complex_add (tree type, tree ac, tree bc, enum tree_code code)
+{
+ tree ar, ai, br, bi, rr, ri, inner_type;
+
+ if (TREE_CODE (ac) == COMPLEX_EXPR)
+ ar = TREE_OPERAND (ac, 0), ai = TREE_OPERAND (ac, 1);
+ else if (TREE_CODE (ac) == COMPLEX_CST)
+ ar = TREE_REALPART (ac), ai = TREE_IMAGPART (ac);
+ else
+ return NULL;
+
+ if (TREE_CODE (bc) == COMPLEX_EXPR)
+ br = TREE_OPERAND (bc, 0), bi = TREE_OPERAND (bc, 1);
+ else if (TREE_CODE (bc) == COMPLEX_CST)
+ br = TREE_REALPART (bc), bi = TREE_IMAGPART (bc);
+ else
+ return NULL;
+
+ inner_type = TREE_TYPE (type);
+
+ rr = fold (build2 (code, inner_type, ar, br));
+ ri = fold (build2 (code, inner_type, ai, bi));
+
+ return fold (build2 (COMPLEX_EXPR, type, rr, ri));
+}
+
+/* Perform some simplifications of complex multiplication when one or more
+ of the components are constants or zeros. Return non-null if successful. */
+
+tree
+fold_complex_mult_parts (tree type, tree ar, tree ai, tree br, tree bi)
+{
+ tree rr, ri, inner_type, zero;
+ bool ar0, ai0, br0, bi0, bi1;
+
+ inner_type = TREE_TYPE (type);
+ zero = NULL;
+
+ if (SCALAR_FLOAT_TYPE_P (inner_type))
+ {
+ ar0 = ai0 = br0 = bi0 = bi1 = false;
+
+ /* We're only interested in +0.0 here, thus we don't use real_zerop. */
+
+ if (TREE_CODE (ar) == REAL_CST
+ && REAL_VALUES_IDENTICAL (TREE_REAL_CST (ar), dconst0))
+ ar0 = true, zero = ar;
+
+ if (TREE_CODE (ai) == REAL_CST
+ && REAL_VALUES_IDENTICAL (TREE_REAL_CST (ai), dconst0))
+ ai0 = true, zero = ai;
+
+ if (TREE_CODE (br) == REAL_CST
+ && REAL_VALUES_IDENTICAL (TREE_REAL_CST (br), dconst0))
+ br0 = true, zero = br;
+
+ if (TREE_CODE (bi) == REAL_CST)
+ {
+ if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (bi), dconst0))
+ bi0 = true, zero = bi;
+ else if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (bi), dconst1))
+ bi1 = true;
+ }
+ }
+ else
+ {
+ ar0 = integer_zerop (ar);
+ if (ar0)
+ zero = ar;
+ ai0 = integer_zerop (ai);
+ if (ai0)
+ zero = ai;
+ br0 = integer_zerop (br);
+ if (br0)
+ zero = br;
+ bi0 = integer_zerop (bi);
+ if (bi0)
+ {
+ zero = bi;
+ bi1 = false;
+ }
+ else
+ bi1 = integer_onep (bi);
+ }
+
+ /* We won't optimize anything below unless something is zero. */
+ if (zero == NULL)
+ return NULL;
+
+ if (ai0 && br0 && bi1)
+ {
+ rr = zero;
+ ri = ar;
+ }
+ else if (ai0 && bi0)
+ {
+ rr = fold (build2 (MULT_EXPR, inner_type, ar, br));
+ ri = zero;
+ }
+ else if (ai0 && br0)
+ {
+ rr = zero;
+ ri = fold (build2 (MULT_EXPR, inner_type, ar, bi));
+ }
+ else if (ar0 && bi0)
+ {
+ rr = zero;
+ ri = fold (build2 (MULT_EXPR, inner_type, ai, br));
+ }
+ else if (ar0 && br0)
+ {
+ rr = fold (build2 (MULT_EXPR, inner_type, ai, bi));
+ rr = fold (build1 (NEGATE_EXPR, inner_type, rr));
+ ri = zero;
+ }
+ else if (bi0)
+ {
+ rr = fold (build2 (MULT_EXPR, inner_type, ar, br));
+ ri = fold (build2 (MULT_EXPR, inner_type, ai, br));
+ }
+ else if (ai0)
+ {
+ rr = fold (build2 (MULT_EXPR, inner_type, ar, br));
+ ri = fold (build2 (MULT_EXPR, inner_type, ar, bi));
+ }
+ else if (br0)
+ {
+ rr = fold (build2 (MULT_EXPR, inner_type, ai, bi));
+ rr = fold (build1 (NEGATE_EXPR, inner_type, rr));
+ ri = fold (build2 (MULT_EXPR, inner_type, ar, bi));
+ }
+ else if (ar0)
+ {
+ rr = fold (build2 (MULT_EXPR, inner_type, ai, bi));
+ rr = fold (build1 (NEGATE_EXPR, inner_type, rr));
+ ri = fold (build2 (MULT_EXPR, inner_type, ai, br));
+ }
+ else
+ return NULL;
+
+ return fold (build2 (COMPLEX_EXPR, type, rr, ri));
+}
+
+static tree
+fold_complex_mult (tree type, tree ac, tree bc)
+{
+ tree ar, ai, br, bi;
+
+ if (TREE_CODE (ac) == COMPLEX_EXPR)
+ ar = TREE_OPERAND (ac, 0), ai = TREE_OPERAND (ac, 1);
+ else if (TREE_CODE (ac) == COMPLEX_CST)
+ ar = TREE_REALPART (ac), ai = TREE_IMAGPART (ac);
+ else
+ return NULL;
+
+ if (TREE_CODE (bc) == COMPLEX_EXPR)
+ br = TREE_OPERAND (bc, 0), bi = TREE_OPERAND (bc, 1);
+ else if (TREE_CODE (bc) == COMPLEX_CST)
+ br = TREE_REALPART (bc), bi = TREE_IMAGPART (bc);
+ else
+ return NULL;
+
+ return fold_complex_mult_parts (type, ar, ai, br, bi);
+}
+
+/* Perform some simplifications of complex division when one or more of
+ the components are constants or zeros. Return non-null if successful. */
+
+tree
+fold_complex_div_parts (tree type, tree ar, tree ai, tree br, tree bi,
+ enum tree_code code)
+{
+ tree rr, ri, inner_type, zero;
+ bool ar0, ai0, br0, bi0, bi1;
+
+ inner_type = TREE_TYPE (type);
+ zero = NULL;
+
+ if (SCALAR_FLOAT_TYPE_P (inner_type))
+ {
+ ar0 = ai0 = br0 = bi0 = bi1 = false;
+
+ /* We're only interested in +0.0 here, thus we don't use real_zerop. */
+
+ if (TREE_CODE (ar) == REAL_CST
+ && REAL_VALUES_IDENTICAL (TREE_REAL_CST (ar), dconst0))
+ ar0 = true, zero = ar;
+
+ if (TREE_CODE (ai) == REAL_CST
+ && REAL_VALUES_IDENTICAL (TREE_REAL_CST (ai), dconst0))
+ ai0 = true, zero = ai;
+
+ if (TREE_CODE (br) == REAL_CST
+ && REAL_VALUES_IDENTICAL (TREE_REAL_CST (br), dconst0))
+ br0 = true, zero = br;
+
+ if (TREE_CODE (bi) == REAL_CST)
+ {
+ if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (bi), dconst0))
+ bi0 = true, zero = bi;
+ else if (REAL_VALUES_IDENTICAL (TREE_REAL_CST (bi), dconst1))
+ bi1 = true;
+ }
+ }
+ else
+ {
+ ar0 = integer_zerop (ar);
+ if (ar0)
+ zero = ar;
+ ai0 = integer_zerop (ai);
+ if (ai0)
+ zero = ai;
+ br0 = integer_zerop (br);
+ if (br0)
+ zero = br;
+ bi0 = integer_zerop (bi);
+ if (bi0)
+ {
+ zero = bi;
+ bi1 = false;
+ }
+ else
+ bi1 = integer_onep (bi);
+ }
+
+ /* We won't optimize anything below unless something is zero. */
+ if (zero == NULL)
+ return NULL;
+
+ if (ai0 && bi0)
+ {
+ rr = fold (build2 (code, inner_type, ar, br));
+ ri = zero;
+ }
+ else if (ai0 && br0)
+ {
+ rr = zero;
+ ri = fold (build2 (code, inner_type, ar, bi));
+ ri = fold (build1 (NEGATE_EXPR, inner_type, ri));
+ }
+ else if (ar0 && bi0)
+ {
+ rr = zero;
+ ri = fold (build2 (code, inner_type, ai, br));
+ }
+ else if (ar0 && br0)
+ {
+ rr = fold (build2 (code, inner_type, ai, bi));
+ ri = zero;
+ }
+ else if (bi0)
+ {
+ rr = fold (build2 (code, inner_type, ar, br));
+ ri = fold (build2 (code, inner_type, ai, br));
+ }
+ else if (br0)
+ {
+ rr = fold (build2 (code, inner_type, ai, bi));
+ ri = fold (build2 (code, inner_type, ar, bi));
+ ri = fold (build1 (NEGATE_EXPR, inner_type, ri));
+ }
+ else
+ return NULL;
+
+ return fold (build2 (COMPLEX_EXPR, type, rr, ri));
+}
+
+static tree
+fold_complex_div (tree type, tree ac, tree bc, enum tree_code code)
+{
+ tree ar, ai, br, bi;
+
+ if (TREE_CODE (ac) == COMPLEX_EXPR)
+ ar = TREE_OPERAND (ac, 0), ai = TREE_OPERAND (ac, 1);
+ else if (TREE_CODE (ac) == COMPLEX_CST)
+ ar = TREE_REALPART (ac), ai = TREE_IMAGPART (ac);
+ else
+ return NULL;
+
+ if (TREE_CODE (bc) == COMPLEX_EXPR)
+ br = TREE_OPERAND (bc, 0), bi = TREE_OPERAND (bc, 1);
+ else if (TREE_CODE (bc) == COMPLEX_CST)
+ br = TREE_REALPART (bc), bi = TREE_IMAGPART (bc);
+ else
+ return NULL;
+
+ return fold_complex_div_parts (type, ar, ai, br, bi, code);
+}
+
/* Perform constant folding and related simplification of EXPR.
The related simplifications include x*1 => x, x*0 => 0, etc.,
and application of the associative law.
@@ -6700,9 +7002,14 @@ fold (tree expr)
#endif
}
if (change)
- return fold (build2 (BIT_AND_EXPR, type,
- fold_convert (type, and0),
- fold_convert (type, and1)));
+ {
+ tem = build_int_cst_wide (type, TREE_INT_CST_LOW (and1),
+ TREE_INT_CST_HIGH (and1));
+ tem = force_fit_type (tem, 0, TREE_OVERFLOW (and1),
+ TREE_CONSTANT_OVERFLOW (and1));
+ return fold (build2 (BIT_AND_EXPR, type,
+ fold_convert (type, and0), tem));
+ }
}
/* Convert (T1)((T2)X op Y) into (T1)X op Y, for pointer types T1 and
@@ -6757,6 +7064,10 @@ fold (tree expr)
case NEGATE_EXPR:
if (negate_expr_p (arg0))
return fold_convert (type, negate_expr (arg0));
+ /* Convert - (~A) to A + 1. */
+ if (INTEGRAL_TYPE_P (type) && TREE_CODE (arg0) == BIT_NOT_EXPR)
+ return fold (build2 (PLUS_EXPR, type, TREE_OPERAND (arg0, 0),
+ build_int_cst (type, 1)));
return t;
case ABS_EXPR:
@@ -6776,6 +7087,14 @@ fold (tree expr)
}
else if (tree_expr_nonnegative_p (arg0))
return arg0;
+
+ /* Strip sign ops from argument. */
+ if (TREE_CODE (type) == REAL_TYPE)
+ {
+ tem = fold_strip_sign_ops (arg0);
+ if (tem)
+ return fold (build1 (ABS_EXPR, type, fold_convert (type, tem)));
+ }
return t;
case CONJ_EXPR:
@@ -6803,6 +7122,17 @@ fold (tree expr)
return fold_not_const (arg0, type);
else if (TREE_CODE (arg0) == BIT_NOT_EXPR)
return TREE_OPERAND (arg0, 0);
+ /* Convert ~ (-A) to A - 1. */
+ else if (INTEGRAL_TYPE_P (type) && TREE_CODE (arg0) == NEGATE_EXPR)
+ return fold (build2 (MINUS_EXPR, type, TREE_OPERAND (arg0, 0),
+ build_int_cst (type, 1)));
+ /* Convert ~ (A - 1) or ~ (A + -1) to -A. */
+ else if (INTEGRAL_TYPE_P (type)
+ && ((TREE_CODE (arg0) == MINUS_EXPR
+ && integer_onep (TREE_OPERAND (arg0, 1)))
+ || (TREE_CODE (arg0) == PLUS_EXPR
+ && integer_all_onesp (TREE_OPERAND (arg0, 1)))))
+ return fold (build1 (NEGATE_EXPR, type, TREE_OPERAND (arg0, 0)));
return t;
case PLUS_EXPR:
@@ -6813,6 +7143,14 @@ fold (tree expr)
if (TREE_CODE (arg0) == NEGATE_EXPR
&& reorder_operands_p (TREE_OPERAND (arg0, 0), arg1))
return fold (build2 (MINUS_EXPR, type, arg1, TREE_OPERAND (arg0, 0)));
+
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tem = fold_complex_add (type, arg0, arg1, PLUS_EXPR);
+ if (tem)
+ return tem;
+ }
+
if (! FLOAT_TYPE_P (type))
{
if (integer_zerop (arg1))
@@ -6944,16 +7282,16 @@ fold (tree expr)
if (TREE_CODE (arg0) == ADDR_EXPR
&& TREE_CODE (arg1) == MULT_EXPR)
{
- tem = try_move_mult_to_index (type, PLUS_EXPR, arg0, arg1);
+ tem = try_move_mult_to_index (PLUS_EXPR, arg0, arg1);
if (tem)
- return fold (tem);
+ return fold_convert (type, fold (tem));
}
else if (TREE_CODE (arg1) == ADDR_EXPR
&& TREE_CODE (arg0) == MULT_EXPR)
{
- tem = try_move_mult_to_index (type, PLUS_EXPR, arg1, arg0);
+ tem = try_move_mult_to_index (PLUS_EXPR, arg1, arg0);
if (tem)
- return fold (tem);
+ return fold_convert (type, fold (tem));
}
}
else
@@ -7244,6 +7582,13 @@ fold (tree expr)
return fold (build2 (MINUS_EXPR, type, negate_expr (arg1),
TREE_OPERAND (arg0, 0)));
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tem = fold_complex_add (type, arg0, arg1, MINUS_EXPR);
+ if (tem)
+ return tem;
+ }
+
if (! FLOAT_TYPE_P (type))
{
if (! wins && integer_zerop (arg0))
@@ -7332,9 +7677,9 @@ fold (tree expr)
if (TREE_CODE (arg0) == ADDR_EXPR
&& TREE_CODE (arg1) == MULT_EXPR)
{
- tem = try_move_mult_to_index (type, MINUS_EXPR, arg0, arg1);
+ tem = try_move_mult_to_index (MINUS_EXPR, arg0, arg1);
if (tem)
- return fold (tem);
+ return fold_convert (type, fold (tem));
}
if (TREE_CODE (arg0) == MULT_EXPR
@@ -7372,6 +7717,13 @@ fold (tree expr)
negate_expr (arg0),
TREE_OPERAND (arg1, 0)));
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tem = fold_complex_mult (type, arg0, arg1);
+ if (tem)
+ return tem;
+ }
+
if (! FLOAT_TYPE_P (type))
{
if (integer_zerop (arg1))
@@ -7429,6 +7781,17 @@ fold (tree expr)
TREE_OPERAND (arg0, 1)));
}
+ /* Strip sign operations from X in X*X, i.e. -Y*-Y -> Y*Y. */
+ if (operand_equal_p (arg0, arg1, 0))
+ {
+ tree tem = fold_strip_sign_ops (arg0);
+ if (tem != NULL_TREE)
+ {
+ tem = fold_convert (type, tem);
+ return fold (build2 (MULT_EXPR, type, tem, tem));
+ }
+ }
+
if (flag_unsafe_math_optimizations)
{
enum built_in_function fcode0 = builtin_mathfn_code (arg0);
@@ -7811,6 +8174,13 @@ fold (tree expr)
TREE_OPERAND (arg1, 0)));
}
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tem = fold_complex_div (type, arg0, arg1, code);
+ if (tem)
+ return tem;
+ }
+
if (flag_unsafe_math_optimizations)
{
enum built_in_function fcode = builtin_mathfn_code (arg1);
@@ -7935,6 +8305,12 @@ fold (tree expr)
code, NULL_TREE)))
return fold_convert (type, tem);
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ tem = fold_complex_div (type, arg0, arg1, code);
+ if (tem)
+ return tem;
+ }
goto binary;
case CEIL_MOD_EXPR:
@@ -8758,6 +9134,26 @@ fold (tree expr)
build2 (LE_EXPR, type,
TREE_OPERAND (arg0, 0), arg1)));
+ /* Convert ABS_EXPR<x> >= 0 to true. */
+ else if (code == GE_EXPR
+ && tree_expr_nonnegative_p (arg0)
+ && (integer_zerop (arg1)
+ || (! HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0)))
+ && real_zerop (arg1))))
+ return omit_one_operand (type, integer_one_node, arg0);
+
+ /* Convert ABS_EXPR<x> < 0 to false. */
+ else if (code == LT_EXPR
+ && tree_expr_nonnegative_p (arg0)
+ && (integer_zerop (arg1) || real_zerop (arg1)))
+ return omit_one_operand (type, integer_zero_node, arg0);
+
+ /* Convert ABS_EXPR<x> == 0 or ABS_EXPR<x> != 0 to x == 0 or x != 0. */
+ else if ((code == EQ_EXPR || code == NE_EXPR)
+ && TREE_CODE (arg0) == ABS_EXPR
+ && (integer_zerop (arg1) || real_zerop (arg1)))
+ return fold (build2 (code, type, TREE_OPERAND (arg0, 0), arg1));
+
/* If this is an EQ or NE comparison with zero and ARG0 is
(1 << foo) & bar, convert it to (bar >> foo) & 1. Both require
two operations, but the latter can be done in one less insn
@@ -10979,17 +11375,21 @@ build_fold_addr_expr (tree t)
return build_fold_addr_expr_with_type (t, build_pointer_type (TREE_TYPE (t)));
}
-/* Builds an expression for an indirection through T, simplifying some
- cases. */
+/* Given a pointer value T, return a simplified version of an indirection
+ through T, or NULL_TREE if no simplification is possible. */
-tree
-build_fold_indirect_ref (tree t)
+static tree
+fold_indirect_ref_1 (tree t)
{
tree type = TREE_TYPE (TREE_TYPE (t));
tree sub = t;
tree subtype;
STRIP_NOPS (sub);
+ subtype = TREE_TYPE (sub);
+ if (!POINTER_TYPE_P (subtype))
+ return NULL_TREE;
+
if (TREE_CODE (sub) == ADDR_EXPR)
{
tree op = TREE_OPERAND (sub, 0);
@@ -11000,19 +11400,56 @@ build_fold_indirect_ref (tree t)
/* *(foo *)&fooarray => fooarray[0] */
else if (TREE_CODE (optype) == ARRAY_TYPE
&& lang_hooks.types_compatible_p (type, TREE_TYPE (optype)))
- return build4 (ARRAY_REF, type, op, size_zero_node, NULL_TREE, NULL_TREE);
+ {
+ tree type_domain = TYPE_DOMAIN (optype);
+ tree min_val = size_zero_node;
+ if (type_domain && TYPE_MIN_VALUE (type_domain))
+ min_val = TYPE_MIN_VALUE (type_domain);
+ return build4 (ARRAY_REF, type, op, min_val, NULL_TREE, NULL_TREE);
+ }
}
/* *(foo *)fooarrptr => (*fooarrptr)[0] */
- subtype = TREE_TYPE (sub);
if (TREE_CODE (TREE_TYPE (subtype)) == ARRAY_TYPE
&& lang_hooks.types_compatible_p (type, TREE_TYPE (TREE_TYPE (subtype))))
{
+ tree type_domain;
+ tree min_val = size_zero_node;
sub = build_fold_indirect_ref (sub);
- return build4 (ARRAY_REF, type, sub, size_zero_node, NULL_TREE, NULL_TREE);
+ type_domain = TYPE_DOMAIN (TREE_TYPE (sub));
+ if (type_domain && TYPE_MIN_VALUE (type_domain))
+ min_val = TYPE_MIN_VALUE (type_domain);
+ return build4 (ARRAY_REF, type, sub, min_val, NULL_TREE, NULL_TREE);
}
- return build1 (INDIRECT_REF, type, t);
+ return NULL_TREE;
+}
+
+/* Builds an expression for an indirection through T, simplifying some
+ cases. */
+
+tree
+build_fold_indirect_ref (tree t)
+{
+ tree sub = fold_indirect_ref_1 (t);
+
+ if (sub)
+ return sub;
+ else
+ return build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (t)), t);
+}
+
+/* Given an INDIRECT_REF T, return either T or a simplified version. */
+
+tree
+fold_indirect_ref (tree t)
+{
+ tree sub = fold_indirect_ref_1 (TREE_OPERAND (t, 0));
+
+ if (sub)
+ return sub;
+ else
+ return t;
}
/* Strip non-trapping, non-side-effecting tree nodes from an expression
@@ -11229,3 +11666,38 @@ ptr_difference_const (tree e1, tree e2, HOST_WIDE_INT *diff)
*diff += (bitpos1 - bitpos2) / BITS_PER_UNIT;
return true;
}
+
+/* Simplify the floating point expression EXP when the sign of the
+ result is not significant. Return NULL_TREE if no simplification
+ is possible. */
+
+tree
+fold_strip_sign_ops (tree exp)
+{
+ tree arg0, arg1;
+
+ switch (TREE_CODE (exp))
+ {
+ case ABS_EXPR:
+ case NEGATE_EXPR:
+ arg0 = fold_strip_sign_ops (TREE_OPERAND (exp, 0));
+ return arg0 ? arg0 : TREE_OPERAND (exp, 0);
+
+ case MULT_EXPR:
+ case RDIV_EXPR:
+ if (HONOR_SIGN_DEPENDENT_ROUNDING (TYPE_MODE (TREE_TYPE (exp))))
+ return NULL_TREE;
+ arg0 = fold_strip_sign_ops (TREE_OPERAND (exp, 0));
+ arg1 = fold_strip_sign_ops (TREE_OPERAND (exp, 1));
+ if (arg0 != NULL_TREE || arg1 != NULL_TREE)
+ return fold (build2 (TREE_CODE (exp), TREE_TYPE (exp),
+ arg0 ? arg0 : TREE_OPERAND (exp, 0),
+ arg1 ? arg1 : TREE_OPERAND (exp, 1)));
+ break;
+
+ default:
+ break;
+ }
+ return NULL_TREE;
+}
+
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 707ab1b8631..846186a3174 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,218 @@
+2005-02-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * decl.c, resolve.c, trans-array.c, trans.h: Fix comment typo(s).
+
+2005-02-24 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ Revert yesterday's patch:
+ 2005-02-23 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * gfortran.h (gfc_component, gfc_actual_arglist, ...
+ ... argument. Copy string instead of pointing to it.
+
+2005-02-23 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * gfortran.h (gfc_get_namespace): Add second argument to prototype.
+ * intrinsic.c (gfc_intrinsic_init_1): Pass second argument to
+ gfc_get_namespace.
+ * module.c (mio_namespace_ref, load_needed): Likewise.
+ * parse.c (parse_interface, parse_contained): Likewise. Here the
+ correct second argument matters.
+ * symbol.c (gfc_get_namespace): Add parent_types argument, only copy
+ parent's implicit types if this is set.
+ (gfc_symbol_init_2): Pass second argument to gfc_get_namespace.
+ * trans-common.c (build_common_decl): Likewise.
+
+ * gfortran.h (symbol_attribute): New 'untyped' field, fix comment
+ formatting.
+ * symbol.c (gfc_set_default_type): Issue error only once, by setting
+ and checking 'untyped' attribute.
+
+ * gfortran.h (gfc_expr): Move 'operator', 'op1', 'op2', and 'uop'
+ fields into new struct 'op' inside the 'value' union.
+ * arith.c (eval_intrinsic): Adapt all users.
+ * dependency.c (gfc_check_dependency): Likewise.
+ * dump-parse-tree.c (gfc_show_expr): Likewise.
+ * expr.c (gfc_get_expr): Don't clear removed fields.
+ (free_expr0, gfc_copy_expr, gfc_type_convert_binary,
+ gfc_is_constant_expr, simplify_intrinsic_op, check_init_expr,
+ check_intrinsic_op): Adapt to new field names.
+ * interface.c (gfc_extend_expr): Likewise. Also explicitly
+ nullify 'esym' and 'isym' fields of new function call.
+ * iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul):
+ Adapt to renamed structure fields.
+ * matchexp.c (build_node, match_level_1, match_expr): Likewise.
+ * module.c (mio_expr): Likewise.
+ * resolve.c (resolve_operator): Likewise.
+ (gfc_find_forall_index): Likewise. Only look through operands
+ if dealing with EXPR_OP
+ * trans-array.c (gfc_walk_op_expr): Adapt to renamed fields.
+ * trans-expr.c (gfc_conv_unary_op, gfc_conv_power_op,
+ gfc_conv_concat_op, gfc_conv_expr_op): Likewise.
+
+ [ Reverted ]
+ * gfortran.h (gfc_component, gfc_actual_arglist, gfc_user_op): Make
+ 'name' a 'const char *'.
+ (gfc_symbol): Likewise, also for 'module'.
+ (gfc_symtree): Make 'name' a 'const char *'.
+ (gfc_intrinsic_sym): Likewise, also for 'lib_name'.
+ (gfc_get_gsymbol, gfc_find_gsymbol): Add 'const' qualifier to
+ 'char *' argument.
+ (gfc_intrinsic_symbol): Use 'gfc_get_string' instead of 'strcpy' to
+ initialize 'SYM->module'.
+ * check.c (gfc_check_minloc_maxloc, check_reduction): Check for NULL
+ pointer instead of empty string.
+ * dump-parse-tree.c (gfc_show_actual_arglist): Likewise.
+ * interface.c (gfc_compare_types): Adapt check to account for possible
+ NULL pointer.
+ (compare_actual_formal): Check for NULL pointer instead of empty
+ string.
+ * intrinsic.c (gfc_current_intrinsic, gfc_current_intrinsic_arg):
+ Add 'const' qualifier.
+ (conv_name): Return a heap allocated string.
+ (find_conv): Add 'const' qualifier to 'target'.
+ (add_sym): Use 'gfc_get_string' instead of 'strcpy'.
+ (make_generic): Check for NULL pointer instead of empty string.
+ (make_alias): Use 'gfc_get_string' instead of 'strcpy'.
+ (add_conv): No need to strcpy result from 'conv_name'.
+ (sort_actual): Check for NULL pointer instead of empty string.
+ * intrinsic.h (gfc_current_intrinsic, gfc_current_intrinsic_arg):
+ Adapt prototype.
+ * module.c (compare_true_names): Compare pointers instead of strings
+ for 'module' member.
+ (find_true_name): Initialize string fields with gfc_get_string.
+ (mio_pool_string): New function.
+ (mio_internal_string): Adapt comment.
+ (mio_component_ref, mio_component, mio_actual_arg): Use
+ 'mio_pool_string' instead of 'mio_internal_string'.
+ (mio_symbol_interface): Add 'const' qualifier to string arguments.
+ Add level of indirection. Use 'mio_pool_string' instead of
+ 'mio_internal_string'.
+ (load_needed, read_module): Use 'gfc_get_string' instead of 'strcpy'.
+ (write_common, write_symbol): Use 'mio_pool_string' instead of
+ 'mio_internal_string'.
+ (write_symbol0, write_symbol1): Likewise, also check for NULL pointer
+ instead of empty string.
+ (write_operator, write_generic): Pass correct type variable to
+ 'mio_symbol_interface'.
+ (write_symtree): Use 'mio_pool_string' instead of
+ 'mio_internal_string'.
+ * primary.c (match_keyword_arg): Adapt check to possible
+ case of NULL pointer. Use 'gfc_get_string' instead of 'strcpy'.
+ * symbol.c (gfc_add_component, gfc_new_symtree, delete_symtree,
+ gfc_get_uop, gfc_new_symbol): Use 'gfc_get_string' instead of
+ 'strcpy'.
+ (ambiguous_symbol): Check for NULL pointer instead of empty string.
+ (gfc_find_gsymbol, gfc_get_gsymbol): Add 'const' qualifier on string
+ arguments.
+ * trans-array.c (gfc_trans_auto_array_allocation): Check for NULL
+ pointer instead of empty string.
+ * trans-decl.c (gfc_sym_mangled_identifier,
+ gfc_sym_mangled_function_id, gfc_finish_var_decl, gfc_get_symbol_decl,
+ gfc_get_symbol_decl): Likewise.
+ * trans-io.c (gfc_new_nml_name_expr): Add 'const' qualifier to
+ argument. Copy string instead of pointing to it.
+
+2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * intrinsic.h, st.c: Update copyright.
+
+2005-02-20 Steven G. Kargl <kargls@comcast.net>
+
+ * symbol.c: Typos in comments.
+
+2005-02-20 Steven G. Kargl <kargls@comcast.net>
+
+ * expr.c (gfc_type_convert_binary): Typo in comment.
+
+2005-02-19 Steven G. Kargl <kargls@comcast.net>
+
+ * check.c (gfc_check_selected_int_kind): New function.
+ * intrinsic.h: Prototype it.
+ * intrinsic.c (add_function): Use it.
+ * simplify (gfc_simplify_ceiling,gfc_simplify_floor): Change
+ BT_REAL to BT_INTEGER and use gfc_default_integer_kind.
+
+2005-02-19 Steven G. Kargl <kargls@comcast.net>
+
+ * check.c (gfc_check_int): improve checking of optional kind
+ * simplify.c (gfc_simplify_int): Change BT_REAL to BT_INTEGER
+
+2005-02-19 Steven G. Kargl <kargls@comcast.net>
+
+ * check.c (gfc_check_achar): New function
+ * intrinsic.h: Prototype it.
+ * intrinsic.c (add_function): Use it.
+
+2005-02-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * trans-stmt.c (generate_loop_for_temp_to_lhs,
+ generate_loop_for_rhs_to_temp): Remove if whose condition is
+ always true.
+
+2005-02-12 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * symbol.c (gfc_use_ha_derived): Remove, fold functionality into ...
+ (gfc_use_derived): ... this function.
+
+2005-02-09 Richard Henderson <rth@redhat.com>
+
+ * f95-lang.c (gfc_init_builtin_functions): Call
+ build_common_builtin_nodes; do not define any functions handled
+ by it.
+
+2005-02-08 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * expr.c (gfc_copy_expr): Don't copy 'op1' and 'op2' for
+ EXPR_SUBSTRING.
+ (gfc_is_constant_expr): Check 'ref' to determine if substring
+ reference is constant.
+ (gfc_simplify_expr): Simplify 'ref' instead of 'op1' and 'op2'.
+ (check_init_expr, check_restricted): Check 'ref' instead of 'op1'
+ and 'op2'.
+ * module.c (mio_expr): Read / write 'ref' instead of 'op1' and 'op2'.
+
+2005-02-07 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * gfortran.h (gfc_add_dimension, gfc_add_result, gfc_add_save,
+ gfc_add_dummy, gfc_add_generic, gfc_add_in_common, gfc_add_data,
+ gfc_add_in_namelist, gfc_add_sequence, gfc_add_function,
+ gfc_add_subroutine, gfc_add_access, gfc_add_flavor, gfc_add_entry,
+ gfc_add_procedure): Add argument.
+ * array.c (gfc_set_array_spec), decl.c (var_element, get_proc_name,
+ gfc_match_null, match_type_spec, match_attr_spec,
+ gfc_match_formal_arglist, match_result, gfc_match_function_decl):
+ Update callers to match.
+ (gfc_match_entry) : Likewise, fix comment typo.
+ (gfc_match_subroutine, attr_decl1, gfc_add_dimension,
+ access_attr_decl, do_parm, gfc_match_save, gfc_match_modproc,
+ gfc_match_derived_decl): Update callers.
+ * interface.c (gfc_match_interface): Likewise.
+ * match.c (gfc_match_label, gfc_add_flavor,
+ gfc_match_call, gfc_match_common, gfc_match_block_data,
+ gfc_match_namelist, gfc_match_module, gfc_match_st_function):
+ Likewise.
+ * parse.c (parse_derived, parse_interface, parse_contained),
+ primary.c (gfc_match_rvalue, gfc_match_variable): Likewise.
+ * resolve.c (resolve_formal_arglist, resolve_entries): Update callers.
+ * symbol.c (check_conflict, check_used): Add new 'name' argument,
+ use when printing error message.
+ (gfc_add_dimension, gfc_add_result, gfc_add_save, gfc_add_dummy,
+ gfc_add_generic, gfc_add_in_common, gfc_add_data,
+ gfc_add_in_namelist, gfc_add_sequence, gfc_add_function,
+ gfc_add_subroutine, gfc_add_access, gfc_add_flavor, gfc_add_entry,
+ gfc_add_procedure): Add new 'name' argument. Pass along to
+ check_conflict and check_used.
+ (gfc_add_allocatable, gfc_add_external, gfc_add_intrinsic,
+ gfc_add_optional, gfc_add_pointer, gfc_add_target, gfc_add_elemental,
+ gfc_add_pure, gfc_add_recursive, gfc_add_intent,
+ gfc_add_explicit_interface, gfc_copy_attr): Pass NULL for new
+ argument in calls to any of the modified functions.
+
+2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
+
+ * gfortran.texi: Don't give last update date.
+
2006-01-30 Richard Henderson <rth@redhat.com>
* options.c (gfc_init_options): Zero flag_errno_math.
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 924eea0fb2f..a219ed20675 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1598,10 +1598,10 @@ eval_intrinsic (gfc_intrinsic_op operator,
temp.expr_type = EXPR_OP;
gfc_clear_ts (&temp.ts);
- temp.operator = operator;
+ temp.value.op.operator = operator;
- temp.op1 = op1;
- temp.op2 = op2;
+ temp.value.op.op1 = op1;
+ temp.value.op.op2 = op2;
gfc_type_convert_binary (&temp);
@@ -1671,10 +1671,10 @@ runtime:
result->ts = temp.ts;
result->expr_type = EXPR_OP;
- result->operator = operator;
+ result->value.op.operator = operator;
- result->op1 = op1;
- result->op2 = op2;
+ result->value.op.op1 = op1;
+ result->value.op.op2 = op2;
result->where = op1->where;
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index c09bf8bcce5..4f4f19b100b 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -457,7 +457,7 @@ gfc_set_array_spec (gfc_symbol * sym, gfc_array_spec * as, locus * error_loc)
if (as == NULL)
return SUCCESS;
- if (gfc_add_dimension (&sym->attr, error_loc) == FAILURE)
+ if (gfc_add_dimension (&sym->attr, sym->name, error_loc) == FAILURE)
return FAILURE;
sym->as = as;
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index a63112bd81e..7a971f20038 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -401,6 +401,16 @@ gfc_check_abs (gfc_expr * a)
return SUCCESS;
}
+try
+gfc_check_achar (gfc_expr * a)
+{
+
+ if (type_check (a, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
try
gfc_check_all_any (gfc_expr * mask, gfc_expr * dim)
@@ -936,10 +946,18 @@ gfc_check_index (gfc_expr * string, gfc_expr * substring, gfc_expr * back)
try
gfc_check_int (gfc_expr * x, gfc_expr * kind)
{
- if (numeric_check (x, 0) == FAILURE
- || kind_check (kind, 1, BT_INTEGER) == FAILURE)
+ if (numeric_check (x, 0) == FAILURE)
+ return FAILURE;
+
+ if (kind != NULL)
+ {
+ if (type_check (kind, 1, BT_INTEGER) == FAILURE)
return FAILURE;
+ if (scalar_check (kind, 1) == FAILURE)
+ return FAILURE;
+ }
+
return SUCCESS;
}
@@ -1196,7 +1214,7 @@ gfc_check_minloc_maxloc (gfc_actual_arglist * ap)
m = ap->next->next->expr;
if (m == NULL && d != NULL && d->ts.type == BT_LOGICAL
- && ap->next->name[0] == '\0')
+ && ap->next->name == NULL)
{
m = d;
d = NULL;
@@ -1241,7 +1259,7 @@ check_reduction (gfc_actual_arglist * ap)
m = ap->next->next->expr;
if (m == NULL && d != NULL && d->ts.type == BT_LOGICAL
- && ap->next->name[0] == '\0')
+ && ap->next->name == NULL)
{
m = d;
d = NULL;
@@ -1536,6 +1554,20 @@ gfc_check_scan (gfc_expr * x, gfc_expr * y, gfc_expr * z)
try
+gfc_check_selected_int_kind (gfc_expr * r)
+{
+
+ if (type_check (r, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (r, 0) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_selected_real_kind (gfc_expr * p, gfc_expr * r)
{
if (p == NULL && r == NULL)
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 92326e7066a..b3114cac2c1 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -27,7 +27,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "parse.h"
-/* This flag is set if a an old-style length selector is matched
+/* This flag is set if an old-style length selector is matched
during a type-declaration statement. */
static int old_char_selector;
@@ -198,7 +198,7 @@ var_element (gfc_data_variable * new)
}
#endif
- if (gfc_add_data (&sym->attr, &new->expr->where) == FAILURE)
+ if (gfc_add_data (&sym->attr, sym->name, &new->expr->where) == FAILURE)
return MATCH_ERROR;
return MATCH_YES;
@@ -598,7 +598,8 @@ get_proc_name (const char *name, gfc_symbol ** result)
if (sym->ns->proc_name != NULL
&& sym->ns->proc_name->attr.flavor == FL_MODULE
&& sym->attr.proc != PROC_MODULE
- && gfc_add_procedure (&sym->attr, PROC_MODULE, NULL) == FAILURE)
+ && gfc_add_procedure (&sym->attr, PROC_MODULE,
+ sym->name, NULL) == FAILURE)
rc = 2;
return rc;
@@ -818,8 +819,9 @@ gfc_match_null (gfc_expr ** result)
gfc_intrinsic_symbol (sym);
if (sym->attr.proc != PROC_INTRINSIC
- && (gfc_add_procedure (&sym->attr, PROC_INTRINSIC, NULL) == FAILURE
- || gfc_add_function (&sym->attr, NULL) == FAILURE))
+ && (gfc_add_procedure (&sym->attr, PROC_INTRINSIC,
+ sym->name, NULL) == FAILURE
+ || gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE))
return MATCH_ERROR;
e = gfc_get_expr ();
@@ -1369,7 +1371,7 @@ match_type_spec (gfc_typespec * ts, int implicit_flag)
}
if (sym->attr.flavor != FL_DERIVED
- && gfc_add_flavor (&sym->attr, FL_DERIVED, NULL) == FAILURE)
+ && gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
ts->type = BT_DERIVED;
@@ -1801,7 +1803,7 @@ match_attr_spec (void)
break;
case DECL_DIMENSION:
- t = gfc_add_dimension (&current_attr, &seen_at[d]);
+ t = gfc_add_dimension (&current_attr, NULL, &seen_at[d]);
break;
case DECL_EXTERNAL:
@@ -1829,7 +1831,7 @@ match_attr_spec (void)
break;
case DECL_PARAMETER:
- t = gfc_add_flavor (&current_attr, FL_PARAMETER, &seen_at[d]);
+ t = gfc_add_flavor (&current_attr, FL_PARAMETER, NULL, &seen_at[d]);
break;
case DECL_POINTER:
@@ -1837,15 +1839,17 @@ match_attr_spec (void)
break;
case DECL_PRIVATE:
- t = gfc_add_access (&current_attr, ACCESS_PRIVATE, &seen_at[d]);
+ t = gfc_add_access (&current_attr, ACCESS_PRIVATE, NULL,
+ &seen_at[d]);
break;
case DECL_PUBLIC:
- t = gfc_add_access (&current_attr, ACCESS_PUBLIC, &seen_at[d]);
+ t = gfc_add_access (&current_attr, ACCESS_PUBLIC, NULL,
+ &seen_at[d]);
break;
case DECL_SAVE:
- t = gfc_add_save (&current_attr, &seen_at[d]);
+ t = gfc_add_save (&current_attr, NULL, &seen_at[d]);
break;
case DECL_TARGET:
@@ -2080,7 +2084,7 @@ gfc_match_formal_arglist (gfc_symbol * progname, int st_flag, int null_flag)
dummy procedure. We don't apply these attributes to formal
arguments of statement functions. */
if (sym != NULL && !st_flag
- && (gfc_add_dummy (&sym->attr, NULL) == FAILURE
+ && (gfc_add_dummy (&sym->attr, sym->name, NULL) == FAILURE
|| gfc_missing_attr (&sym->attr, NULL) == FAILURE))
{
m = MATCH_ERROR;
@@ -2180,8 +2184,8 @@ match_result (gfc_symbol * function, gfc_symbol ** result)
if (gfc_get_symbol (name, NULL, &r))
return MATCH_ERROR;
- if (gfc_add_flavor (&r->attr, FL_VARIABLE, NULL) == FAILURE
- || gfc_add_result (&r->attr, NULL) == FAILURE)
+ if (gfc_add_flavor (&r->attr, FL_VARIABLE, r->name, NULL) == FAILURE
+ || gfc_add_result (&r->attr, r->name, NULL) == FAILURE)
return MATCH_ERROR;
*result = r;
@@ -2251,7 +2255,7 @@ gfc_match_function_decl (void)
/* Make changes to the symbol. */
m = MATCH_ERROR;
- if (gfc_add_function (&sym->attr, NULL) == FAILURE)
+ if (gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)
goto cleanup;
if (gfc_missing_attr (&sym->attr, NULL) == FAILURE
@@ -2326,13 +2330,13 @@ gfc_match_entry (void)
if (state == COMP_SUBROUTINE)
{
- /* And entry in a subroutine. */
+ /* An entry in a subroutine. */
m = gfc_match_formal_arglist (entry, 0, 1);
if (m != MATCH_YES)
return MATCH_ERROR;
- if (gfc_add_entry (&entry->attr, NULL) == FAILURE
- || gfc_add_subroutine (&entry->attr, NULL) == FAILURE)
+ if (gfc_add_entry (&entry->attr, entry->name, NULL) == FAILURE
+ || gfc_add_subroutine (&entry->attr, entry->name, NULL) == FAILURE)
return MATCH_ERROR;
}
else
@@ -2346,8 +2350,8 @@ gfc_match_entry (void)
if (gfc_match_eos () == MATCH_YES)
{
- if (gfc_add_entry (&entry->attr, NULL) == FAILURE
- || gfc_add_function (&entry->attr, NULL) == FAILURE)
+ if (gfc_add_entry (&entry->attr, entry->name, NULL) == FAILURE
+ || gfc_add_function (&entry->attr, entry->name, NULL) == FAILURE)
return MATCH_ERROR;
entry->result = proc->result;
@@ -2361,9 +2365,10 @@ gfc_match_entry (void)
if (m != MATCH_YES)
return MATCH_ERROR;
- if (gfc_add_result (&result->attr, NULL) == FAILURE
- || gfc_add_entry (&entry->attr, NULL) == FAILURE
- || gfc_add_function (&entry->attr, NULL) == FAILURE)
+ if (gfc_add_result (&result->attr, result->name, NULL) == FAILURE
+ || gfc_add_entry (&entry->attr, result->name, NULL) == FAILURE
+ || gfc_add_function (&entry->attr, result->name,
+ NULL) == FAILURE)
return MATCH_ERROR;
}
@@ -2426,7 +2431,7 @@ gfc_match_subroutine (void)
return MATCH_ERROR;
gfc_new_block = sym;
- if (gfc_add_subroutine (&sym->attr, NULL) == FAILURE)
+ if (gfc_add_subroutine (&sym->attr, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
if (gfc_match_formal_arglist (sym, 0, 1) != MATCH_YES)
@@ -2713,7 +2718,7 @@ attr_decl1 (void)
if ((current_attr.external || current_attr.intrinsic)
&& sym->attr.flavor != FL_PROCEDURE
- && gfc_add_flavor (&sym->attr, FL_PROCEDURE, NULL) == FAILURE)
+ && gfc_add_flavor (&sym->attr, FL_PROCEDURE, sym->name, NULL) == FAILURE)
{
m = MATCH_ERROR;
goto cleanup;
@@ -2840,7 +2845,7 @@ gfc_match_dimension (void)
{
gfc_clear_attr (&current_attr);
- gfc_add_dimension (&current_attr, NULL);
+ gfc_add_dimension (&current_attr, NULL, NULL);
return attr_decl ();
}
@@ -2893,7 +2898,7 @@ access_attr_decl (gfc_statement st)
if (gfc_add_access (&sym->attr,
(st ==
ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE,
- NULL) == FAILURE)
+ sym->name, NULL) == FAILURE)
return MATCH_ERROR;
break;
@@ -3036,7 +3041,7 @@ do_parm (void)
}
if (gfc_check_assign_symbol (sym, init) == FAILURE
- || gfc_add_flavor (&sym->attr, FL_PARAMETER, NULL) == FAILURE)
+ || gfc_add_flavor (&sym->attr, FL_PARAMETER, sym->name, NULL) == FAILURE)
{
m = MATCH_ERROR;
goto cleanup;
@@ -3120,7 +3125,8 @@ gfc_match_save (void)
switch (m)
{
case MATCH_YES:
- if (gfc_add_save (&sym->attr, &gfc_current_locus) == FAILURE)
+ if (gfc_add_save (&sym->attr, sym->name,
+ &gfc_current_locus) == FAILURE)
return MATCH_ERROR;
goto next_item;
@@ -3189,7 +3195,8 @@ gfc_match_modproc (void)
return MATCH_ERROR;
if (sym->attr.proc != PROC_MODULE
- && gfc_add_procedure (&sym->attr, PROC_MODULE, NULL) == FAILURE)
+ && gfc_add_procedure (&sym->attr, PROC_MODULE,
+ sym->name, NULL) == FAILURE)
return MATCH_ERROR;
if (gfc_add_interface (sym) == FAILURE)
@@ -3236,7 +3243,7 @@ loop:
return MATCH_ERROR;
}
- if (gfc_add_access (&attr, ACCESS_PRIVATE, NULL) == FAILURE)
+ if (gfc_add_access (&attr, ACCESS_PRIVATE, NULL, NULL) == FAILURE)
return MATCH_ERROR;
goto loop;
}
@@ -3249,7 +3256,7 @@ loop:
return MATCH_ERROR;
}
- if (gfc_add_access (&attr, ACCESS_PUBLIC, NULL) == FAILURE)
+ if (gfc_add_access (&attr, ACCESS_PUBLIC, NULL, NULL) == FAILURE)
return MATCH_ERROR;
goto loop;
}
@@ -3294,7 +3301,7 @@ loop:
derived type that is a pointer. The first part of the AND clause
is true if a the symbol is not the return value of a function. */
if (sym->attr.flavor != FL_DERIVED
- && gfc_add_flavor (&sym->attr, FL_DERIVED, NULL) == FAILURE)
+ && gfc_add_flavor (&sym->attr, FL_DERIVED, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
if (sym->components != NULL)
@@ -3306,7 +3313,7 @@ loop:
}
if (attr.access != ACCESS_UNKNOWN
- && gfc_add_access (&sym->attr, attr.access, NULL) == FAILURE)
+ && gfc_add_access (&sym->attr, attr.access, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
gfc_new_block = sym;
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index fb0c5764d45..cb5cb50fd92 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -277,11 +277,11 @@ gfc_check_dependency (gfc_expr * expr1, gfc_expr * expr2, gfc_expr ** vars,
switch (expr2->expr_type)
{
case EXPR_OP:
- n = gfc_check_dependency (expr1, expr2->op1, vars, nvars);
+ n = gfc_check_dependency (expr1, expr2->value.op.op1, vars, nvars);
if (n)
return n;
- if (expr2->op2)
- return gfc_check_dependency (expr1, expr2->op2, vars, nvars);
+ if (expr2->value.op.op2)
+ return gfc_check_dependency (expr1, expr2->value.op.op2, vars, nvars);
return 0;
case EXPR_VARIABLE:
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 7af7a625f65..f8df9dabb12 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -106,7 +106,7 @@ gfc_show_actual_arglist (gfc_actual_arglist * a)
for (; a; a = a->next)
{
gfc_status_char ('(');
- if (a->name[0] != '\0')
+ if (a->name != NULL)
gfc_status ("%s = ", a->name);
if (a->expr != NULL)
gfc_show_expr (a->expr);
@@ -415,7 +415,7 @@ gfc_show_expr (gfc_expr * p)
case EXPR_OP:
gfc_status ("(");
- switch (p->operator)
+ switch (p->value.op.operator)
{
case INTRINSIC_UPLUS:
gfc_status ("U+ ");
@@ -480,12 +480,12 @@ gfc_show_expr (gfc_expr * p)
("gfc_show_expr(): Bad intrinsic in expression!");
}
- gfc_show_expr (p->op1);
+ gfc_show_expr (p->value.op.op1);
- if (p->op2)
+ if (p->value.op.op2)
{
gfc_status (" ");
- gfc_show_expr (p->op2);
+ gfc_show_expr (p->value.op.op2);
}
gfc_status (")");
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 87ce3e5fcbc..5867f9bfaa5 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -36,12 +36,9 @@ gfc_get_expr (void)
e = gfc_getmem (sizeof (gfc_expr));
gfc_clear_ts (&e->ts);
- e->op1 = NULL;
- e->op2 = NULL;
e->shape = NULL;
e->ref = NULL;
e->symtree = NULL;
- e->uop = NULL;
return e;
}
@@ -170,10 +167,10 @@ free_expr0 (gfc_expr * e)
break;
case EXPR_OP:
- if (e->op1 != NULL)
- gfc_free_expr (e->op1);
- if (e->op2 != NULL)
- gfc_free_expr (e->op2);
+ if (e->value.op.op1 != NULL)
+ gfc_free_expr (e->value.op.op1);
+ if (e->value.op.op2 != NULL)
+ gfc_free_expr (e->value.op.op2);
break;
case EXPR_FUNCTION:
@@ -393,9 +390,6 @@ gfc_copy_expr (gfc_expr * p)
q->value.character.string = s;
memcpy (s, p->value.character.string, p->value.character.length + 1);
-
- q->op1 = gfc_copy_expr (p->op1);
- q->op2 = gfc_copy_expr (p->op2);
break;
case EXPR_CONSTANT:
@@ -440,17 +434,17 @@ gfc_copy_expr (gfc_expr * p)
break;
case EXPR_OP:
- switch (q->operator)
+ switch (q->value.op.operator)
{
case INTRINSIC_NOT:
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
- q->op1 = gfc_copy_expr (p->op1);
+ q->value.op.op1 = gfc_copy_expr (p->value.op.op1);
break;
default: /* Binary operators */
- q->op1 = gfc_copy_expr (p->op1);
- q->op2 = gfc_copy_expr (p->op2);
+ q->value.op.op1 = gfc_copy_expr (p->value.op.op1);
+ q->value.op.op2 = gfc_copy_expr (p->value.op.op2);
break;
}
@@ -587,8 +581,8 @@ gfc_type_convert_binary (gfc_expr * e)
{
gfc_expr *op1, *op2;
- op1 = e->op1;
- op2 = e->op2;
+ op1 = e->value.op.op1;
+ op2 = e->value.op.op2;
if (op1->ts.type == BT_UNKNOWN || op2->ts.type == BT_UNKNOWN)
{
@@ -621,18 +615,18 @@ gfc_type_convert_binary (gfc_expr * e)
{
e->ts = op1->ts;
- /* Special cose for ** operator. */
- if (e->operator == INTRINSIC_POWER)
+ /* Special case for ** operator. */
+ if (e->value.op.operator == INTRINSIC_POWER)
goto done;
- gfc_convert_type (e->op2, &e->ts, 2);
+ gfc_convert_type (e->value.op.op2, &e->ts, 2);
goto done;
}
if (op1->ts.type == BT_INTEGER)
{
e->ts = op2->ts;
- gfc_convert_type (e->op1, &e->ts, 2);
+ gfc_convert_type (e->value.op.op1, &e->ts, 2);
goto done;
}
@@ -643,9 +637,9 @@ gfc_type_convert_binary (gfc_expr * e)
else
e->ts.kind = op2->ts.kind;
if (op1->ts.type != BT_COMPLEX || op1->ts.kind != e->ts.kind)
- gfc_convert_type (e->op1, &e->ts, 2);
+ gfc_convert_type (e->value.op.op1, &e->ts, 2);
if (op2->ts.type != BT_COMPLEX || op2->ts.kind != e->ts.kind)
- gfc_convert_type (e->op2, &e->ts, 2);
+ gfc_convert_type (e->value.op.op2, &e->ts, 2);
done:
return;
@@ -668,9 +662,9 @@ gfc_is_constant_expr (gfc_expr * e)
switch (e->expr_type)
{
case EXPR_OP:
- rv = (gfc_is_constant_expr (e->op1)
- && (e->op2 == NULL
- || gfc_is_constant_expr (e->op2)));
+ rv = (gfc_is_constant_expr (e->value.op.op1)
+ && (e->value.op.op2 == NULL
+ || gfc_is_constant_expr (e->value.op.op2)));
break;
@@ -699,7 +693,8 @@ gfc_is_constant_expr (gfc_expr * e)
break;
case EXPR_SUBSTRING:
- rv = gfc_is_constant_expr (e->op1) && gfc_is_constant_expr (e->op2);
+ rv = (gfc_is_constant_expr (e->ref->u.ss.start)
+ && gfc_is_constant_expr (e->ref->u.ss.end));
break;
case EXPR_STRUCTURE:
@@ -731,11 +726,11 @@ simplify_intrinsic_op (gfc_expr * p, int type)
{
gfc_expr *op1, *op2, *result;
- if (p->operator == INTRINSIC_USER)
+ if (p->value.op.operator == INTRINSIC_USER)
return SUCCESS;
- op1 = p->op1;
- op2 = p->op2;
+ op1 = p->value.op.op1;
+ op2 = p->value.op.op2;
if (gfc_simplify_expr (op1, type) == FAILURE)
return FAILURE;
@@ -747,10 +742,10 @@ simplify_intrinsic_op (gfc_expr * p, int type)
return SUCCESS;
/* Rip p apart */
- p->op1 = NULL;
- p->op2 = NULL;
+ p->value.op.op1 = NULL;
+ p->value.op.op2 = NULL;
- switch (p->operator)
+ switch (p->value.op.operator)
{
case INTRINSIC_UPLUS:
result = gfc_uplus (op1);
@@ -1115,12 +1110,10 @@ gfc_simplify_expr (gfc_expr * p, int type)
break;
case EXPR_SUBSTRING:
- if (gfc_simplify_expr (p->op1, type) == FAILURE
- || gfc_simplify_expr (p->op2, type) == FAILURE)
+ if (simplify_ref_chain (p->ref, type) == FAILURE)
return FAILURE;
/* TODO: evaluate constant substrings. */
-
break;
case EXPR_OP:
@@ -1195,15 +1188,17 @@ static try check_init_expr (gfc_expr *);
static try
check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
{
+ gfc_expr *op1 = e->value.op.op1;
+ gfc_expr *op2 = e->value.op.op2;
- if ((*check_function) (e->op1) == FAILURE)
+ if ((*check_function) (op1) == FAILURE)
return FAILURE;
- switch (e->operator)
+ switch (e->value.op.operator)
{
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
- if (!numeric_type (et0 (e->op1)))
+ if (!numeric_type (et0 (op1)))
goto not_numeric;
break;
@@ -1213,11 +1208,11 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
case INTRINSIC_GE:
case INTRINSIC_LT:
case INTRINSIC_LE:
- if ((*check_function) (e->op2) == FAILURE)
+ if ((*check_function) (op2) == FAILURE)
return FAILURE;
- if (!(et0 (e->op1) == BT_CHARACTER && et0 (e->op2) == BT_CHARACTER)
- && !(numeric_type (et0 (e->op1)) && numeric_type (et0 (e->op2))))
+ if (!(et0 (op1) == BT_CHARACTER && et0 (op2) == BT_CHARACTER)
+ && !(numeric_type (et0 (op1)) && numeric_type (et0 (op2))))
{
gfc_error ("Numeric or CHARACTER operands are required in "
"expression at %L", &e->where);
@@ -1230,34 +1225,34 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
case INTRINSIC_TIMES:
case INTRINSIC_DIVIDE:
case INTRINSIC_POWER:
- if ((*check_function) (e->op2) == FAILURE)
+ if ((*check_function) (op2) == FAILURE)
return FAILURE;
- if (!numeric_type (et0 (e->op1)) || !numeric_type (et0 (e->op2)))
+ if (!numeric_type (et0 (op1)) || !numeric_type (et0 (op2)))
goto not_numeric;
- if (e->operator == INTRINSIC_POWER
- && check_function == check_init_expr && et0 (e->op2) != BT_INTEGER)
+ if (e->value.op.operator == INTRINSIC_POWER
+ && check_function == check_init_expr && et0 (op2) != BT_INTEGER)
{
gfc_error ("Exponent at %L must be INTEGER for an initialization "
- "expression", &e->op2->where);
+ "expression", &op2->where);
return FAILURE;
}
break;
case INTRINSIC_CONCAT:
- if ((*check_function) (e->op2) == FAILURE)
+ if ((*check_function) (op2) == FAILURE)
return FAILURE;
- if (et0 (e->op1) != BT_CHARACTER || et0 (e->op2) != BT_CHARACTER)
+ if (et0 (op1) != BT_CHARACTER || et0 (op2) != BT_CHARACTER)
{
gfc_error ("Concatenation operator in expression at %L "
- "must have two CHARACTER operands", &e->op1->where);
+ "must have two CHARACTER operands", &op1->where);
return FAILURE;
}
- if (e->op1->ts.kind != e->op2->ts.kind)
+ if (op1->ts.kind != op2->ts.kind)
{
gfc_error ("Concat operator at %L must concatenate strings of the "
"same kind", &e->where);
@@ -1267,10 +1262,10 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
break;
case INTRINSIC_NOT:
- if (et0 (e->op1) != BT_LOGICAL)
+ if (et0 (op1) != BT_LOGICAL)
{
gfc_error (".NOT. operator in expression at %L must have a LOGICAL "
- "operand", &e->op1->where);
+ "operand", &op1->where);
return FAILURE;
}
@@ -1280,10 +1275,10 @@ check_intrinsic_op (gfc_expr * e, try (*check_function) (gfc_expr *))
case INTRINSIC_OR:
case INTRINSIC_EQV:
case INTRINSIC_NEQV:
- if ((*check_function) (e->op2) == FAILURE)
+ if ((*check_function) (op2) == FAILURE)
return FAILURE;
- if (et0 (e->op1) != BT_LOGICAL || et0 (e->op2) != BT_LOGICAL)
+ if (et0 (op1) != BT_LOGICAL || et0 (op2) != BT_LOGICAL)
{
gfc_error ("LOGICAL operands are required in expression at %L",
&e->where);
@@ -1439,11 +1434,11 @@ check_init_expr (gfc_expr * e)
break;
case EXPR_SUBSTRING:
- t = check_init_expr (e->op1);
+ t = check_init_expr (e->ref->u.ss.start);
if (t == FAILURE)
break;
- t = check_init_expr (e->op2);
+ t = check_init_expr (e->ref->u.ss.end);
if (t == SUCCESS)
t = gfc_simplify_expr (e, 0);
@@ -1662,11 +1657,11 @@ check_restricted (gfc_expr * e)
break;
case EXPR_SUBSTRING:
- t = gfc_specification_expr (e->op1);
+ t = gfc_specification_expr (e->ref->u.ss.start);
if (t == FAILURE)
break;
- t = gfc_specification_expr (e->op2);
+ t = gfc_specification_expr (e->ref->u.ss.end);
if (t == SUCCESS)
t = gfc_simplify_expr (e, 0);
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index b406bf041a0..7f04b7ca261 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -794,8 +794,7 @@ gfc_init_builtin_functions (void)
BUILT_IN_CABS, "cabs", true);
gfc_define_builtin ("__builtin_cabsf", func_cfloat_float,
BUILT_IN_CABSF, "cabsf", true);
-
-
+
gfc_define_builtin ("__builtin_copysign", mfunc_double[1],
BUILT_IN_COPYSIGN, "copysign", true);
gfc_define_builtin ("__builtin_copysignf", mfunc_float[1],
@@ -809,61 +808,28 @@ gfc_init_builtin_functions (void)
/* Other builtin functions we use. */
- tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, long_integer_type_node, tmp);
- ftype = build_function_type (long_integer_type_node, tmp);
- gfc_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT,
- "__builtin_expect", true);
-
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, pvoid_type_node, tmp);
- tmp = tree_cons (NULL_TREE, pvoid_type_node, tmp);
- ftype = build_function_type (pvoid_type_node, tmp);
- gfc_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY,
- "memcpy", false);
-
tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node);
ftype = build_function_type (integer_type_node, tmp);
- gfc_define_builtin ("__builtin_clz", ftype, BUILT_IN_CLZ, "clz", true);
+ gfc_define_builtin ("__builtin_clz", ftype, BUILT_IN_CLZ,
+ "__builtin_clz", true);
tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node);
ftype = build_function_type (integer_type_node, tmp);
- gfc_define_builtin ("__builtin_clzl", ftype, BUILT_IN_CLZL, "clzl", true);
+ gfc_define_builtin ("__builtin_clzl", ftype, BUILT_IN_CLZL,
+ "__builtin_clzl", true);
tmp = tree_cons (NULL_TREE, long_long_integer_type_node, void_list_node);
ftype = build_function_type (integer_type_node, tmp);
- gfc_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL, "clzll", true);
-
- tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, pvoid_type_node, tmp);
- tmp = tree_cons (NULL_TREE, pvoid_type_node, tmp);
- ftype = build_function_type (void_type_node, tmp);
- gfc_define_builtin ("__builtin_init_trampoline", ftype,
- BUILT_IN_INIT_TRAMPOLINE, "init_trampoline", false);
-
- tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node);
- ftype = build_function_type (pvoid_type_node, tmp);
- gfc_define_builtin ("__builtin_adjust_trampoline", ftype,
- BUILT_IN_ADJUST_TRAMPOLINE, "adjust_trampoline", true);
-
- /* The stack_save, stack_restore, and alloca builtins aren't used directly.
- They are inserted during gimplification to implement variable sized
- stack allocation. */
-
- ftype = build_function_type (pvoid_type_node, void_list_node);
- gfc_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE,
- "stack_save", false);
-
- tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node);
- ftype = build_function_type (void_type_node, tmp);
- gfc_define_builtin ("__builtin_stack_restore", ftype, BUILT_IN_STACK_RESTORE,
- "stack_restore", false);
-
- tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- ftype = build_function_type (pvoid_type_node, tmp);
- gfc_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
- "alloca", false);
+ gfc_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL,
+ "__builtin_clzll", true);
+
+ tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node);
+ tmp = tree_cons (NULL_TREE, long_integer_type_node, tmp);
+ ftype = build_function_type (long_integer_type_node, tmp);
+ gfc_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT,
+ "__builtin_expect", true);
+ build_common_builtin_nodes ();
targetm.init_builtins ();
}
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index c68f5af5ad5..adbccc11486 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -408,7 +408,8 @@ typedef struct
unsigned in_namelist:1, in_common:1;
unsigned function:1, subroutine:1, generic:1;
- unsigned implicit_type:1; /* Type defined via implicit rules */
+ unsigned implicit_type:1; /* Type defined via implicit rules. */
+ unsigned untyped:1; /* No implicit type could be found. */
/* Function/subroutine attributes */
unsigned sequence:1, elemental:1, pure:1, recursive:1;
@@ -539,7 +540,7 @@ gfc_array_spec;
/* Components of derived types. */
typedef struct gfc_component
{
- char name[GFC_MAX_SYMBOL_LEN + 1];
+ const char *name;
gfc_typespec ts;
int pointer, dimension;
@@ -570,7 +571,7 @@ gfc_formal_arglist;
/* The gfc_actual_arglist structure is for actual arguments. */
typedef struct gfc_actual_arglist
{
- char name[GFC_MAX_SYMBOL_LEN + 1];
+ const char *name;
/* Alternate return label when the expr member is null. */
struct gfc_st_label *label;
@@ -635,7 +636,7 @@ gfc_interface;
/* User operator nodes. These are like stripped down symbols. */
typedef struct
{
- char name[GFC_MAX_SYMBOL_LEN + 1];
+ const char *name;
gfc_interface *operator;
struct gfc_namespace *ns;
@@ -651,8 +652,8 @@ gfc_user_op;
typedef struct gfc_symbol
{
- char name[GFC_MAX_SYMBOL_LEN + 1]; /* Primary name, before renaming */
- char module[GFC_MAX_SYMBOL_LEN + 1]; /* Module this symbol came from */
+ const char *name; /* Primary name, before renaming */
+ const char *module; /* Module this symbol came from */
locus declared_at;
gfc_typespec ts;
@@ -743,7 +744,7 @@ gfc_entry_list;
typedef struct gfc_symtree
{
BBT_HEADER (gfc_symtree);
- char name[GFC_MAX_SYMBOL_LEN + 1];
+ const char *name;
int ambiguous;
union
{
@@ -1002,7 +1003,7 @@ gfc_resolve_f;
typedef struct gfc_intrinsic_sym
{
- char name[GFC_MAX_SYMBOL_LEN + 1], lib_name[GFC_MAX_SYMBOL_LEN + 1];
+ const char *name, *lib_name;
gfc_intrinsic_arg *formal;
gfc_typespec ts;
int elemental, pure, generic, specific, actual_ok, standard;
@@ -1043,15 +1044,11 @@ typedef struct gfc_expr
int rank;
mpz_t *shape; /* Can be NULL if shape is unknown at compile time */
- gfc_intrinsic_op operator;
-
/* Nonnull for functions and structure constructors */
gfc_symtree *symtree;
- gfc_user_op *uop;
gfc_ref *ref;
- struct gfc_expr *op1, *op2;
locus where;
union
@@ -1069,6 +1066,14 @@ typedef struct gfc_expr
struct
{
+ gfc_intrinsic_op operator;
+ gfc_user_op *uop;
+ struct gfc_expr *op1, *op2;
+ }
+ op;
+
+ struct
+ {
gfc_actual_arglist *actual;
const char *name; /* Points to the ultimate name of the function */
gfc_intrinsic_sym *isym;
@@ -1573,32 +1578,33 @@ void gfc_get_component_attr (symbol_attribute *, gfc_component *);
void gfc_set_sym_referenced (gfc_symbol * sym);
try gfc_add_allocatable (symbol_attribute *, locus *);
-try gfc_add_dimension (symbol_attribute *, locus *);
+try gfc_add_dimension (symbol_attribute *, const char *, locus *);
try gfc_add_external (symbol_attribute *, locus *);
try gfc_add_intrinsic (symbol_attribute *, locus *);
try gfc_add_optional (symbol_attribute *, locus *);
try gfc_add_pointer (symbol_attribute *, locus *);
-try gfc_add_result (symbol_attribute *, locus *);
-try gfc_add_save (symbol_attribute *, locus *);
+try gfc_add_result (symbol_attribute *, const char *, locus *);
+try gfc_add_save (symbol_attribute *, const char *, locus *);
try gfc_add_saved_common (symbol_attribute *, locus *);
try gfc_add_target (symbol_attribute *, locus *);
-try gfc_add_dummy (symbol_attribute *, locus *);
-try gfc_add_generic (symbol_attribute *, locus *);
+try gfc_add_dummy (symbol_attribute *, const char *, locus *);
+try gfc_add_generic (symbol_attribute *, const char *, locus *);
try gfc_add_common (symbol_attribute *, locus *);
-try gfc_add_in_common (symbol_attribute *, locus *);
-try gfc_add_data (symbol_attribute *, locus *);
-try gfc_add_in_namelist (symbol_attribute *, locus *);
-try gfc_add_sequence (symbol_attribute *, locus *);
+try gfc_add_in_common (symbol_attribute *, const char *, locus *);
+try gfc_add_data (symbol_attribute *, const char *, locus *);
+try gfc_add_in_namelist (symbol_attribute *, const char *, locus *);
+try gfc_add_sequence (symbol_attribute *, const char *, locus *);
try gfc_add_elemental (symbol_attribute *, locus *);
try gfc_add_pure (symbol_attribute *, locus *);
try gfc_add_recursive (symbol_attribute *, locus *);
-try gfc_add_function (symbol_attribute *, locus *);
-try gfc_add_subroutine (symbol_attribute *, locus *);
-
-try gfc_add_access (symbol_attribute *, gfc_access, locus *);
-try gfc_add_flavor (symbol_attribute *, sym_flavor, locus *);
-try gfc_add_entry (symbol_attribute *, locus *);
-try gfc_add_procedure (symbol_attribute *, procedure_type, locus *);
+try gfc_add_function (symbol_attribute *, const char *, locus *);
+try gfc_add_subroutine (symbol_attribute *, const char *, locus *);
+
+try gfc_add_access (symbol_attribute *, gfc_access, const char *, locus *);
+try gfc_add_flavor (symbol_attribute *, sym_flavor, const char *, locus *);
+try gfc_add_entry (symbol_attribute *, const char *, locus *);
+try gfc_add_procedure (symbol_attribute *, procedure_type,
+ const char *, locus *);
try gfc_add_intent (symbol_attribute *, sym_intent, locus *);
try gfc_add_explicit_interface (gfc_symbol *, ifsrc,
gfc_formal_arglist *, locus *);
@@ -1618,7 +1624,7 @@ void gfc_free_st_label (gfc_st_label *);
void gfc_define_st_label (gfc_st_label *, gfc_sl_type, locus *);
try gfc_reference_st_label (gfc_st_label *, gfc_sl_type);
-gfc_namespace *gfc_get_namespace (gfc_namespace *);
+gfc_namespace *gfc_get_namespace (gfc_namespace *, int);
gfc_symtree *gfc_new_symtree (gfc_symtree **, const char *);
gfc_symtree *gfc_find_symtree (gfc_symtree *, const char *);
gfc_user_op *gfc_get_uop (const char *);
@@ -1648,8 +1654,8 @@ void gfc_save_all (gfc_namespace *);
void gfc_symbol_state (void);
-gfc_gsymbol *gfc_get_gsymbol (char *);
-gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, char *);
+gfc_gsymbol *gfc_get_gsymbol (const char *);
+gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *);
/* intrinsic.c */
extern int gfc_init_expr;
@@ -1658,7 +1664,7 @@ extern int gfc_init_expr;
by placing it into a special module that is otherwise impossible to
read or write. */
-#define gfc_intrinsic_symbol(SYM) strcpy (SYM->module, "(intrinsic)")
+#define gfc_intrinsic_symbol(SYM) SYM->module = gfc_get_string ("(intrinsic)")
void gfc_intrinsic_init_1 (void);
void gfc_intrinsic_done_1 (void);
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 3ff37684ed2..c3242f7b5a3 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1,8 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename gfortran.info
-@set last-update 13 May 2004
-@set copyrights-gfortran 1999-2004
+@set copyrights-gfortran 1999-2005
@include gcc-common.texi
@@ -83,10 +82,6 @@ Contributed by Steven Bosscher (@email{s.bosscher@@gcc.gnu.org}).
@title Using GNU Fortran 95
@sp 2
@center Steven Bosscher
-@sp 3
-@center Last updated @value{last-update}
-@sp 1
-@center for version @value {version-GCC}
@page
@vskip 0pt plus 1filll
For the @value{version-GCC} Version*
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index c127568275a..ecbf9a27aac 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -213,7 +213,8 @@ gfc_match_interface (void)
if (gfc_get_symbol (name, NULL, &sym))
return MATCH_ERROR;
- if (!sym->attr.generic && gfc_add_generic (&sym->attr, NULL) == FAILURE)
+ if (!sym->attr.generic
+ && gfc_add_generic (&sym->attr, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
current_interface.sym = gfc_new_block = sym;
@@ -339,8 +340,9 @@ gfc_compare_types (gfc_typespec * ts1, gfc_typespec * ts2)
true names and module names are the same and the module name is
nonnull, then they are equal. */
if (strcmp (ts1->derived->name, ts2->derived->name) == 0
- && ts1->derived->module[0] != '\0'
- && strcmp (ts1->derived->module, ts2->derived->module) == 0)
+ && ((ts1->derived->module == NULL && ts2->derived->module == NULL)
+ || (ts1->derived != NULL && ts2->derived != NULL
+ && strcmp (ts1->derived->module, ts2->derived->module) == 0)))
return 1;
/* Compare type via the rules of the standard. Both types must have
@@ -1164,7 +1166,7 @@ compare_actual_formal (gfc_actual_arglist ** ap,
for (a = actual; a; a = a->next, f = f->next)
{
- if (a->name[0] != '\0')
+ if (a->name != NULL)
{
i = 0;
for (f = formal; f; f = f->next, i++)
@@ -1639,21 +1641,21 @@ gfc_extend_expr (gfc_expr * e)
sym = NULL;
actual = gfc_get_actual_arglist ();
- actual->expr = e->op1;
+ actual->expr = e->value.op.op1;
- if (e->op2 != NULL)
+ if (e->value.op.op2 != NULL)
{
actual->next = gfc_get_actual_arglist ();
- actual->next->expr = e->op2;
+ actual->next->expr = e->value.op.op2;
}
- i = fold_unary (e->operator);
+ i = fold_unary (e->value.op.operator);
if (i == INTRINSIC_USER)
{
for (ns = gfc_current_ns; ns; ns = ns->parent)
{
- uop = gfc_find_uop (e->uop->name, ns);
+ uop = gfc_find_uop (e->value.op.uop->name, ns);
if (uop == NULL)
continue;
@@ -1686,6 +1688,8 @@ gfc_extend_expr (gfc_expr * e)
e->expr_type = EXPR_FUNCTION;
e->symtree = find_sym_in_symtree (sym);
e->value.function.actual = actual;
+ e->value.function.esym = NULL;
+ e->value.function.isym = NULL;
if (gfc_pure (NULL) && !gfc_pure (sym))
{
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 03d443f3c52..ebf5cb2edda 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -37,7 +37,8 @@ int gfc_init_expr = 0;
/* Pointers to an intrinsic function and its argument names that are being
checked. */
-char *gfc_current_intrinsic, *gfc_current_intrinsic_arg[MAX_INTRINSIC_ARGS];
+const char *gfc_current_intrinsic;
+const char *gfc_current_intrinsic_arg[MAX_INTRINSIC_ARGS];
locus *gfc_current_intrinsic_where;
static gfc_intrinsic_sym *functions, *subroutines, *conversion, *next_sym;
@@ -107,7 +108,7 @@ gfc_get_intrinsic_sub_symbol (const char * name)
/* Return a pointer to the name of a conversion function given two
typespecs. */
-static char *
+static const char *
conv_name (gfc_typespec * from, gfc_typespec * to)
{
static char name[30];
@@ -115,7 +116,7 @@ conv_name (gfc_typespec * from, gfc_typespec * to)
sprintf (name, "__convert_%c%d_%c%d", gfc_type_letter (from->type),
from->kind, gfc_type_letter (to->type), to->kind);
- return name;
+ return gfc_get_string (name);
}
@@ -127,7 +128,7 @@ static gfc_intrinsic_sym *
find_conv (gfc_typespec * from, gfc_typespec * to)
{
gfc_intrinsic_sym *sym;
- char *target;
+ const char *target;
int i;
target = conv_name (from, to);
@@ -213,7 +214,7 @@ add_sym (const char *name, int elemental, int actual_ok ATTRIBUTE_UNUSED,
bt type, int kind, int standard, gfc_check_f check,
gfc_simplify_f simplify, gfc_resolve_f resolve, ...)
{
-
+ char buf[GFC_MAX_SYMBOL_LEN + 11]; /* 10 for '_gfortran_', 1 for '\0' */
int optional, first_flag;
va_list argp;
@@ -233,10 +234,11 @@ add_sym (const char *name, int elemental, int actual_ok ATTRIBUTE_UNUSED,
break;
case SZ_NOTHING:
- strcpy (next_sym->name, name);
+ next_sym->name = gfc_get_string (name);
- strcpy (next_sym->lib_name, "_gfortran_");
- strcat (next_sym->lib_name, name);
+ strcpy (buf, "_gfortran_");
+ strcat (buf, name);
+ next_sym->lib_name = gfc_get_string (buf);
next_sym->elemental = elemental;
next_sym->ts.type = type;
@@ -785,11 +787,11 @@ make_generic (const char *name, gfc_generic_isym_id generic_id, int standard)
g->generic = 1;
g->specific = 1;
g->generic_id = generic_id;
- if ((g + 1)->name[0] != '\0')
+ if ((g + 1)->name != NULL)
g->specific_head = g + 1;
g++;
- while (g->name[0] != '\0')
+ while (g->name != NULL)
{
g->next = g + 1;
g->specific = 1;
@@ -828,7 +830,7 @@ make_alias (const char *name, int standard)
case SZ_NOTHING:
next_sym[0] = next_sym[-1];
- strcpy (next_sym->name, name);
+ next_sym->name = gfc_get_string (name);
next_sym++;
break;
@@ -894,7 +896,7 @@ add_functions (void)
make_generic ("abs", GFC_ISYM_ABS, GFC_STD_F77);
add_sym_1 ("achar", 1, 1, BT_CHARACTER, dc, GFC_STD_F95,
- NULL, gfc_simplify_achar, NULL,
+ gfc_check_achar, gfc_simplify_achar, NULL,
i, BT_INTEGER, di, REQUIRED);
make_generic ("achar", GFC_ISYM_ACHAR, GFC_STD_F95);
@@ -1781,7 +1783,7 @@ add_functions (void)
make_generic ("second", GFC_ISYM_SECOND, GFC_STD_GNU);
add_sym_1 ("selected_int_kind", 0, 1, BT_INTEGER, di, GFC_STD_F95,
- NULL, gfc_simplify_selected_int_kind, NULL,
+ gfc_check_selected_int_kind, gfc_simplify_selected_int_kind, NULL,
r, BT_INTEGER, di, REQUIRED);
make_generic ("selected_int_kind", GFC_ISYM_SI_KIND, GFC_STD_F95);
@@ -2152,8 +2154,8 @@ add_conv (bt from_type, int from_kind, bt to_type, int to_kind,
sym = conversion + nconv;
- strcpy (sym->name, conv_name (&from, &to));
- strcpy (sym->lib_name, sym->name);
+ sym->name = conv_name (&from, &to);
+ sym->lib_name = sym->name;
sym->simplify.cc = simplify;
sym->elemental = 1;
sym->ts = to;
@@ -2241,7 +2243,7 @@ gfc_intrinsic_init_1 (void)
nargs = nfunc = nsub = nconv = 0;
/* Create a namespace to hold the resolved intrinsic symbols. */
- gfc_intrinsic_namespace = gfc_get_namespace (NULL);
+ gfc_intrinsic_namespace = gfc_get_namespace (NULL, 0);
sizing = SZ_FUNCS;
add_functions ();
@@ -2359,7 +2361,7 @@ sort_actual (const char *name, gfc_actual_arglist ** ap,
if (a == NULL)
goto optional;
- if (a->name[0] != '\0')
+ if (a->name != NULL)
goto keywords;
f->actual = a;
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 41593efe9c1..3f5fcba3736 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -1,6 +1,7 @@
/* Header file for intrinsics check, resolve and simplify function
prototypes.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Contributed by Andy Vaught & Katherine Holcomb
This file is part of GCC.
@@ -31,6 +32,7 @@ try gfc_check_a_xkind (gfc_expr *, gfc_expr *);
try gfc_check_a_p (gfc_expr *, gfc_expr *);
try gfc_check_abs (gfc_expr *);
+try gfc_check_achar (gfc_expr *);
try gfc_check_all_any (gfc_expr *, gfc_expr *);
try gfc_check_allocated (gfc_expr *);
try gfc_check_associated (gfc_expr *, gfc_expr *);
@@ -93,6 +95,7 @@ try gfc_check_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_scale (gfc_expr *, gfc_expr *);
try gfc_check_scan (gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_second_sub (gfc_expr *);
+try gfc_check_selected_int_kind (gfc_expr *);
try gfc_check_selected_real_kind (gfc_expr *, gfc_expr *);
try gfc_check_set_exponent (gfc_expr *, gfc_expr *);
try gfc_check_shape (gfc_expr *);
@@ -365,6 +368,6 @@ void gfc_resolve_unlink_sub (gfc_code *);
#define MAX_INTRINSIC_ARGS 5
-extern char *gfc_current_intrinsic,
- *gfc_current_intrinsic_arg[MAX_INTRINSIC_ARGS];
+extern const char *gfc_current_intrinsic;
+extern const char *gfc_current_intrinsic_arg[MAX_INTRINSIC_ARGS];
extern locus *gfc_current_intrinsic_where;
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index a4ab2251761..9a30b7df2e1 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -383,9 +383,9 @@ gfc_resolve_dot_product (gfc_expr * f, gfc_expr * a, gfc_expr * b)
{
temp.expr_type = EXPR_OP;
gfc_clear_ts (&temp.ts);
- temp.operator = INTRINSIC_NONE;
- temp.op1 = a;
- temp.op2 = b;
+ temp.value.op.operator = INTRINSIC_NONE;
+ temp.value.op.op1 = a;
+ temp.value.op.op2 = b;
gfc_type_convert_binary (&temp);
f->ts = temp.ts;
}
@@ -753,9 +753,9 @@ gfc_resolve_matmul (gfc_expr * f, gfc_expr * a, gfc_expr * b)
{
temp.expr_type = EXPR_OP;
gfc_clear_ts (&temp.ts);
- temp.operator = INTRINSIC_NONE;
- temp.op1 = a;
- temp.op2 = b;
+ temp.value.op.operator = INTRINSIC_NONE;
+ temp.value.op.op1 = a;
+ temp.value.op.op2 = b;
gfc_type_convert_binary (&temp);
f->ts = temp.ts;
}
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index abd8ef89acb..2a364478530 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -266,7 +266,8 @@ gfc_match_label (void)
}
if (gfc_new_block->attr.flavor != FL_LABEL
- && gfc_add_flavor (&gfc_new_block->attr, FL_LABEL, NULL) == FAILURE)
+ && gfc_add_flavor (&gfc_new_block->attr, FL_LABEL,
+ gfc_new_block->name, NULL) == FAILURE)
return MATCH_ERROR;
for (p = gfc_state_stack; p; p = p->previous)
@@ -806,7 +807,7 @@ gfc_match_program (void)
if (m == MATCH_ERROR)
return m;
- if (gfc_add_flavor (&sym->attr, FL_PROGRAM, NULL) == FAILURE)
+ if (gfc_add_flavor (&sym->attr, FL_PROGRAM, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
gfc_new_block = sym;
@@ -2013,7 +2014,7 @@ gfc_match_call (void)
if (!sym->attr.generic
&& !sym->attr.subroutine
- && gfc_add_subroutine (&sym->attr, NULL) == FAILURE)
+ && gfc_add_subroutine (&sym->attr, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
if (gfc_match_eos () != MATCH_YES)
@@ -2237,7 +2238,7 @@ gfc_match_common (void)
goto cleanup;
}
- if (gfc_add_in_common (&sym->attr, NULL) == FAILURE)
+ if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
goto cleanup;
if (sym->value != NULL
@@ -2252,7 +2253,7 @@ gfc_match_common (void)
goto cleanup;
}
- if (gfc_add_in_common (&sym->attr, NULL) == FAILURE)
+ if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
goto cleanup;
/* Derived type names must have the SEQUENCE attribute. */
@@ -2287,7 +2288,7 @@ gfc_match_common (void)
goto cleanup;
}
- if (gfc_add_dimension (&sym->attr, NULL) == FAILURE)
+ if (gfc_add_dimension (&sym->attr, sym->name, NULL) == FAILURE)
goto cleanup;
if (sym->attr.pointer)
@@ -2353,7 +2354,7 @@ gfc_match_block_data (void)
if (gfc_get_symbol (name, NULL, &sym))
return MATCH_ERROR;
- if (gfc_add_flavor (&sym->attr, FL_BLOCK_DATA, NULL) == FAILURE)
+ if (gfc_add_flavor (&sym->attr, FL_BLOCK_DATA, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
gfc_new_block = sym;
@@ -2403,7 +2404,8 @@ gfc_match_namelist (void)
}
if (group_name->attr.flavor != FL_NAMELIST
- && gfc_add_flavor (&group_name->attr, FL_NAMELIST, NULL) == FAILURE)
+ && gfc_add_flavor (&group_name->attr, FL_NAMELIST,
+ group_name->name, NULL) == FAILURE)
return MATCH_ERROR;
for (;;)
@@ -2415,7 +2417,7 @@ gfc_match_namelist (void)
goto error;
if (sym->attr.in_namelist == 0
- && gfc_add_in_namelist (&sym->attr, NULL) == FAILURE)
+ && gfc_add_in_namelist (&sym->attr, sym->name, NULL) == FAILURE)
goto error;
nl = gfc_get_namelist ();
@@ -2471,7 +2473,8 @@ gfc_match_module (void)
if (m != MATCH_YES)
return m;
- if (gfc_add_flavor (&gfc_new_block->attr, FL_MODULE, NULL) == FAILURE)
+ if (gfc_add_flavor (&gfc_new_block->attr, FL_MODULE,
+ gfc_new_block->name, NULL) == FAILURE)
return MATCH_ERROR;
return MATCH_YES;
@@ -2587,7 +2590,8 @@ gfc_match_st_function (void)
gfc_push_error (&old_error);
- if (gfc_add_procedure (&sym->attr, PROC_ST_FUNCTION, NULL) == FAILURE)
+ if (gfc_add_procedure (&sym->attr, PROC_ST_FUNCTION,
+ sym->name, NULL) == FAILURE)
goto undo_error;
if (gfc_match_formal_arglist (sym, 1, 0) != MATCH_YES)
diff --git a/gcc/fortran/matchexp.c b/gcc/fortran/matchexp.c
index bde8d603dea..04fd31f3609 100644
--- a/gcc/fortran/matchexp.c
+++ b/gcc/fortran/matchexp.c
@@ -179,11 +179,11 @@ build_node (gfc_intrinsic_op operator, locus * where,
new = gfc_get_expr ();
new->expr_type = EXPR_OP;
- new->operator = operator;
+ new->value.op.operator = operator;
new->where = *where;
- new->op1 = op1;
- new->op2 = op2;
+ new->value.op.op1 = op1;
+ new->value.op.op2 = op2;
return new;
}
@@ -214,7 +214,7 @@ match_level_1 (gfc_expr ** result)
else
{
f = build_node (INTRINSIC_USER, &where, e, NULL);
- f->uop = uop;
+ f->value.op.uop = uop;
*result = f;
}
@@ -873,7 +873,7 @@ gfc_match_expr (gfc_expr ** result)
}
all = build_node (INTRINSIC_USER, &where, all, e);
- all->uop = uop;
+ all->value.op.uop = uop;
}
*result = all;
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 3670a3a49ad..4b69b738db1 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -655,7 +655,8 @@ compare_true_names (void * _t1, void * _t2)
t1 = (true_name *) _t1;
t2 = (true_name *) _t2;
- c = strcmp (t1->sym->module, t2->sym->module);
+ c = ((t1->sym->module > t2->sym->module)
+ - (t1->sym->module < t2->sym->module));
if (c != 0)
return c;
@@ -673,8 +674,11 @@ find_true_name (const char *name, const char *module)
gfc_symbol sym;
int c;
- strcpy (sym.name, name);
- strcpy (sym.module, module);
+ sym.name = gfc_get_string (name);
+ if (module != NULL)
+ sym.module = gfc_get_string (module);
+ else
+ sym.module = NULL;
t.sym = &sym;
p = true_name_root;
@@ -1341,8 +1345,33 @@ mio_allocated_string (const char *s)
}
-/* Read or write a string that is in static memory or inside of some
- already-allocated structure. */
+/* Read or write a string that is in static memory. */
+
+static void
+mio_pool_string (const char **stringp)
+{
+ /* TODO: one could write the string only once, and refer to it via a
+ fixup pointer. */
+
+ /* As a special case we have to deal with a NULL string. This
+ happens for the 'module' member of 'gfc_symbol's that are not in a
+ module. We read / write these as the empty string. */
+ if (iomode == IO_OUTPUT)
+ {
+ const char *p = *stringp == NULL ? "" : *stringp;
+ write_atom (ATOM_STRING, p);
+ }
+ else
+ {
+ require_atom (ATOM_STRING);
+ *stringp = atom_string[0] == '\0' ? NULL : gfc_get_string (atom_string);
+ gfc_free (atom_string);
+ }
+}
+
+
+/* Read or write a string that is inside of some already-allocated
+ structure. */
static void
mio_internal_string (char *string)
@@ -1802,7 +1831,7 @@ mio_component_ref (gfc_component ** cp, gfc_symbol * sym)
p->type = P_COMPONENT;
if (iomode == IO_OUTPUT)
- mio_internal_string ((*cp)->name);
+ mio_pool_string (&(*cp)->name);
else
{
mio_internal_string (name);
@@ -1851,7 +1880,7 @@ mio_component (gfc_component * c)
if (p->type == P_UNKNOWN)
p->type = P_COMPONENT;
- mio_internal_string (c->name);
+ mio_pool_string (&c->name);
mio_typespec (&c->ts);
mio_array_spec (&c->as);
@@ -1907,7 +1936,7 @@ mio_actual_arg (gfc_actual_arglist * a)
{
mio_lparen ();
- mio_internal_string (a->name);
+ mio_pool_string (&a->name);
mio_expr (&a->expr);
mio_rparen ();
}
@@ -2404,14 +2433,15 @@ mio_expr (gfc_expr ** ep)
switch (e->expr_type)
{
case EXPR_OP:
- e->operator = MIO_NAME(gfc_intrinsic_op) (e->operator, intrinsics);
+ e->value.op.operator
+ = MIO_NAME(gfc_intrinsic_op) (e->value.op.operator, intrinsics);
- switch (e->operator)
+ switch (e->value.op.operator)
{
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
case INTRINSIC_NOT:
- mio_expr (&e->op1);
+ mio_expr (&e->value.op.op1);
break;
case INTRINSIC_PLUS:
@@ -2430,8 +2460,8 @@ mio_expr (gfc_expr ** ep)
case INTRINSIC_GE:
case INTRINSIC_LT:
case INTRINSIC_LE:
- mio_expr (&e->op1);
- mio_expr (&e->op2);
+ mio_expr (&e->value.op.op1);
+ mio_expr (&e->value.op.op2);
break;
default:
@@ -2483,8 +2513,7 @@ mio_expr (gfc_expr ** ep)
case EXPR_SUBSTRING:
e->value.character.string = (char *)
mio_allocated_string (e->value.character.string);
- mio_expr (&e->op1);
- mio_expr (&e->op2);
+ mio_ref_list (&e->ref);
break;
case EXPR_STRUCTURE:
@@ -2599,14 +2628,14 @@ mio_interface (gfc_interface ** ip)
/* Save/restore a named operator interface. */
static void
-mio_symbol_interface (char *name, char *module,
+mio_symbol_interface (const char **name, const char **module,
gfc_interface ** ip)
{
mio_lparen ();
- mio_internal_string (name);
- mio_internal_string (module);
+ mio_pool_string (name);
+ mio_pool_string (module);
mio_interface_rest (ip);
}
@@ -2628,7 +2657,7 @@ mio_namespace_ref (gfc_namespace ** nsp)
ns = (gfc_namespace *)p->u.pointer;
if (ns == NULL)
{
- ns = gfc_get_namespace (NULL);
+ ns = gfc_get_namespace (NULL, 0);
associate_integer_pointer (p, ns);
}
else
@@ -2879,12 +2908,12 @@ load_needed (pointer_info * p)
the namespaces that hold the formal parameters of module
procedures. */
- ns = gfc_get_namespace (NULL);
+ ns = gfc_get_namespace (NULL, 0);
associate_integer_pointer (q, ns);
}
sym = gfc_new_symbol (p->u.rsym.true_name, ns);
- strcpy (sym->module, p->u.rsym.module);
+ sym->module = gfc_get_string (p->u.rsym.module);
associate_integer_pointer (p, sym);
}
@@ -3037,7 +3066,7 @@ read_module (void)
sym = info->u.rsym.sym =
gfc_new_symbol (info->u.rsym.true_name, gfc_current_ns);
- strcpy (sym->module, info->u.rsym.module);
+ sym->module = gfc_get_string (info->u.rsym.module);
}
st->n.sym = sym;
@@ -3170,7 +3199,7 @@ write_common (gfc_symtree *st)
write_common(st->right);
mio_lparen();
- mio_internal_string(st->name);
+ mio_pool_string(&st->name);
p = st->n.common;
mio_symbol_ref(&p->head);
@@ -3190,9 +3219,9 @@ write_symbol (int n, gfc_symbol * sym)
gfc_internal_error ("write_symbol(): bad module symbol '%s'", sym->name);
mio_integer (&n);
- mio_internal_string (sym->name);
+ mio_pool_string (&sym->name);
- mio_internal_string (sym->module);
+ mio_pool_string (&sym->module);
mio_pointer_ref (&sym->ns);
mio_symbol (sym);
@@ -3217,8 +3246,8 @@ write_symbol0 (gfc_symtree * st)
write_symbol0 (st->right);
sym = st->n.sym;
- if (sym->module[0] == '\0')
- strcpy (sym->module, module_name);
+ if (sym->module == NULL)
+ sym->module = gfc_get_string (module_name);
if (sym->attr.flavor == FL_PROCEDURE && sym->attr.generic
&& !sym->attr.subroutine && !sym->attr.function)
@@ -3265,8 +3294,8 @@ write_symbol1 (pointer_info * p)
/* FIXME: This shouldn't be necessary, but it works around
deficiencies in the module loader or/and symbol handling. */
- if (p->u.wsym.sym->module[0] == '\0' && p->u.wsym.sym->attr.dummy)
- strcpy (p->u.wsym.sym->module, module_name);
+ if (p->u.wsym.sym->module == NULL && p->u.wsym.sym->attr.dummy)
+ p->u.wsym.sym->module = gfc_get_string (module_name);
p->u.wsym.state = WRITTEN;
write_symbol (p->integer, p->u.wsym.sym);
@@ -3281,12 +3310,13 @@ static void
write_operator (gfc_user_op * uop)
{
static char nullstring[] = "";
+ const char *p = nullstring;
if (uop->operator == NULL
|| !gfc_check_access (uop->access, uop->ns->default_access))
return;
- mio_symbol_interface (uop->name, nullstring, &uop->operator);
+ mio_symbol_interface (&uop->name, &p, &uop->operator);
}
@@ -3300,7 +3330,7 @@ write_generic (gfc_symbol * sym)
|| !gfc_check_access (sym->attr.access, sym->ns->default_access))
return;
- mio_symbol_interface (sym->name, sym->module, &sym->generic);
+ mio_symbol_interface (&sym->name, &sym->module, &sym->generic);
}
@@ -3323,7 +3353,7 @@ write_symtree (gfc_symtree * st)
if (p == NULL)
gfc_internal_error ("write_symtree(): Symbol not written");
- mio_internal_string (st->name);
+ mio_pool_string (&st->name);
mio_integer (&st->ambiguous);
mio_integer (&p->integer);
}
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 484c05ce2d6..a3f0ac19539 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -1349,7 +1349,8 @@ parse_derived (void)
}
seen_sequence = 1;
- gfc_add_sequence (&gfc_current_block ()->attr, NULL);
+ gfc_add_sequence (&gfc_current_block ()->attr,
+ gfc_current_block ()->name, NULL);
break;
default:
@@ -1404,7 +1405,7 @@ parse_interface (void)
current_state = COMP_NONE;
loop:
- gfc_current_ns = gfc_get_namespace (current_interface.ns);
+ gfc_current_ns = gfc_get_namespace (current_interface.ns, 0);
st = next_statement ();
switch (st)
@@ -1451,9 +1452,9 @@ loop:
if (current_state == COMP_NONE)
{
if (new_state == COMP_FUNCTION)
- gfc_add_function (&sym->attr, NULL);
- if (new_state == COMP_SUBROUTINE)
- gfc_add_subroutine (&sym->attr, NULL);
+ gfc_add_function (&sym->attr, sym->name, NULL);
+ else if (new_state == COMP_SUBROUTINE)
+ gfc_add_subroutine (&sym->attr, sym->name, NULL);
current_state = new_state;
}
@@ -2169,7 +2170,7 @@ parse_contained (int module)
do
{
- gfc_current_ns = gfc_get_namespace (parent_ns);
+ gfc_current_ns = gfc_get_namespace (parent_ns, 1);
gfc_current_ns->sibling = parent_ns->contained;
parent_ns->contained = gfc_current_ns;
@@ -2200,15 +2201,15 @@ parse_contained (int module)
gfc_new_block->name);
else
{
- if (gfc_add_procedure (&sym->attr, PROC_INTERNAL,
+ if (gfc_add_procedure (&sym->attr, PROC_INTERNAL, sym->name,
&gfc_new_block->declared_at) ==
SUCCESS)
{
if (st == ST_FUNCTION)
- gfc_add_function (&sym->attr,
+ gfc_add_function (&sym->attr, sym->name,
&gfc_new_block->declared_at);
else
- gfc_add_subroutine (&sym->attr,
+ gfc_add_subroutine (&sym->attr, sym->name,
&gfc_new_block->declared_at);
}
}
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index a2d1d1f5004..f3c51ab4675 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1273,7 +1273,7 @@ match_keyword_arg (gfc_actual_arglist * actual, gfc_actual_arglist * base)
if (name[0] != '\0')
{
for (a = base; a; a = a->next)
- if (strcmp (a->name, name) == 0)
+ if (a->name != NULL && strcmp (a->name, name) == 0)
{
gfc_error
("Keyword '%s' at %C has already appeared in the current "
@@ -1282,7 +1282,7 @@ match_keyword_arg (gfc_actual_arglist * actual, gfc_actual_arglist * base)
}
}
- strcpy (actual->name, name);
+ actual->name = gfc_get_string (name);
return MATCH_YES;
cleanup:
@@ -1877,7 +1877,7 @@ gfc_match_rvalue (gfc_expr ** result)
e->rank = sym->as->rank;
if (!sym->attr.function
- && gfc_add_function (&sym->attr, NULL) == FAILURE)
+ && gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)
{
m = MATCH_ERROR;
break;
@@ -1905,7 +1905,8 @@ gfc_match_rvalue (gfc_expr ** result)
if (sym->attr.dimension)
{
- if (gfc_add_flavor (&sym->attr, FL_VARIABLE, NULL) == FAILURE)
+ if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
+ sym->name, NULL) == FAILURE)
{
m = MATCH_ERROR;
break;
@@ -1930,7 +1931,8 @@ gfc_match_rvalue (gfc_expr ** result)
e->symtree = symtree;
e->expr_type = EXPR_VARIABLE;
- if (gfc_add_flavor (&sym->attr, FL_VARIABLE, NULL) == FAILURE)
+ if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
+ sym->name, NULL) == FAILURE)
{
m = MATCH_ERROR;
break;
@@ -1964,7 +1966,8 @@ gfc_match_rvalue (gfc_expr ** result)
e->expr_type = EXPR_VARIABLE;
if (sym->attr.flavor != FL_VARIABLE
- && gfc_add_flavor (&sym->attr, FL_VARIABLE, NULL) == FAILURE)
+ && gfc_add_flavor (&sym->attr, FL_VARIABLE,
+ sym->name, NULL) == FAILURE)
{
m = MATCH_ERROR;
break;
@@ -1990,7 +1993,7 @@ gfc_match_rvalue (gfc_expr ** result)
e->expr_type = EXPR_FUNCTION;
if (!sym->attr.function
- && gfc_add_function (&sym->attr, NULL) == FAILURE)
+ && gfc_add_function (&sym->attr, sym->name, NULL) == FAILURE)
{
m = MATCH_ERROR;
break;
@@ -2072,7 +2075,8 @@ gfc_match_variable (gfc_expr ** result, int equiv_flag)
break;
case FL_UNKNOWN:
- if (gfc_add_flavor (&sym->attr, FL_VARIABLE, NULL) == FAILURE)
+ if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
+ sym->name, NULL) == FAILURE)
return MATCH_ERROR;
break;
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 442b205b7bc..4d98f462a82 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -151,7 +151,7 @@ resolve_formal_arglist (gfc_symbol * proc)
A procedure specification would have already set the type. */
if (sym->attr.flavor == FL_UNKNOWN)
- gfc_add_flavor (&sym->attr, FL_VARIABLE, &sym->declared_at);
+ gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, &sym->declared_at);
if (gfc_pure (proc))
{
@@ -364,12 +364,12 @@ resolve_entries (gfc_namespace * ns)
gfc_get_ha_symbol (name, &proc);
gcc_assert (proc != NULL);
- gfc_add_procedure (&proc->attr, PROC_INTERNAL, NULL);
+ gfc_add_procedure (&proc->attr, PROC_INTERNAL, proc->name, NULL);
if (ns->proc_name->attr.subroutine)
- gfc_add_subroutine (&proc->attr, NULL);
+ gfc_add_subroutine (&proc->attr, proc->name, NULL);
else
{
- gfc_add_function (&proc->attr, NULL);
+ gfc_add_function (&proc->attr, proc->name, NULL);
gfc_internal_error ("TODO: Functions with alternate entry points");
}
proc->attr.access = ACCESS_PRIVATE;
@@ -884,8 +884,8 @@ set_type:
}
-/* Figure out if if a function reference is pure or not. Also sets the name
- of the function for a potential error message. Returns nonzero if the
+/* Figure out if a function reference is pure or not. Also set the name
+ of the function for a potential error message. Return nonzero if the
function is PURE, zero if not. */
static int
@@ -1262,10 +1262,10 @@ resolve_operator (gfc_expr * e)
/* Resolve all subnodes-- give them types. */
- switch (e->operator)
+ switch (e->value.op.operator)
{
default:
- if (gfc_resolve_expr (e->op2) == FAILURE)
+ if (gfc_resolve_expr (e->value.op.op2) == FAILURE)
return FAILURE;
/* Fall through... */
@@ -1273,17 +1273,17 @@ resolve_operator (gfc_expr * e)
case INTRINSIC_NOT:
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
- if (gfc_resolve_expr (e->op1) == FAILURE)
+ if (gfc_resolve_expr (e->value.op.op1) == FAILURE)
return FAILURE;
break;
}
/* Typecheck the new node. */
- op1 = e->op1;
- op2 = e->op2;
+ op1 = e->value.op.op1;
+ op2 = e->value.op.op2;
- switch (e->operator)
+ switch (e->value.op.operator)
{
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
@@ -1296,7 +1296,7 @@ resolve_operator (gfc_expr * e)
}
sprintf (msg, "Operand of unary numeric operator '%s' at %%L is %s",
- gfc_op2string (e->operator), gfc_typename (&e->ts));
+ gfc_op2string (e->value.op.operator), gfc_typename (&e->ts));
goto bad_op;
case INTRINSIC_PLUS:
@@ -1312,7 +1312,7 @@ resolve_operator (gfc_expr * e)
sprintf (msg,
"Operands of binary numeric operator '%s' at %%L are %s/%s",
- gfc_op2string (e->operator), gfc_typename (&op1->ts),
+ gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
goto bad_op;
@@ -1345,7 +1345,7 @@ resolve_operator (gfc_expr * e)
}
sprintf (msg, "Operands of logical operator '%s' at %%L are %s/%s",
- gfc_op2string (e->operator), gfc_typename (&op1->ts),
+ gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
goto bad_op;
@@ -1393,7 +1393,7 @@ resolve_operator (gfc_expr * e)
}
sprintf (msg, "Operands of comparison operator '%s' at %%L are %s/%s",
- gfc_op2string (e->operator), gfc_typename (&op1->ts),
+ gfc_op2string (e->value.op.operator), gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
goto bad_op;
@@ -1401,10 +1401,10 @@ resolve_operator (gfc_expr * e)
case INTRINSIC_USER:
if (op2 == NULL)
sprintf (msg, "Operand of user operator '%s' at %%L is %s",
- e->uop->name, gfc_typename (&op1->ts));
+ e->value.op.uop->name, gfc_typename (&op1->ts));
else
sprintf (msg, "Operands of user operator '%s' at %%L are %s/%s",
- e->uop->name, gfc_typename (&op1->ts),
+ e->value.op.uop->name, gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
goto bad_op;
@@ -1417,7 +1417,7 @@ resolve_operator (gfc_expr * e)
t = SUCCESS;
- switch (e->operator)
+ switch (e->value.op.operator)
{
case INTRINSIC_PLUS:
case INTRINSIC_MINUS:
@@ -3327,23 +3327,27 @@ gfc_find_forall_index (gfc_expr *expr, gfc_symbol *symbol)
gfc_error ("Unsupported statement while finding forall index in "
"expression");
break;
- default:
+
+ case EXPR_OP:
+ /* Find the FORALL index in the first operand. */
+ if (expr->value.op.op1)
+ {
+ if (gfc_find_forall_index (expr->value.op.op1, symbol) == SUCCESS)
+ return SUCCESS;
+ }
+
+ /* Find the FORALL index in the second operand. */
+ if (expr->value.op.op2)
+ {
+ if (gfc_find_forall_index (expr->value.op.op2, symbol) == SUCCESS)
+ return SUCCESS;
+ }
break;
- }
- /* Find the FORALL index in the first operand. */
- if (expr->op1)
- {
- if (gfc_find_forall_index (expr->op1, symbol) == SUCCESS)
- return SUCCESS;
+ default:
+ break;
}
- /* Find the FORALL index in the second operand. */
- if (expr->op2)
- {
- if (gfc_find_forall_index (expr->op2, symbol) == SUCCESS)
- return SUCCESS;
- }
return FAILURE;
}
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 423f3336d8b..81bc0159909 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -592,7 +592,7 @@ gfc_simplify_ceiling (gfc_expr * e, gfc_expr * k)
gfc_expr *ceil, *result;
int kind;
- kind = get_kind (BT_REAL, k, "CEILING", gfc_default_real_kind);
+ kind = get_kind (BT_INTEGER, k, "CEILING", gfc_default_integer_kind);
if (kind == -1)
return &gfc_bad_expr;
@@ -1017,7 +1017,7 @@ gfc_simplify_floor (gfc_expr * e, gfc_expr * k)
mpfr_t floor;
int kind;
- kind = get_kind (BT_REAL, k, "FLOOR", gfc_default_real_kind);
+ kind = get_kind (BT_INTEGER, k, "FLOOR", gfc_default_integer_kind);
if (kind == -1)
gfc_internal_error ("gfc_simplify_floor(): Bad kind");
@@ -1473,7 +1473,7 @@ gfc_simplify_int (gfc_expr * e, gfc_expr * k)
gfc_expr *rpart, *rtrunc, *result;
int kind;
- kind = get_kind (BT_REAL, k, "INT", gfc_default_real_kind);
+ kind = get_kind (BT_INTEGER, k, "INT", gfc_default_integer_kind);
if (kind == -1)
return &gfc_bad_expr;
diff --git a/gcc/fortran/st.c b/gcc/fortran/st.c
index b6515376e38..f4b32006ad1 100644
--- a/gcc/fortran/st.c
+++ b/gcc/fortran/st.c
@@ -1,5 +1,5 @@
/* Build executable statement trees.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 7333dbbb442..0b5e8e727a4 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -179,8 +179,7 @@ gfc_merge_new_implicit (gfc_typespec * ts)
}
-/* Given a symbol, return a pointer to the typespec for it's default
- type. */
+/* Given a symbol, return a pointer to the typespec for its default type. */
gfc_typespec *
gfc_get_default_type (gfc_symbol * sym, gfc_namespace * ns)
@@ -214,9 +213,12 @@ gfc_set_default_type (gfc_symbol * sym, int error_flag, gfc_namespace * ns)
if (ts->type == BT_UNKNOWN)
{
- if (error_flag)
- gfc_error ("Symbol '%s' at %L has no IMPLICIT type", sym->name,
- &sym->declared_at);
+ if (error_flag && !sym->attr.untyped)
+ {
+ gfc_error ("Symbol '%s' at %L has no IMPLICIT type",
+ sym->name, &sym->declared_at);
+ sym->attr.untyped = 1; /* Ensure we only give an error once. */
+ }
return FAILURE;
}
@@ -237,7 +239,7 @@ gfc_set_default_type (gfc_symbol * sym, int error_flag, gfc_namespace * ns)
#define conf2(a) if (attr->a) { a2 = a; goto conflict; }
static try
-check_conflict (symbol_attribute * attr, locus * where)
+check_conflict (symbol_attribute * attr, const char * name, locus * where)
{
static const char *dummy = "DUMMY", *save = "SAVE", *pointer = "POINTER",
*target = "TARGET", *external = "EXTERNAL", *intent = "INTENT",
@@ -426,7 +428,13 @@ check_conflict (symbol_attribute * attr, locus * where)
return SUCCESS;
conflict:
- gfc_error ("%s attribute conflicts with %s attribute at %L", a1, a2, where);
+ if (name == NULL)
+ gfc_error ("%s attribute conflicts with %s attribute at %L",
+ a1, a2, where);
+ else
+ gfc_error ("%s attribute conflicts with %s attribute in '%s' at %L",
+ a1, a2, name, where);
+
return FAILURE;
}
@@ -456,7 +464,7 @@ gfc_set_sym_referenced (gfc_symbol * sym)
nonzero if not. */
static int
-check_used (symbol_attribute * attr, locus * where)
+check_used (symbol_attribute * attr, const char * name, locus * where)
{
if (attr->use_assoc == 0)
@@ -465,17 +473,21 @@ check_used (symbol_attribute * attr, locus * where)
if (where == NULL)
where = &gfc_current_locus;
- gfc_error ("Cannot change attributes of USE-associated symbol at %L",
- where);
+ if (name == NULL)
+ gfc_error ("Cannot change attributes of USE-associated symbol at %L",
+ where);
+ else
+ gfc_error ("Cannot change attributes of USE-associated symbol %s at %L",
+ name, where);
return 1;
}
/* Used to prevent changing the attributes of a symbol after it has been
- used. This check is only done from dummy variable as only these can be
+ used. This check is only done for dummy variables as only these can be
used in specification expressions. Applying this to all symbols causes
- error when we reach the body of a contained function. */
+ an error when we reach the body of a contained function. */
static int
check_done (symbol_attribute * attr, locus * where)
@@ -511,7 +523,7 @@ try
gfc_add_allocatable (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
if (attr->allocatable)
@@ -521,15 +533,15 @@ gfc_add_allocatable (symbol_attribute * attr, locus * where)
}
attr->allocatable = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
try
-gfc_add_dimension (symbol_attribute * attr, locus * where)
+gfc_add_dimension (symbol_attribute * attr, const char *name, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, name, where) || check_done (attr, where))
return FAILURE;
if (attr->dimension)
@@ -539,7 +551,7 @@ gfc_add_dimension (symbol_attribute * attr, locus * where)
}
attr->dimension = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
@@ -547,7 +559,7 @@ try
gfc_add_external (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
if (attr->external)
@@ -558,7 +570,7 @@ gfc_add_external (symbol_attribute * attr, locus * where)
attr->external = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
@@ -566,7 +578,7 @@ try
gfc_add_intrinsic (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
if (attr->intrinsic)
@@ -577,7 +589,7 @@ gfc_add_intrinsic (symbol_attribute * attr, locus * where)
attr->intrinsic = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
@@ -585,7 +597,7 @@ try
gfc_add_optional (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
if (attr->optional)
@@ -595,7 +607,7 @@ gfc_add_optional (symbol_attribute * attr, locus * where)
}
attr->optional = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
@@ -603,31 +615,31 @@ try
gfc_add_pointer (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
attr->pointer = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
try
-gfc_add_result (symbol_attribute * attr, locus * where)
+gfc_add_result (symbol_attribute * attr, const char *name, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, name, where) || check_done (attr, where))
return FAILURE;
attr->result = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_save (symbol_attribute * attr, locus * where)
+gfc_add_save (symbol_attribute * attr, const char *name, locus * where)
{
- if (check_used (attr, where))
+ if (check_used (attr, name, where))
return FAILURE;
if (gfc_pure (NULL))
@@ -645,7 +657,7 @@ gfc_add_save (symbol_attribute * attr, locus * where)
}
attr->save = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
@@ -653,7 +665,7 @@ try
gfc_add_target (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
if (attr->target)
@@ -663,72 +675,73 @@ gfc_add_target (symbol_attribute * attr, locus * where)
}
attr->target = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
try
-gfc_add_dummy (symbol_attribute * attr, locus * where)
+gfc_add_dummy (symbol_attribute * attr, const char *name, locus * where)
{
- if (check_used (attr, where))
+ if (check_used (attr, name, where))
return FAILURE;
- /* Duplicate dummy arguments are allow due to ENTRY statements. */
+ /* Duplicate dummy arguments are allowed due to ENTRY statements. */
attr->dummy = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_in_common (symbol_attribute * attr, locus * where)
+gfc_add_in_common (symbol_attribute * attr, const char *name, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, name, where) || check_done (attr, where))
return FAILURE;
/* Duplicate attribute already checked for. */
attr->in_common = 1;
- if (check_conflict (attr, where) == FAILURE)
+ if (check_conflict (attr, name, where) == FAILURE)
return FAILURE;
if (attr->flavor == FL_VARIABLE)
return SUCCESS;
- return gfc_add_flavor (attr, FL_VARIABLE, where);
+ return gfc_add_flavor (attr, FL_VARIABLE, name, where);
}
try
-gfc_add_data (symbol_attribute *attr, locus *where)
+gfc_add_data (symbol_attribute *attr, const char *name, locus *where)
{
- if (check_used (attr, where))
+ if (check_used (attr, name, where))
return FAILURE;
attr->data = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_in_namelist (symbol_attribute * attr, locus * where)
+gfc_add_in_namelist (symbol_attribute * attr, const char *name,
+ locus * where)
{
attr->in_namelist = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_sequence (symbol_attribute * attr, locus * where)
+gfc_add_sequence (symbol_attribute * attr, const char *name, locus * where)
{
- if (check_used (attr, where))
+ if (check_used (attr, name, where))
return FAILURE;
attr->sequence = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
@@ -736,11 +749,11 @@ try
gfc_add_elemental (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
attr->elemental = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
@@ -748,11 +761,11 @@ try
gfc_add_pure (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
attr->pure = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
@@ -760,19 +773,19 @@ try
gfc_add_recursive (symbol_attribute * attr, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, NULL, where) || check_done (attr, where))
return FAILURE;
attr->recursive = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
try
-gfc_add_entry (symbol_attribute * attr, locus * where)
+gfc_add_entry (symbol_attribute * attr, const char *name, locus * where)
{
- if (check_used (attr, where))
+ if (check_used (attr, name, where))
return FAILURE;
if (attr->entry)
@@ -782,59 +795,60 @@ gfc_add_entry (symbol_attribute * attr, locus * where)
}
attr->entry = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_function (symbol_attribute * attr, locus * where)
+gfc_add_function (symbol_attribute * attr, const char *name, locus * where)
{
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, where) == FAILURE)
+ && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
return FAILURE;
attr->function = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_subroutine (symbol_attribute * attr, locus * where)
+gfc_add_subroutine (symbol_attribute * attr, const char *name, locus * where)
{
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, where) == FAILURE)
+ && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
return FAILURE;
attr->subroutine = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_generic (symbol_attribute * attr, locus * where)
+gfc_add_generic (symbol_attribute * attr, const char *name, locus * where)
{
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, where) == FAILURE)
+ && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
return FAILURE;
attr->generic = 1;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
-/* Flavors are special because some flavors are not what fortran
+/* Flavors are special because some flavors are not what Fortran
considers attributes and can be reaffirmed multiple times. */
try
-gfc_add_flavor (symbol_attribute * attr, sym_flavor f, locus * where)
+gfc_add_flavor (symbol_attribute * attr, sym_flavor f, const char *name,
+ locus * where)
{
if ((f == FL_PROGRAM || f == FL_BLOCK_DATA || f == FL_MODULE
|| f == FL_PARAMETER || f == FL_LABEL || f == FL_DERIVED
- || f == FL_NAMELIST) && check_used (attr, where))
+ || f == FL_NAMELIST) && check_used (attr, name, where))
return FAILURE;
if (attr->flavor == f && f == FL_VARIABLE)
@@ -854,19 +868,20 @@ gfc_add_flavor (symbol_attribute * attr, sym_flavor f, locus * where)
attr->flavor = f;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
try
-gfc_add_procedure (symbol_attribute * attr, procedure_type t, locus * where)
+gfc_add_procedure (symbol_attribute * attr, procedure_type t,
+ const char *name, locus * where)
{
- if (check_used (attr, where) || check_done (attr, where))
+ if (check_used (attr, name, where) || check_done (attr, where))
return FAILURE;
if (attr->flavor != FL_PROCEDURE
- && gfc_add_flavor (attr, FL_PROCEDURE, where) == FAILURE)
+ && gfc_add_flavor (attr, FL_PROCEDURE, name, where) == FAILURE)
return FAILURE;
if (where == NULL)
@@ -886,11 +901,11 @@ gfc_add_procedure (symbol_attribute * attr, procedure_type t, locus * where)
/* Statement functions are always scalar and functions. */
if (t == PROC_ST_FUNCTION
- && ((!attr->function && gfc_add_function (attr, where) == FAILURE)
+ && ((!attr->function && gfc_add_function (attr, name, where) == FAILURE)
|| attr->dimension))
return FAILURE;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
@@ -898,13 +913,13 @@ try
gfc_add_intent (symbol_attribute * attr, sym_intent intent, locus * where)
{
- if (check_used (attr, where))
+ if (check_used (attr, NULL, where))
return FAILURE;
if (attr->intent == INTENT_UNKNOWN)
{
attr->intent = intent;
- return check_conflict (attr, where);
+ return check_conflict (attr, NULL, where);
}
if (where == NULL)
@@ -921,13 +936,14 @@ gfc_add_intent (symbol_attribute * attr, sym_intent intent, locus * where)
/* No checks for use-association in public and private statements. */
try
-gfc_add_access (symbol_attribute * attr, gfc_access access, locus * where)
+gfc_add_access (symbol_attribute * attr, gfc_access access,
+ const char *name, locus * where)
{
if (attr->access == ACCESS_UNKNOWN)
{
attr->access = access;
- return check_conflict (attr, where);
+ return check_conflict (attr, name, where);
}
if (where == NULL)
@@ -943,7 +959,7 @@ gfc_add_explicit_interface (gfc_symbol * sym, ifsrc source,
gfc_formal_arglist * formal, locus * where)
{
- if (check_used (&sym->attr, where))
+ if (check_used (&sym->attr, sym->name, where))
return FAILURE;
if (where == NULL)
@@ -1033,37 +1049,37 @@ gfc_copy_attr (symbol_attribute * dest, symbol_attribute * src, locus * where)
if (src->allocatable && gfc_add_allocatable (dest, where) == FAILURE)
goto fail;
- if (src->dimension && gfc_add_dimension (dest, where) == FAILURE)
+ if (src->dimension && gfc_add_dimension (dest, NULL, where) == FAILURE)
goto fail;
if (src->optional && gfc_add_optional (dest, where) == FAILURE)
goto fail;
if (src->pointer && gfc_add_pointer (dest, where) == FAILURE)
goto fail;
- if (src->save && gfc_add_save (dest, where) == FAILURE)
+ if (src->save && gfc_add_save (dest, NULL, where) == FAILURE)
goto fail;
if (src->target && gfc_add_target (dest, where) == FAILURE)
goto fail;
- if (src->dummy && gfc_add_dummy (dest, where) == FAILURE)
+ if (src->dummy && gfc_add_dummy (dest, NULL, where) == FAILURE)
goto fail;
- if (src->result && gfc_add_result (dest, where) == FAILURE)
+ if (src->result && gfc_add_result (dest, NULL, where) == FAILURE)
goto fail;
if (src->entry)
dest->entry = 1;
- if (src->in_namelist && gfc_add_in_namelist (dest, where) == FAILURE)
+ if (src->in_namelist && gfc_add_in_namelist (dest, NULL, where) == FAILURE)
goto fail;
- if (src->in_common && gfc_add_in_common (dest, where) == FAILURE)
+ if (src->in_common && gfc_add_in_common (dest, NULL, where) == FAILURE)
goto fail;
- if (src->generic && gfc_add_generic (dest, where) == FAILURE)
+ if (src->generic && gfc_add_generic (dest, NULL, where) == FAILURE)
goto fail;
- if (src->function && gfc_add_function (dest, where) == FAILURE)
+ if (src->function && gfc_add_function (dest, NULL, where) == FAILURE)
goto fail;
- if (src->subroutine && gfc_add_subroutine (dest, where) == FAILURE)
+ if (src->subroutine && gfc_add_subroutine (dest, NULL, where) == FAILURE)
goto fail;
- if (src->sequence && gfc_add_sequence (dest, where) == FAILURE)
+ if (src->sequence && gfc_add_sequence (dest, NULL, where) == FAILURE)
goto fail;
if (src->elemental && gfc_add_elemental (dest, where) == FAILURE)
goto fail;
@@ -1073,7 +1089,7 @@ gfc_copy_attr (symbol_attribute * dest, symbol_attribute * src, locus * where)
goto fail;
if (src->flavor != FL_UNKNOWN
- && gfc_add_flavor (dest, src->flavor, where) == FAILURE)
+ && gfc_add_flavor (dest, src->flavor, NULL, where) == FAILURE)
goto fail;
if (src->intent != INTENT_UNKNOWN
@@ -1081,14 +1097,14 @@ gfc_copy_attr (symbol_attribute * dest, symbol_attribute * src, locus * where)
goto fail;
if (src->access != ACCESS_UNKNOWN
- && gfc_add_access (dest, src->access, where) == FAILURE)
+ && gfc_add_access (dest, src->access, NULL, where) == FAILURE)
goto fail;
if (gfc_missing_attr (dest, where) == FAILURE)
goto fail;
/* The subroutines that set these bits also cause flavors to be set,
- and that has already happened in the original, so don't let to
+ and that has already happened in the original, so don't let it
happen again. */
if (src->external)
dest->external = 1;
@@ -1133,7 +1149,7 @@ gfc_add_component (gfc_symbol * sym, const char *name, gfc_component ** componen
tail = p;
}
- /* Allocate new component */
+ /* Allocate a new component. */
p = gfc_get_component ();
if (tail == NULL)
@@ -1141,7 +1157,7 @@ gfc_add_component (gfc_symbol * sym, const char *name, gfc_component ** componen
else
tail->next = p;
- strcpy (p->name, name);
+ p->name = gfc_get_string (name);
p->loc = gfc_current_locus;
*component = p;
@@ -1180,21 +1196,24 @@ switch_types (gfc_symtree * st, gfc_symbol * from, gfc_symbol * to)
have to have a derived type in a parent unit. We find the node in
the other namespace and point the symtree node in this namespace to
that node. Further reference to this name point to the correct
- node. If we can't find the node in a parent namespace, then have
+ node. If we can't find the node in a parent namespace, then we have
an error.
This subroutine takes a pointer to a symbol node and returns a
pointer to the translated node or NULL for an error. Usually there
is no translation and we return the node we were passed. */
-static gfc_symtree *
-gfc_use_ha_derived (gfc_symbol * sym)
+gfc_symbol *
+gfc_use_derived (gfc_symbol * sym)
{
gfc_symbol *s, *p;
gfc_typespec *t;
gfc_symtree *st;
int i;
+ if (sym->components != NULL)
+ return sym; /* Already defined. */
+
if (sym->ns->parent == NULL)
goto bad;
@@ -1237,7 +1256,7 @@ gfc_use_ha_derived (gfc_symbol * sym)
namelists, common lists and interface lists. */
gfc_free_symbol (sym);
- return st;
+ return s;
bad:
gfc_error ("Derived type '%s' at %C is being used before it is defined",
@@ -1246,22 +1265,6 @@ bad:
}
-gfc_symbol *
-gfc_use_derived (gfc_symbol * sym)
-{
- gfc_symtree *st;
-
- if (sym->components != NULL)
- return sym; /* Already defined */
-
- st = gfc_use_ha_derived (sym);
- if (st)
- return st->n.sym;
- else
- return NULL;
-}
-
-
/* Given a derived type node and a component name, try to locate the
component structure. Returns the NULL pointer if the component is
not found or the components are private. */
@@ -1520,7 +1523,7 @@ done:
the internal subprograms must be read before we can start
generating code for the host.
- Given the tricky nature of the fortran grammar, we must be able to
+ Given the tricky nature of the Fortran grammar, we must be able to
undo changes made to a symbol table if the current interpretation
of a statement is found to be incorrect. Whenever a symbol is
looked up, we make a copy of it and link to it. All of these
@@ -1531,10 +1534,11 @@ done:
this case, that symbol has been used as a host associated variable
at some previous time. */
-/* Allocate a new namespace structure. */
+/* Allocate a new namespace structure. Copies the implicit types from
+ PARENT if PARENT_TYPES is set. */
gfc_namespace *
-gfc_get_namespace (gfc_namespace * parent)
+gfc_get_namespace (gfc_namespace * parent, int parent_types)
{
gfc_namespace *ns;
gfc_typespec *ts;
@@ -1556,7 +1560,7 @@ gfc_get_namespace (gfc_namespace * parent)
ns->set_flag[i - 'a'] = 0;
ts = &ns->default_type[i - 'a'];
- if (ns->parent != NULL)
+ if (parent_types && ns->parent != NULL)
{
/* Copy parent settings */
*ts = ns->parent->default_type[i - 'a'];
@@ -1609,7 +1613,7 @@ gfc_new_symtree (gfc_symtree ** root, const char *name)
gfc_symtree *st;
st = gfc_getmem (sizeof (gfc_symtree));
- strcpy (st->name, name);
+ st->name = gfc_get_string (name);
gfc_insert_bbt (root, st, compare_symtree);
return st;
@@ -1625,7 +1629,7 @@ delete_symtree (gfc_symtree ** root, const char *name)
st0 = gfc_find_symtree (*root, name);
- strcpy (st.name, name);
+ st.name = gfc_get_string (name);
gfc_delete_bbt (root, &st, compare_symtree);
gfc_free (st0);
@@ -1670,7 +1674,7 @@ gfc_get_uop (const char *name)
st = gfc_new_symtree (&gfc_current_ns->uop_root, name);
uop = st->n.uop = gfc_getmem (sizeof (gfc_user_op));
- strcpy (uop->name, name);
+ uop->name = gfc_get_string (name);
uop->access = ACCESS_UNKNOWN;
uop->ns = gfc_current_ns;
@@ -1739,7 +1743,7 @@ gfc_new_symbol (const char *name, gfc_namespace * ns)
if (strlen (name) > GFC_MAX_SYMBOL_LEN)
gfc_internal_error ("new_symbol(): Symbol name too long");
- strcpy (p->name, name);
+ p->name = gfc_get_string (name);
return p;
}
@@ -1750,7 +1754,7 @@ static void
ambiguous_symbol (const char *name, gfc_symtree * st)
{
- if (st->n.sym->module[0])
+ if (st->n.sym->module)
gfc_error ("Name '%s' at %C is an ambiguous reference to '%s' "
"from module '%s'", name, st->n.sym->name, st->n.sym->module);
else
@@ -2243,7 +2247,7 @@ void
gfc_symbol_init_2 (void)
{
- gfc_current_ns = gfc_get_namespace (NULL);
+ gfc_current_ns = gfc_get_namespace (NULL, 0);
}
@@ -2326,7 +2330,7 @@ save_symbol (gfc_symbol * sym)
|| sym->attr.flavor != FL_VARIABLE)
return;
- gfc_add_save (&sym->attr, &sym->declared_at);
+ gfc_add_save (&sym->attr, sym->name, &sym->declared_at);
}
@@ -2358,7 +2362,7 @@ gfc_symbol_state(void) {
/* Search a tree for the global symbol. */
gfc_gsymbol *
-gfc_find_gsymbol (gfc_gsymbol *symbol, char *name)
+gfc_find_gsymbol (gfc_gsymbol *symbol, const char *name)
{
gfc_gsymbol *s;
@@ -2395,7 +2399,7 @@ gsym_compare (void * _s1, void * _s2)
/* Get a global symbol, creating it if it doesn't exist. */
gfc_gsymbol *
-gfc_get_gsymbol (char *name)
+gfc_get_gsymbol (const char *name)
{
gfc_gsymbol *s;
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index e281619741d..a97bcc593a3 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1271,7 +1271,7 @@ gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base)
/* Also the data pointer. */
tmp = gfc_conv_array_data (se.expr);
/* If this is a variable or address of a variable we use it directly.
- Otherwise we must evaluate it now to to avoid break dependency
+ Otherwise we must evaluate it now to avoid breaking dependency
analysis by pulling the expressions for elemental array indices
inside the loop. */
if (!(DECL_P (tmp)
@@ -3071,7 +3071,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
gcc_assert (!sym->attr.use_assoc);
gcc_assert (!TREE_STATIC (decl));
- gcc_assert (!sym->module[0]);
+ gcc_assert (!sym->module);
if (sym->ts.type == BT_CHARACTER
&& !INTEGER_CST_P (sym->ts.cl->backend_decl))
@@ -4194,18 +4194,18 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr)
gfc_ss *head2;
gfc_ss *newss;
- head = gfc_walk_subexpr (ss, expr->op1);
- if (expr->op2 == NULL)
+ head = gfc_walk_subexpr (ss, expr->value.op.op1);
+ if (expr->value.op.op2 == NULL)
head2 = head;
else
- head2 = gfc_walk_subexpr (head, expr->op2);
+ head2 = gfc_walk_subexpr (head, expr->value.op.op2);
/* All operands are scalar. Pass back and let the caller deal with it. */
if (head2 == ss)
return head2;
/* All operands require scalarization. */
- if (head != ss && (expr->op2 == NULL || head2 != head))
+ if (head != ss && (expr->value.op.op2 == NULL || head2 != head))
return head2;
/* One of the operands needs scalarization, the other is scalar.
@@ -4223,7 +4223,7 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr)
gcc_assert (head);
newss->next = ss;
head->next = newss;
- newss->expr = expr->op1;
+ newss->expr = expr->value.op.op1;
}
else /* head2 == head */
{
@@ -4231,7 +4231,7 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr)
/* Second operand is scalar. */
newss->next = head2;
head2 = newss;
- newss->expr = expr->op2;
+ newss->expr = expr->value.op.op2;
}
return head2;
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 6a6e1395f10..35ea8012034 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -288,7 +288,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
/* Create a namespace to store symbols for common blocks. */
if (gfc_common_ns == NULL)
- gfc_common_ns = gfc_get_namespace (NULL);
+ gfc_common_ns = gfc_get_namespace (NULL, 0);
gfc_get_symbol (com->name, gfc_common_ns, &common_sym);
decl = common_sym->backend_decl;
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 6567695ad29..b81b9862207 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -272,7 +272,7 @@ gfc_sym_mangled_identifier (gfc_symbol * sym)
{
char name[GFC_MAX_MANGLED_SYMBOL_LEN + 1];
- if (sym->module[0] == 0)
+ if (sym->module == NULL)
return gfc_sym_identifier (sym);
else
{
@@ -290,8 +290,8 @@ gfc_sym_mangled_function_id (gfc_symbol * sym)
int has_underscore;
char name[GFC_MAX_MANGLED_SYMBOL_LEN + 1];
- if (sym->module[0] == 0 || sym->attr.proc == PROC_EXTERNAL
- || (sym->module[0] != 0 && sym->attr.if_source == IFSRC_IFBODY))
+ if (sym->module == NULL || sym->attr.proc == PROC_EXTERNAL
+ || (sym->module != NULL && sym->attr.if_source == IFSRC_IFBODY))
{
if (strcmp (sym->name, "MAIN__") == 0
|| sym->attr.proc == PROC_INTRINSIC)
@@ -404,7 +404,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
}
- else if (sym->module[0] && !sym->attr.result && !sym->attr.dummy)
+ else if (sym->module && !sym->attr.result && !sym->attr.dummy)
{
/* TODO: Don't set sym->module for result or dummy variables. */
gcc_assert (current_function_decl == NULL_TREE);
@@ -766,7 +766,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
/* Symbols from modules should have their assembler names mangled.
This is done here rather than in gfc_finish_var_decl because it
is different for string length variables. */
- if (sym->module[0])
+ if (sym->module)
SET_DECL_ASSEMBLER_NAME (decl, gfc_sym_mangled_identifier (sym));
if (sym->attr.dimension)
@@ -808,7 +808,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
{
char name[GFC_MAX_MANGLED_SYMBOL_LEN + 2];
- if (sym->module[0])
+ if (sym->module)
{
/* Also prefix the mangled name for symbols from modules. */
strcpy (&name[1], sym->name);
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 494faa44135..685a9f97f9e 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -414,7 +414,7 @@ gfc_conv_unary_op (enum tree_code code, gfc_se * se, gfc_expr * expr)
gcc_assert (expr->ts.type != BT_CHARACTER);
/* Initialize the operand. */
gfc_init_se (&operand, se);
- gfc_conv_expr_val (&operand, expr->op1);
+ gfc_conv_expr_val (&operand, expr->value.op.op1);
gfc_add_block_to_block (&se->pre, &operand.pre);
type = gfc_typenode_for_spec (&expr->ts);
@@ -607,25 +607,25 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
tree tmp;
gfc_init_se (&lse, se);
- gfc_conv_expr_val (&lse, expr->op1);
+ gfc_conv_expr_val (&lse, expr->value.op.op1);
gfc_add_block_to_block (&se->pre, &lse.pre);
gfc_init_se (&rse, se);
- gfc_conv_expr_val (&rse, expr->op2);
+ gfc_conv_expr_val (&rse, expr->value.op.op2);
gfc_add_block_to_block (&se->pre, &rse.pre);
- if (expr->op2->ts.type == BT_INTEGER
- && expr->op2->expr_type == EXPR_CONSTANT)
+ if (expr->value.op.op2->ts.type == BT_INTEGER
+ && expr->value.op.op2->expr_type == EXPR_CONSTANT)
if (gfc_conv_cst_int_power (se, lse.expr, rse.expr))
return;
gfc_int4_type_node = gfc_get_int_type (4);
- kind = expr->op1->ts.kind;
- switch (expr->op2->ts.type)
+ kind = expr->value.op.op1->ts.kind;
+ switch (expr->value.op.op2->ts.type)
{
case BT_INTEGER:
- ikind = expr->op2->ts.kind;
+ ikind = expr->value.op.op2->ts.kind;
switch (ikind)
{
case 1:
@@ -648,7 +648,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
{
case 1:
case 2:
- if (expr->op1->ts.type == BT_INTEGER)
+ if (expr->value.op.op1->ts.type == BT_INTEGER)
lse.expr = convert (gfc_int4_type_node, lse.expr);
else
gcc_unreachable ();
@@ -666,7 +666,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
gcc_unreachable ();
}
- switch (expr->op1->ts.type)
+ switch (expr->value.op.op1->ts.type)
{
case BT_INTEGER:
fndecl = gfor_fndecl_math_powi[kind][ikind].integer;
@@ -780,14 +780,14 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr)
tree args;
tree tmp;
- gcc_assert (expr->op1->ts.type == BT_CHARACTER
- && expr->op2->ts.type == BT_CHARACTER);
+ gcc_assert (expr->value.op.op1->ts.type == BT_CHARACTER
+ && expr->value.op.op2->ts.type == BT_CHARACTER);
gfc_init_se (&lse, se);
- gfc_conv_expr (&lse, expr->op1);
+ gfc_conv_expr (&lse, expr->value.op.op1);
gfc_conv_string_parameter (&lse);
gfc_init_se (&rse, se);
- gfc_conv_expr (&rse, expr->op2);
+ gfc_conv_expr (&rse, expr->value.op.op2);
gfc_conv_string_parameter (&rse);
gfc_add_block_to_block (&se->pre, &lse.pre);
@@ -846,10 +846,10 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
checkstring = 0;
lop = 0;
- switch (expr->operator)
+ switch (expr->value.op.operator)
{
case INTRINSIC_UPLUS:
- gfc_conv_expr (se, expr->op1);
+ gfc_conv_expr (se, expr->value.op.op1);
return;
case INTRINSIC_UMINUS:
@@ -951,19 +951,19 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr)
}
/* The only exception to this is **, which is handled separately anyway. */
- gcc_assert (expr->op1->ts.type == expr->op2->ts.type);
+ gcc_assert (expr->value.op.op1->ts.type == expr->value.op.op2->ts.type);
- if (checkstring && expr->op1->ts.type != BT_CHARACTER)
+ if (checkstring && expr->value.op.op1->ts.type != BT_CHARACTER)
checkstring = 0;
/* lhs */
gfc_init_se (&lse, se);
- gfc_conv_expr (&lse, expr->op1);
+ gfc_conv_expr (&lse, expr->value.op.op1);
gfc_add_block_to_block (&se->pre, &lse.pre);
/* rhs */
gfc_init_se (&rse, se);
- gfc_conv_expr (&rse, expr->op2);
+ gfc_conv_expr (&rse, expr->value.op.op2);
gfc_add_block_to_block (&se->pre, &rse.pre);
/* For string comparisons we generate a library call, and compare the return
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index b5ef13f5e16..26f05f1e9fb 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -816,7 +816,7 @@ gfc_trans_inquire (gfc_code * code)
static gfc_expr *
-gfc_new_nml_name_expr (char * name)
+gfc_new_nml_name_expr (const char * name)
{
gfc_expr * nml_name;
nml_name = gfc_get_expr();
@@ -825,7 +825,8 @@ gfc_new_nml_name_expr (char * name)
nml_name->ts.kind = gfc_default_character_kind;
nml_name->ts.type = BT_CHARACTER;
nml_name->value.character.length = strlen(name);
- nml_name->value.character.string = name;
+ nml_name->value.character.string = gfc_getmem (strlen (name) + 1);
+ strcpy (nml_name->value.character.string, name);
return nml_name;
}
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 7a55cbc48c9..da074c8b454 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -1578,10 +1578,8 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size,
/* Form the mask expression according to the mask tree list. */
if (wheremask)
{
- tmp2 = wheremask;
- if (tmp2 != NULL)
- wheremaskexpr = gfc_build_array_ref (tmp2, count3);
- tmp2 = TREE_CHAIN (tmp2);
+ wheremaskexpr = gfc_build_array_ref (wheremask, count3);
+ tmp2 = TREE_CHAIN (wheremask);
while (tmp2)
{
tmp1 = gfc_build_array_ref (tmp2, count3);
@@ -1684,10 +1682,8 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree size,
/* Form the mask expression according to the mask tree list. */
if (wheremask)
{
- tmp2 = wheremask;
- if (tmp2 != NULL)
- wheremaskexpr = gfc_build_array_ref (tmp2, count3);
- tmp2 = TREE_CHAIN (tmp2);
+ wheremaskexpr = gfc_build_array_ref (wheremask, count3);
+ tmp2 = TREE_CHAIN (wheremask);
while (tmp2)
{
tmp1 = gfc_build_array_ref (tmp2, count3);
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index b670f7a3888..f16e23ccff5 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -118,7 +118,7 @@ typedef enum
scalarization loop. */
GFC_SS_SCALAR,
- /* Like GFC_SS_SCALAR except it evaluates a pointer the the expression.
+ /* Like GFC_SS_SCALAR except it evaluates a pointer to the expression.
Used for elemental function parameters. */
GFC_SS_REFERENCE,
diff --git a/gcc/function.h b/gcc/function.h
index f760075c638..ef0f55a4c38 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -284,12 +284,20 @@ struct function GTY(())
int no_debugging_symbols;
rtvec original_arg_vector;
tree original_decl_initial;
+
/* Highest label number in current function. */
int inl_max_label_num;
/* Function sequence number for profiling, debugging, etc. */
int funcdef_no;
+ /* For flow.c. */
+
+ /* Highest loop depth seen so far in loop analysis. Used in flow.c
+ for the "failure strategy" when doing liveness analysis starting
+ with non-empty initial sets. */
+ int max_loop_depth;
+
/* For md files. */
/* tm.h can use this to store whatever it likes. */
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a9eec5a7200..1a9cc5005d6 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -473,8 +473,6 @@ or with constant text in a single argument.
%l process LINK_SPEC as a spec.
%L process LIB_SPEC as a spec.
%G process LIBGCC_SPEC as a spec.
- %M output multilib_dir with directory separators replaced with "_";
- if multilib_dir is not set or is ".", output "".
%S process STARTFILE_SPEC as a spec. A capital S is actually used here.
%E process ENDFILE_SPEC as a spec. A capital E is actually used here.
%C process CPP_SPEC as a spec.
@@ -622,7 +620,7 @@ proper position among the other output files. */
#ifndef LIBGCC_SPEC
#if defined(REAL_LIBGCC_SPEC)
#define LIBGCC_SPEC REAL_LIBGCC_SPEC
-#elif defined(LINK_LIBGCC_SPECIAL) || defined(LINK_LIBGCC_SPECIAL_1)
+#elif defined(LINK_LIBGCC_SPECIAL_1)
/* Have gcc do the search for libgcc.a. */
#define LIBGCC_SPEC "libgcc.a%s"
#else
@@ -708,13 +706,8 @@ proper position among the other output files. */
#endif
#ifndef LINK_LIBGCC_SPEC
-# ifdef LINK_LIBGCC_SPECIAL
-/* Don't generate -L options for startfile prefix list. */
-# define LINK_LIBGCC_SPEC ""
-# else
-/* Do generate them. */
-# define LINK_LIBGCC_SPEC "%D"
-# endif
+/* Generate -L options for startfile prefix list. */
+# define LINK_LIBGCC_SPEC "%D"
#endif
#ifndef STARTFILE_PREFIX_SPEC
@@ -1704,11 +1697,7 @@ init_spec (void)
if (in_sep && *p == '-' && strncmp (p, "-lgcc", 5) == 0)
{
init_gcc_specs (&obstack,
-#ifdef NO_SHARED_LIBGCC_MULTILIB
"-lgcc_s"
-#else
- "-lgcc_s%M"
-#endif
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
@@ -1732,12 +1721,7 @@ init_spec (void)
/* Ug. We don't know shared library extensions. Hope that
systems that use this form don't do shared libraries. */
init_gcc_specs (&obstack,
-#ifdef NO_SHARED_LIBGCC_MULTILIB
- "-lgcc_s"
-#else
- "-lgcc_s%M"
-#endif
- ,
+ "-lgcc_s",
"libgcc.a%s",
"libgcc_eh.a%s"
#ifdef USE_LIBUNWIND_EXCEPTIONS
@@ -5078,23 +5062,6 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
return value;
break;
- case 'M':
- if (multilib_dir && strcmp (multilib_dir, ".") != 0)
- {
- char *p;
- const char *q;
- size_t len;
-
- len = strlen (multilib_dir);
- obstack_blank (&obstack, len + 1);
- p = obstack_next_free (&obstack) - (len + 1);
-
- *p++ = '_';
- for (q = multilib_dir; *q ; ++q, ++p)
- *p = (IS_DIR_SEPARATOR (*q) ? '_' : *q);
- }
- break;
-
case 'R':
/* We assume there is a directory
separator at the end of this string. */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 5535aa121a7..456a857259f 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -264,19 +264,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
the result of the expression is copied to a new register, and the redundant
expression is deleted by replacing it with this new register. Classic GCSE
doesn't have this problem as much as it computes the reaching defs of
- each register in each block and thus can try to use an existing register.
-
- **********************
-
- A fair bit of simplicity is created by creating small functions for simple
- tasks, even when the function is only called in one place. This may
- measurably slow things down [or may not] by creating more function call
- overhead than is necessary. The source is laid out so that it's trivial
- to make the affected functions inline so that one can measure what speed
- up, if any, can be achieved, and maybe later when things settle things can
- be rearranged.
-
- Help stamp out big monolithic functions! */
+ each register in each block and thus can try to use an existing
+ register. */
/* GCSE global vars. */
@@ -500,7 +489,10 @@ static bitmap modify_mem_list_set;
/* This array parallels modify_mem_list, but is kept canonicalized. */
static rtx * canon_modify_mem_list;
-static bitmap canon_modify_mem_list_set;
+
+/* Bitmap indexed by block numbers to record which blocks contain
+ function calls. */
+static bitmap blocks_with_calls;
/* Various variables for statistics gathering. */
@@ -959,7 +951,7 @@ alloc_gcse_mem (rtx f)
CUID_INSN (i++) = insn;
/* Allocate vars to track sets of regs. */
- reg_set_bitmap = BITMAP_XMALLOC ();
+ reg_set_bitmap = BITMAP_ALLOC (NULL);
/* Allocate vars to track sets of regs, memory per block. */
reg_set_in_block = sbitmap_vector_alloc (last_basic_block, max_gcse_regno);
@@ -967,8 +959,8 @@ alloc_gcse_mem (rtx f)
basic block. */
modify_mem_list = gcalloc (last_basic_block, sizeof (rtx));
canon_modify_mem_list = gcalloc (last_basic_block, sizeof (rtx));
- modify_mem_list_set = BITMAP_XMALLOC ();
- canon_modify_mem_list_set = BITMAP_XMALLOC ();
+ modify_mem_list_set = BITMAP_ALLOC (NULL);
+ blocks_with_calls = BITMAP_ALLOC (NULL);
}
/* Free memory allocated by alloc_gcse_mem. */
@@ -979,12 +971,12 @@ free_gcse_mem (void)
free (uid_cuid);
free (cuid_insn);
- BITMAP_XFREE (reg_set_bitmap);
+ BITMAP_FREE (reg_set_bitmap);
sbitmap_vector_free (reg_set_in_block);
free_modify_mem_tables ();
- BITMAP_XFREE (modify_mem_list_set);
- BITMAP_XFREE (canon_modify_mem_list_set);
+ BITMAP_FREE (modify_mem_list_set);
+ BITMAP_FREE (blocks_with_calls);
}
/* Compute the local properties of each recorded expression.
@@ -1951,7 +1943,6 @@ canon_list_insert (rtx dest ATTRIBUTE_UNUSED, rtx unused1 ATTRIBUTE_UNUSED,
alloc_EXPR_LIST (VOIDmode, dest_addr, canon_modify_mem_list[bb]);
canon_modify_mem_list[bb] =
alloc_EXPR_LIST (VOIDmode, dest, canon_modify_mem_list[bb]);
- bitmap_set_bit (canon_modify_mem_list_set, bb);
}
/* Record memory modification information for INSN. We do not actually care
@@ -1975,7 +1966,7 @@ record_last_mem_set_info (rtx insn)
need to insert a pair of items, as canon_list_insert does. */
canon_modify_mem_list[bb] =
alloc_INSN_LIST (insn, canon_modify_mem_list[bb]);
- bitmap_set_bit (canon_modify_mem_list_set, bb);
+ bitmap_set_bit (blocks_with_calls, bb);
}
else
note_stores (PATTERN (insn), canon_list_insert, (void*) insn);
@@ -2199,17 +2190,13 @@ clear_modify_mem_tables (void)
EXECUTE_IF_SET_IN_BITMAP (modify_mem_list_set, 0, i, bi)
{
free_INSN_LIST_list (modify_mem_list + i);
- }
- bitmap_clear (modify_mem_list_set);
-
- EXECUTE_IF_SET_IN_BITMAP (canon_modify_mem_list_set, 0, i, bi)
- {
free_insn_expr_list_list (canon_modify_mem_list + i);
}
- bitmap_clear (canon_modify_mem_list_set);
+ bitmap_clear (modify_mem_list_set);
+ bitmap_clear (blocks_with_calls);
}
-/* Release memory used by modify_mem_list_set and canon_modify_mem_list_set. */
+/* Release memory used by modify_mem_list_set. */
static void
free_modify_mem_tables (void)
@@ -2470,41 +2457,51 @@ compute_transp (rtx x, int indx, sbitmap *bmap, int set_p)
return;
case MEM:
- FOR_EACH_BB (bb)
- {
- rtx list_entry = canon_modify_mem_list[bb->index];
+ {
+ bitmap_iterator bi;
+ unsigned bb_index;
- while (list_entry)
- {
- rtx dest, dest_addr;
+ /* First handle all the blocks with calls. We don't need to
+ do any list walking for them. */
+ EXECUTE_IF_SET_IN_BITMAP (blocks_with_calls, 0, bb_index, bi)
+ {
+ if (set_p)
+ SET_BIT (bmap[bb_index], indx);
+ else
+ RESET_BIT (bmap[bb_index], indx);
+ }
- if (CALL_P (XEXP (list_entry, 0)))
- {
- if (set_p)
- SET_BIT (bmap[bb->index], indx);
- else
- RESET_BIT (bmap[bb->index], indx);
- break;
- }
- /* LIST_ENTRY must be an INSN of some kind that sets memory.
- Examine each hunk of memory that is modified. */
+ /* Now iterate over the blocks which have memory modifications
+ but which do not have any calls. */
+ EXECUTE_IF_AND_COMPL_IN_BITMAP (modify_mem_list_set, blocks_with_calls,
+ 0, bb_index, bi)
+ {
+ rtx list_entry = canon_modify_mem_list[bb_index];
- dest = XEXP (list_entry, 0);
- list_entry = XEXP (list_entry, 1);
- dest_addr = XEXP (list_entry, 0);
+ while (list_entry)
+ {
+ rtx dest, dest_addr;
- if (canon_true_dependence (dest, GET_MODE (dest), dest_addr,
- x, rtx_addr_varies_p))
- {
- if (set_p)
- SET_BIT (bmap[bb->index], indx);
- else
- RESET_BIT (bmap[bb->index], indx);
- break;
- }
- list_entry = XEXP (list_entry, 1);
- }
- }
+ /* LIST_ENTRY must be an INSN of some kind that sets memory.
+ Examine each hunk of memory that is modified. */
+
+ dest = XEXP (list_entry, 0);
+ list_entry = XEXP (list_entry, 1);
+ dest_addr = XEXP (list_entry, 0);
+
+ if (canon_true_dependence (dest, GET_MODE (dest), dest_addr,
+ x, rtx_addr_varies_p))
+ {
+ if (set_p)
+ SET_BIT (bmap[bb_index], indx);
+ else
+ RESET_BIT (bmap[bb_index], indx);
+ break;
+ }
+ list_entry = XEXP (list_entry, 1);
+ }
+ }
+ }
x = XEXP (x, 0);
goto repeat;
@@ -4133,7 +4130,7 @@ pre_edge_insert (struct edge_list *edge_list, struct expr **index_map)
if (! occr->deleted_p)
continue;
- /* Insert this expression on this edge if if it would
+ /* Insert this expression on this edge if it would
reach the deleted occurrence in BB. */
if (!TEST_BIT (inserted[e], j))
{
@@ -5849,7 +5846,7 @@ find_loads (rtx x, rtx store_pattern, int after)
/* Check if INSN kills the store pattern X (is aliased with it).
AFTER is true if we are checking the case when store X occurs
- after the insn. Return true if it it does. */
+ after the insn. Return true if it does. */
static bool
store_killed_in_insn (rtx x, rtx x_regs, rtx insn, int after)
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index 64dde93ed8e..e54cbbdaece 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -1,5 +1,6 @@
/* Pipeline hazard description translator.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Vladimir Makarov <vmakarov@redhat.com>
@@ -8969,9 +8970,8 @@ output_get_cpu_unit_code_func (void)
int i;
unit_decl_t *units;
- fprintf (output_file, "int\n%s (%s)\n\tconst char *%s;\n",
- GET_CPU_UNIT_CODE_FUNC_NAME, CPU_UNIT_NAME_PARAMETER_NAME,
- CPU_UNIT_NAME_PARAMETER_NAME);
+ fprintf (output_file, "int\n%s (const char *%s)\n",
+ GET_CPU_UNIT_CODE_FUNC_NAME, CPU_UNIT_NAME_PARAMETER_NAME);
fprintf (output_file, "{\n struct %s {const char *%s; int %s;};\n",
NAME_CODE_STRUCT_NAME, NAME_MEMBER_NAME, CODE_MEMBER_NAME);
fprintf (output_file, " int %s, %s, %s, %s;\n", CMP_VARIABLE_NAME,
@@ -9018,9 +9018,9 @@ output_cpu_unit_reservation_p (void)
{
automaton_t automaton;
- fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\tint %s;\n",
- CPU_UNIT_RESERVATION_P_FUNC_NAME, STATE_NAME,
- CPU_CODE_PARAMETER_NAME, STATE_TYPE_NAME, STATE_NAME,
+ fprintf (output_file, "int\n%s (%s %s, int %s)\n",
+ CPU_UNIT_RESERVATION_P_FUNC_NAME,
+ STATE_TYPE_NAME, STATE_NAME,
CPU_CODE_PARAMETER_NAME);
fprintf (output_file, "{\n gcc_assert (%s >= 0 && %s < %d);\n",
CPU_CODE_PARAMETER_NAME, CPU_CODE_PARAMETER_NAME,
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
index e2872eeffa4..096af89a8e3 100644
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -1,6 +1,6 @@
/* -*- indented-text -*- */
/* Process source files and output type information.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -272,8 +272,6 @@ ITYPE {IWORD}({WS}{IWORD})*
^"%{" { BEGIN(in_yacc_escape); } /* } */
-^"@@".* /* Used for c-parse.in C/ObjC demarcation. */
-
{WS} { update_lineno (yytext, yyleng); }
"const"/[^[:alnum:]_] /* don't care */
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index ad2c880ee51..e3de8225949 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -367,7 +367,9 @@ enum insn_note {
NOTE_INSN_MAX
};
-static const char *const note_insn_name[NOTE_INSN_MAX] = {
+/* We must allocate one more entry here, as we use NOTE_INSN_MAX as the
+ default field for line number notes. */
+static const char *const note_insn_name[NOTE_INSN_MAX+1] = {
#define DEF_INSN_NOTE(NAME) #NAME,
#include "insn-notes.def"
#undef DEF_INSN_NOTE
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index f56f13c9a01..e52ca068984 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -133,6 +133,7 @@ static const char * const optabs[] =
"exp10_optab->handlers[$A].insn_code = CODE_FOR_$(exp10$a2$)",
"exp2_optab->handlers[$A].insn_code = CODE_FOR_$(exp2$a2$)",
"expm1_optab->handlers[$A].insn_code = CODE_FOR_$(expm1$a2$)",
+ "ldexp_optab->handlers[$A].insn_code = CODE_FOR_$(ldexp$a3$)",
"logb_optab->handlers[$A].insn_code = CODE_FOR_$(logb$a2$)",
"ilogb_optab->handlers[$A].insn_code = CODE_FOR_$(ilogb$a2$)",
"log_optab->handlers[$A].insn_code = CODE_FOR_$(log$a2$)",
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index 874925de998..30fd3899bca 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -2,7 +2,7 @@
- prototype declarations for operand predicates (tm-preds.h)
- function definitions of operand predicates, if defined new-style
(insn-preds.c)
- Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -167,7 +167,7 @@ mark_mode_tests (rtx exp)
struct pred_data *p = lookup_predicate (XSTR (exp, 1));
if (!p)
error ("reference to undefined predicate '%s'", XSTR (exp, 1));
- else if (p->special)
+ else if (p->special || GET_MODE (exp) != VOIDmode)
NO_MODE_TEST (exp) = 1;
}
break;
@@ -366,7 +366,10 @@ write_predicate_expr (const char *name, rtx exp)
break;
case MATCH_OPERAND:
- printf ("%s (op, mode)", XSTR (exp, 1));
+ if (GET_MODE (exp) == VOIDmode)
+ printf ("%s (op, mode)", XSTR (exp, 1));
+ else
+ printf ("%s (op, %smode)", XSTR (exp, 1), mode_name[GET_MODE (exp)]);
break;
case MATCH_CODE:
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 131731f1e7e..dd879fa55cb 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -2218,8 +2218,7 @@ ggc_pch_write_object (struct ggc_pch_data *d ATTRIBUTE_UNUSED,
/* To speed small writes, we use a nulled-out array that's larger
than most padding requests as the source for our null bytes. This
permits us to do the padding with fwrite() rather than fseek(), and
- limits the chance the the OS may try to flush any outstanding
- writes. */
+ limits the chance the OS may try to flush any outstanding writes. */
if (padding <= sizeof(emptyBytes))
{
if (fwrite (emptyBytes, 1, padding, f) != padding)
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 6e60aebea76..f3e70ee716d 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -291,15 +291,16 @@ try_catch_may_fallthru (tree stmt)
return false;
case EH_FILTER_EXPR:
- /* If the exception does not match EH_FILTER_TYPES, we will
- execute EH_FILTER_FAILURE, and we will fall through if that
- falls through. If the exception does match EH_FILTER_TYPES,
- we will fall through. We don't know which exceptions may be
- generated, so we just check for EH_FILTER_TYPES being NULL,
- in which case we know that that the exception does not
- match. */
- return (EH_FILTER_TYPES (tsi_stmt (i)) != NULL
- || block_may_fallthru (EH_FILTER_FAILURE (tsi_stmt (i))));
+ /* The exception filter expression only matters if there is an
+ exception. If the exception does not match EH_FILTER_TYPES,
+ we will execute EH_FILTER_FAILURE, and we will fall through
+ if that falls through. If the exception does match
+ EH_FILTER_TYPES, the stack unwinder will continue up the
+ stack, so we will not fall through. We don't know whether we
+ will throw an exception which matches EH_FILTER_TYPES or not,
+ so we just ignore EH_FILTER_TYPES and assume that we might
+ throw an exception which doesn't match. */
+ return block_may_fallthru (EH_FILTER_FAILURE (tsi_stmt (i)));
default:
/* This case represents statements to be executed when an
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 0fd39436325..d461d776ee8 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1433,8 +1433,15 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
VARRAY_GENERIC_PTR_NOGC_INIT (stack, 10, "stack");
/* We can handle anything that get_inner_reference can deal with. */
- for (p = expr_p; handled_component_p (*p); p = &TREE_OPERAND (*p, 0))
- VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p);
+ for (p = expr_p; ; p = &TREE_OPERAND (*p, 0))
+ {
+ /* Fold INDIRECT_REFs now to turn them into ARRAY_REFs. */
+ if (TREE_CODE (*p) == INDIRECT_REF)
+ *p = fold_indirect_ref (*p);
+ if (!handled_component_p (*p))
+ break;
+ VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p);
+ }
gcc_assert (VARRAY_ACTIVE_SIZE (stack));
@@ -2845,16 +2852,10 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p,
This kind of code arises in C++ when an object is bound
to a const reference, and if "x" is a TARGET_EXPR we want
to take advantage of the optimization below. */
- tree pointer;
-
- pointer = TREE_OPERAND (*from_p, 0);
- STRIP_NOPS (pointer);
- if (TREE_CODE (pointer) == ADDR_EXPR
- && (lang_hooks.types_compatible_p
- (TREE_TYPE (TREE_OPERAND (pointer, 0)),
- TREE_TYPE (*from_p))))
+ tree t = fold_indirect_ref (*from_p);
+ if (t != *from_p)
{
- *from_p = TREE_OPERAND (pointer, 0);
+ *from_p = t;
ret = GS_OK;
}
else
@@ -3544,7 +3545,7 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
ret = GS_OK;
if (TREE_CODE (init) == BIND_EXPR)
gimplify_bind_expr (&init, temp, pre_p);
- if (init != temp)
+ if (init != temp)
{
init = build (MODIFY_EXPR, void_type_node, temp, init);
ret = gimplify_expr (&init, pre_p, post_p, is_gimple_stmt,
@@ -3795,9 +3796,13 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
recalculate_side_effects (*expr_p);
break;
+ case INDIRECT_REF:
+ *expr_p = fold_indirect_ref (*expr_p);
+ if (*expr_p != save_expr)
+ break;
+ /* else fall through. */
case ALIGN_INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
- case INDIRECT_REF:
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_reg, fb_rvalue);
recalculate_side_effects (*expr_p);
diff --git a/gcc/global.c b/gcc/global.c
index 35fec4a4392..edf974291b9 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -1,6 +1,6 @@
/* Allocate registers for pseudo-registers that span basic blocks.
Copyright (C) 1987, 1988, 1991, 1994, 1996, 1997, 1998,
- 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -2033,21 +2033,21 @@ allocate_bb_info (void)
bitmap init;
alloc_aux_for_blocks (sizeof (struct bb_info));
- init = BITMAP_XMALLOC ();
+ init = BITMAP_ALLOC (NULL);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
bitmap_set_bit (init, i);
FOR_EACH_BB (bb)
{
bb_info = bb->aux;
- bb_info->earlyclobber = BITMAP_XMALLOC ();
- bb_info->avloc = BITMAP_XMALLOC ();
- bb_info->killed = BITMAP_XMALLOC ();
- bb_info->live_pavin = BITMAP_XMALLOC ();
- bb_info->live_pavout = BITMAP_XMALLOC ();
+ bb_info->earlyclobber = BITMAP_ALLOC (NULL);
+ bb_info->avloc = BITMAP_ALLOC (NULL);
+ bb_info->killed = BITMAP_ALLOC (NULL);
+ bb_info->live_pavin = BITMAP_ALLOC (NULL);
+ bb_info->live_pavout = BITMAP_ALLOC (NULL);
bitmap_copy (bb_info->live_pavin, init);
bitmap_copy (bb_info->live_pavout, init);
}
- BITMAP_XFREE (init);
+ BITMAP_FREE (init);
}
/* The function frees the allocated info of all basic blocks. */
@@ -2061,11 +2061,11 @@ free_bb_info (void)
FOR_EACH_BB (bb)
{
bb_info = BB_INFO (bb);
- BITMAP_XFREE (bb_info->live_pavout);
- BITMAP_XFREE (bb_info->live_pavin);
- BITMAP_XFREE (bb_info->killed);
- BITMAP_XFREE (bb_info->avloc);
- BITMAP_XFREE (bb_info->earlyclobber);
+ BITMAP_FREE (bb_info->live_pavout);
+ BITMAP_FREE (bb_info->live_pavin);
+ BITMAP_FREE (bb_info->killed);
+ BITMAP_FREE (bb_info->avloc);
+ BITMAP_FREE (bb_info->earlyclobber);
}
free_aux_for_blocks ();
}
@@ -2297,7 +2297,7 @@ calculate_reg_pav (void)
VARRAY_BB_INIT (bbs, n_basic_blocks, "basic blocks");
VARRAY_BB_INIT (new_bbs, n_basic_blocks, "basic blocks for the next iter.");
- temp_bitmap = BITMAP_XMALLOC ();
+ temp_bitmap = BITMAP_ALLOC (NULL);
FOR_EACH_BB (bb)
{
VARRAY_PUSH_BB (bbs, bb);
@@ -2351,7 +2351,7 @@ calculate_reg_pav (void)
VARRAY_POP_ALL (new_bbs);
}
sbitmap_free (wset);
- BITMAP_XFREE (temp_bitmap);
+ BITMAP_FREE (temp_bitmap);
}
/* The function modifies partial availability information for two
@@ -2373,7 +2373,7 @@ modify_reg_pav (void)
CLEAR_HARD_REG_SET (stack_hard_regs);
for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
SET_HARD_REG_BIT(stack_hard_regs, i);
- stack_regs = BITMAP_XMALLOC ();
+ stack_regs = BITMAP_ALLOC (NULL);
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
{
COPY_HARD_REG_SET (used, reg_class_contents[reg_preferred_class (i)]);
@@ -2405,7 +2405,7 @@ modify_reg_pav (void)
#endif
}
#ifdef STACK_REGS
- BITMAP_XFREE (stack_regs);
+ BITMAP_FREE (stack_regs);
#endif
}
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 9b3ed5e8eff..6a2ac54691f 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1,6 +1,6 @@
/* Instruction scheduling pass.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com)
@@ -2052,6 +2052,12 @@ schedule_block (int b, int rgn_n_insns)
if (cost >= 1)
{
queue_insn (insn, cost);
+ if (SCHED_GROUP_P (insn))
+ {
+ advance = cost;
+ break;
+ }
+
continue;
}
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index de29b7b926e..5f9cd4a9227 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,75 @@
+2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ PR libgcj/16923
+ * gcj.texi (Invocation): Add descriptions of JvVMInitArgs and
+ JvVMOption.
+
+2005-02-22 Tom Tromey <tromey@redhat.com>
+
+ PR java/20056:
+ * verify-impl.c (EITHER): New define.
+ (types_compatible): Handle it.
+ (check_field_constant): Use it.
+
+2005-02-18 Tom Tromey <tromey@redhat.com>
+
+ PR java/20056:
+ * verify-impl.c (types_equal): Fixed test.
+
+ PR java/20056:
+ * verify-glue.c (vfy_class_has_field): New function.
+ * verify.h (vfy_class_has_field): Declare.
+ * verify-impl.c (check_field_constant): Added 'putfield'
+ argument.
+ (verify_instructions_0): Updated.
+ (types_equal): New function.
+
+2005-02-14 Tom Tromey <tromey@redhat.com>
+
+ PR java/19921:
+ * jcf-write.c (generate_bytecode_insns) <CALL_EXPR>: Note the
+ stack effect of multianewarray.
+
+2005-02-14 Andrew Haley <aph@redhat.com>
+
+ PR java/19907
+ * expr.c (expand_byte_code): Call promote_arguments().
+ (promote_arguments): New function.
+ * decl.c (check_local_unnamed_variable): Remve special case for
+ new verifier.
+ (find_local_variable): Promote all boolean types to int
+ when searching for local variable decls.
+
+2005-02-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * builtins.c, java-except.h, jcf-parse.c, jv-scan.c, lex.c,
+ parse-scan.y: Update copyright.
+
+2005-02-11 Per Bothner <per@bothner.com>
+
+ PR java/15543
+ * parse-scan.y (input_location): Remove variable.
+ (main_input_filename): New - replaces input_filename, which isn't
+ settable if USE_MAPPED_LOCATION.
+ * lex.c (java_init_lex): Wrap some more places in #ifndef JC1-LITE,
+ so we don't reference input_location or wfl_operator in that case.
+ * jv-scan.c (expand_location): Remove - no longer used.
+ (main): Set main_input_filename rather than input_filename.
+
+2005-02-09 Richard Henderson <rth@redhat.com>
+
+ * builtins.c (initialize_builtins): Call build_common_builtin_nodes.
+ * decl.c (java_init_decl_processing): Initialize const_ptr_type_node.
+
+2005-02-08 Marcin Dalecki <martin@dalecki.de>
+
+ * expr.c (add_type_assertion): Use the proper enumeration type,
+ since this is what htab_find_slot() is expecting.
+
+2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
+
+ * gcj.texi: Update copyright dates.
+
2005-02-02 Tom Tromey <tromey@redhat.com>
* gcj.texi (libgcj Runtime Properties): Default library_control
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index 8230036aa7f..f4a8efb2a1b 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -1,5 +1,5 @@
/* Built-in and inline functions for gcj
- Copyright (C) 2001, 2003, 2004
+ Copyright (C) 2001, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -216,6 +216,8 @@ initialize_builtins (void)
double_ftype_double, "_ZN4java4lang4Math4sqrtEd");
define_builtin (BUILT_IN_TAN, "__builtin_tan",
double_ftype_double, "_ZN4java4lang4Math3tanEd");
+
+ build_common_builtin_nodes ();
}
/* If the call matches a builtin, return the
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 1343ebfe3f0..b7aa61650d3 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -263,24 +263,14 @@ check_local_unnamed_variable (tree best, tree decl, tree type)
initially held a pointer arg -- or vice versa -- we create a
new VAR_DECL.
- ???: As long as verification is correct, this will be a
+ ???: As long as verification is correct, this will be a
compatible type. But maybe we should create a dummy variable
and replace all references to it with the DECL and a
- NOP_EXPR.
+ NOP_EXPR.
*/
|| (TREE_CODE (decl_type) == POINTER_TYPE
&& TREE_CODE (decl) == PARM_DECL
- && TREE_CODE (type) == POINTER_TYPE)
-
- /* The new verifier requires a similar treatment in the
- situation where the parameter has an integral type which
- promotes to `int'. */
- || (flag_new_verifier
- && TREE_CODE (decl) == PARM_DECL
- && INTEGRAL_TYPE_P (decl_type)
- && TYPE_PRECISION (decl_type) <= 32
- && INTEGRAL_TYPE_P (type)
- && TYPE_PRECISION (type) <= 32))
+ && TREE_CODE (type) == POINTER_TYPE))
{
if (best == NULL_TREE
|| (decl_type == type && TREE_TYPE (best) != type))
@@ -312,6 +302,16 @@ find_local_variable (int index, tree type, int pc ATTRIBUTE_UNUSED)
tmp = DECL_LOCAL_SLOT_CHAIN (tmp);
}
+ /* gcj has a function called promote_type(), which is used by both
+ the bytecode compiler and the source compiler. Unfortunately,
+ the type systems for the Java VM and the Java language are not
+ the same: a boolean in the VM promotes to an int, not to a wide
+ boolean. If our caller wants something to hold a boolean, that
+ had better be an int, because that slot might be re-used
+ later in integer context. */
+ if (TREE_CODE (type) == BOOLEAN_TYPE)
+ type = integer_type_node;
+
/* If we don't find a match, create one with the type passed in.
The name of the variable is #n#m, which n is the variable index
in the local variable area and m is a dummy identifier for
@@ -692,7 +692,11 @@ java_init_decl_processing (void)
void_type_node = make_node (VOID_TYPE);
pushdecl (build_decl (TYPE_DECL, get_identifier ("void"), void_type_node));
layout_type (void_type_node); /* Uses size_zero_node */
+
ptr_type_node = build_pointer_type (void_type_node);
+ const_ptr_type_node
+ = build_pointer_type (build_type_variant (void_type_node, 1, 0));
+
t = make_node (VOID_TYPE);
layout_type (t); /* Uses size_zero_node */
return_address_type_node = build_pointer_type (t);
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 626b9bcadd2..7d515052ba0 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -86,6 +86,7 @@ static void java_stack_pop (int);
static tree build_java_throw_out_of_bounds_exception (tree);
static tree build_java_check_indexed_type (tree, tree);
static unsigned char peek_opcode_at_pc (struct JCF *, int, int);
+static void promote_arguments (void);
static GTY(()) tree operand_type[59];
@@ -458,7 +459,7 @@ add_type_assertion (tree class, int assertion_code, tree op1, tree op2)
as.op1 = op1;
as.op2 = op2;
- as_pp = htab_find_slot (assertions_htab, &as, true);
+ as_pp = htab_find_slot (assertions_htab, &as, INSERT);
/* Don't add the same assertion twice. */
if (*as_pp)
@@ -2961,6 +2962,8 @@ expand_byte_code (JCF *jcf, tree method)
return;
}
+ promote_arguments ();
+
/* Translate bytecodes. */
linenumber_pointer = linenumber_table;
for (PC = 0; PC < length;)
@@ -3643,4 +3646,28 @@ build_java_empty_stmt (void)
return t;
}
+/* Promote all args of integral type before generating any code. */
+
+static void
+promote_arguments (void)
+{
+ int i;
+ tree arg;
+ for (arg = DECL_ARGUMENTS (current_function_decl), i = 0;
+ arg != NULL_TREE; arg = TREE_CHAIN (arg), i++)
+ {
+ tree arg_type = TREE_TYPE (arg);
+ if (INTEGRAL_TYPE_P (arg_type)
+ && TYPE_PRECISION (arg_type) < 32)
+ {
+ tree copy = find_local_variable (i, integer_type_node, -1);
+ java_add_stmt (build2 (MODIFY_EXPR, integer_type_node,
+ copy,
+ fold_convert (integer_type_node, arg)));
+ }
+ if (TYPE_IS_WIDE (arg_type))
+ i++;
+ }
+}
+
#include "gt-java-expr.h"
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index 0bf50bd5fcf..b270b6fbbcf 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -10,7 +10,7 @@
@c the word ``Java'.
@c When this manual is copyrighted.
-@set copyrights-gcj 2001, 2002
+@set copyrights-gcj 2001, 2002, 2003, 2004, 2005
@c Versions
@set which-gcj GCC-@value{version-GCC}
@@ -2110,7 +2110,8 @@ CNI permits C++ applications to make calls into Java classes, in addition to
allowing Java code to call into C++. Several functions, known as the
@dfn{invocation API}, are provided to support this.
-@deftypefun jint JvCreateJavaVM (void* @var{vm_args})
+@deftypefun jint JvCreateJavaVM (JvVMInitArgs* @var{vm_args})
+
Initializes the Java runtime. This function performs essential initialization
of the threads interface, garbage collector, exception handling and other key
aspects of the runtime. It must be called once by an application with
@@ -2119,11 +2120,40 @@ It is safe, but not recommended, to call @code{JvCreateJavaVM()} more than
once provided it is only called from a single thread.
The @var{vmargs} parameter can be used to specify initialization parameters
for the Java runtime. It may be @code{NULL}.
-This function returns @code{0} upon success, or @code{-1} if the runtime is
-already initialized.
-@emph{Note:} In GCJ 3.1, the @code{vm_args} parameter is ignored. It may be
-used in a future release.
+JvVMInitArgs represents a list of virtual machine initialization
+arguments. @code{JvCreateJavaVM()} ignores the version field.
+
+@example
+typedef struct JvVMOption
+@{
+ // a VM initialization option
+ char* optionString;
+ // extra information associated with this option
+ void* extraInfo;
+@} JvVMOption;
+
+typedef struct JvVMInitArgs
+@{
+ // for compatibility with JavaVMInitArgs
+ jint version;
+
+ // number of VM initialization options
+ jint nOptions;
+
+ // an array of VM initialization options
+ JvVMOption* options;
+
+ // true if the option parser should ignore unrecognized options
+ jboolean ignoreUnrecognized;
+@} JvVMInitArgs;
+@end example
+
+@code{JvCreateJavaVM()} returns @code{0} upon success, or @code{-1} if
+the runtime is already initialized.
+
+@emph{Note:} In GCJ 3.1, the @code{vm_args} parameter is ignored. It
+is recognized and used as of release 4.0.
@end deftypefun
@deftypefun java::lang::Thread* JvAttachCurrentThread (jstring @var{name}, java::lang::ThreadGroup* @var{group})
diff --git a/gcc/java/java-except.h b/gcc/java/java-except.h
index e09f21dfde8..a45e650ffb8 100644
--- a/gcc/java/java-except.h
+++ b/gcc/java/java-except.h
@@ -1,6 +1,7 @@
/* Definitions for exception handling for use by the GNU compiler
for the Java(TM) language compiler.
- Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 50a75054cb1..3a4c780e77a 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -1,5 +1,5 @@
/* Parser for Java(TM) .class files.
- Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 603eaa51ee9..87790408d13 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2572,6 +2572,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
OP1 (OPCODE_multianewarray);
OP2 (index);
OP1 (ndims);
+ NOTE_POP (ndims - 1);
break;
}
else if (f == soft_anewarray_node)
diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c
index 5f90ee93392..a3726fd2ff9 100644
--- a/gcc/java/jv-scan.c
+++ b/gcc/java/jv-scan.c
@@ -1,5 +1,5 @@
/* Main for jv-scan
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
@@ -131,29 +131,6 @@ version (void)
exit (0);
}
-#ifdef USE_MAPPED_LOCATION
-/* FIXME - this is the same as the function in tree.c, which is awkward.
- Probably the cleanest solution is to move the function to line-map.c.
- This is difficult as long as we still support --disable-mapped-location,
- since whether expanded_location has a column fields depends on
- USE_MAPPED_LOCATION. */
-
-expanded_location
-expand_location (source_location loc)
-{
- expanded_location xloc;
- if (loc == 0) { xloc.file = NULL; xloc.line = 0; xloc.column = 0; }
- else
- {
- const struct line_map *map = linemap_lookup (&line_table, loc);
- xloc.file = map->to_file;
- xloc.line = SOURCE_LINE (map, loc);
- xloc.column = SOURCE_COLUMN (map, loc);
- };
- return xloc;
-}
-#endif
-
/* jc1-lite main entry point */
int
main (int argc, char **argv)
@@ -237,8 +214,7 @@ main (int argc, char **argv)
if (encoding == NULL || *encoding == '\0')
encoding = DEFAULT_ENCODING;
- input_filename = filename;
- input_line = 0;
+ main_input_filename = filename;
java_init_lex (finput, encoding);
ctxp->filename = filename;
yyparse ();
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index 712ffc2c589..b82a307e6ba 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -1,5 +1,5 @@
/* Language lexer for the GNU compiler for the Java(TM) language.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
@@ -108,11 +108,13 @@ java_init_lex (FILE *finput, const char *encoding)
if (!wfl_operator)
{
+#ifndef JC1_LITE
#ifdef USE_MAPPED_LOCATION
wfl_operator = build_expr_wfl (NULL_TREE, input_location);
#else
wfl_operator = build_expr_wfl (NULL_TREE, ctxp->filename, 0, 0);
#endif
+#endif
}
if (!label_id)
label_id = get_identifier ("$L");
@@ -134,7 +136,9 @@ java_init_lex (FILE *finput, const char *encoding)
ctxp->package = NULL_TREE;
#endif
+#ifndef JC1_LITE
ctxp->save_location = input_location;
+#endif
ctxp->java_error_flag = 0;
ctxp->lexer = java_new_lexer (finput, encoding);
}
@@ -1471,7 +1475,6 @@ do_java_lex (YYSTYPE *java_lval)
#ifndef JC1_LITE
java_lval->operator.token = OCB_TK;
java_lval->operator.location = BUILD_LOCATION();
-#endif
#ifdef USE_MAPPED_LOCATION
if (ctxp->ccb_indent == 1)
ctxp->first_ccb_indent1 = input_location;
@@ -1479,14 +1482,14 @@ do_java_lex (YYSTYPE *java_lval)
if (ctxp->ccb_indent == 1)
ctxp->first_ccb_indent1 = input_line;
#endif
+#endif
ctxp->ccb_indent++;
return OCB_TK;
case '}':
+ ctxp->ccb_indent--;
#ifndef JC1_LITE
java_lval->operator.token = CCB_TK;
java_lval->operator.location = BUILD_LOCATION();
-#endif
- ctxp->ccb_indent--;
#ifdef USE_MAPPED_LOCATION
if (ctxp->ccb_indent == 1)
ctxp->last_ccb_indent1 = input_location;
@@ -1494,6 +1497,7 @@ do_java_lex (YYSTYPE *java_lval)
if (ctxp->ccb_indent == 1)
ctxp->last_ccb_indent1 = input_line;
#endif
+#endif
return CCB_TK;
case '[':
BUILD_OPERATOR (OSB_TK);
diff --git a/gcc/java/parse-scan.y b/gcc/java/parse-scan.y
index 189ee728e12..dceacb6cc7f 100644
--- a/gcc/java/parse-scan.y
+++ b/gcc/java/parse-scan.y
@@ -1,5 +1,5 @@
/* Parser grammar for quick source code scan of Java(TM) language programs.
- Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
@@ -42,15 +42,12 @@ definitions and other extensions. */
#include "system.h"
#include "coretypes.h"
#include "tm.h"
-#include "input.h"
#include "obstack.h"
#include "toplev.h"
extern FILE *finput, *out;
-/* Current position in real source file. */
-
-location_t input_location;
+ const char *main_input_filename;
/* Obstack for the lexer. */
struct obstack temporary_obstack;
@@ -1295,7 +1292,7 @@ report_class_declaration (const char * name)
if (!previous_output)
{
if (flag_list_filename)
- fprintf (out, "%s: ", input_filename);
+ fprintf (out, "%s: ", main_input_filename);
previous_output = 1;
}
@@ -1340,7 +1337,7 @@ report (void)
{
extern int flag_complexity;
if (flag_complexity)
- fprintf (out, "%s %d\n", input_filename, complexity);
+ fprintf (out, "%s %d\n", main_input_filename, complexity);
}
/* Reset global status used by the report functions. */
@@ -1357,7 +1354,7 @@ reset_report (void)
void
yyerror (const char *msg ATTRIBUTE_UNUSED)
{
- fprintf (stderr, "%s: %d: %s\n", input_filename, input_line, msg);
+ fprintf (stderr, "%s: %s\n", main_input_filename, msg);
exit (1);
}
diff --git a/gcc/java/verify-glue.c b/gcc/java/verify-glue.c
index b2cd9156cd0..5d480e88d68 100644
--- a/gcc/java/verify-glue.c
+++ b/gcc/java/verify-glue.c
@@ -1,5 +1,5 @@
/* Glue to interface gcj with bytecode verifier.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -385,6 +385,21 @@ vfy_null_type (void)
return TYPE_NULL;
}
+bool
+vfy_class_has_field (vfy_jclass klass, vfy_string name,
+ vfy_string signature)
+{
+ tree field = TYPE_FIELDS (klass);
+ while (field != NULL_TREE)
+ {
+ if (DECL_NAME (field) == name
+ && build_java_signature (TREE_TYPE (field)) == signature)
+ return true;
+ field = TREE_CHAIN (field);
+ }
+ return false;
+}
+
int
vfy_fail (const char *message, int pc, vfy_jclass ignore1 ATTRIBUTE_UNUSED,
vfy_method *ignore2 ATTRIBUTE_UNUSED)
diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c
index ee8f426e5a3..ae585c8d7db 100644
--- a/gcc/java/verify-impl.c
+++ b/gcc/java/verify-impl.c
@@ -539,16 +539,19 @@ struct type
First, when constructing a new object, it is the PC of the
`new' instruction which created the object. We use the special
- value UNINIT to mean that this is uninitialized, and the
- special value SELF for the case where the current method is
- itself the <init> method.
-
+ value UNINIT to mean that this is uninitialized. The special
+ value SELF is used for the case where the current method is
+ itself the <init> method. the special value EITHER is used
+ when we may optionally allow either an uninitialized or
+ initialized reference to match.
+
Second, when the key is return_address_type, this holds the PC
of the instruction following the `jsr'. */
int pc;
- #define UNINIT -2
- #define SELF -1
+#define UNINIT -2
+#define SELF -1
+#define EITHER -3
};
#if 0
@@ -721,23 +724,52 @@ types_compatible (type *t, type *k)
if (k->klass == NULL)
verify_fail ("programmer error in type::compatible");
- /* An initialized type and an uninitialized type are not
- compatible. */
- if (type_initialized (t) != type_initialized (k))
- return false;
-
- /* Two uninitialized objects are compatible if either:
- * The PCs are identical, or
- * One PC is UNINIT. */
- if (type_initialized (t))
+ /* Handle the special 'EITHER' case, which is only used in a
+ special case of 'putfield'. Note that we only need to handle
+ this on the LHS of a check. */
+ if (! type_initialized (t) && t->pc == EITHER)
{
- if (t->pc != k->pc && t->pc != UNINIT && k->pc != UNINIT)
+ /* If the RHS is uninitialized, it must be an uninitialized
+ 'this'. */
+ if (! type_initialized (k) && k->pc != SELF)
return false;
}
+ else if (type_initialized (t) != type_initialized (k))
+ {
+ /* An initialized type and an uninitialized type are not
+ otherwise compatible. */
+ return false;
+ }
+ else
+ {
+ /* Two uninitialized objects are compatible if either:
+ * The PCs are identical, or
+ * One PC is UNINIT. */
+ if (type_initialized (t))
+ {
+ if (t->pc != k->pc && t->pc != UNINIT && k->pc != UNINIT)
+ return false;
+ }
+ }
return ref_compatible (t->klass, k->klass);
}
+/* Return true if two types are equal. Only valid for reference
+ types. */
+static bool
+types_equal (type *t1, type *t2)
+{
+ if ((t1->key != reference_type && t1->key != uninitialized_reference_type)
+ || (t2->key != reference_type
+ && t2->key != uninitialized_reference_type))
+ return false;
+ /* Only single-ref types are allowed. */
+ if (t1->klass->ref_next || t2->klass->ref_next)
+ return false;
+ return refs_equal (t1->klass, t2->klass);
+}
+
static bool
type_isvoid (type *t)
{
@@ -2117,9 +2149,10 @@ handle_field_or_method (int index, int expected,
return check_class_constant (class_index);
}
-/* Return field's type, compute class' type if requested. */
+/* Return field's type, compute class' type if requested. If
+ PUTFIELD is true, use the special 'putfield' semantics. */
static type
-check_field_constant (int index, type *class_type)
+check_field_constant (int index, type *class_type, bool putfield)
{
vfy_string name, field_type;
const char *typec;
@@ -2137,6 +2170,21 @@ check_field_constant (int index, type *class_type)
init_type_from_string (&t, field_type);
else
init_type_from_tag (&t, get_type_val_for_signature (typec[0]));
+
+ /* We have an obscure special case here: we can use `putfield' on a
+ field declared in this class, even if `this' has not yet been
+ initialized. */
+ if (putfield
+ && ! type_initialized (&vfr->current_state->this_type)
+ && vfr->current_state->this_type.pc == SELF
+ && types_equal (&vfr->current_state->this_type, &ct)
+ && vfy_class_has_field (vfr->current_class, name, field_type))
+ /* Note that we don't actually know whether we're going to match
+ against 'this' or some other object of the same type. So,
+ here we set things up so that it doesn't matter. This relies
+ on knowing what our caller is up to. */
+ type_set_uninitialized (class_type, EITHER);
+
return t;
}
@@ -2971,15 +3019,15 @@ verify_instructions_0 (void)
invalidate_pc ();
break;
case op_getstatic:
- push_type_t (check_field_constant (get_ushort (), NULL));
+ push_type_t (check_field_constant (get_ushort (), NULL, false));
break;
case op_putstatic:
- pop_type_t (check_field_constant (get_ushort (), NULL));
+ pop_type_t (check_field_constant (get_ushort (), NULL, false));
break;
case op_getfield:
{
type klass;
- type field = check_field_constant (get_ushort (), &klass);
+ type field = check_field_constant (get_ushort (), &klass, false);
pop_type_t (klass);
push_type_t (field);
}
@@ -2987,15 +3035,8 @@ verify_instructions_0 (void)
case op_putfield:
{
type klass;
- type field = check_field_constant (get_ushort (), &klass);
+ type field = check_field_constant (get_ushort (), &klass, true);
pop_type_t (field);
-
- /* We have an obscure special case here: we can use
- `putfield' on a field declared in this class, even if
- `this' has not yet been initialized. */
- if (! type_initialized (&vfr->current_state->this_type)
- && vfr->current_state->this_type.pc == SELF)
- type_set_uninitialized (&klass, SELF);
pop_type_t (klass);
}
break;
diff --git a/gcc/java/verify.h b/gcc/java/verify.h
index 3553d357960..b23a08a9888 100644
--- a/gcc/java/verify.h
+++ b/gcc/java/verify.h
@@ -1,5 +1,5 @@
/* Declarations to interface gcj with bytecode verifier.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -126,6 +126,8 @@ void vfy_note_stack_type (vfy_method *method, int pc, int slot,
void vfy_note_local_type (vfy_method *method, int pc, int slot,
vfy_jclass type);
void vfy_note_instruction_seen (int pc);
+bool vfy_class_has_field (vfy_jclass klass, vfy_string name,
+ vfy_string signature);
#define GLOM(name, stuff) name ## stuff
#define VFY_PRIMITIVE_CLASS(name) \
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index 40f3ac36883..037be930a43 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -1,5 +1,5 @@
/* Loop transformation code generation
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org>
This file is part of GCC.
@@ -1873,6 +1873,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
tree newupperbound, newlowerbound;
lambda_linear_expression offset;
tree type;
+ bool insert_after;
oldiv = VEC_index (tree, old_ivs, i);
type = TREE_TYPE (oldiv);
@@ -1915,14 +1916,12 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
bsi = bsi_start (bb);
bsi_insert_after (&bsi, stmts, BSI_NEW_STMT);
- /* Create the new iv, and insert it's increment on the latch
- block. */
+ /* Create the new iv. */
- bb = EDGE_PRED (temp->latch, 0)->src;
- bsi = bsi_last (bb);
+ standard_iv_increment_position (temp, &bsi, &insert_after);
create_iv (newlowerbound,
build_int_cst (type, LL_STEP (newloop)),
- ivvar, temp, &bsi, false, &ivvar,
+ ivvar, temp, &bsi, insert_after, &ivvar,
&ivvarinced);
/* Replace the exit condition with the new upper bound
@@ -2297,6 +2296,7 @@ perfect_nestify (struct loops *loops,
basic_block preheaderbb, headerbb, bodybb, latchbb, olddest;
size_t i;
block_stmt_iterator bsi;
+ bool insert_after;
edge e;
struct loop *newloop;
tree phi;
@@ -2314,23 +2314,23 @@ perfect_nestify (struct loops *loops,
preheaderbb = loop_split_edge_with (loop->single_exit, NULL);
headerbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
- /* This is done because otherwise, it will release the ssa_name too early
- when the edge gets redirected and it will get reused, causing the use of
- the phi node to get rewritten. */
-
+ /* Push the exit phi nodes that we are moving. */
for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi))
{
VEC_safe_push (tree, phis, PHI_RESULT (phi));
VEC_safe_push (tree, phis, PHI_ARG_DEF (phi, 0));
- mark_for_rewrite (PHI_RESULT (phi));
}
e = redirect_edge_and_branch (EDGE_SUCC (preheaderbb, 0), headerbb);
- /* Remove the exit phis from the old basic block. */
+ /* Remove the exit phis from the old basic block. Make sure to set
+ PHI_RESULT to null so it doesn't get released. */
while (phi_nodes (olddest) != NULL)
- remove_phi_node (phi_nodes (olddest), NULL, olddest);
+ {
+ SET_PHI_RESULT (phi_nodes (olddest), NULL);
+ remove_phi_node (phi_nodes (olddest), NULL, olddest);
+ }
- /* and add them to the new basic block. */
+ /* and add them back to the new basic block. */
while (VEC_length (tree, phis) != 0)
{
tree def;
@@ -2341,7 +2341,6 @@ perfect_nestify (struct loops *loops,
add_phi_arg (phi, def, EDGE_PRED (preheaderbb, 0));
}
flush_pending_stmts (e);
- unmark_all_for_rewrite ();
bodybb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
latchbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
@@ -2377,10 +2376,10 @@ perfect_nestify (struct loops *loops,
/* Create the new iv. */
ivvar = create_tmp_var (integer_type_node, "perfectiv");
add_referenced_tmp_var (ivvar);
- bsi = bsi_last (EDGE_PRED (newloop->latch, 0)->src);
+ standard_iv_increment_position (newloop, &bsi, &insert_after);
create_iv (VEC_index (tree, lbounds, 0),
build_int_cst (integer_type_node, VEC_index (int, steps, 0)),
- ivvar, newloop, &bsi, false, &ivvar, &ivvarinced);
+ ivvar, newloop, &bsi, insert_after, &ivvar, &ivvarinced);
/* Create the new upper bound. This may be not just a variable, so we copy
it to one just in case. */
@@ -2392,7 +2391,12 @@ perfect_nestify (struct loops *loops,
VEC_index (tree, ubounds, 0));
uboundvar = make_ssa_name (uboundvar, stmt);
TREE_OPERAND (stmt, 0) = uboundvar;
- bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
+
+ if (insert_after)
+ bsi_insert_after (&bsi, stmt, BSI_SAME_STMT);
+ else
+ bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
+
COND_EXPR_COND (exit_condition) = build (GE_EXPR,
boolean_type_node,
uboundvar,
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 59083ad7b56..fc6decaaf85 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -68,6 +68,7 @@ extern bool lhd_decl_ok_for_sibcall (tree);
extern const char *lhd_comdat_group (tree);
extern tree lhd_expr_size (tree);
extern size_t lhd_tree_size (enum tree_code);
+extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
/* Declarations of default tree inlining hooks. */
extern tree lhd_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
@@ -122,6 +123,7 @@ extern int lhd_gimplify_expr (tree *, tree *, tree *);
#define LANG_HOOKS_TREE_SIZE lhd_tree_size
#define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p
#define LANG_HOOKS_BUILTIN_FUNCTION builtin_function
+#define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset
#define LANG_HOOKS_FUNCTION_INIT lhd_do_nothing_f
#define LANG_HOOKS_FUNCTION_FINAL lhd_do_nothing_f
@@ -285,6 +287,7 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_GET_CALLEE_FNDECL, \
LANG_HOOKS_PRINT_ERROR_FUNCTION, \
LANG_HOOKS_EXPR_SIZE, \
+ LANG_HOOKS_TO_TARGET_CHARSET, \
LANG_HOOKS_ATTRIBUTE_TABLE, \
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 0cf31be7806..12119a88fa1 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -1,5 +1,5 @@
/* Default language-specific hooks.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of GCC.
@@ -546,3 +546,9 @@ lhd_make_node (enum tree_code code)
{
return make_node (code);
}
+
+HOST_WIDE_INT
+lhd_to_target_charset (HOST_WIDE_INT c)
+{
+ return c;
+}
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index f57f14821ec..97b8f5e1ce4 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -1,5 +1,5 @@
/* The lang_hooks data structure.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -374,6 +374,15 @@ struct lang_hooks
semantics in cases that it doesn't want to handle specially. */
tree (*expr_size) (tree);
+ /* Convert a character from the host's to the target's character
+ set. The character should be in what C calls the "basic source
+ character set" (roughly, the set of characters defined by plain
+ old ASCII). The default is to return the character unchanged,
+ which is correct in most circumstances. Note that both argument
+ and result should be sign-extended under -fsigned-char,
+ zero-extended under -fno-signed-char. */
+ HOST_WIDE_INT (*to_target_charset) (HOST_WIDE_INT);
+
/* Pointers to machine-independent attribute tables, for front ends
using attribs.c. If one is NULL, it is ignored. Respectively, a
table of attributes specific to the language, a table of
diff --git a/gcc/libada-mk.in b/gcc/libada-mk.in
index 2dd85c9fd54..af722cb0b90 100644
--- a/gcc/libada-mk.in
+++ b/gcc/libada-mk.in
@@ -26,7 +26,7 @@ libdir=@libdir@
gcc_version=@gcc_version@
NOCOMMON_FLAG=@nocommon_flag@
WARN_CFLAGS=@warn_cflags@
-cc_set_by_configure=@cc_set_by_configure@
+cc_set_by_configure=@cc_for_cross_gnattools@
gcc_tmake_file=@tmake_file@
gcc_xmake_file=@xmake_file@
diff --git a/gcc/libgcc-std.ver b/gcc/libgcc-std.ver
index db68ea6ef94..341cf7a481b 100644
--- a/gcc/libgcc-std.ver
+++ b/gcc/libgcc-std.ver
@@ -233,3 +233,22 @@ GCC_3.4.4 {
__negvti2
__subvti3
}
+
+%inherit GCC_4.0.0 GCC_3.4.4
+GCC_4.0.0 {
+ # libgcc2 __builtin_powi helpers.
+ __powisf2
+ __powidf2
+ __powixf2
+ __powitf2
+
+ # c99 compliant complex arithmetic
+ __divsc3
+ __divdc3
+ __divxc3
+ __divtc3
+ __mulsc3
+ __muldc3
+ __mulxc3
+ __multc3
+}
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 1b1455d5d8d..68623c37122 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -1,7 +1,7 @@
/* More subroutines needed by GCC output code on some machines. */
/* Compile this one with gcc. */
/* Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -148,13 +148,12 @@ __subvDI3 (DWtype a, DWtype b)
#endif
#ifdef L_mulvsi3
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
Wtype
__mulvSI3 (Wtype a, Wtype b)
{
const DWtype w = (DWtype) a * (DWtype) b;
- if ((Wtype) (w >> WORD_SIZE) != (Wtype) w >> (WORD_SIZE - 1))
+ if ((Wtype) (w >> W_TYPE_SIZE) != (Wtype) w >> (W_TYPE_SIZE - 1))
abort ();
return w;
@@ -273,7 +272,6 @@ __absvDI2 (DWtype a)
#endif
#ifdef L_mulvdi3
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
DWtype
__mulvDI3 (DWtype u, DWtype v)
{
@@ -282,10 +280,10 @@ __mulvDI3 (DWtype u, DWtype v)
const DWunion uu = {.ll = u};
const DWunion vv = {.ll = v};
- if (__builtin_expect (uu.s.high == uu.s.low >> (WORD_SIZE - 1), 1))
+ if (__builtin_expect (uu.s.high == uu.s.low >> (W_TYPE_SIZE - 1), 1))
{
/* u fits in a single Wtype. */
- if (__builtin_expect (vv.s.high == vv.s.low >> (WORD_SIZE - 1), 1))
+ if (__builtin_expect (vv.s.high == vv.s.low >> (W_TYPE_SIZE - 1), 1))
{
/* v fits in a single Wtype as well. */
/* A single multiplication. No overflow risk. */
@@ -304,7 +302,7 @@ __mulvDI3 (DWtype u, DWtype v)
if (uu.s.low < 0)
w1.ll -= vv.ll;
w1.ll += (UWtype) w0.s.high;
- if (__builtin_expect (w1.s.high == w1.s.low >> (WORD_SIZE - 1), 1))
+ if (__builtin_expect (w1.s.high == w1.s.low >> (W_TYPE_SIZE - 1), 1))
{
w0.s.high = w1.s.low;
return w0.ll;
@@ -313,7 +311,7 @@ __mulvDI3 (DWtype u, DWtype v)
}
else
{
- if (__builtin_expect (vv.s.high == vv.s.low >> (WORD_SIZE - 1), 1))
+ if (__builtin_expect (vv.s.high == vv.s.low >> (W_TYPE_SIZE - 1), 1))
{
/* v fits into a single Wtype. */
/* Two multiplications. */
@@ -327,7 +325,7 @@ __mulvDI3 (DWtype u, DWtype v)
if (vv.s.low < 0)
w1.ll -= uu.ll;
w1.ll += (UWtype) w0.s.high;
- if (__builtin_expect (w1.s.high == w1.s.low >> (WORD_SIZE - 1), 1))
+ if (__builtin_expect (w1.s.high == w1.s.low >> (W_TYPE_SIZE - 1), 1))
{
w0.s.high = w1.s.low;
return w0.ll;
@@ -1157,10 +1155,7 @@ __ucmpdi2 (DWtype a, DWtype b)
}
#endif
-#if defined(L_fixunstfdi) && (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128)
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
+#if defined(L_fixunstfdi) && LIBGCC2_HAS_TF_MODE
DWtype
__fixunstfDI (TFtype a)
{
@@ -1168,11 +1163,11 @@ __fixunstfDI (TFtype a)
return 0;
/* Compute high word of result, as a flonum. */
- const TFtype b = (a / HIGH_WORD_COEFF);
+ const TFtype b = (a / Wtype_MAXp1_F);
/* Convert that to fixed (but not to DWtype!),
and shift it into the high word. */
UDWtype v = (UWtype) b;
- v <<= WORD_SIZE;
+ v <<= W_TYPE_SIZE;
/* Remove high part from the TFtype, leaving the low part as flonum. */
a -= (TFtype)v;
/* Convert that to fixed (but not to DWtype!) and add it in.
@@ -1186,7 +1181,7 @@ __fixunstfDI (TFtype a)
}
#endif
-#if defined(L_fixtfdi) && (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128)
+#if defined(L_fixtfdi) && LIBGCC2_HAS_TF_MODE
DWtype
__fixtfdi (TFtype a)
{
@@ -1196,10 +1191,7 @@ __fixtfdi (TFtype a)
}
#endif
-#if defined(L_fixunsxfdi) && (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80)
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
+#if defined(L_fixunsxfdi) && LIBGCC2_HAS_XF_MODE
DWtype
__fixunsxfDI (XFtype a)
{
@@ -1207,11 +1199,11 @@ __fixunsxfDI (XFtype a)
return 0;
/* Compute high word of result, as a flonum. */
- const XFtype b = (a / HIGH_WORD_COEFF);
+ const XFtype b = (a / Wtype_MAXp1_F);
/* Convert that to fixed (but not to DWtype!),
and shift it into the high word. */
UDWtype v = (UWtype) b;
- v <<= WORD_SIZE;
+ v <<= W_TYPE_SIZE;
/* Remove high part from the XFtype, leaving the low part as flonum. */
a -= (XFtype)v;
/* Convert that to fixed (but not to DWtype!) and add it in.
@@ -1225,7 +1217,7 @@ __fixunsxfDI (XFtype a)
}
#endif
-#if defined(L_fixxfdi) && (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80)
+#if defined(L_fixxfdi) && LIBGCC2_HAS_XF_MODE
DWtype
__fixxfdi (XFtype a)
{
@@ -1235,29 +1227,26 @@ __fixxfdi (XFtype a)
}
#endif
-#ifdef L_fixunsdfdi
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
+#if defined(L_fixunsdfdi) && LIBGCC2_HAS_DF_MODE
DWtype
__fixunsdfDI (DFtype a)
{
/* Get high part of result. The division here will just moves the radix
point and will not cause any rounding. Then the conversion to integral
type chops result as desired. */
- const UWtype hi = a / HIGH_WORD_COEFF;
+ const UWtype hi = a / Wtype_MAXp1_F;
/* Get low part of result. Convert `hi' to floating type and scale it back,
then subtract this from the number being converted. This leaves the low
part. Convert that to integral type. */
- const UWtype lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF);
+ const UWtype lo = a - (DFtype) hi * Wtype_MAXp1_F;
/* Assemble result from the two parts. */
- return ((UDWtype) hi << WORD_SIZE) | lo;
+ return ((UDWtype) hi << W_TYPE_SIZE) | lo;
}
#endif
-#ifdef L_fixdfdi
+#if defined(L_fixdfdi) && LIBGCC2_HAS_DF_MODE
DWtype
__fixdfdi (DFtype a)
{
@@ -1268,29 +1257,66 @@ __fixdfdi (DFtype a)
#endif
#ifdef L_fixunssfdi
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
DWtype
-__fixunssfDI (SFtype original_a)
+__fixunssfDI (SFtype a)
{
+#if LIBGCC2_HAS_DF_MODE
/* Convert the SFtype to a DFtype, because that is surely not going
to lose any bits. Some day someone else can write a faster version
that avoids converting to DFtype, and verify it really works right. */
- const DFtype a = original_a;
+ const DFtype dfa = a;
/* Get high part of result. The division here will just moves the radix
point and will not cause any rounding. Then the conversion to integral
type chops result as desired. */
- const UWtype hi = a / HIGH_WORD_COEFF;
+ const UWtype hi = dfa / Wtype_MAXp1_F;
/* Get low part of result. Convert `hi' to floating type and scale it back,
then subtract this from the number being converted. This leaves the low
part. Convert that to integral type. */
- const UWtype lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF);
+ const UWtype lo = dfa - (DFtype) hi * Wtype_MAXp1_F;
/* Assemble result from the two parts. */
- return ((UDWtype) hi << WORD_SIZE) | lo;
+ return ((UDWtype) hi << W_TYPE_SIZE) | lo;
+#elif FLT_MANT_DIG < W_TYPE_SIZE
+ if (a < 1)
+ return 0;
+ if (a < Wtype_MAXp1_F)
+ return (UWtype)a;
+ if (a < Wtype_MAXp1_F * Wtype_MAXp1_F)
+ {
+ /* Since we know that there are fewer significant bits in the SFmode
+ quantity than in a word, we know that we can convert out all the
+ significant bits in one step, and thus avoid losing bits. */
+
+ /* ??? This following loop essentially performs frexpf. If we could
+ use the real libm function, or poke at the actual bits of the fp
+ format, it would be significantly faster. */
+
+ UWtype shift = 0, counter;
+ SFtype msb;
+
+ a /= Wtype_MAXp1_F;
+ for (counter = W_TYPE_SIZE / 2; counter != 0; counter >>= 1)
+ {
+ SFtype counterf = (UWtype)1 << counter;
+ if (a >= counterf)
+ {
+ shift |= counter;
+ a /= counterf;
+ }
+ }
+
+ /* Rescale into the range of one word, extract the bits of that
+ one word, and shift the result into position. */
+ a *= Wtype_MAXp1_F;
+ counter = a;
+ return (DWtype)counter << shift;
+ }
+ return -1;
+#else
+# error
+#endif
}
#endif
@@ -1304,79 +1330,72 @@ __fixsfdi (SFtype a)
}
#endif
-#if defined(L_floatdixf) && (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80)
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_HALFWORD_COEFF (((UDWtype) 1) << (WORD_SIZE / 2))
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
+#if defined(L_floatdixf) && LIBGCC2_HAS_XF_MODE
XFtype
__floatdixf (DWtype u)
{
- XFtype d = (Wtype) (u >> WORD_SIZE);
- d *= HIGH_HALFWORD_COEFF;
- d *= HIGH_HALFWORD_COEFF;
- d += (UWtype) (u & (HIGH_WORD_COEFF - 1));
-
+ XFtype d = (Wtype) (u >> W_TYPE_SIZE);
+ d *= Wtype_MAXp1_F;
+ d += (UWtype)u;
return d;
}
#endif
-#if defined(L_floatditf) && (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128)
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_HALFWORD_COEFF (((UDWtype) 1) << (WORD_SIZE / 2))
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
+#if defined(L_floatditf) && LIBGCC2_HAS_TF_MODE
TFtype
__floatditf (DWtype u)
{
- TFtype d = (Wtype) (u >> WORD_SIZE);
- d *= HIGH_HALFWORD_COEFF;
- d *= HIGH_HALFWORD_COEFF;
- d += (UWtype) (u & (HIGH_WORD_COEFF - 1));
-
+ TFtype d = (Wtype) (u >> W_TYPE_SIZE);
+ d *= Wtype_MAXp1_F;
+ d += (UWtype)u;
return d;
}
#endif
-#ifdef L_floatdidf
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_HALFWORD_COEFF (((UDWtype) 1) << (WORD_SIZE / 2))
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
+#if defined(L_floatdidf) && LIBGCC2_HAS_DF_MODE
DFtype
__floatdidf (DWtype u)
{
- DFtype d = (Wtype) (u >> WORD_SIZE);
- d *= HIGH_HALFWORD_COEFF;
- d *= HIGH_HALFWORD_COEFF;
- d += (UWtype) (u & (HIGH_WORD_COEFF - 1));
-
+ DFtype d = (Wtype) (u >> W_TYPE_SIZE);
+ d *= Wtype_MAXp1_F;
+ d += (UWtype)u;
return d;
}
#endif
#ifdef L_floatdisf
-#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
-#define HIGH_HALFWORD_COEFF (((UDWtype) 1) << (WORD_SIZE / 2))
-#define HIGH_WORD_COEFF (((UDWtype) 1) << WORD_SIZE)
-
-#define DI_SIZE (sizeof (DWtype) * BITS_PER_UNIT)
-#define DF_SIZE DBL_MANT_DIG
+#define DI_SIZE (W_TYPE_SIZE * 2)
#define SF_SIZE FLT_MANT_DIG
SFtype
__floatdisf (DWtype u)
{
+#if SF_SIZE >= W_TYPE_SIZE
+ /* When the word size is small, we never get any rounding error. */
+ SFtype f = (Wtype) (u >> W_TYPE_SIZE);
+ f *= Wtype_MAXp1_F;
+ f += (UWtype)u;
+ return f;
+#elif LIBGCC2_HAS_DF_MODE
+
+#if LIBGCC2_DOUBLE_TYPE_SIZE == 64
+#define DF_SIZE DBL_MANT_DIG
+#elif LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64
+#define DF_SIZE LDBL_MANT_DIG
+#else
+# error
+#endif
+
+#define REP_BIT ((UDWtype) 1 << (DI_SIZE - DF_SIZE))
+
/* Protect against double-rounding error.
- Represent any low-order bits, that might be truncated in DFmode,
- by a bit that won't be lost. The bit can go in anywhere below the
- rounding position of the SFmode. A fixed mask and bit position
- handles all usual configurations. It doesn't handle the case
- of 128-bit DImode, however. */
+ Represent any low-order bits, that might be truncated by a bit that
+ won't be lost. The bit can go in anywhere below the rounding position
+ of the SFmode. A fixed mask and bit position handles all usual
+ configurations. It doesn't handle the case of 128-bit DImode, however. */
if (DF_SIZE < DI_SIZE
&& DF_SIZE > (DI_SIZE - DF_SIZE + SF_SIZE))
{
-#define REP_BIT ((UDWtype) 1 << (DI_SIZE - DF_SIZE))
if (! (- ((DWtype) 1 << DF_SIZE) < u
&& u < ((DWtype) 1 << DF_SIZE)))
{
@@ -1387,19 +1406,52 @@ __floatdisf (DWtype u)
}
}
}
- /* Do the calculation in DFmode
- so that we don't lose any of the precision of the high word
- while multiplying it. */
- DFtype f = (Wtype) (u >> WORD_SIZE);
- f *= HIGH_HALFWORD_COEFF;
- f *= HIGH_HALFWORD_COEFF;
- f += (UWtype) (u & (HIGH_WORD_COEFF - 1));
+ /* Do the calculation in DFmode so that we don't lose any of the
+ precision of the high word while multiplying it. */
+ DFtype f = (Wtype) (u >> W_TYPE_SIZE);
+ f *= Wtype_MAXp1_F;
+ f += (UWtype)u;
return (SFtype) f;
+#else
+ /* Finally, the word size is larger than the number of bits in SFmode,
+ and we've got no DFmode. The only way to avoid double rounding is
+ to special case the extraction. */
+
+ /* If there are no high bits set, fall back to one conversion. */
+ if ((Wtype)u == u)
+ return (SFtype)(Wtype)u;
+
+ /* Otherwise, find the power of two. */
+ Wtype hi = u >> W_TYPE_SIZE;
+ if (hi < 0)
+ hi = -hi;
+
+ UWtype count, shift;
+ count_leading_zeros (count, hi);
+
+ /* No leading bits means u == minimum. */
+ if (count == 0)
+ return -(Wtype_MAXp1_F * Wtype_MAXp1_F / 2);
+
+ shift = W_TYPE_SIZE - count;
+
+ /* Shift down the most significant bits. */
+ hi = u >> shift;
+
+ /* If we lost any nonzero bits, set the lsb to ensure correct rounding. */
+ if (u & ((1 << shift) - 1))
+ hi |= 1;
+
+ /* Convert the one word of data, and rescale. */
+ SFtype f = hi;
+ f *= (UWtype)1 << shift;
+ return f;
+#endif
}
#endif
-#if defined(L_fixunsxfsi) && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80
+#if defined(L_fixunsxfsi) && LIBGCC2_HAS_XF_MODE
/* Reenable the normal types, in case limits.h needs them. */
#undef char
#undef short
@@ -1421,7 +1473,7 @@ __fixunsxfSI (XFtype a)
}
#endif
-#ifdef L_fixunsdfsi
+#if defined(L_fixunsdfsi) && LIBGCC2_HAS_DF_MODE
/* Reenable the normal types, in case limits.h needs them. */
#undef char
#undef short
@@ -1465,6 +1517,243 @@ __fixunssfSI (SFtype a)
}
#endif
+/* Integer power helper used from __builtin_powi for non-constant
+ exponents. */
+
+#if defined(L_powisf2) \
+ || (defined(L_powidf2) && LIBGCC2_HAS_DF_MODE) \
+ || (defined(L_powixf2) && LIBGCC2_HAS_XF_MODE) \
+ || (defined(L_powitf2) && LIBGCC2_HAS_TF_MODE)
+# if defined(L_powisf2)
+# define TYPE SFtype
+# define NAME __powisf2
+# elif defined(L_powidf2)
+# define TYPE DFtype
+# define NAME __powidf2
+# elif defined(L_powixf2)
+# define TYPE XFtype
+# define NAME __powixf2
+# elif defined(L_powitf2)
+# define TYPE TFtype
+# define NAME __powitf2
+# endif
+
+TYPE
+NAME (TYPE x, Wtype m)
+{
+ UWtype n = m < 0 ? -m : m;
+ TYPE y = n % 2 ? x : 1;
+ while (n >>= 1)
+ {
+ x = x * x;
+ if (n % 2)
+ y = y * x;
+ }
+ return m < 0 ? 1/y : y;
+}
+
+#endif
+
+#if defined(L_mulsc3) || defined(L_divsc3) \
+ || ((defined(L_muldc3) || defined(L_divdc3)) && LIBGCC2_HAS_DF_MODE) \
+ || ((defined(L_mulxc3) || defined(L_divxc3)) && LIBGCC2_HAS_XF_MODE) \
+ || ((defined(L_multc3) || defined(L_divtc3)) && LIBGCC2_HAS_TF_MODE)
+
+#undef float
+#undef double
+#undef long
+
+#if defined(L_mulsc3) || defined(L_divsc3)
+# define MTYPE SFtype
+# define CTYPE SCtype
+# define MODE sc
+# define CEXT f
+# define NOTRUNC __FLT_EVAL_METHOD__ == 0
+#elif defined(L_muldc3) || defined(L_divdc3)
+# define MTYPE DFtype
+# define CTYPE DCtype
+# define MODE dc
+# if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64
+# define CEXT l
+# define NOTRUNC 1
+# else
+# define CEXT
+# define NOTRUNC __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == 1
+# endif
+#elif defined(L_mulxc3) || defined(L_divxc3)
+# define MTYPE XFtype
+# define CTYPE XCtype
+# define MODE xc
+# define CEXT l
+# define NOTRUNC 1
+#elif defined(L_multc3) || defined(L_divtc3)
+# define MTYPE TFtype
+# define CTYPE TCtype
+# define MODE tc
+# define CEXT l
+# define NOTRUNC 1
+#else
+# error
+#endif
+
+#define CONCAT3(A,B,C) _CONCAT3(A,B,C)
+#define _CONCAT3(A,B,C) A##B##C
+
+#define CONCAT2(A,B) _CONCAT2(A,B)
+#define _CONCAT2(A,B) A##B
+
+/* All of these would be present in a full C99 implementation of <math.h>
+ and <complex.h>. Our problem is that only a few systems have such full
+ implementations. Further, libgcc_s.so isn't currently linked against
+ libm.so, and even for systems that do provide full C99, the extra overhead
+ of all programs using libgcc having to link against libm. So avoid it. */
+
+#define isnan(x) __builtin_expect ((x) != (x), 0)
+#define isfinite(x) __builtin_expect (!isnan((x) - (x)), 1)
+#define isinf(x) __builtin_expect (!isnan(x) & !isfinite(x), 0)
+
+#define INFINITY CONCAT2(__builtin_inf, CEXT) ()
+#define I 1i
+
+/* Helpers to make the following code slightly less gross. */
+#define COPYSIGN CONCAT2(__builtin_copysign, CEXT)
+#define FABS CONCAT2(__builtin_fabs, CEXT)
+
+/* Verify that MTYPE matches up with CEXT. */
+extern void *compile_type_assert[sizeof(INFINITY) == sizeof(MTYPE) ? 1 : -1];
+
+/* Ensure that we've lost any extra precision. */
+#if NOTRUNC
+# define TRUNC(x)
+#else
+# define TRUNC(x) __asm__ ("" : "=m"(x) : "m"(x))
+#endif
+
+#if defined(L_mulsc3) || defined(L_muldc3) \
+ || defined(L_mulxc3) || defined(L_multc3)
+
+CTYPE
+CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
+{
+ MTYPE ac, bd, ad, bc, x, y;
+
+ ac = a * c;
+ bd = b * d;
+ ad = a * d;
+ bc = b * c;
+
+ TRUNC (ac);
+ TRUNC (bd);
+ TRUNC (ad);
+ TRUNC (bc);
+
+ x = ac - bd;
+ y = ad + bc;
+
+ if (isnan (x) && isnan (y))
+ {
+ /* Recover infinities that computed as NaN + iNaN. */
+ _Bool recalc = 0;
+ if (isinf (a) || isinf (b))
+ {
+ /* z is infinite. "Box" the infinity and change NaNs in
+ the other factor to 0. */
+ a = COPYSIGN (isinf (a) ? 1 : 0, a);
+ b = COPYSIGN (isinf (b) ? 1 : 0, b);
+ if (isnan (c)) c = COPYSIGN (0, c);
+ if (isnan (d)) d = COPYSIGN (0, d);
+ recalc = 1;
+ }
+ if (isinf (c) || isinf (d))
+ {
+ /* w is infinite. "Box" the infinity and change NaNs in
+ the other factor to 0. */
+ c = COPYSIGN (isinf (c) ? 1 : 0, c);
+ d = COPYSIGN (isinf (d) ? 1 : 0, d);
+ if (isnan (a)) a = COPYSIGN (0, a);
+ if (isnan (b)) b = COPYSIGN (0, b);
+ recalc = 1;
+ }
+ if (!recalc
+ && (isinf (ac) || isinf (bd)
+ || isinf (ad) || isinf (bc)))
+ {
+ /* Recover infinities from overflow by changing NaNs to 0. */
+ if (isnan (a)) a = COPYSIGN (0, a);
+ if (isnan (b)) b = COPYSIGN (0, b);
+ if (isnan (c)) c = COPYSIGN (0, c);
+ if (isnan (d)) d = COPYSIGN (0, d);
+ recalc = 1;
+ }
+ if (recalc)
+ {
+ x = INFINITY * (a * c - b * d);
+ y = INFINITY * (a * d + b * c);
+ }
+ }
+
+ return x + I * y;
+}
+#endif /* complex multiply */
+
+#if defined(L_divsc3) || defined(L_divdc3) \
+ || defined(L_divxc3) || defined(L_divtc3)
+
+CTYPE
+CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
+{
+ MTYPE denom, ratio, x, y;
+
+ /* ??? We can get better behavior from logarithmic scaling instead of
+ the division. But that would mean starting to link libgcc against
+ libm. We could implement something akin to ldexp/frexp as gcc builtins
+ fairly easily... */
+ if (FABS (c) < FABS (d))
+ {
+ ratio = c / d;
+ denom = (c * ratio) + d;
+ x = ((a * ratio) + b) / denom;
+ y = ((b * ratio) - a) / denom;
+ }
+ else
+ {
+ ratio = d / c;
+ denom = (d * ratio) + c;
+ x = ((b * ratio) + a) / denom;
+ y = (b - (a * ratio)) / denom;
+ }
+
+ /* Recover infinities and zeros that computed as NaN+iNaN; the only cases
+ are nonzero/zero, infinite/finite, and finite/infinite. */
+ if (isnan (x) && isnan (y))
+ {
+ if (denom == 0.0 && (!isnan (a) || !isnan (b)))
+ {
+ x = COPYSIGN (INFINITY, c) * a;
+ y = COPYSIGN (INFINITY, c) * b;
+ }
+ else if ((isinf (a) || isinf (b)) && isfinite (c) && isfinite (d))
+ {
+ a = COPYSIGN (isinf (a) ? 1 : 0, a);
+ b = COPYSIGN (isinf (b) ? 1 : 0, b);
+ x = INFINITY * (a * c + b * d);
+ y = INFINITY * (b * c - a * d);
+ }
+ else if ((isinf (c) || isinf (d)) && isfinite (a) && isfinite (b))
+ {
+ c = COPYSIGN (isinf (c) ? 1 : 0, c);
+ d = COPYSIGN (isinf (d) ? 1 : 0, d);
+ x = 0.0 * (a * c + b * d);
+ y = 0.0 * (b * c - a * d);
+ }
+ }
+
+ return x + I * y;
+}
+#endif /* complex divide */
+
+#endif /* all complex float routines */
+
/* From here on down, the routines use normal data types. */
#define SItype bogus_type
@@ -1736,4 +2025,3 @@ func_ptr __DTOR_LIST__[2];
#endif
#endif /* no INIT_SECTION_ASM_OP and not CTOR_LISTS_DEFINED_EXTERNALLY */
#endif /* L_ctors */
-
diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h
index f6b8fa43aef..d1df220f9dd 100644
--- a/gcc/libgcc2.h
+++ b/gcc/libgcc2.h
@@ -1,5 +1,5 @@
/* Header file for libgcc2.c. */
-/* Copyright (C) 2000, 2001, 2004
+/* Copyright (C) 2000, 2001, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -51,10 +51,26 @@ extern short int __get_eh_table_version (struct exception_descriptor *);
#define LIBGCC2_WORDS_BIG_ENDIAN WORDS_BIG_ENDIAN
#endif
+#ifndef LIBGCC2_DOUBLE_TYPE_SIZE
+#define LIBGCC2_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
+#endif
#ifndef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE
#endif
+#ifndef LIBGCC2_HAS_DF_MODE
+#define LIBGCC2_HAS_DF_MODE \
+ (LIBGCC2_DOUBLE_TYPE_SIZE == 64 || LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64)
+#endif
+
+#ifndef LIBGCC2_HAS_XF_MODE
+#define LIBGCC2_HAS_XF_MODE (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80)
+#endif
+
+#ifndef LIBGCC2_HAS_TF_MODE
+#define LIBGCC2_HAS_TF_MODE (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128)
+#endif
+
#ifndef MIN_UNITS_PER_WORD
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
#endif
@@ -91,13 +107,19 @@ typedef unsigned int UTItype __attribute__ ((mode (TI)));
#if BITS_PER_UNIT == 8
typedef float SFtype __attribute__ ((mode (SF)));
-typedef float DFtype __attribute__ ((mode (DF)));
+typedef _Complex float SCtype __attribute__ ((mode (SC)));
-#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80
+#if LIBGCC2_HAS_DF_MODE
+typedef float DFtype __attribute__ ((mode (DF)));
+typedef _Complex float DCtype __attribute__ ((mode (DC)));
+#endif
+#if LIBGCC2_HAS_XF_MODE
typedef float XFtype __attribute__ ((mode (XF)));
+typedef _Complex float XCtype __attribute__ ((mode (XC)));
#endif
-#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128
+#if LIBGCC2_HAS_TF_MODE
typedef float TFtype __attribute__ ((mode (TF)));
+typedef _Complex float TCtype __attribute__ ((mode (TC)));
#endif
#else /* BITS_PER_UNIT != 8 */
@@ -196,6 +218,18 @@ typedef int word_type __attribute__ ((mode (__word__)));
#define Wtype_MAX ((Wtype)(((UWtype)1 << (W_TYPE_SIZE - 1)) - 1))
#define Wtype_MIN (- Wtype_MAX - 1)
+#if W_TYPE_SIZE == 8
+# define Wtype_MAXp1_F 0x1p8f
+#elif W_TYPE_SIZE == 16
+# define Wtype_MAXp1_F 0x1p16f
+#elif W_TYPE_SIZE == 32
+# define Wtype_MAXp1_F 0x1p32f
+#elif W_TYPE_SIZE == 64
+# define Wtype_MAXp1_F 0x1p64f
+#else
+# error "expand the table"
+#endif
+
#define __muldi3 __NDW(mul,3)
#define __divdi3 __NDW(div,3)
#define __udivdi3 __NDW(udiv,3)
@@ -297,26 +331,41 @@ extern SItype __negvsi2 (SItype);
#endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */
#if BITS_PER_UNIT == 8
-extern DWtype __fixdfdi (DFtype);
extern DWtype __fixsfdi (SFtype);
-extern DFtype __floatdidf (DWtype);
extern SFtype __floatdisf (DWtype);
-extern UWtype __fixunsdfSI (DFtype);
extern UWtype __fixunssfSI (SFtype);
-extern DWtype __fixunsdfDI (DFtype);
extern DWtype __fixunssfDI (SFtype);
+extern SFtype __powisf2 (SFtype, Wtype);
+extern SCtype __divsc3 (SFtype, SFtype, SFtype, SFtype);
+extern SCtype __mulsc3 (SFtype, SFtype, SFtype, SFtype);
+
+#if LIBGCC2_HAS_DF_MODE
+extern DWtype __fixdfdi (DFtype);
+extern DFtype __floatdidf (DWtype);
+extern UWtype __fixunsdfSI (DFtype);
+extern DWtype __fixunsdfDI (DFtype);
+extern DFtype __powidf2 (DFtype, Wtype);
+extern DCtype __divdc3 (DFtype, DFtype, DFtype, DFtype);
+extern DCtype __muldc3 (DFtype, DFtype, DFtype, DFtype);
+#endif
-#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80
+#if LIBGCC2_HAS_XF_MODE
extern DWtype __fixxfdi (XFtype);
extern DWtype __fixunsxfDI (XFtype);
extern XFtype __floatdixf (DWtype);
extern UWtype __fixunsxfSI (XFtype);
+extern XFtype __powixf2 (XFtype, Wtype);
+extern XCtype __divxc3 (XFtype, XFtype, XFtype, XFtype);
+extern XCtype __mulxc3 (XFtype, XFtype, XFtype, XFtype);
#endif
-#if LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128
+#if LIBGCC2_HAS_TF_MODE
extern DWtype __fixunstfDI (TFtype);
extern DWtype __fixtfdi (TFtype);
extern TFtype __floatditf (DWtype);
+extern TFtype __powitf2 (TFtype, Wtype);
+extern TCtype __divtc3 (TFtype, TFtype, TFtype, TFtype);
+extern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype);
#endif
#endif /* BITS_PER_UNIT == 8 */
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 03f8c67a6c4..92e9d3614f0 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -1,5 +1,5 @@
/* Rtl-level loop invariant motion.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -296,13 +296,13 @@ static void
find_defs (struct loop *loop, basic_block *body, struct df *df)
{
unsigned i;
- bitmap blocks = BITMAP_XMALLOC ();
+ bitmap blocks = BITMAP_ALLOC (NULL);
for (i = 0; i < loop->num_nodes; i++)
bitmap_set_bit (blocks, body[i]->index);
df_analyze_subcfg (df, blocks, DF_UD_CHAIN | DF_HARD_REGS | DF_EQUIV_NOTES);
- BITMAP_XFREE (blocks);
+ BITMAP_FREE (blocks);
}
/* Creates a new invariant for definition DEF in INSN, depending on invariants
@@ -447,10 +447,10 @@ find_invariant_insn (rtx insn, bool always_reached, bool always_executed,
return;
}
- depends_on = BITMAP_XMALLOC ();
+ depends_on = BITMAP_ALLOC (NULL);
if (!check_dependencies (insn, df, depends_on))
{
- BITMAP_XFREE (depends_on);
+ BITMAP_FREE (depends_on);
return;
}
@@ -557,10 +557,10 @@ find_invariants_body (struct loop *loop, basic_block *body,
static void
find_invariants (struct loop *loop, struct df *df)
{
- bitmap may_exit = BITMAP_XMALLOC ();
- bitmap always_reached = BITMAP_XMALLOC ();
- bitmap has_exit = BITMAP_XMALLOC ();
- bitmap always_executed = BITMAP_XMALLOC ();
+ bitmap may_exit = BITMAP_ALLOC (NULL);
+ bitmap always_reached = BITMAP_ALLOC (NULL);
+ bitmap has_exit = BITMAP_ALLOC (NULL);
+ bitmap always_executed = BITMAP_ALLOC (NULL);
basic_block *body = get_loop_body_in_dom_order (loop);
find_exits (loop, body, may_exit, has_exit);
@@ -570,10 +570,10 @@ find_invariants (struct loop *loop, struct df *df)
find_defs (loop, body, df);
find_invariants_body (loop, body, always_reached, always_executed, df);
- BITMAP_XFREE (always_reached);
- BITMAP_XFREE (always_executed);
- BITMAP_XFREE (may_exit);
- BITMAP_XFREE (has_exit);
+ BITMAP_FREE (always_reached);
+ BITMAP_FREE (always_executed);
+ BITMAP_FREE (may_exit);
+ BITMAP_FREE (has_exit);
free (body);
}
@@ -863,7 +863,7 @@ free_inv_motion_data (struct df *df)
for (i = 0; i < VARRAY_ACTIVE_SIZE (invariants); i++)
{
inv = VARRAY_GENERIC_PTR_NOGC (invariants, i);
- BITMAP_XFREE (inv->depends_on);
+ BITMAP_FREE (inv->depends_on);
free (inv);
}
VARRAY_POP_ALL (invariants);
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index 3cdd4bb96e7..d4df66a20e3 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -1,6 +1,6 @@
#!/bin/sh
# Construct makefile for libgcc.
-# Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is part of GCC.
@@ -33,7 +33,6 @@
# EXTRA_MULTILIB_PARTS
# SHLIB_EXT
# SHLIB_LINK
-# SHLIB_MULTILIB
# SHLIB_MKMAP
# SHLIB_MKMAP_OPTS
# SHLIB_MAPFILES
@@ -61,7 +60,9 @@ lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
_enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3
_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
_ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
- _popcountsi2 _popcountdi2 _paritysi2 _paritydi2'
+ _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2
+ _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3
+ _divxc3 _divtc3'
# Disable SHLIB_LINK if shared libgcc not enabled.
if [ "@enable_shared@" = "no" ]; then
@@ -71,6 +72,7 @@ fi
# Build lines.
gcc_compile='$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES)'
+gcc_s_compile="$gcc_compile -DSHARED"
make_compile='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
AR_FOR_TARGET="$(AR_FOR_TARGET)" \
AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
@@ -93,16 +95,23 @@ libgcov_c_dep='stmp-dirs $(srcdir)/libgcov.c $(srcdir)/gcov-io.h $(srcdir)/gcov-
# Dependencies for fp-bit.c
fpbit_c_dep='stmp-dirs config.status tsystem.h'
+# Flag whether we need eh_dummy.c
+need_eh_dummy=
+
if [ "$SHLIB_LINK" ]; then
# Test -fvisibility=hidden. We need both a -fvisibility=hidden on
# the command line, and a #define to prevent libgcc2.h etc from
# overriding that with #pragmas. The dance with @ is to prevent
# echo from seeing anything it might take for an option.
+ # echo turns the \$\$\$\$ into $$$$ and when make sees it it
+ # becomes $$ and the shell substitutes the pid. Makes for a
+ # slightly safer temp file.
echo "vis_hide := \$(strip \$(subst @,-,\\"
echo " \$(shell if echo 'void foo(void); void foo(void) {}' | \\"
echo " $gcc_compile -fvisibility=hidden -Werror \\"
- echo " -c -xc - -o /dev/null 2> /dev/null; \\"
+ echo " -c -xc - -o vis_temp_file\$\$\$\$.o 2> /dev/null; \\"
echo " then echo @fvisibility=hidden @DHIDE_EXPORTS; \\"
+ echo " rm vis_temp_file\$\$\$\$.o 2> /dev/null; \\"
echo " fi)))"
echo
@@ -152,79 +161,29 @@ for ml in $MULTILIBS; do
# Work out relevant parameters that depend only on the multilib.
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
- shlib_dir=
- shlib_dir_qual=
+ shlib_slibdir_qual=
libgcc_a=$dir/libgcc.a
libgcov_a=$dir/libgcov.a
libgcc_eh_a=
libgcc_s_so=
libunwind_a=
libunwind_so=
- if [ "$dir" = . ]; then
- suffix=
- else
- suffix=`echo $dir | sed s,/,_,g`
- fi
if [ "$LIBUNWIND" ]; then
libunwind_a=$dir/libunwind.a
fi
if [ "$SHLIB_LINK" ]; then
- if [ -z "$SHLIB_MULTILIB" ]; then
- if [ "$dir" = . ]; then
- libgcc_eh_a=$dir/libgcc_eh.a
- libgcc_s_so_base=libgcc_s
- libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
- libgcc_s_soname=libgcc_s
- if [ "$LIBUNWIND" ]; then
- libunwind_so_base=libunwind
- libunwind_so=${libunwind_so_base}${SHLIB_EXT}
- libunwind_soname=libunwind
- fi
- else
- libgcc_eh_a=$dir/libgcc_eh.a
- libgcc_s_so_base=libgcc_s_${suffix}
- libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
- libgcc_s_soname=libgcc_s_${suffix}
- if [ "$LIBUNWIND" ]; then
- libunwind_so_base=libunwind_${suffix}
- libunwind_so=${libunwind_so_base}${SHLIB_EXT}
- fi
- fi
-
- if [ -n "$MULTILIB_OSDIRNAMES" ]; then
- if [ "$dir" != . ]; then
- gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory`
- os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
- shlib_dir="$dir"/
- gcc_multilib_sup=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
- os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
- if [ -z "$os_multilib_base" ]; then
- libgcc_s_soname=libgcc_s
- libunwind_soname=libunwind
- if [ "$os_multilib_dir" != "." ]; then
- shlib_dir_qual="/$os_multilib_dir"
- fi
- else
- libgcc_s_soname=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
- libunwind_soname=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g`
- shlib_dir_qual="/$os_multilib_base"
- fi
- fi
- fi
-
- elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
- libgcc_eh_a=$dir/libgcc_eh.a
- libgcc_s_so_base=libgcc_s
- libgcc_s_so=${libgcc_s_so_base}${SHLIB_EXT}
- libgcc_s_soname=libgcc_s
- if [ "$LIBUNWIND" ]; then
- libunwind_so_base=libunwind
- libunwind_so=${libunwind_so_base}${SHLIB_EXT}
- libunwind_soname=libunwind
- fi
+ libgcc_eh_a=$dir/libgcc_eh.a
+ libgcc_s_so=$dir/libgcc_s${SHLIB_EXT}
+ if [ "$LIBUNWIND" ]; then
+ libunwind_so=$dir/libunwind${SHLIB_EXT}
+ fi
+ os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
+ if [ "$os_multilib_dir" != . ]; then
+ shlib_slibdir_qual="/$os_multilib_dir"
fi
fi
+
libgcc_s_so_extra=
libunwind_so_extra=
@@ -238,20 +197,9 @@ for ml in $MULTILIBS; do
echo \# libgcc_eh_a: $libgcc_eh_a
echo \# libunwind_a: $libunwind_a
echo \#
- echo \# gcc_multilib_dir: $gcc_multilib_dir
- echo \# gcc_multilib_sup: $gcc_multilib_sup
- echo \# os_multilib_dir: $os_multilib_dir
- echo \# os_multilib_base: $os_multilib_base
- echo \# shlib_dir: $shlib_dir
- echo \# shlib_dir_qual: $shlib_dir_qual
- echo \#
+ echo \# shlib_slibdir_qual: $shlib_slibdir_qual
echo \# libgcc_s_so: $libgcc_s_so
- echo \# libgcc_s_so_base: $libgcc_s_so_base
- echo \# libgcc_s_soname: $libgcc_s_soname
- echo \#
echo \# libunwind_so: $libunwind_so
- echo \# libunwind_so_base: $libunwind_so_base
- echo \# libunwind_soname: $libunwind_soname
echo \#
echo
@@ -271,7 +219,7 @@ for ml in $MULTILIBS; do
outV="libgcc/${dir}/${name}.vis"
echo ${outS}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
- echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
+ echo " $gcc_s_compile" $flags -DL$name -xassembler-with-cpp \
-c '$(srcdir)/config/$(LIB1ASMSRC)' -o $outS
echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)' ${outV}
@@ -304,7 +252,8 @@ for ml in $MULTILIBS; do
outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $libgcc2_c_dep
- echo " $gcc_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $outS
+ echo " $gcc_s_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' \
+ -o $outS
echo $out: $libgcc2_c_dep
echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
@@ -338,7 +287,7 @@ for ml in $MULTILIBS; do
outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $libgcc2_c_dep
- echo " $gcc_compile" $flags -DL$name \
+ echo " $gcc_s_compile" $flags -DL$name \
-fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $outS
echo $out: $libgcc2_c_dep
@@ -370,7 +319,7 @@ for ml in $MULTILIBS; do
outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $FPBIT $fpbit_c_dep
- echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
+ echo " $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $FPBIT -o $outS
echo $out: $FPBIT $fpbit_c_dep
@@ -400,7 +349,7 @@ for ml in $MULTILIBS; do
outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $DPBIT $fpbit_c_dep
- echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
+ echo " $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $DPBIT -o $outS
echo $out: $DPBIT $fpbit_c_dep
@@ -430,7 +379,7 @@ for ml in $MULTILIBS; do
outS="libgcc/${dir}/${name}_s${objext}"
echo $outS: $TPBIT $fpbit_c_dep
- echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
+ echo " $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-c $TPBIT -o $outS
echo $out: $TPBIT $fpbit_c_dep
@@ -464,7 +413,7 @@ for ml in $MULTILIBS; do
case $file in
*.c)
echo $outS: stmp-dirs $file $libgcc_dep
- echo " $gcc_compile" $flags -c $file -o $outS
+ echo " $gcc_s_compile" $flags -c $file -o $outS
echo $out: stmp-dirs $file $libgcc_dep
echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
@@ -474,7 +423,7 @@ for ml in $MULTILIBS; do
outV="libgcc/${dir}/${oname}.vis"
echo $outS: stmp-dirs $file $libgcc_dep
- echo " $gcc_compile" $flags -xassembler-with-cpp \
+ echo " $gcc_s_compile" $flags -xassembler-with-cpp \
-c $file -o $outS
echo $out: stmp-dirs $file $libgcc_dep $outV
@@ -586,16 +535,29 @@ for ml in $MULTILIBS; do
name=`echo $file | sed -e 's/[.]c$//'`
oname=`echo $name | sed -e 's,.*/,,'`
- out="libgcc/${dir}/${oname}_s${objext}"
+ outS="libgcc/${dir}/${oname}_s${objext}"
- echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
- echo " $gcc_compile" $flags -fexceptions -c $file -o $out
- echo $libgcc_s_so: $out
+ echo $outS: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
+ echo " $gcc_s_compile" $flags -fexceptions -c $file -o $outS
+ echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
- echo libgcc/${dir}/libgcc.map: $out
+ echo libgcc/${dir}/libgcc.map: $outS
fi
done
+ # If nothing went into libgcc_eh.a, create a dummy object -
+ # some linkers don't like totally empty archives.
+ if [ -z "$LIB2ADDEHSTATIC" ]; then
+ file=eh_dummy.c
+ out="libgcc/${dir}/eh_dummy${objext}"
+ need_eh_dummy=1
+
+ echo $out: stmp-dirs $file
+ echo " $gcc_compile" $flags '$(vis_hide)' -fexceptions -c $file -o $out
+ echo $libgcc_eh_a: $out
+ fi
+
+
else # no libgcc_eh.a
for file in $LIB2ADDEH; do
case $file in
@@ -632,7 +594,7 @@ for ml in $MULTILIBS; do
echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
echo $outS: stmp-dirs $file $LIBUNWINDDEP
- echo " $gcc_compile $flags -fexceptions -DSHARED -c $file -o $outS"
+ echo " $gcc_s_compile $flags -fexceptions -c $file -o $outS"
echo $libunwind_a: $out
echo $libunwind_so: $outS
@@ -681,6 +643,11 @@ for ml in $MULTILIBS; do
extra="$extra $targ"
done
+ if [ "$dir" = . ]; then
+ suffix=
+ else
+ suffix=`echo $dir | sed s,/,_,g`
+ fi
echo extra$suffix: stmp-dirs
echo " $make_compile" \\
echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
@@ -771,8 +738,7 @@ EOF
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
-e "s%@shlib_objs@%\$(objects)%g" \
- -e "s%@shlib_base_name@%$libgcc_s_so_base%g" \
- -e "s%@shlib_so_name@%$libgcc_s_soname%g" \
+ -e "s%@shlib_base_name@%libgcc_s%g" \
-e "s%@shlib_map_file@%$mapfile%g" \
-e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
echo "all: $libgcc_s_so"
@@ -785,8 +751,7 @@ EOF
| sed -e "s%@multilib_flags@%$flags%g" \
-e "s%@multilib_dir@%$dir%g" \
-e "s%@shlib_objs@%\$(objects)%g" \
- -e "s%@shlib_base_name@%$libunwind_so_base%g" \
- -e "s%@shlib_so_name@%$libunwind_soname%g" \
+ -e "s%@shlib_base_name@%libunwind%g" \
-e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
echo "all: $libunwind_so"
fi
@@ -813,6 +778,11 @@ echo " if [ -d \$\$d ]; then true; else $mkinstalldirs \$\$d; fi; \\"
echo " done"
echo " if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi"
+if [ "$need_eh_dummy" ]; then
+ echo "eh_dummy.c:"
+ echo " echo 'struct eh_dummy;' > \$@"
+fi
+
echo ""
echo "install: all"
for ml in $MULTILIBS; do
@@ -833,66 +803,23 @@ for ml in $MULTILIBS; do
echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
- if [ -z "$SHLIB_MULTILIB" ]; then
- if [ "$dir" = . ]; then
- shlib_base_name=libgcc_s
- shlibunwind_base_name=libunwind
- else
- shlib_base_name=libgcc_s_`echo $dir | sed s,/,_,g`
- shlibunwind_base_name=libunwind_`echo $dir | sed s,/,_,g`
- fi
- shlib_so_name="$shlib_base_name"
- shlibunwind_so_name="$shlibunwind_base_name"
- shlib_dir=
- shlib_slibdir_qual=
- if [ -n "$MULTILIB_OSDIRNAMES" ]; then
- gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory`
- os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
- if [ "$dir" != . ]; then
- shlib_dir="$dir"/
- fi
- gcc_multilib_sup=`echo $gcc_multilib_dir | sed 's~^[^/]*/~~'`
- os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
- if [ -z "$os_multilib_base" ]; then
- shlib_so_name=libgcc_s
- shlibunwind_so_name=libunwind
- if [ "$os_multilib_dir" != "." ]; then
- shlib_slibdir_qual="/$os_multilib_dir"
- fi
- else
- shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
- shlibunwind_so_name=libunwind_`echo $gcc_multilib_sup | sed s,/,_,g`
- shlib_slibdir_qual="/$os_multilib_base"
- fi
- fi
- echo " $SHLIB_INSTALL" \
- | sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
- -e "s%@shlib_so_name@%$shlib_so_name%g" \
+ shlib_slibdir_qual=
+ os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
+ if [ "$os_multilib_dir" != . ]; then
+ shlib_slibdir_qual="/$os_multilib_dir"
+ fi
+ echo " $SHLIB_INSTALL" \
+ | sed -e "s%@multilib_dir@%$dir%g" \
+ -e "s%@shlib_base_name@%libgcc_s%g" \
+ -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
+ if [ "$LIBUNWIND" ]; then
+ echo " $SHLIBUNWIND_INSTALL" \
+ | sed -e "s%@multilib_dir@%$dir%g" \
+ -e "s%@shlib_base_name@%libunwind%g" \
-e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
- if [ "$LIBUNWIND" ]; then
- echo " $SHLIBUNWIND_INSTALL" \
- | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
- -e "s%@shlib_so_name@%$shlibunwind_so_name%g" \
- -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
- libunwinddir='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
- echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
- echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
- fi
- elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
- shlib_base_name="libgcc_s";
- echo " $SHLIB_INSTALL" \
- | sed -e "s%@shlib_base_name@%$shlib_base_name%g" \
- -e "s%@shlib_so_name@%$shlib_base_name%g" \
- -e "s%@shlib_slibdir_qual@%%g"
- if [ "$LIBUNWIND" ]; then
- echo " $SHLIBUNWIND_INSTALL" \
- | sed -e "s%@shlib_base_name@%$shlibunwind_base_name%g" \
- -e "s%@shlib_so_name@%$shlibunwind_base_name%g" \
- -e "s%@shlib_slibdir_qual@%%g"
- libunwinddir='$(DESTDIR)$(slibdir)'
- echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
- echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
- fi
+ libunwinddir='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
+ echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
+ echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
fi
fi
done
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 88037f36bda..49e73af4960 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-25 Joseph S. Myers <joseph@codesourcery.com>
+
+ * Make-lang.in (objc/objc-parse.o-warn, objc/objc-parse.o,
+ objc/objc-parse.c, objc/objc-parse.y): Remove
+ (OBJC_OBJS, objc.srcextra, objc.tags, objc.mostlyclean,
+ objc.distclean, objc.maintainer-clean): Update for new parser.
+ * config-lang.in (gtfiles): Update for new parser.
+
2005-01-29 Kazu Hirata <kazu@cs.umass.edu>
* lang-specs.h, objc-act.c, objc-act.h, objc-lang.c: Update
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index 08909437aa6..56fad72b149 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
+# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#This file is part of GCC.
@@ -46,11 +46,9 @@ OBJECTIVE-C objective-c: cc1obj$(exeext)
# Use maximal warnings for this front end.
objc-warn = $(STRICT_WARN)
-# Bison-1.75 output yields (harmless) -Wtraditional warnings
-objc/objc-parse.o-warn = -Wno-error
# Language-specific object files for Objective C.
-OBJC_OBJS = objc/objc-lang.o objc/objc-parse.o objc/objc-act.o
+OBJC_OBJS = objc/objc-lang.o objc/objc-act.o
cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
@@ -64,28 +62,13 @@ objc/objc-lang.o : objc/objc-lang.c \
$(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \
c-objc-common.h objc/objc-act.h
-objc/objc-parse.o : objc/objc-parse.c \
- $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
- toplev.h $(GGC_H) input.h flags.h output.h langhooks.h $(C_COMMON_H) \
- $(C_PRAGMA_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
-objc.srcextra: objc/objc-parse.c objc/objc-parse.y
- -cp -p $^ $(srcdir)/objc
-
-objc/objc-parse.c : objc/objc-parse.y
- -$(BISON) $(BISONFLAGS) -o $@ $<
-
-objc/objc-parse.y: c-parse.in
- echo '/*WARNING: This file is automatically generated!*/' >tmp-objc-prs.y
- sed -e "/^@@ifc.*/,/^@@end_ifc.*/d" \
- -e "/^@@ifobjc.*/d" -e "/^@@end_ifobjc.*/d" < $< >>tmp-objc-prs.y
- $(SHELL) $(srcdir)/../move-if-change tmp-objc-prs.y $@
+objc.srcextra:
gtype-objc.h : s-gtype ; @true
gt-objc-objc-act.h : s-gtype ; @true
@@ -103,7 +86,7 @@ objc.srcinfo:
objc.srcman:
objc.tags: force
- cd $(srcdir)/objc; etags -o TAGS.sub *.y *.c *.h; \
+ cd $(srcdir)/objc; etags -o TAGS.sub *.c *.h; \
etags --include TAGS.sub --include ../TAGS.sub
lang_checks += check-objc
@@ -124,18 +107,14 @@ objc.uninstall:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.
objc.mostlyclean:
- -rm -f tmp-objc-prs.y
-rm -f objc/*$(objext) objc/xforward objc/fflags
- -rm -f objc/objc-parse.y objc/objc-parse.c objc/objc-parse.output
-rm -f objc/*$(coverageexts)
objc.clean: objc.mostlyclean
-rm -rf objc-headers
objc.distclean:
-rm -f objc/Makefile objc/Make-host objc/Make-target
-rm -f objc/config.status objc/config.cache
- -rm -f objc-parse.output
objc.maintainer-clean:
- -rm -f $(srcdir)/objc/objc-parse.y $(srcdir)/objc/objc-parse.c
#
# Stage hooks:
diff --git a/gcc/objc/config-lang.in b/gcc/objc/config-lang.in
index 72de2ffc59d..fbb9a6e9e92 100644
--- a/gcc/objc/config-lang.in
+++ b/gcc/objc/config-lang.in
@@ -1,5 +1,5 @@
# Top level configure fragment for GNU Objective-C
-# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004
+# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#This file is part of GCC.
@@ -37,4 +37,4 @@ target_libs=target-libobjc
# Most of the object files for cc1obj actually come from C.
lang_requires="c"
-gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/objc/objc-act.c"
+gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/c-parser.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/objc/objc-act.c"
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 889f9156dd1..95256207da7 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5027,6 +5027,7 @@ init_optabs (void)
exp10_optab = init_optab (UNKNOWN);
exp2_optab = init_optab (UNKNOWN);
expm1_optab = init_optab (UNKNOWN);
+ ldexp_optab = init_optab (UNKNOWN);
logb_optab = init_optab (UNKNOWN);
ilogb_optab = init_optab (UNKNOWN);
log_optab = init_optab (UNKNOWN);
@@ -5049,6 +5050,8 @@ init_optabs (void)
vec_realign_load_optab = init_optab (UNKNOWN);
movmisalign_optab = init_optab (UNKNOWN);
+ powi_optab = init_optab (UNKNOWN);
+
/* Conversions. */
sext_optab = init_convert_optab (SIGN_EXTEND);
zext_optab = init_convert_optab (ZERO_EXTEND);
@@ -5135,6 +5138,8 @@ init_optabs (void)
init_floating_libfuncs (le_optab, "le", '2');
init_floating_libfuncs (unord_optab, "unord", '2');
+ init_floating_libfuncs (powi_optab, "powi", '2');
+
/* Conversions. */
init_interclass_conv_libfuncs (sfloat_optab, "float",
MODE_INT, MODE_FLOAT);
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 613831a8249..e0a7985bc15 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -171,6 +171,8 @@ enum optab_index
OTI_exp2,
/* Exponential - 1*/
OTI_expm1,
+ /* Load exponent of a floating point number */
+ OTI_ldexp,
/* Radix-independent exponent */
OTI_logb,
OTI_ilogb,
@@ -235,6 +237,9 @@ enum optab_index
/* Extract specified elements from vectors, for vector load. */
OTI_vec_realign_load,
+ /* Perform a raise to the power of integer. */
+ OTI_powi,
+
OTI_MAX
};
@@ -299,6 +304,7 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define exp10_optab (optab_table[OTI_exp10])
#define exp2_optab (optab_table[OTI_exp2])
#define expm1_optab (optab_table[OTI_expm1])
+#define ldexp_optab (optab_table[OTI_ldexp])
#define logb_optab (optab_table[OTI_logb])
#define ilogb_optab (optab_table[OTI_ilogb])
#define log_optab (optab_table[OTI_log])
@@ -340,6 +346,8 @@ extern GTY(()) optab optab_table[OTI_MAX];
#define vec_init_optab (optab_table[OTI_vec_init])
#define vec_realign_load_optab (optab_table[OTI_vec_realign_load])
+#define powi_optab (optab_table[OTI_powi])
+
/* Conversion optabs have their own table and indexes. */
enum convert_optab_index
{
diff --git a/gcc/opts.c b/gcc/opts.c
index 4439d1f4d57..fcb8f6d5c1a 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -945,6 +945,10 @@ common_handle_option (size_t scode, const char *arg, int value)
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (arg));
break;
+ case OPT_ftree_vectorizer_verbose_:
+ vect_set_verbosity_level (arg);
+ break;
+
case OPT_ftls_model_:
if (!strcmp (arg, "global-dynamic"))
flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
@@ -1093,6 +1097,7 @@ set_fast_math_flags (int set)
{
flag_signaling_nans = 0;
flag_rounding_math = 0;
+ flag_cx_limited_range = 1;
}
}
diff --git a/gcc/passes.c b/gcc/passes.c
index 723656f4cd8..956885ab717 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -895,6 +895,7 @@ rest_of_handle_combine (void)
rebuild_jump_labels (get_insns ());
timevar_pop (TV_JUMP);
+ delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
}
@@ -971,6 +972,9 @@ rest_of_handle_cse (void)
expecting CSE to be run. But always rerun it in a cheap mode. */
cse_not_expected = !flag_rerun_cse_after_loop && !flag_gcse;
+ if (tem)
+ delete_dead_jumptables ();
+
if (tem || optimize > 1)
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
@@ -1006,6 +1010,7 @@ rest_of_handle_cse2 (void)
{
timevar_push (TV_JUMP);
rebuild_jump_labels (get_insns ());
+ delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE);
timevar_pop (TV_JUMP);
}
@@ -1048,24 +1053,14 @@ rest_of_handle_gcse (void)
}
/* If gcse or cse altered any jumps, rerun jump optimizations to clean
- things up. Then possibly re-run CSE again. */
- while (tem || tem2)
+ things up. */
+ if (tem || tem2)
{
- tem = tem2 = 0;
timevar_push (TV_JUMP);
rebuild_jump_labels (get_insns ());
+ delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
timevar_pop (TV_JUMP);
-
- if (flag_expensive_optimizations)
- {
- timevar_push (TV_CSE);
- reg_scan (get_insns (), max_reg_num ());
- tem2 = cse_main (get_insns (), max_reg_num (), dump_file);
- purge_all_dead_edges (0);
- delete_trivially_dead_insns (get_insns (), max_reg_num ());
- timevar_pop (TV_CSE);
- }
}
close_dump_file (DFI_gcse, print_rtl_with_bb, get_insns ());
@@ -1086,8 +1081,6 @@ rest_of_handle_loop_optimize (void)
int do_prefetch;
timevar_push (TV_LOOP);
- delete_dead_jumptables ();
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
open_dump_file (DFI_loop, current_function_decl);
/* CFG is no longer maintained up-to-date. */
@@ -1118,7 +1111,7 @@ rest_of_handle_loop_optimize (void)
/* Loop can create trivially dead instructions. */
delete_trivially_dead_insns (get_insns (), max_reg_num ());
- find_basic_blocks (get_insns (), max_reg_num (), dump_file);
+ find_basic_blocks (get_insns ());
close_dump_file (DFI_loop, print_rtl, get_insns ());
timevar_pop (TV_LOOP);
@@ -1652,7 +1645,7 @@ rest_of_compilation (void)
/* Any of the several passes since flow1 will have munged register
lifetime data a bit. We need it to be up to date for scheduling
(see handling of reg_known_equiv in init_alias_analysis). */
- recompute_reg_usage (get_insns (), !optimize_size);
+ recompute_reg_usage ();
#ifdef INSN_SCHEDULING
if (optimize > 0 && flag_modulo_sched)
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 5177f603fb8..5ceef0c99d0 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-25 Joseph S. Myers <joseph@codesourcery.com>
+
+ * gcc.pot: Regenerate.
+
2004-12-20 Joseph S. Myers <joseph@codesourcery.com>
* de.po: Update.
diff --git a/gcc/po/gcc.pot b/gcc/po/gcc.pot
index d3b96a32764..79d31eda458 100644
--- a/gcc/po/gcc.pot
+++ b/gcc/po/gcc.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
-"POT-Creation-Date: 2004-11-27 19:39+0000\n"
+"POT-Creation-Date: 2005-02-25 23:27+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -40,550 +40,559 @@ msgstr ""
msgid "offset outside bounds of constant string"
msgstr ""
-#: builtins.c:923
+#: builtins.c:928
msgid "second argument to %<__builtin_prefetch%> must be a constant"
msgstr ""
-#: builtins.c:930
+#: builtins.c:935
msgid "invalid second argument to %<__builtin_prefetch%>; using zero"
msgstr ""
-#: builtins.c:938
+#: builtins.c:943
msgid "third argument to %<__builtin_prefetch%> must be a constant"
msgstr ""
-#: builtins.c:945
+#: builtins.c:950
msgid "invalid third argument to %<__builtin_prefetch%>; using zero"
msgstr ""
-#: builtins.c:3727
+#: builtins.c:3806
msgid "argument of %<__builtin_args_info%> must be constant"
msgstr ""
-#: builtins.c:3733
+#: builtins.c:3812
msgid "argument of %<__builtin_args_info%> out of range"
msgstr ""
-#: builtins.c:3739
+#: builtins.c:3818
msgid "missing argument in %<__builtin_args_info%>"
msgstr ""
-#: builtins.c:3755 builtins.c:8661
-msgid "%<va_start%> used in function with fixed args"
-msgstr ""
-
-#: builtins.c:3774 builtins.c:8677
-msgid "second parameter of %<va_start%> not last named argument"
-msgstr ""
-
-#. Evidently an out of date version of <stdarg.h>; can't validate
-#. va_start's second argument, but can still work as intended.
-#: builtins.c:3779 builtins.c:8683
-msgid "%<__builtin_next_arg%> called without an argument"
-msgstr ""
-
-#: builtins.c:3865
+#: builtins.c:3914 gimplify.c:1765
msgid "too few arguments to function %<va_start%>"
msgstr ""
-#: builtins.c:3869
-msgid "too many arguments to function %<va_start%>"
-msgstr ""
-
-#: builtins.c:4017
+#: builtins.c:4077
msgid "first argument to %<va_arg%> not of type %<va_list%>"
msgstr ""
#. Unfortunately, this is merely undefined, rather than a constraint
#. violation, so we cannot make this an error. If this call is never
#. executed, the program is still strictly conforming.
-#: builtins.c:4031
+#: builtins.c:4091
msgid "%qT is promoted to %qT when passed through %<...%>"
msgstr ""
-#: builtins.c:4036
+#: builtins.c:4096
msgid "(so you should pass %qT not %qT to %<va_arg%>)"
msgstr ""
#. We can, however, treat "undefined" any way we please.
#. Call abort to encourage the user to fix the program.
-#: builtins.c:4042 c-typeck.c:1940
+#: builtins.c:4102 c-typeck.c:2023
msgid "if this code is reached, the program will abort"
msgstr ""
-#: builtins.c:4160
+#: builtins.c:4220
msgid "invalid argument to %<__builtin_frame_address%>"
msgstr ""
-#: builtins.c:4162
+#: builtins.c:4222
msgid "invalid argument to %<__builtin_return_address%>"
msgstr ""
-#: builtins.c:4176
+#: builtins.c:4235
msgid "unsupported argument to %<__builtin_frame_address%>"
msgstr ""
-#: builtins.c:4178
+#: builtins.c:4237
msgid "unsupported argument to %<__builtin_return_address%>"
msgstr ""
-#: builtins.c:4281
+#: builtins.c:4340
msgid "second argument to %<__builtin_expect%> must be a constant"
msgstr ""
-#: builtins.c:5488
+#: builtins.c:5590
msgid "%<__builtin_longjmp%> second argument must be 1"
msgstr ""
-#: builtins.c:5840
+#: builtins.c:5942
msgid "target format does not support infinity"
msgstr ""
-#: builtins.c:7518 builtins.c:7613
+#: builtins.c:7699 builtins.c:7794
#, c-format
msgid "too few arguments to function %qs"
msgstr ""
-#: builtins.c:7524 builtins.c:7619
+#: builtins.c:7705 builtins.c:7800
#, c-format
msgid "too many arguments to function %qs"
msgstr ""
-#: builtins.c:7530 builtins.c:7644
+#: builtins.c:7711 builtins.c:7825
#, c-format
msgid "non-floating-point argument to function %qs"
msgstr ""
-#: c-common.c:831
+#: builtins.c:8911
+msgid "%<va_start%> used in function with fixed args"
+msgstr ""
+
+#. Evidently an out of date version of <stdarg.h>; can't validate
+#. va_start's second argument, but can still work as intended.
+#: builtins.c:8918
+msgid "%<__builtin_next_arg%> called without an argument"
+msgstr ""
+
+#: builtins.c:8933
+msgid "%<va_start%> used with too many arguments"
+msgstr ""
+
+#. FIXME: Sometimes with the tree optimizers we can get the
+#. not the last argument even though the user used the last
+#. argument. We just warn and set the arg to be the last
+#. argument so that we will get wrong-code because of
+#. it.
+#: builtins.c:8953
+msgid "second parameter of %<va_start%> not last named argument"
+msgstr ""
+
+#: c-common.c:826
msgid "%qD is not defined outside of function scope"
msgstr ""
-#: c-common.c:852
+#: c-common.c:847
#, c-format
msgid ""
"string length %qd is greater than the length %qd ISO C%d compilers are "
"required to support"
msgstr ""
-#: c-common.c:898
+#: c-common.c:888
msgid "overflow in constant expression"
msgstr ""
-#: c-common.c:918
+#: c-common.c:908
msgid "integer overflow in expression"
msgstr ""
-#: c-common.c:927
+#: c-common.c:917
msgid "floating point overflow in expression"
msgstr ""
-#: c-common.c:933
+#: c-common.c:923
msgid "vector overflow in expression"
msgstr ""
#. This detects cases like converting -129 or 256 to unsigned char.
-#: c-common.c:955
+#: c-common.c:945
msgid "large integer implicitly truncated to unsigned type"
msgstr ""
-#: c-common.c:957
+#: c-common.c:947
msgid "negative integer implicitly converted to unsigned type"
msgstr ""
-#: c-common.c:1015
+#: c-common.c:1005
msgid "overflow in implicit constant conversion"
msgstr ""
-#: c-common.c:1151
+#: c-common.c:1141
#, c-format
msgid "operation on %qs may be undefined"
msgstr ""
-#: c-common.c:1437
+#: c-common.c:1425
msgid "case label does not reduce to an integer constant"
msgstr ""
-#: c-common.c:1480
+#: c-common.c:1468
msgid "case label value is less than minimum value for type"
msgstr ""
-#: c-common.c:1488
+#: c-common.c:1476
msgid "case label value exceeds maximum value for type"
msgstr ""
-#: c-common.c:1496
+#: c-common.c:1484
msgid "lower value in case label range less than minimum value for type"
msgstr ""
-#: c-common.c:1505
+#: c-common.c:1493
msgid "upper value in case label range exceeds maximum value for type"
msgstr ""
-#: c-common.c:1821
+#: c-common.c:1833
msgid "invalid truth-value expression"
msgstr ""
-#: c-common.c:1869
+#: c-common.c:1881
#, c-format
msgid "invalid operands to binary %s"
msgstr ""
-#: c-common.c:2112
+#: c-common.c:2116
msgid "comparison is always false due to limited range of data type"
msgstr ""
-#: c-common.c:2114
+#: c-common.c:2118
msgid "comparison is always true due to limited range of data type"
msgstr ""
-#: c-common.c:2184
+#: c-common.c:2188
msgid "comparison of unsigned expression >= 0 is always true"
msgstr ""
-#: c-common.c:2193
+#: c-common.c:2197
msgid "comparison of unsigned expression < 0 is always false"
msgstr ""
-#: c-common.c:2235
+#: c-common.c:2239
msgid "pointer of type %<void *%> used in arithmetic"
msgstr ""
-#: c-common.c:2241
+#: c-common.c:2245
msgid "pointer to a function used in arithmetic"
msgstr ""
-#: c-common.c:2247
+#: c-common.c:2251
msgid "pointer to member function used in arithmetic"
msgstr ""
#. Common Ada/Pascal programmer's mistake. We always warn
#. about this since it is so bad.
-#: c-common.c:2355
+#: c-common.c:2371
msgid "the address of %qD, will always evaluate as %<true%>"
msgstr ""
-#: c-common.c:2451
+#: c-common.c:2467
msgid "suggest parentheses around assignment used as truth value"
msgstr ""
-#: c-common.c:2500 c-common.c:2540
+#: c-common.c:2535 c-common.c:2575
msgid "invalid use of %<restrict%>"
msgstr ""
-#: c-common.c:2756
+#: c-common.c:2791
msgid "invalid application of %<sizeof%> to a function type"
msgstr ""
-#: c-common.c:2766
+#: c-common.c:2801
#, c-format
msgid "invalid application of %qs to a void type"
msgstr ""
-#: c-common.c:2772
+#: c-common.c:2807
msgid "invalid application of %qs to incomplete type %qT "
msgstr ""
-#: c-common.c:2813
+#: c-common.c:2848
msgid "%<__alignof%> applied to a bit-field"
msgstr ""
-#: c-common.c:3258
+#: c-common.c:3315
#, c-format
msgid "cannot disable built-in function %qs"
msgstr ""
-#: c-common.c:3448
+#: c-common.c:3505
msgid "pointers are not permitted as case values"
msgstr ""
-#: c-common.c:3452
+#: c-common.c:3509
msgid "range expressions in switch statements are non-standard"
msgstr ""
-#: c-common.c:3477
+#: c-common.c:3534
msgid "empty range specified"
msgstr ""
-#: c-common.c:3536
+#: c-common.c:3593
msgid "duplicate (or overlapping) case value"
msgstr ""
-#: c-common.c:3537
+#: c-common.c:3594
msgid "%Jthis is the first entry overlapping that value"
msgstr ""
-#: c-common.c:3541
+#: c-common.c:3598
msgid "duplicate case value"
msgstr ""
-#: c-common.c:3542
+#: c-common.c:3599
msgid "%Jpreviously used here"
msgstr ""
-#: c-common.c:3546
+#: c-common.c:3603
msgid "multiple default labels in one switch"
msgstr ""
-#: c-common.c:3547
+#: c-common.c:3604
msgid "%Jthis is the first default label"
msgstr ""
-#: c-common.c:3596
+#: c-common.c:3653
msgid "%Jcase value %qs not in enumerated type"
msgstr ""
-#: c-common.c:3599
+#: c-common.c:3656
msgid "%Jcase value %qs not in enumerated type %qT"
msgstr ""
-#: c-common.c:3666
+#: c-common.c:3723
msgid "%Hswitch missing default case"
msgstr ""
#. Warn if there are enumerators that don't correspond to
#. case expressions.
-#: c-common.c:3700
+#: c-common.c:3757
msgid "%Henumeration value %qE not handled in switch"
msgstr ""
-#: c-common.c:3727
+#: c-common.c:3784
msgid "taking the address of a label is non-standard"
msgstr ""
-#: c-common.c:3896 c-common.c:3915 c-common.c:3933 c-common.c:3960
-#: c-common.c:3979 c-common.c:4002 c-common.c:4026 c-common.c:4052
-#: c-common.c:4086 c-common.c:4130 c-common.c:4158 c-common.c:4186
-#: c-common.c:4205 c-common.c:4527 c-common.c:4558 c-common.c:4644
-#: c-common.c:4711 c-common.c:4757 c-common.c:4815 c-common.c:4844
-#: c-common.c:5123 c-common.c:5146 c-common.c:5185 tree.c:3240
-#: config/darwin.c:1218 config/arm/arm.c:2645 config/arm/arm.c:2672
-#: config/avr/avr.c:4514 config/h8300/h8300.c:5779 config/h8300/h8300.c:5802
-#: config/i386/i386.c:1725 config/i386/i386.c:14480 config/ia64/ia64.c:512
-#: config/ip2k/ip2k.c:3163 config/m68hc11/m68hc11.c:1314
-#: config/rs6000/rs6000.c:17094 config/sh/symbian.c:414
-#: config/sh/symbian.c:421
+#: c-common.c:3953 c-common.c:3972 c-common.c:3990 c-common.c:4017
+#: c-common.c:4036 c-common.c:4059 c-common.c:4083 c-common.c:4109
+#: c-common.c:4143 c-common.c:4187 c-common.c:4215 c-common.c:4243
+#: c-common.c:4262 c-common.c:4593 c-common.c:4624 c-common.c:4716
+#: c-common.c:4783 c-common.c:4829 c-common.c:4887 c-common.c:4916
+#: c-common.c:5195 c-common.c:5218 c-common.c:5257 tree.c:3254
+#: config/darwin.c:1236 config/arm/arm.c:2701 config/arm/arm.c:2728
+#: config/avr/avr.c:4601 config/h8300/h8300.c:5779 config/h8300/h8300.c:5802
+#: config/i386/i386.c:1732 config/i386/i386.c:15625 config/ia64/ia64.c:526
+#: config/ip2k/ip2k.c:3164 config/m68hc11/m68hc11.c:1312
+#: config/sh/symbian.c:414 config/sh/symbian.c:421
#, c-format
msgid "%qs attribute ignored"
msgstr ""
-#: c-common.c:4243
+#: c-common.c:4300
#, c-format
msgid "unknown machine mode %qs"
msgstr ""
-#: c-common.c:4263
+#: c-common.c:4320
msgid "specifying vector types with __attribute__ ((mode)) is deprecated"
msgstr ""
-#: c-common.c:4265
+#: c-common.c:4322
msgid "use __attribute__ ((vector_size)) instead"
msgstr ""
-#: c-common.c:4274
+#: c-common.c:4331
#, c-format
msgid "unable to emulate %qs"
msgstr ""
-#: c-common.c:4284
+#: c-common.c:4341
#, c-format
msgid "invalid pointer mode %qs"
msgstr ""
-#: c-common.c:4299
+#: c-common.c:4356
#, c-format
msgid "no data type for mode %qs"
msgstr ""
-#: c-common.c:4309
+#: c-common.c:4366
#, c-format
msgid "cannot use mode %qs for enumeral types"
msgstr ""
-#: c-common.c:4322
+#: c-common.c:4390
#, c-format
msgid "mode %qs applied to inappropriate type"
msgstr ""
-#: c-common.c:4355
+#: c-common.c:4421
msgid "%Jsection attribute cannot be specified for local variables"
msgstr ""
-#: c-common.c:4366
+#: c-common.c:4432
msgid "%Jsection of %qD conflicts with previous declaration"
msgstr ""
-#: c-common.c:4375
+#: c-common.c:4441
msgid "%Jsection attribute not allowed for %qD"
msgstr ""
-#: c-common.c:4381
+#: c-common.c:4447
msgid "%Jsection attributes are not supported for this target"
msgstr ""
-#: c-common.c:4419
+#: c-common.c:4485
msgid "requested alignment is not a constant"
msgstr ""
-#: c-common.c:4424
+#: c-common.c:4490
msgid "requested alignment is not a power of 2"
msgstr ""
-#: c-common.c:4429
+#: c-common.c:4495
msgid "requested alignment is too large"
msgstr ""
-#: c-common.c:4455
+#: c-common.c:4521
msgid "%Jalignment may not be specified for %qD"
msgstr ""
-#: c-common.c:4493
+#: c-common.c:4559
msgid "%J%qD defined both normally and as an alias"
msgstr ""
-#: c-common.c:4509
+#: c-common.c:4575
msgid "alias argument not a string"
msgstr ""
-#: c-common.c:4551
+#: c-common.c:4617
#, c-format
msgid "%qs attribute ignored on non-class types"
msgstr ""
-#: c-common.c:4564
+#: c-common.c:4630
msgid "visibility argument not a string"
msgstr ""
-#: c-common.c:4585
+#: c-common.c:4642
+#, c-format
+msgid "%qE attribute ignored on types"
+msgstr ""
+
+#: c-common.c:4657
msgid ""
"visibility argument must be one of \"default\", \"hidden\", \"protected\" or "
"\"internal\""
msgstr ""
-#: c-common.c:4654
+#: c-common.c:4726
msgid "tls_model argument not a string"
msgstr ""
-#: c-common.c:4663
+#: c-common.c:4735
msgid ""
"tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-"
"dynamic\" or \"global-dynamic\""
msgstr ""
-#: c-common.c:4685 c-common.c:4731
+#: c-common.c:4757 c-common.c:4803
msgid "%J%qE attribute applies only to functions"
msgstr ""
-#: c-common.c:4690 c-common.c:4736
+#: c-common.c:4762 c-common.c:4808
msgid "%Jcan%'t set %qE attribute after definition"
msgstr ""
-#: c-common.c:4812
+#: c-common.c:4884
#, c-format
msgid "%qs attribute ignored for %qs"
msgstr ""
-#: c-common.c:4873
+#: c-common.c:4945
#, c-format
msgid "invalid vector type for attribute %qs"
msgstr ""
-#: c-common.c:4882
+#: c-common.c:4954
msgid "number of components of the vector not a power of two"
msgstr ""
-#: c-common.c:4910
+#: c-common.c:4982
msgid "nonnull attribute without arguments on a non-prototype"
msgstr ""
-#: c-common.c:4925
+#: c-common.c:4997
#, c-format
msgid "nonnull argument has invalid operand number (argument %lu)"
msgstr ""
-#: c-common.c:4944
+#: c-common.c:5016
#, c-format
msgid ""
"nonnull argument with out-of-range operand number (argument %lu, operand %lu)"
msgstr ""
-#: c-common.c:4952
+#: c-common.c:5024
#, c-format
msgid ""
"nonnull argument references non-pointer operand (argument %lu, operand %lu)"
msgstr ""
-#: c-common.c:5007 c-common.c:5044
+#: c-common.c:5079 c-common.c:5116
msgid "missing sentinel in function call"
msgstr ""
-#: c-common.c:5030
+#: c-common.c:5102
msgid "not enough arguments to fit a sentinel"
msgstr ""
-#: c-common.c:5086
+#: c-common.c:5158
#, c-format
msgid "null argument where non-null required (argument %lu)"
msgstr ""
-#: c-common.c:5157
+#: c-common.c:5229
msgid "cleanup argument not an identifier"
msgstr ""
-#: c-common.c:5164
+#: c-common.c:5236
msgid "cleanup argument not a function"
msgstr ""
-#: c-common.c:5202
+#: c-common.c:5274
#, c-format
msgid "%qs attribute requires prototypes with named arguments"
msgstr ""
-#: c-common.c:5213
+#: c-common.c:5285
#, c-format
msgid "%qs attribute only applies to variadic functions"
msgstr ""
-#: c-common.c:5226
+#: c-common.c:5298
msgid "requested position is not an integer constant"
msgstr ""
-#: c-common.c:5233
+#: c-common.c:5305
msgid "requested position is less than zero"
msgstr ""
-#: c-common.c:5539
+#: c-common.c:5611
msgid ""
"%Hignoring return value of %qD, declared with attribute warn_unused_result"
msgstr ""
-#: c-common.c:5543
+#: c-common.c:5615
msgid ""
"%Hignoring return value of function declared with attribute "
"warn_unused_result"
msgstr ""
-#: c-common.c:5582
+#: c-common.c:5675
#, c-format
msgid "attempt to take address of bit-field structure member %qs"
msgstr ""
-#: c-common.c:5634
+#: c-common.c:5727
msgid "invalid lvalue in assignment"
msgstr ""
-#: c-common.c:5637
+#: c-common.c:5730
msgid "invalid lvalue in increment"
msgstr ""
-#: c-common.c:5640
+#: c-common.c:5733
msgid "invalid lvalue in decrement"
msgstr ""
-#: c-common.c:5643
+#: c-common.c:5736
msgid "invalid lvalue in unary %<&%>"
msgstr ""
-#: c-common.c:5646
+#: c-common.c:5739
msgid "invalid lvalue in asm statement"
msgstr ""
@@ -592,346 +601,349 @@ msgstr ""
#. an unprototyped function, it is compile-time undefined;
#. making it a constraint in that case was rejected in
#. DR#252.
-#: c-convert.c:83 c-typeck.c:1354 c-typeck.c:3446 cp/typeck.c:1380
-#: cp/typeck.c:5940 fortran/convert.c:89 treelang/tree-convert.c:79
+#: c-convert.c:83 c-typeck.c:1430 c-typeck.c:3526 cp/typeck.c:1351
+#: cp/typeck.c:5842 fortran/convert.c:89 treelang/tree-convert.c:79
msgid "void value not ignored as it ought to be"
msgstr ""
-#: c-convert.c:121 fortran/convert.c:122 java/typeck.c:158
+#: c-convert.c:121 fortran/convert.c:122 java/typeck.c:156
#: treelang/tree-convert.c:105
msgid "conversion to non-scalar type requested"
msgstr ""
-#: c-decl.c:524
+#: c-decl.c:530
msgid "%Jarray %qD assumed to have one element"
msgstr ""
-#: c-decl.c:637
+#: c-decl.c:643
#, c-format
msgid "GCC supports only %u nested scopes"
msgstr ""
-#: c-decl.c:721
+#: c-decl.c:727
msgid "%Jlabel %qD used but not defined"
msgstr ""
-#: c-decl.c:727
+#: c-decl.c:733
msgid "%Jlabel %qD defined but not used"
msgstr ""
-#: c-decl.c:729
+#: c-decl.c:735
msgid "%Jlabel %qD declared but not defined"
msgstr ""
-#: c-decl.c:772 cp/decl.c:575
+#: c-decl.c:770
+msgid "%Jnested function %qD declared but never defined"
+msgstr ""
+
+#: c-decl.c:784 cp/decl.c:568
msgid "%Junused variable %qD"
msgstr ""
-#: c-decl.c:776
+#: c-decl.c:788
msgid "%Jtype of array %qD completed incompatibly with implicit initialization"
msgstr ""
-#: c-decl.c:1008
+#: c-decl.c:1022
msgid ""
"a parameter list with an ellipsis can%'t match an empty parameter name list "
"declaration"
msgstr ""
-#: c-decl.c:1015
+#: c-decl.c:1029
msgid ""
"an argument type that has a default promotion can%'t match an empty "
"parameter name list declaration"
msgstr ""
-#: c-decl.c:1051
+#: c-decl.c:1065
msgid ""
"%Jprototype for %qD declares more arguments than previous old-style "
"definition"
msgstr ""
-#: c-decl.c:1057
+#: c-decl.c:1071
msgid ""
"%Jprototype for %qD declares fewer arguments than previous old-style "
"definition"
msgstr ""
-#: c-decl.c:1066
+#: c-decl.c:1080
msgid "%Jprototype for %qD declares argument %d with incompatible type"
msgstr ""
#. If we get here, no errors were found, but do issue a warning
#. for this poor-style construct.
-#: c-decl.c:1079
+#: c-decl.c:1093
msgid "%Jprototype for %qD follows non-prototype definition"
msgstr ""
-#: c-decl.c:1094
+#: c-decl.c:1108
msgid "%Jprevious definition of %qD was here"
msgstr ""
-#: c-decl.c:1096
+#: c-decl.c:1110
msgid "%Jprevious implicit declaration of %qD was here"
msgstr ""
-#: c-decl.c:1098
+#: c-decl.c:1112
msgid "%Jprevious declaration of %qD was here"
msgstr ""
-#: c-decl.c:1134
+#: c-decl.c:1149
msgid "%J%qD redeclared as different kind of symbol"
msgstr ""
-#: c-decl.c:1139
+#: c-decl.c:1154
msgid "%Jbuilt-in function %qD declared as non-function"
msgstr ""
-#: c-decl.c:1142 c-decl.c:1246 c-decl.c:1815
+#: c-decl.c:1157 c-decl.c:1273 c-decl.c:1879
msgid "%Jdeclaration of %qD shadows a built-in function"
msgstr ""
-#: c-decl.c:1151
+#: c-decl.c:1166
msgid "%Jredeclaration of enumerator %qD"
msgstr ""
#. If types don't match for a built-in, throw away the
#. built-in. No point in calling locate_old_decl here, it
#. won't print anything.
-#: c-decl.c:1172
+#: c-decl.c:1187
msgid "%Jconflicting types for built-in function %qD"
msgstr ""
-#: c-decl.c:1196 c-decl.c:1207
+#: c-decl.c:1211 c-decl.c:1224 c-decl.c:1234
msgid "%Jconflicting types for %qD"
msgstr ""
-#: c-decl.c:1205
+#: c-decl.c:1232
msgid "%J conflicting type qualifiers for %qD"
msgstr ""
#. Allow OLDDECL to continue in use.
-#: c-decl.c:1222
+#: c-decl.c:1249
msgid "%Jredefinition of typedef %qD"
msgstr ""
-#: c-decl.c:1261 c-decl.c:1339
+#: c-decl.c:1291 c-decl.c:1301 c-decl.c:1314 c-decl.c:1396
msgid "%Jredefinition of %qD"
msgstr ""
-#: c-decl.c:1296 c-decl.c:1377
+#: c-decl.c:1353 c-decl.c:1434
msgid "%Jstatic declaration of %qD follows non-static declaration"
msgstr ""
-#: c-decl.c:1306 c-decl.c:1313 c-decl.c:1366 c-decl.c:1374
+#: c-decl.c:1363 c-decl.c:1370 c-decl.c:1423 c-decl.c:1431
msgid "%Jnon-static declaration of %qD follows static declaration"
msgstr ""
-#: c-decl.c:1326
+#: c-decl.c:1383
msgid "%Jthread-local declaration of %qD follows non-thread-local declaration"
msgstr ""
-#: c-decl.c:1329
+#: c-decl.c:1386
msgid "%Jnon-thread-local declaration of %qD follows thread-local declaration"
msgstr ""
-#: c-decl.c:1359
+#: c-decl.c:1416
msgid "%Jextern declaration of %qD follows declaration with no linkage"
msgstr ""
-#: c-decl.c:1395
+#: c-decl.c:1452
msgid "%Jdeclaration of %qD with no linkage follows extern declaration"
msgstr ""
-#: c-decl.c:1401
+#: c-decl.c:1458
msgid "%Jredeclaration of %qD with no linkage"
msgstr ""
-#: c-decl.c:1415
+#: c-decl.c:1472
msgid ""
"%Jredeclaration of %qD with different visibility (old visibility preserved)"
msgstr ""
-#: c-decl.c:1426
+#: c-decl.c:1483
msgid "%Jinline declaration of %qD follows declaration with attribute noinline"
msgstr ""
-#: c-decl.c:1433
+#: c-decl.c:1490
msgid ""
"%Jdeclaration of %qD with attribute noinline follows inline declaration "
msgstr ""
-#: c-decl.c:1448
+#: c-decl.c:1505
msgid "%J%qD declared inline after being called"
msgstr ""
-#: c-decl.c:1454
+#: c-decl.c:1511
msgid "%J%qD declared inline after its definition"
msgstr ""
-#: c-decl.c:1474
+#: c-decl.c:1531
msgid "%Jredefinition of parameter %qD"
msgstr ""
-#: c-decl.c:1498
+#: c-decl.c:1555
msgid "%Jredundant redeclaration of %qD"
msgstr ""
-#: c-decl.c:1808
+#: c-decl.c:1866
+msgid "%Jdeclaration of %qD shadows previous non-variable"
+msgstr ""
+
+#: c-decl.c:1871
msgid "%Jdeclaration of %qD shadows a parameter"
msgstr ""
-#: c-decl.c:1811
+#: c-decl.c:1874
msgid "%Jdeclaration of %qD shadows a global declaration"
msgstr ""
-#: c-decl.c:1818
+#: c-decl.c:1884
msgid "%Jdeclaration of %qD shadows a previous local"
msgstr ""
-#: c-decl.c:1823 cp/name-lookup.c:942 cp/name-lookup.c:973
+#: c-decl.c:1887 cp/name-lookup.c:942 cp/name-lookup.c:973
#: cp/name-lookup.c:981
msgid "%Jshadowed declaration is here"
msgstr ""
-#: c-decl.c:1977
+#: c-decl.c:2041
msgid "nested extern declaration of %qD"
msgstr ""
-#: c-decl.c:2067
-msgid "nested static declaration of %qD"
-msgstr ""
-
-#: c-decl.c:2161
+#: c-decl.c:2201
#, c-format
msgid "implicit declaration of function %qE"
msgstr ""
-#: c-decl.c:2219
+#: c-decl.c:2262
msgid "incompatible implicit declaration of built-in function %qD"
msgstr ""
-#: c-decl.c:2228
+#: c-decl.c:2271
msgid "incompatible implicit declaration of function %qD"
msgstr ""
-#: c-decl.c:2281
+#: c-decl.c:2324
#, c-format
msgid "%qE undeclared here (not in a function)"
msgstr ""
-#: c-decl.c:2286
+#: c-decl.c:2329
#, c-format
msgid "%qE undeclared (first use in this function)"
msgstr ""
-#: c-decl.c:2290
+#: c-decl.c:2333
msgid "(Each undeclared identifier is reported only once"
msgstr ""
-#: c-decl.c:2291
+#: c-decl.c:2334
msgid "for each function it appears in.)"
msgstr ""
-#: c-decl.c:2329
+#: c-decl.c:2372
#, c-format
msgid "label %qs referenced outside of any function"
msgstr ""
-#: c-decl.c:2372
+#: c-decl.c:2415
#, c-format
msgid "duplicate label declaration %qs"
msgstr ""
-#: c-decl.c:2407
+#: c-decl.c:2450
msgid "%Hduplicate label %qD"
msgstr ""
-#: c-decl.c:2429
+#: c-decl.c:2472
msgid ""
"%Htraditional C lacks a separate namespace for labels, identifier %qs "
"conflicts"
msgstr ""
-#: c-decl.c:2495
+#: c-decl.c:2538
msgid "%H%qs defined as wrong kind of tag"
msgstr ""
-#: c-decl.c:2718
+#: c-decl.c:2761
msgid "unnamed struct/union that defines no instances"
msgstr ""
-#: c-decl.c:2726
+#: c-decl.c:2769
msgid "empty declaration with storage class specifier does not redeclare tag"
msgstr ""
-#: c-decl.c:2737
+#: c-decl.c:2780
msgid "empty declaration with type qualifier does not redeclare tag"
msgstr ""
-#: c-decl.c:2758 c-decl.c:2765
+#: c-decl.c:2801 c-decl.c:2808
msgid "useless type name in empty declaration"
msgstr ""
-#: c-decl.c:2773
+#: c-decl.c:2816
msgid "%<inline%> in empty declaration"
msgstr ""
-#: c-decl.c:2779
+#: c-decl.c:2822
msgid "%<auto%> in file-scope empty declaration"
msgstr ""
-#: c-decl.c:2785
+#: c-decl.c:2828
msgid "%<register%> in file-scope empty declaration"
msgstr ""
-#: c-decl.c:2791
+#: c-decl.c:2834
msgid "useless storage class specifier in empty declaration"
msgstr ""
-#: c-decl.c:2797
+#: c-decl.c:2840
msgid "useless %<__thread%> in empty declaration"
msgstr ""
-#: c-decl.c:2805
+#: c-decl.c:2848
msgid "useless type qualifier in empty declaration"
msgstr ""
-#: c-decl.c:2812 c-parse.y:781 c-parse.y:783 objc/objc-parse.y:818
-#: objc/objc-parse.y:820
+#: c-decl.c:2855 c-parser.c:1160
msgid "empty declaration"
msgstr ""
-#: c-decl.c:2878
+#: c-decl.c:2921
msgid ""
"ISO C90 does not support %<static%> or type qualifiers in parameter array "
"declarators"
msgstr ""
-#: c-decl.c:2881
+#: c-decl.c:2924
msgid "ISO C90 does not support %<[*]%> array declarators"
msgstr ""
-#: c-decl.c:2884
+#: c-decl.c:2927
msgid "GCC does not yet properly implement %<[*]%> array declarators"
msgstr ""
-#: c-decl.c:2903
+#: c-decl.c:2946
msgid "static or type qualifiers in abstract declarator"
msgstr ""
-#: c-decl.c:2960
+#: c-decl.c:3005
msgid "%J%qD is usually a function"
msgstr ""
-#: c-decl.c:2969 cp/decl.c:3718 cp/decl2.c:853
+#: c-decl.c:3014 cp/decl.c:3617 cp/decl2.c:850
msgid "typedef %qD is initialized (use __typeof__ instead)"
msgstr ""
-#: c-decl.c:2974
+#: c-decl.c:3019
msgid "function %qD is initialized like a variable"
msgstr ""
#. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE.
-#: c-decl.c:2980
+#: c-decl.c:3025
msgid "parameter %qD is initialized"
msgstr ""
@@ -939,753 +951,749 @@ msgstr ""
#. of VLAs themselves count as VLAs, it does not make
#. sense to permit them to be initialized given that
#. ordinary VLAs may not be initialized.
-#: c-decl.c:2999 c-decl.c:3019 c-typeck.c:4280
+#: c-decl.c:3044 c-decl.c:3059 c-typeck.c:4380
msgid "variable-sized object may not be initialized"
msgstr ""
-#: c-decl.c:3005
+#: c-decl.c:3050
msgid "variable %qD has initializer but incomplete type"
msgstr ""
-#: c-decl.c:3010
-msgid "elements of array %qD have incomplete type"
-msgstr ""
-
-#: c-decl.c:3086 c-decl.c:5696 cp/decl.c:3758 cp/decl.c:9944
+#: c-decl.c:3126 c-decl.c:5741 cp/decl.c:3657 cp/decl.c:9941
msgid "%Jinline function %qD given attribute noinline"
msgstr ""
-#: c-decl.c:3154
+#: c-decl.c:3194
msgid "%Jinitializer fails to determine size of %qD"
msgstr ""
-#: c-decl.c:3159
+#: c-decl.c:3199
msgid "%Jarray size missing in %qD"
msgstr ""
-#: c-decl.c:3175
+#: c-decl.c:3215
msgid "%Jzero or negative size array %qD"
msgstr ""
-#: c-decl.c:3201 varasm.c:1541
+#: c-decl.c:3241 varasm.c:1556
msgid "%Jstorage size of %qD isn%'t known"
msgstr ""
-#: c-decl.c:3211
+#: c-decl.c:3251
msgid "%Jstorage size of %qD isn%'t constant"
msgstr ""
-#: c-decl.c:3266
+#: c-decl.c:3299
msgid "%Jignoring asm-specifier for non-static local variable %qD"
msgstr ""
-#: c-decl.c:3296 fortran/f95-lang.c:647
+#: c-decl.c:3329 fortran/f95-lang.c:646
msgid "cannot put object with volatile field into register"
msgstr ""
-#: c-decl.c:3430
+#: c-decl.c:3463
msgid "ISO C forbids forward parameter declarations"
msgstr ""
-#: c-decl.c:3614
+#: c-decl.c:3648
msgid "<anonymous>"
msgstr ""
-#: c-decl.c:3623
+#: c-decl.c:3657
#, c-format
msgid "bit-field %qs width not an integer constant"
msgstr ""
-#: c-decl.c:3631
+#: c-decl.c:3665
#, c-format
msgid "negative width in bit-field %qs"
msgstr ""
-#: c-decl.c:3636
+#: c-decl.c:3670
#, c-format
msgid "zero width for bit-field %qs"
msgstr ""
-#: c-decl.c:3646
+#: c-decl.c:3680
#, c-format
msgid "bit-field %qs has invalid type"
msgstr ""
-#: c-decl.c:3655
+#: c-decl.c:3689
#, c-format
msgid "type of bit-field %qs is a GCC extension"
msgstr ""
-#: c-decl.c:3664
+#: c-decl.c:3698
#, c-format
msgid "width of %qs exceeds its type"
msgstr ""
-#: c-decl.c:3677
+#: c-decl.c:3711
#, c-format
msgid "%qs is narrower than values of its type"
msgstr ""
-#: c-decl.c:3802
+#: c-decl.c:3836
msgid "type defaults to %<int%> in declaration of %qs"
msgstr ""
-#: c-decl.c:3830
+#: c-decl.c:3864
msgid "duplicate %<const%>"
msgstr ""
-#: c-decl.c:3832
+#: c-decl.c:3866
msgid "duplicate %<restrict%>"
msgstr ""
-#: c-decl.c:3834
+#: c-decl.c:3868
msgid "duplicate %<volatile%>"
msgstr ""
-#: c-decl.c:3853
+#: c-decl.c:3887
msgid "function definition declared %<auto%>"
msgstr ""
-#: c-decl.c:3855
+#: c-decl.c:3889
msgid "function definition declared %<register%>"
msgstr ""
-#: c-decl.c:3857
+#: c-decl.c:3891
msgid "function definition declared %<typedef%>"
msgstr ""
-#: c-decl.c:3859
+#: c-decl.c:3893
msgid "function definition declared %<__thread%>"
msgstr ""
-#: c-decl.c:3875
+#: c-decl.c:3909
#, c-format
msgid "storage class specified for structure field %qs"
msgstr ""
-#: c-decl.c:3879 cp/decl.c:7120
+#: c-decl.c:3913 cp/decl.c:7053
#, c-format
msgid "storage class specified for parameter %qs"
msgstr ""
-#: c-decl.c:3882 cp/decl.c:7122
+#: c-decl.c:3916 cp/decl.c:7055
msgid "storage class specified for typename"
msgstr ""
-#: c-decl.c:3895 cp/decl.c:7139
+#: c-decl.c:3929 cp/decl.c:7072
msgid "%qs initialized and declared %<extern%>"
msgstr ""
-#: c-decl.c:3897 cp/decl.c:7142
+#: c-decl.c:3931 cp/decl.c:7075
msgid "%qs has both %<extern%> and initializer"
msgstr ""
-#: c-decl.c:3902
+#: c-decl.c:3936
msgid "file-scope declaration of %qs specifies %<auto%>"
msgstr ""
-#: c-decl.c:3904
+#: c-decl.c:3938
msgid "file-scope declaration of %qs specifies %<register%>"
msgstr ""
-#: c-decl.c:3909 cp/decl.c:7146
+#: c-decl.c:3943 cp/decl.c:7079
msgid "nested function %qs declared %<extern%>"
msgstr ""
-#: c-decl.c:3912 cp/decl.c:7156
+#: c-decl.c:3946 cp/decl.c:7089
msgid "function-scope %qs implicitly auto and declared %<__thread%>"
msgstr ""
#. Only the innermost declarator (making a parameter be of
#. array type which is converted to pointer type)
#. may have static or type qualifiers.
-#: c-decl.c:3953 c-decl.c:4142
+#: c-decl.c:3993 c-decl.c:4183
msgid "static or type qualifiers in non-parameter array declarator"
msgstr ""
-#: c-decl.c:3999
+#: c-decl.c:4039
#, c-format
msgid "declaration of %qs as array of voids"
msgstr ""
-#: c-decl.c:4005
+#: c-decl.c:4045
#, c-format
msgid "declaration of %qs as array of functions"
msgstr ""
-#: c-decl.c:4010
+#: c-decl.c:4050
msgid "invalid use of structure with flexible array member"
msgstr ""
-#: c-decl.c:4030
+#: c-decl.c:4070
#, c-format
msgid "size of array %qs has non-integer type"
msgstr ""
-#: c-decl.c:4035
+#: c-decl.c:4075
#, c-format
msgid "ISO C forbids zero-size array %qs"
msgstr ""
-#: c-decl.c:4042
+#: c-decl.c:4082
#, c-format
msgid "size of array %qs is negative"
msgstr ""
-#: c-decl.c:4056
+#: c-decl.c:4096
msgid "ISO C90 forbids array %qs whose size can%'t be evaluated"
msgstr ""
-#: c-decl.c:4060
+#: c-decl.c:4100
#, c-format
msgid "ISO C90 forbids variable-size array %qs"
msgstr ""
-#: c-decl.c:4093 c-decl.c:4261 cp/decl.c:7559
+#: c-decl.c:4139 c-decl.c:4303 cp/decl.c:7509
#, c-format
msgid "size of array %qs is too large"
msgstr ""
-#: c-decl.c:4106
+#: c-decl.c:4150
msgid "ISO C90 does not support flexible array members"
msgstr ""
-#: c-decl.c:4115
+#: c-decl.c:4160
msgid "array type has incomplete element type"
msgstr ""
-#: c-decl.c:4174 cp/decl.c:7248
+#: c-decl.c:4215 cp/decl.c:7179
#, c-format
msgid "%qs declared as function returning a function"
msgstr ""
-#: c-decl.c:4179 cp/decl.c:7253
+#: c-decl.c:4220 cp/decl.c:7184
#, c-format
msgid "%qs declared as function returning an array"
msgstr ""
-#: c-decl.c:4199
+#: c-decl.c:4240
msgid "function definition has qualified void return type"
msgstr ""
-#: c-decl.c:4201
+#: c-decl.c:4242
msgid "type qualifiers ignored on function return type"
msgstr ""
-#: c-decl.c:4230 c-decl.c:4274 c-decl.c:4368 c-decl.c:4455
+#: c-decl.c:4271 c-decl.c:4316 c-decl.c:4410 c-decl.c:4501
msgid "ISO C forbids qualified function types"
msgstr ""
-#: c-decl.c:4282
+#: c-decl.c:4324
msgid "%Jtypedef %qD declared %<inline%>"
msgstr ""
-#: c-decl.c:4312
+#: c-decl.c:4354
msgid "ISO C forbids const or volatile function types"
msgstr ""
-#: c-decl.c:4332
+#: c-decl.c:4374
#, c-format
msgid "variable or field %qs declared void"
msgstr ""
-#: c-decl.c:4361
+#: c-decl.c:4403
msgid "attributes in parameter array declarator ignored"
msgstr ""
-#: c-decl.c:4396
+#: c-decl.c:4438
msgid "%Jparameter %qD declared %<inline%>"
msgstr ""
-#: c-decl.c:4409
+#: c-decl.c:4451
#, c-format
msgid "field %qs declared as a function"
msgstr ""
-#: c-decl.c:4415
+#: c-decl.c:4457
#, c-format
msgid "field %qs has incomplete type"
msgstr ""
-#: c-decl.c:4432 c-decl.c:4443 c-decl.c:4446
+#: c-decl.c:4471 c-decl.c:4483 c-decl.c:4487
#, c-format
msgid "invalid storage class for function %qs"
msgstr ""
-#: c-decl.c:4461
+#: c-decl.c:4507
msgid "%<noreturn%> function returns non-void value"
msgstr ""
-#: c-decl.c:4489
+#: c-decl.c:4535
msgid "cannot inline function %<main%>"
msgstr ""
-#: c-decl.c:4546
+#: c-decl.c:4582
msgid "variable previously declared %<static%> redeclared %<extern%>"
msgstr ""
-#: c-decl.c:4555
+#: c-decl.c:4591
msgid "%Jvariable %qD declared %<inline%>"
msgstr ""
#. A mere warning is sure to result in improper semantics
#. at runtime. Don't bother to allow this to compile.
-#: c-decl.c:4586 cp/decl.c:5994
+#: c-decl.c:4622 cp/decl.c:5920
msgid "thread-local storage not supported for this target"
msgstr ""
-#: c-decl.c:4648 c-decl.c:5733
+#: c-decl.c:4684 c-decl.c:5778
msgid "function declaration isn%'t a prototype"
msgstr ""
-#: c-decl.c:4656
+#: c-decl.c:4692
msgid "parameter names (without types) in function declaration"
msgstr ""
-#: c-decl.c:4689
+#: c-decl.c:4725
msgid "%Jparameter %u (%qD) has incomplete type"
msgstr ""
-#: c-decl.c:4692
+#: c-decl.c:4728
msgid "%Jparameter %u has incomplete type"
msgstr ""
-#: c-decl.c:4701
+#: c-decl.c:4737
msgid "%Jparameter %u (%qD) has void type"
msgstr ""
-#: c-decl.c:4704
+#: c-decl.c:4740
msgid "%Jparameter %u has void type"
msgstr ""
-#: c-decl.c:4761
+#: c-decl.c:4797
msgid "%<void%> as only parameter may not be qualified"
msgstr ""
-#: c-decl.c:4765 c-decl.c:4800
+#: c-decl.c:4801 c-decl.c:4836
msgid "%<void%> must be the only parameter"
msgstr ""
-#: c-decl.c:4793
+#: c-decl.c:4829
msgid "%Jparameter %qD has just a forward declaration"
msgstr ""
#. The %s will be one of 'struct', 'union', or 'enum'.
-#: c-decl.c:4839
+#: c-decl.c:4875
msgid "%<%s %E%> declared inside parameter list"
msgstr ""
#. The %s will be one of 'struct', 'union', or 'enum'.
-#: c-decl.c:4843
+#: c-decl.c:4879
#, c-format
msgid "anonymous %s declared inside parameter list"
msgstr ""
-#: c-decl.c:4848
+#: c-decl.c:4884
msgid ""
"its scope is only this definition or declaration, which is probably not what "
"you want"
msgstr ""
-#: c-decl.c:4981
+#: c-decl.c:5017
msgid "redefinition of %<union %s%>"
msgstr ""
-#: c-decl.c:4983
+#: c-decl.c:5019
msgid "redefinition of %<struct %s%>"
msgstr ""
-#: c-decl.c:4988
+#: c-decl.c:5024
msgid "nested redefinition of %<union %s%>"
msgstr ""
-#: c-decl.c:4991
+#: c-decl.c:5027
msgid "nested redefinition of %<struct %s%>"
msgstr ""
-#: c-decl.c:5063 cp/decl.c:3517
+#: c-decl.c:5099 cp/decl.c:3414
msgid "declaration does not declare anything"
msgstr ""
-#: c-decl.c:5067
+#: c-decl.c:5103
msgid "ISO C doesn%'t support unnamed structs/unions"
msgstr ""
-#: c-decl.c:5110 c-decl.c:5126
+#: c-decl.c:5146 c-decl.c:5162
msgid "%Jduplicate member %qD"
msgstr ""
-#: c-decl.c:5165
+#: c-decl.c:5201
msgid "union has no named members"
msgstr ""
-#: c-decl.c:5167
+#: c-decl.c:5203
msgid "union has no members"
msgstr ""
-#: c-decl.c:5172
+#: c-decl.c:5208
msgid "struct has no named members"
msgstr ""
-#: c-decl.c:5174
+#: c-decl.c:5210
msgid "struct has no members"
msgstr ""
-#: c-decl.c:5231
+#: c-decl.c:5267
msgid "%Jflexible array member in union"
msgstr ""
-#: c-decl.c:5236
+#: c-decl.c:5272
msgid "%Jflexible array member not at end of struct"
msgstr ""
-#: c-decl.c:5241
+#: c-decl.c:5277
msgid "%Jflexible array member in otherwise empty struct"
msgstr ""
-#: c-decl.c:5248
+#: c-decl.c:5284
msgid "%Jinvalid use of structure with flexible array member"
msgstr ""
-#: c-decl.c:5353
+#: c-decl.c:5392
msgid "union cannot be made transparent"
msgstr ""
-#: c-decl.c:5418
+#: c-decl.c:5463
msgid "nested redefinition of %<enum %s%>"
msgstr ""
#. This enum is a named one that has been declared already.
-#: c-decl.c:5425
+#: c-decl.c:5470
msgid "redeclaration of %<enum %s%>"
msgstr ""
-#: c-decl.c:5488
+#: c-decl.c:5533
msgid "enumeration values exceed range of largest integer"
msgstr ""
-#: c-decl.c:5505
+#: c-decl.c:5550
msgid "specified mode too small for enumeral values"
msgstr ""
-#: c-decl.c:5604
+#: c-decl.c:5649
#, c-format
msgid "enumerator value for %qE is not an integer constant"
msgstr ""
-#: c-decl.c:5621
+#: c-decl.c:5666
msgid "overflow in enumeration values"
msgstr ""
-#: c-decl.c:5626
+#: c-decl.c:5671
msgid "ISO C restricts enumerator values to range of %<int%>"
msgstr ""
-#: c-decl.c:5702
+#: c-decl.c:5747
msgid "return type is an incomplete type"
msgstr ""
-#: c-decl.c:5710
+#: c-decl.c:5755
msgid "return type defaults to %<int%>"
msgstr ""
-#: c-decl.c:5739
+#: c-decl.c:5784
msgid "%Jno previous prototype for %qD"
msgstr ""
-#: c-decl.c:5745
+#: c-decl.c:5790
msgid "%J%qD was used with no prototype before its definition"
msgstr ""
-#: c-decl.c:5752
+#: c-decl.c:5797
msgid "%Jno previous declaration for %qD"
msgstr ""
-#: c-decl.c:5758
+#: c-decl.c:5803
msgid "%J%qD was used with no declaration before its definition"
msgstr ""
-#: c-decl.c:5791 c-decl.c:6280
+#: c-decl.c:5836 c-decl.c:6328
msgid "%Jreturn type of %qD is not %<int%>"
msgstr ""
-#: c-decl.c:5806
+#: c-decl.c:5851
msgid "%Jfirst argument of %qD should be %<int%>"
msgstr ""
-#: c-decl.c:5815
+#: c-decl.c:5860
msgid "%Jsecond argument of %qD should be %<char **%>"
msgstr ""
-#: c-decl.c:5824
+#: c-decl.c:5869
msgid "%Jthird argument of %qD should probably be %<char **%>"
msgstr ""
-#: c-decl.c:5834
+#: c-decl.c:5879
msgid "%J%qD takes only zero or two arguments"
msgstr ""
-#: c-decl.c:5837
+#: c-decl.c:5882
msgid "%J%qD is normally a non-static function"
msgstr ""
-#: c-decl.c:5883
+#: c-decl.c:5928
msgid "%Jold-style parameter declarations in prototyped function definition"
msgstr ""
-#: c-decl.c:5896
+#: c-decl.c:5941
msgid "%Jtraditional C rejects ISO C style function definitions"
msgstr ""
-#: c-decl.c:5908
+#: c-decl.c:5953
msgid "%Jparameter name omitted"
msgstr ""
-#: c-decl.c:5948
+#: c-decl.c:5993
msgid "%Jold-style function definition"
msgstr ""
-#: c-decl.c:5956
+#: c-decl.c:6001
msgid "%Jparameter name missing from parameter list"
msgstr ""
-#: c-decl.c:5967
+#: c-decl.c:6012
msgid "%J%qD declared as a non-parameter"
msgstr ""
-#: c-decl.c:5972
+#: c-decl.c:6017
msgid "%Jmultiple parameters named %qD"
msgstr ""
-#: c-decl.c:5980
+#: c-decl.c:6025
msgid "%Jparameter %qD declared with void type"
msgstr ""
-#: c-decl.c:5995 c-decl.c:5997
+#: c-decl.c:6040 c-decl.c:6042
msgid "%Jtype of %qD defaults to %<int%>"
msgstr ""
-#: c-decl.c:6016
+#: c-decl.c:6061
msgid "%Jparameter %qD has incomplete type"
msgstr ""
-#: c-decl.c:6022
+#: c-decl.c:6067
msgid "%Jdeclaration for parameter %qD but no such parameter"
msgstr ""
-#: c-decl.c:6072
+#: c-decl.c:6117
msgid "number of arguments doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6073 c-decl.c:6103 c-decl.c:6110
+#: c-decl.c:6118 c-decl.c:6148 c-decl.c:6155
msgid "%Hprototype declaration"
msgstr ""
-#: c-decl.c:6101
+#: c-decl.c:6146
msgid "promoted argument %qD doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6109
+#: c-decl.c:6154
msgid "argument %qD doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6307 cp/decl.c:10698
+#: c-decl.c:6361 cp/decl.c:10702
msgid "no return statement in function returning non-void"
msgstr ""
-#: c-decl.c:6314
+#: c-decl.c:6368
msgid "this function may return with or without a value"
msgstr ""
#. If we get here, declarations have been used in a for loop without
#. the C99 for loop scope. This doesn't make much sense, so don't
#. allow it.
-#: c-decl.c:6403
+#: c-decl.c:6461
msgid "%<for%> loop initial declaration used outside C99 mode"
msgstr ""
-#: c-decl.c:6432
+#: c-decl.c:6490
msgid ""
"%Jdeclaration of static variable %qD in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6435
+#: c-decl.c:6493
msgid ""
"%Jdeclaration of %<extern%> variable %qD in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6440
+#: c-decl.c:6498
msgid "%<struct %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6444
+#: c-decl.c:6502
msgid "%<union %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6448
+#: c-decl.c:6506
msgid "%<enum %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6452
+#: c-decl.c:6510
msgid "%Jdeclaration of non-variable %qD in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6741 c-decl.c:6890 c-decl.c:7101 cp/decl.c:6828
+#: c-decl.c:6802 c-decl.c:6953 c-decl.c:7165 cp/decl.c:6747
#, c-format
msgid "duplicate %qs"
msgstr ""
-#: c-decl.c:6762 c-decl.c:6899 c-decl.c:7002
+#: c-decl.c:6825 c-decl.c:6962 c-decl.c:7065
msgid "two or more data types in declaration specifiers"
msgstr ""
-#: c-decl.c:6774 cp/decl.c:6804
+#: c-decl.c:6837 cp/decl.c:6723
msgid "%<long long long%> is too long for GCC"
msgstr ""
-#: c-decl.c:6781 c-decl.c:6973
+#: c-decl.c:6844 c-decl.c:7036
msgid "both %<long long%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6787
+#: c-decl.c:6850
msgid "ISO C90 does not support %<long long%>"
msgstr ""
-#: c-decl.c:6792 c-decl.c:6812
+#: c-decl.c:6855 c-decl.c:6875
msgid "both %<long%> and %<short%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6795 c-decl.c:6906
+#: c-decl.c:6858 c-decl.c:6969
msgid "both %<long%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6798 c-decl.c:6925
+#: c-decl.c:6861 c-decl.c:6988
msgid "both %<long%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6801 c-decl.c:6944
+#: c-decl.c:6864 c-decl.c:7007
msgid "both %<long%> and %<char%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6804 c-decl.c:6957
+#: c-decl.c:6867 c-decl.c:7020
msgid "both %<long%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6815 c-decl.c:6909
+#: c-decl.c:6878 c-decl.c:6972
msgid "both %<short%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6818 c-decl.c:6928
+#: c-decl.c:6881 c-decl.c:6991
msgid "both %<short%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6821 c-decl.c:6947
+#: c-decl.c:6884 c-decl.c:7010
msgid "both %<short%> and %<char%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6824 c-decl.c:6960
+#: c-decl.c:6887 c-decl.c:7023
msgid "both %<short%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6827 c-decl.c:6976
+#: c-decl.c:6890 c-decl.c:7039
msgid "both %<short%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6835 c-decl.c:6855
+#: c-decl.c:6898 c-decl.c:6918
msgid "both %<signed%> and %<unsigned%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6838 c-decl.c:6912
+#: c-decl.c:6901 c-decl.c:6975
msgid "both %<signed%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6841 c-decl.c:6931
+#: c-decl.c:6904 c-decl.c:6994
msgid "both %<signed%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6844 c-decl.c:6963
+#: c-decl.c:6907 c-decl.c:7026
msgid "both %<signed%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6847 c-decl.c:6979
+#: c-decl.c:6910 c-decl.c:7042
msgid "both %<signed%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6858 c-decl.c:6915
+#: c-decl.c:6921 c-decl.c:6978
msgid "both %<unsigned%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6861 c-decl.c:6934
+#: c-decl.c:6924 c-decl.c:6997
msgid "both %<unsigned%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6864 c-decl.c:6966
+#: c-decl.c:6927 c-decl.c:7029
msgid "both %<unsigned%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6867 c-decl.c:6982
+#: c-decl.c:6930 c-decl.c:7045
msgid "both %<unsigned%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6875
+#: c-decl.c:6938
msgid "ISO C90 does not support complex types"
msgstr ""
-#: c-decl.c:6877 c-decl.c:6918
+#: c-decl.c:6940 c-decl.c:6981
msgid "both %<complex%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:6880 c-decl.c:6937
+#: c-decl.c:6943 c-decl.c:7000
msgid "both %<complex%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7019
+#: c-decl.c:7082
#, c-format
msgid "%qs fails to be a typedef or built in type"
msgstr ""
-#: c-decl.c:7051
+#: c-decl.c:7115
#, c-format
msgid "%qs is not at beginning of declaration"
msgstr ""
-#: c-decl.c:7066
+#: c-decl.c:7130
msgid "%<__thread%> used with %<auto%>"
msgstr ""
-#: c-decl.c:7068
+#: c-decl.c:7132
msgid "%<__thread%> used with %<register%>"
msgstr ""
-#: c-decl.c:7070
+#: c-decl.c:7134
msgid "%<__thread%> used with %<typedef%>"
msgstr ""
-#: c-decl.c:7081 cp/parser.c:7114
+#: c-decl.c:7145 cp/parser.c:7221
msgid "%<__thread%> before %<extern%>"
msgstr ""
-#: c-decl.c:7090 cp/parser.c:7104
+#: c-decl.c:7154 cp/parser.c:7211
msgid "%<__thread%> before %<static%>"
msgstr ""
-#: c-decl.c:7106
+#: c-decl.c:7170
msgid "multiple storage classes in declaration specifiers"
msgstr ""
-#: c-decl.c:7113
+#: c-decl.c:7177
msgid "%<__thread%> used with %qs"
msgstr ""
-#: c-decl.c:7167
+#: c-decl.c:7232
msgid "ISO C does not support plain %<complex%> meaning %<double complex%>"
msgstr ""
-#: c-decl.c:7212 c-decl.c:7238
+#: c-decl.c:7277 c-decl.c:7303
msgid "ISO C does not support complex integer types"
msgstr ""
-#: c-decl.c:7313 toplev.c:844
+#: c-decl.c:7378 toplev.c:848
msgid "%J%qF used but never defined"
msgstr ""
@@ -2190,7 +2198,7 @@ msgstr ""
msgid "statement with no effect"
msgstr ""
-#: c-gimplify.c:315 c-typeck.c:6728 cp/parser.c:6434
+#: c-gimplify.c:315 c-typeck.c:6878 cp/parser.c:6542
msgid "break statement not within loop or switch"
msgstr ""
@@ -2213,17 +2221,17 @@ msgstr ""
msgid "ignoring nonexistent directory \"%s\"\n"
msgstr ""
-#: c-incpath.c:283
+#: c-incpath.c:286
#, c-format
msgid "#include \"...\" search starts here:\n"
msgstr ""
-#: c-incpath.c:287
+#: c-incpath.c:290
#, c-format
msgid "#include <...> search starts here:\n"
msgstr ""
-#: c-incpath.c:292
+#: c-incpath.c:295
#, c-format
msgid "End of search list.\n"
msgstr ""
@@ -2281,43 +2289,33 @@ msgstr ""
msgid "traditional C rejects string constant concatenation"
msgstr ""
-#: c-objc-common.c:81
+#: c-objc-common.c:80
msgid ""
"%Jfunction %qF can never be inlined because it is suppressed using -fno-"
"inline"
msgstr ""
-#: c-objc-common.c:91
+#: c-objc-common.c:90
msgid ""
"%Jfunction %qF can never be inlined because it might not be bound within "
"this unit of translation"
msgstr ""
-#: c-objc-common.c:99
+#: c-objc-common.c:98
msgid ""
"%Jfunction %qF can never be inlined because it uses attributes conflicting "
"with inlining"
msgstr ""
-#: c-objc-common.c:114
-msgid "%Jfunction %qF can never be inlined because it has pending sizes"
-msgstr ""
-
-#: c-objc-common.c:127
-msgid ""
-"%Jnested function %qF can never be inlined because it has possibly saved "
-"pending sizes"
-msgstr ""
-
-#: c-objc-common.c:263
+#: c-objc-common.c:244
msgid "used array that cannot be converted to pointer where scalar is required"
msgstr ""
-#: c-objc-common.c:267
+#: c-objc-common.c:248
msgid "used struct type value where scalar is required"
msgstr ""
-#: c-objc-common.c:271
+#: c-objc-common.c:252
msgid "used union type value where scalar is required"
msgstr ""
@@ -2364,249 +2362,295 @@ msgstr ""
msgid "switch %qs is no longer supported"
msgstr ""
-#: c-opts.c:655
+#: c-opts.c:653
msgid ""
"-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"
msgstr ""
-#: c-opts.c:841
+#: c-opts.c:839
msgid "output filename specified twice"
msgstr ""
-#: c-opts.c:971
+#: c-opts.c:969
msgid "-Wformat-y2k ignored without -Wformat"
msgstr ""
-#: c-opts.c:973
+#: c-opts.c:971
msgid "-Wformat-extra-args ignored without -Wformat"
msgstr ""
-#: c-opts.c:975
+#: c-opts.c:973
msgid "-Wformat-zero-length ignored without -Wformat"
msgstr ""
-#: c-opts.c:977
+#: c-opts.c:975
msgid "-Wformat-nonliteral ignored without -Wformat"
msgstr ""
-#: c-opts.c:979
+#: c-opts.c:977
msgid "-Wformat-security ignored without -Wformat"
msgstr ""
-#: c-opts.c:981
+#: c-opts.c:979
msgid "-Wmissing-format-attribute ignored without -Wformat"
msgstr ""
-#: c-opts.c:995
+#: c-opts.c:998
#, c-format
msgid "opening output file %s: %m"
msgstr ""
-#: c-opts.c:1000
+#: c-opts.c:1003
#, c-format
msgid "too many filenames given. Type %s --help for usage"
msgstr ""
-#: c-opts.c:1083
+#: c-opts.c:1086
msgid "YYDEBUG was not defined at build time, -dy ignored"
msgstr ""
-#: c-opts.c:1124
+#: c-opts.c:1127
#, c-format
msgid "opening dependency file %s: %m"
msgstr ""
-#: c-opts.c:1134
+#: c-opts.c:1137
#, c-format
msgid "closing dependency file %s: %m"
msgstr ""
-#: c-opts.c:1137
+#: c-opts.c:1140
#, c-format
msgid "when writing output to %s: %m"
msgstr ""
-#: c-opts.c:1216
+#: c-opts.c:1220
msgid "to generate dependencies you must specify either -M or -MM"
msgstr ""
-#: c-opts.c:1281
+#: c-opts.c:1287
msgid "<built-in>"
msgstr ""
-#: c-opts.c:1296
+#: c-opts.c:1302
msgid "<command line>"
msgstr ""
-#: c-opts.c:1379
+#: c-opts.c:1385
msgid "too late for # directive to set debug directory"
msgstr ""
-#. Depending on the version of Bison used to compile this grammar,
-#. it may issue generic diagnostics spelled "syntax error" or
-#. "parse error". To prevent this from changing the translation
-#. template randomly, we list all the variants of this particular
-#. diagnostic here. Translators: there is no fine distinction
-#. between diagnostics with "syntax error" in them, and diagnostics
-#. with "parse error" in them. It's okay to give them both the same
-#. translation.
-#: c-parse.y:54 c-parse.c:5313 c-parse.y:2927 gengtype-yacc.c:1559
-#: java/parse-scan.c:3063 java/parse-scan.y:1373
-#: java/parse.c:6166 java/parse.y:16413 objc/objc-parse.y:53
-#: objc/objc-parse.c:6384 objc/objc-parse.y:3517
-msgid "syntax error"
+#: c-parser.c:972
+msgid "ISO C forbids an empty source file"
msgstr ""
-#: c-parse.c:2153 c-parse.y:2931 gengtype-yacc.c:555 java/parse-scan.c:1932
-#: java/parse-scan.y:1377 java/parse.c:2931
-#: java/parse.y:16417 objc/objc-parse.c:2666
-#: objc/objc-parse.y:3521
-msgid "syntax error: cannot back up"
+#: c-parser.c:1057 c-parser.c:5718
+msgid "ISO C does not allow extra %<;%> outside of a function"
msgstr ""
-#: c-parse.y:343 objc/objc-parse.y:365
-msgid "ISO C forbids an empty source file"
+#: c-parser.c:1148
+msgid "expected declaration specifiers"
msgstr ""
-#: c-parse.y:376 objc/objc-parse.y:399
+#: c-parser.c:1196
msgid "data definition has no type or storage class"
msgstr ""
-#: c-parse.y:388 objc/objc-parse.y:411
-msgid "ISO C does not allow extra %<;%> outside of a function"
+#: c-parser.c:1250
+msgid "expected %<,%> or %<;%>"
msgstr ""
-#: c-parse.y:445
-msgid "traditional C rejects the unary plus operator"
+#. This can appear in many cases looking nothing like a
+#. function definition, so we don't give a more specific
+#. error suggesting there was one.
+#: c-parser.c:1257 c-parser.c:1274
+msgid "expected %<=%>, %<,%>, %<;%>, %<asm%> or %<__attribute__%>"
msgstr ""
-#: c-parse.y:498 objc/objc-parse.y:520
-msgid "%<sizeof%> applied to a bit-field"
+#: c-parser.c:1266
+msgid "ISO C forbids nested functions"
msgstr ""
-#: c-parse.y:595 objc/objc-parse.y:617
-msgid "ISO C forbids omitting the middle term of a ?: expression"
+#: c-parser.c:1612 c-parser.c:2372 c-parser.c:2973 c-parser.c:3207
+#: c-parser.c:3989 c-parser.c:4570 c-parser.c:4962 c-parser.c:4982
+#: c-parser.c:5098 c-parser.c:5243 c-parser.c:5259 c-parser.c:5371
+#: c-parser.c:5383 c-parser.c:5408 c-parser.c:5536 c-parser.c:5565
+#: c-parser.c:5573 c-parser.c:5601 c-parser.c:5615 c-parser.c:5822
+#: c-parser.c:5923
+msgid "expected identifier"
msgstr ""
-#: c-parse.y:636 objc/objc-parse.y:658
-msgid "compound literal has variable size"
+#: c-parser.c:1638 cp/parser.c:9985
+msgid "comma at end of enumerator list"
msgstr ""
-#: c-parse.y:648 objc/objc-parse.y:670
-msgid "ISO C90 forbids compound literals"
+#: c-parser.c:1644
+msgid "expected %<,%> or %<}%>"
msgstr ""
-#: c-parse.y:661 objc/objc-parse.y:683
-msgid "ISO C forbids braced-groups within expressions"
+#: c-parser.c:1658 c-parser.c:1828
+msgid "expected %<{%>"
msgstr ""
-#: c-parse.y:697 objc/objc-parse.y:719
-msgid "first argument to %<__builtin_choose_expr%> not a constant"
+#: c-parser.c:1667
+msgid "ISO C forbids forward references to %<enum%> types"
+msgstr ""
+
+#: c-parser.c:1770
+msgid "expected class name"
+msgstr ""
+
+#: c-parser.c:1789 c-parser.c:5475
+msgid "extra semicolon in struct or union specified"
+msgstr ""
+
+#: c-parser.c:1811
+msgid "no semicolon at end of struct or union"
msgstr ""
-#: c-parse.y:1224 objc/objc-parse.y:1273
+#: c-parser.c:1814
+msgid "expected %<;%>"
+msgstr ""
+
+#: c-parser.c:1890 c-parser.c:2814
+msgid "expected specifier-qualifier-list"
+msgstr ""
+
+#: c-parser.c:1900
+msgid "ISO C forbids member declarations with no members"
+msgstr ""
+
+#: c-parser.c:1969
+msgid "expected %<,%>, %<;%> or %<}%>"
+msgstr ""
+
+#: c-parser.c:1976
+msgid "expected %<:%>, %<,%>, %<;%>, %<}%> or %<__attribute__%>"
+msgstr ""
+
+#: c-parser.c:2025
msgid "%<typeof%> applied to a bit-field"
msgstr ""
-#: c-parse.y:1358 objc/objc-parse.y:1407
-msgid "ISO C forbids empty initializer braces"
+#: c-parser.c:2243
+msgid "expected identifier or %<(%>"
msgstr ""
-#: c-parse.y:1372 objc/objc-parse.y:1421
-msgid "ISO C90 forbids specifying subobject to initialize"
+#: c-parser.c:2435
+msgid "ISO C requires a named argument before %<...%>"
msgstr ""
-#: c-parse.y:1375 objc/objc-parse.y:1424
-msgid "obsolete use of designated initializer without %<=%>"
+#: c-parser.c:2536
+msgid "expected declaration specifiers or %<...%>"
+msgstr ""
+
+#: c-parser.c:2586
+msgid "wide string literal in %<asm%>"
+msgstr ""
+
+#: c-parser.c:2592
+msgid "expected string literal"
+msgstr ""
+
+#: c-parser.c:2899
+msgid "ISO C forbids empty initializer braces"
msgstr ""
-#: c-parse.y:1379 objc/objc-parse.y:1428
+#: c-parser.c:2944
msgid "obsolete use of designated initializer with %<:%>"
msgstr ""
-#: c-parse.y:1410 objc/objc-parse.y:1459
+#: c-parser.c:3066
msgid "ISO C forbids specifying range of elements to initialize"
msgstr ""
-#: c-parse.y:1418 c-parse.y:1448 objc/objc-parse.y:1467 objc/objc-parse.y:1497
-msgid "ISO C forbids nested functions"
+#: c-parser.c:3079
+msgid "ISO C90 forbids specifying subobject to initialize"
msgstr ""
-#: c-parse.y:1623 objc/objc-parse.y:1672
-msgid "ISO C forbids forward references to %<enum%> types"
+#: c-parser.c:3087
+msgid "obsolete use of designated initializer without %<=%>"
msgstr ""
-#: c-parse.y:1635 cp/parser.c:9850 objc/objc-parse.y:1684
-msgid "comma at end of enumerator list"
+#: c-parser.c:3095
+msgid "expected %<=%>"
msgstr ""
-#: c-parse.y:1655 objc/objc-parse.y:1704
-msgid "no semicolon at end of struct or union"
+#: c-parser.c:3226
+msgid "ISO C forbids label declarations"
msgstr ""
-#: c-parse.y:1664 objc/objc-parse.y:1713 objc/objc-parse.y:2699
-msgid "extra semicolon in struct or union specified"
+#: c-parser.c:3231
+msgid "expected declaration or statement"
msgstr ""
-#: c-parse.y:1684 objc/objc-parse.y:1736
-msgid "ISO C forbids member declarations with no members"
+#: c-parser.c:3260 c-parser.c:3288
+msgid "%HISO C90 forbids mixed declarations and code"
msgstr ""
-#: c-parse.y:1850 objc/objc-parse.y:1902
+#: c-parser.c:3304
msgid "label at end of compound statement"
msgstr ""
-#: c-parse.y:1869 objc/objc-parse.y:1921
-msgid "ISO C90 forbids mixed declarations and code"
+#: c-parser.c:3347
+msgid "expected %<:%> or %<...%>"
msgstr ""
-#: c-parse.y:1909 objc/objc-parse.y:1961
-msgid "ISO C forbids label declarations"
+#: c-parser.c:3483
+msgid "expected identifier or %<*%>"
msgstr ""
-#: c-parse.y:1953 objc/objc-parse.y:2005
-msgid "braced-group within expression allowed only inside a function"
+#. Avoid infinite loop in error recovery:
+#. c_parser_skip_until_found stops at a closing nesting
+#. delimiter without consuming it, but here we need to consume
+#. it to proceed further.
+#: c-parser.c:3545
+msgid "expected statement"
msgstr ""
-#: c-parse.y:2249 objc/objc-parse.y:2344
+#: c-parser.c:3877
#, c-format
msgid "%E qualifier ignored on asm"
msgstr ""
-#: c-parse.y:2343 objc/objc-parse.y:2438
-msgid "ISO C requires a named argument before %<...%>"
+#: c-parser.c:4150
+msgid "ISO C forbids omitting the middle term of a ?: expression"
msgstr ""
-#: c-parse.c:5309 c-parse.y:2929 gengtype-yacc.c:1555 java/parse-scan.c:3059
-#: java/parse-scan.y:1375 java/parse.c:6162
-#: java/parse.y:16415 objc/objc-parse.c:6380
-#: objc/objc-parse.y:3519
-msgid "syntax error; also virtual memory exhausted"
+#: c-parser.c:4531
+msgid "traditional C rejects the unary plus operator"
msgstr ""
-#: c-parse.c:5427 gengtype-yacc.c:1673 java/parse-scan.c:3177
-#: java/parse.c:6280 objc/objc-parse.c:6498
-msgid "parser stack overflow"
+#: c-parser.c:4656
+msgid "%<sizeof%> applied to a bit-field"
msgstr ""
-#: c-parse.y:2849 objc/objc-parse.y:3439
-#, c-format
-msgid "syntax error at %qs token"
+#: c-parser.c:4799 c-parser.c:5140 c-parser.c:5162
+msgid "expected expression"
msgstr ""
-#: c-parse.y:2928 java/parse-scan.y:1374
-#: java/parse.y:16414 objc/objc-parse.y:3518
-msgid "parse error"
+#: c-parser.c:4824
+msgid "braced-group within expression allowed only inside a function"
msgstr ""
-#: c-parse.y:2930 java/parse-scan.y:1376
-#: java/parse.y:16416 objc/objc-parse.y:3520
-msgid "parse error; also virtual memory exhausted"
+#: c-parser.c:4838
+msgid "ISO C forbids braced-groups within expressions"
msgstr ""
-#: c-parse.y:2932 java/parse-scan.y:1378
-#: java/parse.y:16418 objc/objc-parse.y:3522
-msgid "parse error: cannot back up"
+#: c-parser.c:5022
+msgid "first argument to %<__builtin_choose_expr%> not a constant"
+msgstr ""
+
+#: c-parser.c:5189
+msgid "compound literal has variable size"
+msgstr ""
+
+#: c-parser.c:5197
+msgid "ISO C90 forbids compound literals"
+msgstr ""
+
+#: c-parser.c:5686
+msgid "extra semicolon in method definition specified"
msgstr ""
#: c-pch.c:130
@@ -2715,177 +2759,177 @@ msgid ""
"%Japplying #pragma weak %qD after first use results in unspecified behavior"
msgstr ""
-#: c-pragma.c:307 c-pragma.c:312
+#: c-pragma.c:334 c-pragma.c:339
msgid "malformed #pragma weak, ignored"
msgstr ""
-#: c-pragma.c:316
+#: c-pragma.c:343
msgid "junk at end of #pragma weak"
msgstr ""
-#: c-pragma.c:379 c-pragma.c:381
+#: c-pragma.c:411 c-pragma.c:413
msgid "malformed #pragma redefine_extname, ignored"
msgstr ""
-#: c-pragma.c:384
+#: c-pragma.c:416
msgid "junk at end of #pragma redefine_extname"
msgstr ""
-#: c-pragma.c:389
+#: c-pragma.c:421
msgid "#pragma redefine_extname not supported on this target"
msgstr ""
-#: c-pragma.c:406 c-pragma.c:492
+#: c-pragma.c:438 c-pragma.c:524
msgid "#pragma redefine_extname ignored due to conflict with previous rename"
msgstr ""
-#: c-pragma.c:429
+#: c-pragma.c:461
msgid ""
"#pragma redefine_extname ignored due to conflict with previous #pragma "
"redefine_extname"
msgstr ""
-#: c-pragma.c:448
+#: c-pragma.c:480
msgid "malformed #pragma extern_prefix, ignored"
msgstr ""
-#: c-pragma.c:451
+#: c-pragma.c:483
msgid "junk at end of #pragma extern_prefix"
msgstr ""
-#: c-pragma.c:457
+#: c-pragma.c:489
msgid "#pragma extern_prefix not supported on this target"
msgstr ""
-#: c-pragma.c:483
+#: c-pragma.c:515
msgid "asm declaration ignored due to conflict with previous rename"
msgstr ""
-#: c-pragma.c:514
+#: c-pragma.c:546
msgid ""
"#pragma redefine_extname ignored due to conflict with __asm__ declaration"
msgstr ""
-#: c-pragma.c:574
+#: c-pragma.c:606
msgid "#pragma GCC visibility must be followed by push or pop"
msgstr ""
-#: c-pragma.c:581
+#: c-pragma.c:613
msgid "No matching push for %<#pragma GCC visibility pop%>"
msgstr ""
-#: c-pragma.c:592 c-pragma.c:621
+#: c-pragma.c:624 c-pragma.c:653
msgid "missing %<(%> after %<#pragma GCC visibility push%> - ignored"
msgstr ""
-#: c-pragma.c:596
+#: c-pragma.c:628
msgid "malformed #pragma GCC visibility push"
msgstr ""
-#: c-pragma.c:600
+#: c-pragma.c:632
msgid "No more than sixteen #pragma GCC visibility pushes allowed at once"
msgstr ""
-#: c-pragma.c:616
+#: c-pragma.c:648
msgid ""
"#pragma GCC visibility push() must specify default, internal, hidden or "
"protected"
msgstr ""
-#: c-pragma.c:625
+#: c-pragma.c:657
msgid "junk at end of %<#pragma GCC visibility%>"
msgstr ""
-#: c-typeck.c:138
+#: c-typeck.c:139
#, c-format
msgid "%qs has an incomplete type"
msgstr ""
-#: c-typeck.c:160 cp/call.c:2671
+#: c-typeck.c:161 cp/call.c:2679
msgid "invalid use of void expression"
msgstr ""
-#: c-typeck.c:168
+#: c-typeck.c:169
msgid "invalid use of flexible array member"
msgstr ""
-#: c-typeck.c:174
+#: c-typeck.c:175
msgid "invalid use of array with unspecified bounds"
msgstr ""
-#: c-typeck.c:182
+#: c-typeck.c:183
msgid "invalid use of undefined type %<%s %s%>"
msgstr ""
#. If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL.
-#: c-typeck.c:186
+#: c-typeck.c:187
#, c-format
msgid "invalid use of incomplete typedef %qs"
msgstr ""
-#: c-typeck.c:373 c-typeck.c:387
+#: c-typeck.c:394 c-typeck.c:419
msgid "function types not truly compatible in ISO C"
msgstr ""
-#: c-typeck.c:745
+#: c-typeck.c:803
msgid "types are not quite compatible"
msgstr ""
-#: c-typeck.c:987
+#: c-typeck.c:1045
msgid "function return types not compatible due to %<volatile%>"
msgstr ""
-#: c-typeck.c:1128 c-typeck.c:2362
+#: c-typeck.c:1204 c-typeck.c:2445
msgid "arithmetic on pointer to an incomplete type"
msgstr ""
-#: c-typeck.c:1483
+#: c-typeck.c:1559
msgid "%qT has no member named %qs"
msgstr ""
-#: c-typeck.c:1519
+#: c-typeck.c:1595
#, c-format
msgid "request for member %qs in something not a structure or union"
msgstr ""
-#: c-typeck.c:1548
+#: c-typeck.c:1629
msgid "dereferencing pointer to incomplete type"
msgstr ""
-#: c-typeck.c:1552
+#: c-typeck.c:1633
msgid "dereferencing %<void *%> pointer"
msgstr ""
-#: c-typeck.c:1569 cp/typeck.c:2150
+#: c-typeck.c:1650 cp/typeck.c:2109
#, c-format
msgid "invalid type argument of %qs"
msgstr ""
-#: c-typeck.c:1597 cp/typeck.c:2301
+#: c-typeck.c:1678 cp/typeck.c:2260
msgid "subscripted value is neither array nor pointer"
msgstr ""
-#: c-typeck.c:1608 cp/typeck.c:2220 cp/typeck.c:2306
+#: c-typeck.c:1689 cp/typeck.c:2179 cp/typeck.c:2265
msgid "array subscript is not an integer"
msgstr ""
-#: c-typeck.c:1614
+#: c-typeck.c:1695
msgid "subscripted value is pointer to function"
msgstr ""
-#: c-typeck.c:1627 cp/typeck.c:2216
+#: c-typeck.c:1708 cp/typeck.c:2175
msgid "array subscript has type %<char%>"
msgstr ""
-#: c-typeck.c:1667
+#: c-typeck.c:1748
msgid "ISO C forbids subscripting %<register%> array"
msgstr ""
-#: c-typeck.c:1669
+#: c-typeck.c:1750
msgid "ISO C90 forbids subscripting non-lvalue array"
msgstr ""
-#: c-typeck.c:1904
+#: c-typeck.c:1987
#, c-format
msgid "called object %qE is not a function"
msgstr ""
@@ -2893,775 +2937,771 @@ msgstr ""
#. This situation leads to run-time undefined behavior. We can't,
#. therefore, simply error unless we can prove that all possible
#. executions of the program must execute the code.
-#: c-typeck.c:1936
+#: c-typeck.c:2019
msgid "function called through a non-compatible type"
msgstr ""
-#: c-typeck.c:1983 c-typeck.c:4227 c-typeck.c:4229 c-typeck.c:4237
-#: c-typeck.c:4262 c-typeck.c:5649
+#: c-typeck.c:2066 c-typeck.c:4327 c-typeck.c:4329 c-typeck.c:4337
+#: c-typeck.c:4362 c-typeck.c:5744
msgid "initializer element is not constant"
msgstr ""
-#: c-typeck.c:2044
+#: c-typeck.c:2127
#, c-format
msgid "too many arguments to function %qE"
msgstr ""
-#: c-typeck.c:2071
+#: c-typeck.c:2154
#, c-format
msgid "type of formal parameter %d is incomplete"
msgstr ""
-#: c-typeck.c:2084
+#: c-typeck.c:2167
#, c-format
msgid ""
"passing argument %d of %qE as integer rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:2089
+#: c-typeck.c:2172
#, c-format
msgid ""
"passing argument %d of %qE as integer rather than complex due to prototype"
msgstr ""
-#: c-typeck.c:2094
+#: c-typeck.c:2177
#, c-format
msgid ""
"passing argument %d of %qE as complex rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:2099
+#: c-typeck.c:2182
#, c-format
msgid ""
"passing argument %d of %qE as floating rather than integer due to prototype"
msgstr ""
-#: c-typeck.c:2104
+#: c-typeck.c:2187
#, c-format
msgid ""
"passing argument %d of %qE as complex rather than integer due to prototype"
msgstr ""
-#: c-typeck.c:2109
+#: c-typeck.c:2192
#, c-format
msgid ""
"passing argument %d of %qE as floating rather than complex due to prototype"
msgstr ""
-#: c-typeck.c:2121
+#: c-typeck.c:2204
msgid ""
"passing argument %d of %qE as %<float%> rather than %<double%> due to "
"prototype"
msgstr ""
-#: c-typeck.c:2141
+#: c-typeck.c:2224
#, c-format
msgid "passing argument %d of %qE with different width due to prototype"
msgstr ""
-#: c-typeck.c:2168
+#: c-typeck.c:2251
#, c-format
msgid "passing argument %d of %qE as unsigned due to prototype"
msgstr ""
-#: c-typeck.c:2171
+#: c-typeck.c:2254
#, c-format
msgid "passing argument %d of %qE as signed due to prototype"
msgstr ""
-#: c-typeck.c:2202
+#: c-typeck.c:2285
#, c-format
msgid "too few arguments to function %qE"
msgstr ""
-#: c-typeck.c:2238
+#: c-typeck.c:2321
msgid "suggest parentheses around + or - inside shift"
msgstr ""
-#: c-typeck.c:2245
+#: c-typeck.c:2328
msgid "suggest parentheses around && within ||"
msgstr ""
-#: c-typeck.c:2254
+#: c-typeck.c:2337
msgid "suggest parentheses around arithmetic in operand of |"
msgstr ""
-#: c-typeck.c:2258
+#: c-typeck.c:2341
msgid "suggest parentheses around comparison in operand of |"
msgstr ""
-#: c-typeck.c:2267
+#: c-typeck.c:2350
msgid "suggest parentheses around arithmetic in operand of ^"
msgstr ""
-#: c-typeck.c:2271
+#: c-typeck.c:2354
msgid "suggest parentheses around comparison in operand of ^"
msgstr ""
-#: c-typeck.c:2278
+#: c-typeck.c:2361
msgid "suggest parentheses around + or - in operand of &"
msgstr ""
-#: c-typeck.c:2282
+#: c-typeck.c:2365
msgid "suggest parentheses around comparison in operand of &"
msgstr ""
-#: c-typeck.c:2288
+#: c-typeck.c:2371
msgid "comparisons like X<=Y<=Z do not have their mathematical meaning"
msgstr ""
-#: c-typeck.c:2314
+#: c-typeck.c:2397
msgid "pointer of type %<void *%> used in subtraction"
msgstr ""
-#: c-typeck.c:2316
+#: c-typeck.c:2399
msgid "pointer to a function used in subtraction"
msgstr ""
-#: c-typeck.c:2405
+#: c-typeck.c:2488
msgid "wrong type argument to unary plus"
msgstr ""
-#: c-typeck.c:2418
+#: c-typeck.c:2501
msgid "wrong type argument to unary minus"
msgstr ""
-#: c-typeck.c:2435
+#: c-typeck.c:2518
msgid "ISO C does not support %<~%> for complex conjugation"
msgstr ""
-#: c-typeck.c:2441
+#: c-typeck.c:2524
msgid "wrong type argument to bit-complement"
msgstr ""
-#: c-typeck.c:2449
+#: c-typeck.c:2532
msgid "wrong type argument to abs"
msgstr ""
-#: c-typeck.c:2461
+#: c-typeck.c:2544
msgid "wrong type argument to conjugation"
msgstr ""
-#: c-typeck.c:2475
+#: c-typeck.c:2558
msgid "wrong type argument to unary exclamation mark"
msgstr ""
-#: c-typeck.c:2512
+#: c-typeck.c:2595
msgid "ISO C does not support %<++%> and %<--%> on complex types"
msgstr ""
-#: c-typeck.c:2528 c-typeck.c:2560
+#: c-typeck.c:2611 c-typeck.c:2643
msgid "wrong type argument to increment"
msgstr ""
-#: c-typeck.c:2530 c-typeck.c:2562
+#: c-typeck.c:2613 c-typeck.c:2645
msgid "wrong type argument to decrement"
msgstr ""
-#: c-typeck.c:2551
+#: c-typeck.c:2634
msgid "increment of pointer to unknown structure"
msgstr ""
-#: c-typeck.c:2553
+#: c-typeck.c:2636
msgid "decrement of pointer to unknown structure"
msgstr ""
-#: c-typeck.c:2723
+#: c-typeck.c:2806
#, c-format
msgid "assignment of read-only member %qs"
msgstr ""
-#: c-typeck.c:2724
+#: c-typeck.c:2807
#, c-format
msgid "increment of read-only member %qs"
msgstr ""
-#: c-typeck.c:2725
+#: c-typeck.c:2808
#, c-format
msgid "decrement of read-only member %qs"
msgstr ""
-#: c-typeck.c:2729
+#: c-typeck.c:2812
#, c-format
msgid "assignment of read-only variable %qs"
msgstr ""
-#: c-typeck.c:2730
+#: c-typeck.c:2813
#, c-format
msgid "increment of read-only variable %qs"
msgstr ""
-#: c-typeck.c:2731
+#: c-typeck.c:2814
#, c-format
msgid "decrement of read-only variable %qs"
msgstr ""
-#: c-typeck.c:2734
+#: c-typeck.c:2817
msgid "assignment of read-only location"
msgstr ""
-#: c-typeck.c:2735
+#: c-typeck.c:2818
msgid "increment of read-only location"
msgstr ""
-#: c-typeck.c:2736
+#: c-typeck.c:2819
msgid "decrement of read-only location"
msgstr ""
-#: c-typeck.c:2755
+#: c-typeck.c:2838
msgid "cannot take address of bit-field %qD"
msgstr ""
-#: c-typeck.c:2783
+#: c-typeck.c:2866
msgid "global register variable %qD used in nested function"
msgstr ""
-#: c-typeck.c:2786
+#: c-typeck.c:2869
msgid "register variable %qD used in nested function"
msgstr ""
-#: c-typeck.c:2791
+#: c-typeck.c:2874
msgid "address of global register variable %qD requested"
msgstr ""
-#: c-typeck.c:2793
+#: c-typeck.c:2876
msgid "address of register variable %qD requested"
msgstr ""
-#: c-typeck.c:2841
+#: c-typeck.c:2924
msgid "non-lvalue array in conditional expression"
msgstr ""
-#: c-typeck.c:2885
+#: c-typeck.c:2968
msgid "signed and unsigned type in conditional expression"
msgstr ""
-#: c-typeck.c:2892
+#: c-typeck.c:2975
msgid "ISO C forbids conditional expr with only one void side"
msgstr ""
-#: c-typeck.c:2908 c-typeck.c:2916
+#: c-typeck.c:2991 c-typeck.c:2999
msgid "ISO C forbids conditional expr between %<void *%> and function pointer"
msgstr ""
-#: c-typeck.c:2923
+#: c-typeck.c:3006
msgid "pointer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:2930 c-typeck.c:2940
+#: c-typeck.c:3013 c-typeck.c:3023
msgid "pointer/integer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:2954
+#: c-typeck.c:3037
msgid "type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:2993
+#: c-typeck.c:3076
msgid "left-hand operand of comma expression has no effect"
msgstr ""
-#: c-typeck.c:3026
+#: c-typeck.c:3109
msgid "cast specifies array type"
msgstr ""
-#: c-typeck.c:3032
+#: c-typeck.c:3115
msgid "cast specifies function type"
msgstr ""
-#: c-typeck.c:3042
+#: c-typeck.c:3125
msgid "ISO C forbids casting nonscalar to the same type"
msgstr ""
-#: c-typeck.c:3060
+#: c-typeck.c:3143
msgid "ISO C forbids casts to union type"
msgstr ""
-#: c-typeck.c:3069
+#: c-typeck.c:3152
msgid "cast to union type from type not present in union"
msgstr ""
-#: c-typeck.c:3120
+#: c-typeck.c:3203
msgid "cast adds new qualifiers to function type"
msgstr ""
#. There are qualifiers present in IN_OTYPE that are not
#. present in IN_TYPE.
-#: c-typeck.c:3125
+#: c-typeck.c:3208
msgid "cast discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3140
+#: c-typeck.c:3223
msgid "cast increases required alignment of target type"
msgstr ""
-#: c-typeck.c:3146
+#: c-typeck.c:3229
msgid "cast from pointer to integer of different size"
msgstr ""
-#: c-typeck.c:3151
+#: c-typeck.c:3234
msgid "cast from function call of type %qT to non-matching type %qT"
msgstr ""
-#: c-typeck.c:3159
+#: c-typeck.c:3242
msgid "cast to pointer from integer of different size"
msgstr ""
-#: c-typeck.c:3171
+#: c-typeck.c:3254
msgid "type-punning to incomplete type might break strict-aliasing rules"
msgstr ""
-#: c-typeck.c:3178
+#: c-typeck.c:3261
msgid "dereferencing type-punned pointer will break strict-aliasing rules"
msgstr ""
-#: c-typeck.c:3181
+#: c-typeck.c:3264
msgid "dereferencing type-punned pointer might break strict-aliasing rules"
msgstr ""
-#: c-typeck.c:3193
+#: c-typeck.c:3276
msgid "ISO C forbids conversion of function pointer to object pointer type"
msgstr ""
-#: c-typeck.c:3202
+#: c-typeck.c:3285
msgid "ISO C forbids conversion of object pointer to function pointer type"
msgstr ""
-#: c-typeck.c:3457
+#: c-typeck.c:3537
msgid "cannot pass rvalue to reference parameter"
msgstr ""
-#: c-typeck.c:3566 c-typeck.c:3675
+#: c-typeck.c:3646 c-typeck.c:3761
#, c-format
msgid ""
"passing argument %d of %qE makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:3569 c-typeck.c:3678
+#: c-typeck.c:3649 c-typeck.c:3764
msgid "assignment makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:3572 c-typeck.c:3680
+#: c-typeck.c:3652 c-typeck.c:3766
msgid "initialization makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:3575 c-typeck.c:3682
+#: c-typeck.c:3655 c-typeck.c:3768
msgid "return makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:3579 c-typeck.c:3643
+#: c-typeck.c:3659 c-typeck.c:3729
#, c-format
msgid "passing argument %d of %qE discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3581 c-typeck.c:3645
+#: c-typeck.c:3661 c-typeck.c:3731
msgid "assignment discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3583 c-typeck.c:3647
+#: c-typeck.c:3663 c-typeck.c:3733
msgid "initialization discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3585 c-typeck.c:3649
+#: c-typeck.c:3665 c-typeck.c:3735
msgid "return discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3590
+#: c-typeck.c:3670
msgid "ISO C prohibits argument conversion to union type"
msgstr ""
-#: c-typeck.c:3628
+#: c-typeck.c:3714
msgid ""
"ISO C forbids passing argument %d of %qE between function pointer and %<void "
"*%>"
msgstr ""
-#: c-typeck.c:3631
+#: c-typeck.c:3717
msgid "ISO C forbids assignment between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:3633
+#: c-typeck.c:3719
msgid "ISO C forbids initialization between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:3635
+#: c-typeck.c:3721
msgid "ISO C forbids return between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:3658
+#: c-typeck.c:3744
#, c-format
msgid "pointer targets in passing argument %d of %qE differ in signedness"
msgstr ""
-#: c-typeck.c:3660
+#: c-typeck.c:3746
msgid "pointer targets in assignment differ in signedness"
msgstr ""
-#: c-typeck.c:3662
+#: c-typeck.c:3748
msgid "pointer targets in initialization differ in signedness"
msgstr ""
-#: c-typeck.c:3664
+#: c-typeck.c:3750
msgid "pointer targets in return differ in signedness"
msgstr ""
-#: c-typeck.c:3687
+#: c-typeck.c:3773
#, c-format
msgid "passing argument %d of %qE from incompatible pointer type"
msgstr ""
-#: c-typeck.c:3689
+#: c-typeck.c:3775
msgid "assignment from incompatible pointer type"
msgstr ""
-#: c-typeck.c:3690
+#: c-typeck.c:3776
msgid "initialization from incompatible pointer type"
msgstr ""
-#: c-typeck.c:3692
+#: c-typeck.c:3778
msgid "return from incompatible pointer type"
msgstr ""
#. ??? This should not be an error when inlining calls to
#. unprototyped functions.
-#: c-typeck.c:3699 c-typeck.c:4187 cp/typeck.c:1406
+#: c-typeck.c:3785 c-typeck.c:4287 cp/typeck.c:1377
msgid "invalid use of non-lvalue array"
msgstr ""
-#: c-typeck.c:3713
+#: c-typeck.c:3799
#, c-format
msgid "passing argument %d of %qE makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:3715
+#: c-typeck.c:3801
msgid "assignment makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:3717
+#: c-typeck.c:3803
msgid "initialization makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:3719
+#: c-typeck.c:3805
msgid "return makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:3726
+#: c-typeck.c:3812
#, c-format
msgid "passing argument %d of %qE makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:3728
+#: c-typeck.c:3814
msgid "assignment makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:3730
+#: c-typeck.c:3816
msgid "initialization makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:3732
+#: c-typeck.c:3818
msgid "return makes integer from pointer without a cast"
msgstr ""
#. ??? This should not be an error when inlining calls to
#. unprototyped functions.
-#: c-typeck.c:3745
+#: c-typeck.c:3831
#, c-format
msgid "incompatible type for argument %d of %qE"
msgstr ""
-#: c-typeck.c:3748
+#: c-typeck.c:3834
msgid "incompatible types in assignment"
msgstr ""
-#: c-typeck.c:3751
+#: c-typeck.c:3837
msgid "incompatible types in initialization"
msgstr ""
-#: c-typeck.c:3754
+#: c-typeck.c:3840
msgid "incompatible types in return"
msgstr ""
-#: c-typeck.c:3835
+#: c-typeck.c:3921
msgid "traditional C rejects automatic aggregate initialization"
msgstr ""
#. Use `%s' to print the string in case there are any escape
#. characters in the message.
-#: c-typeck.c:4000 c-typeck.c:4015 c-typeck.c:4030 final.c:2856 final.c:2858
-#: gcc.c:4649 rtl-error.c:113 toplev.c:606 config/cris/cris.c:568
-#: cp/parser.c:1861 cp/typeck.c:4175 java/expr.c:404
-#: java/parse.y:5021 java/verify.c:1593 java/verify.c:1594
-#: java/verify.c:1613
+#: c-typeck.c:4086 c-typeck.c:4101 c-typeck.c:4116 final.c:2856 final.c:2858
+#: gcc.c:4639 rtl-error.c:113 toplev.c:610 config/cris/cris.c:578
+#: cp/parser.c:1884 cp/typeck.c:4131 java/expr.c:405
+#: java/parse.y:5020 java/verify.c:1553
+#: java/verify.c:1554 java/verify.c:1573
#, c-format
msgid "%s"
msgstr ""
-#: c-typeck.c:4003 c-typeck.c:4018 c-typeck.c:4033
+#: c-typeck.c:4089 c-typeck.c:4104 c-typeck.c:4119
#, c-format
msgid "(near initialization for %qs)"
msgstr ""
-#: c-typeck.c:4047
+#: c-typeck.c:4133
msgid "array initialized from parenthesized string constant"
msgstr ""
-#: c-typeck.c:4111 cp/typeck2.c:702
+#: c-typeck.c:4197 cp/typeck2.c:703
msgid "char-array initialized from wide string"
msgstr ""
-#: c-typeck.c:4116
+#: c-typeck.c:4202
msgid "wchar_t-array initialized from non-wide string"
msgstr ""
-#: c-typeck.c:4134 cp/typeck2.c:724
+#: c-typeck.c:4220 cp/typeck2.c:725
msgid "initializer-string for array of chars is too long"
msgstr ""
-#: c-typeck.c:4140
+#: c-typeck.c:4226
msgid "array of inappropriate type initialized from string constant"
msgstr ""
-#: c-typeck.c:4210
+#: c-typeck.c:4310
msgid "array initialized from non-constant array expression"
msgstr ""
-#: c-typeck.c:4269 c-typeck.c:5653
+#: c-typeck.c:4369 c-typeck.c:5748
msgid "initializer element is not computable at load time"
msgstr ""
-#: c-typeck.c:4284 cp/typeck2.c:803
+#: c-typeck.c:4384 cp/typeck2.c:804
msgid "invalid initializer"
msgstr ""
-#: c-typeck.c:4554 cp/decl.c:4542
+#: c-typeck.c:4651 cp/decl.c:4451
msgid "opaque vector types cannot be initialized"
msgstr ""
-#: c-typeck.c:4750
+#: c-typeck.c:4850
msgid "extra brace group at end of initializer"
msgstr ""
-#: c-typeck.c:4770
+#: c-typeck.c:4870 cp/decl.c:4366
msgid "missing braces around initializer"
msgstr ""
-#: c-typeck.c:4830
+#: c-typeck.c:4931
msgid "braces around scalar initializer"
msgstr ""
-#: c-typeck.c:4887
+#: c-typeck.c:4988
msgid "initialization of flexible array member in a nested context"
msgstr ""
-#: c-typeck.c:4889
+#: c-typeck.c:4990
msgid "initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:4916
+#: c-typeck.c:5017
msgid "missing initializer"
msgstr ""
-#: c-typeck.c:4938
+#: c-typeck.c:5039
msgid "empty scalar initializer"
msgstr ""
-#: c-typeck.c:4943
+#: c-typeck.c:5044
msgid "extra elements in scalar initializer"
msgstr ""
-#: c-typeck.c:5031
-msgid "initialization designators may not nest"
-msgstr ""
-
-#: c-typeck.c:5053 c-typeck.c:5128
+#: c-typeck.c:5148 c-typeck.c:5223
msgid "array index in non-array initializer"
msgstr ""
-#: c-typeck.c:5058 c-typeck.c:5181
+#: c-typeck.c:5153 c-typeck.c:5276
msgid "field name not in record or union initializer"
msgstr ""
-#: c-typeck.c:5104
+#: c-typeck.c:5199
msgid "array index in initializer not of integer type"
msgstr ""
-#: c-typeck.c:5124 c-typeck.c:5126
+#: c-typeck.c:5219 c-typeck.c:5221
msgid "nonconstant array index in initializer"
msgstr ""
-#: c-typeck.c:5130 c-typeck.c:5133
+#: c-typeck.c:5225 c-typeck.c:5228
msgid "array index in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5144
+#: c-typeck.c:5239
msgid "empty index range in initializer"
msgstr ""
-#: c-typeck.c:5153
+#: c-typeck.c:5248
msgid "array index range in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5193
+#: c-typeck.c:5288
#, c-format
msgid "unknown field %qs specified in initializer"
msgstr ""
-#: c-typeck.c:5229 c-typeck.c:5250 c-typeck.c:5716
+#: c-typeck.c:5324 c-typeck.c:5345 c-typeck.c:5811
msgid "initialized field with side-effects overwritten"
msgstr ""
-#: c-typeck.c:5925
+#: c-typeck.c:6020
msgid "excess elements in char array initializer"
msgstr ""
-#: c-typeck.c:5932 c-typeck.c:5978
+#: c-typeck.c:6027 c-typeck.c:6073
msgid "excess elements in struct initializer"
msgstr ""
-#: c-typeck.c:5993
+#: c-typeck.c:6088
msgid "non-static initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:6061
+#: c-typeck.c:6156
msgid "excess elements in union initializer"
msgstr ""
-#: c-typeck.c:6083
+#: c-typeck.c:6178
msgid "traditional C rejects initialization of unions"
msgstr ""
-#: c-typeck.c:6147
+#: c-typeck.c:6242
msgid "excess elements in array initializer"
msgstr ""
-#: c-typeck.c:6177
+#: c-typeck.c:6272
msgid "excess elements in vector initializer"
msgstr ""
-#: c-typeck.c:6200
+#: c-typeck.c:6296
msgid "excess elements in scalar initializer"
msgstr ""
-#: c-typeck.c:6362
+#: c-typeck.c:6492
msgid "ISO C forbids %<goto *expr;%>"
msgstr ""
-#: c-typeck.c:6376 cp/typeck.c:6160
+#: c-typeck.c:6506 cp/typeck.c:6049
msgid "function declared %<noreturn%> has a %<return%> statement"
msgstr ""
-#: c-typeck.c:6383
+#: c-typeck.c:6513
msgid "%<return%> with no value, in function returning non-void"
msgstr ""
-#: c-typeck.c:6390
+#: c-typeck.c:6520
msgid "%<return%> with a value, in function returning void"
msgstr ""
-#: c-typeck.c:6447
+#: c-typeck.c:6577
msgid "function returns address of local variable"
msgstr ""
-#: c-typeck.c:6508 cp/semantics.c:880
+#: c-typeck.c:6638 cp/semantics.c:879
msgid "switch quantity not an integer"
msgstr ""
-#: c-typeck.c:6518
+#: c-typeck.c:6649
msgid "%<long%> switch expression not converted to %<int%> in ISO C"
msgstr ""
-#: c-typeck.c:6555 cp/parser.c:5942
+#: c-typeck.c:6685 cp/parser.c:6051
msgid "case label not within a switch statement"
msgstr ""
-#: c-typeck.c:6557
+#: c-typeck.c:6687
msgid "%<default%> label not within a switch statement"
msgstr ""
-#: c-typeck.c:6621
+#: c-typeck.c:6751
msgid "%Hsuggest explicit braces to avoid ambiguous %<else%>"
msgstr ""
-#: c-typeck.c:6631
+#: c-typeck.c:6761
msgid "%Hempty body in an if-statement"
msgstr ""
-#: c-typeck.c:6639
+#: c-typeck.c:6769
msgid "%Hempty body in an else-statement"
msgstr ""
-#: c-typeck.c:6730 cp/parser.c:6445
+#: c-typeck.c:6880 cp/parser.c:6553
msgid "continue statement not within a loop"
msgstr ""
-#: c-typeck.c:6747
+#: c-typeck.c:6900
msgid "%Hstatement with no effect"
msgstr ""
-#: c-typeck.c:6776
+#: c-typeck.c:6929
msgid "expression statement has incomplete type"
msgstr ""
-#: c-typeck.c:7099 c-typeck.c:7138
+#: c-typeck.c:7252 c-typeck.c:7291
msgid "division by zero"
msgstr ""
-#: c-typeck.c:7183 cp/typeck.c:2971
+#: c-typeck.c:7336 cp/typeck.c:2927
msgid "right shift count is negative"
msgstr ""
-#: c-typeck.c:7190 cp/typeck.c:2977
+#: c-typeck.c:7343 cp/typeck.c:2933
msgid "right shift count >= width of type"
msgstr ""
-#: c-typeck.c:7211 cp/typeck.c:2996
+#: c-typeck.c:7364 cp/typeck.c:2952
msgid "left shift count is negative"
msgstr ""
-#: c-typeck.c:7214 cp/typeck.c:2998
+#: c-typeck.c:7367 cp/typeck.c:2954
msgid "left shift count >= width of type"
msgstr ""
-#: c-typeck.c:7231 cp/typeck.c:3033
+#: c-typeck.c:7384 cp/typeck.c:2989
msgid "comparing floating point with == or != is unsafe"
msgstr ""
-#: c-typeck.c:7255 c-typeck.c:7262
+#: c-typeck.c:7408 c-typeck.c:7415
msgid "ISO C forbids comparison of %<void *%> with function pointer"
msgstr ""
-#: c-typeck.c:7266 c-typeck.c:7312
+#: c-typeck.c:7419 c-typeck.c:7465
msgid "comparison of distinct pointer types lacks a cast"
msgstr ""
-#: c-typeck.c:7280 c-typeck.c:7285 c-typeck.c:7332 c-typeck.c:7337
+#: c-typeck.c:7433 c-typeck.c:7438 c-typeck.c:7485 c-typeck.c:7490
msgid "comparison between pointer and integer"
msgstr ""
-#: c-typeck.c:7304
+#: c-typeck.c:7457
msgid "comparison of complete and incomplete pointers"
msgstr ""
-#: c-typeck.c:7307
+#: c-typeck.c:7460
msgid "ISO C forbids ordered comparisons of pointers to functions"
msgstr ""
-#: c-typeck.c:7320 c-typeck.c:7327
+#: c-typeck.c:7473 c-typeck.c:7480
msgid "ordered comparison of pointer with integer zero"
msgstr ""
-#: c-typeck.c:7548
+#: c-typeck.c:7701
msgid "comparison between signed and unsigned"
msgstr ""
-#: c-typeck.c:7594 cp/typeck.c:3440
+#: c-typeck.c:7747 cp/typeck.c:3396
msgid "comparison of promoted ~unsigned with constant"
msgstr ""
-#: c-typeck.c:7602 cp/typeck.c:3448
+#: c-typeck.c:7755 cp/typeck.c:3404
msgid "comparison of promoted ~unsigned with unsigned"
msgstr ""
-#: calls.c:1909
+#: calls.c:1934
msgid "function call has aggregate value"
msgstr ""
@@ -3705,7 +3745,7 @@ msgstr ""
msgid "verify_flow_info: Basic block %d succ edge is corrupted"
msgstr ""
-#: cfghooks.c:165 cfgrtl.c:2048
+#: cfghooks.c:165 cfgrtl.c:2056
#, c-format
msgid "Wrong amount of branch edges after unconditional jump %i"
msgstr ""
@@ -3814,305 +3854,305 @@ msgstr ""
msgid "%s does not support flow_call_edges_add"
msgstr ""
-#: cfgloop.c:1304
+#: cfgloop.c:1312
#, c-format
msgid "Size of loop %d should be %d, not %d."
msgstr ""
-#: cfgloop.c:1321
+#: cfgloop.c:1329
#, c-format
msgid "Bb %d do not belong to loop %d."
msgstr ""
-#: cfgloop.c:1338
+#: cfgloop.c:1346
#, c-format
msgid "Loop %d's header does not have exactly 2 entries."
msgstr ""
-#: cfgloop.c:1345
+#: cfgloop.c:1353
#, c-format
msgid "Loop %d's latch does not have exactly 1 successor."
msgstr ""
-#: cfgloop.c:1350
+#: cfgloop.c:1358
#, c-format
msgid "Loop %d's latch does not have header as successor."
msgstr ""
-#: cfgloop.c:1355
+#: cfgloop.c:1363
#, c-format
msgid "Loop %d's latch does not belong directly to it."
msgstr ""
-#: cfgloop.c:1361
+#: cfgloop.c:1369
#, c-format
msgid "Loop %d's header does not belong directly to it."
msgstr ""
-#: cfgloop.c:1367
+#: cfgloop.c:1375
#, c-format
msgid "Loop %d's latch is marked as part of irreducible region."
msgstr ""
-#: cfgloop.c:1400
+#: cfgloop.c:1408
#, c-format
msgid "Basic block %d should be marked irreducible."
msgstr ""
-#: cfgloop.c:1406
+#: cfgloop.c:1414
#, c-format
msgid "Basic block %d should not be marked irreducible."
msgstr ""
-#: cfgloop.c:1414
+#: cfgloop.c:1422
#, c-format
msgid "Edge from %d to %d should be marked irreducible."
msgstr ""
-#: cfgloop.c:1421
+#: cfgloop.c:1429
#, c-format
msgid "Edge from %d to %d should not be marked irreducible."
msgstr ""
-#: cfgloop.c:1456
+#: cfgloop.c:1464
#, c-format
msgid "Wrong single exit %d->%d recorded for loop %d."
msgstr ""
-#: cfgloop.c:1460
+#: cfgloop.c:1468
#, c-format
msgid "Right exit is %d->%d."
msgstr ""
-#: cfgloop.c:1477
+#: cfgloop.c:1485
#, c-format
msgid "Single exit not recorded for loop %d."
msgstr ""
-#: cfgloop.c:1484
+#: cfgloop.c:1492
#, c-format
msgid "Loop %d should not have single exit (%d -> %d)."
msgstr ""
-#: cfgrtl.c:1940
+#: cfgrtl.c:1948
#, c-format
msgid "end insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:1954
+#: cfgrtl.c:1962
#, c-format
msgid "insn %d is in multiple basic blocks (%d and %d)"
msgstr ""
-#: cfgrtl.c:1966
+#: cfgrtl.c:1974
#, c-format
msgid "head insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:1990
+#: cfgrtl.c:1998
msgid "verify_flow_info: REG_BR_PROB does not match cfg %wi %i"
msgstr ""
-#: cfgrtl.c:2005
+#: cfgrtl.c:2013
#, c-format
msgid "Fallthru edge crosses section boundary (bb %i)"
msgstr ""
-#: cfgrtl.c:2030
+#: cfgrtl.c:2038
#, c-format
msgid "Missing REG_EH_REGION note in the end of bb %i"
msgstr ""
-#: cfgrtl.c:2038
+#: cfgrtl.c:2046
#, c-format
msgid "Too many outgoing branch edges from bb %i"
msgstr ""
-#: cfgrtl.c:2043
+#: cfgrtl.c:2051
#, c-format
msgid "Fallthru edge after unconditional jump %i"
msgstr ""
-#: cfgrtl.c:2054
+#: cfgrtl.c:2062
#, c-format
msgid "Wrong amount of branch edges after conditional jump %i"
msgstr ""
-#: cfgrtl.c:2059
+#: cfgrtl.c:2067
#, c-format
msgid "Call edges for non-call insn in bb %i"
msgstr ""
-#: cfgrtl.c:2068
+#: cfgrtl.c:2076
#, c-format
msgid "Abnormal edges for no purpose in bb %i"
msgstr ""
-#: cfgrtl.c:2080
+#: cfgrtl.c:2088
#, c-format
msgid "insn %d inside basic block %d but block_for_insn is NULL"
msgstr ""
-#: cfgrtl.c:2084
+#: cfgrtl.c:2092
#, c-format
msgid "insn %d inside basic block %d but block_for_insn is %i"
msgstr ""
-#: cfgrtl.c:2098 cfgrtl.c:2108
+#: cfgrtl.c:2106 cfgrtl.c:2116
#, c-format
msgid "NOTE_INSN_BASIC_BLOCK is missing for block %d"
msgstr ""
-#: cfgrtl.c:2121
+#: cfgrtl.c:2129
#, c-format
msgid "NOTE_INSN_BASIC_BLOCK %d in middle of basic block %d"
msgstr ""
-#: cfgrtl.c:2131
+#: cfgrtl.c:2139
#, c-format
msgid "in basic block %d:"
msgstr ""
-#: cfgrtl.c:2132
+#: cfgrtl.c:2140
msgid "flow control insn inside a basic block"
msgstr ""
-#: cfgrtl.c:2180
+#: cfgrtl.c:2188
#, c-format
msgid "missing barrier after block %i"
msgstr ""
-#: cfgrtl.c:2193
+#: cfgrtl.c:2201
#, c-format
msgid "verify_flow_info: Incorrect blocks for fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2208
+#: cfgrtl.c:2210
#, c-format
msgid "verify_flow_info: Incorrect fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2210
+#: cfgrtl.c:2212
msgid "wrong insn in the fallthru edge"
msgstr ""
-#: cfgrtl.c:2227
+#: cfgrtl.c:2229
msgid "basic blocks not laid down consecutively"
msgstr ""
-#: cfgrtl.c:2252
+#: cfgrtl.c:2254
msgid "insn outside basic block"
msgstr ""
-#: cfgrtl.c:2259
+#: cfgrtl.c:2261
msgid "return not followed by barrier"
msgstr ""
-#: cfgrtl.c:2266
+#: cfgrtl.c:2268
#, c-format
msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)"
msgstr ""
-#: cgraph.c:231
+#: cgraph.c:278
msgid "function body not available"
msgstr ""
-#: cgraph.c:233 cgraphunit.c:651
+#: cgraph.c:280 cgraphunit.c:661
msgid "redefined extern inline functions are not considered for inlining"
msgstr ""
-#: cgraph.c:236 cgraphunit.c:656
+#: cgraph.c:283 cgraphunit.c:666
msgid "function not considered for inlining"
msgstr ""
-#: cgraph.c:238 cgraphunit.c:654
+#: cgraph.c:285 cgraphunit.c:664
msgid "function not inlinable"
msgstr ""
-#: cgraph.c:556
+#: cgraph.c:615
msgid "%D renamed after being referenced in assembly"
msgstr ""
-#: cgraphunit.c:502
+#: cgraphunit.c:512
msgid "Shared call_expr:"
msgstr ""
-#: cgraphunit.c:508
+#: cgraphunit.c:518
msgid "Edge points to wrong declaration:"
msgstr ""
-#: cgraphunit.c:517
+#: cgraphunit.c:527
msgid "Missing callgraph edge for call expr:"
msgstr ""
-#: cgraphunit.c:543
+#: cgraphunit.c:553
#, c-format
msgid "Aux field set for edge %s->%s"
msgstr ""
-#: cgraphunit.c:555
+#: cgraphunit.c:565
msgid "Inlined_to pointer is wrong"
msgstr ""
-#: cgraphunit.c:560
+#: cgraphunit.c:570
msgid "Multiple inline callers"
msgstr ""
-#: cgraphunit.c:567
+#: cgraphunit.c:577
msgid "Inlined_to pointer set for noninline callers"
msgstr ""
-#: cgraphunit.c:573
+#: cgraphunit.c:583
msgid "Inlined_to pointer is set but no predecesors found"
msgstr ""
-#: cgraphunit.c:578
+#: cgraphunit.c:588
msgid "Inlined_to pointer reffers to itself"
msgstr ""
-#: cgraphunit.c:588
+#: cgraphunit.c:598
msgid "Node not found in DECL_ASSEMBLER_NAME hash"
msgstr ""
-#: cgraphunit.c:602
+#: cgraphunit.c:612
#, c-format
msgid "Edge %s->%s has no corresponding call_expr"
msgstr ""
-#: cgraphunit.c:613
+#: cgraphunit.c:623
msgid "verify_cgraph_node failed."
msgstr ""
-#: cgraphunit.c:797
+#: cgraphunit.c:807
msgid "failed to reclaim unneeded function"
msgstr ""
-#: cgraphunit.c:1184
+#: cgraphunit.c:1194
msgid "--param large-function-growth limit reached"
msgstr ""
-#: cgraphunit.c:1221
+#: cgraphunit.c:1231
msgid "recursive inlining"
msgstr ""
-#: cgraphunit.c:1386 cgraphunit.c:1638
+#: cgraphunit.c:1396 cgraphunit.c:1648
msgid "--param max-inline-insns-single limit reached"
msgstr ""
-#: cgraphunit.c:1410
+#: cgraphunit.c:1420
msgid ""
"--param max-inline-insns-single limit reached after inlining into the callee"
msgstr ""
-#: cgraphunit.c:1460
+#: cgraphunit.c:1470
msgid "--param inline-unit-growth limit reached"
msgstr ""
-#: cgraphunit.c:1809
+#: cgraphunit.c:1822
msgid "Nodes with no released memory found."
msgstr ""
-#: collect2.c:402 gcc.c:6744
+#: collect2.c:402 gcc.c:6733
#, c-format
msgid "internal gcc abort in %s, at %s:%d"
msgstr ""
@@ -4121,156 +4161,156 @@ msgstr ""
msgid "no arguments"
msgstr ""
-#: collect2.c:1187
+#: collect2.c:1194
#, c-format
msgid "unknown demangling style '%s'"
msgstr ""
-#: collect2.c:1261 collect2.c:1409 collect2.c:1444
+#: collect2.c:1268 collect2.c:1416 collect2.c:1451
#, c-format
msgid "fopen %s"
msgstr ""
-#: collect2.c:1264 collect2.c:1414 collect2.c:1447
+#: collect2.c:1271 collect2.c:1421 collect2.c:1454
#, c-format
msgid "fclose %s"
msgstr ""
-#: collect2.c:1273
+#: collect2.c:1280
#, c-format
msgid "collect2 version %s"
msgstr ""
-#: collect2.c:1363
+#: collect2.c:1370
#, c-format
msgid "%d constructor(s) found\n"
msgstr ""
-#: collect2.c:1364
+#: collect2.c:1371
#, c-format
msgid "%d destructor(s) found\n"
msgstr ""
-#: collect2.c:1365
+#: collect2.c:1372
#, c-format
msgid "%d frame table(s) found\n"
msgstr ""
-#: collect2.c:1507
+#: collect2.c:1514
#, c-format
msgid "%s terminated with signal %d [%s]%s"
msgstr ""
-#: collect2.c:1525
+#: collect2.c:1532
#, c-format
msgid "%s returned %d exit status"
msgstr ""
-#: collect2.c:1550
+#: collect2.c:1557
#, c-format
msgid "[cannot find %s]"
msgstr ""
-#: collect2.c:1565
+#: collect2.c:1572
#, c-format
msgid "cannot find '%s'"
msgstr ""
-#: collect2.c:1576 collect2.c:1579
+#: collect2.c:1583 collect2.c:1586
#, c-format
msgid "redirecting stdout: %s"
msgstr ""
-#: collect2.c:1618
+#: collect2.c:1625
#, c-format
msgid "[Leaving %s]\n"
msgstr ""
-#: collect2.c:1838
+#: collect2.c:1845
#, c-format
msgid ""
"\n"
"write_c_file - output name is %s, prefix is %s\n"
msgstr ""
-#: collect2.c:2042
+#: collect2.c:2049
msgid "cannot find 'nm'"
msgstr ""
-#: collect2.c:2052 collect2.c:2218
+#: collect2.c:2059 collect2.c:2225
msgid "pipe"
msgstr ""
-#: collect2.c:2056 collect2.c:2222
+#: collect2.c:2063 collect2.c:2229
msgid "fdopen"
msgstr ""
-#: collect2.c:2082 collect2.c:2248
+#: collect2.c:2089 collect2.c:2255
#, c-format
msgid "dup2 %d 1"
msgstr ""
-#: collect2.c:2085 collect2.c:2088 collect2.c:2101 collect2.c:2251
-#: collect2.c:2254 collect2.c:2267
+#: collect2.c:2092 collect2.c:2095 collect2.c:2108 collect2.c:2258
+#: collect2.c:2261 collect2.c:2274
#, c-format
msgid "close %d"
msgstr ""
-#: collect2.c:2091 collect2.c:2257
+#: collect2.c:2098 collect2.c:2264
#, c-format
msgid "execv %s"
msgstr ""
-#: collect2.c:2145
+#: collect2.c:2152
#, c-format
msgid "init function found in object %s"
msgstr ""
-#: collect2.c:2153
+#: collect2.c:2160
#, c-format
msgid "fini function found in object %s"
msgstr ""
-#: collect2.c:2176 collect2.c:2306
+#: collect2.c:2183 collect2.c:2313
msgid "fclose"
msgstr ""
-#: collect2.c:2209
+#: collect2.c:2216
msgid "cannot find 'ldd'"
msgstr ""
-#: collect2.c:2270
+#: collect2.c:2277
msgid ""
"\n"
"ldd output with constructors/destructors.\n"
msgstr ""
-#: collect2.c:2285
+#: collect2.c:2292
#, c-format
msgid "dynamic dependency %s not found"
msgstr ""
-#: collect2.c:2297
+#: collect2.c:2304
#, c-format
msgid "unable to open dynamic dependency '%s'"
msgstr ""
-#: collect2.c:2456
+#: collect2.c:2463
#, c-format
msgid "%s: not a COFF file"
msgstr ""
-#: collect2.c:2576
+#: collect2.c:2583
#, c-format
msgid "%s: cannot open as COFF file"
msgstr ""
-#: collect2.c:2631
+#: collect2.c:2641
#, c-format
msgid "library lib%s not found"
msgstr ""
-#: combine.c:12382
+#: combine.c:12524
#, c-format
msgid ""
";; Combiner statistics: %d attempts, %d substitutions (%d requiring new "
@@ -4279,7 +4319,7 @@ msgid ""
"\n"
msgstr ""
-#: combine.c:12391
+#: combine.c:12533
#, c-format
msgid ""
"\n"
@@ -4391,7 +4431,7 @@ msgstr ""
msgid "too many input files"
msgstr ""
-#: cse.c:6784
+#: cse.c:6772
#, c-format
msgid ";; Processing block from %d to %d, %d sets.\n"
msgstr ""
@@ -4446,31 +4486,23 @@ msgstr ""
msgid "DW_LOC_OP %s not implemented\n"
msgstr ""
-#: emit-rtl.c:1215
-msgid "can't access real part of complex value in hard register"
-msgstr ""
-
-#: emit-rtl.c:1242
-msgid "can't access imaginary part of complex value in hard register"
-msgstr ""
-
-#: emit-rtl.c:2303
+#: emit-rtl.c:2232
msgid "Invalid rtl sharing found in the insn"
msgstr ""
-#: emit-rtl.c:2305
+#: emit-rtl.c:2234
msgid "Shared rtx"
msgstr ""
-#: emit-rtl.c:2307
+#: emit-rtl.c:2236
msgid "Internal consistency failure"
msgstr ""
-#: emit-rtl.c:3343
+#: emit-rtl.c:3301
msgid "ICE: emit_insn used where emit_jump_insn needed:\n"
msgstr ""
-#: errors.c:133 java/jv-scan.c:294
+#: errors.c:133 java/jv-scan.c:272
#, c-format
msgid "abort in %s, at %s:%d"
msgstr ""
@@ -4487,7 +4519,7 @@ msgstr ""
msgid "__builtin_eh_return not supported on this target"
msgstr ""
-#: explow.c:1355
+#: explow.c:1301
msgid "stack limits not supported on this target"
msgstr ""
@@ -4536,173 +4568,173 @@ msgstr ""
#. handle them.
#. We can't handle floating point constants;
#. PRINT_OPERAND must handle them.
-#: final.c:3305 vmsdbgout.c:487 config/i386/i386.c:5836
+#: final.c:3305 vmsdbgout.c:487 config/i386/i386.c:5931
#: config/pdp11/pdp11.c:1690
msgid "floating constant misused"
msgstr ""
-#: final.c:3361 vmsdbgout.c:544 config/i386/i386.c:5914
+#: final.c:3361 vmsdbgout.c:544 config/i386/i386.c:6009
#: config/pdp11/pdp11.c:1737
msgid "invalid expression as operand"
msgstr ""
-#: flow.c:495 flow.c:519 flow.c:541
+#: flow.c:494 flow.c:518 flow.c:540
msgid "internal consistency failure"
msgstr ""
-#: flow.c:1578
+#: flow.c:1689
msgid "Attempt to delete prologue/epilogue insn:"
msgstr ""
-#: fold-const.c:3186 fold-const.c:3197
+#: fold-const.c:3220 fold-const.c:3231
#, c-format
msgid "comparison is always %d due to width of bit-field"
msgstr ""
-#: fold-const.c:4755 fold-const.c:4770
+#: fold-const.c:4789 fold-const.c:4804
#, c-format
msgid "comparison is always %d"
msgstr ""
-#: fold-const.c:4899
+#: fold-const.c:4933
msgid "%<or%> of unmatched not-equal tests is always 1"
msgstr ""
-#: fold-const.c:4904
+#: fold-const.c:4938
msgid "%<and%> of mutually exclusive equal-tests is always 0"
msgstr ""
-#: fold-const.c:9334
+#: fold-const.c:9870
msgid "fold check: original tree changed by fold"
msgstr ""
-#: function.c:831 varasm.c:1569
+#: function.c:832 varasm.c:1584
msgid "%Jsize of variable %qD is too large"
msgstr ""
-#: function.c:1442
+#: function.c:1443
msgid "impossible constraint in %<asm%>"
msgstr ""
-#: function.c:3495
+#: function.c:3633
msgid "%Jvariable %qD might be clobbered by %<longjmp%> or %<vfork%>"
msgstr ""
-#: function.c:3516
+#: function.c:3654
msgid "%Jargument %qD might be clobbered by %<longjmp%> or %<vfork%>"
msgstr ""
-#: function.c:3907
+#: function.c:4045
msgid "function returns an aggregate"
msgstr ""
-#: function.c:4249
+#: function.c:4368
msgid "%Junused parameter %qD"
msgstr ""
-#: gcc.c:1242
+#: gcc.c:1237
#, c-format
msgid "ambiguous abbreviation %s"
msgstr ""
-#: gcc.c:1269
+#: gcc.c:1264
#, c-format
msgid "incomplete '%s' option"
msgstr ""
-#: gcc.c:1280
+#: gcc.c:1275
#, c-format
msgid "missing argument to '%s' option"
msgstr ""
-#: gcc.c:1293
+#: gcc.c:1288
#, c-format
msgid "extraneous argument to '%s' option"
msgstr ""
-#: gcc.c:1637
+#: gcc.c:1632
msgid "Using built-in specs.\n"
msgstr ""
-#: gcc.c:1825
+#: gcc.c:1815
#, c-format
msgid ""
"Setting spec %s to '%s'\n"
"\n"
msgstr ""
-#: gcc.c:1934
+#: gcc.c:1924
#, c-format
msgid "Reading specs from %s\n"
msgstr ""
-#: gcc.c:2030 gcc.c:2049
+#: gcc.c:2020 gcc.c:2039
#, c-format
msgid "specs %%include syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:2057
+#: gcc.c:2047
#, c-format
msgid "could not find specs file %s\n"
msgstr ""
-#: gcc.c:2074 gcc.c:2082 gcc.c:2091 gcc.c:2100
+#: gcc.c:2064 gcc.c:2072 gcc.c:2081 gcc.c:2090
#, c-format
msgid "specs %%rename syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:2109
+#: gcc.c:2099
#, c-format
msgid "specs %s spec was not found to be renamed"
msgstr ""
-#: gcc.c:2116
+#: gcc.c:2106
#, c-format
msgid "%s: attempt to rename spec '%s' to already defined spec '%s'"
msgstr ""
-#: gcc.c:2121
+#: gcc.c:2111
#, c-format
msgid "rename spec %s to %s\n"
msgstr ""
-#: gcc.c:2123
+#: gcc.c:2113
#, c-format
msgid ""
"spec is '%s'\n"
"\n"
msgstr ""
-#: gcc.c:2136
+#: gcc.c:2126
#, c-format
msgid "specs unknown %% command after %ld characters"
msgstr ""
-#: gcc.c:2147 gcc.c:2160
+#: gcc.c:2137 gcc.c:2150
#, c-format
msgid "specs file malformed after %ld characters"
msgstr ""
-#: gcc.c:2213
+#: gcc.c:2203
msgid "spec file has no spec for linking"
msgstr ""
-#: gcc.c:2635
+#: gcc.c:2625
#, c-format
msgid "system path '%s' is not absolute"
msgstr ""
-#: gcc.c:2698
+#: gcc.c:2688
msgid "-pipe not supported"
msgstr ""
-#: gcc.c:2760
+#: gcc.c:2750
msgid ""
"\n"
"Go ahead? (y or n) "
msgstr ""
-#: gcc.c:2885
+#: gcc.c:2875
#, c-format
msgid ""
"Internal error: %s (program %s)\n"
@@ -4710,189 +4742,189 @@ msgid ""
"See %s for instructions."
msgstr ""
-#: gcc.c:2903
+#: gcc.c:2893
#, c-format
msgid "# %s %.2f %.2f\n"
msgstr ""
-#: gcc.c:3033
+#: gcc.c:3023
#, c-format
msgid "Usage: %s [options] file...\n"
msgstr ""
-#: gcc.c:3034
+#: gcc.c:3024
msgid "Options:\n"
msgstr ""
-#: gcc.c:3036
+#: gcc.c:3026
msgid " -pass-exit-codes Exit with highest error code from a phase\n"
msgstr ""
-#: gcc.c:3037
+#: gcc.c:3027
msgid " --help Display this information\n"
msgstr ""
-#: gcc.c:3038
+#: gcc.c:3028
msgid ""
" --target-help Display target specific command line options\n"
msgstr ""
-#: gcc.c:3040
+#: gcc.c:3030
msgid " (Use '-v --help' to display command line options of sub-processes)\n"
msgstr ""
-#: gcc.c:3041
+#: gcc.c:3031
msgid " -dumpspecs Display all of the built in spec strings\n"
msgstr ""
-#: gcc.c:3042
+#: gcc.c:3032
msgid " -dumpversion Display the version of the compiler\n"
msgstr ""
-#: gcc.c:3043
+#: gcc.c:3033
msgid " -dumpmachine Display the compiler's target processor\n"
msgstr ""
-#: gcc.c:3044
+#: gcc.c:3034
msgid ""
" -print-search-dirs Display the directories in the compiler's search "
"path\n"
msgstr ""
-#: gcc.c:3045
+#: gcc.c:3035
msgid ""
" -print-libgcc-file-name Display the name of the compiler's companion "
"library\n"
msgstr ""
-#: gcc.c:3046
+#: gcc.c:3036
msgid " -print-file-name=<lib> Display the full path to library <lib>\n"
msgstr ""
-#: gcc.c:3047
+#: gcc.c:3037
msgid ""
" -print-prog-name=<prog> Display the full path to compiler component "
"<prog>\n"
msgstr ""
-#: gcc.c:3048
+#: gcc.c:3038
msgid ""
" -print-multi-directory Display the root directory for versions of "
"libgcc\n"
msgstr ""
-#: gcc.c:3049
+#: gcc.c:3039
msgid ""
" -print-multi-lib Display the mapping between command line options "
"and\n"
" multiple library search directories\n"
msgstr ""
-#: gcc.c:3052
+#: gcc.c:3042
msgid " -print-multi-os-directory Display the relative path to OS libraries\n"
msgstr ""
-#: gcc.c:3053
+#: gcc.c:3043
msgid ""
" -Wa,<options> Pass comma-separated <options> on to the "
"assembler\n"
msgstr ""
-#: gcc.c:3054
+#: gcc.c:3044
msgid ""
" -Wp,<options> Pass comma-separated <options> on to the "
"preprocessor\n"
msgstr ""
-#: gcc.c:3055
+#: gcc.c:3045
msgid ""
" -Wl,<options> Pass comma-separated <options> on to the linker\n"
msgstr ""
-#: gcc.c:3056
+#: gcc.c:3046
msgid " -Xassembler <arg> Pass <arg> on to the assembler\n"
msgstr ""
-#: gcc.c:3057
+#: gcc.c:3047
msgid " -Xpreprocessor <arg> Pass <arg> on to the preprocessor\n"
msgstr ""
-#: gcc.c:3058
+#: gcc.c:3048
msgid " -Xlinker <arg> Pass <arg> on to the linker\n"
msgstr ""
-#: gcc.c:3059
+#: gcc.c:3049
msgid ""
" -combine Pass multiple source files to compiler at once\n"
msgstr ""
-#: gcc.c:3060
+#: gcc.c:3050
msgid " -save-temps Do not delete intermediate files\n"
msgstr ""
-#: gcc.c:3061
+#: gcc.c:3051
msgid " -pipe Use pipes rather than intermediate files\n"
msgstr ""
-#: gcc.c:3062
+#: gcc.c:3052
msgid " -time Time the execution of each subprocess\n"
msgstr ""
-#: gcc.c:3063
+#: gcc.c:3053
msgid ""
" -specs=<file> Override built-in specs with the contents of "
"<file>\n"
msgstr ""
-#: gcc.c:3064
+#: gcc.c:3054
msgid ""
" -std=<standard> Assume that the input sources are for <standard>\n"
msgstr ""
-#: gcc.c:3065
+#: gcc.c:3055
msgid ""
" -B <directory> Add <directory> to the compiler's search paths\n"
msgstr ""
-#: gcc.c:3066
+#: gcc.c:3056
msgid " -b <machine> Run gcc for target <machine>, if installed\n"
msgstr ""
-#: gcc.c:3067
+#: gcc.c:3057
msgid ""
" -V <version> Run gcc version number <version>, if installed\n"
msgstr ""
-#: gcc.c:3068
+#: gcc.c:3058
msgid ""
" -v Display the programs invoked by the compiler\n"
msgstr ""
-#: gcc.c:3069
+#: gcc.c:3059
msgid ""
" -### Like -v but options quoted and commands not "
"executed\n"
msgstr ""
-#: gcc.c:3070
+#: gcc.c:3060
msgid ""
" -E Preprocess only; do not compile, assemble or "
"link\n"
msgstr ""
-#: gcc.c:3071
+#: gcc.c:3061
msgid " -S Compile only; do not assemble or link\n"
msgstr ""
-#: gcc.c:3072
+#: gcc.c:3062
msgid " -c Compile and assemble, but do not link\n"
msgstr ""
-#: gcc.c:3073
+#: gcc.c:3063
msgid " -o <file> Place the output into <file>\n"
msgstr ""
-#: gcc.c:3074
+#: gcc.c:3064
msgid ""
" -x <language> Specify the language of the following input "
"files\n"
@@ -4903,7 +4935,7 @@ msgid ""
"extension\n"
msgstr ""
-#: gcc.c:3081
+#: gcc.c:3071
#, c-format
msgid ""
"\n"
@@ -4912,28 +4944,28 @@ msgid ""
" other options on to these processes the -W<letter> options must be used.\n"
msgstr ""
-#: gcc.c:3201
+#: gcc.c:3191
#, c-format
msgid "'-%c' option must have argument"
msgstr ""
-#: gcc.c:3223
+#: gcc.c:3213
#, c-format
msgid "couldn't run '%s': %s"
msgstr ""
#. translate_options () has turned --version into -fversion.
-#: gcc.c:3408
+#: gcc.c:3398
#, c-format
msgid "%s (GCC) %s\n"
msgstr ""
-#: gcc.c:3410 gcov.c:412 java/gjavah.c:2368 java/jcf-dump.c:916
+#: gcc.c:3400 gcov.c:412 java/gjavah.c:2376 java/jcf-dump.c:916
#: java/jv-scan.c:128
msgid "(C)"
msgstr ""
-#: gcc.c:3411 java/gjavah.c:2369 java/jcf-dump.c:917 java/jv-scan.c:129
+#: gcc.c:3401 java/gjavah.c:2377 java/jcf-dump.c:917 java/jv-scan.c:129
#, c-format
msgid ""
"This is free software; see the source for copying conditions. There is NO\n"
@@ -4941,87 +4973,87 @@ msgid ""
"\n"
msgstr ""
-#: gcc.c:3512
+#: gcc.c:3502
msgid "argument to '-Xlinker' is missing"
msgstr ""
-#: gcc.c:3520
+#: gcc.c:3510
msgid "argument to '-Xpreprocessor' is missing"
msgstr ""
-#: gcc.c:3527
+#: gcc.c:3517
msgid "argument to '-Xassembler' is missing"
msgstr ""
-#: gcc.c:3534
+#: gcc.c:3524
msgid "argument to '-l' is missing"
msgstr ""
-#: gcc.c:3555
+#: gcc.c:3545
msgid "argument to '-specs' is missing"
msgstr ""
-#: gcc.c:3569
+#: gcc.c:3559
msgid "argument to '-specs=' is missing"
msgstr ""
-#: gcc.c:3606
+#: gcc.c:3596
#, c-format
msgid "'-%c' must come at the start of the command line"
msgstr ""
-#: gcc.c:3615
+#: gcc.c:3605
msgid "argument to '-B' is missing"
msgstr ""
-#: gcc.c:3788
+#: gcc.c:3778
msgid "warning: -pipe ignored because -save-temps specified"
msgstr ""
-#: gcc.c:3792
+#: gcc.c:3782
msgid "warning: -pipe ignored because -time specified"
msgstr ""
-#: gcc.c:4004
+#: gcc.c:3994
msgid "argument to '-x' is missing"
msgstr ""
-#: gcc.c:4032
+#: gcc.c:4022
#, c-format
msgid "argument to '-%s' is missing"
msgstr ""
-#: gcc.c:4093
+#: gcc.c:4083
#, c-format
msgid "warning: '-x %s' after last input file has no effect"
msgstr ""
-#: gcc.c:4370
+#: gcc.c:4360
#, c-format
msgid "switch '%s' does not start with '-'"
msgstr ""
-#: gcc.c:4597
+#: gcc.c:4587
#, c-format
msgid "spec '%s' invalid"
msgstr ""
-#: gcc.c:4663
+#: gcc.c:4653
#, c-format
msgid "%s\n"
msgstr ""
-#: gcc.c:4736
+#: gcc.c:4726
#, c-format
msgid "spec '%s' has invalid '%%0%c'"
msgstr ""
-#: gcc.c:4933
+#: gcc.c:4923
#, c-format
msgid "spec '%s' has invalid '%%W%c"
msgstr ""
-#: gcc.c:4964
+#: gcc.c:4954
#, c-format
msgid "spec '%s' has invalid '%%x%c'"
msgstr ""
@@ -5029,159 +5061,164 @@ msgstr ""
#. Catch the case where a spec string contains something like
#. '%{foo:%*}'. i.e. there is no * in the pattern on the left
#. hand side of the :.
-#: gcc.c:5176
+#: gcc.c:5149
#, c-format
msgid "spec failure: '%%*' has not been initialized by pattern match"
msgstr ""
-#: gcc.c:5185
+#: gcc.c:5158
#, c-format
msgid "warning: use of obsolete %%[ operator in specs"
msgstr ""
-#: gcc.c:5203
+#: gcc.c:5176
#, c-format
msgid "Processing spec %c%s%c, which is '%s'\n"
msgstr ""
-#: gcc.c:5266
+#: gcc.c:5239
#, c-format
msgid "spec failure: unrecognized spec option '%c'"
msgstr ""
-#: gcc.c:5345
+#: gcc.c:5318
#, c-format
msgid "unknown spec function '%s'"
msgstr ""
-#: gcc.c:5364
+#: gcc.c:5337
#, c-format
msgid "error in args to spec function '%s'"
msgstr ""
-#: gcc.c:5412
+#: gcc.c:5385
msgid "malformed spec function name"
msgstr ""
#. )
-#: gcc.c:5415
+#: gcc.c:5388
msgid "no arguments for spec function"
msgstr ""
-#: gcc.c:5434
+#: gcc.c:5407
msgid "malformed spec function arguments"
msgstr ""
-#: gcc.c:5657
+#: gcc.c:5646
#, c-format
msgid "braced spec '%s' is invalid at '%c'"
msgstr ""
-#: gcc.c:5745
+#: gcc.c:5734
#, c-format
msgid "braced spec body '%s' is invalid"
msgstr ""
-#: gcc.c:6171
+#: gcc.c:6160
msgid "spec failure: more than one arg to SYSROOT_SUFFIX_SPEC."
msgstr ""
-#: gcc.c:6181
+#: gcc.c:6170
msgid "spec failure: more than one arg to SYSROOT_HEADERS_SUFFIX_SPEC."
msgstr ""
-#: gcc.c:6274
+#: gcc.c:6263
#, c-format
msgid "unrecognized option '-%s'"
msgstr ""
-#: gcc.c:6280
+#: gcc.c:6269
#, c-format
msgid "install: %s%s\n"
msgstr ""
-#: gcc.c:6281
+#: gcc.c:6270
#, c-format
msgid "programs: %s\n"
msgstr ""
-#: gcc.c:6282
+#: gcc.c:6271
#, c-format
msgid "libraries: %s\n"
msgstr ""
-#: gcc.c:6339
+#: gcc.c:6328
#, c-format
msgid ""
"\n"
"For bug reporting instructions, please see:\n"
msgstr ""
-#: gcc.c:6355
+#: gcc.c:6344
+#, c-format
+msgid "Target: %s\n"
+msgstr ""
+
+#: gcc.c:6345
#, c-format
msgid "Configured with: %s\n"
msgstr ""
-#: gcc.c:6369
+#: gcc.c:6359
#, c-format
msgid "Thread model: %s\n"
msgstr ""
-#: gcc.c:6380
+#: gcc.c:6370
#, c-format
msgid "gcc version %s\n"
msgstr ""
-#: gcc.c:6382
+#: gcc.c:6372
#, c-format
msgid "gcc driver version %s executing gcc version %s\n"
msgstr ""
-#: gcc.c:6390
+#: gcc.c:6380
msgid "no input files"
msgstr ""
-#: gcc.c:6461 gcc.c:6524
+#: gcc.c:6451 gcc.c:6514
#, c-format
msgid "%s: %s compiler not installed on this system"
msgstr ""
-#: gcc.c:6470
+#: gcc.c:6460
#, c-format
msgid "spec '%s' is invalid"
msgstr ""
-#: gcc.c:6607
+#: gcc.c:6596
#, c-format
msgid "%s: linker input file unused because linking not done"
msgstr ""
-#: gcc.c:6647
+#: gcc.c:6636
#, c-format
msgid "language %s not recognized"
msgstr ""
-#: gcc.c:6718
+#: gcc.c:6707
#, c-format
msgid "%s: %s"
msgstr ""
-#: gcc.c:6938
+#: gcc.c:6927
#, c-format
msgid "multilib spec '%s' is invalid"
msgstr ""
-#: gcc.c:7130
+#: gcc.c:7119
#, c-format
msgid "multilib exclusions '%s' is invalid"
msgstr ""
-#: gcc.c:7188 gcc.c:7329
+#: gcc.c:7177 gcc.c:7318
#, c-format
msgid "multilib select '%s' is invalid"
msgstr ""
-#: gcc.c:7367
+#: gcc.c:7356
#, c-format
msgid "multilib exclusion '%s' is invalid"
msgstr ""
@@ -5459,27 +5496,57 @@ msgid "%s:source file is newer than graph file '%s'\n"
msgstr ""
#. Return if there's nothing to do, or it is too expensive.
-#: gcse.c:711
+#: gcse.c:689
msgid "GCSE disabled"
msgstr ""
#. Return if there's nothing to do, or it is too expensive.
-#: gcse.c:6536
+#: gcse.c:6474
msgid "jump bypassing disabled"
msgstr ""
-#: gcse.c:6597
+#: gcse.c:6535
#, c-format
msgid "%s: %d basic blocks and %d edges/basic block"
msgstr ""
-#: gcse.c:6610
+#: gcse.c:6548
#, c-format
msgid "%s: %d basic blocks and %d registers"
msgstr ""
+#: gengtype-yacc.c:560 java/parse-scan.c:1934
+#: java/parse-scan.y:1374 java/parse.c:2933
+#: java/parse.y:16423
+msgid "syntax error: cannot back up"
+msgstr ""
+
+#: gengtype-yacc.c:1602 java/parse-scan.c:3103
+#: java/parse-scan.y:1372 java/parse.c:6206
+#: java/parse.y:16421
+msgid "syntax error; also virtual memory exhausted"
+msgstr ""
+
+#. Depending on the version of Bison used to compile this grammar,
+#. it may issue generic diagnostics spelled "syntax error" or
+#. "parse error". To prevent this from changing the translation
+#. template randomly, we list all the variants of this particular
+#. diagnostic here. Translators: there is no fine distinction
+#. between diagnostics with "syntax error" in them, and diagnostics
+#. with "parse error" in them. It's okay to give them both the same
+#. translation.
+#: gengtype-yacc.c:1606 java/parse-scan.c:3107
+#: java/parse-scan.y:1370 java/parse.c:6210
+#: java/parse.y:16419
+msgid "syntax error"
+msgstr ""
+
+#: gengtype-yacc.c:1727 java/parse-scan.c:3228 java/parse.c:6331
+msgid "parser stack overflow"
+msgstr ""
+
#: ggc-common.c:397 ggc-common.c:405 ggc-common.c:473 ggc-common.c:494
-#: ggc-page.c:2203 ggc-page.c:2235 ggc-page.c:2242 ggc-zone.c:1582
+#: ggc-page.c:2209 ggc-page.c:2240 ggc-page.c:2247 ggc-zone.c:1582
#: ggc-zone.c:1588 ggc-zone.c:1597
#, c-format
msgid "can't write PCH file: %m"
@@ -5496,7 +5563,7 @@ msgid "can't write padding to PCH file: %m"
msgstr ""
#: ggc-common.c:550 ggc-common.c:558 ggc-common.c:565 ggc-common.c:568
-#: ggc-common.c:578 ggc-common.c:581 ggc-page.c:2329 ggc-zone.c:1607
+#: ggc-common.c:578 ggc-common.c:581 ggc-page.c:2334 ggc-zone.c:1607
#, c-format
msgid "can't read PCH file: %m"
msgstr ""
@@ -5505,12 +5572,12 @@ msgstr ""
msgid "had to relocate PCH"
msgstr ""
-#: ggc-page.c:1448
+#: ggc-page.c:1454
#, c-format
msgid "open /dev/zero: %m"
msgstr ""
-#: ggc-page.c:2220 ggc-page.c:2226
+#: ggc-page.c:2225 ggc-page.c:2231
msgid "can't write PCH file"
msgstr ""
@@ -5518,27 +5585,27 @@ msgstr ""
msgid "unexpected node"
msgstr ""
-#: gimplify.c:3137
+#: gimplify.c:3317
#, c-format
msgid "invalid lvalue in asm output %d"
msgstr ""
-#: gimplify.c:3185
+#: gimplify.c:3364
#, c-format
msgid "memory input %d is not directly addressable"
msgstr ""
-#: gimplify.c:4032
+#: gimplify.c:4219
msgid "gimplification failed"
msgstr ""
-#: global.c:373 global.c:386 global.c:400
+#: global.c:371 global.c:384 global.c:398
#, c-format
msgid "%s cannot be used in asm here"
msgstr ""
-#: graph.c:403 passes.c:131 java/jcf-parse.c:1040 java/jcf-parse.c:1180
-#: java/lex.c:1842 objc/objc-act.c:550
+#: graph.c:403 passes.c:131 java/jcf-parse.c:1047 java/jcf-parse.c:1194
+#: java/lex.c:1846 objc/objc-act.c:552
#, c-format
msgid "can't open %s: %m"
msgstr ""
@@ -5598,89 +5665,99 @@ msgstr ""
msgid "unrecognized command line option \"%s\""
msgstr ""
-#: opts.c:632
+#: opts.c:634
msgid "-Wuninitialized is not supported without -O"
msgstr ""
-#: opts.c:646
+#: opts.c:648
msgid "-freorder-blocks-and-partition does not work with exceptions"
msgstr ""
-#: opts.c:659
+#: opts.c:661
msgid "-freorder-blocks-and-partition does not work with -g (currently)"
msgstr ""
-#: opts.c:820
+#: opts.c:821
#, c-format
msgid "structure alignment must be a small power of two, not %d"
msgstr ""
-#: opts.c:885
+#: opts.c:886
#, c-format
msgid "unrecognised visibility value \"%s\""
msgstr ""
-#: opts.c:937
+#: opts.c:938
#, c-format
msgid "unrecognized register name \"%s\""
msgstr ""
-#: opts.c:957
+#: opts.c:962
#, c-format
msgid "unknown tls-model \"%s\""
msgstr ""
-#: opts.c:1032
+#: opts.c:1037
#, c-format
msgid "%s: --param arguments should be of the form NAME=VALUE"
msgstr ""
-#: opts.c:1037
+#: opts.c:1042
#, c-format
msgid "invalid --param value %qs"
msgstr ""
-#: opts.c:1133
+#: opts.c:1139
msgid "target system does not support debug output"
msgstr ""
-#: opts.c:1140
+#: opts.c:1146
#, c-format
msgid "debug format \"%s\" conflicts with prior selection"
msgstr ""
-#: opts.c:1156
+#: opts.c:1162
#, c-format
msgid "unrecognised debug output level \"%s\""
msgstr ""
-#: opts.c:1158
+#: opts.c:1164
#, c-format
msgid "debug output level %s is too high"
msgstr ""
-#: opts.c:1177
+#: opts.c:1183
msgid "The following options are language-independent:\n"
msgstr ""
-#: opts.c:1184
+#: opts.c:1190
#, c-format
msgid ""
"The %s front end recognizes the following options:\n"
"\n"
msgstr ""
-#: opts.c:1198
+#: opts.c:1204
msgid "The --param option recognizes the following as parameters:\n"
msgstr ""
+#: params.c:72
+#, c-format
+msgid "minimum value of parameter %qs is %u"
+msgstr ""
+
+#: params.c:77
+#, c-format
+msgid "maximum value of parameter %qs is %u"
+msgstr ""
+
#. If we didn't find this parameter, issue an error message.
-#: params.c:76
+#: params.c:86
#, c-format
msgid "invalid parameter %qs"
msgstr ""
-#: passes.c:1250
+#: passes.c:1200
msgid ""
"branch target register load optimization is not intended to be run twice"
msgstr ""
@@ -6014,92 +6091,88 @@ msgstr ""
msgid "%s: input file names must have .c suffixes: %s\n"
msgstr ""
-#: ra.c:774
-msgid "Didn't find a coloring.\n"
-msgstr ""
-
-#: reg-stack.c:621
+#: reg-stack.c:622
#, c-format
msgid "output constraint %d must specify a single register"
msgstr ""
-#: reg-stack.c:631
+#: reg-stack.c:632
#, c-format
msgid "output constraint %d cannot be specified together with \"%s\" clobber"
msgstr ""
-#: reg-stack.c:654
+#: reg-stack.c:655
msgid "output regs must be grouped at top of stack"
msgstr ""
-#: reg-stack.c:691
+#: reg-stack.c:692
msgid "implicitly popped regs must be grouped at top of stack"
msgstr ""
-#: reg-stack.c:710
+#: reg-stack.c:711
msgid "output operand %d must use %<&%> constraint"
msgstr ""
-#: regclass.c:762
+#: regclass.c:766
#, c-format
msgid "can't use '%s' as a %s register"
msgstr ""
-#: regclass.c:777 config/ia64/ia64.c:4136 config/ia64/ia64.c:4143
-#: config/pa/pa.c:328 config/pa/pa.c:335
+#: regclass.c:781 config/ia64/ia64.c:4568 config/ia64/ia64.c:4575
+#: config/pa/pa.c:336 config/pa/pa.c:343
#, c-format
msgid "unknown register name: %s"
msgstr ""
-#: regclass.c:787
+#: regclass.c:791
msgid "global register variable follows a function definition"
msgstr ""
-#: regclass.c:791
+#: regclass.c:795
msgid "register used for two global register variables"
msgstr ""
-#: regclass.c:796
+#: regclass.c:800
msgid "call-clobbered register used for global register variable"
msgstr ""
-#: regrename.c:1876
+#: regrename.c:1872
#, c-format
msgid "validate_value_data: [%u] Bad next_regno for empty chain (%u)"
msgstr ""
-#: regrename.c:1888
+#: regrename.c:1884
#, c-format
msgid "validate_value_data: Loop in regno chain (%u)"
msgstr ""
-#: regrename.c:1891
+#: regrename.c:1887
#, c-format
msgid "validate_value_data: [%u] Bad oldest_regno (%u)"
msgstr ""
-#: regrename.c:1903
+#: regrename.c:1899
#, c-format
msgid "validate_value_data: [%u] Non-empty reg in chain (%s %u %i)"
msgstr ""
-#: reload.c:1252
+#: reload.c:1270
msgid "cannot reload integer constant operand in %<asm%>"
msgstr ""
-#: reload.c:1275
+#: reload.c:1293
msgid "impossible register constraint in %<asm%>"
msgstr ""
-#: reload.c:3513
+#: reload.c:3535
msgid "%<&%> constraint used with no register class"
msgstr ""
-#: reload.c:3679
+#: reload.c:3705
msgid "unable to generate reloads for:"
msgstr ""
-#: reload.c:3680 reload.c:3912
+#: reload.c:3706 reload.c:3938
msgid "inconsistent operand constraints in an %<asm%>"
msgstr ""
@@ -6111,38 +6184,38 @@ msgstr ""
msgid "try reducing the number of local variables"
msgstr ""
-#: reload1.c:1866
+#: reload1.c:1865
msgid "can't find a register in class %qs while reloading %<asm%>"
msgstr ""
-#: reload1.c:1871
+#: reload1.c:1870
#, c-format
msgid "unable to find a register to spill in class %qs"
msgstr ""
-#: reload1.c:1873
+#: reload1.c:1872
msgid "this is the insn:"
msgstr ""
-#: reload1.c:3864
+#: reload1.c:3863
msgid "%<asm%> operand requires impossible reload"
msgstr ""
#. It's the compiler's fault.
-#: reload1.c:4983
+#: reload1.c:4982
msgid "could not find a spill register"
msgstr ""
-#: reload1.c:4988
+#: reload1.c:4987
msgid "%<asm%> operand constraint incompatible with operand size"
msgstr ""
#. It's the compiler's fault.
-#: reload1.c:6606
+#: reload1.c:6614
msgid "VOIDmode on an output"
msgstr ""
-#: reload1.c:6607
+#: reload1.c:6615
msgid "output operand is constant in %<asm%>"
msgstr ""
@@ -6154,145 +6227,145 @@ msgstr ""
msgid "insn does not satisfy its constraints:"
msgstr ""
-#: rtl.c:472
+#: rtl.c:471
#, c-format
msgid "RTL check: access of elt %d of '%s' with last elt %d in %s, at %s:%d"
msgstr ""
-#: rtl.c:482
+#: rtl.c:481
#, c-format
msgid ""
"RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at %s:%d"
msgstr ""
-#: rtl.c:492
+#: rtl.c:491
#, c-format
msgid ""
"RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s) in %s, at %"
"s:%d"
msgstr ""
-#: rtl.c:501
+#: rtl.c:500
#, c-format
msgid "RTL check: expected code '%s', have '%s' in %s, at %s:%d"
msgstr ""
-#: rtl.c:511
+#: rtl.c:510
#, c-format
msgid "RTL check: expected code '%s' or '%s', have '%s' in %s, at %s:%d"
msgstr ""
-#: rtl.c:522
+#: rtl.c:521
#, c-format
msgid "RTL check: access of elt %d of vector with last elt %d in %s, at %s:%d"
msgstr ""
-#: rtl.c:533
+#: rtl.c:532
#, c-format
msgid "RTL flag check: %s used with unexpected rtx code '%s' in %s, at %s:%d"
msgstr ""
-#: stmt.c:316
+#: stmt.c:317
msgid "output operand constraint lacks %<=%>"
msgstr ""
-#: stmt.c:331
+#: stmt.c:332
#, c-format
msgid "output constraint %qc for operand %d is not at the beginning"
msgstr ""
-#: stmt.c:354
+#: stmt.c:355
msgid "operand constraint contains incorrectly positioned %<+%> or %<=%>"
msgstr ""
-#: stmt.c:361 stmt.c:460
+#: stmt.c:362 stmt.c:461
msgid "%<%%%> constraint used with last operand"
msgstr ""
-#: stmt.c:380
+#: stmt.c:381
msgid "matching constraint not valid in output operand"
msgstr ""
-#: stmt.c:451
+#: stmt.c:452
#, c-format
msgid "input operand constraint contains %qc"
msgstr ""
-#: stmt.c:493
+#: stmt.c:494
msgid "matching constraint references invalid operand number"
msgstr ""
-#: stmt.c:531
+#: stmt.c:532
#, c-format
msgid "invalid punctuation %qc in constraint"
msgstr ""
-#: stmt.c:555
+#: stmt.c:556
msgid "matching constraint does not allow a register"
msgstr ""
-#: stmt.c:583
+#: stmt.c:584
#, c-format
msgid "asm-specifier for variable %qs conflicts with asm clobber list"
msgstr ""
-#: stmt.c:672
+#: stmt.c:673
msgid "unknown register name %qs in %<asm%>"
msgstr ""
-#: stmt.c:680
+#: stmt.c:681
msgid "PIC register %qs clobbered in %<asm%>"
msgstr ""
-#: stmt.c:727
+#: stmt.c:728
msgid "more than %d operands in %<asm%>"
msgstr ""
-#: stmt.c:790
+#: stmt.c:791
#, c-format
msgid "output number %d not directly addressable"
msgstr ""
-#: stmt.c:869
+#: stmt.c:870
msgid "asm operand %d probably doesn%'t match constraints"
msgstr ""
-#: stmt.c:879
+#: stmt.c:880
#, c-format
msgid "use of memory input without lvalue in asm operand %d is deprecated"
msgstr ""
-#: stmt.c:1026
+#: stmt.c:1027
msgid "asm clobber conflict with output operand"
msgstr ""
-#: stmt.c:1031
+#: stmt.c:1032
msgid "asm clobber conflict with input operand"
msgstr ""
-#: stmt.c:1108
+#: stmt.c:1109
msgid "too many alternatives in %<asm%>"
msgstr ""
-#: stmt.c:1120
+#: stmt.c:1121
msgid "operand constraints for %<asm%> differ in number of alternatives"
msgstr ""
-#: stmt.c:1173
+#: stmt.c:1174
#, c-format
msgid "duplicate asm operand name %qs"
msgstr ""
-#: stmt.c:1271
+#: stmt.c:1272
msgid "missing close brace for named operand"
msgstr ""
-#: stmt.c:1299
+#: stmt.c:1300
#, c-format
msgid "undefined named operand %qs"
msgstr ""
-#: stmt.c:1464
+#: stmt.c:1465
msgid "%Hvalue computed is not used"
msgstr ""
@@ -6403,99 +6476,99 @@ msgstr ""
msgid "ld returned %d exit status"
msgstr ""
-#: toplev.c:465
+#: toplev.c:469
#, c-format
msgid "%s "
msgstr ""
-#: toplev.c:467
+#: toplev.c:471
#, c-format
msgid " %s"
msgstr ""
-#: toplev.c:532
+#: toplev.c:536
#, c-format
msgid "invalid option argument %qs"
msgstr ""
-#: toplev.c:602
+#: toplev.c:606
msgid "unrecoverable error"
msgstr ""
-#: toplev.c:622
+#: toplev.c:626
#, c-format
msgid "getting core file size maximum limit: %m"
msgstr ""
-#: toplev.c:625
+#: toplev.c:629
#, c-format
msgid "setting core file size limit to maximum: %m"
msgstr ""
-#: toplev.c:846
+#: toplev.c:850
msgid "%J%qF declared %<static%> but never defined"
msgstr ""
-#: toplev.c:872
+#: toplev.c:876
msgid "%J%qD defined but not used"
msgstr ""
-#: toplev.c:895 toplev.c:918
+#: toplev.c:899 toplev.c:922
#, c-format
msgid "%qs is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:921
+#: toplev.c:925
#, c-format
msgid "type is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:927
+#: toplev.c:931
#, c-format
msgid "%qs is deprecated"
msgstr ""
-#: toplev.c:929
+#: toplev.c:933
msgid "type is deprecated"
msgstr ""
-#: toplev.c:1075
+#: toplev.c:1087
#, c-format
msgid ""
"\n"
"Target specific options:\n"
msgstr ""
-#: toplev.c:1089 toplev.c:1108
+#: toplev.c:1101 toplev.c:1120
#, c-format
msgid " -m%-23s [undocumented]\n"
msgstr ""
-#: toplev.c:1117
+#: toplev.c:1129
#, c-format
msgid ""
"\n"
"There are undocumented target specific options as well.\n"
msgstr ""
-#: toplev.c:1119
+#: toplev.c:1131
#, c-format
msgid " They exist, but they are not documented.\n"
msgstr ""
-#: toplev.c:1163
+#: toplev.c:1175
#, c-format
msgid "unrecognized gcc debugging option: %c"
msgstr ""
#. Handle -mfix-and-continue.
-#: toplev.c:1225 config/rs6000/rs6000.c:1384 config/rs6000/rs6000.c:1395
+#: toplev.c:1237 config/rs6000/rs6000.c:1400 config/rs6000/rs6000.c:1411
#: config/rs6000/darwin.h:106
#, c-format
msgid "invalid option %qs"
msgstr ""
-#: toplev.c:1240
+#: toplev.c:1252
#, c-format
msgid ""
"%s%s%s version %s (%s)\n"
@@ -6503,342 +6576,352 @@ msgid ""
"%s%s%s version %s (%s) compiled by CC.\n"
msgstr ""
-#: toplev.c:1247
+#: toplev.c:1259
#, c-format
msgid ""
"%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n"
msgstr ""
-#: toplev.c:1299
+#: toplev.c:1311
msgid "options passed: "
msgstr ""
-#: toplev.c:1328
+#: toplev.c:1340
msgid "options enabled: "
msgstr ""
-#: toplev.c:1402
+#: toplev.c:1414
msgid "can%'t open %s for writing: %m"
msgstr ""
-#: toplev.c:1485 config/sh/sh.c:7306
+#: toplev.c:1492 config/sh/sh.c:7334
msgid "created and used with different settings of -fpic"
msgstr ""
-#: toplev.c:1487 config/sh/sh.c:7308
+#: toplev.c:1494 config/sh/sh.c:7336
msgid "created and used with different settings of -fpie"
msgstr ""
-#: toplev.c:1538 config/sh/sh.c:7358
+#: toplev.c:1545 config/sh/sh.c:7386
#, c-format
msgid "created and used with differing settings of '-m%s'"
msgstr ""
-#: toplev.c:1541 config/sh/sh.c:7361
+#: toplev.c:1548 config/sh/sh.c:7389
msgid "out of memory"
msgstr ""
-#: toplev.c:1736
+#: toplev.c:1756
msgid "instruction scheduling not supported on this target machine"
msgstr ""
-#: toplev.c:1740
+#: toplev.c:1760
msgid "this target machine does not have delayed branches"
msgstr ""
-#: toplev.c:1744
+#: toplev.c:1764
msgid "value-based profiling not yet implemented in trees."
msgstr ""
-#: toplev.c:1757
+#: toplev.c:1777
#, c-format
msgid "-f%sleading-underscore not supported on this target machine"
msgstr ""
-#: toplev.c:1831
+#: toplev.c:1851
#, c-format
msgid "target system does not support the \"%s\" debug format"
msgstr ""
-#: toplev.c:1843
+#: toplev.c:1863
msgid "variable tracking requested, but useless unless producing debug info"
msgstr ""
-#: toplev.c:1846
+#: toplev.c:1866
msgid "variable tracking requested, but not supported by this debug format"
msgstr ""
-#: toplev.c:1866
+#: toplev.c:1886
msgid "can%'t open %s: %m"
msgstr ""
-#: toplev.c:1873
+#: toplev.c:1893
msgid "-ffunction-sections not supported for this target"
msgstr ""
-#: toplev.c:1878
+#: toplev.c:1898
msgid "-fdata-sections not supported for this target"
msgstr ""
-#: toplev.c:1885
+#: toplev.c:1905
msgid "-ffunction-sections disabled; it makes profiling impossible"
msgstr ""
-#: toplev.c:1892
+#: toplev.c:1912
msgid "-fprefetch-loop-arrays not supported for this target"
msgstr ""
-#: toplev.c:1898
+#: toplev.c:1918
msgid "-fspeculative-prefetching not supported for this target"
msgstr ""
-#: toplev.c:1904
+#: toplev.c:1924
msgid ""
"-fprefetch-loop-arrays not supported for this target (try -march switches)"
msgstr ""
-#: toplev.c:1910
+#: toplev.c:1930
msgid ""
"-fspeculative-prefetching not supported for this target (try -march switches)"
msgstr ""
-#: toplev.c:1919
+#: toplev.c:1939
msgid "-fprefetch-loop-arrays is not supported with -Os"
msgstr ""
-#: toplev.c:1925
+#: toplev.c:1945
msgid "-ffunction-sections may affect debugging on some targets"
msgstr ""
-#: toplev.c:2034
+#: toplev.c:2057
#, c-format
msgid "error writing to %s: %m"
msgstr ""
-#: toplev.c:2036 java/jcf-parse.c:1059 java/jcf-write.c:3525
+#: toplev.c:2059 java/jcf-parse.c:1066 java/jcf-write.c:3538
#, c-format
msgid "error closing %s: %m"
msgstr ""
-#: tree-cfg.c:1325 tree-cfg.c:2036 tree-cfg.c:2038
+#: tree-cfg.c:1355 tree-cfg.c:2073 tree-cfg.c:2075
msgid "%Hwill never be executed"
msgstr ""
-#: tree-cfg.c:3221
+#: tree-cfg.c:3289
msgid "SSA name in freelist but still referenced"
msgstr ""
-#: tree-cfg.c:3231
+#: tree-cfg.c:3299
msgid "GIMPLE register modified with BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:3251
+#: tree-cfg.c:3327
msgid "address taken, but ADDRESSABLE bit not set"
msgstr ""
-#: tree-cfg.c:3260
+#: tree-cfg.c:3336
msgid "non-boolean used in condition"
msgstr ""
-#: tree-cfg.c:3316
+#: tree-cfg.c:3391
msgid "Invalid reference prefix."
msgstr ""
-#: tree-cfg.c:3381
+#: tree-cfg.c:3456
msgid "Is not a valid GIMPLE statement."
msgstr ""
-#: tree-cfg.c:3401
+#: tree-cfg.c:3476
msgid "Statement marked for throw, but doesn%'t."
msgstr ""
-#: tree-cfg.c:3406
+#: tree-cfg.c:3481
msgid "Statement marked for throw in middle of block."
msgstr ""
-#: tree-cfg.c:3509
+#: tree-cfg.c:3585
msgid "PHI def is not a GIMPLE value"
msgstr ""
-#: tree-cfg.c:3525 tree-cfg.c:3541
+#: tree-cfg.c:3601 tree-cfg.c:3617
msgid "Incorrect sharing of tree nodes"
msgstr ""
-#: tree-cfg.c:3550
+#: tree-cfg.c:3626
msgid "verify_stmts failed."
msgstr ""
-#: tree-cfg.c:3571
+#: tree-cfg.c:3647
msgid "ENTRY_BLOCK has a statement list associated with it\n"
msgstr ""
-#: tree-cfg.c:3577
+#: tree-cfg.c:3653
msgid "EXIT_BLOCK has a statement list associated with it\n"
msgstr ""
-#: tree-cfg.c:3584
+#: tree-cfg.c:3660
#, c-format
msgid "Fallthru to exit from bb %d\n"
msgstr ""
-#: tree-cfg.c:3601
+#: tree-cfg.c:3682
+#, c-format
+msgid "Nonlocal label %s is not first in a sequence of labels in bb %d"
+msgstr ""
+
+#: tree-cfg.c:3691
#, c-format
msgid "Label %s to block does not match in bb %d\n"
msgstr ""
-#: tree-cfg.c:3611
+#: tree-cfg.c:3700
#, c-format
msgid "Label %s has incorrect context in bb %d\n"
msgstr ""
-#: tree-cfg.c:3625
+#: tree-cfg.c:3714
#, c-format
msgid "Control flow in the middle of basic block %d\n"
msgstr ""
-#: tree-cfg.c:3635
+#: tree-cfg.c:3724
#, c-format
msgid "Label %s in the middle of basic block %d\n"
msgstr ""
-#: tree-cfg.c:3652
+#: tree-cfg.c:3741
#, c-format
msgid "Fallthru edge after a control statement in bb %d \n"
msgstr ""
-#: tree-cfg.c:3667
+#: tree-cfg.c:3756
#, c-format
msgid "Structured COND_EXPR at the end of bb %d\n"
msgstr ""
-#: tree-cfg.c:3680 tree-cfg.c:3718 tree-cfg.c:3730 tree-cfg.c:3801
+#: tree-cfg.c:3769 tree-cfg.c:3807 tree-cfg.c:3819 tree-cfg.c:3890
#, c-format
msgid "Wrong outgoing edge flags at end of bb %d\n"
msgstr ""
-#: tree-cfg.c:3688
+#: tree-cfg.c:3777
msgid "%<then%> label does not match edge at end of bb %d\n"
msgstr ""
-#: tree-cfg.c:3696
+#: tree-cfg.c:3785
msgid "%<else%> label does not match edge at end of bb %d\n"
msgstr ""
-#: tree-cfg.c:3706
+#: tree-cfg.c:3795
#, c-format
msgid "Explicit goto at end of bb %d\n"
msgstr ""
-#: tree-cfg.c:3735
+#: tree-cfg.c:3824
#, c-format
msgid "Return edge does not point to exit in bb %d\n"
msgstr ""
-#: tree-cfg.c:3768
+#: tree-cfg.c:3857
msgid "Found default case not at end of case vector"
msgstr ""
-#: tree-cfg.c:3774
+#: tree-cfg.c:3863
msgid ""
"Case labels not sorted:\n"
" "
msgstr ""
-#: tree-cfg.c:3785
+#: tree-cfg.c:3874
msgid "No default case found at end of case vector"
msgstr ""
-#: tree-cfg.c:3793
+#: tree-cfg.c:3882
#, c-format
msgid "Extra outgoing edge %d->%d\n"
msgstr ""
-#: tree-cfg.c:3815
+#: tree-cfg.c:3904
#, c-format
msgid "Missing edge %i->%i"
msgstr ""
-#: tree-cfg.c:5516
+#: tree-cfg.c:5707
msgid "%Jfunction might be possible candidate for attribute %<noreturn%>"
msgstr ""
-#: tree-cfg.c:5543 tree-cfg.c:5547
+#: tree-cfg.c:5734 tree-cfg.c:5738
msgid "%H%<noreturn%> function does return"
msgstr ""
-#: tree-cfg.c:5567 tree-cfg.c:5572
+#: tree-cfg.c:5759 tree-cfg.c:5764
msgid "%Hcontrol reaches end of non-void function"
msgstr ""
-#: tree-dump.c:847
+#: tree-dump.c:849
#, c-format
msgid "could not open dump file %qs: %s"
msgstr ""
-#: tree-dump.c:960
+#: tree-dump.c:965
msgid "ignoring unknown option %q.*s in %<-fdump-%s%>"
msgstr ""
-#: tree-inline.c:945
+#: tree-inline.c:969
msgid ""
"%Jfunction %qF can never be inlined because it uses alloca (override using "
"the always_inline attribute)"
msgstr ""
-#: tree-inline.c:957
+#: tree-inline.c:981
msgid "%Jfunction %qF can never be inlined because it uses setjmp"
msgstr ""
-#: tree-inline.c:971
+#: tree-inline.c:995
msgid ""
"%Jfunction %qF can never be inlined because it uses variable argument lists"
msgstr ""
-#: tree-inline.c:982
+#: tree-inline.c:1006
msgid ""
"%Jfunction %qF can never be inlined because it uses setjmp-longjmp exception "
"handling"
msgstr ""
-#: tree-inline.c:989
+#: tree-inline.c:1013
msgid "%Jfunction %qF can never be inlined because it uses non-local goto"
msgstr ""
-#: tree-inline.c:1008
+#: tree-inline.c:1032
msgid "%Jfunction %qF can never be inlined because it contains a computed goto"
msgstr ""
-#: tree-inline.c:1022
+#: tree-inline.c:1046
msgid ""
"%Jfunction %qF can never be inlined because it receives a non-local goto"
msgstr ""
-#: tree-inline.c:1044
+#: tree-inline.c:1071
msgid ""
"%Jfunction %qF can never be inlined because it uses variable sized variables"
msgstr ""
-#: tree-inline.c:1463
+#: tree-inline.c:1495
msgid "originally indirect function call not considered for inlining"
msgstr ""
-#: tree-inline.c:1473 tree-inline.c:1481
+#: tree-inline.c:1505 tree-inline.c:1513
msgid "%Jinlining failed in call to %qF: %s"
msgstr ""
-#: tree-inline.c:1474 tree-inline.c:1482
+#: tree-inline.c:1506 tree-inline.c:1514
msgid "called from here"
msgstr ""
-#: tree-mudflap.c:851
+#: tree-inline.c:1628
+msgid "control may reach end of non-void function %qD being inlined"
+msgstr ""
+
+#: tree-mudflap.c:857
msgid "mudflap checking not yet implemented for ARRAY_RANGE_REF"
msgstr ""
-#: tree-mudflap.c:1042
-msgid "mudflap ran off end of BIND_EXPR body"
+#: tree-mudflap.c:1048
+#, c-format
+msgid "mudflap cannot track %qs in stub function"
msgstr ""
-#: tree-mudflap.c:1270
+#: tree-mudflap.c:1279
#, c-format
msgid "mudflap cannot track unknown size extern %qs"
msgstr ""
@@ -6847,36 +6930,36 @@ msgstr ""
msgid "mudflap: this language is not supported"
msgstr ""
-#: tree-optimize.c:698
+#: tree-optimize.c:720
msgid "%Jsize of return value of %qD is %u bytes"
msgstr ""
-#: tree-optimize.c:701
+#: tree-optimize.c:723
msgid "%Jsize of return value of %qD is larger than %wd bytes"
msgstr ""
-#: tree-outof-ssa.c:600 tree-outof-ssa.c:615 tree-outof-ssa.c:629
-#: tree-outof-ssa.c:650 tree-outof-ssa.c:1023 tree-outof-ssa.c:1834
+#: tree-outof-ssa.c:610 tree-outof-ssa.c:625 tree-outof-ssa.c:639
+#: tree-outof-ssa.c:661 tree-outof-ssa.c:1029 tree-outof-ssa.c:1865
#: tree-ssa-live.c:417 tree-ssa-live.c:1799
msgid "SSA corruption"
msgstr ""
-#: tree-outof-ssa.c:2239
+#: tree-outof-ssa.c:2270
#, c-format
msgid " Pending stmts not issued on PRED edge (%d, %d)\n"
msgstr ""
-#: tree-outof-ssa.c:2245
+#: tree-outof-ssa.c:2276
#, c-format
msgid " Pending stmts not issued on SUCC edge (%d, %d)\n"
msgstr ""
-#: tree-outof-ssa.c:2252
+#: tree-outof-ssa.c:2283
#, c-format
msgid " Pending stmts not issued on ENTRY edge (%d, %d)\n"
msgstr ""
-#: tree-outof-ssa.c:2258
+#: tree-outof-ssa.c:2289
#, c-format
msgid " Pending stmts not issued on EXIT edge (%d, %d)\n"
msgstr ""
@@ -6885,293 +6968,299 @@ msgstr ""
msgid "unimplemented functionality"
msgstr ""
-#: tree-ssa-operands.c:1260
+#: tree-ssa-operands.c:1273
msgid "internal error"
msgstr ""
-#: tree-ssa.c:117
+#: tree-ssa.c:113
msgid "Expected an SSA_NAME object"
msgstr ""
-#: tree-ssa.c:123
+#: tree-ssa.c:119
msgid "Type mismatch between an SSA_NAME and its symbol."
msgstr ""
-#: tree-ssa.c:129
+#: tree-ssa.c:125
msgid "Found an SSA_NAME that had been released into the free pool"
msgstr ""
-#: tree-ssa.c:135
+#: tree-ssa.c:131
msgid "Found a virtual definition for a GIMPLE register"
msgstr ""
-#: tree-ssa.c:141
+#: tree-ssa.c:137
msgid "Found a real definition for a non-register"
msgstr ""
-#: tree-ssa.c:170
+#: tree-ssa.c:166
#, c-format
msgid "SSA_NAME created in two different blocks %i and %i"
msgstr ""
-#: tree-ssa.c:179
+#: tree-ssa.c:175
msgid "SSA_NAME_DEF_STMT is wrong"
msgstr ""
-#: tree-ssa.c:230
+#: tree-ssa.c:227
msgid "Missing definition"
msgstr ""
-#: tree-ssa.c:236
+#: tree-ssa.c:233
#, c-format
msgid "Definition in block %i does not dominate use in block %i"
msgstr ""
-#: tree-ssa.c:244
+#: tree-ssa.c:241
#, c-format
msgid "Definition in block %i follows the use"
msgstr ""
-#: tree-ssa.c:251
+#: tree-ssa.c:248
msgid "SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set"
msgstr ""
-#: tree-ssa.c:283
+#: tree-ssa.c:280
msgid "Incoming edge count does not match number of PHI arguments\n"
msgstr ""
-#: tree-ssa.c:296
+#: tree-ssa.c:293
#, c-format
msgid "PHI argument is missing for edge %d->%d\n"
msgstr ""
-#: tree-ssa.c:305
+#: tree-ssa.c:302
msgid "PHI argument is not SSA_NAME, or invariant"
msgstr ""
-#: tree-ssa.c:317
+#: tree-ssa.c:314
#, c-format
msgid "Wrong edge %d->%d for PHI argument\n"
msgstr ""
-#: tree-ssa.c:367
+#: tree-ssa.c:364
msgid "Non-addressable variable inside an alias set."
msgstr ""
-#: tree-ssa.c:385
+#: tree-ssa.c:382
msgid "Addressable variable that is an alias tag but is not in any alias set."
msgstr ""
-#: tree-ssa.c:395
+#: tree-ssa.c:392
msgid "verify_flow_insensitive_alias_info failed."
msgstr ""
-#: tree-ssa.c:437
+#: tree-ssa.c:434
msgid "Dereferenced pointers should have a name or a type tag"
msgstr ""
-#: tree-ssa.c:445
+#: tree-ssa.c:442
msgid ""
"Pointers with a memory tag, should have points-to sets or point to malloc"
msgstr ""
-#: tree-ssa.c:453
+#: tree-ssa.c:450
msgid "Pointer escapes but its name tag is not call-clobbered."
msgstr ""
-#: tree-ssa.c:462
+#: tree-ssa.c:459
msgid "verify_flow_sensitive_alias_info failed."
msgstr ""
-#: tree-ssa.c:513
+#: tree-ssa.c:535
+msgid ""
+"Alias set of a pointer's type tag should be a superset of the corresponding "
+"name tag"
+msgstr ""
+
+#: tree-ssa.c:551
msgid ""
"Two different pointers with identical points-to sets but different name tags"
msgstr ""
-#: tree-ssa.c:540
+#: tree-ssa.c:580
msgid "verify_name_tags failed"
msgstr ""
-#: tree-ssa.c:605
+#: tree-ssa.c:647
#, c-format
msgid "AUX pointer initialized for edge %d->%d\n"
msgstr ""
-#: tree-ssa.c:630
+#: tree-ssa.c:672
msgid "Statement makes aliased stores, but has no V_MAY_DEFS"
msgstr ""
-#: tree-ssa.c:668
+#: tree-ssa.c:710
msgid "verify_ssa failed."
msgstr ""
-#: tree-ssa.c:1329
+#: tree-ssa.c:1376
msgid "%H%qD is used uninitialized in this function"
msgstr ""
-#: tree-ssa.c:1354
+#: tree-ssa.c:1401
msgid "%H%qD may be used uninitialized in this function"
msgstr ""
-#: tree-vectorizer.c:2138
+#: tree-vect-transform.c:598
msgid "no support for reduction/induction"
msgstr ""
-#: tree-vectorizer.c:2164
+#: tree-vect-transform.c:624
msgid "unsupported defining stmt"
msgstr ""
-#: tree.c:3258
+#: tree.c:3272
msgid "%Jfunction %qD definition is marked dllimport."
msgstr ""
-#: tree.c:3266
+#: tree.c:3280
msgid "%Jvariable %qD definition is marked dllimport."
msgstr ""
-#: tree.c:3286
+#: tree.c:3300
msgid "%Jexternal linkage required for symbol %qD because of %qs attribute."
msgstr ""
-#: tree.c:4428
+#: tree.c:4453
msgid "arrays of functions are not meaningful"
msgstr ""
-#: tree.c:4480
+#: tree.c:4505
msgid "function return type cannot be function"
msgstr ""
-#: tree.c:5362
+#: tree.c:5398
msgid "invalid initializer for bit string"
msgstr ""
-#: tree.c:5446
+#: tree.c:5482
#, c-format
msgid "tree check: %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:5483
+#: tree.c:5519
#, c-format
msgid "tree check: expected none of %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:5496
+#: tree.c:5532
#, c-format
msgid "tree check: expected class %qs, have %qs (%s) in %s, at %s:%d"
msgstr ""
-#: tree.c:5510
+#: tree.c:5546
#, c-format
msgid "tree check: accessed elt %d of tree_vec with %d elts in %s, at %s:%d"
msgstr ""
-#: tree.c:5522
+#: tree.c:5558
#, c-format
msgid "tree check: accessed elt %d of phi_node with %d elts in %s, at %s:%d"
msgstr ""
-#: tree.c:5534
+#: tree.c:5570
#, c-format
msgid "tree check: accessed operand %d of %s with %d operands in %s, at %s:%d"
msgstr ""
-#: varasm.c:476
+#: varasm.c:477
msgid "%J%D causes a section type conflict"
msgstr ""
-#: varasm.c:910
+#: varasm.c:911
msgid "%Jregister name not specified for %qD"
msgstr ""
-#: varasm.c:912
+#: varasm.c:913
msgid "%Jinvalid register name for %qD"
msgstr ""
-#: varasm.c:914
+#: varasm.c:915
msgid "%Jdata type of %qD isn%'t suitable for a register"
msgstr ""
-#: varasm.c:917
+#: varasm.c:918
msgid "%Jregister specified for %qD isn%'t suitable for data type"
msgstr ""
-#: varasm.c:927
+#: varasm.c:928
msgid "global register variable has initial value"
msgstr ""
-#: varasm.c:930
+#: varasm.c:931
msgid "volatile register variables don%'t work as you might wish"
msgstr ""
-#: varasm.c:963
+#: varasm.c:968
msgid "%Jregister name given for non-register variable %qD"
msgstr ""
-#: varasm.c:1038
+#: varasm.c:1046
msgid "global destructors not supported on this target"
msgstr ""
-#: varasm.c:1099
+#: varasm.c:1107
msgid "global constructors not supported on this target"
msgstr ""
-#: varasm.c:1592
+#: varasm.c:1607
msgid ""
"%Jalignment of %qD is greater than maximum object file alignment. Using %d"
msgstr ""
-#: varasm.c:1641
+#: varasm.c:1646
msgid "thread-local COMMON data not implemented"
msgstr ""
-#: varasm.c:1666
+#: varasm.c:1671
msgid ""
"%Jrequested alignment for %qD is greater than implemented alignment of %d"
msgstr ""
-#: varasm.c:3736
+#: varasm.c:3772
msgid "initializer for integer value is too complicated"
msgstr ""
-#: varasm.c:3741
+#: varasm.c:3777
msgid "initializer for floating value is not a floating constant"
msgstr ""
-#: varasm.c:3807
-msgid "unknown set constructor type"
-msgstr ""
-
-#: varasm.c:4026
+#: varasm.c:4046
#, c-format
msgid "invalid initial value for member %qs"
msgstr ""
-#: varasm.c:4213 varasm.c:4257
+#: varasm.c:4233 varasm.c:4277
msgid "%Jweak declaration of %qD must precede definition"
msgstr ""
-#: varasm.c:4221
+#: varasm.c:4241
msgid ""
"%Jweak declaration of %qD after first use results in unspecified behavior"
msgstr ""
-#: varasm.c:4255
+#: varasm.c:4275
msgid "%Jweak declaration of %qD must be public"
msgstr ""
-#: varasm.c:4264
+#: varasm.c:4284
msgid "%Jweak declaration of %qD not supported"
msgstr ""
-#: varasm.c:4293 varasm.c:4386
+#: varasm.c:4313 varasm.c:4462
msgid "only weak aliases are supported in this configuration"
msgstr ""
-#: varasm.c:4389
+#: varasm.c:4465
msgid "alias definitions not supported in this configuration; ignored"
msgstr ""
-#: varasm.c:4418
+#: varasm.c:4504
+msgid "%qD aliased to undefined symbol %qE"
+msgstr ""
+
+#: varasm.c:4532
msgid "visibility attribute not supported in this configuration; ignored"
msgstr ""
@@ -7234,13 +7323,12 @@ msgid "debug: "
msgstr ""
#: params.def:44
-msgid ""
-"The maximum structure size (in bytes) at which GCC will do block copies."
+msgid "The maximum structure size (in bytes) at which GCC will do block copies"
msgstr ""
#: params.def:54
msgid ""
-"The threshold ratio between instantiated fields and the total structure size."
+"The threshold ratio between instantiated fields and the total structure size"
msgstr ""
#: params.def:72
@@ -7272,255 +7360,267 @@ msgstr ""
msgid "The maximum depth of recursive inlining for non-inline functions"
msgstr ""
-#: params.def:114
-msgid "The maximum number of instructions for the RTL inliner"
-msgstr ""
-
-#: params.def:121
+#: params.def:111
msgid ""
"If -fvariable-expansion-in-unroller is used, the maximum number "
"of times that an individual variable will be expanded "
"during loop unrolling"
msgstr ""
-#: params.def:134
+#: params.def:124
msgid "The maximum number of instructions to consider to fill a delay slot"
msgstr ""
-#: params.def:145
+#: params.def:135
msgid ""
"The maximum number of instructions to consider to find accurate live "
"register information"
msgstr ""
-#: params.def:155
+#: params.def:145
msgid "The maximum length of scheduling's pending operations list"
msgstr ""
-#: params.def:160
+#: params.def:150
msgid "The size of function body to be considered large"
msgstr ""
-#: params.def:164
+#: params.def:154
msgid "Maximal growth due to inlining of large function (in percent)"
msgstr ""
-#: params.def:168
+#: params.def:158
msgid ""
"how much can given compilation unit grow because of the inlining (in percent)"
msgstr ""
-#: params.def:175
+#: params.def:165
msgid "The maximum amount of memory to be allocated by GCSE"
msgstr ""
-#: params.def:180
+#: params.def:170
msgid "The maximum number of passes to make when doing GCSE"
msgstr ""
-#: params.def:190
+#: params.def:180
msgid ""
-"The threshold ratio for performing partial redundancy elimination "
-"after reload."
+"The threshold ratio for performing partial redundancy elimination after "
+"reload."
msgstr ""
-#: params.def:198
+#: params.def:187
msgid ""
-"The threshold ratio of critical edges execution count that permit "
-"performing redundancy elimination after reload."
+"The threshold ratio of critical edges execution count that permit performing "
+"redundancy elimination after reload."
msgstr ""
-#: params.def:210
+#: params.def:198
msgid "The maximum number of instructions to consider to unroll in a loop"
msgstr ""
-#: params.def:216
+#: params.def:204
msgid ""
"The maximum number of instructions to consider to unroll in a loop on average"
msgstr ""
-#: params.def:221
+#: params.def:209
msgid "The maximum number of unrollings of a single loop"
msgstr ""
-#: params.def:226
+#: params.def:214
msgid "The maximum number of insns of a peeled loop"
msgstr ""
-#: params.def:231
+#: params.def:219
msgid "The maximum number of peelings of a single loop"
msgstr ""
-#: params.def:236
+#: params.def:224
msgid "The maximum number of insns of a completely peeled loop"
msgstr ""
-#: params.def:241
+#: params.def:229
msgid ""
"The maximum number of peelings of a single loop that is peeled completely"
msgstr ""
-#: params.def:246
+#: params.def:234
msgid "The maximum number of insns of a peeled loop that rolls only once"
msgstr ""
-#: params.def:252
+#: params.def:240
msgid "The maximum number of insns of an unswitched loop"
msgstr ""
-#: params.def:257
+#: params.def:245
msgid "The maximum number of unswitchings in a single loop"
msgstr ""
-#: params.def:264
+#: params.def:252
msgid ""
-"Bound on the number of iterations the brute force # of iterations \t "
-"analysis algorithm evaluates"
+"Bound on the number of iterations the brute force # of iterations analysis "
+"algorithm evaluates"
msgstr ""
-#: params.def:270
+#: params.def:257
msgid ""
-"Maximum number of loops to perform swing modulo scheduling on \t (mainly "
-"for debugging)"
+"Maximum number of loops to perform swing modulo scheduling on (mainly for "
+"debugging)"
msgstr ""
-#: params.def:277
+#: params.def:263
msgid ""
-"A factor for tuning the upper bound that swing modulo scheduler uses \t for "
+"A factor for tuning the upper bound that swing modulo scheduler uses for "
"scheduling a loop"
msgstr ""
-#: params.def:282
+#: params.def:267
msgid ""
"The number of cycles the swing modulo scheduler considers when \t checking "
"conflicts using DFA"
msgstr ""
-#: params.def:287
+#: params.def:272
msgid ""
-"A threshold on the average loop count considered by the swing modulo \t "
+"A threshold on the average loop count considered by the swing modulo "
"scheduler"
msgstr ""
-#: params.def:293
+#: params.def:277
msgid ""
"Select fraction of the maximal count of repetitions of basic block in "
"program given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:298
+#: params.def:281
msgid ""
"Select fraction of the maximal frequency of executions of basic block in "
"function given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:303
+#: params.def:285
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is available"
msgstr ""
-#: params.def:308
+#: params.def:289
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is not available"
msgstr ""
-#: params.def:313
+#: params.def:293
msgid "Maximal code growth caused by tail duplication (in percent)"
msgstr ""
-#: params.def:317
+#: params.def:297
msgid ""
"Stop reverse growth if the reverse probability of best edge is less than "
"this threshold (in percent)"
msgstr ""
-#: params.def:322
+#: params.def:301
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is available"
msgstr ""
-#: params.def:327
+#: params.def:305
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is not available"
msgstr ""
-#: params.def:334
+#: params.def:311
msgid "The maximum number of incoming edges to consider for crossjumping"
msgstr ""
-#: params.def:340
+#: params.def:317
msgid ""
"The minimum number of matching instructions to consider for crossjumping"
msgstr ""
-#: params.def:346
+#: params.def:323
+msgid ""
+"The maximum number of insns to duplicate when unfactoring computed gotos"
+msgstr ""
+
+#: params.def:329
msgid "The maximum length of path considered in cse"
msgstr ""
-#: params.def:353
+#: params.def:336
msgid ""
"The minimum cost of an expensive expression in the loop invariant motion"
msgstr ""
-#: params.def:362
+#: params.def:345
msgid ""
"Bound on number of candidates below that all candidates are considered in iv "
"optimizations"
msgstr ""
-#: params.def:370
+#: params.def:353
msgid "Bound on number of iv uses in loop optimized in iv optimizations"
msgstr ""
-#: params.def:377
+#: params.def:361
+msgid ""
+"If number of candidates in the set is smaller, we always try to remove "
+"unused ivs during its optimization"
+msgstr ""
+
+#: params.def:368
msgid ""
"Given N calls and V call-clobbered vars in a function. Use .GLOBAL_VAR if "
"NxV is larger than this limit"
msgstr ""
-#: params.def:382
+#: params.def:373
msgid "The maximum memory locations recorded by cselib"
msgstr ""
-#: params.def:395
+#: params.def:386
msgid ""
"Minimum heap expansion to trigger garbage collection, as a percentage of the "
"total size of the heap"
msgstr ""
-#: params.def:401
+#: params.def:391
msgid "Minimum heap size before we start collecting garbage, in kilobytes"
msgstr ""
-#: params.def:409
+#: params.def:399
msgid ""
"The maximum number of instructions to search backward when looking for "
"equivalent reload"
msgstr ""
-#: params.def:414
+#: params.def:404
msgid ""
"The maximum number of virtual operands allowed to represent aliases before "
"triggering alias grouping."
msgstr ""
-#: params.def:419
+#: params.def:409
msgid ""
"The maximum number of blocks in a region to be considered for interblock "
"scheduling"
msgstr ""
-#: params.def:424
+#: params.def:414
msgid ""
"The maximum number of insns in a region to be considered for interblock "
"scheduling"
msgstr ""
-#: params.def:432
+#: params.def:419
+msgid ""
+"The maximum number of RTL nodes that can be recorded as combiner's last value"
+msgstr ""
+
+#: params.def:427
msgid "The upper bound for sharing integer constants"
msgstr ""
@@ -7558,9 +7658,9 @@ msgstr ""
msgid "subframework include %s conflicts with framework include"
msgstr ""
-#: config/darwin.c:1332
+#: config/darwin.c:1350
msgid ""
-"internal and protected visibility attributes not supportedin this "
+"internal and protected visibility attributes not supported in this "
"configuration; ignored"
msgstr ""
@@ -7612,15 +7712,15 @@ msgstr ""
msgid "%Jignoring %<#pragma align%> for explicitly aligned %<%D%>"
msgstr ""
-#: config/darwin.h:152
+#: config/darwin.h:155
msgid "Set sizeof(bool) to 1"
msgstr ""
-#: config/darwin.h:154
+#: config/darwin.h:157
msgid "Generate code suitable for fast turn around debugging"
msgstr ""
-#: config/darwin.h:156
+#: config/darwin.h:159
msgid "Don't generate code suitable for fast turn around debugging"
msgstr ""
@@ -7629,7 +7729,7 @@ msgstr ""
#. coalesced sections. Weak aliases (or any other kind of aliases) are
#. not supported. Weak symbols that aren't visible outside the .s file
#. are not supported.
-#: config/darwin.h:388
+#: config/darwin.h:395
msgid "alias definitions not supported in Mach-O; ignored"
msgstr ""
@@ -7677,7 +7777,7 @@ msgstr ""
msgid "bad value %qs for -mfp-trap-mode switch"
msgstr ""
-#: config/alpha/alpha.c:347 config/rs6000/rs6000.c:1705
+#: config/alpha/alpha.c:347 config/rs6000/rs6000.c:1720
#, c-format
msgid "bad value %qs for -mtls-size switch"
msgstr ""
@@ -7717,91 +7817,91 @@ msgstr ""
msgid "bad value %qs for -mmemory-latency"
msgstr ""
-#: config/alpha/alpha.c:4598
+#: config/alpha/alpha.c:4764
#, c-format
msgid "invalid %%H value"
msgstr ""
-#: config/alpha/alpha.c:4619
+#: config/alpha/alpha.c:4785
#, c-format
msgid "invalid %%J value"
msgstr ""
-#: config/alpha/alpha.c:4635 config/ia64/ia64.c:3739
+#: config/alpha/alpha.c:4801 config/ia64/ia64.c:4133
#, c-format
msgid "invalid %%r value"
msgstr ""
-#: config/alpha/alpha.c:4645 config/rs6000/rs6000.c:10711
+#: config/alpha/alpha.c:4811 config/rs6000/rs6000.c:10799
#: config/xtensa/xtensa.c:1951
#, c-format
msgid "invalid %%R value"
msgstr ""
-#: config/alpha/alpha.c:4651 config/rs6000/rs6000.c:10630
+#: config/alpha/alpha.c:4817 config/rs6000/rs6000.c:10718
#: config/xtensa/xtensa.c:1918
#, c-format
msgid "invalid %%N value"
msgstr ""
-#: config/alpha/alpha.c:4659 config/rs6000/rs6000.c:10658
+#: config/alpha/alpha.c:4825 config/rs6000/rs6000.c:10746
#, c-format
msgid "invalid %%P value"
msgstr ""
-#: config/alpha/alpha.c:4667
+#: config/alpha/alpha.c:4833
#, c-format
msgid "invalid %%h value"
msgstr ""
-#: config/alpha/alpha.c:4675 config/xtensa/xtensa.c:1944
+#: config/alpha/alpha.c:4841 config/xtensa/xtensa.c:1944
#, c-format
msgid "invalid %%L value"
msgstr ""
-#: config/alpha/alpha.c:4714 config/rs6000/rs6000.c:10612
+#: config/alpha/alpha.c:4880 config/rs6000/rs6000.c:10700
#, c-format
msgid "invalid %%m value"
msgstr ""
-#: config/alpha/alpha.c:4722 config/rs6000/rs6000.c:10620
+#: config/alpha/alpha.c:4888 config/rs6000/rs6000.c:10708
#, c-format
msgid "invalid %%M value"
msgstr ""
-#: config/alpha/alpha.c:4766
+#: config/alpha/alpha.c:4932
#, c-format
msgid "invalid %%U value"
msgstr ""
-#: config/alpha/alpha.c:4778 config/alpha/alpha.c:4792
-#: config/rs6000/rs6000.c:10719
+#: config/alpha/alpha.c:4944 config/alpha/alpha.c:4958
+#: config/rs6000/rs6000.c:10807
#, c-format
msgid "invalid %%s value"
msgstr ""
-#: config/alpha/alpha.c:4815
+#: config/alpha/alpha.c:4981
#, c-format
msgid "invalid %%C value"
msgstr ""
-#: config/alpha/alpha.c:4852 config/rs6000/rs6000.c:10449
-#: config/rs6000/rs6000.c:10469
+#: config/alpha/alpha.c:5018 config/rs6000/rs6000.c:10537
+#: config/rs6000/rs6000.c:10557
#, c-format
msgid "invalid %%E value"
msgstr ""
-#: config/alpha/alpha.c:4877 config/alpha/alpha.c:4925
+#: config/alpha/alpha.c:5043 config/alpha/alpha.c:5091
msgid "unknown relocation unspec"
msgstr ""
-#: config/alpha/alpha.c:4886 config/rs6000/rs6000.c:11037
+#: config/alpha/alpha.c:5052 config/rs6000/rs6000.c:11125
#, c-format
msgid "invalid %%xn code"
msgstr ""
-#: config/alpha/alpha.c:5846 config/alpha/alpha.c:5849 config/s390/s390.c:7776
-#: config/s390/s390.c:7779
+#: config/alpha/alpha.c:6037 config/alpha/alpha.c:6040 config/s390/s390.c:8030
+#: config/s390/s390.c:8033
msgid "bad builtin fcode"
msgstr ""
@@ -7818,14 +7918,14 @@ msgstr ""
#. each pair being { "NAME", VALUE }
#. where VALUE is the bits to set or minus the bits to clear.
#. An empty string NAME is used to identify the default VALUE.
-#: config/alpha/alpha.h:293 config/i386/i386.h:336 config/i386/i386.h:338
-#: config/i386/i386.h:340 config/ns32k/ns32k.h:140 config/s390/s390.h:134
-#: config/sparc/sparc.h:616 config/sparc/sparc.h:621
+#: config/alpha/alpha.h:293 config/i386/i386.h:335 config/i386/i386.h:337
+#: config/i386/i386.h:339 config/ns32k/ns32k.h:140 config/s390/s390.h:134
+#: config/sparc/sparc.h:622 config/sparc/sparc.h:627
msgid "Use hardware fp"
msgstr ""
-#: config/alpha/alpha.h:294 config/i386/i386.h:337 config/i386/i386.h:339
-#: config/sparc/sparc.h:618 config/sparc/sparc.h:623
+#: config/alpha/alpha.h:294 config/i386/i386.h:336 config/i386/i386.h:338
+#: config/sparc/sparc.h:624 config/sparc/sparc.h:629
msgid "Do not use hardware fp"
msgstr ""
@@ -7944,7 +8044,7 @@ msgstr ""
msgid "Tune expected memory latency"
msgstr ""
-#: config/alpha/alpha.h:376 config/ia64/ia64.h:284 config/rs6000/sysv4.h:90
+#: config/alpha/alpha.h:376 config/ia64/ia64.h:278 config/rs6000/sysv4.h:90
msgid "Specify bit size of immediate TLS offsets"
msgstr ""
@@ -7963,17 +8063,17 @@ msgstr ""
msgid "argument of %qs attribute is not \"ilink1\" or \"ilink2\""
msgstr ""
-#: config/arc/arc.c:1739 config/m32r/m32r.c:2130
+#: config/arc/arc.c:1739 config/m32r/m32r.c:2141
#, c-format
msgid "invalid operand to %%R code"
msgstr ""
-#: config/arc/arc.c:1771 config/m32r/m32r.c:2153
+#: config/arc/arc.c:1771 config/m32r/m32r.c:2164
#, c-format
msgid "invalid operand to %%H/%%L code"
msgstr ""
-#: config/arc/arc.c:1794 config/m32r/m32r.c:2224
+#: config/arc/arc.c:1794 config/m32r/m32r.c:2235
#, c-format
msgid "invalid operand to %%U code"
msgstr ""
@@ -7985,169 +8085,169 @@ msgstr ""
#. Unknown flag.
#. Undocumented flag.
-#: config/arc/arc.c:1812 config/m32r/m32r.c:2251 config/sparc/sparc.c:7507
+#: config/arc/arc.c:1812 config/m32r/m32r.c:2262 config/sparc/sparc.c:7517
msgid "invalid operand output code"
msgstr ""
-#: config/arm/arm.c:786
+#: config/arm/arm.c:800
#, c-format
msgid "switch -mcpu=%s conflicts with -march= switch"
msgstr ""
-#: config/arm/arm.c:796 config/rs6000/rs6000.c:1220 config/sparc/sparc.c:641
+#: config/arm/arm.c:810 config/rs6000/rs6000.c:1230 config/sparc/sparc.c:648
#, c-format
msgid "bad value (%s) for %s switch"
msgstr ""
-#: config/arm/arm.c:905
+#: config/arm/arm.c:919
msgid "target CPU does not support interworking"
msgstr ""
-#: config/arm/arm.c:911
+#: config/arm/arm.c:925
msgid "target CPU does not support THUMB instructions"
msgstr ""
-#: config/arm/arm.c:925
+#: config/arm/arm.c:939
msgid ""
"enabling backtrace support is only meaningful when compiling for the Thumb"
msgstr ""
-#: config/arm/arm.c:928
+#: config/arm/arm.c:942
msgid ""
"enabling callee interworking support is only meaningful when compiling for "
"the Thumb"
msgstr ""
-#: config/arm/arm.c:931
+#: config/arm/arm.c:945
msgid ""
"enabling caller interworking support is only meaningful when compiling for "
"the Thumb"
msgstr ""
-#: config/arm/arm.c:935
+#: config/arm/arm.c:949
msgid "-mapcs-stack-check incompatible with -mno-apcs-frame"
msgstr ""
-#: config/arm/arm.c:943
+#: config/arm/arm.c:957
msgid "-fpic and -mapcs-reent are incompatible"
msgstr ""
-#: config/arm/arm.c:946
+#: config/arm/arm.c:960
msgid "APCS reentrant code not supported. Ignored"
msgstr ""
-#: config/arm/arm.c:954
+#: config/arm/arm.c:968
msgid "-g with -mno-apcs-frame may not give sensible debugging"
msgstr ""
-#: config/arm/arm.c:962
+#: config/arm/arm.c:976
msgid "passing floating point arguments in fp regs not yet supported"
msgstr ""
-#: config/arm/arm.c:1004
+#: config/arm/arm.c:1018
#, c-format
msgid "invalid ABI option: -mabi=%s"
msgstr ""
-#: config/arm/arm.c:1010
+#: config/arm/arm.c:1024
msgid "iwmmxt requires an AAPCS compatible ABI for proper operation"
msgstr ""
-#: config/arm/arm.c:1013
+#: config/arm/arm.c:1027
msgid "iwmmxt abi requires an iwmmxt capable cpu"
msgstr ""
-#: config/arm/arm.c:1023
+#: config/arm/arm.c:1037
#, c-format
msgid "invalid floating point emulation option: -mfpe=%s"
msgstr ""
-#: config/arm/arm.c:1040
+#: config/arm/arm.c:1054
#, c-format
msgid "invalid floating point option: -mfpu=%s"
msgstr ""
-#: config/arm/arm.c:1081
+#: config/arm/arm.c:1095
#, c-format
msgid "invalid floating point abi: -mfloat-abi=%s"
msgstr ""
-#: config/arm/arm.c:1096
+#: config/arm/arm.c:1110
msgid "-mfloat-abi=hard and VFP"
msgstr ""
-#: config/arm/arm.c:1122
+#: config/arm/arm.c:1136
#, c-format
msgid "structure size boundary can only be set to %s"
msgstr ""
-#: config/arm/arm.c:1131
+#: config/arm/arm.c:1145
msgid "-mpic-register= is useless without -fpic"
msgstr ""
-#: config/arm/arm.c:1138
+#: config/arm/arm.c:1152
#, c-format
msgid "unable to use '%s' for PIC register"
msgstr ""
-#: config/arm/arm.c:2613 config/arm/arm.c:2631 config/avr/avr.c:4533
-#: config/c4x/c4x.c:4499 config/h8300/h8300.c:5755 config/i386/i386.c:1697
-#: config/i386/i386.c:1743 config/ip2k/ip2k.c:3181
-#: config/m68hc11/m68hc11.c:1350 config/m68k/m68k.c:288
-#: config/mcore/mcore.c:3375 config/ns32k/ns32k.c:1068
-#: config/rs6000/rs6000.c:17129 config/sh/sh.c:7160 config/sh/sh.c:7181
-#: config/sh/sh.c:7216 config/stormy16/stormy16.c:2413 config/v850/v850.c:2207
+#: config/arm/arm.c:2669 config/arm/arm.c:2687 config/avr/avr.c:4620
+#: config/c4x/c4x.c:4499 config/h8300/h8300.c:5755 config/i386/i386.c:1704
+#: config/i386/i386.c:1750 config/ip2k/ip2k.c:3182
+#: config/m68hc11/m68hc11.c:1348 config/m68k/m68k.c:288
+#: config/mcore/mcore.c:3379 config/ns32k/ns32k.c:1073
+#: config/rs6000/rs6000.c:17260 config/sh/sh.c:7188 config/sh/sh.c:7209
+#: config/sh/sh.c:7244 config/stormy16/stormy16.c:2413 config/v850/v850.c:2210
#, c-format
msgid "%qs attribute only applies to functions"
msgstr ""
-#: config/arm/arm.c:10385 config/arm/arm.c:10403
+#: config/arm/arm.c:10454 config/arm/arm.c:10472
msgid "predicated Thumb instruction"
msgstr ""
-#: config/arm/arm.c:10391
+#: config/arm/arm.c:10460
msgid "predicated instruction in conditional sequence"
msgstr ""
-#: config/arm/arm.c:10499 config/arm/arm.c:10509 config/arm/arm.c:10519
-#: config/arm/arm.c:10545 config/arm/arm.c:10563 config/arm/arm.c:10598
-#: config/arm/arm.c:10617 config/arm/arm.c:10632 config/arm/arm.c:10658
-#: config/arm/arm.c:10665 config/arm/arm.c:10672
+#: config/arm/arm.c:10568 config/arm/arm.c:10578 config/arm/arm.c:10588
+#: config/arm/arm.c:10614 config/arm/arm.c:10632 config/arm/arm.c:10667
+#: config/arm/arm.c:10686 config/arm/arm.c:10701 config/arm/arm.c:10727
+#: config/arm/arm.c:10734 config/arm/arm.c:10741
#, c-format
msgid "invalid operand for code '%c'"
msgstr ""
-#: config/arm/arm.c:10558
+#: config/arm/arm.c:10627
msgid "instruction never exectued"
msgstr ""
-#: config/arm/arm.c:10683
+#: config/arm/arm.c:10752
msgid "missing operand"
msgstr ""
-#: config/arm/arm.c:11449
+#: config/arm/arm.c:11518
msgid "unable to compute real location of stacked parameter"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:12082 config/arm/arm.c:12119
+#: config/arm/arm.c:12151 config/arm/arm.c:12188
msgid "selector must be an immediate"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:12162 config/i386/i386.c:13369 config/i386/i386.c:13403
+#: config/arm/arm.c:12231 config/i386/i386.c:14446 config/i386/i386.c:14480
msgid "mask must be an immediate"
msgstr ""
-#: config/arm/arm.c:12838
+#: config/arm/arm.c:12907
msgid "no low registers available for popping high registers"
msgstr ""
-#: config/arm/arm.c:13056
+#: config/arm/arm.c:13125
msgid "interrupt Service Routines cannot be coded in Thumb mode"
msgstr ""
-#: config/arm/pe.c:171 config/mcore/mcore.c:3241
+#: config/arm/pe.c:171 config/mcore/mcore.c:3245
msgid "%Jinitialized variable '%D' is marked dllimport"
msgstr ""
@@ -8255,7 +8355,7 @@ msgstr ""
msgid "Specify the register to be used for PIC addressing"
msgstr ""
-#: config/arm/arm.h:396 config/mips/mips.h:780
+#: config/arm/arm.h:396 config/mips/mips.h:784
msgid "Specify an ABI"
msgstr ""
@@ -8271,55 +8371,65 @@ msgstr ""
msgid "Ignore dllimport attribute for functions"
msgstr ""
-#: config/avr/avr.c:520
+#: config/avr/avr.c:532
#, c-format
msgid "large frame pointer change (%d) with -mtiny-stack"
msgstr ""
-#: config/avr/avr.c:1107
+#: config/avr/avr.c:1119
msgid "bad address, not (reg+disp):"
msgstr ""
-#: config/avr/avr.c:1115
+#: config/avr/avr.c:1127
msgid "internal compiler error. Bad address:"
msgstr ""
-#: config/avr/avr.c:1128
+#: config/avr/avr.c:1140
msgid "internal compiler error. Unknown mode:"
msgstr ""
-#: config/avr/avr.c:1750 config/avr/avr.c:2411
+#: config/avr/avr.c:1763 config/avr/avr.c:2424
msgid "invalid insn:"
msgstr ""
-#: config/avr/avr.c:1784 config/avr/avr.c:1867 config/avr/avr.c:1916
-#: config/avr/avr.c:1925 config/avr/avr.c:2020 config/avr/avr.c:2189
-#: config/avr/avr.c:2445 config/avr/avr.c:2553
+#: config/avr/avr.c:1797 config/avr/avr.c:1880 config/avr/avr.c:1929
+#: config/avr/avr.c:1938 config/avr/avr.c:2033 config/avr/avr.c:2202
+#: config/avr/avr.c:2458 config/avr/avr.c:2566
msgid "incorrect insn:"
msgstr ""
-#: config/avr/avr.c:1944 config/avr/avr.c:2105 config/avr/avr.c:2260
-#: config/avr/avr.c:2597
+#: config/avr/avr.c:1957 config/avr/avr.c:2118 config/avr/avr.c:2273
+#: config/avr/avr.c:2610
msgid "unknown move insn:"
msgstr ""
-#: config/avr/avr.c:2820
+#: config/avr/avr.c:2840
msgid "bad shift insn:"
msgstr ""
-#: config/avr/avr.c:2933 config/avr/avr.c:3354 config/avr/avr.c:3725
+#: config/avr/avr.c:2956 config/avr/avr.c:3404 config/avr/avr.c:3790
msgid "internal compiler error. Incorrect shift:"
msgstr ""
-#: config/avr/avr.c:4507 config/ip2k/ip2k.c:3156
+#: config/avr/avr.c:4594 config/ip2k/ip2k.c:3157
msgid "only initialized variables can be placed into program memory area"
msgstr ""
-#: config/avr/avr.c:4601
+#: config/avr/avr.c:4637
+#, c-format
+msgid "`%s' appears to be a misspelled interrupt handler"
+msgstr ""
+
+#: config/avr/avr.c:4645
+#, c-format
+msgid "`%s' appears to be a misspelled signal handler"
+msgstr ""
+
+#: config/avr/avr.c:4714
msgid "only uninitialized variables can be placed in the .noinit section"
msgstr ""
-#: config/avr/avr.c:4615
+#: config/avr/avr.c:4728
#, c-format
msgid "MCU %qs supported for assembler only"
msgstr ""
@@ -8707,243 +8817,234 @@ msgstr ""
msgid "Select CPU to generate code for"
msgstr ""
-#: config/cris/cris.c:620
+#: config/cris/cris.c:630
msgid "unexpected index-type in cris_print_index"
msgstr ""
-#: config/cris/cris.c:634
+#: config/cris/cris.c:644
msgid "unexpected base-type in cris_print_base"
msgstr ""
-#: config/cris/cris.c:927
+#: config/cris/cris.c:945
#, c-format
msgid "stackframe too big: %d bytes"
msgstr ""
-#: config/cris/cris.c:1238
+#: config/cris/cris.c:1256
msgid "allocated but unused delay list in epilogue"
msgstr ""
-#: config/cris/cris.c:1248
+#: config/cris/cris.c:1266
msgid ""
"unexpected function type needing stack adjustment for __builtin_eh_return"
msgstr ""
-#: config/cris/cris.c:1324
+#: config/cris/cris.c:1342
msgid "invalid operand for 'b' modifier"
msgstr ""
-#: config/cris/cris.c:1337
+#: config/cris/cris.c:1355
msgid "invalid operand for 'v' modifier"
msgstr ""
-#: config/cris/cris.c:1347
+#: config/cris/cris.c:1365
msgid "invalid operand for 'P' modifier"
msgstr ""
-#: config/cris/cris.c:1354
+#: config/cris/cris.c:1372
msgid "invalid operand for 'p' modifier"
msgstr ""
-#: config/cris/cris.c:1393
+#: config/cris/cris.c:1411
msgid "invalid operand for 'z' modifier"
msgstr ""
-#: config/cris/cris.c:1441 config/cris/cris.c:1471
+#: config/cris/cris.c:1459 config/cris/cris.c:1489
msgid "invalid operand for 'H' modifier"
msgstr ""
-#: config/cris/cris.c:1447
+#: config/cris/cris.c:1465
msgid "bad register"
msgstr ""
-#: config/cris/cris.c:1485
+#: config/cris/cris.c:1503
msgid "invalid operand for 'e' modifier"
msgstr ""
-#: config/cris/cris.c:1502
+#: config/cris/cris.c:1520
msgid "invalid operand for 'm' modifier"
msgstr ""
-#: config/cris/cris.c:1527
+#: config/cris/cris.c:1545
msgid "invalid operand for 'A' modifier"
msgstr ""
-#: config/cris/cris.c:1535
+#: config/cris/cris.c:1553
msgid "invalid operand for 'D' modifier"
msgstr ""
-#: config/cris/cris.c:1549
+#: config/cris/cris.c:1567
msgid "invalid operand for 'T' modifier"
msgstr ""
-#: config/cris/cris.c:1558
+#: config/cris/cris.c:1576
msgid "invalid operand modifier letter"
msgstr ""
-#: config/cris/cris.c:1566
+#: config/cris/cris.c:1584
#, c-format
msgid "internal error: bad register: %d"
msgstr ""
-#: config/cris/cris.c:1614
+#: config/cris/cris.c:1632
msgid "unexpected multiplicative operand"
msgstr ""
-#: config/cris/cris.c:1634
+#: config/cris/cris.c:1652
msgid "unexpected operand"
msgstr ""
-#: config/cris/cris.c:1667 config/cris/cris.c:1677
+#: config/cris/cris.c:1685 config/cris/cris.c:1695
msgid "unrecognized address"
msgstr ""
-#: config/cris/cris.c:2036
+#: config/cris/cris.c:2048
msgid "internal error: sideeffect-insn affecting main effect"
msgstr ""
#. If we get here, the caller got its initial tests wrong.
-#: config/cris/cris.c:2429
+#: config/cris/cris.c:2421
msgid "internal error: cris_side_effect_mode_ok with bad operands"
msgstr ""
-#: config/cris/cris.c:2506 config/cris/cris.c:2567
+#: config/cris/cris.c:2498 config/cris/cris.c:2559
msgid "unrecognized supposed constant"
msgstr ""
-#: config/cris/cris.c:2611
+#: config/cris/cris.c:2603
msgid "unrecognized supposed constant in cris_global_pic_symbol"
msgstr ""
-#: config/cris/cris.c:2630
+#: config/cris/cris.c:2622
#, c-format
msgid "-max-stackframe=%d is not usable, not between 0 and %d"
msgstr ""
-#: config/cris/cris.c:2658
+#: config/cris/cris.c:2650
#, c-format
msgid "unknown CRIS version specification in -march= or -mcpu= : %s"
msgstr ""
-#: config/cris/cris.c:2694
+#: config/cris/cris.c:2686
#, c-format
msgid "unknown CRIS cpu version specification in -mtune= : %s"
msgstr ""
-#: config/cris/cris.c:2712
+#: config/cris/cris.c:2704
msgid "-fPIC and -fpic are not supported in this configuration"
msgstr ""
-#: config/cris/cris.c:2727
+#: config/cris/cris.c:2719
msgid "that particular -g option is invalid with -maout and -melinux"
msgstr ""
-#: config/cris/cris.c:2902 config/cris/cris.c:2947
+#: config/cris/cris.c:2894 config/cris/cris.c:2939
msgid "unexpected side-effects in address"
msgstr ""
-#. Labels are never marked as global symbols.
-#: config/cris/cris.c:3042 config/cris/cris.c:3073
+#: config/cris/cris.c:3008
msgid "unexpected PIC symbol"
msgstr ""
-#: config/cris/cris.c:3046
+#: config/cris/cris.c:3012
msgid "PIC register isn't set up"
msgstr ""
-#: config/cris/cris.c:3059 config/cris/cris.c:3142
-msgid "unexpected address expression"
-msgstr ""
-
-#: config/cris/cris.c:3077
+#: config/cris/cris.c:3033
msgid "emitting PIC operand, but PIC register isn't set up"
msgstr ""
-#: config/cris/cris.c:3086
-msgid "unexpected NOTE as addr_const:"
-msgstr ""
-
-#: config/cris/aout.h:108
+#: config/cris/aout.h:85
msgid "Compile for the MMU-less Etrax 100-based elinux system"
msgstr ""
-#: config/cris/aout.h:115
+#: config/cris/aout.h:92
msgid "For elinux, request a specified stack-size for this program"
msgstr ""
-#: config/cris/cris.h:362
+#: config/cris/cris.h:354
msgid "Work around bug in multiplication instruction"
msgstr ""
#. No "no-etrax" as it does not really imply any model. On the other hand, "etrax" implies the common (and large) subset matching all models.
-#: config/cris/cris.h:368
+#: config/cris/cris.h:360
msgid "Compile for ETRAX 4 (CRIS v3)"
msgstr ""
-#: config/cris/cris.h:373
+#: config/cris/cris.h:365
msgid "Compile for ETRAX 100 (CRIS v8)"
msgstr ""
-#: config/cris/cris.h:377
+#: config/cris/cris.h:369
msgid "Emit verbose debug information in assembly code"
msgstr ""
-#: config/cris/cris.h:380
+#: config/cris/cris.h:372
msgid "Do not use condition codes from normal instructions"
msgstr ""
-#: config/cris/cris.h:384
+#: config/cris/cris.h:376
msgid "Do not emit addressing modes with side-effect assignment"
msgstr ""
-#: config/cris/cris.h:387
+#: config/cris/cris.h:379
msgid "Do not tune stack alignment"
msgstr ""
-#: config/cris/cris.h:390
+#: config/cris/cris.h:382
msgid "Do not tune writable data alignment"
msgstr ""
-#: config/cris/cris.h:393
+#: config/cris/cris.h:385
msgid "Do not tune code and read-only data alignment"
msgstr ""
-#: config/cris/cris.h:402
+#: config/cris/cris.h:394
msgid "Align code and data to 32 bits"
msgstr ""
-#: config/cris/cris.h:415
+#: config/cris/cris.h:407
msgid "Don't align items in code or data"
msgstr ""
-#: config/cris/cris.h:418
+#: config/cris/cris.h:410
msgid "Do not emit function prologue or epilogue"
msgstr ""
#. We have to handle this m-option here since we can't wash it off in both CC1_SPEC and CC1PLUS_SPEC.
-#: config/cris/cris.h:422
+#: config/cris/cris.h:414
msgid "Use the most feature-enabling options allowed by other options"
msgstr ""
#. We must call it "override-" since calling it "no-" will cause gcc.c to forget it, if there's a "later" -mbest-lib-options. Kludgy, but needed for some multilibbed files.
-#: config/cris/cris.h:428
+#: config/cris/cris.h:420
msgid "Override -mbest-lib-options"
msgstr ""
-#: config/cris/cris.h:460
+#: config/cris/cris.h:452
msgid "Generate code for the specified chip or CPU version"
msgstr ""
-#: config/cris/cris.h:462
+#: config/cris/cris.h:454
msgid "Tune alignment for the specified chip or CPU version"
msgstr ""
-#: config/cris/cris.h:464
+#: config/cris/cris.h:456
msgid "Warn when a stackframe is larger than the specified size"
msgstr ""
#. Node: Profiling
-#: config/cris/cris.h:1031
+#: config/cris/cris.h:1016
msgid "no FUNCTION_PROFILER for CRIS"
msgstr ""
@@ -8951,46 +9052,46 @@ msgstr ""
msgid "Together with -fpic and -fPIC, do not use GOTPLT references"
msgstr ""
-#: config/fr30/fr30.c:463
+#: config/fr30/fr30.c:468
msgid "fr30_print_operand_address: unhandled address"
msgstr ""
-#: config/fr30/fr30.c:487
+#: config/fr30/fr30.c:492
#, c-format
msgid "fr30_print_operand: unrecognized %%p code"
msgstr ""
-#: config/fr30/fr30.c:507
+#: config/fr30/fr30.c:512
#, c-format
msgid "fr30_print_operand: unrecognized %%b code"
msgstr ""
-#: config/fr30/fr30.c:528
+#: config/fr30/fr30.c:533
#, c-format
msgid "fr30_print_operand: unrecognized %%B code"
msgstr ""
-#: config/fr30/fr30.c:536
+#: config/fr30/fr30.c:541
#, c-format
msgid "fr30_print_operand: invalid operand to %%A code"
msgstr ""
-#: config/fr30/fr30.c:553
+#: config/fr30/fr30.c:558
#, c-format
msgid "fr30_print_operand: invalid %%x code"
msgstr ""
-#: config/fr30/fr30.c:560
+#: config/fr30/fr30.c:565
#, c-format
msgid "fr30_print_operand: invalid %%F code"
msgstr ""
-#: config/fr30/fr30.c:577
+#: config/fr30/fr30.c:582
msgid "fr30_print_operand: unknown code"
msgstr ""
-#: config/fr30/fr30.c:606 config/fr30/fr30.c:615 config/fr30/fr30.c:626
-#: config/fr30/fr30.c:639
+#: config/fr30/fr30.c:611 config/fr30/fr30.c:620 config/fr30/fr30.c:631
+#: config/fr30/fr30.c:644
msgid "fr30_print_operand: unhandled MEM"
msgstr ""
@@ -8998,140 +9099,136 @@ msgstr ""
msgid "Assume small address space"
msgstr ""
-#: config/frv/frv.c:563 config/frv/frv.c:590
+#: config/frv/frv.c:576 config/frv/frv.c:603
#, c-format
msgid "Unknown cpu: -mcpu=%s"
msgstr ""
-#: config/frv/frv.c:2513
+#: config/frv/frv.c:2539
msgid "Bad insn to frv_print_operand_address:"
msgstr ""
-#: config/frv/frv.c:2524
+#: config/frv/frv.c:2550
msgid "Bad register to frv_print_operand_memory_reference_reg:"
msgstr ""
-#: config/frv/frv.c:2563 config/frv/frv.c:2573 config/frv/frv.c:2582
-#: config/frv/frv.c:2603 config/frv/frv.c:2608
+#: config/frv/frv.c:2589 config/frv/frv.c:2599 config/frv/frv.c:2608
+#: config/frv/frv.c:2629 config/frv/frv.c:2634
msgid "Bad insn to frv_print_operand_memory_reference:"
msgstr ""
-#: config/frv/frv.c:2747
-msgid "Bad insn in frv_print_operand, bad const_double"
-msgstr ""
-
-#: config/frv/frv.c:2792
-msgid "Bad insn to frv_print_operand, 'C' modifier:"
+#: config/frv/frv.c:2721
+msgid "bad condition code"
msgstr ""
-#: config/frv/frv.c:2815
-msgid "Bad insn to frv_print_operand, 'c' modifier:"
+#: config/frv/frv.c:2796
+msgid "Bad insn in frv_print_operand, bad const_double"
msgstr ""
-#: config/frv/frv.c:2840
+#: config/frv/frv.c:2857
msgid "Bad insn to frv_print_operand, 'e' modifier:"
msgstr ""
-#: config/frv/frv.c:2848
+#: config/frv/frv.c:2865
msgid "Bad insn to frv_print_operand, 'F' modifier:"
msgstr ""
-#: config/frv/frv.c:2864
+#: config/frv/frv.c:2881
msgid "Bad insn to frv_print_operand, 'f' modifier:"
msgstr ""
-#: config/frv/frv.c:2878
+#: config/frv/frv.c:2895
msgid "Bad insn to frv_print_operand, 'g' modifier:"
msgstr ""
-#: config/frv/frv.c:2926
+#: config/frv/frv.c:2943
msgid "Bad insn to frv_print_operand, 'L' modifier:"
msgstr ""
-#: config/frv/frv.c:2939
+#: config/frv/frv.c:2956
msgid "Bad insn to frv_print_operand, 'M/N' modifier:"
msgstr ""
-#: config/frv/frv.c:2960
+#: config/frv/frv.c:2977
msgid "Bad insn to frv_print_operand, 'O' modifier:"
msgstr ""
-#: config/frv/frv.c:2978
+#: config/frv/frv.c:2995
msgid "Bad insn to frv_print_operand, P modifier:"
msgstr ""
-#: config/frv/frv.c:2998
+#: config/frv/frv.c:3015
msgid "Bad insn in frv_print_operand, z case"
msgstr ""
-#: config/frv/frv.c:3029
+#: config/frv/frv.c:3046
msgid "Bad insn in frv_print_operand, 0 case"
msgstr ""
-#: config/frv/frv.c:3034
+#: config/frv/frv.c:3051
msgid "frv_print_operand: unknown code"
msgstr ""
-#: config/frv/frv.c:5835
+#: config/frv/frv.c:5944
msgid "Bad output_move_single operand"
msgstr ""
-#: config/frv/frv.c:5962
+#: config/frv/frv.c:6071
msgid "Bad output_move_double operand"
msgstr ""
-#: config/frv/frv.c:6104
+#: config/frv/frv.c:6213
msgid "Bad output_condmove_single operand"
msgstr ""
-#: config/frv/frv.c:9618
+#: config/frv/frv.c:9774
msgid "accumulator is not a constant integer"
msgstr ""
-#: config/frv/frv.c:9623
+#: config/frv/frv.c:9779
msgid "accumulator number is out of bounds"
msgstr ""
-#: config/frv/frv.c:9634
+#: config/frv/frv.c:9790
#, c-format
msgid "inappropriate accumulator for %qs"
msgstr ""
-#: config/frv/frv.c:9700
+#: config/frv/frv.c:9856
msgid "invalid IACC argument"
msgstr ""
-#: config/frv/frv.c:9723
+#: config/frv/frv.c:9879
#, c-format
msgid "%qs expects a constant argument"
msgstr ""
-#: config/frv/frv.c:9728
+#: config/frv/frv.c:9884
#, c-format
msgid "constant argument out of range for %qs"
msgstr ""
-#: config/frv/frv.c:10125
+#: config/frv/frv.c:10319
msgid "media functions are not available unless -mmedia is used"
msgstr ""
-#: config/frv/frv.c:10137
+#: config/frv/frv.c:10331
msgid "this media function is only available on the fr500"
msgstr ""
-#: config/frv/frv.c:10165
+#: config/frv/frv.c:10359
msgid "this media function is only available on the fr400 and fr550"
msgstr ""
-#: config/frv/frv.c:10184
+#: config/frv/frv.c:10378
msgid "this builtin function is only available on the fr405 and fr450"
msgstr ""
-#: config/frv/frv.c:10193
+#: config/frv/frv.c:10387
msgid "this builtin function is only available on the fr500 and fr550"
msgstr ""
-#: config/frv/frv.c:10205
+#: config/frv/frv.c:10399
msgid "this builtin function is only available on the fr450"
msgstr ""
@@ -9144,7 +9241,7 @@ msgstr ""
#. #else
#. #define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)");
#. #endif
-#: config/frv/frv.h:542
+#: config/frv/frv.h:550
#, c-format
msgid " (frv)"
msgstr ""
@@ -9222,177 +9319,185 @@ msgstr ""
msgid "Use H8/300 alignment rules"
msgstr ""
-#: config/i386/i386.c:1246
+#: config/i386/i386.c:1242
#, c-format
msgid "code model %s not supported in PIC mode"
msgstr ""
-#: config/i386/i386.c:1256 config/sparc/sparc.c:604
+#: config/i386/i386.c:1252 config/sparc/sparc.c:611
#, c-format
msgid "bad value (%s) for -mcmodel= switch"
msgstr ""
-#: config/i386/i386.c:1271
+#: config/i386/i386.c:1267
#, c-format
msgid "bad value (%s) for -masm= switch"
msgstr ""
-#: config/i386/i386.c:1274
+#: config/i386/i386.c:1270
#, c-format
msgid "code model %qs not supported in the %s bit mode"
msgstr ""
-#: config/i386/i386.c:1277
+#: config/i386/i386.c:1273
msgid "code model %<large%> not supported yet"
msgstr ""
-#: config/i386/i386.c:1279
+#: config/i386/i386.c:1275
#, c-format
msgid "%i-bit mode not compiled in"
msgstr ""
-#: config/i386/i386.c:1309 config/i386/i386.c:1333
+#: config/i386/i386.c:1305 config/i386/i386.c:1329
msgid "CPU you selected does not support x86-64 instruction set"
msgstr ""
-#: config/i386/i386.c:1315 config/iq2000/iq2000.c:1671
+#: config/i386/i386.c:1311 config/iq2000/iq2000.c:1673
#, c-format
msgid "bad value (%s) for -march= switch"
msgstr ""
-#: config/i386/i386.c:1346
+#: config/i386/i386.c:1342
#, c-format
msgid "bad value (%s) for -mtune= switch"
msgstr ""
-#: config/i386/i386.c:1363
+#: config/i386/i386.c:1359
#, c-format
msgid "-mregparm=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:1376
+#: config/i386/i386.c:1372
msgid "-malign-loops is obsolete, use -falign-loops"
msgstr ""
-#: config/i386/i386.c:1381 config/i386/i386.c:1394 config/i386/i386.c:1407
+#: config/i386/i386.c:1377 config/i386/i386.c:1390 config/i386/i386.c:1403
#, c-format
msgid "-malign-loops=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:1389
+#: config/i386/i386.c:1385
msgid "-malign-jumps is obsolete, use -falign-jumps"
msgstr ""
-#: config/i386/i386.c:1402
+#: config/i386/i386.c:1398
msgid "-malign-functions is obsolete, use -falign-functions"
msgstr ""
-#: config/i386/i386.c:1440
+#: config/i386/i386.c:1436
#, c-format
msgid "-mpreferred-stack-boundary=%d is not between %d and 12"
msgstr ""
-#: config/i386/i386.c:1452
+#: config/i386/i386.c:1448
#, c-format
msgid "-mbranch-cost=%d is not between 0 and 5"
msgstr ""
-#: config/i386/i386.c:1464
+#: config/i386/i386.c:1460
#, c-format
msgid "bad value (%s) for -mtls-dialect= switch"
msgstr ""
-#: config/i386/i386.c:1498
+#: config/i386/i386.c:1507
msgid "-malign-double makes no sense in the 64bit mode"
msgstr ""
-#: config/i386/i386.c:1500
+#: config/i386/i386.c:1509
msgid "-mrtd calling convention not supported in the 64bit mode"
msgstr ""
-#: config/i386/i386.c:1522 config/i386/i386.c:1533
+#: config/i386/i386.c:1538 config/i386/i386.c:1549
msgid "SSE instruction set disabled, using 387 arithmetics"
msgstr ""
-#: config/i386/i386.c:1538
+#: config/i386/i386.c:1554
msgid "387 instruction set disabled, using SSE arithmetics"
msgstr ""
-#: config/i386/i386.c:1545
+#: config/i386/i386.c:1561
#, c-format
msgid "bad value (%s) for -mfpmath= switch"
msgstr ""
-#: config/i386/i386.c:1707 config/i386/i386.c:1718
+#: config/i386/i386.c:1714 config/i386/i386.c:1725
msgid "fastcall and stdcall attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:1711 config/i386/i386.c:1767
+#: config/i386/i386.c:1718 config/i386/i386.c:1774
msgid "fastcall and regparm attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:1754
+#: config/i386/i386.c:1761
#, c-format
msgid "%qs attribute requires an integer constant argument"
msgstr ""
-#: config/i386/i386.c:1760
+#: config/i386/i386.c:1767
#, c-format
msgid "argument to %qs attribute larger than %d"
msgstr ""
-#: config/i386/i386.c:2776
+#: config/i386/i386.c:2565
+msgid "SSE register return with SSE disabled"
+msgstr ""
+
+#: config/i386/i386.c:2567
+msgid "SSE register argument with SSE disabled"
+msgstr ""
+
+#: config/i386/i386.c:2862
msgid "SSE vector argument without SSE enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:2792
+#: config/i386/i386.c:2879
msgid "MMX vector argument without MMX enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:3038
+#: config/i386/i386.c:3127
msgid "SSE vector return without SSE enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:5908
+#: config/i386/i386.c:6003
msgid "invalid UNSPEC as operand"
msgstr ""
-#: config/i386/i386.c:6146
+#: config/i386/i386.c:6241
msgid "extended registers have no high halves"
msgstr ""
-#: config/i386/i386.c:6161
+#: config/i386/i386.c:6256
msgid "unsupported operand size for extended register"
msgstr ""
-#: config/i386/i386.c:6476
+#: config/i386/i386.c:6572
msgid ""
"operand is neither a constant nor a condition code, invalid operand code 'c'"
msgstr ""
-#: config/i386/i386.c:6522
+#: config/i386/i386.c:6625
#, c-format
msgid "invalid operand code '%c'"
msgstr ""
-#: config/i386/i386.c:6565
+#: config/i386/i386.c:6668
msgid "invalid constraints for operand"
msgstr ""
-#: config/i386/i386.c:11301
+#: config/i386/i386.c:11919
msgid "unknown insn mode"
msgstr ""
-#: config/i386/i386.c:13171 config/i386/i386.c:13207
+#: config/i386/i386.c:14174
#, c-format
msgid "selector must be an integer constant in the range 0..%i"
msgstr ""
-#: config/i386/i386.c:13435
+#: config/i386/i386.c:14512
msgid "shift must be an immediate"
msgstr ""
-#: config/i386/i386.c:14489
+#: config/i386/i386.c:15634
#, c-format
msgid "%qs incompatible attribute ignored"
msgstr ""
@@ -9500,167 +9605,167 @@ msgstr ""
#. Deprecated.
#. Deprecated.
#. Deprecated.
-#: config/i386/i386.h:348
+#: config/i386/i386.h:347
msgid "Alternate calling convention"
msgstr ""
-#: config/i386/i386.h:350 config/m68k/m68k.h:336 config/ns32k/ns32k.h:144
+#: config/i386/i386.h:349 config/m68k/m68k.h:336 config/ns32k/ns32k.h:144
msgid "Use normal calling convention"
msgstr ""
-#: config/i386/i386.h:352
+#: config/i386/i386.h:351
msgid "Align some doubles on dword boundary"
msgstr ""
-#: config/i386/i386.h:354
+#: config/i386/i386.h:353
msgid "Align doubles on word boundary"
msgstr ""
-#: config/i386/i386.h:356
+#: config/i386/i386.h:355
msgid "Uninitialized locals in .bss"
msgstr ""
-#: config/i386/i386.h:358
+#: config/i386/i386.h:357
msgid "Uninitialized locals in .data"
msgstr ""
-#: config/i386/i386.h:360 config/m68k/linux.h:42 config/ns32k/ns32k.h:167
+#: config/i386/i386.h:359 config/m68k/linux.h:42 config/ns32k/ns32k.h:167
msgid "Use IEEE math for fp comparisons"
msgstr ""
-#: config/i386/i386.h:362 config/ns32k/ns32k.h:169
+#: config/i386/i386.h:361 config/ns32k/ns32k.h:169
msgid "Do not use IEEE math for fp comparisons"
msgstr ""
-#: config/i386/i386.h:364
+#: config/i386/i386.h:363
msgid "Return values of functions in FPU registers"
msgstr ""
-#: config/i386/i386.h:366
+#: config/i386/i386.h:365
msgid "Do not return values of functions in FPU registers"
msgstr ""
-#: config/i386/i386.h:368
+#: config/i386/i386.h:367
msgid "Do not generate sin, cos, sqrt for FPU"
msgstr ""
-#: config/i386/i386.h:370
+#: config/i386/i386.h:369
msgid "Generate sin, cos, sqrt for FPU"
msgstr ""
-#: config/i386/i386.h:372
+#: config/i386/i386.h:371
msgid "Omit the frame pointer in leaf functions"
msgstr ""
-#: config/i386/i386.h:375
+#: config/i386/i386.h:374
msgid "Enable stack probing"
msgstr ""
#. undocumented
#. undocumented
-#: config/i386/i386.h:380
+#: config/i386/i386.h:379
msgid "Align destination of the string operations"
msgstr ""
-#: config/i386/i386.h:382
+#: config/i386/i386.h:381
msgid "Do not align destination of the string operations"
msgstr ""
-#: config/i386/i386.h:384
+#: config/i386/i386.h:383
msgid "Inline all known string operations"
msgstr ""
-#: config/i386/i386.h:386
+#: config/i386/i386.h:385
msgid "Do not inline all known string operations"
msgstr ""
-#: config/i386/i386.h:388 config/i386/i386.h:392
+#: config/i386/i386.h:387 config/i386/i386.h:391
msgid "Use push instructions to save outgoing arguments"
msgstr ""
-#: config/i386/i386.h:390 config/i386/i386.h:394
+#: config/i386/i386.h:389 config/i386/i386.h:393
msgid "Do not use push instructions to save outgoing arguments"
msgstr ""
-#: config/i386/i386.h:396
+#: config/i386/i386.h:395
msgid "Support MMX built-in functions"
msgstr ""
-#: config/i386/i386.h:398
+#: config/i386/i386.h:397
msgid "Do not support MMX built-in functions"
msgstr ""
-#: config/i386/i386.h:400
+#: config/i386/i386.h:399
msgid "Support 3DNow! built-in functions"
msgstr ""
-#: config/i386/i386.h:402
+#: config/i386/i386.h:401
msgid "Do not support 3DNow! built-in functions"
msgstr ""
-#: config/i386/i386.h:404
+#: config/i386/i386.h:403
msgid "Support MMX and SSE built-in functions and code generation"
msgstr ""
-#: config/i386/i386.h:406
+#: config/i386/i386.h:405
msgid "Do not support MMX and SSE built-in functions and code generation"
msgstr ""
-#: config/i386/i386.h:408
+#: config/i386/i386.h:407
msgid "Support MMX, SSE and SSE2 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.h:410
+#: config/i386/i386.h:409
msgid "Do not support MMX, SSE and SSE2 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.h:412
+#: config/i386/i386.h:411
msgid "Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.h:414
+#: config/i386/i386.h:413
msgid ""
"Do not support MMX, SSE, SSE2 and SSE3 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.h:416
+#: config/i386/i386.h:415
msgid "sizeof(long double) is 16"
msgstr ""
-#: config/i386/i386.h:418
+#: config/i386/i386.h:417
msgid "sizeof(long double) is 12"
msgstr ""
-#: config/i386/i386.h:420
+#: config/i386/i386.h:419
msgid "Generate 64bit x86-64 code"
msgstr ""
-#: config/i386/i386.h:422
+#: config/i386/i386.h:421
msgid "Generate 32bit i386 code"
msgstr ""
-#: config/i386/i386.h:424
+#: config/i386/i386.h:423
msgid "Use native (MS) bitfield layout"
msgstr ""
-#: config/i386/i386.h:426
+#: config/i386/i386.h:425
msgid "Use gcc default bitfield layout"
msgstr ""
-#: config/i386/i386.h:428
+#: config/i386/i386.h:427
msgid "Use red-zone in the x86-64 code"
msgstr ""
-#: config/i386/i386.h:430
+#: config/i386/i386.h:429
msgid "Do not use red-zone in the x86-64 code"
msgstr ""
-#: config/i386/i386.h:432
+#: config/i386/i386.h:431
#, c-format
msgid "Use direct references against %gs when accessing tls data"
msgstr ""
-#: config/i386/i386.h:434
+#: config/i386/i386.h:433
#, c-format
msgid "Do not use direct references against %gs when accessing tls data"
msgstr ""
@@ -9674,54 +9779,54 @@ msgstr ""
#. variable, type `char *', is set to the variable part of the given
#. option if the fixed part matches. The actual option name is made
#. by appending `-m' to the specified name.
-#: config/i386/i386.h:472 config/ia64/ia64.h:286 config/rs6000/rs6000.h:453
-#: config/s390/s390.h:158 config/sparc/sparc.h:711
+#: config/i386/i386.h:471 config/ia64/ia64.h:280 config/rs6000/rs6000.h:453
+#: config/s390/s390.h:158 config/sparc/sparc.h:717
msgid "Schedule code for given CPU"
msgstr ""
-#: config/i386/i386.h:474
+#: config/i386/i386.h:473
msgid "Generate floating point mathematics using given instruction set"
msgstr ""
-#: config/i386/i386.h:476 config/s390/s390.h:160
+#: config/i386/i386.h:475 config/s390/s390.h:160
msgid "Generate code for given CPU"
msgstr ""
-#: config/i386/i386.h:478
+#: config/i386/i386.h:477
msgid "Number of registers used to pass integer arguments"
msgstr ""
-#: config/i386/i386.h:480
+#: config/i386/i386.h:479
msgid "Loop code aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:482
+#: config/i386/i386.h:481
msgid "Jump targets are aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:484
+#: config/i386/i386.h:483
msgid "Function starts are aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:487
+#: config/i386/i386.h:486
msgid "Attempt to keep stack aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:489
+#: config/i386/i386.h:488
msgid "Branches are this expensive (1-5, arbitrary units)"
msgstr ""
-#: config/i386/i386.h:491
+#: config/i386/i386.h:490
msgid "Use given x86-64 code model"
msgstr ""
#. Undocumented.
#. Undocumented.
-#: config/i386/i386.h:497
+#: config/i386/i386.h:496
msgid "Use given assembler dialect"
msgstr ""
-#: config/i386/i386.h:499
+#: config/i386/i386.h:498
msgid "Use given thread-local storage dialect"
msgstr ""
@@ -9762,58 +9867,58 @@ msgstr ""
msgid "malformed #pragma builtin"
msgstr ""
-#: config/ia64/ia64.c:480 config/m32r/m32r.c:356
+#: config/ia64/ia64.c:494 config/m32r/m32r.c:360
#, c-format
msgid "invalid argument of %qs attribute"
msgstr ""
-#: config/ia64/ia64.c:492
+#: config/ia64/ia64.c:506
msgid "%Jan address area attribute cannot be specified for local variables"
msgstr ""
-#: config/ia64/ia64.c:499
+#: config/ia64/ia64.c:513
msgid "%Jaddress area of '%s' conflicts with previous declaration"
msgstr ""
-#: config/ia64/ia64.c:506
+#: config/ia64/ia64.c:520
msgid "%Jaddress area attribute cannot be specified for functions"
msgstr ""
-#: config/ia64/ia64.c:3784
+#: config/ia64/ia64.c:4183
msgid "ia64_print_operand: unknown code"
msgstr ""
-#: config/ia64/ia64.c:4124 config/pa/pa.c:316
+#: config/ia64/ia64.c:4556 config/pa/pa.c:324
msgid "value of -mfixed-range must have form REG1-REG2"
msgstr ""
-#: config/ia64/ia64.c:4151 config/pa/pa.c:343
+#: config/ia64/ia64.c:4583 config/pa/pa.c:351
#, c-format
msgid "%s-%s is an empty range"
msgstr ""
-#: config/ia64/ia64.c:4202
+#: config/ia64/ia64.c:4634
msgid "cannot optimize floating point division for both latency and throughput"
msgstr ""
-#: config/ia64/ia64.c:4219
+#: config/ia64/ia64.c:4651
msgid "cannot optimize integer division for both latency and throughput"
msgstr ""
-#: config/ia64/ia64.c:4236
+#: config/ia64/ia64.c:4668
msgid "cannot optimize square root for both latency and throughput"
msgstr ""
-#: config/ia64/ia64.c:4250
+#: config/ia64/ia64.c:4682
msgid "not yet implemented: latency-optimized inline square root"
msgstr ""
-#: config/ia64/ia64.c:4262
+#: config/ia64/ia64.c:4694
#, c-format
msgid "bad value (%s) for -mtls-size= switch"
msgstr ""
-#: config/ia64/ia64.c:4278
+#: config/ia64/ia64.c:4710
#, c-format
msgid "bad value (%s) for -tune= switch"
msgstr ""
@@ -9821,171 +9926,167 @@ msgstr ""
#. This macro defines names of command options to set and clear bits in
#. `target_flags'. Its definition is an initializer with a subgrouping for
#. each command option.
-#: config/ia64/ia64.h:182
+#: config/ia64/ia64.h:178
msgid "Generate big endian code"
msgstr ""
-#: config/ia64/ia64.h:184 config/mcore/mcore.h:146
+#: config/ia64/ia64.h:180 config/mcore/mcore.h:146
msgid "Generate little endian code"
msgstr ""
-#: config/ia64/ia64.h:186
+#: config/ia64/ia64.h:182
msgid "Generate code for GNU as"
msgstr ""
-#: config/ia64/ia64.h:188
+#: config/ia64/ia64.h:184
msgid "Generate code for Intel as"
msgstr ""
-#: config/ia64/ia64.h:190
+#: config/ia64/ia64.h:186
msgid "Generate code for GNU ld"
msgstr ""
-#: config/ia64/ia64.h:192
+#: config/ia64/ia64.h:188
msgid "Generate code for Intel ld"
msgstr ""
-#: config/ia64/ia64.h:194
+#: config/ia64/ia64.h:190
msgid "Generate code without GP reg"
msgstr ""
-#: config/ia64/ia64.h:196
+#: config/ia64/ia64.h:192
msgid "Emit stop bits before and after volatile extended asms"
msgstr ""
-#: config/ia64/ia64.h:198
+#: config/ia64/ia64.h:194
msgid "Don't emit stop bits before and after volatile extended asms"
msgstr ""
-#: config/ia64/ia64.h:200
-msgid "Emit code for Itanium (TM) processor B step"
-msgstr ""
-
-#: config/ia64/ia64.h:202
+#: config/ia64/ia64.h:196
msgid "Use in/loc/out register names"
msgstr ""
-#: config/ia64/ia64.h:204
+#: config/ia64/ia64.h:198
msgid "Disable use of sdata/scommon/sbss"
msgstr ""
-#: config/ia64/ia64.h:206
+#: config/ia64/ia64.h:200
msgid "Enable use of sdata/scommon/sbss"
msgstr ""
-#: config/ia64/ia64.h:208
+#: config/ia64/ia64.h:202
msgid "gp is constant (but save/restore gp on indirect calls)"
msgstr ""
-#: config/ia64/ia64.h:210
+#: config/ia64/ia64.h:204
msgid "Generate self-relocatable code"
msgstr ""
-#: config/ia64/ia64.h:212
+#: config/ia64/ia64.h:206
msgid "Generate inline floating point division, optimize for latency"
msgstr ""
-#: config/ia64/ia64.h:214
+#: config/ia64/ia64.h:208
msgid "Generate inline floating point division, optimize for throughput"
msgstr ""
-#: config/ia64/ia64.h:217
+#: config/ia64/ia64.h:211
msgid "Do not inline floating point division"
msgstr ""
-#: config/ia64/ia64.h:219
+#: config/ia64/ia64.h:213
msgid "Generate inline integer division, optimize for latency"
msgstr ""
-#: config/ia64/ia64.h:221
+#: config/ia64/ia64.h:215
msgid "Generate inline integer division, optimize for throughput"
msgstr ""
-#: config/ia64/ia64.h:223
+#: config/ia64/ia64.h:217
msgid "Do not inline integer division"
msgstr ""
-#: config/ia64/ia64.h:225
+#: config/ia64/ia64.h:219
msgid "Generate inline square root, optimize for latency"
msgstr ""
-#: config/ia64/ia64.h:227
+#: config/ia64/ia64.h:221
msgid "Generate inline square root, optimize for throughput"
msgstr ""
-#: config/ia64/ia64.h:229
+#: config/ia64/ia64.h:223
msgid "Do not inline square root"
msgstr ""
-#: config/ia64/ia64.h:231
+#: config/ia64/ia64.h:225
msgid "Enable Dwarf 2 line debug info via GNU as"
msgstr ""
-#: config/ia64/ia64.h:233
+#: config/ia64/ia64.h:227
msgid "Disable Dwarf 2 line debug info via GNU as"
msgstr ""
-#: config/ia64/ia64.h:235
+#: config/ia64/ia64.h:229
msgid "Enable earlier placing stop bits for better scheduling"
msgstr ""
-#: config/ia64/ia64.h:237
+#: config/ia64/ia64.h:231
msgid "Disable earlier placing stop bits"
msgstr ""
-#: config/ia64/ia64.h:282
+#: config/ia64/ia64.h:276
msgid "Specify range of registers to make fixed"
msgstr ""
-#: config/ip2k/ip2k.c:1086
+#: config/ip2k/ip2k.c:1087
msgid "bad operand"
msgstr ""
-#: config/iq2000/iq2000.c:1647
+#: config/iq2000/iq2000.c:1649
#, c-format
msgid "bad value (%s) for -mcpu= switch"
msgstr ""
-#: config/iq2000/iq2000.c:1676
+#: config/iq2000/iq2000.c:1678
#, c-format
msgid "The compiler does not support -march=%s."
msgstr ""
-#: config/iq2000/iq2000.c:2063
+#: config/iq2000/iq2000.c:2065
#, c-format
msgid "gp_offset (%ld) or end_offset (%ld) is less than zero."
msgstr ""
-#: config/iq2000/iq2000.c:2845
+#: config/iq2000/iq2000.c:2847
#, c-format
msgid "argument %qd is not a constant"
msgstr ""
-#: config/iq2000/iq2000.c:3148 config/xtensa/xtensa.c:2033
+#: config/iq2000/iq2000.c:3150 config/xtensa/xtensa.c:2033
msgid "PRINT_OPERAND_ADDRESS, null pointer"
msgstr ""
-#: config/iq2000/iq2000.c:3303
+#: config/iq2000/iq2000.c:3305
#, c-format
msgid "PRINT_OPERAND: Unknown punctuation '%c'"
msgstr ""
-#: config/iq2000/iq2000.c:3312 config/mips/mips.c:4821
+#: config/iq2000/iq2000.c:3314 config/mips/mips.c:4832
#: config/xtensa/xtensa.c:1887
msgid "PRINT_OPERAND null pointer"
msgstr ""
-#: config/iq2000/iq2000.c:3381
+#: config/iq2000/iq2000.c:3383
#, c-format
msgid "invalid %%P operand"
msgstr ""
-#: config/iq2000/iq2000.c:3389 config/rs6000/rs6000.c:10648
+#: config/iq2000/iq2000.c:3391 config/rs6000/rs6000.c:10736
#, c-format
msgid "invalid %%p value"
msgstr ""
-#: config/iq2000/iq2000.c:3453 config/mips/mips.c:4947
+#: config/iq2000/iq2000.c:3455 config/mips/mips.c:4958
#, c-format
msgid "invalid use of %%d, %%x, or %%X"
msgstr ""
@@ -10002,87 +10103,87 @@ msgstr ""
msgid "Don't use GP relative sdata/sbss sections"
msgstr ""
-#: config/iq2000/iq2000.h:78 config/mips/mips.h:585
+#: config/iq2000/iq2000.h:78 config/mips/mips.h:589
msgid "Use ROM instead of RAM"
msgstr ""
-#: config/iq2000/iq2000.h:80 config/mips/mips.h:587
+#: config/iq2000/iq2000.h:80 config/mips/mips.h:591
msgid "Don't use ROM instead of RAM"
msgstr ""
-#: config/iq2000/iq2000.h:82 config/mips/mips.h:589
+#: config/iq2000/iq2000.h:82 config/mips/mips.h:593
msgid "Put uninitialized constants in ROM (needs -membedded-data)"
msgstr ""
-#: config/iq2000/iq2000.h:84 config/mips/mips.h:591
+#: config/iq2000/iq2000.h:84 config/mips/mips.h:595
msgid "Don't put uninitialized constants in ROM"
msgstr ""
-#: config/iq2000/iq2000.h:106 config/mips/mips.h:776
+#: config/iq2000/iq2000.h:106 config/mips/mips.h:780
msgid "Specify CPU for scheduling purposes"
msgstr ""
-#: config/iq2000/iq2000.h:108 config/mips/mips.h:778
+#: config/iq2000/iq2000.h:108 config/mips/mips.h:782
msgid "Specify CPU for code generation purposes"
msgstr ""
-#: config/m32r/m32r.c:174
+#: config/m32r/m32r.c:178
#, c-format
msgid "bad value (%s) for -mmodel switch"
msgstr ""
-#: config/m32r/m32r.c:183
+#: config/m32r/m32r.c:187
#, c-format
msgid "bad value (%s) for -msdata switch"
msgstr ""
-#: config/m32r/m32r.c:190
+#: config/m32r/m32r.c:194
#, c-format
msgid "bad value (%s) for -flush-trap=n (0=<n<=15)"
msgstr ""
-#: config/m32r/m32r.c:2100
+#: config/m32r/m32r.c:2111
#, c-format
msgid "invalid operand to %%s code"
msgstr ""
-#: config/m32r/m32r.c:2107
+#: config/m32r/m32r.c:2118
#, c-format
msgid "invalid operand to %%p code"
msgstr ""
-#: config/m32r/m32r.c:2162
+#: config/m32r/m32r.c:2173
msgid "bad insn for 'A'"
msgstr ""
-#: config/m32r/m32r.c:2209
+#: config/m32r/m32r.c:2220
#, c-format
msgid "invalid operand to %%T/%%B code"
msgstr ""
-#: config/m32r/m32r.c:2232
+#: config/m32r/m32r.c:2243
#, c-format
msgid "invalid operand to %%N code"
msgstr ""
-#: config/m32r/m32r.c:2265
+#: config/m32r/m32r.c:2276
msgid "pre-increment address is not a register"
msgstr ""
-#: config/m32r/m32r.c:2272
+#: config/m32r/m32r.c:2283
msgid "pre-decrement address is not a register"
msgstr ""
-#: config/m32r/m32r.c:2279
+#: config/m32r/m32r.c:2290
msgid "post-increment address is not a register"
msgstr ""
-#: config/m32r/m32r.c:2355 config/m32r/m32r.c:2371
-#: config/rs6000/rs6000.c:17326
+#: config/m32r/m32r.c:2366 config/m32r/m32r.c:2382
+#: config/rs6000/rs6000.c:17465
msgid "bad address"
msgstr ""
-#: config/m32r/m32r.c:2376
+#: config/m32r/m32r.c:2387
msgid "lo_sum not of register"
msgstr ""
@@ -10111,11 +10212,11 @@ msgstr ""
msgid "Small data area: none, sdata, use"
msgstr ""
-#: config/m32r/m32r.h:316 config/mips/mips.h:784
+#: config/m32r/m32r.h:316 config/mips/mips.h:788
msgid "Don't call any cache flush functions"
msgstr ""
-#: config/m32r/m32r.h:318 config/mips/mips.h:786
+#: config/m32r/m32r.h:318 config/mips/mips.h:790
msgid "Specify cache flush function"
msgstr ""
@@ -10132,49 +10233,49 @@ msgstr ""
msgid "-f%s ignored for 68HC11/68HC12 (not supported)"
msgstr ""
-#: config/m68hc11/m68hc11.c:1435
+#: config/m68hc11/m68hc11.c:1433
msgid "%<trap%> and %<far%> attributes are not compatible, ignoring %<far%>"
msgstr ""
-#: config/m68hc11/m68hc11.c:1441
+#: config/m68hc11/m68hc11.c:1439
msgid "%<trap%> attribute is already used"
msgstr ""
#. !!!! SCz wrong here.
-#: config/m68hc11/m68hc11.c:3400 config/m68hc11/m68hc11.c:3784
+#: config/m68hc11/m68hc11.c:3398 config/m68hc11/m68hc11.c:3782
msgid "move insn not handled"
msgstr ""
-#: config/m68hc11/m68hc11.c:3632 config/m68hc11/m68hc11.c:3716
-#: config/m68hc11/m68hc11.c:3987
+#: config/m68hc11/m68hc11.c:3630 config/m68hc11/m68hc11.c:3714
+#: config/m68hc11/m68hc11.c:3985
msgid "invalid register in the move instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3666
+#: config/m68hc11/m68hc11.c:3664
msgid "invalid operand in the instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3961
+#: config/m68hc11/m68hc11.c:3959
msgid "invalid register in the instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3994
+#: config/m68hc11/m68hc11.c:3992
msgid "operand 1 must be a hard register"
msgstr ""
-#: config/m68hc11/m68hc11.c:4008
+#: config/m68hc11/m68hc11.c:4006
msgid "invalid rotate insn"
msgstr ""
-#: config/m68hc11/m68hc11.c:4432
+#: config/m68hc11/m68hc11.c:4430
msgid "registers IX, IY and Z used in the same INSN"
msgstr ""
-#: config/m68hc11/m68hc11.c:4769 config/m68hc11/m68hc11.c:5069
+#: config/m68hc11/m68hc11.c:4767 config/m68hc11/m68hc11.c:5067
msgid "cannot do z-register replacement"
msgstr ""
-#: config/m68hc11/m68hc11.c:5132
+#: config/m68hc11/m68hc11.c:5130
msgid "invalid Z register replacement for insn"
msgstr ""
@@ -10268,7 +10369,7 @@ msgstr ""
msgid "-fPIC is not currently supported on the 68000 or 68010\n"
msgstr ""
-#: config/m68k/m68k.c:543 config/rs6000/rs6000.c:13479
+#: config/m68k/m68k.c:547 config/rs6000/rs6000.c:13592
msgid "stack limit expression is not supported"
msgstr ""
@@ -10405,7 +10506,7 @@ msgstr ""
msgid "ID of shared library to build"
msgstr ""
-#: config/mcore/mcore.c:2987
+#: config/mcore/mcore.c:2992
msgid "invalid option %<-mstack-increment=%s%>"
msgstr ""
@@ -10461,140 +10562,141 @@ msgstr ""
msgid "Maximum amount for a single stack increment operation"
msgstr ""
-#: config/mips/mips.c:4018
+#: config/mips/mips.c:4025
#, c-format
msgid "bad value (%s) for -mabi= switch"
msgstr ""
-#: config/mips/mips.c:4041
+#: config/mips/mips.c:4048
#, c-format
msgid ""
"-mips%s conflicts with the other architecture options, which specify a MIPS%"
"d processor"
msgstr ""
-#: config/mips/mips.c:4060
+#: config/mips/mips.c:4067
#, c-format
msgid "-march=%s is not compatible with the selected ABI"
msgstr ""
-#: config/mips/mips.c:4075
+#: config/mips/mips.c:4082
msgid "-mgp64 used with a 32-bit processor"
msgstr ""
-#: config/mips/mips.c:4077
+#: config/mips/mips.c:4084
msgid "-mgp32 used with a 64-bit ABI"
msgstr ""
-#: config/mips/mips.c:4079
+#: config/mips/mips.c:4086
msgid "-mgp64 used with a 32-bit ABI"
msgstr ""
-#: config/mips/mips.c:4097 config/mips/mips.c:4099 config/mips/mips.c:4101
-#: config/mips/mips.c:4181
+#: config/mips/mips.c:4104 config/mips/mips.c:4106 config/mips/mips.c:4108
+#: config/mips/mips.c:4192
#, c-format
msgid "unsupported combination: %s"
msgstr ""
-#: config/mips/mips.c:4176
+#: config/mips/mips.c:4136
+msgid "-mint64 is a deprecated option"
+msgstr ""
+
+#: config/mips/mips.c:4187
msgid ""
"generation of Branch Likely instructions enabled, but not supported by "
"architecture"
msgstr ""
-#: config/mips/mips.c:4193
+#: config/mips/mips.c:4204
msgid "-G is incompatible with PIC code which is the default"
msgstr ""
-#: config/mips/mips.c:4260
+#: config/mips/mips.c:4271
msgid "-mips3d requires -mpaired-single"
msgstr ""
-#: config/mips/mips.c:4269
+#: config/mips/mips.c:4280
msgid "-mips3d/-mpaired-single must be used with -mfp64 -mhard-float"
msgstr ""
-#: config/mips/mips.c:4274
+#: config/mips/mips.c:4285
msgid "-mips3d/-mpaired-single must be used with -mips64"
msgstr ""
-#: config/mips/mips.c:4632
+#: config/mips/mips.c:4643
msgid "mips_debugger_offset called with non stack/frame/arg pointer"
msgstr ""
-#: config/mips/mips.c:4758
+#: config/mips/mips.c:4769
#, c-format
msgid "internal error: %%) found without a %%( in assembler pattern"
msgstr ""
-#: config/mips/mips.c:4772
+#: config/mips/mips.c:4783
#, c-format
msgid "internal error: %%] found without a %%[ in assembler pattern"
msgstr ""
-#: config/mips/mips.c:4785
+#: config/mips/mips.c:4796
#, c-format
msgid "internal error: %%> found without a %%< in assembler pattern"
msgstr ""
-#: config/mips/mips.c:4798
+#: config/mips/mips.c:4809
#, c-format
msgid "internal error: %%} found without a %%{ in assembler pattern"
msgstr ""
-#: config/mips/mips.c:4812
+#: config/mips/mips.c:4823
#, c-format
msgid "PRINT_OPERAND: unknown punctuation '%c'"
msgstr ""
-#: config/mips/mips.c:4841
+#: config/mips/mips.c:4852
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%C"
msgstr ""
-#: config/mips/mips.c:4858
+#: config/mips/mips.c:4869
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%N"
msgstr ""
-#: config/mips/mips.c:4867
+#: config/mips/mips.c:4878
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%F"
msgstr ""
-#: config/mips/mips.c:4876
+#: config/mips/mips.c:4887
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%W"
msgstr ""
-#: config/mips/mips.c:4897
+#: config/mips/mips.c:4908
#, c-format
msgid "invalid %%Y value"
msgstr ""
-#: config/mips/mips.c:4975
+#: config/mips/mips.c:4986
msgid "PRINT_OPERAND, invalid operand for relocation"
msgstr ""
-#: config/mips/mips.c:7561
+#: config/mips/mips.c:7573
#, c-format
msgid "cannot handle inconsistent calls to %qs"
msgstr ""
-#: config/mips/mips.c:8951
+#: config/mips/mips.c:8963
msgid "the cpu name must be lower case"
msgstr ""
-#: config/mips/mips.c:8973
+#: config/mips/mips.c:8985
#, c-format
msgid "bad value (%s) for %s"
msgstr ""
-#: config/mips/linux64.h:39
-msgid "Same as -mabi=32, just trickier"
-msgstr ""
-
#. Target CPU builtins.
+#. Everyone but IRIX defines this to mips.
#. We do this here because __mips is defined below and so we can't use builtin_define_std.
#. Treat _R3000 and _R4000 like register-size defines, which is how they've historically been used.
#. Macros dependent on the C dialect.
@@ -10604,63 +10706,63 @@ msgstr ""
#. each pair being { "NAME", VALUE }
#. where VALUE is the bits to set or minus the bits to clear.
#. An empty string NAME is used to identify the default VALUE.
-#: config/mips/mips.h:533
+#: config/mips/mips.h:537
msgid "Use 64-bit int type"
msgstr ""
-#: config/mips/mips.h:535
+#: config/mips/mips.h:539
msgid "Use 64-bit long type"
msgstr ""
-#: config/mips/mips.h:537
+#: config/mips/mips.h:541
msgid "Use 32-bit long type"
msgstr ""
-#: config/mips/mips.h:539
+#: config/mips/mips.h:543
msgid "Optimize lui/addiu address loads"
msgstr ""
-#: config/mips/mips.h:541
+#: config/mips/mips.h:545
msgid "Don't optimize lui/addiu address loads"
msgstr ""
-#: config/mips/mips.h:543
+#: config/mips/mips.h:547
msgid "Use GNU as (now ignored)"
msgstr ""
-#: config/mips/mips.h:545 config/mips/mips.h:547
+#: config/mips/mips.h:549 config/mips/mips.h:551
msgid "Use GP relative sdata/sbss sections (now ignored)"
msgstr ""
-#: config/mips/mips.h:549 config/mips/mips.h:551
+#: config/mips/mips.h:553 config/mips/mips.h:555
msgid "Don't use GP relative sdata/sbss sections (now ignored)"
msgstr ""
-#: config/mips/mips.h:553
+#: config/mips/mips.h:557
msgid "Output compiler statistics (now ignored)"
msgstr ""
-#: config/mips/mips.h:555
+#: config/mips/mips.h:559
msgid "Don't output compiler statistics"
msgstr ""
-#: config/mips/mips.h:557
+#: config/mips/mips.h:561
msgid "Don't optimize block moves"
msgstr ""
-#: config/mips/mips.h:559
+#: config/mips/mips.h:563
msgid "Optimize block moves"
msgstr ""
-#: config/mips/mips.h:561
+#: config/mips/mips.h:565
msgid "Use mips-tfile asm postpass"
msgstr ""
-#: config/mips/mips.h:563
+#: config/mips/mips.h:567
msgid "Don't use mips-tfile asm postpass"
msgstr ""
-#: config/mips/mips.h:565 config/pa/pa.h:288
+#: config/mips/mips.h:569 config/pa/pa.h:288
msgid "Use software floating point"
msgstr ""
@@ -10670,193 +10772,193 @@ msgstr ""
#. where VALUE is the bits to set or minus the bits to clear and DOC
#. is the documentation for --help (NULL if intentionally undocumented).
#. An empty string NAME is used to identify the default VALUE.
-#: config/mips/mips.h:567 config/pdp11/pdp11.h:61 config/rs6000/rs6000.h:329
+#: config/mips/mips.h:571 config/pdp11/pdp11.h:61 config/rs6000/rs6000.h:329
msgid "Use hardware floating point"
msgstr ""
-#: config/mips/mips.h:569
+#: config/mips/mips.h:573
msgid "Use 64-bit FP registers"
msgstr ""
-#: config/mips/mips.h:571
+#: config/mips/mips.h:575
msgid "Use 32-bit FP registers"
msgstr ""
-#: config/mips/mips.h:573
+#: config/mips/mips.h:577
msgid "Use 64-bit general registers"
msgstr ""
-#: config/mips/mips.h:575
+#: config/mips/mips.h:579
msgid "Use 32-bit general registers"
msgstr ""
-#: config/mips/mips.h:577
+#: config/mips/mips.h:581
msgid "Use Irix PIC"
msgstr ""
-#: config/mips/mips.h:579
+#: config/mips/mips.h:583
msgid "Don't use Irix PIC"
msgstr ""
-#: config/mips/mips.h:581
+#: config/mips/mips.h:585
msgid "Use indirect calls"
msgstr ""
-#: config/mips/mips.h:583
+#: config/mips/mips.h:587
msgid "Don't use indirect calls"
msgstr ""
-#: config/mips/mips.h:593
+#: config/mips/mips.h:597
msgid "Use big-endian byte order"
msgstr ""
-#: config/mips/mips.h:595
+#: config/mips/mips.h:599
msgid "Use little-endian byte order"
msgstr ""
-#: config/mips/mips.h:597
+#: config/mips/mips.h:601
msgid "Use single (32-bit) FP only"
msgstr ""
-#: config/mips/mips.h:599
+#: config/mips/mips.h:603
msgid "Don't use single (32-bit) FP only"
msgstr ""
-#: config/mips/mips.h:601 config/mips/mips.h:603
+#: config/mips/mips.h:605 config/mips/mips.h:607
msgid "Use paired-single floating point instructions"
msgstr ""
-#: config/mips/mips.h:605 config/mips/mips.h:607
+#: config/mips/mips.h:609 config/mips/mips.h:611
msgid "Use MIPS-3D instructions"
msgstr ""
-#: config/mips/mips.h:609
+#: config/mips/mips.h:613
msgid "Use multiply accumulate"
msgstr ""
-#: config/mips/mips.h:611
+#: config/mips/mips.h:615
msgid "Don't use multiply accumulate"
msgstr ""
-#: config/mips/mips.h:613
+#: config/mips/mips.h:617
msgid "Don't generate fused multiply/add instructions"
msgstr ""
-#: config/mips/mips.h:615 config/rs6000/rs6000.h:345
+#: config/mips/mips.h:619 config/rs6000/rs6000.h:345
msgid "Generate fused multiply/add instructions"
msgstr ""
-#: config/mips/mips.h:617
+#: config/mips/mips.h:621
msgid "Perform VR4130-specific alignment optimizations"
msgstr ""
-#: config/mips/mips.h:619
+#: config/mips/mips.h:623
msgid "Don't perform VR4130-specific alignment optimizations"
msgstr ""
-#: config/mips/mips.h:621
+#: config/mips/mips.h:625
msgid "Work around early 4300 hardware bug"
msgstr ""
-#: config/mips/mips.h:623
+#: config/mips/mips.h:627
msgid "Don't work around early 4300 hardware bug"
msgstr ""
-#: config/mips/mips.h:625
+#: config/mips/mips.h:629
msgid "Work around errata for early SB-1 revision 2 cores"
msgstr ""
-#: config/mips/mips.h:627
+#: config/mips/mips.h:631
msgid "Don't work around errata for early SB-1 revision 2 cores"
msgstr ""
-#: config/mips/mips.h:629
+#: config/mips/mips.h:633
msgid "Work around R4000 errata"
msgstr ""
-#: config/mips/mips.h:631
+#: config/mips/mips.h:635
msgid "Don't work around R4000 errata"
msgstr ""
-#: config/mips/mips.h:633
+#: config/mips/mips.h:637
msgid "Work around R4400 errata"
msgstr ""
-#: config/mips/mips.h:635
+#: config/mips/mips.h:639
msgid "Don't work around R4400 errata"
msgstr ""
-#: config/mips/mips.h:637
+#: config/mips/mips.h:641
msgid "Work around certain VR4120 errata"
msgstr ""
-#: config/mips/mips.h:639
+#: config/mips/mips.h:643
msgid "Don't work around certain VR4120 errata"
msgstr ""
-#: config/mips/mips.h:641
+#: config/mips/mips.h:645
msgid "Trap on integer divide by zero"
msgstr ""
-#: config/mips/mips.h:643
+#: config/mips/mips.h:647
msgid "Don't trap on integer divide by zero"
msgstr ""
-#: config/mips/mips.h:645
+#: config/mips/mips.h:649
msgid "Use trap to check for integer divide by zero"
msgstr ""
-#: config/mips/mips.h:647
+#: config/mips/mips.h:651
msgid "Use break to check for integer divide by zero"
msgstr ""
-#: config/mips/mips.h:649
+#: config/mips/mips.h:653
msgid "Use Branch Likely instructions, overriding default for arch"
msgstr ""
-#: config/mips/mips.h:651
+#: config/mips/mips.h:655
msgid "Don't use Branch Likely instructions, overriding default for arch"
msgstr ""
-#: config/mips/mips.h:653
+#: config/mips/mips.h:657
msgid "Use NewABI-style %reloc() assembly operators"
msgstr ""
-#: config/mips/mips.h:655
+#: config/mips/mips.h:659
msgid "Use assembler macros instead of relocation operators"
msgstr ""
-#: config/mips/mips.h:657
+#: config/mips/mips.h:661
msgid "Generate mips16 code"
msgstr ""
-#: config/mips/mips.h:659
+#: config/mips/mips.h:663
msgid "Generate normal-mode code"
msgstr ""
-#: config/mips/mips.h:661
+#: config/mips/mips.h:665
msgid "Lift restrictions on GOT size"
msgstr ""
-#: config/mips/mips.h:663
+#: config/mips/mips.h:667
msgid "Do not lift restrictions on GOT size"
msgstr ""
-#: config/mips/mips.h:665
+#: config/mips/mips.h:669
msgid "FP exceptions are enabled"
msgstr ""
-#: config/mips/mips.h:667
+#: config/mips/mips.h:671
msgid "FP exceptions are not enabled"
msgstr ""
-#: config/mips/mips.h:782
+#: config/mips/mips.h:786
msgid "Specify a Standard MIPS ISA"
msgstr ""
#. Output assembler code to FILE to increment profiler label # LABELNO
#. for profiling a function entry.
-#: config/mips/mips.h:2321
+#: config/mips/mips.h:2318
msgid "mips16 function profiling"
msgstr ""
@@ -10885,70 +10987,70 @@ msgstr ""
msgid "MMIX Internal: Last named vararg would not fit in a register"
msgstr ""
-#: config/mmix/mmix.c:1462 config/mmix/mmix.c:1592
+#: config/mmix/mmix.c:1471 config/mmix/mmix.c:1601
msgid "MMIX Internal: Expected a CONST_INT, not this"
msgstr ""
-#: config/mmix/mmix.c:1470 config/mmix/mmix.c:1494 config/mmix/mmix.c:1610
+#: config/mmix/mmix.c:1479 config/mmix/mmix.c:1503 config/mmix/mmix.c:1619
#, c-format
msgid "MMIX Internal: Bad register: %d"
msgstr ""
-#: config/mmix/mmix.c:1541
+#: config/mmix/mmix.c:1550
msgid "MMIX Internal: Bad value for 'm', not a CONST_INT"
msgstr ""
-#: config/mmix/mmix.c:1560
+#: config/mmix/mmix.c:1569
msgid "MMIX Internal: Expected a register, not this"
msgstr ""
-#: config/mmix/mmix.c:1570
+#: config/mmix/mmix.c:1579
msgid "MMIX Internal: Expected a constant, not this"
msgstr ""
#. Presumably there's a missing case above if we get here.
-#: config/mmix/mmix.c:1602
+#: config/mmix/mmix.c:1611
#, c-format
msgid "MMIX Internal: Missing %qc case in mmix_print_operand"
msgstr ""
#. We need the original here.
-#: config/mmix/mmix.c:1654
+#: config/mmix/mmix.c:1663
msgid "MMIX Internal: Cannot decode this operand"
msgstr ""
-#: config/mmix/mmix.c:1711
+#: config/mmix/mmix.c:1720
msgid "MMIX Internal: This is not a recognized address"
msgstr ""
-#: config/mmix/mmix.c:1888
+#: config/mmix/mmix.c:1897
#, c-format
msgid "stack frame not a multiple of 8 bytes: %d"
msgstr ""
-#: config/mmix/mmix.c:2127
+#: config/mmix/mmix.c:2133
#, c-format
msgid "stack frame not a multiple of octabyte: %d"
msgstr ""
-#: config/mmix/mmix.c:2601 config/mmix/mmix.c:2665
+#: config/mmix/mmix.c:2606 config/mmix/mmix.c:2670
#, c-format
msgid "MMIX Internal: %s is not a shiftable int"
msgstr ""
-#: config/mmix/mmix.c:2781
+#: config/mmix/mmix.c:2786
msgid "MMIX Internal: Trying to output invalidly reversed condition:"
msgstr ""
-#: config/mmix/mmix.c:2788
+#: config/mmix/mmix.c:2793
msgid "MMIX Internal: What's the CC of this?"
msgstr ""
-#: config/mmix/mmix.c:2792
+#: config/mmix/mmix.c:2797
msgid "MMIX Internal: What is the CC of this?"
msgstr ""
-#: config/mmix/mmix.c:2862
+#: config/mmix/mmix.c:2867
msgid "MMIX Internal: This is not a constant:"
msgstr ""
@@ -11023,15 +11125,15 @@ msgstr ""
msgid "Do not generate a single exit point for each function"
msgstr ""
-#: config/mn10300/linux.h:60 config/mn10300/mn10300.h:71
+#: config/mn10300/linux.h:45 config/mn10300/mn10300.h:71
msgid "Target the AM33 processor"
msgstr ""
-#: config/mn10300/linux.h:61 config/mn10300/mn10300.h:75
+#: config/mn10300/linux.h:46 config/mn10300/mn10300.h:75
msgid "Target the AM33/2.0 processor"
msgstr ""
-#: config/mn10300/linux.h:62 config/mn10300/mn10300.h:78
+#: config/mn10300/linux.h:47 config/mn10300/mn10300.h:78
msgid "Enable linker relaxations"
msgstr ""
@@ -11115,62 +11217,69 @@ msgstr ""
msgid "No \"Small register classes\" kludge"
msgstr ""
-#: config/pa/pa.c:404
+#: config/pa/pa.c:412
#, c-format
msgid ""
"unknown -mschedule= option (%s).\n"
"Valid options are 700, 7100, 7100LC, 7200, 7300, and 8000\n"
msgstr ""
-#: config/pa/pa.c:429
+#: config/pa/pa.c:437
#, c-format
msgid ""
"unknown -march= option (%s).\n"
"Valid options are 1.0, 1.1, and 2.0\n"
msgstr ""
-#: config/pa/pa.c:449
+#: config/pa/pa.c:457
#, c-format
msgid ""
"unknown -munix= option (%s).\n"
"Valid options are 93, 95 and 98.\n"
msgstr ""
-#: config/pa/pa.c:454
+#: config/pa/pa.c:462
#, c-format
msgid ""
"unknown -munix= option (%s).\n"
"Valid options are 93 and 95.\n"
msgstr ""
-#: config/pa/pa.c:458
+#: config/pa/pa.c:466
#, c-format
msgid ""
"unknown -munix= option (%s).\n"
"Valid option is 93.\n"
msgstr ""
-#: config/pa/pa.c:475
+#: config/pa/pa.c:483
msgid "PIC code generation is not supported in the portable runtime model\n"
msgstr ""
-#: config/pa/pa.c:480
+#: config/pa/pa.c:488
msgid "PIC code generation is not compatible with fast indirect calls\n"
msgstr ""
-#: config/pa/pa.c:485
+#: config/pa/pa.c:493
msgid "-g is only supported when using GAS on this processor,"
msgstr ""
-#: config/pa/pa.c:486
+#: config/pa/pa.c:494
msgid "-g option disabled"
msgstr ""
-#: config/pa/pa-hpux.h:96 config/pa/pa64-hpux.h:25
+#: config/pa/pa.c:8338
+#, c-format
+msgid ""
+"alignment (%u) for %s exceeds maximum alignment for global common data. "
+"Using %u"
+msgstr ""
+
+#: config/pa/pa-hpux.h:96 config/pa/pa64-hpux.h:26
msgid "Generate cpp defines for server IO"
msgstr ""
-#: config/pa/pa-hpux.h:97 config/pa/pa64-hpux.h:27
+#: config/pa/pa-hpux.h:97 config/pa/pa64-hpux.h:28
msgid "Generate cpp defines for workstation IO"
msgstr ""
@@ -11316,11 +11425,11 @@ msgstr ""
msgid "Specify CPU for scheduling purposes."
msgstr ""
-#: config/pa/pa64-hpux.h:29
+#: config/pa/pa64-hpux.h:30
msgid "Assume code will be linked by GNU ld"
msgstr ""
-#: config/pa/pa64-hpux.h:31
+#: config/pa/pa64-hpux.h:32
msgid "Assume code will be linked by HP ld"
msgstr ""
@@ -11457,217 +11566,247 @@ msgstr ""
msgid "junk at end of #pragma longcall"
msgstr ""
-#: config/rs6000/rs6000.c:1244
+#: config/rs6000/rs6000.c:1254
msgid "-mmultiple is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:1251
+#: config/rs6000/rs6000.c:1261
msgid "-mstring is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:1265
+#: config/rs6000/rs6000.c:1275
#, c-format
msgid "unknown -mdebug-%s switch"
msgstr ""
-#: config/rs6000/rs6000.c:1277
+#: config/rs6000/rs6000.c:1287
msgid ""
"unknown -mtraceback arg %qs; expecting %<full%>, %<partial%> or %<none%>"
msgstr ""
-#: config/rs6000/rs6000.c:1288
+#: config/rs6000/rs6000.c:1298
#, c-format
msgid "Unknown switch -mlong-double-%s"
msgstr ""
-#: config/rs6000/rs6000.c:1338
+#: config/rs6000/rs6000.c:1354
msgid "AltiVec and E500 instructions cannot coexist"
msgstr ""
-#: config/rs6000/rs6000.c:1616
+#: config/rs6000/rs6000.c:1622
#, c-format
msgid "unknown -m%s= option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:1637
+#: config/rs6000/rs6000.c:1643
#, c-format
msgid "not configured for ABI: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:1645
+#: config/rs6000/rs6000.c:1651
msgid "Using darwin64 ABI"
msgstr ""
-#: config/rs6000/rs6000.c:1650
+#: config/rs6000/rs6000.c:1656
msgid "Using old darwin ABI"
msgstr ""
-#: config/rs6000/rs6000.c:1656
+#: config/rs6000/rs6000.c:1662
#, c-format
msgid "unknown ABI specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:1673
+#: config/rs6000/rs6000.c:1679
msgid "invalid option for -mfloat-gprs"
msgstr ""
-#: config/rs6000/rs6000.c:1687
+#: config/rs6000/rs6000.c:1695
+msgid ""
+"-malign-power is not supported for 64-bit Darwin; it is incompatible with "
+"the installed C and C++ libraries"
+msgstr ""
+
+#: config/rs6000/rs6000.c:1702
#, c-format
msgid "unknown -malign-XXXXX option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:4658
+#: config/rs6000/rs6000.c:4756
msgid ""
"GCC vector returned by reference: non-standard ABI extension with no "
"compatibility guarantee"
msgstr ""
-#: config/rs6000/rs6000.c:4731
+#: config/rs6000/rs6000.c:4829
msgid ""
"Cannot return value in vector register because altivec instructions are "
"disabled, use -maltivec to enable them."
msgstr ""
-#: config/rs6000/rs6000.c:4920
+#: config/rs6000/rs6000.c:5018
msgid ""
"Cannot pass argument in vector register because altivec instructions are "
"disabled, use -maltivec to enable them."
msgstr ""
-#: config/rs6000/rs6000.c:5712
+#: config/rs6000/rs6000.c:5809
msgid ""
"GCC vector passed by reference: non-standard ABI extension with no "
"compatibility guarantee"
msgstr ""
-#: config/rs6000/rs6000.c:6605
+#: config/rs6000/rs6000.c:6704
msgid "argument 1 must be a 5-bit signed literal"
msgstr ""
-#: config/rs6000/rs6000.c:6708 config/rs6000/rs6000.c:7378
+#: config/rs6000/rs6000.c:6807 config/rs6000/rs6000.c:7477
msgid "argument 2 must be a 5-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:6748
+#: config/rs6000/rs6000.c:6847
msgid "argument 1 of __builtin_altivec_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:6802
+#: config/rs6000/rs6000.c:6901
msgid "argument 1 of __builtin_altivec_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:6964
+#: config/rs6000/rs6000.c:7063
msgid "argument 3 must be a 4-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:7136
+#: config/rs6000/rs6000.c:7235
#, c-format
msgid "argument to %qs must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:7249
+#: config/rs6000/rs6000.c:7348
msgid "argument to dss must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:7264
+#: config/rs6000/rs6000.c:7363
#, c-format
msgid "invalid parameter combination for %qs AltiVec intrinsic"
msgstr ""
-#: config/rs6000/rs6000.c:7498
+#: config/rs6000/rs6000.c:7597
msgid "argument 1 of __builtin_spe_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:7571
+#: config/rs6000/rs6000.c:7670
msgid "argument 1 of __builtin_spe_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:10478
+#: config/rs6000/rs6000.c:10566
#, c-format
msgid "invalid %%f value"
msgstr ""
-#: config/rs6000/rs6000.c:10487
+#: config/rs6000/rs6000.c:10575
#, c-format
msgid "invalid %%F value"
msgstr ""
-#: config/rs6000/rs6000.c:10496
+#: config/rs6000/rs6000.c:10584
#, c-format
msgid "invalid %%G value"
msgstr ""
-#: config/rs6000/rs6000.c:10531
+#: config/rs6000/rs6000.c:10619
#, c-format
msgid "invalid %%j code"
msgstr ""
-#: config/rs6000/rs6000.c:10541
+#: config/rs6000/rs6000.c:10629
#, c-format
msgid "invalid %%J code"
msgstr ""
-#: config/rs6000/rs6000.c:10551
+#: config/rs6000/rs6000.c:10639
#, c-format
msgid "invalid %%k value"
msgstr ""
-#: config/rs6000/rs6000.c:10571 config/xtensa/xtensa.c:1937
+#: config/rs6000/rs6000.c:10659 config/xtensa/xtensa.c:1937
#, c-format
msgid "invalid %%K value"
msgstr ""
-#: config/rs6000/rs6000.c:10638
+#: config/rs6000/rs6000.c:10726
#, c-format
msgid "invalid %%O value"
msgstr ""
-#: config/rs6000/rs6000.c:10685
+#: config/rs6000/rs6000.c:10773
#, c-format
msgid "invalid %%q value"
msgstr ""
-#: config/rs6000/rs6000.c:10729
+#: config/rs6000/rs6000.c:10817
#, c-format
msgid "invalid %%S value"
msgstr ""
-#: config/rs6000/rs6000.c:10771
+#: config/rs6000/rs6000.c:10859
#, c-format
msgid "invalid %%T value"
msgstr ""
-#: config/rs6000/rs6000.c:10781
+#: config/rs6000/rs6000.c:10869
#, c-format
msgid "invalid %%u value"
msgstr ""
-#: config/rs6000/rs6000.c:10790 config/xtensa/xtensa.c:1907
+#: config/rs6000/rs6000.c:10878 config/xtensa/xtensa.c:1907
#, c-format
msgid "invalid %%v value"
msgstr ""
-#: config/rs6000/rs6000.c:13442
+#: config/rs6000/rs6000.c:13555
msgid "stack frame too large"
msgstr ""
-#: config/rs6000/rs6000.c:15958
+#: config/rs6000/rs6000.c:16073
msgid "no profiling of 64-bit code for this ABI"
msgstr ""
-#: config/rs6000/rs6000.c:17044
-msgid "use of 'long' in AltiVec types is deprecated; use 'int'"
+#: config/rs6000/rs6000.c:17163
+msgid "use of %<long%> in AltiVec types is invalid for 64-bit code"
+msgstr ""
+
+#: config/rs6000/rs6000.c:17165
+msgid "use of %<long%> in AltiVec types is deprecated; use %<int%>"
+msgstr ""
+
+#: config/rs6000/rs6000.c:17169
+msgid "use of %<long long%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/aix.h:203 config/rs6000/beos.h:32
-msgid "Always pass floating-point arguments in memory"
+#: config/rs6000/rs6000.c:17171
+msgid "use of %<double%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/aix.h:205 config/rs6000/beos.h:34
-msgid "Don't always pass floating-point arguments in memory"
+#: config/rs6000/rs6000.c:17173
+msgid "use of %<long double%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/aix41.h:27 config/rs6000/aix43.h:32 config/rs6000/aix51.h:31
+#: config/rs6000/rs6000.c:17175
+msgid "use of boolean types in AltiVec types is invalid"
+msgstr ""
+
+#: config/rs6000/rs6000.c:17177
+msgid "use of %<complex%> in AltiVec types is invalid"
+msgstr ""
+
+#: config/rs6000/aix.h:204
+msgid "Conform more closely to IBM XLC semantics"
+msgstr ""
+
+#: config/rs6000/aix.h:206
+msgid "Default GCC semantics that differ from IBM XLC"
+msgstr ""
+
+#: config/rs6000/aix41.h:28 config/rs6000/aix43.h:32 config/rs6000/aix51.h:31
#: config/rs6000/aix52.h:31
msgid "Support message passing with the Parallel Environment"
msgstr ""
@@ -11727,15 +11866,15 @@ msgstr ""
msgid "-m64 not supported in this configuration"
msgstr ""
-#: config/rs6000/linux64.h:106
+#: config/rs6000/linux64.h:109
msgid "-m64 requires a PowerPC64 cpu"
msgstr ""
-#: config/rs6000/linux64.h:216
+#: config/rs6000/linux64.h:221
msgid "Call mcount for profiling before a function prologue"
msgstr ""
-#: config/rs6000/linux64.h:218
+#: config/rs6000/linux64.h:223
msgid "Call mcount for profiling after a function prologue"
msgstr ""
@@ -11882,7 +12021,7 @@ msgstr ""
msgid "Do not generate single field mfcr instruction"
msgstr ""
-#: config/rs6000/rs6000.h:451 config/sparc/sparc.h:709
+#: config/rs6000/rs6000.h:451 config/sparc/sparc.h:715
msgid "Use features of and schedule code for given CPU"
msgstr ""
@@ -11954,7 +12093,7 @@ msgstr ""
#. Number of bytes into the frame return addresses can be found. See
#. rs6000_stack_info in rs6000.c for more information on how the different
#. abi's store the return address.
-#: config/rs6000/rs6000.h:1829
+#: config/rs6000/rs6000.h:1830
msgid "RETURN_ADDRESS_OFFSET not supported"
msgstr ""
@@ -12106,79 +12245,84 @@ msgstr ""
msgid "-m%s not supported in this configuration"
msgstr ""
-#: config/s390/s390.c:1293
+#: config/s390/s390.c:1406
#, c-format
msgid "Unknown cpu used in -march=%s."
msgstr ""
-#: config/s390/s390.c:1312
+#: config/s390/s390.c:1425
#, c-format
msgid "Unknown cpu used in -mtune=%s."
msgstr ""
-#: config/s390/s390.c:1317
+#: config/s390/s390.c:1430
#, c-format
msgid "z/Architecture mode not supported on %s."
msgstr ""
-#: config/s390/s390.c:1319
+#: config/s390/s390.c:1432
msgid "64-bit ABI not supported in ESA/390 mode."
msgstr ""
-#: config/s390/s390.c:1325
+#: config/s390/s390.c:1443
+msgid ""
+"-mbackchain -mpacked-stack -mhard-float are not supported in combination."
+msgstr ""
+
+#: config/s390/s390.c:1450
msgid "invalid value for -mwarn-framesize"
msgstr ""
-#: config/s390/s390.c:1335
+#: config/s390/s390.c:1460
msgid "invalid value for -mstack-size"
msgstr ""
-#: config/s390/s390.c:1338
+#: config/s390/s390.c:1463
msgid "stack size must be an exact power of 2"
msgstr ""
-#: config/s390/s390.c:1344
+#: config/s390/s390.c:1469
msgid "invalid value for -mstack-guard"
msgstr ""
-#: config/s390/s390.c:1347
+#: config/s390/s390.c:1472
msgid "stack size must be greater than the stack guard value"
msgstr ""
-#: config/s390/s390.c:1350
+#: config/s390/s390.c:1475
msgid "stack guard value must be an exact power of 2"
msgstr ""
-#: config/s390/s390.c:1353
+#: config/s390/s390.c:1478
msgid "-mstack-size implies use of -mstack-guard"
msgstr ""
-#: config/s390/s390.c:1357
+#: config/s390/s390.c:1482
msgid "-mstack-guard implies use of -mstack-size"
msgstr ""
-#: config/s390/s390.c:4046
+#: config/s390/s390.c:4310
msgid "Cannot decompose address."
msgstr ""
-#: config/s390/s390.c:4238
+#: config/s390/s390.c:4502
msgid "UNKNOWN in print_operand !?"
msgstr ""
-#: config/s390/s390.c:6285
+#: config/s390/s390.c:6549
msgid "Total size of local variables exceeds architecture limit."
msgstr ""
-#: config/s390/s390.c:6823
+#: config/s390/s390.c:7085
#, c-format
msgid "frame size of %qs is "
msgstr ""
-#: config/s390/s390.c:6823
+#: config/s390/s390.c:7085
msgid " bytes"
msgstr ""
-#: config/s390/s390.c:6827
+#: config/s390/s390.c:7089
#, c-format
msgid "%qs uses dynamic stack allocation"
msgstr ""
@@ -12275,29 +12419,29 @@ msgid ""
"trap instruction is triggered"
msgstr ""
-#: config/sh/sh.c:6197
+#: config/sh/sh.c:6201
msgid "__builtin_saveregs not supported by this subtarget"
msgstr ""
-#: config/sh/sh.c:7166
+#: config/sh/sh.c:7194
msgid "attribute interrupt_handler is not compatible with -m5-compact"
msgstr ""
#. The sp_switch attribute only has meaning for interrupt functions.
#. The trap_exit attribute only has meaning for interrupt functions.
-#: config/sh/sh.c:7188 config/sh/sh.c:7223
+#: config/sh/sh.c:7216 config/sh/sh.c:7251
#, c-format
msgid "%qs attribute only applies to interrupt functions"
msgstr ""
#. The argument must be a constant string.
-#: config/sh/sh.c:7195
+#: config/sh/sh.c:7223
#, c-format
msgid "%qs attribute argument not a string constant"
msgstr ""
#. The argument must be a constant integer.
-#: config/sh/sh.c:7230
+#: config/sh/sh.c:7258
#, c-format
msgid "%qs attribute argument not an integer constant"
msgstr ""
@@ -12334,7 +12478,7 @@ msgstr ""
msgid "%Hexternal linkage required for symbol '%D' because of '%s' attribute."
msgstr ""
-#: config/sh/symbian.c:892 cp/tree.c:2346
+#: config/sh/symbian.c:892 cp/tree.c:2286
#, c-format
msgid "lang_* check: failed in %s, at %s:%d"
msgstr ""
@@ -12346,183 +12490,183 @@ msgstr ""
msgid "Profiling is not supported on this target."
msgstr ""
-#: config/sparc/sparc.c:577
+#: config/sparc/sparc.c:584
#, c-format
msgid "%s is not supported by this configuration"
msgstr ""
-#: config/sparc/sparc.c:584
+#: config/sparc/sparc.c:591
msgid "-mlong-double-64 not allowed with -m64"
msgstr ""
-#: config/sparc/sparc.c:609
+#: config/sparc/sparc.c:616
msgid "-mcmodel= is not supported on 32 bit systems"
msgstr ""
-#: config/sparc/sparc.c:7315 config/sparc/sparc.c:7321
+#: config/sparc/sparc.c:7325 config/sparc/sparc.c:7331
#, c-format
msgid "invalid %%Y operand"
msgstr ""
-#: config/sparc/sparc.c:7391
+#: config/sparc/sparc.c:7401
#, c-format
msgid "invalid %%A operand"
msgstr ""
-#: config/sparc/sparc.c:7401
+#: config/sparc/sparc.c:7411
#, c-format
msgid "invalid %%B operand"
msgstr ""
-#: config/sparc/sparc.c:7440
+#: config/sparc/sparc.c:7450
#, c-format
msgid "invalid %%c operand"
msgstr ""
-#: config/sparc/sparc.c:7441
+#: config/sparc/sparc.c:7451
#, c-format
msgid "invalid %%C operand"
msgstr ""
-#: config/sparc/sparc.c:7462
+#: config/sparc/sparc.c:7472
#, c-format
msgid "invalid %%d operand"
msgstr ""
-#: config/sparc/sparc.c:7463
+#: config/sparc/sparc.c:7473
#, c-format
msgid "invalid %%D operand"
msgstr ""
-#: config/sparc/sparc.c:7479
+#: config/sparc/sparc.c:7489
#, c-format
msgid "invalid %%f operand"
msgstr ""
-#: config/sparc/sparc.c:7493
+#: config/sparc/sparc.c:7503
#, c-format
msgid "invalid %%s operand"
msgstr ""
-#: config/sparc/sparc.c:7547
+#: config/sparc/sparc.c:7557
msgid "long long constant not a valid immediate operand"
msgstr ""
-#: config/sparc/sparc.c:7550
+#: config/sparc/sparc.c:7560
msgid "floating point constant not a valid immediate operand"
msgstr ""
#: config/sparc/freebsd.h:77 config/sparc/linux.h:91
-#: config/sparc/linux64.h:111 config/sparc/netbsd-elf.h:211
+#: config/sparc/linux64.h:111 config/sparc/netbsd-elf.h:201
msgid "Use 64 bit long doubles"
msgstr ""
#: config/sparc/freebsd.h:78 config/sparc/linux.h:92
-#: config/sparc/linux64.h:112 config/sparc/netbsd-elf.h:212
+#: config/sparc/linux64.h:112 config/sparc/netbsd-elf.h:202
msgid "Use 128 bit long doubles"
msgstr ""
-#: config/sparc/sp64-elf.h:90
+#: config/sparc/sp64-elf.h:87
msgid "Generate code for big endian"
msgstr ""
-#: config/sparc/sp64-elf.h:91
+#: config/sparc/sp64-elf.h:88
msgid "Generate code for little endian"
msgstr ""
-#: config/sparc/sp86x-elf.h:68
+#: config/sparc/sp86x-elf.h:61
msgid "Use little-endian byte order for data"
msgstr ""
-#: config/sparc/sparc.h:626
+#: config/sparc/sparc.h:632
msgid "Assume possible double misalignment"
msgstr ""
-#: config/sparc/sparc.h:628
+#: config/sparc/sparc.h:634
msgid "Assume all doubles are aligned"
msgstr ""
-#: config/sparc/sparc.h:630
+#: config/sparc/sparc.h:636
msgid "Pass -assert pure-text to linker"
msgstr ""
-#: config/sparc/sparc.h:632
+#: config/sparc/sparc.h:638
msgid "Do not pass -assert pure-text to linker"
msgstr ""
-#: config/sparc/sparc.h:634
+#: config/sparc/sparc.h:640
msgid "Use ABI reserved registers"
msgstr ""
-#: config/sparc/sparc.h:636
+#: config/sparc/sparc.h:642
msgid "Do not use ABI reserved registers"
msgstr ""
-#: config/sparc/sparc.h:638
+#: config/sparc/sparc.h:644
msgid "Use hardware quad fp instructions"
msgstr ""
-#: config/sparc/sparc.h:640
+#: config/sparc/sparc.h:646
msgid "Do not use hardware quad fp instructions"
msgstr ""
-#: config/sparc/sparc.h:642
+#: config/sparc/sparc.h:648
msgid "Compile for v8plus ABI"
msgstr ""
-#: config/sparc/sparc.h:644
+#: config/sparc/sparc.h:650
msgid "Do not compile for v8plus ABI"
msgstr ""
-#: config/sparc/sparc.h:646
+#: config/sparc/sparc.h:652
msgid "Utilize Visual Instruction Set"
msgstr ""
-#: config/sparc/sparc.h:648
+#: config/sparc/sparc.h:654
msgid "Do not utilize Visual Instruction Set"
msgstr ""
-#: config/sparc/sparc.h:650
+#: config/sparc/sparc.h:656
msgid "Pointers are 64-bit"
msgstr ""
-#: config/sparc/sparc.h:652
+#: config/sparc/sparc.h:658
msgid "Pointers are 32-bit"
msgstr ""
-#: config/sparc/sparc.h:654
+#: config/sparc/sparc.h:660
msgid "Use 32-bit ABI"
msgstr ""
-#: config/sparc/sparc.h:656
+#: config/sparc/sparc.h:662
msgid "Use 64-bit ABI"
msgstr ""
-#: config/sparc/sparc.h:658
+#: config/sparc/sparc.h:664
msgid "Use stack bias"
msgstr ""
-#: config/sparc/sparc.h:660
+#: config/sparc/sparc.h:666
msgid "Do not use stack bias"
msgstr ""
-#: config/sparc/sparc.h:662
+#: config/sparc/sparc.h:668
msgid "Use structs on stronger alignment for double-word copies"
msgstr ""
-#: config/sparc/sparc.h:664
+#: config/sparc/sparc.h:670
msgid "Do not use structs on stronger alignment for double-word copies"
msgstr ""
-#: config/sparc/sparc.h:666
+#: config/sparc/sparc.h:672
msgid "Optimize tail call instructions in assembler and linker"
msgstr ""
-#: config/sparc/sparc.h:668
+#: config/sparc/sparc.h:674
msgid "Do not optimize tail call instructions in assembler or linker"
msgstr ""
-#: config/sparc/sparc.h:713
+#: config/sparc/sparc.h:719
msgid "Use given SPARC code model"
msgstr ""
@@ -12632,63 +12776,63 @@ msgstr ""
msgid "junk at end of #pragma ghs endzda"
msgstr ""
-#: config/v850/v850.c:163
+#: config/v850/v850.c:168
#, c-format
msgid "%s=%s is not numeric"
msgstr ""
-#: config/v850/v850.c:170
+#: config/v850/v850.c:175
#, c-format
msgid "%s=%s is too large"
msgstr ""
-#: config/v850/v850.c:336
+#: config/v850/v850.c:339
msgid "const_double_split got a bad insn:"
msgstr ""
-#: config/v850/v850.c:901
+#: config/v850/v850.c:904
msgid "output_move_single:"
msgstr ""
-#: config/v850/v850.c:2243
+#: config/v850/v850.c:2246
msgid "%Jdata area attributes cannot be specified for local variables"
msgstr ""
-#: config/v850/v850.c:2254
+#: config/v850/v850.c:2257
msgid "%Jdata area of '%D' conflicts with previous declaration"
msgstr ""
-#: config/v850/v850.c:2453
+#: config/v850/v850.c:2456
#, c-format
msgid "bogus JR construction: %d\n"
msgstr ""
-#: config/v850/v850.c:2474 config/v850/v850.c:2677
+#: config/v850/v850.c:2477 config/v850/v850.c:2680
#, c-format
msgid "bad amount of stack space removal: %d"
msgstr ""
-#: config/v850/v850.c:2653
+#: config/v850/v850.c:2656
#, c-format
msgid "bogus JARL construction: %d\n"
msgstr ""
-#: config/v850/v850.c:3023
+#: config/v850/v850.c:3026
#, c-format
msgid "Bogus DISPOSE construction: %d\n"
msgstr ""
-#: config/v850/v850.c:3045
+#: config/v850/v850.c:3048
#, c-format
msgid "Too much stack space to dispose of: %d"
msgstr ""
-#: config/v850/v850.c:3218
+#: config/v850/v850.c:3221
#, c-format
msgid "Bogus PREPEARE construction: %d\n"
msgstr ""
-#: config/v850/v850.c:3240
+#: config/v850/v850.c:3243
#, c-format
msgid "Too much stack space to prepare: %d"
msgstr ""
@@ -12866,12 +13010,12 @@ msgstr ""
msgid "Use direct CALLn instructions for fast calls"
msgstr ""
-#: ada/misc.c:258
+#: ada/misc.c:257
#, c-format
msgid "missing argument to \"-%s\""
msgstr ""
-#: ada/misc.c:299
+#: ada/misc.c:298
msgid "%<-gnat%> misspelled as %<-gant%>"
msgstr ""
@@ -12879,483 +13023,496 @@ msgstr ""
msgid "unable to call pointer to member function here"
msgstr ""
-#: cp/call.c:2369
+#: cp/call.c:2376
msgid "%s %D(%T, %T, %T) <built-in>"
msgstr ""
-#: cp/call.c:2374
+#: cp/call.c:2381
msgid "%s %D(%T, %T) <built-in>"
msgstr ""
-#: cp/call.c:2378
+#: cp/call.c:2385
msgid "%s %D(%T) <built-in>"
msgstr ""
-#: cp/call.c:2382
+#: cp/call.c:2389
msgid "%s %T <conversion>"
msgstr ""
-#: cp/call.c:2384
+#: cp/call.c:2391
msgid "%J%s %+#D <near match>"
msgstr ""
-#: cp/call.c:2386
+#: cp/call.c:2393
msgid "%J%s %+#D"
msgstr ""
-#: cp/call.c:2421
+#: cp/call.c:2428
msgid "candidates are:"
msgstr ""
-#: cp/call.c:2607
+#: cp/call.c:2614
msgid "conversion from %qT to %qT is ambiguous"
msgstr ""
-#: cp/call.c:2761 cp/call.c:2819
+#: cp/call.c:2767 cp/call.c:2825
msgid "no matching function for call to %<%D(%A)%>"
msgstr ""
-#: cp/call.c:2764 cp/call.c:2822
+#: cp/call.c:2770 cp/call.c:2828
msgid "call of overloaded %<%D(%A)%> is ambiguous"
msgstr ""
#. It's no good looking for an overloaded operator() on a
#. pointer-to-member-function.
-#: cp/call.c:2890
+#: cp/call.c:2896
#, c-format
msgid ""
"pointer-to-member function %E cannot be called without an object; consider "
"using .* or ->*"
msgstr ""
-#: cp/call.c:2959
+#: cp/call.c:2965
msgid "no match for call to %<(%T) (%A)%>"
msgstr ""
-#: cp/call.c:2968
+#: cp/call.c:2974
msgid "call of %<(%T) (%A)%> is ambiguous"
msgstr ""
-#: cp/call.c:3005
+#: cp/call.c:3012
msgid "%s for ternary %<operator?:%> in %<%E ? %E : %E%>"
msgstr ""
-#: cp/call.c:3011
+#: cp/call.c:3018
msgid "%s for %<operator%s%> in %<%E%s%>"
msgstr ""
-#: cp/call.c:3015
+#: cp/call.c:3022
msgid "%s for %<operator[]%> in %<%E[%E]%>"
msgstr ""
-#: cp/call.c:3020
+#: cp/call.c:3027
msgid "%s for %qs in %<%s %E%>"
msgstr ""
-#: cp/call.c:3025
+#: cp/call.c:3032
msgid "%s for %<operator%s%> in %<%E %s %E%>"
msgstr ""
-#: cp/call.c:3028
+#: cp/call.c:3035
msgid "%s for %<operator%s%> in %<%s%E%>"
msgstr ""
-#: cp/call.c:3118
+#: cp/call.c:3125
msgid "ISO C++ forbids omitting the middle term of a ?: expression"
msgstr ""
-#: cp/call.c:3195
+#: cp/call.c:3202
msgid "%qE has type %<void%> and is not a throw-expression"
msgstr ""
-#: cp/call.c:3234 cp/call.c:3444
+#: cp/call.c:3241 cp/call.c:3451
msgid "operands to ?: have different types"
msgstr ""
-#: cp/call.c:3398
+#: cp/call.c:3405
msgid "enumeral mismatch in conditional expression: %qT vs %qT"
msgstr ""
-#: cp/call.c:3405
+#: cp/call.c:3412
msgid "enumeral and non-enumeral type in conditional expression"
msgstr ""
-#: cp/call.c:3700
+#: cp/call.c:3706
msgid "no %<%D(int)%> declared for postfix %qs, trying prefix operator instead"
msgstr ""
-#: cp/call.c:3753
+#: cp/call.c:3759
msgid "using synthesized %q#D for copy assignment"
msgstr ""
-#: cp/call.c:3755
+#: cp/call.c:3761
msgid " where cfront would use %q#D"
msgstr ""
-#: cp/call.c:3787
+#: cp/call.c:3793
msgid "comparison between %q#T and %q#T"
msgstr ""
-#: cp/call.c:4044
+#: cp/call.c:4052
msgid "no suitable %<operator %s> for %qT"
msgstr ""
-#: cp/call.c:4061
+#: cp/call.c:4069
msgid "%q+#D is private"
msgstr ""
-#: cp/call.c:4063
+#: cp/call.c:4071
msgid "%q+#D is protected"
msgstr ""
-#: cp/call.c:4065
+#: cp/call.c:4073
msgid "%q+#D is inaccessible"
msgstr ""
-#: cp/call.c:4066
+#: cp/call.c:4074
msgid "within this context"
msgstr ""
-#: cp/call.c:4154 cp/cvt.c:263
+#: cp/call.c:4163 cp/cvt.c:263
msgid "invalid conversion from %qT to %qT"
msgstr ""
-#: cp/call.c:4156
+#: cp/call.c:4165
msgid " initializing argument %P of %qD"
msgstr ""
-#: cp/call.c:4300
+#: cp/call.c:4177
+msgid "passing NULL to non-pointer argument %P of %qD"
+msgstr ""
+
+#: cp/call.c:4180
+msgid "converting to non-pointer type %qT from NULL"
+msgstr ""
+
+#: cp/call.c:4188
+msgid "passing %qT for argument %P to %qD"
+msgstr ""
+
+#: cp/call.c:4191
+msgid "converting to %qT from %qT"
+msgstr ""
+
+#: cp/call.c:4200
+msgid "passing negative value %qE for argument %P to %qD"
+msgstr ""
+
+#: cp/call.c:4203
+msgid "converting negative value %qE to %qT"
+msgstr ""
+
+#: cp/call.c:4345
msgid "cannot bind bitfield %qE to %qT"
msgstr ""
-#: cp/call.c:4303
+#: cp/call.c:4348 cp/call.c:4364
msgid "cannot bind packed field %qE to %qT"
msgstr ""
-#: cp/call.c:4306
+#: cp/call.c:4351
msgid "cannot bind rvalue %qE to %qT"
msgstr ""
-#: cp/call.c:4401
+#: cp/call.c:4460
msgid ""
"cannot pass objects of non-POD type %q#T through %<...%>; call will abort at "
"runtime"
msgstr ""
#. Undefined behavior [expr.call] 5.2.2/7.
-#: cp/call.c:4427
+#: cp/call.c:4486
msgid ""
"cannot receive objects of non-POD type %q#T through %<...%>; call will abort "
"at runtime"
msgstr ""
-#: cp/call.c:4470
+#: cp/call.c:4529
msgid "the default argument for parameter %d of %qD has not yet been parsed"
msgstr ""
-#: cp/call.c:4675
+#: cp/call.c:4734
msgid "passing %qT as %<this%> argument of %q#D discards qualifiers"
msgstr ""
-#: cp/call.c:4694
+#: cp/call.c:4753
msgid "%qT is not an accessible base of %qT"
msgstr ""
-#: cp/call.c:4944
+#: cp/call.c:5003
msgid "could not find class$ field in java interface type %qT"
msgstr ""
-#: cp/call.c:5206
+#: cp/call.c:5263
msgid "call to non-function %qD"
msgstr ""
-#: cp/call.c:5231
+#: cp/call.c:5288
msgid "request for member %qD in %qE, which is of non-aggregate type %qT"
msgstr ""
-#: cp/call.c:5310
+#: cp/call.c:5367
msgid "no matching function for call to %<%T::%s(%A)%#V%>"
msgstr ""
-#: cp/call.c:5328
+#: cp/call.c:5385
msgid "call of overloaded %<%s(%A)%> is ambiguous"
msgstr ""
-#: cp/call.c:5352
+#: cp/call.c:5409
msgid "cannot call member function %qD without object"
msgstr ""
-#: cp/call.c:5957
+#: cp/call.c:6014
msgid "passing %qT chooses %qT over %qT"
msgstr ""
-#: cp/call.c:5959 cp/name-lookup.c:4110
+#: cp/call.c:6016 cp/name-lookup.c:4104
msgid " in call to %qD"
msgstr ""
-#: cp/call.c:6016
+#: cp/call.c:6073
msgid "choosing %qD over %qD"
msgstr ""
-#: cp/call.c:6017
+#: cp/call.c:6074
msgid " for conversion from %qT to %qT"
msgstr ""
-#: cp/call.c:6019
+#: cp/call.c:6076
msgid " because conversion sequence for the argument is better"
msgstr ""
-#: cp/call.c:6140
+#: cp/call.c:6197
msgid ""
"ISO C++ says that these are ambiguous, even though the worst conversion for "
"the first is better than the worst conversion for the second:"
msgstr ""
-#: cp/call.c:6144
+#: cp/call.c:6201
msgid "candidate 1:"
msgstr ""
-#: cp/call.c:6145
+#: cp/call.c:6202
msgid "candidate 2:"
msgstr ""
-#: cp/call.c:6281
+#: cp/call.c:6338
msgid "could not convert %qE to %qT"
msgstr ""
-#: cp/call.c:6411
+#: cp/call.c:6469
msgid ""
"invalid initialization of non-const reference of type %qT from a temporary "
"of type %qT"
msgstr ""
-#: cp/call.c:6415
+#: cp/call.c:6473
msgid ""
"invalid initialization of reference of type %qT from expression of type %qT"
msgstr ""
-#: cp/class.c:273
+#: cp/class.c:272
msgid "cannot convert from base %qT to derived type %qT via virtual base %qT"
msgstr ""
-#: cp/class.c:898
-msgid "Java class %qT cannot have an implicit non-trivial destructor"
+#: cp/class.c:929
+msgid "Java class %qT cannot have a destructor"
msgstr ""
-#: cp/class.c:899
-msgid "Java class %qT cannot have a destructor"
+#: cp/class.c:931
+msgid "Java class %qT cannot have an implicit non-trivial destructor"
msgstr ""
-#: cp/class.c:998
+#: cp/class.c:1031
msgid "%q#D and %q#D cannot be overloaded"
msgstr ""
-#: cp/class.c:1055
+#: cp/class.c:1088
msgid "conflicting access specifications for method %qD, ignored"
msgstr ""
-#: cp/class.c:1058
+#: cp/class.c:1091
#, c-format
msgid "conflicting access specifications for field %qE, ignored"
msgstr ""
-#: cp/class.c:1108
+#: cp/class.c:1141
msgid "%qD names constructor"
msgstr ""
-#: cp/class.c:1113
+#: cp/class.c:1146
msgid "%qD invalid in %qT"
msgstr ""
-#: cp/class.c:1121
+#: cp/class.c:1154
msgid "no members matching %qD in %q#T"
msgstr ""
-#: cp/class.c:1153 cp/class.c:1161
+#: cp/class.c:1186 cp/class.c:1194
msgid "%qD invalid in %q#T"
msgstr ""
-#: cp/class.c:1154
+#: cp/class.c:1187
msgid " because of local method %q#D with same name"
msgstr ""
-#: cp/class.c:1162
+#: cp/class.c:1195
msgid " because of local member %q#D with same name"
msgstr ""
-#: cp/class.c:1207
+#: cp/class.c:1237
msgid "base class %q#T has a non-virtual destructor"
msgstr ""
-#: cp/class.c:1226
-msgid ""
-"base %qT with only non-default constructor in class without a constructor"
-msgstr ""
-
-#: cp/class.c:1534
+#: cp/class.c:1551
msgid "all member functions in class %qT are private"
msgstr ""
-#: cp/class.c:1545
+#: cp/class.c:1562
msgid "%q#T only defines a private destructor and has no friends"
msgstr ""
-#: cp/class.c:1585
+#: cp/class.c:1602
msgid "%q#T only defines private constructors and has no friends"
msgstr ""
-#: cp/class.c:1923
+#: cp/class.c:1935
msgid "no unique final overrider for %qD in %qT"
msgstr ""
#. Here we know it is a hider, and no overrider exists.
-#: cp/class.c:2379
+#: cp/class.c:2409
msgid "%qD was hidden"
msgstr ""
-#: cp/class.c:2380
+#: cp/class.c:2410
msgid " by %qD"
msgstr ""
-#: cp/class.c:2421 cp/decl2.c:1142
+#: cp/class.c:2451 cp/decl2.c:1100
msgid "%q#D invalid; an anonymous union can only have non-static data members"
msgstr ""
-#: cp/class.c:2428 cp/decl2.c:1149
+#: cp/class.c:2458 cp/decl2.c:1107
msgid "private member %q#D in anonymous union"
msgstr ""
-#: cp/class.c:2431 cp/decl2.c:1151
+#: cp/class.c:2461 cp/decl2.c:1109
msgid "protected member %q#D in anonymous union"
msgstr ""
-#: cp/class.c:2545
-msgid ""
-"vtable layout for class %qT may not be ABI-compliant and may change in a "
-"future version of GCC due to implicit virtual destructor"
-msgstr ""
-
-#: cp/class.c:2603
+#: cp/class.c:2628
msgid "bit-field %q#D with non-integral type"
msgstr ""
-#: cp/class.c:2623
+#: cp/class.c:2645
msgid "bit-field %qD width not an integer constant"
msgstr ""
-#: cp/class.c:2629
+#: cp/class.c:2651
msgid "negative width in bit-field %qD"
msgstr ""
-#: cp/class.c:2634
+#: cp/class.c:2656
msgid "zero width for bit-field %qD"
msgstr ""
-#: cp/class.c:2640
+#: cp/class.c:2662
msgid "width of %qD exceeds its type"
msgstr ""
-#: cp/class.c:2649
+#: cp/class.c:2671
msgid "%qD is too small to hold all values of %q#T"
msgstr ""
-#: cp/class.c:2711
+#: cp/class.c:2731
msgid "member %q#D with constructor not allowed in union"
msgstr ""
-#: cp/class.c:2714
+#: cp/class.c:2734
msgid "member %q#D with destructor not allowed in union"
msgstr ""
-#: cp/class.c:2717
+#: cp/class.c:2737
msgid "member %q#D with copy assignment operator not allowed in union"
msgstr ""
-#: cp/class.c:2744
+#: cp/class.c:2760
msgid "multiple fields in union %qT initialized"
msgstr ""
-#: cp/class.c:2810
+#: cp/class.c:2821
msgid "ignoring packed attribute on unpacked non-POD field %q#D"
msgstr ""
-#: cp/class.c:2870
+#: cp/class.c:2881
msgid "%qD may not be static because it is a member of a union"
msgstr ""
-#: cp/class.c:2875
+#: cp/class.c:2886
msgid "%qD may not have reference type %qT because it is a member of a union"
msgstr ""
-#: cp/class.c:2884
+#: cp/class.c:2895
msgid "field %qD in local class cannot be static"
msgstr ""
-#: cp/class.c:2890
+#: cp/class.c:2901
msgid "field %qD invalidly declared function type"
msgstr ""
-#: cp/class.c:2896
+#: cp/class.c:2907
msgid "field %qD invalidly declared method type"
msgstr ""
-#: cp/class.c:2929
+#: cp/class.c:2939
msgid "non-static reference %q#D in class without a constructor"
msgstr ""
-#: cp/class.c:2977
+#: cp/class.c:2986
msgid "non-static const member %q#D in class without a constructor"
msgstr ""
-#: cp/class.c:2992
+#: cp/class.c:3001
msgid "field %q#D with same name as class"
msgstr ""
-#: cp/class.c:3026
+#: cp/class.c:3034
msgid "%q#T has pointer data members"
msgstr ""
-#: cp/class.c:3030
+#: cp/class.c:3038
msgid " but does not override %<%T(const %T&)%>"
msgstr ""
-#: cp/class.c:3032
+#: cp/class.c:3040
msgid " or %<operator=(const %T&)%>"
msgstr ""
-#: cp/class.c:3035
+#: cp/class.c:3043
msgid " but does not override %<operator=(const %T&)%>"
msgstr ""
-#: cp/class.c:3468
+#: cp/class.c:3476
msgid ""
"offset of empty base %qT may not be ABI-compliant and maychange in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:3580
+#: cp/class.c:3588
msgid "class %qT will be considered nearly empty in a future version of GCC"
msgstr ""
-#: cp/class.c:3662
+#: cp/class.c:3670
msgid "initializer specified for non-virtual method %qD"
msgstr ""
-#: cp/class.c:4321
+#: cp/class.c:4333
msgid ""
"offset of virtual base %qT is not ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4420
+#: cp/class.c:4432
msgid "direct base %qT inaccessible in %qT due to ambiguity"
msgstr ""
-#: cp/class.c:4432
+#: cp/class.c:4444
msgid "virtual base %qT inaccessible in %qT due to ambiguity"
msgstr ""
-#: cp/class.c:4603
+#: cp/class.c:4621
msgid ""
"size assigned to %qT may not be ABI-compliant and may change in a future "
"version of GCC"
@@ -13363,74 +13520,74 @@ msgstr ""
#. Versions of G++ before G++ 3.4 did not reset the
#. DECL_MODE.
-#: cp/class.c:4642
+#: cp/class.c:4660
msgid ""
"the offset of %qD may not be ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4665
+#: cp/class.c:4683
msgid ""
"offset of %qD is not ABI-compliant and may change in a future version of GCC"
msgstr ""
-#: cp/class.c:4675
+#: cp/class.c:4693
msgid ""
"%qD contains empty classes which may cause base classes to be placed at "
"different locations in a future version of GCC"
msgstr ""
-#: cp/class.c:4734
+#: cp/class.c:4753
msgid ""
"layout of classes derived from empty class %qT may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4875 cp/semantics.c:2100
+#: cp/class.c:4894 cp/parser.c:12849
msgid "redefinition of %q#T"
msgstr ""
-#: cp/class.c:5019
+#: cp/class.c:5042
msgid "%q#T has virtual functions but non-virtual destructor"
msgstr ""
-#: cp/class.c:5114
+#: cp/class.c:5139
msgid "trying to finish struct, but kicked out due to previous parse errors"
msgstr ""
-#: cp/class.c:5530
+#: cp/class.c:5555
msgid "language string %<\"%E\"%> not recognized"
msgstr ""
-#: cp/class.c:5617
+#: cp/class.c:5642
msgid "cannot resolve overloaded function %qD based on conversion to type %qT"
msgstr ""
-#: cp/class.c:5742
+#: cp/class.c:5767
msgid "no matches converting function %qD to type %q#T"
msgstr ""
-#: cp/class.c:5765
+#: cp/class.c:5790
msgid "converting overloaded function %qD to type %q#T is ambiguous"
msgstr ""
-#: cp/class.c:5791
+#: cp/class.c:5816
msgid "assuming pointer to member %qD"
msgstr ""
-#: cp/class.c:5794
+#: cp/class.c:5819
msgid "(a pointer to member can only be formed with %<&%E%>)"
msgstr ""
-#: cp/class.c:5839 cp/class.c:5870 cp/class.c:6022 cp/class.c:6029
+#: cp/class.c:5864 cp/class.c:5895 cp/class.c:6047 cp/class.c:6054
msgid "not enough type information"
msgstr ""
-#: cp/class.c:5856
+#: cp/class.c:5881
msgid "argument of type %qT does not match %qT"
msgstr ""
-#: cp/class.c:6006
+#: cp/class.c:6031
msgid "invalid operation on uninstantiated type"
msgstr ""
@@ -13439,11 +13596,11 @@ msgstr ""
#. A name N used in a class S shall refer to the same declaration
#. in its context and when re-evaluated in the completed scope of
#. S.
-#: cp/class.c:6272 cp/decl.c:1231 cp/name-lookup.c:508 cp/pt.c:2223
+#: cp/class.c:6268 cp/decl.c:1096 cp/name-lookup.c:508 cp/pt.c:2198
msgid "declaration of %q#D"
msgstr ""
-#: cp/class.c:6273
+#: cp/class.c:6269
msgid "changes meaning of %qD from %q+#D"
msgstr ""
@@ -13463,161 +13620,169 @@ msgstr ""
msgid "pointer to member cast from %qT to %qT is via virtual base"
msgstr ""
-#: cp/cvt.c:499
+#: cp/cvt.c:497
msgid "conversion from %qT to %qT discards qualifiers"
msgstr ""
-#: cp/cvt.c:517 cp/typeck.c:4879
+#: cp/cvt.c:515 cp/typeck.c:4840
msgid "casting %qT to %qT does not dereference pointer"
msgstr ""
-#: cp/cvt.c:544
+#: cp/cvt.c:542
msgid "cannot convert type %qT to type %qT"
msgstr ""
-#: cp/cvt.c:671
+#: cp/cvt.c:670
msgid "conversion from %q#T to %q#T"
msgstr ""
-#: cp/cvt.c:683 cp/cvt.c:703
+#: cp/cvt.c:682 cp/cvt.c:702
msgid "%q#T used where a %qT was expected"
msgstr ""
-#: cp/cvt.c:718
+#: cp/cvt.c:717
msgid "%q#T used where a floating point value was expected"
msgstr ""
-#: cp/cvt.c:765
+#: cp/cvt.c:764
msgid "conversion from %qT to non-scalar type %qT requested"
msgstr ""
-#: cp/cvt.c:853
+#: cp/cvt.c:798
+msgid "pseudo-destructor is not called"
+msgstr ""
+
+#: cp/cvt.c:857
msgid "object of incomplete type %qT will not be accessed in %s"
msgstr ""
-#: cp/cvt.c:856
+#: cp/cvt.c:860
msgid "object of type %qT will not be accessed in %s"
msgstr ""
-#: cp/cvt.c:872
+#: cp/cvt.c:876
msgid "object %qE of incomplete type %qT will not be accessed in %s"
msgstr ""
#. [over.over] enumerates the places where we can take the address
#. of an overloaded function, and this is not one of them.
-#: cp/cvt.c:888
+#: cp/cvt.c:892
#, c-format
msgid "%s cannot resolve address of overloaded function"
msgstr ""
#. Only warn when there is no &.
-#: cp/cvt.c:894
+#: cp/cvt.c:898
#, c-format
msgid "%s is a reference, not call, to function %qE"
msgstr ""
-#: cp/cvt.c:902
+#: cp/cvt.c:909
#, c-format
msgid "%s has no effect"
msgstr ""
-#: cp/cvt.c:1013
+#: cp/cvt.c:941
+msgid "value computed is not used"
+msgstr ""
+
+#: cp/cvt.c:1049
msgid "converting NULL to non-pointer type"
msgstr ""
-#: cp/cvt.c:1086
+#: cp/cvt.c:1121
msgid "ambiguous default type conversion from %qT"
msgstr ""
-#: cp/cvt.c:1088
+#: cp/cvt.c:1123
msgid " candidate conversions include %qD and %qD"
msgstr ""
-#: cp/decl.c:368
+#: cp/decl.c:361
msgid "label %qD used but not defined"
msgstr ""
-#: cp/decl.c:379
+#: cp/decl.c:372
msgid "label %qD defined but not used"
msgstr ""
-#: cp/decl.c:1138
+#: cp/decl.c:1003
msgid "%qD was declared %<extern%> and later %<static%>"
msgstr ""
-#: cp/decl.c:1139 cp/decl.c:1604
+#: cp/decl.c:1004 cp/decl.c:1469
msgid "previous declaration of %qD"
msgstr ""
-#: cp/decl.c:1187
+#: cp/decl.c:1052
msgid "%Jfunction %qD redeclared as inline"
msgstr ""
-#: cp/decl.c:1188
+#: cp/decl.c:1053
msgid "%Jprevious declaration of %qD with attribute noinline"
msgstr ""
-#: cp/decl.c:1195
+#: cp/decl.c:1060
msgid "%Jfunction %qD redeclared with attribute noinline"
msgstr ""
-#: cp/decl.c:1197
+#: cp/decl.c:1062
msgid "%Jprevious declaration of %qD was inline"
msgstr ""
-#: cp/decl.c:1218 cp/decl.c:1289
+#: cp/decl.c:1083 cp/decl.c:1154
msgid "shadowing %s function %q#D"
msgstr ""
-#: cp/decl.c:1227
+#: cp/decl.c:1092
msgid "library function %q#D redeclared as non-function %q#D"
msgstr ""
-#: cp/decl.c:1232
+#: cp/decl.c:1097
msgid "conflicts with built-in declaration %q#D"
msgstr ""
-#: cp/decl.c:1284 cp/decl.c:1393 cp/decl.c:1409
+#: cp/decl.c:1149 cp/decl.c:1258 cp/decl.c:1274
msgid "new declaration %q#D"
msgstr ""
-#: cp/decl.c:1285
+#: cp/decl.c:1150
msgid "ambiguates built-in declaration %q#D"
msgstr ""
-#: cp/decl.c:1356
+#: cp/decl.c:1221
msgid "%q#D redeclared as different kind of symbol"
msgstr ""
-#: cp/decl.c:1359
+#: cp/decl.c:1224
msgid "previous declaration of %q#D"
msgstr ""
-#: cp/decl.c:1378
+#: cp/decl.c:1243
msgid "declaration of template %q#D"
msgstr ""
-#: cp/decl.c:1379 cp/name-lookup.c:509
+#: cp/decl.c:1244 cp/name-lookup.c:509
msgid "conflicts with previous declaration %q#D"
msgstr ""
-#: cp/decl.c:1394 cp/decl.c:1410
+#: cp/decl.c:1259 cp/decl.c:1275
msgid "ambiguates old declaration %q#D"
msgstr ""
-#: cp/decl.c:1402
+#: cp/decl.c:1267
msgid "declaration of C function %q#D conflicts with"
msgstr ""
-#: cp/decl.c:1404
+#: cp/decl.c:1269
msgid "previous declaration %q#D here"
msgstr ""
-#: cp/decl.c:1417
+#: cp/decl.c:1282
msgid "conflicting declaration %q#D"
msgstr ""
-#: cp/decl.c:1418
+#: cp/decl.c:1283
msgid "%qD has a previous declaration as %q#D"
msgstr ""
@@ -13628,65 +13793,65 @@ msgstr ""
#. A namespace-name defined at global scope shall not be
#. declared as the name of any other entity in any global scope
#. of the program.
-#: cp/decl.c:1471
+#: cp/decl.c:1336
msgid "declaration of namespace %qD conflicts with"
msgstr ""
-#: cp/decl.c:1472
+#: cp/decl.c:1337
msgid "previous declaration of namespace %qD here"
msgstr ""
-#: cp/decl.c:1484
+#: cp/decl.c:1349
msgid "%q#D previously defined here"
msgstr ""
-#: cp/decl.c:1485
+#: cp/decl.c:1350
msgid "%q#D previously declared here"
msgstr ""
#. Prototype decl follows defn w/o prototype.
-#: cp/decl.c:1494
+#: cp/decl.c:1359
msgid "prototype for %q#D"
msgstr ""
-#: cp/decl.c:1495
+#: cp/decl.c:1360
msgid "%Jfollows non-prototype definition here"
msgstr ""
-#: cp/decl.c:1507
+#: cp/decl.c:1372
msgid "previous declaration of %q#D with %qL linkage"
msgstr ""
-#: cp/decl.c:1509
+#: cp/decl.c:1374
msgid "conflicts with new declaration with %qL linkage"
msgstr ""
-#: cp/decl.c:1532 cp/decl.c:1539
+#: cp/decl.c:1397 cp/decl.c:1404
msgid "default argument given for parameter %d of %q#D"
msgstr ""
-#: cp/decl.c:1534 cp/decl.c:1541
+#: cp/decl.c:1399 cp/decl.c:1406
msgid "after previous specification in %q#D"
msgstr ""
-#: cp/decl.c:1550
+#: cp/decl.c:1415
msgid "%q#D was used before it was declared inline"
msgstr ""
-#: cp/decl.c:1551
+#: cp/decl.c:1416
msgid "%Jprevious non-inline declaration here"
msgstr ""
-#: cp/decl.c:1603
+#: cp/decl.c:1468
msgid "redundant redeclaration of %qD in same scope"
msgstr ""
-#: cp/decl.c:1697
+#: cp/decl.c:1562
#, c-format
msgid "declaration of %qF throws different exceptions"
msgstr ""
-#: cp/decl.c:1699
+#: cp/decl.c:1564
#, c-format
msgid "than previous declaration %qF"
msgstr ""
@@ -13699,824 +13864,844 @@ msgstr ""
#. that specialization that would cause an implicit
#. instantiation to take place, in every translation unit in
#. which such a use occurs.
-#: cp/decl.c:1852
+#: cp/decl.c:1724
msgid "explicit specialization of %qD after first use"
msgstr ""
-#: cp/decl.c:1931
+#: cp/decl.c:1803
msgid "%J%qD: visibility attribute ignored because it"
msgstr ""
-#: cp/decl.c:1933
+#: cp/decl.c:1805
msgid "%Jconflicts with previous declaration here"
msgstr ""
-#: cp/decl.c:2161
+#: cp/decl.c:2048
#, c-format
msgid "label %qE referenced outside of any function"
msgstr ""
-#: cp/decl.c:2257 cp/decl.c:2281 cp/decl.c:2369
+#: cp/decl.c:2144 cp/decl.c:2168 cp/decl.c:2256
msgid "jump to label %qD"
msgstr ""
-#: cp/decl.c:2259 cp/decl.c:2283
+#: cp/decl.c:2146 cp/decl.c:2170
msgid "jump to case label"
msgstr ""
-#: cp/decl.c:2262 cp/decl.c:2286
+#: cp/decl.c:2149 cp/decl.c:2173
msgid "%H from here"
msgstr ""
-#: cp/decl.c:2267
+#: cp/decl.c:2154
msgid " crosses initialization of %q#D"
msgstr ""
-#: cp/decl.c:2270 cp/decl.c:2385
+#: cp/decl.c:2157 cp/decl.c:2272
msgid " enters scope of non-POD %q#D"
msgstr ""
-#: cp/decl.c:2290 cp/decl.c:2389
+#: cp/decl.c:2177 cp/decl.c:2276
msgid " enters try block"
msgstr ""
-#: cp/decl.c:2292 cp/decl.c:2391
+#: cp/decl.c:2179 cp/decl.c:2278
msgid " enters catch block"
msgstr ""
-#: cp/decl.c:2370
+#: cp/decl.c:2257
msgid " from here"
msgstr ""
#. Can't skip init of __exception_info.
-#: cp/decl.c:2381
+#: cp/decl.c:2268
msgid "%J enters catch block"
msgstr ""
-#: cp/decl.c:2383
+#: cp/decl.c:2270
msgid " skips initialization of %q#D"
msgstr ""
-#: cp/decl.c:2417
+#: cp/decl.c:2304
msgid "label named wchar_t"
msgstr ""
-#: cp/decl.c:2420
+#: cp/decl.c:2307
msgid "duplicate label %qD"
msgstr ""
-#: cp/decl.c:2651 cp/parser.c:3437
+#: cp/decl.c:2555 cp/parser.c:3514
msgid "%qD used without template parameters"
msgstr ""
-#: cp/decl.c:2661 cp/decl.c:2676 cp/decl.c:2767
+#: cp/decl.c:2572 cp/decl.c:2663
msgid "no class template named %q#T in %q#T"
msgstr ""
-#: cp/decl.c:2697 cp/decl.c:2707 cp/decl.c:2727
+#: cp/decl.c:2593 cp/decl.c:2603 cp/decl.c:2623
msgid "no type named %q#T in %q#T"
msgstr ""
-#: cp/decl.c:2776
+#: cp/decl.c:2672
msgid "template parameters do not match template"
msgstr ""
-#: cp/decl.c:2777 cp/friend.c:317 cp/friend.c:325
+#: cp/decl.c:2673 cp/friend.c:317 cp/friend.c:325
msgid "%qD declared here"
msgstr ""
-#: cp/decl.c:3448
+#: cp/decl.c:3344
msgid "%Jan anonymous union cannot have function members"
msgstr ""
-#: cp/decl.c:3466
+#: cp/decl.c:3362
msgid "member %q#D with constructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3470
+#: cp/decl.c:3366
msgid "member %q#D with destructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3474
+#: cp/decl.c:3370
msgid ""
"member %q#D with copy assignment operator not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3500
+#: cp/decl.c:3396
msgid "multiple types in one declaration"
msgstr ""
-#: cp/decl.c:3504
+#: cp/decl.c:3400
msgid "redeclaration of C++ built-in type %qT"
msgstr ""
-#: cp/decl.c:3540
+#: cp/decl.c:3437
msgid "missing type-name in typedef-declaration"
msgstr ""
-#: cp/decl.c:3548
+#: cp/decl.c:3445
msgid "ISO C++ prohibits anonymous structs"
msgstr ""
-#: cp/decl.c:3555
+#: cp/decl.c:3452
#, c-format
msgid "%qs can only be specified for functions"
msgstr ""
-#: cp/decl.c:3561
+#: cp/decl.c:3458
msgid "%<friend%> can only be specified inside a class"
msgstr ""
-#: cp/decl.c:3563
+#: cp/decl.c:3460
msgid "%<explicit%> can only be specified for constructors"
msgstr ""
-#: cp/decl.c:3565
+#: cp/decl.c:3462
msgid "a storage class can only be specified for objects and functions"
msgstr ""
-#: cp/decl.c:3571
+#: cp/decl.c:3468
msgid "qualifiers can only be specified for objects and functions"
msgstr ""
-#: cp/decl.c:3601
+#: cp/decl.c:3498
msgid "attribute ignored in declaration of %q#T"
msgstr ""
-#: cp/decl.c:3602
+#: cp/decl.c:3499
msgid "attribute for %q#T must follow the %qs keyword"
msgstr ""
-#: cp/decl.c:3723
+#: cp/decl.c:3622
msgid "function %q#D is initialized like a variable"
msgstr ""
-#: cp/decl.c:3735
+#: cp/decl.c:3634
msgid "declaration of %q#D has %<extern%> and is initialized"
msgstr ""
-#: cp/decl.c:3766
+#: cp/decl.c:3665
msgid "%q#D is not a static member of %q#T"
msgstr ""
-#: cp/decl.c:3772
+#: cp/decl.c:3671
msgid "ISO C++ does not permit %<%T::%D%> to be defined as %<%T::%D%>"
msgstr ""
-#: cp/decl.c:3781
+#: cp/decl.c:3680
msgid ""
"template header not allowed in member definition of explicitly specialized "
"class"
msgstr ""
-#: cp/decl.c:3789
+#: cp/decl.c:3688
msgid "duplicate initialization of %qD"
msgstr ""
-#: cp/decl.c:3822
+#: cp/decl.c:3726
msgid "declaration of %q#D outside of class is not definition"
msgstr ""
-#: cp/decl.c:3871
+#: cp/decl.c:3775
msgid "variable %q#D has initializer but incomplete type"
msgstr ""
-#: cp/decl.c:3878 cp/decl.c:4502
+#: cp/decl.c:3782 cp/decl.c:4411
msgid "elements of array %q#D have incomplete type"
msgstr ""
-#: cp/decl.c:3894
+#: cp/decl.c:3798
msgid "aggregate %q#D has incomplete type and cannot be defined"
msgstr ""
-#: cp/decl.c:3944
+#: cp/decl.c:3848
msgid "%qD declared as reference but not initialized"
msgstr ""
-#: cp/decl.c:3950
+#: cp/decl.c:3854
msgid "ISO C++ forbids use of initializer list to initialize reference %qD"
msgstr ""
-#: cp/decl.c:3979
+#: cp/decl.c:3880
msgid "cannot initialize %qT from %qT"
msgstr ""
-#: cp/decl.c:4011
+#: cp/decl.c:3912
msgid "initializer fails to determine size of %qD"
msgstr ""
-#: cp/decl.c:4016
+#: cp/decl.c:3917
msgid "array size missing in %qD"
msgstr ""
-#: cp/decl.c:4028
+#: cp/decl.c:3929
msgid "zero-size array %qD"
msgstr ""
#. An automatic variable with an incomplete type: that is an error.
#. Don't talk about array types here, since we took care of that
#. message in grokdeclarator.
-#: cp/decl.c:4065
+#: cp/decl.c:3966
msgid "storage size of %qD isn't known"
msgstr ""
-#: cp/decl.c:4087
+#: cp/decl.c:3988
msgid "storage size of %qD isn't constant"
msgstr ""
-#: cp/decl.c:4142
+#: cp/decl.c:4043
msgid ""
"sorry: semantics of inline function static data %q#D are wrong (you'll wind "
"up with multiple copies)"
msgstr ""
-#: cp/decl.c:4145
+#: cp/decl.c:4046
msgid "%J you can work around this by removing the initializer"
msgstr ""
-#: cp/decl.c:4172
+#: cp/decl.c:4073
msgid "uninitialized const %qD"
msgstr ""
-#: cp/decl.c:4232
+#: cp/decl.c:4133
msgid "name %qD used in a GNU-style designated initializer for an array"
msgstr ""
-#: cp/decl.c:4242
+#: cp/decl.c:4143
#, c-format
msgid "Designated initializer %qE larger than array size"
msgstr ""
-#: cp/decl.c:4313
+#: cp/decl.c:4215
msgid "brace-enclosed initializer used to initialize %qT"
msgstr ""
-#: cp/decl.c:4376
+#: cp/decl.c:4280
msgid "initializer for %qT must be brace-enclosed"
msgstr ""
-#: cp/decl.c:4392
+#: cp/decl.c:4296
msgid "ISO C++ does not allow designated initializers"
msgstr ""
-#: cp/decl.c:4396
+#: cp/decl.c:4300
msgid "%qT has no non-static data member named %qD"
msgstr ""
-#: cp/decl.c:4458
+#: cp/decl.c:4364
msgid "too many initializers for %qT"
msgstr ""
-#: cp/decl.c:4496
+#: cp/decl.c:4405
msgid "variable-sized object %qD may not be initialized"
msgstr ""
-#: cp/decl.c:4507
+#: cp/decl.c:4416
msgid "%qD has incomplete type"
msgstr ""
-#: cp/decl.c:4561
+#: cp/decl.c:4470
msgid "%qD must be initialized by constructor, not by %<{...}%>"
msgstr ""
-#: cp/decl.c:4606
+#: cp/decl.c:4506
+msgid "array %qD initialized by parenthesized string literal %qE"
+msgstr ""
+
+#: cp/decl.c:4521
msgid "structure %qD with uninitialized const members"
msgstr ""
-#: cp/decl.c:4608
+#: cp/decl.c:4523
msgid "structure %qD with uninitialized reference members"
msgstr ""
-#: cp/decl.c:4803
+#: cp/decl.c:4723
msgid "assignment (not initialization) in declaration"
msgstr ""
-#: cp/decl.c:4820
+#: cp/decl.c:4740
msgid "cannot initialize %qD to namespace %qD"
msgstr ""
-#: cp/decl.c:4863
+#: cp/decl.c:4781
msgid "shadowing previous type declaration of %q#D"
msgstr ""
-#: cp/decl.c:4900
+#: cp/decl.c:4815
msgid "%qD cannot be thread-local because it has non-POD type %qT"
msgstr ""
-#: cp/decl.c:4915
+#: cp/decl.c:4830
msgid "%qD is thread-local and so cannot be dynamically initialized"
msgstr ""
-#: cp/decl.c:5523
+#: cp/decl.c:5447
msgid "destructor for alien class %qT cannot be a member"
msgstr ""
-#: cp/decl.c:5525
+#: cp/decl.c:5449
msgid "constructor for alien class %qT cannot be a member"
msgstr ""
-#: cp/decl.c:5546
+#: cp/decl.c:5470
msgid "%qD declared as a %<virtual%> %s"
msgstr ""
-#: cp/decl.c:5548
+#: cp/decl.c:5472
msgid "%qD declared as an %<inline%> %s"
msgstr ""
-#: cp/decl.c:5550
+#: cp/decl.c:5474
msgid ""
"%<const%> and %<volatile%> function specifiers on %qD invalid in %s "
"declaration"
msgstr ""
-#: cp/decl.c:5554
+#: cp/decl.c:5478
msgid "%qD declared as a friend"
msgstr ""
-#: cp/decl.c:5560
+#: cp/decl.c:5484
msgid "%qD declared with an exception specification"
msgstr ""
-#: cp/decl.c:5643
+#: cp/decl.c:5570
msgid "cannot declare %<::main%> to be a template"
msgstr ""
-#: cp/decl.c:5645
+#: cp/decl.c:5572
msgid "cannot declare %<::main%> to be inline"
msgstr ""
-#: cp/decl.c:5647
+#: cp/decl.c:5574
msgid "cannot declare %<::main%> to be static"
msgstr ""
-#: cp/decl.c:5651
+#: cp/decl.c:5578
msgid "%<::main%> must return %<int%>"
msgstr ""
-#: cp/decl.c:5681
+#: cp/decl.c:5608
msgid "non-local function %q#D uses anonymous type"
msgstr ""
-#: cp/decl.c:5684 cp/decl.c:6029
+#: cp/decl.c:5611 cp/decl.c:5947
msgid ""
"%q#D does not refer to the unqualified type, so it is not used for linkage"
msgstr ""
-#: cp/decl.c:5690
+#: cp/decl.c:5617
msgid "non-local function %q#D uses local type %qT"
msgstr ""
-#: cp/decl.c:5713
+#: cp/decl.c:5640
msgid "%smember function %qD cannot have cv-qualifier"
msgstr ""
-#: cp/decl.c:5737
+#: cp/decl.c:5664
msgid "defining explicit specialization %qD in friend declaration"
msgstr ""
#. Something like `template <class T> friend void f<T>()'.
-#: cp/decl.c:5747
+#: cp/decl.c:5674
msgid "invalid use of template-id %qD in declaration of primary template"
msgstr ""
-#: cp/decl.c:5775
+#: cp/decl.c:5702
msgid ""
"default arguments are not allowed in declaration of friend template "
"specialization %qD"
msgstr ""
-#: cp/decl.c:5783
+#: cp/decl.c:5710
msgid ""
"%<inline%> is not allowed in declaration of friend template specialization %"
"qD"
msgstr ""
-#: cp/decl.c:5850
+#: cp/decl.c:5776
msgid "definition of implicitly-declared %qD"
msgstr ""
-#: cp/decl.c:5870 cp/decl2.c:715
+#: cp/decl.c:5796 cp/decl2.c:712
msgid "no %q#D member function declared in class %qT"
msgstr ""
-#. It's a typedef referring to an anonymous type.
-#: cp/decl.c:6026
+#. DRs 132, 319 and 389 seem to indicate types with
+#. no linkage can only be used to declare extern "C"
+#. entities. Since it's not always an error in the
+#. ISO C++ 90 Standard, we only issue a warning.
+#: cp/decl.c:5944
msgid "non-local variable %q#D uses anonymous type"
msgstr ""
-#: cp/decl.c:6035
+#: cp/decl.c:5953
msgid "non-local variable %q#D uses local type %qT"
msgstr ""
-#: cp/decl.c:6150
+#: cp/decl.c:6070
msgid ""
"invalid in-class initialization of static data member of non-integral type %"
"qT"
msgstr ""
-#: cp/decl.c:6160
+#: cp/decl.c:6080
msgid "ISO C++ forbids in-class initialization of non-const static member %qD"
msgstr ""
-#: cp/decl.c:6164
+#: cp/decl.c:6084
msgid ""
"ISO C++ forbids initialization of member constant %qD of non-integral type %"
"qT"
msgstr ""
-#: cp/decl.c:6184
+#: cp/decl.c:6104
msgid "size of array %qD has non-integral type %qT"
msgstr ""
-#: cp/decl.c:6186
+#: cp/decl.c:6106
msgid "size of array has non-integral type %qT"
msgstr ""
-#: cp/decl.c:6222
+#: cp/decl.c:6142
msgid "size of array %qD is negative"
msgstr ""
-#: cp/decl.c:6224
+#: cp/decl.c:6144
msgid "size of array is negative"
msgstr ""
-#: cp/decl.c:6232
+#: cp/decl.c:6152
msgid "ISO C++ forbids zero-size array %qD"
msgstr ""
-#: cp/decl.c:6234
+#: cp/decl.c:6154
msgid "ISO C++ forbids zero-size array"
msgstr ""
-#: cp/decl.c:6241
+#: cp/decl.c:6161
msgid "size of array %qD is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:6244
+#: cp/decl.c:6164
msgid "size of array is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:6249
+#: cp/decl.c:6169
msgid "ISO C++ forbids variable-size array %qD"
msgstr ""
-#: cp/decl.c:6251
+#: cp/decl.c:6171
msgid "ISO C++ forbids variable-size array"
msgstr ""
-#: cp/decl.c:6281
+#: cp/decl.c:6201
msgid "overflow in array dimension"
msgstr ""
-#: cp/decl.c:6356
+#: cp/decl.c:6275
msgid "declaration of %qD as %s"
msgstr ""
-#: cp/decl.c:6358
+#: cp/decl.c:6277
#, c-format
msgid "creating %s"
msgstr ""
-#: cp/decl.c:6370
+#: cp/decl.c:6289
msgid ""
"declaration of %qD as multidimensional array must have bounds for all "
"dimensions except the first"
msgstr ""
-#: cp/decl.c:6374
+#: cp/decl.c:6293
msgid ""
"multidimensional array must have bounds for all dimensions except the first"
msgstr ""
-#: cp/decl.c:6409
+#: cp/decl.c:6328
msgid "return type specification for constructor invalid"
msgstr ""
-#: cp/decl.c:6419
+#: cp/decl.c:6338
msgid "return type specification for destructor invalid"
msgstr ""
-#: cp/decl.c:6432
+#: cp/decl.c:6351
msgid "operator %qT declared to return %qT"
msgstr ""
-#: cp/decl.c:6434
+#: cp/decl.c:6353
msgid "return type specified for %<operator %T%>"
msgstr ""
-#: cp/decl.c:6456
+#: cp/decl.c:6375
msgid "unnamed variable or field declared void"
msgstr ""
-#: cp/decl.c:6460
+#: cp/decl.c:6379
#, c-format
msgid "variable or field %qE declared void"
msgstr ""
-#: cp/decl.c:6463
+#: cp/decl.c:6382
msgid "variable or field declared void"
msgstr ""
-#: cp/decl.c:6629
+#: cp/decl.c:6537
msgid "type %qT is not derived from type %qT"
msgstr ""
-#: cp/decl.c:6674
-msgid "declarator-id missing; using reserved word %qD"
+#: cp/decl.c:6557 cp/decl.c:6649 cp/decl.c:7792
+msgid "declaration of %qD as non-function"
msgstr ""
-#: cp/decl.c:6730 cp/decl.c:7824
-msgid "declaration of %qD as non-function"
+#: cp/decl.c:6563
+msgid "declaration of %qD as non-member"
msgstr ""
-#: cp/decl.c:6763
+#: cp/decl.c:6593
+msgid "declarator-id missing; using reserved word %qD"
+msgstr ""
+
+#: cp/decl.c:6682
#, c-format
msgid "two or more data types in declaration of %qs"
msgstr ""
-#: cp/decl.c:6806
+#: cp/decl.c:6725
msgid "ISO C++ does not support %<long long%>"
msgstr ""
-#: cp/decl.c:6866 cp/decl.c:6868
+#: cp/decl.c:6785 cp/decl.c:6787
#, c-format
msgid "ISO C++ forbids declaration of %qs with no type"
msgstr ""
-#: cp/decl.c:6893
+#: cp/decl.c:6812
#, c-format
msgid "short, signed or unsigned invalid for %qs"
msgstr ""
-#: cp/decl.c:6895
+#: cp/decl.c:6814
#, c-format
msgid "long, short, signed or unsigned invalid for %qs"
msgstr ""
-#: cp/decl.c:6897
+#: cp/decl.c:6816
#, c-format
msgid "long and short specified together for %qs"
msgstr ""
-#: cp/decl.c:6899
+#: cp/decl.c:6818
#, c-format
msgid "long or short specified with char for %qs"
msgstr ""
-#: cp/decl.c:6901
+#: cp/decl.c:6820
#, c-format
msgid "long or short specified with floating type for %qs"
msgstr ""
-#: cp/decl.c:6903
+#: cp/decl.c:6822
#, c-format
msgid "signed and unsigned given together for %qs"
msgstr ""
-#: cp/decl.c:6909
+#: cp/decl.c:6828
#, c-format
msgid "long, short, signed or unsigned used invalidly for %qs"
msgstr ""
-#: cp/decl.c:6974
+#: cp/decl.c:6893
#, c-format
msgid "complex invalid for %qs"
msgstr ""
-#: cp/decl.c:7003
+#: cp/decl.c:6922
msgid "qualifiers are not allowed on declaration of %<operator %T%>"
msgstr ""
-#: cp/decl.c:7024
+#: cp/decl.c:6934 cp/typeck.c:6404
+msgid "ignoring %qV qualifiers added to function type %qT"
+msgstr ""
+
+#: cp/decl.c:6957
msgid "member %qD cannot be declared both virtual and static"
msgstr ""
-#: cp/decl.c:7031
+#: cp/decl.c:6964
msgid "%<%T::%D%> is not a valid declarator"
msgstr ""
-#: cp/decl.c:7039
+#: cp/decl.c:6972
msgid "typedef declaration invalid in parameter declaration"
msgstr ""
-#: cp/decl.c:7043
+#: cp/decl.c:6976
msgid "storage class specifiers invalid in parameter declarations"
msgstr ""
-#: cp/decl.c:7050
+#: cp/decl.c:6983
msgid "virtual outside class declaration"
msgstr ""
-#: cp/decl.c:7063 cp/decl.c:7070
+#: cp/decl.c:6996 cp/decl.c:7003
#, c-format
msgid "multiple storage classes in declaration of %qs"
msgstr ""
-#: cp/decl.c:7113
+#: cp/decl.c:7046
#, c-format
msgid "storage class specified for %s %qs"
msgstr ""
-#: cp/decl.c:7150
+#: cp/decl.c:7083
msgid "top-level declaration of %qs specifies %<auto%>"
msgstr ""
-#: cp/decl.c:7162
+#: cp/decl.c:7095
msgid "storage class specifiers invalid in friend function declarations"
msgstr ""
-#: cp/decl.c:7289
+#: cp/decl.c:7220
msgid "destructor cannot be static member function"
msgstr ""
-#: cp/decl.c:7292
+#: cp/decl.c:7223
msgid "destructors may not be cv-qualified"
msgstr ""
-#: cp/decl.c:7312
+#: cp/decl.c:7243
msgid "constructor cannot be static member function"
msgstr ""
-#: cp/decl.c:7315
+#: cp/decl.c:7246
msgid "constructors cannot be declared virtual"
msgstr ""
-#: cp/decl.c:7320
+#: cp/decl.c:7251
msgid "constructors may not be cv-qualified"
msgstr ""
-#: cp/decl.c:7340
+#: cp/decl.c:7271
#, c-format
msgid "can't initialize friend function %qs"
msgstr ""
#. Cannot be both friend and virtual.
-#: cp/decl.c:7344
+#: cp/decl.c:7275
msgid "virtual functions cannot be friends"
msgstr ""
-#: cp/decl.c:7348
+#: cp/decl.c:7279
msgid "friend declaration not in class definition"
msgstr ""
-#: cp/decl.c:7350
+#: cp/decl.c:7281
#, c-format
msgid "can't define friend function %qs in a local class definition"
msgstr ""
-#: cp/decl.c:7363
+#: cp/decl.c:7294
msgid "destructors may not have parameters"
msgstr ""
-#: cp/decl.c:7381 cp/decl.c:7388
+#: cp/decl.c:7313 cp/decl.c:7320
msgid "cannot declare reference to %q#T"
msgstr ""
-#: cp/decl.c:7382
+#: cp/decl.c:7314
msgid "cannot declare pointer to %q#T"
msgstr ""
-#: cp/decl.c:7390
+#: cp/decl.c:7322
msgid "cannot declare pointer to %q#T member"
msgstr ""
-#: cp/decl.c:7446
+#: cp/decl.c:7361
+msgid "%qD is a namespace"
+msgstr ""
+
+#: cp/decl.c:7400
msgid "template-id %qD used as a declarator"
msgstr ""
-#: cp/decl.c:7497
+#: cp/decl.c:7447
msgid "extra qualification %<%T::%> on member %qs ignored"
msgstr ""
-#: cp/decl.c:7516
+#: cp/decl.c:7466
msgid "cannot declare member function %<%T::%s%> within %<%T%>"
msgstr ""
-#: cp/decl.c:7531
+#: cp/decl.c:7481
msgid "cannot declare member %<%T::%s%> within %qT"
msgstr ""
-#: cp/decl.c:7570
+#: cp/decl.c:7520
msgid "data member may not have variably modified type %qT"
msgstr ""
-#: cp/decl.c:7572
+#: cp/decl.c:7522
msgid "parameter may not have variably modified type %qT"
msgstr ""
#. [dcl.fct.spec] The explicit specifier shall only be used in
#. declarations of constructors within a class definition.
-#: cp/decl.c:7580
+#: cp/decl.c:7530
msgid "only declarations of constructors can be %<explicit%>"
msgstr ""
-#: cp/decl.c:7588
+#: cp/decl.c:7538
msgid "non-member %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:7593
+#: cp/decl.c:7543
msgid "non-object member %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:7599
+#: cp/decl.c:7549
msgid "function %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:7604
+#: cp/decl.c:7554
msgid "static %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:7609
+#: cp/decl.c:7559
msgid "const %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:7627
-msgid "ISO C++ forbids nested type %qD with same name as enclosing class"
+#: cp/decl.c:7579
+msgid "%Jtypedef name may not be a nested-name-specifier"
msgstr ""
-#: cp/decl.c:7636
-msgid "%Jtypedef name may not be a nested-name-specifier"
+#: cp/decl.c:7595
+msgid "ISO C++ forbids nested type %qD with same name as enclosing class"
msgstr ""
-#: cp/decl.c:7689
-msgid "%Jinvalid type qualifier for non-member function type"
+#: cp/decl.c:7694
+#, c-format
+msgid "qualified function types cannot be used to declare %s functions"
msgstr ""
-#: cp/decl.c:7752
+#: cp/decl.c:7720
msgid "type qualifiers specified for friend class declaration"
msgstr ""
-#: cp/decl.c:7757
+#: cp/decl.c:7725
msgid "%<inline%> specified for friend class declaration"
msgstr ""
-#: cp/decl.c:7765
+#: cp/decl.c:7733
msgid "template parameters cannot be friends"
msgstr ""
-#: cp/decl.c:7767
+#: cp/decl.c:7735
msgid "friend declaration requires class-key, i.e. %<friend class %T::%D%>"
msgstr ""
-#: cp/decl.c:7771
+#: cp/decl.c:7739
msgid "friend declaration requires class-key, i.e. %<friend %#T%>"
msgstr ""
-#: cp/decl.c:7784
+#: cp/decl.c:7752
msgid "trying to make class %qT a friend of global scope"
msgstr ""
-#: cp/decl.c:7795
+#: cp/decl.c:7763
msgid "invalid qualifiers on non-member function type"
msgstr ""
-#: cp/decl.c:7814
+#: cp/decl.c:7782
msgid "abstract declarator %qT used as declaration"
msgstr ""
-#: cp/decl.c:7839
+#: cp/decl.c:7807
msgid "cannot use %<::%> in parameter declaration"
msgstr ""
#. Something like struct S { int N::j; };
-#: cp/decl.c:7884
+#: cp/decl.c:7852
msgid "invalid use of %<::%>"
msgstr ""
-#: cp/decl.c:7896
-msgid "function %qD cannot be declared friend"
-msgstr ""
-
-#: cp/decl.c:7908
+#: cp/decl.c:7867
msgid "can't make %qD into a method -- not in a class"
msgstr ""
-#: cp/decl.c:7917
+#: cp/decl.c:7876
msgid "function %qD declared virtual inside a union"
msgstr ""
-#: cp/decl.c:7926
+#: cp/decl.c:7885
msgid "%qD cannot be declared virtual, since it is always static"
msgstr ""
-#: cp/decl.c:8006
+#: cp/decl.c:7903
+msgid "declaration of %qD as member of %qT"
+msgstr ""
+
+#: cp/decl.c:7979
msgid "field %qD has incomplete type"
msgstr ""
-#: cp/decl.c:8008
+#: cp/decl.c:7981
msgid "name %qT has incomplete type"
msgstr ""
-#: cp/decl.c:8017
+#: cp/decl.c:7990
msgid " in instantiation of template %qT"
msgstr ""
-#: cp/decl.c:8027
+#: cp/decl.c:8000
#, c-format
msgid "%qE is neither function nor member function; cannot be declared friend"
msgstr ""
-#: cp/decl.c:8038
+#: cp/decl.c:8011
msgid "member functions are implicitly friends of their class"
msgstr ""
@@ -14532,81 +14717,81 @@ msgstr ""
#. the rest of the compiler does not correctly
#. handle the initialization unless the member is
#. static so we make it static below.
-#: cp/decl.c:8078
+#: cp/decl.c:8051
msgid "ISO C++ forbids initialization of member %qD"
msgstr ""
-#: cp/decl.c:8080
+#: cp/decl.c:8053
msgid "making %qD static"
msgstr ""
-#: cp/decl.c:8138
+#: cp/decl.c:8111
msgid "storage class %<auto%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:8140
+#: cp/decl.c:8113
msgid "storage class %<register%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:8142
+#: cp/decl.c:8115
msgid "storage class %<__thread%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:8153
+#: cp/decl.c:8126
msgid ""
"%<static%> specified invalid for function %qs declared out of global scope"
msgstr ""
-#: cp/decl.c:8156
+#: cp/decl.c:8129
msgid ""
"%<inline%> specifier invalid for function %qs declared out of global scope"
msgstr ""
-#: cp/decl.c:8164
+#: cp/decl.c:8137
#, c-format
msgid "virtual non-class function %qs"
msgstr ""
-#: cp/decl.c:8195
+#: cp/decl.c:8168
msgid "cannot declare member function %qD to have static linkage"
msgstr ""
#. FIXME need arm citation
-#: cp/decl.c:8202
+#: cp/decl.c:8175
msgid "cannot declare static function inside another function"
msgstr ""
-#: cp/decl.c:8231
+#: cp/decl.c:8204
msgid ""
"%<static%> may not be used when defining (as opposed to declaring) a static "
"data member"
msgstr ""
-#: cp/decl.c:8238
+#: cp/decl.c:8211
msgid "static member %qD declared %<register%>"
msgstr ""
-#: cp/decl.c:8243
+#: cp/decl.c:8216
msgid "cannot explicitly declare member %q#D to have extern linkage"
msgstr ""
-#: cp/decl.c:8386
+#: cp/decl.c:8359
msgid "default argument for %q#D has type %qT"
msgstr ""
-#: cp/decl.c:8389
+#: cp/decl.c:8362
msgid "default argument for parameter of type %qT has type %qT"
msgstr ""
-#: cp/decl.c:8406
+#: cp/decl.c:8379
msgid "default argument %qE uses local variable %qD"
msgstr ""
-#: cp/decl.c:8474
+#: cp/decl.c:8447
msgid "parameter %qD invalidly declared method type"
msgstr ""
-#: cp/decl.c:8498
+#: cp/decl.c:8471
msgid "parameter %qD includes %s to array of unknown bound %qT"
msgstr ""
@@ -14625,110 +14810,110 @@ msgstr ""
#. or implicitly defined), there's no need to worry about their
#. existence. Theoretically, they should never even be
#. instantiated, but that's hard to forestall.
-#: cp/decl.c:8657
+#: cp/decl.c:8630
msgid "invalid constructor; you probably meant %<%T (const %T&)%>"
msgstr ""
-#: cp/decl.c:8781
+#: cp/decl.c:8754
msgid "%qD may not be declared within a namespace"
msgstr ""
-#: cp/decl.c:8783
+#: cp/decl.c:8756
msgid "%qD may not be declared as static"
msgstr ""
-#: cp/decl.c:8803
+#: cp/decl.c:8776
msgid "%qD must be a nonstatic member function"
msgstr ""
-#: cp/decl.c:8809
+#: cp/decl.c:8782
msgid ""
"%qD must be either a non-static member function or a non-member function"
msgstr ""
-#: cp/decl.c:8827
+#: cp/decl.c:8800
msgid "%qD must have an argument of class or enumerated type"
msgstr ""
-#: cp/decl.c:8862
+#: cp/decl.c:8835
#, c-format
msgid "conversion to %s%s will never use a type conversion operator"
msgstr ""
#. 13.4.0.3
-#: cp/decl.c:8870
+#: cp/decl.c:8843
msgid "ISO C++ prohibits overloading operator ?:"
msgstr ""
-#: cp/decl.c:8920
+#: cp/decl.c:8893
msgid "postfix %qD must take %<int%> as its argument"
msgstr ""
-#: cp/decl.c:8924
+#: cp/decl.c:8897
msgid "postfix %qD must take %<int%> as its second argument"
msgstr ""
-#: cp/decl.c:8931
+#: cp/decl.c:8904
msgid "%qD must take either zero or one argument"
msgstr ""
-#: cp/decl.c:8933
+#: cp/decl.c:8906
msgid "%qD must take either one or two arguments"
msgstr ""
-#: cp/decl.c:8954
+#: cp/decl.c:8927
msgid "prefix %qD should return %qT"
msgstr ""
-#: cp/decl.c:8960
+#: cp/decl.c:8933
msgid "postfix %qD should return %qT"
msgstr ""
-#: cp/decl.c:8969
+#: cp/decl.c:8942
msgid "%qD must take %<void%>"
msgstr ""
-#: cp/decl.c:8971 cp/decl.c:8979
+#: cp/decl.c:8944 cp/decl.c:8952
msgid "%qD must take exactly one argument"
msgstr ""
-#: cp/decl.c:8981
+#: cp/decl.c:8954
msgid "%qD must take exactly two arguments"
msgstr ""
-#: cp/decl.c:8989
+#: cp/decl.c:8962
msgid "user-defined %qD always evaluates both arguments"
msgstr ""
-#: cp/decl.c:9003
+#: cp/decl.c:8976
msgid "%qD should return by value"
msgstr ""
-#: cp/decl.c:9015 cp/decl.c:9018
+#: cp/decl.c:8988 cp/decl.c:8991
msgid "%qD cannot have default arguments"
msgstr ""
-#: cp/decl.c:9072
+#: cp/decl.c:9049
msgid "using template type parameter %qT after %qs"
msgstr ""
-#: cp/decl.c:9086
+#: cp/decl.c:9064
msgid "using typedef-name %qD after %qs"
msgstr ""
-#: cp/decl.c:9087
+#: cp/decl.c:9065
msgid "%qD has a previous declaration here"
msgstr ""
-#: cp/decl.c:9094
+#: cp/decl.c:9073
msgid "%qT referred to as %qs"
msgstr ""
-#: cp/decl.c:9095 cp/decl.c:9102
+#: cp/decl.c:9074 cp/decl.c:9082
msgid "%qT has a previous declaration here"
msgstr ""
-#: cp/decl.c:9101
+#: cp/decl.c:9081
msgid "%qT referred to as enum"
msgstr ""
@@ -14739,47 +14924,51 @@ msgstr ""
#. void f(class C); // No template header here
#.
#. then the required template argument is missing.
-#: cp/decl.c:9117
+#: cp/decl.c:9097
msgid "template argument required for %<%s %T%>"
msgstr ""
-#: cp/decl.c:9279
+#: cp/decl.c:9133 cp/name-lookup.c:2595
+msgid "%qD has the same name as the class in which it is declared"
+msgstr ""
+
+#: cp/decl.c:9271
msgid "use of enum %q#D without previous declaration"
msgstr ""
-#: cp/decl.c:9298
+#: cp/decl.c:9290
msgid "redeclaration of %qT as a non-template"
msgstr ""
-#: cp/decl.c:9391
+#: cp/decl.c:9383
msgid "derived union %qT invalid"
msgstr ""
-#: cp/decl.c:9397
+#: cp/decl.c:9389
msgid "Java class %qT cannot have multiple bases"
msgstr ""
-#: cp/decl.c:9405
+#: cp/decl.c:9397
msgid "Java class %qT cannot have virtual bases"
msgstr ""
-#: cp/decl.c:9424
+#: cp/decl.c:9416
msgid "base type %qT fails to be a struct or class type"
msgstr ""
-#: cp/decl.c:9457
+#: cp/decl.c:9449
msgid "recursive type %qT undefined"
msgstr ""
-#: cp/decl.c:9459
+#: cp/decl.c:9451
msgid "duplicate base type %qT invalid"
msgstr ""
-#: cp/decl.c:9529
+#: cp/decl.c:9521
msgid "multiple definition of %q#T"
msgstr ""
-#: cp/decl.c:9530
+#: cp/decl.c:9522
msgid "%Jprevious definition here"
msgstr ""
@@ -14787,237 +14976,233 @@ msgstr ""
#.
#. IF no integral type can represent all the enumerator values, the
#. enumeration is ill-formed.
-#: cp/decl.c:9667
+#: cp/decl.c:9659
msgid "no integral type can represent all of the enumerator values for %qT"
msgstr ""
-#: cp/decl.c:9768
+#: cp/decl.c:9765
msgid "enumerator value for %qD not integer constant"
msgstr ""
-#: cp/decl.c:9795
+#: cp/decl.c:9792
msgid "overflow in enumeration values at %qD"
msgstr ""
-#: cp/decl.c:9866
+#: cp/decl.c:9863
msgid "return type %q#T is incomplete"
msgstr ""
-#: cp/decl.c:9981 cp/typeck.c:6274
+#: cp/decl.c:9978 cp/typeck.c:6163
msgid "%<operator=%> should return a reference to %<*this%>"
msgstr ""
-#: cp/decl.c:10304
+#: cp/decl.c:10301
msgid "parameter %qD declared void"
msgstr ""
-#: cp/decl.c:10786
+#: cp/decl.c:10790
msgid "invalid member function declaration"
msgstr ""
-#: cp/decl.c:10801
+#: cp/decl.c:10805
msgid "%qD is already defined in class %qT"
msgstr ""
-#: cp/decl.c:11012
+#: cp/decl.c:11015
msgid "static member function %q#D declared with type qualifiers"
msgstr ""
-#: cp/decl2.c:280
+#: cp/decl2.c:279
msgid "name missing for member function"
msgstr ""
-#: cp/decl2.c:373 cp/decl2.c:387
+#: cp/decl2.c:372 cp/decl2.c:386
msgid "ambiguous conversion for array subscript"
msgstr ""
-#: cp/decl2.c:381
+#: cp/decl2.c:380
msgid "invalid types %<%T[%T]%> for array subscript"
msgstr ""
-#: cp/decl2.c:426
+#: cp/decl2.c:423
msgid "deleting array %q#D"
msgstr ""
-#: cp/decl2.c:432
+#: cp/decl2.c:429
msgid "type %q#T argument given to %<delete%>, expected pointer"
msgstr ""
-#: cp/decl2.c:444
+#: cp/decl2.c:441
msgid ""
"cannot delete a function. Only pointer-to-objects are valid arguments to %"
"<delete%>"
msgstr ""
-#: cp/decl2.c:452
+#: cp/decl2.c:449
msgid "deleting %qT is undefined"
msgstr ""
#. 14.5.2.2 [temp.mem]
#.
#. A local class shall not have member templates.
-#: cp/decl2.c:488
+#: cp/decl2.c:485
msgid "invalid declaration of member template %q#D in local class"
msgstr ""
-#: cp/decl2.c:497
+#: cp/decl2.c:494
msgid "invalid use of %<virtual%> in template declaration of %q#D"
msgstr ""
-#: cp/decl2.c:507 cp/pt.c:2990
+#: cp/decl2.c:504 cp/pt.c:2965
msgid "template declaration of %q#D"
msgstr ""
-#: cp/decl2.c:556
+#: cp/decl2.c:553
msgid "Java method %qD has non-Java return type %qT"
msgstr ""
-#: cp/decl2.c:572
+#: cp/decl2.c:569
msgid "Java method %qD has non-Java parameter type %qT"
msgstr ""
-#: cp/decl2.c:677
+#: cp/decl2.c:674
msgid "prototype for %q#D does not match any in class %qT"
msgstr ""
-#: cp/decl2.c:778
+#: cp/decl2.c:775
msgid "local class %q#T shall not have static data member %q#D"
msgstr ""
-#: cp/decl2.c:786
+#: cp/decl2.c:783
msgid "initializer invalid for static member with constructor"
msgstr ""
-#: cp/decl2.c:789
+#: cp/decl2.c:786
msgid "(an out of class initialization is required)"
msgstr ""
-#: cp/decl2.c:870
+#: cp/decl2.c:867
msgid "member %qD conflicts with virtual function table field name"
msgstr ""
-#: cp/decl2.c:890
+#: cp/decl2.c:886
+msgid "applying attributes to template parameters is not implemented"
+msgstr ""
+
+#: cp/decl2.c:896
msgid "%qD is already defined in %qT"
msgstr ""
-#: cp/decl2.c:936
+#: cp/decl2.c:944
msgid "field initializer is not constant"
msgstr ""
-#: cp/decl2.c:964
+#: cp/decl2.c:972
msgid "%<asm%> specifiers are not permitted on non-static data members"
msgstr ""
-#: cp/decl2.c:1010
+#: cp/decl2.c:1018
msgid "cannot declare %qD to be a bit-field type"
msgstr ""
-#: cp/decl2.c:1020
+#: cp/decl2.c:1028
msgid "cannot declare bit-field %qD with function type"
msgstr ""
-#: cp/decl2.c:1027
+#: cp/decl2.c:1035
msgid "%qD is already defined in the class %qT"
msgstr ""
-#: cp/decl2.c:1034
+#: cp/decl2.c:1042
msgid "static member %qD cannot be a bit-field"
msgstr ""
-#: cp/decl2.c:1093
-msgid "initializer specified for non-member function %qD"
-msgstr ""
-
-#: cp/decl2.c:1097
-msgid "invalid initializer for virtual method %qD"
-msgstr ""
-
-#: cp/decl2.c:1129
+#: cp/decl2.c:1087
msgid "anonymous struct not inside named type"
msgstr ""
-#: cp/decl2.c:1206
+#: cp/decl2.c:1164
msgid "namespace-scope anonymous aggregates must be static"
msgstr ""
-#: cp/decl2.c:1213
+#: cp/decl2.c:1171
msgid "anonymous union with no members"
msgstr ""
-#: cp/decl2.c:1249
+#: cp/decl2.c:1207
msgid "%<operator new%> must return type %qT"
msgstr ""
-#: cp/decl2.c:1258
+#: cp/decl2.c:1216
msgid "%<operator new%> takes type %<size_t%> (%qT) as first parameter"
msgstr ""
-#: cp/decl2.c:1287
+#: cp/decl2.c:1245
msgid "%<operator delete%> must return type %qT"
msgstr ""
-#: cp/decl2.c:1296
+#: cp/decl2.c:1254
msgid "%<operator delete%> takes type %qT as first parameter"
msgstr ""
-#: cp/decl2.c:3033
+#: cp/decl2.c:2992
msgid "inline function %qD used but never defined"
msgstr ""
-#: cp/decl2.c:3178
+#: cp/decl2.c:3140
msgid "default argument missing for parameter %P of %q+#D"
msgstr ""
#. damn ICE suppression
-#: cp/error.c:2365
+#: cp/error.c:2371
#, c-format
msgid "unexpected letter %qc in locate_error\n"
msgstr ""
#. Can't throw a reference.
-#: cp/except.c:239
+#: cp/except.c:262
msgid "type %qT is disallowed in Java %<throw%> or %<catch%>"
msgstr ""
-#: cp/except.c:250
+#: cp/except.c:273
msgid "call to Java %<catch%> or %<throw%> with %<jthrowable%> undefined"
msgstr ""
#. Thrown object must be a Throwable.
-#: cp/except.c:257
+#: cp/except.c:280
msgid "type %qT is not derived from %<java::lang::Throwable%>"
msgstr ""
-#: cp/except.c:320
+#: cp/except.c:343
msgid "mixing C++ and Java catches in a single translation unit"
msgstr ""
-#: cp/except.c:576
+#: cp/except.c:602
msgid "throwing NULL, which has integral, not pointer type"
msgstr ""
-#: cp/except.c:599 cp/init.c:1872
+#: cp/except.c:625 cp/init.c:1893
msgid "%qD should never be overloaded"
msgstr ""
-#: cp/except.c:666
+#: cp/except.c:692
msgid " in thrown expression"
msgstr ""
-#: cp/except.c:810
+#: cp/except.c:836
msgid ""
"expression %qE of abstract class type %qT cannot be used in throw-expression"
msgstr ""
-#: cp/except.c:895
+#: cp/except.c:921
msgid "%Hexception of type %qT will be caught"
msgstr ""
-#: cp/except.c:897
+#: cp/except.c:923
msgid "%H by earlier handler for %qT"
msgstr ""
-#: cp/except.c:927
+#: cp/except.c:953
msgid "%H%<...%> handler must be the last handler for its try block"
msgstr ""
@@ -15094,184 +15279,192 @@ msgstr ""
msgid "argument to '%s' missing\n"
msgstr ""
-#: cp/init.c:316
+#: cp/init.c:326
msgid "%J%qD should be initialized in the member initialization list"
msgstr ""
-#: cp/init.c:363
+#: cp/init.c:373
msgid "%Jdefault-initialization of %q#D, which has reference type"
msgstr ""
-#: cp/init.c:369
+#: cp/init.c:379
msgid "%Juninitialized reference member %qD"
msgstr ""
-#: cp/init.c:372
+#: cp/init.c:382
msgid "%Juninitialized member %qD with %<const%> type %qT"
msgstr ""
-#: cp/init.c:515
+#: cp/init.c:525
msgid "%qD will be initialized after"
msgstr ""
-#: cp/init.c:518
+#: cp/init.c:528
msgid "base %qT will be initialized after"
msgstr ""
-#: cp/init.c:521
+#: cp/init.c:531
msgid " %q#D"
msgstr ""
-#: cp/init.c:523
+#: cp/init.c:533
msgid " base %qT"
msgstr ""
-#: cp/init.c:524
+#: cp/init.c:534
msgid "%J when initialized here"
msgstr ""
-#: cp/init.c:540
+#: cp/init.c:550
msgid "%Jmultiple initializations given for %qD"
msgstr ""
-#: cp/init.c:543
+#: cp/init.c:553
msgid "%Jmultiple initializations given for base %qT"
msgstr ""
-#: cp/init.c:610
+#: cp/init.c:620
msgid "%Jinitializations for multiple members of %qT"
msgstr ""
-#: cp/init.c:667
+#: cp/init.c:677
msgid ""
"%Jbase class %q#T should be explicitly initialized in the copy constructor"
msgstr ""
-#: cp/init.c:891 cp/init.c:910
+#: cp/init.c:901 cp/init.c:920
msgid "class %qT does not have any field named %qD"
msgstr ""
-#: cp/init.c:897
+#: cp/init.c:907
msgid ""
"%q#D is a static data member; it can only be initialized at its definition"
msgstr ""
-#: cp/init.c:904
+#: cp/init.c:914
msgid "%q#D is not a non-static data member of %qT"
msgstr ""
-#: cp/init.c:943
+#: cp/init.c:953
msgid "unnamed initializer for %qT, which has no base classes"
msgstr ""
-#: cp/init.c:951
+#: cp/init.c:961
msgid "unnamed initializer for %qT, which uses multiple inheritance"
msgstr ""
-#: cp/init.c:997
+#: cp/init.c:1007
msgid "%qD is both a direct base and an indirect virtual base"
msgstr ""
-#: cp/init.c:1005
+#: cp/init.c:1015
msgid "type %qD is not a direct or virtual base of %qT"
msgstr ""
-#: cp/init.c:1008
+#: cp/init.c:1018
msgid "type %qD is not a direct base of %qT"
msgstr ""
-#: cp/init.c:1088
+#: cp/init.c:1098
msgid "bad array initializer"
msgstr ""
-#: cp/init.c:1287
+#: cp/init.c:1297
msgid "%qT is not an aggregate type"
msgstr ""
-#: cp/init.c:1379
+#: cp/init.c:1389
msgid "qualified type %qT does not match destructor name %<~%T%>"
msgstr ""
-#: cp/init.c:1387
+#: cp/init.c:1397
msgid "incomplete type %qT does not have member %qD"
msgstr ""
-#: cp/init.c:1406
+#: cp/init.c:1416
msgid "%qD is not a member of type %qT"
msgstr ""
-#: cp/init.c:1433
+#: cp/init.c:1443
msgid "invalid pointer to bit-field %qD"
msgstr ""
-#: cp/init.c:1535
+#: cp/init.c:1545
msgid "invalid use of non-static member function %qD"
msgstr ""
-#: cp/init.c:1541 cp/semantics.c:1293
+#: cp/init.c:1551 cp/semantics.c:1321
msgid "invalid use of non-static data member %qD"
msgstr ""
-#: cp/init.c:1641
+#: cp/init.c:1651
+msgid "size in array new must have integral type"
+msgstr ""
+
+#: cp/init.c:1654
+msgid "zero size array reserves no space"
+msgstr ""
+
+#: cp/init.c:1662
msgid "new cannot be applied to a reference type"
msgstr ""
-#: cp/init.c:1647
+#: cp/init.c:1668
msgid "new cannot be applied to a function type"
msgstr ""
-#: cp/init.c:1679
+#: cp/init.c:1700
msgid "call to Java constructor, while %<jclass%> undefined"
msgstr ""
-#: cp/init.c:1695
+#: cp/init.c:1716
msgid "can't find class$"
msgstr ""
-#: cp/init.c:1823
+#: cp/init.c:1844
msgid "invalid type %<void%> for new"
msgstr ""
-#: cp/init.c:1833
+#: cp/init.c:1854
msgid "uninitialized const in %<new%> of %q#T"
msgstr ""
-#: cp/init.c:1867
+#: cp/init.c:1888
#, c-format
msgid "call to Java constructor with %qs undefined"
msgstr ""
-#: cp/init.c:1907
+#: cp/init.c:1928
msgid "request for member %qD is ambiguous"
msgstr ""
-#: cp/init.c:2040
+#: cp/init.c:2061
msgid "ISO C++ forbids initialization in array new"
msgstr ""
-#: cp/init.c:2510
+#: cp/init.c:2531
msgid "initializer ends prematurely"
msgstr ""
-#: cp/init.c:2563
+#: cp/init.c:2584
msgid "cannot initialize multi-dimensional array with initializer"
msgstr ""
-#: cp/init.c:2722
+#: cp/init.c:2741
msgid "possible problem detected in invocation of delete operator:"
msgstr ""
-#: cp/init.c:2725
+#: cp/init.c:2744
msgid ""
"neither the destructor nor the class-specific operator delete will be "
"called, even if they are declared when the class is defined."
msgstr ""
-#: cp/init.c:2746
+#: cp/init.c:2765
msgid "unknown array size in delete"
msgstr ""
-#: cp/init.c:3006
+#: cp/init.c:2998
msgid "type to vector delete is neither pointer or array type"
msgstr ""
@@ -15348,14 +15541,20 @@ msgstr ""
msgid "generic thunk code fails for method %q#D which uses %<...%>"
msgstr ""
-#: cp/method.c:650
+#: cp/method.c:657
msgid "non-static const member %q#D, can't use default assignment operator"
msgstr ""
-#: cp/method.c:656
+#: cp/method.c:663
msgid "non-static reference member %q#D, can't use default assignment operator"
msgstr ""
+#: cp/method.c:1078
+msgid ""
+"vtable layout for class %qT may not be ABI-compliantand may change in a "
+"future version of GCC due to implicit virtual destructor"
+msgstr ""
+
#: cp/name-lookup.c:693
msgid "redeclaration of %<wchar_t%> as %qT"
msgstr ""
@@ -15445,57 +15644,51 @@ msgstr ""
msgid "XXX is_class_level != (current_scope == class_scope)\n"
msgstr ""
-#: cp/name-lookup.c:1859
+#: cp/name-lookup.c:1864
msgid "%q#D hides constructor for %q#T"
msgstr ""
-#: cp/name-lookup.c:1874
+#: cp/name-lookup.c:1879
msgid "%q#D conflicts with previous using declaration %q#D"
msgstr ""
-#: cp/name-lookup.c:1886
+#: cp/name-lookup.c:1891
msgid "previous non-function declaration %q#D"
msgstr ""
-#: cp/name-lookup.c:1887
+#: cp/name-lookup.c:1892
msgid "conflicts with function declaration %q#D"
msgstr ""
#. It's a nested name with template parameter dependent scope.
#. This can only be using-declaration for class member.
-#: cp/name-lookup.c:1965 cp/name-lookup.c:1990 cp/name-lookup.c:3163
+#: cp/name-lookup.c:1970 cp/name-lookup.c:1995 cp/name-lookup.c:3157
msgid "%qT is not a namespace"
msgstr ""
#. 7.3.3/5
#. A using-declaration shall not name a template-id.
-#: cp/name-lookup.c:1975
+#: cp/name-lookup.c:1980
msgid "a using-declaration cannot specify a template-id. Try %<using %D%>"
msgstr ""
-#: cp/name-lookup.c:1982
+#: cp/name-lookup.c:1987
msgid "namespace %qD not allowed in using-declaration"
msgstr ""
-#: cp/name-lookup.c:2018
+#: cp/name-lookup.c:2023
msgid "%qD not declared"
msgstr ""
-#. If the OLD_FN was really declared, the
-#. declarations don't match.
-#: cp/name-lookup.c:2030 cp/name-lookup.c:2072 cp/name-lookup.c:2109
+#: cp/name-lookup.c:2035 cp/name-lookup.c:2080 cp/name-lookup.c:2114
msgid "%qD is already declared in this scope"
msgstr ""
-#: cp/name-lookup.c:2115
+#: cp/name-lookup.c:2120
msgid "using declaration %qD introduced ambiguous type %qT"
msgstr ""
-#: cp/name-lookup.c:2594
-msgid "%qD has the same name as the class in which it is declared"
-msgstr ""
-
-#: cp/name-lookup.c:2689
+#: cp/name-lookup.c:2691
msgid "using-declaration for non-member at class scope"
msgstr ""
@@ -15503,400 +15696,413 @@ msgstr ""
msgid "using-declaration cannot name destructor"
msgstr ""
-#: cp/name-lookup.c:2775
+#: cp/name-lookup.c:2769
msgid "declaration of %qD not in a namespace surrounding %qD"
msgstr ""
-#: cp/name-lookup.c:2783
+#: cp/name-lookup.c:2777
msgid "explicit qualification in declaration of `%D'"
msgstr ""
-#: cp/name-lookup.c:2819
+#: cp/name-lookup.c:2813
msgid "%qD should have been declared inside %qD"
msgstr ""
-#: cp/name-lookup.c:2881
+#: cp/name-lookup.c:2875
msgid "namespace alias %qD not allowed here, assuming %qD"
msgstr ""
#. The parser did not find it, so it's not there.
-#: cp/name-lookup.c:2996
+#: cp/name-lookup.c:2990
msgid "unknown namespace %qD"
msgstr ""
-#: cp/name-lookup.c:3157
+#: cp/name-lookup.c:3151
msgid "namespace %qT undeclared"
msgstr ""
-#: cp/name-lookup.c:3201
+#: cp/name-lookup.c:3195
msgid "strong using only meaningful at namespace scope"
msgstr ""
-#: cp/name-lookup.c:3208
+#: cp/name-lookup.c:3202
msgid "%qD attribute directive ignored"
msgstr ""
-#: cp/name-lookup.c:3342
+#: cp/name-lookup.c:3336
msgid "use of %qD is ambiguous"
msgstr ""
-#: cp/name-lookup.c:3343
+#: cp/name-lookup.c:3337
msgid " first declared as %q#D here"
msgstr ""
-#: cp/name-lookup.c:3345
+#: cp/name-lookup.c:3339
msgid " also declared as %q#D here"
msgstr ""
-#: cp/name-lookup.c:3360
+#: cp/name-lookup.c:3354
msgid "%qD denotes an ambiguous type"
msgstr ""
-#: cp/name-lookup.c:3361
+#: cp/name-lookup.c:3355
msgid "%J first type here"
msgstr ""
-#: cp/name-lookup.c:3362
+#: cp/name-lookup.c:3356
msgid "%J other type here"
msgstr ""
#. This happens for A::B where B is a template, and there are no
#. template arguments.
-#: cp/name-lookup.c:3426 cp/typeck.c:1818
+#: cp/name-lookup.c:3420 cp/parser.c:4365 cp/typeck.c:1786
msgid "invalid use of %qD"
msgstr ""
-#: cp/name-lookup.c:3466
+#: cp/name-lookup.c:3460
msgid "%<%D::%D%> is not a template"
msgstr ""
-#: cp/name-lookup.c:3482
+#: cp/name-lookup.c:3476
msgid "%qD undeclared in namespace %qD"
msgstr ""
-#: cp/name-lookup.c:4108
+#: cp/name-lookup.c:4102
msgid "%qD is not a function,"
msgstr ""
-#: cp/name-lookup.c:4109
+#: cp/name-lookup.c:4103
msgid " conflict with %qD"
msgstr ""
-#: cp/name-lookup.c:4873
+#: cp/name-lookup.c:4868
msgid "XXX entering pop_everything ()\n"
msgstr ""
-#: cp/name-lookup.c:4882
+#: cp/name-lookup.c:4877
msgid "XXX leaving pop_everything ()\n"
msgstr ""
-#: cp/parser.c:1812
+#: cp/parser.c:1807
+msgid "%<#pragma%> is not allowed here"
+msgstr ""
+
+#: cp/parser.c:1836
msgid "%<%D::%D%> has not been declared"
msgstr ""
-#: cp/parser.c:1815 cp/semantics.c:2318
+#: cp/parser.c:1839 cp/semantics.c:2375
msgid "%<::%D%> has not been declared"
msgstr ""
-#: cp/parser.c:1818
+#: cp/parser.c:1842
msgid "request for member %qD in non-class type %qT"
msgstr ""
-#: cp/parser.c:1821
+#: cp/parser.c:1845
msgid "%<%T::%D%> has not been declared"
msgstr ""
-#: cp/parser.c:1824
+#: cp/parser.c:1848
msgid "%qD has not been declared"
msgstr ""
-#: cp/parser.c:1827
+#: cp/parser.c:1851
msgid "%<%D::%D%> %s"
msgstr ""
-#: cp/parser.c:1829
+#: cp/parser.c:1853
msgid "%<::%D%> %s"
msgstr ""
-#: cp/parser.c:1831
+#: cp/parser.c:1855
msgid "%qD %s"
msgstr ""
-#: cp/parser.c:1884
+#: cp/parser.c:1907
msgid "new types may not be defined in a return type"
msgstr ""
-#: cp/parser.c:1901 cp/pt.c:4364
+#: cp/parser.c:1908
+msgid "(perhaps a semicolon is missing after the definition of %qT)"
+msgstr ""
+
+#: cp/parser.c:1927 cp/pt.c:4328
msgid "%qT is not a template"
msgstr ""
-#: cp/parser.c:1903
+#: cp/parser.c:1929
#, c-format
msgid "%qE is not a template"
msgstr ""
-#: cp/parser.c:1905
+#: cp/parser.c:1931
msgid "invalid template-id"
msgstr ""
-#: cp/parser.c:1933
+#: cp/parser.c:1960
#, c-format
msgid "%s cannot appear in a constant-expression"
msgstr ""
-#: cp/parser.c:1957
+#: cp/parser.c:1985
#, c-format
msgid "invalid use of template-name %qE without an argument list"
msgstr ""
#. Issue an error message.
-#: cp/parser.c:1962
+#: cp/parser.c:1990
#, c-format
msgid "%qE does not name a type"
msgstr ""
-#: cp/parser.c:1993
+#: cp/parser.c:2021
msgid "(perhaps %<typename %T::%E%> was intended)"
msgstr ""
-#: cp/parser.c:2008
+#: cp/parser.c:2036
#, c-format
msgid "%qE in namespace %qE does not name a type"
msgstr ""
-#: cp/parser.c:2011
+#: cp/parser.c:2039
msgid "%qE in class %qT does not name a type"
msgstr ""
-#: cp/parser.c:2678
+#: cp/parser.c:2748
msgid "ISO C++ forbids braced-groups within expressions"
msgstr ""
-#: cp/parser.c:2687
+#: cp/parser.c:2757
msgid "statement-expressions are allowed only inside functions"
msgstr ""
-#: cp/parser.c:2738
+#: cp/parser.c:2808
msgid "%<this%> may not be used in this context"
msgstr ""
-#: cp/parser.c:2873
+#: cp/parser.c:2944
msgid "local variable %qD may not appear in this context"
msgstr ""
-#: cp/parser.c:3238
+#: cp/parser.c:3316
msgid "typedef-name %qD used as destructor declarator"
msgstr ""
-#: cp/parser.c:3886
+#: cp/parser.c:3965
msgid "ISO C++ forbids compound-literals"
msgstr ""
-#: cp/parser.c:4786
+#: cp/parser.c:4885
msgid "array bound forbidden after parenthesized type-id"
msgstr ""
-#: cp/parser.c:4787
+#: cp/parser.c:4886
msgid "try removing the parentheses around the type-id"
msgstr ""
-#: cp/parser.c:4893
-msgid "size in array new must have integral type"
-msgstr ""
-
-#: cp/parser.c:4896
-msgid "zero size array reserves no space"
-msgstr ""
-
-#: cp/parser.c:4995
+#: cp/parser.c:5087
msgid "expression in new-declarator must have integral or enumeration type"
msgstr ""
-#: cp/parser.c:5177
+#: cp/parser.c:5276
msgid "use of old-style cast"
msgstr ""
-#: cp/parser.c:5932
+#: cp/parser.c:6041
#, c-format
msgid "case label %qE not within a switch statement"
msgstr ""
-#: cp/parser.c:6476
+#: cp/parser.c:6584
msgid "ISO C++ forbids computed gotos"
msgstr ""
-#: cp/parser.c:6601
+#: cp/parser.c:6709
msgid "extra %<;%>"
msgstr ""
-#: cp/parser.c:6920
+#: cp/parser.c:7028
msgid "mixing declarations and function-definitions is forbidden"
msgstr ""
-#: cp/parser.c:7052
+#: cp/parser.c:7159
msgid "duplicate %<friend%>"
msgstr ""
-#: cp/parser.c:7221
+#: cp/parser.c:7328
msgid "class definition may not be declared a friend"
msgstr ""
-#: cp/parser.c:7534
+#: cp/parser.c:7641
msgid "only constructors take base initializers"
msgstr ""
-#: cp/parser.c:7585
+#: cp/parser.c:7692
msgid "anachronistic old-style base class initializer"
msgstr ""
-#: cp/parser.c:7626
+#: cp/parser.c:7734
msgid ""
"keyword %<typename%> not allowed in this context (a qualified member "
"initializer is implicitly a type)"
msgstr ""
#. Warn that we do not support `export'.
-#: cp/parser.c:7988
+#: cp/parser.c:8096
msgid "keyword %<export%> not implemented, and will be ignored"
msgstr ""
#. Otherwise, emit an error about the invalid digraph, but continue
#. parsing because we got our argument list.
-#: cp/parser.c:8358
+#: cp/parser.c:8469
msgid "%<<::%> cannot begin a template-argument list"
msgstr ""
-#: cp/parser.c:8359
+#: cp/parser.c:8470
msgid ""
"%<<:%> is an alternate spelling for %<[%>. Insert whitespace between %<<%> "
"and %<::%>"
msgstr ""
-#: cp/parser.c:8366
+#: cp/parser.c:8477
msgid "(if you use -fpermissive G++ will accept your code)"
msgstr ""
+#: cp/parser.c:8541
+msgid "parse error in template argument list"
+msgstr ""
+
#. Explain what went wrong.
-#: cp/parser.c:8536
+#: cp/parser.c:8654
msgid "non-template %qD used as template"
msgstr ""
-#: cp/parser.c:8537
+#: cp/parser.c:8655
msgid "use %<%T::template %D%> to indicate that it is a template"
msgstr ""
-#: cp/parser.c:9554
-msgid "using %<typename%> outside of template"
+#: cp/parser.c:9245 cp/parser.c:15012
+#, c-format
+msgid "template declaration of %qs"
msgstr ""
-#: cp/parser.c:9677
-msgid "expected type-name"
+#: cp/parser.c:9688
+msgid "using %<typename%> outside of template"
msgstr ""
-#: cp/parser.c:9748
+#: cp/parser.c:9883
msgid "type attributes are honored only at type definition"
msgstr ""
#. [namespace.udecl]
#.
#. A using declaration shall not name a template-id.
-#: cp/parser.c:10130
+#: cp/parser.c:10265
msgid "a template-id may not appear in a using-declaration"
msgstr ""
-#: cp/parser.c:10461
+#: cp/parser.c:10595
msgid "an asm-specification is not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:10463
+#: cp/parser.c:10597
msgid "attributes are not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:10594
+#: cp/parser.c:10728
msgid "attributes after parenthesized initializer ignored"
msgstr ""
-#: cp/parser.c:10976
+#: cp/parser.c:11113
msgid "array bound is not an integer constant"
msgstr ""
-#: cp/parser.c:11045
+#: cp/parser.c:11183
msgid "%<%T::%D%> is not a type"
msgstr ""
-#: cp/parser.c:11090
+#: cp/parser.c:11225
msgid "invalid use of constructor as a template"
msgstr ""
-#: cp/parser.c:11091
+#: cp/parser.c:11226
msgid ""
"use %<%T::%D%> instead of %<%T::%T%> to name the constructor in a qualified "
"name"
msgstr ""
-#: cp/parser.c:11279
+#: cp/parser.c:11414
msgid "duplicate cv-qualifier"
msgstr ""
-#: cp/parser.c:11795
+#: cp/parser.c:11916
msgid "file ends in default argument"
msgstr ""
-#: cp/parser.c:11855
+#: cp/parser.c:11977
msgid "deprecated use of default argument for parameter of non-function"
msgstr ""
-#: cp/parser.c:11858
+#: cp/parser.c:11980
msgid "default arguments are only permitted for function parameters"
msgstr ""
-#: cp/parser.c:12598
+#: cp/parser.c:12722
+msgid "invalid class name in declaration of %qD"
+msgstr ""
+
+#: cp/parser.c:12733
msgid "declaration of %qD in %qD which does not enclose %qD"
msgstr ""
-#: cp/parser.c:12611
+#: cp/parser.c:12746
msgid "extra qualification ignored"
msgstr ""
-#: cp/parser.c:12622
+#: cp/parser.c:12757
msgid "an explicit specialization must be preceded by %<template <>%>"
msgstr ""
-#: cp/parser.c:12914
+#: cp/parser.c:12850
+msgid "previous definition of %q#T"
+msgstr ""
+
+#: cp/parser.c:13059
msgid "%Hextra %<;%>"
msgstr ""
-#: cp/parser.c:12932
+#: cp/parser.c:13077
msgid "a class-key must be used when declaring a friend"
msgstr ""
-#: cp/parser.c:12946
+#: cp/parser.c:13091
msgid "friend declaration does not name a class or function"
msgstr ""
-#: cp/parser.c:13120
+#: cp/parser.c:13267
msgid "pure-specifier on function-definition"
msgstr ""
-#: cp/parser.c:13393
+#: cp/parser.c:13545
msgid "keyword %<typename%> not allowed outside of templates"
msgstr ""
-#: cp/parser.c:13395
+#: cp/parser.c:13547
msgid ""
"keyword %<typename%> not allowed in this context (the base class is "
"implicitly a type)"
msgstr ""
-#: cp/parser.c:13669
+#: cp/parser.c:13821
msgid "invalid catch parameter"
msgstr ""
-#: cp/parser.c:14231
+#: cp/parser.c:14399
msgid "reference to %qD is ambiguous"
msgstr ""
-#: cp/parser.c:14400
+#: cp/parser.c:14568
msgid "too few template-parameter-lists"
msgstr ""
@@ -15904,151 +16110,150 @@ msgstr ""
#. something like:
#.
#. template <class T> template <class U> void S::f();
-#: cp/parser.c:14415
+#: cp/parser.c:14583
msgid "too many template-parameter-lists"
msgstr ""
#. Skip the entire function.
-#: cp/parser.c:14639
+#: cp/parser.c:14807
msgid "invalid function declaration"
msgstr ""
#. Issue an error message.
-#: cp/parser.c:14676
-msgid "named return values are no longer supported"
-msgstr ""
-
#: cp/parser.c:14844
-#, c-format
-msgid "template declaration of %qs"
+msgid "named return values are no longer supported"
msgstr ""
-#: cp/parser.c:15048
+#: cp/parser.c:15218
msgid "%H%<>>%> should be %<> >%> within a nested template argument list"
msgstr ""
-#: cp/parser.c:15063
+#: cp/parser.c:15233
msgid "spurious %<>>%>, use %<>%> to terminate a template argument list"
msgstr ""
-#: cp/parser.c:15068
+#: cp/parser.c:15238
msgid "missing %<>%> to terminate the template argument list"
msgstr ""
-#: cp/parser.c:15586
+#: cp/parser.c:15766
msgid "%qs tag used in naming %q#T"
msgstr ""
-#: cp/parser.c:15607
+#: cp/parser.c:15787
msgid "%qD redeclared with different access"
msgstr ""
-#: cp/parser.c:15624
+#: cp/parser.c:15804
msgid "%<template%> (as a disambiguator) is only allowed within templates"
msgstr ""
-#: cp/parser.c:15832
+#: cp/parser.c:16012
msgid "inter-module optimizations not implemented for C++"
msgstr ""
-#: cp/pt.c:240
+#: cp/pt.c:241
msgid "data member %qD cannot be a member template"
msgstr ""
-#: cp/pt.c:252
+#: cp/pt.c:253
msgid "invalid member template declaration %qD"
msgstr ""
-#: cp/pt.c:574
+#: cp/pt.c:575
msgid "explicit specialization in non-namespace scope %qD"
msgstr ""
-#: cp/pt.c:585
+#: cp/pt.c:586
msgid "enclosing class templates are not explicitly specialized"
msgstr ""
-#: cp/pt.c:669
+#: cp/pt.c:670
msgid "specialization of %qD in different namespace"
msgstr ""
-#: cp/pt.c:670 cp/pt.c:739
+#: cp/pt.c:671 cp/pt.c:740
msgid " from definition of %q#D"
msgstr ""
-#: cp/pt.c:706
+#: cp/pt.c:707
msgid "specialization of %qT after instantiation"
msgstr ""
-#: cp/pt.c:738
+#: cp/pt.c:739
msgid "specializing %q#T in different namespace"
msgstr ""
-#: cp/pt.c:753
+#: cp/pt.c:754
msgid "specialization %qT after instantiation %qT"
msgstr ""
-#: cp/pt.c:765
+#: cp/pt.c:766
msgid "explicit specialization of non-template %qT"
msgstr ""
-#: cp/pt.c:1163
+#: cp/pt.c:1164
msgid "specialization of %qD after instantiation"
msgstr ""
-#: cp/pt.c:1292
+#: cp/pt.c:1293
msgid "%s %+#D"
msgstr ""
-#: cp/pt.c:1348
+#: cp/pt.c:1349
msgid "%qD is not a function template"
msgstr ""
-#: cp/pt.c:1533
+#: cp/pt.c:1534
msgid "template-id %qD for %q+D does not match any template declaration"
msgstr ""
-#: cp/pt.c:1542
+#: cp/pt.c:1543
msgid "ambiguous template specialization %qD for %q+D"
msgstr ""
#. This case handles bogus declarations like template <>
#. template <class T> void f<int>();
-#: cp/pt.c:1765 cp/pt.c:1819
+#: cp/pt.c:1774 cp/pt.c:1828
msgid "template-id %qD in declaration of primary template"
msgstr ""
-#: cp/pt.c:1778
+#: cp/pt.c:1787
msgid "template parameter list used in explicit instantiation"
msgstr ""
-#: cp/pt.c:1784
+#: cp/pt.c:1793
msgid "definition provided for explicit instantiation"
msgstr ""
-#: cp/pt.c:1792
+#: cp/pt.c:1801
msgid "too many template parameter lists in declaration of %qD"
msgstr ""
-#: cp/pt.c:1795
+#: cp/pt.c:1804
msgid "too few template parameter lists in declaration of %qD"
msgstr ""
-#: cp/pt.c:1797
+#: cp/pt.c:1806
msgid "explicit specialization of %qD must be introduced by %<template <>%>"
msgstr ""
-#: cp/pt.c:1816
+#: cp/pt.c:1825
msgid "function template partial specialization %qD is not allowed"
msgstr ""
-#: cp/pt.c:1848
+#: cp/pt.c:1857
msgid "default argument specified in explicit specialization"
msgstr ""
-#: cp/pt.c:1852
+#: cp/pt.c:1861
msgid "template specialization with C linkage"
msgstr ""
+#: cp/pt.c:1888
+msgid "%qD is not a template function"
+msgstr ""
+
#. From [temp.expl.spec]:
#.
#. If such an explicit specialization for the member
@@ -16057,60 +16262,55 @@ msgstr ""
#. program is ill-formed.
#.
#. Similar language is found in [temp.explicit].
-#: cp/pt.c:1936
+#: cp/pt.c:1950
msgid "specialization of implicitly-declared special member function"
msgstr ""
-#: cp/pt.c:1980
+#: cp/pt.c:1994
msgid "no member function %qD declared in %qT"
msgstr ""
-#. There are two many template parameter lists.
-#: cp/pt.c:2130
-msgid "too many template parameter lists in declaration of %qT"
-msgstr ""
-
-#: cp/pt.c:2224
+#: cp/pt.c:2199
msgid " shadows template parm %q#D"
msgstr ""
-#: cp/pt.c:2626
+#: cp/pt.c:2601
msgid "template parameters not used in partial specialization:"
msgstr ""
-#: cp/pt.c:2630
+#: cp/pt.c:2605
msgid " %qD"
msgstr ""
-#: cp/pt.c:2641
+#: cp/pt.c:2616
msgid "partial specialization %qT does not specialize any template arguments"
msgstr ""
-#: cp/pt.c:2666
+#: cp/pt.c:2641
#, c-format
msgid "template argument %qE involves template parameter(s)"
msgstr ""
-#: cp/pt.c:2710
+#: cp/pt.c:2685
msgid "type %qT of template argument %qE depends on template parameter(s)"
msgstr ""
-#: cp/pt.c:2797
+#: cp/pt.c:2772
msgid "no default argument for %qD"
msgstr ""
-#: cp/pt.c:2954
+#: cp/pt.c:2929
msgid "template with C linkage"
msgstr ""
-#: cp/pt.c:2957
+#: cp/pt.c:2932
msgid "template class without a name"
msgstr ""
#. [temp.mem]
#.
#. A destructor shall not be a member template.
-#: cp/pt.c:2965
+#: cp/pt.c:2940
msgid "destructor %qD declared as member template"
msgstr ""
@@ -16119,53 +16319,57 @@ msgstr ""
#. An allocation function can be a function
#. template. ... Template allocation functions shall
#. have two or more parameters.
-#: cp/pt.c:2980
+#: cp/pt.c:2955
msgid "invalid template declaration of %qD"
msgstr ""
-#: cp/pt.c:3061
+#: cp/pt.c:3036
msgid "%qD does not declare a template type"
msgstr ""
-#: cp/pt.c:3067
+#: cp/pt.c:3042
msgid "template definition of non-template %q#D"
msgstr ""
-#: cp/pt.c:3109
+#: cp/pt.c:3084
msgid "expected %d levels of template parms for %q#D, got %d"
msgstr ""
-#: cp/pt.c:3121
+#: cp/pt.c:3096
msgid "got %d template parameters for %q#D"
msgstr ""
-#: cp/pt.c:3124
+#: cp/pt.c:3099
msgid "got %d template parameters for %q#T"
msgstr ""
-#: cp/pt.c:3126
+#: cp/pt.c:3101
#, c-format
msgid " but %d required"
msgstr ""
-#: cp/pt.c:3211
+#: cp/pt.c:3190
msgid "%qT is not a template type"
msgstr ""
-#: cp/pt.c:3227
+#: cp/pt.c:3203
+msgid "template specifiers not specified in declaration of %qD"
+msgstr ""
+
+#: cp/pt.c:3213
msgid "previous declaration %qD"
msgstr ""
-#: cp/pt.c:3228
+#: cp/pt.c:3214
#, c-format
msgid "used %d template parameter%s instead of %d"
msgstr ""
-#: cp/pt.c:3248
+#: cp/pt.c:3234
msgid "template parameter %q#D"
msgstr ""
-#: cp/pt.c:3249
+#: cp/pt.c:3235
msgid "redeclared here as %q#D"
msgstr ""
@@ -16173,314 +16377,322 @@ msgstr ""
#.
#. A template-parameter may not be given default arguments
#. by two different declarations in the same scope.
-#: cp/pt.c:3259
+#: cp/pt.c:3245
msgid "redefinition of default argument for %q#D"
msgstr ""
-#: cp/pt.c:3260
+#: cp/pt.c:3246
msgid "%J original definition appeared here"
msgstr ""
-#: cp/pt.c:3370
+#: cp/pt.c:3342
msgid ""
"%qE is not a valid template argument for type %qT because function %qD has "
"not external linkage"
msgstr ""
-#: cp/pt.c:3411
+#: cp/pt.c:3383
msgid ""
"%qE is not a valid template argument for type %qT because string literals "
"can never be used in this context"
msgstr ""
-#: cp/pt.c:3486
+#: cp/pt.c:3458
msgid ""
"%qE is not a valid template argument for type %qT because it is a non-"
"constant expression"
msgstr ""
-#: cp/pt.c:3536
+#: cp/pt.c:3508
msgid ""
"%qE is not a valid template argument for type %qT because it is not a "
"constant pointer"
msgstr ""
-#: cp/pt.c:3556
+#: cp/pt.c:3528
msgid ""
"%qE is not a valid template argument for type %qT because of conflicts in cv-"
"qualification"
msgstr ""
-#: cp/pt.c:3563
+#: cp/pt.c:3535
msgid ""
"%qE is not a valid template argument for type %qT because it is not a lvalue"
msgstr ""
-#: cp/pt.c:3576
+#: cp/pt.c:3548
msgid ""
"%qE is not a valid template argument for type %qT because object %qD has not "
"external linkage"
msgstr ""
-#: cp/pt.c:3618
+#: cp/pt.c:3590
msgid ""
"%qE is not a valid template argument for type %qT because it is a pointer"
msgstr ""
-#: cp/pt.c:3620
+#: cp/pt.c:3592
#, c-format
msgid "try using %qE instead"
msgstr ""
-#: cp/pt.c:3655
+#: cp/pt.c:3627
msgid ""
"%qE is not a valid template argument for type %qT because it is of type %qT"
msgstr ""
-#: cp/pt.c:3658
+#: cp/pt.c:3630
msgid "standard conversions are not allowed in this context"
msgstr ""
-#: cp/pt.c:3827
+#: cp/pt.c:3799
msgid "to refer to a type member of a template parameter, use %<typename %E%>"
msgstr ""
-#: cp/pt.c:3841 cp/pt.c:3860 cp/pt.c:3900
+#: cp/pt.c:3814 cp/pt.c:3833 cp/pt.c:3873
msgid "type/value mismatch at argument %d in template parameter list for %qD"
msgstr ""
-#: cp/pt.c:3845
+#: cp/pt.c:3818
msgid " expected a constant of type %qT, got %qT"
msgstr ""
-#: cp/pt.c:3849
+#: cp/pt.c:3822
#, c-format
msgid " expected a class template, got %qE"
msgstr ""
-#: cp/pt.c:3851
+#: cp/pt.c:3824
#, c-format
msgid " expected a type, got %qE"
msgstr ""
-#: cp/pt.c:3864
+#: cp/pt.c:3837
msgid " expected a type, got %qT"
msgstr ""
-#: cp/pt.c:3866
+#: cp/pt.c:3839
msgid " expected a class template, got %qT"
msgstr ""
-#: cp/pt.c:3903
+#: cp/pt.c:3876
msgid " expected a template of type %qD, got %qD"
msgstr ""
-#: cp/pt.c:3939
+#: cp/pt.c:3912
msgid "could not convert template argument %qE to %qT"
msgstr ""
-#: cp/pt.c:3978
+#: cp/pt.c:3951
#, c-format
msgid "wrong number of template arguments (%d, should be %d)"
msgstr ""
-#: cp/pt.c:3982
+#: cp/pt.c:3955
msgid "provided for %qD"
msgstr ""
-#: cp/pt.c:4012
+#: cp/pt.c:3985
#, c-format
msgid "template argument %d is invalid"
msgstr ""
-#: cp/pt.c:4234
-msgid "non-template used as template"
-msgstr ""
-
-#: cp/pt.c:4376
+#: cp/pt.c:4340
msgid "non-template type %qT used as a template"
msgstr ""
-#: cp/pt.c:4378
+#: cp/pt.c:4342
msgid "for template declaration %qD"
msgstr ""
-#: cp/pt.c:5018
+#: cp/pt.c:4982
msgid ""
"template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN "
"to increase the maximum) instantiating %qD"
msgstr ""
-#: cp/pt.c:5457
+#: cp/pt.c:5424
msgid "ambiguous class template instantiation for %q#T"
msgstr ""
-#: cp/pt.c:5463
+#: cp/pt.c:5430
msgid "%s %+#T"
msgstr ""
-#: cp/pt.c:6522
+#: cp/pt.c:6510
msgid "instantiation of %qD as type %qT"
msgstr ""
-#: cp/pt.c:6683
+#: cp/pt.c:6678
msgid "invalid parameter type %qT"
msgstr ""
-#: cp/pt.c:6685
+#: cp/pt.c:6680
msgid "in declaration %qD"
msgstr ""
-#: cp/pt.c:6746
+#: cp/pt.c:6741
msgid "function returning an array"
msgstr ""
-#: cp/pt.c:6748
+#: cp/pt.c:6743
msgid "function returning a function"
msgstr ""
-#: cp/pt.c:6775
+#: cp/pt.c:6770
msgid "creating pointer to member function of non-class type %qT"
msgstr ""
-#: cp/pt.c:6945
+#: cp/pt.c:6938
msgid "creating array with size zero"
msgstr ""
-#: cp/pt.c:6959
+#: cp/pt.c:6952
#, c-format
msgid "creating array with size zero (%qE)"
msgstr ""
-#: cp/pt.c:7176
+#: cp/pt.c:7169
msgid "forming reference to void"
msgstr ""
-#: cp/pt.c:7178
+#: cp/pt.c:7171
msgid "forming %s to reference type %qT"
msgstr ""
-#: cp/pt.c:7215
+#: cp/pt.c:7208
msgid "creating pointer to member of non-class type %qT"
msgstr ""
-#: cp/pt.c:7221
+#: cp/pt.c:7214
msgid "creating pointer to member reference type %qT"
msgstr ""
-#: cp/pt.c:7291
+#: cp/pt.c:7280
msgid "creating array of %qT"
msgstr ""
-#: cp/pt.c:7297
+#: cp/pt.c:7286
msgid "creating array of %qT, which is an abstract class type"
msgstr ""
-#: cp/pt.c:7341
+#: cp/pt.c:7330
msgid "%qT is not a class, struct, or union type"
msgstr ""
-#: cp/pt.c:7430
+#: cp/pt.c:7365
+msgid "%qT resolves to %qT, which is not an enumeration type"
+msgstr ""
+
+#: cp/pt.c:7368
+msgid "%qT resolves to %qT, which is is not a class type"
+msgstr ""
+
+#: cp/pt.c:7429
#, c-format
msgid "use of %qs in template"
msgstr ""
-#: cp/pt.c:7555
+#: cp/pt.c:7554
#, c-format
msgid ""
"dependent-name %qE is parsed as a non-type, but instantiation yields a type"
msgstr ""
-#: cp/pt.c:7557
+#: cp/pt.c:7556
msgid "say %<typename %E%> if a type is meant"
msgstr ""
-#: cp/pt.c:8708
+#: cp/pt.c:7675
+msgid "using invalid field %qD"
+msgstr ""
+
+#: cp/pt.c:8729
msgid "%qT is not a class or namespace"
msgstr ""
-#: cp/pt.c:8711
+#: cp/pt.c:8732
msgid "%qD is not a class or namespace"
msgstr ""
-#: cp/pt.c:8844
-msgid "%qT uses anonymous type"
+#: cp/pt.c:8872
+msgid "%qT is/uses anonymous type"
msgstr ""
-#: cp/pt.c:8846
+#: cp/pt.c:8874
msgid "%qT uses local type %qT"
msgstr ""
-#: cp/pt.c:8854
+#: cp/pt.c:8883
msgid "%qT is a variably modified type"
msgstr ""
-#: cp/pt.c:8865
+#: cp/pt.c:8894
#, c-format
msgid "integral expression %qE is not constant"
msgstr ""
-#: cp/pt.c:8870
+#: cp/pt.c:8899
msgid " trying to instantiate %qD"
msgstr ""
-#: cp/pt.c:9386
+#: cp/pt.c:9418
msgid "incomplete type unification"
msgstr ""
-#: cp/pt.c:10704 cp/pt.c:10775
+#: cp/pt.c:10767 cp/pt.c:10838
msgid "explicit instantiation of non-template %q#D"
msgstr ""
-#: cp/pt.c:10720 cp/pt.c:10770
+#: cp/pt.c:10783 cp/pt.c:10833
msgid "no matching template for %qD found"
msgstr ""
-#: cp/pt.c:10726
+#: cp/pt.c:10789
msgid "explicit instantiation of %q#D"
msgstr ""
-#: cp/pt.c:10762
+#: cp/pt.c:10825
msgid "duplicate explicit instantiation of %q#D"
msgstr ""
-#: cp/pt.c:10784
+#: cp/pt.c:10847
msgid "ISO C++ forbids the use of %<extern%> on explicit instantiations"
msgstr ""
-#: cp/pt.c:10789 cp/pt.c:10879
+#: cp/pt.c:10852 cp/pt.c:10942
msgid "storage class %qD applied to template instantiation"
msgstr ""
-#: cp/pt.c:10851
+#: cp/pt.c:10914
msgid "explicit instantiation of non-template type %qT"
msgstr ""
-#: cp/pt.c:10860
+#: cp/pt.c:10923
msgid "explicit instantiation of %q#T before definition of template"
msgstr ""
-#: cp/pt.c:10868
+#: cp/pt.c:10931
#, c-format
msgid "ISO C++ forbids the use of %qE on explicit instantiations"
msgstr ""
-#: cp/pt.c:10913
+#: cp/pt.c:10976
msgid "duplicate explicit instantiation of %q#T"
msgstr ""
-#: cp/pt.c:11278
+#: cp/pt.c:11341
msgid "explicit instantiation of %qD but no definition available"
msgstr ""
-#: cp/pt.c:11422
+#: cp/pt.c:11485
msgid ""
"template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN "
"to increase the maximum) instantiating %q+D, possibly from virtual table "
"generation"
msgstr ""
-#: cp/pt.c:11701
+#: cp/pt.c:11753
msgid "%q#T is not a valid type for a template constant parameter"
msgstr ""
@@ -16498,24 +16710,24 @@ msgstr ""
msgid "can't create repository information file %qs"
msgstr ""
-#: cp/rtti.c:243
+#: cp/rtti.c:244
msgid "cannot use typeid with -fno-rtti"
msgstr ""
-#: cp/rtti.c:249
+#: cp/rtti.c:250
msgid "must #include <typeinfo> before using typeid"
msgstr ""
-#: cp/rtti.c:321
+#: cp/rtti.c:322
msgid ""
"cannot create type information for type %qT because its size is variable"
msgstr ""
-#: cp/rtti.c:574 cp/rtti.c:588
+#: cp/rtti.c:570 cp/rtti.c:584
msgid "dynamic_cast of %q#D to %q#T can never succeed"
msgstr ""
-#: cp/rtti.c:667
+#: cp/rtti.c:663
msgid "cannot dynamic_cast %qE (of type %q#T) to type %q#T (%s)"
msgstr ""
@@ -16527,209 +16739,205 @@ msgstr ""
msgid "%qT is an inaccessible base of %qT"
msgstr ""
-#: cp/search.c:1834
+#: cp/search.c:1843
msgid "deprecated covariant return type for %q#D"
msgstr ""
-#: cp/search.c:1836 cp/search.c:1851 cp/search.c:1857
+#: cp/search.c:1845 cp/search.c:1860 cp/search.c:1866
msgid " overriding %q#D"
msgstr ""
-#: cp/search.c:1850
+#: cp/search.c:1859
msgid "invalid covariant return type for %q#D"
msgstr ""
-#: cp/search.c:1855
+#: cp/search.c:1864
msgid "conflicting return type specified for %q#D"
msgstr ""
-#: cp/search.c:1866
+#: cp/search.c:1875
msgid "looser throw specifier for %q#F"
msgstr ""
-#: cp/search.c:1867
+#: cp/search.c:1876
msgid " overriding %q#F"
msgstr ""
#. A static member function cannot match an inherited
#. virtual member function.
-#: cp/search.c:1960
+#: cp/search.c:1969
msgid "%q#D cannot be declared"
msgstr ""
-#: cp/search.c:1961
+#: cp/search.c:1970
msgid " since %q#D declared in base class"
msgstr ""
-#: cp/semantics.c:1157
+#: cp/semantics.c:1199
#, c-format
msgid "type of asm operand %qE could not be determined"
msgstr ""
-#: cp/semantics.c:1290
+#: cp/semantics.c:1318
msgid "invalid use of member %qD in static member function"
msgstr ""
-#: cp/semantics.c:1294 cp/semantics.c:1333
+#: cp/semantics.c:1322 cp/semantics.c:1361
msgid "from this location"
msgstr ""
-#: cp/semantics.c:1332
+#: cp/semantics.c:1360
msgid "object missing in reference to %qD"
msgstr ""
-#: cp/semantics.c:1811
+#: cp/semantics.c:1838
msgid "arguments to destructor are not allowed"
msgstr ""
-#: cp/semantics.c:1861
+#: cp/semantics.c:1888
msgid "%<this%> is unavailable for static member functions"
msgstr ""
-#: cp/semantics.c:1867
+#: cp/semantics.c:1894
msgid "invalid use of %<this%> in non-member function"
msgstr ""
-#: cp/semantics.c:1869
+#: cp/semantics.c:1896
msgid "invalid use of %<this%> at top level"
msgstr ""
-#: cp/semantics.c:1893
+#: cp/semantics.c:1920
msgid "invalid qualifying scope in pseudo-destructor name"
msgstr ""
-#: cp/semantics.c:1913
+#: cp/semantics.c:1940
msgid "%qE is not of type %qT"
msgstr ""
-#: cp/semantics.c:2007
+#: cp/semantics.c:2039
msgid "template type parameters must use the keyword %<class%> or %<typename%>"
msgstr ""
-#: cp/semantics.c:2051
+#: cp/semantics.c:2083
msgid ""
"invalid use of type %qT as a default value for a template template-parameter"
msgstr ""
-#: cp/semantics.c:2054
+#: cp/semantics.c:2086
msgid "invalid use of %qD as a default value for a template template-parameter"
msgstr ""
-#: cp/semantics.c:2058
+#: cp/semantics.c:2090
msgid "invalid default argument for a template template parameter"
msgstr ""
-#: cp/semantics.c:2075
+#: cp/semantics.c:2107
msgid "definition of %q#T inside template parameter list"
msgstr ""
-#: cp/semantics.c:2086
+#: cp/semantics.c:2118
msgid "invalid definition of qualified type %qT"
msgstr ""
-#: cp/semantics.c:2101
-msgid "previous definition of %q#T"
-msgstr ""
-
-#: cp/semantics.c:2277
+#: cp/semantics.c:2334
msgid "invalid base-class specification"
msgstr ""
-#: cp/semantics.c:2286
+#: cp/semantics.c:2343
msgid "base class %qT has cv qualifiers"
msgstr ""
-#: cp/semantics.c:2306
+#: cp/semantics.c:2363
msgid "incomplete type %qT used in nested name specifier"
msgstr ""
-#: cp/semantics.c:2309
+#: cp/semantics.c:2366
msgid "reference to %<%T::%D%> is ambiguous"
msgstr ""
-#: cp/semantics.c:2313 cp/typeck.c:1653
+#: cp/semantics.c:2370 cp/typeck.c:1621
msgid "%qD is not a member of %qT"
msgstr ""
-#: cp/semantics.c:2316
+#: cp/semantics.c:2373
msgid "%qD is not a member of %qD"
msgstr ""
-#: cp/semantics.c:2441
+#: cp/semantics.c:2502
msgid ""
"template parameter %qD of type %qT is not allowed in an integral constant "
"expression because it is not of integral or enumeration type"
msgstr ""
-#: cp/semantics.c:2585
+#: cp/semantics.c:2656
msgid "%qD cannot appear in a constant-expression"
msgstr ""
-#: cp/semantics.c:2593
+#: cp/semantics.c:2664
msgid "use of namespace %qD as expression"
msgstr ""
-#: cp/semantics.c:2598
+#: cp/semantics.c:2669
msgid "use of class template %qT as expression"
msgstr ""
#. Ambiguous reference to base members.
-#: cp/semantics.c:2604
+#: cp/semantics.c:2675
msgid "request for member %qD is ambiguous in multiple inheritance lattice"
msgstr ""
-#: cp/semantics.c:2665
+#: cp/semantics.c:2748
#, c-format
msgid "use of %s from containing function"
msgstr ""
-#: cp/semantics.c:2668
+#: cp/semantics.c:2751
msgid " %q#D declared here"
msgstr ""
-#: cp/semantics.c:2719
+#: cp/semantics.c:2801
#, c-format
msgid "type of %qE is unknown"
msgstr ""
-#: cp/tree.c:525
+#: cp/tree.c:539
msgid "%qV qualifiers cannot be applied to %qT"
msgstr ""
-#: cp/tree.c:1760
+#: cp/tree.c:1740
#, c-format
msgid "%qE attribute can only be applied to Java class definitions"
msgstr ""
-#: cp/tree.c:1789
+#: cp/tree.c:1769
#, c-format
msgid "%qE attribute can only be applied to class definitions"
msgstr ""
-#: cp/tree.c:1794
+#: cp/tree.c:1774
#, c-format
msgid "%qE is obsolete; g++ vtables are now COM-compatible by default"
msgstr ""
-#: cp/tree.c:1818
+#: cp/tree.c:1798
msgid "requested init_priority is not an integer constant"
msgstr ""
-#: cp/tree.c:1839
+#: cp/tree.c:1819
#, c-format
msgid ""
"can only use %qE attribute on file-scope definitions of objects of class type"
msgstr ""
-#: cp/tree.c:1847
+#: cp/tree.c:1827
msgid "requested init_priority is out of range"
msgstr ""
-#: cp/tree.c:1857
+#: cp/tree.c:1837
msgid "requested init_priority is reserved for internal use"
msgstr ""
-#: cp/tree.c:1867
+#: cp/tree.c:1847
#, c-format
msgid "%qE attribute is not supported on this platform"
msgstr ""
@@ -16747,191 +16955,191 @@ msgstr ""
msgid "%s between distinct pointer-to-member types %qT and %qT lacks a cast"
msgstr ""
-#: cp/typeck.c:1250
+#: cp/typeck.c:1239
#, c-format
msgid "invalid application of %qs to a member function"
msgstr ""
-#: cp/typeck.c:1283
+#: cp/typeck.c:1272
#, c-format
msgid "invalid application of %qs to a bit-field"
msgstr ""
-#: cp/typeck.c:1288
+#: cp/typeck.c:1277
#, c-format
msgid "ISO C++ forbids applying %qs to an expression of function type"
msgstr ""
-#: cp/typeck.c:1325
+#: cp/typeck.c:1314
msgid "invalid use of non-static member function"
msgstr ""
-#: cp/typeck.c:1510
+#: cp/typeck.c:1481
msgid "deprecated conversion from string constant to %qT'"
msgstr ""
-#: cp/typeck.c:1624 cp/typeck.c:1923
+#: cp/typeck.c:1592 cp/typeck.c:1882
msgid "request for member %qD in %qE, which is of non-class type %qT"
msgstr ""
-#: cp/typeck.c:1651
+#: cp/typeck.c:1619
#, c-format
msgid "invalid use of nonstatic data member %qE"
msgstr ""
-#: cp/typeck.c:1703 cp/typeck.c:1731
+#: cp/typeck.c:1671 cp/typeck.c:1699
msgid "invalid access to non-static data member %qD of NULL object"
msgstr ""
-#: cp/typeck.c:1706 cp/typeck.c:1733
+#: cp/typeck.c:1674 cp/typeck.c:1701
msgid "(perhaps the %<offsetof%> macro was used incorrectly)"
msgstr ""
-#: cp/typeck.c:1844
+#: cp/typeck.c:1812
msgid "qualified type %qT does not match destructor name ~%qT"
msgstr ""
-#: cp/typeck.c:1850
+#: cp/typeck.c:1818
msgid "the type being destroyed is %qT, but the destructor refers to %qT"
msgstr ""
-#: cp/typeck.c:1969
+#: cp/typeck.c:1928
msgid "%<%D::%D%> is not a member of %qT"
msgstr ""
-#: cp/typeck.c:1980
+#: cp/typeck.c:1939
msgid "%qT is not a base of %qT"
msgstr ""
-#: cp/typeck.c:1999
+#: cp/typeck.c:1958
msgid "%qD has no member named %qE"
msgstr ""
-#: cp/typeck.c:2014
+#: cp/typeck.c:1973
msgid "%qD is not a member template function"
msgstr ""
#. A pointer to incomplete type (other than cv void) can be
#. dereferenced [expr.unary.op]/1
-#: cp/typeck.c:2121
+#: cp/typeck.c:2080
msgid "%qT is not a pointer-to-object type"
msgstr ""
-#: cp/typeck.c:2146
+#: cp/typeck.c:2105
#, c-format
msgid "invalid use of %qs on pointer to member"
msgstr ""
-#: cp/typeck.c:2152
+#: cp/typeck.c:2111
msgid "invalid type argument"
msgstr ""
-#: cp/typeck.c:2175
+#: cp/typeck.c:2134
msgid "subscript missing in array reference"
msgstr ""
-#: cp/typeck.c:2257
+#: cp/typeck.c:2216
msgid "ISO C++ forbids subscripting non-lvalue array"
msgstr ""
-#: cp/typeck.c:2268
+#: cp/typeck.c:2227
msgid "subscripting array declared %<register%>"
msgstr ""
-#: cp/typeck.c:2351
+#: cp/typeck.c:2310
#, c-format
msgid "object missing in use of %qE"
msgstr ""
-#: cp/typeck.c:2452
+#: cp/typeck.c:2411
msgid "ISO C++ forbids calling %<::main%> from within program"
msgstr ""
-#: cp/typeck.c:2477
+#: cp/typeck.c:2436
msgid ""
"must use %<.*%> or %<->*%> to call pointer-to-member function in %<%E (...)%>"
msgstr ""
-#: cp/typeck.c:2491
+#: cp/typeck.c:2450
#, c-format
msgid "%qE cannot be used as a function"
msgstr ""
-#: cp/typeck.c:2570
+#: cp/typeck.c:2529
msgid "too many arguments to %s %q+#D"
msgstr ""
-#: cp/typeck.c:2572 cp/typeck.c:2678
+#: cp/typeck.c:2531 cp/typeck.c:2634
msgid "at this point in file"
msgstr ""
-#: cp/typeck.c:2575
+#: cp/typeck.c:2534
msgid "too many arguments to function"
msgstr ""
-#: cp/typeck.c:2609
+#: cp/typeck.c:2568
msgid "parameter %P of %qD has incomplete type %qT"
msgstr ""
-#: cp/typeck.c:2612
+#: cp/typeck.c:2571
msgid "parameter %P has incomplete type %qT"
msgstr ""
-#: cp/typeck.c:2676
+#: cp/typeck.c:2632
msgid "too few arguments to %s %q+#D"
msgstr ""
-#: cp/typeck.c:2681
+#: cp/typeck.c:2637
msgid "too few arguments to function"
msgstr ""
-#: cp/typeck.c:2828 cp/typeck.c:2838
+#: cp/typeck.c:2784 cp/typeck.c:2794
msgid "assuming cast to type %qT from overloaded function"
msgstr ""
-#: cp/typeck.c:2899
+#: cp/typeck.c:2855
msgid "division by zero in %<%E / 0%>"
msgstr ""
-#: cp/typeck.c:2901
+#: cp/typeck.c:2857
msgid "division by zero in %<%E / 0.%>"
msgstr ""
-#: cp/typeck.c:2935
+#: cp/typeck.c:2891
msgid "division by zero in %<%E %% 0%>"
msgstr ""
-#: cp/typeck.c:2937
+#: cp/typeck.c:2893
msgid "division by zero in %<%E %% 0.%>"
msgstr ""
-#: cp/typeck.c:3017
+#: cp/typeck.c:2973
#, c-format
msgid "%s rotate count is negative"
msgstr ""
-#: cp/typeck.c:3020
+#: cp/typeck.c:2976
#, c-format
msgid "%s rotate count >= width of type"
msgstr ""
-#: cp/typeck.c:3054 cp/typeck.c:3059 cp/typeck.c:3155 cp/typeck.c:3160
+#: cp/typeck.c:3010 cp/typeck.c:3015 cp/typeck.c:3111 cp/typeck.c:3116
msgid "ISO C++ forbids comparison between pointer and integer"
msgstr ""
-#: cp/typeck.c:3174
+#: cp/typeck.c:3130
msgid "unordered comparison on non-floating point argument"
msgstr ""
-#: cp/typeck.c:3196
+#: cp/typeck.c:3152
msgid "invalid operands of types %qT and %qT to binary %qO"
msgstr ""
-#: cp/typeck.c:3360
+#: cp/typeck.c:3316
msgid "comparison between types %q#T and %q#T"
msgstr ""
-#: cp/typeck.c:3396
+#: cp/typeck.c:3352
msgid "comparison between signed and unsigned integer expressions"
msgstr ""
@@ -16939,139 +17147,139 @@ msgstr ""
#. performed. Note that pointer-difference and pointer-addition
#. have already been handled above, and so we don't end up here in
#. that case.
-#: cp/typeck.c:3475
+#: cp/typeck.c:3431
msgid "NULL used in arithmetic"
msgstr ""
-#: cp/typeck.c:3533
+#: cp/typeck.c:3489
msgid "ISO C++ forbids using pointer of type %<void *%> in subtraction"
msgstr ""
-#: cp/typeck.c:3535
+#: cp/typeck.c:3491
msgid "ISO C++ forbids using pointer to a function in subtraction"
msgstr ""
-#: cp/typeck.c:3537
+#: cp/typeck.c:3493
msgid "ISO C++ forbids using pointer to a method in subtraction"
msgstr ""
-#: cp/typeck.c:3549
+#: cp/typeck.c:3505
msgid "invalid use of a pointer to an incomplete type in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:3625
+#: cp/typeck.c:3581
#, c-format
msgid ""
"invalid use of %qE to form a pointer-to-member-function. Use a qualified-id."
msgstr ""
-#: cp/typeck.c:3632
+#: cp/typeck.c:3588
#, c-format
msgid ""
"parenthesis around %qE cannot be used to form a pointer-to-member-function"
msgstr ""
-#: cp/typeck.c:3655
+#: cp/typeck.c:3611
msgid "taking address of temporary"
msgstr ""
-#: cp/typeck.c:3890
+#: cp/typeck.c:3846
#, c-format
msgid "ISO C++ forbids %sing an enum"
msgstr ""
-#: cp/typeck.c:3901
+#: cp/typeck.c:3857
msgid "cannot %s a pointer to incomplete type %qT"
msgstr ""
-#: cp/typeck.c:3907
+#: cp/typeck.c:3863
msgid "ISO C++ forbids %sing a pointer of type %qT"
msgstr ""
-#: cp/typeck.c:3932
+#: cp/typeck.c:3888
msgid "cast to non-reference type used as lvalue"
msgstr ""
-#: cp/typeck.c:3967
+#: cp/typeck.c:3923
msgid "invalid use of %<--%> on bool variable %qD"
msgstr ""
#. ARM $3.4
-#: cp/typeck.c:3996
+#: cp/typeck.c:3952
msgid "ISO C++ forbids taking address of function %<::main%>"
msgstr ""
#. An expression like &memfn.
-#: cp/typeck.c:4050
+#: cp/typeck.c:4006
msgid ""
"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%>"
msgstr ""
-#: cp/typeck.c:4055
+#: cp/typeck.c:4011
msgid ""
"ISO C++ forbids taking the address of a bound member function to form a "
"pointer to member function. Say %<&%T::%D%>"
msgstr ""
-#: cp/typeck.c:4083
+#: cp/typeck.c:4039
msgid "ISO C++ forbids taking the address of a cast to a non-lvalue expression"
msgstr ""
-#: cp/typeck.c:4135
+#: cp/typeck.c:4091
msgid "attempt to take address of bit-field structure member %qD"
msgstr ""
-#: cp/typeck.c:4248
+#: cp/typeck.c:4211
msgid "taking address of destructor"
msgstr ""
-#: cp/typeck.c:4261
+#: cp/typeck.c:4224
msgid "taking address of bound pointer-to-member expression"
msgstr ""
-#: cp/typeck.c:4269
+#: cp/typeck.c:4232
msgid "cannot create pointer to reference member %qD"
msgstr ""
-#: cp/typeck.c:4332
+#: cp/typeck.c:4295
msgid "cannot take the address of %<this%>, which is an rvalue expression"
msgstr ""
-#: cp/typeck.c:4355
+#: cp/typeck.c:4318
msgid "address of explicit register variable %qD requested"
msgstr ""
-#: cp/typeck.c:4360
+#: cp/typeck.c:4323
msgid "address requested for %qD, which is declared %<register%>"
msgstr ""
-#: cp/typeck.c:4426
+#: cp/typeck.c:4389
#, c-format
msgid "%s expression list treated as compound expression"
msgstr ""
-#: cp/typeck.c:4502
+#: cp/typeck.c:4464
msgid "%s from type %qT to type %qT casts away constness"
msgstr ""
-#: cp/typeck.c:4800
+#: cp/typeck.c:4761
msgid "invalid static_cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:4822
+#: cp/typeck.c:4783
msgid "converting from %qT to %qT"
msgstr ""
-#: cp/typeck.c:4867
+#: cp/typeck.c:4828
msgid "invalid cast of an rvalue expression of type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:4926
+#: cp/typeck.c:4887
msgid "cast from %qT to %qT loses precision"
msgstr ""
-#: cp/typeck.c:4954
+#: cp/typeck.c:4912
msgid "cast from %qT to %qT increases required alignment of target type"
msgstr ""
@@ -17079,152 +17287,128 @@ msgstr ""
#. where possible, and it is necessary in some cases. DR 195
#. addresses this issue, but as of 2004/10/26 is still in
#. drafting.
-#: cp/typeck.c:4968
+#: cp/typeck.c:4926
msgid ""
"ISO C++ forbids casting between pointer-to-function and pointer-to-object"
msgstr ""
-#: cp/typeck.c:4979
+#: cp/typeck.c:4937
msgid "invalid cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5035
+#: cp/typeck.c:4993
msgid ""
"invalid use of const_cast with type %qT, which is not a pointer, reference, "
"nor a pointer-to-data-member type"
msgstr ""
-#: cp/typeck.c:5044
+#: cp/typeck.c:5002
msgid ""
"invalid use of const_cast with type %qT, which is a pointer or reference to "
"a function type"
msgstr ""
-#: cp/typeck.c:5066
+#: cp/typeck.c:5024
msgid "invalid const_cast of an rvalue of type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5109
+#: cp/typeck.c:5067
msgid "invalid const_cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5177 cp/typeck.c:5182
+#: cp/typeck.c:5135 cp/typeck.c:5140
msgid "ISO C++ forbids casting to an array type %qT"
msgstr ""
-#: cp/typeck.c:5190
+#: cp/typeck.c:5148
msgid "invalid cast to function type %qT"
msgstr ""
-#: cp/typeck.c:5411
+#: cp/typeck.c:5364
msgid " in evaluation of %<%Q(%#T, %#T)%>"
msgstr ""
-#: cp/typeck.c:5480
+#: cp/typeck.c:5433
msgid "incompatible types in assignment of %qT to %qT"
msgstr ""
-#: cp/typeck.c:5487
+#: cp/typeck.c:5440
msgid "ISO C++ forbids assignment of arrays"
msgstr ""
-#: cp/typeck.c:5598
+#: cp/typeck.c:5551
msgid " in pointer to member function conversion"
msgstr ""
-#: cp/typeck.c:5604
+#: cp/typeck.c:5557
msgid " in pointer to member conversion"
msgstr ""
#. This is a reinterpret cast, we choose to do nothing.
-#: cp/typeck.c:5615 cp/typeck.c:5631
+#: cp/typeck.c:5568 cp/typeck.c:5584
msgid "pointer to member cast via virtual base %qT"
msgstr ""
-#: cp/typeck.c:5634
+#: cp/typeck.c:5587
msgid "pointer to member conversion via virtual base %qT"
msgstr ""
-#: cp/typeck.c:5707
+#: cp/typeck.c:5660
msgid "invalid conversion to type %qT from type %qT"
msgstr ""
-#: cp/typeck.c:5871
-msgid "passing NULL used for non-pointer %s %P of %qD"
-msgstr ""
-
-#: cp/typeck.c:5874
-msgid "%s to non-pointer type %qT from NULL"
-msgstr ""
-
-#: cp/typeck.c:5882
-msgid "passing %qT for %s %P of %qD"
-msgstr ""
-
-#: cp/typeck.c:5885
-msgid "%s to %qT from %qT"
-msgstr ""
-
-#: cp/typeck.c:5894
-msgid "passing negative value %qE for %s %P of %qD"
-msgstr ""
-
-#: cp/typeck.c:5897
-msgid "%s of negative value %qE to %qT"
-msgstr ""
-
-#: cp/typeck.c:5983
+#: cp/typeck.c:5875
msgid "cannot convert %qT to %qT for argument %qP to %qD"
msgstr ""
-#: cp/typeck.c:5986
+#: cp/typeck.c:5878
msgid "cannot convert %qT to %qT in %s"
msgstr ""
-#: cp/typeck.c:6062 cp/typeck.c:6064
+#: cp/typeck.c:5951 cp/typeck.c:5953
msgid "in passing argument %P of %q+D"
msgstr ""
-#: cp/typeck.c:6114
+#: cp/typeck.c:6003
msgid "returning reference to temporary"
msgstr ""
-#: cp/typeck.c:6121
+#: cp/typeck.c:6010
msgid "reference to non-lvalue returned"
msgstr ""
-#: cp/typeck.c:6133
+#: cp/typeck.c:6022
msgid "reference to local variable %qD returned"
msgstr ""
-#: cp/typeck.c:6136
+#: cp/typeck.c:6025
msgid "address of local variable %qD returned"
msgstr ""
-#: cp/typeck.c:6166
+#: cp/typeck.c:6055
msgid "returning a value from a destructor"
msgstr ""
#. If a return statement appears in a handler of the
#. function-try-block of a constructor, the program is ill-formed.
-#: cp/typeck.c:6174
+#: cp/typeck.c:6063
msgid "cannot return from a handler of a function-try-block of a constructor"
msgstr ""
#. You can't return a value from a constructor.
-#: cp/typeck.c:6177
+#: cp/typeck.c:6066
msgid "returning a value from a constructor"
msgstr ""
-#: cp/typeck.c:6200
+#: cp/typeck.c:6089
msgid "return-statement with no value, in function returning %qT"
msgstr ""
-#: cp/typeck.c:6217
+#: cp/typeck.c:6106
msgid "return-statement with a value, in function returning 'void'"
msgstr ""
-#: cp/typeck.c:6248
+#: cp/typeck.c:6137
msgid ""
"%<operator new%> must not return NULL unless it is declared %<throw()%> (or -"
"fcheck-new is in effect)"
@@ -17280,154 +17464,154 @@ msgstr ""
msgid "%J since type %qT has pure virtual functions"
msgstr ""
-#: cp/typeck2.c:581
+#: cp/typeck2.c:582
msgid "constructor syntax used, but no constructor declared for type %qT"
msgstr ""
-#: cp/typeck2.c:595
+#: cp/typeck2.c:596
msgid "cannot initialize arrays using this syntax"
msgstr ""
-#: cp/typeck2.c:687
+#: cp/typeck2.c:688
msgid "initializing array with parameter list"
msgstr ""
-#: cp/typeck2.c:709
+#: cp/typeck2.c:710
msgid "int-array initialized from non-wide string"
msgstr ""
-#: cp/typeck2.c:742
+#: cp/typeck2.c:743
msgid "initializer for scalar variable requires one element"
msgstr ""
-#: cp/typeck2.c:749
+#: cp/typeck2.c:750
msgid "braces around scalar initializer for %qT"
msgstr ""
-#: cp/typeck2.c:752
+#: cp/typeck2.c:753
msgid "ignoring extra initializers for %qT"
msgstr ""
-#: cp/typeck2.c:764
+#: cp/typeck2.c:765
msgid "variable-sized object of type %qT may not be initialized"
msgstr ""
-#: cp/typeck2.c:775
+#: cp/typeck2.c:776
msgid "subobject of type %qT must be initialized by constructor, not by %qE"
msgstr ""
-#: cp/typeck2.c:841
+#: cp/typeck2.c:842
msgid "aggregate has a partly bracketed initializer"
msgstr ""
-#: cp/typeck2.c:879 cp/typeck2.c:968
+#: cp/typeck2.c:880 cp/typeck2.c:969
msgid "non-trivial labeled initializers"
msgstr ""
-#: cp/typeck2.c:893
+#: cp/typeck2.c:894
msgid "non-empty initializer for array of empty elements"
msgstr ""
-#: cp/typeck2.c:1007 cp/typeck2.c:1022
+#: cp/typeck2.c:1008 cp/typeck2.c:1023
msgid "missing initializer for member %qD"
msgstr ""
-#: cp/typeck2.c:1012
+#: cp/typeck2.c:1013
msgid "uninitialized const member %qD"
msgstr ""
-#: cp/typeck2.c:1014
+#: cp/typeck2.c:1015
msgid "member %qD with uninitialized const fields"
msgstr ""
-#: cp/typeck2.c:1016
+#: cp/typeck2.c:1017
msgid "member %qD is uninitialized reference"
msgstr ""
-#: cp/typeck2.c:1063
+#: cp/typeck2.c:1064
msgid "index value instead of field name in union initializer"
msgstr ""
-#: cp/typeck2.c:1075
+#: cp/typeck2.c:1076
msgid "no field %qD in union being initialized"
msgstr ""
-#: cp/typeck2.c:1083
+#: cp/typeck2.c:1084
msgid "union %qT with no named members cannot be initialized"
msgstr ""
-#: cp/typeck2.c:1118
+#: cp/typeck2.c:1119
msgid "excess elements in aggregate initializer"
msgstr ""
-#: cp/typeck2.c:1232
+#: cp/typeck2.c:1227
msgid "circular pointer delegation detected"
msgstr ""
-#: cp/typeck2.c:1245
+#: cp/typeck2.c:1240
msgid "base operand of %<->%> has non-pointer type %qT"
msgstr ""
-#: cp/typeck2.c:1269
+#: cp/typeck2.c:1264
msgid "result of %<operator->()%> yields non-pointer result"
msgstr ""
-#: cp/typeck2.c:1271
+#: cp/typeck2.c:1266
msgid "base operand of %<->%> is not a pointer"
msgstr ""
-#: cp/typeck2.c:1295
+#: cp/typeck2.c:1290
msgid "%qE cannot be used as a member pointer, since it is of type %qT"
msgstr ""
-#: cp/typeck2.c:1304
+#: cp/typeck2.c:1299
msgid ""
"cannot apply member pointer %qE to %qE, which is of non-aggregate type %qT"
msgstr ""
-#: cp/typeck2.c:1326
+#: cp/typeck2.c:1321
msgid "pointer to member type %qT incompatible with object type %qT"
msgstr ""
-#: cp/typeck2.c:1549
+#: cp/typeck2.c:1544
msgid "call to function %qD which throws incomplete type %q#T"
msgstr ""
-#: cp/typeck2.c:1552
+#: cp/typeck2.c:1547
msgid "call to function which throws incomplete type %q#T"
msgstr ""
#. XXX Not i18n clean.
-#: cp/cp-tree.h:3843
+#: cp/cp-tree.h:3884
#, c-format
msgid "%s is deprecated, please see the documentation for details"
msgstr ""
-#: fortran/f95-lang.c:243
+#: fortran/f95-lang.c:242
msgid "Unexpected type in truthvalue_conversion"
msgstr ""
-#: fortran/f95-lang.c:296
+#: fortran/f95-lang.c:295
#, c-format
msgid "can't open input file: %s"
msgstr ""
-#: fortran/f95-lang.c:623
+#: fortran/f95-lang.c:622
#, c-format
msgid "global register variable %qs used in nested function"
msgstr ""
-#: fortran/f95-lang.c:627
+#: fortran/f95-lang.c:626
#, c-format
msgid "register variable %qs used in nested function"
msgstr ""
-#: fortran/f95-lang.c:634
+#: fortran/f95-lang.c:633
#, c-format
msgid "address of global register variable %qs requested"
msgstr ""
-#: fortran/f95-lang.c:652
+#: fortran/f95-lang.c:651
#, c-format
msgid "address of register variable %qs requested"
msgstr ""
@@ -17446,82 +17630,82 @@ msgstr ""
msgid "no input files; unwilling to write output files"
msgstr ""
-#: fortran/trans-array.c:2888
+#: fortran/trans-array.c:2886
msgid "Possible frontend bug: array constructor not expanded"
msgstr ""
-#: fortran/trans-array.c:3991
+#: fortran/trans-array.c:3989
msgid ""
"Possible frontend bug: Deferred array size without pointer or allocatable "
"attribute."
msgstr ""
-#: fortran/trans-array.c:4151
+#: fortran/trans-array.c:4149
msgid "scalar vector subscript???"
msgstr ""
-#: fortran/trans-array.c:4425
+#: fortran/trans-array.c:4423
#, c-format
msgid "bad expression type during walk (%d)"
msgstr ""
-#: fortran/trans-const.c:329
+#: fortran/trans-const.c:327
#, c-format
msgid "gfc_conv_constant_to_tree(): invalid type: %s"
msgstr ""
-#: fortran/trans-decl.c:760
+#: fortran/trans-decl.c:754
msgid "intrinsic variable which isn't a procedure"
msgstr ""
-#: fortran/trans-decl.c:1899
+#: fortran/trans-decl.c:1893
msgid "Function does not return a value"
msgstr ""
#. I don't think this should ever happen.
-#: fortran/trans-decl.c:1998
+#: fortran/trans-decl.c:1992
#, c-format
msgid "module symbol %s in wrong namespace"
msgstr ""
-#: fortran/trans-decl.c:2012
+#: fortran/trans-decl.c:2006
#, c-format
msgid "backend decl for module variable %s already exists"
msgstr ""
-#: fortran/trans-decl.c:2094
+#: fortran/trans-decl.c:2088
#, c-format
msgid "unused parameter %qs"
msgstr ""
-#: fortran/trans-decl.c:2099
+#: fortran/trans-decl.c:2093
#, c-format
msgid "unused variable %qs"
msgstr ""
-#: fortran/trans-decl.c:2243
+#: fortran/trans-decl.c:2234
msgid "Function return value not set"
msgstr ""
-#: fortran/trans-expr.c:950
+#: fortran/trans-expr.c:949
msgid "Unknown intrinsic op"
msgstr ""
-#: fortran/trans-intrinsic.c:585
+#: fortran/trans-intrinsic.c:583
#, c-format
msgid "Intrinsic function %s(%d) not recognized"
msgstr ""
-#: fortran/trans-io.c:934
+#: fortran/trans-io.c:936
#, c-format
msgid "Bad namelist IO basetype (%d)"
msgstr ""
-#: fortran/trans-io.c:1011
+#: fortran/trans-io.c:1013
msgid "A format cannot be specified with a namelist"
msgstr ""
-#: fortran/trans-io.c:1309
+#: fortran/trans-io.c:1311
#, c-format
msgid "Bad IO basetype (%d)"
msgstr ""
@@ -17538,7 +17722,7 @@ msgstr ""
msgid "Array element size too big"
msgstr ""
-#: fortran/trans.c:623
+#: fortran/trans.c:621
msgid "gfc_trans_code(): Bad statement code"
msgstr ""
@@ -17548,27 +17732,27 @@ msgstr ""
msgid "gfc_todo: Not Implemented: "
msgstr ""
-#: java/check-init.c:245
+#: java/check-init.c:251
#, c-format
msgid "Can't reassign a value to the final variable %qs"
msgstr ""
-#: java/check-init.c:513 java/parse.h:377
+#: java/check-init.c:519 java/parse.h:377
#, c-format
msgid "Variable %qs may not have been initialized"
msgstr ""
-#: java/check-init.c:529
+#: java/check-init.c:535
#, c-format
msgid "variable %qs may not have been initialized"
msgstr ""
-#: java/check-init.c:941
+#: java/check-init.c:954
#, c-format
msgid "internal error in check-init: tree code not implemented: %s"
msgstr ""
-#: java/check-init.c:1013
+#: java/check-init.c:1026
msgid "%Jfinal field %qD may not have been initialized"
msgstr ""
@@ -17603,337 +17787,337 @@ msgstr ""
msgid "%Jnon-static method '%D' overrides static method"
msgstr ""
-#: java/decl.c:1203
+#: java/decl.c:1260
msgid "%J'%D' used prior to declaration"
msgstr ""
-#: java/decl.c:1244
+#: java/decl.c:1301
#, c-format
msgid "declaration of %qs shadows a parameter"
msgstr ""
-#: java/decl.c:1247
+#: java/decl.c:1304
#, c-format
msgid "declaration of %qs shadows a symbol from the parameter list"
msgstr ""
-#: java/decl.c:1575
+#: java/decl.c:1632
msgid "%Jlabel '%D' used but not defined"
msgstr ""
-#: java/decl.c:1580
+#: java/decl.c:1637
msgid "%Jlabel '%D' defined but not used"
msgstr ""
-#: java/decl.c:1702
+#: java/decl.c:1759
msgid "%JIn %D: overlapped variable and exception ranges at %d"
msgstr ""
-#: java/decl.c:1766
+#: java/decl.c:1823
msgid "bad type in parameter debug info"
msgstr ""
-#: java/decl.c:1775
+#: java/decl.c:1832
msgid "%Jbad PC range for debug info for local '%D'"
msgstr ""
-#: java/expr.c:375
+#: java/expr.c:376
#, c-format
msgid "need to insert runtime check for %s"
msgstr ""
-#: java/expr.c:500 java/expr.c:547
+#: java/expr.c:501 java/expr.c:548
#, c-format
msgid "assert: %s is assign compatible with %s"
msgstr ""
-#: java/expr.c:667
+#: java/expr.c:668
msgid "stack underflow - dup* operation"
msgstr ""
-#: java/expr.c:1699
+#: java/expr.c:1703
#, c-format
msgid "reference %qs is ambiguous: appears in interface %qs and interface %qs"
msgstr ""
-#: java/expr.c:1727
+#: java/expr.c:1731
#, c-format
msgid "field %qs not found"
msgstr ""
-#: java/expr.c:2112
+#: java/expr.c:2116
#, c-format
msgid "method '%s' not found in class"
msgstr ""
-#: java/expr.c:2317
+#: java/expr.c:2321
#, c-format
msgid "failed to find class '%s'"
msgstr ""
-#: java/expr.c:2346
+#: java/expr.c:2350
#, c-format
msgid "class '%s' has no method named '%s' matching signature '%s'"
msgstr ""
-#: java/expr.c:2377
+#: java/expr.c:2381
msgid "invokestatic on non static method"
msgstr ""
-#: java/expr.c:2382
+#: java/expr.c:2386
msgid "invokestatic on abstract method"
msgstr ""
-#: java/expr.c:2390
+#: java/expr.c:2394
msgid "invoke[non-static] on static method"
msgstr ""
-#: java/expr.c:2708
+#: java/expr.c:2712
#, c-format
msgid "missing field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2715
+#: java/expr.c:2719
#, c-format
msgid "mismatching signature for field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2737
+#: java/expr.c:2741
msgid "%Jassignment to final field '%D' not in field's class"
msgstr ""
-#: java/expr.c:2742
+#: java/expr.c:2746
msgid "%Jassignment to final static field %qD not in class initializer"
msgstr ""
-#: java/expr.c:2751
+#: java/expr.c:2755
msgid "%Jassignment to final field '%D' not in constructor"
msgstr ""
-#: java/expr.c:2941
+#: java/expr.c:2945
msgid "invalid PC in line number table"
msgstr ""
-#: java/expr.c:2995
+#: java/expr.c:3001
#, c-format
msgid "unreachable bytecode from %d to before %d"
msgstr ""
-#: java/expr.c:3037
+#: java/expr.c:3043
#, c-format
msgid "unreachable bytecode from %d to the end of the method"
msgstr ""
#. duplicate code from LOAD macro
-#: java/expr.c:3337
+#: java/expr.c:3343
msgid "unrecogized wide sub-instruction"
msgstr ""
-#: java/gjavah.c:695
+#: java/gjavah.c:701
msgid "static field has same name as method"
msgstr ""
#. FIXME: i18n bug here. Order of prints should not be
#. fixed.
-#: java/gjavah.c:891
+#: java/gjavah.c:899
#, c-format
msgid "ignored method '"
msgstr ""
-#: java/gjavah.c:893
+#: java/gjavah.c:901
#, c-format
msgid "' marked virtual\n"
msgstr ""
-#: java/gjavah.c:1241
+#: java/gjavah.c:1249
#, c-format
msgid "couldn't find class %s"
msgstr ""
-#: java/gjavah.c:1248
+#: java/gjavah.c:1256
#, c-format
msgid "parse error while reading %s"
msgstr ""
-#: java/gjavah.c:1474 java/gjavah.c:1576 java/gjavah.c:1651
+#: java/gjavah.c:1482 java/gjavah.c:1584 java/gjavah.c:1659
#, c-format
msgid "unparseable signature: '%s'"
msgstr ""
-#: java/gjavah.c:2041
+#: java/gjavah.c:2049
msgid "Not a valid Java .class file."
msgstr ""
-#: java/gjavah.c:2049 java/jcf-parse.c:739
+#: java/gjavah.c:2057 java/jcf-parse.c:746
msgid "error while parsing constant pool"
msgstr ""
-#: java/gjavah.c:2055
+#: java/gjavah.c:2063
#, c-format
msgid "error in constant pool entry #%d"
msgstr ""
-#: java/gjavah.c:2198
+#: java/gjavah.c:2206
msgid "class is of array type\n"
msgstr ""
-#: java/gjavah.c:2206
+#: java/gjavah.c:2214
msgid "base class is of array type"
msgstr ""
-#: java/gjavah.c:2322
+#: java/gjavah.c:2330
#, c-format
msgid "Try 'gcjh --help' for more information.\n"
msgstr ""
-#: java/gjavah.c:2329
+#: java/gjavah.c:2337
#, c-format
msgid ""
"Usage: gcjh [OPTION]... CLASS...\n"
"\n"
msgstr ""
-#: java/gjavah.c:2330
+#: java/gjavah.c:2338
#, c-format
msgid ""
"Generate C++ header files from .class files\n"
"\n"
msgstr ""
-#: java/gjavah.c:2331
+#: java/gjavah.c:2339
#, c-format
msgid " -stubs Generate an implementation stub file\n"
msgstr ""
-#: java/gjavah.c:2332
+#: java/gjavah.c:2340
#, c-format
msgid " -jni Generate a JNI header or stub\n"
msgstr ""
-#: java/gjavah.c:2334
+#: java/gjavah.c:2342
#, c-format
msgid " -add TEXT Insert TEXT into class body\n"
msgstr ""
-#: java/gjavah.c:2335
+#: java/gjavah.c:2343
#, c-format
msgid " -append TEXT Insert TEXT after class declaration\n"
msgstr ""
-#: java/gjavah.c:2336
+#: java/gjavah.c:2344
#, c-format
msgid " -friend TEXT Insert TEXT as 'friend' declaration\n"
msgstr ""
-#: java/gjavah.c:2337
+#: java/gjavah.c:2345
#, c-format
msgid " -prepend TEXT Insert TEXT before start of class\n"
msgstr ""
-#: java/gjavah.c:2339 java/jcf-dump.c:897
+#: java/gjavah.c:2347 java/jcf-dump.c:897
#, c-format
msgid " --classpath PATH Set path to find .class files\n"
msgstr ""
-#: java/gjavah.c:2340 java/jcf-dump.c:898
+#: java/gjavah.c:2348 java/jcf-dump.c:898
#, c-format
msgid " -IDIR Append directory to class path\n"
msgstr ""
-#: java/gjavah.c:2341 java/jcf-dump.c:899
+#: java/gjavah.c:2349 java/jcf-dump.c:899
#, c-format
msgid " --bootclasspath PATH Override built-in class path\n"
msgstr ""
-#: java/gjavah.c:2342 java/jcf-dump.c:900
+#: java/gjavah.c:2350 java/jcf-dump.c:900
#, c-format
msgid " --extdirs PATH Set extensions directory path\n"
msgstr ""
-#: java/gjavah.c:2343
+#: java/gjavah.c:2351
#, c-format
msgid " -d DIRECTORY Set output directory name\n"
msgstr ""
-#: java/gjavah.c:2344 java/jcf-dump.c:901 java/jv-scan.c:114
+#: java/gjavah.c:2352 java/jcf-dump.c:901 java/jv-scan.c:114
#, c-format
msgid " -o FILE Set output file name\n"
msgstr ""
-#: java/gjavah.c:2345
+#: java/gjavah.c:2353
#, c-format
msgid " -td DIRECTORY Set temporary directory name\n"
msgstr ""
-#: java/gjavah.c:2347 java/jcf-dump.c:903 java/jv-scan.c:116
+#: java/gjavah.c:2355 java/jcf-dump.c:903 java/jv-scan.c:116
#, c-format
msgid " --help Print this help, then exit\n"
msgstr ""
-#: java/gjavah.c:2348 java/jcf-dump.c:904 java/jv-scan.c:117
+#: java/gjavah.c:2356 java/jcf-dump.c:904 java/jv-scan.c:117
#, c-format
msgid " --version Print version number, then exit\n"
msgstr ""
-#: java/gjavah.c:2349 java/jcf-dump.c:905
+#: java/gjavah.c:2357 java/jcf-dump.c:905
#, c-format
msgid " -v, --verbose Print extra information while running\n"
msgstr ""
-#: java/gjavah.c:2351
+#: java/gjavah.c:2359
#, c-format
msgid ""
" -M Print all dependencies to stdout;\n"
" suppress ordinary output\n"
msgstr ""
-#: java/gjavah.c:2353
+#: java/gjavah.c:2361
#, c-format
msgid ""
" -MM Print non-system dependencies to stdout;\n"
" suppress ordinary output\n"
msgstr ""
-#: java/gjavah.c:2355
+#: java/gjavah.c:2363
#, c-format
msgid " -MD Print all dependencies to stdout\n"
msgstr ""
-#: java/gjavah.c:2356
+#: java/gjavah.c:2364
#, c-format
msgid " -MMD Print non-system dependencies to stdout\n"
msgstr ""
-#: java/gjavah.c:2359 java/jcf-dump.c:907 java/jv-scan.c:119
+#: java/gjavah.c:2367 java/jcf-dump.c:907 java/jv-scan.c:119
#, c-format
msgid ""
"For bug reporting instructions, please see:\n"
"%s.\n"
msgstr ""
-#: java/gjavah.c:2387 java/gjavah.c:2501
+#: java/gjavah.c:2395 java/gjavah.c:2509
msgid "no classes specified"
msgstr ""
-#: java/gjavah.c:2480
+#: java/gjavah.c:2488
msgid "'-MG' option is unimplemented"
msgstr ""
-#: java/gjavah.c:2509
+#: java/gjavah.c:2517
msgid "can't specify both -o and -MD"
msgstr ""
-#: java/gjavah.c:2520
+#: java/gjavah.c:2528
#, c-format
msgid "Processing %s\n"
msgstr ""
-#: java/gjavah.c:2526
+#: java/gjavah.c:2534
#, c-format
msgid "%s: no such class"
msgstr ""
-#: java/gjavah.c:2530
+#: java/gjavah.c:2538
#, c-format
msgid "Found in %s\n"
msgstr ""
@@ -17948,7 +18132,7 @@ msgstr ""
msgid "error while parsing constant pool\n"
msgstr ""
-#: java/jcf-dump.c:826 java/jcf-parse.c:742
+#: java/jcf-dump.c:826 java/jcf-parse.c:749
#, c-format
msgid "error in constant pool entry #%d\n"
msgstr ""
@@ -18024,53 +18208,53 @@ msgid ""
"file %qs used instead"
msgstr ""
-#: java/jcf-parse.c:362
+#: java/jcf-parse.c:366
msgid "bad string constant"
msgstr ""
-#: java/jcf-parse.c:380
+#: java/jcf-parse.c:384
#, c-format
msgid "bad value constant type %d, index %d"
msgstr ""
-#: java/jcf-parse.c:559
+#: java/jcf-parse.c:572
#, c-format
msgid "can't reopen %s: %m"
msgstr ""
-#: java/jcf-parse.c:566
+#: java/jcf-parse.c:579
#, c-format
msgid "can't close %s: %m"
msgstr ""
-#: java/jcf-parse.c:707 java/jcf-parse.c:713
+#: java/jcf-parse.c:714 java/jcf-parse.c:720
#, c-format
msgid "cannot find file for class %s"
msgstr ""
-#: java/jcf-parse.c:736
+#: java/jcf-parse.c:743
msgid "not a valid Java .class file"
msgstr ""
#. FIXME - where was first time
-#: java/jcf-parse.c:754
+#: java/jcf-parse.c:761
#, c-format
msgid "reading class %s for the second time from %s"
msgstr ""
-#: java/jcf-parse.c:772
+#: java/jcf-parse.c:779
msgid "error while parsing fields"
msgstr ""
-#: java/jcf-parse.c:775
+#: java/jcf-parse.c:782
msgid "error while parsing methods"
msgstr ""
-#: java/jcf-parse.c:778
+#: java/jcf-parse.c:785
msgid "error while parsing final attributes"
msgstr ""
-#: java/jcf-parse.c:795
+#: java/jcf-parse.c:802
msgid ""
"the %<java.lang.Object%> that was found in %qs didn't have the special zero-"
"length %<gnu.gcj.gcj-compiled%> attribute. This generally means that your "
@@ -18078,54 +18262,54 @@ msgid ""
"info page describing how to set the classpath"
msgstr ""
-#: java/jcf-parse.c:869
+#: java/jcf-parse.c:876
msgid "missing Code attribute"
msgstr ""
-#: java/jcf-parse.c:1129
+#: java/jcf-parse.c:1137
msgid "%Hsource file seen twice on command line and will be compiled only once"
msgstr ""
-#: java/jcf-parse.c:1144
+#: java/jcf-parse.c:1155
msgid "no input file specified"
msgstr ""
-#: java/jcf-parse.c:1176
+#: java/jcf-parse.c:1190
#, c-format
msgid "can't close input file %s: %m"
msgstr ""
-#: java/jcf-parse.c:1217
+#: java/jcf-parse.c:1231
#, c-format
msgid "bad zip/jar file %s"
msgstr ""
-#: java/jcf-parse.c:1433
+#: java/jcf-parse.c:1447
#, c-format
msgid "error while reading %s from zip file"
msgstr ""
-#: java/jcf-write.c:2656
+#: java/jcf-write.c:2667
#, c-format
msgid ""
"internal error in generate_bytecode_insn - tree code not implemented: %s"
msgstr ""
-#: java/jcf-write.c:3028
+#: java/jcf-write.c:3041
msgid "field initializer type mismatch"
msgstr ""
-#: java/jcf-write.c:3485
+#: java/jcf-write.c:3498
#, c-format
msgid "can't create directory %s: %m"
msgstr ""
-#: java/jcf-write.c:3518
+#: java/jcf-write.c:3531
#, c-format
msgid "can't open %s for writing: %m"
msgstr ""
-#: java/jcf-write.c:3538
+#: java/jcf-write.c:3551
#, c-format
msgid "can't create %s: %m"
msgstr ""
@@ -18180,26 +18364,26 @@ msgid ""
" --list-filename Print input filename when listing class names\n"
msgstr ""
-#: java/jv-scan.c:213
+#: java/jv-scan.c:190
msgid "only one of '--print-main', '--list-class', and '--complexity' allowed"
msgstr ""
-#: java/jv-scan.c:216
+#: java/jv-scan.c:193
#, c-format
msgid "can't open output file '%s'"
msgstr ""
-#: java/jv-scan.c:251
+#: java/jv-scan.c:229
#, c-format
msgid "file not found '%s'"
msgstr ""
-#: java/jv-scan.c:273
+#: java/jv-scan.c:251
#, c-format
msgid "%s: error: "
msgstr ""
-#: java/jv-scan.c:285
+#: java/jv-scan.c:263
#, c-format
msgid "%s: warning: "
msgstr ""
@@ -18252,15 +18436,15 @@ msgstr ""
msgid "cannot specify 'main' class when not linking"
msgstr ""
-#: java/lang.c:620
+#: java/lang.c:629
msgid "can't do dependency tracking with input from stdin"
msgstr ""
-#: java/lang.c:636
+#: java/lang.c:645
msgid "couldn't determine target name for dependency tracking"
msgstr ""
-#: java/lex.c:256
+#: java/lex.c:260
msgid ""
"unknown encoding: %qs\n"
"This might mean that your locale's encoding is not supported\n"
@@ -18269,7 +18453,7 @@ msgid ""
"%<--encoding=UTF-8%> option"
msgstr ""
-#: java/lex.c:627
+#: java/lex.c:631
msgid "internal error - bad unget"
msgstr ""
@@ -18282,986 +18466,1076 @@ msgstr ""
msgid "internal error - invalid Utf8 name"
msgstr ""
-#: java/parse-scan.y:881 java/parse.y:975
-#: java/parse.y:1316 java/parse.y:1377
-#: java/parse.y:1588 java/parse.y:1811
-#: java/parse.y:1820 java/parse.y:1831
-#: java/parse.y:1842 java/parse.y:1854
-#: java/parse.y:1869 java/parse.y:1886
-#: java/parse.y:1888 java/parse.y:1969
-#: java/parse.y:2146 java/parse.y:2215
-#: java/parse.y:2379 java/parse.y:2392
-#: java/parse.y:2399 java/parse.y:2406
-#: java/parse.y:2417 java/parse.y:2419
-#: java/parse.y:2457 java/parse.y:2459
-#: java/parse.y:2461 java/parse.y:2482
-#: java/parse.y:2484 java/parse.y:2486
-#: java/parse.y:2502 java/parse.y:2504
-#: java/parse.y:2525 java/parse.y:2527
-#: java/parse.y:2529 java/parse.y:2557
-#: java/parse.y:2559 java/parse.y:2561
-#: java/parse.y:2563 java/parse.y:2581
-#: java/parse.y:2583 java/parse.y:2594
-#: java/parse.y:2605 java/parse.y:2616
-#: java/parse.y:2627 java/parse.y:2638
-#: java/parse.y:2651 java/parse.y:2655
-#: java/parse.y:2657 java/parse.y:2670
+#: java/parse-scan.y:878
+#: java/parse.y:974
+#: java/parse.y:1315
+#: java/parse.y:1376
+#: java/parse.y:1587
+#: java/parse.y:1810
+#: java/parse.y:1819
+#: java/parse.y:1830
+#: java/parse.y:1841
+#: java/parse.y:1853
+#: java/parse.y:1868
+#: java/parse.y:1885
+#: java/parse.y:1887
+#: java/parse.y:1968
+#: java/parse.y:2145
+#: java/parse.y:2214
+#: java/parse.y:2378
+#: java/parse.y:2391
+#: java/parse.y:2398
+#: java/parse.y:2405
+#: java/parse.y:2416
+#: java/parse.y:2418
+#: java/parse.y:2456
+#: java/parse.y:2458
+#: java/parse.y:2460
+#: java/parse.y:2481
+#: java/parse.y:2483
+#: java/parse.y:2485
+#: java/parse.y:2501
+#: java/parse.y:2503
+#: java/parse.y:2524
+#: java/parse.y:2526
+#: java/parse.y:2528
+#: java/parse.y:2556
+#: java/parse.y:2558
+#: java/parse.y:2560
+#: java/parse.y:2562
+#: java/parse.y:2580
+#: java/parse.y:2582
+#: java/parse.y:2593
+#: java/parse.y:2604
+#: java/parse.y:2615
+#: java/parse.y:2626
+#: java/parse.y:2637
+#: java/parse.y:2650
+#: java/parse.y:2654
+#: java/parse.y:2656
+#: java/parse.y:2669
msgid "Missing term"
msgstr ""
-#: java/parse-scan.y:883 java/parse.y:749
-#: java/parse.y:787 java/parse.y:812
-#: java/parse.y:996 java/parse.y:1351
-#: java/parse.y:1564 java/parse.y:1566
-#: java/parse.y:1796 java/parse.y:1822
-#: java/parse.y:1833 java/parse.y:1844
-#: java/parse.y:1856 java/parse.y:1871
+#: java/parse-scan.y:880
+#: java/parse.y:748
+#: java/parse.y:786
+#: java/parse.y:811
+#: java/parse.y:995
+#: java/parse.y:1350
+#: java/parse.y:1563
+#: java/parse.y:1565
+#: java/parse.y:1795
+#: java/parse.y:1821
+#: java/parse.y:1832
+#: java/parse.y:1843
+#: java/parse.y:1855
+#: java/parse.y:1870
msgid "';' expected"
msgstr ""
-#: java/parse.y:747 java/parse.y:785
+#: java/parse-scan.y:1371
+#: java/parse.y:16420
+msgid "parse error"
+msgstr ""
+
+#: java/parse-scan.y:1373
+#: java/parse.y:16422
+msgid "parse error; also virtual memory exhausted"
+msgstr ""
+
+#: java/parse-scan.y:1375
+#: java/parse.y:16424
+msgid "parse error: cannot back up"
+msgstr ""
+
+#: java/parse.y:746
+#: java/parse.y:784
msgid "Missing name"
msgstr ""
-#: java/parse.y:775
+#: java/parse.y:774
#, c-format
msgid "Ambiguous class: %qs and %qs"
msgstr ""
-#: java/parse.y:810
+#: java/parse.y:809
msgid "'*' expected"
msgstr ""
-#: java/parse.y:824
+#: java/parse.y:823
msgid "Class or interface declaration expected"
msgstr ""
-#: java/parse.y:841
+#: java/parse.y:840
#, c-format
msgid "Modifier %qs declared twice"
msgstr ""
-#: java/parse.y:861 java/parse.y:863
+#: java/parse.y:860
+#: java/parse.y:862
msgid "Missing class name"
msgstr ""
-#: java/parse.y:866 java/parse.y:870
-#: java/parse.y:878 java/parse.y:1036
-#: java/parse.y:1297 java/parse.y:1299
-#: java/parse.y:1631 java/parse.y:1882
-#: java/parse.y:1914 java/parse.y:1976
+#: java/parse.y:865
+#: java/parse.y:869
+#: java/parse.y:877
+#: java/parse.y:1035
+#: java/parse.y:1296
+#: java/parse.y:1298
+#: java/parse.y:1630
+#: java/parse.y:1881
+#: java/parse.y:1913
+#: java/parse.y:1975
msgid "'{' expected"
msgstr ""
-#: java/parse.y:880
+#: java/parse.y:879
msgid "Missing super class name"
msgstr ""
-#: java/parse.y:890 java/parse.y:906
+#: java/parse.y:889
+#: java/parse.y:905
msgid "Missing interface name"
msgstr ""
-#: java/parse.y:990
+#: java/parse.y:989
msgid "Missing variable initializer"
msgstr ""
-#: java/parse.y:1007
+#: java/parse.y:1006
msgid "Invalid declaration"
msgstr ""
-#: java/parse.y:1010 java/parse.y:1095
-#: java/parse.y:2161 java/parse.y:2190
-#: java/parse.y:2212 java/parse.y:2216
-#: java/parse.y:2251 java/parse.y:2330
-#: java/parse.y:2340 java/parse.y:2350
+#: java/parse.y:1009
+#: java/parse.y:1094
+#: java/parse.y:2160
+#: java/parse.y:2189
+#: java/parse.y:2211
+#: java/parse.y:2215
+#: java/parse.y:2250
+#: java/parse.y:2329
+#: java/parse.y:2339
+#: java/parse.y:2349
msgid "']' expected"
msgstr ""
-#: java/parse.y:1014
+#: java/parse.y:1013
msgid "Unbalanced ']'"
msgstr ""
-#: java/parse.y:1050
+#: java/parse.y:1049
msgid "Invalid method declaration, method name required"
msgstr ""
-#: java/parse.y:1055 java/parse.y:1060
-#: java/parse.y:1065 java/parse.y:2064
+#: java/parse.y:1054
+#: java/parse.y:1059
+#: java/parse.y:1064
+#: java/parse.y:2063
msgid "Identifier expected"
msgstr ""
-#: java/parse.y:1070 java/parse.y:4742
+#: java/parse.y:1069
+#: java/parse.y:4741
msgid "Invalid method declaration, return type required"
msgstr ""
-#: java/parse.y:1090
+#: java/parse.y:1089
msgid "Discouraged form of returned type specification"
msgstr ""
-#: java/parse.y:1093 java/parse.y:1544
-#: java/parse.y:1551 java/parse.y:1560
-#: java/parse.y:1562 java/parse.y:1590
-#: java/parse.y:1699 java/parse.y:2006
-#: java/parse.y:2059
+#: java/parse.y:1092
+#: java/parse.y:1543
+#: java/parse.y:1550
+#: java/parse.y:1559
+#: java/parse.y:1561
+#: java/parse.y:1589
+#: java/parse.y:1698
+#: java/parse.y:2005
+#: java/parse.y:2058
msgid "')' expected"
msgstr ""
-#: java/parse.y:1109
+#: java/parse.y:1108
msgid "Missing formal parameter term"
msgstr ""
-#: java/parse.y:1124 java/parse.y:1129
+#: java/parse.y:1123
+#: java/parse.y:1128
msgid "Missing identifier"
msgstr ""
-#: java/parse.y:1149 java/parse.y:1158
+#: java/parse.y:1148
+#: java/parse.y:1157
msgid "Missing class type term"
msgstr ""
-#: java/parse.y:1185
+#: java/parse.y:1184
#, c-format
msgid ""
"Can't define static initializer in class %qs. Static initializer can only be "
"defined in top-level classes"
msgstr ""
-#: java/parse.y:1314
+#: java/parse.y:1313
msgid "Invalid interface type"
msgstr ""
-#: java/parse.y:1483
+#: java/parse.y:1482
msgid "An empty declaration is a deprecated feature that should not be used"
msgstr ""
-#: java/parse.y:1504 java/parse.y:1678
-#: java/parse.y:1680
+#: java/parse.y:1503
+#: java/parse.y:1677
+#: java/parse.y:1679
msgid "':' expected"
msgstr ""
-#: java/parse.y:1530 java/parse.y:1535
-#: java/parse.y:1540
+#: java/parse.y:1529
+#: java/parse.y:1534
+#: java/parse.y:1539
msgid "Invalid expression statement"
msgstr ""
-#: java/parse.y:1558 java/parse.y:1586
-#: java/parse.y:1627 java/parse.y:1695
-#: java/parse.y:1763 java/parse.y:1884
-#: java/parse.y:1962 java/parse.y:2053
-#: java/parse.y:2055 java/parse.y:2068
-#: java/parse.y:2311 java/parse.y:2313
+#: java/parse.y:1557
+#: java/parse.y:1585
+#: java/parse.y:1626
+#: java/parse.y:1694
+#: java/parse.y:1762
+#: java/parse.y:1883
+#: java/parse.y:1961
+#: java/parse.y:2052
+#: java/parse.y:2054
+#: java/parse.y:2067
+#: java/parse.y:2310
+#: java/parse.y:2312
msgid "'(' expected"
msgstr ""
-#: java/parse.y:1629
+#: java/parse.y:1628
msgid "Missing term or ')'"
msgstr ""
-#: java/parse.y:1676
+#: java/parse.y:1675
msgid "Missing or invalid constant expression"
msgstr ""
-#: java/parse.y:1697
+#: java/parse.y:1696
msgid "Missing term and ')' expected"
msgstr ""
-#: java/parse.y:1736
+#: java/parse.y:1735
msgid "Invalid control expression"
msgstr ""
-#: java/parse.y:1738 java/parse.y:1740
+#: java/parse.y:1737
+#: java/parse.y:1739
msgid "Invalid update expression"
msgstr ""
-#: java/parse.y:1765
+#: java/parse.y:1764
msgid "Invalid init statement"
msgstr ""
-#: java/parse.y:1965
+#: java/parse.y:1964
msgid "Missing term or ')' expected"
msgstr ""
-#: java/parse.y:2008
+#: java/parse.y:2007
msgid "'class' or 'this' expected"
msgstr ""
-#: java/parse.y:2010 java/parse.y:2012
+#: java/parse.y:2009
+#: java/parse.y:2011
msgid "'class' expected"
msgstr ""
-#: java/parse.y:2057
+#: java/parse.y:2056
msgid "')' or term expected"
msgstr ""
-#: java/parse.y:2159 java/parse.y:2188
+#: java/parse.y:2158
+#: java/parse.y:2187
msgid "'[' expected"
msgstr ""
-#: java/parse.y:2266
+#: java/parse.y:2265
msgid "Field expected"
msgstr ""
-#: java/parse.y:2325 java/parse.y:2335
-#: java/parse.y:2345
+#: java/parse.y:2324
+#: java/parse.y:2334
+#: java/parse.y:2344
msgid "Missing term and ']' expected"
msgstr ""
-#: java/parse.y:2450
+#: java/parse.y:2449
msgid "']' expected, invalid type expression"
msgstr ""
-#: java/parse.y:2453
+#: java/parse.y:2452
msgid "Invalid type expression"
msgstr ""
-#: java/parse.y:2565
+#: java/parse.y:2564
msgid "Invalid reference type"
msgstr ""
-#: java/parse.y:3032
+#: java/parse.y:3031
msgid "Constructor invocation must be first thing in a constructor"
msgstr ""
-#: java/parse.y:3034
+#: java/parse.y:3033
msgid "Only constructors can invoke constructors"
msgstr ""
-#: java/parse.y:3042
+#: java/parse.y:3041
#, c-format
msgid ": %qs JDK1.1(TM) feature"
msgstr ""
-#: java/parse.y:3122 java/parse.y:3124
+#: java/parse.y:3121
+#: java/parse.y:3123
#, c-format
msgid ""
"%s.\n"
"%s"
msgstr ""
-#: java/parse.y:3283
+#: java/parse.y:3282
msgid "Missing return statement"
msgstr ""
-#: java/parse.y:3305 java/parse.y:11937
-#: java/parse.y:11941
+#: java/parse.y:3304
+#: java/parse.y:11940
+#: java/parse.y:11944
msgid "Unreachable statement"
msgstr ""
-#: java/parse.y:3315
+#: java/parse.y:3314
msgid "Can't access %s field %<%s.%s%> from %qs"
msgstr ""
-#: java/parse.y:3384
+#: java/parse.y:3383
#, c-format
msgid "%s %qs already defined in %s:%d"
msgstr ""
-#: java/parse.y:3402
+#: java/parse.y:3401
msgid ""
"Variable %qs is already defined in this method and was declared %<%s %s%> at "
"line %d"
msgstr ""
-#: java/parse.y:3513
+#: java/parse.y:3512
#, c-format
msgid "Interface %qs repeated"
msgstr ""
-#: java/parse.y:3543
+#: java/parse.y:3542
#, c-format
msgid "%s name %qs clashes with imported type %qs"
msgstr ""
-#: java/parse.y:3575
+#: java/parse.y:3574
msgid "Public %s %qs must be defined in a file called %<%s.java%>"
msgstr ""
-#: java/parse.y:3590
+#: java/parse.y:3589
#, c-format
msgid ""
"Inner class %qs can't be static. Static classes can only occur in interfaces "
"and top-level classes"
msgstr ""
-#: java/parse.y:3671
+#: java/parse.y:3670
#, c-format
msgid ""
"The class name %qs is already defined in this scope. An inner class may not "
"have the same simple name as any of its enclosing classes"
msgstr ""
-#: java/parse.y:3713
+#: java/parse.y:3712
msgid "Qualifier must be a reference"
msgstr ""
-#: java/parse.y:3734
+#: java/parse.y:3733
#, c-format
msgid "Cyclic inheritance involving %s"
msgstr ""
-#: java/parse.y:3998
+#: java/parse.y:3997
msgid ""
"Redundant use of %<abstract%> modifier. Interface %qs is implicitly abstract"
msgstr ""
-#: java/parse.y:4153
+#: java/parse.y:4152
#, c-format
msgid "Class %qs can't be declared both abstract and final"
msgstr ""
-#: java/parse.y:4165
+#: java/parse.y:4164
msgid "%<java.lang.Object%> can't extend anything"
msgstr ""
-#: java/parse.y:4407
+#: java/parse.y:4406
msgid "Duplicate variable declaration: %<%s %s%> was %<%s %s%> (%s:%d)"
msgstr ""
-#: java/parse.y:4471
+#: java/parse.y:4470
#, c-format
msgid "Field %qs can't be static in inner class %qs unless it is final"
msgstr ""
-#: java/parse.y:4717
+#: java/parse.y:4716
#, c-format
msgid "Class %qs must be declared abstract to define abstract method %qs"
msgstr ""
-#: java/parse.y:4724
+#: java/parse.y:4723
#, c-format
msgid "native method %qs can't be strictfp"
msgstr ""
-#: java/parse.y:4728
+#: java/parse.y:4727
#, c-format
msgid "method %qs can't be transient"
msgstr ""
-#: java/parse.y:4731
+#: java/parse.y:4730
#, c-format
msgid "method %qs can't be volatile"
msgstr ""
-#: java/parse.y:4781 java/parse.y:6530
+#: java/parse.y:4780
+#: java/parse.y:6533
#, c-format
msgid ""
"Method %qs can't be static in inner class %qs. Only members of interfaces "
"and top-level classes can be static"
msgstr ""
-#: java/parse.y:4947
+#: java/parse.y:4946
#, c-format
msgid "%s method %qs can't have a body defined"
msgstr ""
-#: java/parse.y:4958
+#: java/parse.y:4957
#, c-format
msgid "Non native and non abstract method %qs must have a body defined"
msgstr ""
-#: java/parse.y:5029
+#: java/parse.y:5028
#, c-format
msgid "%s: recursive invocation of constructor %qs"
msgstr ""
-#: java/parse.y:5059
+#: java/parse.y:5058
msgid ""
"Inconsistent member declaration. At most one of %<public%>, %<private%>, or "
"%<protected%> may be specified"
msgstr ""
-#: java/parse.y:5067
+#: java/parse.y:5066
msgid ""
"Inconsistent member declaration. At most one of %<final%> or %<volatile%> "
"may be specified"
msgstr ""
-#: java/parse.y:5157
+#: java/parse.y:5156
#, c-format
msgid "Variable %qs is used more than once in the argument list of method %qs"
msgstr ""
-#: java/parse.y:5241
+#: java/parse.y:5240
#, c-format
msgid "%s %qs can't implement/extend %s %qs"
msgstr ""
-#: java/parse.y:5275
+#: java/parse.y:5274
#, c-format
msgid "Class %qs can't subclass %s %qs"
msgstr ""
-#: java/parse.y:5284
+#: java/parse.y:5283
#, c-format
msgid "Can't subclass final classes: %s"
msgstr ""
-#: java/parse.y:5470
+#: java/parse.y:5469
#, c-format
msgid "Cyclic class inheritance%s"
msgstr ""
-#: java/parse.y:6181
+#: java/parse.y:6184
#, c-format
msgid "Superclass %qs of class %qs not found"
msgstr ""
-#: java/parse.y:6187
+#: java/parse.y:6190
#, c-format
msgid "Type %qs not found in declaration of field %qs"
msgstr ""
-#: java/parse.y:6193
+#: java/parse.y:6196
#, c-format
msgid "Type %qs not found in the declaration of the argument %qs of method %qs"
msgstr ""
-#: java/parse.y:6200
+#: java/parse.y:6203
#, c-format
msgid "Type %qs not found in the declaration of the return type of method %qs"
msgstr ""
-#: java/parse.y:6206
+#: java/parse.y:6209
#, c-format
msgid "Superinterface %qs of %s %qs not found"
msgstr ""
-#: java/parse.y:6213
+#: java/parse.y:6216
#, c-format
msgid "Type %qs not found in the declaration of the local variable %qs"
msgstr ""
-#: java/parse.y:6220
+#: java/parse.y:6223
msgid "Class %qs not found in %<throws%>"
msgstr ""
-#: java/parse.y:6277
+#: java/parse.y:6280
#, c-format
msgid "Duplicate %s declaration %qs"
msgstr ""
-#: java/parse.y:6351
+#: java/parse.y:6354
msgid ""
"Class %qs doesn't define the abstract method %<%s %s%> from %s %<%s%>. This "
"method must be defined or %s %qs must be declared abstract"
msgstr ""
-#: java/parse.y:6507
+#: java/parse.y:6510
msgid ""
"Class %qs in %<throws%> clause must be a subclass of class %<java.lang."
"Throwable%>"
msgstr ""
-#: java/parse.y:6551
+#: java/parse.y:6554
#, c-format
msgid ""
"Class %qs must override %qs with a public method in order to implement "
"interface %qs"
msgstr ""
-#: java/parse.y:6565 java/parse.y:6792
+#: java/parse.y:6568
+#: java/parse.y:6795
#, c-format
msgid "Method %qs was defined with return type %qs in class %qs"
msgstr ""
-#: java/parse.y:6582
+#: java/parse.y:6585
#, c-format
msgid "%s methods can't be overridden. Method %qs is %s in class %qs"
msgstr ""
-#: java/parse.y:6596
+#: java/parse.y:6599
#, c-format
msgid ""
"Instance methods can't be overridden by a static method. Method %qs is an "
"instance method in class %qs"
msgstr ""
-#: java/parse.y:6619
+#: java/parse.y:6622
#, c-format
msgid ""
"Methods can't be overridden to be more private. Method %qs is not %s in "
"class %qs"
msgstr ""
-#: java/parse.y:6760
+#: java/parse.y:6763
msgid ""
"Invalid checked exception class %qs in %<throws%> clause. The exception "
"must be a subclass of an exception thrown by %qs from class %qs"
msgstr ""
-#: java/parse.y:6817
+#: java/parse.y:6820
#, c-format
msgid ""
"Interface %qs inherits method %qs from interface %qs. This method is "
"redefined with a different return type in interface %qs"
msgstr ""
-#: java/parse.y:6992
+#: java/parse.y:6995
#, c-format
msgid "Class or interface %qs not found in import"
msgstr ""
-#: java/parse.y:7077
+#: java/parse.y:7080
#, c-format
msgid "malformed .zip archive in CLASSPATH: %s"
msgstr ""
-#: java/parse.y:7148
+#: java/parse.y:7151
#, c-format
msgid ""
"Can't find default package %qs. Check the CLASSPATH environment variable and "
"the access to the archives"
msgstr ""
-#: java/parse.y:7153
+#: java/parse.y:7156
#, c-format
msgid "Package %qs not found in import"
msgstr ""
-#: java/parse.y:7250
+#: java/parse.y:7253
#, c-format
msgid "Type %qs also potentially defined in package %qs"
msgstr ""
-#: java/parse.y:7395
+#: java/parse.y:7398
#, c-format
msgid "Nested %s %s is %s; cannot be accessed from here"
msgstr ""
-#: java/parse.y:7433
+#: java/parse.y:7436
#, c-format
msgid ""
"Can't access %s %qs. Only public classes and interfaces in other packages "
"can be accessed"
msgstr ""
-#: java/parse.y:7471
+#: java/parse.y:7474
msgid "Only %<final%> is allowed as a local variables modifier"
msgstr ""
-#: java/parse.y:9025
+#: java/parse.y:9028
#, c-format
msgid "No constructor matching %qs found in class %qs"
msgstr ""
-#: java/parse.y:9525
+#: java/parse.y:9528
#, c-format
msgid "Can't reference %qs before the superclass constructor has been called"
msgstr ""
-#: java/parse.y:9579
+#: java/parse.y:9582
#, c-format
msgid ""
"Local variable %qs can't be accessed from within the inner class %qs unless "
"it is declared final"
msgstr ""
-#: java/parse.y:9584 java/parse.y:10047
+#: java/parse.y:9587
+#: java/parse.y:10050
#, c-format
msgid "Undefined variable %qs"
msgstr ""
-#: java/parse.y:9595
+#: java/parse.y:9598
#, c-format
msgid "Can't make a static reference to nonstatic variable %qs in class %qs"
msgstr ""
-#: java/parse.y:9801 java/parse.y:10656
+#: java/parse.y:9804
+#: java/parse.y:10659
#, c-format
msgid "No enclosing instance for inner class %qs is in scope%s"
msgstr ""
-#: java/parse.y:9920 java/parse.y:12369
+#: java/parse.y:9923
+#: java/parse.y:12372
msgid "Keyword %<this%> used outside allowed context"
msgstr ""
-#: java/parse.y:9926 java/parse.y:10810
+#: java/parse.y:9929
+#: java/parse.y:10813
msgid ""
"Can't reference %<this%> before the superclass constructor has been called"
msgstr ""
-#: java/parse.y:9942
+#: java/parse.y:9945
msgid ""
"Can't use variable %<%s.this%>: type %qs isn't an outer type of type %qs"
msgstr ""
-#: java/parse.y:9975
+#: java/parse.y:9978
msgid "Keyword %<super%> used outside allowed context"
msgstr ""
-#: java/parse.y:10024
+#: java/parse.y:10027
#, c-format
msgid "No variable %qs defined in class %qs"
msgstr ""
-#: java/parse.y:10029
+#: java/parse.y:10032
#, c-format
msgid "Undefined variable or class name: %qs"
msgstr ""
-#: java/parse.y:10100
+#: java/parse.y:10103
#, c-format
msgid "Can't use type %qs as a qualifier"
msgstr ""
-#: java/parse.y:10119
+#: java/parse.y:10122
msgid "Attempt to reference field %qs in %<%s %s%>"
msgstr ""
-#: java/parse.y:10150
+#: java/parse.y:10153
#, c-format
msgid "No variable %qs defined in type %qs"
msgstr ""
-#: java/parse.y:10234
+#: java/parse.y:10237
msgid "Attempt to reference field %<new%> in a %qs"
msgstr ""
-#: java/parse.y:10371
+#: java/parse.y:10374
#, c-format
msgid "The class %qs has been deprecated"
msgstr ""
-#: java/parse.y:10381
+#: java/parse.y:10384
#, c-format
msgid "The %s %qs in class %qs has been deprecated"
msgstr ""
-#: java/parse.y:10498
+#: java/parse.y:10501
#, c-format
msgid "Can't invoke a method on primitive type %qs"
msgstr ""
-#: java/parse.y:10513
+#: java/parse.y:10516
#, c-format
msgid "Can't make static reference to method %qs in interface %qs"
msgstr ""
-#: java/parse.y:10523 java/parse.y:10857
+#: java/parse.y:10526
+#: java/parse.y:10860
msgid "Can't make static reference to method %<%s %s%> in class %qs"
msgstr ""
-#: java/parse.y:10563
+#: java/parse.y:10566
msgid "Can't invoke super constructor on java.lang.Object"
msgstr ""
-#: java/parse.y:10576 java/parse.y:14433
+#: java/parse.y:10579
+#: java/parse.y:14437
#, c-format
msgid "Class %qs not found in type declaration"
msgstr ""
-#: java/parse.y:10588
+#: java/parse.y:10591
#, c-format
msgid "Class %qs is an abstract class. It can't be instantiated"
msgstr ""
-#: java/parse.y:10618
+#: java/parse.y:10621
#, c-format
msgid "No method named %qs in scope"
msgstr ""
-#: java/parse.y:10729
+#: java/parse.y:10732
msgid "Can't access %s %s %<%s.%s%> from %qs"
msgstr ""
-#: java/parse.y:11203
+#: java/parse.y:11206
msgid "Can't find %s %<%s(%s)%> in type %qs%s"
msgstr ""
-#: java/parse.y:11783
+#: java/parse.y:11786
msgid "Constant expression required"
msgstr ""
-#: java/parse.y:11796
+#: java/parse.y:11799
msgid "Incompatible type for case. Can't convert %qs to %<int%>"
msgstr ""
-#: java/parse.y:11830
+#: java/parse.y:11833
msgid "Duplicate case label: %<default%>"
msgstr ""
-#: java/parse.y:12178
+#: java/parse.y:12181
msgid "Incompatible type for %<+=%>. Can't convert %qs to %<java.lang.String%>"
msgstr ""
-#: java/parse.y:12349
+#: java/parse.y:12352
#, c-format
msgid "missing static field %qs"
msgstr ""
-#: java/parse.y:12354
+#: java/parse.y:12357
#, c-format
msgid "not a static field %qs"
msgstr ""
-#: java/parse.y:12377
+#: java/parse.y:12380
msgid ""
"Can't reference %<this%> or %<super%> before the superclass constructor has "
"been called"
msgstr ""
-#: java/parse.y:12397
+#: java/parse.y:12400
#, c-format
msgid "No case for %s"
msgstr ""
-#: java/parse.y:12827
+#: java/parse.y:12830
msgid "Invalid left hand side of assignment"
msgstr ""
-#: java/parse.y:12878
+#: java/parse.y:12881
#, c-format
msgid "Incompatible type for %s. Can't convert %qs to %qs"
msgstr ""
-#: java/parse.y:12881
+#: java/parse.y:12884
#, c-format
msgid "Incompatible type for %s. Explicit cast needed to convert %qs to %qs"
msgstr ""
-#: java/parse.y:13054
+#: java/parse.y:13057
#, c-format
msgid ""
"Constant expression %qs too wide for narrowing primitive conversion to %qs"
msgstr ""
-#: java/parse.y:13345
+#: java/parse.y:13348
#, c-format
msgid "unregistered operator %s"
msgstr ""
-#: java/parse.y:13494
+#: java/parse.y:13497
msgid ""
"Evaluating this expression will result in an arithmetic exception being "
"thrown"
msgstr ""
-#: java/parse.y:13576
+#: java/parse.y:13579
#, c-format
msgid ""
"Incompatible type for %qs. Explicit cast needed to convert shift distance "
"from %qs to integral"
msgstr ""
-#: java/parse.y:13581
+#: java/parse.y:13584
#, c-format
msgid ""
"Incompatible type for %qs. Can't convert shift distance from %qs to integral"
msgstr ""
-#: java/parse.y:13657
+#: java/parse.y:13660
msgid "Invalid argument %qs for %<instanceof%>"
msgstr ""
-#: java/parse.y:13684
+#: java/parse.y:13687
#, c-format
msgid "Impossible for %qs to be instance of %qs"
msgstr ""
-#: java/parse.y:13813
+#: java/parse.y:13818
#, c-format
msgid "Incompatible type for %qs. Can't convert %qs to %qs"
msgstr ""
-#: java/parse.y:14294
+#: java/parse.y:14298
#, c-format
msgid "Invalid argument type %qs to %qs"
msgstr ""
-#: java/parse.y:14524
+#: java/parse.y:14528
#, c-format
msgid "Invalid cast from %qs to %qs"
msgstr ""
-#: java/parse.y:14571
+#: java/parse.y:14575
msgid "%<[]%> can only be applied to arrays. It can't be applied to %qs"
msgstr ""
-#: java/parse.y:14584
+#: java/parse.y:14588
msgid ""
"Incompatible type for %<[]%>. Explicit cast needed to convert %qs to %<int%>"
msgstr ""
-#: java/parse.y:14588
+#: java/parse.y:14592
msgid "Incompatible type for %<[]%>. Can't convert %qs to %<int%>"
msgstr ""
-#: java/parse.y:14659
+#: java/parse.y:14663
msgid ""
"Incompatible type for dimension in array creation expression. %s convert %qs "
"to %<int%>"
msgstr ""
-#: java/parse.y:14775
+#: java/parse.y:14779
#, c-format
msgid "Invalid array initializer for non-array type %qs"
msgstr ""
-#: java/parse.y:14862
+#: java/parse.y:14866
#, c-format
msgid "Incompatible type for array. %s convert %qs to %qs"
msgstr ""
-#: java/parse.y:14931
+#: java/parse.y:14935
msgid "%<return%> inside instance initializer"
msgstr ""
-#: java/parse.y:14935
+#: java/parse.y:14939
msgid "%<return%> inside static initializer"
msgstr ""
-#: java/parse.y:14941
+#: java/parse.y:14945
msgid "%<return%> with%s value from %<%s %s%>"
msgstr ""
-#: java/parse.y:14948
+#: java/parse.y:14952
msgid "%<return%> with value from constructor %qs"
msgstr ""
-#: java/parse.y:15013
+#: java/parse.y:15017
msgid "Incompatible type for %<if%>. Can't convert %qs to %<boolean%>"
msgstr ""
-#: java/parse.y:15046
+#: java/parse.y:15050
#, c-format
msgid "Declaration of %qs shadows a previous label declaration"
msgstr ""
-#: java/parse.y:15051
+#: java/parse.y:15055
#, c-format
msgid "This is the location of the previous declaration of label %qs"
msgstr ""
-#: java/parse.y:15298
+#: java/parse.y:15302
#, c-format
msgid "No label definition found for %qs"
msgstr ""
-#: java/parse.y:15311
+#: java/parse.y:15315
msgid "%<continue%> must be in loop"
msgstr ""
-#: java/parse.y:15314
+#: java/parse.y:15318
#, c-format
msgid "continue label %qs does not name a loop"
msgstr ""
-#: java/parse.y:15335
+#: java/parse.y:15339
msgid "%<break%> must be in loop or switch"
msgstr ""
-#: java/parse.y:15376
+#: java/parse.y:15380
msgid ""
"Incompatible type for loop conditional. Can't convert %qs to %<boolean%>"
msgstr ""
-#: java/parse.y:15414
+#: java/parse.y:15418
msgid "Incompatible type for %<switch%>. Can't convert %qs to %<int%>"
msgstr ""
#. The case_label_list is in reverse order, so print the
#. outer label first.
-#: java/parse.y:15445
+#: java/parse.y:15449
msgid "duplicate case label: %<"
msgstr ""
-#: java/parse.y:15446
+#: java/parse.y:15450
msgid "%>"
msgstr ""
-#: java/parse.y:15449
+#: java/parse.y:15453
msgid "original label is here"
msgstr ""
-#: java/parse.y:15666
+#: java/parse.y:15670
msgid ""
"Can't catch class %qs. Catch clause parameter type must be a subclass of "
"class %<java.lang.Throwable%>"
msgstr ""
-#: java/parse.y:15690
+#: java/parse.y:15694
msgid "%<catch%> not reached because of the catch clause at line %d"
msgstr ""
-#: java/parse.y:15757
+#: java/parse.y:15761
msgid ""
"Incompatible type for %<synchronized%>. Can't convert %qs to %<java.lang."
"Object%>"
msgstr ""
-#: java/parse.y:15816
+#: java/parse.y:15820
msgid "Can't throw %qs; it must be a subclass of class %<java.lang.Throwable%>"
msgstr ""
-#: java/parse.y:15845
+#: java/parse.y:15849
msgid ""
"Checked exception %qs can't be thrown in instance initializer (not all "
"declared constructor are declaring it in their %<throws%> clause)"
msgstr ""
-#: java/parse.y:15866
+#: java/parse.y:15870
msgid ""
"Checked exception %qs can't be caught by any of the catch clause(s) of the "
"surrounding %<try%> block"
msgstr ""
-#: java/parse.y:15879
+#: java/parse.y:15883
#, c-format
msgid "Checked exception %qs can't be thrown in initializer"
msgstr ""
-#: java/parse.y:15883
+#: java/parse.y:15887
msgid "Checked exception %qs isn't thrown from a %<try%> block"
msgstr ""
-#: java/parse.y:15889
+#: java/parse.y:15893
msgid ""
"Checked exception %qs doesn't match any of current method's %<throws%> "
"declaration(s)"
msgstr ""
-#: java/parse.y:15944
+#: java/parse.y:15948
#, c-format
msgid "Exception %qs can't be thrown in initializer"
msgstr ""
-#: java/parse.y:15949
+#: java/parse.y:15953
msgid ""
"Exception %qs must be caught, or it must be declared in the %<throws%> "
"clause of %qs"
msgstr ""
-#: java/parse.y:16060
+#: java/parse.y:16066
msgid "Incompatible type for %<?:%>. Can't convert %qs to %<boolean%>"
msgstr ""
-#: java/parse.y:16128
+#: java/parse.y:16134
msgid "Incompatible type for %<?:%>. Can't convert %qs to %qs"
msgstr ""
-#: java/typeck.c:547
+#: java/typeck.c:533
msgid "junk at end of signature string"
msgstr ""
-#: java/verify-glue.c:393
+#: java/verify-glue.c:408
#, c-format
msgid "verification failed: %s"
msgstr ""
-#: java/verify-glue.c:395
+#: java/verify-glue.c:410
#, c-format
msgid "verification failed at PC=%d: %s"
msgstr ""
-#: java/verify-glue.c:479 java/verify.c:514
+#: java/verify-glue.c:494 java/verify.c:480
msgid "bad pc in exception_table"
msgstr ""
-#: java/verify.c:1516
+#: java/verify.c:1476
#, c-format
msgid "unknown opcode %d@pc=%d during verification"
msgstr ""
-#: java/verify.c:1591 java/verify.c:1607 java/verify.c:1612
+#: java/verify.c:1551 java/verify.c:1567 java/verify.c:1572
#, c-format
msgid "verification error at PC=%d"
msgstr ""
@@ -19310,175 +19584,175 @@ msgstr ""
msgid "Incompatible type for %qs. Can't convert %qs to integral"
msgstr ""
-#: objc/objc-act.c:753
+#: objc/objc-act.c:756
msgid "%<@end%> must appear in an @implementation context"
msgstr ""
-#: objc/objc-act.c:780
+#: objc/objc-act.c:783
msgid "method declaration not in @interface context"
msgstr ""
-#: objc/objc-act.c:791
+#: objc/objc-act.c:794
msgid "method definition not in @implementation context"
msgstr ""
-#: objc/objc-act.c:901
+#: objc/objc-act.c:925
#, c-format
msgid "object does not conform to the %qs protocol"
msgstr ""
-#: objc/objc-act.c:991 objc/objc-act.c:1068
+#: objc/objc-act.c:1015 objc/objc-act.c:1092
#, c-format
msgid "class %qs does not implement the %qs protocol"
msgstr ""
-#: objc/objc-act.c:1174
+#: objc/objc-act.c:1198
#, c-format
msgid "statically allocated instance of Objective-C class %qs"
msgstr ""
-#: objc/objc-act.c:1231
+#: objc/objc-act.c:1269
#, c-format
msgid "protocol %qs has circular dependency"
msgstr ""
-#: objc/objc-act.c:1253 objc/objc-act.c:5831
+#: objc/objc-act.c:1291 objc/objc-act.c:5881
#, c-format
msgid "cannot find protocol declaration for %qs"
msgstr ""
-#: objc/objc-act.c:1649 objc/objc-act.c:2783 objc/objc-act.c:6359
-#: objc/objc-act.c:6685 objc/objc-act.c:6738 objc/objc-act.c:6763
+#: objc/objc-act.c:1687 objc/objc-act.c:2836 objc/objc-act.c:6409
+#: objc/objc-act.c:6735 objc/objc-act.c:6788 objc/objc-act.c:6813
#, c-format
msgid "cannot find interface declaration for %qs"
msgstr ""
-#: objc/objc-act.c:1653
+#: objc/objc-act.c:1691
#, c-format
msgid "interface %qs does not have valid constant string layout"
msgstr ""
-#: objc/objc-act.c:1658
+#: objc/objc-act.c:1696
#, c-format
msgid "cannot find reference tag for class %qs"
msgstr ""
-#: objc/objc-act.c:2330
-msgid "%Jcreating selector for nonexistent method %qE"
+#: objc/objc-act.c:2374
+msgid "%Hcreating selector for nonexistent method %qE"
msgstr ""
-#: objc/objc-act.c:2518
+#: objc/objc-act.c:2563
#, c-format
msgid "%qs is not an Objective-C class name or alias"
msgstr ""
-#: objc/objc-act.c:2633 objc/objc-act.c:2651 objc/objc-act.c:6622
-#: objc/objc-act.c:6919 objc/objc-act.c:6949
+#: objc/objc-act.c:2678 objc/objc-act.c:2696 objc/objc-act.c:6672
+#: objc/objc-act.c:6964 objc/objc-act.c:6994
msgid "Objective-C declarations may only appear in global scope"
msgstr ""
-#: objc/objc-act.c:2638
+#: objc/objc-act.c:2683
#, c-format
msgid "cannot find class %qs"
msgstr ""
-#: objc/objc-act.c:2640
+#: objc/objc-act.c:2685
#, c-format
msgid "class %qs already exists"
msgstr ""
-#: objc/objc-act.c:2665 objc/objc-act.c:6654
+#: objc/objc-act.c:2716 objc/objc-act.c:6704
#, c-format
msgid "%qs redeclared as different kind of symbol"
msgstr ""
-#: objc/objc-act.c:2667 objc/objc-act.c:6656
+#: objc/objc-act.c:2718 objc/objc-act.c:6706
msgid "%Jprevious declaration of '%D'"
msgstr ""
-#: objc/objc-act.c:2893
+#: objc/objc-act.c:2946
msgid "use %<-fobjc-exceptions%> to enable Objective-C exception syntax"
msgstr ""
-#: objc/objc-act.c:3222
+#: objc/objc-act.c:3275
msgid "@catch parameter is not a known Objective-C class type"
msgstr ""
-#: objc/objc-act.c:3238
+#: objc/objc-act.c:3291
msgid "exception of type %<%T%> will be caught"
msgstr ""
-#: objc/objc-act.c:3240
+#: objc/objc-act.c:3293
msgid "%H by earlier handler for %<%T%>"
msgstr ""
-#: objc/objc-act.c:3293
+#: objc/objc-act.c:3346
msgid "%<@try%> without %<@catch%> or %<@finally%>"
msgstr ""
-#: objc/objc-act.c:3340
+#: objc/objc-act.c:3393
msgid "%<@throw%> (rethrow) used outside of a @catch block"
msgstr ""
-#: objc/objc-act.c:3716
+#: objc/objc-act.c:3758
msgid "%Jtype '%D' does not have a known size"
msgstr ""
-#: objc/objc-act.c:4229
+#: objc/objc-act.c:4271
msgid "%J%s %qs"
msgstr ""
-#: objc/objc-act.c:4252 objc/objc-act.c:4271
+#: objc/objc-act.c:4294 objc/objc-act.c:4313
msgid "inconsistent instance variable specification"
msgstr ""
-#: objc/objc-act.c:5127
+#: objc/objc-act.c:5169
msgid "can not use an object as parameter to a method"
msgstr ""
-#: objc/objc-act.c:5329
+#: objc/objc-act.c:5377
msgid "multiple %s named %<%c%s%> found"
msgstr ""
-#: objc/objc-act.c:5554
+#: objc/objc-act.c:5602
#, c-format
msgid "no super class declared in @interface for %qs"
msgstr ""
-#: objc/objc-act.c:5595
+#: objc/objc-act.c:5645
msgid "found %<-%s%> instead of %<+%s%> in protocol(s)"
msgstr ""
-#: objc/objc-act.c:5654
+#: objc/objc-act.c:5704
#, c-format
msgid "invalid receiver type %qs"
msgstr ""
-#: objc/objc-act.c:5669
+#: objc/objc-act.c:5719
msgid "%<%c%s%> not found in protocol(s)"
msgstr ""
-#: objc/objc-act.c:5683
+#: objc/objc-act.c:5733
msgid "%qs may not respond to %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:5691
+#: objc/objc-act.c:5741
msgid "no %<%c%s%> method found"
msgstr ""
-#: objc/objc-act.c:5697
+#: objc/objc-act.c:5747
msgid "(Messages without a matching method signature"
msgstr ""
-#: objc/objc-act.c:5698
+#: objc/objc-act.c:5748
msgid "will be assumed to return %<id%> and accept"
msgstr ""
-#: objc/objc-act.c:5699
+#: objc/objc-act.c:5749
msgid "%<...%> as arguments.)"
msgstr ""
-#: objc/objc-act.c:5930
+#: objc/objc-act.c:5980
#, c-format
msgid "undeclared selector %qs"
msgstr ""
@@ -19492,167 +19766,163 @@ msgstr ""
#. to an instance variable. It's better to catch the cases
#. where this is done unknowingly than to support the above
#. paradigm.
-#: objc/objc-act.c:5972
+#: objc/objc-act.c:6022
#, c-format
msgid "instance variable %qs accessed in class method"
msgstr ""
-#: objc/objc-act.c:6184
+#: objc/objc-act.c:6234
msgid "duplicate declaration of method %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:6229
+#: objc/objc-act.c:6279
msgid "duplicate interface declaration for category %<%s(%s)%>"
msgstr ""
-#: objc/objc-act.c:6256
+#: objc/objc-act.c:6306
#, c-format
msgid "illegal reference type specified for instance variable %qs"
msgstr ""
-#: objc/objc-act.c:6267
+#: objc/objc-act.c:6317
#, c-format
msgid "instance variable %qs has unknown size"
msgstr ""
#. vtable pointers are Real Bad(tm), since Obj-C cannot initialize them
-#: objc/objc-act.c:6281
+#: objc/objc-act.c:6331
#, c-format
msgid "type %qs has virtual member functions"
msgstr ""
-#: objc/objc-act.c:6282
+#: objc/objc-act.c:6332
#, c-format
msgid "illegal aggregate type %qs specified for instance variable %qs"
msgstr ""
-#: objc/objc-act.c:6290
+#: objc/objc-act.c:6340
#, c-format
msgid "type %qs has a user-defined constructor"
msgstr ""
-#: objc/objc-act.c:6292
+#: objc/objc-act.c:6342
#, c-format
msgid "type %qs has a user-defined destructor"
msgstr ""
-#: objc/objc-act.c:6293
+#: objc/objc-act.c:6343
msgid ""
"C++ constructors and destructors will not be invoked for Objective-C fields"
msgstr ""
-#: objc/objc-act.c:6383
+#: objc/objc-act.c:6433
#, c-format
msgid "instance variable %qs is declared private"
msgstr ""
-#: objc/objc-act.c:6392
+#: objc/objc-act.c:6442
#, c-format
msgid "instance variable %qs is %s; this will be a hard error in the future"
msgstr ""
-#: objc/objc-act.c:6399
+#: objc/objc-act.c:6449
#, c-format
msgid "instance variable %qs is declared %s"
msgstr ""
-#: objc/objc-act.c:6409
+#: objc/objc-act.c:6459
msgid "static access to object of type %<id%>"
msgstr ""
-#: objc/objc-act.c:6431 objc/objc-act.c:6519
+#: objc/objc-act.c:6481 objc/objc-act.c:6569
#, c-format
msgid "incomplete implementation of class %qs"
msgstr ""
-#: objc/objc-act.c:6435 objc/objc-act.c:6524
+#: objc/objc-act.c:6485 objc/objc-act.c:6574
#, c-format
msgid "incomplete implementation of category %qs"
msgstr ""
-#: objc/objc-act.c:6440 objc/objc-act.c:6529
+#: objc/objc-act.c:6490 objc/objc-act.c:6579
msgid "method definition for %<%c%s%> not found"
msgstr ""
-#: objc/objc-act.c:6570
+#: objc/objc-act.c:6620
#, c-format
msgid "%s %qs does not fully implement the %qs protocol"
msgstr ""
-#: objc/objc-act.c:6628 objc/objc-act.c:8177
+#: objc/objc-act.c:6678 objc/objc-act.c:8272
msgid "%<@end%> missing in implementation context"
msgstr ""
-#: objc/objc-act.c:6641
+#: objc/objc-act.c:6691
#, c-format
msgid "cannot find interface declaration for %qs, superclass of %qs"
msgstr ""
-#: objc/objc-act.c:6668
+#: objc/objc-act.c:6718
#, c-format
msgid "reimplementation of class %qs"
msgstr ""
-#: objc/objc-act.c:6699
+#: objc/objc-act.c:6749
#, c-format
msgid "conflicting super class name %qs"
msgstr ""
-#: objc/objc-act.c:6701
+#: objc/objc-act.c:6751
#, c-format
msgid "previous declaration of %qs"
msgstr ""
-#: objc/objc-act.c:6715 objc/objc-act.c:6717
+#: objc/objc-act.c:6765 objc/objc-act.c:6767
#, c-format
msgid "duplicate interface declaration for class %qs"
msgstr ""
-#: objc/objc-act.c:6977
+#: objc/objc-act.c:7022
#, c-format
msgid "duplicate declaration for protocol %qs"
msgstr ""
#. Add a readable method name to the warning.
-#: objc/objc-act.c:7494
+#: objc/objc-act.c:7552
msgid "%J%s %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:7784
+#: objc/objc-act.c:7849
#, c-format
msgid "no super class declared in interface for %qs"
msgstr ""
-#: objc/objc-act.c:7832
+#: objc/objc-act.c:7897
msgid "[super ...] must appear in a method context"
msgstr ""
-#: objc/objc-act.c:8459
+#: objc/objc-act.c:8554
#, c-format
msgid "local declaration of %qs hides instance variable"
msgstr ""
-#: objc/objc-parse.y:2720
-msgid "extra semicolon in method definition specified"
-msgstr ""
-
#: treelang/tree1.c:278
msgid "%HDuplicate name %q.*s."
msgstr ""
-#: treelang/treetree.c:842
+#: treelang/treetree.c:826
msgid "Global register variable %qD used in nested function."
msgstr ""
-#: treelang/treetree.c:846
+#: treelang/treetree.c:830
msgid "Register variable %qD used in nested function."
msgstr ""
-#: treelang/treetree.c:852
+#: treelang/treetree.c:836
msgid "Address of global register variable %qD requested."
msgstr ""
-#: treelang/treetree.c:857
+#: treelang/treetree.c:841
msgid "Address of register variable %qD requested."
msgstr ""
@@ -20004,687 +20274,687 @@ msgid "Warn about function pointer arithmetic"
msgstr ""
#: options.c:1237
-msgid "Warn if inherited methods are unimplemented"
+msgid "Warn when a pointer differs in signedness in an assignment."
msgstr ""
#: options.c:1240
-msgid "Warn about multiple declarations of the same object"
+msgid "Warn if inherited methods are unimplemented"
msgstr ""
#: options.c:1243
-msgid "Warn if modifiers are specified when not necessary"
+msgid "Warn about multiple declarations of the same object"
msgstr ""
#: options.c:1246
-msgid "Warn when the compiler reorders code"
+msgid "Warn if modifiers are specified when not necessary"
msgstr ""
#: options.c:1249
+msgid "Warn when the compiler reorders code"
+msgstr ""
+
+#: options.c:1252
msgid ""
"Warn whenever a function's return type defaults to \"int\" (C), or about "
"inconsistent return types (C++)"
msgstr ""
-#: options.c:1252
+#: options.c:1255
msgid "Warn if a selector has multiple methods"
msgstr ""
-#: options.c:1255
+#: options.c:1258
msgid "Warn about possible violations of sequence point rules"
msgstr ""
-#: options.c:1258
+#: options.c:1261
msgid "Warn when one local variable shadows another"
msgstr ""
-#: options.c:1261
+#: options.c:1264
msgid "Warn about signed-unsigned comparisons"
msgstr ""
-#: options.c:1264
+#: options.c:1267
msgid "Warn when overload promotes from unsigned to signed"
msgstr ""
-#: options.c:1267
#: options.c:1270
+#: options.c:1273
msgid "Warn about code which might break strict aliasing rules"
msgstr ""
-#: options.c:1273
+#: options.c:1276
msgid "Warn about unprototyped function declarations"
msgstr ""
-#: options.c:1276
+#: options.c:1279
msgid "Warn about \"suspicious\" constructs"
msgstr ""
-#: options.c:1279
+#: options.c:1282
msgid "Warn about enumerated switches, with no default, missing a case"
msgstr ""
-#: options.c:1282
+#: options.c:1285
msgid "Warn about enumerated switches missing a \"default:\" statement"
msgstr ""
-#: options.c:1285
+#: options.c:1288
msgid "Warn about all enumerated switches missing a specific case"
msgstr ""
-#: options.c:1288
+#: options.c:1291
msgid "Warn when synthesis behavior differs from Cfront"
msgstr ""
-#: options.c:1291
+#: options.c:1294
msgid "Do not suppress warnings from system headers"
msgstr ""
-#: options.c:1294
+#: options.c:1297
msgid "Warn about features not present in traditional C"
msgstr ""
-#: options.c:1297
+#: options.c:1300
msgid ""
"Warn if trigraphs are encountered that might affect the meaning of the "
"program"
msgstr ""
-#: options.c:1300
+#: options.c:1303
msgid "Warn about @selector()s without previously declared methods"
msgstr ""
-#: options.c:1303
+#: options.c:1306
msgid "Warn if an undefined macro is used in an #if directive"
msgstr ""
-#: options.c:1306
+#: options.c:1309
msgid "Warn about underflow of numerical constant expressions"
msgstr ""
-#: options.c:1309
+#: options.c:1312
msgid "Warn about uninitialized automatic variables"
msgstr ""
-#: options.c:1312
+#: options.c:1315
msgid "Warn about unrecognized pragmas"
msgstr ""
-#: options.c:1315
+#: options.c:1318
msgid "Warn about code that will never be executed"
msgstr ""
-#: options.c:1318
+#: options.c:1321
msgid "Enable all -Wunused- warnings"
msgstr ""
-#: options.c:1321
+#: options.c:1324
msgid "Warn when a function is unused"
msgstr ""
-#: options.c:1324
#: options.c:1327
+#: options.c:1330
msgid "Warn when a label is unused"
msgstr ""
-#: options.c:1330
+#: options.c:1333
msgid "Warn about macros defined in the main file that are not used"
msgstr ""
-#: options.c:1333
+#: options.c:1336
msgid "Warn when a function parameter is unused"
msgstr ""
-#: options.c:1336
+#: options.c:1339
msgid "Warn when an expression value is unused"
msgstr ""
-#: options.c:1339
+#: options.c:1342
msgid "Warn when a variable is unused"
msgstr ""
-#: options.c:1342
+#: options.c:1345
msgid "Do not warn about using variadic macros when -pedantic"
msgstr ""
-#: options.c:1345
+#: options.c:1348
msgid "Give strings the type \"array of char\""
msgstr ""
-#: options.c:1348
+#: options.c:1351
msgid ""
"A synonym for -std=c89. In a future version of GCC it will become "
"synonymous with -std=c99 instead"
msgstr ""
-#: options.c:1351
+#: options.c:1354
msgid "-aux-info <file>\tEmit declaration information into <file>"
msgstr ""
-#: options.c:1363
+#: options.c:1366
msgid "-d<letters>\tEnable dumps from specific passes of the compiler"
msgstr ""
-#: options.c:1366
+#: options.c:1369
msgid "Set the default real and integer kinds to double precision"
msgstr ""
-#: options.c:1369
+#: options.c:1372
msgid "-dumpbase <file>\tSet the file basename to be used for dumps"
msgstr ""
-#: options.c:1372
+#: options.c:1375
msgid "--CLASSPATH\tDeprecated; use --classpath instead"
msgstr ""
-#: options.c:1375
+#: options.c:1378
msgid "Generate position-independent code if possible (large mode)"
msgstr ""
-#: options.c:1378
+#: options.c:1381
msgid ""
"Generate position-independent code for executables if possible (large mode)"
msgstr ""
-#: options.c:1384
+#: options.c:1387
msgid "Enforce class member access control semantics"
msgstr ""
-#: options.c:1387
+#: options.c:1390
msgid "Align the start of functions"
msgstr ""
-#: options.c:1393
+#: options.c:1396
msgid "Align labels which are only reached by jumping"
msgstr ""
-#: options.c:1399
+#: options.c:1402
msgid "Align all labels"
msgstr ""
-#: options.c:1405
+#: options.c:1408
msgid "Align the start of loops"
msgstr ""
-#: options.c:1414
+#: options.c:1417
msgid "Change when template instances are emitted"
msgstr ""
-#: options.c:1417
+#: options.c:1420
msgid "Specify that arguments may alias each other and globals"
msgstr ""
-#: options.c:1420
+#: options.c:1423
msgid "Assume arguments may alias globals but not each other"
msgstr ""
-#: options.c:1423
+#: options.c:1426
msgid "Assume arguments alias neither each other nor globals"
msgstr ""
-#: options.c:1426
+#: options.c:1429
msgid "Recognize the \"asm\" keyword"
msgstr ""
-#: options.c:1429
+#: options.c:1432
msgid "Permit the use of the assert keyword"
msgstr ""
-#: options.c:1438
+#: options.c:1441
msgid "Generate unwind tables that are exact at each instruction boundary"
msgstr ""
-#: options.c:1441
+#: options.c:1444
msgid "--bootclasspath=<path>\tReplace system path"
msgstr ""
-#: options.c:1444
+#: options.c:1447
msgid "Generate code to check bounds before indexing arrays"
msgstr ""
-#: options.c:1447
+#: options.c:1450
msgid "Replace add, compare, branch with branch on count register"
msgstr ""
-#: options.c:1450
+#: options.c:1453
msgid "Use profiling information for branch probabilities"
msgstr ""
-#: options.c:1453
+#: options.c:1456
msgid ""
"Perform branch target load optimization before prologue / epilogue threading"
msgstr ""
-#: options.c:1456
+#: options.c:1459
msgid ""
"Perform branch target load optimization after prologue / epilogue threading"
msgstr ""
-#: options.c:1459
+#: options.c:1462
msgid ""
"Restrict target load migration not to re-use registers in any basic block"
msgstr ""
-#: options.c:1462
+#: options.c:1465
msgid "Recognize built-in functions"
msgstr ""
-#: options.c:1468
+#: options.c:1471
msgid ""
"-fcall-saved-<register>\tMark <register> as being preserved across functions"
msgstr ""
-#: options.c:1471
+#: options.c:1474
msgid ""
"-fcall-used-<register>\tMark <register> as being corrupted by function calls"
msgstr ""
-#: options.c:1474
+#: options.c:1477
msgid "Save registers around function calls"
msgstr ""
-#: options.c:1477
+#: options.c:1480
msgid "Check the return value of new"
msgstr ""
-#: options.c:1480
+#: options.c:1483
msgid "Generate checks for references to NULL"
msgstr ""
-#: options.c:1483
+#: options.c:1486
msgid "--classpath=<path>\tSet class path"
msgstr ""
-#: options.c:1486
+#: options.c:1489
msgid "Do not put uninitialized globals in the common section"
msgstr ""
-#: options.c:1492
+#: options.c:1495
msgid "Allow the arguments of the '?' operator to have different types"
msgstr ""
-#: options.c:1495
+#: options.c:1498
msgid "Reduce the size of object files"
msgstr ""
-#: options.c:1498
+#: options.c:1501
msgid "Make string literals \"const char[]\" not \"char[]\""
msgstr ""
-#: options.c:1501
+#: options.c:1504
msgid "-fconst-string-class=<name>\tUse class <name> for constant strings"
msgstr ""
-#: options.c:1504
+#: options.c:1507
msgid "Perform a register copy-propagation optimization pass"
msgstr ""
-#: options.c:1507
+#: options.c:1510
msgid "Perform cross-jumping optimization"
msgstr ""
-#: options.c:1510
+#: options.c:1513
msgid "When running CSE, follow jumps to their targets"
msgstr ""
-#: options.c:1513
+#: options.c:1516
msgid "When running CSE, follow conditional jumps"
msgstr ""
-#: options.c:1516
+#: options.c:1519
+msgid "Omit range reduction step when performing complex division"
+msgstr ""
+
+#: options.c:1522
msgid "Place data items into their own section"
msgstr ""
-#: options.c:1519
+#: options.c:1525
msgid "Inline member functions by default"
msgstr ""
-#: options.c:1522
+#: options.c:1528
msgid "Defer popping functions args from stack until later"
msgstr ""
-#: options.c:1525
+#: options.c:1531
msgid "Attempt to fill delay slots of branch instructions"
msgstr ""
-#: options.c:1528
+#: options.c:1534
msgid "Delete useless null pointer checks"
msgstr ""
-#: options.c:1531
+#: options.c:1537
msgid ""
"-fdiagnostics-show-location=[once|every-line]\tHow often to emit source "
"location at the beginning of line-wrapped diagnostics"
msgstr ""
-#: options.c:1540
+#: options.c:1546
msgid "Allow dollar signs in entity names"
msgstr ""
-#: options.c:1543
+#: options.c:1549
msgid "Permit '$' as an identifier character"
msgstr ""
-#: options.c:1546
+#: options.c:1552
msgid "-fdump-<type>\tDump various compiler internals to a file"
msgstr ""
-#: options.c:1549
+#: options.c:1555
msgid "Display the code tree after parsing."
msgstr ""
-#: options.c:1552
+#: options.c:1558
msgid ""
"Suppress output of instruction numbers and line number notes in debugging "
"dumps"
msgstr ""
-#: options.c:1558
+#: options.c:1564
msgid "Perform DWARF2 duplicate elimination"
msgstr ""
-#: options.c:1561
-#: options.c:1564
+#: options.c:1567
+#: options.c:1570
msgid "Perform unused type elimination in debug info"
msgstr ""
-#: options.c:1567
+#: options.c:1573
msgid "Output a class file"
msgstr ""
-#: options.c:1570
+#: options.c:1576
msgid "Alias for -femit-class-file"
msgstr ""
-#: options.c:1579
+#: options.c:1585
msgid ""
"--encoding=<encoding>\tChoose input encoding (defaults from your locale)"
msgstr ""
-#: options.c:1582
+#: options.c:1588
msgid "Generate code to check exception specifications"
msgstr ""
-#: options.c:1588
+#: options.c:1594
msgid "Enable exception handling"
msgstr ""
-#: options.c:1591
+#: options.c:1597
msgid ""
"-fexec-charset=<cset>\tConvert all strings and character constants to "
"character set <cset>"
msgstr ""
-#: options.c:1594
+#: options.c:1600
msgid "Perform a number of minor, expensive optimizations"
msgstr ""
-#: options.c:1597
+#: options.c:1603
msgid "--extdirs=<path>\tSet the extension directory path"
msgstr ""
-#: options.c:1606
+#: options.c:1612
msgid "Input file is a file with a list of filenames to compile"
msgstr ""
-#: options.c:1609
+#: options.c:1615
msgid "Assume no NaNs or infinities are generated"
msgstr ""
-#: options.c:1612
+#: options.c:1618
msgid ""
"-ffixed-<register>\tMark <register> as being unavailable to the compiler"
msgstr ""
-#: options.c:1615
+#: options.c:1621
msgid "Assume that the source file is fixed form"
msgstr ""
-#: options.c:1618
+#: options.c:1624
msgid "-ffixed-line-length-<n>\t\tUse n as character line width in fixed mode"
msgstr ""
-#: options.c:1621
+#: options.c:1627
msgid "Allow arbitrary character line width in fixed mode"
msgstr ""
-#: options.c:1624
+#: options.c:1630
msgid "Don't allocate floats and doubles in extended-precision registers"
msgstr ""
-#: options.c:1627
+#: options.c:1633
msgid "Scope of for-init-statement variables is local to the loop"
msgstr ""
-#: options.c:1630
+#: options.c:1636
msgid "Copy memory address constants into registers before use"
msgstr ""
-#: options.c:1633
+#: options.c:1639
msgid "Always check for non gcj generated classes archives"
msgstr ""
-#: options.c:1636
+#: options.c:1642
msgid "Copy memory operands into registers before use"
msgstr ""
-#: options.c:1639
+#: options.c:1645
msgid "Assume that the source file is free form"
msgstr ""
-#: options.c:1642
+#: options.c:1648
msgid "Do not assume that standard C libraries and \"main\" exist"
msgstr ""
-#: options.c:1645
+#: options.c:1651
msgid "Allow function addresses to be held in registers"
msgstr ""
-#: options.c:1648
+#: options.c:1654
msgid "Place each function into its own section"
msgstr ""
-#: options.c:1651
+#: options.c:1657
msgid "Perform global common subexpression elimination"
msgstr ""
-#: options.c:1654
+#: options.c:1660
msgid ""
"Perform global common subexpression elimination after register allocation"
msgstr ""
-#: options.c:1657
+#: options.c:1663
msgid ""
"Perform redundant load after store elimination in global common subexpression"
msgstr ""
-#: options.c:1660
+#: options.c:1666
msgid ""
"Perform enhanced load motion during global common subexpression elimination"
msgstr ""
-#: options.c:1663
+#: options.c:1669
msgid "Perform store motion after global common subexpression elimination"
msgstr ""
-#: options.c:1666
+#: options.c:1672
msgid "Recognize GNU-defined keywords"
msgstr ""
-#: options.c:1669
+#: options.c:1675
msgid "Generate code for GNU runtime environment"
msgstr ""
-#: options.c:1672
+#: options.c:1678
msgid "Enable guessing of branch probabilities"
msgstr ""
-#: options.c:1681
+#: options.c:1687
msgid ""
"Assume the runtime uses a hash table to map an object to its synchronization "
"structure"
msgstr ""
-#: options.c:1687
+#: options.c:1693
msgid "Assume normal C execution environment"
msgstr ""
-#: options.c:1690
+#: options.c:1696
msgid "Enable support for huge objects"
msgstr ""
-#: options.c:1693
+#: options.c:1699
msgid "Process #ident directives"
msgstr ""
-#: options.c:1696
+#: options.c:1702
msgid "Perform conversion of conditional jumps to branchless equivalents"
msgstr ""
-#: options.c:1699
+#: options.c:1705
msgid "Perform conversion of conditional jumps to conditional execution"
msgstr ""
-#: options.c:1702
+#: options.c:1708
msgid "Export functions even if they can be inlined"
msgstr ""
-#: options.c:1705
+#: options.c:1711
msgid "Emit implicit instantiations of inline templates"
msgstr ""
-#: options.c:1708
+#: options.c:1714
msgid ""
"Specify that no implicit typing is allowed, unless overridden by explicit "
"IMPLICIT statements"
msgstr ""
-#: options.c:1711
+#: options.c:1717
msgid "Emit implicit instantiations of templates"
msgstr ""
-#: options.c:1714
+#: options.c:1720
msgid "Use offset tables for virtual method calls"
msgstr ""
-#: options.c:1717
+#: options.c:1723
msgid "Do not generate .size directives"
msgstr ""
-#: options.c:1720
+#: options.c:1726
msgid "Pay attention to the \"inline\" keyword"
msgstr ""
-#: options.c:1729
+#: options.c:1735
msgid ""
"-finline-limit=<number>\tLimit the size of inlined functions to <number>"
msgstr ""
-#: options.c:1732
+#: options.c:1738
msgid ""
"-finput-charset=<cset> Specify the default character set for source "
"files."
msgstr ""
-#: options.c:1735
+#: options.c:1741
msgid "Instrument function entry and exit with profiling calls"
msgstr ""
-#: options.c:1738
+#: options.c:1744
msgid "Optimize induction variables on trees"
msgstr ""
-#: options.c:1741
+#: options.c:1747
msgid "Assume native functions are implemented using JNI"
msgstr ""
-#: options.c:1744
+#: options.c:1750
msgid "Generate code for functions even if they are fully inlined"
msgstr ""
-#: options.c:1747
+#: options.c:1753
msgid "Emit static const variables even if they are not used"
msgstr ""
-#: options.c:1753
+#: options.c:1759
msgid "Give external symbols a leading underscore"
msgstr ""
-#: options.c:1756
+#: options.c:1762
msgid "Perform loop optimizations"
msgstr ""
-#: options.c:1759
+#: options.c:1765
msgid "Perform loop optimizations using the new loop optimizer"
msgstr ""
-#: options.c:1762
+#: options.c:1768
msgid "Set errno after built-in math functions"
msgstr ""
-#: options.c:1765
+#: options.c:1771
msgid "-fmax-identifier-length=<n>\tMaximum identifier length."
msgstr ""
-#: options.c:1768
+#: options.c:1774
msgid ""
"-fmax-stack-var-size=<n>\tSize in bytes of the largest array that will be "
"put on the stack"
msgstr ""
-#: options.c:1771
+#: options.c:1777
msgid "Report on permanent memory allocation"
msgstr ""
-#: options.c:1774
+#: options.c:1780
msgid "Attempt to merge identical constants and constant variables"
msgstr ""
-#: options.c:1777
+#: options.c:1783
msgid "Attempt to merge identical constants across compilation units"
msgstr ""
-#: options.c:1780
+#: options.c:1786
msgid ""
"-fmessage-length=<number>\tLimit diagnostics to <number> characters per "
"line. 0 suppresses line-wrapping"
msgstr ""
-#: options.c:1783
+#: options.c:1789
msgid "Set default accessibility of module entities to PRIVATE"
msgstr ""
-#: options.c:1786
+#: options.c:1792
msgid "Perform SMS based modulo scheduling before the first scheduling pass"
msgstr ""
-#: options.c:1789
+#: options.c:1795
msgid "Move loop invariant computations out of loops"
msgstr ""
-#: options.c:1792
+#: options.c:1798
msgid "Don't warn about uses of Microsoft extensions"
msgstr ""
-#: options.c:1795
+#: options.c:1801
msgid ""
"Add mudflap bounds-checking instrumentation for single-threaded program."
msgstr ""
-#: options.c:1798
+#: options.c:1804
msgid "Ignore read operations when inserting mudflap instrumentation."
msgstr ""
-#: options.c:1801
+#: options.c:1807
msgid "Add mudflap bounds-checking instrumentation for multi-threaded program."
msgstr ""
-#: options.c:1810
-msgid "Use graph-coloring register allocation"
-msgstr ""
-
-#: options.c:1813
-msgid "Enable the new bytecode verifier"
-msgstr ""
-
#: options.c:1816
msgid "Generate code for NeXT (Apple Mac OS X) runtime environment"
msgstr ""
@@ -21124,323 +21394,329 @@ msgid "Enable loop vectorization on trees"
msgstr ""
#: options.c:2161
-msgid "Append underscores to externally visible names"
+msgid ""
+"-ftree-vectorizer-verbose=<number> Set the verbosity level of the "
+"vectorizer"
msgstr ""
#: options.c:2164
-msgid "Compile whole compilation unit at a time"
+msgid "Append underscores to externally visible names"
msgstr ""
#: options.c:2167
-msgid "Perform loop unrolling for all loops"
+msgid "Compile whole compilation unit at a time"
msgstr ""
#: options.c:2170
-msgid "Perform loop unrolling when iteration count is known"
+msgid "Perform loop unrolling for all loops"
msgstr ""
#: options.c:2173
-msgid "Allow math optimizations that may violate IEEE or ISO standards"
+msgid "Perform loop unrolling when iteration count is known"
msgstr ""
#: options.c:2176
-msgid "When \"signed\" or \"unsigned\" is not given make the bitfield unsigned"
+msgid "Allow math optimizations that may violate IEEE or ISO standards"
msgstr ""
#: options.c:2179
-msgid "Make \"char\" unsigned by default"
+msgid "When \"signed\" or \"unsigned\" is not given make the bitfield unsigned"
msgstr ""
#: options.c:2182
-msgid "Perform loop unswitching"
+msgid "Make \"char\" unsigned by default"
msgstr ""
#: options.c:2185
-msgid "Just generate unwind tables for exception handling"
+msgid "Perform loop unswitching"
msgstr ""
#: options.c:2188
-msgid "Generate code for the Boehm GC"
+msgid "Just generate unwind tables for exception handling"
msgstr ""
#: options.c:2191
-msgid "Use __cxa_atexit to register destructors"
+msgid "Generate code for the Boehm GC"
msgstr ""
#: options.c:2194
-msgid "Call a library routine to do integer divisions"
+msgid "Use __cxa_atexit to register destructors"
msgstr ""
#: options.c:2197
-msgid "Perform variable tracking"
+msgid "Call a library routine to do integer divisions"
msgstr ""
#: options.c:2200
-msgid "Apply variable expansion when loops are unrolled."
+msgid "Perform variable tracking"
msgstr ""
#: options.c:2203
-msgid "Add extra commentary to assembler output"
+msgid "Apply variable expansion when loops are unrolled."
msgstr ""
#: options.c:2206
-msgid "Marks all inlined methods as having hidden visibility"
+msgid "Add extra commentary to assembler output"
msgstr ""
#: options.c:2209
+msgid "Marks all inlined methods as having hidden visibility"
+msgstr ""
+
+#: options.c:2212
msgid ""
"-fvisibility=[default|internal|hidden|protected]\tSet the default symbol "
"visibility"
msgstr ""
-#: options.c:2212
+#: options.c:2215
msgid "Use expression value profiles in optimizations"
msgstr ""
-#: options.c:2215
+#: options.c:2218
msgid "Discard unused virtual functions"
msgstr ""
-#: options.c:2218
+#: options.c:2221
msgid "Implement vtables using thunks"
msgstr ""
-#: options.c:2221
+#: options.c:2224
msgid "Emit common-like symbols as weak symbols"
msgstr ""
-#: options.c:2224
+#: options.c:2227
msgid "Construct webs and split unrelated uses of single variable"
msgstr ""
-#: options.c:2227
+#: options.c:2230
msgid ""
"-fwide-exec-charset=<cset>\tConvert all wide strings and character constants "
"to character set <cset>"
msgstr ""
-#: options.c:2230
+#: options.c:2233
msgid "Generate a #line directive pointing at the current working directory"
msgstr ""
-#: options.c:2233
+#: options.c:2236
msgid "Assume signed arithmetic overflow wraps around"
msgstr ""
-#: options.c:2236
+#: options.c:2239
msgid "Emit cross referencing information"
msgstr ""
-#: options.c:2239
+#: options.c:2242
msgid "Put zero initialized data in the bss section"
msgstr ""
-#: options.c:2242
+#: options.c:2245
msgid ""
"Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode"
msgstr ""
-#: options.c:2245
+#: options.c:2248
msgid "Generate debug information in default format"
msgstr ""
-#: options.c:2248
+#: options.c:2251
msgid "Generate debug information in COFF format"
msgstr ""
-#: options.c:2251
+#: options.c:2254
msgid "Generate debug information in DWARF v2 format"
msgstr ""
-#: options.c:2254
+#: options.c:2257
msgid "Dump declarations to a .decl file"
msgstr ""
-#: options.c:2257
+#: options.c:2260
msgid "Generate debug information in default extended format"
msgstr ""
-#: options.c:2260
+#: options.c:2263
msgid "Generate debug information in STABS format"
msgstr ""
-#: options.c:2263
+#: options.c:2266
msgid "Generate debug information in extended STABS format"
msgstr ""
-#: options.c:2266
+#: options.c:2269
msgid "Generate debug information in VMS format"
msgstr ""
-#: options.c:2269
+#: options.c:2272
msgid "Generate debug information in XCOFF format"
msgstr ""
-#: options.c:2272
+#: options.c:2275
msgid "Generate debug information in extended XCOFF format"
msgstr ""
-#: options.c:2275
+#: options.c:2278
msgid "Set the default integer kind to double precision"
msgstr ""
-#: options.c:2278
+#: options.c:2281
msgid "-idirafter <dir>\tAdd <dir> to the end of the system include path"
msgstr ""
-#: options.c:2281
+#: options.c:2284
msgid "-imacros <file>\tAccept definition of macros in <file>"
msgstr ""
-#: options.c:2284
+#: options.c:2287
msgid "-include <file>\tInclude the contents of <file> before other files"
msgstr ""
-#: options.c:2287
+#: options.c:2290
msgid "-iprefix <path>\tSpecify <path> as a prefix for next two options"
msgstr ""
-#: options.c:2290
+#: options.c:2293
msgid "-iquote <dir>\tAdd <dir> to the end of the quote include path"
msgstr ""
-#: options.c:2293
+#: options.c:2296
msgid "-isysroot <dir>\tSet <dir> to be the system root directory"
msgstr ""
-#: options.c:2296
+#: options.c:2299
msgid "-isystem <dir>\tAdd <dir> to the start of the system include path"
msgstr ""
-#: options.c:2299
+#: options.c:2302
msgid "-iwithprefix <dir>\tAdd <dir> to the end of the system include path"
msgstr ""
-#: options.c:2302
+#: options.c:2305
msgid "-iwithprefixbefore <dir>\tAdd <dir> to the end of the main include path"
msgstr ""
-#: options.c:2314
+#: options.c:2317
msgid ""
"Do not search standard system include directories (those specified with -"
"isystem will still be used)"
msgstr ""
-#: options.c:2317
+#: options.c:2320
msgid "Do not search standard system include directories for C++"
msgstr ""
-#: options.c:2320
+#: options.c:2323
msgid "-o <file>\tPlace output into <file>"
msgstr ""
-#: options.c:2323
+#: options.c:2326
msgid "Enable function profiling"
msgstr ""
-#: options.c:2326
+#: options.c:2329
msgid "Issue warnings needed for strict compliance to the standard"
msgstr ""
-#: options.c:2329
+#: options.c:2332
msgid "Like -pedantic but issue them as errors"
msgstr ""
-#: options.c:2332
+#: options.c:2335
msgid "Generate C header of platform-specific features"
msgstr ""
-#: options.c:2335
+#: options.c:2338
msgid "-qkind=<n>\tSet the kind for a real with the 'q' exponent to 'n'"
msgstr ""
-#: options.c:2338
+#: options.c:2341
msgid "Do not display functions compiled or elapsed time"
msgstr ""
-#: options.c:2341
+#: options.c:2344
msgid "Set the default real kind to double precision"
msgstr ""
-#: options.c:2344
+#: options.c:2347
msgid "Remap file names when including files"
msgstr ""
-#: options.c:2347
+#: options.c:2350
msgid "Conform to the ISO 1998 C++ standard"
msgstr ""
-#: options.c:2350
+#: options.c:2353
msgid "Conform to the ISO 1990 C standard"
msgstr ""
-#: options.c:2353
+#: options.c:2356
msgid "Conform to the ISO 1999 C standard"
msgstr ""
-#: options.c:2356
-#: options.c:2386
+#: options.c:2359
#: options.c:2389
+#: options.c:2392
msgid "Deprecated in favor of -std=c99"
msgstr ""
-#: options.c:2359
+#: options.c:2362
msgid "Conform to the ISO Fortran 2003 standard."
msgstr ""
-#: options.c:2362
+#: options.c:2365
msgid "Conform to the ISO Fortran 95 standard."
msgstr ""
-#: options.c:2365
+#: options.c:2368
msgid "Conform nothing in particular."
msgstr ""
-#: options.c:2368
+#: options.c:2371
msgid "Conform to the ISO 1998 C++ standard with GNU extensions"
msgstr ""
-#: options.c:2371
+#: options.c:2374
msgid "Conform to the ISO 1990 C standard with GNU extensions"
msgstr ""
-#: options.c:2374
+#: options.c:2377
msgid "Conform to the ISO 1999 C standard with GNU extensions"
msgstr ""
-#: options.c:2377
+#: options.c:2380
msgid "Deprecated in favor of -std=gnu99"
msgstr ""
-#: options.c:2380
+#: options.c:2383
msgid "Deprecated in favor of -std=c89"
msgstr ""
-#: options.c:2383
+#: options.c:2386
msgid "Conform to the ISO 1990 C standard as amended in 1994"
msgstr ""
-#: options.c:2392
+#: options.c:2395
msgid "Enable traditional preprocessing"
msgstr ""
-#: options.c:2395
+#: options.c:2398
msgid "-trigraphs\tSupport ISO C trigraphs"
msgstr ""
-#: options.c:2398
+#: options.c:2401
msgid "Do not predefine system-specific and GCC-specific macros"
msgstr ""
-#: options.c:2401
+#: options.c:2404
msgid "Enable verbose output"
msgstr ""
-#: options.c:2407
+#: options.c:2410
msgid "Suppress warnings"
msgstr ""
-#: config/mips/mips.h:1120 config/arc/arc.h:63
+#: config/mips/mips.h:1124 config/arc/arc.h:63
msgid "may not use both -EB and -EL"
msgstr ""
@@ -21456,35 +21732,35 @@ msgstr ""
msgid "-msingle-float and -msoft-float cannot both be specified"
msgstr ""
-#: config/darwin.h:248
+#: config/darwin.h:251
msgid "-current_version only allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:250
+#: config/darwin.h:253
msgid "-install_name only allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:255
+#: config/darwin.h:258
msgid "-bundle not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:256
+#: config/darwin.h:259
msgid "-bundle_loader not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:257
+#: config/darwin.h:260
msgid "-client_name not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:262
+#: config/darwin.h:265
msgid "-force_flat_namespace not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:264
+#: config/darwin.h:267
msgid "-keep_private_externs not allowed with -dynamiclib"
msgstr ""
-#: config/darwin.h:265
+#: config/darwin.h:268
msgid "-private_bundle not allowed with -dynamiclib"
msgstr ""
@@ -21512,28 +21788,20 @@ msgstr ""
msgid "shared and mdll are not compatible"
msgstr ""
+#: config/i386/nwld.h:34
+msgid "Static linking is not supported.\n"
+msgstr ""
+
#: config/sparc/linux64.h:211 config/sparc/linux64.h:222
-#: config/sparc/netbsd-elf.h:136 config/sparc/netbsd-elf.h:155
+#: config/sparc/netbsd-elf.h:126 config/sparc/netbsd-elf.h:145
#: config/sparc/sol2-bi.h:195 config/sparc/sol2-bi.h:205
msgid "may not use both -m32 and -m64"
msgstr ""
-#: treelang/lang-specs.h:52
-msgid "-pg or -p and -fomit-frame-pointer are incompatible"
-msgstr ""
-
-#: java/jvspec.c:80 gcc.c:796 ada/lang-specs.h:34
-msgid "-pg and -fomit-frame-pointer are incompatible"
-msgstr ""
-
#: config/vax/netbsd-elf.h:42
msgid "The -shared option is not currently supported for VAX ELF."
msgstr ""
-#: config/i386/nwld.h:34
-msgid "Static linking is not supported.\n"
-msgstr ""
-
#: config/vax/vax.h:50 config/vax/vax.h:51
msgid "profiling not supported with -mg\n"
msgstr ""
@@ -21558,11 +21826,15 @@ msgstr ""
msgid "the m210 does not have little endian support"
msgstr ""
-#: gcc.c:769
+#: gcc.c:763
msgid "GCC does not support -C or -CC without -E"
msgstr ""
-#: gcc.c:963
+#: gcc.c:790 java/jvspec.c:80 ada/lang-specs.h:34
+msgid "-pg and -fomit-frame-pointer are incompatible"
+msgstr ""
+
+#: gcc.c:957
msgid "-E required when input is from standard input"
msgstr ""
@@ -21579,10 +21851,14 @@ msgstr ""
msgid "does not support multilib"
msgstr ""
-#: config/rs6000/darwin.h:132
+#: config/rs6000/darwin.h:130
msgid " conflicting code gen style switches are used"
msgstr ""
+#: treelang/lang-specs.h:52
+msgid "-pg or -p and -fomit-frame-pointer are incompatible"
+msgstr ""
+
#: ada/lang-specs.h:35
msgid "-c or -S required for Ada"
msgstr ""
diff --git a/gcc/predict.c b/gcc/predict.c
index 7e0f0db93d4..9ecf1e3269d 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -67,7 +67,7 @@ static sreal real_zero, real_one, real_almost_one, real_br_prob_base,
real_inv_br_prob_base, real_one_half, real_bb_freq_max;
/* Random guesstimation given names. */
-#define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 10 - 1)
+#define PROB_VERY_UNLIKELY (REG_BR_PROB_BASE / 100 - 1)
#define PROB_EVEN (REG_BR_PROB_BASE / 2)
#define PROB_VERY_LIKELY (REG_BR_PROB_BASE - PROB_VERY_UNLIKELY)
#define PROB_ALWAYS (REG_BR_PROB_BASE)
@@ -1043,9 +1043,9 @@ tree_predict_by_opcode (basic_block bb)
return;
op0 = TREE_OPERAND (cond, 0);
type = TREE_TYPE (op0);
- visited = BITMAP_XMALLOC ();
+ visited = BITMAP_ALLOC (NULL);
val = expr_expected_value (cond, visited);
- BITMAP_XFREE (visited);
+ BITMAP_FREE (visited);
if (val)
{
if (integer_zerop (val))
@@ -1819,7 +1819,7 @@ estimate_bb_frequencies (struct loops *loops)
EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->probability = REG_BR_PROB_BASE;
/* Set up block info for each basic block. */
- tovisit = BITMAP_XMALLOC ();
+ tovisit = BITMAP_ALLOC (NULL);
alloc_aux_for_blocks (sizeof (struct block_info_def));
alloc_aux_for_edges (sizeof (struct edge_info_def));
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
@@ -1857,7 +1857,7 @@ estimate_bb_frequencies (struct loops *loops)
free_aux_for_blocks ();
free_aux_for_edges ();
- BITMAP_XFREE (tovisit);
+ BITMAP_FREE (tovisit);
}
compute_function_frequency ();
if (flag_reorder_functions)
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 8d8cbffc389..41d029a4bf4 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -79,6 +79,12 @@ print_node_brief (FILE *file, const char *prefix, tree node, int indent)
{
if (DECL_NAME (node))
fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
+ else if (TREE_CODE (node) == LABEL_DECL
+ && LABEL_DECL_UID (node) != -1)
+ fprintf (file, " L." HOST_WIDE_INT_PRINT_DEC, LABEL_DECL_UID (node));
+ else
+ fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
+ DECL_UID (node));
}
else if (class == tcc_type)
{
@@ -217,6 +223,12 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
{
if (DECL_NAME (node))
fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
+ else if (TREE_CODE (node) == LABEL_DECL
+ && LABEL_DECL_UID (node) != -1)
+ fprintf (file, " L." HOST_WIDE_INT_PRINT_DEC, LABEL_DECL_UID (node));
+ else
+ fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
+ DECL_UID (node));
}
else if (class == tcc_type)
{
@@ -252,6 +264,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
fputs (" readonly", file);
if (!TYPE_P (node) && TREE_CONSTANT (node))
fputs (" constant", file);
+ else if (TYPE_P (node) && TYPE_SIZES_GIMPLIFIED (node))
+ fputs (" sizes-gimplified", file);
+
if (TREE_INVARIANT (node))
fputs (" invariant", file);
if (TREE_ADDRESSABLE (node))
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
index c9a3fee81dd..6006745c3dd 100644
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -1,6 +1,6 @@
/* RTL reader for GCC.
Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004
+ 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -1253,6 +1253,9 @@ read_rtx_1 (FILE *infile)
memcpy (&return_vec->elem[0], obstack_finish (&vector_stack),
list_counter * sizeof (rtx));
}
+ else if (format_ptr[i] == 'E')
+ fatal_with_file_and_line (infile,
+ "vector must have at least one element");
XVEC (return_rtx, i) = return_vec;
obstack_free (&vector_stack, NULL);
/* close bracket gotten */
diff --git a/gcc/reload.c b/gcc/reload.c
index 0b865a1925f..7d42492a98d 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -2160,12 +2160,15 @@ operands_match_p (rtx x, rtx y)
j = REGNO (y);
/* On a WORDS_BIG_ENDIAN machine, point to the last register of a
- multiple hard register group, so that for example (reg:DI 0) and
- (reg:SI 1) will be considered the same register. */
+ multiple hard register group of scalar integer registers, so that
+ for example (reg:DI 0) and (reg:SI 1) will be considered the same
+ register. */
if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD
+ && SCALAR_INT_MODE_P (GET_MODE (x))
&& i < FIRST_PSEUDO_REGISTER)
i += hard_regno_nregs[i][GET_MODE (x)] - 1;
if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (y)) > UNITS_PER_WORD
+ && SCALAR_INT_MODE_P (GET_MODE (y))
&& j < FIRST_PSEUDO_REGISTER)
j += hard_regno_nregs[j][GET_MODE (y)] - 1;
@@ -3668,6 +3671,10 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
pref_or_nothing[commutative] = pref_or_nothing[commutative + 1];
pref_or_nothing[commutative + 1] = t;
+ t = address_reloaded[commutative];
+ address_reloaded[commutative] = address_reloaded[commutative + 1];
+ address_reloaded[commutative + 1] = t;
+
memcpy (constraints, recog_data.constraints,
noperands * sizeof (char *));
goto try_swapped;
@@ -6705,12 +6712,14 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
if (regno >= 0 && regno < FIRST_PSEUDO_REGISTER)
for (i = 0; i < nregs; ++i)
- if (call_used_regs[regno + i])
+ if (call_used_regs[regno + i]
+ || HARD_REGNO_CALL_PART_CLOBBERED (regno + i, mode))
return 0;
if (valueno >= 0 && valueno < FIRST_PSEUDO_REGISTER)
for (i = 0; i < valuenregs; ++i)
- if (call_used_regs[valueno + i])
+ if (call_used_regs[valueno + i]
+ || HARD_REGNO_CALL_PART_CLOBBERED (valueno + i, mode))
return 0;
}
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 6ec1d7e0f56..e6e4ac14969 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -1,6 +1,6 @@
/* RTL utility routines.
Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 7e010293cd0..b0d839a5337 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2019,7 +2019,7 @@ extern rtx move_by_pieces (rtx, rtx, unsigned HOST_WIDE_INT,
unsigned int, int);
/* In flow.c */
-extern void recompute_reg_usage (rtx, int);
+extern void recompute_reg_usage (void);
extern int initialize_uninitialized_subregs (void);
extern void delete_dead_jumptables (void);
extern void print_rtl_with_bb (FILE *, rtx);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index a1a774752cf..a2cd612f92d 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -758,6 +758,7 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
tmp[i] = ~tmp[i];
real_from_target (&d, tmp, mode);
}
+ break;
default:
gcc_unreachable ();
}
@@ -1925,7 +1926,7 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
return const0_rtx;
/* Transform (and (extend X) C) into (zero_extend (and X C)) if
- there are no non-zero bits of C outside of X's mode. */
+ there are no nonzero bits of C outside of X's mode. */
if ((GET_CODE (op0) == SIGN_EXTEND
|| GET_CODE (op0) == ZERO_EXTEND)
&& GET_CODE (trueop1) == CONST_INT
@@ -2880,6 +2881,21 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
return simplify_gen_relational (code, mode, cmp_mode, x, c);
}
+ /* (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0))) is
+ the same as (zero_extract:SI FOO (const_int 1) BAR). */
+ if (code == NE
+ && op1 == const0_rtx
+ && GET_MODE_CLASS (mode) == MODE_INT
+ && cmp_mode != VOIDmode
+ /* ??? Work-around BImode bugs in the ia64 backend. */
+ && mode != BImode
+ && cmp_mode != BImode
+ && nonzero_bits (op0, cmp_mode) == 1
+ && STORE_FLAG_VALUE == 1)
+ return GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode)
+ ? simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode)
+ : lowpart_subreg (mode, op0, cmp_mode);
+
return NULL_RTX;
}
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 6e21b540aa4..64e070b5a0a 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1,6 +1,7 @@
/* Expands front end tree to back end RTL for GCC
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -2238,8 +2239,8 @@ emit_case_bit_tests (tree index_type, tree index_expr, tree minval,
qsort (test, count, sizeof(*test), case_bit_test_cmp);
index_expr = fold (build2 (MINUS_EXPR, index_type,
- convert (index_type, index_expr),
- convert (index_type, minval)));
+ fold_convert (index_type, index_expr),
+ fold_convert (index_type, minval)));
index = expand_expr (index_expr, NULL_RTX, VOIDmode, 0);
do_pending_stack_adjust ();
@@ -2359,7 +2360,7 @@ expand_case (tree exp)
uniq = 0;
count = 0;
- label_bitmap = BITMAP_XMALLOC ();
+ label_bitmap = BITMAP_ALLOC (NULL);
for (n = case_list; n; n = n->right)
{
/* Count the elements and track the largest and smallest
@@ -2390,11 +2391,17 @@ expand_case (tree exp)
}
}
- BITMAP_XFREE (label_bitmap);
+ BITMAP_FREE (label_bitmap);
/* cleanup_tree_cfg removes all SWITCH_EXPR with a single
- destination, such as one with a default case only. */
- gcc_assert (count != 0);
+ destination, such as one with a default case only. However,
+ it doesn't remove cases that are out of range for the switch
+ type, so we may still get a zero here. */
+ if (count == 0)
+ {
+ emit_jump (default_label);
+ return;
+ }
/* Compute span of values. */
range = fold (build2 (MINUS_EXPR, index_type, maxval, minval));
@@ -2611,8 +2618,7 @@ static int
estimate_case_costs (case_node_ptr node)
{
tree min_ascii = integer_minus_one_node;
- tree max_ascii = convert (TREE_TYPE (node->high),
- build_int_cst (NULL_TREE, 127));
+ tree max_ascii = build_int_cst (TREE_TYPE (node->high), 127);
case_node_ptr n;
int i;
diff --git a/gcc/stub-objc.c b/gcc/stub-objc.c
index f01fd9b4249..8c03da27545 100644
--- a/gcc/stub-objc.c
+++ b/gcc/stub-objc.c
@@ -2,7 +2,7 @@
that are called from within the C and C++ front-ends,
respectively.
Copyright (C) 1991, 1995, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -254,3 +254,47 @@ objc_is_public (tree ARG_UNUSED (expr), tree ARG_UNUSED (identifier))
{
return 1;
}
+
+tree
+objc_get_class_ivars (tree ARG_UNUSED (class_name))
+{
+ return 0;
+}
+
+tree
+objc_build_throw_stmt (tree ARG_UNUSED (throw_expr))
+{
+ return 0;
+}
+
+void
+objc_build_synchronized (location_t ARG_UNUSED (start_locus),
+ tree ARG_UNUSED (mutex), tree ARG_UNUSED (body))
+{
+}
+
+void
+objc_begin_try_stmt (location_t ARG_UNUSED (try_locus), tree ARG_UNUSED (body))
+{
+}
+
+void
+objc_begin_catch_clause (tree ARG_UNUSED (decl))
+{
+}
+
+void
+objc_finish_catch_clause (void)
+{
+}
+
+void
+objc_build_finally_clause (location_t ARG_UNUSED (finally_locus),
+ tree ARG_UNUSED (body))
+{
+}
+
+void
+objc_finish_try_stmt (void)
+{
+}
diff --git a/gcc/system.h b/gcc/system.h
index 752c2542b26..d45e56afb33 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -1,6 +1,6 @@
/* Get common system includes and various definitions and declarations based
on autoconf macros.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -660,7 +660,9 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
PUT_SDB_SRC_FILE STABS_GCC_MARKER DBX_OUTPUT_FUNCTION_END \
DBX_OUTPUT_GCC_MARKER DBX_FINISH_SYMBOL SDB_GENERATE_FAKE \
NON_SAVING_SETJMP TARGET_LATE_RTL_PROLOGUE_EPILOGUE \
- CASE_DROPS_THROUGH
+ CASE_DROPS_THROUGH TARGET_BELL TARGET_BS TARGET_CR TARGET_DIGIT0 \
+ TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT \
+ LINK_LIBGCC_SPECIAL
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2dfc38fff8c..9ab9ada96e9 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,515 @@
+2005-02-26 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/20188
+ * gcc.dg/tree-ssa/inline_asm-1.c: New test.
+ * gcc.dg/tree-ssa/inline_asm-2.c: New test.
+ * gcc.dg/asm-b.c: New test.
+
+2005-02-26 Richard Sandiford <rsandifo@redhat.com>
+
+ * gcc.c-torture/execute/ieee/mul-subnormal-single-1.x: New file.
+ Disable this test on IRIX 6.
+
+2005-02-25 Joseph S. Myers <joseph@codesourcery.com>
+
+ * gcc.dg/cpp/separate-1.c, gcc.dg/noncompile/971104-1.c,
+ gcc.dg/noncompile/990416-1.c: Adjust expected messages for new
+ parser.
+
+2005-02-25 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/20204
+ * testsuite/gcc.dg/pr20204.c: New test.
+
+2005-02-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/20196
+ * gcc.c-torture/execute/20050224-1.c: New test.
+
+ PR c++/20175
+ * g++.dg/warn/Wbraces2.C: New test.
+
+2005-02-23 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19878
+ * g++.dg/init/const2.C: New test.
+
+2005-02-23 Hans-Peter Nilsson <hp@axis.com>
+
+ PR tree-optimization/20100
+ * gcc.c-torture/execute/pr20100-1.c: New test.
+
+2005-02-23 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * gfortran.dg/implicit_3.f90: New test.
+
+ * gfortran.dg/deftype_1.f90: New test.
+
+2005-02-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * g++.dg/lookup/anon2.C: Don't let access checks make it look like
+ the test passes.
+ * g++.dg/other/anon3.C: Accept a warning.
+
+2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.dg/pr20017.c: Fix a comment typo.
+
+2005-02-23 Bud Davis <bdavis@gfortran.org>
+
+ * gfortran.dg/list_read_4.f90: Change to f90 comments.
+
+2005-02-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR ada/19902
+ * ada/acats/tests/cxa/cxa3004.a: Remove.
+ * ada/acats/tests/cxb/cxb30061.am: Likewise.
+
+2005-02-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20073
+ * g++.dg/init/const1.C: New test.
+
+ PR c++/19991
+ * g++.dg/parse/constant7.C: New test.
+
+ PR c++/20152
+ * g++.dg/parse/error27.C: New test.
+ * g++.dg/template/qualttp15.C: Adjust error markers.
+ * g++.old-deja/g++.other/struct1.C: Likewise.
+
+ PR c++/20153
+ * g++.dg/template/error17.C: New test.
+
+ PR c++/20148
+ * g++.dg/parser/error26.C: New test.
+
+2005-02-22 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/20100
+ PR tree-optimization/20115
+ * gcc.dg/pr20115.c: New test.
+ * gcc.dg/pr20115-1.c: New test.
+ * gcc.dg/pr20100.c: New test.
+ * gcc.dg/tree-ssa/20040517-1.c: Expect virtual operands for
+ call-clobbered variables after alias1.
+
+2005-02-22 Bud Davis <bdavis@gfortran.org>
+
+ * gfortran.dg/list_read_4.f90: new test.
+
+2005-02-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR rtl-optimization/20017.
+ * gcc.dg/pr20017.c: New.
+
+2005-02-22 Devang Patel <dpatel@apple.com>
+
+ PR 19952
+ * g++.dg/tree-ssa/pr19952.C: New test.
+
+2005-02-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19883
+ * g++.dg/parse/constant6.C: New test.
+
+2005-02-22 Uros Bizjak <uros@kss-loka.si>
+
+ * g++.dg/charset/asm1.c: Check for IBM1047 code set, not IBM-1047.
+ * g++.dg/charset/asm2.c: Likewise.
+ * g++.dg/charset/asm3.c: Likewise.
+ * g++.dg/charset/asm4.c: Likewise.
+ * g++.dg/charset/asm5.c: Likewise.
+ * g++.dg/charset/attribute1.c: Likewise.
+ * g++.dg/charset/attribute2.c: Likewise.
+ * g++.dg/charset/extern1.cc: Likewise.
+ * g++.dg/charset/extern2.cc: Likewise.
+ * g++.dg/charset/extern3.cc: Likewise.
+ * g++.dg/charset/function.cc: Likewise.
+ * g++.dg/charset/string.c: Likewise.
+ * g++.dg/charset/charset.exp: Likewise.
+ * lib/target-supports.exp (check_iconv_available): Fix comment.
+
+2005-02-22 Uros Bizjak <uros@kss-loka.si>
+
+ * gcc.dg/charset/builtin1.c: Use dg-require-iconv "IBM1047".
+ * gcc.dg/charset/asm1.c: Check for IBM1047 code set, not IBM-1047.
+ * gcc.dg/charset/asm2.c: Likewise.
+ * gcc.dg/charset/asm3.c: Likewise.
+ * gcc.dg/charset/asm4.c: Likewise.
+ * gcc.dg/charset/asm5.c: Likewise.
+ * gcc.dg/charset/asm6.c: Likewise.
+ * gcc.dg/charset/attribute1.c: Likewise.
+ * gcc.dg/charset/attribute2.c: Likewise.
+ * gcc.dg/charset/builtin1.c: Likewise.
+ * gcc.dg/charset/extern.c: Likewise.
+ * gcc.dg/charset/function.c: Likewise.
+ * gcc.dg/charset/string.c: Likewise.
+ * gcc.dg/charset/charset.exp: Likewise.
+
+2005-02-21 Bud Davis <bdavis9659@comcast.net>
+
+ PR fortran/20086
+ * gfortran.dg/pr20086.f90: New test.
+
+2005-02-21 Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/19786
+ * g++.dg/tree-ssa/pr19786.C: New.
+
+2005-02-21 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * lib/gfortran-dg.exp (gfortran-dg-test): Split long regexps.
+
+2005-02-21 Jeff Law <law@redhat.com>
+
+ * gcc.dg/tree-ssa/20041122-1.c: New test for missing optimization.
+
+2005-02-20 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * gfortran.dg/do_iterator: Split loop, markup all lines for
+ which an error locus is printed.
+ * gfortran.dg/pr17708.f90: Markup all lines for which an error
+ locus is printed.
+ * gfortran.dg/select_4.f90: Likewise.
+ * lib/gfortran-dg.exp (gfortran-dg-test): Handle gfortran error
+ locuses in the various permutations.
+
+2005-02-20 Dorit Naishlos <dorit@il.ibm.com>
+
+ PR tree-optimization/19951
+ * g++.dg/vect: New directory.
+ * g++.dg/vect/vect.exp: New file.
+ * g++.dg/vect/pr19951.cc: New testcase.
+ * g++.dg/dg.exp: Also prune vectorizer tests.
+
+2005-02-20 Zack Weinberg <zack@codesourcery.com>
+
+ PR 18785
+ * gcc.dg/charset/builtin1.c: New test.
+
+2005-02-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/19299
+ * g++.dg/inherit/volatile1.C: New test.
+
+ PR c++/19440
+ * g++.dg/template/dtor4.C: New test.
+
+2005-02-19 Steven G. Kargl <kargls@comcast.net>
+
+ * gfortran.dg/int_1.f90: New test.
+
+2005-02-19 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/cpp/mac-eol-at-eof.c: New test.
+
+2005-02-19 Steven G. Kargl <kargls@comcast.net>
+
+ * gfortran.dg/achar_1.f90: New test.
+
+2005-02-19 Hans-Peter Nilsson <hp@axis.com>
+
+ * gcc.c-torture/execute/20020720-1.x: Don't XFAIL cris-*-*.
+
+2005-02-19 Zdenek Dvorak <dvorakz@suse.cz>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/19828
+ * gcc.dg/tree-ssa/loop-7.c: New test.
+ * gcc.c-torture/execute/20050218-1.c: New test.
+
+2005-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/20043
+ * gcc.dg/transparent-union-1.c: New test.
+ * gcc.dg/transparent-union-2.c: New test.
+
+2005-02-18 James E Wilson <wilson@specifixinc.com>
+
+ PR tree-optimization/18977
+ * gcc.c-torture/execute/loop-ivopts-1.c: New testcase.
+
+2005-02-18 Ulrich Weigand <uweigand@de.ibm.com>
+
+ PR target/20054
+ * gcc.dg/pr20054.c: New test.
+
+2005-01-20 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/19508
+ * g++.dg/ext/attrib20.C: New test.
+
+2004-02-18 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR middle-end/20030
+ * gfortran.fortran-torture/execute/character_passing.f90: New test.
+
+2005-02-18 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/20008
+ * g++.dg/opt/switch4.C: New.
+
+2005-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/20023
+ PR tree-optimization/20009
+ * gcc.c-torture/compile/20050217-1.c: New test.
+ * g++.dg/opt/switch3.C: New test.
+
+ PR tree-optimization/18947
+ * gcc.c-torture/compile/20050215-1.c: New test.
+ * gcc.c-torture/compile/20050215-2.c: New test.
+ * gcc.c-torture/compile/20050215-3.c: New test.
+
+2005-02-17 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/20028
+ * g++.dg/template/crash34.C: New.
+
+ PR c++/20022
+ * g++.dg/other/access3.C: New.
+
+2005-02-17 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/vect-98.c: New test.
+
+2005-02-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR tree-optimization/19967
+ * gcc.dg/pr19967.c: New.
+
+2005-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/19857
+ * gcc.dg/tree-ssa/20050215-1.c: New test.
+ * gcc.c-torture/execute/20050215-1.c: New test.
+
+2005-02-15 Eric Christopher <echristo@redhat.com>
+
+ * gcc.dg/cpp/20050215-1.c: New file.
+
+2005-02-15 James A. Morrison <phython@gcc.gnu.org>
+
+ PR tree-optimization/15785
+ * gcc.dg/pr15785-1.c: New test.
+
+2005-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17788
+ * g++.dg/init/ctor4.C: New.
+ * g++.old-deja/g++.bugs/900205_04.C: Adjust.
+
+2005-02-15 Joseph S. Myers <joseph@codesourcery.com>
+
+ * gcc.dg/overflow-warn-1.c, gcc.dg/overflow-warn-2.c,
+ gcc.dg/overflow-warn-3.c, gcc.dg/overflow-warn-4.c: New tests.
+
+2005-02-15 Andreas Schwab <schwab@suse.de>
+
+ * ada/acats/tests/cxb/cxb30131.c: Include <stdlib.h> to properly
+ declare malloc.
+
+2005-02-15 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * gcc.misc-tests/linkage.exp (s390): Check for 64bit added.
+
+2005-02-14 Diego Novillo <dnovillo@redhat.com>
+
+ PR tree-optimization/19853
+ * gcc.c-torture/compile/pr19853.c: New test.
+
+2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19608
+ * g++.dg/parse/local-class1.C: New.
+
+ PR c++/19895
+ * g++.dg/parse/ptrmem3.C: New.
+
+ PR c++/19884
+ * g++.old-deja/g++.oliva/template6.C: Add another case.
+ * g++.dg/template/explicit6.C: New.
+
+2005-02-14 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/17816
+ * g++.dg/other/redecl2.C: New.
+
+2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/19891
+ * g++.dg/abi/covariant4.C: New.
+
+2005-02-13 James A. Morrison <phython@gcc.gnu.org>
+
+ * gcc.dg/pr15784-1.c, gcc.dg/pr15784-2.c, gcc.dg/pr15784-3.c: New tests.
+
+2005-02-12 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/vect/vect-96.c: Fix typo.
+
+2005-02-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/14479
+ PR c++/19487
+ * g++.dg/template/enum5.C: New test.
+
+2005-02-12 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/vect-97.c: New test.
+
+2005-02-12 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/vect-96.c: New test.
+
+2005-02-12 Uros Bizjak <uros@kss-loka.si>
+
+ * gcc.dg/builtins-34.c: Also check ldexp*.
+
+2005-02-12 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * gcc.dg/tree-ssa/20040703-1.c: Quote decimal dot.
+
+2005-02-11 Janis Johnson <janis187@us.ibm.com>
+
+ * lib/gcc-dg.exp: (dg-require-weak, dg-require-visibility,
+ dg-require-alias, dg-require-gc-sections, dg-require-profiling,
+ dg-require-dll, dg-require-iconv, dg-require-named-sections,
+ dg-require-effective-target, dg-skip-if, dg-xfail-if, selector_opd,
+ selector_list, selector_expression, dg-process-target): Move to new
+ file target-supports-dg.exp.
+ * lib/target-supports-dg.exp: New.
+
+ * lib/target-supports.exp (check_effective_target_broken_cplxf_arg):
+ New.
+
+2005-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/19666
+ * gcc/testsuite/g++.dg/other/ptrmem6.C: New test.
+
+ PR middle-end/19858
+ * gcc.c-torture/compile/20050210-1.c: New test.
+
+2005-02-11 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19755
+ * g++.dg/warn/Wbraces1.C: New test.
+
+2005-02-10 Richard Guenther <rguenth@gcc.gnu.org>
+
+ * gcc.dg/builtins-52.c: New testcase.
+
+2005-02-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/19342
+ * gcc.c-torture/execute/20050119-1.c: New test.
+
+2005-02-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19811
+ * g++.dg/init/delete1.C: New test.
+
+2005-02-09 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/18470
+ * g++.dg/template/static12.C: New test.
+
+2005-02-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19787
+ * g++.dg/conversion/ambig1.C: New test.
+
+ PR c++/19739
+ * g++.dg/ext/attrib19.C: New test.
+
+ PR c++/19732
+ * g++.dg/parse/dtor5.C: New test.
+
+ PR c++/19762
+ * g++.dg/template/dtor3.C: New test.
+
+ PR c++/19826
+ * g++.dg/template/static11.C: New test.
+ * g++.dg/template/crash2.C: Remove dg-error marker.
+
+2005-02-09 Janis Johnson <janis187@us.ibm.com>
+
+ PR C++/18491
+ * g++.old-deja/g++.mike/p10769a.C: Remove.
+
+2005-02-09 Roger Sayle <roger@eyesopen.com>
+
+ * gcc.dg/builtins-48.c: New test case.
+ * gcc.dg/builtins-49.c: New test case.
+ * gcc.dg/builtins-50.c: New test case.
+ * gcc.dg/builtins-51.c: New test case.
+
+2005-02-09 Ian Lance Taylor <ian@airs.com>
+
+ PR middle-end/19583
+ * g++.dg/warn/Wreturn-type-3.C: New test.
+
+2005-02-09 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR middle-end/19402
+ * gcc.dg/pr19402-1.c: New testcase.
+ * gcc.dg/pr19402-2.c: likewise.
+
+2005-02-09 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR middle-end/19854
+ * g++.dg/tree-ssa/tmmti.C: New testcase.
+
+2005-02-09 Joseph S. Myers <joseph@codesourcery.com>
+
+ * g++.dg/rtti/tinfo1.C: Allow newline after assembler label.
+
+2005-02-08 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/19733
+ * g++.dg/parse/crash23.C: New test.
+ * g++.dg/warn/Weff1.C: New test.
+
+2005-02-09 Joseph S. Myers <joseph@codesourcery.com>
+
+ * gcc.dg/20050209-1.c: New test.
+
+2005-02-09 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR target/19799
+ * gcc.dg/sibcall-3.c, gcc.dg/sibcall-4.c: XFAIL on hppa*64*-*.
+
+2005-02-08 Mike Stump <mrs@apple.com>
+
+ * g++.dg/pch/import-2.c: New test.
+ * g++.dg/pch/import-2.hs: New.
+ * g++.dg/pch/include/import-2a.h: New.
+ * g++.dg/pch/include/import-2b.h: New.
+
+2005-02-08 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/uninit-4.c: XFAIL bogus warning for powerpc64.
+
+2005-02-08 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * gfortran.dg/substr_1.f90: New test.
+
+2005-02-07 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR middle-end/19775
+ * gcc.dg/torture/builtin-power-1.c: Disable test for
+ invalid transformation.
+ * gcc.dg/builtins-10.c: Likewise. Disable one test we
+ no longer optimize.
+ * gcc.dg/builtins-47.c: New testcase.
+
+2005-02-07 Leehod Baruch <leehod@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * testsuite/gcc.dg/vect/vect.exp: Add -ftree-vectorizer-verbose=3.
+
2005-02-06 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/compile/20050206-1.c: New test.
@@ -24,7 +536,7 @@
2005-02-03 Dorit Naishlos <dorit@il.ibm.com>
* gcc.dg/vect/vect-85.c: Remove xfail.
- * gcc.dg/vect/vect-86.c: Remove xfail.
+ * gcc.dg/vect/vect-86.c: Remove xfail.
* gcc.dg/vect/vect-87.c: Remove xfail.
* gcc.dg/vect/vect-88.c: Remove xfail.
@@ -48,7 +560,7 @@
PR c++/19628
* g++/ext/builtin7.C: New.
* g++/ext/builtin8.C: New.
-
+
2005-02-02 Joseph S. Myers <joseph@codesourcery.com>
PR c/18502
@@ -202,7 +714,7 @@
* g++.dg/template/static10.C: New test.
PR c++/19395
- * g++.dg/parse/error24.C: New test.
+ * g++.dg/parse/error24.C: New test.
PR c++/19367
* g++.dg/lookup/builtin1.C: New test.
@@ -323,7 +835,7 @@
2005-01-26 Greg Parker <gparker@apple.com>
Stuart Hastings <stuart@apple.com>
-
+
* gcc.c-torture/execute/20050125-1.c: New.
2005-01-18 Jan Hubicka <jh@suse.cz>
@@ -636,7 +1148,7 @@
* ada/acats/tests/c3/c92005b.ada: Likewise.
* ada/acats/tests/c3/cxb3012.a: Likewise.
* ada/acats/norun.lst: Add c380004 and c953002, add PR
-
+
2005-01-09 Paul Brook <paul@codesourcery.com>
* gfortran.dg/common_2.f90: New file.
diff --git a/gcc/testsuite/ada/acats/tests/cxa/cxa3004.a b/gcc/testsuite/ada/acats/tests/cxa/cxa3004.a
deleted file mode 100644
index ed2023e37e5..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxa/cxa3004.a
+++ /dev/null
@@ -1,235 +0,0 @@
--- CXA3004.A
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the functions defined in package Ada.Characters.Handling
--- for classification of and conversion between Wide_Character and
--- Character values produce correct results when given the appropriate
--- Character and String inputs.
---
--- TEST DESCRIPTION:
--- This test demonstrates the functions defined in package
--- Ada.Characters.Handling which provide for the classification of and
--- conversion between Wide_Characters and Characters, in character
--- variables and strings.
--- Each of the functions is provided with input values that are of the
--- appropriate range. The results of the function processing are
--- subsequently evaluated.
---
--- APPLICABILITY CRITERIA:
--- Applicable to all implementations using the Latin_1 set as the
--- definition of Character.
---
---
--- CHANGE HISTORY:
--- 06 Dec 94 SAIC ACVC 2.0
--- 27 Dec 94 SAIC Corrected variable names.
---
---!
-
-with Report;
-with Ada.Characters.Handling;
-
-procedure CXA3004 is
-begin
-
- Report.Test ("CXA3004", "Check that the functions defined in package " &
- "Ada.Characters.Handling for classification " &
- "of and conversion between Wide_Character and " &
- "Character values produce correct results " &
- "when given the appropriate Character " &
- "and String inputs");
-
- Test_Block:
- declare
-
- package ACH renames Ada.Characters.Handling;
-
- Char_End : Integer := 255;
- WC_Start : Integer := 256;
- Sub_Char : Character := '*';
-
- Blank : Character := ' ';
- First_Char : Character := Character'First;
- Last_Char : Character := Character'Last;
- F_Char : Character := 'F';
-
-
- First_Wide_Char : Wide_Character := Wide_Character'First;
- Last_Non_Wide_Char : Wide_Character := Wide_Character'Val(Char_End);
- First_Unique_Wide_Char : Wide_Character := Wide_Character'Val(WC_Start);
- Last_Wide_Char : Wide_Character := Wide_Character'Last;
-
- A_String : String (1..3) := First_Char & 'X' & Last_Char;
- A_Wide_String : Wide_String (1..3) := First_Wide_Char &
- ACH.To_Wide_Character('X') &
- ACH.To_Wide_Character(Last_Char);
-
- Unique_Wide_String : Wide_String (1..2) := First_Unique_Wide_Char &
- Last_Wide_Char;
-
- Mixed_Wide_String : Wide_String (1..6) := ACH.To_Wide_Character('A') &
- First_Wide_Char &
- Last_Non_Wide_Char &
- First_Unique_Wide_Char &
- Last_Wide_Char &
- ACH.To_Wide_Character('Z');
-
-
- Basic_Char : Character := 'A';
- Basic_Wide_Char : Wide_Character := 'A';
- Basic_String : String (1..6) := "ABCXYZ";
- Basic_Wide_String : Wide_String (1..6) := "ABCXYZ";
-
- begin
-
-
- -- Function Is_Character
-
-
- if not ACH.Is_Character(First_Wide_Char) then
- Report.Failed ("Incorrect result from Is_Character - 1");
- end if;
-
-
- if ACH.Is_Character(First_Unique_Wide_Char) or
- ACH.Is_Character(Last_Wide_Char)
- then
- Report.Failed ("Incorrect result from Is_Character - 2");
- end if;
-
-
- -- Function Is_String
-
-
- if not ACH.Is_String(A_Wide_String) then
- Report.Failed ("Incorrect result from Is_String - 1");
- end if;
-
-
- if ACH.Is_String(Unique_Wide_String) or
- ACH.Is_String(Mixed_Wide_String)
- then
- Report.Failed ("Incorrect result from Is_String - 2");
- end if;
-
-
- -- Function To_Character
-
-
- -- Use default substitution character in call of To_Character.
-
- if ACH.To_Character(First_Wide_Char) /= First_Char or
- ACH.To_Character(Last_Non_Wide_Char) /= Last_Char
- then
- Report.Failed ("Incorrect result from To_Character - 1");
- end if;
-
-
- -- Provide a substitution character for use with To_Character.
-
- if ACH.To_Character(First_Unique_Wide_Char, Blank) /= Blank or
- ACH.To_Character(First_Unique_Wide_Char, Sub_Char) /= Sub_Char or
- ACH.To_Character(Last_Wide_Char) /= ' ' -- default
- then
- Report.Failed ("Incorrect result from To_Character - 2");
- end if;
-
-
- -- Function To_String
-
-
- if ACH.To_String(A_Wide_String) /= A_String then
- Report.Failed ("Incorrect result from To_String - 1");
- end if;
-
-
- if ACH.To_String(Unique_Wide_String, Sub_Char) /= "**" then
- Report.Failed ("Incorrect result from To_String - 2");
- end if;
-
-
-
- if ACH.To_String(Mixed_Wide_String, Sub_Char) /=
- ('A' & First_Char & Last_Char & "**" & 'Z') or
- ACH.To_String(Mixed_Wide_String, Sub_Char) /=
- (ACH.To_Character(Mixed_Wide_String(1), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(2), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(3), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(4), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(5), Sub_Char) &
- ACH.To_Character(Mixed_Wide_String(6), Sub_Char))
- then
- Report.Failed ("Incorrect result from To_String - 3");
- end if;
-
-
- -- Function To_Wide_Character
-
-
- if ACH.To_Wide_Character(Basic_Char) /= Basic_Wide_Char then
- Report.Failed ("Incorrect result from To_Wide_Character");
- end if;
-
-
- -- Function To_Wide_String
-
-
- if not (ACH.To_Wide_String(Basic_String) = Basic_Wide_String) then
- Report.Failed ("Incorrect result from To_Wide_String");
- end if;
-
-
- -- Functions Used In Combination
-
- if not ACH.Is_Character (ACH.To_Wide_Character (
- ACH.To_Character(First_Wide_Char)))
- then
- Report.Failed ("Incorrect result from functions in combination - 1");
- end if;
-
-
- if not ACH.Is_String(ACH.To_Wide_String(ACH.To_String(A_Wide_String)))
- then
- Report.Failed ("Incorrect result from functions in combination - 2");
- end if;
-
-
- if ACH.To_String(ACH.To_Wide_Character('A') &
- ACH.To_Wide_Character(F_Char) &
- ACH.To_Wide_Character('Z')) /= "AFZ"
- then
- Report.Failed ("Incorrect result from functions in combination - 3");
- end if;
-
-
- exception
- when others => Report.Failed ("Exception raised in Test_Block");
- end Test_Block;
-
-
- Report.Result;
-
-end CXA3004;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb30061.am b/gcc/testsuite/ada/acats/tests/cxb/cxb30061.am
deleted file mode 100644
index d31345a8eb1..00000000000
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb30061.am
+++ /dev/null
@@ -1,404 +0,0 @@
--- CXB30061.AM
---
--- Grant of Unlimited Rights
---
--- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--- unlimited rights in the software and documentation contained herein.
--- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
--- this public release, the Government intends to confer upon all
--- recipients unlimited rights equal to those held by the Government.
--- These rights include rights to use, duplicate, release or disclose the
--- released technical data and computer software in whole or in part, in
--- any manner and for any purpose whatsoever, and to have or permit others
--- to do so.
---
--- DISCLAIMER
---
--- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--- PARTICULAR PURPOSE OF SAID MATERIAL.
---*
---
--- OBJECTIVE:
--- Check that the function To_C maps between the Ada type Wide_Character
--- and the C type wchar_t.
---
--- Check that the function To_Ada maps between the C type wchar_t and
--- the Ada type Wide_Character.
---
--- Check that the function Is_Nul_Terminated returns True if the
--- wchar_array parameter contains wide_nul, and otherwise False.
---
--- Check that the function To_C produces a correct wchar_array result,
--- with lower bound of 0, and length dependent upon the Item and
--- Append_Nul parameters.
---
--- Check that the function To_Ada produces a correct wide_string result,
--- with lower bound of 1, and length dependent upon the Item and
--- Trim_Nul parameters.
---
--- Check that the function To_Ada raises Terminator_Error if the
--- parameter Trim_Nul is set to True, but the actual Item parameter
--- does not contain the wide_nul wchar_t.
---
--- TEST DESCRIPTION:
--- This test uses a variety of Wide_Character, wchar_t, Wide_String, and
--- wchar_array objects to test versions of the To_C, To_Ada, and
--- Is_Nul_Terminated functions.
---
--- This test assumes that the following characters are all included
--- in the implementation defined type Interfaces.C.wchar_t:
--- ' ', ',', '.', '0'..'9', 'a'..'z' and 'A'..'Z'.
---
--- APPLICABILITY CRITERIA:
--- This test is applicable to all implementations that provide
--- package Interfaces.C. If an implementation provides
--- package Interfaces.C, this test must compile, execute, and
--- report "PASSED".
---
--- SPECIAL REQUIREMENTS:
--- The file CXB30060.C must be compiled with a C compiler.
--- Implementation dialects of C may require alteration of
--- the C program syntax (see individual C files).
---
--- Note that the compiled C code must be bound with the compiled Ada
--- code to create an executable image. An implementation must provide
--- the necessary commands to accomplish this.
---
--- Note that the C code included in CXB30060.C conforms
--- to ANSI-C. Modifications to these files may be required for other
--- C compilers. An implementation must provide the necessary
--- modifications to satisfy the function requirements.
---
--- TEST FILES:
--- The following files comprise this test:
---
--- CXB30060.C
--- CXB30061.AM
---
--- CHANGE HISTORY:
--- 07 Sep 95 SAIC Initial prerelease version.
--- 09 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
--- 13 Sep 99 RLB Replaced (bogus) Unchecked_Conversions with a
--- C function character generator.
---
---!
-
-with Report;
-with Interfaces.C; -- N/A => ERROR
-with Ada.Characters.Latin_1;
-with Ada.Characters.Handling;
-with Ada.Exceptions;
-with Ada.Strings.Wide_Fixed;
-with Impdef;
-
-procedure CXB30061 is
-begin
-
- Report.Test ("CXB3006", "Check that the functions To_C and To_Ada " &
- "produce correct results");
-
- Test_Block:
- declare
-
- use Interfaces, Interfaces.C;
- use Ada.Characters, Ada.Characters.Latin_1, Ada.Characters.Handling;
- use Ada.Strings.Wide_Fixed;
-
- First_Character,
- Last_Character : Character;
- TC_wchar_t,
- TC_Low_wchar_t,
- TC_High_wchar_t : wchar_t := wchar_t'First;
- TC_Wide_String : Wide_String(1..8) := (others => Wide_Character'First);
- TC_wchar_array : wchar_array(0..7) := (others => C.wide_nul);
-
- -- The function Char_Gen returns a character corresponding to its
- -- argument.
- -- Value 0 .. 9 ==> '0' .. '9'
- -- Value 10 .. 19 ==> 'A' .. 'J'
- -- Value 20 .. 29 ==> 'k' .. 't'
- -- Value 30 ==> ' '
- -- Value 31 ==> '.'
- -- Value 32 ==> ','
-
- function Char_Gen (Value : in int) return wchar_t;
-
- -- Use the user-defined C function char_gen as a completion to the
- -- function specification above.
-
- pragma Import (Convention => C,
- Entity => Char_Gen,
- External_Name => Impdef.CXB30060_External_Name);
-
- begin
-
- -- Check that the functions To_C and To_Ada map between the Ada type
- -- Wide_Character and the C type wchar_t.
-
- if To_C(To_Wide_Character(Ada.Characters.Latin_1.NUL)) /=
- Interfaces.C.wide_nul
- then
- Report.Failed("Incorrect result from To_C with NUL character input");
- end if;
-
- First_Character := Report.Ident_Char('k');
- Last_Character := Report.Ident_Char('t');
- for i in First_Character..Last_Character loop
- if To_C(Item => To_Wide_Character(i)) /=
- Char_Gen(Character'Pos(i) - Character'Pos('k') + 20)
- then
- Report.Failed("Incorrect result from To_C with lower case " &
- "alphabetic wide character input");
- end if;
- end loop;
-
- First_Character := Report.Ident_Char('A');
- Last_Character := Report.Ident_Char('J');
- for i in First_Character..Last_Character loop
- if To_C(Item => To_Wide_Character(i)) /=
- Char_Gen(Character'Pos(i) - Character'Pos('A') + 10)
- then
- Report.Failed("Incorrect result from To_C with upper case " &
- "alphabetic wide character input");
- end if;
- end loop;
-
- First_Character := Report.Ident_Char('0');
- Last_Character := Report.Ident_Char('9');
- for i in First_Character..Last_Character loop
- if To_C(Item => To_Wide_Character(i)) /=
- Char_Gen(Character'Pos(i) - Character'Pos('0'))
- then
- Report.Failed("Incorrect result from To_C with digit " &
- "wide character input");
- end if;
- end loop;
-
- if To_C(Item => To_Wide_Character(' ')) /= Char_Gen(30)
- then
- Report.Failed("Incorrect result from To_C with space " &
- "wide character input");
- end if;
-
- if To_C(Item => To_Wide_Character('.')) /= Char_Gen(31)
- then
- Report.Failed("Incorrect result from To_C with dot " &
- "wide character input");
- end if;
-
- if To_C(Item => To_Wide_Character(',')) /= Char_Gen(32)
- then
- Report.Failed("Incorrect result from To_C with comma " &
- "wide character input");
- end if;
-
- if To_Ada(Interfaces.C.wide_nul) /=
- To_Wide_Character(Ada.Characters.Latin_1.NUL)
- then
- Report.Failed("Incorrect result from To_Ada with wide_nul " &
- "wchar_t input");
- end if;
-
- for Code in int range
- int(Report.Ident_Int(20)) .. int(Report.Ident_Int(29)) loop
- -- 'k' .. 't'
- if To_Ada(Item => Char_Gen(Code)) /=
- To_Wide_Character(Character'Val (Character'Pos('k') + (Code - 20)))
- then
- Report.Failed("Incorrect result from To_Ada with lower case " &
- "alphabetic wchar_t input");
- end if;
- end loop;
-
- for Code in int range
- int(Report.Ident_Int(10)) .. int(Report.Ident_Int(19)) loop
- -- 'A' .. 'J'
- if To_Ada(Item => Char_Gen(Code)) /=
- To_Wide_Character(Character'Val (Character'Pos('A') + (Code - 10)))
- then
- Report.Failed("Incorrect result from To_Ada with upper case " &
- "alphabetic wchar_t input");
- end if;
- end loop;
-
- for Code in int range
- int(Report.Ident_Int(0)) .. int(Report.Ident_Int(9)) loop
- -- '0' .. '9'
- if To_Ada(Item => Char_Gen(Code)) /=
- To_Wide_Character(Character'Val (Character'Pos('0') + (Code)))
- then
- Report.Failed("Incorrect result from To_Ada with digit " &
- "wchar_t input");
- end if;
- end loop;
-
- if To_Ada(Item => Char_Gen(30)) /= ' ' then
- Report.Failed("Incorrect result from To_Ada with space " &
- "char input");
- end if;
- if To_Ada(Item => Char_Gen(31)) /= '.' then
- Report.Failed("Incorrect result from To_Ada with dot " &
- "char input");
- end if;
- if To_Ada(Item => Char_Gen(32)) /= ',' then
- Report.Failed("Incorrect result from To_Ada with comma " &
- "char input");
- end if;
-
- -- Check that the function Is_Nul_Terminated produces correct results
- -- whether or not the wchar_array argument contains the
- -- Ada.Interfaces.C.wide_nul character.
-
- TC_Wide_String := "abcdefgh";
- if Is_Nul_Terminated(Item => To_C(TC_Wide_String, Append_Nul => False))
- then
- Report.Failed("Incorrect result from Is_Nul_Terminated when no " &
- "wide_nul wchar_t is present");
- end if;
-
- if not Is_Nul_Terminated(To_C(TC_Wide_String, Append_Nul => True)) then
- Report.Failed("Incorrect result from Is_Nul_Terminated when the " &
- "wide_nul wchar_t is present");
- end if;
-
-
-
- -- Now that we've tested the character/char versions of To_Ada and To_C,
- -- use them to test the string versions.
-
- declare
- i : size_t := 0;
- j : integer := 1;
- Incorrect_Conversion : Boolean := False;
-
- TC_No_wide_nul : constant wchar_array := To_C(TC_Wide_String,
- False);
- TC_wide_nul_Appended : constant wchar_array := To_C(TC_Wide_String,
- True);
- begin
-
- -- Check that the function To_C produces a wchar_array result with
- -- lower bound of 0, and length dependent upon the Item and
- -- Append_Nul parameters (if Append_Nul is True, length is
- -- Item'Length + 1; if False, length is Item'Length).
-
- if TC_No_wide_nul'First /= 0 or TC_wide_nul_Appended'First /= 0 then
- Report.Failed("Incorrect lower bound from Function To_C");
- end if;
-
- if TC_No_wide_nul'Length /= TC_Wide_String'Length then
- Report.Failed("Incorrect length returned from Function To_C " &
- "when Append_Nul => False");
- end if;
-
- if TC_wide_nul_Appended'Length /= TC_Wide_String'Length + 1 then
- Report.Failed("Incorrect length returned from Function To_C " &
- "when Append_Nul => True");
- end if;
-
- if not Is_Nul_Terminated(TC_wide_nul_Appended) then
- Report.Failed("No wide_nul appended to the wide_string " &
- "parameter during conversion to wchar_array " &
- "by function To_C");
- end if;
-
- for TC_char in Report.Ident_Char('a')..Report.Ident_Char('h') loop
- if TC_No_wide_nul(i) /= To_C(To_Wide_Character(TC_char)) or
- TC_wide_nul_Appended(i) /= To_C(To_Wide_Character(TC_char)) then
- -- Use single character To_C.
- Incorrect_Conversion := True;
- end if;
- i := i + 1;
- end loop;
-
- if Incorrect_Conversion then
- Report.Failed("Incorrect result from To_C with wide_string input " &
- "and wchar_array result");
- end if;
-
-
- -- Check that the function To_Ada produces a wide_string result with
- -- lower bound of 1, and length dependent upon the Item and
- -- Trim_Nul parameters (if Trim_Nul is False, length is Item'Length;
- -- if False, length will be the length of the slice of Item prior to
- -- the first wide_nul).
-
- declare
- TC_No_NUL_Wide_String : constant Wide_String :=
- To_Ada(Item => TC_wide_nul_Appended, Trim_Nul => True);
-
- TC_NUL_Appended_Wide_String : constant Wide_String :=
- To_Ada(TC_wide_nul_Appended, False);
-
- begin
-
- if TC_No_NUL_Wide_String'First /= 1 or
- TC_NUL_Appended_Wide_String'First /= 1
- then
- Report.Failed("Incorrect lower bound from Function To_Ada");
- end if;
-
- if TC_No_NUL_Wide_String'Length /= TC_Wide_String'Length then
- Report.Failed("Incorrect length returned from Function " &
- "To_Ada when Trim_Nul => True");
- end if;
-
- if TC_NUL_Appended_Wide_String'Length /=
- TC_Wide_String'Length + 1
- then
- Report.Failed("Incorrect length returned from Function " &
- "To_Ada when Trim_Nul => False");
- end if;
-
- for TC_Character in Wide_Character'('a') .. Wide_Character'('h') loop
- if TC_No_NUL_Wide_String(j) /= TC_Character or
- TC_NUL_Appended_Wide_String(j) /= TC_Character
- then
- Report.Failed("Incorrect result from To_Ada with " &
- "char_array input, index = " &
- Integer'Image(j));
- end if;
- j := j + 1;
- end loop;
-
- end;
-
-
- -- Check that the function To_Ada raises Terminator_Error if the
- -- parameter Trim_Nul is set to True, but the actual Item parameter
- -- does not contain the wide_nul wchar_t.
-
- begin
- TC_Wide_String := To_Ada(TC_No_wide_nul, Trim_Nul => True);
- Report.Failed("Terminator_Error not raised when Item " &
- "parameter of To_Ada does not contain the " &
- "wide_nul wchar_t, but parameter Trim_Nul " &
- "=> True");
- Report.Comment
- (To_String(TC_Wide_String) & " printed to defeat optimization");
- exception
- when Terminator_Error => null; -- OK, expected exception.
- when others =>
- Report.Failed("Incorrect exception raised by function " &
- "To_Ada when the Item parameter does not " &
- "contain the wide_nul wchar_t, but " &
- "parameter Trim_Nul => True");
- end;
-
- end;
-
- exception
- when The_Error : others =>
- Report.Failed
- ("The following exception was raised in the Test_Block: " &
- Ada.Exceptions.Exception_Name(The_Error));
- end Test_Block;
-
- Report.Result;
-
-end CXB30061;
diff --git a/gcc/testsuite/ada/acats/tests/cxb/cxb30131.c b/gcc/testsuite/ada/acats/tests/cxb/cxb30131.c
index 7bebe551c6d..6cbbdd131b0 100644
--- a/gcc/testsuite/ada/acats/tests/cxb/cxb30131.c
+++ b/gcc/testsuite/ada/acats/tests/cxb/cxb30131.c
@@ -54,10 +54,11 @@
*/
#include <string.h>
+#include <stdlib.h>
char *stringdup (char *s)
{
- char *result = (char *) malloc(sizeof(char)*(strlen(s)+1));
+ char *result = malloc(sizeof(char)*(strlen(s)+1));
return strcpy(result,s);
}
diff --git a/gcc/testsuite/g++.dg/charset/asm1.c b/gcc/testsuite/g++.dg/charset/asm1.c
index 9c0ff2866b0..7076d128566 100644
--- a/gcc/testsuite/g++.dg/charset/asm1.c
+++ b/gcc/testsuite/g++.dg/charset/asm1.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target *-*-* } }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler ".ascii bar" } }
{ dg-final { scan-assembler ".ascii foo" } }
*/
diff --git a/gcc/testsuite/g++.dg/charset/asm2.c b/gcc/testsuite/g++.dg/charset/asm2.c
index 8d8dbbb524d..8ae2212fd26 100644
--- a/gcc/testsuite/g++.dg/charset/asm2.c
+++ b/gcc/testsuite/g++.dg/charset/asm2.c
@@ -1,7 +1,7 @@
/* Test for complex asm statements. Make sure it compiles
then test for some of the asm statements not being translated. */
/* { dg-do compile { target i?86-*-* } }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "std" } }
{ dg-final { scan-assembler "cld" } }
{ dg-final { scan-assembler "rep" } }
diff --git a/gcc/testsuite/g++.dg/charset/asm3.c b/gcc/testsuite/g++.dg/charset/asm3.c
index cd850c3e81f..59c8d59ff39 100644
--- a/gcc/testsuite/g++.dg/charset/asm3.c
+++ b/gcc/testsuite/g++.dg/charset/asm3.c
@@ -1,6 +1,6 @@
/* Simple asm test. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "foo" } } */
extern int bar;
diff --git a/gcc/testsuite/g++.dg/charset/asm4.c b/gcc/testsuite/g++.dg/charset/asm4.c
index fa93f40fdaf..a4bb01401a9 100644
--- a/gcc/testsuite/g++.dg/charset/asm4.c
+++ b/gcc/testsuite/g++.dg/charset/asm4.c
@@ -1,6 +1,6 @@
/* Test for string translation. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "translate" } } */
void foo (void)
{
diff --git a/gcc/testsuite/g++.dg/charset/asm5.c b/gcc/testsuite/g++.dg/charset/asm5.c
index 91316224f0c..ae2ec485d80 100644
--- a/gcc/testsuite/g++.dg/charset/asm5.c
+++ b/gcc/testsuite/g++.dg/charset/asm5.c
@@ -1,6 +1,6 @@
/* Test for string translation. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "foo" } } */
int main()
{
diff --git a/gcc/testsuite/g++.dg/charset/attribute1.c b/gcc/testsuite/g++.dg/charset/attribute1.c
index 993c7934c80..799630030ba 100644
--- a/gcc/testsuite/g++.dg/charset/attribute1.c
+++ b/gcc/testsuite/g++.dg/charset/attribute1.c
@@ -1,6 +1,6 @@
/* Test for attribute non-translation. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "foo" } } */
int walrus __attribute__ ((section (".foo")));
diff --git a/gcc/testsuite/g++.dg/charset/attribute2.c b/gcc/testsuite/g++.dg/charset/attribute2.c
index 3cb766aa63a..dcb28f2da27 100644
--- a/gcc/testsuite/g++.dg/charset/attribute2.c
+++ b/gcc/testsuite/g++.dg/charset/attribute2.c
@@ -2,7 +2,7 @@
If error recovery is ever testable then "foobar" should be
translated. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
*/
int foo __attribute__ ((walrus)); /* { dg-error "walrus" "ignored" } */
char x[] = "foobar";
diff --git a/gcc/testsuite/g++.dg/charset/charset.exp b/gcc/testsuite/g++.dg/charset/charset.exp
index 7a74217dec3..6bb19593944 100644
--- a/gcc/testsuite/g++.dg/charset/charset.exp
+++ b/gcc/testsuite/g++.dg/charset/charset.exp
@@ -30,7 +30,7 @@ load_lib target-supports.exp
# If a testcase doesn't have special options, use these.
global DEFAULT_CHARSETCFLAGS
if ![info exists DEFAULT_CHARSETCFLAGS] then {
- set DEFAULT_CHARSETCFLAGS "-fexec-charset=IBM-1047"
+ set DEFAULT_CHARSETCFLAGS "-fexec-charset=IBM1047"
}
# Initialize `dg'.
diff --git a/gcc/testsuite/g++.dg/charset/extern1.cc b/gcc/testsuite/g++.dg/charset/extern1.cc
index 2a68ab7cf78..09284ad1ed2 100644
--- a/gcc/testsuite/g++.dg/charset/extern1.cc
+++ b/gcc/testsuite/g++.dg/charset/extern1.cc
@@ -1,6 +1,6 @@
/* Test extern statments not being translated. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
*/
extern "C" {
diff --git a/gcc/testsuite/g++.dg/charset/extern2.cc b/gcc/testsuite/g++.dg/charset/extern2.cc
index 82157a6fea4..3a8f4e82d7e 100644
--- a/gcc/testsuite/g++.dg/charset/extern2.cc
+++ b/gcc/testsuite/g++.dg/charset/extern2.cc
@@ -1,5 +1,5 @@
/* Check that we push the declaration and then continue translation. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "foobar" } } */
extern "C" { char *foo = "foobar"; }
diff --git a/gcc/testsuite/g++.dg/charset/extern3.cc b/gcc/testsuite/g++.dg/charset/extern3.cc
index 5e46ca6facf..05a0c3e42bc 100644
--- a/gcc/testsuite/g++.dg/charset/extern3.cc
+++ b/gcc/testsuite/g++.dg/charset/extern3.cc
@@ -1,5 +1,5 @@
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "abcdefghijklmnopqrstuvwxyz" } } */
extern char *bar;
diff --git a/gcc/testsuite/g++.dg/charset/function.cc b/gcc/testsuite/g++.dg/charset/function.cc
index ab4c2bcba0e..5aba6511bd0 100644
--- a/gcc/testsuite/g++.dg/charset/function.cc
+++ b/gcc/testsuite/g++.dg/charset/function.cc
@@ -1,5 +1,5 @@
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "\"foobar\"" } } */
const char *str;
diff --git a/gcc/testsuite/g++.dg/charset/string.c b/gcc/testsuite/g++.dg/charset/string.c
index 375e28a2ed6..f720773dd57 100644
--- a/gcc/testsuite/g++.dg/charset/string.c
+++ b/gcc/testsuite/g++.dg/charset/string.c
@@ -1,5 +1,5 @@
/* Simple character translation test. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "string foobar" } } */
char *foo = "string foobar";
diff --git a/gcc/testsuite/g++.dg/dg.exp b/gcc/testsuite/g++.dg/dg.exp
index f809f10f2db..f4ec94c6ee1 100644
--- a/gcc/testsuite/g++.dg/dg.exp
+++ b/gcc/testsuite/g++.dg/dg.exp
@@ -39,6 +39,7 @@ set tests [prune $tests $srcdir/$subdir/gcov/*]
set tests [prune $tests $srcdir/$subdir/pch/*]
set tests [prune $tests $srcdir/$subdir/special/*]
set tests [prune $tests $srcdir/$subdir/tls/*]
+set tests [prune $tests $srcdir/$subdir/vect/*]
# Main loop.
dg-runtest $tests "" $DEFAULT_CXXFLAGS
diff --git a/gcc/testsuite/g++.dg/lookup/anon2.C b/gcc/testsuite/g++.dg/lookup/anon2.C
index 4cd64aecb49..d556ba0034a 100644
--- a/gcc/testsuite/g++.dg/lookup/anon2.C
+++ b/gcc/testsuite/g++.dg/lookup/anon2.C
@@ -1,6 +1,9 @@
// { dg-do compile }
// { dg-options "" }
-class { int i; } a; // { dg-error "private|anonymous type" }
-void foo() { a.i; } // { dg-error "context" }
+// Make sure we issue a diagnostic if a type with no linkage is used
+// to declare a a variable that has linkage.
+struct { int i; } a; // { dg-warning "anonymous type" }
+
+void foo() { a.i; }
diff --git a/gcc/testsuite/g++.dg/other/anon3.C b/gcc/testsuite/g++.dg/other/anon3.C
index 87cbfb544cd..87116eb8901 100644
--- a/gcc/testsuite/g++.dg/other/anon3.C
+++ b/gcc/testsuite/g++.dg/other/anon3.C
@@ -4,4 +4,4 @@
// { dg-do compile }
-enum { a = 3 } x;
+enum { a = 3 } x; // { dg-warning "anonymous type" }
diff --git a/gcc/testsuite/g++.dg/rtti/tinfo1.C b/gcc/testsuite/g++.dg/rtti/tinfo1.C
index 581d3c71c97..037ee35fc8f 100644
--- a/gcc/testsuite/g++.dg/rtti/tinfo1.C
+++ b/gcc/testsuite/g++.dg/rtti/tinfo1.C
@@ -1,6 +1,6 @@
// Test if a local definition is in a linkonce/comdat section.
// { dg-do compile }
-// { dg-final { scan-assembler "_ZTIP9CTemplateIhE\[: \t\]" } }
+// { dg-final { scan-assembler "_ZTIP9CTemplateIhE\[: \t\n\]" } }
// { dg-final { scan-assembler-not ".globl\[ \]+_ZTIP9CTemplateIhE" } }
// { dg-final { scan-assembler-not ".section\[^\n\r\]*_ZTIP9CTemplateIhE\[^\n\r\]*" } }
diff --git a/gcc/testsuite/g++.dg/template/crash2.C b/gcc/testsuite/g++.dg/template/crash2.C
index 8bf7b450df2..a02787a46fa 100644
--- a/gcc/testsuite/g++.dg/template/crash2.C
+++ b/gcc/testsuite/g++.dg/template/crash2.C
@@ -5,7 +5,7 @@ class A
{
public:
static const EnumType size = max; // { dg-error "" }
- int table[size]; // { dg-error "" }
+ int table[size];
};
template <class EnumType>
const EnumType A<EnumType>::size;
diff --git a/gcc/testsuite/g++.dg/template/qualttp15.C b/gcc/testsuite/g++.dg/template/qualttp15.C
index 1b1f3bb725d..0f97c32fcb8 100644
--- a/gcc/testsuite/g++.dg/template/qualttp15.C
+++ b/gcc/testsuite/g++.dg/template/qualttp15.C
@@ -17,8 +17,8 @@ template <class T> struct X<T::template B>
T z;
};
-template <class T> struct X<T::template B>
-{ // { dg-error "redefinition" }
+template <class T> struct X<T::template B> // { dg-error "redefinition" }
+{
T z;
};
diff --git a/gcc/testsuite/g++.dg/template/qualttp20.C b/gcc/testsuite/g++.dg/template/qualttp20.C
index 5a9c61c4304..ae20d762902 100644
--- a/gcc/testsuite/g++.dg/template/qualttp20.C
+++ b/gcc/testsuite/g++.dg/template/qualttp20.C
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-options "-pedantic -pedantic-errors" }
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 15 Dec 2001 <nathan@codesourcery.com>
@@ -16,7 +17,7 @@ struct AS
template <typename T> struct B1 : T
{
typedef typename T::L __restrict__ r;// { dg-error "'__restrict__' qualifiers cannot" "" }
- typedef typename T::myT __restrict__ p;// { dg-warning "ignoring '__restrict__'" "" { xfail *-*-* } }
+ typedef typename T::myT __restrict__ p;// { dg-error "ignoring '__restrict__'" }
// The following are DR 295 dependent
typedef typename T::myT volatile *myvolatile;
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C b/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C
index e5f59ab63bc..a2c84fadb9e 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C
@@ -9,19 +9,23 @@
// keywords: default constructor, inheritance
-struct struct0 {
+// In ISO C++ 1998, such a derived class is not ill-formed, but if the
+// implicitly-declared constructor is used, then it is implicitly
+// defined and found to be ill-formed.
+
+struct struct0 { // { dg-error "note" }
int data_member;
struct0 (int, void *); // suppresses implicit default constructor
};
-struct0::struct0 (int, void *)
+struct0::struct0 (int, void *) // { dg-error "note" }
{
}
-struct struct0_derived_struct_0 : public struct0 { // { dg-error "" }
+struct struct0_derived_struct_0 : public struct0 { // { dg-error "" }
};
-// struct0_derived_struct_0 object; // would give g++ error if compiled
+struct0_derived_struct_0 object;
int main () { return 0; }
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p10769a.C b/gcc/testsuite/g++.old-deja/g++.mike/p10769a.C
deleted file mode 100644
index 89cc31d0fff..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.mike/p10769a.C
+++ /dev/null
@@ -1,46 +0,0 @@
-// { dg-do run }
-// { dg-options "-Wno-pmf-conversions" }
-// prms-id: 10769
-
-#define PMF2PF(PMF) ((void (*)())(PMF))
-
-int ok = 0;
-
-class A {
-public:
- void f1a() { ok += 3; }
- void f1b() { ok += 5; }
- void f2a() { ok += 7; }
- void f2b() { }
- static void (*table[2][2])();
- void main();
-} a;
-
-void (*A::table[2][2])()
- = { { PMF2PF(&A::f1a), PMF2PF(&A::f1b) },
- { PMF2PF(&A::f2a), PMF2PF(&A::f1b) },
- };
-
-void
-dispatch (A *obj, int i, int j)
-{
- (*(void (*)(A *))A::table[i][j])(obj);
-}
-
-void A::main() {
- dispatch (&a, 0, 0);
- void (A::*mPtr)() = &A::f1a;
-
- (*(void (*)(A*))PMF2PF(mPtr))(&a);
- (*(void (*)(A*))PMF2PF(f2a))(&a); // { dg-bogus "" "" { xfail *-*-* } }
-}
-
-int main() {
- a.A::main();
- dispatch (&a, 0, 1);
- void (A::*mPtr)() = &A::f1b;
-
- (*(void (*)(A*))PMF2PF(a.*mPtr))(&a);
- (*(void (*)(A*))PMF2PF(a.f2a))(&a); // { dg-bogus "" "" { xfail *-*-* } }
- return ok != 3+3+5+5+7+7;
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template6.C b/gcc/testsuite/g++.old-deja/g++.oliva/template6.C
index f31d677afb0..270d67695f6 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/template6.C
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/template6.C
@@ -6,4 +6,7 @@
// simplified from bug report by Meenaradchagan Vishnu <mvishnu@fore.com>
template <typename> struct foo {};
-template <> void foo(); // { dg-error "" } bad specialization
+template <> void foo(); // { dg-error "not a template function" } bad specialization
+
+struct baz {};
+template <> void baz (); // { dg-error "not a template function" } bad specialization
diff --git a/gcc/testsuite/g++.old-deja/g++.other/struct1.C b/gcc/testsuite/g++.old-deja/g++.other/struct1.C
index f4fa322bd1f..b1f943f604f 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/struct1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/struct1.C
@@ -9,34 +9,34 @@
class Y
{ // { dg-error "" } previous definition
};
-class Y
-{ // { dg-error "" } redefinition
+class Y // { dg-error "" } redefinition
+{
};
template<class T> class X
{ // { dg-error "" } previous definition
};
-template<class T> class X
-{ // { dg-error "" } redefinition
+template<class T> class X // { dg-error "" } redefinition
+{
};
template<class T> class X<T *>
{ // { dg-error "" } previous definition
};
-template<class T> class X<T *>
-{ // { dg-error "" } redefinition
+template<class T> class X<T *> // { dg-error "" } redefinition
+{
};
template<> class X<int>
{ // { dg-error "" } previous definition
};
-template<> class X<int>
-{ // { dg-error "" } redefinition
+template<> class X<int> // { dg-error "" } redefinition
+{
};
template<> class X<int *>
{ // { dg-error "" } previous definition
};
-template<> class X<int *>
-{ // { dg-error "" } redefinition
+template<> class X<int *> // { dg-error "" } redefinition
+{
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem5.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem5.C
index 4b7d5f9f572..54e975edab6 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem5.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem5.C
@@ -14,4 +14,4 @@ struct Null {
int *pd = NULL;
int (*pf)() = NULL;
int Null::*pmd = NULL;
-int (Null::*pmf)() = NULL; // { dg-bogus "" "" { xfail *-*-* } } - cannot convert -
+int (Null::*pmf)() = NULL;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020720-1.x b/gcc/testsuite/gcc.c-torture/execute/20020720-1.x
index 7afd9e44879..c693128a791 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20020720-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/20020720-1.x
@@ -29,7 +29,7 @@ set torture_eval_before_compile {
set compiler_conditional_xfail_data {
"This test fails to optimize completely on certain platforms." \
{ "xtensa-*-*" "sh-*-*" "arm*-*-*" "strongarm*-*-*" "xscale*-*-*" \
- "h8300*-*-*" "cris-*-*" "frv-*-*" "powerpc-*-*spe" } \
+ "h8300*-*-*" "frv-*-*" "powerpc-*-*spe" } \
{ "*" } \
{ "-O0" }
}
diff --git a/gcc/testsuite/gcc.dg/asm-b.c b/gcc/testsuite/gcc.dg/asm-b.c
index c3b0edd4284..ce68cabe300 100644
--- a/gcc/testsuite/gcc.dg/asm-b.c
+++ b/gcc/testsuite/gcc.dg/asm-b.c
@@ -1,8 +1,8 @@
/* { dg-do run { target powerpc-*-* i?386-*-* x86_64-*-* } } */
/* { dg-options "-O1" } */
-/* Test to make sure that inline-asm causes the tree optimizers to get the
- V_MAY_DEFs and clobber memory. */
-/* Test from Jakub Jelinek, modified by Andrew Pinski to work on all powerpc targets. */
+/* Test to make sure that inline-asm causes the tree optimizators get the
+ V_MAY_DEFs and clober memory. */
+/* Test from Jakub Jelinek, modified by Andrew Pinski to work on all powerpc targets. */
extern void abort (void);
unsigned short v = 0x0300;
diff --git a/gcc/testsuite/gcc.dg/builtins-10.c b/gcc/testsuite/gcc.dg/builtins-10.c
index 9e5a4583fc3..53158a0f852 100644
--- a/gcc/testsuite/gcc.dg/builtins-10.c
+++ b/gcc/testsuite/gcc.dg/builtins-10.c
@@ -14,11 +14,12 @@ extern double exp(double);
extern double log(double);
extern double sqrt(double);
extern double pow(double,double);
+extern double fabs(double);
void test(double x)
{
- if (sqrt(pow(x,4.0)) != x*x)
- link_error ();
+ /*if (sqrt(pow(x,4.0)) != x*x)
+ link_error (); */
if (pow(sqrt(x),4.0) != x*x)
link_error ();
@@ -29,7 +30,7 @@ void test(double x)
void test2(double x, double y, double z)
{
- if (sqrt(pow(x,y)) != pow(x,y*0.5))
+ if (sqrt(pow(x,y)) != pow(fabs(x),y*0.5))
link_error ();
if (log(pow(x,y)) != y*log(x))
diff --git a/gcc/testsuite/gcc.dg/builtins-34.c b/gcc/testsuite/gcc.dg/builtins-34.c
index 0055f329dd5..f2625d5ef59 100644
--- a/gcc/testsuite/gcc.dg/builtins-34.c
+++ b/gcc/testsuite/gcc.dg/builtins-34.c
@@ -12,14 +12,17 @@ extern double exp10(double);
extern double exp2(double);
extern double pow10(double);
extern double expm1(double);
+extern double ldexp(double, int);
extern float exp10f(float);
extern float exp2f(float);
extern float pow10f(float);
extern float expm1f(float);
+extern float ldexpf(float, int);
extern long double exp10l(long double);
extern long double exp2l(long double);
extern long double pow10l(long double);
extern long double expm1l(long double);
+extern long double ldexpl(long double, int);
double test1(double x)
@@ -42,6 +45,11 @@ double test4(double x)
return expm1(x);
}
+double test5(double x, int exp)
+{
+ return ldexp(x, exp);
+}
+
float test1f(float x)
{
return exp10f(x);
@@ -62,6 +70,11 @@ float test4f(float x)
return expm1f(x);
}
+float test5f(float x, int exp)
+{
+ return ldexpf(x, exp);
+}
+
long double test1l(long double x)
{
return exp10l(x);
@@ -82,3 +95,7 @@ long double test4l(long double x)
return expm1l(x);
}
+long double test5l(long double x, int exp)
+{
+ return ldexpl(x, exp);
+}
diff --git a/gcc/testsuite/gcc.dg/charset/asm1.c b/gcc/testsuite/gcc.dg/charset/asm1.c
index d7578d418f6..dfd14018613 100644
--- a/gcc/testsuite/gcc.dg/charset/asm1.c
+++ b/gcc/testsuite/gcc.dg/charset/asm1.c
@@ -1,5 +1,5 @@
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler ".ascii bar" } }
{ dg-final { scan-assembler ".ascii foo" } }
*/
diff --git a/gcc/testsuite/gcc.dg/charset/asm2.c b/gcc/testsuite/gcc.dg/charset/asm2.c
index bfca86c8e96..a9a9c011b2b 100644
--- a/gcc/testsuite/gcc.dg/charset/asm2.c
+++ b/gcc/testsuite/gcc.dg/charset/asm2.c
@@ -2,7 +2,7 @@
If we ever get a good way to test error recovery
the string "foobar" should be translated. */
/* { dg-do compile } */
-/* { dg-require-iconv "IBM-1047" } */
+/* { dg-require-iconv "IBM1047" } */
asm (not_a_string); /* { dg-error "(parse error|syntax error|expected string literal) before" "not_a_string" } */
char x[] = "foobar";
diff --git a/gcc/testsuite/gcc.dg/charset/asm3.c b/gcc/testsuite/gcc.dg/charset/asm3.c
index 8d8dbbb524d..8ae2212fd26 100644
--- a/gcc/testsuite/gcc.dg/charset/asm3.c
+++ b/gcc/testsuite/gcc.dg/charset/asm3.c
@@ -1,7 +1,7 @@
/* Test for complex asm statements. Make sure it compiles
then test for some of the asm statements not being translated. */
/* { dg-do compile { target i?86-*-* } }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "std" } }
{ dg-final { scan-assembler "cld" } }
{ dg-final { scan-assembler "rep" } }
diff --git a/gcc/testsuite/gcc.dg/charset/asm4.c b/gcc/testsuite/gcc.dg/charset/asm4.c
index cd850c3e81f..59c8d59ff39 100644
--- a/gcc/testsuite/gcc.dg/charset/asm4.c
+++ b/gcc/testsuite/gcc.dg/charset/asm4.c
@@ -1,6 +1,6 @@
/* Simple asm test. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "foo" } } */
extern int bar;
diff --git a/gcc/testsuite/gcc.dg/charset/asm5.c b/gcc/testsuite/gcc.dg/charset/asm5.c
index fa93f40fdaf..a4bb01401a9 100644
--- a/gcc/testsuite/gcc.dg/charset/asm5.c
+++ b/gcc/testsuite/gcc.dg/charset/asm5.c
@@ -1,6 +1,6 @@
/* Test for string translation. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "translate" } } */
void foo (void)
{
diff --git a/gcc/testsuite/gcc.dg/charset/asm6.c b/gcc/testsuite/gcc.dg/charset/asm6.c
index 91316224f0c..ae2ec485d80 100644
--- a/gcc/testsuite/gcc.dg/charset/asm6.c
+++ b/gcc/testsuite/gcc.dg/charset/asm6.c
@@ -1,6 +1,6 @@
/* Test for string translation. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "foo" } } */
int main()
{
diff --git a/gcc/testsuite/gcc.dg/charset/attribute1.c b/gcc/testsuite/gcc.dg/charset/attribute1.c
index 993c7934c80..799630030ba 100644
--- a/gcc/testsuite/gcc.dg/charset/attribute1.c
+++ b/gcc/testsuite/gcc.dg/charset/attribute1.c
@@ -1,6 +1,6 @@
/* Test for attribute non-translation. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler "foo" } } */
int walrus __attribute__ ((section (".foo")));
diff --git a/gcc/testsuite/gcc.dg/charset/attribute2.c b/gcc/testsuite/gcc.dg/charset/attribute2.c
index 4ce95a51f84..ef1f35f3ed1 100644
--- a/gcc/testsuite/gcc.dg/charset/attribute2.c
+++ b/gcc/testsuite/gcc.dg/charset/attribute2.c
@@ -2,7 +2,7 @@
If error recovery is ever testable then "foobar" should be
translated. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
*/
int foo __attribute__ ((walrus)); /* { dg-error "walrus" "ignored" } */
char x[] = "foobar";
diff --git a/gcc/testsuite/gcc.dg/charset/charset.exp b/gcc/testsuite/gcc.dg/charset/charset.exp
index ad75cb55af8..bc2c65db910 100644
--- a/gcc/testsuite/gcc.dg/charset/charset.exp
+++ b/gcc/testsuite/gcc.dg/charset/charset.exp
@@ -30,7 +30,7 @@ load_lib target-supports.exp
# If a testcase doesn't have special options, use these.
global DEFAULT_CHARSETCFLAGS
if ![info exists DEFAULT_CHARSETCFLAGS] then {
- set DEFAULT_CHARSETCFLAGS "-fexec-charset=IBM-1047"
+ set DEFAULT_CHARSETCFLAGS "-fexec-charset=IBM1047"
}
# Initialize `dg'.
diff --git a/gcc/testsuite/gcc.dg/charset/extern.c b/gcc/testsuite/gcc.dg/charset/extern.c
index 5e46ca6facf..05a0c3e42bc 100644
--- a/gcc/testsuite/gcc.dg/charset/extern.c
+++ b/gcc/testsuite/gcc.dg/charset/extern.c
@@ -1,5 +1,5 @@
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "abcdefghijklmnopqrstuvwxyz" } } */
extern char *bar;
diff --git a/gcc/testsuite/gcc.dg/charset/function.c b/gcc/testsuite/gcc.dg/charset/function.c
index ab4c2bcba0e..5aba6511bd0 100644
--- a/gcc/testsuite/gcc.dg/charset/function.c
+++ b/gcc/testsuite/gcc.dg/charset/function.c
@@ -1,5 +1,5 @@
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "\"foobar\"" } } */
const char *str;
diff --git a/gcc/testsuite/gcc.dg/charset/string.c b/gcc/testsuite/gcc.dg/charset/string.c
index 375e28a2ed6..f720773dd57 100644
--- a/gcc/testsuite/gcc.dg/charset/string.c
+++ b/gcc/testsuite/gcc.dg/charset/string.c
@@ -1,5 +1,5 @@
/* Simple character translation test. */
/* { dg-do compile }
- { dg-require-iconv "IBM-1047" }
+ { dg-require-iconv "IBM1047" }
{ dg-final { scan-assembler-not "string foobar" } } */
char *foo = "string foobar";
diff --git a/gcc/testsuite/gcc.dg/cpp/separate-1.c b/gcc/testsuite/gcc.dg/cpp/separate-1.c
index 71dcfef7f1d..8698147d521 100644
--- a/gcc/testsuite/gcc.dg/cpp/separate-1.c
+++ b/gcc/testsuite/gcc.dg/cpp/separate-1.c
@@ -12,4 +12,4 @@ int FOO( /* { dg-error "parse error|syntax error|expected" "error on this line"
), bar;
int baz FOO /* { dg-error "parse error|syntax error|expected" "error on this line" } */
-; /* { dg-warning "no type or storage class" "warning on this line" } */
+;
diff --git a/gcc/testsuite/gcc.dg/noncompile/971104-1.c b/gcc/testsuite/gcc.dg/noncompile/971104-1.c
index 4b02d7174df..722b71c784f 100644
--- a/gcc/testsuite/gcc.dg/noncompile/971104-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/971104-1.c
@@ -25,5 +25,5 @@ static void up(int sem){
({ "MUTEX ", "BARB_SEM 1", "BARB_SEM 2", "CUST_SEM 1",
"CUST_SEM 2", "WAIT_SEM 1", "WAIT_SEM 2", "WAIT_SEM 3",
"WAIT_SEM 4"} /* { dg-error "parse error|syntax error|expected" } */
- [( sb.sem_num )]) );
+ [( sb.sem_num )]) ); /* { dg-error "expected" } */
}
diff --git a/gcc/testsuite/gcc.dg/noncompile/990416-1.c b/gcc/testsuite/gcc.dg/noncompile/990416-1.c
index a0e02e20638..49f5569394e 100644
--- a/gcc/testsuite/gcc.dg/noncompile/990416-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/990416-1.c
@@ -3,7 +3,7 @@ typedef int word_type;
static void
copy_reg (unsigned int reg, frame_state *udata, /* { dg-error "parse|syntax|expected" } */
- frame_state *target_udata)
+ frame_state *target_udata) /* { dg-error "expected" } */
{
word_type *preg = get_reg_addr (reg, udata, 0); /* { dg-error "undeclared|function|without a cast" } */
word_type *ptreg = get_reg_addr (reg, target_udata, 0); /* { dg-error "undeclared|without a cast" } */
diff --git a/gcc/testsuite/gcc.dg/sibcall-3.c b/gcc/testsuite/gcc.dg/sibcall-3.c
index d4b1b6f9b63..490e193541f 100644
--- a/gcc/testsuite/gcc.dg/sibcall-3.c
+++ b/gcc/testsuite/gcc.dg/sibcall-3.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail arc-*-* avr-*-* c4x-*-* cris-*-* h8300-*-* ip2k-*-* m32r-*-* m68hc1?-*-* m681?-*-* m680*-*-* m68k-*-* mcore-*-* mn10300-*-* ns32k-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */
+/* { dg-do run { xfail arc-*-* avr-*-* c4x-*-* cris-*-* h8300-*-* hppa*64*-*-* ip2k-*-* m32r-*-* m68hc1?-*-* m681?-*-* m680*-*-* m68k-*-* mcore-*-* mn10300-*-* ns32k-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */
/* { dg-options "-O2 -foptimize-sibling-calls" } */
/* The option -foptimize-sibling-calls is the default, but serves as
diff --git a/gcc/testsuite/gcc.dg/sibcall-4.c b/gcc/testsuite/gcc.dg/sibcall-4.c
index b092440e1ad..7237310b3a0 100644
--- a/gcc/testsuite/gcc.dg/sibcall-4.c
+++ b/gcc/testsuite/gcc.dg/sibcall-4.c
@@ -5,7 +5,7 @@
Copyright (C) 2002 Free Software Foundation Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
-/* { dg-do run { xfail arc-*-* avr-*-* c4x-*-* cris-*-* h8300-*-* ip2k-*-* m32r-*-* m68hc1?-*-* m681?-*-* m680*-*-* m68k-*-* mcore-*-* mn10300-*-* ns32k-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */
+/* { dg-do run { xfail arc-*-* avr-*-* c4x-*-* cris-*-* h8300-*-* hppa*64*-*-* ip2k-*-* m32r-*-* m68hc1?-*-* m681?-*-* m680*-*-* m68k-*-* mcore-*-* mn10300-*-* ns32k-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa-*-* } } */
/* { dg-options "-O2 -foptimize-sibling-calls" } */
/* The option -foptimize-sibling-calls is the default, but serves as
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-power-1.c b/gcc/testsuite/gcc.dg/torture/builtin-power-1.c
index 45566118a81..7cdc00c23fb 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-power-1.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-power-1.c
@@ -63,7 +63,7 @@ void test(double d1, double d2, double d3,
|| FN##l(powl(ld1,ld2)) != powl(ld1,ld2/N)) \
link_failure_##FN##_pow()
- ROOT_POW(sqrt,2);
+ /*ROOT_POW(sqrt,2); Invalid. */
/*ROOT_POW(cbrt,3); Intentionally not implemented. */
/* Test pow(pow(x,y),z) -> pow(x,y*z). */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c
index 5f99be2874e..4b09b536d13 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-ssa-vops" } */
+/* { dg-options "-O1 -fdump-tree-alias1-vops" } */
extern void abort (void);
int a;
@@ -17,5 +17,4 @@ void bar (void)
malloc functions may clobber global memory. Only the function result
does not alias any other pointer.
Hence, we must have a VDEF for a before and after the call to foo(). */
-/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "ssa"} } */
-
+/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "alias1"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c
index 8f6ae167d3d..25e470a59b6 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c
@@ -9,4 +9,4 @@ float foo(float x)
}
/* We should *not* fold the arithmetic. */
-/* { dg-final { scan-tree-dump-times "0.0" 0 "dom2"} } */
+/* { dg-final { scan-tree-dump-times "0\\.0" 0 "dom2"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c b/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c
index ef8f9607056..bc4039f878f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c
@@ -13,5 +13,5 @@ void f(char *a)
link_error ();
}
-/* There should a V_MAY_DEF for the inline-asm and one for the link_error. */
-/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 2 "alias1"} } */
+/* There should a V_MAY_DEF for the inline-asm. */
+/* { dg-final { scan-tree-dump-times "V_MAY_DEF" 1 "alias1"} } */
diff --git a/gcc/testsuite/gcc.dg/uninit-4.c b/gcc/testsuite/gcc.dg/uninit-4.c
index c51d00802b7..3a8d917df28 100644
--- a/gcc/testsuite/gcc.dg/uninit-4.c
+++ b/gcc/testsuite/gcc.dg/uninit-4.c
@@ -23,7 +23,7 @@ extern struct operation cpp_lex (void);
void
cpp_parse_expr (void)
{
- int rprio; /* { dg-bogus "rprio" "uninitialized variable warning" } */
+ int rprio; /* { dg-bogus "rprio" "uninitialized variable warning PR19833" { xfail { powerpc*-*-* && lp64 } } } */
struct operation op;
for (;;)
diff --git a/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc/testsuite/gcc.dg/vect/vect.exp
index 55525f41fab..3f52ed68e19 100644
--- a/gcc/testsuite/gcc.dg/vect/vect.exp
+++ b/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -23,7 +23,8 @@ load_lib gcc-dg.exp
set DEFAULT_VECTCFLAGS ""
# These flags are used for all targets.
-lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fdump-tree-vect-stats"
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" \
+ "-ftree-vectorizer-verbose=3" "-fdump-tree-vect-stats"
# If the target system supports vector instructions, the default action
# for a test is 'run', otherwise it's 'compile'. Save current default.
diff --git a/gcc/testsuite/gcc.misc-tests/linkage.exp b/gcc/testsuite/gcc.misc-tests/linkage.exp
index 375378d0f16..ade04113c13 100644
--- a/gcc/testsuite/gcc.misc-tests/linkage.exp
+++ b/gcc/testsuite/gcc.misc-tests/linkage.exp
@@ -48,11 +48,14 @@ if [isnative] then {
set native_cflags "-xarch=v9"
}
}
- if [istarget "s390x-*-linux*"] {
+ if [istarget "s390*-*-linux*"] {
set file_string [exec file "linkage-x.o"]
if [ string match "*32-bit*" $file_string ] {
set native_cflags "-m31"
}
+ if [ string match "*64-bit*" $file_string ] {
+ set native_cflags "-m64"
+ }
} elseif [istarget "x86_64-*-linux*"] {
set file_string [exec file "linkage-x.o"]
if [ string match "*32-bit*" $file_string ] {
diff --git a/gcc/testsuite/gfortran.dg/do_iterator.f90 b/gcc/testsuite/gfortran.dg/do_iterator.f90
index 982568e3909..0e11aa23339 100644
--- a/gcc/testsuite/gfortran.dg/do_iterator.f90
+++ b/gcc/testsuite/gfortran.dg/do_iterator.f90
@@ -1,8 +1,12 @@
! { dg-do compile }
! various checks which verify that we don't change do-iterators
-DO I=1,5
- I=1 ! { dg-error "cannot be redefined" "changing do-iterator 1" }
+DO I=1,5 ! { dg-error "cannot be redefined" "changing do-iterator 1" }
+ I=1 ! { dg-error "cannot be redefined" "changing do-iterator 1" }
+END DO
+DO I=1,5 ! { dg-error "cannot be redefined" "changing do-iterator 2" }
READ(5,*) I ! { dg-error "cannot be redefined" "changing do-iterator 2" }
+END DO
+DO I=1,5 ! { dg-error "cannot be redefined" "changing do-iterator 3" }
READ(5,*,iostat=i) j ! { dg-error "cannot be redefined" "changing do-iterator 3" }
ENDDO
END
diff --git a/gcc/testsuite/gfortran.dg/pr17708.f90 b/gcc/testsuite/gfortran.dg/pr17708.f90
index 7485da8bb07..b696b0c2757 100644
--- a/gcc/testsuite/gfortran.dg/pr17708.f90
+++ b/gcc/testsuite/gfortran.dg/pr17708.f90
@@ -2,8 +2,8 @@
program test
j = 0
do 10 i=1,3
- if(i == 2) goto 10 ! { dg-warning "" "" }
+ if(i == 2) goto 10 ! { dg-warning "jumps to END" }
j = j+1
-10 enddo
+10 enddo ! { dg-warning "jumps to END" }
if (j/=2) call abort
end
diff --git a/gcc/testsuite/gfortran.dg/select_4.f90 b/gcc/testsuite/gfortran.dg/select_4.f90
index 8fb661f7c22..dbced6e4c66 100644
--- a/gcc/testsuite/gfortran.dg/select_4.f90
+++ b/gcc/testsuite/gfortran.dg/select_4.f90
@@ -4,15 +4,15 @@
program select_5
integer i
select case(i)
- case (20:30)
- case (25:) ! { dg-error "overlaps with CASE" "" }
+ case (20:30) ! { dg-error "overlaps with CASE" }
+ case (25:) ! { dg-error "overlaps with CASE" }
end select
select case(i)
- case (30)
- case (25:) ! { dg-error "overlaps with CASE" "" }
+ case (30) ! { dg-error "overlaps with CASE" }
+ case (25:) ! { dg-error "overlaps with CASE" }
end select
select case(i)
- case (20:30)
- case (25) ! { dg-error "overlaps with CASE" "" }
+ case (20:30) ! { dg-error "overlaps with CASE" }
+ case (25) ! { dg-error "overlaps with CASE" }
end select
end program select_5
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 6e09639b1cf..9f55b02cb93 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -17,6 +17,7 @@
load_lib dg.exp
load_lib file-format.exp
load_lib target-supports.exp
+load_lib target-supports-dg.exp
load_lib scanasm.exp
load_lib scantree.exp
load_lib prune.exp
@@ -298,157 +299,6 @@ proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } {
}
}
-# If this target does not support weak symbols, skip this test.
-
-proc dg-require-weak { args } {
- set weak_available [ check_weak_available ]
- if { $weak_available == -1 } {
- upvar name name
- unresolved "$name"
- }
- if { $weak_available != 1 } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# If this target does not support the "visibility" attribute, skip this
-# test.
-
-proc dg-require-visibility { args } {
- set visibility_available [ check_visibility_available ]
- if { $visibility_available == -1 } {
- upvar name name
- unresolved "$name"
- }
- if { $visibility_available != 1 } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# If this target does not support the "alias" attribute, skip this
-# test.
-
-proc dg-require-alias { args } {
- set alias_available [ check_alias_available ]
- if { $alias_available == -1 } {
- upvar name name
- unresolved "$name"
- }
- if { $alias_available < 2 } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# If this target's linker does not support the --gc-sections flag,
-# skip this test.
-
-proc dg-require-gc-sections { args } {
- if { ![ check_gc_sections_available ] } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# If this target does not support profiling, skip this test.
-
-proc dg-require-profiling { args } {
- if { ![ check_profiling_available ${args} ] } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# If this target does not support DLL attributes skip this test.
-
-proc dg-require-dll { args } {
- global target_triplet
- # As a special case, the mcore-*-elf supports these attributes.
- # All Symbian OS targets also support these attributes.
- if { [string match "mcore-*-elf" $target_triplet]
- || [string match "*-*-symbianelf" $target_triplet]} {
- return
- }
- # PE/COFF targets support dllimport/dllexport.
- if { [gcc_target_object_format] == "pe" } {
- return
- }
-
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
-}
-
-proc dg-require-iconv { args } {
- if { ![ check_iconv_available ${args} ] } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# If this target does not support named sections skip this test.
-
-proc dg-require-named-sections { args } {
- if { ![ check_named_sections_available ] } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# If the target does not match the required effective target, skip this test.
-
-proc dg-require-effective-target { args } {
- set args [lreplace $args 0 0]
- if { ![is-effective-target [lindex $args 0]] } {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-}
-
-# Skip the test (report it as UNSUPPORTED) if the target list and
-# included flags are matched and the excluded flags are not matched.
-#
-# The first argument is the line number of the dg-skip-if directive
-# within the test file. Remaining arguments are as for xfail lists:
-# message { targets } { include } { exclude }
-#
-# This tests against multilib flags plus either the default flags for this
-# group of tests or flags specified with a previous dg-options command.
-
-proc dg-skip-if { args } {
- set args [lreplace $args 0 0]
-
- set selector "target [join [lindex $args 1]]"
- if { [dg-process-target $selector] == "S" } {
- # The target list matched; now check the flags. The DejaGnu proc
- # check_conditional_xfail will look at the options in compiler_flags,
- # so set that up for this test based on flags we know about. Start
- # the list with a dummy tool name so the list will match "*" if
- # there are no flags.
-
- global compiler_flags
- upvar dg-extra-tool-flags extra_tool_flags
-
- set compiler_flags " toolname "
- append compiler_flags $extra_tool_flags
- set dest [target_info name]
- if [board_info $dest exists multilib_flags] {
- append compiler_flags "[board_info $dest multilib_flags] "
- }
-
- # The target list might be an effective-target keyword, so replace
- # the original list with "*-*-*".
- if [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]] {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
-
- # Any value in this variable was left over from an earlier test.
- set compiler_flags ""
- }
-}
-
# Prune any messages matching ARGS[1] (a regexp) from test output.
proc dg-prune-output { args } {
global additional_prunes
@@ -461,23 +311,6 @@ proc dg-prune-output { args } {
lappend additional_prunes [lindex $args 1]
}
-# Like check_conditional_xfail, but callable from a dg test.
-
-proc dg-xfail-if { args } {
- # Don't change anything if we're already skipping the test.
- upvar dg-do-what dg-do-what
- if { [lindex ${dg-do-what} 1] == "N" } {
- return
- }
-
- set args [lreplace $args 0 0]
- set selector "target [join [lindex $args 1]]"
- if { [dg-process-target $selector] == "S" } {
- global compiler_conditional_xfail_data
- set compiler_conditional_xfail_data [lreplace $args 1 1 "*-*-*"]
- }
-}
-
# We need to make sure that additional_* are cleared out after every
# test. It is not enough to clear them out *before* the next test run
# because gcc-target-compile gets run directly from some .exp files
@@ -515,117 +348,4 @@ if { [info procs saved-dg-test] == [list] } {
}
}
-# Intercept the call to the DejaGnu version of dg-process-target to
-# support use of an effective-target keyword in place of a list of
-# target triplets to xfail or skip a test.
-#
-# selector is one of:
-# xfail target-triplet-1 ...
-# xfail effective-target-keyword
-# xfail selector-expression
-# target target-triplet-1 ...
-# target effective-target-keyword
-# target selector-expression
-#
-# For a target list the result is "S" if the target is selected, "N" otherwise.
-# For an xfail list the result is "F" if the target is affected, "P" otherwise.
-#
-# A selector expression appears within curly braces and uses a single logical
-# operator: !, &&, or ||. An operand is another selector expression, an
-# effective-target keyword, or a list of target triplets within quotes or
-# curly braces.
-
-if { [info procs saved-dg-process-target] == [list] } {
- rename dg-process-target saved-dg-process-target
-
- # Evaluate an operand within a selector expression.
- proc selector_opd { op } {
- set selector "target"
- lappend selector $op
- set answer [ expr { [dg-process-target $selector] == "S" } ]
- verbose "selector_opd: `$op' $answer" 2
- return $answer
- }
-
- # Evaluate a target triplet list within a selector expression.
- # Unlike other operands, this needs to be expanded from a list to
- # the same string as "target".
- proc selector_list { op } {
- set selector "target [join $op]"
- set answer [ expr { [dg-process-target $selector] == "S" } ]
- verbose "selector_list: `$op' $answer" 2
- return $answer
- }
-
- # Evaluate a selector expression.
- proc selector_expression { exp } {
- if { [llength $exp] == 2 } {
- if [string match "!" [lindex $exp 0]] {
- set op1 [lindex $exp 1]
- set answer [expr { ! [selector_opd $op1] }]
- } else {
- # Assume it's a list of target triplets.
- set answer [selector_list $exp]
- }
- } elseif { [llength $exp] == 3 } {
- set op1 [lindex $exp 0]
- set opr [lindex $exp 1]
- set op2 [lindex $exp 2]
- if [string match "&&" $opr] {
- set answer [expr { [selector_opd $op1] && [selector_opd $op2] }]
- } elseif [string match "||" $opr] {
- set answer [expr { [selector_opd $op1] || [selector_opd $op2] }]
- } else {
- # Assume it's a list of target triplets.
- set answer [selector_list $exp]
- }
- } else {
- # Assume it's a list of target triplets.
- set answer [selector_list $exp]
- }
-
- verbose "selector_expression: `$exp' $answer" 2
- return $answer
- }
-
- proc dg-process-target { args } {
- verbose "replacement dg-process-target: `$args'" 2
-
- # Extract the 'what' keyword from the argument list.
- set selector [string trim [lindex $args 0]]
- if [regexp "^xfail " $selector] {
- set what "xfail"
- } elseif [regexp "^target " $selector] {
- set what "target"
- } else {
- error "syntax error in target selector \"$selector\""
- }
-
- # Extract the rest of the list, which might be a keyword.
- regsub "^${what}" $selector "" rest
- set rest [string trim $rest]
-
- if [is-effective-target-keyword $rest] {
- # The selector is an effective target keyword.
- if [is-effective-target $rest] {
- return [expr { $what == "xfail" ? "F" : "S" }]
- } else {
- return [expr { $what == "xfail" ? "P" : "N" }]
- }
- }
-
- if [string match "{*}" $rest] {
- if [selector_expression [lindex $rest 0]] {
- return [expr { $what == "xfail" ? "F" : "S" }]
- } else {
- return [expr { $what == "xfail" ? "P" : "N" }]
- }
- }
-
- # The selector is not an effective-target keyword, so process
- # the list of target triplets.
- return [saved-dg-process-target $selector]
- }
-}
-
set additional_prunes ""
diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp
index 2387403030b..247df02bd0c 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,11 +25,47 @@ proc gfortran-dg-test { prog do_what extra_tool_flags } {
set comp_output [lindex $result 0]
set output_file [lindex $result 1]
- # Put the error message on the same line as the line number
- # FIXME: Add a colon after line number
- # Remove the line of source code with the error and
- # the number pointing to error
- regsub -all "\n\n\[^\n\]*\n *\[0-9\]*\n" $comp_output ": " comp_output
+ # gfortran error messages look like this:
+ # In file [name]:[line]
+ #
+ # some code
+ # 1
+ # Error: Some error at (1) and (2)
+ # or
+ # In file [name]:[line]
+ #
+ # some code
+ # 1
+ # In file [name]:[line2]
+ #
+ # some other code
+ # 2
+ # Error: Some error at (1) and (2)
+ # or
+ # In file [name]:[line]
+ #
+ # some code and some more code
+ # 1 2
+ # Error: Some error at (1) and (2)
+ #
+ # We collapse these to look like:
+ # [name]:[line]: Error: Some error at (1) and (2)
+ # or
+ # [name]:[line]: Error: Some error at (1) and (2)
+ # [name]:[line2]: Error: Some error at (1) and (2)
+ # We proceed in two steps: first we deal with the form with two
+ # different locus lines, then with the form with only one locus line.
+ #
+ # Note that these regexps only make sense in the combinations used below.
+ # Note also that is imperative that we first deal with the form with
+ # two loci.
+ set locus_regexp " In file (\[^\n\]*)\n\n\[^\n\]*\n\[^\n\]*\n"
+ set diag_regexp "(\[^\n\]*)\n"
+
+ set two_loci "$locus_regexp$locus_regexp$diag_regexp"
+ set single_locus "$locus_regexp$diag_regexp"
+ regsub -all $two_loci $comp_output "\\1: \\3\n\\2: \\3\n" comp_output
+ regsub -all $single_locus $comp_output "\\1: \\2\n" comp_output
return [list $comp_output $output_file]
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 4a91b943d6d..f2577c18106 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -386,6 +386,92 @@ proc check_vmx_hw_available { } {
return $vmx_hw_available_saved
}
+# GCC 3.4.0 for powerpc64-*-linux* included an ABI fix for passing
+# complex float arguments. This affects gfortran tests that call cabsf
+# in libm built by an earlier compiler. Return 1 if libm uses the same
+# argument passing as the compiler under test, 0 otherwise.
+#
+# When the target name changes, replace the cached result.
+
+proc check_effective_target_broken_cplxf_arg { } {
+ global et_broken_cplxf_arg_saved
+ global et_broken_cplxf_arg_target_name
+ global tool
+
+ # Skip the work for targets known not to be affected.
+ if { ![istarget powerpc64-*-linux*] } {
+ return 0
+ } elseif { [is-effective-target ilp32] } {
+ return 0
+ }
+
+ if { ![info exists et_broken_cplxf_arg_target_name] } {
+ set et_broken_cplxf_arg_target_name ""
+ }
+
+ # If the target has changed since we set the cached value, clear it.
+ set current_target [current_target_name]
+ if { $current_target != $et_broken_cplxf_arg_target_name } {
+ verbose "check_effective_target_broken_cplxf_arg: `$et_broken_cplxf_arg_target_name'" 2
+ set et_broken_cplxf_arg_target_name $current_target
+ if [info exists et_broken_cplxf_arg_saved] {
+ verbose "check_effective_target_broken_cplxf_arg: removing cached result" 2
+ unset et_broken_cplxf_arg_saved
+ }
+ }
+
+ if [info exists et_broken_cplxf_arg_saved] {
+ verbose "check_effective_target_broken_cplxf_arg: using cached result" 2
+ } else {
+ set et_broken_cplxf_arg_saved 0
+ # This is only known to affect one target.
+ if { ![istarget powerpc64-*-linux*] || ![is-effective-target lp64] } {
+ set et_broken_cplxf_arg_saved 0
+ verbose "check_effective_target_broken_cplxf_arg: caching 0" 2
+ return $et_broken_cplxf_arg_saved
+ }
+
+ # Set up, compile, and execute a C test program that calls cabsf.
+ set src cabsf[pid].c
+ set exe cabsf[pid].x
+
+ set f [open $src "w"]
+ puts $f "#include <complex.h>"
+ puts $f "extern void abort (void);"
+ puts $f "float fabsf (float);"
+ puts $f "float cabsf (_Complex float);"
+ puts $f "int main ()"
+ puts $f "{"
+ puts $f " _Complex float cf;"
+ puts $f " float f;"
+ puts $f " cf = 3 + 4.0fi;"
+ puts $f " f = cabsf (cf);"
+ puts $f " if (fabsf (f - 5.0) > 0.0001) abort ();"
+ puts $f " return 0;"
+ puts $f "}"
+ close $f
+
+ set lines [${tool}_target_compile $src $exe executable "-lm"]
+ file delete $src
+
+ if [string match "" $lines] {
+ # No error message, compilation succeeded.
+ set result [${tool}_load "./$exe" "" ""]
+ set status [lindex $result 0]
+ remote_file build delete $exe
+
+ verbose "check_effective_target_broken_cplxf_arg: status is <$status>" 2
+
+ if { $status != "pass" } {
+ set et_broken_cplxf_arg_saved 1
+ }
+ } else {
+ verbose "check_effective_target_broken_cplxf_arg: compilation failed" 2
+ }
+ }
+ return $et_broken_cplxf_arg_saved
+}
+
proc check_alpha_max_hw_available { } {
global alpha_max_hw_available_saved
global tool
diff --git a/gcc/testsuite/treelang/ChangeLog b/gcc/testsuite/treelang/ChangeLog
index c60765b837c..4f7fd02b5e9 100644
--- a/gcc/testsuite/treelang/ChangeLog
+++ b/gcc/testsuite/treelang/ChangeLog
@@ -1,3 +1,28 @@
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * compile/var_defs: Add uninitialized variables.
+
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * compile/extrafunc.tree, compile/extravar.tree: New tests.
+
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * compile/unsigned.tree: New test.
+
+2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+
+ PR other/19896
+ * execute/execute.exp: New file.
+ * execute/funccall.tree, execute/funccall-2.tree, execute/initial.tree,
+ execute/main.tree, execute/static.tree: New tests.
+
+2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+
+ PR other/19897
+ * compile/exit.tree, compile/extref.tree, compile/function-1.tree,
+ compile/syntax-1.tree: New tests.
+
2004-10-02 James A. Morrison <phython@gcc.gnu.org>
* compile/autofunc.tree: New File.
diff --git a/gcc/testsuite/treelang/compile/var_defs.tree b/gcc/testsuite/treelang/compile/var_defs.tree
index aaab0d9099e..49f9cd0385b 100644
--- a/gcc/testsuite/treelang/compile/var_defs.tree
+++ b/gcc/testsuite/treelang/compile/var_defs.tree
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-options "-Wuninitialized -O" }
external_definition void boring (int arg0);
external_definition char condition (char arg1, char arg2);
external_definition int first_nonzero (int arg5, int arg6);
@@ -14,11 +15,12 @@ condition
if (arg1)
{
automatic int i;
- return arg1;
+ return i + 1; // { dg-warning "uninitialized" }
}
else
{
- return 0;
+ automatic int j;
+ return j; // { dg-warning "uninitialized" }
}
}
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 2659997a941..e7947eba2eb 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -267,9 +267,9 @@ int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
/* 0 means straightforward implementation of complex divide acceptable.
1 means wide ranges of inputs must work for complex divide.
- 2 means C99-like requirements for complex divide (not yet implemented). */
+ 2 means C99-like requirements for complex multiply and divide. */
-int flag_complex_divide_method = 0;
+int flag_complex_method = 1;
/* Nonzero means that we don't want inlining by virtue of -fno-inline,
not just because the tree inliner turned us off. */
@@ -1948,14 +1948,16 @@ process_options (void)
/* The presence of IEEE signaling NaNs, implies all math can trap. */
if (flag_signaling_nans)
flag_trapping_math = 1;
+
+ /* With -fcx-limited-range, we do cheap and quick complex arithmetic. */
+ if (flag_cx_limited_range)
+ flag_complex_method = 0;
}
/* Initialize the compiler back end. */
static void
backend_init (void)
{
- init_adjust_machine_modes ();
-
init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
|| debug_info_level == DINFO_LEVEL_VERBOSE
#ifdef VMS_DEBUGGING_INFO
@@ -2092,6 +2094,11 @@ do_compile (void)
/* Don't do any more if an error has already occurred. */
if (!errorcount)
{
+ /* This must be run always, because it is needed to compute the FP
+ predefined macros, such as __LDBL_MAX__, for targets using non
+ default FP formats. */
+ init_adjust_machine_modes ();
+
/* Set up the back-end if requested. */
if (!no_backend)
backend_init ();
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index cade864f191..9e87dbfccb0 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -440,6 +440,29 @@ create_bb (void *h, void *e, basic_block after)
Edge creation
---------------------------------------------------------------------------*/
+/* Fold COND_EXPR_COND of each COND_EXPR. */
+
+static void
+fold_cond_expr_cond (void)
+{
+ basic_block bb;
+
+ FOR_EACH_BB (bb)
+ {
+ tree stmt = last_stmt (bb);
+
+ if (stmt
+ && TREE_CODE (stmt) == COND_EXPR)
+ {
+ tree cond = fold (COND_EXPR_COND (stmt));
+ if (integer_zerop (cond))
+ COND_EXPR_COND (stmt) = integer_zero_node;
+ else if (integer_onep (cond))
+ COND_EXPR_COND (stmt) = integer_one_node;
+ }
+ }
+}
+
/* Join all the blocks in the flowgraph. */
static void
@@ -478,6 +501,9 @@ make_edges (void)
builder inserted for completeness. */
remove_fake_exit_edges ();
+ /* Fold COND_EXPR_COND of each COND_EXPR. */
+ fold_cond_expr_cond ();
+
/* Clean up the graph and warn for unreachable code. */
cleanup_tree_cfg ();
}
@@ -2198,14 +2224,7 @@ find_taken_edge (basic_block bb, tree val)
gcc_assert (is_ctrl_stmt (stmt));
gcc_assert (val);
- /* If VAL is a predicate of the form N RELOP N, where N is an
- SSA_NAME, we can usually determine its truth value. */
- if (COMPARISON_CLASS_P (val))
- val = fold (val);
-
- /* If VAL is not a constant, we can't determine which edge might
- be taken. */
- if (!really_constant_p (val))
+ if (TREE_CODE (val) != INTEGER_CST)
return NULL;
if (TREE_CODE (stmt) == COND_EXPR)
@@ -2237,12 +2256,12 @@ find_taken_edge_cond_expr (basic_block bb, tree val)
return true_edge;
else if (integer_zerop (val))
return false_edge;
- else
- return NULL;
+
+ gcc_unreachable ();
}
-/* Given a constant value VAL and the entry block BB to a SWITCH_EXPR
+/* Given an INTEGER_CST VAL and the entry block BB to a SWITCH_EXPR
statement, determine which edge will be taken out of the block. Return
NULL if any edge may be taken. */
@@ -2253,9 +2272,6 @@ find_taken_edge_switch_expr (basic_block bb, tree val)
basic_block dest_bb;
edge e;
- if (TREE_CODE (val) != INTEGER_CST)
- return NULL;
-
switch_expr = last_stmt (bb);
taken_case = find_case_label_for_value (switch_expr, val);
dest_bb = label_to_block (CASE_LABEL (taken_case));
@@ -5079,7 +5095,7 @@ tree_duplicate_sese_region (edge entry, edge exit,
free (region_copy);
unmark_all_for_rewrite ();
- BITMAP_XFREE (definitions);
+ BITMAP_FREE (definitions);
return true;
}
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 3373326aad9..a5708f39a8e 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -105,6 +105,40 @@ expand_complex_addition (block_stmt_iterator *bsi, tree inner_type,
update_complex_assignment (bsi, rr, ri);
}
+/* Expand a complex multiplication or division to a libcall to the c99
+ compliant routines. */
+
+static void
+expand_complex_libcall (block_stmt_iterator *bsi, tree ar, tree ai,
+ tree br, tree bi, enum tree_code code)
+{
+ enum machine_mode mode;
+ enum built_in_function bcode;
+ tree args, fn, stmt, type;
+
+ args = tree_cons (NULL, bi, NULL);
+ args = tree_cons (NULL, br, args);
+ args = tree_cons (NULL, ai, args);
+ args = tree_cons (NULL, ar, args);
+
+ stmt = bsi_stmt (*bsi);
+ type = TREE_TYPE (TREE_OPERAND (stmt, 1));
+
+ mode = TYPE_MODE (type);
+ gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
+ if (code == MULT_EXPR)
+ bcode = BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ else if (code == RDIV_EXPR)
+ bcode = BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ else
+ gcc_unreachable ();
+ fn = built_in_decls[bcode];
+
+ TREE_OPERAND (stmt, 1)
+ = build3 (CALL_EXPR, type, build_fold_addr_expr (fn), args, NULL);
+ modify_stmt (stmt);
+}
+
/* Expand complex multiplication to scalars:
a * b = (ar*br - ai*bi) + i(ar*bi + br*ai)
*/
@@ -115,6 +149,12 @@ expand_complex_multiplication (block_stmt_iterator *bsi, tree inner_type,
{
tree t1, t2, t3, t4, rr, ri;
+ if (flag_complex_method == 2 && SCALAR_FLOAT_TYPE_P (inner_type))
+ {
+ expand_complex_libcall (bsi, ar, ai, br, bi, MULT_EXPR);
+ return;
+ }
+
t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, br);
t2 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, bi);
t3 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, bi);
@@ -311,18 +351,27 @@ expand_complex_division (block_stmt_iterator *bsi, tree inner_type,
tree ar, tree ai, tree br, tree bi,
enum tree_code code)
{
- switch (flag_complex_divide_method)
+ switch (flag_complex_method)
{
case 0:
/* straightforward implementation of complex divide acceptable. */
expand_complex_div_straight (bsi, inner_type, ar, ai, br, bi, code);
break;
+
+ case 2:
+ if (SCALAR_FLOAT_TYPE_P (inner_type))
+ {
+ expand_complex_libcall (bsi, ar, ai, br, bi, code);
+ return;
+ }
+ /* FALLTHRU */
+
case 1:
/* wide ranges of inputs must work for complex divide. */
expand_complex_div_wide (bsi, inner_type, ar, ai, br, bi, code);
break;
+
default:
- /* C99-like requirements for complex divide (not yet implemented). */
gcc_unreachable ();
}
}
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index c6ca75310f8..7987f66390f 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -109,10 +109,14 @@ array_base_name_differ_p (struct data_reference *a,
{
tree base_a = DR_BASE_NAME (a);
tree base_b = DR_BASE_NAME (b);
- tree ta = TREE_TYPE (base_a);
- tree tb = TREE_TYPE (base_b);
+ tree ta, tb;
+ if (!base_a || !base_b)
+ return false;
+ ta = TREE_TYPE (base_a);
+ tb = TREE_TYPE (base_b);
+
/* Determine if same base. Example: for the array accesses
a[i], b[i] or pointer accesses *a, *b, bases are a, b. */
if (base_a == base_b)
@@ -179,24 +183,6 @@ array_base_name_differ_p (struct data_reference *a,
return true;
}
- if (!alias_sets_conflict_p (get_alias_set (base_a), get_alias_set (base_b)))
- {
- *differ_p = true;
- return true;
- }
-
- /* An instruction writing through a restricted pointer is
- "independent" of any instruction reading or writing through a
- different pointer, in the same block/scope. */
- if ((TREE_CODE (ta) == POINTER_TYPE && TYPE_RESTRICT (ta)
- && !DR_IS_READ(a))
- || (TREE_CODE (tb) == POINTER_TYPE && TYPE_RESTRICT (tb)
- && !DR_IS_READ(b)))
- {
- *differ_p = true;
- return true;
- }
-
return false;
}
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index d7ccd69d7cf..b591ffb5e7e 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -1,5 +1,5 @@
/* Data flow functions for trees.
- Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
@@ -901,8 +901,7 @@ add_referenced_var (tree var, struct walk_state *walk_state)
/* Scan DECL_INITIAL for pointer variables as they may contain
address arithmetic referencing the address of other
variables. */
- if (DECL_INITIAL (var)
- && POINTER_TYPE_P (TREE_TYPE (var)))
+ if (DECL_INITIAL (var))
walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0);
}
}
@@ -957,7 +956,7 @@ mark_new_vars_to_rename (tree stmt, bitmap vars_to_rename)
int v_may_defs_before, v_may_defs_after;
int v_must_defs_before, v_must_defs_after;
- vars_in_vops_to_rename = BITMAP_XMALLOC ();
+ vars_in_vops_to_rename = BITMAP_ALLOC (NULL);
/* Before re-scanning the statement for operands, mark the existing
virtual operands to be renamed again. We do this because when new
@@ -1006,7 +1005,7 @@ mark_new_vars_to_rename (tree stmt, bitmap vars_to_rename)
|| v_must_defs_before > v_must_defs_after)
bitmap_ior_into (vars_to_rename, vars_in_vops_to_rename);
- BITMAP_XFREE (vars_in_vops_to_rename);
+ BITMAP_FREE (vars_in_vops_to_rename);
}
/* Find all variables within the gimplified statement that were not previously
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index d9cf404eb3b..87a283146e4 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -1,5 +1,6 @@
/* Tree-dumping functionality for intermediate representation.
- Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GCC.
@@ -667,56 +668,56 @@ dump_node (tree t, int flags, FILE *stream)
TREE_DUMP_INDEX enumeration in tree.h */
static struct dump_file_info dump_files[TDI_end] =
{
- {NULL, NULL, 0, 0, 0, 0},
- {".tu", "translation-unit", TDF_TREE, 0, 0, 0},
- {".class", "class-hierarchy", TDF_TREE, 0, 1, 0},
- {".original", "tree-original", TDF_TREE, 0, 2, 0},
- {".generic", "tree-generic", TDF_TREE, 0, 3, 0},
- {".nested", "tree-nested", TDF_TREE, 0, 4, 0},
- {".inlined", "tree-inlined", TDF_TREE, 0, 5, 0},
- {".vcg", "tree-vcg", TDF_TREE, 0, 6, 0},
- {NULL, "tree-all", TDF_TREE, 0, 0, 0},
- {NULL, "rtl-all", TDF_RTL, 0, 0, 0},
- {NULL, "ipa-all", TDF_IPA, 0, 0, 0},
-
- { ".cgraph", "ipa-cgraph", TDF_IPA, 0, 1, 0},
-
- { ".sibling", "rtl-sibling", TDF_RTL, 0, 1, 'i'},
- { ".eh", "rtl-eh", TDF_RTL, 0, 2, 'h'},
- { ".jump", "rtl-jump", TDF_RTL, 0, 3, 'j'},
- { ".cse", "rtl-cse", TDF_RTL, 0, 4, 's'},
- { ".gcse", "rtl-gcse", TDF_RTL, 0, 5, 'G'},
- { ".loop", "rtl-loop", TDF_RTL, 0, 6, 'L'},
- { ".bypass", "rtl-bypass", TDF_RTL, 0, 7, 'G'},
- { ".cfg", "rtl-cfg", TDF_RTL, 0, 8, 'f'},
- { ".bp", "rtl-bp", TDF_RTL, 0, 9, 'b'},
- { ".vpt", "rtl-vpt", TDF_RTL, 0, 10, 'V'},
- { ".ce1", "rtl-ce1", TDF_RTL, 0, 11, 'C'},
- { ".tracer", "rtl-tracer", TDF_RTL, 0, 12, 'T'},
- { ".loop2", "rtl-loop2", TDF_RTL, 0, 13, 'L'},
- { ".web", "rtl-web", TDF_RTL, 0, 14, 'Z'},
- { ".cse2", "rtl-cse2", TDF_RTL, 0, 15, 't'},
- { ".life", "rtl-life", TDF_RTL, 0, 16, 'f'},
- { ".combine", "rtl-combine", TDF_RTL, 0, 17, 'c'},
- { ".ce2", "rtl-ce2", TDF_RTL, 0, 18, 'C'},
- { ".regmove", "rtl-regmove", TDF_RTL, 0, 19, 'N'},
- { ".sms", "rtl-sms", TDF_RTL, 0, 20, 'm'},
- { ".sched", "rtl-sched", TDF_RTL, 0, 21, 'S'},
- { ".lreg", "rtl-lreg", TDF_RTL, 0, 22, 'l'},
- { ".greg", "rtl-greg", TDF_RTL, 0, 23, 'g'},
- { ".postreload", "rtl-postreload", TDF_RTL, 0, 24, 'o'},
- { ".gcse2", "rtl-gcse2", TDF_RTL, 0, 25, 'J'},
- { ".flow2", "rtl-flow2", TDF_RTL, 0, 26, 'w'},
- { ".peephole2", "rtl-peephole2", TDF_RTL, 0, 27, 'z'},
- { ".ce3", "rtl-ce3", TDF_RTL, 0, 28, 'E'},
- { ".rnreg", "rtl-rnreg", TDF_RTL, 0, 29, 'n'},
- { ".bbro", "rtl-bbro", TDF_RTL, 0, 30, 'B'},
- { ".btl", "rtl-btl", TDF_RTL, 0, 31, 'd'},
- { ".sched2", "rtl-sched2", TDF_RTL, 0, 32, 'R'},
- { ".stack", "rtl-stack", TDF_RTL, 0, 33, 'k'},
- { ".vartrack", "rtl-vartrack", TDF_RTL, 0, 34, 'V'},
- { ".mach", "rtl-mach", TDF_RTL, 0, 35, 'M'},
- { ".dbr", "rtl-dbr", TDF_RTL, 0, 36, 'd'}
+ {NULL, NULL, NULL, 0, 0, 0, 0},
+ {".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0},
+ {".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0},
+ {".original", "tree-original", NULL, TDF_TREE, 0, 2, 0},
+ {".generic", "tree-generic", NULL, TDF_TREE, 0, 3, 0},
+ {".nested", "tree-nested", NULL, TDF_TREE, 0, 4, 0},
+ {".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0},
+ {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0},
+ {NULL, "tree-all", NULL, TDF_TREE, 0, 0, 0},
+ {NULL, "rtl-all", NULL, TDF_RTL, 0, 0, 0},
+ {NULL, "ipa-all", NULL, TDF_IPA, 0, 0, 0},
+
+ { ".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0, 1, 0},
+
+ { ".sibling", "rtl-sibling", NULL, TDF_RTL, 0, 1, 'i'},
+ { ".eh", "rtl-eh", NULL, TDF_RTL, 0, 2, 'h'},
+ { ".jump", "rtl-jump", NULL, TDF_RTL, 0, 3, 'j'},
+ { ".cse", "rtl-cse", NULL, TDF_RTL, 0, 4, 's'},
+ { ".gcse", "rtl-gcse", NULL, TDF_RTL, 0, 5, 'G'},
+ { ".loop", "rtl-loop", NULL, TDF_RTL, 0, 6, 'L'},
+ { ".bypass", "rtl-bypass", NULL, TDF_RTL, 0, 7, 'G'},
+ { ".cfg", "rtl-cfg", NULL, TDF_RTL, 0, 8, 'f'},
+ { ".bp", "rtl-bp", NULL, TDF_RTL, 0, 9, 'b'},
+ { ".vpt", "rtl-vpt", NULL, TDF_RTL, 0, 10, 'V'},
+ { ".ce1", "rtl-ce1", NULL, TDF_RTL, 0, 11, 'C'},
+ { ".tracer", "rtl-tracer", NULL, TDF_RTL, 0, 12, 'T'},
+ { ".loop2", "rtl-loop2", NULL, TDF_RTL, 0, 13, 'L'},
+ { ".web", "rtl-web", NULL, TDF_RTL, 0, 14, 'Z'},
+ { ".cse2", "rtl-cse2", NULL, TDF_RTL, 0, 15, 't'},
+ { ".life", "rtl-life", NULL, TDF_RTL, 0, 16, 'f'},
+ { ".combine", "rtl-combine", NULL, TDF_RTL, 0, 17, 'c'},
+ { ".ce2", "rtl-ce2", NULL, TDF_RTL, 0, 18, 'C'},
+ { ".regmove", "rtl-regmove", NULL, TDF_RTL, 0, 19, 'N'},
+ { ".sms", "rtl-sms", NULL, TDF_RTL, 0, 20, 'm'},
+ { ".sched", "rtl-sched", NULL, TDF_RTL, 0, 21, 'S'},
+ { ".lreg", "rtl-lreg", NULL, TDF_RTL, 0, 22, 'l'},
+ { ".greg", "rtl-greg", NULL, TDF_RTL, 0, 23, 'g'},
+ { ".postreload", "rtl-postreload", NULL, TDF_RTL, 0, 24, 'o'},
+ { ".gcse2", "rtl-gcse2", NULL, TDF_RTL, 0, 25, 'J'},
+ { ".flow2", "rtl-flow2", NULL, TDF_RTL, 0, 26, 'w'},
+ { ".peephole2", "rtl-peephole2", NULL, TDF_RTL, 0, 27, 'z'},
+ { ".ce3", "rtl-ce3", NULL, TDF_RTL, 0, 28, 'E'},
+ { ".rnreg", "rtl-rnreg", NULL, TDF_RTL, 0, 29, 'n'},
+ { ".bbro", "rtl-bbro", NULL, TDF_RTL, 0, 30, 'B'},
+ { ".btl", "rtl-btl", NULL, TDF_RTL, 0, 31, 'd'},
+ { ".sched2", "rtl-sched2", NULL, TDF_RTL, 0, 32, 'R'},
+ { ".stack", "rtl-stack", NULL, TDF_RTL, 0, 33, 'k'},
+ { ".vartrack", "rtl-vartrack", NULL, TDF_RTL, 0, 34, 'V'},
+ { ".mach", "rtl-mach", NULL, TDF_RTL, 0, 35, 'M'},
+ { ".dbr", "rtl-dbr", NULL, TDF_RTL, 0, 36, 'd'}
};
/* Dynamically registered tree dump files and switches. */
@@ -749,8 +750,8 @@ static const struct dump_option_value_info dump_options[] =
};
unsigned int
-dump_register (const char *suffix, const char *swtch, int flags,
- unsigned int num, int letter)
+dump_register (const char *suffix, const char *swtch, const char *glob,
+ int flags, unsigned int num, int letter)
{
size_t this = extra_dump_files_in_use++;
@@ -768,6 +769,7 @@ dump_register (const char *suffix, const char *swtch, int flags,
memset (&extra_dump_files[this], 0, sizeof (struct dump_file_info));
extra_dump_files[this].suffix = suffix;
extra_dump_files[this].swtch = swtch;
+ extra_dump_files[this].glob = glob;
extra_dump_files[this].flags = flags;
extra_dump_files[this].num = num;
extra_dump_files[this].letter = letter;
@@ -924,13 +926,16 @@ dump_enable_all (int flags, int letter)
relevant details in the dump_files array. */
static int
-dump_switch_p_1 (const char *arg, struct dump_file_info *dfi)
+dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob)
{
const char *option_value;
const char *ptr;
int flags;
+
+ if (doglob && !dfi->glob)
+ return 0;
- option_value = skip_leading_substring (arg, dfi->swtch);
+ option_value = skip_leading_substring (arg, doglob ? dfi->glob : dfi->swtch);
if (!option_value)
return 0;
@@ -981,10 +986,20 @@ dump_switch_p (const char *arg)
int any = 0;
for (i = TDI_none + 1; i != TDI_end; i++)
- any |= dump_switch_p_1 (arg, &dump_files[i]);
+ any |= dump_switch_p_1 (arg, &dump_files[i], false);
+
+ /* Don't glob if we got a hit already */
+ if (!any)
+ for (i = TDI_none + 1; i != TDI_end; i++)
+ any |= dump_switch_p_1 (arg, &dump_files[i], true);
for (i = 0; i < extra_dump_files_in_use; i++)
- any |= dump_switch_p_1 (arg, &extra_dump_files[i]);
+ any |= dump_switch_p_1 (arg, &extra_dump_files[i], false);
+
+ if (!any)
+ for (i = 0; i < extra_dump_files_in_use; i++)
+ any |= dump_switch_p_1 (arg, &extra_dump_files[i], true);
+
return any;
}
diff --git a/gcc/tree-dump.h b/gcc/tree-dump.h
index 3f5c8aea63f..ffe3de11c14 100644
--- a/gcc/tree-dump.h
+++ b/gcc/tree-dump.h
@@ -1,5 +1,5 @@
/* Tree-dumping functionality for intermediate representation.
- Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GCC.
@@ -88,6 +88,7 @@ extern void queue_and_dump_type (dump_info_p, tree);
extern void dump_function (enum tree_dump_index, tree);
extern void dump_function_to_file (tree, FILE *, int);
-extern unsigned int dump_register (const char *, const char *, int, unsigned int, int);
+extern unsigned int dump_register (const char *, const char *, const char *,
+ int, unsigned int, int);
#endif /* ! GCC_TREE_DUMP_H */
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 20660e4e279..f19c851fb74 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -755,7 +755,7 @@ lower_try_finally_fallthru_label (struct leh_tf_state *tf)
alternative considered below. For the nonce, we always choose the first
option.
- THIS_STATE may be null if if this is a try-cleanup, not a try-finally. */
+ THIS_STATE may be null if this is a try-cleanup, not a try-finally. */
static void
honor_protect_cleanup_actions (struct leh_state *outer_state,
@@ -1840,6 +1840,13 @@ tree_could_trap_p (tree expr)
return true;
return false;
+ case CALL_EXPR:
+ t = get_callee_fndecl (expr);
+ /* Assume that calls to weak functions may trap. */
+ if (!t || !DECL_P (t) || DECL_WEAK (t))
+ return true;
+ return false;
+
default:
/* Any floating arithmetic may trap. */
if (fp_operation && flag_trapping_math)
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 3937b2ce10c..a7e91e9d95f 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -691,6 +691,7 @@ void number_of_iterations_cond (tree, tree, tree, enum tree_code, tree, tree,
struct tree_niter_desc *);
bool number_of_iterations_exit (struct loop *, edge,
struct tree_niter_desc *niter);
+tree find_loop_niter (struct loop *, edge *);
tree loop_niter_by_eval (struct loop *, edge);
tree find_loop_niter_by_eval (struct loop *, edge *);
void estimate_numbers_of_iterations (struct loops *);
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index fbcbe1ca5d7..52bcfba69fb 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -830,7 +830,7 @@ process_phi_nodes (struct loop *loop)
continue;
phi = phi_nodes (bb);
- bsi = bsi_start (bb);
+ bsi = bsi_after_labels (bb);
/* BB has two predecessors. Using predecessor's aux field, set
appropriate condition for the PHI node replacement. */
@@ -1017,7 +1017,7 @@ get_loop_body_in_if_conv_order (const struct loop *loop)
gcc_assert (loop->latch != EXIT_BLOCK_PTR);
blocks = xcalloc (loop->num_nodes, sizeof (basic_block));
- visited = BITMAP_XMALLOC ();
+ visited = BITMAP_ALLOC (NULL);
blocks_in_bfs_order = get_loop_body_in_bfs_order (loop);
@@ -1029,7 +1029,7 @@ get_loop_body_in_if_conv_order (const struct loop *loop)
if (bb->flags & BB_IRREDUCIBLE_LOOP)
{
free (blocks_in_bfs_order);
- BITMAP_XFREE (visited);
+ BITMAP_FREE (visited);
free (blocks);
return NULL;
}
@@ -1052,7 +1052,7 @@ get_loop_body_in_if_conv_order (const struct loop *loop)
}
}
free (blocks_in_bfs_order);
- BITMAP_XFREE (visited);
+ BITMAP_FREE (visited);
return blocks;
}
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index c6124e24a16..271c1ff8938 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -54,7 +54,6 @@ Boston, MA 02111-1307, USA. */
Graph. ACM Transactions on Programming Languages and Systems,
13(4):451-490, October 1991. */
-
/* Structure to map a variable VAR to the set of blocks that contain
definitions for VAR. */
struct def_blocks_d
@@ -66,7 +65,7 @@ struct def_blocks_d
Ith block contains a definition of VAR. */
bitmap def_blocks;
- /* Blocks that contain a phi node for VAR. */
+ /* Blocks that contain a PHI node for VAR. */
bitmap phi_blocks;
/* Blocks where VAR is live-on-entry. Similar semantics as
@@ -74,6 +73,7 @@ struct def_blocks_d
bitmap livein_blocks;
};
+
/* Each entry in DEF_BLOCKS contains an element of type STRUCT
DEF_BLOCKS_D, mapping a variable VAR to a bitmap describing all the
basic blocks where VAR is defined (assigned a new value). It also
@@ -87,19 +87,18 @@ static htab_t def_blocks;
state after completing rewriting of a block and its dominator children.
This vector is used in two contexts. The first is rewriting of _DECL
- nodes into SSA_NAMEs. In that context it's elements have the
+ nodes into SSA_NAMEs. In that context its elements have the
following properties:
An SSA_NAME indicates that the current definition of the underlying
variable should be set to the given SSA_NAME.
-
+
A _DECL node indicates that the underlying variable has no current
definition.
-
+
A NULL node is used to mark the last node associated with the
current block.
-
This vector is also used when rewriting an SSA_NAME which has multiple
definition sites into multiple SSA_NAMEs. In that context entries come
in pairs.
@@ -127,8 +126,8 @@ struct mark_def_sites_global_data
sbitmap names_to_rename;
};
-/* Information stored for ssa names. */
+/* Information stored for ssa names. */
struct ssa_name_info
{
/* This field indicates whether or not the variable may need PHI nodes.
@@ -140,31 +139,6 @@ struct ssa_name_info
tree current_def;
};
-/* Local functions. */
-static void rewrite_finalize_block (struct dom_walk_data *, basic_block);
-static void rewrite_initialize_block (struct dom_walk_data *, basic_block);
-static void rewrite_add_phi_arguments (struct dom_walk_data *, basic_block);
-static void mark_def_sites (struct dom_walk_data *walk_data,
- basic_block bb, block_stmt_iterator);
-static void mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
- basic_block bb);
-static void set_def_block (tree, basic_block, bool, bool);
-static void set_livein_block (tree, basic_block);
-static bool prepare_use_operand_for_rename (use_operand_p, size_t *uid_p);
-static bool prepare_def_operand_for_rename (tree def, size_t *uid_p);
-static void insert_phi_nodes (bitmap *, bitmap);
-static void rewrite_stmt (struct dom_walk_data *, basic_block,
- block_stmt_iterator);
-static inline void rewrite_operand (use_operand_p);
-static void insert_phi_nodes_for (tree, bitmap *, VEC(basic_block) **);
-static tree get_reaching_def (tree);
-static hashval_t def_blocks_hash (const void *);
-static int def_blocks_eq (const void *, const void *);
-static void def_blocks_free (void *);
-static int debug_def_blocks_r (void **, void *);
-static inline struct def_blocks_d *get_def_blocks_for (tree);
-static inline struct def_blocks_d *find_def_blocks_for (tree);
-static void htab_statistics (FILE *, htab_t);
/* Use TREE_VISITED to keep track of which statements we want to
rename. When renaming a subset of the variables, not all
@@ -183,6 +157,7 @@ get_ssa_name_ann (tree name)
return SSA_NAME_AUX (name);
}
+
/* Gets phi_state field for VAR. */
static inline enum need_phi_state
@@ -194,6 +169,7 @@ get_phi_state (tree var)
return var_ann (var)->need_phi_state;
}
+
/* Sets phi_state field for VAR to STATE. */
static inline void
@@ -205,6 +181,7 @@ set_phi_state (tree var, enum need_phi_state state)
var_ann (var)->need_phi_state = state;
}
+
/* Return the current definition for VAR. */
static inline tree
@@ -216,6 +193,7 @@ get_current_def (tree var)
return var_ann (var)->current_def;
}
+
/* Sets current definition of VAR to DEF. */
static inline void
@@ -227,6 +205,7 @@ set_current_def (tree var, tree def)
var_ann (var)->current_def = def;
}
+
/* Compute global livein information given the set of blockx where
an object is locally live at the start of the block (LIVEIN)
and the set of blocks where the object is defined (DEF_BLOCKS).
@@ -280,78 +259,154 @@ compute_global_livein (bitmap livein, bitmap def_blocks)
}
-/* Block initialization routine for mark_def_sites. Clear the
- KILLS bitmap at the start of each block. */
+/* Return the set of blocks where variable VAR is defined and the blocks
+ where VAR is live on entry (livein). If no entry is found in
+ DEF_BLOCKS, a new one is created and returned. */
-static void
-mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
- basic_block bb ATTRIBUTE_UNUSED)
+static inline struct def_blocks_d *
+get_def_blocks_for (tree var)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
- bitmap kills = gd->kills;
+ struct def_blocks_d db, *db_p;
+ void **slot;
- bitmap_clear (kills);
+ db.var = var;
+ slot = htab_find_slot (def_blocks, (void *) &db, INSERT);
+ if (*slot == NULL)
+ {
+ db_p = xmalloc (sizeof (*db_p));
+ db_p->var = var;
+ db_p->def_blocks = BITMAP_ALLOC (NULL);
+ db_p->phi_blocks = BITMAP_ALLOC (NULL);
+ db_p->livein_blocks = BITMAP_ALLOC (NULL);
+ *slot = (void *) db_p;
+ }
+ else
+ db_p = (struct def_blocks_d *) *slot;
+
+ return db_p;
}
-/* Block initialization routine for mark_def_sites. Clear the
- KILLS bitmap at the start of each block. */
+
+/* Mark block BB as the definition site for variable VAR. PHI_P is true if
+ VAR is defined by a PHI node. IS_UPDATE is true if the caller is
+ updating an existing SSA form. */
static void
-ssa_mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
- basic_block bb)
+set_def_block (tree var, basic_block bb, bool phi_p, bool is_update)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
- bitmap kills = gd->kills;
- tree phi, def;
- unsigned def_uid;
+ struct def_blocks_d *db_p;
+ enum need_phi_state state;
- bitmap_clear (kills);
+ if (!is_update && TREE_CODE (var) == SSA_NAME)
+ var = SSA_NAME_VAR (var);
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- def = PHI_RESULT (phi);
- def_uid = SSA_NAME_VERSION (def);
+ state = get_phi_state (var);
+ db_p = get_def_blocks_for (var);
- if (!TEST_BIT (gd->names_to_rename, def_uid))
- continue;
+ /* Set the bit corresponding to the block where VAR is defined. */
+ bitmap_set_bit (db_p->def_blocks, bb->index);
+ if (phi_p)
+ bitmap_set_bit (db_p->phi_blocks, bb->index);
- set_def_block (def, bb, true, true);
- bitmap_set_bit (kills, def_uid);
- }
+ /* Keep track of whether or not we may need to insert PHI nodes.
+
+ If we are in the UNKNOWN state, then this is the first definition
+ of VAR. Additionally, we have not seen any uses of VAR yet, so
+ we do not need a PHI node for this variable at this time (i.e.,
+ transition to NEED_PHI_STATE_NO).
+
+ If we are in any other state, then we either have multiple definitions
+ of this variable occurring in different blocks or we saw a use of the
+ variable which was not dominated by the block containing the
+ definition(s). In this case we may need a PHI node, so enter
+ state NEED_PHI_STATE_MAYBE. */
+ if (state == NEED_PHI_STATE_UNKNOWN)
+ set_phi_state (var, NEED_PHI_STATE_NO);
+ else
+ set_phi_state (var, NEED_PHI_STATE_MAYBE);
}
-/* Marks ssa names used as arguments of phis at the end of BB. */
+
+/* Mark block BB as having VAR live at the entry to BB. */
static void
-ssa_mark_phi_uses (struct dom_walk_data *walk_data, basic_block bb)
+set_livein_block (tree var, basic_block bb)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
- bitmap kills = gd->kills;
- edge e;
- tree phi, use;
- unsigned uid;
- edge_iterator ei;
+ struct def_blocks_d *db_p;
+ enum need_phi_state state = get_phi_state (var);
- FOR_EACH_EDGE (e, ei, bb->succs)
- {
- if (e->dest == EXIT_BLOCK_PTR)
- continue;
+ db_p = get_def_blocks_for (var);
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
- {
- use = PHI_ARG_DEF_FROM_EDGE (phi, e);
- if (TREE_CODE (use) != SSA_NAME)
- continue;
+ /* Set the bit corresponding to the block where VAR is live in. */
+ bitmap_set_bit (db_p->livein_blocks, bb->index);
- uid = SSA_NAME_VERSION (use);
+ /* Keep track of whether or not we may need to insert PHI nodes.
- if (TEST_BIT (gd->names_to_rename, uid)
- && !bitmap_bit_p (kills, uid))
- set_livein_block (use, bb);
- }
+ If we reach here in NEED_PHI_STATE_NO, see if this use is dominated
+ by the single block containing the definition(s) of this variable. If
+ it is, then we remain in NEED_PHI_STATE_NO, otherwise we transition to
+ NEED_PHI_STATE_MAYBE. */
+ if (state == NEED_PHI_STATE_NO)
+ {
+ int def_block_index = bitmap_first_set_bit (db_p->def_blocks);
+
+ if (def_block_index == -1
+ || ! dominated_by_p (CDI_DOMINATORS, bb,
+ BASIC_BLOCK (def_block_index)))
+ set_phi_state (var, NEED_PHI_STATE_MAYBE);
}
+ else
+ set_phi_state (var, NEED_PHI_STATE_MAYBE);
+}
+
+
+/* If the use operand pointed to by OP_P needs to be renamed, then strip away
+ any SSA_NAME wrapping the operand, set *UID_P to the underlying variable's
+ uid, and return true. Otherwise return false. If the operand was an
+ SSA_NAME, change it to the stripped name. */
+
+static bool
+prepare_use_operand_for_rename (use_operand_p op_p, size_t *uid_p)
+{
+ tree use = USE_FROM_PTR (op_p);
+ tree var = (TREE_CODE (use) != SSA_NAME) ? use : SSA_NAME_VAR (use);
+ *uid_p = var_ann (var)->uid;
+
+ /* Ignore variables that don't need to be renamed. */
+ if (vars_to_rename && !bitmap_bit_p (vars_to_rename, *uid_p))
+ return false;
+
+ /* The variable needs to be renamed. If this is a use which already
+ has an SSA_NAME, then strip it off.
+
+ By not throwing away SSA_NAMEs on assignments, we avoid a lot of
+ useless churn of SSA_NAMEs without having to overly complicate the
+ renamer. */
+ if (TREE_CODE (use) == SSA_NAME)
+ SET_USE (op_p, var);
+
+ return true;
}
+
+/* If the def variable DEF needs to be renamed, then strip away any SSA_NAME
+ wrapping the operand, set *UID_P to the underlying variable's uid and return
+ true. Otherwise return false. */
+
+static bool
+prepare_def_operand_for_rename (tree def, size_t *uid_p)
+{
+ tree var = (TREE_CODE (def) != SSA_NAME) ? def : SSA_NAME_VAR (def);
+ *uid_p = var_ann (var)->uid;
+
+ /* Ignore variables that don't need to be renamed. */
+ if (vars_to_rename && !bitmap_bit_p (vars_to_rename, *uid_p))
+ return false;
+
+ return true;
+}
+
+
/* Call back for walk_dominator_tree used to collect definition sites
for every variable in the function. For every statement S in block
BB:
@@ -434,179 +489,133 @@ mark_def_sites (struct dom_walk_data *walk_data,
}
-/* Same as mark_def_sites, but works over SSA names. */
+/* Given a set of blocks with variable definitions (DEF_BLOCKS),
+ return a bitmap with all the blocks in the iterated dominance
+ frontier of the blocks in DEF_BLOCKS. DFS contains dominance
+ frontier information as returned by compute_dominance_frontiers.
+
+ The resulting set of blocks are the potential sites where PHI nodes
+ are needed. The caller is responsible from freeing the memory
+ allocated for the return value. */
-static void
-ssa_mark_def_sites (struct dom_walk_data *walk_data,
- basic_block bb,
- block_stmt_iterator bsi)
+static bitmap
+find_idf (bitmap def_blocks, bitmap *dfs)
{
- struct mark_def_sites_global_data *gd = walk_data->global_data;
- bitmap kills = gd->kills;
- size_t uid, def_uid;
- tree stmt, use, def;
- ssa_op_iter iter;
+ bitmap_iterator bi;
+ unsigned bb_index;
+ VEC(basic_block) *work_stack;
+ bitmap phi_insertion_points;
- /* Mark all the blocks that have definitions for each variable in the
- names_to_rename bitmap. */
- stmt = bsi_stmt (bsi);
- get_stmt_operands (stmt);
+ work_stack = VEC_alloc (basic_block, n_basic_blocks);
+ phi_insertion_points = BITMAP_ALLOC (NULL);
- /* If a variable is used before being set, then the variable is live
- across a block boundary, so mark it live-on-entry to BB. */
- FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
- {
- uid = SSA_NAME_VERSION (use);
+ /* Seed the work list with all the blocks in DEF_BLOCKS. */
+ EXECUTE_IF_SET_IN_BITMAP (def_blocks, 0, bb_index, bi)
+ VEC_safe_push (basic_block, work_stack, BASIC_BLOCK (bb_index));
- if (TEST_BIT (gd->names_to_rename, uid)
- && !bitmap_bit_p (kills, uid))
- set_livein_block (use, bb);
- }
-
- /* Now process the definition made by this statement. Mark the
- variables in KILLS. */
- FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
+ /* Pop a block off the worklist, add every block that appears in
+ the original block's DF that we have not already processed to
+ the worklist. Iterate until the worklist is empty. Blocks
+ which are added to the worklist are potential sites for
+ PHI nodes. */
+ while (VEC_length (basic_block, work_stack) > 0)
{
- def_uid = SSA_NAME_VERSION (def);
-
- if (TEST_BIT (gd->names_to_rename, def_uid))
+ basic_block bb = VEC_pop (basic_block, work_stack);
+ bb_index = bb->index;
+
+ EXECUTE_IF_AND_COMPL_IN_BITMAP (dfs[bb_index], phi_insertion_points,
+ 0, bb_index, bi)
{
- set_def_block (def, bb, false, true);
- bitmap_set_bit (kills, def_uid);
+ bb = BASIC_BLOCK (bb_index);
+
+ /* Use a safe push because if there is a definition of VAR
+ in every basic block, then WORK_STACK may eventually have
+ more than N_BASIC_BLOCK entries. */
+ VEC_safe_push (basic_block, work_stack, bb);
+ bitmap_set_bit (phi_insertion_points, bb_index);
}
}
-}
-
-/* Mark block BB as the definition site for variable VAR. PHI_P is true if
- VAR is defined by a phi node. SSA_P is true if we are called from
- rewrite_ssa_into_ssa. */
-
-static void
-set_def_block (tree var, basic_block bb, bool phi_p, bool ssa_p)
-{
- struct def_blocks_d *db_p;
- enum need_phi_state state;
-
- if (!ssa_p
- && TREE_CODE (var) == SSA_NAME)
- var = SSA_NAME_VAR (var);
- state = get_phi_state (var);
- db_p = get_def_blocks_for (var);
+ VEC_free (basic_block, work_stack);
- /* Set the bit corresponding to the block where VAR is defined. */
- bitmap_set_bit (db_p->def_blocks, bb->index);
- if (phi_p)
- bitmap_set_bit (db_p->phi_blocks, bb->index);
+ return phi_insertion_points;
+}
- /* Keep track of whether or not we may need to insert phi nodes.
- If we are in the UNKNOWN state, then this is the first definition
- of VAR. Additionally, we have not seen any uses of VAR yet, so
- we do not need a phi node for this variable at this time (i.e.,
- transition to NEED_PHI_STATE_NO).
+/* Return the set of blocks where variable VAR is defined and the blocks
+ where VAR is live on entry (livein). Return NULL, if no entry is
+ found in DEF_BLOCKS. */
- If we are in any other state, then we either have multiple definitions
- of this variable occurring in different blocks or we saw a use of the
- variable which was not dominated by the block containing the
- definition(s). In this case we may need a PHI node, so enter
- state NEED_PHI_STATE_MAYBE. */
- if (state == NEED_PHI_STATE_UNKNOWN)
- set_phi_state (var, NEED_PHI_STATE_NO);
- else
- set_phi_state (var, NEED_PHI_STATE_MAYBE);
+static inline struct def_blocks_d *
+find_def_blocks_for (tree var)
+{
+ struct def_blocks_d dm;
+ dm.var = var;
+ return (struct def_blocks_d *) htab_find (def_blocks, &dm);
}
-/* Mark block BB as having VAR live at the entry to BB. */
+/* Insert PHI nodes for variable VAR using the iterated dominance
+ frontier given in PHI_INSERTION_POINTS. */
static void
-set_livein_block (tree var, basic_block bb)
+insert_phi_nodes_for (tree var, bitmap phi_insertion_points)
{
- struct def_blocks_d *db_p;
- enum need_phi_state state = get_phi_state (var);
+ unsigned bb_index;
+ edge e;
+ tree phi;
+ basic_block bb;
+ bitmap_iterator bi;
+ struct def_blocks_d *def_map;
- db_p = get_def_blocks_for (var);
+ def_map = find_def_blocks_for (var);
- /* Set the bit corresponding to the block where VAR is live in. */
- bitmap_set_bit (db_p->livein_blocks, bb->index);
+ /* Remove the blocks where we already have PHI nodes for VAR. */
+ bitmap_and_compl_into (phi_insertion_points, def_map->phi_blocks);
- /* Keep track of whether or not we may need to insert phi nodes.
+ /* Now compute global livein for this variable. Note this modifies
+ def_map->livein_blocks. */
+ compute_global_livein (def_map->livein_blocks, def_map->def_blocks);
- If we reach here in NEED_PHI_STATE_NO, see if this use is dominated
- by the single block containing the definition(s) of this variable. If
- it is, then we remain in NEED_PHI_STATE_NO, otherwise we transition to
- NEED_PHI_STATE_MAYBE. */
- if (state == NEED_PHI_STATE_NO)
+ /* And insert the PHI nodes. */
+ EXECUTE_IF_AND_IN_BITMAP (phi_insertion_points, def_map->livein_blocks,
+ 0, bb_index, bi)
{
- int def_block_index = bitmap_first_set_bit (db_p->def_blocks);
+ bb = BASIC_BLOCK (bb_index);
+ phi = create_phi_node (var, bb);
- if (def_block_index == -1
- || ! dominated_by_p (CDI_DOMINATORS, bb,
- BASIC_BLOCK (def_block_index)))
- set_phi_state (var, NEED_PHI_STATE_MAYBE);
+ /* If we are rewriting SSA names, add also the PHI arguments. */
+ if (TREE_CODE (var) == SSA_NAME)
+ {
+ edge_iterator ei;
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ add_phi_arg (phi, var, e);
+ }
}
- else
- set_phi_state (var, NEED_PHI_STATE_MAYBE);
}
-/* If the use operand pointed to by OP_P needs to be renamed, then strip away
- any SSA_NAME wrapping the operand, set *UID_P to the underlying variable's
- uid, and return true. Otherwise return false. If the operand was an
- SSA_NAME, change it to the stripped name. */
+/* Helper for insert_phi_nodes. If VAR needs PHI nodes, insert them
+ at the dominance frontier (DFS) of blocks defining VAR. */
-static bool
-prepare_use_operand_for_rename (use_operand_p op_p, size_t *uid_p)
+static inline void
+insert_phi_nodes_1 (tree var, bitmap *dfs)
{
- tree use = USE_FROM_PTR (op_p);
- tree var = (TREE_CODE (use) != SSA_NAME) ? use : SSA_NAME_VAR (use);
- *uid_p = var_ann (var)->uid;
-
- /* Ignore variables that don't need to be renamed. */
- if (vars_to_rename && !bitmap_bit_p (vars_to_rename, *uid_p))
- return false;
-
- /* The variable needs to be renamed. If this is a use which already
- has an SSA_NAME, then strip it off.
-
- By not throwing away SSA_NAMEs on assignments, we avoid a lot of
- useless churn of SSA_NAMEs without having to overly complicate the
- renamer. */
- if (TREE_CODE (use) == SSA_NAME)
- SET_USE (op_p, var);
-
- return true;
-}
+ struct def_blocks_d *def_map;
+ bitmap idf;
-/* If the def variable DEF needs to be renamed, then strip away any SSA_NAME
- wrapping the operand, set *UID_P to the underlying variable's uid and return
- true. Otherwise return false. */
+ def_map = find_def_blocks_for (var);
+ if (def_map == NULL)
+ return;
-static bool
-prepare_def_operand_for_rename (tree def, size_t *uid_p)
-{
- tree var = (TREE_CODE (def) != SSA_NAME) ? def : SSA_NAME_VAR (def);
- *uid_p = var_ann (var)->uid;
+ idf = find_idf (def_map->def_blocks, dfs);
- /* Ignore variables that don't need to be renamed. */
- if (vars_to_rename && !bitmap_bit_p (vars_to_rename, *uid_p))
- return false;
+ if (get_phi_state (var) != NEED_PHI_STATE_NO)
+ insert_phi_nodes_for (var, idf);
- return true;
+ BITMAP_FREE (idf);
}
-/* Helper for insert_phi_nodes. If VAR needs PHI nodes, insert them
- at the dominance frontier (DFS) of blocks defining VAR.
- WORK_STACK is the vector used to implement the worklist of basic
- blocks. */
-
-static inline void
-insert_phi_nodes_1 (tree var, bitmap *dfs, VEC(basic_block) **work_stack)
-{
- if (get_phi_state (var) != NEED_PHI_STATE_NO)
- insert_phi_nodes_for (var, dfs, work_stack);
-}
/* Insert PHI nodes at the dominance frontier of blocks with variable
definitions. DFS contains the dominance frontier information for
@@ -620,15 +629,10 @@ static void
insert_phi_nodes (bitmap *dfs, bitmap names_to_rename)
{
unsigned i;
- VEC(basic_block) *work_stack;
bitmap_iterator bi;
timevar_push (TV_TREE_INSERT_PHI_NODES);
- /* Vector WORK_STACK is a stack of CFG blocks. Each block that contains
- an assignment or PHI node will be pushed to this stack. */
- work_stack = VEC_alloc (basic_block, n_basic_blocks);
-
/* Iterate over all variables in VARS_TO_RENAME. For each variable, add
to the work list all the blocks that have a definition for the
variable. PHI nodes will be added to the dominance frontier blocks of
@@ -636,26 +640,62 @@ insert_phi_nodes (bitmap *dfs, bitmap names_to_rename)
if (names_to_rename)
{
EXECUTE_IF_SET_IN_BITMAP (names_to_rename, 0, i, bi)
- {
- if (ssa_name (i))
- insert_phi_nodes_1 (ssa_name (i), dfs, &work_stack);
- }
+ if (ssa_name (i))
+ insert_phi_nodes_1 (ssa_name (i), dfs);
}
else if (vars_to_rename)
- EXECUTE_IF_SET_IN_BITMAP (vars_to_rename, 0, i, bi)
- {
- insert_phi_nodes_1 (referenced_var (i), dfs, &work_stack);
- }
+ {
+ EXECUTE_IF_SET_IN_BITMAP (vars_to_rename, 0, i, bi)
+ insert_phi_nodes_1 (referenced_var (i), dfs);
+ }
else
- for (i = 0; i < num_referenced_vars; i++)
- insert_phi_nodes_1 (referenced_var (i), dfs, &work_stack);
-
- VEC_free (basic_block, work_stack);
+ {
+ for (i = 0; i < num_referenced_vars; i++)
+ insert_phi_nodes_1 (referenced_var (i), dfs);
+ }
timevar_pop (TV_TREE_INSERT_PHI_NODES);
}
+/* Register DEF (an SSA_NAME) to be a new definition for its underlying
+ variable (SSA_NAME_VAR (DEF)) and push VAR's current reaching definition
+ into the stack pointed by BLOCK_DEFS_P. */
+
+void
+register_new_def (tree def, VEC (tree_on_heap) **block_defs_p)
+{
+ tree var = SSA_NAME_VAR (def);
+ tree currdef;
+
+ /* If this variable is set in a single basic block and all uses are
+ dominated by the set(s) in that single basic block, then there is
+ no reason to record anything for this variable in the block local
+ definition stacks. Doing so just wastes time and memory.
+
+ This is the same test to prune the set of variables which may
+ need PHI nodes. So we just use that information since it's already
+ computed and available for us to use. */
+ if (get_phi_state (var) == NEED_PHI_STATE_NO)
+ {
+ set_current_def (var, def);
+ return;
+ }
+
+ currdef = get_current_def (var);
+
+ /* Push the current reaching definition into *BLOCK_DEFS_P. This stack is
+ later used by the dominator tree callbacks to restore the reaching
+ definitions for all the variables defined in the block after a recursive
+ visit to all its immediately dominated blocks. If there is no current
+ reaching definition, then just record the underlying _DECL node. */
+ VEC_safe_push (tree_on_heap, *block_defs_p, currdef ? currdef : var);
+
+ /* Set the current reaching definition for VAR to be DEF. */
+ set_current_def (var, def);
+}
+
+
/* Perform a depth-first traversal of the dominator tree looking for
variables to rename. BB is the block where to start searching.
Renaming is a five step process:
@@ -702,84 +742,123 @@ rewrite_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree result = PHI_RESULT (phi);
-
register_new_def (result, &block_defs_stack);
}
}
-/* Register DEF (an SSA_NAME) to be a new definition for the original
- ssa name VAR and push VAR's current reaching definition
- into the stack pointed by BLOCK_DEFS_P. */
-static void
-ssa_register_new_def (tree var, tree def)
+/* Return the current definition for variable VAR. If none is found,
+ create a new SSA name to act as the zeroth definition for VAR. If VAR
+ is call clobbered and there exists a more recent definition of
+ GLOBAL_VAR, return the definition for GLOBAL_VAR. This means that VAR
+ has been clobbered by a function call since its last assignment. */
+
+static tree
+get_reaching_def (tree var)
{
- tree currdef;
-
- /* If this variable is set in a single basic block and all uses are
- dominated by the set(s) in that single basic block, then there is
- nothing to do. TODO we should not be called at all, and just
- keep the original name. */
- if (get_phi_state (var) == NEED_PHI_STATE_NO)
+ tree default_d, currdef_var, avar;
+
+ /* Lookup the current reaching definition for VAR. */
+ default_d = NULL_TREE;
+ currdef_var = get_current_def (var);
+
+ /* If there is no reaching definition for VAR, create and register a
+ default definition for it (if needed). */
+ if (currdef_var == NULL_TREE)
{
- set_current_def (var, def);
- return;
+ if (TREE_CODE (var) == SSA_NAME)
+ avar = SSA_NAME_VAR (var);
+ else
+ avar = var;
+
+ default_d = default_def (avar);
+ if (default_d == NULL_TREE)
+ {
+ default_d = make_ssa_name (avar, build_empty_stmt ());
+ set_default_def (avar, default_d);
+ }
+ set_current_def (var, default_d);
}
- currdef = get_current_def (var);
+ /* Return the current reaching definition for VAR, or the default
+ definition, if we had to create one. */
+ return (currdef_var) ? currdef_var : default_d;
+}
- /* Push the current reaching definition into *BLOCK_DEFS_P. This stack is
- later used by the dominator tree callbacks to restore the reaching
- definitions for all the variables defined in the block after a recursive
- visit to all its immediately dominated blocks. */
- VEC_safe_push (tree_on_heap, block_defs_stack, currdef);
- VEC_safe_push (tree_on_heap, block_defs_stack, var);
- /* Set the current reaching definition for VAR to be DEF. */
- set_current_def (var, def);
+/* Replace the operand pointed by OP_P with its immediate reaching
+ definition. */
+
+static inline void
+rewrite_operand (use_operand_p op_p)
+{
+ tree var = USE_FROM_PTR (op_p);
+ if (TREE_CODE (var) != SSA_NAME)
+ SET_USE (op_p, get_reaching_def (var));
+ else
+ {
+#if defined ENABLE_CHECKING
+ /* If we get to this point, VAR is an SSA_NAME. If VAR's symbol
+ was marked for renaming, make sure that its reaching
+ definition is VAR itself. Otherwise, something has gone
+ wrong. */
+ tree sym = SSA_NAME_VAR (var);
+ if (bitmap_bit_p (vars_to_rename, var_ann (sym)->uid))
+ gcc_assert (var == get_reaching_def (SSA_NAME_VAR (var)));
+#endif
+ }
}
-/* Ditto, for rewriting ssa names. */
+
+/* SSA Rewriting Step 2. Rewrite every variable used in each statement in
+ the block with its immediate reaching definitions. Update the current
+ definition of a variable when a new real or virtual definition is found. */
static void
-ssa_rewrite_initialize_block (struct dom_walk_data *walk_data, basic_block bb)
+rewrite_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
+ basic_block bb ATTRIBUTE_UNUSED,
+ block_stmt_iterator si)
{
- tree phi, new_name;
- sbitmap names_to_rename = walk_data->global_data;
- edge e;
- bool abnormal_phi;
- edge_iterator ei;
+ stmt_ann_t ann;
+ tree stmt;
+ use_operand_p use_p;
+ def_operand_p def_p;
+ ssa_op_iter iter;
+
+ stmt = bsi_stmt (si);
+ ann = stmt_ann (stmt);
+
+ /* If mark_def_sites decided that we don't need to rewrite this
+ statement, ignore it. */
+ if (!REWRITE_THIS_STMT (stmt))
+ return;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\n\nRenaming block #%d\n\n", bb->index);
+ {
+ fprintf (dump_file, "Renaming statement ");
+ print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
- /* Mark the unwind point for this block. */
- VEC_safe_push (tree_on_heap, block_defs_stack, NULL_TREE);
+ get_stmt_operands (stmt);
- FOR_EACH_EDGE (e, ei, bb->preds)
- if (e->flags & EDGE_ABNORMAL)
- break;
- abnormal_phi = (e != NULL);
+ /* Step 1. Rewrite USES and VUSES in the statement. */
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
+ rewrite_operand (use_p);
- /* Step 1. Register new definitions for every PHI node in the block.
- Conceptually, all the PHI nodes are executed in parallel and each PHI
- node introduces a new version for the associated variable. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ /* Step 2. Register the statement's DEF and VDEF operands. */
+ FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
{
- tree result = PHI_RESULT (phi);
-
- if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (result)))
- {
- new_name = duplicate_ssa_name (result, phi);
- SET_PHI_RESULT (phi, new_name);
+ if (TREE_CODE (DEF_FROM_PTR (def_p)) != SSA_NAME)
+ SET_DEF (def_p, make_ssa_name (DEF_FROM_PTR (def_p), stmt));
- if (abnormal_phi)
- SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_name) = 1;
- ssa_register_new_def (result, new_name);
- }
+ /* FIXME: We shouldn't be registering new defs if the variable
+ doesn't need to be renamed. */
+ register_new_def (DEF_FROM_PTR (def_p), &block_defs_stack);
}
}
+
/* SSA Rewriting Step 3. Visit all the successor blocks of BB looking for
PHI nodes. For every PHI node found, add a new argument containing the
current reaching definition for the variable and the edge through which
@@ -812,9 +891,10 @@ rewrite_add_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
}
}
+
/* Rewrite existing virtual PHI arguments so that they have the correct
reaching definitions. BB is the basic block whose successors contain the
- phi nodes we want to add arguments for. */
+ PHI nodes we want to add arguments for. */
static void
rewrite_virtual_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
@@ -848,42 +928,10 @@ rewrite_virtual_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
}
}
-/* Ditto, for ssa name rewriting. */
-
-static void
-ssa_rewrite_phi_arguments (struct dom_walk_data *walk_data, basic_block bb)
-{
- edge e;
- sbitmap names_to_rename = walk_data->global_data;
- use_operand_p op;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, bb->succs)
- {
- tree phi;
- if (e->dest == EXIT_BLOCK_PTR)
- continue;
+/* Called after visiting basic block BB. Restore CURRDEFS to its
+ original value. */
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
- {
- op = PHI_ARG_DEF_PTR_FROM_EDGE (phi, e);
- if (TREE_CODE (USE_FROM_PTR (op)) != SSA_NAME)
- continue;
-
- if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (op))))
- continue;
-
- SET_USE (op, get_reaching_def (USE_FROM_PTR (op)));
- if (e->flags & EDGE_ABNORMAL)
- SSA_NAME_OCCURS_IN_ABNORMAL_PHI (USE_FROM_PTR (op)) = 1;
- }
- }
-}
-
-
-/* Similar to restore_vars_to_original_value, except that it restores
- CURRDEFS to its original value. */
static void
rewrite_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb ATTRIBUTE_UNUSED)
@@ -916,28 +964,6 @@ rewrite_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
}
}
-/* Ditto, for rewriting ssa names. */
-
-static void
-ssa_rewrite_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
- basic_block bb ATTRIBUTE_UNUSED)
-{
-
- /* Step 5. Restore the current reaching definition for each variable
- referenced in the block (in reverse order). */
- while (VEC_length (tree_on_heap, block_defs_stack) > 0)
- {
- tree var = VEC_pop (tree_on_heap, block_defs_stack);
- tree saved_def;
-
- if (var == NULL)
- break;
-
- saved_def = VEC_pop (tree_on_heap, block_defs_stack);
-
- set_current_def (var, saved_def);
- }
-}
/* Dump SSA information to FILE. */
@@ -969,29 +995,6 @@ debug_tree_ssa (void)
}
-/* Dump SSA statistics on FILE. */
-
-void
-dump_tree_ssa_stats (FILE *file)
-{
- fprintf (file, "\nHash table statistics:\n");
-
- fprintf (file, " def_blocks: ");
- htab_statistics (file, def_blocks);
-
- fprintf (file, "\n");
-}
-
-
-/* Dump SSA statistics on stderr. */
-
-void
-debug_tree_ssa_stats (void)
-{
- dump_tree_ssa_stats (stderr);
-}
-
-
/* Dump statistics for the hash table HTAB. */
static void
@@ -1004,288 +1007,26 @@ htab_statistics (FILE *file, htab_t htab)
}
-/* Insert PHI nodes for variable VAR using the dominance frontier
- information given in DFS. WORK_STACK is the vector used to
- implement the worklist of basic blocks. */
-
-static void
-insert_phi_nodes_for (tree var, bitmap *dfs, VEC(basic_block) **work_stack)
-{
- struct def_blocks_d *def_map;
- bitmap phi_insertion_points;
- unsigned bb_index;
- edge e;
- tree phi;
- basic_block bb;
- bitmap_iterator bi;
-
- def_map = find_def_blocks_for (var);
- if (def_map == NULL)
- return;
-
- phi_insertion_points = BITMAP_XMALLOC ();
-
- EXECUTE_IF_SET_IN_BITMAP (def_map->def_blocks, 0, bb_index, bi)
- {
- VEC_safe_push (basic_block, *work_stack, BASIC_BLOCK (bb_index));
- }
-
- /* Pop a block off the worklist, add every block that appears in
- the original block's dfs that we have not already processed to
- the worklist. Iterate until the worklist is empty. Blocks
- which are added to the worklist are potential sites for
- PHI nodes.
-
- The iteration step could be done during PHI insertion just as
- easily. We do it here for historical reasons -- we used to have
- a heuristic which used the potential PHI insertion points to
- determine if fully pruned or semi pruned SSA form was appropriate.
-
- We now always use fully pruned SSA form. */
- while (VEC_length (basic_block, *work_stack) > 0)
- {
- unsigned dfs_index;
- bitmap_iterator bi;
-
- bb = VEC_pop (basic_block, *work_stack);
- bb_index = bb->index;
-
- EXECUTE_IF_AND_COMPL_IN_BITMAP (dfs[bb_index],
- phi_insertion_points,
- 0, dfs_index, bi)
- {
- basic_block bb = BASIC_BLOCK (dfs_index);
-
- /* Use a safe push because if there is a definition of VAR
- in every basic block, then WORK_STACK may eventually have
- more than N_BASIC_BLOCK entries. */
- VEC_safe_push (basic_block, *work_stack, bb);
- bitmap_set_bit (phi_insertion_points, dfs_index);
- }
- }
-
- /* Remove the blocks where we already have the phis. */
- bitmap_and_compl_into (phi_insertion_points, def_map->phi_blocks);
-
- /* Now compute global livein for this variable. Note this modifies
- def_map->livein_blocks. */
- compute_global_livein (def_map->livein_blocks, def_map->def_blocks);
-
- /* And insert the PHI nodes. */
- EXECUTE_IF_AND_IN_BITMAP (phi_insertion_points, def_map->livein_blocks,
- 0, bb_index, bi)
- {
- bb = BASIC_BLOCK (bb_index);
-
- phi = create_phi_node (var, bb);
-
- /* If we are rewriting ssa names, add also the phi arguments. */
- if (TREE_CODE (var) == SSA_NAME)
- {
- edge_iterator ei;
- FOR_EACH_EDGE (e, ei, bb->preds)
- add_phi_arg (phi, var, e);
- }
- }
-
- BITMAP_XFREE (phi_insertion_points);
-}
-
-/* SSA Rewriting Step 2. Rewrite every variable used in each statement in
- the block with its immediate reaching definitions. Update the current
- definition of a variable when a new real or virtual definition is found. */
-
-static void
-rewrite_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
- basic_block bb ATTRIBUTE_UNUSED,
- block_stmt_iterator si)
-{
- stmt_ann_t ann;
- tree stmt;
- use_operand_p use_p;
- def_operand_p def_p;
- ssa_op_iter iter;
-
- stmt = bsi_stmt (si);
- ann = stmt_ann (stmt);
-
- /* If mark_def_sites decided that we don't need to rewrite this
- statement, ignore it. */
- if (!REWRITE_THIS_STMT (stmt))
- return;
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "Renaming statement ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
-
- /* We have just scanned the code for operands. No statement should
- be modified. */
- gcc_assert (!ann->modified);
-
- /* Step 1. Rewrite USES and VUSES in the statement. */
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
- rewrite_operand (use_p);
-
- /* Step 2. Register the statement's DEF and VDEF operands. */
- FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
- {
- if (TREE_CODE (DEF_FROM_PTR (def_p)) != SSA_NAME)
- SET_DEF (def_p, make_ssa_name (DEF_FROM_PTR (def_p), stmt));
-
- /* FIXME: We shouldn't be registering new defs if the variable
- doesn't need to be renamed. */
- register_new_def (DEF_FROM_PTR (def_p), &block_defs_stack);
- }
-}
-
-
-/* Same as rewrite_stmt, for rewriting ssa names. */
+/* Dump SSA statistics on FILE. */
-static void
-ssa_rewrite_stmt (struct dom_walk_data *walk_data,
- basic_block bb ATTRIBUTE_UNUSED,
- block_stmt_iterator si)
+void
+dump_tree_ssa_stats (FILE *file)
{
- stmt_ann_t ann;
- tree stmt, var;
- ssa_op_iter iter;
- use_operand_p use_p;
- def_operand_p def_p;
- sbitmap names_to_rename = walk_data->global_data;
-
- stmt = bsi_stmt (si);
- ann = stmt_ann (stmt);
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "Renaming statement ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
-
- /* We have just scanned the code for operands. No statement should
- be modified. */
- gcc_assert (!ann->modified);
-
- /* Step 1. Rewrite USES and VUSES in the statement. */
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
- {
- if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (use_p))))
- SET_USE (use_p, get_reaching_def (USE_FROM_PTR (use_p)));
- }
-
- /* Step 2. Register the statement's DEF and VDEF operands. */
- FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
- {
- var = DEF_FROM_PTR (def_p);
+ fprintf (file, "\nHash table statistics:\n");
- if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (var)))
- continue;
+ fprintf (file, " def_blocks: ");
+ htab_statistics (file, def_blocks);
- SET_DEF (def_p, duplicate_ssa_name (var, stmt));
- ssa_register_new_def (var, DEF_FROM_PTR (def_p));
- }
+ fprintf (file, "\n");
}
-/* Replace the operand pointed by OP_P with its immediate reaching
- definition. */
-static inline void
-rewrite_operand (use_operand_p op_p)
-{
- tree var = USE_FROM_PTR (op_p);
- if (TREE_CODE (var) != SSA_NAME)
- SET_USE (op_p, get_reaching_def (var));
- else
- {
-#if defined ENABLE_CHECKING
- /* If we get to this point, VAR is an SSA_NAME. If VAR's symbol
- was marked for renaming, make sure that its reaching
- definition is VAR itself. Otherwise, something has gone
- wrong. */
- tree sym = SSA_NAME_VAR (var);
- if (bitmap_bit_p (vars_to_rename, var_ann (sym)->uid))
- gcc_assert (var == get_reaching_def (SSA_NAME_VAR (var)));
-#endif
- }
-}
-
-/* Register DEF (an SSA_NAME) to be a new definition for its underlying
- variable (SSA_NAME_VAR (DEF)) and push VAR's current reaching definition
- into the stack pointed by BLOCK_DEFS_P. */
+/* Dump SSA statistics on stderr. */
void
-register_new_def (tree def, VEC (tree_on_heap) **block_defs_p)
-{
- tree var = SSA_NAME_VAR (def);
- tree currdef;
-
- /* If this variable is set in a single basic block and all uses are
- dominated by the set(s) in that single basic block, then there is
- no reason to record anything for this variable in the block local
- definition stacks. Doing so just wastes time and memory.
-
- This is the same test to prune the set of variables which may
- need PHI nodes. So we just use that information since it's already
- computed and available for us to use. */
- if (get_phi_state (var) == NEED_PHI_STATE_NO)
- {
- set_current_def (var, def);
- return;
- }
-
- currdef = get_current_def (var);
-
- /* Push the current reaching definition into *BLOCK_DEFS_P. This stack is
- later used by the dominator tree callbacks to restore the reaching
- definitions for all the variables defined in the block after a recursive
- visit to all its immediately dominated blocks. If there is no current
- reaching definition, then just record the underlying _DECL node. */
- VEC_safe_push (tree_on_heap, *block_defs_p, currdef ? currdef : var);
-
- /* Set the current reaching definition for VAR to be DEF. */
- set_current_def (var, def);
-}
-
-/* Return the current definition for variable VAR. If none is found,
- create a new SSA name to act as the zeroth definition for VAR. If VAR
- is call clobbered and there exists a more recent definition of
- GLOBAL_VAR, return the definition for GLOBAL_VAR. This means that VAR
- has been clobbered by a function call since its last assignment. */
-
-static tree
-get_reaching_def (tree var)
+debug_tree_ssa_stats (void)
{
- tree default_d, currdef_var, avar;
-
- /* Lookup the current reaching definition for VAR. */
- default_d = NULL_TREE;
- currdef_var = get_current_def (var);
-
- /* If there is no reaching definition for VAR, create and register a
- default definition for it (if needed). */
- if (currdef_var == NULL_TREE)
- {
- if (TREE_CODE (var) == SSA_NAME)
- avar = SSA_NAME_VAR (var);
- else
- avar = var;
-
- default_d = default_def (avar);
- if (default_d == NULL_TREE)
- {
- default_d = make_ssa_name (avar, build_empty_stmt ());
- set_default_def (avar, default_d);
- }
- set_current_def (var, default_d);
- }
-
- /* Return the current reaching definition for VAR, or the default
- definition, if we had to create one. */
- return (currdef_var) ? currdef_var : default_d;
+ dump_tree_ssa_stats (stderr);
}
@@ -1305,27 +1046,20 @@ def_blocks_eq (const void *p1, const void *p2)
== ((const struct def_blocks_d *)p2)->var;
}
+
/* Free memory allocated by one entry in DEF_BLOCKS. */
static void
def_blocks_free (void *p)
{
struct def_blocks_d *entry = p;
- BITMAP_XFREE (entry->def_blocks);
- BITMAP_XFREE (entry->phi_blocks);
- BITMAP_XFREE (entry->livein_blocks);
+ BITMAP_FREE (entry->def_blocks);
+ BITMAP_FREE (entry->phi_blocks);
+ BITMAP_FREE (entry->livein_blocks);
free (entry);
}
-/* Dump the DEF_BLOCKS hash table on stderr. */
-
-void
-debug_def_blocks (void)
-{
- htab_traverse (def_blocks, debug_def_blocks_r, NULL);
-}
-
/* Callback for htab_traverse to dump the DEF_BLOCKS hash table. */
static int
@@ -1342,46 +1076,15 @@ debug_def_blocks_r (void **slot, void *data ATTRIBUTE_UNUSED)
}
-/* Return the set of blocks where variable VAR is defined and the blocks
- where VAR is live on entry (livein). Return NULL, if no entry is
- found in DEF_BLOCKS. */
+/* Dump the DEF_BLOCKS hash table on stderr. */
-static inline struct def_blocks_d *
-find_def_blocks_for (tree var)
+void
+debug_def_blocks (void)
{
- struct def_blocks_d dm;
- dm.var = var;
- return (struct def_blocks_d *) htab_find (def_blocks, &dm);
+ htab_traverse (def_blocks, debug_def_blocks_r, NULL);
}
-/* Return the set of blocks where variable VAR is defined and the blocks
- where VAR is live on entry (livein). If no entry is found in
- DEF_BLOCKS, a new one is created and returned. */
-
-static inline struct def_blocks_d *
-get_def_blocks_for (tree var)
-{
- struct def_blocks_d db, *db_p;
- void **slot;
-
- db.var = var;
- slot = htab_find_slot (def_blocks, (void *) &db, INSERT);
- if (*slot == NULL)
- {
- db_p = xmalloc (sizeof (*db_p));
- db_p->var = var;
- db_p->def_blocks = BITMAP_XMALLOC ();
- db_p->phi_blocks = BITMAP_XMALLOC ();
- db_p->livein_blocks = BITMAP_XMALLOC ();
- *slot = (void *) db_p;
- }
- else
- db_p = (struct def_blocks_d *) *slot;
-
- return db_p;
-}
-
/* If a variable V in VARS_TO_RENAME is a pointer, the renaming
process will cause us to lose the name memory tags that may have
been associated with the various SSA_NAMEs of V. This means that
@@ -1433,12 +1136,12 @@ invalidate_name_tags (bitmap vars_to_rename)
}
}
-/* Rewrite the actual blocks, statements, and phi arguments, to be in SSA
+
+/* Rewrite the actual blocks, statements, and PHI arguments, to be in SSA
form. FIX_VIRTUAL_PHIS is true if we should only be fixing up virtual
- phi arguments, instead of adding new phi arguments for just added phi
+ PHI arguments, instead of adding new PHI arguments for just added PHI
nodes. */
-
static void
rewrite_blocks (bool fix_virtual_phis)
{
@@ -1477,7 +1180,15 @@ rewrite_blocks (bool fix_virtual_phis)
/* Finalize the dominator walker. */
fini_walk_dominator_tree (&walk_data);
+ /* Debugging dumps. */
+ if (dump_file && (dump_flags & TDF_STATS))
+ {
+ dump_dfa_stats (dump_file);
+ dump_tree_ssa_stats (dump_file);
+ }
+
htab_delete (def_blocks);
+ def_blocks = NULL;
VEC_free (tree_on_heap, block_defs_stack);
block_defs_stack = NULL;
@@ -1485,6 +1196,20 @@ rewrite_blocks (bool fix_virtual_phis)
timevar_pop (TV_TREE_SSA_REWRITE_BLOCKS);
}
+
+/* Block initialization routine for mark_def_sites. Clear the
+ KILLS bitmap at the start of each block. */
+
+static void
+mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
+ basic_block bb ATTRIBUTE_UNUSED)
+{
+ struct mark_def_sites_global_data *gd = walk_data->global_data;
+ bitmap kills = gd->kills;
+ bitmap_clear (kills);
+}
+
+
/* Mark the definition site blocks for each variable, so that we know where
the variable is actually live. */
@@ -1505,7 +1230,6 @@ mark_def_site_blocks (void)
/* Ensure that the dominance information is OK. */
calculate_dominance_info (CDI_DOMINATORS);
-
/* Setup callbacks for the generic dominator tree walker to find and
mark definition sites. */
walk_data.walk_stmts_backward = false;
@@ -1521,7 +1245,7 @@ mark_def_site_blocks (void)
/* Notice that this bitmap is indexed using variable UIDs, so it must be
large enough to accommodate all the variables referenced in the
function, not just the ones we are renaming. */
- mark_def_sites_global_data.kills = BITMAP_XMALLOC ();
+ mark_def_sites_global_data.kills = BITMAP_ALLOC (NULL);
walk_data.global_data = &mark_def_sites_global_data;
/* We do not have any local data. */
@@ -1537,7 +1261,7 @@ mark_def_site_blocks (void)
fini_walk_dominator_tree (&walk_data);
/* We no longer need this bitmap, clear and free it. */
- BITMAP_XFREE (mark_def_sites_global_data.kills);
+ BITMAP_FREE (mark_def_sites_global_data.kills);
}
@@ -1601,7 +1325,7 @@ rewrite_into_ssa (bool all)
can save significant time during PHI insertion for large graphs. */
dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *));
FOR_EACH_BB (bb)
- dfs[bb->index] = BITMAP_XMALLOC ();
+ dfs[bb->index] = BITMAP_ALLOC (NULL);
/* Compute dominance frontiers. */
compute_dominance_frontiers (dfs);
@@ -1611,24 +1335,44 @@ rewrite_into_ssa (bool all)
rewrite_blocks (false);
- /* Debugging dumps. */
- if (dump_file && (dump_flags & TDF_STATS))
- {
- dump_dfa_stats (dump_file);
- dump_tree_ssa_stats (dump_file);
- }
-
/* Free allocated memory. */
FOR_EACH_BB (bb)
- BITMAP_XFREE (dfs[bb->index]);
+ BITMAP_FREE (dfs[bb->index]);
free (dfs);
vars_to_rename = old_vars_to_rename;
timevar_pop (TV_TREE_SSA_OTHER);
}
-/* Rewrite the def-def chains so that they have the correct reaching
- definitions. */
+
+/* Rewrites all variables into SSA. */
+
+static void
+rewrite_all_into_ssa (void)
+{
+ rewrite_into_ssa (true);
+}
+
+struct tree_opt_pass pass_build_ssa =
+{
+ "ssa", /* name */
+ NULL, /* gate */
+ rewrite_all_into_ssa, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ 0, /* tv_id */
+ PROP_cfg | PROP_referenced_vars, /* properties_required */
+ PROP_ssa, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */
+ 0 /* letter */
+};
+
+
+/* Rewrite the def-def chains of virtual operands so that they have
+ the correct reaching definitions. */
void
rewrite_def_def_chains (void)
@@ -1637,10 +1381,302 @@ rewrite_def_def_chains (void)
calculate_dominance_info (CDI_DOMINATORS);
mark_def_site_blocks ();
rewrite_blocks (true);
+}
+
+
+
+/*---------------------------------------------------------------------------
+ Functions to fix a program in invalid SSA form into valid SSA
+ form. The main entry point here is rewrite_ssa_into_ssa.
+---------------------------------------------------------------------------*/
+
+/* Called after visiting basic block BB. Restore CURRDEFS to its
+ original value. */
+
+static void
+ssa_rewrite_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
+ basic_block bb ATTRIBUTE_UNUSED)
+{
+
+ /* Step 5. Restore the current reaching definition for each variable
+ referenced in the block (in reverse order). */
+ while (VEC_length (tree_on_heap, block_defs_stack) > 0)
+ {
+ tree var = VEC_pop (tree_on_heap, block_defs_stack);
+ tree saved_def;
+
+ if (var == NULL)
+ break;
+
+ saved_def = VEC_pop (tree_on_heap, block_defs_stack);
+ set_current_def (var, saved_def);
+ }
+}
+
+
+/* Register DEF (an SSA_NAME) to be a new definition for the original
+ ssa name VAR and push VAR's current reaching definition
+ into the stack pointed by BLOCK_DEFS_P. */
+
+static void
+ssa_register_new_def (tree var, tree def)
+{
+ tree currdef;
+
+ /* If this variable is set in a single basic block and all uses are
+ dominated by the set(s) in that single basic block, then there is
+ nothing to do. TODO we should not be called at all, and just
+ keep the original name. */
+ if (get_phi_state (var) == NEED_PHI_STATE_NO)
+ {
+ set_current_def (var, def);
+ return;
+ }
+
+ currdef = get_current_def (var);
+
+ /* Push the current reaching definition into *BLOCK_DEFS_P. This stack is
+ later used by the dominator tree callbacks to restore the reaching
+ definitions for all the variables defined in the block after a recursive
+ visit to all its immediately dominated blocks. */
+ VEC_safe_push (tree_on_heap, block_defs_stack, currdef);
+ VEC_safe_push (tree_on_heap, block_defs_stack, var);
+
+ /* Set the current reaching definition for VAR to be DEF. */
+ set_current_def (var, def);
+}
+
+
+/* Same as rewrite_stmt, for rewriting ssa names. */
+
+static void
+ssa_rewrite_stmt (struct dom_walk_data *walk_data,
+ basic_block bb ATTRIBUTE_UNUSED,
+ block_stmt_iterator si)
+{
+ stmt_ann_t ann;
+ tree stmt, var;
+ ssa_op_iter iter;
+ use_operand_p use_p;
+ def_operand_p def_p;
+ sbitmap names_to_rename = walk_data->global_data;
+
+ stmt = bsi_stmt (si);
+ ann = stmt_ann (stmt);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Renaming statement ");
+ print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
+
+ /* We have just scanned the code for operands. No statement should
+ be modified. */
+ gcc_assert (!ann->modified);
+
+ /* Step 1. Rewrite USES and VUSES in the statement. */
+ FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
+ {
+ if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (use_p))))
+ SET_USE (use_p, get_reaching_def (USE_FROM_PTR (use_p)));
+ }
+
+ /* Step 2. Register the statement's DEF and VDEF operands. */
+ FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
+ {
+ var = DEF_FROM_PTR (def_p);
+
+ if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (var)))
+ continue;
+
+ SET_DEF (def_p, duplicate_ssa_name (var, stmt));
+ ssa_register_new_def (var, DEF_FROM_PTR (def_p));
+ }
+}
+
+
+/* Ditto, for ssa name rewriting. */
+
+static void
+ssa_rewrite_phi_arguments (struct dom_walk_data *walk_data, basic_block bb)
+{
+ edge e;
+ sbitmap names_to_rename = walk_data->global_data;
+ use_operand_p op;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ tree phi;
+
+ if (e->dest == EXIT_BLOCK_PTR)
+ continue;
+
+ for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+ {
+ op = PHI_ARG_DEF_PTR_FROM_EDGE (phi, e);
+ if (TREE_CODE (USE_FROM_PTR (op)) != SSA_NAME)
+ continue;
+
+ if (!TEST_BIT (names_to_rename, SSA_NAME_VERSION (USE_FROM_PTR (op))))
+ continue;
+
+ SET_USE (op, get_reaching_def (USE_FROM_PTR (op)));
+ if (e->flags & EDGE_ABNORMAL)
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (USE_FROM_PTR (op)) = 1;
+ }
+ }
+}
+
+/* Ditto, for rewriting ssa names. */
+
+static void
+ssa_rewrite_initialize_block (struct dom_walk_data *walk_data, basic_block bb)
+{
+ tree phi, new_name;
+ sbitmap names_to_rename = walk_data->global_data;
+ edge e;
+ bool abnormal_phi;
+ edge_iterator ei;
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\n\nRenaming block #%d\n\n", bb->index);
+
+ /* Mark the unwind point for this block. */
+ VEC_safe_push (tree_on_heap, block_defs_stack, NULL_TREE);
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ if (e->flags & EDGE_ABNORMAL)
+ break;
+ abnormal_phi = (e != NULL);
+
+ /* Step 1. Register new definitions for every PHI node in the block.
+ Conceptually, all the PHI nodes are executed in parallel and each PHI
+ node introduces a new version for the associated variable. */
+ for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ {
+ tree result = PHI_RESULT (phi);
+
+ if (TEST_BIT (names_to_rename, SSA_NAME_VERSION (result)))
+ {
+ new_name = duplicate_ssa_name (result, phi);
+ SET_PHI_RESULT (phi, new_name);
+
+ if (abnormal_phi)
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_name) = 1;
+ ssa_register_new_def (result, new_name);
+ }
+ }
}
+
+
+/* Same as mark_def_sites, but works over SSA names. */
+
+static void
+ssa_mark_def_sites (struct dom_walk_data *walk_data,
+ basic_block bb,
+ block_stmt_iterator bsi)
+{
+ struct mark_def_sites_global_data *gd = walk_data->global_data;
+ bitmap kills = gd->kills;
+ size_t uid, def_uid;
+ tree stmt, use, def;
+ ssa_op_iter iter;
+
+ /* Mark all the blocks that have definitions for each variable in the
+ names_to_rename bitmap. */
+ stmt = bsi_stmt (bsi);
+ get_stmt_operands (stmt);
+
+ /* If a variable is used before being set, then the variable is live
+ across a block boundary, so mark it live-on-entry to BB. */
+ FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS)
+ {
+ uid = SSA_NAME_VERSION (use);
+
+ if (TEST_BIT (gd->names_to_rename, uid)
+ && !bitmap_bit_p (kills, uid))
+ set_livein_block (use, bb);
+ }
+
+ /* Now process the definition made by this statement. Mark the
+ variables in KILLS. */
+ FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
+ {
+ def_uid = SSA_NAME_VERSION (def);
+
+ if (TEST_BIT (gd->names_to_rename, def_uid))
+ {
+ set_def_block (def, bb, false, true);
+ bitmap_set_bit (kills, def_uid);
+ }
+ }
+}
+
+
+/* Block initialization routine for mark_def_sites. Clear the
+ KILLS bitmap at the start of each block. */
+
+static void
+ssa_mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
+ basic_block bb)
+{
+ struct mark_def_sites_global_data *gd = walk_data->global_data;
+ bitmap kills = gd->kills;
+ tree phi, def;
+ unsigned def_uid;
+
+ bitmap_clear (kills);
+
+ for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ {
+ def = PHI_RESULT (phi);
+ def_uid = SSA_NAME_VERSION (def);
+
+ if (!TEST_BIT (gd->names_to_rename, def_uid))
+ continue;
+
+ set_def_block (def, bb, true, true);
+ bitmap_set_bit (kills, def_uid);
+ }
+}
+
+/* Marks ssa names used as arguments of phis at the end of BB. */
+
+static void
+ssa_mark_phi_uses (struct dom_walk_data *walk_data, basic_block bb)
+{
+ struct mark_def_sites_global_data *gd = walk_data->global_data;
+ bitmap kills = gd->kills;
+ edge e;
+ tree phi, use;
+ unsigned uid;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ if (e->dest == EXIT_BLOCK_PTR)
+ continue;
+
+ for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+ {
+ use = PHI_ARG_DEF_FROM_EDGE (phi, e);
+ if (TREE_CODE (use) != SSA_NAME)
+ continue;
+
+ uid = SSA_NAME_VERSION (use);
+
+ if (TEST_BIT (gd->names_to_rename, uid)
+ && !bitmap_bit_p (kills, uid))
+ set_livein_block (use, bb);
+ }
+ }
+}
+
+
/* The marked ssa names may have more than one definition;
- add phi nodes and rewrite them to fix this. */
+ add PHI nodes and rewrite them to fix this. */
void
rewrite_ssa_into_ssa (void)
@@ -1669,7 +1705,7 @@ rewrite_ssa_into_ssa (void)
can save significant time during PHI insertion for large graphs. */
dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *));
FOR_EACH_BB (bb)
- dfs[bb->index] = BITMAP_XMALLOC ();
+ dfs[bb->index] = BITMAP_ALLOC (NULL);
/* Ensure that the dominance information is OK. */
calculate_dominance_info (CDI_DOMINATORS);
@@ -1698,7 +1734,7 @@ rewrite_ssa_into_ssa (void)
set_current_def (ssa_name (i), NULL_TREE);
}
- mark_def_sites_global_data.kills = BITMAP_XMALLOC ();
+ mark_def_sites_global_data.kills = BITMAP_ALLOC (NULL);
mark_def_sites_global_data.names_to_rename = snames_to_rename;
walk_data.global_data = &mark_def_sites_global_data;
@@ -1717,7 +1753,7 @@ rewrite_ssa_into_ssa (void)
fini_walk_dominator_tree (&walk_data);
/* We no longer need this bitmap, clear and free it. */
- BITMAP_XFREE (mark_def_sites_global_data.kills);
+ BITMAP_FREE (mark_def_sites_global_data.kills);
/* Insert PHI nodes at dominance frontiers of definition blocks. */
insert_phi_nodes (dfs, to_rename);
@@ -1773,7 +1809,7 @@ rewrite_ssa_into_ssa (void)
/* Free allocated memory. */
FOR_EACH_BB (bb)
- BITMAP_XFREE (dfs[bb->index]);
+ BITMAP_FREE (dfs[bb->index]);
free (dfs);
htab_delete (def_blocks);
@@ -1789,34 +1825,9 @@ rewrite_ssa_into_ssa (void)
}
#endif
- BITMAP_XFREE (to_rename);
+ BITMAP_FREE (to_rename);
VEC_free (tree_on_heap, block_defs_stack);
block_defs_stack = NULL;
timevar_pop (TV_TREE_SSA_OTHER);
}
-
-/* Rewrites all variables into ssa. */
-
-static void
-rewrite_all_into_ssa (void)
-{
- rewrite_into_ssa (true);
-}
-
-struct tree_opt_pass pass_build_ssa =
-{
- "ssa", /* name */
- NULL, /* gate */
- rewrite_all_into_ssa, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- 0, /* tv_id */
- PROP_cfg | PROP_referenced_vars, /* properties_required */
- PROP_ssa, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */
- 0 /* letter */
-};
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index 6c8bafe89c3..b8c6201ff88 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -374,6 +374,7 @@ linear_transform_loops (struct loops *loops)
}
free_df ();
scev_reset ();
+ rewrite_into_ssa (false);
rewrite_into_loop_closed_ssa ();
#ifdef ENABLE_CHECKING
verify_loop_closed_ssa ();
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 9d931a6a461..abaa806aee8 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -212,7 +212,7 @@ static struct tree_opt_pass pass_init_datastructures =
static void
register_one_dump_file (struct tree_opt_pass *pass, int n)
{
- char *dot_name, *flag_name;
+ char *dot_name, *flag_name, *glob_name;
char num[10];
/* See below in next_pass_1. */
@@ -225,13 +225,15 @@ register_one_dump_file (struct tree_opt_pass *pass, int n)
if (pass->properties_provided & PROP_trees)
{
flag_name = concat ("tree-", pass->name, num, NULL);
- pass->static_pass_number = dump_register (dot_name, flag_name,
+ glob_name = concat ("tree-", pass->name, NULL);
+ pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
TDF_TREE, n + TDI_tree_all, 0);
}
else
{
flag_name = concat ("rtl-", pass->name, num, NULL);
- pass->static_pass_number = dump_register (dot_name, flag_name,
+ glob_name = concat ("rtl-", pass->name, NULL);
+ pass->static_pass_number = dump_register (dot_name, flag_name, glob_name,
TDF_RTL, n, pass->letter);
}
}
@@ -345,7 +347,6 @@ init_tree_optimization_passes (void)
p = &pass_all_optimizations.sub;
NEXT_PASS (pass_referenced_vars);
- NEXT_PASS (pass_maybe_create_global_var);
NEXT_PASS (pass_create_structure_vars);
NEXT_PASS (pass_build_ssa);
/* NEXT_PASS (pass_build_pta); */
@@ -367,6 +368,10 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_ch);
NEXT_PASS (pass_profile);
NEXT_PASS (pass_sra);
+ /* FIXME: SRA may generate arbitrary gimple code, exposing new
+ aliased and call-clobbered variables. As mentioned below,
+ pass_may_alias should be a TODO item. */
+ NEXT_PASS (pass_may_alias);
NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_dominator);
NEXT_PASS (pass_redundant_phi);
@@ -669,7 +674,7 @@ tree_rest_of_compilation (tree fndecl)
bitmap_obstack_initialize (NULL);
bitmap_obstack_initialize (&reg_obstack); /* FIXME, only at RTL generation*/
- vars_to_rename = BITMAP_XMALLOC ();
+ vars_to_rename = BITMAP_ALLOC (NULL);
/* Perform all tree transforms and optimizations. */
execute_pass_list (all_passes);
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 65c74d310a4..2eaa2713984 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -51,9 +51,7 @@ Boston, MA 02111-1307, USA. */
#define SSANORM_PERFORM_TER 0x1
#define SSANORM_COMBINE_TEMPS 0x2
-#define SSANORM_REMOVE_ALL_PHIS 0x4
-#define SSANORM_COALESCE_PARTITIONS 0x8
-#define SSANORM_USE_COALESCE_LIST 0x10
+#define SSANORM_COALESCE_PARTITIONS 0x4
/* Used to hold all the components required to do SSA PHI elimination.
The node and pred/succ list is a simple linear list of nodes and
@@ -697,10 +695,6 @@ coalesce_ssa_name (var_map map, int flags)
if (num_var_partitions (map) <= 1)
return NULL;
- /* If no preference given, use cheap coalescing of all partitions. */
- if ((flags & (SSANORM_COALESCE_PARTITIONS | SSANORM_USE_COALESCE_LIST)) == 0)
- flags |= SSANORM_COALESCE_PARTITIONS;
-
liveinfo = calculate_live_on_entry (map);
calculate_live_on_exit (liveinfo);
rv = root_var_init (map);
@@ -708,51 +702,48 @@ coalesce_ssa_name (var_map map, int flags)
/* Remove single element variable from the list. */
root_var_compact (rv);
- if (flags & SSANORM_USE_COALESCE_LIST)
+ cl = create_coalesce_list (map);
+
+ /* Add all potential copies via PHI arguments to the list. */
+ FOR_EACH_BB (bb)
{
- cl = create_coalesce_list (map);
-
- /* Add all potential copies via PHI arguments to the list. */
- FOR_EACH_BB (bb)
+ for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ tree res = PHI_RESULT (phi);
+ int p = var_to_partition (map, res);
+ if (p == NO_PARTITION)
+ continue;
+ for (x = 0; x < (unsigned)PHI_NUM_ARGS (phi); x++)
{
- tree res = PHI_RESULT (phi);
- int p = var_to_partition (map, res);
- if (p == NO_PARTITION)
+ tree arg = PHI_ARG_DEF (phi, x);
+ int p2;
+
+ if (TREE_CODE (arg) != SSA_NAME)
continue;
- for (x = 0; x < (unsigned)PHI_NUM_ARGS (phi); x++)
- {
- tree arg = PHI_ARG_DEF (phi, x);
- int p2;
-
- if (TREE_CODE (arg) != SSA_NAME)
- continue;
- if (SSA_NAME_VAR (res) != SSA_NAME_VAR (arg))
- continue;
- p2 = var_to_partition (map, PHI_ARG_DEF (phi, x));
- if (p2 != NO_PARTITION)
- add_coalesce (cl, p, p2, 1);
- }
+ if (SSA_NAME_VAR (res) != SSA_NAME_VAR (arg))
+ continue;
+ p2 = var_to_partition (map, PHI_ARG_DEF (phi, x));
+ if (p2 != NO_PARTITION)
+ add_coalesce (cl, p, p2, 1);
}
}
+ }
- /* Coalesce all the result decls together. */
- var = NULL_TREE;
- i = 0;
- for (x = 0; x < num_var_partitions (map); x++)
+ /* Coalesce all the result decls together. */
+ var = NULL_TREE;
+ i = 0;
+ for (x = 0; x < num_var_partitions (map); x++)
+ {
+ tree p = partition_to_var (map, x);
+ if (TREE_CODE (SSA_NAME_VAR(p)) == RESULT_DECL)
{
- tree p = partition_to_var (map, x);
- if (TREE_CODE (SSA_NAME_VAR(p)) == RESULT_DECL)
+ if (var == NULL_TREE)
{
- if (var == NULL_TREE)
- {
- var = p;
- i = x;
- }
- else
- add_coalesce (cl, i, x, 1);
+ var = p;
+ i = x;
}
+ else
+ add_coalesce (cl, i, x, 1);
}
}
@@ -833,16 +824,14 @@ coalesce_ssa_name (var_map map, int flags)
dump_var_map (dump_file, map);
/* Coalesce partitions. */
- if (flags & SSANORM_USE_COALESCE_LIST)
- coalesce_tpa_members (rv, graph, map, cl,
- ((dump_flags & TDF_DETAILS) ? dump_file
- : NULL));
+ coalesce_tpa_members (rv, graph, map, cl,
+ ((dump_flags & TDF_DETAILS) ? dump_file
+ : NULL));
-
if (flags & SSANORM_COALESCE_PARTITIONS)
- coalesce_tpa_members (rv, graph, map, NULL,
- ((dump_flags & TDF_DETAILS) ? dump_file
- : NULL));
+ coalesce_tpa_members (rv, graph, map, NULL,
+ ((dump_flags & TDF_DETAILS) ? dump_file
+ : NULL));
if (cl)
delete_coalesce_list (cl);
root_var_delete (rv);
@@ -1260,8 +1249,8 @@ new_temp_expr_table (var_map map)
t->partition_dep_list = xcalloc (num_var_partitions (map) + 1,
sizeof (value_expr_p));
- t->replaceable = BITMAP_XMALLOC ();
- t->partition_in_use = BITMAP_XMALLOC ();
+ t->replaceable = BITMAP_ALLOC (NULL);
+ t->partition_in_use = BITMAP_ALLOC (NULL);
t->saw_replaceable = false;
t->virtual_partition = num_var_partitions (map);
@@ -1293,8 +1282,8 @@ free_temp_expr_table (temp_expr_table_p t)
free (p);
}
- BITMAP_XFREE (t->partition_in_use);
- BITMAP_XFREE (t->replaceable);
+ BITMAP_FREE (t->partition_in_use);
+ BITMAP_FREE (t->replaceable);
free (t->partition_dep_list);
if (t->saw_replaceable)
@@ -1659,8 +1648,23 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
{
if (tab->version_info[SSA_NAME_VERSION (def)])
{
- /* Mark expression as replaceable unless stmt is volatile. */
- if (!ann->has_volatile_ops)
+ bool same_root_var = false;
+ tree def2;
+ ssa_op_iter iter2;
+
+ /* See if the root variables are the same. If they are, we
+ do not want to do the replacement to avoid problems with
+ code size, see PR tree-optimization/17549. */
+ FOR_EACH_SSA_TREE_OPERAND (def2, stmt, iter2, SSA_OP_DEF)
+ if (SSA_NAME_VAR (def) == SSA_NAME_VAR (def2))
+ {
+ same_root_var = true;
+ break;
+ }
+
+ /* Mark expression as replaceable unless stmt is volatile
+ or DEF sets the same root variable as STMT. */
+ if (!ann->has_volatile_ops && !same_root_var)
mark_replaceable (tab, def);
else
finish_expr (tab, SSA_NAME_VERSION (def), false);
@@ -2100,7 +2104,7 @@ analyze_edges_for_bb (basic_block bb, FILE *debug_file)
{
VARRAY_EDGE_INIT (edge_leader, 25, "edge_leader");
VARRAY_TREE_INIT (stmt_list, 25, "stmt_list");
- leader_has_match = BITMAP_XMALLOC ();
+ leader_has_match = BITMAP_ALLOC (NULL);
}
else
{
@@ -2246,7 +2250,7 @@ perform_edge_inserts (FILE *dump_file)
/* Clear out any tables which were created. */
edge_leader = NULL;
- BITMAP_XFREE (leader_has_match);
+ BITMAP_FREE (leader_has_match);
if (changed)
{
@@ -2367,9 +2371,7 @@ remove_ssa_form (FILE *dump, var_map map, int flags)
for (phi = phi_nodes (bb); phi; phi = next)
{
next = PHI_CHAIN (phi);
- if ((flags & SSANORM_REMOVE_ALL_PHIS)
- || var_to_partition (map, PHI_RESULT (phi)) != NO_PARTITION)
- remove_phi_node (phi, NULL_TREE, bb);
+ remove_phi_node (phi, NULL_TREE, bb);
}
}
@@ -2477,7 +2479,7 @@ rewrite_out_of_ssa (void)
{
var_map map;
int var_flags = 0;
- int ssa_flags = (SSANORM_REMOVE_ALL_PHIS | SSANORM_USE_COALESCE_LIST);
+ int ssa_flags = 0;
/* If elimination of a PHI requires inserting a copy on a backedge,
then we will have to split the backedge which has numerous
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index d6a098f2e18..e63ad11c9bb 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -78,6 +78,7 @@ struct dump_file_info
{
const char *suffix; /* suffix to give output file. */
const char *swtch; /* command line switch */
+ const char *glob; /* command line glob */
int flags; /* user flags */
int state; /* state of play */
int num; /* dump file number */
@@ -165,7 +166,6 @@ extern struct tree_opt_pass pass_expand;
extern struct tree_opt_pass pass_rest_of_compilation;
extern struct tree_opt_pass pass_fre;
extern struct tree_opt_pass pass_linear_transform;
-extern struct tree_opt_pass pass_maybe_create_global_var;
extern struct tree_opt_pass pass_create_structure_vars;
extern struct tree_opt_pass pass_build_pta;
extern struct tree_opt_pass pass_del_pta;
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index c1c10358f8f..c6a60fe6de7 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -2466,7 +2466,7 @@ scev_initialize (struct loops *loops)
scalar_evolution_info = htab_create (100, hash_scev_info,
eq_scev_info, del_scev_info);
- already_instantiated = BITMAP_XMALLOC ();
+ already_instantiated = BITMAP_ALLOC (NULL);
initialize_scalar_evolutions_analyzer ();
@@ -2561,6 +2561,6 @@ void
scev_finalize (void)
{
htab_delete (scalar_evolution_info);
- BITMAP_XFREE (already_instantiated);
+ BITMAP_FREE (already_instantiated);
}
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 01bf53c0af9..267655d4bdf 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1116,6 +1116,12 @@ instantiate_element (struct sra_elt *elt)
DECL_SOURCE_LOCATION (var) = DECL_SOURCE_LOCATION (base);
DECL_ARTIFICIAL (var) = 1;
+ if (TREE_THIS_VOLATILE (elt->type))
+ {
+ TREE_THIS_VOLATILE (var) = 1;
+ TREE_SIDE_EFFECTS (var) = 1;
+ }
+
if (DECL_NAME (base) && !DECL_IGNORED_P (base))
{
char *pretty_name = build_element_name (elt);
@@ -2079,10 +2085,10 @@ tree_sra (void)
{
/* Initialize local variables. */
gcc_obstack_init (&sra_obstack);
- sra_candidates = BITMAP_XMALLOC ();
- needs_copy_in = BITMAP_XMALLOC ();
- sra_type_decomp_cache = BITMAP_XMALLOC ();
- sra_type_inst_cache = BITMAP_XMALLOC ();
+ sra_candidates = BITMAP_ALLOC (NULL);
+ needs_copy_in = BITMAP_ALLOC (NULL);
+ sra_type_decomp_cache = BITMAP_ALLOC (NULL);
+ sra_type_inst_cache = BITMAP_ALLOC (NULL);
sra_map = htab_create (101, sra_elt_hash, sra_elt_eq, NULL);
/* Scan. If we find anything, instantiate and scalarize. */
@@ -2096,10 +2102,10 @@ tree_sra (void)
/* Free allocated memory. */
htab_delete (sra_map);
sra_map = NULL;
- BITMAP_XFREE (sra_candidates);
- BITMAP_XFREE (needs_copy_in);
- BITMAP_XFREE (sra_type_decomp_cache);
- BITMAP_XFREE (sra_type_inst_cache);
+ BITMAP_FREE (sra_candidates);
+ BITMAP_FREE (needs_copy_in);
+ BITMAP_FREE (sra_type_decomp_cache);
+ BITMAP_FREE (sra_type_inst_cache);
obstack_free (&sra_obstack, NULL);
}
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 18e88e3db58..943cc47609e 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -44,6 +44,9 @@ Boston, MA 02111-1307, USA. */
#include "params.h"
#include "vec.h"
+/* 'true' after aliases have been computed (see compute_may_aliases). */
+bool aliases_computed_p;
+
/* Structure to map a variable to its alias set and keep track of the
virtual operands that will be needed to represent it. */
struct alias_map_d
@@ -94,6 +97,9 @@ struct alias_info
/* Number of function calls found in the program. */
size_t num_calls_found;
+ /* Number of const/pure function calls found in the program. */
+ size_t num_pure_const_calls_found;
+
/* Array of counters to keep track of how many times each pointer has
been dereferenced in the program. This is used by the alias grouping
heuristic in compute_flow_insensitive_aliasing. */
@@ -145,7 +151,7 @@ static void compute_points_to_and_addr_escape (struct alias_info *);
static void compute_flow_sensitive_aliasing (struct alias_info *);
static void setup_pointers_and_addressables (struct alias_info *);
static bool collect_points_to_info_r (tree, tree, void *);
-static bool is_escape_site (tree, size_t *);
+static bool is_escape_site (tree, struct alias_info *);
static void add_pointed_to_var (struct alias_info *, tree, tree);
static void create_global_var (void);
static void collect_points_to_info_for (struct alias_info *, tree);
@@ -441,7 +447,7 @@ count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
rhs = stmt;
}
- if (lhs && EXPR_P (lhs))
+ if (lhs && (TREE_CODE (lhs) == TREE_LIST || EXPR_P (lhs)))
{
struct count_ptr_d count;
count.ptr = ptr;
@@ -451,7 +457,7 @@ count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
*num_derefs_p = count.count;
}
- if (rhs && EXPR_P (rhs))
+ if (rhs && (TREE_CODE (rhs) == TREE_LIST || EXPR_P (rhs)))
{
struct count_ptr_d count;
count.ptr = ptr;
@@ -465,80 +471,22 @@ count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
}
-/* Count the number of calls in the function and conditionally
- create GLOBAL_VAR. This is performed before translation
- into SSA (and thus before alias analysis) to avoid compile time
- and memory utilization explosions in functions with many
- of calls and call clobbered variables. */
-
-static void
-count_calls_and_maybe_create_global_var (void)
-{
- struct alias_info ai;
- basic_block bb;
- bool temp;
-
- memset (&ai, 0, sizeof (struct alias_info));
-
- /* First count the number of calls in the IL. */
- FOR_EACH_BB (bb)
- {
- block_stmt_iterator si;
-
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- {
- tree stmt = bsi_stmt (si);
-
- if (get_call_expr_in (stmt) != NULL_TREE)
- ai.num_calls_found++;
- }
- }
-
- /* If there are no call clobbered variables, then maybe_create_global_var
- will always create a GLOBAL_VAR. At this point we do not want that
- behavior. So we turn on one bit in CALL_CLOBBERED_VARs, call
- maybe_create_global_var, then reset the bit to its original state. */
- temp = bitmap_bit_p (call_clobbered_vars, 0);
- bitmap_set_bit (call_clobbered_vars, 0);
- maybe_create_global_var (&ai);
- if (!temp)
- bitmap_clear_bit (call_clobbered_vars, 0);
-}
-
-struct tree_opt_pass pass_maybe_create_global_var =
-{
- "maybe_create_global_var", /* name */
- NULL, /* gate */
- count_calls_and_maybe_create_global_var, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_MAY_ALIAS, /* tv_id */
- PROP_cfg, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- 0 /* letter */
-};
-
/* Initialize the data structures used for alias analysis. */
static struct alias_info *
init_alias_info (void)
{
struct alias_info *ai;
- static bool aliases_computed_p = false;
ai = xcalloc (1, sizeof (struct alias_info));
ai->ssa_names_visited = sbitmap_alloc (num_ssa_names);
sbitmap_zero (ai->ssa_names_visited);
VARRAY_TREE_INIT (ai->processed_ptrs, 50, "processed_ptrs");
- ai->addresses_needed = BITMAP_XMALLOC ();
+ ai->addresses_needed = BITMAP_ALLOC (NULL);
VARRAY_UINT_INIT (ai->num_references, num_referenced_vars, "num_references");
- ai->written_vars = BITMAP_XMALLOC ();
- ai->dereferenced_ptrs_store = BITMAP_XMALLOC ();
- ai->dereferenced_ptrs_load = BITMAP_XMALLOC ();
+ ai->written_vars = BITMAP_ALLOC (NULL);
+ ai->dereferenced_ptrs_store = BITMAP_ALLOC (NULL);
+ ai->dereferenced_ptrs_load = BITMAP_ALLOC (NULL);
/* If aliases have been computed before, clear existing information. */
if (aliases_computed_p)
@@ -633,7 +581,7 @@ delete_alias_info (struct alias_info *ai)
sbitmap_free (ai->ssa_names_visited);
ai->processed_ptrs = NULL;
- BITMAP_XFREE (ai->addresses_needed);
+ BITMAP_FREE (ai->addresses_needed);
for (i = 0; i < ai->num_addressable_vars; i++)
{
@@ -650,9 +598,9 @@ delete_alias_info (struct alias_info *ai)
free (ai->pointers);
ai->num_references = NULL;
- BITMAP_XFREE (ai->written_vars);
- BITMAP_XFREE (ai->dereferenced_ptrs_store);
- BITMAP_XFREE (ai->dereferenced_ptrs_load);
+ BITMAP_FREE (ai->written_vars);
+ BITMAP_FREE (ai->dereferenced_ptrs_store);
+ BITMAP_FREE (ai->dereferenced_ptrs_load);
free (ai);
}
@@ -702,7 +650,7 @@ compute_points_to_and_addr_escape (struct alias_info *ai)
{
bitmap addr_taken;
tree stmt = bsi_stmt (si);
- bool stmt_escapes_p = is_escape_site (stmt, &ai->num_calls_found);
+ bool stmt_escapes_p = is_escape_site (stmt, ai);
bitmap_iterator bi;
/* Mark all the variables whose address are taken by the
@@ -1139,6 +1087,7 @@ compute_flow_insensitive_aliasing (struct alias_info *ai)
/* Since TAG2 does not have any aliases of its own, add
TAG2 itself to the alias set of TAG1. */
add_may_alias (tag1, tag2);
+ SET_BIT (may_aliases1, var_ann (tag2)->uid);
}
}
}
@@ -1642,31 +1591,67 @@ maybe_create_global_var (struct alias_info *ai)
n_clobbered++;
}
- if (ai->num_calls_found * n_clobbered >= (size_t) GLOBAL_VAR_THRESHOLD)
- create_global_var ();
- }
+ /* If the number of virtual operands that would be needed to
+ model all the call-clobbered variables is larger than
+ GLOBAL_VAR_THRESHOLD, create .GLOBAL_VAR.
- /* If the function has calls to clobbering functions and .GLOBAL_VAR has
- been created, make it an alias for all call-clobbered variables. */
- if (global_var)
- EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
- {
- tree var = referenced_var (i);
- if (var != global_var)
- {
- subvar_t svars;
- add_may_alias (var, global_var);
- bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
- if (AGGREGATE_TYPE_P (TREE_TYPE (var))
- && TREE_CODE (TREE_TYPE (var)) != ARRAY_TYPE
- && (svars = get_subvars_for_var (var)))
+ Also create .GLOBAL_VAR if there are no call-clobbered
+ variables and the program contains a mixture of pure/const
+ and regular function calls. This is to avoid the problem
+ described in PR 20115:
+
+ int X;
+ int func_pure (void) { return X; }
+ int func_non_pure (int a) { X += a; }
+ int foo ()
{
- subvar_t sv;
- for (sv = svars; sv; sv = sv->next)
- bitmap_set_bit (vars_to_rename, var_ann (sv->var)->uid);
+ int a = func_pure ();
+ func_non_pure (a);
+ a = func_pure ();
+ return a;
}
- }
- }
+
+ Since foo() has no call-clobbered variables, there is
+ no relationship between the calls to func_pure and
+ func_non_pure. Since func_pure has no side-effects, value
+ numbering optimizations elide the second call to func_pure.
+ So, if we have some pure/const and some regular calls in the
+ program we create .GLOBAL_VAR to avoid missing these
+ relations. */
+ if (ai->num_calls_found * n_clobbered >= (size_t) GLOBAL_VAR_THRESHOLD
+ || (n_clobbered == 0
+ && ai->num_calls_found > 0
+ && ai->num_pure_const_calls_found > 0
+ && ai->num_calls_found > ai->num_pure_const_calls_found))
+ create_global_var ();
+ }
+
+ /* Mark all call-clobbered symbols for renaming. Since the initial
+ rewrite into SSA ignored all call sites, we may need to rename
+ .GLOBAL_VAR and the call-clobbered variables. */
+ EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, bi)
+ {
+ tree var = referenced_var (i);
+
+ /* If the function has calls to clobbering functions and
+ .GLOBAL_VAR has been created, make it an alias for all
+ call-clobbered variables. */
+ if (global_var && var != global_var)
+ {
+ subvar_t svars;
+ add_may_alias (var, global_var);
+ if (AGGREGATE_TYPE_P (TREE_TYPE (var))
+ && TREE_CODE (TREE_TYPE (var)) != ARRAY_TYPE
+ && (svars = get_subvars_for_var (var)))
+ {
+ subvar_t sv;
+ for (sv = svars; sv; sv = sv->next)
+ bitmap_set_bit (vars_to_rename, var_ann (sv->var)->uid);
+ }
+ }
+
+ bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
+ }
}
@@ -1826,8 +1811,8 @@ set_pt_malloc (tree ptr)
/* Given two different pointers DEST and ORIG. Merge the points-to
- information in ORIG into DEST. AI is as in
- collect_points_to_info. */
+ information in ORIG into DEST. AI contains all the alias
+ information collected up to this point. */
static void
merge_pointed_to_info (struct alias_info *ai, tree dest, tree orig)
@@ -1972,7 +1957,7 @@ add_pointed_to_expr (struct alias_info *ai, tree ptr, tree expr)
/* If VALUE is of the form &DECL, add DECL to the set of variables
pointed-to by PTR. Otherwise, add VALUE as a pointed-to expression by
- PTR. AI is as in collect_points_to_info. */
+ PTR. AI points to the collected alias information. */
static void
add_pointed_to_var (struct alias_info *ai, tree ptr, tree value)
@@ -2155,16 +2140,18 @@ collect_points_to_info_r (tree var, tree stmt, void *data)
3- STMT is an assignment to a non-local variable, or
4- STMT is a return statement.
- If NUM_CALLS_P is not NULL, the counter is incremented if STMT contains
- a function call. */
+ AI points to the alias information collected so far. */
static bool
-is_escape_site (tree stmt, size_t *num_calls_p)
+is_escape_site (tree stmt, struct alias_info *ai)
{
- if (get_call_expr_in (stmt) != NULL_TREE)
+ tree call = get_call_expr_in (stmt);
+ if (call != NULL_TREE)
{
- if (num_calls_p)
- (*num_calls_p)++;
+ ai->num_calls_found++;
+
+ if (!TREE_SIDE_EFFECTS (call))
+ ai->num_pure_const_calls_found++;
return true;
}
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 995b9439afb..b255020917f 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1060,9 +1060,7 @@ visit_assignment (tree stmt, tree *output_p)
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. This is
- valid because a VIEW_CONVERT_EXPR is valid everywhere an operand of
- aggregate type is valid.
+ 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
@@ -1073,10 +1071,18 @@ visit_assignment (tree stmt, tree *output_p)
if (TREE_CODE (orig_lhs) == VIEW_CONVERT_EXPR
&& val.lattice_val == CONSTANT)
{
- val.const_val = build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (TREE_OPERAND (orig_lhs, 0)),
- val.const_val);
+ tree w = fold (build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (TREE_OPERAND (orig_lhs, 0)),
+ val.const_val));
+
orig_lhs = TREE_OPERAND (orig_lhs, 1);
+ if (w && is_gimple_min_invariant (w))
+ val.const_val = w;
+ else
+ {
+ val.lattice_val = VARYING;
+ val.const_val = NULL;
+ }
}
if (val.lattice_val == CONSTANT
@@ -1285,9 +1291,8 @@ widen_bitfield (tree val, tree field, tree var)
for (i = 0, mask = 0; i < field_size; i++)
mask |= ((HOST_WIDE_INT) 1) << i;
- wide_val = build (BIT_AND_EXPR, TREE_TYPE (var), val,
- fold_convert (TREE_TYPE (var),
- build_int_cst (NULL_TREE, mask)));
+ wide_val = build2 (BIT_AND_EXPR, TREE_TYPE (var), val,
+ build_int_cst (TREE_TYPE (var), mask));
}
else
{
@@ -1297,9 +1302,8 @@ widen_bitfield (tree val, tree field, tree var)
for (i = 0, mask = 0; i < (var_size - field_size); i++)
mask |= ((HOST_WIDE_INT) 1) << (var_size - i - 1);
- wide_val = build (BIT_IOR_EXPR, TREE_TYPE (var), val,
- fold_convert (TREE_TYPE (var),
- build_int_cst (NULL_TREE, mask)));
+ wide_val = build2 (BIT_IOR_EXPR, TREE_TYPE (var), val,
+ build_int_cst (TREE_TYPE (var), mask));
}
return fold (wide_val);
@@ -1961,7 +1965,7 @@ ccp_fold_builtin (tree stmt, tree fn)
}
/* Try to use the dataflow information gathered by the CCP process. */
- visited = BITMAP_XMALLOC ();
+ visited = BITMAP_ALLOC (NULL);
memset (strlen_val, 0, sizeof (strlen_val));
for (i = 0, a = arglist;
@@ -1974,7 +1978,7 @@ ccp_fold_builtin (tree stmt, tree fn)
strlen_val[i] = NULL_TREE;
}
- BITMAP_XFREE (visited);
+ BITMAP_FREE (visited);
result = NULL_TREE;
switch (DECL_FUNCTION_CODE (callee))
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 87f6561415a..16b9d480a49 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -879,7 +879,7 @@ tree_dce_init (bool aggressive)
control_dependence_map
= xmalloc (last_basic_block * sizeof (bitmap));
for (i = 0; i < last_basic_block; ++i)
- control_dependence_map[i] = BITMAP_XMALLOC ();
+ control_dependence_map[i] = BITMAP_ALLOC (NULL);
last_stmt_necessary = sbitmap_alloc (last_basic_block);
sbitmap_zero (last_stmt_necessary);
@@ -901,7 +901,7 @@ tree_dce_done (bool aggressive)
int i;
for (i = 0; i < last_basic_block; ++i)
- BITMAP_XFREE (control_dependence_map[i]);
+ BITMAP_FREE (control_dependence_map[i]);
free (control_dependence_map);
sbitmap_free (visited_control_parents);
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 244bfa2b0f0..a313925174a 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -181,7 +181,7 @@ static struct opt_stats_d opt_stats;
of the form SSA_NAME COND CONST we create a new vrp_element to record
how the condition affects the possible values SSA_NAME may have.
- Each record contains the condition tested (COND), and the the range of
+ Each record contains the condition tested (COND), and the range of
values the variable may legitimately have if COND is true. Note the
range of values may be a smaller range than COND specifies if we have
recorded other ranges for this variable. Each record also contains the
@@ -383,8 +383,8 @@ tree_ssa_dominator_optimize (void)
nonzero_vars_stack = VEC_alloc (tree_on_heap, 20);
vrp_variables_stack = VEC_alloc (tree_on_heap, 20);
stmts_to_rescan = VEC_alloc (tree_on_heap, 20);
- nonzero_vars = BITMAP_XMALLOC ();
- need_eh_cleanup = BITMAP_XMALLOC ();
+ nonzero_vars = BITMAP_ALLOC (NULL);
+ need_eh_cleanup = BITMAP_ALLOC (NULL);
/* Setup callbacks for the generic dominator tree walker. */
walk_data.walk_stmts_backward = false;
@@ -497,8 +497,8 @@ tree_ssa_dominator_optimize (void)
fini_walk_dominator_tree (&walk_data);
/* Free nonzero_vars. */
- BITMAP_XFREE (nonzero_vars);
- BITMAP_XFREE (need_eh_cleanup);
+ BITMAP_FREE (nonzero_vars);
+ BITMAP_FREE (need_eh_cleanup);
VEC_free (tree_on_heap, block_defs_stack);
VEC_free (tree_on_heap, avail_exprs_stack);
@@ -603,8 +603,8 @@ thread_across_edge (struct dom_walk_data *walk_data, edge e)
stmt_ann_t ann = stmt_ann (stmt);
use_optype uses = USE_OPS (ann);
vuse_optype vuses = VUSE_OPS (ann);
- tree *uses_copy = xcalloc (NUM_USES (uses), sizeof (tree));
- tree *vuses_copy = xcalloc (NUM_VUSES (vuses), sizeof (tree));
+ tree *uses_copy = xmalloc (NUM_USES (uses) * sizeof (tree));
+ tree *vuses_copy = xmalloc (NUM_VUSES (vuses) * sizeof (tree));
unsigned int i;
/* Make a copy of the uses into USES_COPY, then cprop into
@@ -1398,7 +1398,7 @@ record_cond (tree cond, tree value)
/* Build a new conditional using NEW_CODE, OP0 and OP1 and store
the new conditional into *p, then store a boolean_true_node
- into the the *(p + 1). */
+ into *(p + 1). */
static void
build_and_record_new_cond (enum tree_code new_code, tree op0, tree op1, tree *p)
@@ -1635,6 +1635,46 @@ unsafe_associative_fp_binop (tree exp)
&& FLOAT_TYPE_P (TREE_TYPE (exp)));
}
+/* Returns true when STMT is a simple iv increment. It detects the
+ following situation:
+
+ i_1 = phi (..., i_2)
+ i_2 = i_1 +/- ... */
+
+static bool
+simple_iv_increment_p (tree stmt)
+{
+ tree lhs, rhs, preinc, phi;
+ unsigned i;
+
+ if (TREE_CODE (stmt) != MODIFY_EXPR)
+ return false;
+
+ lhs = TREE_OPERAND (stmt, 0);
+ if (TREE_CODE (lhs) != SSA_NAME)
+ return false;
+
+ rhs = TREE_OPERAND (stmt, 1);
+
+ if (TREE_CODE (rhs) != PLUS_EXPR
+ && TREE_CODE (rhs) != MINUS_EXPR)
+ return false;
+
+ preinc = TREE_OPERAND (rhs, 0);
+ if (TREE_CODE (preinc) != SSA_NAME)
+ return false;
+
+ phi = SSA_NAME_DEF_STMT (preinc);
+ if (TREE_CODE (phi) != PHI_NODE)
+ return false;
+
+ for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++)
+ if (PHI_ARG_DEF (phi, i) == lhs)
+ return true;
+
+ return false;
+}
+
/* STMT is a MODIFY_EXPR for which we were unable to find RHS in the
hash tables. Try to simplify the RHS using whatever equivalences
we may have recorded.
@@ -1688,6 +1728,11 @@ simplify_rhs_and_lookup_avail_expr (struct dom_walk_data *walk_data,
{
tree rhs_def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
+ /* If the statement defines an induction variable, do not propagate
+ its value, so that we do not create overlapping life ranges. */
+ if (simple_iv_increment_p (rhs_def_stmt))
+ goto dont_fold_assoc;
+
/* See if the RHS_DEF_STMT has the same form as our statement. */
if (TREE_CODE (rhs_def_stmt) == MODIFY_EXPR)
{
@@ -2551,7 +2596,10 @@ eliminate_redundant_computations (struct dom_walk_data *walk_data,
|| ! def
|| TREE_CODE (def) != SSA_NAME
|| SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def)
- || NUM_V_MAY_DEFS (v_may_defs) != 0)
+ || NUM_V_MAY_DEFS (v_may_defs) != 0
+ /* Do not record equivalences for increments of ivs. This would create
+ overlapping live ranges for a very questionable gain. */
+ || simple_iv_increment_p (stmt))
insert = false;
/* Check if the expression has been computed before. */
@@ -3106,7 +3154,7 @@ lookup_avail_expr (tree stmt, bool insert)
void **slot;
tree lhs;
tree temp;
- struct expr_hash_elt *element = xcalloc (sizeof (struct expr_hash_elt), 1);
+ struct expr_hash_elt *element = xmalloc (sizeof (struct expr_hash_elt));
lhs = TREE_CODE (stmt) == MODIFY_EXPR ? TREE_OPERAND (stmt, 0) : NULL;
@@ -3189,16 +3237,19 @@ extract_range_from_cond (tree cond, tree *hi_p, tree *lo_p, int *inverted_p)
tree op1 = TREE_OPERAND (cond, 1);
tree high, low, type;
int inverted;
-
+
+ type = TREE_TYPE (op1);
+
/* Experiments have shown that it's rarely, if ever useful to
record ranges for enumerations. Presumably this is due to
the fact that they're rarely used directly. They are typically
cast into an integer type and used that way. */
- if (TREE_CODE (TREE_TYPE (op1)) != INTEGER_TYPE)
+ if (TREE_CODE (type) != INTEGER_TYPE
+ /* We don't know how to deal with types with variable bounds. */
+ || TREE_CODE (TYPE_MIN_VALUE (type)) != INTEGER_CST
+ || TREE_CODE (TYPE_MAX_VALUE (type)) != INTEGER_CST)
return 0;
- type = TREE_TYPE (op1);
-
switch (TREE_CODE (cond))
{
case EQ_EXPR:
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 625e1d1fa8f..249132d0f61 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -433,7 +433,7 @@ tree_ssa_dse (void)
walk_data.block_local_data_size = sizeof (struct dse_block_local_data);
/* This is the main hash table for the dead store elimination pass. */
- dse_gd.stores = BITMAP_XMALLOC ();
+ dse_gd.stores = BITMAP_ALLOC (NULL);
walk_data.global_data = &dse_gd;
/* Initialize the dominator walker. */
@@ -446,7 +446,7 @@ tree_ssa_dse (void)
fini_walk_dominator_tree (&walk_data);
/* Release the main bitmap. */
- BITMAP_XFREE (dse_gd.stores);
+ BITMAP_FREE (dse_gd.stores);
/* Free dataflow information. It's probably out of date now anyway. */
free_df ();
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index b13894e42fc..fb079dd0e24 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1,5 +1,5 @@
/* Forward propagation of single use variables.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -480,7 +480,7 @@ tree_ssa_forward_propagate_single_use_vars (void)
basic_block bb;
varray_type vars_worklist, cond_worklist;
- vars = BITMAP_XMALLOC ();
+ vars = BITMAP_ALLOC (NULL);
VARRAY_TREE_INIT (vars_worklist, 10, "VARS worklist");
VARRAY_TREE_INIT (cond_worklist, 10, "COND worklist");
@@ -522,7 +522,7 @@ tree_ssa_forward_propagate_single_use_vars (void)
}
/* All done. Clean up. */
- BITMAP_XFREE (vars);
+ BITMAP_FREE (vars);
}
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 15c8b482082..3add81b9a05 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -1,5 +1,5 @@
/* Liveness for SSA trees.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
This file is part of GCC.
@@ -439,11 +439,11 @@ new_tree_live_info (var_map map)
live->map = map;
live->num_blocks = last_basic_block;
- live->global = BITMAP_XMALLOC ();
+ live->global = BITMAP_ALLOC (NULL);
live->livein = (bitmap *)xmalloc (num_var_partitions (map) * sizeof (bitmap));
for (x = 0; x < num_var_partitions (map); x++)
- live->livein[x] = BITMAP_XMALLOC ();
+ live->livein[x] = BITMAP_ALLOC (NULL);
/* liveout is deferred until it is actually requested. */
live->liveout = NULL;
@@ -460,17 +460,17 @@ delete_tree_live_info (tree_live_info_p live)
if (live->liveout)
{
for (x = live->num_blocks - 1; x >= 0; x--)
- BITMAP_XFREE (live->liveout[x]);
+ BITMAP_FREE (live->liveout[x]);
free (live->liveout);
}
if (live->livein)
{
for (x = num_var_partitions (live->map) - 1; x >= 0; x--)
- BITMAP_XFREE (live->livein[x]);
+ BITMAP_FREE (live->livein[x]);
free (live->livein);
}
if (live->global)
- BITMAP_XFREE (live->global);
+ BITMAP_FREE (live->global);
free (live);
}
@@ -573,7 +573,7 @@ calculate_live_on_entry (var_map map)
edge_iterator ei;
#endif
- saw_def = BITMAP_XMALLOC ();
+ saw_def = BITMAP_ALLOC (NULL);
live = new_tree_live_info (map);
@@ -720,7 +720,7 @@ calculate_live_on_entry (var_map map)
gcc_assert (num <= 0);
#endif
- BITMAP_XFREE (saw_def);
+ BITMAP_FREE (saw_def);
return live;
}
@@ -742,7 +742,7 @@ calculate_live_on_exit (tree_live_info_p liveinfo)
on_exit = (bitmap *)xmalloc (last_basic_block * sizeof (bitmap));
for (x = 0; x < (unsigned)last_basic_block; x++)
- on_exit[x] = BITMAP_XMALLOC ();
+ on_exit[x] = BITMAP_ALLOC (NULL);
/* Set all the live-on-exit bits for uses in PHIs. */
FOR_EACH_BB (bb)
@@ -1309,7 +1309,7 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa,
if (tpa_num_trees (tpa) == 0)
return graph;
- live = BITMAP_XMALLOC ();
+ live = BITMAP_ALLOC (NULL);
VARRAY_INT_INIT (partition_link, num_var_partitions (map) + 1, "part_link");
VARRAY_INT_INIT (tpa_nodes, tpa_num_trees (tpa), "tpa nodes");
@@ -1443,7 +1443,7 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa,
VARRAY_POP_ALL (tpa_to_clear);
}
- BITMAP_XFREE (live);
+ BITMAP_FREE (live);
return graph;
}
diff --git a/gcc/tree-ssa-live.h b/gcc/tree-ssa-live.h
index fc16fddec72..c3029494677 100644
--- a/gcc/tree-ssa-live.h
+++ b/gcc/tree-ssa-live.h
@@ -1,5 +1,5 @@
/* Routines for liveness in SSA trees.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
This file is part of GCC.
@@ -428,7 +428,7 @@ tpa_decompact(tpa_p tpa)
}
-/* Once a var_map has been created and compressed, a complimentary root_var
+/* Once a var_map has been created and compressed, a complementary root_var
object can be built. This creates a list of all the root variables from
which ssa version names are derived. Each root variable has a list of
which partitions are versions of that root.
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 65a2a5fd48a..770b71b1208 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -38,6 +38,28 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-pass.h"
#include "flags.h"
+/* TODO: Support for predicated code motion. I.e.
+
+ while (1)
+ {
+ if (cond)
+ {
+ a = inv;
+ something;
+ }
+ }
+
+ Where COND and INV are is invariants, but evaluating INV may trap or be
+ invalid from some other reason if !COND. This may be transformed to
+
+ if (cond)
+ a = inv;
+ while (1)
+ {
+ if (cond)
+ something;
+ } */
+
/* A type for the list of statements that have to be moved in order to be able
to hoist an invariant computation. */
@@ -227,6 +249,28 @@ movement_possibility (tree stmt)
|| tree_could_trap_p (rhs))
return MOVE_PRESERVE_EXECUTION;
+ if (get_call_expr_in (stmt))
+ {
+ /* While pure or const call is guaranteed to have no side effects, we
+ cannot move it arbitrarily. Consider code like
+
+ char *s = something ();
+
+ while (1)
+ {
+ if (s)
+ t = strlen (s);
+ else
+ t = 0;
+ }
+
+ Here the strlen call cannot be moved out of the loop, even though
+ s is invariant. In addition to possibly creating a call with
+ invalid arguments, moving out a function call that is not executed
+ may cause performance regressions in case the call is costly and
+ not executed at all. */
+ return MOVE_PRESERVE_EXECUTION;
+ }
return MOVE_POSSIBLE;
}
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 4635a023962..88fa967bf3b 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -1,5 +1,5 @@
/* Induction variable canonicalization.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -220,12 +220,23 @@ canonicalize_loop_induction_variables (struct loops *loops, struct loop *loop,
niter = fold (build2 (MINUS_EXPR, TREE_TYPE (niter), niter,
build_int_cst (TREE_TYPE (niter), 1)));
}
- else if (try_eval)
- niter = find_loop_niter_by_eval (loop, &exit);
-
- if (chrec_contains_undetermined (niter)
- || TREE_CODE (niter) != INTEGER_CST)
- return false;
+ else
+ {
+ /* If the loop has more than one exit, try checking all of them
+ for # of iterations determinable through scev. */
+ if (!loop->single_exit)
+ niter = find_loop_niter (loop, &exit);
+
+ /* Finally if everything else fails, try brute force evaluation. */
+ if (try_eval
+ && (chrec_contains_undetermined (niter)
+ || TREE_CODE (niter) != INTEGER_CST))
+ niter = find_loop_niter_by_eval (loop, &exit);
+
+ if (chrec_contains_undetermined (niter)
+ || TREE_CODE (niter) != INTEGER_CST)
+ return false;
+ }
if (dump_file && (dump_flags & TDF_DETAILS))
{
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 3288080ac52..b1636a7ffe9 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -123,9 +123,6 @@ struct version_info
/* Information attached to loop. */
struct loop_data
{
- struct tree_niter_desc niter;
- /* Number of iterations. */
-
unsigned regs_used; /* Number of registers used. */
};
@@ -199,6 +196,9 @@ struct ivopts_data
/* The currently optimized loop. */
struct loop *current_loop;
+ /* Numbers of iterations for all exits of the current loop. */
+ htab_t niters;
+
/* The size of version_info array allocated. */
unsigned version_info_size;
@@ -639,6 +639,86 @@ stmt_after_increment (struct loop *loop, struct iv_cand *cand, tree stmt)
}
}
+/* Element of the table in that we cache the numbers of iterations obtained
+ from exits of the loop. */
+
+struct nfe_cache_elt
+{
+ /* The edge for that the number of iterations is cached. */
+ edge exit;
+
+ /* True if the # of iterations was successfully determined. */
+ bool valid_p;
+
+ /* Description of # of iterations. */
+ struct tree_niter_desc niter;
+};
+
+/* Hash function for nfe_cache_elt E. */
+
+static hashval_t
+nfe_hash (const void *e)
+{
+ const struct nfe_cache_elt *elt = e;
+
+ return htab_hash_pointer (elt->exit);
+}
+
+/* Equality function for nfe_cache_elt E1 and edge E2. */
+
+static int
+nfe_eq (const void *e1, const void *e2)
+{
+ const struct nfe_cache_elt *elt1 = e1;
+
+ return elt1->exit == e2;
+}
+
+/* Returns structure describing number of iterations determined from
+ EXIT of DATA->current_loop, or NULL if something goes wrong. */
+
+static struct tree_niter_desc *
+niter_for_exit (struct ivopts_data *data, edge exit)
+{
+ struct nfe_cache_elt *nfe_desc;
+ PTR *slot;
+
+ slot = htab_find_slot_with_hash (data->niters, exit,
+ htab_hash_pointer (exit),
+ INSERT);
+
+ if (!*slot)
+ {
+ nfe_desc = xmalloc (sizeof (struct nfe_cache_elt));
+ nfe_desc->exit = exit;
+ nfe_desc->valid_p = number_of_iterations_exit (data->current_loop,
+ exit, &nfe_desc->niter);
+ *slot = nfe_desc;
+ }
+ else
+ nfe_desc = *slot;
+
+ if (!nfe_desc->valid_p)
+ return NULL;
+
+ return &nfe_desc->niter;
+}
+
+/* Returns structure describing number of iterations determined from
+ single dominating exit of DATA->current_loop, or NULL if something
+ goes wrong. */
+
+static struct tree_niter_desc *
+niter_for_single_dom_exit (struct ivopts_data *data)
+{
+ edge exit = single_dom_exit (data->current_loop);
+
+ if (!exit)
+ return NULL;
+
+ return niter_for_exit (data, exit);
+}
+
/* Initializes data structures used by the iv optimization pass, stored
in DATA. LOOPS is the loop tree. */
@@ -650,9 +730,10 @@ tree_ssa_iv_optimize_init (struct loops *loops, struct ivopts_data *data)
data->version_info_size = 2 * num_ssa_names;
data->version_info = xcalloc (data->version_info_size,
sizeof (struct version_info));
- data->relevant = BITMAP_XMALLOC ();
- data->important_candidates = BITMAP_XMALLOC ();
+ data->relevant = BITMAP_ALLOC (NULL);
+ data->important_candidates = BITMAP_ALLOC (NULL);
data->max_inv_id = 0;
+ data->niters = htab_create (10, nfe_hash, nfe_eq, free);
for (i = 1; i < loops->num; i++)
if (loops->parray[i])
@@ -685,10 +766,10 @@ determine_base_object (tree expr)
base = get_base_address (obj);
if (!base)
- return fold_convert (ptr_type_node, expr);
+ return expr;
if (TREE_CODE (base) == INDIRECT_REF)
- return fold_convert (ptr_type_node, TREE_OPERAND (base, 0));
+ return determine_base_object (TREE_OPERAND (base, 0));
return fold (build1 (ADDR_EXPR, ptr_type_node, base));
@@ -707,6 +788,10 @@ determine_base_object (tree expr)
return fold (build (code, ptr_type_node, op0, op1));
+ case NOP_EXPR:
+ case CONVERT_EXPR:
+ return determine_base_object (TREE_OPERAND (expr, 0));
+
default:
return fold_convert (ptr_type_node, expr);
}
@@ -1009,20 +1094,6 @@ find_givs (struct ivopts_data *data)
free (body);
}
-/* Determine the number of iterations of the current loop. */
-
-static void
-determine_number_of_iterations (struct ivopts_data *data)
-{
- struct loop *loop = data->current_loop;
- edge exit = single_dom_exit (loop);
-
- if (!exit)
- return;
-
- number_of_iterations_exit (loop, exit, &loop_data (loop)->niter);
-}
-
/* For each ssa name defined in LOOP determines whether it is an induction
variable and if so, its initial value and step. */
@@ -1030,7 +1101,6 @@ static bool
find_induction_variables (struct ivopts_data *data)
{
unsigned i;
- struct loop *loop = data->current_loop;
bitmap_iterator bi;
if (!find_bivs (data))
@@ -1038,25 +1108,21 @@ find_induction_variables (struct ivopts_data *data)
find_givs (data);
mark_bivs (data);
- determine_number_of_iterations (data);
if (dump_file && (dump_flags & TDF_DETAILS))
{
- if (loop_data (loop)->niter.niter)
+ struct tree_niter_desc *niter;
+
+ niter = niter_for_single_dom_exit (data);
+
+ if (niter)
{
fprintf (dump_file, " number of iterations ");
- print_generic_expr (dump_file, loop_data (loop)->niter.niter,
- TDF_SLIM);
+ print_generic_expr (dump_file, niter->niter, TDF_SLIM);
fprintf (dump_file, "\n");
fprintf (dump_file, " may be zero if ");
- print_generic_expr (dump_file, loop_data (loop)->niter.may_be_zero,
- TDF_SLIM);
- fprintf (dump_file, "\n");
-
- fprintf (dump_file, " bogus unless ");
- print_generic_expr (dump_file, loop_data (loop)->niter.assumptions,
- TDF_SLIM);
+ print_generic_expr (dump_file, niter->may_be_zero, TDF_SLIM);
fprintf (dump_file, "\n");
fprintf (dump_file, "\n");
};
@@ -1086,7 +1152,7 @@ record_use (struct ivopts_data *data, tree *use_p, struct iv *iv,
use->iv = iv;
use->stmt = stmt;
use->op_p = use_p;
- use->related_cands = BITMAP_XMALLOC ();
+ use->related_cands = BITMAP_ALLOC (NULL);
/* To avoid showing ssa name in the dumps, if it was not reset by the
caller. */
@@ -1675,6 +1741,105 @@ find_interesting_uses (struct ivopts_data *data)
free (body);
}
+/* Strips constant offsets from EXPR and stores them to OFFSET. If INSIDE_ADDR
+ is true, assume we are inside an address. */
+
+static tree
+strip_offset (tree expr, bool inside_addr, unsigned HOST_WIDE_INT *offset)
+{
+ tree op0 = NULL_TREE, op1 = NULL_TREE, step;
+ enum tree_code code;
+ tree type, orig_type = TREE_TYPE (expr);
+ unsigned HOST_WIDE_INT off0, off1, st;
+ tree orig_expr = expr;
+
+ STRIP_NOPS (expr);
+ type = TREE_TYPE (expr);
+ code = TREE_CODE (expr);
+ *offset = 0;
+
+ switch (code)
+ {
+ case INTEGER_CST:
+ if (!cst_and_fits_in_hwi (expr)
+ || zero_p (expr))
+ return orig_expr;
+
+ *offset = int_cst_value (expr);
+ return build_int_cst_type (orig_type, 0);
+
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ op0 = TREE_OPERAND (expr, 0);
+ op1 = TREE_OPERAND (expr, 1);
+
+ op0 = strip_offset (op0, false, &off0);
+ op1 = strip_offset (op1, false, &off1);
+
+ *offset = (code == PLUS_EXPR ? off0 + off1 : off0 - off1);
+ if (op0 == TREE_OPERAND (expr, 0)
+ && op1 == TREE_OPERAND (expr, 1))
+ return orig_expr;
+
+ if (zero_p (op1))
+ expr = op0;
+ else if (zero_p (op0))
+ {
+ if (code == PLUS_EXPR)
+ expr = op1;
+ else
+ expr = build1 (NEGATE_EXPR, type, op1);
+ }
+ else
+ expr = build2 (code, type, op0, op1);
+
+ return fold_convert (orig_type, expr);
+
+ case ARRAY_REF:
+ if (!inside_addr)
+ return orig_expr;
+
+ step = array_ref_element_size (expr);
+ if (!cst_and_fits_in_hwi (step))
+ break;
+
+ st = int_cst_value (step);
+ op1 = TREE_OPERAND (expr, 1);
+ op1 = strip_offset (op1, false, &off1);
+ *offset = off1 * st;
+ break;
+
+ case COMPONENT_REF:
+ if (!inside_addr)
+ return orig_expr;
+ break;
+
+ case ADDR_EXPR:
+ inside_addr = true;
+ break;
+
+ default:
+ return orig_expr;
+ }
+
+ /* Default handling of expressions for that we want to recurse into
+ the first operand. */
+ op0 = TREE_OPERAND (expr, 0);
+ op0 = strip_offset (op0, inside_addr, &off0);
+ *offset += off0;
+
+ if (op0 == TREE_OPERAND (expr, 0)
+ && (!op1 || op1 == TREE_OPERAND (expr, 1)))
+ return orig_expr;
+
+ expr = copy_node (expr);
+ TREE_OPERAND (expr, 0) = op0;
+ if (op1)
+ TREE_OPERAND (expr, 1) = op1;
+
+ return fold_convert (orig_type, expr);
+}
+
/* Adds a candidate BASE + STEP * i. Important field is set to IMPORTANT and
position to POS. If USE is not NULL, the candidate is set as related to
it. If both BASE and STEP are NULL, we add a pseudocandidate for the
@@ -1900,7 +2065,8 @@ static void
add_address_candidates (struct ivopts_data *data,
struct iv *iv, struct iv_use *use)
{
- tree base, abase, tmp, *act;
+ tree base, abase;
+ unsigned HOST_WIDE_INT offset;
/* First, the trivial choices. */
add_iv_value_candidates (data, iv, use);
@@ -1929,26 +2095,9 @@ add_address_candidates (struct ivopts_data *data,
/* Third, try removing the constant offset. */
abase = iv->base;
- while (TREE_CODE (abase) == PLUS_EXPR
- && TREE_CODE (TREE_OPERAND (abase, 1)) != INTEGER_CST)
- abase = TREE_OPERAND (abase, 0);
- /* We found the offset, so make the copy of the non-shared part and
- remove it. */
- if (TREE_CODE (abase) == PLUS_EXPR)
- {
- tmp = iv->base;
- act = &base;
-
- for (tmp = iv->base; tmp != abase; tmp = TREE_OPERAND (tmp, 0))
- {
- *act = build2 (PLUS_EXPR, TREE_TYPE (tmp),
- NULL_TREE, TREE_OPERAND (tmp, 1));
- act = &TREE_OPERAND (*act, 0);
- }
- *act = TREE_OPERAND (tmp, 0);
-
- add_candidate (data, base, iv->step, false, use);
- }
+ base = strip_offset (abase, false, &offset);
+ if (offset)
+ add_candidate (data, base, iv->step, false, use);
}
/* Possibly adds pseudocandidate for replacing the final value of USE by
@@ -1958,16 +2107,11 @@ static void
add_iv_outer_candidates (struct ivopts_data *data, struct iv_use *use)
{
struct tree_niter_desc *niter;
- struct loop *loop = data->current_loop;
/* We must know where we exit the loop and how many times does it roll. */
- if (!single_dom_exit (loop))
- return;
-
- niter = &loop_data (loop)->niter;
- if (!niter->niter
- || !operand_equal_p (niter->assumptions, boolean_true_node, 0)
- || !operand_equal_p (niter->may_be_zero, boolean_false_node, 0))
+ niter = niter_for_single_dom_exit (data);
+ if (!niter
+ || !zero_p (niter->may_be_zero))
return;
add_candidate_1 (data, NULL, NULL, false, IP_NORMAL, use, NULL_TREE);
@@ -2040,7 +2184,7 @@ record_important_candidates (struct ivopts_data *data)
for (i = 0; i < n_iv_uses (data); i++)
{
use = iv_use (data, i);
- BITMAP_XFREE (use->related_cands);
+ BITMAP_FREE (use->related_cands);
}
}
else
@@ -2116,7 +2260,7 @@ set_use_iv_cost (struct ivopts_data *data,
if (cost == INFTY)
{
- BITMAP_XFREE (depends_on);
+ BITMAP_FREE (depends_on);
return;
}
@@ -2283,7 +2427,8 @@ computation_cost (tree expr)
rtx seq, rslt;
tree type = TREE_TYPE (expr);
unsigned cost;
- int regno = 0;
+ /* Avoid using hard regs in ways which may be unsupported. */
+ int regno = LAST_VIRTUAL_REGISTER + 1;
walk_tree (&expr, prepare_decl_rtl, &regno, NULL);
start_sequence ();
@@ -2376,10 +2521,13 @@ get_computation_at (struct loop *loop,
if (stmt_after_increment (loop, cand, at))
cbase = fold (build2 (PLUS_EXPR, uutype, cbase, cstep));
- /* use = ubase + ratio * (var - cbase). If either cbase is a constant
- or |ratio| == 1, it is better to handle this like
-
- ubase - ratio * cbase + ratio * var. */
+ /* use = ubase - ratio * cbase + ratio * var.
+
+ In general case ubase + ratio * (var - cbase) could be better (one less
+ multiplication), but often it is possible to eliminate redundant parts
+ of computations from (ubase - ratio * cbase) term, and if it does not
+ happen, fold is able to apply the distributive law to obtain this form
+ anyway. */
if (ratioi == 1)
{
@@ -2391,7 +2539,7 @@ get_computation_at (struct loop *loop,
delta = fold (build2 (PLUS_EXPR, uutype, ubase, cbase));
expr = fold (build2 (MINUS_EXPR, uutype, delta, expr));
}
- else if (TREE_CODE (cbase) == INTEGER_CST)
+ else
{
ratio = build_int_cst_type (uutype, ratioi);
delta = fold (build2 (MULT_EXPR, uutype, ratio, cbase));
@@ -2399,13 +2547,6 @@ get_computation_at (struct loop *loop,
expr = fold (build2 (MULT_EXPR, uutype, ratio, expr));
expr = fold (build2 (PLUS_EXPR, uutype, delta, expr));
}
- else
- {
- expr = fold (build2 (MINUS_EXPR, uutype, expr, cbase));
- ratio = build_int_cst_type (uutype, ratioi);
- expr = fold (build2 (MULT_EXPR, uutype, ratio, expr));
- expr = fold (build2 (PLUS_EXPR, uutype, ubase, expr));
- }
return fold_convert (utype, expr);
}
@@ -2419,53 +2560,6 @@ get_computation (struct loop *loop, struct iv_use *use, struct iv_cand *cand)
return get_computation_at (loop, use, cand, use->stmt);
}
-/* Strips constant offsets from EXPR and adds them to OFFSET. */
-
-static void
-strip_offset (tree *expr, unsigned HOST_WIDE_INT *offset)
-{
- tree op0, op1;
- enum tree_code code;
-
- while (1)
- {
- if (cst_and_fits_in_hwi (*expr))
- {
- *offset += int_cst_value (*expr);
- *expr = integer_zero_node;
- return;
- }
-
- code = TREE_CODE (*expr);
-
- if (code != PLUS_EXPR && code != MINUS_EXPR)
- return;
-
- op0 = TREE_OPERAND (*expr, 0);
- op1 = TREE_OPERAND (*expr, 1);
-
- if (cst_and_fits_in_hwi (op1))
- {
- if (code == PLUS_EXPR)
- *offset += int_cst_value (op1);
- else
- *offset -= int_cst_value (op1);
-
- *expr = op0;
- continue;
- }
-
- if (code != PLUS_EXPR)
- return;
-
- if (!cst_and_fits_in_hwi (op0))
- return;
-
- *offset += int_cst_value (op0);
- *expr = op1;
- }
-}
-
/* Returns cost of addition in MODE. */
static unsigned
@@ -2734,7 +2828,7 @@ find_depends (tree *expr_p, int *ws ATTRIBUTE_UNUSED, void *data)
return NULL_TREE;
if (!*depends_on)
- *depends_on = BITMAP_XMALLOC ();
+ *depends_on = BITMAP_ALLOC (NULL);
bitmap_set_bit (*depends_on, info->inv_id);
return NULL_TREE;
@@ -2788,6 +2882,8 @@ force_var_cost (struct ivopts_data *data,
costs_initialized = true;
}
+ STRIP_NOPS (expr);
+
if (depends_on)
{
fd_ivopts_data = data;
@@ -2822,6 +2918,8 @@ force_var_cost (struct ivopts_data *data,
case MULT_EXPR:
op0 = TREE_OPERAND (expr, 0);
op1 = TREE_OPERAND (expr, 1);
+ STRIP_NOPS (op0);
+ STRIP_NOPS (op1);
if (is_gimple_val (op0))
cost0 = 0;
@@ -2967,11 +3065,14 @@ difference_cost (struct ivopts_data *data,
{
unsigned cost;
enum machine_mode mode = TYPE_MODE (TREE_TYPE (e1));
+ unsigned HOST_WIDE_INT off1, off2;
- strip_offset (&e1, offset);
- *offset = -*offset;
- strip_offset (&e2, offset);
- *offset = -*offset;
+ e1 = strip_offset (e1, false, &off1);
+ e2 = strip_offset (e2, false, &off2);
+ *offset += off1 - off2;
+
+ STRIP_NOPS (e1);
+ STRIP_NOPS (e2);
if (TREE_CODE (e1) == ADDR_EXPR)
return ptr_difference_cost (data, e1, e2, symbol_present, var_present, offset,
@@ -3237,19 +3338,44 @@ cand_value_at (struct loop *loop, struct iv_cand *cand, tree at, tree niter)
return val;
}
+/* Returns period of induction variable iv. */
+
+static tree
+iv_period (struct iv *iv)
+{
+ tree step = iv->step, period, type;
+ tree pow2div;
+
+ gcc_assert (step && TREE_CODE (step) == INTEGER_CST);
+
+ /* Period of the iv is gcd (step, type range). Since type range is power
+ of two, it suffices to determine the maximum power of two that divides
+ step. */
+ pow2div = num_ending_zeros (step);
+ type = unsigned_type_for (TREE_TYPE (step));
+
+ period = build_low_bits_mask (type,
+ (TYPE_PRECISION (type)
+ - tree_low_cst (pow2div, 1)));
+
+ return period;
+}
+
/* Check whether it is possible to express the condition in USE by comparison
of candidate CAND. If so, store the comparison code to COMPARE and the
value compared with to BOUND. */
static bool
-may_eliminate_iv (struct loop *loop,
+may_eliminate_iv (struct ivopts_data *data,
struct iv_use *use, struct iv_cand *cand,
enum tree_code *compare, tree *bound)
{
basic_block ex_bb;
edge exit;
- struct tree_niter_desc niter, new_niter;
- tree wider_type, type, base;
+ struct tree_niter_desc *niter;
+ tree nit, nit_type;
+ tree wider_type, period, per_type;
+ struct loop *loop = data->current_loop;
/* For now works only for exits that dominate the loop latch. TODO -- extend
for other conditions inside loop body. */
@@ -3266,43 +3392,39 @@ may_eliminate_iv (struct loop *loop,
if (flow_bb_inside_loop_p (loop, exit->dest))
return false;
- niter.niter = NULL_TREE;
- number_of_iterations_exit (loop, exit, &niter);
- if (!niter.niter
- || !integer_nonzerop (niter.assumptions)
- || !integer_zerop (niter.may_be_zero))
+ niter = niter_for_exit (data, exit);
+ if (!niter
+ || !zero_p (niter->may_be_zero))
return false;
- if (exit->flags & EDGE_TRUE_VALUE)
- *compare = EQ_EXPR;
- else
- *compare = NE_EXPR;
-
- *bound = cand_value_at (loop, cand, use->stmt, niter.niter);
+ nit = niter->niter;
+ nit_type = TREE_TYPE (nit);
- /* Let us check there is not some problem with overflows, by checking that
- the number of iterations is unchanged. */
- base = cand->iv->base;
- type = TREE_TYPE (base);
- if (stmt_after_increment (loop, cand, use->stmt))
- base = fold (build2 (PLUS_EXPR, type, base, cand->iv->step));
-
- new_niter.niter = NULL_TREE;
- number_of_iterations_cond (TREE_TYPE (cand->iv->base), base,
- cand->iv->step, NE_EXPR, *bound, NULL_TREE,
- &new_niter);
- if (!new_niter.niter
- || !integer_nonzerop (new_niter.assumptions)
- || !integer_zerop (new_niter.may_be_zero))
+ /* Determine whether we may use the variable to test whether niter iterations
+ elapsed. This is the case iff the period of the induction variable is
+ greater than the number of iterations. */
+ period = iv_period (cand->iv);
+ if (!period)
return false;
+ per_type = TREE_TYPE (period);
- wider_type = TREE_TYPE (new_niter.niter);
- if (TYPE_PRECISION (wider_type) < TYPE_PRECISION (TREE_TYPE (niter.niter)))
- wider_type = TREE_TYPE (niter.niter);
- if (!operand_equal_p (fold_convert (wider_type, niter.niter),
- fold_convert (wider_type, new_niter.niter), 0))
+ wider_type = TREE_TYPE (period);
+ if (TYPE_PRECISION (nit_type) < TYPE_PRECISION (per_type))
+ wider_type = per_type;
+ else
+ wider_type = nit_type;
+
+ if (!integer_nonzerop (fold (build2 (GE_EXPR, boolean_type_node,
+ fold_convert (wider_type, period),
+ fold_convert (wider_type, nit)))))
return false;
+ if (exit->flags & EDGE_TRUE_VALUE)
+ *compare = EQ_EXPR;
+ else
+ *compare = NE_EXPR;
+
+ *bound = cand_value_at (loop, cand, use->stmt, nit);
return true;
}
@@ -3322,7 +3444,7 @@ determine_use_iv_cost_condition (struct ivopts_data *data,
return false;
}
- if (may_eliminate_iv (data->current_loop, use, cand, &compare, &bound))
+ if (may_eliminate_iv (data, use, cand, &compare, &bound))
{
bitmap depends_on = NULL;
unsigned cost = force_var_cost (data, bound, &depends_on);
@@ -3349,8 +3471,10 @@ determine_use_iv_cost_condition (struct ivopts_data *data,
a direct computation. If so, the formula is stored to *VALUE. */
static bool
-may_replace_final_value (struct loop *loop, struct iv_use *use, tree *value)
+may_replace_final_value (struct ivopts_data *data, struct iv_use *use,
+ tree *value)
{
+ struct loop *loop = data->current_loop;
edge exit;
struct tree_niter_desc *niter;
@@ -3361,10 +3485,9 @@ may_replace_final_value (struct loop *loop, struct iv_use *use, tree *value)
gcc_assert (dominated_by_p (CDI_DOMINATORS, exit->src,
bb_for_stmt (use->stmt)));
- niter = &loop_data (loop)->niter;
- if (!niter->niter
- || !operand_equal_p (niter->assumptions, boolean_true_node, 0)
- || !operand_equal_p (niter->may_be_zero, boolean_false_node, 0))
+ niter = niter_for_single_dom_exit (data);
+ if (!niter
+ || !zero_p (niter->may_be_zero))
return false;
*value = iv_value (use->iv, niter->niter);
@@ -3397,7 +3520,7 @@ determine_use_iv_cost_outer (struct ivopts_data *data,
if (!cand->iv)
{
- if (!may_replace_final_value (loop, use, &value))
+ if (!may_replace_final_value (data, use, &value))
{
set_use_iv_cost (data, use, cand, INFTY, NULL);
return false;
@@ -3467,7 +3590,7 @@ determine_use_iv_costs (struct ivopts_data *data)
unsigned i, j;
struct iv_use *use;
struct iv_cand *cand;
- bitmap to_clear = BITMAP_XMALLOC ();
+ bitmap to_clear = BITMAP_ALLOC (NULL);
alloc_use_cost_map (data);
@@ -3501,7 +3624,7 @@ determine_use_iv_costs (struct ivopts_data *data)
}
}
- BITMAP_XFREE (to_clear);
+ BITMAP_FREE (to_clear);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -4012,7 +4135,7 @@ iv_ca_new (struct ivopts_data *data)
nw->bad_uses = 0;
nw->cand_for_use = xcalloc (n_iv_uses (data), sizeof (struct cost_pair *));
nw->n_cand_uses = xcalloc (n_iv_cands (data), sizeof (unsigned));
- nw->cands = BITMAP_XMALLOC ();
+ nw->cands = BITMAP_ALLOC (NULL);
nw->n_cands = 0;
nw->n_regs = 0;
nw->cand_use_cost = 0;
@@ -4030,7 +4153,7 @@ iv_ca_free (struct iv_ca **ivs)
{
free ((*ivs)->cand_for_use);
free ((*ivs)->n_cand_uses);
- BITMAP_XFREE ((*ivs)->cands);
+ BITMAP_FREE ((*ivs)->cands);
free ((*ivs)->n_invariant_uses);
free (*ivs);
*ivs = NULL;
@@ -4546,11 +4669,32 @@ static void
rewrite_use_nonlinear_expr (struct ivopts_data *data,
struct iv_use *use, struct iv_cand *cand)
{
- tree comp = unshare_expr (get_computation (data->current_loop,
- use, cand));
+ tree comp;
tree op, stmts, tgt, ass;
block_stmt_iterator bsi, pbsi;
-
+
+ /* An important special case -- if we are asked to express value of
+ the original iv by itself, just exit; there is no need to
+ introduce a new computation (that might also need casting the
+ variable to unsigned and back). */
+ if (cand->pos == IP_ORIGINAL
+ && TREE_CODE (use->stmt) == MODIFY_EXPR
+ && TREE_OPERAND (use->stmt, 0) == cand->var_after)
+ {
+ op = TREE_OPERAND (use->stmt, 1);
+
+ /* Be a bit careful. In case variable is expressed in some
+ complicated way, rewrite it so that we may get rid of this
+ complicated expression. */
+ if ((TREE_CODE (op) == PLUS_EXPR
+ || TREE_CODE (op) == MINUS_EXPR)
+ && TREE_OPERAND (op, 0) == cand->var_before
+ && TREE_CODE (TREE_OPERAND (op, 1)) == INTEGER_CST)
+ return;
+ }
+
+ comp = unshare_expr (get_computation (data->current_loop,
+ use, cand));
switch (TREE_CODE (use->stmt))
{
case PHI_NODE:
@@ -4732,18 +4876,19 @@ rewrite_use_compare (struct ivopts_data *data,
block_stmt_iterator bsi = bsi_for_stmt (use->stmt);
enum tree_code compare;
- if (may_eliminate_iv (data->current_loop,
- use, cand, &compare, &bound))
+ if (may_eliminate_iv (data, use, cand, &compare, &bound))
{
+ tree var = var_at_stmt (data->current_loop, cand, use->stmt);
+ tree var_type = TREE_TYPE (var);
+
+ bound = fold_convert (var_type, bound);
op = force_gimple_operand (unshare_expr (bound), &stmts,
true, NULL_TREE);
if (stmts)
bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
- *use->op_p = build2 (compare, boolean_type_node,
- var_at_stmt (data->current_loop,
- cand, use->stmt), op);
+ *use->op_p = build2 (compare, boolean_type_node, var, op);
modify_stmt (use->stmt);
return;
}
@@ -4907,7 +5052,7 @@ rewrite_use_outer (struct ivopts_data *data,
{
if (!cand->iv)
{
- bool ok = may_replace_final_value (data->current_loop, use, &value);
+ bool ok = may_replace_final_value (data, use, &value);
gcc_assert (ok);
}
else
@@ -5028,6 +5173,8 @@ free_loop_data (struct ivopts_data *data)
unsigned i, j;
bitmap_iterator bi;
+ htab_empty (data->niters);
+
EXECUTE_IF_SET_IN_BITMAP (data->relevant, 0, i, bi)
{
struct version_info *info;
@@ -5048,10 +5195,10 @@ free_loop_data (struct ivopts_data *data)
struct iv_use *use = iv_use (data, i);
free (use->iv);
- BITMAP_XFREE (use->related_cands);
+ BITMAP_FREE (use->related_cands);
for (j = 0; j < use->n_map_members; j++)
if (use->cost_map[j].depends_on)
- BITMAP_XFREE (use->cost_map[j].depends_on);
+ BITMAP_FREE (use->cost_map[j].depends_on);
free (use->cost_map);
free (use);
}
@@ -5103,8 +5250,9 @@ tree_ssa_iv_optimize_finalize (struct loops *loops, struct ivopts_data *data)
free_loop_data (data);
free (data->version_info);
- BITMAP_XFREE (data->relevant);
- BITMAP_XFREE (data->important_candidates);
+ BITMAP_FREE (data->relevant);
+ BITMAP_FREE (data->important_candidates);
+ htab_delete (data->niters);
VARRAY_FREE (decl_rtl_to_reset);
VARRAY_FREE (data->iv_uses);
@@ -5172,8 +5320,6 @@ tree_ssa_iv_optimize_loop (struct ivopts_data *data, struct loop *loop)
/* Remove the ivs that are unused after rewriting. */
remove_unused_ivs (data);
- loop_commit_inserts ();
-
/* We have changed the structure of induction variables; it might happen
that definitions in the scev database refer to some of them that were
eliminated. */
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index fe9c43c5860..848abbc88d6 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -1,5 +1,5 @@
/* High-level loop manipulation functions.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -41,7 +41,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
It is expected that neither BASE nor STEP are shared with other expressions
(unless the sharing rules allow this). Use VAR as a base var_decl for it
(if NULL, a new temporary will be created). The increment will occur at
- INCR_POS (after it if AFTER is true, before it otherwise). The ssa versions
+ INCR_POS (after it if AFTER is true, before it otherwise). INCR_POS and
+ AFTER can be computed using standard_iv_increment_position. The ssa versions
of the variable before and after increment will be stored in VAR_BEFORE and
VAR_AFTER (unless they are NULL). */
@@ -158,10 +159,10 @@ add_exit_phis_var (tree var, bitmap livein, bitmap exits)
bitmap_clear_bit (livein, def_bb->index);
- def = BITMAP_XMALLOC ();
+ def = BITMAP_ALLOC (NULL);
bitmap_set_bit (def, def_bb->index);
compute_global_livein (livein, def);
- BITMAP_XFREE (def);
+ BITMAP_FREE (def);
EXECUTE_IF_AND_IN_BITMAP (exits, livein, 0, index, bi)
{
@@ -190,7 +191,7 @@ add_exit_phis (bitmap names_to_rename, bitmap *use_blocks, bitmap loop_exits)
static bitmap
get_loops_exits (void)
{
- bitmap exits = BITMAP_XMALLOC ();
+ bitmap exits = BITMAP_ALLOC (NULL);
basic_block bb;
edge e;
edge_iterator ei;
@@ -234,7 +235,7 @@ find_uses_to_rename_use (basic_block bb, tree use, bitmap *use_blocks)
return;
if (!use_blocks[ver])
- use_blocks[ver] = BITMAP_XMALLOC ();
+ use_blocks[ver] = BITMAP_ALLOC (NULL);
bitmap_set_bit (use_blocks[ver], bb->index);
if (!flow_bb_inside_loop_p (def_loop, bb))
@@ -329,10 +330,10 @@ rewrite_into_loop_closed_ssa (void)
add_exit_phis (names_to_rename, use_blocks, loop_exits);
for (i = 0; i < num_ssa_names; i++)
- BITMAP_XFREE (use_blocks[i]);
+ BITMAP_FREE (use_blocks[i]);
free (use_blocks);
- BITMAP_XFREE (loop_exits);
- BITMAP_XFREE (names_to_rename);
+ BITMAP_FREE (loop_exits);
+ BITMAP_FREE (names_to_rename);
/* Do the rewriting. */
rewrite_ssa_into_ssa ();
@@ -617,7 +618,7 @@ tree_duplicate_loop_to_header_edge (struct loop *loop, edge e,
definitions = marked_ssa_names ();
rename_variables (first_new_block, definitions);
unmark_all_for_rewrite ();
- BITMAP_XFREE (definitions);
+ BITMAP_FREE (definitions);
/* For some time we have the identical ssa names as results in multiple phi
nodes. When phi node is resized, it sets SSA_NAME_DEF_STMT of its result
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 6a429b73cac..21bfce89a2a 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1,5 +1,5 @@
/* Functions to determine/estimate number of iterations of a loop.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -80,44 +80,6 @@ nonzero_p (tree arg)
return (TREE_INT_CST_LOW (arg) != 0 || TREE_INT_CST_HIGH (arg) != 0);
}
-/* Returns number of zeros at the end of binary representation of X.
-
- ??? Use ffs if available? */
-
-static tree
-num_ending_zeros (tree x)
-{
- unsigned HOST_WIDE_INT fr, nfr;
- unsigned num, abits;
- tree type = TREE_TYPE (x);
-
- if (TREE_INT_CST_LOW (x) == 0)
- {
- num = HOST_BITS_PER_WIDE_INT;
- fr = TREE_INT_CST_HIGH (x);
- }
- else
- {
- num = 0;
- fr = TREE_INT_CST_LOW (x);
- }
-
- for (abits = HOST_BITS_PER_WIDE_INT / 2; abits; abits /= 2)
- {
- nfr = fr >> abits;
- if (nfr << abits == fr)
- {
- num += abits;
- fr = nfr;
- }
- }
-
- if (num > TYPE_PRECISION (type))
- num = TYPE_PRECISION (type);
-
- return build_int_cst_type (type, num);
-}
-
/* Returns inverse of X modulo 2^s, where MASK = 2^s-1. */
static tree
@@ -823,6 +785,75 @@ number_of_iterations_exit (struct loop *loop, edge exit,
return integer_onep (niter->assumptions);
}
+/* Try to determine the number of iterations of LOOP. If we succeed,
+ expression giving number of iterations is returned and *EXIT is
+ set to the edge from that the information is obtained. Otherwise
+ chrec_dont_know is returned. */
+
+tree
+find_loop_niter (struct loop *loop, edge *exit)
+{
+ unsigned n_exits, i;
+ edge *exits = get_loop_exit_edges (loop, &n_exits);
+ edge ex;
+ tree niter = NULL_TREE, aniter;
+ struct tree_niter_desc desc;
+
+ *exit = NULL;
+ for (i = 0; i < n_exits; i++)
+ {
+ ex = exits[i];
+ if (!just_once_each_iteration_p (loop, ex->src))
+ continue;
+
+ if (!number_of_iterations_exit (loop, ex, &desc))
+ continue;
+
+ if (nonzero_p (desc.may_be_zero))
+ {
+ /* We exit in the first iteration through this exit.
+ We won't find anything better. */
+ niter = build_int_cst_type (unsigned_type_node, 0);
+ *exit = ex;
+ break;
+ }
+
+ if (!zero_p (desc.may_be_zero))
+ continue;
+
+ aniter = desc.niter;
+
+ if (!niter)
+ {
+ /* Nothing recorded yet. */
+ niter = aniter;
+ *exit = ex;
+ continue;
+ }
+
+ /* Prefer constants, the lower the better. */
+ if (TREE_CODE (aniter) != INTEGER_CST)
+ continue;
+
+ if (TREE_CODE (niter) != INTEGER_CST)
+ {
+ niter = aniter;
+ *exit = ex;
+ continue;
+ }
+
+ if (tree_int_cst_lt (aniter, niter))
+ {
+ niter = aniter;
+ *exit = ex;
+ continue;
+ }
+ }
+ free (exits);
+
+ return niter ? niter : chrec_dont_know;
+}
+
/*
Analysis of a number of iterations of a loop by a brute-force evaluation.
@@ -1055,13 +1086,11 @@ find_loop_niter_by_eval (struct loop *loop, edge *exit)
continue;
aniter = loop_niter_by_eval (loop, ex);
- if (chrec_contains_undetermined (aniter)
- || TREE_CODE (aniter) != INTEGER_CST)
+ if (chrec_contains_undetermined (aniter))
continue;
if (niter
- && !nonzero_p (fold (build2 (LT_EXPR, boolean_type_node,
- aniter, niter))))
+ && !tree_int_cst_lt (aniter, niter))
continue;
niter = aniter;
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index e463d018024..e22dc5aa6ad 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1484,7 +1484,17 @@ get_call_expr_operands (tree stmt, tree expr)
tree op;
int call_flags = call_expr_flags (expr);
- if (!bitmap_empty_p (call_clobbered_vars))
+ /* If aliases have been computed already, add V_MAY_DEF or V_USE
+ operands for all the symbols that have been found to be
+ call-clobbered.
+
+ Note that if aliases have not been computed, the global effects
+ of calls will not be included in the SSA web. This is fine
+ because no optimizer should run before aliases have been
+ computed. By not bothering with virtual operands for CALL_EXPRs
+ we avoid adding superfluous virtual operands, which can be a
+ significant compile time sink (See PR 15855). */
+ if (aliases_computed_p && !bitmap_empty_p (call_clobbered_vars))
{
/* A 'pure' or a 'const' functions never call clobber anything.
A 'noreturn' function might, but since we don't return anyway
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index b9e1510e05d..66e2b223ce3 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1103,6 +1103,7 @@ clean (value_set_t set)
}
DEF_VEC_MALLOC_P (basic_block);
+sbitmap has_abnormal_preds;
/* Compute the ANTIC set for BLOCK.
@@ -1121,6 +1122,7 @@ DEF_VEC_MALLOC_P (basic_block);
static bool
compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge)
{
+ basic_block son;
bool changed = false;
value_set_t S, old, ANTIC_OUT;
value_set_node_t node;
@@ -1185,7 +1187,7 @@ compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge)
ANTIC_IN (block) = bitmap_set_subtract_from_value_set (EXP_GEN (block),
TMP_GEN (block),
true);
-
+
/* Then union in the ANTIC_OUT - TMP_GEN values,
to get ANTIC_OUT U EXP_GEN - TMP_GEN */
for (node = S->head; node; node = node->next)
@@ -1205,19 +1207,24 @@ compute_antic_aux (basic_block block, bool block_has_abnormal_pred_edge)
print_value_set (dump_file, S, "S", block->index);
}
+ for (son = first_dom_son (CDI_POST_DOMINATORS, block);
+ son;
+ son = next_dom_son (CDI_POST_DOMINATORS, son))
+ {
+ changed |= compute_antic_aux (son,
+ TEST_BIT (has_abnormal_preds, son->index));
+ }
return changed;
}
-/* Compute ANTIC sets. Iterates until fixpointed. */
+/* Compute ANTIC sets. */
static void
compute_antic (void)
{
- bool changed= true;
+ bool changed = true;
int num_iterations = 0;
- basic_block block, *worklist;
- size_t sp = 0;
- sbitmap has_abnormal_preds;
+ basic_block block;
/* If any predecessor edges are abnormal, we punt, so antic_in is empty.
We pre-build the map of blocks with incoming abnormal edges here. */
@@ -1229,11 +1236,11 @@ compute_antic (void)
edge e;
FOR_EACH_EDGE (e, ei, block->preds)
- if (e->flags & EDGE_ABNORMAL)
- {
- SET_BIT (has_abnormal_preds, block->index);
- break;
- }
+ if (e->flags & EDGE_ABNORMAL)
+ {
+ SET_BIT (has_abnormal_preds, block->index);
+ break;
+ }
/* While we are here, give empty ANTIC_IN sets to each block. */
ANTIC_IN (block) = set_new (true);
@@ -1241,41 +1248,13 @@ compute_antic (void)
/* At the exit block we anticipate nothing. */
ANTIC_IN (EXIT_BLOCK_PTR) = set_new (true);
- /* Allocate the worklist. */
- worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
-
- /* Loop until fixpointed. */
while (changed)
{
- basic_block son, bb;
-
- changed = false;
num_iterations++;
-
- /* Seed the algorithm by putting post-dominator children of
- the exit block in the worklist. */
- for (son = first_dom_son (CDI_POST_DOMINATORS, EXIT_BLOCK_PTR);
- son;
- son = next_dom_son (CDI_POST_DOMINATORS, son))
- worklist[sp++] = son;
-
- /* Now visit all blocks in a DFS of the post dominator tree. */
- while (sp)
- {
- bool bb_has_abnormal_pred;
-
- bb = worklist[--sp];
- bb_has_abnormal_pred = TEST_BIT (has_abnormal_preds, bb->index);
- changed |= compute_antic_aux (bb, bb_has_abnormal_pred);
-
- for (son = first_dom_son (CDI_POST_DOMINATORS, bb);
- son;
- son = next_dom_son (CDI_POST_DOMINATORS, son))
- worklist[sp++] = son;
- }
+ changed = false;
+ changed = compute_antic_aux (EXIT_BLOCK_PTR, false);
}
- free (worklist);
sbitmap_free (has_abnormal_preds);
if (dump_file && (dump_flags & TDF_STATS))
@@ -2191,7 +2170,7 @@ init_pre (bool do_fre)
AVAIL_OUT (bb) = bitmap_set_new ();
}
- need_eh_cleanup = BITMAP_XMALLOC ();
+ need_eh_cleanup = BITMAP_ALLOC (NULL);
}
@@ -2229,7 +2208,7 @@ fini_pre (bool do_fre)
cleanup_tree_cfg ();
}
- BITMAP_XFREE (need_eh_cleanup);
+ BITMAP_FREE (need_eh_cleanup);
/* Wipe out pointers to VALUE_HANDLEs. In the not terribly distant
future we will want them to be persistent though. */
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6ff3bba5bb2..6280dcecda5 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1422,7 +1422,7 @@ constraint_set_union (VEC(constraint_t) **to,
static void
solution_set_add (bitmap set, unsigned HOST_WIDE_INT offset)
{
- bitmap result = BITMAP_XMALLOC ();
+ bitmap result = BITMAP_ALLOC (NULL);
unsigned int i;
bitmap_iterator bi;
@@ -1450,7 +1450,7 @@ solution_set_add (bitmap set, unsigned HOST_WIDE_INT offset)
}
bitmap_copy (set, result);
- BITMAP_XFREE (result);
+ BITMAP_FREE (result);
}
/* Union solution sets TO and FROM, and add INC to each member of FROM in the
@@ -1465,11 +1465,11 @@ set_union_with_increment (bitmap to, bitmap from, unsigned HOST_WIDE_INT inc)
{
bitmap tmp;
bool res;
- tmp = BITMAP_XMALLOC ();
+ tmp = BITMAP_ALLOC (NULL);
bitmap_copy (tmp, from);
solution_set_add (tmp, inc);
res = bitmap_ior_into (to, tmp);
- BITMAP_XFREE (tmp);
+ BITMAP_FREE (tmp);
return res;
}
}
@@ -1911,7 +1911,7 @@ process_unification_queue (constraint_graph_t graph, struct scc_info *si,
bool update_changed)
{
size_t i = 0;
- bitmap tmp = BITMAP_XMALLOC ();
+ bitmap tmp = BITMAP_ALLOC (NULL);
bitmap_clear (tmp);
while (i != VARRAY_ACTIVE_SIZE (si->unification_queue))
{
@@ -1976,7 +1976,7 @@ process_unification_queue (constraint_graph_t graph, struct scc_info *si,
}
}
}
- BITMAP_XFREE (tmp);
+ BITMAP_FREE (tmp);
}
/* Information needed to compute the topographic ordering of a graph. */
@@ -2358,16 +2358,16 @@ perform_rountev_chandra (constraint_graph_t graph)
Corrolary: If all predecessors of i have the same
points-to set, then i has that same points-to set as
those predecessors. */
- tmp = BITMAP_XMALLOC ();
+ tmp = BITMAP_ALLOC (NULL);
bitmap_and_compl (tmp, get_varinfo (i)->solution,
get_varinfo (w)->solution);
if (!bitmap_empty_p (tmp))
{
okay_to_elim = false;
- BITMAP_XFREE (tmp);
+ BITMAP_FREE (tmp);
break;
}
- BITMAP_XFREE (tmp);
+ BITMAP_FREE (tmp);
}
/* See if the root is different than the original node.
If so, we've found an equivalence. */
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index de4006d2187..b39c260c273 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -341,7 +341,7 @@ verify_flow_insensitive_alias_info (void)
{
size_t i;
tree var;
- bitmap visited = BITMAP_XMALLOC ();
+ bitmap visited = BITMAP_ALLOC (NULL);
for (i = 0; i < num_referenced_vars; i++)
{
@@ -384,7 +384,7 @@ verify_flow_insensitive_alias_info (void)
}
}
- BITMAP_XFREE (visited);
+ BITMAP_FREE (visited);
return;
err:
@@ -480,7 +480,7 @@ verify_name_tags (void)
bitmap first, second;
VEC (tree) *name_tag_reps = NULL;
VEC (bitmap) *pt_vars_for_reps = NULL;
- bitmap type_aliases = BITMAP_XMALLOC ();
+ bitmap type_aliases = BITMAP_ALLOC (NULL);
/* First we compute the name tag representatives and their points-to sets. */
for (i = 0; i < num_ssa_names; i++)
@@ -604,7 +604,7 @@ verify_ssa (void)
ssa_op_iter iter;
tree op;
enum dom_state orig_dom_state = dom_computed[CDI_DOMINATORS];
- bitmap names_defined_in_bb = BITMAP_XMALLOC ();
+ bitmap names_defined_in_bb = BITMAP_ALLOC (NULL);
timevar_push (TV_TREE_SSA_VERIFY);
@@ -702,7 +702,7 @@ verify_ssa (void)
else
dom_computed[CDI_DOMINATORS] = orig_dom_state;
- BITMAP_XFREE (names_defined_in_bb);
+ BITMAP_FREE (names_defined_in_bb);
timevar_pop (TV_TREE_SSA_VERIFY);
return;
@@ -717,12 +717,13 @@ void
init_tree_ssa (void)
{
VARRAY_TREE_INIT (referenced_vars, 20, "referenced_vars");
- call_clobbered_vars = BITMAP_XMALLOC ();
- addressable_vars = BITMAP_XMALLOC ();
+ call_clobbered_vars = BITMAP_ALLOC (NULL);
+ addressable_vars = BITMAP_ALLOC (NULL);
init_ssa_operands ();
init_ssanames ();
init_phinodes ();
global_var = NULL_TREE;
+ aliases_computed_p = false;
}
@@ -762,11 +763,12 @@ delete_tree_ssa (void)
fini_ssa_operands ();
global_var = NULL_TREE;
- BITMAP_XFREE (call_clobbered_vars);
+ BITMAP_FREE (call_clobbered_vars);
call_clobbered_vars = NULL;
- BITMAP_XFREE (addressable_vars);
+ BITMAP_FREE (addressable_vars);
addressable_vars = NULL;
modified_noreturn_calls = NULL;
+ aliases_computed_p = false;
}
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index db6717cf3ae..38aab0bc295 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -1,5 +1,5 @@
/* Generic routines for manipulating SSA_NAME expressions
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -118,7 +118,7 @@ unmark_all_for_rewrite (void)
bitmap
marked_ssa_names (void)
{
- bitmap ret = BITMAP_XMALLOC ();
+ bitmap ret = BITMAP_ALLOC (NULL);
bitmap_copy (ret, ssa_names_to_rewrite);
@@ -138,7 +138,7 @@ init_ssanames (void)
large. */
VARRAY_PUSH_TREE (ssa_names, NULL_TREE);
free_ssanames = NULL;
- ssa_names_to_rewrite = BITMAP_XMALLOC ();
+ ssa_names_to_rewrite = BITMAP_ALLOC (NULL);
}
/* Finalize management of SSA_NAMEs. */
@@ -146,7 +146,7 @@ init_ssanames (void)
void
fini_ssanames (void)
{
- BITMAP_XFREE (ssa_names_to_rewrite);
+ BITMAP_FREE (ssa_names_to_rewrite);
ggc_free (ssa_names);
ssa_names = NULL;
free_ssanames = NULL;
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 758614bf09a..8c447428780 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -128,7 +128,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "tree.h"
#include "target.h"
-
#include "rtl.h"
#include "basic-block.h"
#include "diagnostic.h"
@@ -146,134 +145,37 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "input.h"
#include "tree-vectorizer.h"
#include "tree-pass.h"
-#include "langhooks.h"
-
/*************************************************************************
Simple Loop Peeling Utilities
*************************************************************************/
-
-/* Entry point for peeling of simple loops.
- Peel the first/last iterations of a loop.
- It can be used outside of the vectorizer for loops that are simple enough
- (see function documentation). In the vectorizer it is used to peel the
- last few iterations when the loop bound is unknown or does not evenly
- divide by the vectorization factor, and to peel the first few iterations
- to force the alignment of data references in the loop. */
-struct loop *slpeel_tree_peel_loop_to_edge
- (struct loop *, struct loops *, edge, tree, tree, bool);
static struct loop *slpeel_tree_duplicate_loop_to_edge_cfg
(struct loop *, struct loops *, edge);
static void slpeel_update_phis_for_duplicate_loop
(struct loop *, struct loop *, bool after);
static void slpeel_update_phi_nodes_for_guard (edge, struct loop *, bool, bool);
-static void slpeel_make_loop_iterate_ntimes (struct loop *, tree);
static edge slpeel_add_loop_guard (basic_block, tree, basic_block, basic_block);
-static bool slpeel_can_duplicate_loop_p (struct loop *, edge);
+
static void allocate_new_names (bitmap);
static void rename_use_op (use_operand_p);
static void rename_def_op (def_operand_p, tree);
static void rename_variables_in_bb (basic_block);
static void free_new_names (bitmap);
static void rename_variables_in_loop (struct loop *);
-#ifdef ENABLE_CHECKING
-static void slpeel_verify_cfg_after_peeling (struct loop *, struct loop *);
-#endif
-static LOC find_loop_location (struct loop *);
-
/*************************************************************************
- Vectorization Utilities.
+ General Vectorization Utilities
*************************************************************************/
+static void vect_set_dump_settings (void);
+static bool need_imm_uses_for (tree);
-/* Main analysis functions. */
-static loop_vec_info vect_analyze_loop (struct loop *);
-static loop_vec_info vect_analyze_loop_form (struct loop *);
-static bool vect_analyze_data_refs (loop_vec_info);
-static bool vect_mark_stmts_to_be_vectorized (loop_vec_info);
-static bool vect_analyze_scalar_cycles (loop_vec_info);
-static bool vect_analyze_data_ref_accesses (loop_vec_info);
-static bool vect_analyze_data_ref_dependence
- (struct data_reference *, struct data_reference *, loop_vec_info);
-static bool vect_analyze_data_ref_dependences (loop_vec_info);
-static bool vect_analyze_data_refs_alignment (loop_vec_info);
-static bool vect_compute_data_refs_alignment (loop_vec_info);
-static bool vect_analyze_operations (loop_vec_info);
-
-/* Main code transformation functions. */
-static void vect_transform_loop (loop_vec_info, struct loops *);
-static bool vect_transform_stmt (tree, block_stmt_iterator *);
-static bool vectorizable_load (tree, block_stmt_iterator *, tree *);
-static bool vectorizable_store (tree, block_stmt_iterator *, tree *);
-static bool vectorizable_operation (tree, block_stmt_iterator *, tree *);
-static bool vectorizable_assignment (tree, block_stmt_iterator *, tree *);
-static enum dr_alignment_support vect_supportable_dr_alignment
- (struct data_reference *);
-static void vect_align_data_ref (tree);
-static void vect_enhance_data_refs_alignment (loop_vec_info);
-
-/* Utility functions for the analyses. */
-static bool vect_is_simple_use (tree , loop_vec_info, tree *);
-static bool exist_non_indexing_operands_for_use_p (tree, tree);
-static bool vect_is_simple_iv_evolution (unsigned, tree, tree *, tree *, bool);
-static void vect_mark_relevant (varray_type *, tree);
-static bool vect_stmt_relevant_p (tree, loop_vec_info);
-static tree vect_get_loop_niters (struct loop *, tree *);
-static bool vect_compute_data_ref_alignment (struct data_reference *);
-static bool vect_analyze_data_ref_access (struct data_reference *);
-static bool vect_can_force_dr_alignment_p (tree, unsigned int);
-static struct data_reference * vect_analyze_pointer_ref_access
- (tree, tree, bool);
-static bool vect_can_advance_ivs_p (loop_vec_info);
-static tree vect_get_base_and_offset (struct data_reference *, tree, tree,
- loop_vec_info, tree *, tree *, tree *,
- bool*);
-static struct data_reference * vect_analyze_pointer_ref_access
- (tree, tree, bool);
-static tree vect_get_ptr_offset (tree, tree, tree *);
-static tree vect_get_memtag_and_dr
- (tree, tree, bool, loop_vec_info, tree, struct data_reference **);
-static bool vect_analyze_offset_expr (tree, struct loop *, tree, tree *,
- tree *, tree *);
-static tree vect_strip_conversion (tree);
-
-/* Utility functions for the code transformation. */
-static tree vect_create_destination_var (tree, tree);
-static tree vect_create_data_ref_ptr
- (tree, block_stmt_iterator *, tree, tree *, bool);
-static tree vect_create_index_for_vector_ref (loop_vec_info);
-static tree vect_create_addr_base_for_vector_ref (tree, tree *, tree);
-static tree get_vectype_for_scalar_type (tree);
-static tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
-static tree vect_get_vec_def_for_operand (tree, tree);
-static tree vect_init_vector (tree, tree);
-static void vect_finish_stmt_generation
- (tree stmt, tree vec_stmt, block_stmt_iterator *bsi);
-
-/* Utility function dealing with loop peeling (not peeling itself). */
-static void vect_generate_tmps_on_preheader
- (loop_vec_info, tree *, tree *, tree *);
-static tree vect_build_loop_niters (loop_vec_info);
-static void vect_update_ivs_after_vectorizer (loop_vec_info, tree, edge);
-static tree vect_gen_niters_for_prolog_loop (loop_vec_info, tree);
-static void vect_update_inits_of_dr (struct data_reference *, tree niters);
-static void vect_update_inits_of_drs (loop_vec_info, tree);
-static void vect_do_peeling_for_alignment (loop_vec_info, struct loops *);
-static void vect_do_peeling_for_loop_bound
- (loop_vec_info, tree *, struct loops *);
-
-/* Utilities for creation and deletion of vec_info structs. */
-loop_vec_info new_loop_vec_info (struct loop *loop);
-void destroy_loop_vec_info (loop_vec_info);
-stmt_vec_info new_stmt_vec_info (tree, loop_vec_info);
+/* vect_dump will be set to stderr or dump_file if exist. */
+FILE *vect_dump;
-/*************************************************************************
- Vectorization Debug Information.
- *************************************************************************/
+/* vect_verbosity_level set to an invalid value
+ to mark that it's uninitialized. */
+enum verbosity_levels vect_verbosity_level = MAX_VERBOSITY_LEVEL;
-/* Utilities for output formatting. */
-static bool vect_debug_stats (LOC);
-static bool vect_debug_details (LOC);
/*************************************************************************
@@ -660,7 +562,7 @@ slpeel_update_phi_nodes_for_guard (edge guard_edge,
Assumption: the exit-condition of LOOP is the last stmt in the loop. */
-static void
+void
slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
{
tree indx_before_incr, indx_after_incr, cond_stmt, cond;
@@ -708,8 +610,13 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
bsi_remove (&loop_cond_bsi);
loop_loc = find_loop_location (loop);
- if (vect_debug_details (loop_loc))
- print_generic_expr (dump_file, cond_stmt, TDF_SLIM);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ if (loop_loc != UNKNOWN_LOC)
+ fprintf (dump_file, "\nloop at %s:%d: ",
+ LOC_FILE (loop_loc), LOC_LINE (loop_loc));
+ print_generic_expr (dump_file, cond_stmt, TDF_SLIM);
+ }
loop->nb_iterations = niters;
}
@@ -862,7 +769,7 @@ slpeel_add_loop_guard (basic_block guard_bb, tree cond, basic_block exit_bb,
(5) E is the entry/exit edge of LOOP.
*/
-static bool
+bool
slpeel_can_duplicate_loop_p (struct loop *loop, edge e)
{
edge exit_e = loop->exit_edges [0];
@@ -890,7 +797,7 @@ slpeel_can_duplicate_loop_p (struct loop *loop, edge e)
}
#ifdef ENABLE_CHECKING
-static void
+void
slpeel_verify_cfg_after_peeling (struct loop *first_loop,
struct loop *second_loop)
{
@@ -1003,9 +910,13 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loops *loops,
if (!(new_loop = slpeel_tree_duplicate_loop_to_edge_cfg (loop, loops, e)))
{
loop_loc = find_loop_location (loop);
- if (vect_debug_stats (loop_loc)
- || vect_debug_details (loop_loc))
- fprintf (dump_file, "tree_duplicate_loop_to_edge_cfg failed.\n");
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ if (loop_loc != UNKNOWN_LOC)
+ fprintf (dump_file, "\n%s:%d: note: ",
+ LOC_FILE (loop_loc), LOC_LINE (loop_loc));
+ fprintf (dump_file, "tree_duplicate_loop_to_edge_cfg failed.\n");
+ }
return NULL;
}
@@ -1112,7 +1023,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loops *loops,
slpeel_make_loop_iterate_ntimes (first_loop, first_niters);
free_new_names (definitions);
- BITMAP_XFREE (definitions);
+ BITMAP_FREE (definitions);
unmark_all_for_rewrite ();
return new_loop;
@@ -1125,7 +1036,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loops *loops,
location is calculated.
Return the loop location if succeed and NULL if not. */
-static LOC
+LOC
find_loop_location (struct loop *loop)
{
tree node = NULL_TREE;
@@ -1160,8 +1071,84 @@ find_loop_location (struct loop *loop)
}
-
-/* Here the proper Vectorizer starts. */
+/*************************************************************************
+ Vectorization Debug Information.
+ *************************************************************************/
+
+/* Function vect_set_verbosity_level.
+
+ Called from toplev.c upon detection of the
+ -ftree-vectorizer-verbose=N option. */
+
+void
+vect_set_verbosity_level (const char *val)
+{
+ unsigned int vl;
+
+ vl = atoi (val);
+ if (vl < MAX_VERBOSITY_LEVEL)
+ vect_verbosity_level = vl;
+ else
+ vect_verbosity_level = MAX_VERBOSITY_LEVEL - 1;
+}
+
+
+/* Function vect_set_dump_settings.
+
+ Fix the verbosity level of the vectorizer if the
+ requested level was not set explicitly using the flag
+ -ftree-vectorizer-verbose=N.
+ Decide where to print the debugging information (dump_file/stderr).
+ If the user defined the verbosity level, but there is no dump file,
+ print to stderr, otherwise print to the dump file. */
+
+static void
+vect_set_dump_settings (void)
+{
+ vect_dump = dump_file;
+
+ /* Check if the verbosity level was defined by the user: */
+ if (vect_verbosity_level != MAX_VERBOSITY_LEVEL)
+ {
+ /* If there is no dump file, print to stderr. */
+ if (!dump_file)
+ vect_dump = stderr;
+ return;
+ }
+
+ /* User didn't specify verbosity level: */
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ vect_verbosity_level = REPORT_DETAILS;
+ else if (dump_file && (dump_flags & TDF_STATS))
+ vect_verbosity_level = REPORT_UNVECTORIZED_LOOPS;
+ else
+ vect_verbosity_level = REPORT_NONE;
+
+ gcc_assert (dump_file || vect_verbosity_level == REPORT_NONE);
+}
+
+
+/* Function debug_loop_details.
+
+ For vectorization debug dumps. */
+
+bool
+vect_print_dump_info (enum verbosity_levels vl, LOC loc)
+{
+ if (vl > vect_verbosity_level)
+ return false;
+
+ if (loc == UNKNOWN_LOC)
+ fprintf (vect_dump, "\n%s:%d: note: ",
+ DECL_SOURCE_FILE (current_function_decl),
+ DECL_SOURCE_LINE (current_function_decl));
+ else
+ fprintf (vect_dump, "\n%s:%d: note: ", LOC_FILE (loc), LOC_LINE (loc));
+
+
+ return true;
+}
+
/*************************************************************************
Vectorization Utilities.
@@ -1185,7 +1172,7 @@ new_stmt_vec_info (tree stmt, loop_vec_info loop_vinfo)
STMT_VINFO_VEC_STMT (res) = NULL;
STMT_VINFO_DATA_REF (res) = NULL;
STMT_VINFO_MEMTAG (res) = NULL;
- STMT_VINFO_VECT_DR_BASE (res) = NULL;
+ STMT_VINFO_VECT_DR_BASE_ADDRESS (res) = NULL;
STMT_VINFO_VECT_INIT_OFFSET (res) = NULL_TREE;
STMT_VINFO_VECT_STEP (res) = NULL_TREE;
STMT_VINFO_VECT_BASE_ALIGNED_P (res) = false;
@@ -1288,65 +1275,11 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo)
}
-/* Function debug_loop_stats.
-
- For vectorization statistics dumps. */
-
-static bool
-vect_debug_stats (LOC loc)
-{
- if (!dump_file || !(dump_flags & TDF_STATS))
- return false;
-
- if (loc == UNKNOWN_LOC)
- fprintf (dump_file, "\n");
- else
- fprintf (dump_file, "\nloop at %s:%d: ",
- LOC_FILE (loc), LOC_LINE (loc));
-
- return true;
-}
-
-
-/* Function debug_loop_details.
-
- For vectorization debug dumps. */
-
-static bool
-vect_debug_details (LOC loc)
-{
- if (!dump_file || !(dump_flags & TDF_DETAILS))
- return false;
-
- if (loc == UNKNOWN_LOC)
- fprintf (dump_file, "\n");
- else
- fprintf (dump_file, "\nloop at %s:%d: ",
- LOC_FILE (loc), LOC_LINE (loc));
-
- return true;
-}
-
-
-/* Function vect_get_ptr_offset
-
- Compute the OFFSET modulo vector-type alignment of pointer REF in bits. */
-
-static tree
-vect_get_ptr_offset (tree ref ATTRIBUTE_UNUSED,
- tree vectype ATTRIBUTE_UNUSED,
- tree *offset ATTRIBUTE_UNUSED)
-{
- /* TODO: Use alignment information. */
- return NULL_TREE;
-}
-
-
/* Function vect_strip_conversions
Strip conversions that don't narrow the mode. */
-static tree
+tree
vect_strip_conversion (tree expr)
{
tree to, ti, oprnd0;
@@ -1368,410 +1301,12 @@ vect_strip_conversion (tree expr)
}
-/* Function vect_analyze_offset_expr
-
- Given an offset expression EXPR received from get_inner_reference, analyze
- it and create an expression for INITIAL_OFFSET by substituting the variables
- of EXPR with initial_condition of the corresponding access_fn in the loop.
- E.g.,
- for i
- for (j = 3; j < N; j++)
- a[j].b[i][j] = 0;
-
- For a[j].b[i][j], EXPR will be 'i * C_i + j * C_j + C'. 'i' cannot be
- substituted, since its access_fn in the inner loop is i. 'j' will be
- substituted with 3. An INITIAL_OFFSET will be 'i * C_i + C`', where
- C` = 3 * C_j + C.
-
- Compute MISALIGN (the misalignment of the data reference initial access from
- its base) if possible. Misalignment can be calculated only if all the
- variables can be substituted with constants, or if a variable is multiplied
- by a multiple of VECTYPE_ALIGNMENT. In the above example, since 'i' cannot
- be substituted, MISALIGN will be NULL_TREE in case that C_i is not a multiple
- of VECTYPE_ALIGNMENT, and C` otherwise. (We perform MISALIGN modulo
- VECTYPE_ALIGNMENT computation in the caller of this function).
-
- STEP is an evolution of the data reference in this loop in bytes.
- In the above example, STEP is C_j.
-
- Return FALSE, if the analysis fails, e.g., there is no access_fn for a
- variable. In this case, all the outputs (INITIAL_OFFSET, MISALIGN and STEP)
- are NULL_TREEs. Otherwise, return TRUE.
-
-*/
-
-static bool
-vect_analyze_offset_expr (tree expr,
- struct loop *loop,
- tree vectype_alignment,
- tree *initial_offset,
- tree *misalign,
- tree *step)
-{
- tree oprnd0;
- tree oprnd1;
- tree left_offset = ssize_int (0);
- tree right_offset = ssize_int (0);
- tree left_misalign = ssize_int (0);
- tree right_misalign = ssize_int (0);
- tree left_step = ssize_int (0);
- tree right_step = ssize_int (0);
- enum tree_code code;
- tree init, evolution;
-
- *step = NULL_TREE;
- *misalign = NULL_TREE;
- *initial_offset = NULL_TREE;
-
- /* Strip conversions that don't narrow the mode. */
- expr = vect_strip_conversion (expr);
- if (!expr)
- return false;
-
- /* Stop conditions:
- 1. Constant. */
- if (TREE_CODE (expr) == INTEGER_CST)
- {
- *initial_offset = fold_convert (ssizetype, expr);
- *misalign = fold_convert (ssizetype, expr);
- *step = ssize_int (0);
- return true;
- }
-
- /* 2. Variable. Try to substitute with initial_condition of the corresponding
- access_fn in the current loop. */
- if (SSA_VAR_P (expr))
- {
- tree access_fn = analyze_scalar_evolution (loop, expr);
-
- if (access_fn == chrec_dont_know)
- /* No access_fn. */
- return false;
-
- init = initial_condition_in_loop_num (access_fn, loop->num);
- if (init == expr && !expr_invariant_in_loop_p (loop, init))
- /* Not enough information: may be not loop invariant.
- E.g., for a[b[i]], we get a[D], where D=b[i]. EXPR is D, its
- initial_condition is D, but it depends on i - loop's induction
- variable. */
- return false;
-
- evolution = evolution_part_in_loop_num (access_fn, loop->num);
- if (evolution && TREE_CODE (evolution) != INTEGER_CST)
- /* Evolution is not constant. */
- return false;
-
- if (TREE_CODE (init) == INTEGER_CST)
- *misalign = fold_convert (ssizetype, init);
- else
- /* Not constant, misalignment cannot be calculated. */
- *misalign = NULL_TREE;
-
- *initial_offset = fold_convert (ssizetype, init);
-
- *step = evolution ? fold_convert (ssizetype, evolution) : ssize_int (0);
- return true;
- }
-
- /* Recursive computation. */
- if (!BINARY_CLASS_P (expr))
- {
- /* We expect to get binary expressions (PLUS/MINUS and MULT). */
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "Not binary expression ");
- print_generic_expr (dump_file, expr, TDF_SLIM);
- }
- return false;
- }
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
-
- if (!vect_analyze_offset_expr (oprnd0, loop, vectype_alignment, &left_offset,
- &left_misalign, &left_step)
- || !vect_analyze_offset_expr (oprnd1, loop, vectype_alignment,
- &right_offset, &right_misalign, &right_step))
- return false;
-
- /* The type of the operation: plus, minus or mult. */
- code = TREE_CODE (expr);
- switch (code)
- {
- case MULT_EXPR:
- if (TREE_CODE (right_offset) != INTEGER_CST)
- /* RIGHT_OFFSET can be not constant. For example, for arrays of variable
- sized types.
- FORNOW: We don't support such cases. */
- return false;
-
- /* Strip conversions that don't narrow the mode. */
- left_offset = vect_strip_conversion (left_offset);
- if (!left_offset)
- return false;
- /* Misalignment computation. */
- if (SSA_VAR_P (left_offset))
- {
- /* If the left side contains variables that can't be substituted with
- constants, we check if the right side is a multiple of ALIGNMENT.
- */
- if (integer_zerop (size_binop (TRUNC_MOD_EXPR, right_offset,
- fold_convert (ssizetype, vectype_alignment))))
- *misalign = ssize_int (0);
- else
- /* If the remainder is not zero or the right side isn't constant,
- we can't compute misalignment. */
- *misalign = NULL_TREE;
- }
- else
- {
- /* The left operand was successfully substituted with constant. */
- if (left_misalign)
- /* In case of EXPR '(i * C1 + j) * C2', LEFT_MISALIGN is
- NULL_TREE. */
- *misalign = size_binop (code, left_misalign, right_misalign);
- else
- *misalign = NULL_TREE;
- }
-
- /* Step calculation. */
- /* Multiply the step by the right operand. */
- *step = size_binop (MULT_EXPR, left_step, right_offset);
- break;
-
- case PLUS_EXPR:
- case MINUS_EXPR:
- /* Combine the recursive calculations for step and misalignment. */
- *step = size_binop (code, left_step, right_step);
-
- if (left_misalign && right_misalign)
- *misalign = size_binop (code, left_misalign, right_misalign);
- else
- *misalign = NULL_TREE;
-
- break;
-
- default:
- gcc_unreachable ();
- }
-
- /* Compute offset. */
- *initial_offset = fold_convert (ssizetype,
- fold (build2 (code, TREE_TYPE (left_offset),
- left_offset,
- right_offset)));
- return true;
-}
-
-
-/* Function vect_get_base_and_offset
-
- Return the BASE of the data reference EXPR.
- If VECTYPE is given, also compute the INITIAL_OFFSET from BASE, MISALIGN and
- STEP.
- E.g., for EXPR a.b[i] + 4B, BASE is a, and OFFSET is the overall offset
- 'a.b[i] + 4B' from a (can be an expression), MISALIGN is an OFFSET
- instantiated with initial_conditions of access_functions of variables,
- modulo alignment, and STEP is the evolution of the DR_REF in this loop.
-
- Function get_inner_reference is used for the above in case of ARRAY_REF and
- COMPONENT_REF.
-
- Input:
- EXPR - the memory reference that is being analyzed
- DR - the data_reference struct of the _original_ memory reference
- (Note: DR_REF (DR) is not necessarily EXPR)
- VECTYPE - the type that defines the alignment (i.e, we compute
- alignment relative to TYPE_ALIGN(VECTYPE))
-
- Output:
- BASE (returned value) - the base of the data reference EXPR.
- E.g, if EXPR is a.b[k].c[i][j] the returned
- base is a.
- INITIAL_OFFSET - initial offset of EXPR from BASE (an expression)
- MISALIGN - offset of EXPR from BASE in bytes (a constant) or NULL_TREE if the
- computation is impossible
- STEP - evolution of the DR_REF in the loop
- BASE_ALIGNED_P - indicates if BASE is aligned
-
- If something unexpected is encountered (an unsupported form of data-ref),
- then NULL_TREE is returned. */
-
-static tree
-vect_get_base_and_offset (struct data_reference *dr,
- tree expr,
- tree vectype,
- loop_vec_info loop_vinfo,
- tree *initial_offset,
- tree *misalign,
- tree *step,
- bool *base_aligned_p)
-{
- tree this_offset = ssize_int (0);
- tree this_misalign = ssize_int (0);
- tree this_step = ssize_int (0);
- tree base = NULL_TREE;
- tree next_ref;
- tree oprnd0, oprnd1;
- enum tree_code code = TREE_CODE (expr);
- HOST_WIDE_INT pbitsize;
- HOST_WIDE_INT pbitpos;
- tree poffset;
- enum machine_mode pmode;
- int punsignedp, pvolatilep;
- tree bit_pos_in_bytes;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
-
- *base_aligned_p = false;
-
- switch (code)
- {
- /* These cases end the recursion: */
- case VAR_DECL:
- case PARM_DECL:
- *initial_offset = ssize_int (0);
- *step = ssize_int (0);
- *misalign = ssize_int (0);
- if (DECL_ALIGN (expr) >= TYPE_ALIGN (vectype))
- *base_aligned_p = true;
- return expr;
-
- case SSA_NAME:
- if (TREE_CODE (TREE_TYPE (expr)) != POINTER_TYPE)
- return NULL_TREE;
-
- if (TYPE_ALIGN (TREE_TYPE (TREE_TYPE (expr))) < TYPE_ALIGN (vectype))
- {
- base = vect_get_ptr_offset (expr, vectype, misalign);
- if (base)
- *base_aligned_p = true;
- }
- else
- {
- *base_aligned_p = true;
- *misalign = ssize_int (0);
- }
- *initial_offset = ssize_int (0);
- *step = ssize_int (0);
- return expr;
-
- case INTEGER_CST:
- *initial_offset = fold_convert (ssizetype, expr);
- *misalign = fold_convert (ssizetype, expr);
- *step = ssize_int (0);
- return expr;
-
- /* These cases continue the recursion: */
- case ADDR_EXPR:
- oprnd0 = TREE_OPERAND (expr, 0);
- next_ref = oprnd0;
- break;
-
- case INDIRECT_REF:
- oprnd0 = TREE_OPERAND (expr, 0);
- next_ref = oprnd0;
- break;
-
- case PLUS_EXPR:
- case MINUS_EXPR:
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
-
- /* In case we have a PLUS_EXPR of the form
- (oprnd0 + oprnd1), we assume that only oprnd0 determines the base.
- This is verified in vect_get_memtag_and_dr. */
- base = vect_get_base_and_offset (dr, oprnd1, vectype, loop_vinfo,
- &this_offset, &this_misalign,
- &this_step, base_aligned_p);
- /* Offset was already computed in vect_analyze_pointer_ref_access. */
- this_offset = ssize_int (0);
-
- if (!base)
- this_misalign = NULL_TREE;
- else
- this_misalign = size_binop (TREE_CODE (expr), ssize_int (0),
- this_misalign);
- next_ref = oprnd0;
- break;
-
- default:
- if (!handled_component_p (expr))
- /* Unsupported expression. */
- return NULL_TREE;
-
- /* Find the base and the offset from it. */
- next_ref = get_inner_reference (expr, &pbitsize, &pbitpos, &poffset,
- &pmode, &punsignedp, &pvolatilep, false);
- if (!next_ref)
- return NULL_TREE;
-
- if (poffset
- && !vect_analyze_offset_expr (poffset, loop, TYPE_SIZE_UNIT (vectype),
- &this_offset, &this_misalign,
- &this_step))
- {
- /* Failed to compute offset or step. */
- *step = NULL_TREE;
- *initial_offset = NULL_TREE;
- *misalign = NULL_TREE;
- return NULL_TREE;
- }
-
- /* Add bit position to OFFSET and MISALIGN. */
-
- bit_pos_in_bytes = ssize_int (pbitpos/BITS_PER_UNIT);
- /* Check that there is no remainder in bits. */
- if (pbitpos%BITS_PER_UNIT)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "bit offset alignment.");
- return NULL_TREE;
- }
- this_offset = size_binop (PLUS_EXPR, bit_pos_in_bytes,
- fold_convert (ssizetype, this_offset));
- if (this_misalign)
- this_misalign = size_binop (PLUS_EXPR, this_misalign, bit_pos_in_bytes);
-
- /* Continue the recursion to refine the base (get_inner_reference returns
- &a for &a[i], and not a). */
- break;
- }
-
- base = vect_get_base_and_offset (dr, next_ref, vectype, loop_vinfo,
- initial_offset, misalign, step,
- base_aligned_p);
- if (base)
- {
- /* Combine the results. */
- if (this_misalign && *misalign)
- *misalign = size_binop (PLUS_EXPR, *misalign, this_misalign);
- else
- *misalign = NULL_TREE;
-
- *step = size_binop (PLUS_EXPR, *step, this_step);
-
- *initial_offset = size_binop (PLUS_EXPR, *initial_offset, this_offset);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- print_generic_expr (dump_file, expr, TDF_SLIM);
- fprintf (dump_file, "\n --> total offset for ref: ");
- print_generic_expr (dump_file, *initial_offset, TDF_SLIM);
- fprintf (dump_file, "\n --> total misalign for ref: ");
- print_generic_expr (dump_file, *misalign, TDF_SLIM);
- fprintf (dump_file, "\n --> total step for ref: ");
- print_generic_expr (dump_file, *step, TDF_SLIM);
- }
- }
- return base;
-}
-
-
/* Function vect_force_dr_alignment_p.
Returns whether the alignment of a DECL can be forced to be aligned
on ALIGNMENT bit boundary. */
-static bool
+bool
vect_can_force_dr_alignment_p (tree decl, unsigned int alignment)
{
if (TREE_CODE (decl) != VAR_DECL)
@@ -1795,199 +1330,12 @@ vect_can_force_dr_alignment_p (tree decl, unsigned int alignment)
}
-/* Function vect_get_new_vect_var.
-
- Returns a name for a new variable. The current naming scheme appends the
- prefix "vect_" or "vect_p" (depending on the value of VAR_KIND) to
- the name of vectorizer generated variables, and appends that to NAME if
- provided. */
-
-static tree
-vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *name)
-{
- const char *prefix;
- int prefix_len;
- tree new_vect_var;
-
- if (var_kind == vect_simple_var)
- prefix = "vect_";
- else
- prefix = "vect_p";
-
- prefix_len = strlen (prefix);
-
- if (name)
- new_vect_var = create_tmp_var (type, concat (prefix, name, NULL));
- else
- new_vect_var = create_tmp_var (type, prefix);
-
- return new_vect_var;
-}
-
-
-/* Function vect_create_index_for_vector_ref.
-
- Create (and return) an index variable, along with it's update chain in the
- loop. This variable will be used to access a memory location in a vector
- operation.
-
- Input:
- LOOP: The loop being vectorized.
- BSI: The block_stmt_iterator where STMT is. Any new stmts created by this
- function can be added here, or in the loop pre-header.
-
- Output:
- Return an index that will be used to index a vector array. It is expected
- that a pointer to the first vector will be used as the base address for the
- indexed reference.
-
- FORNOW: we are not trying to be efficient, just creating a new index each
- time from scratch. At this time all vector references could use the same
- index.
-
- TODO: create only one index to be used by all vector references. Record
- the index in the LOOP_VINFO the first time this procedure is called and
- return it on subsequent calls. The increment of this index must be placed
- just before the conditional expression that ends the single block loop. */
-
-static tree
-vect_create_index_for_vector_ref (loop_vec_info loop_vinfo)
-{
- tree init, step;
- block_stmt_iterator incr_bsi;
- bool insert_after;
- tree indx_before_incr, indx_after_incr;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree incr;
-
- /* It is assumed that the base pointer used for vectorized access contains
- the address of the first vector. Therefore the index used for vectorized
- access must be initialized to zero and incremented by 1. */
-
- init = integer_zero_node;
- step = integer_one_node;
-
- standard_iv_increment_position (loop, &incr_bsi, &insert_after);
- create_iv (init, step, NULL_TREE, loop, &incr_bsi, insert_after,
- &indx_before_incr, &indx_after_incr);
- incr = bsi_stmt (incr_bsi);
- get_stmt_operands (incr);
- set_stmt_info (stmt_ann (incr), new_stmt_vec_info (incr, loop_vinfo));
-
- return indx_before_incr;
-}
-
-
-/* Function vect_create_addr_base_for_vector_ref.
-
- Create an expression that computes the address of the first memory location
- that will be accessed for a data reference.
-
- Input:
- STMT: The statement containing the data reference.
- NEW_STMT_LIST: Must be initialized to NULL_TREE or a statement list.
- OFFSET: Optional. If supplied, it is be added to the initial address.
-
- Output:
- 1. Return an SSA_NAME whose value is the address of the memory location of
- the first vector of the data reference.
- 2. If new_stmt_list is not NULL_TREE after return then the caller must insert
- these statement(s) which define the returned SSA_NAME.
-
- FORNOW: We are only handling array accesses with step 1. */
-
-static tree
-vect_create_addr_base_for_vector_ref (tree stmt,
- tree *new_stmt_list,
- tree offset)
-{
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
- tree data_ref_base = unshare_expr (STMT_VINFO_VECT_DR_BASE (stmt_info));
- tree base_name = unshare_expr (DR_BASE_NAME (dr));
- tree ref = DR_REF (dr);
- tree scalar_type = TREE_TYPE (ref);
- tree scalar_ptr_type = build_pointer_type (scalar_type);
- tree vec_stmt;
- tree new_temp;
- tree addr_base, addr_expr;
- tree dest, new_stmt;
- tree base_offset = unshare_expr (STMT_VINFO_VECT_INIT_OFFSET (stmt_info));
-
- if (TREE_CODE (TREE_TYPE (data_ref_base)) != POINTER_TYPE)
- /* After the analysis stage, we expect to get here only with RECORD_TYPE
- and ARRAY_TYPE. */
- /* Add '&' to ref_base. */
- data_ref_base = build_fold_addr_expr (data_ref_base);
- else
- {
- /* Create '(scalar_type*) base' for pointers. */
- tree dest, new_stmt, new_temp, vec_stmt, tmp_base;
- tree scalar_array_type = build_array_type (scalar_type, 0);
- tree scalar_array_ptr_type = build_pointer_type (scalar_array_type);
- tree array_ptr = create_tmp_var (scalar_array_ptr_type, "array_ptr");
- add_referenced_tmp_var (array_ptr);
-
- dest = create_tmp_var (TREE_TYPE (data_ref_base), "dataref");
- add_referenced_tmp_var (dest);
- tmp_base = force_gimple_operand (data_ref_base, &new_stmt, false, dest);
- append_to_statement_list_force (new_stmt, new_stmt_list);
-
- vec_stmt = fold_convert (scalar_array_ptr_type, tmp_base);
- vec_stmt = build2 (MODIFY_EXPR, void_type_node, array_ptr, vec_stmt);
- new_temp = make_ssa_name (array_ptr, vec_stmt);
- TREE_OPERAND (vec_stmt, 0) = new_temp;
- append_to_statement_list_force (vec_stmt, new_stmt_list);
- data_ref_base = new_temp;
- }
-
- /* Create base_offset */
- dest = create_tmp_var (TREE_TYPE (base_offset), "base_off");
- add_referenced_tmp_var (dest);
- base_offset = force_gimple_operand (base_offset, &new_stmt, false, dest);
- append_to_statement_list_force (new_stmt, new_stmt_list);
-
- if (offset)
- {
- tree tmp = create_tmp_var (TREE_TYPE (base_offset), "offset");
- add_referenced_tmp_var (tmp);
- offset = fold (build2 (MULT_EXPR, TREE_TYPE (offset), offset,
- STMT_VINFO_VECT_STEP (stmt_info)));
- base_offset = fold (build2 (PLUS_EXPR, TREE_TYPE (base_offset),
- base_offset, offset));
- base_offset = force_gimple_operand (base_offset, &new_stmt, false, tmp);
- append_to_statement_list_force (new_stmt, new_stmt_list);
- }
-
- /* base + base_offset */
- addr_base = fold (build2 (PLUS_EXPR, TREE_TYPE (data_ref_base), data_ref_base,
- base_offset));
-
- /* addr_expr = addr_base */
- addr_expr = vect_get_new_vect_var (scalar_ptr_type, vect_pointer_var,
- get_name (base_name));
- add_referenced_tmp_var (addr_expr);
- vec_stmt = build2 (MODIFY_EXPR, void_type_node, addr_expr, addr_base);
- new_temp = make_ssa_name (addr_expr, vec_stmt);
- TREE_OPERAND (vec_stmt, 0) = new_temp;
- append_to_statement_list_force (vec_stmt, new_stmt_list);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "created ");
- print_generic_expr (dump_file, vec_stmt, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
- return new_temp;
-}
-
-
/* Function get_vectype_for_scalar_type.
Returns the vector type corresponding to SCALAR_TYPE as supported
by the target. */
-static tree
+tree
get_vectype_for_scalar_type (tree scalar_type)
{
enum machine_mode inner_mode = TYPE_MODE (scalar_type);
@@ -2003,19 +1351,19 @@ get_vectype_for_scalar_type (tree scalar_type)
nunits = UNITS_PER_SIMD_WORD / nbytes;
vectype = build_vector_type (scalar_type, nunits);
- if (vect_debug_details (UNKNOWN_LOC))
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
{
- fprintf (dump_file, "get vectype with %d units of type ", nunits);
- print_generic_expr (dump_file, scalar_type, TDF_SLIM);
+ fprintf (vect_dump, "get vectype with %d units of type ", nunits);
+ print_generic_expr (vect_dump, scalar_type, TDF_SLIM);
}
if (!vectype)
return NULL_TREE;
- if (vect_debug_details (UNKNOWN_LOC))
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
{
- fprintf (dump_file, "vectype: ");
- print_generic_expr (dump_file, vectype, TDF_SLIM);
+ fprintf (vect_dump, "vectype: ");
+ print_generic_expr (vect_dump, vectype, TDF_SLIM);
}
if (!VECTOR_MODE_P (TYPE_MODE (vectype)))
@@ -2023,8 +1371,8 @@ get_vectype_for_scalar_type (tree scalar_type)
/* TODO: tree-complex.c sometimes can parallelize operations
on generic vectors. We can vectorize the loop in that case,
but then we should re-run the lowering pass. */
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "mode not supported by target.");
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
+ fprintf (vect_dump, "mode not supported by target.");
return NULL_TREE;
}
@@ -2032,909 +1380,12 @@ get_vectype_for_scalar_type (tree scalar_type)
}
-/* Function vect_align_data_ref.
-
- Handle mislignment of a memory accesses.
-
- FORNOW: Can't handle misaligned accesses.
- Make sure that the dataref is aligned. */
-
-static void
-vect_align_data_ref (tree stmt)
-{
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
-
- /* FORNOW: can't handle misaligned accesses;
- all accesses expected to be aligned. */
- gcc_assert (aligned_access_p (dr));
-}
-
-
-/* Function vect_create_data_ref_ptr.
-
- Create a memory reference expression for vector access, to be used in a
- vector load/store stmt. The reference is based on a new pointer to vector
- type (vp).
-
- Input:
- 1. STMT: a stmt that references memory. Expected to be of the form
- MODIFY_EXPR <name, data-ref> or MODIFY_EXPR <data-ref, name>.
- 2. BSI: block_stmt_iterator where new stmts can be added.
- 3. OFFSET (optional): an offset to be added to the initial address accessed
- by the data-ref in STMT.
- 4. ONLY_INIT: indicate if vp is to be updated in the loop, or remain
- pointing to the initial address.
-
- Output:
- 1. Declare a new ptr to vector_type, and have it point to the base of the
- data reference (initial addressed accessed by the data reference).
- For example, for vector of type V8HI, the following code is generated:
-
- v8hi *vp;
- vp = (v8hi *)initial_address;
-
- if OFFSET is not supplied:
- initial_address = &a[init];
- if OFFSET is supplied:
- initial_address = &a[init + OFFSET];
-
- Return the initial_address in INITIAL_ADDRESS.
-
- 2. Create a data-reference in the loop based on the new vector pointer vp,
- and using a new index variable 'idx' as follows:
-
- vp' = vp + update
-
- where if ONLY_INIT is true:
- update = zero
- and otherwise
- update = idx + vector_type_size
-
- Return the pointer vp'.
-
-
- FORNOW: handle only aligned and consecutive accesses. */
-
-static tree
-vect_create_data_ref_ptr (tree stmt, block_stmt_iterator *bsi, tree offset,
- tree *initial_address, bool only_init)
-{
- tree base_name;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- tree vect_ptr_type;
- tree vect_ptr;
- tree tag;
- v_may_def_optype v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
- v_must_def_optype v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
- vuse_optype vuses = STMT_VUSE_OPS (stmt);
- int nvuses, nv_may_defs, nv_must_defs;
- int i;
- tree new_temp;
- tree vec_stmt;
- tree new_stmt_list = NULL_TREE;
- tree idx;
- edge pe = loop_preheader_edge (loop);
- basic_block new_bb;
- tree vect_ptr_init;
- tree vectype_size;
- tree ptr_update;
- tree data_ref_ptr;
- tree type, tmp, size;
-
- base_name = unshare_expr (DR_BASE_NAME (dr));
- if (vect_debug_details (UNKNOWN_LOC))
- {
- tree data_ref_base = base_name;
- fprintf (dump_file, "create array_ref of type: ");
- print_generic_expr (dump_file, vectype, TDF_SLIM);
- if (TREE_CODE (data_ref_base) == VAR_DECL)
- fprintf (dump_file, "\nvectorizing a one dimensional array ref: ");
- else if (TREE_CODE (data_ref_base) == ARRAY_REF)
- fprintf (dump_file, "\nvectorizing a multidimensional array ref: ");
- else if (TREE_CODE (data_ref_base) == COMPONENT_REF)
- fprintf (dump_file, "\nvectorizing a record based array ref: ");
- else if (TREE_CODE (data_ref_base) == SSA_NAME)
- fprintf (dump_file, "\nvectorizing a pointer ref: ");
- print_generic_expr (dump_file, base_name, TDF_SLIM);
- }
-
- /** (1) Create the new vector-pointer variable: **/
-
- vect_ptr_type = build_pointer_type (vectype);
- vect_ptr = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
- get_name (base_name));
- add_referenced_tmp_var (vect_ptr);
-
-
- /** (2) Handle aliasing information of the new vector-pointer: **/
-
- tag = STMT_VINFO_MEMTAG (stmt_info);
- gcc_assert (tag);
- get_var_ann (vect_ptr)->type_mem_tag = tag;
-
- /* Mark for renaming all aliased variables
- (i.e, the may-aliases of the type-mem-tag). */
- nvuses = NUM_VUSES (vuses);
- nv_may_defs = NUM_V_MAY_DEFS (v_may_defs);
- nv_must_defs = NUM_V_MUST_DEFS (v_must_defs);
- for (i = 0; i < nvuses; i++)
- {
- tree use = VUSE_OP (vuses, i);
- if (TREE_CODE (use) == SSA_NAME)
- bitmap_set_bit (vars_to_rename, var_ann (SSA_NAME_VAR (use))->uid);
- }
- for (i = 0; i < nv_may_defs; i++)
- {
- tree def = V_MAY_DEF_RESULT (v_may_defs, i);
- if (TREE_CODE (def) == SSA_NAME)
- bitmap_set_bit (vars_to_rename, var_ann (SSA_NAME_VAR (def))->uid);
- }
- for (i = 0; i < nv_must_defs; i++)
- {
- tree def = V_MUST_DEF_RESULT (v_must_defs, i);
- if (TREE_CODE (def) == SSA_NAME)
- bitmap_set_bit (vars_to_rename, var_ann (SSA_NAME_VAR (def))->uid);
- }
-
-
- /** (3) Calculate the initial address the vector-pointer, and set
- the vector-pointer to point to it before the loop: **/
-
- /* Create: (&(base[init_val+offset]) in the loop preheader. */
- new_temp = vect_create_addr_base_for_vector_ref (stmt, &new_stmt_list,
- offset);
- pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmt_list);
- gcc_assert (!new_bb);
- *initial_address = new_temp;
-
- /* Create: p = (vectype *) initial_base */
- vec_stmt = fold_convert (vect_ptr_type, new_temp);
- vec_stmt = build2 (MODIFY_EXPR, void_type_node, vect_ptr, vec_stmt);
- new_temp = make_ssa_name (vect_ptr, vec_stmt);
- TREE_OPERAND (vec_stmt, 0) = new_temp;
- new_bb = bsi_insert_on_edge_immediate (pe, vec_stmt);
- gcc_assert (!new_bb);
- vect_ptr_init = TREE_OPERAND (vec_stmt, 0);
-
-
- /** (4) Handle the updating of the vector-pointer inside the loop: **/
-
- if (only_init) /* No update in loop is required. */
- return vect_ptr_init;
-
- idx = vect_create_index_for_vector_ref (loop_vinfo);
-
- /* Create: update = idx * vectype_size */
- tmp = create_tmp_var (integer_type_node, "update");
- add_referenced_tmp_var (tmp);
- size = TYPE_SIZE (vect_ptr_type);
- type = lang_hooks.types.type_for_size (tree_low_cst (size, 1), 1);
- ptr_update = create_tmp_var (type, "update");
- add_referenced_tmp_var (ptr_update);
- vectype_size = TYPE_SIZE_UNIT (vectype);
- vec_stmt = build2 (MULT_EXPR, integer_type_node, idx, vectype_size);
- vec_stmt = build2 (MODIFY_EXPR, void_type_node, tmp, vec_stmt);
- new_temp = make_ssa_name (tmp, vec_stmt);
- TREE_OPERAND (vec_stmt, 0) = new_temp;
- bsi_insert_before (bsi, vec_stmt, BSI_SAME_STMT);
- vec_stmt = fold_convert (type, new_temp);
- vec_stmt = build2 (MODIFY_EXPR, void_type_node, ptr_update, vec_stmt);
- new_temp = make_ssa_name (ptr_update, vec_stmt);
- TREE_OPERAND (vec_stmt, 0) = new_temp;
- bsi_insert_before (bsi, vec_stmt, BSI_SAME_STMT);
-
- /* Create: data_ref_ptr = vect_ptr_init + update */
- vec_stmt = build2 (PLUS_EXPR, vect_ptr_type, vect_ptr_init, new_temp);
- vec_stmt = build2 (MODIFY_EXPR, void_type_node, vect_ptr, vec_stmt);
- new_temp = make_ssa_name (vect_ptr, vec_stmt);
- TREE_OPERAND (vec_stmt, 0) = new_temp;
- bsi_insert_before (bsi, vec_stmt, BSI_SAME_STMT);
- data_ref_ptr = TREE_OPERAND (vec_stmt, 0);
-
- return data_ref_ptr;
-}
-
-
-/* Function vect_create_destination_var.
-
- Create a new temporary of type VECTYPE. */
-
-static tree
-vect_create_destination_var (tree scalar_dest, tree vectype)
-{
- tree vec_dest;
- const char *new_name;
-
- gcc_assert (TREE_CODE (scalar_dest) == SSA_NAME);
-
- new_name = get_name (scalar_dest);
- if (!new_name)
- new_name = "var_";
- vec_dest = vect_get_new_vect_var (vectype, vect_simple_var, new_name);
- add_referenced_tmp_var (vec_dest);
-
- return vec_dest;
-}
-
-
-/* Function vect_init_vector.
-
- Insert a new stmt (INIT_STMT) that initializes a new vector variable with
- the vector elements of VECTOR_VAR. Return the DEF of INIT_STMT. It will be
- used in the vectorization of STMT. */
-
-static tree
-vect_init_vector (tree stmt, tree vector_var)
-{
- stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree new_var;
- tree init_stmt;
- tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
- tree vec_oprnd;
- edge pe;
- tree new_temp;
- basic_block new_bb;
-
- new_var = vect_get_new_vect_var (vectype, vect_simple_var, "cst_");
- add_referenced_tmp_var (new_var);
-
- init_stmt = build2 (MODIFY_EXPR, vectype, new_var, vector_var);
- new_temp = make_ssa_name (new_var, init_stmt);
- TREE_OPERAND (init_stmt, 0) = new_temp;
-
- pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, init_stmt);
- gcc_assert (!new_bb);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "created new init_stmt: ");
- print_generic_expr (dump_file, init_stmt, TDF_SLIM);
- }
-
- vec_oprnd = TREE_OPERAND (init_stmt, 0);
- return vec_oprnd;
-}
-
-
-/* Function vect_get_vec_def_for_operand.
-
- OP is an operand in STMT. This function returns a (vector) def that will be
- used in the vectorized stmt for STMT.
-
- In the case that OP is an SSA_NAME which is defined in the loop, then
- STMT_VINFO_VEC_STMT of the defining stmt holds the relevant def.
-
- In case OP is an invariant or constant, a new stmt that creates a vector def
- needs to be introduced. */
-
-static tree
-vect_get_vec_def_for_operand (tree op, tree stmt)
-{
- tree vec_oprnd;
- tree vec_stmt;
- tree def_stmt;
- stmt_vec_info def_stmt_info = NULL;
- stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
- tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
- int nunits = GET_MODE_NUNITS (TYPE_MODE (vectype));
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block bb;
- tree vec_inv;
- tree t = NULL_TREE;
- tree def;
- int i;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "vect_get_vec_def_for_operand: ");
- print_generic_expr (dump_file, op, TDF_SLIM);
- }
-
- /** ===> Case 1: operand is a constant. **/
-
- if (TREE_CODE (op) == INTEGER_CST || TREE_CODE (op) == REAL_CST)
- {
- /* Create 'vect_cst_ = {cst,cst,...,cst}' */
-
- tree vec_cst;
-
- /* Build a tree with vector elements. */
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "Create vector_cst. nunits = %d", nunits);
-
- for (i = nunits - 1; i >= 0; --i)
- {
- t = tree_cons (NULL_TREE, op, t);
- }
- vec_cst = build_vector (vectype, t);
- return vect_init_vector (stmt, vec_cst);
- }
-
- gcc_assert (TREE_CODE (op) == SSA_NAME);
-
- /** ===> Case 2: operand is an SSA_NAME - find the stmt that defines it. **/
-
- def_stmt = SSA_NAME_DEF_STMT (op);
- def_stmt_info = vinfo_for_stmt (def_stmt);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "vect_get_vec_def_for_operand: def_stmt: ");
- print_generic_expr (dump_file, def_stmt, TDF_SLIM);
- }
-
-
- /** ==> Case 2.1: operand is defined inside the loop. **/
-
- if (def_stmt_info)
- {
- /* Get the def from the vectorized stmt. */
-
- vec_stmt = STMT_VINFO_VEC_STMT (def_stmt_info);
- gcc_assert (vec_stmt);
- vec_oprnd = TREE_OPERAND (vec_stmt, 0);
- return vec_oprnd;
- }
-
-
- /** ==> Case 2.2: operand is defined by the loop-header phi-node -
- it is a reduction/induction. **/
-
- bb = bb_for_stmt (def_stmt);
- if (TREE_CODE (def_stmt) == PHI_NODE && flow_bb_inside_loop_p (loop, bb))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "reduction/induction - unsupported.");
- internal_error ("no support for reduction/induction"); /* FORNOW */
- }
-
-
- /** ==> Case 2.3: operand is defined outside the loop -
- it is a loop invariant. */
-
- switch (TREE_CODE (def_stmt))
- {
- case PHI_NODE:
- def = PHI_RESULT (def_stmt);
- break;
- case MODIFY_EXPR:
- def = TREE_OPERAND (def_stmt, 0);
- break;
- case NOP_EXPR:
- def = TREE_OPERAND (def_stmt, 0);
- gcc_assert (IS_EMPTY_STMT (def_stmt));
- def = op;
- break;
- default:
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "unsupported defining stmt: ");
- print_generic_expr (dump_file, def_stmt, TDF_SLIM);
- }
- internal_error ("unsupported defining stmt");
- }
-
- /* Build a tree with vector elements. Create 'vec_inv = {inv,inv,..,inv}' */
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "Create vector_inv.");
-
- for (i = nunits - 1; i >= 0; --i)
- {
- t = tree_cons (NULL_TREE, def, t);
- }
-
- vec_inv = build_constructor (vectype, t);
- return vect_init_vector (stmt, vec_inv);
-}
-
-
-/* Function vect_finish_stmt_generation.
-
- Insert a new stmt. */
-
-static void
-vect_finish_stmt_generation (tree stmt, tree vec_stmt, block_stmt_iterator *bsi)
-{
- bsi_insert_before (bsi, vec_stmt, BSI_SAME_STMT);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "add new stmt: ");
- print_generic_expr (dump_file, vec_stmt, TDF_SLIM);
- }
-
-#ifdef ENABLE_CHECKING
- /* Make sure bsi points to the stmt that is being vectorized. */
- gcc_assert (stmt == bsi_stmt (*bsi));
-#endif
-
-#ifdef USE_MAPPED_LOCATION
- SET_EXPR_LOCATION (vec_stmt, EXPR_LOCUS (stmt));
-#else
- SET_EXPR_LOCUS (vec_stmt, EXPR_LOCUS (stmt));
-#endif
-}
-
-
-/* Function vectorizable_assignment.
-
- Check if STMT performs an assignment (copy) that can be vectorized.
- If VEC_STMT is also passed, vectorize the STMT: create a vectorized
- stmt to replace it, put it in VEC_STMT, and insert it at BSI.
- Return FALSE if not a vectorizable STMT, TRUE otherwise. */
-
-static bool
-vectorizable_assignment (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
-{
- tree vec_dest;
- tree scalar_dest;
- tree op;
- tree vec_oprnd;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- tree new_temp;
-
- /* Is vectorizable assignment? */
-
- if (TREE_CODE (stmt) != MODIFY_EXPR)
- return false;
-
- scalar_dest = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (scalar_dest) != SSA_NAME)
- return false;
-
- op = TREE_OPERAND (stmt, 1);
- if (!vect_is_simple_use (op, loop_vinfo, NULL))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "use not simple.");
- return false;
- }
-
- if (!vec_stmt) /* transformation not required. */
- {
- STMT_VINFO_TYPE (stmt_info) = assignment_vec_info_type;
- return true;
- }
-
- /** Transform. **/
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "transform assignment.");
-
- /* Handle def. */
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
-
- /* Handle use. */
- op = TREE_OPERAND (stmt, 1);
- vec_oprnd = vect_get_vec_def_for_operand (op, stmt);
-
- /* Arguments are ready. create the new vector stmt. */
- *vec_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, vec_oprnd);
- new_temp = make_ssa_name (vec_dest, *vec_stmt);
- TREE_OPERAND (*vec_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
-
- return true;
-}
-
-
-/* Function vectorizable_operation.
-
- Check if STMT performs a binary or unary operation that can be vectorized.
- If VEC_STMT is also passed, vectorize the STMT: create a vectorized
- stmt to replace it, put it in VEC_STMT, and insert it at BSI.
- Return FALSE if not a vectorizable STMT, TRUE otherwise. */
-
-static bool
-vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
-{
- tree vec_dest;
- tree scalar_dest;
- tree operation;
- tree op0, op1 = NULL;
- tree vec_oprnd0, vec_oprnd1=NULL;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- int i;
- enum tree_code code;
- enum machine_mode vec_mode;
- tree new_temp;
- int op_type;
- tree op;
- optab optab;
-
- /* Is STMT a vectorizable binary/unary operation? */
- if (TREE_CODE (stmt) != MODIFY_EXPR)
- return false;
-
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
- return false;
-
- operation = TREE_OPERAND (stmt, 1);
- code = TREE_CODE (operation);
- optab = optab_for_tree_code (code, vectype);
-
- /* Support only unary or binary operations. */
- op_type = TREE_CODE_LENGTH (code);
- if (op_type != unary_op && op_type != binary_op)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "num. args = %d (not unary/binary op).", op_type);
- return false;
- }
-
- for (i = 0; i < op_type; i++)
- {
- op = TREE_OPERAND (operation, i);
- if (!vect_is_simple_use (op, loop_vinfo, NULL))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "use not simple.");
- return false;
- }
- }
-
- /* Supportable by target? */
- if (!optab)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "no optab.");
- return false;
- }
- vec_mode = TYPE_MODE (vectype);
- if (optab->handlers[(int) vec_mode].insn_code == CODE_FOR_nothing)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "op not supported by target.");
- return false;
- }
-
- if (!vec_stmt) /* transformation not required. */
- {
- STMT_VINFO_TYPE (stmt_info) = op_vec_info_type;
- return true;
- }
-
- /** Transform. **/
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "transform binary/unary operation.");
-
- /* Handle def. */
- scalar_dest = TREE_OPERAND (stmt, 0);
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
-
- /* Handle uses. */
- op0 = TREE_OPERAND (operation, 0);
- vec_oprnd0 = vect_get_vec_def_for_operand (op0, stmt);
-
- if (op_type == binary_op)
- {
- op1 = TREE_OPERAND (operation, 1);
- vec_oprnd1 = vect_get_vec_def_for_operand (op1, stmt);
- }
-
- /* Arguments are ready. create the new vector stmt. */
-
- if (op_type == binary_op)
- *vec_stmt = build2 (MODIFY_EXPR, vectype, vec_dest,
- build2 (code, vectype, vec_oprnd0, vec_oprnd1));
- else
- *vec_stmt = build2 (MODIFY_EXPR, vectype, vec_dest,
- build1 (code, vectype, vec_oprnd0));
- new_temp = make_ssa_name (vec_dest, *vec_stmt);
- TREE_OPERAND (*vec_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
-
- return true;
-}
-
-
-/* Function vectorizable_store.
-
- Check if STMT defines a non scalar data-ref (array/pointer/structure) that
- can be vectorized.
- If VEC_STMT is also passed, vectorize the STMT: create a vectorized
- stmt to replace it, put it in VEC_STMT, and insert it at BSI.
- Return FALSE if not a vectorizable STMT, TRUE otherwise. */
-
-static bool
-vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
-{
- tree scalar_dest;
- tree data_ref;
- tree op;
- tree vec_oprnd1;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- enum machine_mode vec_mode;
- tree dummy;
- enum dr_alignment_support alignment_support_cheme;
-
- /* Is vectorizable store? */
-
- if (TREE_CODE (stmt) != MODIFY_EXPR)
- return false;
-
- scalar_dest = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (scalar_dest) != ARRAY_REF
- && TREE_CODE (scalar_dest) != INDIRECT_REF)
- return false;
-
- op = TREE_OPERAND (stmt, 1);
- if (!vect_is_simple_use (op, loop_vinfo, NULL))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "use not simple.");
- return false;
- }
-
- vec_mode = TYPE_MODE (vectype);
- /* FORNOW. In some cases can vectorize even if data-type not supported
- (e.g. - array initialization with 0). */
- if (mov_optab->handlers[(int)vec_mode].insn_code == CODE_FOR_nothing)
- return false;
-
- if (!STMT_VINFO_DATA_REF (stmt_info))
- return false;
-
-
- if (!vec_stmt) /* transformation not required. */
- {
- STMT_VINFO_TYPE (stmt_info) = store_vec_info_type;
- return true;
- }
-
- /** Transform. **/
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "transform store");
-
- alignment_support_cheme = vect_supportable_dr_alignment (dr);
- gcc_assert (alignment_support_cheme);
- gcc_assert (alignment_support_cheme = dr_aligned); /* FORNOW */
-
- /* Handle use - get the vectorized def from the defining stmt. */
- vec_oprnd1 = vect_get_vec_def_for_operand (op, stmt);
-
- /* Handle def. */
- /* FORNOW: make sure the data reference is aligned. */
- vect_align_data_ref (stmt);
- data_ref = vect_create_data_ref_ptr (stmt, bsi, NULL_TREE, &dummy, false);
- data_ref = build_fold_indirect_ref (data_ref);
-
- /* Arguments are ready. create the new vector stmt. */
- *vec_stmt = build2 (MODIFY_EXPR, vectype, data_ref, vec_oprnd1);
- vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
-
- return true;
-}
-
-
-/* vectorizable_load.
-
- Check if STMT reads a non scalar data-ref (array/pointer/structure) that
- can be vectorized.
- If VEC_STMT is also passed, vectorize the STMT: create a vectorized
- stmt to replace it, put it in VEC_STMT, and insert it at BSI.
- Return FALSE if not a vectorizable STMT, TRUE otherwise. */
-
-static bool
-vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
-{
- tree scalar_dest;
- tree vec_dest = NULL;
- tree data_ref = NULL;
- tree op;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- tree new_temp;
- int mode;
- tree init_addr;
- tree new_stmt;
- tree dummy;
- basic_block new_bb;
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- edge pe = loop_preheader_edge (loop);
- enum dr_alignment_support alignment_support_cheme;
-
- /* Is vectorizable load? */
-
- if (TREE_CODE (stmt) != MODIFY_EXPR)
- return false;
-
- scalar_dest = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (scalar_dest) != SSA_NAME)
- return false;
-
- op = TREE_OPERAND (stmt, 1);
- if (TREE_CODE (op) != ARRAY_REF && TREE_CODE (op) != INDIRECT_REF)
- return false;
-
- if (!STMT_VINFO_DATA_REF (stmt_info))
- return false;
-
- mode = (int) TYPE_MODE (vectype);
-
- /* FORNOW. In some cases can vectorize even if data-type not supported
- (e.g. - data copies). */
- if (mov_optab->handlers[mode].insn_code == CODE_FOR_nothing)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "Aligned load, but unsupported type.");
- return false;
- }
-
- if (!vec_stmt) /* transformation not required. */
- {
- STMT_VINFO_TYPE (stmt_info) = load_vec_info_type;
- return true;
- }
-
- /** Transform. **/
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "transform load.");
-
- alignment_support_cheme = vect_supportable_dr_alignment (dr);
- gcc_assert (alignment_support_cheme);
-
- if (alignment_support_cheme == dr_aligned
- || alignment_support_cheme == dr_unaligned_supported)
- {
- /* Create:
- p = initial_addr;
- indx = 0;
- loop {
- vec_dest = *(p);
- indx = indx + 1;
- }
- */
-
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
- data_ref = vect_create_data_ref_ptr (stmt, bsi, NULL_TREE, &dummy, false);
- if (aligned_access_p (dr))
- data_ref = build_fold_indirect_ref (data_ref);
- else
- {
- int mis = DR_MISALIGNMENT (dr);
- tree tmis = (mis == -1 ? size_zero_node : size_int (mis));
- tmis = size_binop (MULT_EXPR, tmis, size_int(BITS_PER_UNIT));
- data_ref = build2 (MISALIGNED_INDIRECT_REF, vectype, data_ref, tmis);
- }
- new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, data_ref);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
- }
- else if (alignment_support_cheme == dr_unaligned_software_pipeline)
- {
- /* Create:
- p1 = initial_addr;
- msq_init = *(floor(p1))
- p2 = initial_addr + VS - 1;
- magic = have_builtin ? builtin_result : initial_address;
- indx = 0;
- loop {
- p2' = p2 + indx * vectype_size
- lsq = *(floor(p2'))
- vec_dest = realign_load (msq, lsq, magic)
- indx = indx + 1;
- msq = lsq;
- }
- */
-
- tree offset;
- tree magic;
- tree phi_stmt;
- tree msq_init;
- tree msq, lsq;
- tree dataref_ptr;
- tree params;
-
- /* <1> Create msq_init = *(floor(p1)) in the loop preheader */
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
- data_ref = vect_create_data_ref_ptr (stmt, bsi, NULL_TREE,
- &init_addr, true);
- data_ref = build1 (ALIGN_INDIRECT_REF, vectype, data_ref);
- new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, data_ref);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
- gcc_assert (!new_bb);
- msq_init = TREE_OPERAND (new_stmt, 0);
-
-
- /* <2> Create lsq = *(floor(p2')) in the loop */
- offset = build_int_cst (integer_type_node,
- GET_MODE_NUNITS (TYPE_MODE (vectype)));
- offset = int_const_binop (MINUS_EXPR, offset, integer_one_node, 1);
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
- dataref_ptr = vect_create_data_ref_ptr (stmt, bsi, offset, &dummy, false);
- data_ref = build1 (ALIGN_INDIRECT_REF, vectype, dataref_ptr);
- new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, data_ref);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
- lsq = TREE_OPERAND (new_stmt, 0);
-
-
- /* <3> */
- if (targetm.vectorize.builtin_mask_for_load)
- {
- /* Create permutation mask, if required, in loop preheader. */
- tree builtin_decl;
- params = build_tree_list (NULL_TREE, init_addr);
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
- builtin_decl = targetm.vectorize.builtin_mask_for_load ();
- new_stmt = build_function_call_expr (builtin_decl, params);
- new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, new_stmt);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
- gcc_assert (!new_bb);
- magic = TREE_OPERAND (new_stmt, 0);
-
- /* Since we have just created a CALL_EXPR, we may need to
- rename call-clobbered variables. */
- mark_call_clobbered_vars_to_rename ();
- }
- else
- {
- /* Use current address instead of init_addr for reduced reg pressure.
- */
- magic = dataref_ptr;
- }
-
-
- /* <4> Create msq = phi <msq_init, lsq> in loop */
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
- msq = make_ssa_name (vec_dest, NULL_TREE);
- phi_stmt = create_phi_node (msq, loop->header); /* CHECKME */
- SSA_NAME_DEF_STMT (msq) = phi_stmt;
- add_phi_arg (phi_stmt, msq_init, loop_preheader_edge (loop));
- add_phi_arg (phi_stmt, lsq, loop_latch_edge (loop));
-
-
- /* <5> Create <vec_dest = realign_load (msq, lsq, magic)> in loop */
- vec_dest = vect_create_destination_var (scalar_dest, vectype);
- new_stmt = build3 (REALIGN_LOAD_EXPR, vectype, msq, lsq, magic);
- new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, new_stmt);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
- }
- else
- gcc_unreachable ();
-
- *vec_stmt = new_stmt;
- return true;
-}
-
-
/* Function vect_supportable_dr_alignment
Return whether the data reference DR is supported with respect to its
alignment. */
-static enum dr_alignment_support
+enum dr_alignment_support
vect_supportable_dr_alignment (struct data_reference *dr)
{
tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (DR_STMT (dr)));
@@ -2962,624 +1413,6 @@ vect_supportable_dr_alignment (struct data_reference *dr)
}
-/* Function vect_transform_stmt.
-
- Create a vectorized stmt to replace STMT, and insert it at BSI. */
-
-static bool
-vect_transform_stmt (tree stmt, block_stmt_iterator *bsi)
-{
- bool is_store = false;
- tree vec_stmt = NULL_TREE;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- bool done;
-
- switch (STMT_VINFO_TYPE (stmt_info))
- {
- case op_vec_info_type:
- done = vectorizable_operation (stmt, bsi, &vec_stmt);
- gcc_assert (done);
- break;
-
- case assignment_vec_info_type:
- done = vectorizable_assignment (stmt, bsi, &vec_stmt);
- gcc_assert (done);
- break;
-
- case load_vec_info_type:
- done = vectorizable_load (stmt, bsi, &vec_stmt);
- gcc_assert (done);
- break;
-
- case store_vec_info_type:
- done = vectorizable_store (stmt, bsi, &vec_stmt);
- gcc_assert (done);
- is_store = true;
- break;
- default:
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "stmt not supported.");
- gcc_unreachable ();
- }
-
- STMT_VINFO_VEC_STMT (stmt_info) = vec_stmt;
-
- return is_store;
-}
-
-
-/* This function builds ni_name = number of iterations loop executes
- on the loop preheader. */
-
-static tree
-vect_build_loop_niters (loop_vec_info loop_vinfo)
-{
- tree ni_name, stmt, var;
- edge pe;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree ni = unshare_expr (LOOP_VINFO_NITERS (loop_vinfo));
-
- var = create_tmp_var (TREE_TYPE (ni), "niters");
- add_referenced_tmp_var (var);
- ni_name = force_gimple_operand (ni, &stmt, false, var);
-
- pe = loop_preheader_edge (loop);
- if (stmt)
- {
- basic_block new_bb = bsi_insert_on_edge_immediate (pe, stmt);
- gcc_assert (!new_bb);
- }
-
- return ni_name;
-}
-
-
-/* This function generates the following statements:
-
- ni_name = number of iterations loop executes
- ratio = ni_name / vf
- ratio_mult_vf_name = ratio * vf
-
- and places them at the loop preheader edge. */
-
-static void
-vect_generate_tmps_on_preheader (loop_vec_info loop_vinfo,
- tree *ni_name_ptr,
- tree *ratio_mult_vf_name_ptr,
- tree *ratio_name_ptr)
-{
-
- edge pe;
- basic_block new_bb;
- tree stmt, ni_name;
- tree var;
- tree ratio_name;
- tree ratio_mult_vf_name;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree ni = LOOP_VINFO_NITERS (loop_vinfo);
- int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
- tree log_vf = build_int_cst (unsigned_type_node, exact_log2 (vf));
-
- pe = loop_preheader_edge (loop);
-
- /* Generate temporary variable that contains
- number of iterations loop executes. */
-
- ni_name = vect_build_loop_niters (loop_vinfo);
-
- /* Create: ratio = ni >> log2(vf) */
-
- var = create_tmp_var (TREE_TYPE (ni), "bnd");
- add_referenced_tmp_var (var);
- ratio_name = make_ssa_name (var, NULL_TREE);
- stmt = build2 (MODIFY_EXPR, void_type_node, ratio_name,
- build2 (RSHIFT_EXPR, TREE_TYPE (ni_name), ni_name, log_vf));
- SSA_NAME_DEF_STMT (ratio_name) = stmt;
-
- pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, stmt);
- gcc_assert (!new_bb);
-
- /* Create: ratio_mult_vf = ratio << log2 (vf). */
-
- var = create_tmp_var (TREE_TYPE (ni), "ratio_mult_vf");
- add_referenced_tmp_var (var);
- ratio_mult_vf_name = make_ssa_name (var, NULL_TREE);
- stmt = build2 (MODIFY_EXPR, void_type_node, ratio_mult_vf_name,
- build2 (LSHIFT_EXPR, TREE_TYPE (ratio_name), ratio_name, log_vf));
- SSA_NAME_DEF_STMT (ratio_mult_vf_name) = stmt;
-
- pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, stmt);
- gcc_assert (!new_bb);
-
- *ni_name_ptr = ni_name;
- *ratio_mult_vf_name_ptr = ratio_mult_vf_name;
- *ratio_name_ptr = ratio_name;
-
- return;
-}
-
-
-/* Function vect_update_ivs_after_vectorizer.
-
- "Advance" the induction variables of LOOP to the value they should take
- after the execution of LOOP. This is currently necessary because the
- vectorizer does not handle induction variables that are used after the
- loop. Such a situation occurs when the last iterations of LOOP are
- peeled, because:
- 1. We introduced new uses after LOOP for IVs that were not originally used
- after LOOP: the IVs of LOOP are now used by an epilog loop.
- 2. LOOP is going to be vectorized; this means that it will iterate N/VF
- times, whereas the loop IVs should be bumped N times.
-
- Input:
- - LOOP - a loop that is going to be vectorized. The last few iterations
- of LOOP were peeled.
- - NITERS - the number of iterations that LOOP executes (before it is
- vectorized). i.e, the number of times the ivs should be bumped.
- - UPDATE_E - a successor edge of LOOP->exit that is on the (only) path
- coming out from LOOP on which there are uses of the LOOP ivs
- (this is the path from LOOP->exit to epilog_loop->preheader).
-
- The new definitions of the ivs are placed in LOOP->exit.
- The phi args associated with the edge UPDATE_E in the bb
- UPDATE_E->dest are updated accordingly.
-
- Assumption 1: Like the rest of the vectorizer, this function assumes
- a single loop exit that has a single predecessor.
-
- Assumption 2: The phi nodes in the LOOP header and in update_bb are
- organized in the same order.
-
- Assumption 3: The access function of the ivs is simple enough (see
- vect_can_advance_ivs_p). This assumption will be relaxed in the future.
-
- Assumption 4: Exactly one of the successors of LOOP exit-bb is on a path
- coming out of LOOP on which the ivs of LOOP are used (this is the path
- that leads to the epilog loop; other paths skip the epilog loop). This
- path starts with the edge UPDATE_E, and its destination (denoted update_bb)
- needs to have its phis updated.
- */
-
-static void
-vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
- edge update_e)
-{
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block exit_bb = loop->exit_edges[0]->dest;
- tree phi, phi1;
- basic_block update_bb = update_e->dest;
-
- /* gcc_assert (vect_can_advance_ivs_p (loop_vinfo)); */
-
- /* Make sure there exists a single-predecessor exit bb: */
- gcc_assert (EDGE_COUNT (exit_bb->preds) == 1);
-
- for (phi = phi_nodes (loop->header), phi1 = phi_nodes (update_bb);
- phi && phi1;
- phi = PHI_CHAIN (phi), phi1 = PHI_CHAIN (phi1))
- {
- tree access_fn = NULL;
- tree evolution_part;
- tree init_expr;
- tree step_expr;
- tree var, stmt, ni, ni_name;
- block_stmt_iterator last_bsi;
-
- /* Skip virtual phi's. */
- if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "virtual phi. skip.");
- continue;
- }
-
- access_fn = analyze_scalar_evolution (loop, PHI_RESULT (phi));
- gcc_assert (access_fn);
- evolution_part =
- unshare_expr (evolution_part_in_loop_num (access_fn, loop->num));
- gcc_assert (evolution_part != NULL_TREE);
-
- /* FORNOW: We do not support IVs whose evolution function is a polynomial
- of degree >= 2 or exponential. */
- gcc_assert (!tree_is_chrec (evolution_part));
-
- step_expr = evolution_part;
- init_expr = unshare_expr (initial_condition_in_loop_num (access_fn,
- loop->num));
-
- ni = build2 (PLUS_EXPR, TREE_TYPE (init_expr),
- build2 (MULT_EXPR, TREE_TYPE (niters),
- niters, step_expr), init_expr);
-
- var = create_tmp_var (TREE_TYPE (init_expr), "tmp");
- add_referenced_tmp_var (var);
-
- ni_name = force_gimple_operand (ni, &stmt, false, var);
-
- /* Insert stmt into exit_bb. */
- last_bsi = bsi_last (exit_bb);
- if (stmt)
- bsi_insert_before (&last_bsi, stmt, BSI_SAME_STMT);
-
- /* Fix phi expressions in the successor bb. */
- gcc_assert (PHI_ARG_DEF_FROM_EDGE (phi1, update_e) ==
- PHI_ARG_DEF_FROM_EDGE (phi, EDGE_SUCC (loop->latch, 0)));
- SET_PHI_ARG_DEF (phi1, update_e->dest_idx, ni_name);
- }
-}
-
-
-/* Function vect_do_peeling_for_loop_bound
-
- Peel the last iterations of the loop represented by LOOP_VINFO.
- The peeled iterations form a new epilog loop. Given that the loop now
- iterates NITERS times, the new epilog loop iterates
- NITERS % VECTORIZATION_FACTOR times.
-
- The original loop will later be made to iterate
- NITERS / VECTORIZATION_FACTOR times (this value is placed into RATIO). */
-
-static void
-vect_do_peeling_for_loop_bound (loop_vec_info loop_vinfo, tree *ratio,
- struct loops *loops)
-{
-
- tree ni_name, ratio_mult_vf_name;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- struct loop *new_loop;
- edge update_e;
-#ifdef ENABLE_CHECKING
- int loop_num;
-#endif
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_transtorm_for_unknown_loop_bound>>\n");
-
- /* Generate the following variables on the preheader of original loop:
-
- ni_name = number of iteration the original loop executes
- ratio = ni_name / vf
- ratio_mult_vf_name = ratio * vf */
- vect_generate_tmps_on_preheader (loop_vinfo, &ni_name,
- &ratio_mult_vf_name, ratio);
-
- /* Update loop info. */
- loop->pre_header = loop_preheader_edge (loop)->src;
- loop->pre_header_edges[0] = loop_preheader_edge (loop);
-
-#ifdef ENABLE_CHECKING
- loop_num = loop->num;
-#endif
- new_loop = slpeel_tree_peel_loop_to_edge (loop, loops, loop->exit_edges[0],
- ratio_mult_vf_name, ni_name, false);
-#ifdef ENABLE_CHECKING
- gcc_assert (new_loop);
- gcc_assert (loop_num == loop->num);
- slpeel_verify_cfg_after_peeling (loop, new_loop);
-#endif
-
- /* A guard that controls whether the new_loop is to be executed or skipped
- is placed in LOOP->exit. LOOP->exit therefore has two successors - one
- is the preheader of NEW_LOOP, where the IVs from LOOP are used. The other
- is a bb after NEW_LOOP, where these IVs are not used. Find the edge that
- is on the path where the LOOP IVs are used and need to be updated. */
-
- if (EDGE_PRED (new_loop->pre_header, 0)->src == loop->exit_edges[0]->dest)
- update_e = EDGE_PRED (new_loop->pre_header, 0);
- else
- update_e = EDGE_PRED (new_loop->pre_header, 1);
-
- /* Update IVs of original loop as if they were advanced
- by ratio_mult_vf_name steps. */
- vect_update_ivs_after_vectorizer (loop_vinfo, ratio_mult_vf_name, update_e);
-
- /* After peeling we have to reset scalar evolution analyzer. */
- scev_reset ();
-
- return;
-}
-
-
-/* Function vect_gen_niters_for_prolog_loop
-
- Set the number of iterations for the loop represented by LOOP_VINFO
- to the minimum between LOOP_NITERS (the original iteration count of the loop)
- and the misalignment of DR - the first data reference recorded in
- LOOP_VINFO_UNALIGNED_DR (LOOP_VINFO). As a result, after the execution of
- this loop, the data reference DR will refer to an aligned location.
-
- The following computation is generated:
-
- compute address misalignment in bytes:
- addr_mis = addr & (vectype_size - 1)
-
- prolog_niters = min ( LOOP_NITERS , (VF - addr_mis/elem_size)&(VF-1) )
-
- (elem_size = element type size; an element is the scalar element
- whose type is the inner type of the vectype) */
-
-static tree
-vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters)
-{
- struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo);
- int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree var, stmt;
- tree iters, iters_name;
- edge pe;
- basic_block new_bb;
- tree dr_stmt = DR_STMT (dr);
- stmt_vec_info stmt_info = vinfo_for_stmt (dr_stmt);
- tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- int vectype_align = TYPE_ALIGN (vectype) / BITS_PER_UNIT;
- tree elem_misalign;
- tree byte_misalign;
- tree new_stmts = NULL_TREE;
- tree start_addr =
- vect_create_addr_base_for_vector_ref (dr_stmt, &new_stmts, NULL_TREE);
- tree ptr_type = TREE_TYPE (start_addr);
- tree size = TYPE_SIZE (ptr_type);
- tree type = lang_hooks.types.type_for_size (tree_low_cst (size, 1), 1);
- tree vectype_size_minus_1 = build_int_cst (type, vectype_align - 1);
- tree vf_minus_1 = build_int_cst (unsigned_type_node, vf - 1);
- tree niters_type = TREE_TYPE (loop_niters);
- tree elem_size_log =
- build_int_cst (unsigned_type_node, exact_log2 (vectype_align/vf));
- tree vf_tree = build_int_cst (unsigned_type_node, vf);
-
- pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmts);
- gcc_assert (!new_bb);
-
- /* Create: byte_misalign = addr & (vectype_size - 1) */
- byte_misalign = build2 (BIT_AND_EXPR, type, start_addr, vectype_size_minus_1);
-
- /* Create: elem_misalign = byte_misalign / element_size */
- elem_misalign =
- build2 (RSHIFT_EXPR, unsigned_type_node, byte_misalign, elem_size_log);
-
- /* Create: (niters_type) (VF - elem_misalign)&(VF - 1) */
- iters = build2 (MINUS_EXPR, unsigned_type_node, vf_tree, elem_misalign);
- iters = build2 (BIT_AND_EXPR, unsigned_type_node, iters, vf_minus_1);
- iters = fold_convert (niters_type, iters);
-
- /* Create: prolog_loop_niters = min (iters, loop_niters) */
- /* If the loop bound is known at compile time we already verified that it is
- greater than vf; since the misalignment ('iters') is at most vf, there's
- no need to generate the MIN_EXPR in this case. */
- if (TREE_CODE (loop_niters) != INTEGER_CST)
- iters = build2 (MIN_EXPR, niters_type, iters, loop_niters);
-
- var = create_tmp_var (niters_type, "prolog_loop_niters");
- add_referenced_tmp_var (var);
- iters_name = force_gimple_operand (iters, &stmt, false, var);
-
- /* Insert stmt on loop preheader edge. */
- pe = loop_preheader_edge (loop);
- if (stmt)
- {
- basic_block new_bb = bsi_insert_on_edge_immediate (pe, stmt);
- gcc_assert (!new_bb);
- }
-
- return iters_name;
-}
-
-
-/* Function vect_update_inits_of_dr
-
- NITERS iterations were peeled from LOOP. DR represents a data reference
- in LOOP. This function updates the information recorded in DR to
- account for the fact that the first NITERS iterations had already been
- executed. Specifically, it updates the OFFSET field of stmt_info. */
-
-static void
-vect_update_inits_of_dr (struct data_reference *dr, tree niters)
-{
- stmt_vec_info stmt_info = vinfo_for_stmt (DR_STMT (dr));
- tree offset = STMT_VINFO_VECT_INIT_OFFSET (stmt_info);
-
- niters = fold (build2 (MULT_EXPR, TREE_TYPE (niters), niters,
- STMT_VINFO_VECT_STEP (stmt_info)));
- offset = fold (build2 (PLUS_EXPR, TREE_TYPE (offset), offset, niters));
- STMT_VINFO_VECT_INIT_OFFSET (stmt_info) = offset;
-}
-
-
-/* Function vect_update_inits_of_drs
-
- NITERS iterations were peeled from the loop represented by LOOP_VINFO.
- This function updates the information recorded for the data references in
- the loop to account for the fact that the first NITERS iterations had
- already been executed. Specifically, it updates the initial_condition of the
- access_function of all the data_references in the loop. */
-
-static void
-vect_update_inits_of_drs (loop_vec_info loop_vinfo, tree niters)
-{
- unsigned int i;
- varray_type loop_write_datarefs = LOOP_VINFO_DATAREF_WRITES (loop_vinfo);
- varray_type loop_read_datarefs = LOOP_VINFO_DATAREF_READS (loop_vinfo);
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\n<<vect_update_inits_of_dr>>\n");
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_write_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_write_datarefs, i);
- vect_update_inits_of_dr (dr, niters);
- }
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_read_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_read_datarefs, i);
- vect_update_inits_of_dr (dr, niters);
- }
-}
-
-
-/* Function vect_do_peeling_for_alignment
-
- Peel the first 'niters' iterations of the loop represented by LOOP_VINFO.
- 'niters' is set to the misalignment of one of the data references in the
- loop, thereby forcing it to refer to an aligned location at the beginning
- of the execution of this loop. The data reference for which we are
- peeling is recorded in LOOP_VINFO_UNALIGNED_DR. */
-
-static void
-vect_do_peeling_for_alignment (loop_vec_info loop_vinfo, struct loops *loops)
-{
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree niters_of_prolog_loop, ni_name;
- tree n_iters;
- struct loop *new_loop;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_do_peeling_for_alignment>>\n");
-
- ni_name = vect_build_loop_niters (loop_vinfo);
- niters_of_prolog_loop = vect_gen_niters_for_prolog_loop (loop_vinfo, ni_name);
-
- /* Peel the prolog loop and iterate it niters_of_prolog_loop. */
- new_loop =
- slpeel_tree_peel_loop_to_edge (loop, loops, loop_preheader_edge (loop),
- niters_of_prolog_loop, ni_name, true);
-#ifdef ENABLE_CHECKING
- gcc_assert (new_loop);
- slpeel_verify_cfg_after_peeling (new_loop, loop);
-#endif
-
- /* Update number of times loop executes. */
- n_iters = LOOP_VINFO_NITERS (loop_vinfo);
- LOOP_VINFO_NITERS (loop_vinfo) =
- build2 (MINUS_EXPR, TREE_TYPE (n_iters), n_iters, niters_of_prolog_loop);
-
- /* Update the init conditions of the access functions of all data refs. */
- vect_update_inits_of_drs (loop_vinfo, niters_of_prolog_loop);
-
- /* After peeling we have to reset scalar evolution analyzer. */
- scev_reset ();
-
- return;
-}
-
-
-/* Function vect_transform_loop.
-
- The analysis phase has determined that the loop is vectorizable.
- Vectorize the loop - created vectorized stmts to replace the scalar
- stmts in the loop, and update the loop exit condition. */
-
-static void
-vect_transform_loop (loop_vec_info loop_vinfo,
- struct loops *loops ATTRIBUTE_UNUSED)
-{
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
- int nbbs = loop->num_nodes;
- block_stmt_iterator si;
- int i;
- tree ratio = NULL;
- int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vec_transform_loop>>\n");
-
-
- /* Peel the loop if there are data refs with unknown alignment.
- Only one data ref with unknown store is allowed. */
-
- if (LOOP_DO_PEELING_FOR_ALIGNMENT (loop_vinfo))
- vect_do_peeling_for_alignment (loop_vinfo, loops);
-
- /* If the loop has a symbolic number of iterations 'n' (i.e. it's not a
- compile time constant), or it is a constant that doesn't divide by the
- vectorization factor, then an epilog loop needs to be created.
- We therefore duplicate the loop: the original loop will be vectorized,
- and will compute the first (n/VF) iterations. The second copy of the loop
- will remain scalar and will compute the remaining (n%VF) iterations.
- (VF is the vectorization factor). */
-
- if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
- || (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
- && LOOP_VINFO_INT_NITERS (loop_vinfo) % vectorization_factor != 0))
- vect_do_peeling_for_loop_bound (loop_vinfo, &ratio, loops);
- else
- ratio = build_int_cst (TREE_TYPE (LOOP_VINFO_NITERS (loop_vinfo)),
- LOOP_VINFO_INT_NITERS (loop_vinfo) / vectorization_factor);
-
- /* 1) Make sure the loop header has exactly two entries
- 2) Make sure we have a preheader basic block. */
-
- gcc_assert (EDGE_COUNT (loop->header->preds) == 2);
-
- loop_split_edge_with (loop_preheader_edge (loop), NULL);
-
-
- /* FORNOW: the vectorizer supports only loops which body consist
- of one basic block (header + empty latch). When the vectorizer will
- support more involved loop forms, the order by which the BBs are
- traversed need to be reconsidered. */
-
- for (i = 0; i < nbbs; i++)
- {
- basic_block bb = bbs[i];
-
- for (si = bsi_start (bb); !bsi_end_p (si);)
- {
- tree stmt = bsi_stmt (si);
- stmt_vec_info stmt_info;
- bool is_store;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "------>vectorizing statement: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
- stmt_info = vinfo_for_stmt (stmt);
- gcc_assert (stmt_info);
- if (!STMT_VINFO_RELEVANT_P (stmt_info))
- {
- bsi_next (&si);
- continue;
- }
-#ifdef ENABLE_CHECKING
- /* FORNOW: Verify that all stmts operate on the same number of
- units and no inner unrolling is necessary. */
- gcc_assert
- (GET_MODE_NUNITS (TYPE_MODE (STMT_VINFO_VECTYPE (stmt_info)))
- == vectorization_factor);
-#endif
- /* -------- vectorize statement ------------ */
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "transform statement.");
-
- is_store = vect_transform_stmt (stmt, &si);
- if (is_store)
- {
- /* free the attached stmt_vec_info and remove the stmt. */
- stmt_ann_t ann = stmt_ann (stmt);
- free (stmt_info);
- set_stmt_info (ann, NULL);
- bsi_remove (&si);
- continue;
- }
-
- bsi_next (&si);
- } /* stmts in BB */
- } /* BBs in loop */
-
- slpeel_make_loop_iterate_ntimes (loop, ratio);
-
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file,"Success! loop vectorized.");
- if (vect_debug_stats (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "LOOP VECTORIZED.");
-}
-
-
/* Function vect_is_simple_use.
Input:
@@ -3593,7 +1426,7 @@ vect_transform_loop (loop_vec_info loop_vinfo,
those that are defined by a previous iteration of the loop (as is the case
in reduction/induction computations). */
-static bool
+bool
vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def)
{
tree def_stmt;
@@ -3612,8 +1445,8 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def)
def_stmt = SSA_NAME_DEF_STMT (operand);
if (def_stmt == NULL_TREE )
{
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "no def_stmt.");
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
+ fprintf (vect_dump, "no def_stmt.");
return false;
}
@@ -3624,10 +1457,10 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def)
tree arg = TREE_OPERAND (def_stmt, 0);
if (TREE_CODE (arg) == INTEGER_CST || TREE_CODE (arg) == REAL_CST)
return true;
- if (vect_debug_details (UNKNOWN_LOC))
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
{
- fprintf (dump_file, "Unexpected empty stmt: ");
- print_generic_expr (dump_file, def_stmt, TDF_SLIM);
+ fprintf (vect_dump, "Unexpected empty stmt: ");
+ print_generic_expr (vect_dump, def_stmt, TDF_SLIM);
}
return false;
}
@@ -3637,8 +1470,8 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def)
bb = bb_for_stmt (def_stmt);
if (TREE_CODE (def_stmt) == PHI_NODE && flow_bb_inside_loop_p (loop, bb))
{
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "reduction/induction - unsupported.");
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
+ fprintf (vect_dump, "reduction/induction - unsupported.");
return false; /* FORNOW: not supported yet. */
}
@@ -3655,248 +1488,14 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def)
}
-/* Function vect_analyze_operations.
-
- Scan the loop stmts and make sure they are all vectorizable. */
-
-static bool
-vect_analyze_operations (loop_vec_info loop_vinfo)
-{
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
- int nbbs = loop->num_nodes;
- block_stmt_iterator si;
- unsigned int vectorization_factor = 0;
- int i;
- bool ok;
- tree scalar_type;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_analyze_operations>>\n");
-
- for (i = 0; i < nbbs; i++)
- {
- basic_block bb = bbs[i];
-
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- {
- tree stmt = bsi_stmt (si);
- unsigned int nunits;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree vectype;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "==> examining statement: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
-
- gcc_assert (stmt_info);
-
- /* skip stmts which do not need to be vectorized.
- this is expected to include:
- - the COND_EXPR which is the loop exit condition
- - any LABEL_EXPRs in the loop
- - computations that are used only for array indexing or loop
- control */
-
- if (!STMT_VINFO_RELEVANT_P (stmt_info))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "irrelevant.");
- continue;
- }
-
- if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (stmt))))
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- {
- fprintf (dump_file, "not vectorized: vector stmt in loop:");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
- return false;
- }
-
- if (STMT_VINFO_DATA_REF (stmt_info))
- scalar_type = TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (stmt_info)));
- else if (TREE_CODE (stmt) == MODIFY_EXPR)
- scalar_type = TREE_TYPE (TREE_OPERAND (stmt, 0));
- else
- scalar_type = TREE_TYPE (stmt);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "get vectype for scalar type: ");
- print_generic_expr (dump_file, scalar_type, TDF_SLIM);
- }
-
- vectype = get_vectype_for_scalar_type (scalar_type);
- if (!vectype)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- {
- fprintf (dump_file, "not vectorized: unsupported data-type ");
- print_generic_expr (dump_file, scalar_type, TDF_SLIM);
- }
- return false;
- }
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "vectype: ");
- print_generic_expr (dump_file, vectype, TDF_SLIM);
- }
- STMT_VINFO_VECTYPE (stmt_info) = vectype;
-
- ok = (vectorizable_operation (stmt, NULL, NULL)
- || vectorizable_assignment (stmt, NULL, NULL)
- || vectorizable_load (stmt, NULL, NULL)
- || vectorizable_store (stmt, NULL, NULL));
-
- if (!ok)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- {
- fprintf (dump_file, "not vectorized: stmt not supported: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
- return false;
- }
-
- nunits = GET_MODE_NUNITS (TYPE_MODE (vectype));
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "nunits = %d", nunits);
-
- if (vectorization_factor)
- {
- /* FORNOW: don't allow mixed units.
- This restriction will be relaxed in the future. */
- if (nunits != vectorization_factor)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: mixed data-types");
- return false;
- }
- }
- else
- vectorization_factor = nunits;
-
-#ifdef ENABLE_CHECKING
- gcc_assert (GET_MODE_SIZE (TYPE_MODE (scalar_type))
- * vectorization_factor == UNITS_PER_SIMD_WORD);
-#endif
- }
- }
-
- /* TODO: Analyze cost. Decide if worth while to vectorize. */
-
- if (vectorization_factor <= 1)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unsupported data-type");
- return false;
- }
- LOOP_VINFO_VECT_FACTOR (loop_vinfo) = vectorization_factor;
-
- if (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
- && vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file,
- "vectorization_factor = %d, niters = " HOST_WIDE_INT_PRINT_DEC,
- vectorization_factor, LOOP_VINFO_INT_NITERS (loop_vinfo));
-
- if (LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
- && LOOP_VINFO_INT_NITERS (loop_vinfo) < vectorization_factor)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: iteration count too small.");
- return false;
- }
-
- if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
- || LOOP_VINFO_INT_NITERS (loop_vinfo) % vectorization_factor != 0)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "epilog loop required.");
- if (!vect_can_advance_ivs_p (loop_vinfo))
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: can't create epilog loop 1.");
- return false;
- }
- if (!slpeel_can_duplicate_loop_p (loop, loop->exit_edges[0]))
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: can't create epilog loop 2.");
- return false;
- }
- }
-
- return true;
-}
-
-
-/* Function exist_non_indexing_operands_for_use_p
-
- USE is one of the uses attached to STMT. Check if USE is
- used in STMT for anything other than indexing an array. */
-
-static bool
-exist_non_indexing_operands_for_use_p (tree use, tree stmt)
-{
- tree operand;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
-
- /* USE corresponds to some operand in STMT. If there is no data
- reference in STMT, then any operand that corresponds to USE
- is not indexing an array. */
- if (!STMT_VINFO_DATA_REF (stmt_info))
- return true;
-
- /* STMT has a data_ref. FORNOW this means that its of one of
- the following forms:
- -1- ARRAY_REF = var
- -2- var = ARRAY_REF
- (This should have been verified in analyze_data_refs).
-
- 'var' in the second case corresponds to a def, not a use,
- so USE cannot correspond to any operands that are not used
- for array indexing.
-
- Therefore, all we need to check is if STMT falls into the
- first case, and whether var corresponds to USE. */
-
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME)
- return false;
-
- operand = TREE_OPERAND (stmt, 1);
-
- if (TREE_CODE (operand) != SSA_NAME)
- return false;
-
- if (operand == use)
- return true;
-
- return false;
-}
-
-
/* Function vect_is_simple_iv_evolution.
FORNOW: A simple evolution of an induction variables in the loop is
considered a polynomial evolution with constant step. */
-static bool
+bool
vect_is_simple_iv_evolution (unsigned loop_nb, tree access_fn, tree * init,
- tree * step, bool strict)
+ tree * step)
{
tree init_expr;
tree step_expr;
@@ -3914,14 +1513,15 @@ vect_is_simple_iv_evolution (unsigned loop_nb, tree access_fn, tree * init,
return false;
step_expr = evolution_part;
- init_expr = unshare_expr (initial_condition_in_loop_num (access_fn, loop_nb));
+ init_expr = unshare_expr (initial_condition_in_loop_num (access_fn,
+ loop_nb));
- if (vect_debug_details (UNKNOWN_LOC))
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
{
- fprintf (dump_file, "step: ");
- print_generic_expr (dump_file, step_expr, TDF_SLIM);
- fprintf (dump_file, ", init: ");
- print_generic_expr (dump_file, init_expr, TDF_SLIM);
+ fprintf (vect_dump, "step: ");
+ print_generic_expr (vect_dump, step_expr, TDF_SLIM);
+ fprintf (vect_dump, ", init: ");
+ print_generic_expr (vect_dump, init_expr, TDF_SLIM);
}
*init = init_expr;
@@ -3929,1766 +1529,15 @@ vect_is_simple_iv_evolution (unsigned loop_nb, tree access_fn, tree * init,
if (TREE_CODE (step_expr) != INTEGER_CST)
{
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "step unknown.");
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
+ fprintf (vect_dump, "step unknown.");
return false;
}
- if (strict)
- if (!integer_onep (step_expr))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- print_generic_expr (dump_file, step_expr, TDF_SLIM);
- return false;
- }
-
- return true;
-}
-
-
-/* Function vect_analyze_scalar_cycles.
-
- Examine the cross iteration def-use cycles of scalar variables, by
- analyzing the loop (scalar) PHIs; verify that the cross iteration def-use
- cycles that they represent do not impede vectorization.
-
- FORNOW: Reduction as in the following loop, is not supported yet:
- loop1:
- for (i=0; i<N; i++)
- sum += a[i];
- The cross-iteration cycle corresponding to variable 'sum' will be
- considered too complicated and will impede vectorization.
-
- FORNOW: Induction as in the following loop, is not supported yet:
- loop2:
- for (i=0; i<N; i++)
- a[i] = i;
-
- However, the following loop *is* vectorizable:
- loop3:
- for (i=0; i<N; i++)
- a[i] = b[i];
-
- In both loops there exists a def-use cycle for the variable i:
- loop: i_2 = PHI (i_0, i_1)
- a[i_2] = ...;
- i_1 = i_2 + 1;
- GOTO loop;
-
- The evolution of the above cycle is considered simple enough,
- however, we also check that the cycle does not need to be
- vectorized, i.e - we check that the variable that this cycle
- defines is only used for array indexing or in stmts that do not
- need to be vectorized. This is not the case in loop2, but it
- *is* the case in loop3. */
-
-static bool
-vect_analyze_scalar_cycles (loop_vec_info loop_vinfo)
-{
- tree phi;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block bb = loop->header;
- tree dummy;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_analyze_scalar_cycles>>\n");
-
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- tree access_fn = NULL;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "Analyze phi: ");
- print_generic_expr (dump_file, phi, TDF_SLIM);
- }
-
- /* Skip virtual phi's. The data dependences that are associated with
- virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */
-
- if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "virtual phi. skip.");
- continue;
- }
-
- /* Analyze the evolution function. */
-
- /* FORNOW: The only scalar cross-iteration cycles that we allow are
- those of loop induction variables; This property is verified here.
-
- Furthermore, if that induction variable is used in an operation
- that needs to be vectorized (i.e, is not solely used to index
- arrays and check the exit condition) - we do not support its
- vectorization yet. This property is verified in vect_is_simple_use,
- during vect_analyze_operations. */
-
- access_fn = /* instantiate_parameters
- (loop,*/
- analyze_scalar_evolution (loop, PHI_RESULT (phi));
-
- if (!access_fn)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unsupported scalar cycle.");
- return false;
- }
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "Access function of PHI: ");
- print_generic_expr (dump_file, access_fn, TDF_SLIM);
- }
-
- if (!vect_is_simple_iv_evolution (loop->num, access_fn, &dummy,
- &dummy, false))
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unsupported scalar cycle.");
- return false;
- }
- }
-
- return true;
-}
-
-
-/* Function vect_analyze_data_ref_dependence.
-
- Return TRUE if there (might) exist a dependence between a memory-reference
- DRA and a memory-reference DRB. */
-
-static bool
-vect_analyze_data_ref_dependence (struct data_reference *dra,
- struct data_reference *drb,
- loop_vec_info loop_vinfo)
-{
- bool differ_p;
- struct data_dependence_relation *ddr;
-
- if (!array_base_name_differ_p (dra, drb, &differ_p))
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- {
- fprintf (dump_file,
- "not vectorized: can't determine dependence between: ");
- print_generic_expr (dump_file, DR_REF (dra), TDF_SLIM);
- fprintf (dump_file, " and ");
- print_generic_expr (dump_file, DR_REF (drb), TDF_SLIM);
- }
- return true;
- }
-
- if (differ_p)
- return false;
-
- ddr = initialize_data_dependence_relation (dra, drb);
- compute_affine_dependence (ddr);
-
- if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
- return false;
-
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- {
- fprintf (dump_file,
- "not vectorized: possible dependence between data-refs ");
- print_generic_expr (dump_file, DR_REF (dra), TDF_SLIM);
- fprintf (dump_file, " and ");
- print_generic_expr (dump_file, DR_REF (drb), TDF_SLIM);
- }
-
- return true;
-}
-
-
-/* Function vect_analyze_data_ref_dependences.
-
- Examine all the data references in the loop, and make sure there do not
- exist any data dependences between them.
-
- TODO: dependences which distance is greater than the vectorization factor
- can be ignored. */
-
-static bool
-vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo)
-{
- unsigned int i, j;
- varray_type loop_write_refs = LOOP_VINFO_DATAREF_WRITES (loop_vinfo);
- varray_type loop_read_refs = LOOP_VINFO_DATAREF_READS (loop_vinfo);
-
- /* Examine store-store (output) dependences. */
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_analyze_dependences>>\n");
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "compare all store-store pairs.");
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_write_refs); i++)
- {
- for (j = i + 1; j < VARRAY_ACTIVE_SIZE (loop_write_refs); j++)
- {
- struct data_reference *dra =
- VARRAY_GENERIC_PTR (loop_write_refs, i);
- struct data_reference *drb =
- VARRAY_GENERIC_PTR (loop_write_refs, j);
- if (vect_analyze_data_ref_dependence (dra, drb, loop_vinfo))
- return false;
- }
- }
-
- /* Examine load-store (true/anti) dependences. */
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "compare all load-store pairs.");
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_read_refs); i++)
- {
- for (j = 0; j < VARRAY_ACTIVE_SIZE (loop_write_refs); j++)
- {
- struct data_reference *dra = VARRAY_GENERIC_PTR (loop_read_refs, i);
- struct data_reference *drb =
- VARRAY_GENERIC_PTR (loop_write_refs, j);
- if (vect_analyze_data_ref_dependence (dra, drb, loop_vinfo))
- return false;
- }
- }
-
- return true;
-}
-
-
-/* Function vect_compute_data_ref_alignment
-
- Compute the misalignment of the data reference DR.
-
- Output:
- 1. If during the misalignment computation it is found that the data reference
- cannot be vectorized then false is returned.
- 2. DR_MISALIGNMENT (DR) is defined.
-
- FOR NOW: No analysis is actually performed. Misalignment is calculated
- only for trivial cases. TODO. */
-
-static bool
-vect_compute_data_ref_alignment (struct data_reference *dr)
-{
- tree stmt = DR_STMT (dr);
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree ref = DR_REF (dr);
- tree vectype;
- tree base, alignment;
- bool base_aligned_p;
- tree misalign;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "vect_compute_data_ref_alignment:");
-
- /* Initialize misalignment to unknown. */
- DR_MISALIGNMENT (dr) = -1;
-
- misalign = STMT_VINFO_VECT_MISALIGNMENT (stmt_info);
- base_aligned_p = STMT_VINFO_VECT_BASE_ALIGNED_P (stmt_info);
- base = STMT_VINFO_VECT_DR_BASE (stmt_info);
- vectype = STMT_VINFO_VECTYPE (stmt_info);
-
- if (!misalign)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "Unknown alignment for access: ");
- print_generic_expr (dump_file, base, TDF_SLIM);
- }
- return true;
- }
-
- if (!base_aligned_p)
- {
- if (!vect_can_force_dr_alignment_p (base, TYPE_ALIGN (vectype)))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "can't force alignment of ref: ");
- print_generic_expr (dump_file, ref, TDF_SLIM);
- }
- return true;
- }
-
- /* Force the alignment of the decl.
- NOTE: This is the only change to the code we make during
- the analysis phase, before deciding to vectorize the loop. */
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "force alignment");
- DECL_ALIGN (base) = TYPE_ALIGN (vectype);
- DECL_USER_ALIGN (base) = 1;
- }
-
- /* At this point we assume that the base is aligned. */
- gcc_assert (base_aligned_p
- || (TREE_CODE (base) == VAR_DECL
- && DECL_ALIGN (base) >= TYPE_ALIGN (vectype)));
-
- /* Alignment required, in bytes: */
- alignment = ssize_int (TYPE_ALIGN (vectype)/BITS_PER_UNIT);
-
- /* Modulo alignment. */
- misalign = size_binop (TRUNC_MOD_EXPR, misalign, alignment);
- if (tree_int_cst_sgn (misalign) < 0)
- {
- /* Negative misalignment value. */
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "unexpected misalign value");
- return false;
- }
-
- DR_MISALIGNMENT (dr) = tree_low_cst (misalign, 1);
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "misalign = %d", DR_MISALIGNMENT (dr));
-
- return true;
-}
-
-
-/* Function vect_compute_data_refs_alignment
-
- Compute the misalignment of data references in the loop.
- This pass may take place at function granularity instead of at loop
- granularity.
-
- FOR NOW: No analysis is actually performed. Misalignment is calculated
- only for trivial cases. TODO. */
-
-static bool
-vect_compute_data_refs_alignment (loop_vec_info loop_vinfo)
-{
- varray_type loop_write_datarefs = LOOP_VINFO_DATAREF_WRITES (loop_vinfo);
- varray_type loop_read_datarefs = LOOP_VINFO_DATAREF_READS (loop_vinfo);
- unsigned int i;
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_write_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_write_datarefs, i);
- if (!vect_compute_data_ref_alignment (dr))
- return false;
- }
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_read_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_read_datarefs, i);
- if (!vect_compute_data_ref_alignment (dr))
- return false;
- }
-
- return true;
-}
-
-
-/* Function vect_enhance_data_refs_alignment
-
- This pass will use loop versioning and loop peeling in order to enhance
- the alignment of data references in the loop.
-
- FOR NOW: we assume that whatever versioning/peeling takes place, only the
- original loop is to be vectorized; Any other loops that are created by
- the transformations performed in this pass - are not supposed to be
- vectorized. This restriction will be relaxed. */
-
-static void
-vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
-{
- varray_type loop_read_datarefs = LOOP_VINFO_DATAREF_READS (loop_vinfo);
- varray_type loop_write_datarefs = LOOP_VINFO_DATAREF_WRITES (loop_vinfo);
- unsigned int i;
-
- /*
- This pass will require a cost model to guide it whether to apply peeling
- or versioning or a combination of the two. For example, the scheme that
- intel uses when given a loop with several memory accesses, is as follows:
- choose one memory access ('p') which alignment you want to force by doing
- peeling. Then, either (1) generate a loop in which 'p' is aligned and all
- other accesses are not necessarily aligned, or (2) use loop versioning to
- generate one loop in which all accesses are aligned, and another loop in
- which only 'p' is necessarily aligned.
-
- ("Automatic Intra-Register Vectorization for the Intel Architecture",
- Aart J.C. Bik, Milind Girkar, Paul M. Grey and Ximmin Tian, International
- Journal of Parallel Programming, Vol. 30, No. 2, April 2002.)
-
- Devising a cost model is the most critical aspect of this work. It will
- guide us on which access to peel for, whether to use loop versioning, how
- many versions to create, etc. The cost model will probably consist of
- generic considerations as well as target specific considerations (on
- powerpc for example, misaligned stores are more painful than misaligned
- loads).
-
- Here is the general steps involved in alignment enhancements:
-
- -- original loop, before alignment analysis:
- for (i=0; i<N; i++){
- x = q[i]; # DR_MISALIGNMENT(q) = unknown
- p[i] = y; # DR_MISALIGNMENT(p) = unknown
- }
-
- -- After vect_compute_data_refs_alignment:
- for (i=0; i<N; i++){
- x = q[i]; # DR_MISALIGNMENT(q) = 3
- p[i] = y; # DR_MISALIGNMENT(p) = unknown
- }
-
- -- Possibility 1: we do loop versioning:
- if (p is aligned) {
- for (i=0; i<N; i++){ # loop 1A
- x = q[i]; # DR_MISALIGNMENT(q) = 3
- p[i] = y; # DR_MISALIGNMENT(p) = 0
- }
- }
- else {
- for (i=0; i<N; i++){ # loop 1B
- x = q[i]; # DR_MISALIGNMENT(q) = 3
- p[i] = y; # DR_MISALIGNMENT(p) = unaligned
- }
- }
-
- -- Possibility 2: we do loop peeling:
- for (i = 0; i < 3; i++){ # (scalar loop, not to be vectorized).
- x = q[i];
- p[i] = y;
- }
- for (i = 3; i < N; i++){ # loop 2A
- x = q[i]; # DR_MISALIGNMENT(q) = 0
- p[i] = y; # DR_MISALIGNMENT(p) = unknown
- }
-
- -- Possibility 3: combination of loop peeling and versioning:
- for (i = 0; i < 3; i++){ # (scalar loop, not to be vectorized).
- x = q[i];
- p[i] = y;
- }
- if (p is aligned) {
- for (i = 3; i<N; i++){ # loop 3A
- x = q[i]; # DR_MISALIGNMENT(q) = 0
- p[i] = y; # DR_MISALIGNMENT(p) = 0
- }
- }
- else {
- for (i = 3; i<N; i++){ # loop 3B
- x = q[i]; # DR_MISALIGNMENT(q) = 0
- p[i] = y; # DR_MISALIGNMENT(p) = unaligned
- }
- }
-
- These loops are later passed to loop_transform to be vectorized. The
- vectorizer will use the alignment information to guide the transformation
- (whether to generate regular loads/stores, or with special handling for
- misalignment).
- */
-
- /* (1) Peeling to force alignment. */
-
- /* (1.1) Decide whether to perform peeling, and how many iterations to peel:
- Considerations:
- + How many accesses will become aligned due to the peeling
- - How many accesses will become unaligned due to the peeling,
- and the cost of misaligned accesses.
- - The cost of peeling (the extra runtime checks, the increase
- in code size).
-
- The scheme we use FORNOW: peel to force the alignment of the first
- misaligned store in the loop.
- Rationale: misaligned stores are not yet supported.
-
- TODO: Use a better cost model. */
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_write_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_write_datarefs, i);
- if (!aligned_access_p (dr))
- {
- LOOP_VINFO_UNALIGNED_DR (loop_vinfo) = dr;
- LOOP_DO_PEELING_FOR_ALIGNMENT (loop_vinfo) = true;
- break;
- }
- }
-
- if (!LOOP_VINFO_UNALIGNED_DR (loop_vinfo))
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "Peeling for alignment will not be applied.");
- return;
- }
- else
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "Peeling for alignment will be applied.");
-
-
- /* (1.2) Update the alignment info according to the peeling factor.
- If the misalignment of the DR we peel for is M, then the
- peeling factor is VF - M, and the misalignment of each access DR_i
- in the loop is DR_MISALIGNMENT (DR_i) + VF - M.
- If the misalignment of the DR we peel for is unknown, then the
- misalignment of each access DR_i in the loop is also unknown.
-
- FORNOW: set the misalignment of the accesses to unknown even
- if the peeling factor is known at compile time.
-
- TODO: - if the peeling factor is known at compile time, use that
- when updating the misalignment info of the loop DRs.
- - consider accesses that are known to have the same
- alignment, even if that alignment is unknown. */
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_write_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_write_datarefs, i);
- if (dr == LOOP_VINFO_UNALIGNED_DR (loop_vinfo))
- {
- DR_MISALIGNMENT (dr) = 0;
- if (vect_debug_details (LOOP_LOC (loop_vinfo))
- || vect_debug_stats (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "Alignment of access forced using peeling.");
- }
- else
- DR_MISALIGNMENT (dr) = -1;
- }
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_read_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_read_datarefs, i);
- if (dr == LOOP_VINFO_UNALIGNED_DR (loop_vinfo))
- {
- DR_MISALIGNMENT (dr) = 0;
- if (vect_debug_details (LOOP_LOC (loop_vinfo))
- || vect_debug_stats (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "Alignment of access forced using peeling.");
- }
- else
- DR_MISALIGNMENT (dr) = -1;
- }
-}
-
-
-/* Function vect_analyze_data_refs_alignment
-
- Analyze the alignment of the data-references in the loop.
- FOR NOW: Until support for misliagned accesses is in place, only if all
- accesses are aligned can the loop be vectorized. This restriction will be
- relaxed. */
-
-static bool
-vect_analyze_data_refs_alignment (loop_vec_info loop_vinfo)
-{
- varray_type loop_read_datarefs = LOOP_VINFO_DATAREF_READS (loop_vinfo);
- varray_type loop_write_datarefs = LOOP_VINFO_DATAREF_WRITES (loop_vinfo);
- enum dr_alignment_support supportable_dr_alignment;
- unsigned int i;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_analyze_data_refs_alignment>>\n");
-
-
- /* This pass may take place at function granularity instead of at loop
- granularity. */
-
- if (!vect_compute_data_refs_alignment (loop_vinfo))
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo))
- || vect_debug_stats (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file,
- "not vectorized: can't calculate alignment for data ref.");
- return false;
- }
-
-
- /* This pass will decide on using loop versioning and/or loop peeling in
- order to enhance the alignment of data references in the loop. */
-
- vect_enhance_data_refs_alignment (loop_vinfo);
-
-
- /* Finally, check that all the data references in the loop can be
- handled with respect to their alignment. */
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_read_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_read_datarefs, i);
- supportable_dr_alignment = vect_supportable_dr_alignment (dr);
- if (!supportable_dr_alignment)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo))
- || vect_debug_stats (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unsupported unaligned load.");
- return false;
- }
- if (supportable_dr_alignment != dr_aligned
- && (vect_debug_details (LOOP_LOC (loop_vinfo))
- || vect_debug_stats (LOOP_LOC (loop_vinfo))))
- fprintf (dump_file, "Vectorizing an unaligned access.");
- }
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_write_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_write_datarefs, i);
- supportable_dr_alignment = vect_supportable_dr_alignment (dr);
- if (!supportable_dr_alignment)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo))
- || vect_debug_stats (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unsupported unaligned store.");
- return false;
- }
- if (supportable_dr_alignment != dr_aligned
- && (vect_debug_details (LOOP_LOC (loop_vinfo))
- || vect_debug_stats (LOOP_LOC (loop_vinfo))))
- fprintf (dump_file, "Vectorizing an unaligned access.");
- }
-
- return true;
-}
-
-
-/* Function vect_analyze_data_ref_access.
-
- Analyze the access pattern of the data-reference DR. For now, a data access
- has to consecutive to be considered vectorizable. */
-
-static bool
-vect_analyze_data_ref_access (struct data_reference *dr)
-{
- tree stmt = DR_STMT (dr);
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree step = STMT_VINFO_VECT_STEP (stmt_info);
- tree scalar_type = TREE_TYPE (DR_REF (dr));
-
- if (!step || tree_int_cst_compare (step, TYPE_SIZE_UNIT (scalar_type)))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "not consecutive access");
- return false;
- }
- return true;
-}
-
-
-/* Function vect_analyze_data_ref_accesses.
-
- Analyze the access pattern of all the data references in the loop.
-
- FORNOW: the only access pattern that is considered vectorizable is a
- simple step 1 (consecutive) access.
-
- FORNOW: handle only arrays and pointer accesses. */
-
-static bool
-vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo)
-{
- unsigned int i;
- varray_type loop_write_datarefs = LOOP_VINFO_DATAREF_WRITES (loop_vinfo);
- varray_type loop_read_datarefs = LOOP_VINFO_DATAREF_READS (loop_vinfo);
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_analyze_data_ref_accesses>>\n");
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_write_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_write_datarefs, i);
- bool ok = vect_analyze_data_ref_access (dr);
- if (!ok)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: complicated access pattern.");
- return false;
- }
- }
-
- for (i = 0; i < VARRAY_ACTIVE_SIZE (loop_read_datarefs); i++)
- {
- struct data_reference *dr = VARRAY_GENERIC_PTR (loop_read_datarefs, i);
- bool ok = vect_analyze_data_ref_access (dr);
- if (!ok)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: complicated access pattern.");
- return false;
- }
- }
-
- return true;
-}
-
-
-/* Function vect_analyze_pointer_ref_access.
-
- Input:
- STMT - a stmt that contains a data-ref
- MEMREF - a data-ref in STMT, which is an INDIRECT_REF.
-
- If the data-ref access is vectorizable, return a data_reference structure
- that represents it (DR). Otherwise - return NULL. */
-
-static struct data_reference *
-vect_analyze_pointer_ref_access (tree memref, tree stmt, bool is_read)
-{
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree access_fn = analyze_scalar_evolution (loop, TREE_OPERAND (memref, 0));
- tree init, step;
- tree reftype, innertype;
- tree indx_access_fn;
- int loopnum = loop->num;
- struct data_reference *dr;
-
- if (!access_fn)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: complicated pointer access.");
- return NULL;
- }
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "Access function of ptr: ");
- print_generic_expr (dump_file, access_fn, TDF_SLIM);
- }
-
- if (!vect_is_simple_iv_evolution (loopnum, access_fn, &init, &step, false))
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: pointer access is not simple.");
- return NULL;
- }
-
- STRIP_NOPS (init);
-
- if (!expr_invariant_in_loop_p (loop, init))
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file,
- "not vectorized: initial condition is not loop invariant.");
- return NULL;
- }
-
- if (TREE_CODE (step) != INTEGER_CST)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file,
- "not vectorized: non constant step for pointer access.");
- return NULL;
- }
-
- reftype = TREE_TYPE (TREE_OPERAND (memref, 0));
- if (TREE_CODE (reftype) != POINTER_TYPE)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unexpected pointer access form.");
- return NULL;
- }
-
- reftype = TREE_TYPE (init);
- if (TREE_CODE (reftype) != POINTER_TYPE)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unexpected pointer access form.");
- return NULL;
- }
-
- innertype = TREE_TYPE (reftype);
- if (tree_int_cst_compare (TYPE_SIZE_UNIT (innertype), step))
- {
- /* FORNOW: support only consecutive access */
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: non consecutive access.");
- return NULL;
- }
-
- STMT_VINFO_VECT_STEP (stmt_info) = fold_convert (ssizetype, step);
- if (TREE_CODE (init) == PLUS_EXPR
- || TREE_CODE (init) == MINUS_EXPR)
- STMT_VINFO_VECT_INIT_OFFSET (stmt_info) =
- size_binop (TREE_CODE (init), ssize_int (0),
- fold_convert (ssizetype, TREE_OPERAND (init, 1)));
- else
- STMT_VINFO_VECT_INIT_OFFSET (stmt_info) = ssize_int (0);
-
- indx_access_fn =
- build_polynomial_chrec (loopnum, integer_zero_node, integer_one_node);
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- {
- fprintf (dump_file, "Access function of ptr indx: ");
- print_generic_expr (dump_file, indx_access_fn, TDF_SLIM);
- }
- dr = init_data_ref (stmt, memref, init, indx_access_fn, is_read);
- return dr;
-}
-
-
-/* Function vect_get_memtag_and_dr.
-
- The function returns the relevant variable for memory tag (for aliasing
- purposes). Also data reference structure DR is created.
-
- This function handles three kinds of MEMREF:
-
- It is called from vect_analyze_data_refs with a MEMREF that is either an
- ARRAY_REF or an INDIRECT_REF (this is category 1 - "recursion begins").
- It builds a DR for them using vect_get_base_and_offset, and calls itself
- recursively to retrieve the relevant memtag for the MEMREF, "peeling" the
- MEMREF along the way. During the recursive calls, the function may be called
- with a MEMREF for which the recursion has to continue - PLUS_EXPR,
- MINUS_EXPR, INDIRECT_REF (category 2 - "recursion continues"),
- and/or with a MEMREF for which a memtag can be trivially obtained - VAR_DECL
- and SSA_NAME (this is category 3 - "recursion stop condition").
-
- When the MEMREF falls into category 1 there is still no data reference struct
- (DR) available. It is created by this function, and then, along the
- recursion, MEMREF will fall into category 2 or 3, in which case a DR will
- have already been created, but the analysis continues to retrieve the MEMTAG.
-
- Input:
- MEMREF - data reference in STMT
- IS_READ - TRUE if STMT reads from MEMREF, FALSE if writes to MEMREF
-
- Output:
- DR - data_reference struct for MEMREF
- return value - the relevant variable for memory tag (for aliasing purposes).
-
-*/
-
-static tree
-vect_get_memtag_and_dr (tree memref, tree stmt, bool is_read,
- loop_vec_info loop_vinfo,
- tree vectype, struct data_reference **dr)
-{
- tree symbl, oprnd0, oprnd1;
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree offset, misalign, step;
- tree ref_to_be_analyzed, tag, dr_base;
- struct data_reference *new_dr;
- bool base_aligned_p;
-
- if (*dr)
- {
- /* Category 3: recursion stop condition. */
- /* (1) A DR already exists. We only need to get the relevant memtag for
- MEMREF, the rest of the data was already initialized. */
-
- switch (TREE_CODE (memref))
- {
- /* (1.1) Stop condition: find the relevant memtag and return. */
- case SSA_NAME:
- symbl = SSA_NAME_VAR (memref);
- tag = get_var_ann (symbl)->type_mem_tag;
- if (!tag)
- {
- tree ptr = TREE_OPERAND (DR_REF ((*dr)), 0);
- if (TREE_CODE (ptr) == SSA_NAME)
- tag = get_var_ann (SSA_NAME_VAR (ptr))->type_mem_tag;
- }
- if (!tag)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "not vectorized: no memtag for ref.");
- return NULL_TREE;
- }
- return tag;
-
- case VAR_DECL:
- case PARM_DECL:
- return memref;
-
- /* Category 2: recursion continues. */
- /* (1.2) A recursive call to find the relevant memtag is required. */
- case INDIRECT_REF:
- symbl = TREE_OPERAND (memref, 0);
- break; /* For recursive call. */
-
- case COMPONENT_REF:
- /* Could have recorded more accurate information -
- i.e, the actual FIELD_DECL that is being referenced -
- but later passes expect VAR_DECL as the nmt. */
- /* Fall through. */
-
- case ADDR_EXPR:
- symbl = STMT_VINFO_VECT_DR_BASE (stmt_info);
- break; /* For recursive call. */
-
- case PLUS_EXPR:
- case MINUS_EXPR:
- /* Although DR exists, we have to call the function recursively to
- build MEMTAG for such expression. This is handled below. */
- oprnd0 = TREE_OPERAND (memref, 0);
- oprnd1 = TREE_OPERAND (memref, 1);
-
- STRIP_NOPS (oprnd1);
- /* Supported plus/minus expressions are of the form
- {address_base + offset}, such that address_base is of type
- POINTER/ARRAY, and offset is either an INTEGER_CST of type POINTER,
- or it's not of type POINTER/ARRAY.
- TODO: swap operands if {offset + address_base}. */
- if ((TREE_CODE (TREE_TYPE (oprnd1)) == POINTER_TYPE
- && TREE_CODE (oprnd1) != INTEGER_CST)
- || TREE_CODE (TREE_TYPE (oprnd1)) == ARRAY_TYPE)
- return NULL_TREE;
-
- symbl = oprnd0;
- break; /* For recursive call. */
-
- default:
- return NULL_TREE;
- }
- }
- else
- {
- /* Category 1: recursion begins. */
- /* (2) A DR does not exist yet and must be built, followed by a
- recursive call to get the relevant memtag for MEMREF. */
-
- switch (TREE_CODE (memref))
- {
- case INDIRECT_REF:
- new_dr = vect_analyze_pointer_ref_access (memref, stmt, is_read);
- if (!new_dr)
- return NULL_TREE;
- *dr = new_dr;
- symbl = DR_BASE_NAME (new_dr);
- ref_to_be_analyzed = DR_BASE_NAME (new_dr);
- break;
-
- case ARRAY_REF:
- new_dr = analyze_array (stmt, memref, is_read);
- *dr = new_dr;
- symbl = DR_BASE_NAME (new_dr);
- ref_to_be_analyzed = memref;
- break;
-
- default:
- /* TODO: Support data-refs of form a[i].p for unions and single
- field structures. */
- return NULL_TREE;
- }
-
- offset = ssize_int (0);
- misalign = ssize_int (0);
- step = ssize_int (0);
-
- /* Analyze data-ref, find its base, initial offset from the base, step,
- and alignment. */
- dr_base = vect_get_base_and_offset (new_dr, ref_to_be_analyzed,
- vectype, loop_vinfo, &offset,
- &misalign, &step, &base_aligned_p);
- if (!dr_base)
- return NULL_TREE;
-
- /* Initialize information according to above analysis. */
- /* Since offset and step of a pointer can be also set in
- vect_analyze_pointer_ref_access, we combine the values here. */
- if (STMT_VINFO_VECT_INIT_OFFSET (stmt_info))
- STMT_VINFO_VECT_INIT_OFFSET (stmt_info) =
- size_binop (PLUS_EXPR, offset,
- STMT_VINFO_VECT_INIT_OFFSET (stmt_info));
- else
- STMT_VINFO_VECT_INIT_OFFSET (stmt_info) = offset;
-
- if (step && STMT_VINFO_VECT_STEP (stmt_info))
- STMT_VINFO_VECT_STEP (stmt_info) =
- size_binop (PLUS_EXPR, step, STMT_VINFO_VECT_STEP (stmt_info));
- else
- STMT_VINFO_VECT_STEP (stmt_info) = step;
-
- STMT_VINFO_VECT_BASE_ALIGNED_P (stmt_info) = base_aligned_p;
- STMT_VINFO_VECT_MISALIGNMENT (stmt_info) = misalign;
- STMT_VINFO_VECT_DR_BASE (stmt_info) = dr_base;
- }
-
- if (!symbl)
- return NULL_TREE;
- /* Recursive call to retrieve the relevant memtag. */
- tag = vect_get_memtag_and_dr (symbl, stmt, is_read, loop_vinfo, vectype, dr);
- return tag;
-}
-
-
-/* Function vect_analyze_data_refs.
-
- Find all the data references in the loop.
-
- The general structure of the analysis of data refs in the vectorizer is as
- follows:
- 1- vect_analyze_data_refs(loop):
- Find and analyze all data-refs in the loop:
- foreach ref
- ref_stmt.memtag = vect_get_memtag_and_dr (ref)
- 1.1- vect_get_memtag_and_dr(ref):
- Analyze ref, and build a DR (data_referece struct) for it;
- call vect_get_base_and_offset to compute base, initial_offset,
- step and alignment. Set ref_stmt.base, ref_stmt.initial_offset,
- ref_stmt.alignment, and ref_stmt.step accordingly.
- 1.1.1- vect_get_base_and_offset():
- Calculate base, initial_offset, step and alignment.
- For ARRAY_REFs and COMPONENT_REFs use call get_inner_reference.
- 2- vect_analyze_dependences(): apply dependence testing using ref_stmt.DR
- 3- vect_analyze_drs_alignment(): check that ref_stmt.alignment is ok.
- 4- vect_analyze_drs_access(): check that ref_stmt.step is ok.
-
- FORNOW: Handle aligned INDIRECT_REFs and ARRAY_REFs
- which base is really an array (not a pointer) and which alignment
- can be forced. This restriction will be relaxed. */
-
-static bool
-vect_analyze_data_refs (loop_vec_info loop_vinfo)
-{
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
- int nbbs = loop->num_nodes;
- block_stmt_iterator si;
- int j;
- struct data_reference *dr;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_analyze_data_refs>>\n");
-
- for (j = 0; j < nbbs; j++)
- {
- basic_block bb = bbs[j];
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- {
- bool is_read = false;
- tree stmt = bsi_stmt (si);
- stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- v_may_def_optype v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
- v_must_def_optype v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
- vuse_optype vuses = STMT_VUSE_OPS (stmt);
- varray_type *datarefs = NULL;
- int nvuses, nv_may_defs, nv_must_defs;
- tree memref = NULL;
- tree symbl;
- tree scalar_type, vectype;
-
- /* Assumption: there exists a data-ref in stmt, if and only if
- it has vuses/vdefs. */
-
- if (!vuses && !v_may_defs && !v_must_defs)
- continue;
-
- nvuses = NUM_VUSES (vuses);
- nv_may_defs = NUM_V_MAY_DEFS (v_may_defs);
- nv_must_defs = NUM_V_MUST_DEFS (v_must_defs);
-
- if (nvuses && (nv_may_defs || nv_must_defs))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "unexpected vdefs and vuses in stmt: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
- return false;
- }
-
- if (TREE_CODE (stmt) != MODIFY_EXPR)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "unexpected vops in stmt: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
- return false;
- }
-
- if (vuses)
- {
- memref = TREE_OPERAND (stmt, 1);
- datarefs = &(LOOP_VINFO_DATAREF_READS (loop_vinfo));
- is_read = true;
- }
- else /* vdefs */
- {
- memref = TREE_OPERAND (stmt, 0);
- datarefs = &(LOOP_VINFO_DATAREF_WRITES (loop_vinfo));
- is_read = false;
- }
-
- scalar_type = TREE_TYPE (memref);
- vectype = get_vectype_for_scalar_type (scalar_type);
- if (!vectype)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "no vectype for stmt: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- fprintf (dump_file, " scalar_type: ");
- print_generic_expr (dump_file, scalar_type, TDF_DETAILS);
- }
- /* It is not possible to vectorize this data reference. */
- return false;
- }
- /* Analyze MEMREF. If it is of a supported form, build data_reference
- struct for it (DR) and find memtag for aliasing purposes. */
- dr = NULL;
- symbl = vect_get_memtag_and_dr (memref, stmt, is_read, loop_vinfo,
- vectype, &dr);
- if (!symbl)
- {
- if (vect_debug_stats (LOOP_LOC (loop_vinfo))
- || vect_debug_details (LOOP_LOC (loop_vinfo)))
- {
- fprintf (dump_file, "not vectorized: unhandled data ref: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
- return false;
- }
- STMT_VINFO_MEMTAG (stmt_info) = symbl;
- STMT_VINFO_VECTYPE (stmt_info) = vectype;
- VARRAY_PUSH_GENERIC_PTR (*datarefs, dr);
- STMT_VINFO_DATA_REF (stmt_info) = dr;
- }
- }
-
return true;
}
-/* Utility functions used by vect_mark_stmts_to_be_vectorized. */
-
-/* Function vect_mark_relevant.
-
- Mark STMT as "relevant for vectorization" and add it to WORKLIST. */
-
-static void
-vect_mark_relevant (varray_type *worklist, tree stmt)
-{
- stmt_vec_info stmt_info;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "mark relevant.");
-
- if (TREE_CODE (stmt) == PHI_NODE)
- {
- VARRAY_PUSH_TREE (*worklist, stmt);
- return;
- }
-
- stmt_info = vinfo_for_stmt (stmt);
-
- if (!stmt_info)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "mark relevant: no stmt info!!.");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
- return;
- }
-
- if (STMT_VINFO_RELEVANT_P (stmt_info))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "already marked relevant.");
- return;
- }
-
- STMT_VINFO_RELEVANT_P (stmt_info) = 1;
- VARRAY_PUSH_TREE (*worklist, stmt);
-}
-
-
-/* Function vect_stmt_relevant_p.
-
- Return true if STMT in loop that is represented by LOOP_VINFO is
- "relevant for vectorization".
-
- A stmt is considered "relevant for vectorization" if:
- - it has uses outside the loop.
- - it has vdefs (it alters memory).
- - control stmts in the loop (except for the exit condition).
-
- CHECKME: what other side effects would the vectorizer allow? */
-
-static bool
-vect_stmt_relevant_p (tree stmt, loop_vec_info loop_vinfo)
-{
- v_may_def_optype v_may_defs;
- v_must_def_optype v_must_defs;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- int i;
- dataflow_t df;
- int num_uses;
-
- /* cond stmt other than loop exit cond. */
- if (is_ctrl_stmt (stmt) && (stmt != LOOP_VINFO_EXIT_COND (loop_vinfo)))
- return true;
-
- /* changing memory. */
- v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
- v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
- if (v_may_defs || v_must_defs)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "vec_stmt_relevant_p: stmt has vdefs.");
- return true;
- }
-
- /* uses outside the loop. */
- df = get_immediate_uses (stmt);
- num_uses = num_immediate_uses (df);
- for (i = 0; i < num_uses; i++)
- {
- tree use = immediate_use (df, i);
- basic_block bb = bb_for_stmt (use);
- if (!flow_bb_inside_loop_p (loop, bb))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "vec_stmt_relevant_p: used out of loop.");
- return true;
- }
- }
-
- return false;
-}
-
-
-/* Function vect_mark_stmts_to_be_vectorized.
-
- Not all stmts in the loop need to be vectorized. For example:
-
- for i...
- for j...
- 1. T0 = i + j
- 2. T1 = a[T0]
-
- 3. j = j + 1
-
- Stmt 1 and 3 do not need to be vectorized, because loop control and
- addressing of vectorized data-refs are handled differently.
-
- This pass detects such stmts. */
-
-static bool
-vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
-{
- varray_type worklist;
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
- unsigned int nbbs = loop->num_nodes;
- block_stmt_iterator si;
- tree stmt;
- stmt_ann_t ann;
- unsigned int i;
- int j;
- use_optype use_ops;
- stmt_vec_info stmt_info;
- basic_block bb;
- tree phi;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<vect_mark_stmts_to_be_vectorized>>\n");
-
- bb = loop->header;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "init: phi relevant? ");
- print_generic_expr (dump_file, phi, TDF_SLIM);
- }
-
- if (vect_stmt_relevant_p (phi, loop_vinfo))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "unsupported reduction/induction.");
- return false;
- }
- }
-
- VARRAY_TREE_INIT (worklist, 64, "work list");
-
- /* 1. Init worklist. */
-
- for (i = 0; i < nbbs; i++)
- {
- bb = bbs[i];
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- {
- stmt = bsi_stmt (si);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "init: stmt relevant? ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
-
- stmt_info = vinfo_for_stmt (stmt);
- STMT_VINFO_RELEVANT_P (stmt_info) = 0;
-
- if (vect_stmt_relevant_p (stmt, loop_vinfo))
- vect_mark_relevant (&worklist, stmt);
- }
- }
-
-
- /* 2. Process_worklist */
-
- while (VARRAY_ACTIVE_SIZE (worklist) > 0)
- {
- stmt = VARRAY_TOP_TREE (worklist);
- VARRAY_POP (worklist);
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "worklist: examine stmt: ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
- }
-
- /* Examine the USES in this statement. Mark all the statements which
- feed this statement's uses as "relevant", unless the USE is used as
- an array index. */
-
- if (TREE_CODE (stmt) == PHI_NODE)
- {
- /* follow the def-use chain inside the loop. */
- for (j = 0; j < PHI_NUM_ARGS (stmt); j++)
- {
- tree arg = PHI_ARG_DEF (stmt, j);
- tree def_stmt = NULL_TREE;
- basic_block bb;
- if (!vect_is_simple_use (arg, loop_vinfo, &def_stmt))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "worklist: unsupported use.");
- varray_clear (worklist);
- return false;
- }
- if (!def_stmt)
- continue;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "worklist: def_stmt: ");
- print_generic_expr (dump_file, def_stmt, TDF_SLIM);
- }
-
- bb = bb_for_stmt (def_stmt);
- if (flow_bb_inside_loop_p (loop, bb))
- vect_mark_relevant (&worklist, def_stmt);
- }
- }
-
- ann = stmt_ann (stmt);
- use_ops = USE_OPS (ann);
-
- for (i = 0; i < NUM_USES (use_ops); i++)
- {
- tree use = USE_OP (use_ops, i);
-
- /* We are only interested in uses that need to be vectorized. Uses
- that are used for address computation are not considered relevant.
- */
- if (exist_non_indexing_operands_for_use_p (use, stmt))
- {
- tree def_stmt = NULL_TREE;
- basic_block bb;
- if (!vect_is_simple_use (use, loop_vinfo, &def_stmt))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "worklist: unsupported use.");
- varray_clear (worklist);
- return false;
- }
-
- if (!def_stmt)
- continue;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "worklist: examine use %d: ", i);
- print_generic_expr (dump_file, use, TDF_SLIM);
- }
-
- bb = bb_for_stmt (def_stmt);
- if (flow_bb_inside_loop_p (loop, bb))
- vect_mark_relevant (&worklist, def_stmt);
- }
- }
- } /* while worklist */
-
- varray_clear (worklist);
- return true;
-}
-
-
-/* Function vect_can_advance_ivs_p
-
- In case the number of iterations that LOOP iterates in unknown at compile
- time, an epilog loop will be generated, and the loop induction variables
- (IVs) will be "advanced" to the value they are supposed to take just before
- the epilog loop. Here we check that the access function of the loop IVs
- and the expression that represents the loop bound are simple enough.
- These restrictions will be relaxed in the future. */
-
-static bool
-vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
-{
- struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- basic_block bb = loop->header;
- tree phi;
-
- /* Analyze phi functions of the loop header. */
-
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- tree access_fn = NULL;
- tree evolution_part;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "Analyze phi: ");
- print_generic_expr (dump_file, phi, TDF_SLIM);
- }
-
- /* Skip virtual phi's. The data dependences that are associated with
- virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */
-
- if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "virtual phi. skip.");
- continue;
- }
-
- /* Analyze the evolution function. */
-
- access_fn = instantiate_parameters
- (loop, analyze_scalar_evolution (loop, PHI_RESULT (phi)));
-
- if (!access_fn)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "No Access function.");
- return false;
- }
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "Access function of PHI: ");
- print_generic_expr (dump_file, access_fn, TDF_SLIM);
- }
-
- evolution_part = evolution_part_in_loop_num (access_fn, loop->num);
-
- if (evolution_part == NULL_TREE)
- return false;
-
- /* FORNOW: We do not transform initial conditions of IVs
- which evolution functions are a polynomial of degree >= 2. */
-
- if (tree_is_chrec (evolution_part))
- return false;
- }
-
- return true;
-}
-
-
-/* Function vect_get_loop_niters.
-
- Determine how many iterations the loop is executed.
- If an expression that represents the number of iterations
- can be constructed, place it in NUMBER_OF_ITERATIONS.
- Return the loop exit condition. */
-
-static tree
-vect_get_loop_niters (struct loop *loop, tree *number_of_iterations)
-{
- tree niters;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<get_loop_niters>>\n");
-
- niters = number_of_iterations_in_loop (loop);
-
- if (niters != NULL_TREE
- && niters != chrec_dont_know)
- {
- *number_of_iterations = niters;
-
- if (vect_debug_details (UNKNOWN_LOC))
- {
- fprintf (dump_file, "==> get_loop_niters:" );
- print_generic_expr (dump_file, *number_of_iterations, TDF_SLIM);
- }
- }
-
- return get_loop_exit_condition (loop);
-}
-
-
-/* Function vect_analyze_loop_form.
-
- Verify the following restrictions (some may be relaxed in the future):
- - it's an inner-most loop
- - number of BBs = 2 (which are the loop header and the latch)
- - the loop has a pre-header
- - the loop has a single entry and exit
- - the loop exit condition is simple enough, and the number of iterations
- can be analyzed (a countable loop). */
-
-static loop_vec_info
-vect_analyze_loop_form (struct loop *loop)
-{
- loop_vec_info loop_vinfo;
- tree loop_cond;
- tree number_of_iterations = NULL;
- bool rescan = false;
- LOC loop_loc;
-
- loop_loc = find_loop_location (loop);
-
- if (vect_debug_details (loop_loc))
- fprintf (dump_file, "\n<<vect_analyze_loop_form>>\n");
-
- if (loop->inner
- || !loop->single_exit
- || loop->num_nodes != 2
- || EDGE_COUNT (loop->header->preds) != 2
- || loop->num_entries != 1)
- {
- if (vect_debug_stats (loop_loc) || vect_debug_details (loop_loc))
- {
- fprintf (dump_file, "not vectorized: bad loop form. ");
- if (loop->inner)
- fprintf (dump_file, "nested loop.");
- else if (!loop->single_exit)
- fprintf (dump_file, "multiple exits.");
- else if (loop->num_nodes != 2)
- fprintf (dump_file, "too many BBs in loop.");
- else if (EDGE_COUNT (loop->header->preds) != 2)
- fprintf (dump_file, "too many incoming edges.");
- else if (loop->num_entries != 1)
- fprintf (dump_file, "too many entries.");
- }
-
- return NULL;
- }
-
- /* We assume that the loop exit condition is at the end of the loop. i.e,
- that the loop is represented as a do-while (with a proper if-guard
- before the loop if needed), where the loop header contains all the
- executable statements, and the latch is empty. */
- if (!empty_block_p (loop->latch))
- {
- if (vect_debug_stats (loop_loc) || vect_debug_details (loop_loc))
- fprintf (dump_file, "not vectorized: unexpectd loop form.");
- return NULL;
- }
-
- /* Make sure we have a preheader basic block. */
- if (!loop->pre_header)
- {
- rescan = true;
- loop_split_edge_with (loop_preheader_edge (loop), NULL);
- }
-
- /* Make sure there exists a single-predecessor exit bb: */
- if (EDGE_COUNT (loop->exit_edges[0]->dest->preds) != 1)
- {
- rescan = true;
- loop_split_edge_with (loop->exit_edges[0], NULL);
- }
-
- if (rescan)
- {
- flow_loop_scan (loop, LOOP_ALL);
- /* Flow loop scan does not update loop->single_exit field. */
- loop->single_exit = loop->exit_edges[0];
- }
-
- if (empty_block_p (loop->header))
- {
- if (vect_debug_stats (loop_loc) || vect_debug_details (loop_loc))
- fprintf (dump_file, "not vectorized: empty loop.");
- return NULL;
- }
-
- loop_cond = vect_get_loop_niters (loop, &number_of_iterations);
- if (!loop_cond)
- {
- if (vect_debug_stats (loop_loc) || vect_debug_details (loop_loc))
- fprintf (dump_file, "not vectorized: complicated exit condition.");
- return NULL;
- }
-
- if (!number_of_iterations)
- {
- if (vect_debug_stats (loop_loc) || vect_debug_details (loop_loc))
- fprintf (dump_file,
- "not vectorized: number of iterations cannot be computed.");
- return NULL;
- }
-
- if (chrec_contains_undetermined (number_of_iterations))
- {
- if (vect_debug_details (loop_loc))
- fprintf (dump_file, "Infinite number of iterations.");
- return false;
- }
-
- loop_vinfo = new_loop_vec_info (loop);
- LOOP_VINFO_NITERS (loop_vinfo) = number_of_iterations;
-
- if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
- {
- if (vect_debug_details (loop_loc))
- {
- fprintf (dump_file, "loop bound unknown.\n");
- fprintf (dump_file, "Symbolic number of iterations is ");
- print_generic_expr (dump_file, number_of_iterations, TDF_DETAILS);
- }
- }
- else
- if (LOOP_VINFO_INT_NITERS (loop_vinfo) == 0)
- {
- if (vect_debug_stats (loop_loc) || vect_debug_details (loop_loc))
- fprintf (dump_file, "not vectorized: number of iterations = 0.");
- return NULL;
- }
-
- LOOP_VINFO_EXIT_COND (loop_vinfo) = loop_cond;
- LOOP_VINFO_LOC (loop_vinfo) = loop_loc;
-
- return loop_vinfo;
-}
-
-
-/* Function vect_analyze_loop.
-
- Apply a set of analyses on LOOP, and create a loop_vec_info struct
- for it. The different analyses will record information in the
- loop_vec_info struct. */
-
-static loop_vec_info
-vect_analyze_loop (struct loop *loop)
-{
- bool ok;
- loop_vec_info loop_vinfo;
-
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\n<<<<<<< analyze_loop_nest >>>>>>>\n");
-
- /* Check the CFG characteristics of the loop (nesting, entry/exit, etc. */
-
- loop_vinfo = vect_analyze_loop_form (loop);
- if (!loop_vinfo)
- {
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "bad loop form.");
- return NULL;
- }
-
- /* Find all data references in the loop (which correspond to vdefs/vuses)
- and analyze their evolution in the loop.
-
- FORNOW: Handle only simple, array references, which
- alignment can be forced, and aligned pointer-references. */
-
- ok = vect_analyze_data_refs (loop_vinfo);
- if (!ok)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "bad data references.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- /* Data-flow analysis to detect stmts that do not need to be vectorized. */
-
- ok = vect_mark_stmts_to_be_vectorized (loop_vinfo);
- if (!ok)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "unexpected pattern.");
- if (vect_debug_stats (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "not vectorized: unexpected pattern.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- /* Check that all cross-iteration scalar data-flow cycles are OK.
- Cross-iteration cycles caused by virtual phis are analyzed separately. */
-
- ok = vect_analyze_scalar_cycles (loop_vinfo);
- if (!ok)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "bad scalar cycle.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- /* Analyze data dependences between the data-refs in the loop.
- FORNOW: fail at the first data dependence that we encounter. */
-
- ok = vect_analyze_data_ref_dependences (loop_vinfo);
- if (!ok)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "bad data dependence.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- /* Analyze the access patterns of the data-refs in the loop (consecutive,
- complex, etc.). FORNOW: Only handle consecutive access pattern. */
-
- ok = vect_analyze_data_ref_accesses (loop_vinfo);
- if (!ok)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "bad data access.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- /* Analyze the alignment of the data-refs in the loop.
- FORNOW: Only aligned accesses are handled. */
-
- ok = vect_analyze_data_refs_alignment (loop_vinfo);
- if (!ok)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "bad data alignment.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- /* Scan all the operations in the loop and make sure they are
- vectorizable. */
-
- ok = vect_analyze_operations (loop_vinfo);
- if (!ok)
- {
- if (vect_debug_details (LOOP_LOC (loop_vinfo)))
- fprintf (dump_file, "bad operation or unsupported loop bound.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- LOOP_VINFO_VECTORIZABLE_P (loop_vinfo) = 1;
-
- return loop_vinfo;
-}
-
-
/* Function need_imm_uses_for.
Return whether we ought to include information for 'var'
@@ -5712,12 +1561,15 @@ vectorize_loops (struct loops *loops)
unsigned int i, loops_num;
unsigned int num_vectorized_loops = 0;
+ /* Fix the verbosity level if not defined explicitly by the user. */
+ vect_set_dump_settings ();
+
/* Does the target support SIMD? */
/* FORNOW: until more sophisticated machine modelling is in place. */
if (!UNITS_PER_SIMD_WORD)
{
- if (vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "vectorizer: target vector size is not defined.");
+ if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
+ fprintf (vect_dump, "vectorizer: target vector size is not defined.");
return;
}
@@ -5751,8 +1603,8 @@ vectorize_loops (struct loops *loops)
num_vectorized_loops++;
}
- if (vect_debug_stats (UNKNOWN_LOC) || vect_debug_details (UNKNOWN_LOC))
- fprintf (dump_file, "\nvectorized %u loops in function.\n",
+ if (vect_print_dump_info (REPORT_VECTORIZED_LOOPS, UNKNOWN_LOC))
+ fprintf (vect_dump, "vectorized %u loops in function.\n",
num_vectorized_loops);
/* ----------- Finalize. ----------- */
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 537e963542c..f974c708786 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1,5 +1,5 @@
/* Loop Vectorization
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Dorit Naishlos <dorit@il.ibm.com>
This file is part of GCC.
@@ -56,6 +56,19 @@ enum dr_alignment_support {
dr_aligned
};
+/* Define verbosity levels. */
+enum verbosity_levels {
+ REPORT_NONE,
+ REPORT_VECTORIZED_LOOPS,
+ REPORT_UNVECTORIZED_LOOPS,
+ REPORT_ALIGNMENT,
+ REPORT_BAD_FORM_LOOPS,
+ REPORT_OUTER_LOOPS,
+ REPORT_DETAILS,
+ /* New verbosity levels should be added before this one. */
+ MAX_VERBOSITY_LEVEL
+};
+
/*-----------------------------------------------------------------*/
/* Info on vectorized loops. */
/*-----------------------------------------------------------------*/
@@ -161,20 +174,25 @@ typedef struct _stmt_vec_info {
tree memtag;
/** The following fields are used to store the information about
- data-reference. {base + initial_offset} is the first location accessed by
- data-ref in the loop, and step is the stride of data-ref in the loop;
+ data-reference. {base_address + initial_offset} is the first location
+ accessed by data-ref in the loop, and step is the stride of data-ref in
+ the loop in bytes;
e.g.:
Example 1 Example 2
data-ref a[j].b[i][j] a + 4B (a is int*)
-
- base a a
+
+ base_address &a a
initial_offset j_0*D_j + i_0*D_i + C 4
step D_j 4
+ data-reference structure info:
+ base_name a NULL
+ access_fn <access_fns of indexes of b> (0, +, 1)
+
**/
- /* The above base, offset and step. */
- tree base;
+ /* The above base_address, offset and step. */
+ tree base_address;
tree initial_offset;
tree step;
@@ -195,7 +213,7 @@ typedef struct _stmt_vec_info {
#define STMT_VINFO_VEC_STMT(S) (S)->vectorized_stmt
#define STMT_VINFO_DATA_REF(S) (S)->data_ref_info
#define STMT_VINFO_MEMTAG(S) (S)->memtag
-#define STMT_VINFO_VECT_DR_BASE(S) (S)->base
+#define STMT_VINFO_VECT_DR_BASE_ADDRESS(S)(S)->base_address
#define STMT_VINFO_VECT_INIT_OFFSET(S) (S)->initial_offset
#define STMT_VINFO_VECT_STEP(S) (S)->step
#define STMT_VINFO_VECT_BASE_ALIGNED_P(S) (S)->base_aligned_p
@@ -240,17 +258,68 @@ unknown_alignment_for_access_p (struct data_reference *data_ref_info)
/* Perform signed modulo, always returning a non-negative value. */
#define VECT_SMODULO(x,y) ((x) % (y) < 0 ? ((x) % (y) + (y)) : (x) % (y))
+/* vect_dump will be set to stderr or dump_file if exist. */
+extern FILE *vect_dump;
+extern enum verbosity_levels vect_verbosity_level;
/*-----------------------------------------------------------------*/
/* Function prototypes. */
/*-----------------------------------------------------------------*/
-/* Main driver. */
-extern void vectorize_loops (struct loops *);
+/*************************************************************************
+ Simple Loop Peeling Utilities - in tree-vectorizer.c
+ *************************************************************************/
+/* Entry point for peeling of simple loops.
+ Peel the first/last iterations of a loop.
+ It can be used outside of the vectorizer for loops that are simple enough
+ (see function documentation). In the vectorizer it is used to peel the
+ last few iterations when the loop bound is unknown or does not evenly
+ divide by the vectorization factor, and to peel the first few iterations
+ to force the alignment of data references in the loop. */
+extern struct loop *slpeel_tree_peel_loop_to_edge
+ (struct loop *, struct loops *, edge, tree, tree, bool);
+extern void slpeel_make_loop_iterate_ntimes (struct loop *, tree);
+extern bool slpeel_can_duplicate_loop_p (struct loop *, edge);
+#ifdef ENABLE_CHECKING
+extern void slpeel_verify_cfg_after_peeling (struct loop *, struct loop *);
+#endif
+
-/* creation and deletion of loop and stmt info structs. */
+/*************************************************************************
+ General Vectorization Utilities
+ *************************************************************************/
+/** In tree-vectorizer.c **/
+extern tree vect_strip_conversion (tree);
+extern tree get_vectype_for_scalar_type (tree);
+extern bool vect_is_simple_use (tree , loop_vec_info, tree *);
+extern bool vect_is_simple_iv_evolution (unsigned, tree, tree *, tree *);
+extern bool vect_can_force_dr_alignment_p (tree, unsigned int);
+extern enum dr_alignment_support vect_supportable_dr_alignment
+ (struct data_reference *);
+/* Creation and deletion of loop and stmt info structs. */
extern loop_vec_info new_loop_vec_info (struct loop *loop);
extern void destroy_loop_vec_info (loop_vec_info);
extern stmt_vec_info new_stmt_vec_info (tree stmt, loop_vec_info);
+/* Main driver. */
+extern void vectorize_loops (struct loops *);
+
+/** In tree-vect-analyze.c **/
+/* Driver for analysis stage. */
+extern loop_vec_info vect_analyze_loop (struct loop *);
+
+/** In tree-vect-transform.c **/
+extern bool vectorizable_load (tree, block_stmt_iterator *, tree *);
+extern bool vectorizable_store (tree, block_stmt_iterator *, tree *);
+extern bool vectorizable_operation (tree, block_stmt_iterator *, tree *);
+extern bool vectorizable_assignment (tree, block_stmt_iterator *, tree *);
+/* Driver for transformation stage. */
+extern void vect_transform_loop (loop_vec_info, struct loops *);
+
+/*************************************************************************
+ Vectorization Debug Information - in tree-vectorizer.c
+ *************************************************************************/
+extern bool vect_print_dump_info (enum verbosity_levels, LOC);
+extern void vect_set_verbosity_level (const char *);
+extern LOC find_loop_location (struct loop *);
#endif /* GCC_TREE_VECTORIZER_H */
diff --git a/gcc/tree-vn.c b/gcc/tree-vn.c
index ab952ebadd0..f6263fd5dc4 100644
--- a/gcc/tree-vn.c
+++ b/gcc/tree-vn.c
@@ -1,5 +1,5 @@
/* Value Numbering routines for tree expressions.
- Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@dberlin.org>, Steven Bosscher
<stevenb@suse.de> and Diego Novillo <dnovillo@redhat.com>
@@ -267,11 +267,16 @@ vn_lookup_or_add (tree expr, vuse_optype vuses)
/* Get the value handle of EXPR. This is the only correct way to get
the value handle for a "thing". If EXPR does not have a value
- handle associated, it returns NULL_TREE. */
+ handle associated, it returns NULL_TREE.
+ NB: If EXPR is min_invariant, this function is *required* to return EXPR. */
tree
get_value_handle (tree expr)
{
+
+ if (is_gimple_min_invariant (expr))
+ return expr;
+
if (TREE_CODE (expr) == SSA_NAME)
return SSA_NAME_VALUE (expr);
else if (EXPR_P (expr) || DECL_P (expr))
@@ -280,10 +285,7 @@ get_value_handle (tree expr)
return ((ann) ? ann->common.value_handle : NULL_TREE);
}
else
- {
- gcc_assert (is_gimple_min_invariant (expr));
- return expr;
- }
+ gcc_unreachable ();
}
diff --git a/gcc/tree.c b/gcc/tree.c
index 6afc17f1f46..3a0054c507e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4538,9 +4538,14 @@ build_function_type_list (tree return_type, ...)
for (args = NULL_TREE; t != NULL_TREE; t = va_arg (p, tree))
args = tree_cons (NULL_TREE, t, args);
- last = args;
- args = nreverse (args);
- TREE_CHAIN (last) = void_list_node;
+ if (args == NULL_TREE)
+ args = void_list_node;
+ else
+ {
+ last = args;
+ args = nreverse (args);
+ TREE_CHAIN (last) = void_list_node;
+ }
args = build_function_type (return_type, args);
va_end (p);
@@ -5782,6 +5787,166 @@ build_common_tree_nodes_2 (int short_double)
}
}
+/* A subroutine of build_common_builtin_nodes. Define a builtin function. */
+
+static void
+local_define_builtin (const char *name, tree type, enum built_in_function code,
+ const char *library_name, int ecf_flags)
+{
+ tree decl;
+
+ decl = lang_hooks.builtin_function (name, type, code, BUILT_IN_NORMAL,
+ library_name, NULL_TREE);
+ if (ecf_flags & ECF_CONST)
+ TREE_READONLY (decl) = 1;
+ if (ecf_flags & ECF_PURE)
+ DECL_IS_PURE (decl) = 1;
+ if (ecf_flags & ECF_NORETURN)
+ TREE_THIS_VOLATILE (decl) = 1;
+ if (ecf_flags & ECF_NOTHROW)
+ TREE_NOTHROW (decl) = 1;
+ if (ecf_flags & ECF_MALLOC)
+ DECL_IS_MALLOC (decl) = 1;
+
+ built_in_decls[code] = decl;
+ implicit_built_in_decls[code] = decl;
+}
+
+/* Call this function after instantiating all builtins that the language
+ front end cares about. This will build the rest of the builtins that
+ are relied upon by the tree optimizers and the middle-end. */
+
+void
+build_common_builtin_nodes (void)
+{
+ tree tmp, ftype;
+
+ if (built_in_decls[BUILT_IN_MEMCPY] == NULL
+ || built_in_decls[BUILT_IN_MEMMOVE] == NULL)
+ {
+ tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
+ tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp);
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ ftype = build_function_type (ptr_type_node, tmp);
+
+ if (built_in_decls[BUILT_IN_MEMCPY] == NULL)
+ local_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY,
+ "memcpy", ECF_NOTHROW);
+ if (built_in_decls[BUILT_IN_MEMMOVE] == NULL)
+ local_define_builtin ("__builtin_memmove", ftype, BUILT_IN_MEMMOVE,
+ "memmove", ECF_NOTHROW);
+ }
+
+ if (built_in_decls[BUILT_IN_MEMCMP] == NULL)
+ {
+ tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
+ tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp);
+ tmp = tree_cons (NULL_TREE, const_ptr_type_node, tmp);
+ ftype = build_function_type (ptr_type_node, tmp);
+ local_define_builtin ("__builtin_memcmp", ftype, BUILT_IN_MEMCMP,
+ "memcmp", ECF_PURE | ECF_NOTHROW);
+ }
+
+ if (built_in_decls[BUILT_IN_MEMSET] == NULL)
+ {
+ tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
+ tmp = tree_cons (NULL_TREE, integer_type_node, tmp);
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ ftype = build_function_type (ptr_type_node, tmp);
+ local_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET,
+ "memset", ECF_NOTHROW);
+ }
+
+ if (built_in_decls[BUILT_IN_ALLOCA] == NULL)
+ {
+ tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
+ ftype = build_function_type (ptr_type_node, tmp);
+ local_define_builtin ("__builtin_alloca", ftype, BUILT_IN_ALLOCA,
+ "alloca", ECF_NOTHROW | ECF_MALLOC);
+ }
+
+ tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ ftype = build_function_type (void_type_node, tmp);
+ local_define_builtin ("__builtin_init_trampoline", ftype,
+ BUILT_IN_INIT_TRAMPOLINE,
+ "__builtin_init_trampoline", ECF_NOTHROW);
+
+ tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ ftype = build_function_type (ptr_type_node, tmp);
+ local_define_builtin ("__builtin_adjust_trampoline", ftype,
+ BUILT_IN_ADJUST_TRAMPOLINE,
+ "__builtin_adjust_trampoline",
+ ECF_CONST | ECF_NOTHROW);
+
+ tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ ftype = build_function_type (void_type_node, tmp);
+ local_define_builtin ("__builtin_nonlocal_goto", ftype,
+ BUILT_IN_NONLOCAL_GOTO,
+ "__builtin_nonlocal_goto",
+ ECF_NORETURN | ECF_NOTHROW);
+
+ ftype = build_function_type (ptr_type_node, void_list_node);
+ local_define_builtin ("__builtin_stack_save", ftype, BUILT_IN_STACK_SAVE,
+ "__builtin_stack_save", ECF_NOTHROW);
+
+ tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ ftype = build_function_type (void_type_node, tmp);
+ local_define_builtin ("__builtin_stack_restore", ftype,
+ BUILT_IN_STACK_RESTORE,
+ "__builtin_stack_restore", ECF_NOTHROW);
+
+ ftype = build_function_type (void_type_node, void_list_node);
+ local_define_builtin ("__builtin_profile_func_enter", ftype,
+ BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter", 0);
+ local_define_builtin ("__builtin_profile_func_exit", ftype,
+ BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit", 0);
+
+ /* Complex multiplication and division. These are handled as builtins
+ rather than optabs because emit_library_call_value doesn't support
+ complex. Further, we can do slightly better with folding these
+ beasties if the real and complex parts of the arguments are separate. */
+ {
+ enum machine_mode mode;
+
+ for (mode = MIN_MODE_COMPLEX_FLOAT; mode <= MAX_MODE_COMPLEX_FLOAT; ++mode)
+ {
+ char mode_name_buf[4], *q;
+ const char *p;
+ enum built_in_function mcode, dcode;
+ tree type, inner_type;
+
+ type = lang_hooks.types.type_for_mode (mode, 0);
+ if (type == NULL)
+ continue;
+ inner_type = TREE_TYPE (type);
+
+ tmp = tree_cons (NULL_TREE, inner_type, void_list_node);
+ tmp = tree_cons (NULL_TREE, inner_type, tmp);
+ tmp = tree_cons (NULL_TREE, inner_type, tmp);
+ tmp = tree_cons (NULL_TREE, inner_type, tmp);
+ ftype = build_function_type (type, tmp);
+
+ mcode = BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ dcode = BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+
+ for (p = GET_MODE_NAME (mode), q = mode_name_buf; *p; p++, q++)
+ *q = TOLOWER (*p);
+ *q = '\0';
+
+ built_in_names[mcode] = concat ("__mul", mode_name_buf, "3", NULL);
+ local_define_builtin (built_in_names[mcode], ftype, mcode,
+ built_in_names[mcode], ECF_CONST | ECF_NOTHROW);
+
+ built_in_names[dcode] = concat ("__div", mode_name_buf, "3", NULL);
+ local_define_builtin (built_in_names[dcode], ftype, dcode,
+ built_in_names[dcode], ECF_CONST | ECF_NOTHROW);
+ }
+ }
+}
+
/* HACK. GROSS. This is absolutely disgusting. I wish there was a
better way.
@@ -6193,4 +6358,42 @@ operand_equal_for_phi_arg_p (tree arg0, tree arg1)
return operand_equal_p (arg0, arg1, 0);
}
+/* Returns number of zeros at the end of binary representation of X.
+
+ ??? Use ffs if available? */
+
+tree
+num_ending_zeros (tree x)
+{
+ unsigned HOST_WIDE_INT fr, nfr;
+ unsigned num, abits;
+ tree type = TREE_TYPE (x);
+
+ if (TREE_INT_CST_LOW (x) == 0)
+ {
+ num = HOST_BITS_PER_WIDE_INT;
+ fr = TREE_INT_CST_HIGH (x);
+ }
+ else
+ {
+ num = 0;
+ fr = TREE_INT_CST_LOW (x);
+ }
+
+ for (abits = HOST_BITS_PER_WIDE_INT / 2; abits; abits /= 2)
+ {
+ nfr = fr >> abits;
+ if (nfr << abits == fr)
+ {
+ num += abits;
+ fr = nfr;
+ }
+ }
+
+ if (num > TYPE_PRECISION (type))
+ num = TYPE_PRECISION (type);
+
+ return build_int_cst_type (type, num);
+}
+
#include "gt-tree.h"
diff --git a/gcc/tree.h b/gcc/tree.h
index 10012e406fd..81992f904bd 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -182,18 +182,32 @@ extern const char *const built_in_class_names[4];
/* Codes that identify the various built in functions
so that expand_call can identify them quickly. */
-#define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM) ENUM,
+#define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) ENUM,
enum built_in_function
{
#include "builtins.def"
+ /* Complex division routines in libgcc. These are done via builtins
+ because emit_library_call_value can't handle complex values. */
+ BUILT_IN_COMPLEX_MUL_MIN,
+ BUILT_IN_COMPLEX_MUL_MAX
+ = BUILT_IN_COMPLEX_MUL_MIN
+ + MAX_MODE_COMPLEX_FLOAT
+ - MIN_MODE_COMPLEX_FLOAT,
+
+ BUILT_IN_COMPLEX_DIV_MIN,
+ BUILT_IN_COMPLEX_DIV_MAX
+ = BUILT_IN_COMPLEX_DIV_MIN
+ + MAX_MODE_COMPLEX_FLOAT
+ - MIN_MODE_COMPLEX_FLOAT,
+
/* Upper bound on non-language-specific builtins. */
END_BUILTINS
};
#undef DEF_BUILTIN
/* Names for the above. */
-extern const char *const built_in_names[(int) END_BUILTINS];
+extern const char * built_in_names[(int) END_BUILTINS];
/* Helper macros for math builtins. */
@@ -3275,6 +3289,7 @@ extern int integer_nonzerop (tree);
extern bool zero_p (tree);
extern bool cst_and_fits_in_hwi (tree);
+extern tree num_ending_zeros (tree);
/* staticp (tree x) is nonzero if X is a reference to data allocated
at a fixed address in memory. Returns the outermost data. */
@@ -3527,11 +3542,16 @@ extern tree fold_binary_to_constant (enum tree_code, tree, tree, tree);
extern tree fold_read_from_constant_string (tree);
extern tree int_const_binop (enum tree_code, tree, tree, int);
extern tree build_fold_addr_expr (tree);
-tree fold_build_cleanup_point_expr (tree type, tree expr);
+extern tree fold_build_cleanup_point_expr (tree type, tree expr);
+extern tree fold_strip_sign_ops (tree);
extern tree build_fold_addr_expr_with_type (tree, tree);
extern tree build_fold_indirect_ref (tree);
+extern tree fold_indirect_ref (tree);
extern tree constant_boolean_node (int, tree);
extern tree build_low_bits_mask (tree, unsigned);
+extern tree fold_complex_mult_parts (tree, tree, tree, tree, tree);
+extern tree fold_complex_div_parts (tree, tree, tree, tree, tree,
+ enum tree_code);
extern bool tree_swap_operands_p (tree, tree, bool);
extern enum tree_code swap_tree_comparison (enum tree_code);
@@ -3590,6 +3610,7 @@ extern int real_minus_onep (tree);
extern void init_ttree (void);
extern void build_common_tree_nodes (bool, bool);
extern void build_common_tree_nodes_2 (int);
+extern void build_common_builtin_nodes (void);
extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
extern tree build_range_type (tree, tree, tree);
extern HOST_WIDE_INT int_cst_value (tree);
@@ -3917,4 +3938,7 @@ extern bool thread_through_all_blocks (void);
/* In tree-gimple.c. */
extern tree get_base_address (tree t);
+/* In tree-vectorizer.c. */
+extern void vect_set_verbosity_level (const char *);
+
#endif /* GCC_TREE_H */
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index ff0d19c4db9..eb5c55da451 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,6 +1,95 @@
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * parse.y (function_invocation, variable-ref, make_plus_expression):
+ Pass location to tree_code_get_expression.
+ * treetree.c (tree_code_generate_return): Set EXPR_LOCUS on retval.
+ (tree_code_get_expression): Wrap variable references in NOP_EXPRs and
+ set EXPR_LOCATION on ret1.
+ * treetree.h (tree_code_get_expression): Take the location of the
+ expression as an argument.
+
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * treelang.texi: Treelang does have warnings.
+ * treetree.c (tree_code_create_function_prototype): Don't set
+ TREE_USED and set TREE_PUBLIC, DECL_EXTERNAL, and TREE_STATIC
+ as few times as needed on the function declaration.
+ (tree_code_create_function_initial): Don't set TREE_USED,
+ TREE_ADDRESSABLE, but set TREE_STATIC on the function declaration.
+ (tree_code_create_variable): Don't set TREE_USED on VAR_DECL.
+ (tree_code_get_expression): Set TREE_USED for variable references
+ and function calls.
+
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * parse.y: Do comparisons as the type of the first expression.
+ * treetree.c (tree_code_get_integer_value): Build integer constants
+ with the proper type.
+
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * Make-lang.in: Remove commented out code.
+ * lang-specs.h: Always pass -dumpbase to tree1.
+
+2005-02-25 James A. Morrrison <phython@gcc.gnu.org>
+
+ * treelang.texi: Remove extra contribution notice.
+ Split up some run-on sentences. Document function parameters
+ as optional. Indicate automatic variables can now be at any scope.
+ Mention literals are only signed if they are preceded by a unary
+ plus or minus. Clarify interoperability with C.
+
+2005-02-25 James A. Morrison <phython@gcc.gnu.org>
+
+ * treelang.texi: Fix whitespacing.
+
+2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+
+ PR other/19896
+ * treetree.c (tree_code_create_variable): Initialize DECL_EXTERNAL,
+ TREE_PUBLIC, and TREE_STATIC for var_decl to zero. Don't call
+ rest_of_decl_compilation on static variables.
+ (pushdecl): Put DECL_EXPRs into the current BIND_EXPR for automatic
+ variables.
+
+2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+
+ PR other/19897
+ * parse.y: (function_prototype): Accept EXTERNAL_REFERENCE_STORAGE.
+ Move function parameters check from ...
+ (function): ...Here. Update call to tree_code_create_function_initial.
+ (function_invocation): Use expressions_with_commas_opt instead of
+ expressions_with_commas.
+ (expressions_with_commas_opt): New rule.
+ * treetree.c (tree_code_create_function_prototype): Create PARM_DECLs
+ for function parameters.
+ (tree_code_create_function_initial): Remove PARMS parameter.
+ Don't create PARM_DECLs for function parameters.
+ * treetree.h (tree_code_create_function_initial): Remove PARMS
+ parameter.
+
+2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * parse.y: Update copyright.
+
+2005-02-13 James A. Morrison <phython@gcc.gnu.org>
+
+ * treetree.c (tree_lang_type_for_mode): Return NULL_TREE for all non
+ scalar integer types.
+
+2005-02-09 Richard Henderson <rth@redhat.com>
+
+ * treetree.c (treelang_init_decl_processing): Call
+ build_common_builtin_nodes.
+
+2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
+
+ * treelang.texi: Don't use local treelang version number. Don't
+ give last update date.
+
2005-02-01 James A. Morrison <phython@gcc.gnu.org>
- * (lex.l): Undef LINEMAP_POSITION_FOR_COLUMN before defining it.
+ * lex.l: Undef LINEMAP_POSITION_FOR_COLUMN before defining it.
2005-02-01 James A. Morrison <phython@gcc.gnu.org>
diff --git a/gcc/treelang/Make-lang.in b/gcc/treelang/Make-lang.in
index 5b9073515ed..54ae2e01b92 100644
--- a/gcc/treelang/Make-lang.in
+++ b/gcc/treelang/Make-lang.in
@@ -293,7 +293,6 @@ treelang.check: $(TESTSUITEDIR)/site.exp
gcc_extras="-B`cd ..;${PWD_COMMAND}` -B`cd ..;${PWD_COMMAND}`/treelang"; export gcc_extras; \
$(RUNTEST) --tool treelang $(RUNTESTFLAGS)
rm $(srcdir)/testsuite/treelang/{a01gcco01runpgmerr,a01gcc.out01,a01gcc.out01err}
-# GCC_EXTRAS="$(GCC_EXTRAS)"; export GCC_EXTRAS; \
# copy the output files from the current test to source ie say the new results are OK
treelang.check.fix: force
diff --git a/gcc/treelang/lang-specs.h b/gcc/treelang/lang-specs.h
index 1ca9c8cc89b..80ca8c2555b 100644
--- a/gcc/treelang/lang-specs.h
+++ b/gcc/treelang/lang-specs.h
@@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */
{"@treelang",
"tree1\
%{!Q:-quiet}\
+ -dumpbase %B \
%{d*}\
%{m*}\
%{a}\
diff --git a/gcc/treelang/parse.y b/gcc/treelang/parse.y
index 665157e82a7..be443625221 100644
--- a/gcc/treelang/parse.y
+++ b/gcc/treelang/parse.y
@@ -3,7 +3,7 @@
---------------------------------------------------------------------
-Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -273,6 +273,7 @@ storage typename NAME LEFT_PARENTHESIS parameters_opt RIGHT_PARENTHESIS SEMICOLO
{
case STATIC_STORAGE:
case EXTERNAL_DEFINITION_STORAGE:
+ case EXTERNAL_REFERENCE_STORAGE:
break;
case AUTOMATIC_STORAGE:
@@ -324,6 +325,17 @@ storage typename NAME LEFT_PARENTHESIS parameters_opt RIGHT_PARENTHESIS SEMICOLO
STORAGE_CLASS (prod),
NUMERIC_TYPE (type),
first_parms, tok->tp.tok.location);
+
+#ifdef ENABLE_CHECKING
+ /* Check all the parameters have code. */
+ for (this_parm = PARAMETERS (prod);
+ this_parm;
+ this_parm = this_parm->tp.pro.next)
+ {
+ gcc_assert ((struct prod_token_parm_item*)VARIABLE (this_parm));
+ gcc_assert (((struct prod_token_parm_item*)VARIABLE (this_parm))->tp.pro.code);
+ }
+#endif
}
;
@@ -332,7 +344,6 @@ NAME LEFT_BRACE {
struct prod_token_parm_item *proto;
struct prod_token_parm_item search_prod;
struct prod_token_parm_item* tok;
- struct prod_token_parm_item *this_parm;
tok = $1;
SYMBOL_TABLE_NAME ((&search_prod)) = tok;
search_prod.category = token_category;
@@ -346,20 +357,9 @@ NAME LEFT_BRACE {
gcc_assert (proto->tp.pro.code);
- tree_code_create_function_initial (proto->tp.pro.code, tok->tp.tok.location,
- FIRST_PARMS (current_function));
-
-#ifdef ENABLE_CHECKING
- /* Check all the parameters have code. */
- for (this_parm = PARAMETERS (proto);
- this_parm;
- this_parm = this_parm->tp.pro.next)
- {
- gcc_assert ((struct prod_token_parm_item*)VARIABLE (this_parm));
- gcc_assert (((struct prod_token_parm_item*)VARIABLE (this_parm))->tp.pro.code);
- }
-#endif
+ tree_code_create_function_initial (proto->tp.pro.code, tok->tp.tok.location);
}
+
variable_defs_opt statements_opt RIGHT_BRACE {
struct prod_token_parm_item* tok;
tok = $1;
@@ -591,8 +591,11 @@ INTEGER {
struct prod_token_parm_item *tok = $2;
struct prod_token_parm_item *op1 = $1;
struct prod_token_parm_item *op2 = $3;
+ int type_code = NUMERIC_TYPE (op1);
+ if (!type_code)
+ YYERROR;
$$ = make_plus_expression
- (tok, op1, op2, SIGNED_INT, EXP_EQUALS);
+ (tok, op1, op2, type_code, EXP_EQUALS);
}
|variable_ref ASSIGN expression {
struct prod_token_parm_item *tok = $2;
@@ -610,7 +613,7 @@ INTEGER {
;
function_invocation:
-NAME LEFT_PARENTHESIS expressions_with_commas RIGHT_PARENTHESIS {
+NAME LEFT_PARENTHESIS expressions_with_commas_opt RIGHT_PARENTHESIS {
struct prod_token_parm_item *prod;
struct prod_token_parm_item* tok;
struct prod_token_parm_item search_prod;
@@ -672,11 +675,18 @@ NAME LEFT_PARENTHESIS expressions_with_commas RIGHT_PARENTHESIS {
type = tree_code_get_type (NUMERIC_TYPE (prod));
prod->tp.pro.code = tree_code_get_expression (EXP_FUNCTION_INVOCATION, type,
proto->tp.pro.code, parms,
- NULL);
+ NULL, tok->tp.tok.location);
$$ = prod;
}
;
+expressions_with_commas_opt:
+/* Nil. */ {
+$$ = 0
+}
+|expressions_with_commas { $$ = $1 }
+;
+
expressions_with_commas:
expression {
struct prod_token_parm_item *exp;
@@ -720,8 +730,9 @@ NAME {
OP1 (prod) = $1;
prod->tp.pro.code =
- tree_code_get_expression (EXP_REFERENCE, type,
- symbol_table_entry->tp.pro.code, NULL, NULL);
+ tree_code_get_expression (EXP_REFERENCE, type,
+ symbol_table_entry->tp.pro.code, NULL, NULL,
+ tok->tp.tok.location);
$$ = prod;
}
;
@@ -910,7 +921,8 @@ make_plus_expression (struct prod_token_parm_item* tok,
prod->tp.pro.code = tree_code_get_expression (prod_code, type,
op1->tp.pro.code,
- op2->tp.pro.code, NULL);
+ op2->tp.pro.code, NULL,
+ tok->tp.tok.location);
return prod;
}
diff --git a/gcc/treelang/treelang.texi b/gcc/treelang/treelang.texi
index 557809b3e68..09d93d45ba5 100644
--- a/gcc/treelang/treelang.texi
+++ b/gcc/treelang/treelang.texi
@@ -9,10 +9,7 @@
@include gcc-common.texi
-@set version-treelang 2.0
-
-@set last-update 2004-09-28
-@set copyrights-treelang 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
+@set copyrights-treelang 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
@set email-general gcc@@gcc.gnu.org
@set email-bugs gcc-bugs@@gcc.gnu.org or bug-gcc@@gnu.org
@@ -110,8 +107,8 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
@ifset INTERNALS
@ifset USING
This file documents the use and the internals of the GNU Treelang
-(@code{treelang}) compiler. At the moment this manual is not
-incorporated into the main GCC manual as it is too incomplete. It
+(@code{treelang}) compiler. At the moment this manual is not
+incorporated into the main GCC manual as it is incomplete. It
corresponds to the @value{which-treelang} version of @code{treelang}.
@end ifset
@end ifset
@@ -131,12 +128,6 @@ Boston, MA 02111-1307 USA
@insertcopying
@end ifnottex
-treelang was Contributed by Tim Josling (@email{@value{email-josling}}).
-Inspired by and based on the 'toy' language, written by Richard Kenner.
-
-This document was written by Tim Josling, based on the GNU C++
-documentation.
-
@setchapternewpage odd
@c @finalout
@titlepage
@@ -154,10 +145,6 @@ documentation.
@end ifclear
@sp 2
@center Tim Josling
-@sp 3
-@center Last updated @value{last-update}
-@sp 1
-@center for version @value{version-treelang}
@page
@vskip 0pt plus 1filll
For the @value{which-treelang} Version*
@@ -181,23 +168,21 @@ Boston, MA 02111-1307, USA@*
@ifset INTERNALS
@ifset USING
-This manual documents how to run, install and maintain @code{treelang},
-as well as its new features and incompatibilities,
-and how to report bugs.
-It corresponds to the @value{which-treelang} version of @code{treelang}.
+This manual documents how to run, install and maintain @code{treelang}.
+It also documents the features and incompatibilities in the @value{which-treelang}
+version of @code{treelang}.
@end ifset
@end ifset
@ifclear INTERNALS
-This manual documents how to run and install @code{treelang},
-as well as its new features and incompatibilities, and how to report
-bugs.
-It corresponds to the @value{which-treelang} version of @code{treelang}.
+This manual documents how to run and install @code{treelang}.
+It also documents the features and incompatibilities in the @value{which-treelang}
+version of @code{treelang}.
@end ifclear
@ifclear USING
-This manual documents how to maintain @code{treelang}, as well as its
-new features and incompatibilities, and how to report bugs. It
-corresponds to the @value{which-treelang} version of @code{treelang}.
+This manual documents how to maintain @code{treelang}.
+It also documents the features and incompatibilities in the @value{which-treelang}
+version of @code{treelang}.
@end ifclear
@end ifnottex
@@ -264,10 +249,10 @@ Reporting Bugs
@cindex credits
Treelang was based on 'toy' by Richard Kenner, and also uses code from
-the GCC core code tree. Tim Josling first created the language and
+the GCC core code tree. Tim Josling first created the language and
documentation, based on the GCC Fortran compiler's documentation
-framework. Treelang was updated to use the TreeSSA infrastructure by James A.
-Morrison.
+framework. Treelang was updated to use the TreeSSA infrastructure by
+James A. Morrison.
@itemize @bullet
@item
@@ -282,7 +267,7 @@ standard C runtime.
@item
It would have been difficult to build treelang without access to Joachim
-Nadler's guide to writing a front end to GCC (written in German). A
+Nadler's guide to writing a front end to GCC (written in German). A
translation of this document into English is available via the
CobolForGCC project or via the documentation links from the GCC home
page @uref{http://gcc.gnu.org}.
@@ -298,9 +283,9 @@ page @uref{http://gcc.gnu.org}.
@cindex beginners
Treelang is a sample language, useful only to help people understand how
-to implement a new language front end to GCC. It is not a useful
+to implement a new language front end to GCC. It is not a useful
language in itself other than as an example or basis for building a new
-language. Therefore only language developers are likely to have an
+language. Therefore only language developers are likely to have an
interest in it.
This manual assumes familiarity with GCC, which you can obtain by using
@@ -332,11 +317,11 @@ replacement for, or alternative to, the 'toy' language, but which is
amenable to inclusion within the GCC source tree.
@code{treelang} is largely a cut down version of C, designed to showcase
-the features of the GCC code generation back end. Only those features
+the features of the GCC code generation back end. Only those features
that are directly supported by the GCC code generation back end are
-implemented. Features are implemented in a manner which is easiest and
-clearest to implement. Not all or even most code generation back end
-features are implemented. The intention is to add features incrementally
+implemented. Features are implemented in a manner which is easiest and
+clearest to implement. Not all or even most code generation back end
+features are implemented. The intention is to add features incrementally
until most features of the GCC back end are implemented in treelang.
The main features missing are structures, arrays and pointers.
@@ -401,8 +386,8 @@ Treelang programs consist of whitespace, comments, keywords and names.
@item
Whitespace consists of the space character, a tab, and the end of line
character. Line terminations are as defined by the
-standard C library. Whitespace is ignored except within comments,
-and where it separates parts of the program. In the example below, A and
+standard C library. Whitespace is ignored except within comments,
+and where it separates parts of the program. In the example below, A and
B are two separate names separated by whitespace.
@smallexample
@@ -411,7 +396,7 @@ A B
@item
Comments consist of @samp{//} followed by any characters up to the end
-of the line. C style comments (/* */) are not supported. For example,
+of the line. C style comments (/* */) are not supported. For example,
the assignment below is followed by a not very helpful comment.
@smallexample
@@ -436,9 +421,9 @@ used to separate parameters in a function prototype or in a function call
@item ;
used to end a statement
@item +
-addition
+addition, or unary plus for signed literals
@item -
-subtraction
+subtraction, or unary minus for signed literals
@item =
assignment
@item ==
@@ -450,7 +435,7 @@ begin 'else' portion of IF statement
@item static
indicate variable is permanent, or function has file scope only
@item automatic
-indicate that variable is allocated for the life of the function
+indicate that variable is allocated for the life of the current scope
@item external_reference
indicate that variable or function is defined in another file
@item external_definition
@@ -470,9 +455,9 @@ used as function type to indicate function returns nothing
@item
Names consist of any letter or "_" followed by any number of letters,
-numbers, or "_". "$" is not allowed in a name. All names must be globally
+numbers, or "_". "$" is not allowed in a name. All names must be globally
unique, i.e. may not be used twice in any context, and must
-not be a keyword. Names and keywords are case sensitive. For example:
+not be a keyword. Names and keywords are case sensitive. For example:
@smallexample
a A _a a_ IF_X
@@ -486,7 +471,7 @@ are all different names.
@chapter Parsing Syntax
@cindex Parsing Syntax
-Declarations are built up from the lexical elements described above. A
+Declarations are built up from the lexical elements described above. A
file may contain one of more declarations.
@itemize @bullet
@@ -521,23 +506,23 @@ This defines the scope, duration and visibility of a function or variable
@enumerate 1
@item
-automatic: This means a variable is allocated at start of function and
-released when the function returns. This can only be used for variables
-within functions. It cannot be used for functions.
+automatic: This means a variable is allocated at start of the current scope and
+released when the current scope is exited. This can only be used for variables
+within functions. It cannot be used for functions.
@item
static: This means a variable is allocated at start of program and
-remains allocated until the program as a whole ends. For a function, it
+remains allocated until the program as a whole ends. For a function, it
means that the function is only visible within the current file.
@item
external_definition: For a variable, which must be defined outside a
-function, it means that the variable is visible from other files. For a
+function, it means that the variable is visible from other files. For a
function, it means that the function is visible from another file.
@item
external_reference: For a variable, which must be defined outside a
-function, it means that the variable is defined in another file. For a
+function, it means that the variable is defined in another file. For a
function, it means that the function is defined in another file.
@end enumerate
@@ -550,16 +535,16 @@ This defines the data type of a variable or the return type of a function.
@enumerate a
@item
-int: The variable is a signed integer. The function returns a signed integer.
+int: The variable is a signed integer. The function returns a signed integer.
@item
-unsigned int: The variable is an unsigned integer. The function returns an unsigned integer.
+unsigned int: The variable is an unsigned integer. The function returns an unsigned integer.
@item
-char: The variable is a signed character. The function returns a signed character.
+char: The variable is a signed character. The function returns a signed character.
@item
-unsigned char: The variable is an unsigned character. The function returns an unsigned character.
+unsigned char: The variable is an unsigned character. The function returns an unsigned character.
@end enumerate
@@ -569,7 +554,7 @@ parameter_list OR parameter [, parameter]...
@item
parameter: variable_declaration ,
-The variable declarations must not have initialisations.
+The variable declarations must not have initializations.
@item
initial: = value
@@ -577,28 +562,30 @@ initial: = value
@item
value: integer_constant
+Values without a unary plus or minus are considered to be unsigned.
@smallexample
-eg 1 +2 -3
+e.g.@: 1 +2 -3
@end smallexample
@item
-function_declaration: name @{variable_declarations statements @}
+function_declaration: name @{ variable_declarations statements @}
A function consists of the function name then the declarations (if any)
and statements (if any) within one pair of braces.
The details of the function arguments come from the function
-prototype. The function prototype must precede the function declaration
+prototype. The function prototype must precede the function declaration
in the file.
@item
statement: if_statement OR expression_statement OR return_statement
@item
-if_statement: if (expression) @{ statements @} else @{ statements @}
+if_statement: if ( expression ) @{ variable_declarations statements @}
+else @{ variable_declarations statements @}
The first lot of statements is executed if the expression is
-nonzero. Otherwise the second lot of statements is executed. Either
+nonzero. Otherwise the second lot of statements is executed. Either
list of statements may be empty, but both sets of braces and the else must be present.
@smallexample
@@ -615,7 +602,7 @@ a=b;
@item
expression_statement: expression;
-The expression is executed and any side effects, such
+The expression is executed, including any side effects.
@item
return_statement: return expression_opt;
@@ -625,18 +612,18 @@ be absent, and if the function is not void the expression must be
present.
@item
-expression: variable OR integer_constant OR expression+expression
-OR expression-expression OR expression==expression OR (expression)
-OR variable=expression OR function_call
+expression: variable OR integer_constant OR expression + expression
+OR expression - expression OR expression == expression OR ( expression )
+OR variable = expression OR function_call
An expression can be a constant or a variable reference or a
-function_call. Expressions can be combined as a sum of two expressions
+function_call. Expressions can be combined as a sum of two expressions
or the difference of two expressions, or an equality test of two
-expresions. An assignment is also an expression. Expresions and operator
+expresions. An assignment is also an expression. Expresions and operator
precedence work as in C.
@item
-function_call: function_name (comma_separated_expressions)
+function_call: function_name ( optional_comma_separated_expressions )
This invokes the function, passing to it the values of the expressions
as actual parameters.
@@ -706,7 +693,7 @@ compiler indicate the problem and the location in the user's source file
where the problem was first noticed. The user can use this information
to locate and fix the problem.
-The compiler stops after the first error. There are no plans to fix
+The compiler stops after the first error. There are no plans to fix
this, ever, as it would vastly complicate the implementation of treelang
to little or no benefit.
@@ -723,8 +710,11 @@ the programmer's intention.)
@cindex warnings
@cindex questionable instructions
@item
-There are no warnings in treelang. A program is either correct or in
-error.
+There are a few warnings in treelang. For example an unused static function
+generate a warnings when -Wunused-function is specified, similarily an unused
+static variable generates a warning when -Wunused-variable are specified.
+The only treelang specific warning is a warning when an expression is in a
+return statement for functions that return void.
@end itemize
@cindex components of treelang
@@ -752,8 +742,8 @@ The @code{treelang} command itself.
The @code{libc} run-time library. This library contains the machine
code needed to support capabilities of the Treelang language that are
not directly provided by the machine code generated by the
-@code{treelang} compilation phase. This is the same library that the
-main c compiler uses (libc).
+@code{treelang} compilation phase. This is the same library that the
+main C compiler uses (libc).
@cindex @code{tree1}, program
@cindex programs, @code{tree1}
@@ -806,8 +796,8 @@ same as @samp{gcc foo.c}, but instead of using the C compiler named
In a GNU Treelang installation, @code{gcc} recognizes Treelang source
files by name just like it does C and C++ source files. It knows to use
the Treelang compiler named @code{tree1}, instead of @code{cc1} or
-@code{cc1plus}, to compile Treelang files. If a file's name ends in
-@code{.tree} then GCC knows that the program is written in treelang. You
+@code{cc1plus}, to compile Treelang files. If a file's name ends in
+@code{.tree} then GCC knows that the program is written in treelang. You
can also manually override the language.
@cindex @code{gcc}, not recognizing Treelang source
@@ -894,7 +884,7 @@ for information on the way different languages are handled
by the GCC compiler (@code{gcc}).
You can use this, combined with the output of the @samp{gcc -v x.tree}
-command to get the options applicable to treelang. Treelang programs
+command to get the options applicable to treelang. Treelang programs
must end with the suffix @samp{.tree}.
@cindex preprocessor
@@ -926,8 +916,8 @@ and everybody else, so you should be able to freely mix treelang and C
(and C++) code, with one proviso.
C promotes small integer types to 'int' when used as function parameters and
-return values. The treelang compiler does not do this, so if you want to interface
-to C, you need to specify the promoted value, not the nominal value.
+return values in non-prototyped functions. Since treelang has no
+non-prototyped functions, the treelang compiler does not do this.
@ifset INTERNALS
@node treelang internals, Open Questions, Other Languages, Top
@@ -943,10 +933,10 @@ to C, you need to specify the promoted value, not the nominal value.
@section treelang files
To create a compiler that integrates into GCC, you need create many
-files. Some of the files are integrated into the main GCC makefile, to
+files. Some of the files are integrated into the main GCC makefile, to
build the various parts of the compiler and to run the test
-suite. Others are incorporated into various GCC programs such as
-GCC.c. Finally you must provide the actual programs comprising your
+suite. Others are incorporated into various GCC programs such as
+@file{gcc.c}. Finally you must provide the actual programs comprising your
compiler.
@cindex files
@@ -956,8 +946,8 @@ The files are:
@enumerate 1
@item
-COPYING. This is the copyright file, assuming you are going to use the
-GNU General Public Licence. You probably need to use the GPL because if
+COPYING. This is the copyright file, assuming you are going to use the
+GNU General Public Licence. You probably need to use the GPL because if
you use the GCC back end your program and the back end are one program,
and the back end is GPLed.
@@ -965,11 +955,11 @@ This need not be present if the language is incorporated into the main
GCC tree, as the main GCC directory has this file.
@item
-COPYING.LIB. This is the copyright file for those parts of your program
+COPYING.LIB. This is the copyright file for those parts of your program
that are not to be covered by the GPL, but are instead to be covered by
-the LGPL (Library or Lesser GPL). This licence may be appropriate for
+the LGPL (Library or Lesser GPL). This licence may be appropriate for
the library routines associated with your compiler. These are the
-routines that are linked with the @emph{output} of the compiler. Using
+routines that are linked with the @emph{output} of the compiler. Using
the LGPL for these programs allows programs written using your compiler
to be closed source. For example LIBC is under the LGPL.
@@ -977,27 +967,27 @@ This need not be present if the language is incorporated into the main
GCC tree, as the main GCC directory has this file.
@item
-ChangeLog. Record all the changes to your compiler. Use the same format
+ChangeLog. Record all the changes to your compiler. Use the same format
as used in treelang as it is supported by an emacs editing mode and is
-part of the FSF coding standard. Normally each directory has its own
-changelog. The FSF standard allows but does not require a meaningful
+part of the FSF coding standard. Normally each directory has its own
+changelog. The FSF standard allows but does not require a meaningful
comment on why the changes were made, above and beyond @emph{why} they
-were made. In the author's opinion it is useful to provide this
+were made. In the author's opinion it is useful to provide this
information.
@item
-treelang.texi. The manual, written in texinfo. Your manual would have a
-different file name. You need not write it in texinfo if you don't want
+treelang.texi. The manual, written in texinfo. Your manual would have a
+different file name. You need not write it in texinfo if you don't want
do, but a lot of GNU software does use texinfo.
@cindex Make-lang.in
@item
-Make-lang.in. This file is part of the make file which in incorporated
+Make-lang.in. This file is part of the make file which in incorporated
with the GCC make file skeleton (Makefile.in in the GCC directory) to
make Makefile, as part of the configuration process.
Makefile in turn is the main instruction to actually build
-everything. The build instructions are held in the main GCC manual and
+everything. The build instructions are held in the main GCC manual and
web site so they are not repeated here.
There are some comments at the top which will help you understand what
@@ -1009,76 +999,77 @@ how much progress you are making), build info and html files from the
texinfo source, run the tests etc.
@item
-README. Just a brief informative text file saying what is in this
+README. Just a brief informative text file saying what is in this
directory.
@cindex config-lang.in
@item
-config-lang.in. This file is read by the configuration progress and must
+config-lang.in. This file is read by the configuration progress and must
be present. You specify the name of your language, the name(s) of the
compiler(s) incouding preprocessors you are going to build, whether any,
usually generated, files should be excluded from diffs (ie when making
-diff files to send in patches). Whether the equate 'stagestuff' is used
+diff files to send in patches). Whether the equate 'stagestuff' is used
is unknown (???).
-@cindex lang-options
+@cindex lang.opt
@item
-lang-options. This file is included into GCC.c, the main GCC driver, and
-tells it what options your language supports. This is only used to
-display help (is this true ???).
+lang.opt. This file is included into @file{gcc.c}, the main GCC driver, and
+tells it what options your language supports. This is also used to
+display help.
-@cindex lang-specs
+@cindex lang-specs.h
@item
-lang-specs. This file is also included in GCC.c. It tells GCC.c when to
-call your programs and what options to send them. The mini-language
-'specs' is documented in the source of GCC.c. Do not attempt to write a
-specs file from scratch - use an existing one as the base and enhance
-it.
+lang-specs.h. This file is also included in @file{gcc.c}. It tells
+@file{gcc.c} when to call your programs and what options to send them. The
+mini-language 'specs' is documented in the source of @file{gcc.c}. Do not
+attempt to write a specs file from scratch - use an existing one as the base
+and enhance it.
@item
-Your texi files. Texinfo can be used to build documentation in HTML,
+Your texi files. Texinfo can be used to build documentation in HTML,
info, dvi and postscript formats. It is a tagged language, is documented
in its own manual, and has its own emacs mode.
@item
-Your programs. The relationships between all the programs are explained
-in the next section. You need to write or use the following programs:
+Your programs. The relationships between all the programs are explained
+in the next section. You need to write or use the following programs:
@itemize @bullet
@item
-lexer. This breaks the input into words and passes these to the
-parser. This is lex.l in treelang, which is passed through flex, a lex
-variant, to produce C code lex.c. Note there is a school of thought that
-says real men hand code their own lexers, however you may prefer to
+lexer. This breaks the input into words and passes these to the
+parser. This is @file{lex.l} in treelang, which is passed through flex, a lex
+variant, to produce C code @file{lex.c}. Note there is a school of thought
+that says real men hand code their own lexers. However, you may prefer to
write far less code and use flex, as was done with treelang.
@item
-parser. This breaks the program into recognizable constructs such as
-expressions, statements etc. This is parse.y in treelang, which is
-passed through bison, which is a yacc variant, to produce C code parse.c.
+parser. This breaks the program into recognizable constructs such as
+expressions, statements etc. This is @file{parse.y} in treelang, which is
+passed through bison, which is a yacc variant, to produce C code
+@file{parse.c}.
@item
-back end interface. This interfaces to the code generation back end. In
-treelang, this is tree1.c which mainly interfaces to toplev.c and
-treetree.c which mainly interfaces to everything else. Many languages
+back end interface. This interfaces to the code generation back end. In
+treelang, this is @file{tree1.c} which mainly interfaces to @file{toplev.c} and
+@file{treetree.c} which mainly interfaces to everything else. Many languages
mix up the back end interface with the parser, as in the C compiler for
-example. It is a matter of taste which way to do it, but with treelang
+example. It is a matter of taste which way to do it, but with treelang
it is separated out to make the back end interface cleaner and easier to
understand.
@item
-header files. For function prototypes and common data items. One point
+header files. For function prototypes and common data items. One point
to note here is that bison can generate a header files with all the
numbers is has assigned to the keywords and symbols, and you can include
-the same header in your lexer. This technique is demonstrated in
+the same header in your lexer. This technique is demonstrated in
treelang.
@item
-compiler main file. GCC comes with a program toplev.c which is a
-perfectly serviceable main program for your compiler. treelang uses
-toplev.c but other languages have been known to replace it with their
-own main program. Again this is a matter of taste and how much code you
+compiler main file. GCC comes with a file @file{toplev.c} which is a
+perfectly serviceable main program for your compiler. GNU Treelang uses
+@file{toplev.c} but other languages have been known to replace it with their
+own main program. Again this is a matter of taste and how much code you
want to write.
@end itemize
@@ -1102,24 +1093,24 @@ want to write.
The GCC compiler consists of a driver, which then executes the various
compiler phases based on the instructions in the specs files.
-Typically a program's language will be identified from its suffix (eg
-.tree) for treelang programs.
+Typically a program's language will be identified from its suffix
+(e.g., @file{.tree}) for treelang programs.
-The driver (gcc.c) will then drive (exec) in turn a preprocessor, the main
-compiler, the assembler and the link editor. Options to GCC allow you to
-override all of this. In the case of treelang programs there is no
+The driver (@file{gcc.c}) will then drive (exec) in turn a preprocessor,
+the main compiler, the assembler and the link editor. Options to GCC allow you
+to override all of this. In the case of treelang programs there is no
preprocessor, and mostly these days the C preprocessor is run within the
main C compiler rather than as a separate process, apparently for reasons of speed.
You will be using the standard assembler and linkage editor so these are
ignored from now on.
-You have to write your own preprocessor if you want one. This is usually
-totally language specific. The main point to be aware of is to ensure
+You have to write your own preprocessor if you want one. This is usually
+totally language specific. The main point to be aware of is to ensure
that you find some way to pass file name and line number information
through to the main compiler so that it can tell the back end this
information and so the debugger can find the right source line for each
-piece of code. That is all there is to say about the preprocessor except
+piece of code. That is all there is to say about the preprocessor except
that the preprocessor will probably not be the slowest part of the
compiler and will probably not use the most memory so don't waste too
much time tuning it until you know you need to do so.
@@ -1127,13 +1118,14 @@ much time tuning it until you know you need to do so.
@node treelang main compiler, , treelang driver, treelang compiler interfaces
@subsection treelang main compiler
-The main compiler for treelang consists of toplev.c from the main GCC
+The main compiler for treelang consists of @file{toplev.c} from the main GCC
compiler, the parser, lexer and back end interface routines, and the
back end routines themselves, of which there are many.
-toplev.c does a lot of work for you and you should almost certainly use it,
+@file{toplev.c} does a lot of work for you and you should almost certainly
+use it.
-Writing this code is the hard part of creating a compiler using GCC. The
+Writing this code is the hard part of creating a compiler using GCC. The
back end interface documentation is incomplete and the interface is
complex.
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index b621fadf183..aea6e0ba5cb 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -5,7 +5,7 @@
you are in the right place.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This code is based on toy.c written by Richard Kenner.
@@ -325,6 +325,7 @@ tree_code_create_function_prototype (unsigned char* chars,
tree type_node;
tree fn_type;
tree fn_decl;
+ tree parm_list = NULL_TREE;
/* Build the type. */
id = get_identifier ((const char*)chars);
@@ -351,25 +352,19 @@ tree_code_create_function_prototype (unsigned char* chars,
DECL_CONTEXT (fn_decl) = NULL_TREE;
DECL_SOURCE_LOCATION (fn_decl) = loc;
- TREE_USED (fn_decl) = 1;
-
TREE_PUBLIC (fn_decl) = 0;
DECL_EXTERNAL (fn_decl) = 0;
TREE_STATIC (fn_decl) = 0;
switch (storage_class)
{
case STATIC_STORAGE:
- TREE_PUBLIC (fn_decl) = 0;
break;
case EXTERNAL_DEFINITION_STORAGE:
TREE_PUBLIC (fn_decl) = 1;
- TREE_STATIC (fn_decl) = 0;
- DECL_EXTERNAL (fn_decl) = 0;
break;
case EXTERNAL_REFERENCE_STORAGE:
- TREE_PUBLIC (fn_decl) = 0;
DECL_EXTERNAL (fn_decl) = 1;
break;
@@ -378,6 +373,37 @@ tree_code_create_function_prototype (unsigned char* chars,
gcc_unreachable ();
}
+ /* Make the argument variable decls. */
+ for (parm = parms; parm; parm = parm->tp.par.next)
+ {
+ tree parm_decl = build_decl (PARM_DECL, get_identifier
+ ((const char*) (parm->tp.par.variable_name)),
+ tree_code_get_type (parm->type));
+
+ /* Some languages have different nominal and real types. */
+ DECL_ARG_TYPE (parm_decl) = TREE_TYPE (parm_decl);
+ gcc_assert (DECL_ARG_TYPE (parm_decl));
+ gcc_assert (fn_decl);
+ DECL_CONTEXT (parm_decl) = fn_decl;
+ DECL_SOURCE_LOCATION (parm_decl) = loc;
+ parm_list = chainon (parm_decl, parm_list);
+ }
+
+ /* Back into reverse order as the back end likes them. */
+ parm_list = nreverse (parm_list);
+
+ DECL_ARGUMENTS (fn_decl) = parm_list;
+
+ /* Save the decls for use when the args are referred to. */
+ for (parm = parms; parm_list;
+ parm_list = TREE_CHAIN (parm_list),
+ parm = parm->tp.par.next)
+ {
+ gcc_assert (parm); /* Too few. */
+ *parm->tp.par.where_to_put_var_tree = parm_list;
+ }
+ gcc_assert (!parm); /* Too many. */
+
/* Process declaration of function defined elsewhere. */
rest_of_decl_compilation (fn_decl, 1, 0);
@@ -386,21 +412,16 @@ tree_code_create_function_prototype (unsigned char* chars,
/* Output code for start of function; the decl of the function is in
- PREV_SAVED (as created by tree_code_create_function_prototype),
- the function is at line number LINENO in file FILENAME. The
- parameter details are in the lists PARMS. Returns nothing. */
+ PREV_SAVED (as created by tree_code_create_function_prototype),
+ the function is at line number LINENO in file FILENAME. The
+ parameter details are in the lists PARMS. Returns nothing. */
+
void
tree_code_create_function_initial (tree prev_saved,
- location_t loc,
- struct prod_token_parm_item* parms)
+ location_t loc)
{
tree fn_decl;
- tree param_decl;
- tree parm_decl;
- tree parm_list;
tree resultdecl;
- struct prod_token_parm_item* this_parm;
- struct prod_token_parm_item* parm;
fn_decl = prev_saved;
gcc_assert (fn_decl);
@@ -426,49 +447,11 @@ tree_code_create_function_initial (tree prev_saved,
DECL_SOURCE_LOCATION (resultdecl) = loc;
DECL_RESULT (fn_decl) = resultdecl;
- /* Make the argument variable decls. */
- parm_list = NULL_TREE;
- for (parm = parms; parm; parm = parm->tp.par.next)
- {
- parm_decl = build_decl (PARM_DECL, get_identifier
- ((const char*) (parm->tp.par.variable_name)),
- tree_code_get_type (parm->type));
-
- /* Some languages have different nominal and real types. */
- DECL_ARG_TYPE (parm_decl) = TREE_TYPE (parm_decl);
- gcc_assert (DECL_ARG_TYPE (parm_decl));
- gcc_assert (fn_decl);
- DECL_CONTEXT (parm_decl) = fn_decl;
- DECL_SOURCE_LOCATION (parm_decl) = loc;
- parm_list = chainon (parm_decl, parm_list);
- }
-
- /* Back into reverse order as the back end likes them. */
- parm_list = nreverse (parm_list);
-
- DECL_ARGUMENTS (fn_decl) = parm_list;
-
- /* Save the decls for use when the args are referred to. */
- for (param_decl = DECL_ARGUMENTS (fn_decl),
- this_parm = parms;
- param_decl;
- param_decl = TREE_CHAIN (param_decl),
- this_parm = this_parm->tp.par.next)
- {
- gcc_assert (this_parm); /* Too few. */
- *this_parm->tp.par.where_to_put_var_tree = param_decl;
- }
- gcc_assert (!this_parm); /* Too many. */
-
/* Create a new level at the start of the function. */
pushlevel (0);
- /* Force it to be output, else may be solely inlined. */
- TREE_ADDRESSABLE (fn_decl) = 1;
-
- /* Stop -O3 from deleting it. */
- TREE_USED (fn_decl) = 1;
+ TREE_STATIC (fn_decl) = 1;
}
/* Wrapup a function contained in file FILENAME, ending at line LINENO. */
@@ -552,41 +535,31 @@ tree_code_create_variable (unsigned int storage_class,
DECL_SOURCE_LOCATION (var_decl) = loc;
+ DECL_EXTERNAL (var_decl) = 0;
+ TREE_PUBLIC (var_decl) = 0;
+ TREE_STATIC (var_decl) = 0;
/* Set the storage mode and whether only visible in the same file. */
switch (storage_class)
{
case STATIC_STORAGE:
TREE_STATIC (var_decl) = 1;
- TREE_PUBLIC (var_decl) = 0;
break;
case AUTOMATIC_STORAGE:
- TREE_STATIC (var_decl) = 0;
- TREE_PUBLIC (var_decl) = 0;
break;
case EXTERNAL_DEFINITION_STORAGE:
- TREE_STATIC (var_decl) = 0;
TREE_PUBLIC (var_decl) = 1;
break;
case EXTERNAL_REFERENCE_STORAGE:
DECL_EXTERNAL (var_decl) = 1;
- TREE_PUBLIC (var_decl) = 0;
break;
default:
gcc_unreachable ();
}
- /* This should really only be set if the variable is used. */
- TREE_USED (var_decl) = 1;
-
- /* Expand declaration and initial value if any. */
-
- if (TREE_STATIC (var_decl))
- rest_of_decl_compilation (var_decl, 0, 0);
-
TYPE_NAME (TREE_TYPE (var_decl)) = TYPE_NAME (var_type);
return pushdecl (copy_node (var_decl));
}
@@ -616,6 +589,9 @@ tree_code_generate_return (tree type, tree exp)
TREE_SIDE_EFFECTS (setret) = 1;
TREE_USED (setret) = 1;
setret = build1 (RETURN_EXPR, type, setret);
+ /* Use EXPR_LOCUS so we don't lose any information about the file we
+ are compiling. */
+ SET_EXPR_LOCUS (setret, EXPR_LOCUS (exp));
}
else
setret = build1 (RETURN_EXPR, type, NULL_TREE);
@@ -664,7 +640,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
for (ix = start; ix < length; ix++)
val = val * 10 + chars[ix] - (unsigned char)'0';
val = val*negative;
- return build_int_cst_wide (NULL_TREE,
+ return build_int_cst_wide (start == 1 ?
+ integer_type_node : unsigned_type_node,
val & 0xffffffff, (val >> 32) & 0xffffffff);
}
@@ -673,7 +650,8 @@ tree_code_get_integer_value (unsigned char* chars, unsigned int length)
tree
tree_code_get_expression (unsigned int exp_type,
tree type, tree op1, tree op2,
- tree op3 ATTRIBUTE_UNUSED)
+ tree op3 ATTRIBUTE_UNUSED,
+ location_t loc)
{
tree ret1;
int operator;
@@ -711,19 +689,22 @@ tree_code_get_expression (unsigned int exp_type,
/* Reference to a variable. This is dead easy, just return the
decl for the variable. If the TYPE is different than the
- variable type, convert it. */
+ variable type, convert it. However, to keep accurate location
+ information we wrap it in a NOP_EXPR is is easily stripped. */
case EXP_REFERENCE:
gcc_assert (op1);
+ TREE_USED (op1) = 1;
if (type == TREE_TYPE (op1))
- ret1 = op1;
+ ret1 = build1 (NOP_EXPR, type, op1);
else
ret1 = fold (build1 (CONVERT_EXPR, type, op1));
break;
case EXP_FUNCTION_INVOCATION:
- gcc_assert (op1 && op2);
+ gcc_assert (op1);
{
tree fun_ptr;
+ TREE_USED (op1) = 1;
fun_ptr = fold (build1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (op1)), op1));
ret1 = build3 (CALL_EXPR, type, fun_ptr, nreverse (op2), NULL_TREE);
@@ -734,6 +715,10 @@ tree_code_get_expression (unsigned int exp_type,
gcc_unreachable ();
}
+ /* Declarations already have a location and constants can be shared so they
+ shouldn't a location set on them. */
+ if (! DECL_P (ret1) && ! TREE_CONSTANT (ret1))
+ SET_EXPR_LOCATION (ret1, loc);
return ret1;
}
@@ -893,7 +878,10 @@ tree_lang_type_for_size (unsigned precision, int unsignedp)
static tree
tree_lang_type_for_mode (enum machine_mode mode, int unsignedp)
{
- return tree_lang_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
+ if (SCALAR_INT_MODE_P (mode))
+ return tree_lang_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
+ else
+ return NULL_TREE;
}
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
@@ -1131,6 +1119,12 @@ pushdecl (tree decl)
&& TYPE_NAME (TREE_TYPE (decl)) == 0)
TYPE_NAME (TREE_TYPE (decl)) = DECL_NAME (decl);
+ /* Put automatic variables into the intermediate representation. */
+ if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl)
+ && !TREE_STATIC (decl) && !TREE_PUBLIC (decl))
+ tree_code_output_expression_statement (build1 (DECL_EXPR, void_type_node,
+ decl),
+ DECL_SOURCE_LOCATION (decl));
return decl;
}
@@ -1209,7 +1203,7 @@ treelang_init_decl_processing (void)
tree_push_type_decl (get_identifier ("long double"), long_double_type_node);
tree_push_type_decl (get_identifier ("void"), void_type_node);
- /* Add any target-specific builtin functions. */
+ build_common_builtin_nodes ();
(*targetm.init_builtins) ();
pedantic_lvalues = pedantic;
diff --git a/gcc/treelang/treetree.h b/gcc/treelang/treetree.h
index 41ce452b6ab..cb6891ebfdd 100644
--- a/gcc/treelang/treetree.h
+++ b/gcc/treelang/treetree.h
@@ -33,17 +33,17 @@ tree tree_code_add_parameter (tree list, tree proto_exp, tree exp);
tree tree_code_get_integer_value (unsigned char *chars, unsigned int length);
void tree_code_generate_return (tree type, tree exp);
void tree_ggc_storage_always_used (void *m);
-tree tree_code_get_expression (unsigned int exp_type, tree type, tree op1, tree op2, tree op3);
+tree tree_code_get_expression (unsigned int exp_type, tree type, tree op1,
+ tree op2, tree op3, location_t loc);
tree tree_code_get_numeric_type (unsigned int size1, unsigned int sign1);
void tree_code_create_function_initial (tree prev_saved,
- location_t loc,
- struct prod_token_parm_item* parms);
+ location_t loc);
void tree_code_create_function_wrapup (location_t loc);
tree tree_code_create_function_prototype (unsigned char* chars,
unsigned int storage_class,
unsigned int ret_type,
- struct prod_token_parm_item* parms,
- location_t loc);
+ struct prod_token_parm_item* parms,
+ location_t loc);
tree tree_code_create_variable (unsigned int storage_class,
unsigned char* chars,
unsigned int length,
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 1663e64800d..7c1f7e17a50 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -1,5 +1,5 @@
/* Transformations based on profile information for values.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -245,7 +245,8 @@ insn_prefetch_values_to_profile (rtx insn, histogram_values *values)
int write;
histogram_value hist;
- if (!INSN_P (insn))
+ /* It only makes sense to look for memory references in ordinary insns. */
+ if (GET_CODE (insn) != INSN)
return false;
if (!find_mem_reference (insn, &mem, &write))
@@ -288,13 +289,30 @@ static void
rtl_find_values_to_profile (histogram_values *values)
{
rtx insn;
- unsigned i;
+ unsigned i, libcall_level;
life_analysis (NULL, PROP_DEATH_NOTES);
*values = VEC_alloc (histogram_value, 0);
+ libcall_level = 0;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- insn_values_to_profile (insn, values);
+ {
+ if (find_reg_note (insn, REG_LIBCALL, NULL_RTX))
+ libcall_level++;
+
+ /* Do not instrument values inside libcalls (we are going to split block
+ due to instrumentation, and libcall blocks should be local to a single
+ basic block). */
+ if (!libcall_level)
+ insn_values_to_profile (insn, values);
+
+ if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
+ {
+ gcc_assert (libcall_level > 0);
+ libcall_level--;
+ }
+ }
+ gcc_assert (libcall_level == 0);
for (i = 0; i < VEC_length (histogram_value, *values); i++)
{
diff --git a/gcc/version.c b/gcc/version.c
index 75e5758d7b5..8e0e86d89e3 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -5,7 +5,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "4.1.0-structure-aliasing (merged 20050203)";
+const char version_string[] = "4.1.0-structure-aliasing (merged 20050226)";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
diff --git a/include/ChangeLog b/include/ChangeLog
index 0a8c6016cea..da3aaa2f7c0 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-14 Paolo Bonzini <bonzini@gnu.org>
+
+ PR bootstrap/19818
+ * ansidecl.h (PARAMS): Guard from redefinition.
+
2004-12-11 Ben Elliston <bje@au.ibm.com>
* fibheap.h (struct fibnode): Only use unsigned long bitfields
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 04c3a30bb53..2eeccf20351 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -149,7 +149,12 @@ So instead we use the macro below and test it against specific values. */
#define PTRCONST void *const
#define LONG_DOUBLE long double
+/* PARAMS is often defined elsewhere (e.g. by libintl.h), so wrap it in
+ a #ifndef. */
+#ifndef PARAMS
#define PARAMS(ARGS) ARGS
+#endif
+
#define VPARAMS(ARGS) ARGS
#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 49055bd51bd..5e6ad289e36 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,44 @@
+2005-02-20 Zack Weinberg <zack@codesourcery.com>
+
+ PR 18785
+ * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
+ (cpp_host_to_exec_charset): New function.
+ * include/cpplib.h: Declare cpp_host_to_exec_charset.
+
+2005-02-19 Devang Patel <dpatel@apple.com>
+
+ * charset.c (_cpp_convert_input): Check '\r' before inserting
+ '\n' at the end.
+
+2005-02-15 Eric Christopher <echristo@redhat.com>
+
+ PR preprocessor/19077
+ * macro.c (cpp_macro_definition): Move handling of whitespace
+ to PREV_WHITE conditional. Remove overloading of len
+ variable.
+
+2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
+ traditional.c: Update copyright.
+
+2005-02-14 Paolo Bonzini <bonzini@gnu.org>
+
+ PR bootstrap/19818
+ * configure.ac: Check for declaration of basename and getopt.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+ * internal.h (ustrcspn): New.
+ * macro.c (create_iso_definition): Fix allocation of memory.
+ (padding_token): Add cast to remove const-ness.
+ * pch.c (cpp_read_state): Use ustrcspn.
+
+2005-02-08 Mike Stump <mrs@apple.com>
+
+ * files.c (pchf_adder): Remove.
+ (struct pchf_adder_info): Likewise.
+ (_cpp_save_file_entries): Write out all files so that #import works.
+
2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
* configure: Regenerate.
@@ -7,7 +48,7 @@
* include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
* include/cpplib.h: Also update copyright years.
-
+
2005-01-03 Geoffrey Keating <geoffk@apple.com>
* files.c (_cpp_find_file): Add files found by search_path_exhausted
@@ -30,7 +71,7 @@
2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
- PR preprocessor/17610
+ PR preprocessor/17610
* directives.c (do_include_common): Error out if an empty filename
is given for #include (or #include_next or #import).
@@ -53,7 +94,7 @@
* configure: Regenerate.
2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
- Joseph Myers <joseph@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
* internal.h (struct lexer_state): Add in_deferred_pragma.
* directives.c (struct pragma_entry): Add allow_expansion.
@@ -66,7 +107,7 @@
* include/cpplib.h (cpp_register_pragma): Update prototype.
2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
- Mark Mitchell <mark@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
* configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
need_64bit_hwint=yes.
@@ -81,7 +122,7 @@
Remove local srcdir path from generated file.
2004-11-04 Zack Weinberg <zack@codesourcery.com>
- Gerald Pfeifer <gerald@pfeifer.com>
+ Gerald Pfeifer <gerald@pfeifer.com>
* internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
as well.
diff --git a/libcpp/charset.c b/libcpp/charset.c
index 7a88a708e6c..6b6c360f73d 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
@@ -81,8 +81,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HOST_CHARSET == HOST_CHARSET_ASCII
#define SOURCE_CHARSET "UTF-8"
+#define LAST_POSSIBLY_BASIC_SOURCE_CHAR 0x7e
#elif HOST_CHARSET == HOST_CHARSET_EBCDIC
#define SOURCE_CHARSET "UTF-EBCDIC"
+#define LAST_POSSIBLY_BASIC_SOURCE_CHAR 0xFF
#else
#error "Unrecognized basic host character set"
#endif
@@ -714,6 +716,63 @@ _cpp_destroy_iconv (cpp_reader *pfile)
}
}
+/* Utility routine for use by a full compiler. C is a character taken
+ from the *basic* source character set, encoded in the host's
+ execution encoding. Convert it to (the target's) execution
+ encoding, and return that value.
+
+ Issues an internal error if C's representation in the narrow
+ execution character set fails to be a single-byte value (C99
+ 5.2.1p3: "The representation of each member of the source and
+ execution character sets shall fit in a byte.") May also issue an
+ internal error if C fails to be a member of the basic source
+ character set (testing this exactly is too hard, especially when
+ the host character set is EBCDIC). */
+cppchar_t
+cpp_host_to_exec_charset (cpp_reader *pfile, cppchar_t c)
+{
+ uchar sbuf[1];
+ struct _cpp_strbuf tbuf;
+
+ /* This test is merely an approximation, but it suffices to catch
+ the most important thing, which is that we don't get handed a
+ character outside the unibyte range of the host character set. */
+ if (c > LAST_POSSIBLY_BASIC_SOURCE_CHAR)
+ {
+ cpp_error (pfile, CPP_DL_ICE,
+ "character 0x%lx is not in the basic source character set\n",
+ (unsigned long)c);
+ return 0;
+ }
+
+ /* Being a character in the unibyte range of the host character set,
+ we can safely splat it into a one-byte buffer and trust that that
+ is a well-formed string. */
+ sbuf[0] = c;
+
+ /* This should never need to reallocate, but just in case... */
+ tbuf.asize = 1;
+ tbuf.text = xmalloc (tbuf.asize);
+ tbuf.len = 0;
+
+ if (!APPLY_CONVERSION (pfile->narrow_cset_desc, sbuf, 1, &tbuf))
+ {
+ cpp_errno (pfile, CPP_DL_ICE, "converting to execution character set");
+ return 0;
+ }
+ if (tbuf.len != 1)
+ {
+ cpp_error (pfile, CPP_DL_ICE,
+ "character 0x%lx is not unibyte in execution character set",
+ (unsigned long)c);
+ return 0;
+ }
+ c = tbuf.text[0];
+ free(tbuf.text);
+ return c;
+}
+
+
/* Utility routine that computes a mask of the form 0000...111... with
WIDTH 1-bits. */
@@ -727,8 +786,6 @@ width_to_mask (size_t width)
return ((size_t) 1 << width) - 1;
}
-
-
/* Returns 1 if C is valid in an identifier, 2 if C is valid except at
the start of an identifier, and 0 if C is not valid in an
identifier. We assume C has already gone through the checks of
@@ -1405,7 +1462,15 @@ _cpp_convert_input (cpp_reader *pfile, const char *input_charset,
if (to.len + 4096 < to.asize || to.len >= to.asize)
to.text = xrealloc (to.text, to.len + 1);
- to.text[to.len] = '\n';
+ /* If the file is using old-school Mac line endings (\r only),
+ terminate with another \r, not an \n, so that we do not mistake
+ the \r\n sequence for a single DOS line ending and erroneously
+ issue the "No newline at end of file" diagnostic. */
+ if (to.text[to.len - 1] == '\r')
+ to.text[to.len] = '\r';
+ else
+ to.text[to.len] = '\n';
+
*st_size = to.len;
return to.text;
}
diff --git a/libcpp/config.in b/libcpp/config.in
index 8cf8cebcf3b..d7f67a609cf 100644
--- a/libcpp/config.in
+++ b/libcpp/config.in
@@ -26,6 +26,10 @@
*/
#undef HAVE_DECL_ABORT
+/* Define to 1 if you have the declaration of `basename', and to 0 if you
+ don't. */
+#undef HAVE_DECL_BASENAME
+
/* Define to 1 if you have the declaration of `errno', and to 0 if you don't.
*/
#undef HAVE_DECL_ERRNO
@@ -46,6 +50,10 @@
you don't. */
#undef HAVE_DECL_FWRITE_UNLOCKED
+/* Define to 1 if you have the declaration of `getopt', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GETOPT
+
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_PUTC_UNLOCKED
diff --git a/libcpp/configure b/libcpp/configure
index 604ed847d6f..b8c2c5a4cce 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -5066,6 +5066,76 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking whether basename is declared" >&5
+echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_basename+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef basename
+ char *p = (char *) basename;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_basename=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_basename=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5
+echo "${ECHO_T}$ac_cv_have_decl_basename" >&6
+if test $ac_cv_have_decl_basename = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_BASENAME 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_BASENAME 0
+_ACEOF
+
+
+fi
echo "$as_me:$LINENO: checking whether errno is declared" >&5
echo $ECHO_N "checking whether errno is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_errno+set}" = set; then
@@ -5136,6 +5206,76 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking whether getopt is declared" >&5
+echo $ECHO_N "checking whether getopt is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_getopt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef getopt
+ char *p = (char *) getopt;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_getopt=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_getopt=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt" >&5
+echo "${ECHO_T}$ac_cv_have_decl_getopt" >&6
+if test $ac_cv_have_decl_getopt = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETOPT 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETOPT 0
+_ACEOF
+
+
+fi
echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5
echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 8a9a44986e8..b268d8d76bc 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -46,7 +46,7 @@ AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \
fwrite_unlocked fprintf_unlocked)
-AC_CHECK_DECLS([abort, errno, putc_unlocked, fputc_unlocked,
+AC_CHECK_DECLS([abort, basename, errno, getopt, putc_unlocked, fputc_unlocked,
fputs_unlocked, fwrite_unlocked, fprintf_unlocked])
# Checks for library functions.
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 6039862a95a..8a6d45ac191 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1,6 +1,6 @@
/* CPP Library. (Directive handling.)
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
diff --git a/libcpp/files.c b/libcpp/files.c
index df5d9d7c972..593e5ebf0c8 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -1,6 +1,6 @@
/* Part of CPP library. File handling.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -173,7 +173,6 @@ static void read_name_map (cpp_dir *dir);
static char *remap_filename (cpp_reader *pfile, _cpp_file *file);
static char *append_file_to_dir (const char *fname, cpp_dir *dir);
static bool validate_pch (cpp_reader *, _cpp_file *file, const char *pchname);
-static int pchf_adder (void **slot, void *data);
static int pchf_save_compare (const void *e1, const void *e2);
static int pchf_compare (const void *d_p, const void *e_p);
static bool check_file_against_entries (cpp_reader *, _cpp_file *, bool);
@@ -1448,38 +1447,54 @@ struct pchf_data {
static struct pchf_data *pchf;
-/* Data for pchf_addr. */
-struct pchf_adder_info
+/* A qsort ordering function for pchf_entry structures. */
+
+static int
+pchf_save_compare (const void *e1, const void *e2)
{
- cpp_reader *pfile;
- struct pchf_data *d;
-};
+ return memcmp (e1, e2, sizeof (struct pchf_entry));
+}
-/* A hash traversal function to add entries into DATA->D. */
+/* Create and write to F a pchf_data structure. */
-static int
-pchf_adder (void **slot, void *data)
+bool
+_cpp_save_file_entries (cpp_reader *pfile, FILE *fp)
{
- struct file_hash_entry *h = (struct file_hash_entry *) *slot;
- struct pchf_adder_info *i = (struct pchf_adder_info *) data;
+ size_t count = 0;
+ struct pchf_data *result;
+ size_t result_size;
+ _cpp_file *f;
- if (h->start_dir != NULL && h->u.file->stack_count != 0)
+ for (f = pfile->all_files; f; f = f->next_file)
+ ++count;
+
+ result_size = (sizeof (struct pchf_data)
+ + sizeof (struct pchf_entry) * (count - 1));
+ result = xcalloc (result_size, 1);
+
+ result->count = 0;
+ result->have_once_only = false;
+
+ for (f = pfile->all_files; f; f = f->next_file)
{
- struct pchf_data *d = i->d;
- _cpp_file *f = h->u.file;
- size_t count = d->count++;
+ size_t count;
/* This should probably never happen, since if a read error occurred
the PCH file shouldn't be written... */
if (f->dont_read || f->err_no)
- return 1;
+ continue;
+
+ if (f->stack_count == 0)
+ continue;
- d->entries[count].once_only = f->once_only;
+ count = result->count++;
+
+ result->entries[count].once_only = f->once_only;
/* |= is avoided in the next line because of an HP C compiler bug */
- d->have_once_only = d->have_once_only | f->once_only;
+ result->have_once_only = result->have_once_only | f->once_only;
if (f->buffer_valid)
- md5_buffer ((const char *)f->buffer,
- f->st.st_size, d->entries[count].sum);
+ md5_buffer ((const char *)f->buffer,
+ f->st.st_size, result->entries[count].sum);
else
{
FILE *ff;
@@ -1487,48 +1502,16 @@ pchf_adder (void **slot, void *data)
if (!open_file (f))
{
- open_file_failed (i->pfile, f);
- return 0;
+ open_file_failed (pfile, f);
+ return false;
}
ff = fdopen (f->fd, "rb");
- md5_stream (ff, d->entries[count].sum);
+ md5_stream (ff, result->entries[count].sum);
fclose (ff);
f->fd = oldfd;
}
- d->entries[count].size = f->st.st_size;
+ result->entries[count].size = f->st.st_size;
}
- return 1;
-}
-
-/* A qsort ordering function for pchf_entry structures. */
-
-static int
-pchf_save_compare (const void *e1, const void *e2)
-{
- return memcmp (e1, e2, sizeof (struct pchf_entry));
-}
-
-/* Create and write to F a pchf_data structure. */
-
-bool
-_cpp_save_file_entries (cpp_reader *pfile, FILE *f)
-{
- size_t count = 0;
- struct pchf_data *result;
- size_t result_size;
- struct pchf_adder_info pai;
-
- count = htab_elements (pfile->file_hash);
- result_size = (sizeof (struct pchf_data)
- + sizeof (struct pchf_entry) * (count - 1));
- result = xcalloc (result_size, 1);
-
- result->count = 0;
- result->have_once_only = false;
-
- pai.pfile = pfile;
- pai.d = result;
- htab_traverse (pfile->file_hash, pchf_adder, &pai);
result_size = (sizeof (struct pchf_data)
+ sizeof (struct pchf_entry) * (result->count - 1));
@@ -1536,7 +1519,7 @@ _cpp_save_file_entries (cpp_reader *pfile, FILE *f)
qsort (result->entries, result->count, sizeof (struct pchf_entry),
pchf_save_compare);
- return fwrite (result, result_size, 1, f) == 1;
+ return fwrite (result, result_size, 1, fp) == 1;
}
/* Read the pchf_data structure from F. */
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index c3814460705..70f8d895afd 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -659,6 +659,9 @@ extern bool cpp_interpret_string_notranslate (cpp_reader *,
const cpp_string *, size_t,
cpp_string *, bool);
+/* Convert a host character constant to the execution character set. */
+extern cppchar_t cpp_host_to_exec_charset (cpp_reader *, cppchar_t);
+
/* Used to register macros and assertions, perhaps from the command line.
The text is the same as the command line argument. */
extern void cpp_define (cpp_reader *, const char *);
@@ -743,12 +746,6 @@ cpp_num cpp_num_sign_extend (cpp_num, size_t);
#define CPP_DL_WARNING_P(l) (CPP_DL_EXTRACT (l) >= CPP_DL_WARNING \
&& CPP_DL_EXTRACT (l) <= CPP_DL_PEDWARN)
-/* N.B. The error-message-printer prototypes have not been nicely
- formatted because exgettext needs to see 'msgid' on the same line
- as the name of the function in order to work properly. Only the
- string argument gets a name in an effort to keep the lines from
- getting ridiculously oversized. */
-
/* Output a diagnostic of some kind. */
extern void cpp_error (cpp_reader *, int, const char *msgid, ...)
ATTRIBUTE_PRINTF_3;
diff --git a/libcpp/init.c b/libcpp/init.c
index c3c738e250c..39e50f5a519 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -1,6 +1,6 @@
/* CPP Library.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 9f39b21ec8e..0ae13d58cb6 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -1,5 +1,5 @@
/* Part of CPP library.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -585,6 +585,9 @@ static inline unsigned char *uxstrdup (const unsigned char *);
static inline unsigned char *ustrchr (const unsigned char *, int);
static inline int ufputs (const unsigned char *, FILE *);
+/* Use a const char for the second parameter since it is usually a literal. */
+static inline int ustrcspn (const unsigned char *, const char *);
+
static inline int
ustrcmp (const unsigned char *s1, const unsigned char *s2)
{
@@ -597,6 +600,12 @@ ustrncmp (const unsigned char *s1, const unsigned char *s2, size_t n)
return strncmp ((const char *)s1, (const char *)s2, n);
}
+static inline int
+ustrcspn (const unsigned char *s1, const char *s2)
+{
+ return strcspn ((const char *)s1, s2);
+}
+
static inline size_t
ustrlen (const unsigned char *s1)
{
diff --git a/libcpp/macro.c b/libcpp/macro.c
index e3824cbe5af..5e596699e01 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -1,6 +1,6 @@
/* Part of CPP library. (Macro and #define handling.)
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -910,7 +910,10 @@ padding_token (cpp_reader *pfile, const cpp_token *source)
cpp_token *result = _cpp_temp_token (pfile);
result->type = CPP_PADDING;
- result->val.source = source;
+
+ /* Data in GCed data structures cannot be made const so far, so we
+ need a cast here. */
+ result->val.source = (cpp_token *) source;
result->flags = 0;
return result;
}
@@ -1416,10 +1419,11 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
/* Success. Commit or allocate the parameter array. */
if (pfile->hash_table->alloc_subobject)
{
- cpp_token *tokns = pfile->hash_table->alloc_subobject
- (sizeof (cpp_token) * macro->paramc);
- memcpy (tokns, macro->params, sizeof (cpp_token) * macro->paramc);
- macro->params = tokns;
+ cpp_hashnode **params = pfile->hash_table->alloc_subobject
+ (sizeof (cpp_hashnode *) * macro->paramc);
+ memcpy (params, macro->params,
+ sizeof (cpp_hashnode *) * macro->paramc);
+ macro->params = params;
}
else
BUFF_FRONT (pfile->a_buff) = (uchar *) &macro->params[macro->paramc];
@@ -1662,6 +1666,7 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
len += NODE_LEN (macro->params[i]) + 1; /* "," */
}
+ /* This should match below where we fill in the buffer. */
if (CPP_OPTION (pfile, traditional))
len += _cpp_replacement_text_len (macro);
else
@@ -1673,11 +1678,14 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
if (token->type == CPP_MACRO_ARG)
len += NODE_LEN (macro->params[token->val.arg_no - 1]);
else
- len += cpp_token_len (token) + 1; /* Includes room for ' '. */
+ len += cpp_token_len (token);
+
if (token->flags & STRINGIFY_ARG)
len++; /* "#" */
if (token->flags & PASTE_LEFT)
len += 3; /* " ##" */
+ if (token->flags & PREV_WHITE)
+ len++; /* " " */
}
}
@@ -1737,10 +1745,10 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
if (token->type == CPP_MACRO_ARG)
{
- len = NODE_LEN (macro->params[token->val.arg_no - 1]);
memcpy (buffer,
- NODE_NAME (macro->params[token->val.arg_no - 1]), len);
- buffer += len;
+ NODE_NAME (macro->params[token->val.arg_no - 1]),
+ NODE_LEN (macro->params[token->val.arg_no - 1]));
+ buffer += NODE_LEN (macro->params[token->val.arg_no - 1]);
}
else
buffer = cpp_spell_token (pfile, token, buffer);
diff --git a/libcpp/pch.c b/libcpp/pch.c
index 292132139d2..79900c30c36 100644
--- a/libcpp/pch.c
+++ b/libcpp/pch.c
@@ -1,5 +1,6 @@
/* Part of CPP library. (Precompiled header reading/writing.)
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -653,7 +654,7 @@ cpp_read_state (cpp_reader *r, const char *name, FILE *f,
size_t namelen;
uchar *defn;
- namelen = strcspn (data->defns[i], "( \n");
+ namelen = ustrcspn (data->defns[i], "( \n");
h = cpp_lookup (r, data->defns[i], namelen);
defn = data->defns[i] + namelen;
diff --git a/libcpp/po/ChangeLog b/libcpp/po/ChangeLog
index 86488c52ec6..8ad1332900f 100644
--- a/libcpp/po/ChangeLog
+++ b/libcpp/po/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-25 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cpplib.pot: Regenerate.
+
2004-12-15 Joseph S. Myers <joseph@codesourcery.com>
* fr.po: Update.
diff --git a/libcpp/po/cpplib.pot b/libcpp/po/cpplib.pot
index 9d82e855357..4677ec07112 100644
--- a/libcpp/po/cpplib.pot
+++ b/libcpp/po/cpplib.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
-"POT-Creation-Date: 2004-11-27 19:38+0000\n"
+"POT-Creation-Date: 2005-02-25 23:28+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,113 +16,125 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: charset.c:653
+#: charset.c:655
#, c-format
msgid "conversion from %s to %s not supported by iconv"
msgstr ""
-#: charset.c:656
+#: charset.c:658
msgid "iconv_open"
msgstr ""
-#: charset.c:664
+#: charset.c:666
#, c-format
msgid "no iconv implementation, cannot convert from %s to %s"
msgstr ""
-#: charset.c:808
+#: charset.c:743
+#, c-format
+msgid "character 0x%lx is not in the basic source character set\n"
+msgstr ""
+
+#: charset.c:760
+#: charset.c:1243
+msgid "converting to execution character set"
+msgstr ""
+
+#: charset.c:766
+#, c-format
+msgid "character 0x%lx is not unibyte in execution character set"
+msgstr ""
+
+#: charset.c:865
msgid "universal character names are only valid in C++ and C99"
msgstr ""
-#: charset.c:811
+#: charset.c:868
#, c-format
msgid "the meaning of '\\%c' is different in traditional C"
msgstr ""
-#: charset.c:837
+#: charset.c:894
#, c-format
msgid "incomplete universal character name %.*s"
msgstr ""
-#: charset.c:849
+#: charset.c:906
#, c-format
msgid "%.*s is not a valid universal character"
msgstr ""
-#: charset.c:859
+#: charset.c:916
#, c-format
msgid "universal character %.*s is not valid in an identifier"
msgstr ""
-#: charset.c:863
+#: charset.c:920
#, c-format
msgid "universal character %.*s is not valid at the start of an identifier"
msgstr ""
-#: charset.c:896
+#: charset.c:953
msgid "converting UCN to source character set"
msgstr ""
-#: charset.c:900
+#: charset.c:957
msgid "converting UCN to execution character set"
msgstr ""
-#: charset.c:972
+#: charset.c:1029
msgid "the meaning of '\\x' is different in traditional C"
msgstr ""
-#: charset.c:989
+#: charset.c:1046
msgid "\\x used with no following hex digits"
msgstr ""
-#: charset.c:996
+#: charset.c:1053
msgid "hex escape sequence out of range"
msgstr ""
-#: charset.c:1035
+#: charset.c:1092
msgid "octal escape sequence out of range"
msgstr ""
-#: charset.c:1103
+#: charset.c:1160
msgid "the meaning of '\\a' is different in traditional C"
msgstr ""
-#: charset.c:1110
+#: charset.c:1167
#, c-format
msgid "non-ISO-standard escape sequence, '\\%c'"
msgstr ""
-#: charset.c:1118
+#: charset.c:1175
#, c-format
msgid "unknown escape sequence '\\%c'"
msgstr ""
-#: charset.c:1121
+#: charset.c:1178
#, c-format
msgid "unknown escape sequence: '\\%03o'"
msgstr ""
-#: charset.c:1127
+#: charset.c:1184
msgid "converting escape sequence to execution character set"
msgstr ""
-#: charset.c:1186
-msgid "converting to execution character set"
-msgstr ""
-
-#: charset.c:1249 charset.c:1312
+#: charset.c:1306
+#: charset.c:1369
msgid "character constant too long for its type"
msgstr ""
-#: charset.c:1252
+#: charset.c:1309
msgid "multi-character character constant"
msgstr ""
-#: charset.c:1344
+#: charset.c:1401
msgid "empty character constant"
msgstr ""
-#: charset.c:1393
+#: charset.c:1450
#, c-format
msgid "failure to convert %s to %s"
msgstr ""
@@ -197,138 +209,144 @@ msgid "#%s expects \"FILENAME\" or <FILENAME>"
msgstr ""
#: directives.c:673
+#, c-format
+msgid "empty filename in #%s"
+msgstr ""
+
+#: directives.c:681
msgid "#include nested too deeply"
msgstr ""
-#: directives.c:711
+#: directives.c:719
msgid "#include_next in primary source file"
msgstr ""
-#: directives.c:737
+#: directives.c:745
#, c-format
msgid "invalid flag \"%s\" in line directive"
msgstr ""
-#: directives.c:784
+#: directives.c:792
#, c-format
msgid "\"%s\" after #line is not a positive integer"
msgstr ""
-#: directives.c:790
+#: directives.c:798
msgid "line number out of range"
msgstr ""
-#: directives.c:803 directives.c:880
+#: directives.c:811
+#: directives.c:888
#, c-format
msgid "\"%s\" is not a valid filename"
msgstr ""
-#: directives.c:840
+#: directives.c:848
#, c-format
msgid "\"%s\" after # is not a positive integer"
msgstr ""
-#: directives.c:942
+#: directives.c:950
msgid "invalid #ident directive"
msgstr ""
-#: directives.c:1030
+#: directives.c:1038
#, c-format
msgid "registering \"%s\" as both a pragma and a pragma namespace"
msgstr ""
-#: directives.c:1033
+#: directives.c:1041
#, c-format
msgid "#pragma %s %s is already registered"
msgstr ""
-#: directives.c:1036
+#: directives.c:1044
#, c-format
msgid "#pragma %s is already registered"
msgstr ""
-#: directives.c:1236
+#: directives.c:1244
msgid "#pragma once in main file"
msgstr ""
-#: directives.c:1259
+#: directives.c:1267
msgid "invalid #pragma GCC poison directive"
msgstr ""
-#: directives.c:1268
+#: directives.c:1276
#, c-format
msgid "poisoning existing macro \"%s\""
msgstr ""
-#: directives.c:1289
+#: directives.c:1297
msgid "#pragma system_header ignored outside include file"
msgstr ""
-#: directives.c:1313
+#: directives.c:1321
#, c-format
msgid "cannot find source file %s"
msgstr ""
-#: directives.c:1317
+#: directives.c:1325
#, c-format
msgid "current file is older than %s"
msgstr ""
-#: directives.c:1431
+#: directives.c:1439
msgid "_Pragma takes a parenthesized string literal"
msgstr ""
-#: directives.c:1538
+#: directives.c:1546
msgid "#else without #if"
msgstr ""
-#: directives.c:1543
+#: directives.c:1551
msgid "#else after #else"
msgstr ""
-#: directives.c:1545
-#: directives.c:1578
+#: directives.c:1553
+#: directives.c:1586
msgid "the conditional began here"
msgstr ""
-#: directives.c:1571
+#: directives.c:1579
msgid "#elif without #if"
msgstr ""
-#: directives.c:1576
+#: directives.c:1584
msgid "#elif after #else"
msgstr ""
-#: directives.c:1606
+#: directives.c:1614
msgid "#endif without #if"
msgstr ""
-#: directives.c:1683
+#: directives.c:1691
msgid "missing '(' after predicate"
msgstr ""
-#: directives.c:1698
+#: directives.c:1706
msgid "missing ')' to complete answer"
msgstr ""
-#: directives.c:1718
+#: directives.c:1726
msgid "predicate's answer is empty"
msgstr ""
-#: directives.c:1745
+#: directives.c:1753
msgid "assertion without predicate"
msgstr ""
-#: directives.c:1747
+#: directives.c:1755
msgid "predicate must be an identifier"
msgstr ""
-#: directives.c:1833
+#: directives.c:1841
#, c-format
msgid "\"%s\" re-asserted"
msgstr ""
-#: directives.c:2056
+#: directives.c:2064
#, c-format
msgid "unterminated #%s"
msgstr ""
@@ -380,7 +398,8 @@ msgstr ""
msgid "invalid suffix \"%.*s\" on floating constant"
msgstr ""
-#: expr.c:250 expr.c:275
+#: expr.c:250
+#: expr.c:275
#, c-format
msgid "traditional C rejects the \"%.*s\" suffix"
msgstr ""
@@ -436,7 +455,8 @@ msgstr ""
msgid "\"%s\" is not defined"
msgstr ""
-#: expr.c:716 expr.c:745
+#: expr.c:716
+#: expr.c:745
#, c-format
msgid "missing binary operator before token \"%s\""
msgstr ""
@@ -519,35 +539,35 @@ msgstr ""
msgid "NULL directory in find_file"
msgstr ""
-#: files.c:446
+#: files.c:454
msgid "one or more PCH files were found, but they were invalid"
msgstr ""
-#: files.c:449
+#: files.c:457
msgid "use -Winvalid-pch for more information"
msgstr ""
-#: files.c:514
+#: files.c:522
#, c-format
msgid "%s is a block device"
msgstr ""
-#: files.c:531
+#: files.c:539
#, c-format
msgid "%s is too large"
msgstr ""
-#: files.c:566
+#: files.c:574
#, c-format
msgid "%s is shorter than expected"
msgstr ""
-#: files.c:769
+#: files.c:803
#, c-format
msgid "no include path in which to search for %s"
msgstr ""
-#: files.c:1052
+#: files.c:1096
msgid "Multiple include guards may be useful for:\n"
msgstr ""
@@ -641,7 +661,8 @@ msgstr ""
msgid "no newline at end of file"
msgstr ""
-#: lex.c:948 traditional.c:162
+#: lex.c:948
+#: traditional.c:162
msgid "unterminated comment"
msgstr ""
@@ -679,7 +700,8 @@ msgstr ""
msgid "macro \"%s\" is not used"
msgstr ""
-#: macro.c:124 macro.c:287
+#: macro.c:124
+#: macro.c:287
#, c-format
msgid "invalid built-in macro \"%s\""
msgstr ""
@@ -711,7 +733,8 @@ msgstr ""
msgid "macro \"%s\" passed %u arguments, but takes just %u"
msgstr ""
-#: macro.c:642 traditional.c:675
+#: macro.c:642
+#: traditional.c:675
#, c-format
msgid "unterminated argument list invoking macro \"%s\""
msgstr ""
@@ -721,88 +744,91 @@ msgstr ""
msgid "function-like macro \"%s\" must be used with arguments in traditional C"
msgstr ""
-#: macro.c:1258
+#: macro.c:1261
#, c-format
msgid "duplicate macro parameter \"%s\""
msgstr ""
-#: macro.c:1303
+#: macro.c:1306
#, c-format
msgid "\"%s\" may not appear in macro parameter list"
msgstr ""
-#: macro.c:1311
+#: macro.c:1314
msgid "macro parameters must be comma-separated"
msgstr ""
-#: macro.c:1328
+#: macro.c:1331
msgid "parameter name missing"
msgstr ""
-#: macro.c:1345
+#: macro.c:1348
msgid "anonymous variadic macros were introduced in C99"
msgstr ""
-#: macro.c:1350
+#: macro.c:1353
msgid "ISO C does not permit named variadic macros"
msgstr ""
-#: macro.c:1359
+#: macro.c:1362
msgid "missing ')' in macro parameter list"
msgstr ""
-#: macro.c:1430
+#: macro.c:1434
msgid "ISO C requires whitespace after the macro name"
msgstr ""
-#: macro.c:1458
+#: macro.c:1462
msgid "'#' is not followed by a macro parameter"
msgstr ""
-#: macro.c:1477
+#: macro.c:1481
msgid "'##' cannot appear at either end of a macro expansion"
msgstr ""
-#: macro.c:1573
+#: macro.c:1577
#, c-format
msgid "\"%s\" redefined"
msgstr ""
-#: macro.c:1578
+#: macro.c:1582
msgid "this is the location of the previous definition"
msgstr ""
-#: macro.c:1628
+#: macro.c:1632
#, c-format
msgid "macro argument \"%s\" would be stringified in traditional C"
msgstr ""
-#: macro.c:1651
+#: macro.c:1655
#, c-format
msgid "invalid hash type %d in cpp_macro_definition"
msgstr ""
-#: pch.c:83 pch.c:331
-#: pch.c:353 pch.c:359
+#: pch.c:84
+#: pch.c:332
+#: pch.c:354
+#: pch.c:360
msgid "while writing precompiled header"
msgstr ""
-#: pch.c:466
+#: pch.c:467
#, c-format
msgid "%s: not used because `%.*s' not defined"
msgstr ""
-#: pch.c:478
+#: pch.c:479
#, c-format
msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'"
msgstr ""
-#: pch.c:519
+#: pch.c:520
#, c-format
msgid "%s: not used because `%s' is defined"
msgstr ""
-#: pch.c:532 pch.c:695
+#: pch.c:533
+#: pch.c:696
msgid "while reading precompiled header"
msgstr ""
diff --git a/libcpp/traditional.c b/libcpp/traditional.c
index ba25301b14e..85be48716a5 100644
--- a/libcpp/traditional.c
+++ b/libcpp/traditional.c
@@ -1,5 +1,5 @@
/* CPP Library - traditional lexical analysis and macro expansion.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
Contributed by Neil Booth, May 2002
This program is free software; you can redistribute it and/or modify it
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index b0bccb7b072..83a1c2b5d9e 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,24 @@
+2005-02-22 Andrew Haley <aph@redhat.com>
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to
+ odd-numbered register pairs for 64-bit integer types.
+
+2005-02-23 Andreas Tobler <a.tobler@schweiz.ch>
+
+ PR libffi/20104
+ * testsuite/libffi.call/return_ll1.c: New test case.
+
+2005-02-11 Janis Johnson <janis187@us.ibm.com>
+
+ * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options.
+ * testsuite/libffi.call/float.c: Ditto.
+ * testsuite/libffi.call/float2.c: Ditto.
+ * testsuite/libffi.call/float3.c: Ditto.
+
+2005-02-08 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv.
+
2005-01-12 Eric Botcazou <ebotcazou@libertysurf.fr>
* testsuite/libffi.special/special.exp (cxx_options): Add
diff --git a/libffi/src/frv/ffitarget.h b/libffi/src/frv/ffitarget.h
index 48ca13963c6..d235697d641 100644
--- a/libffi/src/frv/ffitarget.h
+++ b/libffi/src/frv/ffitarget.h
@@ -28,10 +28,6 @@
/* ---- System specific configurations ----------------------------------- */
-#if defined (POWERPC) && defined (__powerpc64__)
-#define POWERPC64
-#endif
-
#ifndef LIBFFI_ASM
typedef unsigned long ffi_arg;
typedef signed long ffi_sarg;
@@ -44,29 +40,6 @@ typedef enum ffi_abi {
FFI_DEFAULT_ABI = FFI_EABI,
#endif
-#ifdef POWERPC
- FFI_SYSV,
- FFI_GCC_SYSV,
- FFI_LINUX64,
-# ifdef POWERPC64
- FFI_DEFAULT_ABI = FFI_LINUX64,
-# else
- FFI_DEFAULT_ABI = FFI_GCC_SYSV,
-# endif
-#endif
-
-#ifdef POWERPC_AIX
- FFI_AIX,
- FFI_DARWIN,
- FFI_DEFAULT_ABI = FFI_AIX,
-#endif
-
-#ifdef POWERPC_DARWIN
- FFI_AIX,
- FFI_DARWIN,
- FFI_DEFAULT_ABI = FFI_DARWIN,
-#endif
-
FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
} ffi_abi;
#endif
@@ -78,11 +51,10 @@ typedef enum ffi_abi {
#ifdef __FRV_FDPIC__
/* Trampolines are 8 4-byte instructions long. */
-#define FFI_TRAMPOLINE_SIZE (8*4)
+#define FFI_TRAMPOLINE_SIZE (8*4)
#else
/* Trampolines are 5 4-byte instructions long. */
-#define FFI_TRAMPOLINE_SIZE (5*4)
+#define FFI_TRAMPOLINE_SIZE (5*4)
#endif
#endif
-
diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c
index c8d188777c8..67d945bd826 100644
--- a/libffi/src/powerpc/ffi.c
+++ b/libffi/src/powerpc/ffi.c
@@ -573,10 +573,14 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
/* 'long long' arguments are passed as two words, but
either both words must fit in registers or both go
on the stack. If they go on the stack, they must
- be 8-byte-aligned. */
+ be 8-byte-aligned.
+
+ Also, only certain register pairs can be used for
+ passing long long int -- specifically (r3,r4), (r5,r6),
+ (r7,r8), (r9,r10).
+ */
if (intarg_count == NUM_GPR_ARG_REGISTERS-1
- || (intarg_count >= NUM_GPR_ARG_REGISTERS
- && intarg_count%2 != 0))
+ || intarg_count%2 != 0)
intarg_count++;
intarg_count += 2;
break;
diff --git a/libffi/testsuite/libffi.call/cls_align_longdouble.c b/libffi/testsuite/libffi.call/cls_align_longdouble.c
index 6234e5d3fcd..bcfddf5f710 100644
--- a/libffi/testsuite/libffi.call/cls_align_longdouble.c
+++ b/libffi/testsuite/libffi.call/cls_align_longdouble.c
@@ -5,7 +5,6 @@
Originator: <hos@tamanegi.org> 20031203 */
/* { dg-do run { xfail mips64*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
#include "ffitest.h"
diff --git a/libffi/testsuite/libffi.call/float.c b/libffi/testsuite/libffi.call/float.c
index d712fb1021a..51cb2fa3718 100644
--- a/libffi/testsuite/libffi.call/float.c
+++ b/libffi/testsuite/libffi.call/float.c
@@ -5,7 +5,6 @@
Originator: From the original ffitest.c */
/* { dg-do run } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
#include "ffitest.h"
diff --git a/libffi/testsuite/libffi.call/float2.c b/libffi/testsuite/libffi.call/float2.c
index 4de41d356c4..2039724fdc2 100644
--- a/libffi/testsuite/libffi.call/float2.c
+++ b/libffi/testsuite/libffi.call/float2.c
@@ -5,7 +5,6 @@
Originator: From the original ffitest.c */
/* { dg-do run } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
#include "ffitest.h"
#include "float.h"
diff --git a/libffi/testsuite/libffi.call/float3.c b/libffi/testsuite/libffi.call/float3.c
index 27933c32606..76bd5f287cb 100644
--- a/libffi/testsuite/libffi.call/float3.c
+++ b/libffi/testsuite/libffi.call/float3.c
@@ -5,7 +5,6 @@
Originator: From the original ffitest.c */
/* { dg-do run } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-* } } */
#include "ffitest.h"
#include "float.h"
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index e932ed1bf55..cdb0868cdb6 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,34 @@
+2004-02-22 Paul Thomas <paulthomas2@wannado.fr>
+ Bud Davis <bdavis@gfortran.org>
+
+ * io/list_read.c (read_real): Handle separators properly
+ in list directed read.
+
+2004-02-21 Bud Davis <bdavis@gfortran.org>
+
+ PR fortran/20086
+ * io/transfer.c (write_constant_string): accept an 'h' as
+ the start of a hollerith format string.
+
+2005-02-21 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR libfortran/19302
+ * intrinsics/c99_functions.c (nextafterf): Special-case infinite
+ numbers.
+
+2005-02-21 Steven G. Kargl <kargls@comcast.net>
+
+ * io/write.c (output_float): Typo in error meesage.
+
+2005-02-20 Steven G. Kargl <kargls@comcast.net>
+
+ PR 20085
+ * intrinsic/args.c (iargc): Off by 1.
+
+2005-02-19 Steven G. Kargl <kargls@comcast.net>
+
+ * intrinsic/date_and_time.c: Fix conformance problems.
+
2005-02-01 Paul Thomas <paulthomas2@wanadoo.fr>
PR libgfortran/19363
diff --git a/libgfortran/intrinsics/args.c b/libgfortran/intrinsics/args.c
index e1032d43408..72f1b987c87 100644
--- a/libgfortran/intrinsics/args.c
+++ b/libgfortran/intrinsics/args.c
@@ -1,6 +1,6 @@
/* Implementation of the GETARG and IARGC g77, and
corresponding F2003, intrinsics.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
Contributed by Bud Davis and Janne Blomqvist.
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -78,7 +78,9 @@ getarg_i8 (GFC_INTEGER_8 *pos, char *val, gfc_charlen_type val_len)
}
-/* Return the number of commandline arguments. */
+/* Return the number of commandline arguments. The g77 info page
+ states that iargc does not include the specification of the
+ program name itself. */
extern GFC_INTEGER_4 iargc (void);
export_proto(iargc);
@@ -91,7 +93,7 @@ iargc (void)
get_args (&argc, &argv);
- return argc;
+ return (argc - 1);
}
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index 7dd95918dcd..f7dc9777dd8 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -218,6 +218,8 @@ nextafterf(float x, float y)
return x + y;
if (x == y)
return x;
+ if (!isfinite (x))
+ return x > 0 ? __FLT_MAX__ : - __FLT_MAX__;
/* absx = fabsf (x); */
absx = (x < 0.0) ? -x : x;
diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c
index 5bdb0494d20..2364186a0d7 100644
--- a/libgfortran/intrinsics/date_and_time.c
+++ b/libgfortran/intrinsics/date_and_time.c
@@ -1,5 +1,5 @@
/* Implementation of the DATE_AND_TIME intrinsic.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Steven Bosscher.
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -67,7 +67,7 @@ Boston, MA 02111-1307, USA. */
DATE (optional) shall be scalar and of type default character, and
shall be of length at least 8 in order to contain the complete
- value. It is an INTENT (OUT) argument. Its leftmost 8 characters
+ value. It is an INTENT(OUT) argument. Its leftmost 8 characters
are assigned a value of the form CCYYMMDD, where CC is the century,
YY the year within the century, MM the month within the year, and
DD the day within the month. If there is no date available, they
@@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA. */
TIME (optional) shall be scalar and of type default character, and
shall be of length at least 10 in order to contain the complete
- value. It is an INTENT (OUT) argument. Its leftmost 10 characters
+ value. It is an INTENT(OUT) argument. Its leftmost 10 characters
are assigned a value of the form hhmmss.sss, where hh is the hour
of the day, mm is the minutes of the hour, and ss.sss is the
seconds and milliseconds of the minute. If there is no clock
@@ -83,40 +83,40 @@ Boston, MA 02111-1307, USA. */
ZONE (optional) shall be scalar and of type default character, and
shall be of length at least 5 in order to contain the complete
- value. It is an INTENT (OUT) argument. Its leftmost 5 characters
- are assigned a value of the form ±hhmm, where hh and mm are the
+ value. It is an INTENT(OUT) argument. Its leftmost 5 characters
+ are assigned a value of the form ±hhmm, where hh and mm are the
time difference with respect to Coordinated Universal Time (UTC) in
hours and parts of an hour expressed in minutes, respectively. If
there is no clock available, they are assigned blanks.
VALUES (optional) shall be of type default integer and of rank
- one. It is an INTENT (OUT) argument. Its size shall be at least
+ one. It is an INTENT(OUT) argument. Its size shall be at least
8. The values returned in VALUES are as follows:
- VALUES (1) the year (for example, 2003), or HUGE (0) if there is
+ VALUES(1) the year (for example, 2003), or -HUGE(0) if there is
no date available;
- VALUES (2) the month of the year, or HUGE (0) if there
+ VALUES(2) the month of the year, or -HUGE(0) if there
is no date available;
- VALUES (3) the day of the month, or HUGE (0) if there is no date
+ VALUES(3) the day of the month, or -HUGE(0) if there is no date
available;
- VALUES (4) the time difference with respect to Coordinated
- Universal Time (UTC) in minutes, or HUGE (0) if this information
+ VALUES(4) the time difference with respect to Coordinated
+ Universal Time (UTC) in minutes, or -HUGE(0) if this information
is not available;
- VALUES (5) the hour of the day, in the range of 0 to 23, or HUGE
- (0) if there is no clock;
+ VALUES(5) the hour of the day, in the range of 0 to 23, or
+ -HUGE(0) if there is no clock;
- VALUES (6) the minutes of the hour, in the range 0 to 59, or
- HUGE (0) if there is no clock;
+ VALUES(6) the minutes of the hour, in the range 0 to 59, or
+ -HUGE(0) if there is no clock;
- VALUES (7) the seconds of the minute, in the range 0 to 60, or
- HUGE (0) if there is no clock;
+ VALUES(7) the seconds of the minute, in the range 0 to 60, or
+ -HUGE(0) if there is no clock;
- VALUES (8) the milliseconds of the second, in the range 0 to
- 999, or HUGE (0) if there is no clock.
+ VALUES(8) the milliseconds of the second, in the range 0 to
+ 999, or -HUGE(0) if there is no clock.
NULL pointer represent missing OPTIONAL arguments. All arguments
have INTENT(OUT). Because of the -i8 option, we must implement
@@ -129,125 +129,131 @@ Boston, MA 02111-1307, USA. */
- There is no STDC/POSIX way to get VALUES(8). A GNUish way may
be to use ftime.
*/
+#define DATE_LEN 8
+#define TIME_LEN 10
+#define ZONE_LEN 5
+#define VALUES_SIZE 8
extern void date_and_time (char *, char *, char *, gfc_array_i4 *,
GFC_INTEGER_4, GFC_INTEGER_4, GFC_INTEGER_4);
export_proto(date_and_time);
void
-date_and_time (char *__date,
- char *__time,
- char *__zone,
- gfc_array_i4 *__values,
- GFC_INTEGER_4 __date_len,
- GFC_INTEGER_4 __time_len,
- GFC_INTEGER_4 __zone_len)
+date_and_time (char *__date, char *__time, char *__zone,
+ gfc_array_i4 *__values, GFC_INTEGER_4 __date_len,
+ GFC_INTEGER_4 __time_len, GFC_INTEGER_4 __zone_len)
{
-#define DATE_LEN 8
-#define TIME_LEN 10
-#define ZONE_LEN 5
-#define VALUES_SIZE 8
+ int i;
char date[DATE_LEN + 1];
char timec[TIME_LEN + 1];
char zone[ZONE_LEN + 1];
GFC_INTEGER_4 values[VALUES_SIZE];
#ifndef HAVE_NO_DATE_TIME
- time_t lt = time (NULL);
- struct tm local_time = *localtime (&lt);
- struct tm UTC_time = *gmtime (&lt);
-
- /* All arguments can be derived from VALUES. */
- values[0] = 1900 + local_time.tm_year;
- values[1] = 1 + local_time.tm_mon;
- values[2] = local_time.tm_mday;
- values[3] = (local_time.tm_min - UTC_time.tm_min +
- 60 * (local_time.tm_hour - UTC_time.tm_hour +
+ time_t lt;
+ struct tm local_time;
+ struct tm UTC_time;
+
+ lt = time (NULL);
+
+ if (lt != (time_t) -1)
+ {
+ local_time = *localtime (&lt);
+ UTC_time = *gmtime (&lt);
+
+ /* All arguments can be derived from VALUES. */
+ values[0] = 1900 + local_time.tm_year;
+ values[1] = 1 + local_time.tm_mon;
+ values[2] = local_time.tm_mday;
+ values[3] = (local_time.tm_min - UTC_time.tm_min +
+ 60 * (local_time.tm_hour - UTC_time.tm_hour +
24 * (local_time.tm_yday - UTC_time.tm_yday)));
- values[4] = local_time.tm_hour;
- values[5] = local_time.tm_min;
- values[6] = local_time.tm_sec;
+ values[4] = local_time.tm_hour;
+ values[5] = local_time.tm_min;
+ values[6] = local_time.tm_sec;
+ values[7] = 0;
+
#if HAVE_GETTIMEOFDAY
- {
- struct timeval tp;
+ {
+ struct timeval tp;
# if GETTIMEOFDAY_ONE_ARGUMENT
- if (!gettimeofday (&tp))
+ if (!gettimeofday (&tp))
# else
# if HAVE_STRUCT_TIMEZONE
- struct timezone tzp;
+ struct timezone tzp;
/* Some systems such as HP-UX, do have struct timezone, but
gettimeofday takes void* as the 2nd arg. However, the
effect of passing anything other than a null pointer is
- unspecified on HPUX. Configure checks if gettimeofday
+ unspecified on HP-UX. Configure checks if gettimeofday
actually fails with a non-NULL arg and pretends that
struct timezone is missing if it does fail. */
- if (!gettimeofday (&tp, &tzp))
+ if (!gettimeofday (&tp, &tzp))
# else
- if (!gettimeofday (&tp, (void *) 0))
+ if (!gettimeofday (&tp, (void *) 0))
# endif /* HAVE_STRUCT_TIMEZONE */
# endif /* GETTIMEOFDAY_ONE_ARGUMENT */
values[7] = tp.tv_usec / 1000;
- }
-#else
- values[7] = GFC_INTEGER_4_HUGE;
+ }
#endif /* HAVE_GETTIMEOFDAY */
- if (__date)
- {
#if HAVE_SNPRINTF
- snprintf (date, DATE_LEN + 1, "%04d%02d%02d",
- values[0], values[1], values[2]);
+ if (__date)
+ snprintf (date, DATE_LEN + 1, "%04d%02d%02d",
+ values[0], values[1], values[2]);
+ if (__time)
+ snprintf (timec, TIME_LEN + 1, "%02d%02d%02d.%03d",
+ values[4], values[5], values[6], values[7]);
+
+ if (__zone)
+ snprintf (zone, ZONE_LEN + 1, "%+03d%02d",
+ values[3] / 60, abs (values[3] % 60));
#else
- sprintf (date, "%04d%02d%02d",
- values[0], values[1], values[2]);
-#endif
- }
+ if (__date)
+ sprintf (date, "%04d%02d%02d", values[0], values[1], values[2]);
- if (__time)
- {
-#if HAVE_SNPRINTF
- snprintf (timec, TIME_LEN + 1, "%02d%02d%02d.%03d",
- values[4], values[5], values[6], values[7]);
-#else
- sprintf (timec, "%02d%02d%02d.%03d",
- values[4], values[5], values[6], values[7]);
-#endif
- }
+ if (__time)
+ sprintf (timec, "%02d%02d%02d.%03d",
+ values[4], values[5], values[6], values[7]);
- if (__zone)
- {
-#if HAVE_SNPRINTF
- snprintf (zone, ZONE_LEN + 1, "%+03d%02d",
- values[3] / 60, abs (values[3] % 60));
-#else
- sprintf (zone, "%+03d%02d",
- values[3] / 60, abs (values[3] % 60));
+ if (__zone)
+ sprintf (zone, "%+03d%02d",
+ values[3] / 60, abs (values[3] % 60));
#endif
}
-#else /* if defined HAVE_NO_DATE_TIME */
- /* We really have *nothing* to return, so return blanks and HUGE(0). */
+ else
{
- int i;
-
memset (date, ' ', DATE_LEN);
date[DATE_LEN] = '\0';
memset (timec, ' ', TIME_LEN);
- time[TIME_LEN] = '\0';
+ timec[TIME_LEN] = '\0';
memset (zone, ' ', ZONE_LEN);
zone[ZONE_LEN] = '\0';
for (i = 0; i < VALUES_SIZE; i++)
- values[i] = GFC_INTEGER_4_HUGE;
- }
+ values[i] = - GFC_INTEGER_4_HUGE;
+ }
+#else /* if defined HAVE_NO_DATE_TIME */
+ /* We really have *nothing* to return, so return blanks and HUGE(0). */
+
+ memset (date, ' ', DATE_LEN);
+ date[DATE_LEN] = '\0';
+
+ memset (timec, ' ', TIME_LEN);
+ timec[TIME_LEN] = '\0';
+
+ memset (zone, ' ', ZONE_LEN);
+ zone[ZONE_LEN] = '\0';
+
+ for (i = 0; i < VALUES_SIZE; i++)
+ values[i] = - GFC_INTEGER_4_HUGE;
#endif /* HAVE_NO_DATE_TIME */
/* Copy the values into the arguments. */
if (__values)
{
- int i;
size_t len, delta, elt_size;
elt_size = GFC_DESCRIPTOR_SIZE (__values);
@@ -263,9 +269,7 @@ date_and_time (char *__date,
GFC_INTEGER_4 *vptr4 = __values->data;
for (i = 0; i < VALUES_SIZE; i++, vptr4 += delta)
- {
- *vptr4 = values[i];
- }
+ *vptr4 = values[i];
}
else if (elt_size == 8)
{
@@ -273,8 +277,8 @@ date_and_time (char *__date,
for (i = 0; i < VALUES_SIZE; i++, vptr8 += delta)
{
- if (values[i] == GFC_INTEGER_4_HUGE)
- *vptr8 = GFC_INTEGER_8_HUGE;
+ if (values[i] == - GFC_INTEGER_4_HUGE)
+ *vptr8 = - GFC_INTEGER_8_HUGE;
else
*vptr8 = values[i];
}
@@ -300,8 +304,4 @@ date_and_time (char *__date,
assert (__date_len >= DATE_LEN);
fstrcpy (__date, DATE_LEN, date, DATE_LEN);
}
-#undef DATE_LEN
-#undef TIME_LEN
-#undef ZONE_LEN
-#undef VALUES_SIZE
}
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index eecc11491e3..74a6688b014 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1052,8 +1052,6 @@ read_real (int length)
goto got_repeat;
CASE_SEPARATORS:
- if (c != '\n' && c != ',')
- unget_char (c); /* Real number that is just a digit-string. */
goto done;
default:
@@ -1164,8 +1162,6 @@ read_real (int length)
break;
CASE_SEPARATORS:
- unget_char (c);
- eat_separator ();
goto done;
default:
@@ -1174,6 +1170,8 @@ read_real (int length)
}
done:
+ unget_char (c);
+ eat_separator ();
push_char ('\0');
if (convert_real (value, saved_string, length))
return;
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index a55936f9e6c..0e4c619dc98 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -386,7 +386,7 @@ write_constant_string (fnode * f)
for (; length > 0; length--)
{
c = *p++ = *q++;
- if (c == delimiter && c != 'H')
+ if (c == delimiter && c != 'H' && c != 'h')
q++; /* Skip the doubled delimiter. */
}
}
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 403b9afe322..19744d294c0 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -297,7 +297,7 @@ output_float (fnode *f, double value, int len)
/* We should always know the field width and precision. */
if (d < 0)
- internal_error ("Uspecified precision");
+ internal_error ("Unspecified precision");
/* Use sprintf to print the number in the format +D.DDDDe+ddd
For an N digit exponent, this gives us (32-6)-N digits after the
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index adbb2498124..1d801adf38f 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-13 Jason Merrill <jason@redhat.com>
+
+ * cp-demangle.c (__cxa_demangle): Change resolution of ambiguous
+ arguments.
+
2005-01-11 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* hex.c (hex_value): Group 'unsigned int' together to get correct
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 5707aa20aa2..c4436d7d7d5 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -4047,21 +4047,6 @@ __cxa_demangle (mangled_name, output_buffer, length, status)
return NULL;
}
- /* The specification for __cxa_demangle() is that if the mangled
- name could be either an extern "C" identifier, or an internal
- built-in type name, then we resolve it as the identifier. All
- internal built-in type names are a single lower case character.
- Frankly, this simplistic disambiguation doesn't make sense to me,
- but it is documented, so we implement it here. */
- if (IS_LOWER (mangled_name[0])
- && mangled_name[1] == '\0'
- && cplus_demangle_builtin_types[mangled_name[0] - 'a'].name != NULL)
- {
- if (status != NULL)
- *status = -2;
- return NULL;
- }
-
demangled = d_demangle (mangled_name, DMGL_PARAMS | DMGL_TYPES, &alc);
if (demangled == NULL)
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 1ee4076912b..c6b5ef98e16 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,3993 @@
+2005-02-24 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/font/TextAttribute.java: changed names to lower case;
+ (readResolve): implemented.
+ Added doc comments all over.
+
+2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ PR libgcj/16923
+ * jni.cc (JNI_CreateJavaVM): Check JNI version. Cast args to
+ JvVMInitArgs. Pass args to _Jv_CreateJavaVM and check return
+ value. Move argument parsing code to prims.cc.
+ * prims.cc (no_properties): Remove.
+ (_Jv_Compiler_Properties): Initialize to NULL.
+ (_Jv_Properties_Count): Initialize to 0.
+ (parse_verbose_args): New function.
+ (parse_init_args): New function.
+ (_Jv_CreateJavaVM): Call parse_init_args.
+ (_Jv_RunMain): Check return value of _Jv_CreateJavaVM.
+ * gcj/cni.h (JvVMOption): New struct.
+ (JvVMInitArgs): Likewise.
+ (JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than
+ void*.
+ * libjava/gcj/javaprims.h (_Jv_VMOption): New struct.
+ (_Jv_VMInitArgs): Likewise.
+ * include/java-props.h (_Jv_Properties_Count): Declare.
+ * java/lang/natRuntime.cc (insertSystemProperties): Use
+ _Jv_Properties_Count in for loop exit condition.
+ * testsuite/libjava.jni/jni.exp
+ (gcj_invocation_compile_c_to_binary): New procedure.
+ (gcj_invocation_test_one): Likewise.
+ (gcj_jni_run): Run JNI invocation API tests.
+ * testsuite/libjava.jni/invocation/PR16923.c,
+ testsuite/libjava.jni/invocation/PR16923.java,
+ testsuite/libjava.jni/invocation/PR16923.out: New test.
+
+2005-02-23 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am: Added new file gnu/java/nio/ChannelReader.java.
+ * Makefile.in: Regenerated.
+
+2005-02-23 Robert Schuster <thebohemian@gmx.net>
+
+ * gnu/java/nio/ChannelReader: Fixed comments.
+
+2005-02-23 Robert Schuster <thebohemian@gmx.net>
+
+ * java/nio/channels/Channels: Added FIXMEs about
+ stub method implementation.
+ (newReader): Implemented.
+ * gnu/java/nio/ChannelReader: New class.
+
+2005-02-23 Michael Koch <konqueror@gmx.de>
+
+ * java/text/SimpleDateFormat.java:
+ Removed unused import.
+
+2005-02-22 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ PR libgcj/20029:
+ * Makefile.am (lib_gnu_java_awt_peer_gtk_la_CFLAGS): Add X_CFLAGS.
+ (lib_gnu_java_awt_peer_gtk_la_LDFLAGS): Add X_LIBS and -lXtst.
+ * Makefile.in: Regenerate.
+ * configure.ac: Check for libXtst.
+ * configure: Regenerate.
+
+2005-02-22 Mark Wielaard <address@bogus.example.com>
+
+ * java/security/AlgorithmParameterGenerator.java (getInstance):
+ Mention provider when throwing NoSuchProviderException.
+ * java/security/AlgorithmParameters.java (getInstance): Likewise.
+ * java/security/KeyFactory.java (getInstance): Likewise.
+ * java/security/KeyStore.java (getInstance): Likewise.
+ * java/security/SecureRandom.java (getInstance): Likewise.
+ * java/security/cert/CertificateFactory.java (getInstance): Likewise.
+
+2005-02-22 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/lang/reflect/Proxy.java,
+ java/net/URL.java,
+ java/security/SecureRandom.java,
+ java/util/Timer.java,
+ java/util/prefs/AbstractPreferences.java:
+ Don't catch java.lang.ThreadDeath.
+
+2005-02-22 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/font/TransformAttribute.java,
+ (TransformAttribute(AffineTransform)): throw
+ IllegalArgumentException for null transform.
+ (getTransform): return a copy of transform.
+ Added doc comments to all.
+
+2005-02-22 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/io/Externalizable.java,
+ java/io/Serializable.java
+ (serialVersionUID): Removed.
+ * java/rmi/server/RemoteObject.java,
+ java/rmi/server/UID.java
+ (serialVersionUID): Made private.
+ * java/rmi/server/RemoteRef.java,
+ java/rmi/server/ServerRef.java
+ (serialVersionUID): Set proper value.
+ * java/security/interfaces/DSAPrivateKey.java,
+ java/security/interfaces/DSAPublicKey.java,
+ java/security/interfaces/RSAMultiPrimePrivateCrtKey.java,
+ java/security/interfaces/RSAPrivateCrtKey.java,
+ java/security/interfaces/RSAPrivateKey.java,
+ java/security/interfaces/RSAPublicKey.java,
+ javax/crypto/SecretKey.java
+ (serialVersionUID): Added.
+
+2005-02-22 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Object.h (_JvObjectPrefix): Declare as extern "Java".
+
+2005-02-22 Tom Tromey <tromey@redhat.com>
+
+ PR java/20056:
+ * verify.cc (type::EITHER): New constant.
+ (check_field_constant): Use it.
+ (type::compatible): Handle it.
+
+2005-02-22 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/security/PolicyFile.java,
+ gnu/java/security/pkcs/PKCS7SignedData.java,
+ gnu/java/security/pkcs/SignerInfo.java:
+ Fixed copyright header.
+
+2005-02-22 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/beans/PropertyDescriptor.java
+ (PropertyDescriptor,setReadMethod): Set propertyType.
+
+2005-02-22 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/DirectByteBufferImpl.java
+ (owner): Fixed formatting of javadoc.
+ * java/text/DateFormat.java
+ (getAvailableLocales): Fixed formatting.
+ * java/text/SimpleDateFormat.java:
+ Fixed formatting and import statement order.
+ * java/util/Calendar.java
+ (Calendar): Fixed javadoc to be HTML compliant.
+ * java/util/SimpleTimeZone.java:
+ Fixed javadocs.
+
+2005-02-22 Roman Kennke <roman@ontographics.com>
+
+ * javax/swing/plaf/basic/BasicLookAndFeel.java
+ (initComponentDefaults): Fixed Button left and right margin.
+
+2005-02-22 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * java/awt/Robot.java (waitForIdle): Call invokeAndWait on an
+ empty Runnable.
+
+ PR libgcj/17952:
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java,
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+ (getWidth): New method.
+ (getHeight): Likewise.
+ (create): Remove width, height and insets parameters. Move size
+ setup ...
+ (realize_cb): ... here. New function.
+ (connectSignals): Connect realize_cb.
+ (request_frame_extents): Remove FIXME. Move
+ postInsetsChangedEvent lookup ...
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c (gtkInit):
+ ... here. Look up GtkWindowPeer getWidth and getHeight methods.
+ * jni/gtk-peer/gtkpeer.h (postInsetsChangedEventID): Declare
+ jmethodID.
+ (windowGetWidthID): Likewise.
+ (windowGetHeightID): Likewise.
+
+2005-02-21 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ PR libgcj/19842
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (button_to_awt_mods): Return BUTTON masks, not BUTTON_DOWN masks.
+
+2005-02-21 Bryce McKinlay <mckinlay@redhat.com>
+
+ Merge serialization from GNU Classpath.
+ * gcj/method.h: Add missing #includes.
+ * java/io/ObjectInputStream.java (readClassDescriptor): Check for
+ primitive class IDs on the stream here...
+ (resolveClass): ...not here.
+ * java/io/ObjectStreamField.java: Use VMObjectStream class calls to set
+ fields.
+ * java/io/VMObjectStreamClass.java (setDoubleNative, setFloatNative,
+ setLongNative, setIntNative, setShortNative, setCharNative,
+ setByteNative, setBooleanNative, setObjectNative): New native methods.
+ * java/io/natVMObjectStreamClass.java (setDoubleNative, setFloatNative,
+ setLongNative, setIntNative, setShortNative, setCharNative,
+ setByteNative, setBooleanNative, setObjectNative): Implement them.
+ * java/io/natObjectInputStream.cc (allocateObject): Add new parameters
+ from Classpath's version. Use _Jv_FromReflectedConstructor(). Call
+ the constructor here.
+ (callConstructor): Removed.
+ (getCallersClassLoader): Removed.
+ * java/lang/reflect/Field.java (setByte, setShort, setInt, setLong,
+ setFloat, setDouble, setChar, setBoolean): Add 'checkFinal' parameter
+ to control whether setting final field values is permitted. Call
+ getAddr() with checkFinal parameter instead of setAddr().
+ * java/lang/reflect/natField.cc (getType): Lookup and resolve field
+ only if not done already.
+ (getAddr): Add checkFinal parameter. Do the final field check only if
+ checkFinal is set.
+ (setAddr): Removed.
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ # Fixes bug #11957
+ * java/io/ObjectInputStream.java (resolveClass): Don't check "void"
+ twice.
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ Fixes bug #11618.
+ * java/io/ObjectInputStream.java (readClassDescriptor): Handle classes
+ without a super class and us ObjectStreamClass.lookupForClassObject().
+ (resolveClass): Check for primitive types.
+ (lookupClass): Return null when argument is null.
+
+2005-02-21 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/io/ObjectInputStream.java
+ (readObject): Fix to consume TC_ENDBLOCKDATA after readExternal.
+
+2005-02-21 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/io/ObjectOutputStream.java
+ (writeObject, callWriteMethod): Replaced reflection with accessing
+ cached info in ObjectStreamClass.
+ (getMethod): Removed.
+ * java/io/ObjectStreamClass.java
+ (findMethod): Added check to make sure the method found has the
+ right modifiers.
+ (cacheMethods): Added writeReplace and writeObject methods.
+ (setFlags): Look at new writeObjectMethod field instead of doing
+ reflection again.
+ (writeReplaceMethod): New field.
+ (writeObjectMethod): New field.
+
+2005-02-21 Guilhem Lavaux <guilhem@kaffe.org>
+ Jeroen Frijters <jeroen@frijters.net>
+
+ * java/io/ObjectInputStream.java
+ (newObject): Changed prototype. Get a constructor reflect object
+ directly.
+ (callConstructor): Removed.
+ (allocateObject): Changed prototype.
+ (readClassDescriptor): Build the constructor reflection directly.
+ (readObject): Invoke newObject using the new prototype.
+
+ * java/io/ObjectStreamClass.java
+ (firstNonSerializableParent): Removed.
+ (firstNonSerializableParentConstructor): Added.
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/locale/LocaleInformation_en.java: Extend
+ localPatternChars to "GyMdkHmsSEDFwWahKzYeugAZ".
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/text/SimpleDateFormat.java
+ (SimpleDateFormat(String, DateFormatSymbols)): Throw
+ NullPointerException when formatData is null.
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/util/SimpleTimeZone.java (getOffset): Calculate beforeEnd by
+ taking dstSavings into account.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/text/SimpleDateFormat.java,
+ (parse): Set correct DST_OFFSET to the correct value.
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/util/SimpleTimeZone.java (checkRule): Throw
+ IllegalArgumentException when month out of range.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/GregorianCalendar.java,
+ (add): Don't set fields directly anymore. Use set()
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/text/SimpleDateFormat.java (CompiledField.toString):
+ Use StringBuffer, not StringBuilder.
+ (toString): Likewise.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/Calendar.java
+ (clear): Dates should clear to local time.
+ * java/util/GregorianCalendar.java
+ (computeTime): Fix priority problem with DAY_OF_WEEK,
+ Handle non-sunday-startig weeks and minimumDaysInFirstWeek.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/Calendar.java
+ (Calendar): Constructor should clear fields.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/text/SimpleDateFormat.java
+ (parse): Tweak handling of 2-year dates
+ * java/util/Calendar.java
+ (clear): Clear fields to correct value.
+ * java/util/GregorianCalendar.java
+ (computeTime): Correct handling of time zones.
+ Correct field minimum values.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/Calendar.java
+ (set) Invalidate all fields on first call to set().
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/GregorianCalendar.java
+ (computeTime): Fixed handling of time zones.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/Calendar.java
+ (clear): Set values to Epoch instead of zero.
+ (set): Set isSet to the relevant field pattern instead of just
+ the field.
+ * java/util/GregorianCalendar.java
+ (getBundle): Removed.
+ (getDayOfYear): Removed.
+ (getFirstDayOfMonth): New private method.
+ (nonLeniencyCheck): New private method.
+ (computeTime): Correct handling of insufficient data.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/Calendar.java: Invalidate ERA field on setting
+ the YEAR.
+ * java/util/SimpleTimeZone.java:
+ (getDaysInMonth): Reimplemented.
+ * java/util/GregorianCalendar.java:
+ (getLinearTime): Removed.
+ (isLeapYear(int,boolean)): Removed.
+ (before(), after()): Removed.
+ (computeTime): Reimplemented.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/Calendar.java: Reformatted.
+ * java/util/GregorianCalendar.java: Reformatted.
+ * java/util/SimpleTimeZone.java: Reformatted.
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/util/GregorianCalendar.java
+ (GregorianCalendar): Update fields in the constructor
+
+2005-02-21 Noa Resare <noa@resare.com>
+
+ * java/util/Calendar.java (explicitDSTOffset): New instance field.
+ (set(int,int)): Set and use new field.
+ (set(int,int,int)): Check new field.
+
+2005-02-21 Noa Resare <address@hidden>
+
+ * java/util/Calendar.java(set):
+ Fix for DST related regression.
+
+2005-02-21 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/util/Calendar.java
+ (setTimeInMillis): Added call to clear, removed computeFields call.
+ * java/util/Date.java
+ (Date(int,int,int,int,int,int)): Removed workaround for
+ GregorianCalendar bug.
+ * java/util/GregorianCalendar.java
+ (GregorianCalendar): Chained all constructors to a (new)
+ common constructor.
+ (computeTime): Fixed support for lenient month treatment.
+ (getLinearDay): Return long instead of int.
+ (calculateDay): Added fields argument and changed day argument
+ to long.
+
+2005-02-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/text/SimpleDateFormat.java
+ Lots of documentation updates.
+ (readObject(java.io.ObjectInputStream)): Wraps
+ IllegalArgumentException as specified.
+ (compileFormat(String)): Uses standardChars
+ rather than the local pattern characters.
+ Throws IllegalArgumentException rather than
+ storing a -1 field.
+ (toString()): Extended to include all variables
+ in a better format.
+ (translateLocalizedPattern(String, String, String)):
+ Renamed to better define the use of this method.
+
+2005-02-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/text/DateFormat.java:
+ Documented pattern character offset constants and
+ added new ones.
+ (Field): Added new static fields for new pattern chars.
+ * java/text/SimpleDateFormat.java:
+ (CompiledField): Changed name of FieldSizePair class
+ to CompiledField after adding the character as an
+ attribute. Changed fields to private and added
+ accessors to give encapsulation.
+ (CompiledField.CompiledField(int,int,char)): Extended
+ with character field.
+ (CompiledField.getField()): New accessor method.
+ (CompiledField.getSize()): New acceessor method.
+ (CompiledField.getCharacter()): New accessor method.
+ (CompiledField.toString()): Added primarily for debugging.
+ (standardChars): Now uses extended 24 character sequence.
+ (compileFormat(String)): Changed to use CompiledField.
+ (formatWithAttribute(java.util.Date, gnu.java.text.FormatBuffer,
+ java.text.FieldPosition)): Changed to use CompiledField.
+ New handler for RFC 822 timezones added.
+
+2005-02-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/text/SimpleDateFormat.java:
+ (parse(String, java.text.ParsePosition)):
+ Changed 'E' and 'M' cases to use both
+ short and long names. Extended 'z'
+ case to also handle 'Z', and deal
+ with simple GMT offsets such as +0100.
+ (computeOffset(String)): New private method,
+ which converts a GMT offset specification,
+ such as GMT-0500 to a numeric offset in
+ milliseconds.
+ * java/util/TimeZone.java:
+ (timezones()): Added "CEST", the daylight
+ savings time version of "CET", or Central
+ European Time.
+
+2005-02-21 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * java/text/SimpleDateFormat.java:
+ (parse): Set the DST offset to 0 when parsing
+ GMT offset timezones.
+
+2005-02-21 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * java/text/SimpleDateFormat.java:
+ (parse): Use offset to set ZONE_OFFSET
+ rather than the DST_OFFSET, so that
+ GMT offset timezones change the right
+ one.
+
+2005-02-21 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/text/SimpleDateFormat.java:
+ (getDateFormatSymbols()): return a copy
+ (setDateFormatSymbols(java.text.DateFormatSymbols)):
+ throw exception on null input
+ (clone()): implemented to clone
+ internal fields
+
+2005-02-21 Sven de Marothy <sven@physto.se>
+
+ * java/text/SimpleDateFormat.java
+ (parse): comparison should be case-insensitive, ignore null
+ strings.
+
+2005-02-21 Robert Schuster <theBohemian@gmx.net>
+
+ * gnu/java/beans/IntrospectionIncubator.java
+ (addMethod) Reverts the patch that ntroduced a regression (see bug
+ https://savannah.gnu.org/bugs/?func=detailitem&item_id=10938).
+
+2005-02-21 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Checkbox.java
+ (next_checkbox_number): New static variable.
+ (generateName): New method.
+ (getUniqueLong): Likewise.
+ * java/awt/Window.java
+ (next_window_number): New static variable.
+ (generateName): New method.
+ (getUniqueLong): Likewise.
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/util/jar/JarFile.java (verifyHashes): Check whether ZipEntry
+ exists.
+
+2005-02-21 Andrew Haley <aph@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (nat_source_files): Added natLogger.cc.
+ * java/util/logging/natLogger.cc: New file.
+ * java/util/logging/Logger.java (getCallerStackFrame): Now
+ native.
+
+2005-02-21 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.am (all_property_files): Remove left over.
+ (classes.stamp): Add stamp for the ONESTEP build, also known as
+ --enable-libgcj-multifile.
+ * Makefile.in: Regenerated.
+
+2005-02-21 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Button.java,
+ java/awt/Container.java,
+ java/awt/Font.java,
+ java/awt/Frame.java,
+ java/text/CollationElementIterator.java,
+ java/text/RuleBasedCollator.java,
+ java/util/PropertyPermission.java:
+ Fixed formatting issues all over.
+
+2005-02-21 Mark Wielaard <mark@klomp.org>
+
+ * java/io/FileDescriptor.java (sync): Add real exception to
+ SyncFailedException.
+
+2005-02-21 Michael Koch <konqueror@gmx.de>
+
+ * java/io/InputStreamReader.java:
+ Fixed @author tag.
+
+2005-02-20 Rutger Ovidius <ovidr@users.sourceforge.net>
+
+ PR libgcj/19728:
+ * gnu/java/security/provider/Gnu.java (Gnu): Add SHA-160 alias.
+
+2005-02-20 Dalibor Topic <robilad@kaffe.org>
+
+ * libraries/javalib/gnu/regexp/RE.java,
+ libraries/javalib/java/io/ObjectInputStream.java,
+ libraries/javalib/java/security/AllPermission.java,
+ libraries/javalib/java/security/BasicPermission.java,
+ libraries/javalib/java/security/Permissions.java,
+ libraries/javalib/java/text/MessageFormat.java:
+ Made 'inner' classes real public static inner classes,
+ and made them final where possible, or removed them
+ where unused.
+
+2005-02-20 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/text/FormatCharacterIterator.java:
+ Removed redundant modifiers.
+
+2005-02-19 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gthread-jni.c (throw): Call g_snprintf instead of
+ snprintf.
+
+2005-02-19 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am: Added new files in gnu/java/beans and
+ java/beans/XMLDecoder.java.
+ * Makefile.in: Regenerated.
+
+2005-02-19 Robert Schuster <thebohemian@gmx.net>
+
+ * gnu/java/beans/decoder/GrowableArrayContext.java: Fixed
+ assignment behavior by using java.lang.reflect.Array.set()
+ directly.
+
+2005-02-19 Dalibor Topic <robilad@kaffe.org>
+
+ * gnu/java/beans/EmptyBeanInfo.java,
+ gnu/java/beans/info/ComponentBeanInfo.java:
+ Removed unused files.
+
+2005-02-19 Robert Schuster <thebohemian@gmx.net>
+
+ * gnu/java/beans/DummyAppletStub.java: Add dummy implementation
+ of AppletStub for java.beans.Beans.instantiate.
+ * gnu/java/beans/DummyAppletContext.java: Add dummy implementation
+ of AppletContext.
+ * java/beans/Beans: Added 1.4 functionality, fixed user documentation
+ to be conformant with Javadoc guidelines.
+ (instantiate): Added two more overloaded variants, reworked user
+ documentation, fixed exception behavior, fixed behavior when
+ deserializing null.
+
+2005-02-19 Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/beans/decoder/DummyHandler.java: Add return statements for
+ failing methods.
+ * gnu/java/beans/decoder/DummyContext.java: Likewise.
+
+2005-02-19 Robert Schuster <theBohemian@gmx.net>
+
+ * gnu/java/beans/decoder/AbstractContext.java,
+ gnu/java/beans/decoder/AbstractCreatableContext.java,
+ gnu/java/beans/decoder/AbstractElementHandler.java,
+ gnu/java/beans/decoder/AbstractObjectContext.java,
+ gnu/java/beans/decoder/ArrayContext.java,
+ gnu/java/beans/decoder/ArrayHandler.java,
+ gnu/java/beans/decoder/AssemblyException.java,
+ gnu/java/beans/decoder/BooleanHandler.java,
+ gnu/java/beans/decoder/ByteHandler.java,
+ gnu/java/beans/decoder/CharHandler.java,
+ gnu/java/beans/decoder/ClassHandler.java,
+ gnu/java/beans/decoder/ConstructorContext.java,
+ gnu/java/beans/decoder/Context.java,
+ gnu/java/beans/decoder/DecoderContext.java,
+ gnu/java/beans/decoder/DefaultExceptionListener.java,
+ gnu/java/beans/decoder/DoubleHandler.java,
+ gnu/java/beans/decoder/DummyContext.java,
+ gnu/java/beans/decoder/DummyHandler.java,
+ gnu/java/beans/decoder/ElementHandler.java,
+ gnu/java/beans/decoder/FloatHandler.java,
+ gnu/java/beans/decoder/GrowableArrayContext.java,
+ gnu/java/beans/decoder/IndexContext.java,
+ gnu/java/beans/decoder/IntHandler.java,
+ gnu/java/beans/decoder/JavaHandler.java,
+ gnu/java/beans/decoder/LongHandler.java,
+ gnu/java/beans/decoder/MethodContext.java,
+ gnu/java/beans/decoder/MethodFinder.java,
+ gnu/java/beans/decoder/NullHandler.java,
+ gnu/java/beans/decoder/ObjectContext.java,
+ gnu/java/beans/decoder/ObjectHandler.java,
+ gnu/java/beans/decoder/PersistenceParser.java,
+ gnu/java/beans/decoder/PropertyContext.java,
+ gnu/java/beans/decoder/ShortHandler.java,
+ gnu/java/beans/decoder/SimpleHandler.java,
+ gnu/java/beans/decoder/StaticMethodContext.java,
+ gnu/java/beans/decoder/StringHandler.java,
+ gnu/java/beans/decoder/VoidHandler.java: New class
+ implementing java.beans.XMLDecoder decoding functionality.
+ * java/beans/XMLDecoder.java: New class.
+
+2005-02-19 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTextField.java
+ (notfiyAction): Added javadoc.
+
+2005-02-19 Sven de Marothy <sven@physto.se>
+
+ * javax/swing/SpinnerDateModel.java: Implemented.
+
+2005-02-19 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am: Added javax/swing/SpinnerDateModel.java.
+ * Makefile.in: Regenerated.
+
+2005-02-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/SelectorImpl.java:
+ Reworked import statements.
+ (register): Removed unused code.
+ * java/nio/channels/Channels.java: Reformatted.
+ * java/nio/charset/Charset.java: Likewise.
+ * java/rmi/server/RemoteObject.java
+ (serialVersionUID): Made private.
+ * java/rmi/server/UID.java
+ (serialVersionUID): Likewise.
+
+2005-02-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/ftp/ActiveModeDTP.java,
+ gnu/java/net/protocol/ftp/BlockInputStream.java,
+ gnu/java/net/protocol/ftp/BlockOutputStream.java,
+ gnu/java/net/protocol/ftp/CompressedInputStream.java,
+ gnu/java/net/protocol/ftp/CompressedOutputStream.java,
+ gnu/java/net/protocol/ftp/DTPInputStream.java,
+ gnu/java/net/protocol/ftp/DTP.java,
+ gnu/java/net/protocol/ftp/DTPOutputStream.java,
+ gnu/java/net/protocol/ftp/FTPConnection.java,
+ gnu/java/net/protocol/ftp/FTPException.java,
+ gnu/java/net/protocol/ftp/FTPResponse.java,
+ gnu/java/net/protocol/ftp/FTPURLConnection.java,
+ gnu/java/net/protocol/ftp/Handler.java,
+ gnu/java/net/protocol/ftp/PassiveModeDTP.java,
+ gnu/java/net/protocol/ftp/StreamInputStream.java,
+ gnu/java/net/protocol/ftp/StreamOutputStream.java,
+ gnu/java/net/CRLFInputStream.java,
+ gnu/java/net/CRLFOutputStream.java,
+ gnu/java/net/GetLocalHostAction.java,
+ gnu/java/net/protocol/ftp/package.html: New files.
+ * Makefile.am: Added new files.
+ * Makefile.in: Regenerated.
+
+2005-02-18 Tom Tromey <tromey@redhat.com>
+
+ * link.cc (make_vtable): Remove abstract method check.
+ (append_partial_itable): Likewise.
+
+ PR java/20056:
+ * verify.cc (type::equals): Fixed test.
+ * testsuite/libjava.lang/PR20056.out: New file.
+ * testsuite/libjava.lang/PR20056.java: New file.
+
+2005-02-18 Bryce McKinlay <mckinlay@redhat.com>
+
+ * java/util/LinkedHashMap (addEntry): Call remove() with key argument,
+ not the HashEntry. Reported by Jean-Marie White.
+
+2005-02-18 Tom Tromey <tromey@redhat.com>
+
+ PR java/20056:
+ * include/jvm.h (_Jv_Linker::has_field_p): Declare.
+ * link.cc (has_field_p): New function.
+ * verify.cc (check_field_constant): Added 'putfield' argument.
+ (verify_instructions_0): Updated.
+ (type::equals): New method.
+
+2005-02-18 Anthony Green <green@redhat.com>
+
+ * NEWS: Draft of libgcj NEWS for 4.0.
+
+2005-02-18 Anthony Green <green@redhat.com>
+
+ * java/lang/natRuntime.cc (insertSystemProperties): Normalize x86
+ architecture names to "i386" for compatibility reasons. Win32
+ still uses "x86".
+
+2005-02-18 Anthony Green <green@redhat.com>
+
+ * gij.cc (version): Change year for '--version' to 2005.
+ * gnu/gcj/convert/Convert.java: Ditto.
+ * gnu/java/rmi/rmic/RMIC.java: Ditto.
+ * gnu/java/rmi/registry/RegistryImpl.java: Ditto.
+
+ * gnu/gcj/tools/gcj_dbtool/Main.java: Only show the most
+ recent copyright year in `--version' output.
+
+2005-02-18 Robert Schuster <thebohemian@gmx.net>
+
+ * java/nio/charset/Charset.java (forName): Throws
+ IllegalArgumentException when argument is null
+ and added documentation.
+
+2005-02-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * gnu/java/nio/channels/FileChannelImpl.java (write(ByteBuffer)):
+ Move the position of the source buffer forward.
+
+2005-02-17 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/Class.h (_Jv_GetMethodString): Updated declaration.
+ * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Updated.
+ * java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Updated.
+ * link.cc (_Jv_GetMethodString): Added 'derived' argument.
+ Changed type of second argument. Rewrote.
+ (make_vtable): Use it.
+ (append_partial_itable): Updated.
+ (layout_vtable_methods): Updated.
+
+2005-02-17 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/PlainSocketImpl.java
+ (shutdownInput): Added javadoc.
+ (shutdownOutput): Likewise.
+
+2005-02-17 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/standard/Chromaticity.java,
+ javax/print/attribute/standard/Destination.java,
+ javax/print/attribute/standard/MediaPrintableArea.java,
+ javax/print/attribute/standard/MediaSize.java: New files.
+ * Makefile.am: Added new files.
+ * Makefile.in: Regenerated.
+
+2005-02-17 Andrew John Hughes <gnu_andrew@member.fsf.org>
+ Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Cookie.java,
+ gnu/java/net/protocol/http/HTTPConnection.java,
+ gnu/java/net/protocol/http/HTTPDateFormat.java,
+ gnu/java/net/protocol/http/Request.java,
+ gnu/java/nio/PipeImpl.java,
+ gnu/java/rmi/dgc/DGCImpl.java,
+ gnu/java/rmi/server/ConnectionRunnerPool.java,
+ gnu/java/rmi/server/UnicastConnectionManager.java,
+ gnu/java/security/der/DERWriter.java,
+ gnu/java/security/pkcs/SignerInfo.java,
+ gnu/java/security/provider/EncodedKeyFactory.java,
+ gnu/java/security/provider/GnuDHPublicKey.java,
+ gnu/java/security/provider/GnuDSAPrivateKey.java,
+ gnu/java/security/provider/GnuDSAPublicKey.java,
+ gnu/java/security/provider/PKIXCertPathValidatorImpl.java,
+ gnu/java/security/x509/X500DistinguishedName.java,
+ gnu/java/security/x509/X509CRL.java,
+ gnu/java/security/x509/X509CRLEntry.java,
+ gnu/java/security/x509/X509Certificate.java,
+ gnu/java/security/x509/ext/AuthorityKeyIdentifier.java,
+ gnu/java/security/x509/ext/CertificatePolicies.java,
+ gnu/java/security/x509/ext/PolicyConstraint.java,
+ gnu/xml/dom/Consumer.java,
+ gnu/xml/dom/DomCharacterData.java,
+ gnu/xml/dom/DomDocument.java,
+ gnu/xml/dom/DomDocumentBuilder.java,
+ gnu/xml/dom/DomIterator.java,
+ gnu/xml/dom/DomNode.java,
+ gnu/xml/dom/DomXPathExpression.java,
+ gnu/xml/dom/DomXPathResult.java,
+ gnu/xml/dom/JAXPFactory.java,
+ gnu/xml/pipeline/CallFilter.java,
+ gnu/xml/pipeline/DomConsumer.java,
+ gnu/xml/pipeline/LinkFilter.java,
+ gnu/xml/pipeline/NSFilter.java,
+ gnu/xml/pipeline/TeeConsumer.java,
+ gnu/xml/pipeline/ValidationConsumer.java,
+ gnu/xml/pipeline/WellFormednessFilter.java,
+ gnu/xml/pipeline/XIncludeFilter.java,
+ gnu/xml/pipeline/XsltFilter.java,
+ gnu/xml/transform/ApplyImportsNode.java,
+ gnu/xml/transform/Bindings.java,
+ gnu/xml/transform/DocumentFunction.java,
+ gnu/xml/transform/FormatNumberFunction.java,
+ gnu/xml/transform/NodeNumberNode.java,
+ gnu/xml/transform/NumberNode.java,
+ gnu/xml/transform/Stylesheet.java,
+ gnu/xml/transform/SystemPropertyFunction.java,
+ gnu/xml/transform/Template.java,
+ gnu/xml/transform/TemplatesImpl.java,
+ gnu/xml/transform/TransformerImpl.java,
+ gnu/xml/transform/ValueOfNode.java,
+ gnu/xml/transform/XSLURIResolver.java,
+ gnu/xml/util/DoParse.java,
+ gnu/xml/util/Resolver.java,
+ gnu/xml/xpath/Expr.java,
+ gnu/xml/xpath/FunctionCall.java,
+ gnu/xml/xpath/RelationalExpr.java,
+ gnu/xml/xpath/Selector.java,
+ gnu/xml/xpath/XPathParser.java:
+ Reworked import statements, fixed modifier order and some little
+ formatting issues.
+
+2005-02-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * java/nio/ByteBufferImpl.java (compact):
+ Set position and limit even if no bytes were moved.
+
+2005-02-17 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/CharViewBufferImpl.java (compact): Likewise.
+ * java/nio/DirectByteBufferImpl.java (compact): Likewise.
+ * java/nio/DoubleViewBufferImpl.java (compact): Likewise.
+ * java/nio/FloatViewBufferImpl.java (compact): Likewise.
+ * java/nio/IntViewBufferImpl.java (compact): Likewise.
+ * java/nio/LongViewBufferImpl.java (compact): Likewise.
+ * java/nio/MappedByteBufferImpl.java (compact): Likewise.
+ * java/nio/ShortViewBufferImpl.java (compact): Likewise.
+ * java/nio/FloatBufferImpl.java (compact): Set position.
+ * java/nio/CharBufferImpl.java (compact): Likewise.
+ * java/nio/DoubleBufferImpl.java (compact): Likewise.
+ * java/nio/IntBufferImpl.java (compact): Likewise.
+ * java/nio/LongBufferImpl.java (compact): Likewise.
+ * java/nio/ShortBufferImpl.java (compact): Likewise.
+
+2005-02-17 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/nio/ByteBufferImpl.java,
+ java/nio/CharBufferImpl.java,
+ java/nio/DirectByteBufferImpl.java,
+ java/nio/DoubleBufferImpl.java,
+ java/nio/FloatBufferImpl.java,
+ java/nio/IntBufferImpl.java,
+ java/nio/LongBufferImpl.java,
+ java/nio/MappedByteBufferImpl.java,
+ java/nio/ShortBufferImpl.java
+ (compact): Added explicit read-only check and invalidate mark.
+
+2005-02-17 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java,
+ gnu/java/awt/peer/gtk/GdkFontPeer.java,
+ gnu/java/awt/peer/gtk/GdkGlyphVector.java,
+ gnu/java/awt/peer/gtk/GdkGraphics.java,
+ gnu/java/awt/peer/gtk/GdkGraphics2D.java,
+ gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java,
+ gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,
+ gnu/java/awt/peer/gtk/GdkPixbufDecoder.java,
+ gnu/java/awt/peer/gtk/GdkRobotPeer.java,
+ gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java,
+ gnu/java/awt/peer/gtk/GdkTextLayout.java,
+ gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java,
+ gnu/java/awt/peer/gtk/GtkChoicePeer.java,
+ gnu/java/awt/peer/gtk/GtkClipboard.java,
+ gnu/java/awt/peer/gtk/GtkComponentPeer.java,
+ gnu/java/awt/peer/gtk/GtkFileDialogPeer.java,
+ gnu/java/awt/peer/gtk/GtkFontPeer.java,
+ gnu/java/awt/peer/gtk/GtkLabelPeer.java,
+ gnu/java/awt/peer/gtk/GtkMenuBarPeer.java,
+ gnu/java/awt/peer/gtk/GtkMenuItemPeer.java,
+ gnu/java/awt/peer/gtk/GtkMenuPeer.java,
+ gnu/java/awt/peer/gtk/GtkScrollPanePeer.java,
+ gnu/java/awt/peer/gtk/GtkScrollbarPeer.java,
+ gnu/java/awt/peer/gtk/GtkToolkit.java,
+ gnu/java/awt/peer/gtk/GtkWindowPeer.java,
+ java/applet/Applet.java,
+ java/awt/AWTError.java,
+ java/awt/AWTEvent.java,
+ java/awt/AWTEventMulticaster.java,
+ java/awt/AWTException.java,
+ java/awt/AWTKeyStroke.java,
+ java/awt/AWTPermission.java,
+ java/awt/ActiveEvent.java,
+ java/awt/Adjustable.java,
+ java/awt/AlphaComposite.java,
+ java/awt/AttributeValue.java,
+ java/awt/BorderLayout.java,
+ java/awt/BufferCapabilities.java,
+ java/awt/Button.java,
+ java/awt/Canvas.java,
+ java/awt/CheckboxGroup.java,
+ java/awt/CheckboxMenuItem.java,
+ java/awt/Color.java,
+ java/awt/ColorPaintContext.java,
+ java/awt/Component.java,
+ java/awt/ComponentOrientation.java,
+ java/awt/Composite.java,
+ java/awt/CompositeContext.java,
+ java/awt/Container.java,
+ java/awt/ContainerOrderFocusTraversalPolicy.java,
+ java/awt/DefaultFocusTraversalPolicy.java,
+ java/awt/Dialog.java,
+ java/awt/Dimension.java,
+ java/awt/DisplayMode.java,
+ java/awt/EventQueue.java,
+ java/awt/FileDialog.java,
+ java/awt/FontFormatException.java,
+ java/awt/Graphics.java,
+ java/awt/Graphics2D.java,
+ java/awt/GraphicsConfigTemplate.java,
+ java/awt/GraphicsConfiguration.java,
+ java/awt/GraphicsDevice.java,
+ java/awt/GridBagLayout.java,
+ java/awt/GridBagLayoutInfo.java,
+ java/awt/GridLayout.java,
+ java/awt/HeadlessException.java,
+ java/awt/IllegalComponentStateException.java,
+ java/awt/Image.java,
+ java/awt/Insets.java,
+ java/awt/ItemSelectable.java,
+ java/awt/JobAttributes.java,
+ java/awt/KeyEventDispatcher.java,
+ java/awt/KeyEventPostProcessor.java,
+ java/awt/KeyboardFocusManager.java,
+ java/awt/Label.java,
+ java/awt/LayoutManager.java,
+ java/awt/MenuBar.java,
+ java/awt/MenuComponent.java,
+ java/awt/MenuContainer.java,
+ java/awt/PageAttributes.java,
+ java/awt/Paint.java,
+ java/awt/PaintContext.java,
+ java/awt/Panel.java,
+ java/awt/Point.java,
+ java/awt/Polygon.java,
+ java/awt/PrintGraphics.java,
+ java/awt/PrintJob.java,
+ java/awt/Rectangle.java,
+ java/awt/RenderingHints.java,
+ java/awt/Shape.java,
+ java/awt/Stroke.java,
+ java/awt/SystemColor.java,
+ java/awt/Toolkit.java,
+ java/awt/Transparency.java,
+ java/awt/Window.java,
+ java/awt/color/CMMException.java,
+ java/awt/color/ColorSpace.java,
+ java/awt/color/ICC_ColorSpace.java,
+ java/awt/color/ICC_Profile.java,
+ java/awt/color/ProfileDataException.java,
+ java/awt/datatransfer/FlavorTable.java,
+ java/awt/datatransfer/MimeTypeParseException.java,
+ java/awt/datatransfer/Transferable.java,
+ java/awt/datatransfer/UnsupportedFlavorException.java,
+ java/awt/dnd/Autoscroll.java,
+ java/awt/dnd/DnDConstants.java,
+ java/awt/dnd/DragGestureListener.java,
+ java/awt/dnd/DragSourceAdapter.java,
+ java/awt/dnd/DragSourceDropEvent.java,
+ java/awt/dnd/DragSourceListener.java,
+ java/awt/dnd/DragSourceMotionListener.java,
+ java/awt/dnd/DropTargetAdapter.java,
+ java/awt/dnd/DropTargetContext.java,
+ java/awt/dnd/DropTargetListener.java,
+ java/awt/dnd/InvalidDnDOperationException.java,
+ java/awt/dnd/MouseDragGestureRecognizer.java,
+ java/awt/dnd/peer/DropTargetContextPeer.java,
+ java/awt/event/AWTEventListener.java,
+ java/awt/event/AWTEventListenerProxy.java,
+ java/awt/event/ActionEvent.java,
+ java/awt/event/AdjustmentEvent.java,
+ java/awt/event/AdjustmentListener.java,
+ java/awt/event/ComponentAdapter.java,
+ java/awt/event/ComponentEvent.java,
+ java/awt/event/ComponentListener.java,
+ java/awt/event/ContainerAdapter.java,
+ java/awt/event/ContainerEvent.java,
+ java/awt/event/ContainerListener.java,
+ java/awt/event/FocusAdapter.java,
+ java/awt/event/FocusEvent.java,
+ java/awt/event/FocusListener.java,
+ java/awt/event/InputEvent.java,
+ java/awt/event/InputMethodEvent.java,
+ java/awt/event/InputMethodListener.java,
+ java/awt/event/InvocationEvent.java,
+ java/awt/event/ItemEvent.java,
+ java/awt/event/ItemListener.java,
+ java/awt/event/KeyAdapter.java,
+ java/awt/event/KeyEvent.java,
+ java/awt/event/KeyListener.java,
+ java/awt/event/MouseAdapter.java,
+ java/awt/event/MouseEvent.java,
+ java/awt/event/MouseListener.java,
+ java/awt/event/MouseMotionAdapter.java,
+ java/awt/event/MouseMotionListener.java,
+ java/awt/event/MouseWheelEvent.java,
+ java/awt/event/MouseWheelListener.java,
+ java/awt/event/PaintEvent.java,
+ java/awt/event/TextEvent.java,
+ java/awt/event/TextListener.java,
+ java/awt/event/WindowAdapter.java,
+ java/awt/event/WindowEvent.java,
+ java/awt/event/WindowFocusListener.java,
+ java/awt/event/WindowListener.java,
+ java/awt/event/WindowStateListener.java,
+ java/awt/font/TextHitInfo.java,
+ java/awt/geom/CubicCurve2D.java,
+ java/awt/geom/Dimension2D.java,
+ java/awt/geom/Ellipse2D.java,
+ java/awt/geom/IllegalPathStateException.java,
+ java/awt/geom/Line2D.java,
+ java/awt/geom/NoninvertibleTransformException.java,
+ java/awt/geom/PathIterator.java,
+ java/awt/geom/Point2D.java,
+ java/awt/geom/QuadCurve2D.java,
+ java/awt/geom/RectangularShape.java,
+ java/awt/geom/RoundRectangle2D.java,
+ java/awt/im/InputContext.java,
+ java/awt/im/InputMethodHighlight.java,
+ java/awt/im/InputMethodRequests.java,
+ java/awt/im/InputSubset.java,
+ java/awt/im/spi/InputMethod.java,
+ java/awt/im/spi/InputMethodDescriptor.java,
+ java/awt/image/BandCombineOp.java,
+ java/awt/image/BandedSampleModel.java,
+ java/awt/image/ByteLookupTable.java,
+ java/awt/image/ComponentSampleModel.java,
+ java/awt/image/DataBuffer.java,
+ java/awt/image/DataBufferByte.java,
+ java/awt/image/DataBufferDouble.java,
+ java/awt/image/DataBufferFloat.java,
+ java/awt/image/DataBufferInt.java,
+ java/awt/image/DataBufferShort.java,
+ java/awt/image/DataBufferUShort.java,
+ java/awt/image/ImagingOpException.java,
+ java/awt/image/Kernel.java,
+ java/awt/image/LookupTable.java,
+ java/awt/image/MultiPixelPackedSampleModel.java,
+ java/awt/image/PackedColorModel.java,
+ java/awt/image/PixelInterleavedSampleModel.java,
+ java/awt/image/RGBImageFilter.java,
+ java/awt/image/Raster.java,
+ java/awt/image/RasterFormatException.java,
+ java/awt/image/SampleModel.java,
+ java/awt/image/ShortLookupTable.java,
+ java/awt/image/SinglePixelPackedSampleModel.java,
+ java/awt/image/WritableRaster.java,
+ java/awt/print/PrinterAbortException.java,
+ java/awt/print/PrinterException.java,
+ java/awt/print/PrinterIOException.java,
+ java/beans/AppletInitializer.java,
+ java/beans/ExceptionListener.java,
+ java/beans/PropertyChangeEvent.java,
+ java/beans/PropertyChangeListenerProxy.java,
+ java/beans/PropertyChangeSupport.java,
+ java/beans/PropertyDescriptor.java,
+ java/beans/VetoableChangeListenerProxy.java,
+ java/beans/VetoableChangeSupport.java,
+ java/io/BufferedReader.java,
+ java/io/ByteArrayInputStream.java,
+ java/io/ByteArrayOutputStream.java,
+ java/io/CharArrayReader.java,
+ java/io/CharArrayWriter.java,
+ java/io/CharConversionException.java,
+ java/io/DataInput.java,
+ java/io/DataInputStream.java,
+ java/io/DataOutput.java,
+ java/io/DataOutputStream.java,
+ java/io/EOFException.java,
+ java/io/FileInputStream.java,
+ java/io/FileNotFoundException.java,
+ java/io/FileOutputStream.java,
+ java/io/FilenameFilter.java,
+ java/io/FilterInputStream.java,
+ java/io/FilterOutputStream.java,
+ java/io/FilterReader.java,
+ java/io/FilterWriter.java,
+ java/io/IOException.java,
+ java/io/InputStream.java,
+ java/io/InterruptedIOException.java,
+ java/io/LineNumberInputStream.java,
+ java/io/LineNumberReader.java,
+ java/io/ObjectInputStream.java,
+ java/io/ObjectStreamException.java,
+ java/io/OptionalDataException.java,
+ java/io/OutputStream.java,
+ java/io/OutputStreamWriter.java,
+ java/io/PrintStream.java,
+ java/io/PrintWriter.java,
+ java/io/PushbackInputStream.java,
+ java/io/PushbackReader.java,
+ java/io/RandomAccessFile.java,
+ java/io/Reader.java,
+ java/io/SequenceInputStream.java,
+ java/io/Serializable.java,
+ java/io/StreamCorruptedException.java,
+ java/io/StreamTokenizer.java,
+ java/io/StringBufferInputStream.java,
+ java/io/StringWriter.java,
+ java/io/SyncFailedException.java,
+ java/io/UTFDataFormatException.java,
+ java/io/UnsupportedEncodingException.java,
+ java/io/WriteAbortedException.java,
+ java/io/Writer.java,
+ java/lang/AbstractMethodError.java,
+ java/lang/ArithmeticException.java,
+ java/lang/ArrayIndexOutOfBoundsException.java,
+ java/lang/ArrayStoreException.java,
+ java/lang/AssertionError.java,
+ java/lang/Boolean.java,
+ java/lang/Byte.java,
+ java/lang/Class.java,
+ java/lang/ClassCastException.java,
+ java/lang/ClassCircularityError.java,
+ java/lang/ClassLoader.java,
+ java/lang/ClassNotFoundException.java,
+ java/lang/CloneNotSupportedException.java,
+ java/lang/Cloneable.java,
+ java/lang/Comparable.java,
+ java/lang/Compiler.java,
+ java/lang/Double.java,
+ java/lang/Error.java,
+ java/lang/Exception.java,
+ java/lang/ExceptionInInitializerError.java,
+ java/lang/Float.java,
+ java/lang/IllegalAccessError.java,
+ java/lang/IllegalAccessException.java,
+ java/lang/IllegalArgumentException.java,
+ java/lang/IllegalMonitorStateException.java,
+ java/lang/IllegalStateException.java,
+ java/lang/IllegalThreadStateException.java,
+ java/lang/IncompatibleClassChangeError.java,
+ java/lang/IndexOutOfBoundsException.java,
+ java/lang/InheritableThreadLocal.java,
+ java/lang/InstantiationError.java,
+ java/lang/InstantiationException.java,
+ java/lang/Integer.java,
+ java/lang/InternalError.java,
+ java/lang/InterruptedException.java,
+ java/lang/LinkageError.java,
+ java/lang/Long.java,
+ java/lang/NegativeArraySizeException.java,
+ java/lang/NoClassDefFoundError.java,
+ java/lang/NoSuchFieldError.java,
+ java/lang/NoSuchFieldException.java,
+ java/lang/NoSuchMethodError.java,
+ java/lang/NoSuchMethodException.java,
+ java/lang/NullPointerException.java,
+ java/lang/Number.java,
+ java/lang/NumberFormatException.java,
+ java/lang/OutOfMemoryError.java,
+ java/lang/Process.java,
+ java/lang/Runnable.java,
+ java/lang/Runtime.java,
+ java/lang/RuntimeException.java,
+ java/lang/RuntimePermission.java,
+ java/lang/SecurityException.java,
+ java/lang/SecurityManager.java,
+ java/lang/Short.java,
+ java/lang/StackOverflowError.java,
+ java/lang/StackTraceElement.java,
+ java/lang/StringBuffer.java,
+ java/lang/StringIndexOutOfBoundsException.java,
+ java/lang/ThreadDeath.java,
+ java/lang/ThreadGroup.java,
+ java/lang/Throwable.java,
+ java/lang/UnsatisfiedLinkError.java,
+ java/lang/UnsupportedOperationException.java,
+ java/lang/VerifyError.java,
+ java/lang/VirtualMachineError.java,
+ java/lang/reflect/AccessibleObject.java,
+ java/lang/reflect/Array.java,
+ java/lang/reflect/InvocationTargetException.java,
+ java/lang/reflect/Member.java,
+ java/lang/reflect/Modifier.java,
+ java/lang/reflect/Proxy.java,
+ java/lang/reflect/ReflectPermission.java,
+ java/lang/reflect/UndeclaredThrowableException.java,
+ java/math/BigInteger.java,
+ java/net/NetworkInterface.java,
+ java/nio/ByteBufferHelper.java,
+ java/nio/ByteBufferImpl.java,
+ java/nio/DirectByteBufferImpl.java,
+ java/nio/DoubleBufferImpl.java,
+ java/nio/FloatBufferImpl.java,
+ java/nio/IntBufferImpl.java,
+ java/nio/LongBufferImpl.java,
+ java/nio/ShortBufferImpl.java,
+ java/nio/channels/Channel.java,
+ java/nio/channels/IllegalBlockingModeException.java,
+ java/nio/charset/spi/CharsetProvider.java,
+ java/security/AccessControlException.java,
+ java/security/BasicPermission.java,
+ java/security/DigestException.java,
+ java/security/DigestInputStream.java,
+ java/security/DigestOutputStream.java,
+ java/security/GeneralSecurityException.java,
+ java/security/Guard.java,
+ java/security/GuardedObject.java,
+ java/security/InvalidAlgorithmParameterException.java,
+ java/security/InvalidKeyException.java,
+ java/security/InvalidParameterException.java,
+ java/security/Key.java,
+ java/security/KeyException.java,
+ java/security/KeyManagementException.java,
+ java/security/KeyStoreException.java,
+ java/security/MessageDigestSpi.java,
+ java/security/NoSuchAlgorithmException.java,
+ java/security/NoSuchProviderException.java,
+ java/security/Permission.java,
+ java/security/PermissionCollection.java,
+ java/security/Permissions.java,
+ java/security/Principal.java,
+ java/security/PrivateKey.java,
+ java/security/PrivilegedActionException.java,
+ java/security/ProviderException.java,
+ java/security/PublicKey.java,
+ java/security/SecureRandom.java,
+ java/security/SecureRandomSpi.java,
+ java/security/SignatureException.java,
+ java/security/SignatureSpi.java,
+ java/security/SignedObject.java,
+ java/security/Signer.java,
+ java/security/UnrecoverableKeyException.java,
+ java/security/UnresolvedPermission.java,
+ java/security/acl/AclNotFoundException.java,
+ java/security/acl/LastOwnerException.java,
+ java/security/acl/NotOwnerException.java,
+ java/security/cert/CertPath.java,
+ java/security/cert/CertPathBuilderException.java,
+ java/security/cert/CertPathValidatorException.java,
+ java/security/cert/CertStoreException.java,
+ java/text/BreakIterator.java,
+ java/text/ChoiceFormat.java,
+ java/text/CollationElementIterator.java,
+ java/text/CollationKey.java,
+ java/text/Collator.java,
+ java/text/DateFormat.java,
+ java/text/DateFormatSymbols.java,
+ java/text/DecimalFormat.java,
+ java/text/DecimalFormatSymbols.java,
+ java/text/FieldPosition.java,
+ java/text/Format.java,
+ java/text/NumberFormat.java,
+ java/text/ParseException.java,
+ java/text/ParsePosition.java,
+ java/text/StringCharacterIterator.java,
+ java/util/AbstractCollection.java,
+ java/util/AbstractList.java,
+ java/util/AbstractMap.java,
+ java/util/AbstractSequentialList.java,
+ java/util/AbstractSet.java,
+ java/util/ArrayList.java,
+ java/util/Arrays.java,
+ java/util/BitSet.java,
+ java/util/Collection.java,
+ java/util/Collections.java,
+ java/util/Comparator.java,
+ java/util/ConcurrentModificationException.java,
+ java/util/Currency.java,
+ java/util/Date.java,
+ java/util/EmptyStackException.java,
+ java/util/Enumeration.java,
+ java/util/EventListener.java,
+ java/util/EventListenerProxy.java,
+ java/util/EventObject.java,
+ java/util/HashMap.java,
+ java/util/HashSet.java,
+ java/util/Hashtable.java,
+ java/util/IdentityHashMap.java,
+ java/util/Iterator.java,
+ java/util/LinkedHashSet.java,
+ java/util/LinkedList.java,
+ java/util/List.java,
+ java/util/ListIterator.java,
+ java/util/ListResourceBundle.java,
+ java/util/Map.java,
+ java/util/MissingResourceException.java,
+ java/util/NoSuchElementException.java,
+ java/util/Observable.java,
+ java/util/Observer.java,
+ java/util/Properties.java,
+ java/util/PropertyPermissionCollection.java,
+ java/util/RandomAccess.java,
+ java/util/Set.java,
+ java/util/SortedMap.java,
+ java/util/SortedSet.java,
+ java/util/Stack.java,
+ java/util/StringTokenizer.java,
+ java/util/TooManyListenersException.java,
+ java/util/TreeMap.java,
+ java/util/TreeSet.java,
+ java/util/Vector.java,
+ java/util/logging/FileHandler.java,
+ java/util/logging/Level.java,
+ java/util/prefs/BackingStoreException.java,
+ java/util/prefs/InvalidPreferencesFormatException.java,
+ java/util/prefs/Preferences.java,
+ javax/accessibility/Accessible.java,
+ javax/accessibility/AccessibleAction.java,
+ javax/accessibility/AccessibleBundle.java,
+ javax/accessibility/AccessibleComponent.java,
+ javax/accessibility/AccessibleContext.java,
+ javax/accessibility/AccessibleEditableText.java,
+ javax/accessibility/AccessibleExtendedComponent.java,
+ javax/accessibility/AccessibleExtendedTable.java,
+ javax/accessibility/AccessibleHyperlink.java,
+ javax/accessibility/AccessibleHypertext.java,
+ javax/accessibility/AccessibleIcon.java,
+ javax/accessibility/AccessibleKeyBinding.java,
+ javax/accessibility/AccessibleRelation.java,
+ javax/accessibility/AccessibleRelationSet.java,
+ javax/accessibility/AccessibleResourceBundle.java,
+ javax/accessibility/AccessibleRole.java,
+ javax/accessibility/AccessibleSelection.java,
+ javax/accessibility/AccessibleState.java,
+ javax/accessibility/AccessibleStateSet.java,
+ javax/accessibility/AccessibleTable.java,
+ javax/accessibility/AccessibleTableModelChange.java,
+ javax/accessibility/AccessibleText.java,
+ javax/accessibility/AccessibleValue.java,
+ javax/imageio/IIOException.java,
+ javax/imageio/ImageIO.java,
+ javax/imageio/spi/IIOServiceProvider.java,
+ javax/imageio/spi/ImageInputStreamSpi.java,
+ javax/imageio/spi/ImageOutputStreamSpi.java,
+ javax/imageio/spi/ImageReaderWriterSpi.java,
+ javax/imageio/spi/ImageTranscoderSpi.java,
+ javax/imageio/spi/RegisterableService.java,
+ javax/imageio/spi/ServiceRegistry.java,
+ javax/imageio/stream/IIOByteBuffer.java,
+ javax/imageio/stream/ImageInputStream.java,
+ javax/imageio/stream/ImageOutputStream.java,
+ javax/naming/Binding.java,
+ javax/naming/CannotProceedException.java,
+ javax/naming/CompositeName.java,
+ javax/naming/CompoundName.java,
+ javax/naming/LinkException.java,
+ javax/naming/LinkRef.java,
+ javax/naming/NameClassPair.java,
+ javax/naming/Reference.java,
+ javax/naming/ReferralException.java,
+ javax/naming/directory/Attribute.java,
+ javax/naming/directory/AttributeModificationException.java,
+ javax/naming/directory/Attributes.java,
+ javax/naming/directory/DirContext.java,
+ javax/naming/directory/ModificationItem.java,
+ javax/naming/directory/SearchControls.java,
+ javax/naming/directory/SearchResult.java,
+ javax/naming/event/EventContext.java,
+ javax/naming/event/EventDirContext.java,
+ javax/naming/event/NamespaceChangeListener.java,
+ javax/naming/event/NamingExceptionEvent.java,
+ javax/naming/event/NamingListener.java,
+ javax/naming/event/ObjectChangeListener.java,
+ javax/naming/ldap/Control.java,
+ javax/naming/ldap/ExtendedResponse.java,
+ javax/naming/ldap/HasControls.java,
+ javax/naming/ldap/LdapContext.java,
+ javax/naming/ldap/UnsolicitedNotification.java,
+ javax/naming/ldap/UnsolicitedNotificationEvent.java,
+ javax/naming/ldap/UnsolicitedNotificationListener.java,
+ javax/naming/spi/DirectoryManager.java,
+ javax/naming/spi/ResolveResult.java,
+ javax/naming/spi/Resolver.java,
+ javax/security/auth/callback/Callback.java,
+ javax/security/auth/callback/CallbackHandler.java,
+ javax/security/auth/callback/ChoiceCallback.java,
+ javax/security/auth/callback/ConfirmationCallback.java,
+ javax/security/auth/callback/LanguageCallback.java,
+ javax/security/auth/callback/NameCallback.java,
+ javax/security/auth/callback/PasswordCallback.java,
+ javax/security/auth/callback/TextInputCallback.java,
+ javax/security/auth/callback/TextOutputCallback.java,
+ javax/security/auth/callback/UnsupportedCallbackException.java,
+ javax/security/sasl/Sasl.java,
+ javax/security/sasl/SaslServerFactory.java,
+ javax/swing/DefaultBoundedRangeModel.java,
+ javax/swing/JComponent.java,
+ javax/swing/JList.java,
+ javax/swing/JProgressBar.java,
+ javax/swing/JRadioButton.java,
+ javax/swing/JTextArea.java,
+ javax/swing/JTextField.java,
+ javax/swing/JToggleButton.java,
+ javax/swing/JTree.java,
+ javax/swing/SpinnerListModel.java,
+ javax/swing/event/EventListenerList.java,
+ javax/swing/text/JTextComponent.java,
+ javax/swing/text/StringContent.java,
+ javax/swing/text/Utilities.java,
+ javax/swing/undo/UndoManager.java,
+ javax/swing/undo/UndoableEditSupport.java,
+ javax/transaction/HeuristicCommitException.java,
+ javax/transaction/HeuristicMixedException.java,
+ javax/transaction/HeuristicRollbackException.java,
+ javax/transaction/InvalidTransactionException.java,
+ javax/transaction/NotSupportedException.java,
+ javax/transaction/RollbackException.java,
+ javax/transaction/Status.java,
+ javax/transaction/Synchronization.java,
+ javax/transaction/SystemException.java,
+ javax/transaction/Transaction.java,
+ javax/transaction/TransactionManager.java,
+ javax/transaction/TransactionRequiredException.java,
+ javax/transaction/TransactionRolledbackException.java,
+ javax/transaction/UserTransaction.java,
+ javax/transaction/xa/XAException.java,
+ javax/transaction/xa/XAResource.java,
+ javax/transaction/xa/Xid.java,
+ javax/xml/XMLConstants.java,
+ javax/xml/datatype/DatatypeConfigurationException.java,
+ javax/xml/datatype/DatatypeConstants.java,
+ javax/xml/datatype/DatatypeFactory.java,
+ javax/xml/datatype/Duration.java,
+ javax/xml/datatype/XMLGregorianCalendar.java,
+ javax/xml/namespace/NamespaceContext.java,
+ javax/xml/namespace/QName.java,
+ javax/xml/parsers/DocumentBuilder.java,
+ javax/xml/parsers/DocumentBuilderFactory.java,
+ javax/xml/parsers/FactoryConfigurationError.java,
+ javax/xml/parsers/ParserConfigurationException.java,
+ javax/xml/parsers/SAXParser.java,
+ javax/xml/parsers/SAXParserFactory.java,
+ javax/xml/transform/ErrorListener.java,
+ javax/xml/transform/OutputKeys.java,
+ javax/xml/transform/Result.java,
+ javax/xml/transform/Source.java,
+ javax/xml/transform/SourceLocator.java,
+ javax/xml/transform/Templates.java,
+ javax/xml/transform/Transformer.java,
+ javax/xml/transform/TransformerConfigurationException.java,
+ javax/xml/transform/TransformerException.java,
+ javax/xml/transform/TransformerFactory.java,
+ javax/xml/transform/TransformerFactoryConfigurationError.java,
+ javax/xml/transform/URIResolver.java,
+ javax/xml/transform/dom/DOMLocator.java,
+ javax/xml/transform/dom/DOMResult.java,
+ javax/xml/transform/dom/DOMSource.java,
+ javax/xml/transform/sax/SAXResult.java,
+ javax/xml/transform/sax/SAXSource.java,
+ javax/xml/transform/sax/SAXTransformerFactory.java,
+ javax/xml/transform/sax/TemplatesHandler.java,
+ javax/xml/transform/sax/TransformerHandler.java,
+ javax/xml/transform/stream/StreamResult.java,
+ javax/xml/transform/stream/StreamSource.java,
+ javax/xml/validation/Schema.java,
+ javax/xml/validation/SchemaFactory.java,
+ javax/xml/validation/TypeInfoProvider.java,
+ javax/xml/validation/Validator.java,
+ javax/xml/validation/ValidatorHandler.java,
+ javax/xml/xpath/XPathConstants.java,
+ javax/xml/xpath/XPathException.java,
+ javax/xml/xpath/XPathExpression.java,
+ javax/xml/xpath/XPathExpressionException.java,
+ javax/xml/xpath/XPathFactory.java,
+ javax/xml/xpath/XPathFactoryConfigurationException.java,
+ javax/xml/xpath/XPathFunction.java,
+ javax/xml/xpath/XPathFunctionException.java,
+ javax/xml/xpath/XPathFunctionResolver.java:
+ Fixed usage of @author tag, reworked import statements,
+ removed CVS tags, changed the modifier order and fixed
+ HTML usage in javadocs.
+
+2005-02-16 Julian Scheid <julian@sektor37.de>
+
+ * gnu/java/nio/charset/UTF_8.java (decodeLoop): Set inPos to
+ in.position().
+ (encodeLoop): Likewise.
+
+2005-02-16 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (ordinary_java_source_files): Add new files
+ gnu/java/security/ber/BER.java,
+ gnu/java/security/ber/BEREncodingException.java,
+ gnu/java/security/ber/BERReader.java,
+ gnu/java/security/ber/BERValue.java,
+ gnu/java/security/pkcs/PKCS7SignedData.java and
+ gnu/java/security/pkcs/SignerInfo.java.
+ * Makefile.in: Regenerated.
+
+2005-02-16 Casey Marshall <csm@gnu.org>
+
+ * gnu/java/security/provider/GnuDSAPrivateKey.java
+ (encodedKey): new field.
+ (getFormat): return "PKCS#8".
+ (getEncoded): implemented.
+ (toString): check for 'null' values.
+ * gnu/java/security/provider/GnuDSAPublicKey.java
+ (encodedKey): new field.
+ (getFormat): return "X.509".
+ (getEncoded): implemented.
+ (toString): check for 'null' values.
+
+2005-02-16 Michael Koch <konqueror@gmx.de>
+
+ * java/util/jar/JarFile.java: Imports reworked.
+
+2005-02-16 Mark Wielaard <mark@klomp.org>
+
+ * java/util/jar/JarFile.java (verify): Make package private.
+ (signaturesRead): Likewise.
+ (verified): Likewise.
+ (entryCerts): Likewise.
+ (DEBUG): Likewise.
+ (debug): Likewise.
+ (entries): Construct new JarEnumeration with reference to this.
+ (JarEnumeration): Make static.
+ (JarEnumeration.jarfile): New field.
+ (JarEnumeration.nextElement): Use and synchronize on jarfile.
+ Compare verified value to Boolean.TRUE or Boolean.False only
+ when verify is true.
+ (getEntry): Make synchronized. Compare value of verified to
+ Boolean.TRUE.
+ (getInputStream): Construct EntryInputStream with reference to this.
+ (getManifest): Make synchronized.
+ (EntryInputStream): Make static.
+ (EntryInputStream.jarfile): New field.
+ (EntryInputStream.EntryInputStream): Check if manifest exists,
+ before getting attributes.
+ (eof): Synchronize on jarfile.
+
+2005-02-16 Casey Marshall <csm@gnu.org>
+
+ * java/util/jar/JarFile.java (verify): return if the jar is signed
+ with an unsupported algorithm.
+
+2005-02-16 Mark Wielaard <mark@klomp.org>
+
+ * java/util/jar/JarFile.java (EntryInputStream): Add actual
+ InputStream as argument.
+ (getInputStream): Construct a new EntryInputStream with the result of
+ super.getInputStream(entry).
+
+2005-02-16 Casey Marshall <csm@gnu.org>
+
+ Signed JAR file support.
+ * java/net/URLClassLoader.java
+ (JarURLResource.getCertificates): re-read jar entry to ensure
+ certificates are picked up.
+ (findClass): fill in class `signers' field, too.
+ * java/util/jar/JarFile.java (META_INF): new constant.
+ (PKCS7_DSA_SUFFIX): new constant.
+ (PKCS7_RSA_SUFFIX): new constant.
+ (DIGEST_KEY_SUFFIX): new constant.
+ (SF_SUFFIX): new constant.
+ (MD2_OID): new constant.
+ (MD4_OID): new constant.
+ (MD5_OID): new constant.
+ (SHA1_OID): new constant.
+ (DSA_ENCRYPTION_OID): new constant.
+ (RSA_ENCRYPTION_OID): new constant.
+ (signaturesRead): new field.
+ (verified): new field.
+ (entryCerts): new field.
+ (DEBUG): new constant.
+ (debug): new method.
+ (JarEnumeration.nextElement): fill in entry certificates, read
+ signatures if they haven't been read.
+ (getEntry): likewise.
+ (getInputStream): verify stream if it hasn't been verified yet.
+ (readSignatures): new method.
+ (verify): new method.
+ (verifyHashes): new method.
+ (readManifestEntry): new method.
+ (EntryInputStream): new class.
+ * gnu/java/io/Base64InputStream.java (decode): new class
+ method.
+ * gnu/java/security/der/DERReader.java don't make class
+ final.
+ (in): made protected.
+ (encBuf): likewise.
+ (readLength): likewise.
+ * gnu/java/security/ber/BER.java,
+ * gnu/java/security/ber/BEREncodingException.java,
+ * gnu/java/security/ber/BERReader.java,
+ * gnu/java/security/ber/BERValue.java,
+ * gnu/java/security/pkcs/PKCS7SignedData.java,
+ * gnu/java/security/pkcs/SignerInfo.java:
+ new files.
+
+2005-02-16 Tom Tromey <tromey@redhat.com>
+
+ * gnu/gcj/runtime/SharedLibHelper.java (findHelper): Delete
+ copied file on exit.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * java/awt/BasicStroke.java (hashCode): Check for null dash.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GtkArg.java,
+ gnu/java/awt/peer/gtk/GtkArgList.java:
+ Removed.
+
+2005-02-15 Craig Black <craig.black@aonix.com>
+
+ * gnu/java/awt/peer/gtk/GtkCheckboxMenuItem.java
+ (postMenuActionEvent): Implement to notify ItemListeners.
+ * java/awt/CheckboxMenuItem.java
+ (dispatchEventImpl): Update state on ItemEvent.
+ * java/awt/MenuItem.java
+ (processActionEvent): Retarget event source.
+
+2005-02-15 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * gnu/java/awt/color/ClutProfileConverter.java,
+ gnu/java/awt/peer/ClasspathTextLayoutPeer.java,
+ gnu/java/awt/peer/gtk/GdkFontPeer.java,
+ gnu/java/awt/peer/gtk/GdkGlyphVector.java,
+ gnu/java/awt/peer/gtk/GdkGraphics2D.java,
+ gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,
+ gnu/java/awt/peer/gtk/GdkPixbufDecoder.java,
+ gnu/java/awt/peer/gtk/GdkRobotPeer.java,
+ gnu/java/awt/peer/gtk/GdkTextLayout.java,
+ gnu/java/awt/peer/gtk/GtkButtonPeer.java,
+ gnu/java/awt/peer/gtk/GtkCheckboxPeer.java,
+ gnu/java/awt/peer/gtk/GtkChoicePeer.java,
+ gnu/java/awt/peer/gtk/GtkComponentPeer.java,
+ gnu/java/awt/peer/gtk/GtkContainerPeer.java,
+ gnu/java/awt/peer/gtk/GtkDialogPeer.java,
+ gnu/java/awt/peer/gtk/GtkFileDialogPeer.java,
+ gnu/java/awt/peer/gtk/GtkFontPeer.java,
+ gnu/java/awt/peer/gtk/GtkFramePeer.java,
+ gnu/java/awt/peer/gtk/GtkLabelPeer.java,
+ gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java,
+ gnu/java/awt/peer/gtk/GtkMenuItemPeer.java,
+ gnu/java/awt/peer/gtk/GtkScrollPanePeer.java,
+ gnu/java/awt/peer/gtk/GtkTextComponentPeer.java,
+ gnu/java/awt/peer/gtk/GtkToolkit.java,
+ gnu/java/awt/peer/gtk/GtkWindowPeer.java,
+ javax/swing/JPopupMenu.java,
+ javax/swing/JSpinner.java,
+ javax/swing/SortingFocusTraversalPolicy.java,
+ javax/swing/SwingUtilities.java,
+ javax/swing/plaf/basic/BasicComboBoxEditor.java,
+ javax/swing/plaf/basic/BasicComboBoxRenderer.java,
+ javax/swing/tree/DefaultMutableTreeNode.java:
+ Removed unused imports and expanded starred
+ imports.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * java/awt/AWTKeyStroke.java (getAWTKeyStroke(String)): Throw
+ IllegalArgumentException when the given String is null.
+
+ * javax/swing/KeyStroke.java (getKeyStroke(String)): Return null
+ when given keystoke sequence cannot be parsed.
+
+ * javax/swing/JRootPane.java (setJMenuBar): Remove current menubar
+ if one is installed. Only install the given menubar is not null.
+
+ * javax/swing/JViewport.java (getViewSize): Return an empty
+ Dimension when the view isn't set or preferred component size when
+ no viewSize is set.
+
+ * javax/swing/ViewportLayout.java (preferredLayoutSize): Return an
+ empty Dimension when there is no view set.
+ (minimumLayoutSize): Likewise.
+ (layoutContainer): Don't try to layout when there is no view.
+
+2005-02-15 Anthony Green <green@redhat.com>
+
+ * jni/gtk-peer/gtk_jawt.c (classpath_jawt_get_drawable,
+ classpath_jawt_lock, classpath_jawt_unlock): New functions.
+ * jawt.c (_Jv_JAWT_Lock, _Jv_JAWT_Unlock): New functions.
+ (_Jv_GetDrawingSurface): Set visualID.
+ (_Jv_FreeDrawingSurfaceInfo): Clear visualID.
+ (JAWT_GetAWT): Set Lock and Unlock.
+ * include/jawt_md.h (struct _JAWT_X11DrawingSurfaceInfo): Add visualID.
+ * include/jawt.h (JAWT_VERSION_1_4, JAWT_LOCK_ERROR,
+ JAWT_LOCK_CLIP_CHANGED, JAWT_LOCK_BOUNDS_CHANGED,
+ JAWT_LOCK_SURFACE_CHANGED): New macros.
+ (struct _JAWT): Add Lock and Unlock.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jawt.c: New file.
+ * include/jawt.h: Likewise.
+ * include/jawt_md.h: Likewise.
+ * include/Makefile.am (tool_include__HEADERS): Add jawt.h and
+ jawt_md.h files.
+ * jni/classpath/classpath_jawt.h: Likewise.
+ * jni/gtk-peer/gtk_jawt.c: Likewise.
+ * Makefile.am: Build libjawt.so.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java:
+ Merged file header with classpath CVS head.
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
+ Merged code formatting with classpath CVS head.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c:
+ Removed debug code.
+ (Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector):
+ Handle special JNI strings with 2 '\0' at the end.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:
+ Merged file header with classpath CVS head.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:
+ Merged code formatting with classpath CVS head.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (create):
+ Use GTK's built-in file system backend. Use GTK_RESPONSE_ACCEPT.
+ (handle_response): Use GTK_RESPONSE_ACCEPT.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * Makefile.am: Fix library build breakage.
+ * Makefile.in: Regenerate.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTabbedPane.java
+ (Page.setDisplayedMnemonicIndex): Handle empty menmonic.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/tree/DefaultMutableTreeNode.java:
+ Reworked Javadocs all over.
+ (getPathToRoot): Fixed direction of result array initialization.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:
+ Fix includes for cairo 0.3.0 snappshot.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c:
+ Merged file header from classpath CVS HEAD.
+
+2005-02-15 Craig Black <craig.black@aonix.com>
+
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
+ (copyState): Pass a JNI global reference to signal handler.
+ (realize_cb): Use and free JNI global reference.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+ (create): Pass a JNI global reference to signal handler.
+ (selection_changed): Match declaration.
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
+ (dispose): Do not remove entries from state tables until after widget is
+ destroyed.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Container.javai (paramString):
+ If layoutMgr is null just return result of super.paramString().
+ * java/awt/Scrollbar.java: Reformatted.
+ * java/awt/im/InputContext.java (static):
+ Removed redundant initializations.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/ImageIcon.java,
+ javax/swing/UIManager.java,
+ javax/swing/text/EditorKit.java,
+ javax/swing/text/Segment.java:
+ More whitespace cleanups.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/EmbeddedWindow.java,
+ gnu/java/awt/image/ImageDecoder.java,
+ gnu/java/awt/peer/gtk/GtkFileDialogPeer.java,
+ java/awt/DefaultKeyboardFocusManager.java,
+ java/awt/Frame.java,
+ java/awt/image/RGBImageFilter.java,
+ javax/swing/AbstractButton.java,
+ javax/swing/ActionMap.java,
+ javax/swing/ComponentInputMap.java,
+ javax/swing/DefaultDesktopManager.java,
+ javax/swing/ImageIcon.java,
+ javax/swing/InputMap.java,
+ javax/swing/JButton.java,
+ javax/swing/JCheckBox.java,
+ javax/swing/JCheckBoxMenuItem.java,
+ javax/swing/JEditorPane.java,
+ javax/swing/JMenu.java,
+ javax/swing/JMenuItem.java,
+ javax/swing/JOptionPane.java,
+ javax/swing/JRootPane.java,
+ javax/swing/JTable.java,
+ javax/swing/MenuSelectionManager.java,
+ javax/swing/RepaintManager.java,
+ javax/swing/ScrollPaneLayout.java,
+ javax/swing/SortingFocusTraversalPolicy.java,
+ javax/swing/UIManager.java,
+ javax/swing/ViewportLayout.java,
+ javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java,
+ javax/swing/plaf/basic/BasicInternalFrameUI.java,
+ javax/swing/plaf/basic/BasicLabelUI.java,
+ javax/swing/plaf/basic/BasicListUI.java,
+ javax/swing/plaf/basic/BasicMenuItemUI.java,
+ javax/swing/plaf/basic/BasicMenuUI.java,
+ javax/swing/plaf/basic/BasicOptionPaneUI.java,
+ javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java,
+ javax/swing/plaf/basic/BasicRootPaneUI.java,
+ javax/swing/plaf/basic/BasicScrollPaneUI.java,
+ javax/swing/plaf/basic/BasicSplitPaneDivider.java,
+ javax/swing/plaf/basic/BasicTextUI.java,
+ javax/swing/table/TableColumnModel.java,
+ javax/swing/text/AbstractDocument.java,
+ javax/swing/text/EditorKit.java,
+ javax/swing/text/Position.java,
+ javax/swing/text/Segment.java,
+ javax/swing/text/StyledEditorKit.java,
+ javax/swing/text/ViewFactory.java:
+ Cleanup whitespace differences to classpath CVS HEAD.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
+ (finalize): Call finish from here.
+ (produce): Not from here.
+ * Makefile.am (gtk_c_source_files):
+ Remove jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c.
+ * Makefile.in: Regenerate.
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java
+ (cairoSetFont):
+ (cairoDrawGdkTextLayout):
+ (cairoDrawString):
+ (getPeerTextMetrics):
+ (getPeerFontMetrics): Remove.
+ (setFont): Don't call cairoSetFont.
+ (cairoDrawGlyphVector): Accept font peer argument.
+ (drawGlyphVector): Pass font peer to cairoDrawGlyphVector.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
+ (ensure_metrics_cairo):
+ (gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetFont):
+ (gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawString):
+ (gnu_java_awt_peer_gtk_GdkGraphics2D_getPeerFontMetrics):
+ (gnu_java_awt_peer_gtk_GdkGraphics2D_getPeerTextMetrics):
+ (metrics_cairo):
+ (metrics_surface): Remove.
+ (gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGlyphVector):
+ Pass and install font peer.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * Makefile.am: Create "split library" structure.
+ * Makefile.in: Regenerate.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
+ Release GDK lock during upcalls.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c: Remove.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
+ (Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector):
+ (Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics):
+ (Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics): New methods.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c: Remove.
+ * gnu/java/awt/peer/gtk/GdkFontPeer.java
+ (getGlyphVector):
+ (getFontMetrics):
+ (getTextMetrics): New native methods.
+ * gnu/java/awt/peer/gtk/GdkFontMetrics.java: Remove native parts.
+ * gnu/java/awt/peer/gtk/GdkGlyphVector.java: Likewise.
+ * Makefile.am: Remove native entries for GdkFontMetrics, GdkGlyphVector.
+ * Makefile.in: Regenerate.
+
+2005-02-15 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * javax/swing/SwingUtilities.java:
+ (getAccessibleAt(java.awt.Component, java.awt.Point)):
+ Implemented and documented.
+ (getAccessibleChild(java.awt.Component, int)): Likewise.
+ (getAccessibleChildrenCount(java.awt.Component)): Likewise.
+ (getAccessibleIndexInParent(java.awt.Component)): Likewise.
+ (getAccessibleStateSet(java.awt.Component)): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/SwingUtilities.java
+ (getFontMetrics): Removed.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Container.java
+ (paramString): Implemented.
+ * javax/swing/AbstractButton.java
+ (paramString): Implemented.
+ * javax/swing/JComponent.java
+ (paramString): Implemented.
+ * javax/swing/JMenu.java
+ (paramString): Implemented.
+ * javax/swing/JMenuBar.java
+ (paramString): Implemented.
+ * javax/swing/JMenuItem.java
+ (paramString): Implemented.
+ * javax/swing/JPopupMenu.java
+ (paramString): Implemented.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JMenu.java
+ (uiClassID): Removed.
+ (JMenu): Set invoker on popup menu.
+ (getUIClassID): Return id directly.
+ (getItemCount): Simply return getMenuComponentCount().
+ Fixed javadoc.
+ (isTopLevelMenu): Simplified.
+ * javax/swing/JMenuItem.java
+ (uiClassID): Removed.
+ (getUIClassID): Return id directly.
+ * javax/swing/JPopupMenu.java
+ (uiClassID): Removed.
+ (JPopupMenu): Always initialize correctly.
+ (getSubElements): Only return components implementing MenuElement
+ interface.
+ (HeavyWeightPopup.hide): Removed.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/image/ReplicateScaleFilter.java
+ (replicatePixels): Made private.
+ * javax/swing/colorchooser/DefaultRGBChooserPanel.java
+ (DefaultRGBChooserPanel): Made package private.
+ * javax/swing/colorchooser/DefaultSwatchChooserPanel.java
+ (RecentSwatchPanel): Likewise.
+ * javax/swing/event/MouseInputAdapter.java: Reformatted.
+ (MouseInputAdapter): Made abstract.
+ * javax/swing/tree/DefaultMutableTreeNode.java
+ (random): Removed.
+ (growTree): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/dnd/DropTarget.java (addDropTargetListener):
+ Clarified comments.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JComponent.java (getComponentGraphics):
+ Removed accidently commited code.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/dnd/DropTarget.java
+ (addDropTargetListener): Despite documentation, do not throw.
+ * javax/swing/JComponent.java: Set a default DropTarget.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/AbstractAction.java
+ (ENABLED_PROPERTY): Removed.
+ (setEnabled): Replaced constant with real string.
+ * javax/swing/AbstractButton.java
+ (createActionPropertyChangeListener.propertyChange): Likewise.
+ * javax/swing/JComboBox.java
+ (DEFAULT_MAXIMUM_ROW_COUNT): Made private.
+ (EDITABLE_CHANGED_PROPERTY): Removed.
+ (MAXIMUM_ROW_COUNT_CHANGED_PROPERTY):Likewise.
+ (ENABLED_CHANGED_PROPERTY):Likewise.
+ (RENDERER_CHANGED_PROPERTY):Likewise.
+ (EDITOR_CHANGED_PROPERTY):Likewise.
+ (MODEL_CHANGED_PROPERTY):Likewise.
+ (uiClassID):Likewise.
+ (getUIClassID): Replaced constant with real string.
+ (setModel):Likewise.
+ (setEditable):Likewise.
+ (setMaximumRowCount):Likewise.
+ (setRenderer):Likewise.
+ (setEditor):Likewise.
+ (setEnabled):Likewise.
+ * javax/swing/JLabel.java
+ (DISABLED_ICON_CHANGED_PROPERTY): Removed.
+ (DISPLAYED_MNEMONIC_CHANGED_PROPERTY): Likewise.
+ (DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY): Likewise.
+ (HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY): Likewise.
+ (HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY): Likewise.
+ (ICON_CHANGED_PROPERTY): Likewise.
+ (ICON_TEXT_GAP_CHANGED_PROPERTY): Likewise.
+ (LABEL_FOR_CHANGED_PROPERTY): Likewise.
+ (TEXT_CHANGED_PROPERTY): Likewise.
+ (VERTICAL_ALIGNMENT_CHANGED_PROPERTY): Likewise.
+ (VERTICAL_TEXT_POSITION_CHANGED_PROPERTY): Likewise.
+ (setText): Replaced constant with real string.
+ (setIcon): Likewise.
+ (setDisabledIcon): Likewise.
+ (setDisplayedMnemonic): Likewise.
+ (setIconTextGap): Likewise.
+ (setVerticalAlignment): Likewise.
+ (setHorizontalAlignment): Likewise.
+ (setVerticalTextPosition): Likewise.
+ (setHorizontalTextPosition): Likewise.
+ (setLabelFor): Replaced constant with real string.
+ Fire property change event after property got changed.
+ * javax/swing/JList.java
+ (CELL_RENDERER_PROPERTY_CHANGED): Likewise.
+ (FIXED_CELL_HEIGHT_PROPERTY_CHANGED): Likewise.
+ (FIXED_CELL_WIDTH_PROPERTY_CHANGED): Likewise.
+ (LAYOUT_ORIENTATION_PROPERTY_CHANGED): Likewise.
+ (MODEL_PROPERTY_CHANGED): Likewise.
+ (PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED): Likewise.
+ (SELECTION_BACKGROUND_PROPERTY_CHANGED): Likewise.
+ (SELECTION_FOREGROUND_PROPERTY_CHANGED): Likewise.
+ (SELECTION_MODEL_PROPERTY_CHANGED): Likewise.
+ (setFixedCellWidth): Reimplemented.
+ (setFixedCellHeight): Exit if new value is identical.
+ Replaced constant with real string.
+ (setSelectionBackground): Likewise.
+ (setSelectionForeground): Likewise.
+ (setPrototypeCellValue): Likewise.
+ (setCellRenderer): Replaced constant with real string.
+ (setModel): Likewise.
+ (setSelectionModel): Likewise.
+ * javax/swing/JMenuBar.java
+ (BORDER_PAINTED_CHANGED_PROPERTY): Removed.
+ (MODEL_CHANGED_PROPERTY): Likewise.
+ (MARGIN_CHANGED_PROPERTY): Likewise.
+ (setBorderPainted): Reimplemented.
+ (setMargin): Likewise.
+ (setSelectionModel): Replaced constant with real string.
+ * javax/swing/JPopupMenu.java
+ (LABEL_CHANGED_PROPERTY): Removed.
+ (VISIBLE_CHANGED_PROPERTY): Likewise.
+ (borderPainted): Likewise.
+ (setLabel): Replaced constant with real string.
+ (setVisible): Exit if new value is identical.
+ Replaced constant with real string.
+ * javax/swing/JProgressBar.java
+ (BORDER_PAINTED_CHANGED_PROPERTY): Removed.
+ (ORIENTATION_CHANGED_PROPERTY): Likewise.
+ (STRING_CHANGED_PROPERTY): Likewise.
+ (STRING_PAINTED_CHANGED_PROPERTY): Likewise.
+ (INDETERMINATE_CHANGED_PROPERTY): Likewise.
+ (setOrientation): Replaced constant with real string.
+ (setStringPainted): Likewise.
+ (setString): Likewise.
+ (setBorderPainted): Likewise.
+ (setIndeterminate): Likewise.
+ * javax/swing/JScrollBar.java
+ (BLOCK_INCREMENT_CHANGED_PROPERTY): Removed.
+ (MODEL_CHANGED_PROPERTY): Likewise.
+ (ORIENTATION_CHANGED_PROPERTY): Likewise.
+ (setOrientation): Replaced constant with real string.
+ (setModel): Likewise.
+ (setUnitIncrement): Likewise.
+ (setBlockIncrement): Likewise.
+ * javax/swing/JScrollPane.java
+ (COLUMN_HEADER_CHANGED_PROPERTY): Removed.
+ (COMPONENT_ORIENTATION_CHANGED_PROPERTY): Likewise.
+ (HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY): Likewise.
+ (HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY): Likewise.
+ (LAYOUT_CHANGED_PROPERTY): Likewise.
+ (ROW_HEADER_CHANGED_PROPERTY): Likewise.
+ (VERTICAL_SCROLLBAR_CHANGED_PROPERTY): Likewise.
+ (VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY): Likewise.
+ (VIEWPORT_CHANGED_PROPERTY): Likewise.
+ (VIEWPORT_BORDER_CHANGED_PROPERTY): Likewise.
+ (WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY): Likewise.
+ (setComponentOrientation): Replaced constant with real string.
+ (setColumnHeader): Likewise.
+ (setHorizontalScrollBar): Likewise.
+ (setHorizontalScrollBarPolicy): Likewise.
+ (setRowHeader): Likewise.
+ (setVerticalScrollBar): Likewise.
+ (setVerticalScrollBarPolicy): Likewise.
+ (setWheelScrollingEnabled): Likewise.
+ (setViewport): Likewise.
+ (setViewportBorder): Likewise.
+ * javax/swing/JSlider.java
+ (INVERTED_CHANGED_PROPERTY): Removed.
+ (LABEL_TABLE_CHANGED_PROPERTY): Likewise.
+ (MAJOR_TICK_SPACING_CHANGED_PROPERTY): Likewise.
+ (MINOR_TICK_SPACING_CHANGED_PROPERTY): Likewise.
+ (MODEL_CHANGED_PROPERTY): Likewise.
+ (ORIENTATION_CHANGED_PROPERTY): Likewise.
+ (PAINT_LABELS_CHANGED_PROPERTY): Likewise.
+ (PAINT_TICKS_CHANGED_PROPERTY): Likewise.
+ (setModel): Replaced constant with real string.
+ (setOrientation): Likewise.
+ (setLabelTable): Likewise.
+ (setInverted): Likewise.
+ (setMajorTickSpacing): Likewise.
+ (setMinorTickSpacing): Likewise.
+ (setPaintTicks): Likewise.
+ (setPaintLabels): Likewise.
+ * javax/swing/JTabbedPane.java
+ (MODEL_CHANGED_PROPERTY): Removed.
+ (TAB_PLACEMENT_CHANGED_PROPERTY): Likewise.
+ (TAB_LAYOUT_POLICY_CHANGED_PROPERTY): Likewise.
+ (setModel): Replaced constant with real string.
+ (setTabPlacement): Likewise.
+ (setTabLayoutPolicy): Likewise.
+ * javax/swing/JToolBar.java
+ (ORIENTATION_CHANGED_PROPERTY): Removed.
+ (FLOATABLE_CHANGED_PROPERTY): Likewise.
+ (BORDER_PAINTED_CHANGED_PROPERTY): Likewise.
+ (MARGIN_CHANGED_PROPERTY): Likewise.
+ (ROLLOVER_CHANGED_PROPERTY): Likewise.
+ (setRollover): Replaced constant with real string.
+ (setMargin): Likewise.
+ (setBorderPainted): Likewise.
+ (setFloatable): Likewise.
+ (setOrientation): Likewise.
+ * javax/swing/plaf/basic/BasicComboBoxUI.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+ * javax/swing/plaf/basic/BasicComboPopup.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+ * javax/swing/plaf/basic/BasicMenuBarUI.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+ * javax/swing/plaf/basic/BasicProgressBarUI.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+ * javax/swing/plaf/basic/BasicScrollBarUI.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+ * javax/swing/plaf/basic/BasicSliderUI.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+ * javax/swing/plaf/basic/BasicToolBarUI.java
+ (PropertyChangeHandler.propertyChange): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultButtonModel.java
+ (changeState): Made private.
+ * javax/swing/DefaultDesktopManager.java
+ (setWasIcon): Fixed second argument to be java.lang.Boolean.
+ * javax/swing/JLayeredPane.java
+ (layerToRange): Made private.
+ (incrLayer): Likewise.
+ (decrLayer): Likewise.
+ * javax/swing/JTable.java
+ (dragEnabled): Likewise.
+ (preferredViewportSize): Renamed from preferredScrollableViewportSize.
+ * javax/swing/KeyStroke.java
+ (Keystroke): Made private.
+ * javax/swing/TransferHandler.java
+ (COMMAND_COPY): Likewise.
+ (COMMAND_CUT): Likewise.
+ (COMMAND_PASTE): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTextField.java
+ (postActionEvent): Use text in field when actionCommand is null.
+ (getActionCommand): Removed.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/AbstractSet.java: Removed.
+ * Makefile.am: Removed javax/swing/AbstractSet.java.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Window.java
+ (AccessibleWindow.getAccessibleStateSet): Fixed method name.
+ * java/awt/dnd/DnDConstants.java
+ (DnDConstants): New private constructor.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultCellRenderer.java: Removed.
+ * Makefile.am: Removed javax/swing/DefaultCellRenderer.java.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/AbstractButton.java
+ (fireItemStateChanged): Made protected.
+ (fireActionPerformed): Likewise.
+ (fireStateChanged): Likewise.
+ * javax/swing/DefaultButtonModel.java
+ (fireItemStateChanged): Likewise.
+ (fireActionPerformed): Likewise.
+ (fireStateChanged): Likewise.
+ * javax/swing/JApplet.java
+ (JApplet): Removed.
+ (frameInit): Likewise.
+ (setRootPane): Made protected.
+ (createRootPane): Likewise.
+ * javax/swing/JComponent.java
+ (getClientProperty): Likewise.
+ (putClientProperty): Likewise.
+ * javax/swing/JEditorPane.java
+ (getContentType): Likewise.
+ (setContentType): Likewise.
+ * javax/swing/JFrame.java
+ (setRootPane): Likewise.
+ (createRootPane): Likewise.
+ * javax/swing/JInternalFrame.java
+ (getFocusCycleRootAncestor): Made final. Added @since tag.
+ (isFocusCycleRoot): Likewise.
+ (getWarningString): Made final.
+ * javax/swing/JScrollBar.java
+ (changeListener): Removed.
+ (changeEvent): Likewise.
+ (createChangeListener): Likewise.
+ (fireStateChanged): Likewise.
+ (addChangeListener): Likewise.
+ (removeChangeListener): Likewise.
+ (getChangeListeners): Likewise.
+ * javax/swing/JScrollPane.java
+ (createViewport): Made protected.
+ * javax/swing/JViewport.java
+ (addImpl): Likewise.
+ (setBorder): New method.
+ * javax/swing/JWindow.java
+ (setRootPane): Made protected.
+ (createRootPane): Likewise.
+ * javax/swing/plaf/basic/BasicButtonUI.java
+ (installListeners): Likewise.
+ (uninstallListeners): Likewise.
+ * javax/swing/plaf/basic/BasicProgressBarUI.java
+ (incrementAnimationIndex): Likewise.
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java
+ (createLayoutManager): Likewise.
+ * javax/swing/table/DefaultTableCellRenderer.java
+ (firePropertyChange): Likewise.
+ * javax/swing/table/JTableHeader.java
+ (AccessibleJTableHeaderEntry.AccessibleJTableHeaderEntry):
+ New constructor.
+ * javax/swing/text/PlainDocument.java
+ (reindex): Made private.
+ * javax/swing/text/PlainView.java
+ (drawLine): Made protected.
+ (getTabSize): Likewise.
+ * javax/swing/text/View.java
+ (setSize): Removed.
+ (preferenceChanged): New method.
+ (getBreakWeight): Likewise.
+ (breakView): Likewise.
+ (getViewIndex): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JScrollPane.java
+ (ScrollBar): Made class protected.
+ * javax/swing/JSpinner.java
+ (JSpinner): Added @since tag.
+ (listenerList): Removed.
+ * javax/swing/JTable.java
+ (setValueAt): New method.
+ (getColumn): Likewise.
+ * javax/swing/JWindow.java
+ (rootPaneCheckingEnabled): Renamed from checking.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/basic/BasicTextUI.java
+ (RootView.modelToView): Made it public and return a java.awt.Shape.
+ Handle null subview.
+ (uninstall): Set textComponent to null when its not possible used
+ anymore.
+ * javax/swing/text/View.java
+ (setParent): Use better argument name.
+ (getContainer): Get parent via getParent().
+ (getViewFactory): Likewise.
+ (getAttributes): Get element via getElement().
+ (getStartOffset): Likewise.
+ (getEndOffset): Likewise.
+ (getResizeWeight): New method.
+ (getMaximumSpan): Likewise.
+ (getMinimumSpan): Likewise.
+ (setSize): Likewise.
+ (getGraphics): Likewise.
+
+2005-02-15 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/awt/Checkbox.java:
+ (AccessibleAWTCheckbox()): Added public constructor
+ to call superclass.
+ * java/awt/Choice.java:
+ (AccessibleAWTChoice): Added class documentation.
+ (AccessibleAWTChoice()): Added public constructor
+ to call superclass.
+ (AccessibleAWTChoice.getAccessibleAction()): Documented.
+ (AccessibleAWTChoice.getAccessibleRole()): Documented,
+ and changed role to COMBO_BOX.
+ (AccessibleAWTChoice.getAccessibleActionCount()): Documented.
+ (AccessibleAWTChoice.getAccessibleActionDescription(int)): Documented.
+ (AccessibleAWTChoice.doAccessibleAction(int)): Documented.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+ Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/LayoutFocusTraversalPolicy.java,
+ javax/swing/SortingFocusTraversalPolicy.java:
+ New classes.
+ * Makefile.am: Added new classes.
+ * Makefike.in: Regenerated.
+
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DebugGraphics.java: Mostly implemented.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/SwingUtilities.java
+ (findFocusOwner): New method.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/DefaultEditorKit.java
+ (read): Added '\n' after each line.
+ * javax/swing/text/PlainView.java
+ (modelToView): Update metrics.
+ (drawLine): Use offsets from element.
+ (paint): Update metrics. Draw all lines.
+
+2005-02-15 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/awt/Checkbox.java:
+ (AccessibleAWTCheckbox): Added class documentation
+ * java/awt/Scrollbar.java:
+ (AccessibleAWTScrollBar): typo corrected and docs added
+ (AccessibleAWTScrollBar.getAccessibleRole()): documented
+ (AccessibleAWTScrollBar.getAccessibleStateSet()): likewise
+ (AccessibleAWTScrollBar.getAccessibleValue()): likewise
+ (AccessibleAWTScrollBar.getCurrentAccessibleValue()): likewise
+ (AccessibleAWTScrollBar.setCurrentAccessibleValue(int)): likewise
+ (AccessibleAWTScrollBar.getMinimumAccessibleValue()): likewise
+ (AccessibleAWTScrollBar.getMaximumAccessibleValue()): likewise
+ (getAccessibleContext()): name of accessible class corrected
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * java/awt/BasicStroke.java (hashCode): Implement.
+ (equals): Document.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/print/PrinterJob.java
+ (pageDialog): Throws java.awt.HeadlessException.
+ (printDialog): Likewise.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * jni/gtk-peer/gtkpeer.h (gdk_env): Fix prototype.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTable.java
+ (getValueAt): New method.
+ * javax/swing/table/JTableHeader.java
+ (columnAtPoint): New method.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTextField.java
+ (actions): New field.
+ (static): Initalize actions field.
+ (getActions): New method.
+
+2005-02-15 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * java/awt/Checkbox.java:
+ (AccessibleAWTCheckbox): name capitalization corrected
+ and serialization UID added.
+ (AccessibleAWTCheckbox.itemStateChanged(java.awt.event.ItemEvent)):
+ documented.
+ (AccessibleAWTCheckbox.getAccessibleAction()): likewise
+ (AccessibleAWTCheckbox.getAccessibleValue()): likewise
+ (AccessibleAWTCheckbox.getAccessibleActionCount()): likewise
+ (AccessibleAWTCheckbox.getAccessibleActionDescription(int)): likewise
+ (AccessibleAWTCheckbox.doAccessibleAction(int)): likewise
+ (AccessibleAWTCheckbox.getCurrentAccessibleValue()): likewise
+ (AccessibleAWTCheckbox.setCurrentAccessibleValue(int)): likewise
+ (AccessibleAWTCheckbox.getMinimumAccessibleValue()): likewise
+ (AccessibleAWTCheckbox.getMaximumAccessibleValue()): likewise
+ (AccessibleAWTCheckbox.getAccessibleRole()): likewise
+ (AccessibleAWTCheckbox.getAccessibleStateSet()): implemented and
+ documented
+ (getAccessibleContext()): name of accessible class corrected
+
+2005-02-15 Sven de Marothy <sven@physto.se>
+
+ * java/awt/geom/doc-files/Area-1.png,
+ java/awt/geom/doc-files/Ellipse-1.png,
+ java/awt/geom/doc-files/GeneralPath-1.png:
+ New files.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c (env_union):
+ Use union to avoid type-punning warning.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultListSelectionModel.java
+ (clone): New method.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ Reported by Martin Platter <motse@complang.tuwien.ac.at>
+ * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFile):
+ Correct method signature of gtkSetFilename.
+
+2005-02-15 Arnaud Vandyck <avdyk@gnu.org>
+
+ * javax/swing/text/StringContent.java: New file.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am: Added javax/swing/text/StringContent.java.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/ClasspathToolkit.java:
+ Import statements reworked.
+ (imageCache): Made it of type java.util.HashMap.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/imageio/stream/MemoryCacheImageInputStream.java:
+ Reworked import statements.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
+ Rewrite uses of extern variable to be function calls.
+ * jni/gtk-peer/gtkpeer.h (gdk_env): Change declaration to
+ function, from extern variable.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
+ (gdk_env): Remove variable, add new function.
+ (java_vm): Add new variable.
+ (Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit): Initialize
+ java_vm rather than old gdk_env variable.
+
+2005-02-15 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/DefaultListModel.java
+ (add): fire correct event,
+ (addElement): corrected interval indices in event,
+ (clear): corrected upper bound for interval, only fire event if
+ list is not empty,
+ (setSize): fire appropriate event.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * gnu/awt/xlib/XEventLoop.java: Add non-blocking event mode.
+ * gnu/awt/xlib/XToolkit.java: Likewise.
+ * gnu/gcj/xlib/XAnyEvent.java: Likewise.
+ * gnu/gcj/xlib/natXAnyEvent.cc: Likewise.
+ * gnu/java/awt/ClasspathToolkit.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java: Likewise.
+ * java/awt/EventQueue.java (getNextEvent):
+ Adjust event loop to switch to native mode after 100ms.
+ * javax/swing/Timer.java (drainEvents): Reuse Runnable.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose):
+ Wake up event thread.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
+ (Java_gnu_java_awt_peer_gtk_GtkToolkit_iterateNativeQueue):
+ Adjust event loop to switch to java mode after 100ms.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * jni.cc (_Jv_JNI_RegisterNatives): Re-add sync, which was
+ accidentally removed in last change.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c,
+ gnu/java/awt/peer/gtk/GtkMainThread.java: Removed.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * include/jni.h (_Jv_JNIEnv::bottom_locals): New field.
+ * include/jvm.h (_Jv_FreeJNIEnv): Declare.
+ * java/lang/natThread.cc (finalize_native): Call _Jv_FreeJNIEnv.
+ * jni.cc: Reuse bottom frame between calls, avoid clearing
+ frame when no local references are made.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/UIDefaults.java (UIDefaults):
+ Fixed typo in javadoc (Thanks to Thomas Zander for reporting)
+ Fixed HTML entity and removed a redundant comma.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/DefaultEditorKit.java
+ (deinstall): Removed.
+ (install): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/UIDefaults.java (put): Handle value of null.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Robot.java,
+ java/awt/Scrollbar.java,
+ java/awt/print/PrinterJob.java,
+ javax/swing/JTable.java,
+ javax/swing/text/AbstractDocument.java:
+ Reworked import statements.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JEditorPane.java
+ (read): Implemented.
+ (write): Likewise.
+ * javax/swing/text/DefaultEditorKit.java
+ (page): Renamed from page_url. Made private.
+ (editorKit): Renamed from kit. Made private.
+ (ctype): Removed.
+ (JEditorPane): All constructors reimplemented.
+ (getContentType): Use content type from editor kit.
+ (getEditorKit): Return editorKit.
+ (getEditorKitForContentType):Likewise.
+ (getPage): Return page.
+ (setContentType): Reimplemented.
+ (setEditorKit): Likewise.
+ (setEditorKitForContentType): Removed wrong implementation.
+ (setPage): Implemented.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
+ (nativeSetIconImageFromData): Re-add native implementation.
+
+2005-02-15 David Gilbert <david.gilbert@object-refinery.com>
+
+ * javax/swing/table/DefaultTableModel.java
+ (DefaultTableModel()): Added Javadocs.
+ (DefaultTableModel(int, int)): Fixed implementation.
+ (DefaultTableModel(Vector, int)): Throw IllegalArgumentException
+ for negative rowCount.
+ (DefaultTableModel(Object[], int)): Added Javadocs.
+ (DefaultTableModel(Vector, Vector)): Likewise.
+ (DefaultTableModel(Object[][], Object[])): Likewise.
+ (getDataVector): Likewise.
+ (setDataVector(Vector, Vector)): Likewise.
+ (setDataVector(Object[][], Object[])): Likewise.
+ (newDataAvailable): Likewise.
+ (newRowsAdded): Likewise.
+ (rowsRemoved): Likewise.
+ (setColumnIdentifiers(Vector)): Allow for null argument.
+ (setColumnIdentifiers(Object[])): Added Javadocs.
+ (setNumRows): Likewise.
+ (setRowCount): Adds new rows if necessary, and sends more specific
+ TableModelEvent.
+ (setColumnCount): Allow for null columnIdentifiers.
+ (addColumn(Object)): Added Javadocs.
+ (addColumn(Object, Vector)): Handle null columnData.
+ (addColumn(Object, Object[])): Handle columnData with more or less
+ entries than rows in the table.
+ (addRow(Vector)): Fire appropriate event.
+ (addRow(Object[])): Added Javadocs.
+ (insertRow(int, Vector)): Fire appropriate event.
+ (insertRow(int, Object[])): Added Javadocs.
+ (moveRow): Reimplemented.
+ (removeRow(int)): Fire appropriate event.
+ (getColumnCount): Allow for null columnIdentifiers.
+ (getColumnName): Now returns empty string when column index is too
+ large.
+ (isCellEditable): Added Javadocs.
+ (getValueAt): Likewise.
+ (setValueAt): Fire more specific event.
+ (convertToVector): Added Javadocs.
+ * javax/swing/table/TableModel.java
+ Added Javadocs.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * libgcj.spec.in (lib): Add -l-javax-imageio.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Replace direct
+ references to event queue q with method call q().
+ * gnu/java/awt/peer/gtk/GtkDialogPeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkFramePeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkGenericPeer.java: Likewise.
+ (q): New method.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * gnu/java/awt/ClasspathToolkit.java
+ (registerImageIOSpis): New method.
+ * gnu/java/awt/image/ImageDecoder.java
+ (imageDecoder): New constructor using InputStream
+ (startProduction): Handle existing InputStream.
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java
+ (findSimpleIntegerArray): Make public and static.
+ (updateBufferedImage): Set each pixel, in a loop.
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
+ Implement ImageIO SPI classes.
+ (createBufferedImage): Rewrite in terms of SPI classes.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (registerImageIOSpis): New method.
+ * java/lang/reflect/natMethod.cc
+ (_Jv_CallAnyMethodA): Borrow a patch from aph, applied to trunk,
+ which lets JNI call interface methods properly.
+ * javax/imageio/ImageIO.java
+ (WriterFormatFilter.filter): Fix copy-and-paste typos.
+ (WriterMIMETypeFilter.filter): Likewise.
+ (ImageReaderIterator): Pass extension argument through to SPI.
+ (getReadersByFilter): Likewise.
+ (getWritersByFilter): Likewise.
+ (getImageReadersByFormatName): Likewise.
+ (getImageReadersByMIMEType): Likewise.
+ (getImageReadersBySuffix): Likewise.
+ (getImageWritersByFormatName): Likewise.
+ (getImageWritersByMIMEType): Likewise.
+ (getImageWritersBySuffix): Likewise.
+ (read): Implement.
+ (write): Implement.
+ * javax/imageio/ImageReader.java
+ (progressListeners): Initialize.
+ (setInput): Implement.
+ * javax/imageio/ImageWriter.java
+ (progressListeners): Initialize.
+ (warningListeners): Likewise.
+ (warningLocales): Likewise.
+ (setOutput): Test "isInstance" rather than class equality.
+ * javax/imageio/spi/IIORegistry.java
+ (static): Add reader and writer SPIs.
+ (IIORegistry): Call ClasspathToolkit.registerImageIOSpis.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+ (query_formats): New function.
+ (save_to_stream): Likewise.
+ (Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_streamImage): Likewise.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c (mouseWheel):
+ Call XFlush.
+ (keyPress): Likewise.
+ (keyRelease): Likewise.
+
+2005-02-15 Olga Rodimina <rodimina@redhat.com>
+
+ * javax/swing/JTable.java
+ (columnAtPoint): New Method. Implemented.
+ (rowAtPoint): Likewise.
+ (countSelections): Fixed few small count errors.
+ (getSelections): Likewise.
+ (setSelectionMode): Set selection mode for column
+ selection model in addition to row selection model.
+ * javax/swing/plaf/basic/BasicTableUI.java:
+ (getRowForPoint): Removed. Replaced by
+ JTable.rowAtPoint().
+ (getColForPoint): Removed. Replaced by
+ JTable.columnAtPoint().
+ (updateSelection): Updated to call JTable.columnAtPoint
+ and JTable.rowAtPoint.
+ * javax/swing/table/DefaultTableColumnModel.java:
+ (getSelectedColumns): Implemented.
+ (getSelectedColumnCount): Implemented.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * Makefile.am
+ (jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c)
+ (gnu/java/awt/peer/gtk/GtkMainThread.java) : Remove.
+ * Makefile.in: Regenerate.
+ * gnu/awt/xlib/XEventLoop.java: Fix to match thread model.
+ * gnu/awt/xlib/XFramePeer.java: Likewise.
+ * gnu/awt/xlib/XToolkit.java: Likewise.
+ * gnu/gcj/xlib/XAnyEvent.java: Likewise.
+ * gnu/gcj/xlib/natXAnyEvent.cc: Likewise.
+ * gnu/java/awt/ClasspathToolkit.java
+ (nativeQueueEmpty)
+ (wakeNativeQueue)
+ (iterateNativeQueue): New methods.
+ * gnu/java/awt/peer/gtk/GtkMainThread.java: Remove.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java
+ (gtkInit): Absorb from defunct GtkMainThread class.
+ (static): Run gtkInit in static startup block.
+ (GtkToolkit): Remove construction of GtkMainThread and queue.
+ (getSystemEventQueueImpl): Construct queue when requested.
+ (nativeQueueEmpty)
+ (wakeNativeQueue)
+ (iterateNativeQueue): New methods.
+ * java/awt/Component.java (removeNotify): Remove race.
+ * java/awt/EventDispatchThread.java
+ (EventDispatchThread): Don't start on construction.
+ (run): Remove isInterrupted check.
+ * java/awt/EventQueue.java (shutdown): New flag.
+ (isShutdown): New method checking J2SE shutdown condition.
+ (setShutdown): New method.
+ (getNextEvent): Restructure to use ClasspathToolkit.
+ (postEvent): Activate new thread on posting, wake thread on
+ post of possible shutdown condition event.
+ * java/awt/Frame.java
+ (Frame): Call noteFrame in all constructors.
+ (fireDummyEvent): New helper method.
+ (addNotify): Fire a dummy event to wake up queue.
+ (removeNotify): Fire a dummy event to wake up queue.
+ (noteFrame): New method.
+ (weakFrames): New static field.
+ (getFrames): Implement.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c:
+ Remove.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c:
+ Move everything from GtkMainThread into this file
+ (Java_gnu_java_awt_peer_gtk_GtkToolkit_iterateNativeQueue)
+ (Java_gnu_java_awt_peer_gtk_GtkToolkit_wakeNativeQueue)
+ (Java_gnu_java_awt_peer_gtk_GtkToolkit_nativeQueueEmpty):
+ New functions to implement single-threaded queue semantics.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/metal/MetalLookAndFeel.java
+ (getControlTextFont): New method.
+ (getMenuTextFont): Likewise.
+ (getSubTextFont): Likewise.
+ (getSystemTextFont): Likewise.
+ (getUserTextFont): Likewise.
+ (getWindowTitleFont): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/AbstractDocument.java
+ (documentFilter): New field.
+ (getDocumentFilter): New method.
+ (setDocumentFilter): Likewise.
+ (dump): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTree.java
+ (DynamicUtilTreeNode.hasChildren): Clarify javadoc.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/AbstractDocument.java
+ (AbstractElement.getLength): Fixed off-by-one error.
+ (AbstractElement.children): Made abstract.
+ (AbstractElement.getAllowsChildren): Likewise.
+ (AbstractElement.getElement): Likewise.
+ (AbstractElement.dumpElement): New private method.
+ (AbstractElement.dump): New method.
+ (BranchElememt.getName): Fixed implementation.
+ (BranchElememt.toString): Likewise.
+ (BranchElememt.getElement): Fixed arguments.
+ (LeafElement.getName): Fixed implementation.
+ (LeafElement.toString): Likewise.
+ * javax/swing/text/GapContent.java
+ (GapContent): Put default content into buffer.
+ * javax/swing/text/PlainDocument.java
+ (reindex): Use empty attribute sets instead of null.
+ (createDefaultRoot): Reimplemented.
+ (insertUpdate): Call super method.
+ (removeUpdate): Likewise.
+ (getParagraphElement): Implemented.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/ClasspathToolkit.java
+ (createRobot): Throws java.awt.AWTException.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c:
+ Added '__attribute__((unused))' to all unused method arguments.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultBoundedRangeModel.java
+ (fireValueChanged): Fixed off-by-one error.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * Makefile.am (gtk_c_source_files): Add GdkRobotPeer.c.
+ (gtk_awt_peer_sources): Add GdkScreenGraphicsDevice.java and
+ GdkRobotPeer.java.
+ (lib_gnu_java_awt_peer_gtk_la_CFLAGS): Add X flags.
+ (lib_gnu_java_awt_peer_gtk_la_LDFLAGS): Add XTest flags.
+ * gnu/awt/xlib/XToolkit.java (createRobot): New method.
+ * gnu/java/awt/ClasspathToolkit.java (createRobot): New method.
+ * gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
+ (getDefaultScreenDevice): Implement.
+ * gnu/java/awt/peer/gtk/GdkRobotPeer.java: New file.
+ * gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java: Likewise.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java (createRobot): New method.
+ * java/awt/Robot.java: Implement.
+ * java/awt/peer/RobotPeer.java: Rename parameters.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c: New file.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (awt_keycode_to_keysym): Make non-static.
+ * jni/gtk-peer/gtkpeer.h (AWT_BUTTON1_MASK, AWT_BUTTON2_MASK,
+ AWT_BUTTON3_MASK): Declare constants.
+ (awt_keycode_to_keysym): Declare.
+
+ * Makefile.am (AM_MAKEFLAGS): Set KEYS variable.
+ * testsuite/libjava.mauve/mauve.exp (test_mauve): If KEYS exists
+ and is non-empty pass its value to "make check".
+ (test_mauve_sim): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/imageio/IIOParam.java
+ (setSourceBands): New method.
+ (setSourceSubsampling): Likewise.
+ * javax/imageio/ImageReadParam.java
+ (setDestination): Likewise.
+ (setDestinationBands): Likewise.
+ (setSourceProgressivePasses): Likewise.
+ * javax/imageio/metadata/IIOInvalidTreeException.java
+ (serialVersionUID): New static field.
+ * javax/imageio/metadata/IIOMetadataNode.java
+ (IIOMetadataNode): Don't explicitely implement org.w3c.dom.Node.
+ (parent): Dont initailize with default value explicitely.
+ (Object): Likewise.
+ (removeAttribute): Doesn't throws org.w3c.dom.DOMException.
+ (removeAttributeNode): Likewise.
+ (removeAttributeNS): Likewise.
+ (setAttribute): Likewise.
+ (setAttributeNode): Likewise.
+ (setAttributeNodeNS): Likewise.
+ (setAttributeNS): Likewise.
+ (appendChild): Likewise.
+ (getNodeValue): Likewise.
+ (insertBefore): Likewise.
+ (removeChild): Likewise.
+ (replaceChild): Likewise.
+ (setPrefix): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/LookAndFeel.java
+ (getDesktopPropertyValue): New method.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTree.java
+ (hasChildren): New instance field.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JComponent.java
+ (getToolTipText): New method.
+ (getTitledBorderText): Likewise.
+ (getAccessibleKeyBinding): Likewise.
+ (getVerifyInputWhenFocusTarget): Likewise.
+ (setVerifyInputWhenFocusTarget): Likewise.
+ (verifyInputWhenFocusTarget): New instance field.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultListSelectionModel.java
+ (fireValueChanged): New method.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultBoundedRangeModel.java:
+ Fixed javadocs all over.
+ (fireStateChanged): Simplified.
+ * javax/swing/BoundedRangeModel.java:
+ Reformatted.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JRootPane.java
+ (setMenuBar): Added @deprecated tag.
+ (getMenuBar): Likewise.
+ * javax/swing/JTable.java
+ (sizeColumnsToFit): Likewise.
+
+2005-02-15 Paul Jenner <psj.home@ntlworld.com>
+
+ * javax/swing/ImageIcon.java (setImage): Implemented.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTable.java:
+ Removed unused imports.
+
+2005-02-15 Olga Rodimina <rodimina@redhat.com>
+
+ (prepareRenderer): Get column's index in dataModel instead
+ of column's view index.
+ (getColumnCount): return count of the columns in ColumnModel,
+ not in dataModel.
+ (removeColumn): Implemented.
+ (moveColumm): Likewise.
+ (setRowHeight): throw IllegalArgumentException if height is
+ less then 1.
+ * javax/swing/table/DefaultTableColumnModel.java: Add javadocs.
+ (DefaultTableColumnModel):Add call to createSelectionModel().
+ (addColumn): Fire columnAdded event to registered listeners.
+ (removeColumn): Fire columnRemoved event to registered listeners.
+ (moveColumn): Fire columnMoved event to registered listeners.
+ (setColumnMargin): Fire ColumnMarginChanged event to registered listeners.
+ (getColumnIndex): Changed parameter name.
+ (setColumnSelectionAllowed): Likewise.
+ (fireColumnAdded): Implemented.
+ (fireColumnRemoved): Likewise.
+ (fireColumnMoved): Likewise.
+ (fireColumnMarginChanged): Likewise.
+ (getListeners): Changed parameter name.
+ (propertyChange): Implemented.
+ (valueChanged): Changed parameter name.
+ (createSelectionModel): Implemented.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GtkToolkit.java:
+ Explicitely import used classes.
+ (getLocalGraphicsEnvironment): Simplify.
+ * java/awt/Window.java (Window):
+ Enable code to get the default GraphicsConfiguration.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/metal/DefaultMetalTheme.java
+ (CONTROL_TEXT_FONT): New static field.
+ (MENU_TEXT_FONT): Likewise.
+ (SUB_TEXT_FONT): Likewise.
+ (SYSTEM_TEXT_FONT): Likewise.
+ (USER_TEXT_FONT): Likewise.
+ (WINDOW_TITLE_FONT): Likewise.
+ (getControlTextFont): New method.
+ (getMenuTextFont): Likewise.
+ (getSubTextFont): Likewise.
+ (getSystemTextFont): Likewise.
+ (getUserTextFont): Likewise.
+ (getWindowTitleFont): Likewise.
+ * javax/swing/plaf/metal/MetalTheme.java
+ (BLACK): Initialize with Color.BLACK.
+ (WHITE): Initialize with Color.WHITE.
+ (getInactiveControlTextColor): Return getControlDisabled().
+ (getMenuDisabledForeground): Return getSecondary3().
+ (getControlTextFont): New abstract method.
+ (getMenuTextFont): Likewise.
+ (getSubTextFont): Likewise.
+ (getSystemTextFont): Likewise.
+ (getUserTextFont): Likewise.
+ (getWindowTitleFont): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JFormattedTextField.java
+ (getFocusLostBehavior): Fixed typo in method name.
+ (setFocusLostBehavior): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/TransferHandler.java:
+ Reworked import statements.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/awt/Button.java,
+ java/awt/Canvas.java,
+ java/awt/Checkbox.java,
+ java/awt/CheckboxMenuItem.java,
+ java/awt/Choice.java,
+ java/awt/Dialog.java,
+ java/awt/Frame.java,
+ java/awt/Label.java,
+ java/awt/List.java,
+ java/awt/Menu.java,
+ java/awt/MenuBar.java,
+ java/awt/MenuItem.java,
+ java/awt/PopupMenu.java,
+ java/awt/ScrollPane.java,
+ java/awt/Scrollbar.java,
+ java/awt/TextArea.java,
+ java/awt/Window.java (getAccessibleContext): Clean up comments.
+ Reformat.
+ * java/awt/Button.java,
+ java/awt/Checkbox.java,
+ java/awt/Choice.java,
+ java/awt/Menu.java,
+ java/awt/PopupMenu.java,
+ java/awt/TextArea.java (getAccessibleContext): Only create new
+ accessible once.
+ * java/awt/TextComponent.java (getAccessibleContext): Implement.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Button.java,
+ javax/swing/JApplet.java,
+ javax/swing/JFormattedTextField.java,
+ javax/swing/JWindow.java,
+ javax/swing/JTree.java,
+ javax/swing/plaf/basic/BasicEditorPaneUI.java,
+ javax/swing/plaf/basic/BasicTextPaneUI.java,
+ javax/swing/plaf/basic/BasicTreeUI.java:
+ Reworked import statements.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am: Put javax.imageio into its own library and link it
+ against lib-org-w3c-dom.la to fix bootstrapping.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/TextAction.java
+ (getTextComponent): Simplified. Added Javadoc.
+ (augmentList): Implemented. Added Javadoc.
+ (getFocusedComponent): Added javadoc.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/awt/Scrollbar.java (AccessibleAWTScrollbar,
+ getAccessibleContext): Implement.
+ * java/awt/ScrollPane.java (AccessibleAWTScrollPane,
+ getAccessibleContext): Implement.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/awt/Dialog.java (AccessibleAWTFrame, getAccessibleContext):
+ Implement.
+ * java/awt/Frame.java (AccessibleAWTFrame, getAccessibleContext):
+ Implement.
+ * java/awt/Window.java (getAccessibleContext): Fix comment.
+ Remove extra import.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/awt/Window.java (AccessibleAWTWindow): Implement.
+ (isActive, isFocused, getAccessibleContext): Implement.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/awt/MenuItem.java (getAccessibleContext): Implement.
+ * java/awt/MenuComponent.java (accessibleContext): Make package
+ visible.
+ * java/awt/CheckboxMenuItem.java (getAccessibleContext,
+ AccessibleAWTCheckboxMenuItem): Implement.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/awt/List.java: Implement AccessibleAWTList,
+ AccessibleAWTListChild.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/awt/Choice.java: Add implements declaration for
+ Accessible.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * javax/imageio/metadata/IIOInvalidTreeException.java: Use Node
+ instead of Object.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * javax/imageio/metadata/IIOMetadataNode.java: Add Node to
+ implemented interface list.
+
+2005-02-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * javax/imageio/metadata/IIOMetadataNode.java: Implement.
+ * javax/imageio/metadata/IIOAttr.java: New class.
+ * javax/imageio/metadata/IIONamedNodeMap.java: New class.
+ * javax/imageio/metadata/IIONodeList.java: New class.
+ * Makefile.am: Added new files.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/AbstractAction.java,
+ javax/swing/AbstractCellEditor.java,
+ javax/swing/AbstractListModel.java,
+ javax/swing/DefaultBoundedRangeModel.java,
+ javax/swing/DefaultButtonModel.java,
+ javax/swing/DefaultCellEditor.java,
+ javax/swing/DefaultComboBoxModel.java,
+ javax/swing/DefaultDesktopManager.java,
+ javax/swing/JMenu.java,
+ javax/swing/JSlider.java,
+ javax/swing/KeyStroke.java,
+ javax/swing/OverlayLayout.java,
+ javax/swing/ScrollPaneLayout.java,
+ javax/swing/SizeRequirements.java,
+ javax/swing/ViewportLayout.java:
+ Made serialVersionUID private.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java:
+ Reformatted.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java: More reformatting.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java: Reformatted.
+
+2005-02-15 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/awt/EventDispatchThread.java,
+ java/awt/Toolkit.java:
+ Don't catch java.lang.ThreadDeath.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/PasswordView.java
+ (drawEchoCharacter): Added javadoc.
+ (drawSelectedText): Likewise.
+ (drawUnselectedText): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JRootPane.java
+ (windowDecorationStyle): New field.
+ (setMenuBar): New method.
+ (getMenuBar): Likewise.
+ (getWindowDecorationStyle): Likewise.
+ (setWindowDecorationStyle): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultListSelectionModel.java
+ (leadAnchorNotificationEnabled): Made protected.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/InternalFrameFocusTraversalPolicy.java: New file.
+ * Makefile.am: Added InternalFrameFocusTraversalPolicy.java.
+ * Makefile.in: Regenerated.
+
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JFormattedTextField.java: Implemented.
+ * javax/swing/JWindow.java
+ (JWindow): New constructors.
+ (initWindow): Renamed from initFrame.
+ * javax/swing/UIDefaults.java
+ (ActiveValue): Made interface static.
+ (LazyValue): Likewise.
+ * javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+ (TitlePaneLayout.TitlePaneLayout): New constructor.
+ * javax/swing/plaf/basic/BasicSliderUI.java
+ (ChangeHandler): Made public.
+ (FocusHandler): Likewise.
+ (PropertyChangeHandler): Likewise.
+ (ScrollListener): Likewise.
+ * javax/swing/plaf/basic/BasicTabbedPaneUI.java
+ (FocusHandler): Likewise.
+ (MouseHandler): Likewise.
+ * javax/swing/plaf/basic/BasicTextPaneUI.java
+ (BasicTextPaneUI): Extend BasicEditorPaneUI.
+ * javax/swing/plaf/basic/BasicToolBarUI.java
+ (BasicToolBarUI): Simplified. Reworked javadoc.
+ (canDock): Simplified. Make public.
+ (DockingListener): Made public.
+ * javax/swing/text/JTextComponent.java
+ (navigationFilter): New field.
+ (getNavigationFilter): New method.
+ (setNavigationFilter): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/metal/MetalTheme.java
+ (getControlTextColor): Return getControlInfo().
+ (getHighlightedTextColor): Return getControlTextColor().
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/basic/BasicButtonListener.java
+ (BasicButtonListener): New constructor.
+ * javax/swing/plaf/basic/BasicButtonUI.java
+ (createButtonListener): Usw new BasicButtonListener constructor.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/imageio/event/package.html,
+ javax/imageio/metadata/package.html: New files.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/image/MemoryImageSource.java: Reformatted.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/tree/TreeCellEditor.java: Refomatted.
+
+2005-02-15 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/awt/color/ICC_Profile.java
+ (finalize): Removed pointless field assignments.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/basic/BasicEditorPaneUI.java: New file.
+ * Makefile.am: Added javax/swing/plaf/basic/BasicEditorPaneUI.java.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/DefaultStyledDocument.java: New file.
+ * Makefile.am: Added javax/swing/text/DefaultStyledDocument.java.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JFileChooser.java
+ (showDialog): Return CANCEL_OPTION for now.
+ (showOpenDialog): Likewise.
+ (showSaveDialog): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JApplet.java
+ (HIDE_ON_CLOSE): Removed.
+ (EXIT_ON_CLOSE): Likewise.
+ (DISPOSE_ON_CLOSE): Likewise.
+ (DO_NOTHING_ON_CLOSE): Likewise.
+ (close_action): Likewise.
+ (getDefaultCloseOperation): Likewise.
+ (setDefaultCloseOperation): Likewise.
+ (processWindowEvent): Likewise.
+ (getPreferredSize): Simplified.
+ * javax/swing/JInternalFrame.java
+ (setDefaultCloseOperation): Fixed throwing exception on wrong argument
+ value.
+ * javax/swing/JWindow.java
+ (HIDE_ON_CLOSE): Removed.
+ (EXIT_ON_CLOSE): Likewise.
+ (DISPOSE_ON_CLOSE): Likewise.
+ (DO_NOTHING_ON_CLOSE): Likewise.
+ (close_action): Likewise.
+ (processKeyEvent): Likewise.
+ (setDefaultCloseOperation): Likewise.
+ (getPreferredSize): Simplified.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTextField.java
+ (getPreferredSize): Re-implemented.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JLabel.java
+ (setDisplayedMnemonic): Use only upper case characters.
+ (setDisplayedMnemonicIndex): Handle index == -1 and fire
+ PropertyChangeEvent after property got set to the new index.
+
+2005-02-15 Robert Schuster <thebohemian@gmx.net>
+
+ * javax/swing/JComboBox.java:
+ (JComboBox): Removed selection of the
+ first item in the model.
+
+2005-02-15 Robert Schuster <thebohemian@gmx.net>
+
+ * javax/swing/JComboBox.java
+ added support for no item being selected
+ (JComboBox): select first or nothing depending on element count
+ (setModel): cleaned up unneeded "this." usage, added more
+ docs, made exception behavior match that of the JDK
+ (setLighWeightPopupEnabled): removed unneeded "this." usage
+ (setEditable): dito
+ (setMaximumRowCount): dito
+ (setRenderer): dito
+ (setPrototypeDisplayValue): dito
+ (getSelectedItem): simplified, added more user doc
+ (setSelectedIndex): corrected exception behavior, added more user doc
+ (getSelectedIndex): fixed hardcoded dependency on DefaultComboBoxModel,
+ added performance warning to user doc
+ (addItem): fixed exception behavior, added user doc
+ (insertItemAt): dito
+ (removeItem): dito
+ (removeItemAt): dito
+ (removeAll): fixed exception behavior, added user doc, added support
+ for model not being instance of DefaultComboBoxModel
+ (getSelectedItemObjects): simplified
+ (getItemCount): fixed dependency on DefaultComboBoxModel
+ (getItemAt): fixed dependency on MutableComboBoxModel
+ * javax/swing/DefaultComboBoxModel.java:
+ (setSelectedItem): updates selected item only if new
+ value is null or known (match JDK behavior)
+ * javax/swing/plaf/basic/BasicComboBoxUI.java:
+ (paintCurrentValue): renders "" if no item is selected
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/plaf/metal/MetalTheme.java,
+ javax/swing/plaf/metal/DefaultMetalTheme.java:
+ New files.
+ * javax/swing/plaf/metal/MetalLookAndFeel.java
+ * Makefile.am: Added the new files.
+ * Makefile.in: Regenerated.
+
+2005-02-15 Olga Rodimina <rodimina@redhat.com>
+
+ * javax/swing/JTable.java
+ (editorComp): New field.
+ (JTable): Initialize local variables and call updateUI
+ (selectionBackground): Make protected.
+ (selectionForeground): Likewise.
+ (initializeLocalVars): Create default editors and renderers,
+ initialize editingColumn, editingRow variables.
+ (createDefaultEditors): New Method.
+ (createDefaultRenderers): Likewise.
+ (createDefaultListSelectionModel): Removed
+ (createDefaultSelectionModel): New Method.
+ (createDefaultTableHeader): Likewise
+ (removeColumn): Likewise.
+ (getEditingColumn): Likewise.
+ (setEditingColumn): Likewise.
+ (getEditingRow): Likewise.
+ (setEditingRow): Likewise.
+ (getEditorComponent): Likewise.
+ (isEditing): Likewise.
+ (setDefaultEditor): Likewise.
+ (addColumnSelectionInterval): Likewise.
+ (addRowSelectionInterval): Likewise.
+ (setColumnSelectionInterval): Likewise.
+ (setRowSelectionInterval): Likewise.
+ (removeColumnSelectionInterval): Likewise.
+ (removeRowSelectionInterval): Likewise.
+ (isColumnSelected): Likewise.
+ (isRowSelected): Likewise.
+ (isCellSelected): Likewise.
+ (selectAll): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTable.java
+ (addColumn): New method.
+ (getColumnClass): Likewise.
+ (getColumnName): Likewise.
+
+2005-02-15 Paul Jenner <psj.home@ntlworld.com>
+
+ * javax/swing/TransferHandler.java
+ (createTransferable): Made protected.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTable.java,
+ javax/swing/plaf/basic/BasicTableHeaderUI.java,
+ javax/swing/plaf/basic/BasicTableUI.java:
+ Use fixed get/setIntercellSpacing() methods.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTable.java
+ (getIntercellSpacing): Fixed typo in method name.
+ (setIntercellSpacing): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/text/JTextComponent.java
+ (focusAccelerator): New variable.
+ (getFocusAccelerator): New method.
+ (setFocusAccelerator): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JComponent.java
+ (setTransferHandler): Made public. Fire property change event.
+ * javax/swing/TransferHandler.java: Implemented.
+ * javax/swing/text/JTextComponent.java
+ (DefaultTransferHandler): New inner class.
+ (defaultTransferHandler): New variable.
+ (copy): New method.
+ (cut): Likewise.
+ (paste): Likewise.
+ (doTransferAction): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTree.java
+ (collapsePath): New method.
+ (collapseRow): Likewise.
+ (expandPath): Likewise.
+ (expandRow): Likewise.
+ (checkExpandParents): Likewise.
+ (doExpandParents): Likewise.
+ (setExpandedState): Likewise.
+ (makeVisible): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JPasswordField.java: Updated javadocs.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JLayeredPane.java
+ (getLayer): Fixed return type, made public.
+ (getPosition): Use new getLayer().
+ (SetPosition): Likewise.
+ (getIndexOf): Likewise.
+ (remove): Likewise.
+ * javax/swing/JInternalFrame.java
+ (getLayer): Use new JLayeredPane.getLayer().
+
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/table/TableColumn.java: Added/fixed javadocs over all.
+ (setHeaderValue): Simplified. Do nothing when old value == new value.
+
+2005-02-15 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics.java (setClip): Protect
+ against null clip region.
+ * gnu/java/awt/peer/gtk/GtkFramePeer.java (create): Call
+ gtkWindowSetResizable.
+ (postConfigureEvent): Only revalidate if frame size has changed.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java (postConfigureEvent):
+ Only revalidate if frame size has changed.
+ * java/awt/Component.java (reshape): Only repaint and post
+ component events if component is showing.
+ * java/awt/Container.java (addImpl): Only post container event if
+ container is showing.
+ (remove): Likewise.
+ * java/awt/Window.java (setLocationRelativeTo): Implement.
+ (setBoundsCallback): Only post component events if component is
+ showing.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c (clearRect):
+ Protect against null graphics structure. Flush gdk event queue.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/imageio/ImageReader.java,
+ javax/imageio/ImageTranscoder.java,
+ javax/imageio/ImageWriter.java,
+ javax/imageio/spi/ImageInputStreamSpi.java,
+ javax/imageio/spi/ImageOutputStreamSpi.java,
+ javax/imageio/spi/ServiceRegistry.java,
+ javax/imageio/stream/ImageInputStream.java,
+ javax/imageio/stream/ImageOutputStream.java: Updated.
+ * javax/imageio/IIOException.java,
+ javax/imageio/IIOImage.java,
+ javax/imageio/IIOParam.java,
+ javax/imageio/IIOParamController.java,
+ javax/imageio/ImageIO.java,
+ javax/imageio/ImageReadParam.java,
+ javax/imageio/ImageTypeSpecifier.java,
+ javax/imageio/ImageWriteParam.java,
+ javax/imageio/spi/IIORegistry.java,
+ javax/imageio/spi/ImageReaderSpi.java,
+ javax/imageio/spi/ImageWriterSpi.java,
+ javax/imageio/stream/FileCacheImageInputStream.java,
+ javax/imageio/stream/FileCacheImageOutputStream.java,
+ javax/imageio/stream/FileImageInputStream.java,
+ javax/imageio/stream/FileImageOutputStream.java,
+ javax/imageio/stream/ImageInputStreamImpl.java,
+ javax/imageio/stream/ImageOutputStreamImpl.java,
+ javax/imageio/stream/MemoryCacheImageInputStream.java,
+ javax/imageio/stream/MemoryCacheImageOutputStream.java,
+ javax/imageio/event/IIOReadProgressListener.java,
+ javax/imageio/event/IIOReadUpdateListener.java,
+ javax/imageio/event/IIOReadWarningListener.java,
+ javax/imageio/event/IIOWriteProgressListener.java,
+ javax/imageio/event/IIOWriteWarningListener.java,
+ javax/imageio/metadata/IIOMetadata.java,
+ javax/imageio/metadata/IIOMetadataController.java,
+ javax/imageio/metadata/IIOMetadataFormat.java,
+ javax/imageio/metadata/IIOInvalidTreeException.java,
+ javax/imageio/metadata/IIOMetadataFormatImpl.java,
+ javax/imageio/metadata/IIOMetadataNode.java: New files.
+ * Makefile.am (javax_source_files): Added new files
+ * Makefile.in: Regenerated.
+
+2005-02-15 Graydon Hoare <graydon@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java:
+ Rework painting into BufferedImages
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:
+ Construct BufferedImage with alpha only when alpha is
+ present in colormodel.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:
+ Rework painting into client-side jint arrays.
+ * jni/gtk-peer/gtkcairopeer.h:
+ Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/DefaultListCellRenderer.java
+ (serialVersionUID): Made private.
+ (getListCellRendererComponent): Set horizontal alignment.
+ * javax/swing/JLabel.java
+ (setVerticalAlignment): Re-implemented.
+ (setHorizontalAlignment): Do nothing if old value = new value.
+ * javax/swing/JList.java
+ (setCellRenderer): Likewise.
+ (setModel): Re-implemented.
+ (setSelectionModel): Likewise.
+
+2005-02-15 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/awt/Component.java,
+ java/awt/geom/Rectangle2D.java:
+ Javadoc fixes.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/AbstractListModel.java
+ (fireContentsChanged): Simplified.
+ (fireIntervalAdded): Likewise.
+ (fireIntervalRemoved): Likewise.
+ * javax/swing/DefaultSingleSelectionModel.java:
+ Reformatted.
+ (fireStateChanged): Simplified.
+ * javax/swing/JPopupMenu.java
+ (setSelectionModel): Set property.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/print/Book.java: Reformatted.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/geom/Area.java
+ (QuadSegment.curveArea): Remove unused variables.
+ (CubicSegment.curveArea): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JTree.java
+ (ANCHOR_SELECTION_PATH_PROPERTY): Added @since tag.
+ (LEAD_SELECTION_PATH_PROPERTY): Likewise.
+ (EXPANDS_SELECTED_PATHS_PROPERTY): Likewise.
+ (EXPANDED): New constant.
+ (COLLAPSED): Likewise.
+ (nodeStates): New field.
+ (cellEditor): New method.
+ (cellRenderer): Likewise.
+ (selectionModel): Likewise.
+ (treeModel): Likewise.
+ (scrollPathToVisible): Likewise.
+ (scrollRowToVisible): Likewise.
+ (isCollapsed): Likewise.
+ (isExpanded): Likewise.
+ (clearToggledPaths): Likewise.
+ (getDescendantToggledPaths): Likewise.
+ (hasBeenExpanded): Likewise.
+ (isVisible): Likewise.
+ (isPathEditable): Likewise.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JLayeredPane.java: Reformatted.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/tree/DefaultMutableTreeNode.java:
+ Completely Revised.
+ * javax/swing/tree/MutableTreeNode.java:
+ Reformatted.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JFormattedTextField.java
+ (setDocument): Call setDocument of super class. Don't fire property
+ change event.
+
+2005-02-15 Sven de Marothy <sven@physto.se>
+
+ * java/awt/image/IndexColorModel.java:
+ Add FIXME with respect to alpha handling.
+ (getAlpha): Default to returning opaque pixels.
+ * java/awt/image/MultiPixelPackedSampleModel.java
+ (MultiPixelPackedSampleModel): Corrected parameters, order of
+ bit shifts and masks, stride length off by one.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/JList.java, javax/swing/JTree.java:
+ Added much new methods and fixed much methods setting bound properties.
+
+2005-02-16 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (gnu_xml_source_files): Removed
+ gnu/xml/dom/DomCDATA.java, gnu/xml/dom/DomEx.java,
+ gnu/xml/dom/DomFragment.java, gnu/xml/dom/DomPI.java and
+ gnu/xml/dom/ls/DomLSEx.java. Replaced by adding
+ gnu/xml/dom/DomCDATASection.java, gnu/xml/dom/DomDOMException.java,
+ gnu/xml/dom/DomDocumentFragment.java,
+ gnu/xml/dom/DomProcessingInstruction.java and
+ gnu/xml/dom/ls/DomLSException.java.
+ * Makefile.in: Regenerated.
+
+2005-02-16 Tom Tromey <tromey@redhat.com>
+
+ * gnu/xml/aelfred2/SAXDriver.java: Ensure that null is returned when
+ attribute index is out of bounds.
+
+2005-02-16 Chris Burdess <dog@gnu.org>
+
+ * gnu/xml/aelfred2/SAXDriver.java: Corrected implementation of
+ isDeclared methods. Improved performance of isSpecified methods.
+
+2005-02-16 Chris Burdess <dog@gnu.org>
+
+ Fixes bug libgcj/19864
+ * gnu/xml/dom/DomAttr.java,
+ gnu/xml/dom/DomCDATA.java,
+ gnu/xml/dom/DomCDATASection.java,
+ gnu/xml/dom/DomCharacterData.java,
+ gnu/xml/dom/DomDOMException.java,
+ gnu/xml/dom/DomDoctype.java,
+ gnu/xml/dom/DomDocument.java,
+ gnu/xml/dom/DomDocumentConfiguration.java,
+ gnu/xml/dom/DomDocumentFragment.java,
+ gnu/xml/dom/DomElement.java,
+ gnu/xml/dom/DomEx.java,
+ gnu/xml/dom/DomFragment.java,
+ gnu/xml/dom/DomImpl.java,
+ gnu/xml/dom/DomIterator.java,
+ gnu/xml/dom/DomNamedNodeMap.java,
+ gnu/xml/dom/DomNode.java,
+ gnu/xml/dom/DomNsNode.java,
+ gnu/xml/dom/DomPI.java,
+ gnu/xml/dom/DomProcessingInstruction.java,
+ gnu/xml/dom/DomText.java,
+ gnu/xml/dom/DomLSEx.java,
+ gnu/xml/dom/DomLSException.java,
+ gnu/xml/dom/DomLSParser.java,
+ gnu/xml/dom/DomLSSerializer.java: Refactoring of exception and DOM
+ implementation class names to conform to Classpath guidelines. Make
+ DomLSException use JDK 1.4+ exception chaining.
+ * gnu/xml/util/SAXNullTransformerFactory.java,
+ gnu/xml/xpath/Predicate.java: Use constants relative to
+ declaring class or interface.
+
+2005-02-16 Andrew Haley <aph@redhat.com>
+
+ * javax/security/auth/Subject.java (doAsPrivileged): If acc is
+ null, create a new AccessControlContext.
+ * java/security/SecureClassLoader.java (protectionDomainCache):
+ new field.
+ (defineClass): Create a new protection domain and add it to our
+ cache.
+
+ * java/rmi/server/UnicastRemoteObject.java (exportObject): Call
+ addStub() to keep track of the stub we've exported.
+ (unexportObject): Call deleteStub().
+ * java/rmi/server/RemoteObject.java (stubs): New field.
+ (addStub): New method.
+ (deleteStub): New method.
+ (toStub): Rewrite.
+
+ * java/lang/VMCompiler.java (loadSharedLibrary): Pass
+ true to findHelper (tryParents).
+ * gnu/gcj/runtime/SharedLibLoader.java (SharedLibLoader):
+ Likewise.
+ * java/net/URLClassLoader.java (SoURLLoader): Likewise.
+ * gnu/gcj/runtime/SharedLibHelper.java (SharedLibHelper): Pass
+ ProtectionDomain.
+ If tryParents is false, don't scan parent class loaders.
+
+ * java/security/Permissions.java (PermissionsHash.implies):
+ Iterate over the collection and invoke implies() on each
+ element.
+
+2005-02-16 Andrew Haley <aph@redhat.com>
+
+ * gnu/gcj/runtime/PersistentByteMap.java (name, values, fc): new
+ fields.
+ (PersistentByteMap): Set name
+ Magic number changed to 0x67636a64 ("gcjd").
+ (init): Force the map to be prime.
+ (emptyPersistentByteMap): File name was a string, now a File.
+ (addBytes): Share srings between entries.
+ (stringTableSize): New method.
+ (capacity): Scale by load factor.
+ (force): New method.
+ (getFile): New method.
+ (close): New method.
+ (putAll): New method.
+ (ByteWrapper): New class.
+ * gnu/gcj/tools/gcj_dbtool/Main.java (verbose): New field.
+ (main): Guess the average string size as 32, not 64.
+ Copy a database before modifying it, so that we can update a
+ database in a running system.
+ If a database isn't big enough, resize it.
+ "-m": new option: merges databases.
+ "-a": Create a new detabase if it doesn't exist.
+ (usage): Correct, add new option.
+ (addJar): Copy a database before modifying it.
+ (resizeMap): New method.
+
+2005-02-15 David Daney <ddaney@avtrex.com>
+ Bryce McKinlay <mckinlay@redhat.com>
+
+ * prims.cc (_Jv_CreateJavaVM): Add comment about initialization order.
+ * posix-threads.cc (_Jv_InitThreads): Call block_sigchld() here to
+ ensure that GC threads inherit the new signal mask.
+ (block_sigchld): Call JvFail rather than throwing exception if
+ pthread_sigmask() fails.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * java/util/jar/Attributes.java (Name.CLASS_PATH): Document that
+ file path elements are separated by spaces.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * java/util/jar/Attributes.java (Attributes.Name): Add documentation
+ to describe attributes without a constant field value in this class.
+
+2005-02-15 Michael Koch <konqueror@gmx.de>
+
+ * java/util/jar/Attributes.java
+ (CREATED_BY, JAVA_BEAN, MAGIC): Removed.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * java/net/URLClassLoader.java (JarURLLoader.JarURLLoader): Just use
+ space for parsing CLASS_PATH attribute.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * java/net/URLClassLoader.java (JarURLLoader.JarURLLoader): Don't look
+ aside for "GCJLIBS" in directory where jarfiles are loaded.
+ (JarURLLoader.getClass): Removed method.
+ (JarURLLoader.toString): Removed method.
+ (FileResource.toString): Removed method.
+
+2005-02-15 Mark Wielaard <mark@klomp.org>
+
+ * javax/net/ssl/SSLContext.java (getInstance): Add exception message
+ and/or cause before throwing.
+
+2005-02-15 Richard Henderson <rth@redhat.com>
+
+ * Makefile.am (libgcj_la_SOURCES): Move all sources ...
+ (libgcj0_convenience_la_SOURCES): ... here.
+ (libgcj_la_LIBADD): Add libgcj0_convenience.la.
+ (libgcj_la_DEPENDENCIES): Include libgcj_la_LIBADD.
+ * Makefile.in: Regenerate.
+
+2005-02-14 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jawt.c: New file.
+ * include/jawt.h: Likewise.
+ * include/jawt_md.h: Likewise.
+ * include/Makefile.am (tool_include__HEADERS): Add jawt.h and
+ jawt_md.h files.
+ * include/Makefile.in: Regenerate.
+ * jni/classpath/classpath_jawt.h: Likewise.
+ * jni/gtk-peer/gtk_jawt.c: Likewise.
+ * Makefile.am: Build libjawt.so.
+ * Makefile.in: Regenerate.
+
+2005-02-14 Tom Tromey <tromey@redhat.com>
+
+ * testsuite/libjava.lang/PR19921.java: Use correct class name.
+
+2005-02-14 Tom Tromey <tromey@redhat.com>
+
+ * testsuite/libjava.lang/PR19921.out: Renamed from PR19929.out.
+ * testsuite/libjava.lang/PR19921.java: Renamed from PR19929.java.
+
+2005-02-14 Tom Tromey <tromey@redhat.com>
+
+ For PR java/19929:
+ * testsuite/libjava.lang/PR19929.out: New file.
+ * testsuite/libjava.lang/PR19929.java: New file.
+
+2005-02-14 Anthony Green <green@redhat.com>
+
+ PR libgcj/18116
+ * testsuite/libjava.jni/PR18116.c: New file.
+ * testsuite/libjava.jni/PR18116.java: New file.
+ * testsuite/libjava.jni/PR18116.out: New file.
+
+2005-02-13 Anthony Green <green@redhat.com>
+
+ PR libgcj/18116
+ * jni.cc (nathash_add): Don't strdup the method signature.
+ (_Jv_JNI_RegisterNatives): Convert the slashes to dots in the
+ method signature.
+ Update copyright.
+
+2005-02-12 Mark Wielaard <mark@klomp.org>
+
+ Fixes bug libgcj/8170
+ * java/lang/ClassLoader.java (loadClass): Don't rewrap
+ ClassNotFoundException.
+ * gnu/java/lang/MainThread.java (run): Chain NoClassDefFoundError.
+ * gnu/gcj/runtime/NameFinder.java (remove_interpreter): Removed.
+ (remove_internal): New field superceding remove_interpreter.
+ (sanitizeStack): Remove all no-package classes starting with "_Jv_".
+ Remove no-class methods starting with "_Jv_". And Replace null
+ class or method names with the empty string. Stop at either the
+ MainThread or a real Thread run() method.
+ (newElement): Made static.
+ * java/net/URLClassLoader.java (findClass): Throw
+ ClassNotFoundExceptions including urls, plus parent using toString().
+ (thisString): New field.
+ (toString): New method.
+
+2005-02-10 Tom Tromey <tromey@redhat.com>
+
+ * external/sax/Makefile.in: Rebuilt.
+ * external/sax/Makefile.am (all-local): Removed.
+ (BUILT_SOURCES): New variable.
+ (mostlyclean-local): No error if no classes to delete.
+ * external/w3c_dom/Makefile.in: Rebuilt.
+ * external/w3c_dom/Makefile.am (all-local): Removed.
+ (BUILT_SOURCES): New variable.
+ (mostlyclean-local): No error if no classes to delete.
+
+2005-02-10 Bryce McKinlay <mckinlay@redhat.com>
+
+ * testsuite/libjava.mauve/xfails: Updated to reflect current state
+ of mauve and libjava.
+
+2005-02-09 Tom Tromey <tromey@redhat.com>
+
+ * gnu/java/net/protocol/jar/Connection.java (getJarFile): Open
+ jar file with OPEN_DELETE.
+ * java/util/zip/ZipFile.java (ZipFile): Call deleteOnExit when
+ OPEN_DELETE is used.
+
+2005-02-09 Tom Tromey <tromey@redhat.com>
+
+ * java/util/zip/InflaterInputStream.java (markSupported):
+ Override.
+ (mark, reset): Likewise.
+
+2005-02-08 Tom Tromey <tromey@redhat.com>
+
+ * java/net/URI.java (AUTHORITY_REGEXP): Handle case where user
+ name or port is missing.
+ (AUTHORITY_USERINFO_GROUP, AUTHORITY_HOST_GROUP,
+ AUTHORITY_PORT_GROUP): Updated.
+
+2005-02-08 Tom Tromey <tromey@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.ac: Reduce number of calls to AC_CHECK_FUNCS and
+ AC_CHECK_HEADERS.
+
+2005-02-07 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natRuntime.cc (insertSystemProperties): Set
+ sun.boot.class.path earlier.
+
+2005-02-07 Tom Tromey <tromey@redhat.com>
+
+ * defineclass.cc (handleClassBegin): Use
+ _Jv_RegisterInitiatingLoader.
+ * java/lang/Class.h (_Jv_UnregisterInitiatingLoader): Declare.
+ * java/lang/natVMClassLoader.cc (resolveClass): Don't register
+ class. Use _Jv_UnregisterInitiatingLoader.
+ * java/lang/natClassLoader.cc (_Jv_UnregisterInitiatingLoader):
+ New function.
+
+2005-02-07 Mark Wielaard <mark@klomp.org>
+
+ Reported by Timo Lindfors <timo.lindfors@iki.fi>
+ java/util/regex/Matcher.java (lookingAt): Set position when match
+ found.
+ (matches): Implemented through lookingAt().
+
+2005-02-07 Mark Wielaard <mark@klomp.org>
+
+ Fix suggested by Timo Lindfors <timo.lindfors@iki.fi>
+ * java/util/regex/Pattern.java (split(CharSequence,int)):
+ Fix while empties > 0 loops.
+
+2005-02-07 Robert Schuster <thebohemian@gmx.net>
+
+ * gnu/java/nio/charset/ISO_8859_1.java,
+ gnu/java/nio/charset/US_ASCII.java,
+ gnu/java/nio/charset/UTF_16.java,
+ gnu/java/nio/charset/UTF_16_LE.java,
+ gnu/java/nio/charset/UTF_16_BE.java,
+ gnu/java/nio/charset/UTF_8.java: Fixed canonical names
+ and aliases according to
+ "http://www.iana.org/assignments/character-sets",
+ "http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html"
+ and "http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL".
+ * gnu/java/nio/charset/Provider.java: Made charset lookup
+ case-insensitive which fixes bug #11740.
+
+2005-02-07 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/19611:
+ * Makefile.in: Rebuilt.
+ * Makefile.am (src.zip): New target.
+ (install-src.zip): Likewise.
+ (sourcesdir): New variable.
+
+2005-02-06 Jerry Quinn <jlquinn@optonline.net>
+
+ * javax/imageio/metadata/IIOMetadataNode.java:
+ Implemented.
+ * javax/imageio/metadata/IIOAttr.java,
+ javax/imageio/metadata/IIONamedNodeMap.java,
+ javax/imageio/metadata/IIONodeList.java:
+ New files
+
+2005-02-06 Graydon Hoare <graydon@redhat.com>
+
+ * gnu/java/awt/ClasspathToolkit.java
+ (registerImageIOSpis): New method.
+ * javax/imageio/ImageIO.java
+ (WriterFormatFilter.filter): Fix copy-and-paste typos.
+ (WriterMIMETypeFilter.filter): Likewise.
+ (ImageReaderIterator): Pass extension argument through to SPI.
+ (getReadersByFilter): Likewise.
+ (getWritersByFilter): Likewise.
+ (getImageReadersByFormatName): Likewise.
+ (getImageReadersByMIMEType): Likewise.
+ (getImageReadersBySuffix): Likewise.
+ (getImageWritersByFormatName): Likewise.
+ (getImageWritersByMIMEType): Likewise.
+ (getImageWritersBySuffix): Likewise.
+ (read): Implement.
+ (write): Implement.
+ * javax/imageio/ImageReader.java
+ (progressListeners): Initialize.
+ (setInput): Implement.
+ * javax/imageio/ImageWriter.java
+ (progressListeners): Initialize.
+ (warningListeners): Likewise.
+ (warningLocales): Likewise.
+ (setOutput): Test "isInstance" rather than class equality.
+ * javax/imageio/spi/IIORegistry.java
+ (static): Add reader and writer SPIs.
+ (IIORegistry): Call ClasspathToolkit.registerImageIOSpis.
+
+2004-02-06 Michael Koch <konqueror@gmx.de>
+
+ * javax/imageio/metadata/IIOInvalidTreeException.java
+ (IIOInvalidTreeException): Reformatted.
+ * javax/imageio/spi/IIORegistry.java
+ (static): Register ImageReaderSpi.class and ImageWriterSpi.class.
+ * javax/imageio/stream/MemoryCacheImageInputStream.java:
+ Reworked import statements.
+
+2004-02-06 Michael Koch <konqueror@gmx.de>
+
+ * javax/imageio/stream/FileImageOutputStream.java:
+ Implemented.
+
+2004-02-06 Michael Koch <konqueror@gmx.de>
+
+ * javax/imageio/stream/FileCacheImageInputStream.java,
+ javax/imageio/stream/FileCacheImageOutputStream.java,
+ javax/imageio/stream/FileImageInputStream.java,
+ javax/imageio/stream/ImageInputStreamImpl.java,
+ javax/imageio/stream/ImageOutputStreamImpl.java,
+ javax/imageio/stream/MemoryCacheImageInputStream.java,
+ javax/imageio/stream/MemoryCacheImageOutputStream.java:
+ Added all missing methods in javax.imageio.stream.
+
2005-02-02 David Daney <ddaney@avtrex.com>
* java/net/InetAddress.java (InetAddress): Make a private copy of
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 3daf09bd7da..cd6f0b3aa64 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -102,12 +102,14 @@ endif
if GTK_AWT
cond_gtk_ltlibrary = lib-gnu-java-awt-peer-gtk.la
+cond_gtk_jawt_ltlibrary = libjawt.la
else
cond_gtk_ltlibrary =
+cond_gtk_jawt_ltlibrary =
endif
toolexeclib_LTLIBRARIES = libgcj.la libgij.la \
- $(cond_gtk_ltlibrary) $(cond_xlib_ltlibrary)
+ $(cond_gtk_ltlibrary) $(cond_gtk_jawt_ltlibrary) $(cond_xlib_ltlibrary)
toolexecmainlib_DATA = libgcj.spec
pkgconfigdir = $(libdir)/pkgconfig
@@ -211,7 +213,11 @@ libgij_la_LIBADD = -L$(here)/.libs libgcj.la
libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
-libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
+# Work around libtool wanting to do piece-wise linking with -r. Using a
+# convenience library suddenly invokes the --whole-archive path instead.
+# This allows the build to succeed for targets that allocate multiple got
+# subsections in the linker, such as Alpha and MIPS.
+libgcj0_convenience_la_SOURCES = prims.cc jni.cc exception.cc \
link.cc defineclass.cc interpret.cc verify.cc \
$(nat_source_files) $(math_c_source_files) $(java_source_files) \
$(gnu_xml_source_files) $(built_java_source_files) \
@@ -220,9 +226,9 @@ libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
$(POSIX_PLATFORM_SRC) $(WIN32_PLATFORM_SRC) $(ECOS_PLATFORM_SRC) \
$(DARWIN_CRT_SRC) \
$(POSIX_THREAD_SRC) $(WIN32_THREAD_SRC) $(NO_THREAD_SRC)
-libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
- java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
- $(LIBLTDL) $(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
+noinst_LTLIBRARIES = libgcj0_convenience.la
+
+libgcj_la_SOURCES =
## Objects from C++ sources in subdirs.
nat_files = $(nat_source_files:.cc=.lo)
@@ -237,7 +243,11 @@ libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
libgcj_la_LIBADD = \
external/sax/libsax_convenience.la \
external/w3c_dom/libw3c_convenience.la \
+ libgcj0_convenience.la \
$(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
+libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
+ java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
+ $(libgcj_la_LIBADD)
libgcj_la_LINK = $(LIBLINK)
# Gtk/Cairo JNI sources.
@@ -252,12 +262,11 @@ endif
gtk_c_source_files = \
$(gtk_cairo_c_source_files) \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \
@@ -274,7 +283,6 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c \
@@ -290,6 +298,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
jni/gtk-peer/gthread-jni.c \
+jni/gtk-peer/gtk_jawt.c \
jni/classpath/jcl.c \
jni/classpath/jnilink.c \
jni/classpath/native_state.c \
@@ -303,8 +312,11 @@ gnu/java/awt/peer/gtk/GdkFontPeer.java \
gnu/java/awt/peer/gtk/GdkGlyphVector.java \
gnu/java/awt/peer/gtk/GdkGraphics.java \
gnu/java/awt/peer/gtk/GdkGraphics2D.java \
+gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java \
gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java \
gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
+gnu/java/awt/peer/gtk/GdkRobotPeer.java \
+gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java \
gnu/java/awt/peer/gtk/GtkButtonPeer.java \
gnu/java/awt/peer/gtk/GtkCanvasPeer.java \
gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java \
@@ -323,7 +335,6 @@ gnu/java/awt/peer/gtk/GtkImage.java \
gnu/java/awt/peer/gtk/GtkImagePainter.java \
gnu/java/awt/peer/gtk/GtkLabelPeer.java \
gnu/java/awt/peer/gtk/GtkListPeer.java \
-gnu/java/awt/peer/gtk/GtkMainThread.java \
gnu/java/awt/peer/gtk/GtkMenuBarPeer.java \
gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java \
gnu/java/awt/peer/gtk/GtkMenuItemPeer.java \
@@ -344,8 +355,6 @@ gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
gtk_jni_headers = $(patsubst %.java,jniinclude/%.h,$(subst /,_,$(gtk_awt_peer_sources)))
-jniinclude/gnu_java_awt_peer_gtk_GdkFontMetrics.h: gnu/java/awt/peer/gtk/GdkFontMetrics.java
-jniinclude/gnu_java_awt_peer_gtk_GdkGlyphVector.h: gnu/java/awt/peer/gtk/GdkGlyphVector.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h: gnu/java/awt/peer/gtk/GdkGraphics.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h: gnu/java/awt/peer/gtk/GdkGraphics2D.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h: gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
@@ -369,7 +378,6 @@ jniinclude/gnu_java_awt_peer_gtk_GtkImage.h: gnu/java/awt/peer/gtk/GtkImage.java
jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h: gnu/java/awt/peer/gtk/GtkImagePainter.java
jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h: gnu/java/awt/peer/gtk/GtkLabelPeer.java
jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h: gnu/java/awt/peer/gtk/GtkListPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMainThread.h: gnu/java/awt/peer/gtk/GtkMainThread.java
jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h: gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h: gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h: gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
@@ -394,9 +402,7 @@ $(gtk_jni_headers): %.h:
echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \
$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkFontMetrics.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkFontPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGlyphVector.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h
@@ -418,7 +424,6 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.lo: $(top_builddir)/jniinclude
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMainThread.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h
@@ -451,15 +456,23 @@ jni/classpath/primlib.h
lib_gnu_java_awt_peer_gtk_la_CFLAGS = \
-Ijniinclude -I$(srcdir)/jni/classpath \
-I$(srcdir)/jni/gtk-peer $(PEDANTIC_CFLAGS) $(GTK_CFLAGS) $(LIBART_CFLAGS) \
- $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS)
+ $(X_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS)
lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni
lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-@gcc_version@.jar libgcj.la libgcj.spec
## The mysterious backslash in the grep pattern is consumed by make.
lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \
- -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK)
+libjawt_la_SOURCES = jawt.c
+libjawt_la_CFLAGS = -I$(srcdir)/jni/classpath $(PEDANTIC_CFLAGS) $(X_CFLAGS)
+libjawt_la_LIBADD = lib-gnu-java-awt-peer-gtk.la
+libjawt_la_LDFLAGS = \
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(LIBGCJ_LD_SYMBOLIC)
+libjawt_la_LINK = $(LIBLINK)
+
lib_gnu_awt_xlib_la_SOURCES = \
$(xlib_java_source_files) \
$(xlib_nat_source_files)
@@ -467,6 +480,7 @@ lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-@gcc_version@.jar libgcj.la libgcj.spe
lib_gnu_awt_xlib_la_LIBADD = $(xlib_javao_files)
## We require libstdc++-v3 to be in the same build tree.
lib_gnu_awt_xlib_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
-I../libstdc++-v3/include \
-I../libstdc++-v3/include/$(target_noncanonical) \
-I$(srcdir)/../libstdc++-v3/libsupc++
@@ -486,7 +500,7 @@ all_java_source_files = \
all_java_class_files = $(all_java_source_files:.java=.class)
-all_property_files = $(property_files) $(jgss_property_files) \
+all_property_files = $(property_files) \
java/util/logging/logging.properties
## Build property files into the library.
@@ -508,7 +522,7 @@ classes.stamp: $(all_java_source_files)
@echo Compiling Java sourcefiles...
@: $(call write_entries_to_file,$?,libgcj.sourcelist)
$(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(BOOTCLASSPATH) -d $(here) @libgcj.sourcelist
-
+ echo > classes.stamp
# This next rule seems backward, but reflects the fact that 1) all
# classfiles are compiled in one go when classes.stamp is built and 2)
# anything which depends on a particular .class file must wait until
@@ -1063,6 +1077,43 @@ gnu/java/awt/peer/EmbeddedWindowPeer.java \
gnu/java/awt/peer/GLightweightPeer.java \
gnu/java/awt/peer/ClasspathFontPeer.java \
gnu/java/awt/peer/ClasspathTextLayoutPeer.java \
+gnu/java/beans/decoder/AbstractContext.java \
+gnu/java/beans/decoder/AbstractCreatableObjectContext.java \
+gnu/java/beans/decoder/AbstractElementHandler.java \
+gnu/java/beans/decoder/AbstractObjectContext.java \
+gnu/java/beans/decoder/ArrayContext.java \
+gnu/java/beans/decoder/ArrayHandler.java \
+gnu/java/beans/decoder/AssemblyException.java \
+gnu/java/beans/decoder/BooleanHandler.java \
+gnu/java/beans/decoder/ByteHandler.java \
+gnu/java/beans/decoder/CharHandler.java \
+gnu/java/beans/decoder/ClassHandler.java \
+gnu/java/beans/decoder/ConstructorContext.java \
+gnu/java/beans/decoder/Context.java \
+gnu/java/beans/decoder/DecoderContext.java \
+gnu/java/beans/decoder/DefaultExceptionListener.java \
+gnu/java/beans/decoder/DoubleHandler.java \
+gnu/java/beans/decoder/DummyContext.java \
+gnu/java/beans/decoder/DummyHandler.java \
+gnu/java/beans/decoder/ElementHandler.java \
+gnu/java/beans/decoder/FloatHandler.java \
+gnu/java/beans/decoder/GrowableArrayContext.java \
+gnu/java/beans/decoder/IndexContext.java \
+gnu/java/beans/decoder/IntHandler.java \
+gnu/java/beans/decoder/JavaHandler.java \
+gnu/java/beans/decoder/LongHandler.java \
+gnu/java/beans/decoder/MethodContext.java \
+gnu/java/beans/decoder/MethodFinder.java \
+gnu/java/beans/decoder/NullHandler.java \
+gnu/java/beans/decoder/ObjectContext.java \
+gnu/java/beans/decoder/ObjectHandler.java \
+gnu/java/beans/decoder/PersistenceParser.java \
+gnu/java/beans/decoder/PropertyContext.java \
+gnu/java/beans/decoder/ShortHandler.java \
+gnu/java/beans/decoder/SimpleHandler.java \
+gnu/java/beans/decoder/StaticMethodContext.java \
+gnu/java/beans/decoder/StringHandler.java \
+gnu/java/beans/decoder/VoidHandler.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
@@ -1073,9 +1124,9 @@ gnu/java/beans/editors/NativeIntEditor.java \
gnu/java/beans/editors/NativeLongEditor.java \
gnu/java/beans/editors/NativeShortEditor.java \
gnu/java/beans/editors/StringEditor.java \
-gnu/java/beans/info/ComponentBeanInfo.java \
gnu/java/beans/BeanInfoEmbryo.java \
-gnu/java/beans/EmptyBeanInfo.java \
+gnu/java/beans/DummyAppletContext.java \
+gnu/java/beans/DummyAppletStub.java \
gnu/java/beans/ExplicitBeanInfo.java \
gnu/java/beans/IntrospectionIncubator.java \
java/applet/Applet.java \
@@ -1455,6 +1506,7 @@ java/beans/VetoableChangeListenerProxy.java \
java/beans/VetoableChangeSupport.java \
java/beans/Visibility.java \
java/beans/AppletInitializer.java \
+java/beans/XMLDecoder.java \
javax/swing/border/AbstractBorder.java \
javax/swing/border/BevelBorder.java \
javax/swing/border/Border.java \
@@ -1480,6 +1532,7 @@ javax/swing/plaf/basic/BasicComboBoxRenderer.java \
javax/swing/plaf/basic/BasicComboPopup.java \
javax/swing/plaf/basic/BasicDesktopIconUI.java \
javax/swing/plaf/basic/BasicDesktopPaneUI.java \
+javax/swing/plaf/basic/BasicEditorPaneUI.java \
javax/swing/plaf/basic/BasicFormattedTextFieldUI.java \
javax/swing/plaf/basic/BasicGraphicsUtils.java \
javax/swing/plaf/basic/BasicInternalFrameTitlePane.java \
@@ -1536,7 +1589,9 @@ javax/swing/plaf/TabbedPaneUI.java \
javax/swing/plaf/TextUI.java \
javax/swing/plaf/TreeUI.java \
javax/swing/plaf/ViewportUI.java \
+javax/swing/plaf/metal/DefaultMetalTheme.java \
javax/swing/plaf/metal/MetalLookAndFeel.java \
+javax/swing/plaf/metal/MetalTheme.java \
javax/swing/plaf/ColorUIResource.java \
javax/swing/plaf/DimensionUIResource.java \
javax/swing/plaf/FontUIResource.java \
@@ -1566,7 +1621,6 @@ javax/swing/plaf/TableUI.java \
javax/swing/plaf/ToolBarUI.java \
javax/swing/plaf/ToolTipUI.java \
javax/swing/AbstractListModel.java \
-javax/swing/AbstractSet.java \
javax/swing/colorchooser/AbstractColorChooserPanel.java \
javax/swing/colorchooser/ColorChooserComponentFactory.java \
javax/swing/colorchooser/ColorSelectionModel.java \
@@ -1596,12 +1650,12 @@ javax/swing/ButtonGroup.java \
javax/swing/ButtonModel.java \
javax/swing/ComponentInputMap.java \
javax/swing/DefaultButtonModel.java \
-javax/swing/DefaultCellRenderer.java \
javax/swing/DefaultListModel.java \
javax/swing/DefaultListSelectionModel.java \
javax/swing/Icon.java \
javax/swing/ImageIcon.java \
javax/swing/InputMap.java \
+javax/swing/InternalFrameFocusTraversalPolicy.java \
javax/swing/JApplet.java \
javax/swing/JButton.java \
javax/swing/JCheckBox.java \
@@ -1630,11 +1684,14 @@ javax/swing/JTree.java \
javax/swing/JViewport.java \
javax/swing/JWindow.java \
javax/swing/KeyStroke.java \
+javax/swing/LayoutFocusTraversalPolicy.java \
javax/swing/ListCellRenderer.java \
javax/swing/ListModel.java \
javax/swing/ListSelectionModel.java \
javax/swing/LookAndFeel.java \
javax/swing/Scrollable.java \
+javax/swing/SortingFocusTraversalPolicy.java \
+javax/swing/SpinnerDateModel.java \
javax/swing/SpinnerListModel.java \
javax/swing/SpinnerModel.java \
javax/swing/SpinnerNumberModel.java \
@@ -1700,6 +1757,7 @@ javax/swing/text/ComponentView.java \
javax/swing/text/DefaultCaret.java \
javax/swing/text/DefaultEditorKit.java \
javax/swing/text/DefaultHighlighter.java \
+javax/swing/text/DefaultStyledDocument.java \
javax/swing/text/Document.java \
javax/swing/text/DocumentFilter.java \
javax/swing/text/EditorKit.java \
@@ -1718,6 +1776,7 @@ javax/swing/text/PlainView.java \
javax/swing/text/Position.java \
javax/swing/text/Segment.java \
javax/swing/text/SimpleAttributeSet.java \
+javax/swing/text/StringContent.java \
javax/swing/text/Style.java \
javax/swing/text/StyleConstants.java \
javax/swing/text/StyleContext.java \
@@ -1930,6 +1989,9 @@ javax/imageio/spi/IIOServiceProvider.java \
javax/imageio/spi/ImageReaderWriterSpi.java \
javax/imageio/spi/ImageInputStreamSpi.java \
javax/imageio/spi/RegisterableService.java \
+javax/imageio/metadata/IIOAttr.java \
+javax/imageio/metadata/IIONamedNodeMap.java \
+javax/imageio/metadata/IIONodeList.java \
javax/imageio/metadata/IIOMetadataFormatImpl.java \
javax/imageio/metadata/IIOInvalidTreeException.java \
javax/imageio/metadata/IIOMetadataFormat.java \
@@ -1994,6 +2056,10 @@ javax/print/attribute/HashPrintServiceAttributeSet.java \
javax/print/attribute/Attribute.java \
javax/print/attribute/DocAttributeSet.java \
javax/print/attribute/PrintRequestAttributeSet.java \
+javax/print/attribute/standard/Chromaticity.java \
+javax/print/attribute/standard/Destination.java \
+javax/print/attribute/standard/MediaPrintableArea.java \
+javax/print/attribute/standard/MediaSize.java \
javax/print/attribute/standard/NumberOfInterveningJobs.java \
javax/print/attribute/standard/PrinterMakeAndModel.java \
javax/print/attribute/standard/PrinterStateReason.java \
@@ -2476,10 +2542,9 @@ gnu/xml/util/Resolver.java \
gnu/xml/util/DoParse.java \
gnu/xml/util/XHTMLWriter.java \
gnu/xml/util/SAXNullTransformerFactory.java \
-gnu/xml/dom/DomCDATA.java \
gnu/xml/dom/DomXPathNSResolver.java \
-gnu/xml/dom/ls/DomLSEx.java \
gnu/xml/dom/ls/FilteredSAXEventSink.java \
+gnu/xml/dom/ls/DomLSException.java \
gnu/xml/dom/ls/DomLSSerializer.java \
gnu/xml/dom/ls/DomLSInput.java \
gnu/xml/dom/ls/DomLSOutput.java \
@@ -2490,14 +2555,14 @@ gnu/xml/dom/ls/WriterOutputStream.java \
gnu/xml/dom/DomElement.java \
gnu/xml/dom/DomNsNode.java \
gnu/xml/dom/DomAttr.java \
-gnu/xml/dom/DomPI.java \
gnu/xml/dom/DTDAttributeTypeInfo.java \
gnu/xml/dom/DomDocumentBuilder.java \
gnu/xml/dom/DTDElementTypeInfo.java \
-gnu/xml/dom/DomEx.java \
gnu/xml/dom/DomDocument.java \
gnu/xml/dom/DomXPathExpression.java \
gnu/xml/dom/DomDocumentConfiguration.java \
+gnu/xml/dom/DomDocumentFragment.java \
+gnu/xml/dom/DomProcessingInstruction.java \
gnu/xml/dom/Consumer.java \
gnu/xml/dom/DomComment.java \
gnu/xml/dom/DomCharacterData.java \
@@ -2517,9 +2582,10 @@ gnu/xml/dom/DomNodeIterator.java \
gnu/xml/dom/DomNotation.java \
gnu/xml/dom/JAXPFactory.java \
gnu/xml/dom/DomIterator.java \
-gnu/xml/dom/DomFragment.java \
gnu/xml/dom/DomEvent.java \
gnu/xml/dom/DomEntity.java \
+gnu/xml/dom/DomCDATASection.java \
+gnu/xml/dom/DomDOMException.java \
gnu/xml/transform/GenerateIdFunction.java \
gnu/xml/transform/FormatNumberFunction.java \
gnu/xml/transform/ValueOfNode.java \
@@ -3005,8 +3071,11 @@ gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
gnu/java/net/BASE64.java \
+gnu/java/net/CRLFInputStream.java \
+gnu/java/net/CRLFOutputStream.java \
gnu/java/net/DefaultContentHandlerFactory.java \
gnu/java/net/EmptyX509TrustManager.java \
+gnu/java/net/GetLocalHostAction.java \
gnu/java/net/HeaderFieldHelper.java \
gnu/java/net/LineInputStream.java \
gnu/java/net/PlainDatagramSocketImpl.java \
@@ -3017,6 +3086,22 @@ gnu/java/net/protocol/core/CoreInputStream.java \
gnu/java/net/protocol/core/Handler.java \
gnu/java/net/protocol/file/Connection.java \
gnu/java/net/protocol/file/Handler.java \
+gnu/java/net/protocol/ftp/ActiveModeDTP.java \
+gnu/java/net/protocol/ftp/BlockInputStream.java \
+gnu/java/net/protocol/ftp/BlockOutputStream.java \
+gnu/java/net/protocol/ftp/CompressedInputStream.java \
+gnu/java/net/protocol/ftp/CompressedOutputStream.java \
+gnu/java/net/protocol/ftp/DTP.java \
+gnu/java/net/protocol/ftp/DTPInputStream.java \
+gnu/java/net/protocol/ftp/DTPOutputStream.java \
+gnu/java/net/protocol/ftp/FTPConnection.java \
+gnu/java/net/protocol/ftp/FTPException.java \
+gnu/java/net/protocol/ftp/FTPResponse.java \
+gnu/java/net/protocol/ftp/FTPURLConnection.java \
+gnu/java/net/protocol/ftp/Handler.java \
+gnu/java/net/protocol/ftp/PassiveModeDTP.java \
+gnu/java/net/protocol/ftp/StreamInputStream.java \
+gnu/java/net/protocol/ftp/StreamOutputStream.java \
gnu/java/net/protocol/gcjlib/Connection.java \
gnu/java/net/protocol/gcjlib/Handler.java \
gnu/java/net/protocol/http/Authenticator.java \
@@ -3045,6 +3130,7 @@ gnu/java/net/protocol/jar/Connection.java \
gnu/java/net/protocol/jar/Handler.java \
gnu/java/nio/ChannelInputStream.java \
gnu/java/nio/ChannelOutputStream.java \
+gnu/java/nio/ChannelReader.java \
gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/DatagramChannelSelectionKey.java \
gnu/java/nio/FileLockImpl.java \
@@ -3080,12 +3166,18 @@ gnu/java/security/PolicyFile.java \
gnu/java/security/action/GetPropertyAction.java \
gnu/java/security/action/GetSecurityPropertyAction.java \
gnu/java/security/action/SetAccessibleAction.java \
+gnu/java/security/ber/BER.java \
+gnu/java/security/ber/BEREncodingException.java \
+gnu/java/security/ber/BERReader.java \
+gnu/java/security/ber/BERValue.java \
gnu/java/security/der/BitString.java \
gnu/java/security/der/DER.java \
gnu/java/security/der/DEREncodingException.java \
gnu/java/security/der/DERReader.java \
gnu/java/security/der/DERValue.java \
gnu/java/security/der/DERWriter.java \
+gnu/java/security/pkcs/PKCS7SignedData.java \
+gnu/java/security/pkcs/SignerInfo.java \
gnu/java/security/provider/CollectionCertStoreImpl.java \
gnu/java/security/provider/DSAKeyFactory.java \
gnu/java/security/provider/DSAKeyPairGenerator.java \
@@ -3629,6 +3721,7 @@ java/nio/natDirectByteBufferImpl.cc \
java/text/natCollator.cc \
java/util/natResourceBundle.cc \
java/util/natVMTimeZone.cc \
+java/util/logging/natLogger.cc \
java/util/zip/natDeflater.cc \
java/util/zip/natInflater.cc
@@ -3731,6 +3824,49 @@ texinfo: TexinfoDoclet.class
## ################################################################
##
+## Creating and installing sources.zip
+##
+
+## Create a zip holding all the sources. This can be meaningfully
+## used in Eclipse.
+src.zip:
+ -rm -f src.zip
+ here=`pwd`; \
+ ( ( cd $(srcdir); \
+ find java gnu javax org -name '*.java' -print | \
+ while read file; do \
+## Ugly code to avoid "echo -C". Must separate each entry by a newline
+## Gross but easy.
+ echo "x-C" | sed -e 's/^.//'; \
+ echo $(srcdir); \
+ echo $$file; \
+ done ); \
+## Now the build tree.
+ find gnu java -name '*.java' -print) | \
+## Many of the above circumlocutions are because ZIP will most likely
+## be a relative path to fastjar.
+ $(ZIP) -cfM@ $$here/src.zip
+## Now include the files from external/.
+ for dir in sax w3c_dom; do \
+ (cd $(srcdir)/external/$$dir; \
+ find org -type f -name '*.java' -print | while read file; do \
+ echo "x-C" | sed -e 's/^.//'; \
+ echo $(srcdir)/external/$$dir; \
+ echo $$file; \
+ done) | \
+ $(ZIP) -ufM0E@ src.zip; \
+ done
+
+## We use a variable for this in case the user wants to override it.
+sourcesdir = $(jardir)
+
+install-src.zip: src.zip
+ $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-@gcc_version@.zip
+
+
+## ################################################################
+
+##
## Dependency tracking madness.
##
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index d73b69ecfaa..1f6e71f66af 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -17,7 +17,7 @@
-SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) $(lib_gnu_java_awt_peer_gtk_la_SOURCES) $(libgcj_la_SOURCES) $(libgij_la_SOURCES) $(gcj_dbtool_SOURCES) $(gen_from_JIS_SOURCES) $(gij_SOURCES) $(grmic_SOURCES) $(grmiregistry_SOURCES) $(jv_convert_SOURCES)
+SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) $(lib_gnu_java_awt_peer_gtk_la_SOURCES) $(libgcj_la_SOURCES) $(libgcj0_convenience_la_SOURCES) $(libgij_la_SOURCES) $(libjawt_la_SOURCES) $(gcj_dbtool_SOURCES) $(gen_from_JIS_SOURCES) $(gij_SOURCES) $(grmic_SOURCES) $(grmiregistry_SOURCES) $(jv_convert_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -95,7 +95,7 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(bindir)" "$(DESTDIR)$(jardir)" \
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(toolexecmainlibdir)"
toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
am__dirstamp = $(am__leading_dot)dirstamp
am__objects_1 = gnu/gcj/xlib/Clip.lo gnu/gcj/xlib/Colormap.lo \
gnu/gcj/xlib/Display.lo gnu/gcj/xlib/Drawable.lo \
@@ -146,8 +146,11 @@ am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST = \
gnu/java/awt/peer/gtk/GdkGlyphVector.java \
gnu/java/awt/peer/gtk/GdkGraphics.java \
gnu/java/awt/peer/gtk/GdkGraphics2D.java \
+ gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java \
gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java \
gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
+ gnu/java/awt/peer/gtk/GdkRobotPeer.java \
+ gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java \
gnu/java/awt/peer/gtk/GtkButtonPeer.java \
gnu/java/awt/peer/gtk/GtkCanvasPeer.java \
gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java \
@@ -166,7 +169,6 @@ am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST = \
gnu/java/awt/peer/gtk/GtkImagePainter.java \
gnu/java/awt/peer/gtk/GtkLabelPeer.java \
gnu/java/awt/peer/gtk/GtkListPeer.java \
- gnu/java/awt/peer/gtk/GtkMainThread.java \
gnu/java/awt/peer/gtk/GtkMenuBarPeer.java \
gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java \
gnu/java/awt/peer/gtk/GtkMenuItemPeer.java \
@@ -185,12 +187,11 @@ am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST = \
gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
+ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \
@@ -207,7 +208,6 @@ am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST = \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \
- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c \
@@ -222,20 +222,23 @@ am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST = \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
- jni/gtk-peer/gthread-jni.c jni/classpath/jcl.c \
- jni/classpath/jnilink.c jni/classpath/native_state.c \
- jni/classpath/primlib.c jni/gtk-peer/gthread-jni.h \
- jni/gtk-peer/gtkpeer.h jni/classpath/jcl.h \
- jni/classpath/jnilink.h jni/classpath/native_state.h \
- jni/classpath/primlib.h
+ jni/gtk-peer/gthread-jni.c jni/gtk-peer/gtk_jawt.c \
+ jni/classpath/jcl.c jni/classpath/jnilink.c \
+ jni/classpath/native_state.c jni/classpath/primlib.c \
+ jni/gtk-peer/gthread-jni.h jni/gtk-peer/gtkpeer.h \
+ jni/classpath/jcl.h jni/classpath/jnilink.h \
+ jni/classpath/native_state.h jni/classpath/primlib.h
am__objects_3 = gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkTextLayout.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkFontMetrics.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkFontPeer.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGlyphVector.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics2D.lo \
+ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkPixbufDecoder.lo \
+ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo \
+ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkCanvasPeer.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkCheckboxGroupPeer.lo \
@@ -254,7 +257,6 @@ am__objects_3 = gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkTextLayout
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkImagePainter.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkLabelPeer.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkListPeer.lo \
- gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuComponentPeer.lo \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuItemPeer.lo \
@@ -274,12 +276,11 @@ am__objects_3 = gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkTextLayout
@GTK_CAIRO_TRUE@am__objects_4 = jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo
am__objects_5 = $(am__objects_4) \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo \
+ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.lo \
@@ -296,7 +297,6 @@ am__objects_5 = $(am__objects_4) \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo \
- jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo \
@@ -312,6 +312,7 @@ am__objects_5 = $(am__objects_4) \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo \
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo \
+ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo \
jni/classpath/lib_gnu_java_awt_peer_gtk_la-jcl.lo \
jni/classpath/lib_gnu_java_awt_peer_gtk_la-jnilink.lo \
jni/classpath/lib_gnu_java_awt_peer_gtk_la-native_state.lo \
@@ -326,9 +327,12 @@ am__DEPENDENCIES_2 = gnu/regexp/MessagesBundle.properties.lo \
gnu/regexp/MessagesBundle_fr.properties.lo \
org/ietf/jgss/MessagesBundle.properties.lo
am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2)
-am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
- defineclass.cc interpret.cc verify.cc gnu/gcj/natCore.cc \
- gnu/gcj/convert/JIS0208_to_Unicode.cc \
+am_libgcj_la_OBJECTS =
+libgcj_la_OBJECTS = $(am_libgcj_la_OBJECTS)
+libgcj0_convenience_la_LIBADD =
+am__libgcj0_convenience_la_SOURCES_DIST = prims.cc jni.cc exception.cc \
+ link.cc defineclass.cc interpret.cc verify.cc \
+ gnu/gcj/natCore.cc gnu/gcj/convert/JIS0208_to_Unicode.cc \
gnu/gcj/convert/JIS0212_to_Unicode.cc \
gnu/gcj/convert/Unicode_to_JIS.cc gnu/gcj/convert/natIconv.cc \
gnu/gcj/convert/natInput_EUCJIS.cc \
@@ -366,21 +370,22 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
java/net/natInetAddress.cc java/nio/channels/natChannels.cc \
java/nio/natDirectByteBufferImpl.cc java/text/natCollator.cc \
java/util/natResourceBundle.cc java/util/natVMTimeZone.cc \
- java/util/zip/natDeflater.cc java/util/zip/natInflater.cc \
- java/lang/dtoa.c java/lang/k_rem_pio2.c java/lang/s_tan.c \
- java/lang/e_acos.c java/lang/k_sin.c java/lang/strtod.c \
- java/lang/e_asin.c java/lang/k_tan.c java/lang/w_acos.c \
- java/lang/e_atan2.c java/lang/mprec.c java/lang/w_asin.c \
- java/lang/e_exp.c java/lang/s_atan.c java/lang/w_atan2.c \
- java/lang/e_fmod.c java/lang/s_ceil.c java/lang/w_exp.c \
- java/lang/e_log.c java/lang/s_copysign.c java/lang/w_fmod.c \
- java/lang/e_pow.c java/lang/s_cos.c java/lang/w_log.c \
- java/lang/e_rem_pio2.c java/lang/s_fabs.c java/lang/w_pow.c \
- java/lang/e_remainder.c java/lang/s_floor.c \
- java/lang/w_remainder.c java/lang/e_scalb.c java/lang/s_rint.c \
- java/lang/w_sqrt.c java/lang/e_sqrt.c java/lang/s_scalbn.c \
- java/lang/sf_rint.c java/lang/k_cos.c java/lang/s_sin.c \
- java/lang/sf_fabs.c java/lang/Class.java java/lang/Object.java \
+ java/util/logging/natLogger.cc java/util/zip/natDeflater.cc \
+ java/util/zip/natInflater.cc java/lang/dtoa.c \
+ java/lang/k_rem_pio2.c java/lang/s_tan.c java/lang/e_acos.c \
+ java/lang/k_sin.c java/lang/strtod.c java/lang/e_asin.c \
+ java/lang/k_tan.c java/lang/w_acos.c java/lang/e_atan2.c \
+ java/lang/mprec.c java/lang/w_asin.c java/lang/e_exp.c \
+ java/lang/s_atan.c java/lang/w_atan2.c java/lang/e_fmod.c \
+ java/lang/s_ceil.c java/lang/w_exp.c java/lang/e_log.c \
+ java/lang/s_copysign.c java/lang/w_fmod.c java/lang/e_pow.c \
+ java/lang/s_cos.c java/lang/w_log.c java/lang/e_rem_pio2.c \
+ java/lang/s_fabs.c java/lang/w_pow.c java/lang/e_remainder.c \
+ java/lang/s_floor.c java/lang/w_remainder.c \
+ java/lang/e_scalb.c java/lang/s_rint.c java/lang/w_sqrt.c \
+ java/lang/e_sqrt.c java/lang/s_scalbn.c java/lang/sf_rint.c \
+ java/lang/k_cos.c java/lang/s_sin.c java/lang/sf_fabs.c \
+ java/lang/Class.java java/lang/Object.java \
java/lang/AbstractMethodError.java \
java/lang/ArithmeticException.java \
java/lang/ArrayIndexOutOfBoundsException.java \
@@ -706,8 +711,11 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java gnu/java/net/BASE64.java \
+ gnu/java/net/CRLFInputStream.java \
+ gnu/java/net/CRLFOutputStream.java \
gnu/java/net/DefaultContentHandlerFactory.java \
gnu/java/net/EmptyX509TrustManager.java \
+ gnu/java/net/GetLocalHostAction.java \
gnu/java/net/HeaderFieldHelper.java \
gnu/java/net/LineInputStream.java \
gnu/java/net/PlainDatagramSocketImpl.java \
@@ -718,6 +726,22 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/java/net/protocol/core/Handler.java \
gnu/java/net/protocol/file/Connection.java \
gnu/java/net/protocol/file/Handler.java \
+ gnu/java/net/protocol/ftp/ActiveModeDTP.java \
+ gnu/java/net/protocol/ftp/BlockInputStream.java \
+ gnu/java/net/protocol/ftp/BlockOutputStream.java \
+ gnu/java/net/protocol/ftp/CompressedInputStream.java \
+ gnu/java/net/protocol/ftp/CompressedOutputStream.java \
+ gnu/java/net/protocol/ftp/DTP.java \
+ gnu/java/net/protocol/ftp/DTPInputStream.java \
+ gnu/java/net/protocol/ftp/DTPOutputStream.java \
+ gnu/java/net/protocol/ftp/FTPConnection.java \
+ gnu/java/net/protocol/ftp/FTPException.java \
+ gnu/java/net/protocol/ftp/FTPResponse.java \
+ gnu/java/net/protocol/ftp/FTPURLConnection.java \
+ gnu/java/net/protocol/ftp/Handler.java \
+ gnu/java/net/protocol/ftp/PassiveModeDTP.java \
+ gnu/java/net/protocol/ftp/StreamInputStream.java \
+ gnu/java/net/protocol/ftp/StreamOutputStream.java \
gnu/java/net/protocol/gcjlib/Connection.java \
gnu/java/net/protocol/gcjlib/Handler.java \
gnu/java/net/protocol/http/Authenticator.java \
@@ -746,6 +770,7 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/java/net/protocol/jar/Handler.java \
gnu/java/nio/ChannelInputStream.java \
gnu/java/nio/ChannelOutputStream.java \
+ gnu/java/nio/ChannelReader.java \
gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/DatagramChannelSelectionKey.java \
gnu/java/nio/FileLockImpl.java \
@@ -776,12 +801,18 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/java/security/action/GetPropertyAction.java \
gnu/java/security/action/GetSecurityPropertyAction.java \
gnu/java/security/action/SetAccessibleAction.java \
+ gnu/java/security/ber/BER.java \
+ gnu/java/security/ber/BEREncodingException.java \
+ gnu/java/security/ber/BERReader.java \
+ gnu/java/security/ber/BERValue.java \
gnu/java/security/der/BitString.java \
gnu/java/security/der/DER.java \
gnu/java/security/der/DEREncodingException.java \
gnu/java/security/der/DERReader.java \
gnu/java/security/der/DERValue.java \
gnu/java/security/der/DERWriter.java \
+ gnu/java/security/pkcs/PKCS7SignedData.java \
+ gnu/java/security/pkcs/SignerInfo.java \
gnu/java/security/provider/CollectionCertStoreImpl.java \
gnu/java/security/provider/DSAKeyFactory.java \
gnu/java/security/provider/DSAKeyPairGenerator.java \
@@ -1283,6 +1314,43 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/java/awt/peer/GLightweightPeer.java \
gnu/java/awt/peer/ClasspathFontPeer.java \
gnu/java/awt/peer/ClasspathTextLayoutPeer.java \
+ gnu/java/beans/decoder/AbstractContext.java \
+ gnu/java/beans/decoder/AbstractCreatableObjectContext.java \
+ gnu/java/beans/decoder/AbstractElementHandler.java \
+ gnu/java/beans/decoder/AbstractObjectContext.java \
+ gnu/java/beans/decoder/ArrayContext.java \
+ gnu/java/beans/decoder/ArrayHandler.java \
+ gnu/java/beans/decoder/AssemblyException.java \
+ gnu/java/beans/decoder/BooleanHandler.java \
+ gnu/java/beans/decoder/ByteHandler.java \
+ gnu/java/beans/decoder/CharHandler.java \
+ gnu/java/beans/decoder/ClassHandler.java \
+ gnu/java/beans/decoder/ConstructorContext.java \
+ gnu/java/beans/decoder/Context.java \
+ gnu/java/beans/decoder/DecoderContext.java \
+ gnu/java/beans/decoder/DefaultExceptionListener.java \
+ gnu/java/beans/decoder/DoubleHandler.java \
+ gnu/java/beans/decoder/DummyContext.java \
+ gnu/java/beans/decoder/DummyHandler.java \
+ gnu/java/beans/decoder/ElementHandler.java \
+ gnu/java/beans/decoder/FloatHandler.java \
+ gnu/java/beans/decoder/GrowableArrayContext.java \
+ gnu/java/beans/decoder/IndexContext.java \
+ gnu/java/beans/decoder/IntHandler.java \
+ gnu/java/beans/decoder/JavaHandler.java \
+ gnu/java/beans/decoder/LongHandler.java \
+ gnu/java/beans/decoder/MethodContext.java \
+ gnu/java/beans/decoder/MethodFinder.java \
+ gnu/java/beans/decoder/NullHandler.java \
+ gnu/java/beans/decoder/ObjectContext.java \
+ gnu/java/beans/decoder/ObjectHandler.java \
+ gnu/java/beans/decoder/PersistenceParser.java \
+ gnu/java/beans/decoder/PropertyContext.java \
+ gnu/java/beans/decoder/ShortHandler.java \
+ gnu/java/beans/decoder/SimpleHandler.java \
+ gnu/java/beans/decoder/StaticMethodContext.java \
+ gnu/java/beans/decoder/StringHandler.java \
+ gnu/java/beans/decoder/VoidHandler.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
@@ -1293,9 +1361,9 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/java/beans/editors/NativeLongEditor.java \
gnu/java/beans/editors/NativeShortEditor.java \
gnu/java/beans/editors/StringEditor.java \
- gnu/java/beans/info/ComponentBeanInfo.java \
gnu/java/beans/BeanInfoEmbryo.java \
- gnu/java/beans/EmptyBeanInfo.java \
+ gnu/java/beans/DummyAppletContext.java \
+ gnu/java/beans/DummyAppletStub.java \
gnu/java/beans/ExplicitBeanInfo.java \
gnu/java/beans/IntrospectionIncubator.java \
java/applet/Applet.java java/applet/AppletStub.java \
@@ -1593,6 +1661,7 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
java/beans/VetoableChangeListenerProxy.java \
java/beans/VetoableChangeSupport.java \
java/beans/Visibility.java java/beans/AppletInitializer.java \
+ java/beans/XMLDecoder.java \
javax/swing/border/AbstractBorder.java \
javax/swing/border/BevelBorder.java \
javax/swing/border/Border.java \
@@ -1617,6 +1686,7 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/swing/plaf/basic/BasicComboPopup.java \
javax/swing/plaf/basic/BasicDesktopIconUI.java \
javax/swing/plaf/basic/BasicDesktopPaneUI.java \
+ javax/swing/plaf/basic/BasicEditorPaneUI.java \
javax/swing/plaf/basic/BasicFormattedTextFieldUI.java \
javax/swing/plaf/basic/BasicGraphicsUtils.java \
javax/swing/plaf/basic/BasicInternalFrameTitlePane.java \
@@ -1671,7 +1741,9 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/swing/plaf/TabbedPaneUI.java \
javax/swing/plaf/TextUI.java javax/swing/plaf/TreeUI.java \
javax/swing/plaf/ViewportUI.java \
+ javax/swing/plaf/metal/DefaultMetalTheme.java \
javax/swing/plaf/metal/MetalLookAndFeel.java \
+ javax/swing/plaf/metal/MetalTheme.java \
javax/swing/plaf/ColorUIResource.java \
javax/swing/plaf/DimensionUIResource.java \
javax/swing/plaf/FontUIResource.java \
@@ -1699,7 +1771,6 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/swing/plaf/TableUI.java javax/swing/plaf/ToolBarUI.java \
javax/swing/plaf/ToolTipUI.java \
javax/swing/AbstractListModel.java \
- javax/swing/AbstractSet.java \
javax/swing/colorchooser/AbstractColorChooserPanel.java \
javax/swing/colorchooser/ColorChooserComponentFactory.java \
javax/swing/colorchooser/ColorSelectionModel.java \
@@ -1726,14 +1797,14 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/swing/ButtonGroup.java javax/swing/ButtonModel.java \
javax/swing/ComponentInputMap.java \
javax/swing/DefaultButtonModel.java \
- javax/swing/DefaultCellRenderer.java \
javax/swing/DefaultListModel.java \
javax/swing/DefaultListSelectionModel.java \
javax/swing/Icon.java javax/swing/ImageIcon.java \
- javax/swing/InputMap.java javax/swing/JApplet.java \
- javax/swing/JButton.java javax/swing/JCheckBox.java \
- javax/swing/JComponent.java javax/swing/JDialog.java \
- javax/swing/JEditorPane.java \
+ javax/swing/InputMap.java \
+ javax/swing/InternalFrameFocusTraversalPolicy.java \
+ javax/swing/JApplet.java javax/swing/JButton.java \
+ javax/swing/JCheckBox.java javax/swing/JComponent.java \
+ javax/swing/JDialog.java javax/swing/JEditorPane.java \
javax/swing/JFormattedTextField.java javax/swing/JFrame.java \
javax/swing/JLabel.java javax/swing/JLayeredPane.java \
javax/swing/JList.java javax/swing/JMenuBar.java \
@@ -1745,9 +1816,12 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/swing/JToggleButton.java javax/swing/JToolTip.java \
javax/swing/JTree.java javax/swing/JViewport.java \
javax/swing/JWindow.java javax/swing/KeyStroke.java \
+ javax/swing/LayoutFocusTraversalPolicy.java \
javax/swing/ListCellRenderer.java javax/swing/ListModel.java \
javax/swing/ListSelectionModel.java \
javax/swing/LookAndFeel.java javax/swing/Scrollable.java \
+ javax/swing/SortingFocusTraversalPolicy.java \
+ javax/swing/SpinnerDateModel.java \
javax/swing/SpinnerListModel.java \
javax/swing/SpinnerModel.java \
javax/swing/SpinnerNumberModel.java javax/swing/Spring.java \
@@ -1809,6 +1883,7 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/swing/text/DefaultCaret.java \
javax/swing/text/DefaultEditorKit.java \
javax/swing/text/DefaultHighlighter.java \
+ javax/swing/text/DefaultStyledDocument.java \
javax/swing/text/Document.java \
javax/swing/text/DocumentFilter.java \
javax/swing/text/EditorKit.java javax/swing/text/Element.java \
@@ -1825,6 +1900,7 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/swing/text/PlainView.java javax/swing/text/Position.java \
javax/swing/text/Segment.java \
javax/swing/text/SimpleAttributeSet.java \
+ javax/swing/text/StringContent.java \
javax/swing/text/Style.java \
javax/swing/text/StyleConstants.java \
javax/swing/text/StyleContext.java \
@@ -1936,6 +2012,9 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/imageio/spi/ImageReaderWriterSpi.java \
javax/imageio/spi/ImageInputStreamSpi.java \
javax/imageio/spi/RegisterableService.java \
+ javax/imageio/metadata/IIOAttr.java \
+ javax/imageio/metadata/IIONamedNodeMap.java \
+ javax/imageio/metadata/IIONodeList.java \
javax/imageio/metadata/IIOMetadataFormatImpl.java \
javax/imageio/metadata/IIOInvalidTreeException.java \
javax/imageio/metadata/IIOMetadataFormat.java \
@@ -1997,6 +2076,10 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
javax/print/attribute/Attribute.java \
javax/print/attribute/DocAttributeSet.java \
javax/print/attribute/PrintRequestAttributeSet.java \
+ javax/print/attribute/standard/Chromaticity.java \
+ javax/print/attribute/standard/Destination.java \
+ javax/print/attribute/standard/MediaPrintableArea.java \
+ javax/print/attribute/standard/MediaSize.java \
javax/print/attribute/standard/NumberOfInterveningJobs.java \
javax/print/attribute/standard/PrinterMakeAndModel.java \
javax/print/attribute/standard/PrinterStateReason.java \
@@ -2436,9 +2519,9 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/xml/util/Resolver.java gnu/xml/util/DoParse.java \
gnu/xml/util/XHTMLWriter.java \
gnu/xml/util/SAXNullTransformerFactory.java \
- gnu/xml/dom/DomCDATA.java gnu/xml/dom/DomXPathNSResolver.java \
- gnu/xml/dom/ls/DomLSEx.java \
+ gnu/xml/dom/DomXPathNSResolver.java \
gnu/xml/dom/ls/FilteredSAXEventSink.java \
+ gnu/xml/dom/ls/DomLSException.java \
gnu/xml/dom/ls/DomLSSerializer.java \
gnu/xml/dom/ls/DomLSInput.java gnu/xml/dom/ls/DomLSOutput.java \
gnu/xml/dom/ls/SAXEventSink.java \
@@ -2446,13 +2529,14 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/xml/dom/ls/ReaderInputStream.java \
gnu/xml/dom/ls/WriterOutputStream.java \
gnu/xml/dom/DomElement.java gnu/xml/dom/DomNsNode.java \
- gnu/xml/dom/DomAttr.java gnu/xml/dom/DomPI.java \
- gnu/xml/dom/DTDAttributeTypeInfo.java \
+ gnu/xml/dom/DomAttr.java gnu/xml/dom/DTDAttributeTypeInfo.java \
gnu/xml/dom/DomDocumentBuilder.java \
- gnu/xml/dom/DTDElementTypeInfo.java gnu/xml/dom/DomEx.java \
+ gnu/xml/dom/DTDElementTypeInfo.java \
gnu/xml/dom/DomDocument.java \
gnu/xml/dom/DomXPathExpression.java \
gnu/xml/dom/DomDocumentConfiguration.java \
+ gnu/xml/dom/DomDocumentFragment.java \
+ gnu/xml/dom/DomProcessingInstruction.java \
gnu/xml/dom/Consumer.java gnu/xml/dom/DomComment.java \
gnu/xml/dom/DomCharacterData.java gnu/xml/dom/DomExtern.java \
gnu/xml/dom/DomEntityReference.java \
@@ -2465,8 +2549,9 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc link.cc \
gnu/xml/dom/DomText.java gnu/xml/dom/DomNSResolverContext.java \
gnu/xml/dom/DomNodeIterator.java gnu/xml/dom/DomNotation.java \
gnu/xml/dom/JAXPFactory.java gnu/xml/dom/DomIterator.java \
- gnu/xml/dom/DomFragment.java gnu/xml/dom/DomEvent.java \
- gnu/xml/dom/DomEntity.java \
+ gnu/xml/dom/DomEvent.java gnu/xml/dom/DomEntity.java \
+ gnu/xml/dom/DomCDATASection.java \
+ gnu/xml/dom/DomDOMException.java \
gnu/xml/transform/GenerateIdFunction.java \
gnu/xml/transform/FormatNumberFunction.java \
gnu/xml/transform/ValueOfNode.java \
@@ -2559,7 +2644,8 @@ am__objects_6 = gnu/gcj/natCore.lo \
java/net/natInetAddress.lo java/nio/channels/natChannels.lo \
java/nio/natDirectByteBufferImpl.lo java/text/natCollator.lo \
java/util/natResourceBundle.lo java/util/natVMTimeZone.lo \
- java/util/zip/natDeflater.lo java/util/zip/natInflater.lo
+ java/util/logging/natLogger.lo java/util/zip/natDeflater.lo \
+ java/util/zip/natInflater.lo
am__objects_7 = java/lang/dtoa.lo java/lang/k_rem_pio2.lo \
java/lang/s_tan.lo java/lang/e_acos.lo java/lang/k_sin.lo \
java/lang/strtod.lo java/lang/e_asin.lo java/lang/k_tan.lo \
@@ -2832,6 +2918,43 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
gnu/java/awt/peer/GLightweightPeer.lo \
gnu/java/awt/peer/ClasspathFontPeer.lo \
gnu/java/awt/peer/ClasspathTextLayoutPeer.lo \
+ gnu/java/beans/decoder/AbstractContext.lo \
+ gnu/java/beans/decoder/AbstractCreatableObjectContext.lo \
+ gnu/java/beans/decoder/AbstractElementHandler.lo \
+ gnu/java/beans/decoder/AbstractObjectContext.lo \
+ gnu/java/beans/decoder/ArrayContext.lo \
+ gnu/java/beans/decoder/ArrayHandler.lo \
+ gnu/java/beans/decoder/AssemblyException.lo \
+ gnu/java/beans/decoder/BooleanHandler.lo \
+ gnu/java/beans/decoder/ByteHandler.lo \
+ gnu/java/beans/decoder/CharHandler.lo \
+ gnu/java/beans/decoder/ClassHandler.lo \
+ gnu/java/beans/decoder/ConstructorContext.lo \
+ gnu/java/beans/decoder/Context.lo \
+ gnu/java/beans/decoder/DecoderContext.lo \
+ gnu/java/beans/decoder/DefaultExceptionListener.lo \
+ gnu/java/beans/decoder/DoubleHandler.lo \
+ gnu/java/beans/decoder/DummyContext.lo \
+ gnu/java/beans/decoder/DummyHandler.lo \
+ gnu/java/beans/decoder/ElementHandler.lo \
+ gnu/java/beans/decoder/FloatHandler.lo \
+ gnu/java/beans/decoder/GrowableArrayContext.lo \
+ gnu/java/beans/decoder/IndexContext.lo \
+ gnu/java/beans/decoder/IntHandler.lo \
+ gnu/java/beans/decoder/JavaHandler.lo \
+ gnu/java/beans/decoder/LongHandler.lo \
+ gnu/java/beans/decoder/MethodContext.lo \
+ gnu/java/beans/decoder/MethodFinder.lo \
+ gnu/java/beans/decoder/NullHandler.lo \
+ gnu/java/beans/decoder/ObjectContext.lo \
+ gnu/java/beans/decoder/ObjectHandler.lo \
+ gnu/java/beans/decoder/PersistenceParser.lo \
+ gnu/java/beans/decoder/PropertyContext.lo \
+ gnu/java/beans/decoder/ShortHandler.lo \
+ gnu/java/beans/decoder/SimpleHandler.lo \
+ gnu/java/beans/decoder/StaticMethodContext.lo \
+ gnu/java/beans/decoder/StringHandler.lo \
+ gnu/java/beans/decoder/VoidHandler.lo \
gnu/java/beans/editors/ColorEditor.lo \
gnu/java/beans/editors/FontEditor.lo \
gnu/java/beans/editors/NativeBooleanEditor.lo \
@@ -2842,9 +2965,9 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
gnu/java/beans/editors/NativeLongEditor.lo \
gnu/java/beans/editors/NativeShortEditor.lo \
gnu/java/beans/editors/StringEditor.lo \
- gnu/java/beans/info/ComponentBeanInfo.lo \
gnu/java/beans/BeanInfoEmbryo.lo \
- gnu/java/beans/EmptyBeanInfo.lo \
+ gnu/java/beans/DummyAppletContext.lo \
+ gnu/java/beans/DummyAppletStub.lo \
gnu/java/beans/ExplicitBeanInfo.lo \
gnu/java/beans/IntrospectionIncubator.lo java/applet/Applet.lo \
java/applet/AppletStub.lo java/applet/AppletContext.lo \
@@ -3116,7 +3239,7 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
java/beans/VetoableChangeListener.lo \
java/beans/VetoableChangeListenerProxy.lo \
java/beans/VetoableChangeSupport.lo java/beans/Visibility.lo \
- java/beans/AppletInitializer.lo \
+ java/beans/AppletInitializer.lo java/beans/XMLDecoder.lo \
javax/swing/border/AbstractBorder.lo \
javax/swing/border/BevelBorder.lo javax/swing/border/Border.lo \
javax/swing/border/CompoundBorder.lo \
@@ -3139,6 +3262,7 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
javax/swing/plaf/basic/BasicComboPopup.lo \
javax/swing/plaf/basic/BasicDesktopIconUI.lo \
javax/swing/plaf/basic/BasicDesktopPaneUI.lo \
+ javax/swing/plaf/basic/BasicEditorPaneUI.lo \
javax/swing/plaf/basic/BasicFormattedTextFieldUI.lo \
javax/swing/plaf/basic/BasicGraphicsUtils.lo \
javax/swing/plaf/basic/BasicInternalFrameTitlePane.lo \
@@ -3189,7 +3313,9 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
javax/swing/plaf/PanelUI.lo javax/swing/plaf/ScrollPaneUI.lo \
javax/swing/plaf/TabbedPaneUI.lo javax/swing/plaf/TextUI.lo \
javax/swing/plaf/TreeUI.lo javax/swing/plaf/ViewportUI.lo \
+ javax/swing/plaf/metal/DefaultMetalTheme.lo \
javax/swing/plaf/metal/MetalLookAndFeel.lo \
+ javax/swing/plaf/metal/MetalTheme.lo \
javax/swing/plaf/ColorUIResource.lo \
javax/swing/plaf/DimensionUIResource.lo \
javax/swing/plaf/FontUIResource.lo \
@@ -3212,7 +3338,7 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
javax/swing/plaf/SpinnerUI.lo javax/swing/plaf/SplitPaneUI.lo \
javax/swing/plaf/TableHeaderUI.lo javax/swing/plaf/TableUI.lo \
javax/swing/plaf/ToolBarUI.lo javax/swing/plaf/ToolTipUI.lo \
- javax/swing/AbstractListModel.lo javax/swing/AbstractSet.lo \
+ javax/swing/AbstractListModel.lo \
javax/swing/colorchooser/AbstractColorChooserPanel.lo \
javax/swing/colorchooser/ColorChooserComponentFactory.lo \
javax/swing/colorchooser/ColorSelectionModel.lo \
@@ -3239,10 +3365,10 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
javax/swing/ButtonGroup.lo javax/swing/ButtonModel.lo \
javax/swing/ComponentInputMap.lo \
javax/swing/DefaultButtonModel.lo \
- javax/swing/DefaultCellRenderer.lo \
javax/swing/DefaultListModel.lo \
javax/swing/DefaultListSelectionModel.lo javax/swing/Icon.lo \
javax/swing/ImageIcon.lo javax/swing/InputMap.lo \
+ javax/swing/InternalFrameFocusTraversalPolicy.lo \
javax/swing/JApplet.lo javax/swing/JButton.lo \
javax/swing/JCheckBox.lo javax/swing/JComponent.lo \
javax/swing/JDialog.lo javax/swing/JEditorPane.lo \
@@ -3257,15 +3383,18 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
javax/swing/JToggleButton.lo javax/swing/JToolTip.lo \
javax/swing/JTree.lo javax/swing/JViewport.lo \
javax/swing/JWindow.lo javax/swing/KeyStroke.lo \
+ javax/swing/LayoutFocusTraversalPolicy.lo \
javax/swing/ListCellRenderer.lo javax/swing/ListModel.lo \
javax/swing/ListSelectionModel.lo javax/swing/LookAndFeel.lo \
- javax/swing/Scrollable.lo javax/swing/SpinnerListModel.lo \
- javax/swing/SpinnerModel.lo javax/swing/SpinnerNumberModel.lo \
- javax/swing/Spring.lo javax/swing/SpringLayout.lo \
- javax/swing/SwingConstants.lo javax/swing/SwingUtilities.lo \
- javax/swing/Timer.lo javax/swing/ToolTipManager.lo \
- javax/swing/TransferHandler.lo javax/swing/UIDefaults.lo \
- javax/swing/UIManager.lo \
+ javax/swing/Scrollable.lo \
+ javax/swing/SortingFocusTraversalPolicy.lo \
+ javax/swing/SpinnerDateModel.lo \
+ javax/swing/SpinnerListModel.lo javax/swing/SpinnerModel.lo \
+ javax/swing/SpinnerNumberModel.lo javax/swing/Spring.lo \
+ javax/swing/SpringLayout.lo javax/swing/SwingConstants.lo \
+ javax/swing/SwingUtilities.lo javax/swing/Timer.lo \
+ javax/swing/ToolTipManager.lo javax/swing/TransferHandler.lo \
+ javax/swing/UIDefaults.lo javax/swing/UIManager.lo \
javax/swing/UnsupportedLookAndFeelException.lo \
javax/swing/event/AncestorEvent.lo \
javax/swing/event/AncestorListener.lo \
@@ -3317,6 +3446,7 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
javax/swing/text/DefaultCaret.lo \
javax/swing/text/DefaultEditorKit.lo \
javax/swing/text/DefaultHighlighter.lo \
+ javax/swing/text/DefaultStyledDocument.lo \
javax/swing/text/Document.lo \
javax/swing/text/DocumentFilter.lo \
javax/swing/text/EditorKit.lo javax/swing/text/Element.lo \
@@ -3331,7 +3461,8 @@ am__objects_11 = gnu/awt/LightweightRedirector.lo \
javax/swing/text/PlainView.lo javax/swing/text/Position.lo \
javax/swing/text/Segment.lo \
javax/swing/text/SimpleAttributeSet.lo \
- javax/swing/text/Style.lo javax/swing/text/StyleConstants.lo \
+ javax/swing/text/StringContent.lo javax/swing/text/Style.lo \
+ javax/swing/text/StyleConstants.lo \
javax/swing/text/StyleContext.lo \
javax/swing/text/StyledDocument.lo \
javax/swing/text/StyledEditorKit.lo \
@@ -3430,6 +3561,9 @@ am__objects_13 = javax/imageio/ImageWriteParam.lo \
javax/imageio/spi/ImageReaderWriterSpi.lo \
javax/imageio/spi/ImageInputStreamSpi.lo \
javax/imageio/spi/RegisterableService.lo \
+ javax/imageio/metadata/IIOAttr.lo \
+ javax/imageio/metadata/IIONamedNodeMap.lo \
+ javax/imageio/metadata/IIONodeList.lo \
javax/imageio/metadata/IIOMetadataFormatImpl.lo \
javax/imageio/metadata/IIOInvalidTreeException.lo \
javax/imageio/metadata/IIOMetadataFormat.lo \
@@ -3487,6 +3621,10 @@ am__objects_13 = javax/imageio/ImageWriteParam.lo \
javax/print/attribute/Attribute.lo \
javax/print/attribute/DocAttributeSet.lo \
javax/print/attribute/PrintRequestAttributeSet.lo \
+ javax/print/attribute/standard/Chromaticity.lo \
+ javax/print/attribute/standard/Destination.lo \
+ javax/print/attribute/standard/MediaPrintableArea.lo \
+ javax/print/attribute/standard/MediaSize.lo \
javax/print/attribute/standard/NumberOfInterveningJobs.lo \
javax/print/attribute/standard/PrinterMakeAndModel.lo \
javax/print/attribute/standard/PrinterStateReason.lo \
@@ -4012,8 +4150,11 @@ am__objects_15 = $(am__objects_9) gnu/classpath/ServiceFactory.lo \
gnu/java/locale/LocaleInformation_zh_SG.lo \
gnu/java/locale/LocaleInformation_zh_TW.lo \
gnu/java/math/MPN.lo gnu/java/net/BASE64.lo \
+ gnu/java/net/CRLFInputStream.lo \
+ gnu/java/net/CRLFOutputStream.lo \
gnu/java/net/DefaultContentHandlerFactory.lo \
gnu/java/net/EmptyX509TrustManager.lo \
+ gnu/java/net/GetLocalHostAction.lo \
gnu/java/net/HeaderFieldHelper.lo \
gnu/java/net/LineInputStream.lo \
gnu/java/net/PlainDatagramSocketImpl.lo \
@@ -4023,6 +4164,22 @@ am__objects_15 = $(am__objects_9) gnu/classpath/ServiceFactory.lo \
gnu/java/net/protocol/core/Handler.lo \
gnu/java/net/protocol/file/Connection.lo \
gnu/java/net/protocol/file/Handler.lo \
+ gnu/java/net/protocol/ftp/ActiveModeDTP.lo \
+ gnu/java/net/protocol/ftp/BlockInputStream.lo \
+ gnu/java/net/protocol/ftp/BlockOutputStream.lo \
+ gnu/java/net/protocol/ftp/CompressedInputStream.lo \
+ gnu/java/net/protocol/ftp/CompressedOutputStream.lo \
+ gnu/java/net/protocol/ftp/DTP.lo \
+ gnu/java/net/protocol/ftp/DTPInputStream.lo \
+ gnu/java/net/protocol/ftp/DTPOutputStream.lo \
+ gnu/java/net/protocol/ftp/FTPConnection.lo \
+ gnu/java/net/protocol/ftp/FTPException.lo \
+ gnu/java/net/protocol/ftp/FTPResponse.lo \
+ gnu/java/net/protocol/ftp/FTPURLConnection.lo \
+ gnu/java/net/protocol/ftp/Handler.lo \
+ gnu/java/net/protocol/ftp/PassiveModeDTP.lo \
+ gnu/java/net/protocol/ftp/StreamInputStream.lo \
+ gnu/java/net/protocol/ftp/StreamOutputStream.lo \
gnu/java/net/protocol/gcjlib/Connection.lo \
gnu/java/net/protocol/gcjlib/Handler.lo \
gnu/java/net/protocol/http/Authenticator.lo \
@@ -4051,6 +4208,7 @@ am__objects_15 = $(am__objects_9) gnu/classpath/ServiceFactory.lo \
gnu/java/net/protocol/jar/Handler.lo \
gnu/java/nio/ChannelInputStream.lo \
gnu/java/nio/ChannelOutputStream.lo \
+ gnu/java/nio/ChannelReader.lo \
gnu/java/nio/DatagramChannelImpl.lo \
gnu/java/nio/DatagramChannelSelectionKey.lo \
gnu/java/nio/FileLockImpl.lo \
@@ -4079,12 +4237,18 @@ am__objects_15 = $(am__objects_9) gnu/classpath/ServiceFactory.lo \
gnu/java/security/action/GetPropertyAction.lo \
gnu/java/security/action/GetSecurityPropertyAction.lo \
gnu/java/security/action/SetAccessibleAction.lo \
+ gnu/java/security/ber/BER.lo \
+ gnu/java/security/ber/BEREncodingException.lo \
+ gnu/java/security/ber/BERReader.lo \
+ gnu/java/security/ber/BERValue.lo \
gnu/java/security/der/BitString.lo \
gnu/java/security/der/DER.lo \
gnu/java/security/der/DEREncodingException.lo \
gnu/java/security/der/DERReader.lo \
gnu/java/security/der/DERValue.lo \
gnu/java/security/der/DERWriter.lo \
+ gnu/java/security/pkcs/PKCS7SignedData.lo \
+ gnu/java/security/pkcs/SignerInfo.lo \
gnu/java/security/provider/CollectionCertStoreImpl.lo \
gnu/java/security/provider/DSAKeyFactory.lo \
gnu/java/security/provider/DSAKeyPairGenerator.lo \
@@ -4492,20 +4656,22 @@ am__objects_17 = gnu/xml/xpath/EqualityExpr.lo \
gnu/xml/util/Resolver.lo gnu/xml/util/DoParse.lo \
gnu/xml/util/XHTMLWriter.lo \
gnu/xml/util/SAXNullTransformerFactory.lo \
- gnu/xml/dom/DomCDATA.lo gnu/xml/dom/DomXPathNSResolver.lo \
- gnu/xml/dom/ls/DomLSEx.lo \
+ gnu/xml/dom/DomXPathNSResolver.lo \
gnu/xml/dom/ls/FilteredSAXEventSink.lo \
+ gnu/xml/dom/ls/DomLSException.lo \
gnu/xml/dom/ls/DomLSSerializer.lo gnu/xml/dom/ls/DomLSInput.lo \
gnu/xml/dom/ls/DomLSOutput.lo gnu/xml/dom/ls/SAXEventSink.lo \
gnu/xml/dom/ls/DomLSParser.lo \
gnu/xml/dom/ls/ReaderInputStream.lo \
gnu/xml/dom/ls/WriterOutputStream.lo gnu/xml/dom/DomElement.lo \
gnu/xml/dom/DomNsNode.lo gnu/xml/dom/DomAttr.lo \
- gnu/xml/dom/DomPI.lo gnu/xml/dom/DTDAttributeTypeInfo.lo \
+ gnu/xml/dom/DTDAttributeTypeInfo.lo \
gnu/xml/dom/DomDocumentBuilder.lo \
- gnu/xml/dom/DTDElementTypeInfo.lo gnu/xml/dom/DomEx.lo \
- gnu/xml/dom/DomDocument.lo gnu/xml/dom/DomXPathExpression.lo \
+ gnu/xml/dom/DTDElementTypeInfo.lo gnu/xml/dom/DomDocument.lo \
+ gnu/xml/dom/DomXPathExpression.lo \
gnu/xml/dom/DomDocumentConfiguration.lo \
+ gnu/xml/dom/DomDocumentFragment.lo \
+ gnu/xml/dom/DomProcessingInstruction.lo \
gnu/xml/dom/Consumer.lo gnu/xml/dom/DomComment.lo \
gnu/xml/dom/DomCharacterData.lo gnu/xml/dom/DomExtern.lo \
gnu/xml/dom/DomEntityReference.lo \
@@ -4518,8 +4684,8 @@ am__objects_17 = gnu/xml/xpath/EqualityExpr.lo \
gnu/xml/dom/DomText.lo gnu/xml/dom/DomNSResolverContext.lo \
gnu/xml/dom/DomNodeIterator.lo gnu/xml/dom/DomNotation.lo \
gnu/xml/dom/JAXPFactory.lo gnu/xml/dom/DomIterator.lo \
- gnu/xml/dom/DomFragment.lo gnu/xml/dom/DomEvent.lo \
- gnu/xml/dom/DomEntity.lo \
+ gnu/xml/dom/DomEvent.lo gnu/xml/dom/DomEntity.lo \
+ gnu/xml/dom/DomCDATASection.lo gnu/xml/dom/DomDOMException.lo \
gnu/xml/transform/GenerateIdFunction.lo \
gnu/xml/transform/FormatNumberFunction.lo \
gnu/xml/transform/ValueOfNode.lo \
@@ -4579,16 +4745,20 @@ am__objects_18 = java/lang/ConcreteProcess.lo \
@USING_POSIX_THREADS_TRUE@am__objects_26 = posix-threads.lo
@USING_WIN32_THREADS_TRUE@am__objects_27 = win32-threads.lo
@USING_NO_THREADS_TRUE@am__objects_28 = no-threads.lo
-am_libgcj_la_OBJECTS = prims.lo jni.lo exception.lo link.lo \
- defineclass.lo interpret.lo verify.lo $(am__objects_6) \
+am_libgcj0_convenience_la_OBJECTS = prims.lo jni.lo exception.lo \
+ link.lo defineclass.lo interpret.lo verify.lo $(am__objects_6) \
$(am__objects_7) $(am__objects_16) $(am__objects_17) \
$(am__objects_18) $(am__objects_19) $(am__objects_20) \
$(am__objects_21) $(am__objects_22) $(am__objects_23) \
$(am__objects_24) $(am__objects_25) $(am__objects_26) \
$(am__objects_27) $(am__objects_28)
-libgcj_la_OBJECTS = $(am_libgcj_la_OBJECTS)
+libgcj0_convenience_la_OBJECTS = $(am_libgcj0_convenience_la_OBJECTS)
am_libgij_la_OBJECTS = gij.lo
libgij_la_OBJECTS = $(am_libgij_la_OBJECTS)
+libjawt_la_DEPENDENCIES = lib-gnu-java-awt-peer-gtk.la
+am_libjawt_la_OBJECTS = libjawt_la-jawt.lo
+libjawt_la_OBJECTS = $(am_libjawt_la_OBJECTS)
+@GTK_AWT_TRUE@am_libjawt_la_rpath = -rpath $(toolexeclibdir)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am_gcj_dbtool_OBJECTS = gnu/gcj/tools/gcj_dbtool/Main.$(OBJEXT)
@@ -4634,12 +4804,15 @@ LTGCJCOMPILE = $(LIBTOOL) --mode=compile $(GCJ) $(AM_GCJFLAGS) \
GCJLD = $(GCJ)
SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) \
$(lib_gnu_java_awt_peer_gtk_la_SOURCES) $(libgcj_la_SOURCES) \
- $(libgij_la_SOURCES) $(gcj_dbtool_SOURCES) \
+ $(libgcj0_convenience_la_SOURCES) $(libgij_la_SOURCES) \
+ $(libjawt_la_SOURCES) $(gcj_dbtool_SOURCES) \
$(gen_from_JIS_SOURCES) $(gij_SOURCES) $(grmic_SOURCES) \
$(grmiregistry_SOURCES) $(jv_convert_SOURCES)
DIST_SOURCES = $(lib_gnu_awt_xlib_la_SOURCES) \
$(am__lib_gnu_java_awt_peer_gtk_la_SOURCES_DIST) \
- $(am__libgcj_la_SOURCES_DIST) $(libgij_la_SOURCES) \
+ $(libgcj_la_SOURCES) \
+ $(am__libgcj0_convenience_la_SOURCES_DIST) \
+ $(libgij_la_SOURCES) $(libjawt_la_SOURCES) \
$(gcj_dbtool_SOURCES) $(am__gen_from_JIS_SOURCES_DIST) \
$(gij_SOURCES) $(grmic_SOURCES) $(grmiregistry_SOURCES) \
$(jv_convert_SOURCES)
@@ -4927,8 +5100,10 @@ write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach o
@XLIB_AWT_TRUE@cond_xlib_ltlibrary = lib-gnu-awt-xlib.la
@GTK_AWT_FALSE@cond_gtk_ltlibrary =
@GTK_AWT_TRUE@cond_gtk_ltlibrary = lib-gnu-java-awt-peer-gtk.la
+@GTK_AWT_FALSE@cond_gtk_jawt_ltlibrary =
+@GTK_AWT_TRUE@cond_gtk_jawt_ltlibrary = libjawt.la
toolexeclib_LTLIBRARIES = libgcj.la libgij.la \
- $(cond_gtk_ltlibrary) $(cond_xlib_ltlibrary)
+ $(cond_gtk_ltlibrary) $(cond_gtk_jawt_ltlibrary) $(cond_xlib_ltlibrary)
toolexecmainlib_DATA = libgcj.spec
pkgconfigdir = $(libdir)/pkgconfig
@@ -4981,7 +5156,12 @@ libgij_la_LIBADD = -L$(here)/.libs libgcj.la
libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
-libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
+
+# Work around libtool wanting to do piece-wise linking with -r. Using a
+# convenience library suddenly invokes the --whole-archive path instead.
+# This allows the build to succeed for targets that allocate multiple got
+# subsections in the linker, such as Alpha and MIPS.
+libgcj0_convenience_la_SOURCES = prims.cc jni.cc exception.cc \
link.cc defineclass.cc interpret.cc verify.cc \
$(nat_source_files) $(math_c_source_files) $(java_source_files) \
$(gnu_xml_source_files) $(built_java_source_files) \
@@ -4991,10 +5171,8 @@ libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
$(DARWIN_CRT_SRC) \
$(POSIX_THREAD_SRC) $(WIN32_THREAD_SRC) $(NO_THREAD_SRC)
-libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
- java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
- $(LIBLTDL) $(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
-
+noinst_LTLIBRARIES = libgcj0_convenience.la
+libgcj_la_SOURCES =
nat_files = $(nat_source_files:.cc=.lo)
xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
@@ -5007,8 +5185,13 @@ libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(THREADLIBS) \
libgcj_la_LIBADD = \
external/sax/libsax_convenience.la \
external/w3c_dom/libw3c_convenience.la \
+ libgcj0_convenience.la \
$(LIBFFI) $(ZLIBS) $(GCLIBS) $(propertyo_files)
+libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
+ java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h \
+ $(libgcj_la_LIBADD)
+
libgcj_la_LINK = $(LIBLINK)
@GTK_CAIRO_FALSE@gtk_cairo_c_source_files =
@@ -5019,12 +5202,11 @@ libgcj_la_LINK = $(LIBLINK)
gtk_c_source_files = \
$(gtk_cairo_c_source_files) \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.c \
@@ -5041,7 +5223,6 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c \
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c \
@@ -5057,6 +5238,7 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
jni/gtk-peer/gthread-jni.c \
+jni/gtk-peer/gtk_jawt.c \
jni/classpath/jcl.c \
jni/classpath/jnilink.c \
jni/classpath/native_state.c \
@@ -5069,8 +5251,11 @@ gnu/java/awt/peer/gtk/GdkFontPeer.java \
gnu/java/awt/peer/gtk/GdkGlyphVector.java \
gnu/java/awt/peer/gtk/GdkGraphics.java \
gnu/java/awt/peer/gtk/GdkGraphics2D.java \
+gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java \
gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java \
gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
+gnu/java/awt/peer/gtk/GdkRobotPeer.java \
+gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java \
gnu/java/awt/peer/gtk/GtkButtonPeer.java \
gnu/java/awt/peer/gtk/GtkCanvasPeer.java \
gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java \
@@ -5089,7 +5274,6 @@ gnu/java/awt/peer/gtk/GtkImage.java \
gnu/java/awt/peer/gtk/GtkImagePainter.java \
gnu/java/awt/peer/gtk/GtkLabelPeer.java \
gnu/java/awt/peer/gtk/GtkListPeer.java \
-gnu/java/awt/peer/gtk/GtkMainThread.java \
gnu/java/awt/peer/gtk/GtkMenuBarPeer.java \
gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java \
gnu/java/awt/peer/gtk/GtkMenuItemPeer.java \
@@ -5121,15 +5305,23 @@ jni/classpath/primlib.h
lib_gnu_java_awt_peer_gtk_la_CFLAGS = \
-Ijniinclude -I$(srcdir)/jni/classpath \
-I$(srcdir)/jni/gtk-peer $(PEDANTIC_CFLAGS) $(GTK_CFLAGS) $(LIBART_CFLAGS) \
- $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS)
+ $(X_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS)
lib_gnu_java_awt_peer_gtk_la_GCJFLAGS = $(AM_GCJFLAGS) -fjni
lib_gnu_java_awt_peer_gtk_la_LIBADD = $(GTK_LIBS) $(GLIB_LIBS) $(LIBART_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS)
lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES = $(gtk_jni_headers) libgcj-@gcc_version@.jar libgcj.la libgcj.spec
lib_gnu_java_awt_peer_gtk_la_LDFLAGS = \
- -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) $(X_LIBS) -lXtst
lib_gnu_java_awt_peer_gtk_la_LINK = $(LIBLINK)
+libjawt_la_SOURCES = jawt.c
+libjawt_la_CFLAGS = -I$(srcdir)/jni/classpath $(PEDANTIC_CFLAGS) $(X_CFLAGS)
+libjawt_la_LIBADD = lib-gnu-java-awt-peer-gtk.la
+libjawt_la_LDFLAGS = \
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
+ $(LIBGCJ_LD_SYMBOLIC)
+
+libjawt_la_LINK = $(LIBLINK)
lib_gnu_awt_xlib_la_SOURCES = \
$(xlib_java_source_files) \
$(xlib_nat_source_files)
@@ -5137,6 +5329,7 @@ lib_gnu_awt_xlib_la_SOURCES = \
lib_gnu_awt_xlib_la_DEPENDENCIES = libgcj-@gcc_version@.jar libgcj.la libgcj.spec
lib_gnu_awt_xlib_la_LIBADD = $(xlib_javao_files)
lib_gnu_awt_xlib_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
-I../libstdc++-v3/include \
-I../libstdc++-v3/include/$(target_noncanonical) \
-I$(srcdir)/../libstdc++-v3/libsupc++
@@ -5155,7 +5348,7 @@ all_java_source_files = \
$(gnu_xml_source_files)
all_java_class_files = $(all_java_source_files:.java=.class)
-all_property_files = $(property_files) $(jgss_property_files) \
+all_property_files = $(property_files) \
java/util/logging/logging.properties
property_files = \
@@ -5288,6 +5481,43 @@ gnu/java/awt/peer/EmbeddedWindowPeer.java \
gnu/java/awt/peer/GLightweightPeer.java \
gnu/java/awt/peer/ClasspathFontPeer.java \
gnu/java/awt/peer/ClasspathTextLayoutPeer.java \
+gnu/java/beans/decoder/AbstractContext.java \
+gnu/java/beans/decoder/AbstractCreatableObjectContext.java \
+gnu/java/beans/decoder/AbstractElementHandler.java \
+gnu/java/beans/decoder/AbstractObjectContext.java \
+gnu/java/beans/decoder/ArrayContext.java \
+gnu/java/beans/decoder/ArrayHandler.java \
+gnu/java/beans/decoder/AssemblyException.java \
+gnu/java/beans/decoder/BooleanHandler.java \
+gnu/java/beans/decoder/ByteHandler.java \
+gnu/java/beans/decoder/CharHandler.java \
+gnu/java/beans/decoder/ClassHandler.java \
+gnu/java/beans/decoder/ConstructorContext.java \
+gnu/java/beans/decoder/Context.java \
+gnu/java/beans/decoder/DecoderContext.java \
+gnu/java/beans/decoder/DefaultExceptionListener.java \
+gnu/java/beans/decoder/DoubleHandler.java \
+gnu/java/beans/decoder/DummyContext.java \
+gnu/java/beans/decoder/DummyHandler.java \
+gnu/java/beans/decoder/ElementHandler.java \
+gnu/java/beans/decoder/FloatHandler.java \
+gnu/java/beans/decoder/GrowableArrayContext.java \
+gnu/java/beans/decoder/IndexContext.java \
+gnu/java/beans/decoder/IntHandler.java \
+gnu/java/beans/decoder/JavaHandler.java \
+gnu/java/beans/decoder/LongHandler.java \
+gnu/java/beans/decoder/MethodContext.java \
+gnu/java/beans/decoder/MethodFinder.java \
+gnu/java/beans/decoder/NullHandler.java \
+gnu/java/beans/decoder/ObjectContext.java \
+gnu/java/beans/decoder/ObjectHandler.java \
+gnu/java/beans/decoder/PersistenceParser.java \
+gnu/java/beans/decoder/PropertyContext.java \
+gnu/java/beans/decoder/ShortHandler.java \
+gnu/java/beans/decoder/SimpleHandler.java \
+gnu/java/beans/decoder/StaticMethodContext.java \
+gnu/java/beans/decoder/StringHandler.java \
+gnu/java/beans/decoder/VoidHandler.java \
gnu/java/beans/editors/ColorEditor.java \
gnu/java/beans/editors/FontEditor.java \
gnu/java/beans/editors/NativeBooleanEditor.java \
@@ -5298,9 +5528,9 @@ gnu/java/beans/editors/NativeIntEditor.java \
gnu/java/beans/editors/NativeLongEditor.java \
gnu/java/beans/editors/NativeShortEditor.java \
gnu/java/beans/editors/StringEditor.java \
-gnu/java/beans/info/ComponentBeanInfo.java \
gnu/java/beans/BeanInfoEmbryo.java \
-gnu/java/beans/EmptyBeanInfo.java \
+gnu/java/beans/DummyAppletContext.java \
+gnu/java/beans/DummyAppletStub.java \
gnu/java/beans/ExplicitBeanInfo.java \
gnu/java/beans/IntrospectionIncubator.java \
java/applet/Applet.java \
@@ -5680,6 +5910,7 @@ java/beans/VetoableChangeListenerProxy.java \
java/beans/VetoableChangeSupport.java \
java/beans/Visibility.java \
java/beans/AppletInitializer.java \
+java/beans/XMLDecoder.java \
javax/swing/border/AbstractBorder.java \
javax/swing/border/BevelBorder.java \
javax/swing/border/Border.java \
@@ -5705,6 +5936,7 @@ javax/swing/plaf/basic/BasicComboBoxRenderer.java \
javax/swing/plaf/basic/BasicComboPopup.java \
javax/swing/plaf/basic/BasicDesktopIconUI.java \
javax/swing/plaf/basic/BasicDesktopPaneUI.java \
+javax/swing/plaf/basic/BasicEditorPaneUI.java \
javax/swing/plaf/basic/BasicFormattedTextFieldUI.java \
javax/swing/plaf/basic/BasicGraphicsUtils.java \
javax/swing/plaf/basic/BasicInternalFrameTitlePane.java \
@@ -5761,7 +5993,9 @@ javax/swing/plaf/TabbedPaneUI.java \
javax/swing/plaf/TextUI.java \
javax/swing/plaf/TreeUI.java \
javax/swing/plaf/ViewportUI.java \
+javax/swing/plaf/metal/DefaultMetalTheme.java \
javax/swing/plaf/metal/MetalLookAndFeel.java \
+javax/swing/plaf/metal/MetalTheme.java \
javax/swing/plaf/ColorUIResource.java \
javax/swing/plaf/DimensionUIResource.java \
javax/swing/plaf/FontUIResource.java \
@@ -5791,7 +6025,6 @@ javax/swing/plaf/TableUI.java \
javax/swing/plaf/ToolBarUI.java \
javax/swing/plaf/ToolTipUI.java \
javax/swing/AbstractListModel.java \
-javax/swing/AbstractSet.java \
javax/swing/colorchooser/AbstractColorChooserPanel.java \
javax/swing/colorchooser/ColorChooserComponentFactory.java \
javax/swing/colorchooser/ColorSelectionModel.java \
@@ -5821,12 +6054,12 @@ javax/swing/ButtonGroup.java \
javax/swing/ButtonModel.java \
javax/swing/ComponentInputMap.java \
javax/swing/DefaultButtonModel.java \
-javax/swing/DefaultCellRenderer.java \
javax/swing/DefaultListModel.java \
javax/swing/DefaultListSelectionModel.java \
javax/swing/Icon.java \
javax/swing/ImageIcon.java \
javax/swing/InputMap.java \
+javax/swing/InternalFrameFocusTraversalPolicy.java \
javax/swing/JApplet.java \
javax/swing/JButton.java \
javax/swing/JCheckBox.java \
@@ -5855,11 +6088,14 @@ javax/swing/JTree.java \
javax/swing/JViewport.java \
javax/swing/JWindow.java \
javax/swing/KeyStroke.java \
+javax/swing/LayoutFocusTraversalPolicy.java \
javax/swing/ListCellRenderer.java \
javax/swing/ListModel.java \
javax/swing/ListSelectionModel.java \
javax/swing/LookAndFeel.java \
javax/swing/Scrollable.java \
+javax/swing/SortingFocusTraversalPolicy.java \
+javax/swing/SpinnerDateModel.java \
javax/swing/SpinnerListModel.java \
javax/swing/SpinnerModel.java \
javax/swing/SpinnerNumberModel.java \
@@ -5925,6 +6161,7 @@ javax/swing/text/ComponentView.java \
javax/swing/text/DefaultCaret.java \
javax/swing/text/DefaultEditorKit.java \
javax/swing/text/DefaultHighlighter.java \
+javax/swing/text/DefaultStyledDocument.java \
javax/swing/text/Document.java \
javax/swing/text/DocumentFilter.java \
javax/swing/text/EditorKit.java \
@@ -5943,6 +6180,7 @@ javax/swing/text/PlainView.java \
javax/swing/text/Position.java \
javax/swing/text/Segment.java \
javax/swing/text/SimpleAttributeSet.java \
+javax/swing/text/StringContent.java \
javax/swing/text/Style.java \
javax/swing/text/StyleConstants.java \
javax/swing/text/StyleContext.java \
@@ -6155,6 +6393,9 @@ javax/imageio/spi/IIOServiceProvider.java \
javax/imageio/spi/ImageReaderWriterSpi.java \
javax/imageio/spi/ImageInputStreamSpi.java \
javax/imageio/spi/RegisterableService.java \
+javax/imageio/metadata/IIOAttr.java \
+javax/imageio/metadata/IIONamedNodeMap.java \
+javax/imageio/metadata/IIONodeList.java \
javax/imageio/metadata/IIOMetadataFormatImpl.java \
javax/imageio/metadata/IIOInvalidTreeException.java \
javax/imageio/metadata/IIOMetadataFormat.java \
@@ -6219,6 +6460,10 @@ javax/print/attribute/HashPrintServiceAttributeSet.java \
javax/print/attribute/Attribute.java \
javax/print/attribute/DocAttributeSet.java \
javax/print/attribute/PrintRequestAttributeSet.java \
+javax/print/attribute/standard/Chromaticity.java \
+javax/print/attribute/standard/Destination.java \
+javax/print/attribute/standard/MediaPrintableArea.java \
+javax/print/attribute/standard/MediaSize.java \
javax/print/attribute/standard/NumberOfInterveningJobs.java \
javax/print/attribute/standard/PrinterMakeAndModel.java \
javax/print/attribute/standard/PrinterStateReason.java \
@@ -6701,10 +6946,9 @@ gnu/xml/util/Resolver.java \
gnu/xml/util/DoParse.java \
gnu/xml/util/XHTMLWriter.java \
gnu/xml/util/SAXNullTransformerFactory.java \
-gnu/xml/dom/DomCDATA.java \
gnu/xml/dom/DomXPathNSResolver.java \
-gnu/xml/dom/ls/DomLSEx.java \
gnu/xml/dom/ls/FilteredSAXEventSink.java \
+gnu/xml/dom/ls/DomLSException.java \
gnu/xml/dom/ls/DomLSSerializer.java \
gnu/xml/dom/ls/DomLSInput.java \
gnu/xml/dom/ls/DomLSOutput.java \
@@ -6715,14 +6959,14 @@ gnu/xml/dom/ls/WriterOutputStream.java \
gnu/xml/dom/DomElement.java \
gnu/xml/dom/DomNsNode.java \
gnu/xml/dom/DomAttr.java \
-gnu/xml/dom/DomPI.java \
gnu/xml/dom/DTDAttributeTypeInfo.java \
gnu/xml/dom/DomDocumentBuilder.java \
gnu/xml/dom/DTDElementTypeInfo.java \
-gnu/xml/dom/DomEx.java \
gnu/xml/dom/DomDocument.java \
gnu/xml/dom/DomXPathExpression.java \
gnu/xml/dom/DomDocumentConfiguration.java \
+gnu/xml/dom/DomDocumentFragment.java \
+gnu/xml/dom/DomProcessingInstruction.java \
gnu/xml/dom/Consumer.java \
gnu/xml/dom/DomComment.java \
gnu/xml/dom/DomCharacterData.java \
@@ -6742,9 +6986,10 @@ gnu/xml/dom/DomNodeIterator.java \
gnu/xml/dom/DomNotation.java \
gnu/xml/dom/JAXPFactory.java \
gnu/xml/dom/DomIterator.java \
-gnu/xml/dom/DomFragment.java \
gnu/xml/dom/DomEvent.java \
gnu/xml/dom/DomEntity.java \
+gnu/xml/dom/DomCDATASection.java \
+gnu/xml/dom/DomDOMException.java \
gnu/xml/transform/GenerateIdFunction.java \
gnu/xml/transform/FormatNumberFunction.java \
gnu/xml/transform/ValueOfNode.java \
@@ -7219,8 +7464,11 @@ gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
gnu/java/net/BASE64.java \
+gnu/java/net/CRLFInputStream.java \
+gnu/java/net/CRLFOutputStream.java \
gnu/java/net/DefaultContentHandlerFactory.java \
gnu/java/net/EmptyX509TrustManager.java \
+gnu/java/net/GetLocalHostAction.java \
gnu/java/net/HeaderFieldHelper.java \
gnu/java/net/LineInputStream.java \
gnu/java/net/PlainDatagramSocketImpl.java \
@@ -7231,6 +7479,22 @@ gnu/java/net/protocol/core/CoreInputStream.java \
gnu/java/net/protocol/core/Handler.java \
gnu/java/net/protocol/file/Connection.java \
gnu/java/net/protocol/file/Handler.java \
+gnu/java/net/protocol/ftp/ActiveModeDTP.java \
+gnu/java/net/protocol/ftp/BlockInputStream.java \
+gnu/java/net/protocol/ftp/BlockOutputStream.java \
+gnu/java/net/protocol/ftp/CompressedInputStream.java \
+gnu/java/net/protocol/ftp/CompressedOutputStream.java \
+gnu/java/net/protocol/ftp/DTP.java \
+gnu/java/net/protocol/ftp/DTPInputStream.java \
+gnu/java/net/protocol/ftp/DTPOutputStream.java \
+gnu/java/net/protocol/ftp/FTPConnection.java \
+gnu/java/net/protocol/ftp/FTPException.java \
+gnu/java/net/protocol/ftp/FTPResponse.java \
+gnu/java/net/protocol/ftp/FTPURLConnection.java \
+gnu/java/net/protocol/ftp/Handler.java \
+gnu/java/net/protocol/ftp/PassiveModeDTP.java \
+gnu/java/net/protocol/ftp/StreamInputStream.java \
+gnu/java/net/protocol/ftp/StreamOutputStream.java \
gnu/java/net/protocol/gcjlib/Connection.java \
gnu/java/net/protocol/gcjlib/Handler.java \
gnu/java/net/protocol/http/Authenticator.java \
@@ -7259,6 +7523,7 @@ gnu/java/net/protocol/jar/Connection.java \
gnu/java/net/protocol/jar/Handler.java \
gnu/java/nio/ChannelInputStream.java \
gnu/java/nio/ChannelOutputStream.java \
+gnu/java/nio/ChannelReader.java \
gnu/java/nio/DatagramChannelImpl.java \
gnu/java/nio/DatagramChannelSelectionKey.java \
gnu/java/nio/FileLockImpl.java \
@@ -7294,12 +7559,18 @@ gnu/java/security/PolicyFile.java \
gnu/java/security/action/GetPropertyAction.java \
gnu/java/security/action/GetSecurityPropertyAction.java \
gnu/java/security/action/SetAccessibleAction.java \
+gnu/java/security/ber/BER.java \
+gnu/java/security/ber/BEREncodingException.java \
+gnu/java/security/ber/BERReader.java \
+gnu/java/security/ber/BERValue.java \
gnu/java/security/der/BitString.java \
gnu/java/security/der/DER.java \
gnu/java/security/der/DEREncodingException.java \
gnu/java/security/der/DERReader.java \
gnu/java/security/der/DERValue.java \
gnu/java/security/der/DERWriter.java \
+gnu/java/security/pkcs/PKCS7SignedData.java \
+gnu/java/security/pkcs/SignerInfo.java \
gnu/java/security/provider/CollectionCertStoreImpl.java \
gnu/java/security/provider/DSAKeyFactory.java \
gnu/java/security/provider/DSAKeyPairGenerator.java \
@@ -7838,6 +8109,7 @@ java/nio/natDirectByteBufferImpl.cc \
java/text/natCollator.cc \
java/util/natResourceBundle.cc \
java/util/natVMTimeZone.cc \
+java/util/logging/natLogger.cc \
java/util/zip/natDeflater.cc \
java/util/zip/natInflater.cc
@@ -7899,6 +8171,7 @@ gnu/gcj/xlib/natXExposeEvent.cc \
gnu/gcj/xlib/natXImage.cc \
gnu/gcj/xlib/natXUnmapEvent.cc
+sourcesdir = $(jardir)
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
@@ -7997,6 +8270,15 @@ libgcj-test.spec: $(top_builddir)/config.status $(srcdir)/libgcj-test.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
gnu/classpath/Configuration.java: $(top_builddir)/config.status $(top_srcdir)/gnu/classpath/Configuration.java.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(toolexeclibdir)" || $(mkdir_p) "$(DESTDIR)$(toolexeclibdir)"
@@ -8188,12 +8470,21 @@ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics.lo: \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics2D.lo: \
gnu/java/awt/peer/gtk/$(am__dirstamp) \
gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
+gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo: \
+ gnu/java/awt/peer/gtk/$(am__dirstamp) \
+ gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.lo: \
gnu/java/awt/peer/gtk/$(am__dirstamp) \
gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkPixbufDecoder.lo: \
gnu/java/awt/peer/gtk/$(am__dirstamp) \
gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
+gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo: \
+ gnu/java/awt/peer/gtk/$(am__dirstamp) \
+ gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
+gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo: \
+ gnu/java/awt/peer/gtk/$(am__dirstamp) \
+ gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.lo: \
gnu/java/awt/peer/gtk/$(am__dirstamp) \
gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
@@ -8248,9 +8539,6 @@ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkLabelPeer.lo: \
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkListPeer.lo: \
gnu/java/awt/peer/gtk/$(am__dirstamp) \
gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
-gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo: \
- gnu/java/awt/peer/gtk/$(am__dirstamp) \
- gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.lo: \
gnu/java/awt/peer/gtk/$(am__dirstamp) \
gnu/java/awt/peer/gtk/$(DEPDIR)/$(am__dirstamp)
@@ -8311,15 +8599,9 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.lo
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
@@ -8329,6 +8611,9 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvir
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
+jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo: \
+ jni/gtk-peer/$(am__dirstamp) \
+ jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
@@ -8377,9 +8662,6 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo:
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo: \
- jni/gtk-peer/$(am__dirstamp) \
- jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
@@ -8425,6 +8707,9 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMet
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo: \
jni/gtk-peer/$(am__dirstamp) \
jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
+jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo: \
+ jni/gtk-peer/$(am__dirstamp) \
+ jni/gtk-peer/$(DEPDIR)/$(am__dirstamp)
jni/classpath/$(am__dirstamp):
@$(mkdir_p) jni/classpath
@: > jni/classpath/$(am__dirstamp)
@@ -8681,6 +8966,14 @@ java/util/natResourceBundle.lo: java/util/$(am__dirstamp) \
java/util/$(DEPDIR)/$(am__dirstamp)
java/util/natVMTimeZone.lo: java/util/$(am__dirstamp) \
java/util/$(DEPDIR)/$(am__dirstamp)
+java/util/logging/$(am__dirstamp):
+ @$(mkdir_p) java/util/logging
+ @: > java/util/logging/$(am__dirstamp)
+java/util/logging/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) java/util/logging/$(DEPDIR)
+ @: > java/util/logging/$(DEPDIR)/$(am__dirstamp)
+java/util/logging/natLogger.lo: java/util/logging/$(am__dirstamp) \
+ java/util/logging/$(DEPDIR)/$(am__dirstamp)
java/util/zip/$(am__dirstamp):
@$(mkdir_p) java/util/zip
@: > java/util/zip/$(am__dirstamp)
@@ -9209,12 +9502,6 @@ java/util/VMTimeZone.lo: java/util/$(am__dirstamp) \
java/util/$(DEPDIR)/$(am__dirstamp)
java/util/WeakHashMap.lo: java/util/$(am__dirstamp) \
java/util/$(DEPDIR)/$(am__dirstamp)
-java/util/logging/$(am__dirstamp):
- @$(mkdir_p) java/util/logging
- @: > java/util/logging/$(am__dirstamp)
-java/util/logging/$(DEPDIR)/$(am__dirstamp):
- @$(mkdir_p) java/util/logging/$(DEPDIR)
- @: > java/util/logging/$(DEPDIR)/$(am__dirstamp)
java/util/logging/ConsoleHandler.lo: \
java/util/logging/$(am__dirstamp) \
java/util/logging/$(DEPDIR)/$(am__dirstamp)
@@ -9803,11 +10090,17 @@ gnu/java/math/MPN.lo: gnu/java/math/$(am__dirstamp) \
gnu/java/math/$(DEPDIR)/$(am__dirstamp)
gnu/java/net/BASE64.lo: gnu/java/net/$(am__dirstamp) \
gnu/java/net/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/CRLFInputStream.lo: gnu/java/net/$(am__dirstamp) \
+ gnu/java/net/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/CRLFOutputStream.lo: gnu/java/net/$(am__dirstamp) \
+ gnu/java/net/$(DEPDIR)/$(am__dirstamp)
gnu/java/net/DefaultContentHandlerFactory.lo: \
gnu/java/net/$(am__dirstamp) \
gnu/java/net/$(DEPDIR)/$(am__dirstamp)
gnu/java/net/EmptyX509TrustManager.lo: gnu/java/net/$(am__dirstamp) \
gnu/java/net/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/GetLocalHostAction.lo: gnu/java/net/$(am__dirstamp) \
+ gnu/java/net/$(DEPDIR)/$(am__dirstamp)
gnu/java/net/HeaderFieldHelper.lo: gnu/java/net/$(am__dirstamp) \
gnu/java/net/$(DEPDIR)/$(am__dirstamp)
gnu/java/net/LineInputStream.lo: gnu/java/net/$(am__dirstamp) \
@@ -9839,6 +10132,60 @@ gnu/java/net/protocol/file/Connection.lo: \
gnu/java/net/protocol/file/Handler.lo: \
gnu/java/net/protocol/file/$(am__dirstamp) \
gnu/java/net/protocol/file/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/net/protocol/ftp
+ @: > gnu/java/net/protocol/ftp/$(am__dirstamp)
+gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/net/protocol/ftp/$(DEPDIR)
+ @: > gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/ActiveModeDTP.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/BlockInputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/BlockOutputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/CompressedInputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/CompressedOutputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/DTP.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/DTPInputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/DTPOutputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/FTPConnection.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/FTPException.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/FTPResponse.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/FTPURLConnection.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/Handler.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/PassiveModeDTP.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/StreamInputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+gnu/java/net/protocol/ftp/StreamOutputStream.lo: \
+ gnu/java/net/protocol/ftp/$(am__dirstamp) \
+ gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
gnu/java/net/protocol/gcjlib/$(am__dirstamp):
@$(mkdir_p) gnu/java/net/protocol/gcjlib
@: > gnu/java/net/protocol/gcjlib/$(am__dirstamp)
@@ -9945,6 +10292,8 @@ gnu/java/nio/ChannelInputStream.lo: gnu/java/nio/$(am__dirstamp) \
gnu/java/nio/$(DEPDIR)/$(am__dirstamp)
gnu/java/nio/ChannelOutputStream.lo: gnu/java/nio/$(am__dirstamp) \
gnu/java/nio/$(DEPDIR)/$(am__dirstamp)
+gnu/java/nio/ChannelReader.lo: gnu/java/nio/$(am__dirstamp) \
+ gnu/java/nio/$(DEPDIR)/$(am__dirstamp)
gnu/java/nio/DatagramChannelImpl.lo: gnu/java/nio/$(am__dirstamp) \
gnu/java/nio/$(DEPDIR)/$(am__dirstamp)
gnu/java/nio/DatagramChannelSelectionKey.lo: \
@@ -10047,6 +10396,23 @@ gnu/java/security/action/GetSecurityPropertyAction.lo: \
gnu/java/security/action/SetAccessibleAction.lo: \
gnu/java/security/action/$(am__dirstamp) \
gnu/java/security/action/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/ber/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/security/ber
+ @: > gnu/java/security/ber/$(am__dirstamp)
+gnu/java/security/ber/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/security/ber/$(DEPDIR)
+ @: > gnu/java/security/ber/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/ber/BER.lo: gnu/java/security/ber/$(am__dirstamp) \
+ gnu/java/security/ber/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/ber/BEREncodingException.lo: \
+ gnu/java/security/ber/$(am__dirstamp) \
+ gnu/java/security/ber/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/ber/BERReader.lo: \
+ gnu/java/security/ber/$(am__dirstamp) \
+ gnu/java/security/ber/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/ber/BERValue.lo: \
+ gnu/java/security/ber/$(am__dirstamp) \
+ gnu/java/security/ber/$(DEPDIR)/$(am__dirstamp)
gnu/java/security/der/$(am__dirstamp):
@$(mkdir_p) gnu/java/security/der
@: > gnu/java/security/der/$(am__dirstamp)
@@ -10070,6 +10436,18 @@ gnu/java/security/der/DERValue.lo: \
gnu/java/security/der/DERWriter.lo: \
gnu/java/security/der/$(am__dirstamp) \
gnu/java/security/der/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/pkcs/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/security/pkcs
+ @: > gnu/java/security/pkcs/$(am__dirstamp)
+gnu/java/security/pkcs/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/security/pkcs/$(DEPDIR)
+ @: > gnu/java/security/pkcs/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/pkcs/PKCS7SignedData.lo: \
+ gnu/java/security/pkcs/$(am__dirstamp) \
+ gnu/java/security/pkcs/$(DEPDIR)/$(am__dirstamp)
+gnu/java/security/pkcs/SignerInfo.lo: \
+ gnu/java/security/pkcs/$(am__dirstamp) \
+ gnu/java/security/pkcs/$(DEPDIR)/$(am__dirstamp)
gnu/java/security/provider/$(am__dirstamp):
@$(mkdir_p) gnu/java/security/provider
@: > gnu/java/security/provider/$(am__dirstamp)
@@ -11695,6 +12073,123 @@ gnu/java/awt/peer/ClasspathFontPeer.lo: \
gnu/java/awt/peer/ClasspathTextLayoutPeer.lo: \
gnu/java/awt/peer/$(am__dirstamp) \
gnu/java/awt/peer/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/beans/decoder
+ @: > gnu/java/beans/decoder/$(am__dirstamp)
+gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp):
+ @$(mkdir_p) gnu/java/beans/decoder/$(DEPDIR)
+ @: > gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/AbstractContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/AbstractCreatableObjectContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/AbstractElementHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/AbstractObjectContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ArrayContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ArrayHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/AssemblyException.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/BooleanHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ByteHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/CharHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ClassHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ConstructorContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/Context.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/DecoderContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/DefaultExceptionListener.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/DoubleHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/DummyContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/DummyHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ElementHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/FloatHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/GrowableArrayContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/IndexContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/IntHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/JavaHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/LongHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/MethodContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/MethodFinder.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/NullHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ObjectContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ObjectHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/PersistenceParser.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/PropertyContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/ShortHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/SimpleHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/StaticMethodContext.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/StringHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/decoder/VoidHandler.lo: \
+ gnu/java/beans/decoder/$(am__dirstamp) \
+ gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
gnu/java/beans/editors/$(am__dirstamp):
@$(mkdir_p) gnu/java/beans/editors
@: > gnu/java/beans/editors/$(am__dirstamp)
@@ -11731,15 +12226,6 @@ gnu/java/beans/editors/NativeShortEditor.lo: \
gnu/java/beans/editors/StringEditor.lo: \
gnu/java/beans/editors/$(am__dirstamp) \
gnu/java/beans/editors/$(DEPDIR)/$(am__dirstamp)
-gnu/java/beans/info/$(am__dirstamp):
- @$(mkdir_p) gnu/java/beans/info
- @: > gnu/java/beans/info/$(am__dirstamp)
-gnu/java/beans/info/$(DEPDIR)/$(am__dirstamp):
- @$(mkdir_p) gnu/java/beans/info/$(DEPDIR)
- @: > gnu/java/beans/info/$(DEPDIR)/$(am__dirstamp)
-gnu/java/beans/info/ComponentBeanInfo.lo: \
- gnu/java/beans/info/$(am__dirstamp) \
- gnu/java/beans/info/$(DEPDIR)/$(am__dirstamp)
gnu/java/beans/$(am__dirstamp):
@$(mkdir_p) gnu/java/beans
@: > gnu/java/beans/$(am__dirstamp)
@@ -11748,7 +12234,9 @@ gnu/java/beans/$(DEPDIR)/$(am__dirstamp):
@: > gnu/java/beans/$(DEPDIR)/$(am__dirstamp)
gnu/java/beans/BeanInfoEmbryo.lo: gnu/java/beans/$(am__dirstamp) \
gnu/java/beans/$(DEPDIR)/$(am__dirstamp)
-gnu/java/beans/EmptyBeanInfo.lo: gnu/java/beans/$(am__dirstamp) \
+gnu/java/beans/DummyAppletContext.lo: gnu/java/beans/$(am__dirstamp) \
+ gnu/java/beans/$(DEPDIR)/$(am__dirstamp)
+gnu/java/beans/DummyAppletStub.lo: gnu/java/beans/$(am__dirstamp) \
gnu/java/beans/$(DEPDIR)/$(am__dirstamp)
gnu/java/beans/ExplicitBeanInfo.lo: gnu/java/beans/$(am__dirstamp) \
gnu/java/beans/$(DEPDIR)/$(am__dirstamp)
@@ -12671,6 +13159,8 @@ java/beans/Visibility.lo: java/beans/$(am__dirstamp) \
java/beans/$(DEPDIR)/$(am__dirstamp)
java/beans/AppletInitializer.lo: java/beans/$(am__dirstamp) \
java/beans/$(DEPDIR)/$(am__dirstamp)
+java/beans/XMLDecoder.lo: java/beans/$(am__dirstamp) \
+ java/beans/$(DEPDIR)/$(am__dirstamp)
javax/swing/border/$(am__dirstamp):
@$(mkdir_p) javax/swing/border
@: > javax/swing/border/$(am__dirstamp)
@@ -12755,6 +13245,9 @@ javax/swing/plaf/basic/BasicDesktopIconUI.lo: \
javax/swing/plaf/basic/BasicDesktopPaneUI.lo: \
javax/swing/plaf/basic/$(am__dirstamp) \
javax/swing/plaf/basic/$(DEPDIR)/$(am__dirstamp)
+javax/swing/plaf/basic/BasicEditorPaneUI.lo: \
+ javax/swing/plaf/basic/$(am__dirstamp) \
+ javax/swing/plaf/basic/$(DEPDIR)/$(am__dirstamp)
javax/swing/plaf/basic/BasicFormattedTextFieldUI.lo: \
javax/swing/plaf/basic/$(am__dirstamp) \
javax/swing/plaf/basic/$(DEPDIR)/$(am__dirstamp)
@@ -12923,9 +13416,15 @@ javax/swing/plaf/metal/$(am__dirstamp):
javax/swing/plaf/metal/$(DEPDIR)/$(am__dirstamp):
@$(mkdir_p) javax/swing/plaf/metal/$(DEPDIR)
@: > javax/swing/plaf/metal/$(DEPDIR)/$(am__dirstamp)
+javax/swing/plaf/metal/DefaultMetalTheme.lo: \
+ javax/swing/plaf/metal/$(am__dirstamp) \
+ javax/swing/plaf/metal/$(DEPDIR)/$(am__dirstamp)
javax/swing/plaf/metal/MetalLookAndFeel.lo: \
javax/swing/plaf/metal/$(am__dirstamp) \
javax/swing/plaf/metal/$(DEPDIR)/$(am__dirstamp)
+javax/swing/plaf/metal/MetalTheme.lo: \
+ javax/swing/plaf/metal/$(am__dirstamp) \
+ javax/swing/plaf/metal/$(DEPDIR)/$(am__dirstamp)
javax/swing/plaf/ColorUIResource.lo: javax/swing/plaf/$(am__dirstamp) \
javax/swing/plaf/$(DEPDIR)/$(am__dirstamp)
javax/swing/plaf/DimensionUIResource.lo: \
@@ -12989,8 +13488,6 @@ javax/swing/plaf/ToolTipUI.lo: javax/swing/plaf/$(am__dirstamp) \
javax/swing/plaf/$(DEPDIR)/$(am__dirstamp)
javax/swing/AbstractListModel.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
-javax/swing/AbstractSet.lo: javax/swing/$(am__dirstamp) \
- javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/colorchooser/$(am__dirstamp):
@$(mkdir_p) javax/swing/colorchooser
@: > javax/swing/colorchooser/$(am__dirstamp)
@@ -13085,8 +13582,6 @@ javax/swing/ComponentInputMap.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/DefaultButtonModel.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
-javax/swing/DefaultCellRenderer.lo: javax/swing/$(am__dirstamp) \
- javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/DefaultListModel.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/DefaultListSelectionModel.lo: javax/swing/$(am__dirstamp) \
@@ -13097,6 +13592,9 @@ javax/swing/ImageIcon.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/InputMap.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
+javax/swing/InternalFrameFocusTraversalPolicy.lo: \
+ javax/swing/$(am__dirstamp) \
+ javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/JApplet.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/JButton.lo: javax/swing/$(am__dirstamp) \
@@ -13153,6 +13651,9 @@ javax/swing/JWindow.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/KeyStroke.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
+javax/swing/LayoutFocusTraversalPolicy.lo: \
+ javax/swing/$(am__dirstamp) \
+ javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/ListCellRenderer.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/ListModel.lo: javax/swing/$(am__dirstamp) \
@@ -13163,6 +13664,11 @@ javax/swing/LookAndFeel.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/Scrollable.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
+javax/swing/SortingFocusTraversalPolicy.lo: \
+ javax/swing/$(am__dirstamp) \
+ javax/swing/$(DEPDIR)/$(am__dirstamp)
+javax/swing/SpinnerDateModel.lo: javax/swing/$(am__dirstamp) \
+ javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/SpinnerListModel.lo: javax/swing/$(am__dirstamp) \
javax/swing/$(DEPDIR)/$(am__dirstamp)
javax/swing/SpinnerModel.lo: javax/swing/$(am__dirstamp) \
@@ -13344,6 +13850,9 @@ javax/swing/text/DefaultEditorKit.lo: \
javax/swing/text/DefaultHighlighter.lo: \
javax/swing/text/$(am__dirstamp) \
javax/swing/text/$(DEPDIR)/$(am__dirstamp)
+javax/swing/text/DefaultStyledDocument.lo: \
+ javax/swing/text/$(am__dirstamp) \
+ javax/swing/text/$(DEPDIR)/$(am__dirstamp)
javax/swing/text/Document.lo: javax/swing/text/$(am__dirstamp) \
javax/swing/text/$(DEPDIR)/$(am__dirstamp)
javax/swing/text/DocumentFilter.lo: javax/swing/text/$(am__dirstamp) \
@@ -13384,6 +13893,8 @@ javax/swing/text/Segment.lo: javax/swing/text/$(am__dirstamp) \
javax/swing/text/SimpleAttributeSet.lo: \
javax/swing/text/$(am__dirstamp) \
javax/swing/text/$(DEPDIR)/$(am__dirstamp)
+javax/swing/text/StringContent.lo: javax/swing/text/$(am__dirstamp) \
+ javax/swing/text/$(DEPDIR)/$(am__dirstamp)
javax/swing/text/Style.lo: javax/swing/text/$(am__dirstamp) \
javax/swing/text/$(DEPDIR)/$(am__dirstamp)
javax/swing/text/StyleConstants.lo: javax/swing/text/$(am__dirstamp) \
@@ -13719,6 +14230,15 @@ javax/imageio/metadata/$(am__dirstamp):
javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp):
@$(mkdir_p) javax/imageio/metadata/$(DEPDIR)
@: > javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp)
+javax/imageio/metadata/IIOAttr.lo: \
+ javax/imageio/metadata/$(am__dirstamp) \
+ javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp)
+javax/imageio/metadata/IIONamedNodeMap.lo: \
+ javax/imageio/metadata/$(am__dirstamp) \
+ javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp)
+javax/imageio/metadata/IIONodeList.lo: \
+ javax/imageio/metadata/$(am__dirstamp) \
+ javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp)
javax/imageio/metadata/IIOMetadataFormatImpl.lo: \
javax/imageio/metadata/$(am__dirstamp) \
javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp)
@@ -13918,6 +14438,18 @@ javax/print/attribute/standard/$(am__dirstamp):
javax/print/attribute/standard/$(DEPDIR)/$(am__dirstamp):
@$(mkdir_p) javax/print/attribute/standard/$(DEPDIR)
@: > javax/print/attribute/standard/$(DEPDIR)/$(am__dirstamp)
+javax/print/attribute/standard/Chromaticity.lo: \
+ javax/print/attribute/standard/$(am__dirstamp) \
+ javax/print/attribute/standard/$(DEPDIR)/$(am__dirstamp)
+javax/print/attribute/standard/Destination.lo: \
+ javax/print/attribute/standard/$(am__dirstamp) \
+ javax/print/attribute/standard/$(DEPDIR)/$(am__dirstamp)
+javax/print/attribute/standard/MediaPrintableArea.lo: \
+ javax/print/attribute/standard/$(am__dirstamp) \
+ javax/print/attribute/standard/$(DEPDIR)/$(am__dirstamp)
+javax/print/attribute/standard/MediaSize.lo: \
+ javax/print/attribute/standard/$(am__dirstamp) \
+ javax/print/attribute/standard/$(DEPDIR)/$(am__dirstamp)
javax/print/attribute/standard/NumberOfInterveningJobs.lo: \
javax/print/attribute/standard/$(am__dirstamp) \
javax/print/attribute/standard/$(DEPDIR)/$(am__dirstamp)
@@ -15375,8 +15907,6 @@ gnu/xml/dom/$(am__dirstamp):
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp):
@$(mkdir_p) gnu/xml/dom/$(DEPDIR)
@: > gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
-gnu/xml/dom/DomCDATA.lo: gnu/xml/dom/$(am__dirstamp) \
- gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomXPathNSResolver.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/ls/$(am__dirstamp):
@@ -15385,11 +15915,11 @@ gnu/xml/dom/ls/$(am__dirstamp):
gnu/xml/dom/ls/$(DEPDIR)/$(am__dirstamp):
@$(mkdir_p) gnu/xml/dom/ls/$(DEPDIR)
@: > gnu/xml/dom/ls/$(DEPDIR)/$(am__dirstamp)
-gnu/xml/dom/ls/DomLSEx.lo: gnu/xml/dom/ls/$(am__dirstamp) \
- gnu/xml/dom/ls/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/ls/FilteredSAXEventSink.lo: \
gnu/xml/dom/ls/$(am__dirstamp) \
gnu/xml/dom/ls/$(DEPDIR)/$(am__dirstamp)
+gnu/xml/dom/ls/DomLSException.lo: gnu/xml/dom/ls/$(am__dirstamp) \
+ gnu/xml/dom/ls/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/ls/DomLSSerializer.lo: gnu/xml/dom/ls/$(am__dirstamp) \
gnu/xml/dom/ls/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/ls/DomLSInput.lo: gnu/xml/dom/ls/$(am__dirstamp) \
@@ -15410,22 +15940,22 @@ gnu/xml/dom/DomNsNode.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomAttr.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
-gnu/xml/dom/DomPI.lo: gnu/xml/dom/$(am__dirstamp) \
- gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DTDAttributeTypeInfo.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomDocumentBuilder.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DTDElementTypeInfo.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
-gnu/xml/dom/DomEx.lo: gnu/xml/dom/$(am__dirstamp) \
- gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomDocument.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomXPathExpression.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomDocumentConfiguration.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
+gnu/xml/dom/DomDocumentFragment.lo: gnu/xml/dom/$(am__dirstamp) \
+ gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
+gnu/xml/dom/DomProcessingInstruction.lo: gnu/xml/dom/$(am__dirstamp) \
+ gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/Consumer.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomComment.lo: gnu/xml/dom/$(am__dirstamp) \
@@ -15464,12 +15994,14 @@ gnu/xml/dom/JAXPFactory.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomIterator.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
-gnu/xml/dom/DomFragment.lo: gnu/xml/dom/$(am__dirstamp) \
- gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomEvent.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/dom/DomEntity.lo: gnu/xml/dom/$(am__dirstamp) \
gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
+gnu/xml/dom/DomCDATASection.lo: gnu/xml/dom/$(am__dirstamp) \
+ gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
+gnu/xml/dom/DomDOMException.lo: gnu/xml/dom/$(am__dirstamp) \
+ gnu/xml/dom/$(DEPDIR)/$(am__dirstamp)
gnu/xml/transform/$(am__dirstamp):
@$(mkdir_p) gnu/xml/transform
@: > gnu/xml/transform/$(am__dirstamp)
@@ -15610,8 +16142,12 @@ sysdep/$(DEPDIR)/$(am__dirstamp):
@: > sysdep/$(DEPDIR)/$(am__dirstamp)
sysdep/dwarf2-backtrace.lo: sysdep/$(am__dirstamp) \
sysdep/$(DEPDIR)/$(am__dirstamp)
+libgcj0_convenience.la: $(libgcj0_convenience_la_OBJECTS) $(libgcj0_convenience_la_DEPENDENCIES)
+ $(GCJLINK) $(libgcj0_convenience_la_LDFLAGS) $(libgcj0_convenience_la_OBJECTS) $(libgcj0_convenience_la_LIBADD) $(LIBS)
libgij.la: $(libgij_la_OBJECTS) $(libgij_la_DEPENDENCIES)
$(CXXLINK) -rpath $(toolexeclibdir) $(libgij_la_LDFLAGS) $(libgij_la_OBJECTS) $(libgij_la_LIBADD) $(LIBS)
+libjawt.la: $(libjawt_la_OBJECTS) $(libjawt_la_DEPENDENCIES)
+ $(libjawt_la_LINK) $(am_libjawt_la_rpath) $(libjawt_la_LDFLAGS) $(libjawt_la_OBJECTS) $(libjawt_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@@ -16014,10 +16550,16 @@ mostlyclean-compile:
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics2D.$(OBJEXT)
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics2D.lo
+ -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.$(OBJEXT)
+ -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.$(OBJEXT)
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkPixbufDecoder.$(OBJEXT)
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkPixbufDecoder.lo
+ -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.$(OBJEXT)
+ -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo
+ -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.$(OBJEXT)
+ -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkTextLayout.$(OBJEXT)
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkTextLayout.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.$(OBJEXT)
@@ -16056,8 +16598,6 @@ mostlyclean-compile:
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkLabelPeer.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkListPeer.$(OBJEXT)
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkListPeer.lo
- -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.$(OBJEXT)
- -rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.$(OBJEXT)
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.lo
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuComponentPeer.$(OBJEXT)
@@ -16088,12 +16628,88 @@ mostlyclean-compile:
-rm -f gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkWindowPeer.lo
-rm -f gnu/java/beans/BeanInfoEmbryo.$(OBJEXT)
-rm -f gnu/java/beans/BeanInfoEmbryo.lo
- -rm -f gnu/java/beans/EmptyBeanInfo.$(OBJEXT)
- -rm -f gnu/java/beans/EmptyBeanInfo.lo
+ -rm -f gnu/java/beans/DummyAppletContext.$(OBJEXT)
+ -rm -f gnu/java/beans/DummyAppletContext.lo
+ -rm -f gnu/java/beans/DummyAppletStub.$(OBJEXT)
+ -rm -f gnu/java/beans/DummyAppletStub.lo
-rm -f gnu/java/beans/ExplicitBeanInfo.$(OBJEXT)
-rm -f gnu/java/beans/ExplicitBeanInfo.lo
-rm -f gnu/java/beans/IntrospectionIncubator.$(OBJEXT)
-rm -f gnu/java/beans/IntrospectionIncubator.lo
+ -rm -f gnu/java/beans/decoder/AbstractContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/AbstractContext.lo
+ -rm -f gnu/java/beans/decoder/AbstractCreatableObjectContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/AbstractCreatableObjectContext.lo
+ -rm -f gnu/java/beans/decoder/AbstractElementHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/AbstractElementHandler.lo
+ -rm -f gnu/java/beans/decoder/AbstractObjectContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/AbstractObjectContext.lo
+ -rm -f gnu/java/beans/decoder/ArrayContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ArrayContext.lo
+ -rm -f gnu/java/beans/decoder/ArrayHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ArrayHandler.lo
+ -rm -f gnu/java/beans/decoder/AssemblyException.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/AssemblyException.lo
+ -rm -f gnu/java/beans/decoder/BooleanHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/BooleanHandler.lo
+ -rm -f gnu/java/beans/decoder/ByteHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ByteHandler.lo
+ -rm -f gnu/java/beans/decoder/CharHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/CharHandler.lo
+ -rm -f gnu/java/beans/decoder/ClassHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ClassHandler.lo
+ -rm -f gnu/java/beans/decoder/ConstructorContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ConstructorContext.lo
+ -rm -f gnu/java/beans/decoder/Context.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/Context.lo
+ -rm -f gnu/java/beans/decoder/DecoderContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/DecoderContext.lo
+ -rm -f gnu/java/beans/decoder/DefaultExceptionListener.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/DefaultExceptionListener.lo
+ -rm -f gnu/java/beans/decoder/DoubleHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/DoubleHandler.lo
+ -rm -f gnu/java/beans/decoder/DummyContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/DummyContext.lo
+ -rm -f gnu/java/beans/decoder/DummyHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/DummyHandler.lo
+ -rm -f gnu/java/beans/decoder/ElementHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ElementHandler.lo
+ -rm -f gnu/java/beans/decoder/FloatHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/FloatHandler.lo
+ -rm -f gnu/java/beans/decoder/GrowableArrayContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/GrowableArrayContext.lo
+ -rm -f gnu/java/beans/decoder/IndexContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/IndexContext.lo
+ -rm -f gnu/java/beans/decoder/IntHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/IntHandler.lo
+ -rm -f gnu/java/beans/decoder/JavaHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/JavaHandler.lo
+ -rm -f gnu/java/beans/decoder/LongHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/LongHandler.lo
+ -rm -f gnu/java/beans/decoder/MethodContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/MethodContext.lo
+ -rm -f gnu/java/beans/decoder/MethodFinder.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/MethodFinder.lo
+ -rm -f gnu/java/beans/decoder/NullHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/NullHandler.lo
+ -rm -f gnu/java/beans/decoder/ObjectContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ObjectContext.lo
+ -rm -f gnu/java/beans/decoder/ObjectHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ObjectHandler.lo
+ -rm -f gnu/java/beans/decoder/PersistenceParser.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/PersistenceParser.lo
+ -rm -f gnu/java/beans/decoder/PropertyContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/PropertyContext.lo
+ -rm -f gnu/java/beans/decoder/ShortHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/ShortHandler.lo
+ -rm -f gnu/java/beans/decoder/SimpleHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/SimpleHandler.lo
+ -rm -f gnu/java/beans/decoder/StaticMethodContext.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/StaticMethodContext.lo
+ -rm -f gnu/java/beans/decoder/StringHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/StringHandler.lo
+ -rm -f gnu/java/beans/decoder/VoidHandler.$(OBJEXT)
+ -rm -f gnu/java/beans/decoder/VoidHandler.lo
-rm -f gnu/java/beans/editors/ColorEditor.$(OBJEXT)
-rm -f gnu/java/beans/editors/ColorEditor.lo
-rm -f gnu/java/beans/editors/FontEditor.$(OBJEXT)
@@ -16114,8 +16730,6 @@ mostlyclean-compile:
-rm -f gnu/java/beans/editors/NativeShortEditor.lo
-rm -f gnu/java/beans/editors/StringEditor.$(OBJEXT)
-rm -f gnu/java/beans/editors/StringEditor.lo
- -rm -f gnu/java/beans/info/ComponentBeanInfo.$(OBJEXT)
- -rm -f gnu/java/beans/info/ComponentBeanInfo.lo
-rm -f gnu/java/io/ASN1ParsingException.$(OBJEXT)
-rm -f gnu/java/io/ASN1ParsingException.lo
-rm -f gnu/java/io/Base64InputStream.$(OBJEXT)
@@ -16418,10 +17032,16 @@ mostlyclean-compile:
-rm -f gnu/java/math/MPN.lo
-rm -f gnu/java/net/BASE64.$(OBJEXT)
-rm -f gnu/java/net/BASE64.lo
+ -rm -f gnu/java/net/CRLFInputStream.$(OBJEXT)
+ -rm -f gnu/java/net/CRLFInputStream.lo
+ -rm -f gnu/java/net/CRLFOutputStream.$(OBJEXT)
+ -rm -f gnu/java/net/CRLFOutputStream.lo
-rm -f gnu/java/net/DefaultContentHandlerFactory.$(OBJEXT)
-rm -f gnu/java/net/DefaultContentHandlerFactory.lo
-rm -f gnu/java/net/EmptyX509TrustManager.$(OBJEXT)
-rm -f gnu/java/net/EmptyX509TrustManager.lo
+ -rm -f gnu/java/net/GetLocalHostAction.$(OBJEXT)
+ -rm -f gnu/java/net/GetLocalHostAction.lo
-rm -f gnu/java/net/HeaderFieldHelper.$(OBJEXT)
-rm -f gnu/java/net/HeaderFieldHelper.lo
-rm -f gnu/java/net/LineInputStream.$(OBJEXT)
@@ -16448,6 +17068,38 @@ mostlyclean-compile:
-rm -f gnu/java/net/protocol/file/Connection.lo
-rm -f gnu/java/net/protocol/file/Handler.$(OBJEXT)
-rm -f gnu/java/net/protocol/file/Handler.lo
+ -rm -f gnu/java/net/protocol/ftp/ActiveModeDTP.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/ActiveModeDTP.lo
+ -rm -f gnu/java/net/protocol/ftp/BlockInputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/BlockInputStream.lo
+ -rm -f gnu/java/net/protocol/ftp/BlockOutputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/BlockOutputStream.lo
+ -rm -f gnu/java/net/protocol/ftp/CompressedInputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/CompressedInputStream.lo
+ -rm -f gnu/java/net/protocol/ftp/CompressedOutputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/CompressedOutputStream.lo
+ -rm -f gnu/java/net/protocol/ftp/DTP.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/DTP.lo
+ -rm -f gnu/java/net/protocol/ftp/DTPInputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/DTPInputStream.lo
+ -rm -f gnu/java/net/protocol/ftp/DTPOutputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/DTPOutputStream.lo
+ -rm -f gnu/java/net/protocol/ftp/FTPConnection.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/FTPConnection.lo
+ -rm -f gnu/java/net/protocol/ftp/FTPException.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/FTPException.lo
+ -rm -f gnu/java/net/protocol/ftp/FTPResponse.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/FTPResponse.lo
+ -rm -f gnu/java/net/protocol/ftp/FTPURLConnection.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/FTPURLConnection.lo
+ -rm -f gnu/java/net/protocol/ftp/Handler.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/Handler.lo
+ -rm -f gnu/java/net/protocol/ftp/PassiveModeDTP.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/PassiveModeDTP.lo
+ -rm -f gnu/java/net/protocol/ftp/StreamInputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/StreamInputStream.lo
+ -rm -f gnu/java/net/protocol/ftp/StreamOutputStream.$(OBJEXT)
+ -rm -f gnu/java/net/protocol/ftp/StreamOutputStream.lo
-rm -f gnu/java/net/protocol/gcjlib/Connection.$(OBJEXT)
-rm -f gnu/java/net/protocol/gcjlib/Connection.lo
-rm -f gnu/java/net/protocol/gcjlib/Handler.$(OBJEXT)
@@ -16644,6 +17296,14 @@ mostlyclean-compile:
-rm -f gnu/java/security/action/GetSecurityPropertyAction.lo
-rm -f gnu/java/security/action/SetAccessibleAction.$(OBJEXT)
-rm -f gnu/java/security/action/SetAccessibleAction.lo
+ -rm -f gnu/java/security/ber/BER.$(OBJEXT)
+ -rm -f gnu/java/security/ber/BER.lo
+ -rm -f gnu/java/security/ber/BEREncodingException.$(OBJEXT)
+ -rm -f gnu/java/security/ber/BEREncodingException.lo
+ -rm -f gnu/java/security/ber/BERReader.$(OBJEXT)
+ -rm -f gnu/java/security/ber/BERReader.lo
+ -rm -f gnu/java/security/ber/BERValue.$(OBJEXT)
+ -rm -f gnu/java/security/ber/BERValue.lo
-rm -f gnu/java/security/der/BitString.$(OBJEXT)
-rm -f gnu/java/security/der/BitString.lo
-rm -f gnu/java/security/der/DER.$(OBJEXT)
@@ -16656,6 +17316,10 @@ mostlyclean-compile:
-rm -f gnu/java/security/der/DERValue.lo
-rm -f gnu/java/security/der/DERWriter.$(OBJEXT)
-rm -f gnu/java/security/der/DERWriter.lo
+ -rm -f gnu/java/security/pkcs/PKCS7SignedData.$(OBJEXT)
+ -rm -f gnu/java/security/pkcs/PKCS7SignedData.lo
+ -rm -f gnu/java/security/pkcs/SignerInfo.$(OBJEXT)
+ -rm -f gnu/java/security/pkcs/SignerInfo.lo
-rm -f gnu/java/security/provider/CollectionCertStoreImpl.$(OBJEXT)
-rm -f gnu/java/security/provider/CollectionCertStoreImpl.lo
-rm -f gnu/java/security/provider/DSAKeyFactory.$(OBJEXT)
@@ -16858,12 +17522,14 @@ mostlyclean-compile:
-rm -f gnu/xml/dom/DTDElementTypeInfo.lo
-rm -f gnu/xml/dom/DomAttr.$(OBJEXT)
-rm -f gnu/xml/dom/DomAttr.lo
- -rm -f gnu/xml/dom/DomCDATA.$(OBJEXT)
- -rm -f gnu/xml/dom/DomCDATA.lo
+ -rm -f gnu/xml/dom/DomCDATASection.$(OBJEXT)
+ -rm -f gnu/xml/dom/DomCDATASection.lo
-rm -f gnu/xml/dom/DomCharacterData.$(OBJEXT)
-rm -f gnu/xml/dom/DomCharacterData.lo
-rm -f gnu/xml/dom/DomComment.$(OBJEXT)
-rm -f gnu/xml/dom/DomComment.lo
+ -rm -f gnu/xml/dom/DomDOMException.$(OBJEXT)
+ -rm -f gnu/xml/dom/DomDOMException.lo
-rm -f gnu/xml/dom/DomDoctype.$(OBJEXT)
-rm -f gnu/xml/dom/DomDoctype.lo
-rm -f gnu/xml/dom/DomDocument.$(OBJEXT)
@@ -16874,6 +17540,8 @@ mostlyclean-compile:
-rm -f gnu/xml/dom/DomDocumentBuilderFactory.lo
-rm -f gnu/xml/dom/DomDocumentConfiguration.$(OBJEXT)
-rm -f gnu/xml/dom/DomDocumentConfiguration.lo
+ -rm -f gnu/xml/dom/DomDocumentFragment.$(OBJEXT)
+ -rm -f gnu/xml/dom/DomDocumentFragment.lo
-rm -f gnu/xml/dom/DomElement.$(OBJEXT)
-rm -f gnu/xml/dom/DomElement.lo
-rm -f gnu/xml/dom/DomEntity.$(OBJEXT)
@@ -16882,12 +17550,8 @@ mostlyclean-compile:
-rm -f gnu/xml/dom/DomEntityReference.lo
-rm -f gnu/xml/dom/DomEvent.$(OBJEXT)
-rm -f gnu/xml/dom/DomEvent.lo
- -rm -f gnu/xml/dom/DomEx.$(OBJEXT)
- -rm -f gnu/xml/dom/DomEx.lo
-rm -f gnu/xml/dom/DomExtern.$(OBJEXT)
-rm -f gnu/xml/dom/DomExtern.lo
- -rm -f gnu/xml/dom/DomFragment.$(OBJEXT)
- -rm -f gnu/xml/dom/DomFragment.lo
-rm -f gnu/xml/dom/DomImpl.$(OBJEXT)
-rm -f gnu/xml/dom/DomImpl.lo
-rm -f gnu/xml/dom/DomIterator.$(OBJEXT)
@@ -16904,8 +17568,8 @@ mostlyclean-compile:
-rm -f gnu/xml/dom/DomNotation.lo
-rm -f gnu/xml/dom/DomNsNode.$(OBJEXT)
-rm -f gnu/xml/dom/DomNsNode.lo
- -rm -f gnu/xml/dom/DomPI.$(OBJEXT)
- -rm -f gnu/xml/dom/DomPI.lo
+ -rm -f gnu/xml/dom/DomProcessingInstruction.$(OBJEXT)
+ -rm -f gnu/xml/dom/DomProcessingInstruction.lo
-rm -f gnu/xml/dom/DomText.$(OBJEXT)
-rm -f gnu/xml/dom/DomText.lo
-rm -f gnu/xml/dom/DomXPathExpression.$(OBJEXT)
@@ -16920,8 +17584,8 @@ mostlyclean-compile:
-rm -f gnu/xml/dom/ImplementationSource.lo
-rm -f gnu/xml/dom/JAXPFactory.$(OBJEXT)
-rm -f gnu/xml/dom/JAXPFactory.lo
- -rm -f gnu/xml/dom/ls/DomLSEx.$(OBJEXT)
- -rm -f gnu/xml/dom/ls/DomLSEx.lo
+ -rm -f gnu/xml/dom/ls/DomLSException.$(OBJEXT)
+ -rm -f gnu/xml/dom/ls/DomLSException.lo
-rm -f gnu/xml/dom/ls/DomLSInput.$(OBJEXT)
-rm -f gnu/xml/dom/ls/DomLSInput.lo
-rm -f gnu/xml/dom/ls/DomLSOutput.$(OBJEXT)
@@ -17906,6 +18570,8 @@ mostlyclean-compile:
-rm -f java/beans/VetoableChangeSupport.lo
-rm -f java/beans/Visibility.$(OBJEXT)
-rm -f java/beans/Visibility.lo
+ -rm -f java/beans/XMLDecoder.$(OBJEXT)
+ -rm -f java/beans/XMLDecoder.lo
-rm -f java/beans/beancontext/BeanContext.$(OBJEXT)
-rm -f java/beans/beancontext/BeanContext.lo
-rm -f java/beans/beancontext/BeanContextChild.$(OBJEXT)
@@ -19380,6 +20046,8 @@ mostlyclean-compile:
-rm -f java/util/logging/StreamHandler.lo
-rm -f java/util/logging/XMLFormatter.$(OBJEXT)
-rm -f java/util/logging/XMLFormatter.lo
+ -rm -f java/util/logging/natLogger.$(OBJEXT)
+ -rm -f java/util/logging/natLogger.lo
-rm -f java/util/natResourceBundle.$(OBJEXT)
-rm -f java/util/natResourceBundle.lo
-rm -f java/util/natVMTimeZone.$(OBJEXT)
@@ -19606,6 +20274,8 @@ mostlyclean-compile:
-rm -f javax/imageio/event/IIOWriteProgressListener.lo
-rm -f javax/imageio/event/IIOWriteWarningListener.$(OBJEXT)
-rm -f javax/imageio/event/IIOWriteWarningListener.lo
+ -rm -f javax/imageio/metadata/IIOAttr.$(OBJEXT)
+ -rm -f javax/imageio/metadata/IIOAttr.lo
-rm -f javax/imageio/metadata/IIOInvalidTreeException.$(OBJEXT)
-rm -f javax/imageio/metadata/IIOInvalidTreeException.lo
-rm -f javax/imageio/metadata/IIOMetadata.$(OBJEXT)
@@ -19618,6 +20288,10 @@ mostlyclean-compile:
-rm -f javax/imageio/metadata/IIOMetadataFormatImpl.lo
-rm -f javax/imageio/metadata/IIOMetadataNode.$(OBJEXT)
-rm -f javax/imageio/metadata/IIOMetadataNode.lo
+ -rm -f javax/imageio/metadata/IIONamedNodeMap.$(OBJEXT)
+ -rm -f javax/imageio/metadata/IIONamedNodeMap.lo
+ -rm -f javax/imageio/metadata/IIONodeList.$(OBJEXT)
+ -rm -f javax/imageio/metadata/IIONodeList.lo
-rm -f javax/imageio/spi/IIORegistry.$(OBJEXT)
-rm -f javax/imageio/spi/IIORegistry.lo
-rm -f javax/imageio/spi/IIOServiceProvider.$(OBJEXT)
@@ -19986,6 +20660,8 @@ mostlyclean-compile:
-rm -f javax/print/attribute/URISyntax.lo
-rm -f javax/print/attribute/UnmodifiableSetException.$(OBJEXT)
-rm -f javax/print/attribute/UnmodifiableSetException.lo
+ -rm -f javax/print/attribute/standard/Chromaticity.$(OBJEXT)
+ -rm -f javax/print/attribute/standard/Chromaticity.lo
-rm -f javax/print/attribute/standard/ColorSupported.$(OBJEXT)
-rm -f javax/print/attribute/standard/ColorSupported.lo
-rm -f javax/print/attribute/standard/Compression.$(OBJEXT)
@@ -20000,6 +20676,8 @@ mostlyclean-compile:
-rm -f javax/print/attribute/standard/DateTimeAtCreation.lo
-rm -f javax/print/attribute/standard/DateTimeAtProcessing.$(OBJEXT)
-rm -f javax/print/attribute/standard/DateTimeAtProcessing.lo
+ -rm -f javax/print/attribute/standard/Destination.$(OBJEXT)
+ -rm -f javax/print/attribute/standard/Destination.lo
-rm -f javax/print/attribute/standard/DocumentName.$(OBJEXT)
-rm -f javax/print/attribute/standard/DocumentName.lo
-rm -f javax/print/attribute/standard/Fidelity.$(OBJEXT)
@@ -20046,6 +20724,10 @@ mostlyclean-compile:
-rm -f javax/print/attribute/standard/JobStateReasons.lo
-rm -f javax/print/attribute/standard/Media.$(OBJEXT)
-rm -f javax/print/attribute/standard/Media.lo
+ -rm -f javax/print/attribute/standard/MediaPrintableArea.$(OBJEXT)
+ -rm -f javax/print/attribute/standard/MediaPrintableArea.lo
+ -rm -f javax/print/attribute/standard/MediaSize.$(OBJEXT)
+ -rm -f javax/print/attribute/standard/MediaSize.lo
-rm -f javax/print/attribute/standard/MediaSizeName.$(OBJEXT)
-rm -f javax/print/attribute/standard/MediaSizeName.lo
-rm -f javax/print/attribute/standard/MultipleDocumentHandling.$(OBJEXT)
@@ -20260,8 +20942,6 @@ mostlyclean-compile:
-rm -f javax/swing/AbstractCellEditor.lo
-rm -f javax/swing/AbstractListModel.$(OBJEXT)
-rm -f javax/swing/AbstractListModel.lo
- -rm -f javax/swing/AbstractSet.$(OBJEXT)
- -rm -f javax/swing/AbstractSet.lo
-rm -f javax/swing/AbstractSpinnerModel.$(OBJEXT)
-rm -f javax/swing/AbstractSpinnerModel.lo
-rm -f javax/swing/Action.$(OBJEXT)
@@ -20298,8 +20978,6 @@ mostlyclean-compile:
-rm -f javax/swing/DefaultButtonModel.lo
-rm -f javax/swing/DefaultCellEditor.$(OBJEXT)
-rm -f javax/swing/DefaultCellEditor.lo
- -rm -f javax/swing/DefaultCellRenderer.$(OBJEXT)
- -rm -f javax/swing/DefaultCellRenderer.lo
-rm -f javax/swing/DefaultComboBoxModel.$(OBJEXT)
-rm -f javax/swing/DefaultComboBoxModel.lo
-rm -f javax/swing/DefaultDesktopManager.$(OBJEXT)
@@ -20328,6 +21006,8 @@ mostlyclean-compile:
-rm -f javax/swing/InputMap.lo
-rm -f javax/swing/InputVerifier.$(OBJEXT)
-rm -f javax/swing/InputVerifier.lo
+ -rm -f javax/swing/InternalFrameFocusTraversalPolicy.$(OBJEXT)
+ -rm -f javax/swing/InternalFrameFocusTraversalPolicy.lo
-rm -f javax/swing/JApplet.$(OBJEXT)
-rm -f javax/swing/JApplet.lo
-rm -f javax/swing/JButton.$(OBJEXT)
@@ -20420,6 +21100,8 @@ mostlyclean-compile:
-rm -f javax/swing/JWindow.lo
-rm -f javax/swing/KeyStroke.$(OBJEXT)
-rm -f javax/swing/KeyStroke.lo
+ -rm -f javax/swing/LayoutFocusTraversalPolicy.$(OBJEXT)
+ -rm -f javax/swing/LayoutFocusTraversalPolicy.lo
-rm -f javax/swing/ListCellRenderer.$(OBJEXT)
-rm -f javax/swing/ListCellRenderer.lo
-rm -f javax/swing/ListModel.$(OBJEXT)
@@ -20462,6 +21144,10 @@ mostlyclean-compile:
-rm -f javax/swing/SizeRequirements.lo
-rm -f javax/swing/SizeSequence.$(OBJEXT)
-rm -f javax/swing/SizeSequence.lo
+ -rm -f javax/swing/SortingFocusTraversalPolicy.$(OBJEXT)
+ -rm -f javax/swing/SortingFocusTraversalPolicy.lo
+ -rm -f javax/swing/SpinnerDateModel.$(OBJEXT)
+ -rm -f javax/swing/SpinnerDateModel.lo
-rm -f javax/swing/SpinnerListModel.$(OBJEXT)
-rm -f javax/swing/SpinnerListModel.lo
-rm -f javax/swing/SpinnerModel.$(OBJEXT)
@@ -20728,6 +21414,8 @@ mostlyclean-compile:
-rm -f javax/swing/plaf/basic/BasicDesktopIconUI.lo
-rm -f javax/swing/plaf/basic/BasicDesktopPaneUI.$(OBJEXT)
-rm -f javax/swing/plaf/basic/BasicDesktopPaneUI.lo
+ -rm -f javax/swing/plaf/basic/BasicEditorPaneUI.$(OBJEXT)
+ -rm -f javax/swing/plaf/basic/BasicEditorPaneUI.lo
-rm -f javax/swing/plaf/basic/BasicFormattedTextFieldUI.$(OBJEXT)
-rm -f javax/swing/plaf/basic/BasicFormattedTextFieldUI.lo
-rm -f javax/swing/plaf/basic/BasicGraphicsUtils.$(OBJEXT)
@@ -20810,8 +21498,12 @@ mostlyclean-compile:
-rm -f javax/swing/plaf/basic/BasicViewportUI.lo
-rm -f javax/swing/plaf/basic/ComboPopup.$(OBJEXT)
-rm -f javax/swing/plaf/basic/ComboPopup.lo
+ -rm -f javax/swing/plaf/metal/DefaultMetalTheme.$(OBJEXT)
+ -rm -f javax/swing/plaf/metal/DefaultMetalTheme.lo
-rm -f javax/swing/plaf/metal/MetalLookAndFeel.$(OBJEXT)
-rm -f javax/swing/plaf/metal/MetalLookAndFeel.lo
+ -rm -f javax/swing/plaf/metal/MetalTheme.$(OBJEXT)
+ -rm -f javax/swing/plaf/metal/MetalTheme.lo
-rm -f javax/swing/table/AbstractTableModel.$(OBJEXT)
-rm -f javax/swing/table/AbstractTableModel.lo
-rm -f javax/swing/table/DefaultTableCellRenderer.$(OBJEXT)
@@ -20848,6 +21540,8 @@ mostlyclean-compile:
-rm -f javax/swing/text/DefaultEditorKit.lo
-rm -f javax/swing/text/DefaultHighlighter.$(OBJEXT)
-rm -f javax/swing/text/DefaultHighlighter.lo
+ -rm -f javax/swing/text/DefaultStyledDocument.$(OBJEXT)
+ -rm -f javax/swing/text/DefaultStyledDocument.lo
-rm -f javax/swing/text/Document.$(OBJEXT)
-rm -f javax/swing/text/Document.lo
-rm -f javax/swing/text/DocumentFilter.$(OBJEXT)
@@ -20884,6 +21578,8 @@ mostlyclean-compile:
-rm -f javax/swing/text/Segment.lo
-rm -f javax/swing/text/SimpleAttributeSet.$(OBJEXT)
-rm -f javax/swing/text/SimpleAttributeSet.lo
+ -rm -f javax/swing/text/StringContent.$(OBJEXT)
+ -rm -f javax/swing/text/StringContent.lo
-rm -f javax/swing/text/Style.$(OBJEXT)
-rm -f javax/swing/text/Style.lo
-rm -f javax/swing/text/StyleConstants.$(OBJEXT)
@@ -21114,12 +21810,8 @@ mostlyclean-compile:
-rm -f jni/classpath/lib_gnu_java_awt_peer_gtk_la-primlib.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.$(OBJEXT)
@@ -21128,6 +21820,8 @@ mostlyclean-compile:
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo
+ -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.$(OBJEXT)
+ -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.$(OBJEXT)
@@ -21162,8 +21856,6 @@ mostlyclean-compile:
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.$(OBJEXT)
- -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.$(OBJEXT)
@@ -21192,6 +21884,8 @@ mostlyclean-compile:
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.lo
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.$(OBJEXT)
-rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo
+ -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.$(OBJEXT)
+ -rm -f jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo
-rm -f org/ietf/jgss/ChannelBinding.$(OBJEXT)
-rm -f org/ietf/jgss/ChannelBinding.lo
-rm -f org/ietf/jgss/GSSContext.$(OBJEXT)
@@ -21221,6 +21915,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gij.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interpret.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jni.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjawt_la-jawt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/no-threads.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nogc.Plo@am__quote@
@@ -21388,8 +22083,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGlyphVector.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphics.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphics2D.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkPixbufDecoder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkTextLayout.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkCanvasPeer.Plo@am__quote@
@@ -21409,7 +22107,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkImagePainter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkLabelPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkListPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMenuComponentPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMenuItemPeer.Plo@am__quote@
@@ -21425,9 +22122,47 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkToolkit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkWindowPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/$(DEPDIR)/BeanInfoEmbryo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/$(DEPDIR)/EmptyBeanInfo.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/$(DEPDIR)/DummyAppletContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/$(DEPDIR)/DummyAppletStub.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/$(DEPDIR)/ExplicitBeanInfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/$(DEPDIR)/IntrospectionIncubator.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/AbstractContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/AbstractCreatableObjectContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/AbstractElementHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/AbstractObjectContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ArrayContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ArrayHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/AssemblyException.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/BooleanHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ByteHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/CharHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ClassHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ConstructorContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/Context.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/DecoderContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/DefaultExceptionListener.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/DoubleHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/DummyContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/DummyHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ElementHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/FloatHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/GrowableArrayContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/IndexContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/IntHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/JavaHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/LongHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/MethodContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/MethodFinder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/NullHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ObjectContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ObjectHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/PersistenceParser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/PropertyContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/ShortHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/SimpleHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/StaticMethodContext.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/StringHandler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/decoder/$(DEPDIR)/VoidHandler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/editors/$(DEPDIR)/ColorEditor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/editors/$(DEPDIR)/FontEditor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/editors/$(DEPDIR)/NativeBooleanEditor.Plo@am__quote@
@@ -21438,7 +22173,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/editors/$(DEPDIR)/NativeLongEditor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/editors/$(DEPDIR)/NativeShortEditor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/editors/$(DEPDIR)/StringEditor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/beans/info/$(DEPDIR)/ComponentBeanInfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/io/$(DEPDIR)/ASN1ParsingException.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/io/$(DEPDIR)/Base64InputStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/io/$(DEPDIR)/ClassLoaderObjectInputStream.Plo@am__quote@
@@ -21590,8 +22324,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/locale/$(DEPDIR)/LocaleInformation_zh_TW.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/math/$(DEPDIR)/MPN.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/BASE64.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/CRLFInputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/CRLFOutputStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/DefaultContentHandlerFactory.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/EmptyX509TrustManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/GetLocalHostAction.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/HeaderFieldHelper.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/LineInputStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/PlainDatagramSocketImpl.Plo@am__quote@
@@ -21605,6 +22342,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/core/$(DEPDIR)/natCoreInputStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/file/$(DEPDIR)/Connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/file/$(DEPDIR)/Handler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/ActiveModeDTP.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/BlockInputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/BlockOutputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/CompressedInputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/CompressedOutputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/DTP.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/DTPInputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/DTPOutputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/FTPConnection.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/FTPException.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/FTPResponse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/FTPURLConnection.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/Handler.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/PassiveModeDTP.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/StreamInputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/ftp/$(DEPDIR)/StreamOutputStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/gcjlib/$(DEPDIR)/Connection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/gcjlib/$(DEPDIR)/Handler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/http/$(DEPDIR)/Authenticator.Plo@am__quote@
@@ -21633,6 +22386,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/jar/$(DEPDIR)/Handler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/ChannelInputStream.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/ChannelOutputStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/ChannelReader.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/DatagramChannelImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/DatagramChannelSelectionKey.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/FileLockImpl.Plo@am__quote@
@@ -21703,12 +22457,18 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/action/$(DEPDIR)/GetPropertyAction.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/action/$(DEPDIR)/GetSecurityPropertyAction.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/action/$(DEPDIR)/SetAccessibleAction.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/ber/$(DEPDIR)/BER.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/ber/$(DEPDIR)/BEREncodingException.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/ber/$(DEPDIR)/BERReader.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/ber/$(DEPDIR)/BERValue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/der/$(DEPDIR)/BitString.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/der/$(DEPDIR)/DER.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/der/$(DEPDIR)/DEREncodingException.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/der/$(DEPDIR)/DERReader.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/der/$(DEPDIR)/DERValue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/der/$(DEPDIR)/DERWriter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/pkcs/$(DEPDIR)/PKCS7SignedData.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/pkcs/$(DEPDIR)/SignerInfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/provider/$(DEPDIR)/CollectionCertStoreImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/provider/$(DEPDIR)/DSAKeyFactory.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/security/provider/$(DEPDIR)/DSAKeyPairGenerator.Plo@am__quote@
@@ -21810,21 +22570,21 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DTDAttributeTypeInfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DTDElementTypeInfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomAttr.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomCDATA.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomCDATASection.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomCharacterData.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomComment.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomDOMException.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomDoctype.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomDocument.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomDocumentBuilder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomDocumentBuilderFactory.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomDocumentConfiguration.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomDocumentFragment.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomElement.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomEntity.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomEntityReference.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomEvent.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomEx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomExtern.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomFragment.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomIterator.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomNSResolverContext.Plo@am__quote@
@@ -21833,7 +22593,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomNodeIterator.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomNotation.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomNsNode.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomPI.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomProcessingInstruction.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomText.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomXPathExpression.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/DomXPathNSResolver.Plo@am__quote@
@@ -21841,7 +22601,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/ImplementationList.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/ImplementationSource.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/$(DEPDIR)/JAXPFactory.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/ls/$(DEPDIR)/DomLSEx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/ls/$(DEPDIR)/DomLSException.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/ls/$(DEPDIR)/DomLSInput.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/ls/$(DEPDIR)/DomLSOutput.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@gnu/xml/dom/ls/$(DEPDIR)/DomLSParser.Plo@am__quote@
@@ -22334,6 +23094,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@java/beans/$(DEPDIR)/VetoableChangeListenerProxy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/beans/$(DEPDIR)/VetoableChangeSupport.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/beans/$(DEPDIR)/Visibility.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@java/beans/$(DEPDIR)/XMLDecoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/beans/beancontext/$(DEPDIR)/BeanContext.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/beans/beancontext/$(DEPDIR)/BeanContextChild.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/beans/beancontext/$(DEPDIR)/BeanContextChildComponentProxy.Plo@am__quote@
@@ -23073,6 +23834,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@java/util/logging/$(DEPDIR)/SocketHandler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/util/logging/$(DEPDIR)/StreamHandler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/util/logging/$(DEPDIR)/XMLFormatter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@java/util/logging/$(DEPDIR)/natLogger.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/util/prefs/$(DEPDIR)/AbstractPreferences.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/util/prefs/$(DEPDIR)/BackingStoreException.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@java/util/prefs/$(DEPDIR)/InvalidPreferencesFormatException.Plo@am__quote@
@@ -23184,12 +23946,15 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOReadWarningListener.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOWriteProgressListener.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOWriteWarningListener.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOAttr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOInvalidTreeException.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadata.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataController.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataFormat.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataFormatImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataNode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIONamedNodeMap.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIONodeList.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/IIORegistry.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/IIOServiceProvider.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ImageInputStreamSpi.Plo@am__quote@
@@ -23374,6 +24139,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/$(DEPDIR)/TextSyntax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/$(DEPDIR)/URISyntax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/$(DEPDIR)/UnmodifiableSetException.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/Chromaticity.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/ColorSupported.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/Compression.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/Copies.Plo@am__quote@
@@ -23381,6 +24147,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/DateTimeAtCompleted.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/DateTimeAtCreation.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/DateTimeAtProcessing.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/Destination.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/DocumentName.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/Fidelity.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/Finishings.Plo@am__quote@
@@ -23404,6 +24171,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/JobStateReason.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/JobStateReasons.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/Media.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/MediaPrintableArea.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/MediaSize.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/MediaSizeName.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/MultipleDocumentHandling.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/print/attribute/standard/$(DEPDIR)/NumberOfDocuments.Plo@am__quote@
@@ -23511,7 +24280,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/AbstractButton.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/AbstractCellEditor.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/AbstractListModel.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/AbstractSet.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/AbstractSpinnerModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/Action.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/ActionMap.Plo@am__quote@
@@ -23530,7 +24298,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/DefaultBoundedRangeModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/DefaultButtonModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/DefaultCellEditor.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/DefaultCellRenderer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/DefaultComboBoxModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/DefaultDesktopManager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/DefaultFocusManager.Plo@am__quote@
@@ -23545,6 +24312,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/ImageIcon.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/InputMap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/InputVerifier.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/InternalFrameFocusTraversalPolicy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/JApplet.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/JButton.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/JCheckBox.Plo@am__quote@
@@ -23591,6 +24359,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/JViewport.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/JWindow.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/KeyStroke.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/LayoutFocusTraversalPolicy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/ListCellRenderer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/ListModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/ListSelectionModel.Plo@am__quote@
@@ -23612,6 +24381,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SingleSelectionModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SizeRequirements.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SizeSequence.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SortingFocusTraversalPolicy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SpinnerDateModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SpinnerListModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SpinnerModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/$(DEPDIR)/SpinnerNumberModel.Plo@am__quote@
@@ -23745,6 +24516,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicComboPopup.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicDesktopIconUI.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicDesktopPaneUI.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicEditorPaneUI.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicFormattedTextFieldUI.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicGraphicsUtils.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicIconFactory.Plo@am__quote@
@@ -23786,7 +24558,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicTreeUI.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/BasicViewportUI.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/basic/$(DEPDIR)/ComboPopup.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/metal/$(DEPDIR)/DefaultMetalTheme.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/metal/$(DEPDIR)/MetalLookAndFeel.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/plaf/metal/$(DEPDIR)/MetalTheme.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/table/$(DEPDIR)/AbstractTableModel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/table/$(DEPDIR)/DefaultTableCellRenderer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/table/$(DEPDIR)/DefaultTableColumnModel.Plo@am__quote@
@@ -23805,6 +24579,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/DefaultCaret.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/DefaultEditorKit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/DefaultHighlighter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/DefaultStyledDocument.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/Document.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/DocumentFilter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/EditorKit.Plo@am__quote@
@@ -23823,6 +24598,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/Position.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/Segment.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/SimpleAttributeSet.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/StringContent.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/Style.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/StyleConstants.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@javax/swing/text/$(DEPDIR)/StyleContext.Plo@am__quote@
@@ -23938,13 +24714,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-native_state.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-primlib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics2D.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkCanvasPeer.Plo@am__quote@
@@ -23962,7 +24737,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkImagePainter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkLabelPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuComponentPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuItemPeer.Plo@am__quote@
@@ -23977,6 +24751,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkToolkit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkWindowPeer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gthread-jni.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@org/ietf/jgss/$(DEPDIR)/ChannelBinding.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@org/ietf/jgss/$(DEPDIR)/GSSContext.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@org/ietf/jgss/$(DEPDIR)/GSSCredential.Plo@am__quote@
@@ -24025,13 +24800,6 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkTextLayout.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkTextLayout.c
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontMetrics.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
-
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c; \
@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.Tpo"; exit 1; fi
@@ -24039,13 +24807,6 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkFontPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGlyphVector.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
-
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c; \
@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkGraphics.Tpo"; exit 1; fi
@@ -24067,6 +24828,13 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c; \
+@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GdkRobotPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GdkRobotPeer.c
+
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c; \
@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkButtonPeer.Tpo"; exit 1; fi
@@ -24179,13 +24947,6 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkListPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
-jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c; \
-@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMainThread.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
-
jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo `test -f 'jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c' || echo '$(srcdir)/'`jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c; \
@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gnu_java_awt_peer_gtk_GtkMenuBarPeer.Tpo"; exit 1; fi
@@ -24291,6 +25052,13 @@ jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo: jni/gtk-peer/gthread-j
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gthread-jni.lo `test -f 'jni/gtk-peer/gthread-jni.c' || echo '$(srcdir)/'`jni/gtk-peer/gthread-jni.c
+jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo: jni/gtk-peer/gtk_jawt.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo -MD -MP -MF "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Tpo" -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo `test -f 'jni/gtk-peer/gtk_jawt.c' || echo '$(srcdir)/'`jni/gtk-peer/gtk_jawt.c; \
+@am__fastdepCC_TRUE@ then mv -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Tpo" "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Plo"; else rm -f "jni/gtk-peer/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jni/gtk-peer/gtk_jawt.c' object='jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/gtk-peer/lib_gnu_java_awt_peer_gtk_la-gtk_jawt.lo `test -f 'jni/gtk-peer/gtk_jawt.c' || echo '$(srcdir)/'`jni/gtk-peer/gtk_jawt.c
+
jni/classpath/lib_gnu_java_awt_peer_gtk_la-jcl.lo: jni/classpath/jcl.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -MT jni/classpath/lib_gnu_java_awt_peer_gtk_la-jcl.lo -MD -MP -MF "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-jcl.Tpo" -c -o jni/classpath/lib_gnu_java_awt_peer_gtk_la-jcl.lo `test -f 'jni/classpath/jcl.c' || echo '$(srcdir)/'`jni/classpath/jcl.c; \
@am__fastdepCC_TRUE@ then mv -f "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-jcl.Tpo" "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-jcl.Plo"; else rm -f "jni/classpath/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-jcl.Tpo"; exit 1; fi
@@ -24319,6 +25087,13 @@ jni/classpath/lib_gnu_java_awt_peer_gtk_la-primlib.lo: jni/classpath/primlib.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_gnu_java_awt_peer_gtk_la_CFLAGS) $(CFLAGS) -c -o jni/classpath/lib_gnu_java_awt_peer_gtk_la-primlib.lo `test -f 'jni/classpath/primlib.c' || echo '$(srcdir)/'`jni/classpath/primlib.c
+libjawt_la-jawt.lo: jawt.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjawt_la_CFLAGS) $(CFLAGS) -MT libjawt_la-jawt.lo -MD -MP -MF "$(DEPDIR)/libjawt_la-jawt.Tpo" -c -o libjawt_la-jawt.lo `test -f 'jawt.c' || echo '$(srcdir)/'`jawt.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libjawt_la-jawt.Tpo" "$(DEPDIR)/libjawt_la-jawt.Plo"; else rm -f "$(DEPDIR)/libjawt_la-jawt.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jawt.c' object='libjawt_la-jawt.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjawt_la_CFLAGS) $(CFLAGS) -c -o libjawt_la-jawt.lo `test -f 'jawt.c' || echo '$(srcdir)/'`jawt.c
+
.cc.o:
@am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
@@ -24549,6 +25324,13 @@ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics2D.lo: gnu/java/aw
@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphics2D.lo `test -f 'gnu/java/awt/peer/gtk/GdkGraphics2D.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkGraphics2D.java
+gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo: gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java
+@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -MT gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo -MD -MP -MF "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.Tpo" -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo `test -f 'gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java; \
+@am__fastdepGCJ_TRUE@ then mv -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.Tpo" "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.Plo"; else rm -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java' object='gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsConfiguration.lo `test -f 'gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java
+
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.lo: gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -MT gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.lo -MD -MP -MF "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.Tpo" -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.lo `test -f 'gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java; \
@am__fastdepGCJ_TRUE@ then mv -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.Tpo" "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.Plo"; else rm -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkGraphicsEnvironment.Tpo"; exit 1; fi
@@ -24563,6 +25345,20 @@ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkPixbufDecoder.lo: gnu/java
@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkPixbufDecoder.lo `test -f 'gnu/java/awt/peer/gtk/GdkPixbufDecoder.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo: gnu/java/awt/peer/gtk/GdkRobotPeer.java
+@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -MT gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo -MD -MP -MF "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.Tpo" -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo `test -f 'gnu/java/awt/peer/gtk/GdkRobotPeer.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkRobotPeer.java; \
+@am__fastdepGCJ_TRUE@ then mv -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.Tpo" "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.Plo"; else rm -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='gnu/java/awt/peer/gtk/GdkRobotPeer.java' object='gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkRobotPeer.lo `test -f 'gnu/java/awt/peer/gtk/GdkRobotPeer.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkRobotPeer.java
+
+gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo: gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
+@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -MT gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo -MD -MP -MF "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.Tpo" -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo `test -f 'gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java; \
+@am__fastdepGCJ_TRUE@ then mv -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.Tpo" "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.Plo"; else rm -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java' object='gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GdkScreenGraphicsDevice.lo `test -f 'gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java
+
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.lo: gnu/java/awt/peer/gtk/GtkButtonPeer.java
@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -MT gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.lo -MD -MP -MF "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.Tpo" -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.lo `test -f 'gnu/java/awt/peer/gtk/GtkButtonPeer.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GtkButtonPeer.java; \
@am__fastdepGCJ_TRUE@ then mv -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.Tpo" "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.Plo"; else rm -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkButtonPeer.Tpo"; exit 1; fi
@@ -24689,13 +25485,6 @@ gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkListPeer.lo: gnu/java/awt/
@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkListPeer.lo `test -f 'gnu/java/awt/peer/gtk/GtkListPeer.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GtkListPeer.java
-gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo: gnu/java/awt/peer/gtk/GtkMainThread.java
-@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -MT gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo -MD -MP -MF "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.Tpo" -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo `test -f 'gnu/java/awt/peer/gtk/GtkMainThread.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GtkMainThread.java; \
-@am__fastdepGCJ_TRUE@ then mv -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.Tpo" "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.Plo"; else rm -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ source='gnu/java/awt/peer/gtk/GtkMainThread.java' object='gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepGCJ_FALSE@ DEPDIR=$(DEPDIR) $(GCJDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepGCJ_FALSE@ $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMainThread.lo `test -f 'gnu/java/awt/peer/gtk/GtkMainThread.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GtkMainThread.java
-
gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.lo: gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
@am__fastdepGCJ_TRUE@ if $(LIBTOOL) --mode=compile $(GCJ) $(lib_gnu_java_awt_peer_gtk_la_GCJFLAGS) $(GCJFLAGS) -MT gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.lo -MD -MP -MF "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.Tpo" -c -o gnu/java/awt/peer/gtk/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.lo `test -f 'gnu/java/awt/peer/gtk/GtkMenuBarPeer.java' || echo '$(srcdir)/'`gnu/java/awt/peer/gtk/GtkMenuBarPeer.java; \
@am__fastdepGCJ_TRUE@ then mv -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.Tpo" "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.Plo"; else rm -f "gnu/java/awt/peer/gtk/$(DEPDIR)/lib_gnu_java_awt_peer_gtk_la-GtkMenuBarPeer.Tpo"; exit 1; fi
@@ -24829,8 +25618,8 @@ clean-libtool:
-rm -rf gnu/java/awt/peer/.libs gnu/java/awt/peer/_libs
-rm -rf gnu/java/awt/peer/gtk/.libs gnu/java/awt/peer/gtk/_libs
-rm -rf gnu/java/beans/.libs gnu/java/beans/_libs
+ -rm -rf gnu/java/beans/decoder/.libs gnu/java/beans/decoder/_libs
-rm -rf gnu/java/beans/editors/.libs gnu/java/beans/editors/_libs
- -rm -rf gnu/java/beans/info/.libs gnu/java/beans/info/_libs
-rm -rf gnu/java/io/.libs gnu/java/io/_libs
-rm -rf gnu/java/lang/.libs gnu/java/lang/_libs
-rm -rf gnu/java/lang/reflect/.libs gnu/java/lang/reflect/_libs
@@ -24839,6 +25628,7 @@ clean-libtool:
-rm -rf gnu/java/net/.libs gnu/java/net/_libs
-rm -rf gnu/java/net/protocol/core/.libs gnu/java/net/protocol/core/_libs
-rm -rf gnu/java/net/protocol/file/.libs gnu/java/net/protocol/file/_libs
+ -rm -rf gnu/java/net/protocol/ftp/.libs gnu/java/net/protocol/ftp/_libs
-rm -rf gnu/java/net/protocol/gcjlib/.libs gnu/java/net/protocol/gcjlib/_libs
-rm -rf gnu/java/net/protocol/http/.libs gnu/java/net/protocol/http/_libs
-rm -rf gnu/java/net/protocol/http/event/.libs gnu/java/net/protocol/http/event/_libs
@@ -24853,7 +25643,9 @@ clean-libtool:
-rm -rf gnu/java/rmi/server/.libs gnu/java/rmi/server/_libs
-rm -rf gnu/java/security/.libs gnu/java/security/_libs
-rm -rf gnu/java/security/action/.libs gnu/java/security/action/_libs
+ -rm -rf gnu/java/security/ber/.libs gnu/java/security/ber/_libs
-rm -rf gnu/java/security/der/.libs gnu/java/security/der/_libs
+ -rm -rf gnu/java/security/pkcs/.libs gnu/java/security/pkcs/_libs
-rm -rf gnu/java/security/provider/.libs gnu/java/security/provider/_libs
-rm -rf gnu/java/security/util/.libs gnu/java/security/util/_libs
-rm -rf gnu/java/security/x509/.libs gnu/java/security/x509/_libs
@@ -25354,10 +26146,10 @@ distclean-generic:
-rm -f gnu/java/awt/peer/gtk/$(am__dirstamp)
-rm -f gnu/java/beans/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/beans/$(am__dirstamp)
+ -rm -f gnu/java/beans/decoder/$(DEPDIR)/$(am__dirstamp)
+ -rm -f gnu/java/beans/decoder/$(am__dirstamp)
-rm -f gnu/java/beans/editors/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/beans/editors/$(am__dirstamp)
- -rm -f gnu/java/beans/info/$(DEPDIR)/$(am__dirstamp)
- -rm -f gnu/java/beans/info/$(am__dirstamp)
-rm -f gnu/java/io/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/io/$(am__dirstamp)
-rm -f gnu/java/lang/$(DEPDIR)/$(am__dirstamp)
@@ -25374,6 +26166,8 @@ distclean-generic:
-rm -f gnu/java/net/protocol/core/$(am__dirstamp)
-rm -f gnu/java/net/protocol/file/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/net/protocol/file/$(am__dirstamp)
+ -rm -f gnu/java/net/protocol/ftp/$(DEPDIR)/$(am__dirstamp)
+ -rm -f gnu/java/net/protocol/ftp/$(am__dirstamp)
-rm -f gnu/java/net/protocol/gcjlib/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/net/protocol/gcjlib/$(am__dirstamp)
-rm -f gnu/java/net/protocol/http/$(DEPDIR)/$(am__dirstamp)
@@ -25402,8 +26196,12 @@ distclean-generic:
-rm -f gnu/java/security/$(am__dirstamp)
-rm -f gnu/java/security/action/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/security/action/$(am__dirstamp)
+ -rm -f gnu/java/security/ber/$(DEPDIR)/$(am__dirstamp)
+ -rm -f gnu/java/security/ber/$(am__dirstamp)
-rm -f gnu/java/security/der/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/security/der/$(am__dirstamp)
+ -rm -f gnu/java/security/pkcs/$(DEPDIR)/$(am__dirstamp)
+ -rm -f gnu/java/security/pkcs/$(am__dirstamp)
-rm -f gnu/java/security/provider/$(DEPDIR)/$(am__dirstamp)
-rm -f gnu/java/security/provider/$(am__dirstamp)
-rm -f gnu/java/security/util/$(DEPDIR)/$(am__dirstamp)
@@ -25649,12 +26447,12 @@ maintainer-clean-generic:
clean: clean-recursive
clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
- clean-noinstPROGRAMS clean-toolexeclibLTLIBRARIES \
- mostlyclean-am
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+ clean-toolexeclibLTLIBRARIES mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/color/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/beans/info/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/http/event/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/security/x509/ext/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) gnu/xml/aelfred2/$(DEPDIR) gnu/xml/dom/$(DEPDIR) gnu/xml/dom/ls/$(DEPDIR) gnu/xml/pipeline/$(DEPDIR) gnu/xml/transform/$(DEPDIR) gnu/xml/util/$(DEPDIR) gnu/xml/xpath/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/metadata/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/spi/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) javax/xml/$(DEPDIR) javax/xml/datatype/$(DEPDIR) javax/xml/namespace/$(DEPDIR) javax/xml/parsers/$(DEPDIR) javax/xml/transform/$(DEPDIR) javax/xml/transform/dom/$(DEPDIR) javax/xml/transform/sax/$(DEPDIR) javax/xml/transform/stream/$(DEPDIR) javax/xml/validation/$(DEPDIR) javax/xml/xpath/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) sysdep/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/color/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/decoder/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/ftp/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/http/event/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/ber/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/pkcs/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/security/x509/ext/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) gnu/xml/aelfred2/$(DEPDIR) gnu/xml/dom/$(DEPDIR) gnu/xml/dom/ls/$(DEPDIR) gnu/xml/pipeline/$(DEPDIR) gnu/xml/transform/$(DEPDIR) gnu/xml/util/$(DEPDIR) gnu/xml/xpath/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/metadata/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/spi/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) javax/xml/$(DEPDIR) javax/xml/datatype/$(DEPDIR) javax/xml/namespace/$(DEPDIR) javax/xml/parsers/$(DEPDIR) javax/xml/transform/$(DEPDIR) javax/xml/transform/dom/$(DEPDIR) javax/xml/transform/sax/$(DEPDIR) javax/xml/transform/stream/$(DEPDIR) javax/xml/validation/$(DEPDIR) javax/xml/xpath/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) sysdep/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-local distclean-tags
@@ -25684,7 +26482,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/color/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/beans/info/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/http/event/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/security/x509/ext/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) gnu/xml/aelfred2/$(DEPDIR) gnu/xml/dom/$(DEPDIR) gnu/xml/dom/ls/$(DEPDIR) gnu/xml/pipeline/$(DEPDIR) gnu/xml/transform/$(DEPDIR) gnu/xml/util/$(DEPDIR) gnu/xml/xpath/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/metadata/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/spi/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) javax/xml/$(DEPDIR) javax/xml/datatype/$(DEPDIR) javax/xml/namespace/$(DEPDIR) javax/xml/parsers/$(DEPDIR) javax/xml/transform/$(DEPDIR) javax/xml/transform/dom/$(DEPDIR) javax/xml/transform/sax/$(DEPDIR) javax/xml/transform/stream/$(DEPDIR) javax/xml/validation/$(DEPDIR) javax/xml/xpath/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) sysdep/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/tools/gcj_dbtool/$(DEPDIR) gnu/gcj/util/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/color/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/decoder/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/ftp/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/http/event/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/ber/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/pkcs/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/security/x509/ext/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) gnu/xml/aelfred2/$(DEPDIR) gnu/xml/dom/$(DEPDIR) gnu/xml/dom/ls/$(DEPDIR) gnu/xml/pipeline/$(DEPDIR) gnu/xml/transform/$(DEPDIR) gnu/xml/util/$(DEPDIR) gnu/xml/xpath/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/metadata/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/spi/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) javax/xml/$(DEPDIR) javax/xml/datatype/$(DEPDIR) javax/xml/namespace/$(DEPDIR) javax/xml/parsers/$(DEPDIR) javax/xml/transform/$(DEPDIR) javax/xml/transform/dom/$(DEPDIR) javax/xml/transform/sax/$(DEPDIR) javax/xml/transform/stream/$(DEPDIR) javax/xml/validation/$(DEPDIR) javax/xml/xpath/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) sysdep/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -25709,15 +26507,15 @@ uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-binPROGRAMS clean-generic clean-libtool \
- clean-local clean-noinstPROGRAMS clean-recursive \
- clean-toolexeclibLTLIBRARIES ctags ctags-recursive dist \
- dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
- distcheck distclean distclean-compile distclean-generic \
- distclean-libtool distclean-local distclean-recursive \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-binSCRIPTS install-data \
- install-data-am install-data-local install-exec \
+ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+ clean-recursive clean-toolexeclibLTLIBRARIES ctags \
+ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
+ dist-tarZ dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-local \
+ distclean-recursive distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-binSCRIPTS \
+ install-data install-data-am install-data-local install-exec \
install-exec-am install-info install-info-am install-jarDATA \
install-man install-pkgconfigDATA install-strip \
install-toolexeclibLTLIBRARIES install-toolexecmainlibDATA \
@@ -25732,8 +26530,6 @@ uninstall-info: uninstall-info-recursive
uninstall-toolexecmainlibDATA
-jniinclude/gnu_java_awt_peer_gtk_GdkFontMetrics.h: gnu/java/awt/peer/gtk/GdkFontMetrics.java
-jniinclude/gnu_java_awt_peer_gtk_GdkGlyphVector.h: gnu/java/awt/peer/gtk/GdkGlyphVector.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h: gnu/java/awt/peer/gtk/GdkGraphics.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h: gnu/java/awt/peer/gtk/GdkGraphics2D.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h: gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
@@ -25757,7 +26553,6 @@ jniinclude/gnu_java_awt_peer_gtk_GtkImage.h: gnu/java/awt/peer/gtk/GtkImage.java
jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h: gnu/java/awt/peer/gtk/GtkImagePainter.java
jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h: gnu/java/awt/peer/gtk/GtkLabelPeer.java
jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h: gnu/java/awt/peer/gtk/GtkListPeer.java
-jniinclude/gnu_java_awt_peer_gtk_GtkMainThread.h: gnu/java/awt/peer/gtk/GtkMainThread.java
jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h: gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h: gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h: gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
@@ -25782,9 +26577,7 @@ $(gtk_jni_headers): %.h:
echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \
$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkFontMetrics.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkFontPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGlyphVector.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h
@@ -25806,7 +26599,6 @@ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.lo: $(top_builddir)/jniinclude
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkImagePainter.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkLabelPeer.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkListPeer.h
-jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMainThread.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuComponentPeer.h
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.lo: $(top_builddir)/jniinclude/gnu_java_awt_peer_gtk_GtkMenuItemPeer.h
@@ -25832,7 +26624,7 @@ $(lib_gnu_java_awt_peer_gtk_la_OBJECTS): $(lib_gnu_java_awt_peer_gtk_la_DEPENDEN
@ONESTEP_TRUE@ @echo Compiling Java sourcefiles...
@ONESTEP_TRUE@ @: $(call write_entries_to_file,$?,libgcj.sourcelist)
@ONESTEP_TRUE@ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(BOOTCLASSPATH) -d $(here) @libgcj.sourcelist
-
+@ONESTEP_TRUE@ echo > classes.stamp
# This next rule seems backward, but reflects the fact that 1) all
# classfiles are compiled in one go when classes.stamp is built and 2)
# anything which depends on a particular .class file must wait until
@@ -26169,6 +26961,31 @@ texinfo: TexinfoDoclet.class
javadoc -outfile $(srcdir)/doc/java-util-jar.texi -doclet TexinfoDoclet -sourcepath .'$(CLASSPATH_SEPARATOR)'$(srcdir) $(srcdir)/java/util/jar/*.java
javadoc -outfile $(srcdir)/doc/java-util-zip.texi -doclet TexinfoDoclet -sourcepath .'$(CLASSPATH_SEPARATOR)'$(srcdir) $(srcdir)/java/util/zip/*.java
+src.zip:
+ -rm -f src.zip
+ here=`pwd`; \
+ ( ( cd $(srcdir); \
+ find java gnu javax org -name '*.java' -print | \
+ while read file; do \
+ echo "x-C" | sed -e 's/^.//'; \
+ echo $(srcdir); \
+ echo $$file; \
+ done ); \
+ find gnu java -name '*.java' -print) | \
+ $(ZIP) -cfM@ $$here/src.zip
+ for dir in sax w3c_dom; do \
+ (cd $(srcdir)/external/$$dir; \
+ find org -type f -name '*.java' -print | while read file; do \
+ echo "x-C" | sed -e 's/^.//'; \
+ echo $(srcdir)/external/$$dir; \
+ echo $$file; \
+ done) | \
+ $(ZIP) -ufM0E@ src.zip; \
+ done
+
+install-src.zip: src.zip
+ $(INSTALL_DATA) src.zip $(DESTDIR)$(sourcesdir)/src-@gcc_version@.zip
+
all-recursive: classes.stamp $(nat_headers) $(xlib_nat_headers)
# Multilib support.
diff --git a/libjava/NEWS b/libjava/NEWS
index 8c9b3b745d1..24fd4567716 100644
--- a/libjava/NEWS
+++ b/libjava/NEWS
@@ -1,3 +1,211 @@
+*** Changes in GCC 4.0:
+
+* Character encoders and decoders have been added for: iso-8859-6
+(arabic), iso-8859-7 (greek), iso-8859-8 (hebrew), iso-8859-9
+(latin-5), iso-8859-13, iso-8859-15 (latin-9), cp1047 (ebcdic),
+ebcdic-xml-us,ascii, windows-1250, windows-1252, UTF-16BE (Big Endian),
+UTF-16LE (Little Endian), UTF-32BE (Big Endian), UTF-32LE (Little
+Endian).
+
+* Lots of Calendar bug fixes.
+
+* The http url protocol handler has been replaced with a full HTTP/1.1
+version from GNU inetlib.
+
+* A new ftp url protocol handler has been added also from GNU inetlib.
+
+* java.beans has been updated to 1.4 including support for XMLEncoder
+and XMLDecoder.
+
+* Added implementations of javax.xml (JAXP 1.3), org.xml.sax (SAX2)
+and org.w3c.dom (DOM Level 3) interfaces. It is possible to switch
+between different implementations AElfred2, GNU DOM, GNU XSL, libxmlj
+SAX, libxmlj DOM and libxmlj XSL by setting different system
+properties. Also provided is a preliminary XPath 1.0
+implementation. The libxmlj versions are build around libxml2 and
+libxslt and have to be enabled during build time by the --enable-xmlj
+configure flag. The current support is equal to the last released GNU
+JAXP 1.3 release. These packages will be maintained as part of the GNU
+Classpath core classes in the future. For more information,
+conformance results and documentation on selecting different
+implementations see doc/README.jaxp.
+
+* Much fuller collection documentation.
+
+* libgcj can now load service providers that are described via
+META-INF/services/* resources in extension JARs. This is useful for
+implementing the various APIs that are supposed to be extensible via
+custom plugins. For details, please see the documentation of
+gnu.classpath.ServiceFactory.
+
+* GNU Classpath's JAR implementation now has preliminary support for
+signed entries, for so called "signed JAR" file support. Signed JAR
+files are one of the key security features of managed runtimes, and
+allows code to run privileged given unforgeable proofs of identity.
+
+* A much improved version of X.509 certificates has been added,
+including a robust certificate path checking algorithm. Also included
+is an implementation of the RSA signature scheme.
+
+* New javax.crypto, javax.crypto.interfaces, javax.crypto.spec,
+javax.net, javax.net.ssl, javax.security.auth,
+javax.security.auth.callback, javax.security.auth.login,
+javax.security.auth.x500, javax.security.sasl and org.ietf.jgss
+packages are now officially part of GNU Classpath. Extra crypto
+algorithms can be obtained from the GNU Crypto project, a full TLS
+implementation is provided by the Jessie project.
+http://www.gnu.org/software/gnu-crypto/
+http://www.nongnu.org/jessie/
+
+* java.security.AccessController has been implemented.
+
+* The default java.lang.SecurityManager now uses AccessController.
+
+* Lookahead support for regular expressions.
+
+* java.util.regexp implementation through gnu.regexp wrappers.
+
+* Serialization object stream fixes for multiple ClassLoader scenarios.
+
+* java.net.URL now uses application classloader to load
+URLStreamHandlers and reuses URLStreamHandlers when URL is reset (but
+protocol isn't changed).
+
+* java.io.File.deleteOnExit() implementation.
+
+* java.io is now implemented by delegating most tasks directly to
+java.nio.
+
+* Reworked/Optimized implementations of java.nio.Buffer and subclasses.
+
+* BufferedReader speed improvements.
+
+* Multiple java.net.InetAdress fixes and java.rmi fixes.
+
+* ServerSocket.accept() now restarts listening when system call
+interrupted.
+
+* java.net.URI implementation.
+
+* New javax.print, javax.print.attribute[.standard] and
+javax.print.event packages and classes.
+
+* java.text multiple new features and bug fixes (only 2 out of the
+1000+ java.text Mauve tests now fail).
+
+* java.text attributed iterators support.
+
+* Improved useabilty of java.text implementation for several
+applications.
+
+* More AWT accessible support.
+
+* AWT gtk+ peers component layout, dialog placement, keyboard focus
+handling and text positioning have been improved.
+
+* ImageIO interfaces are more complete.
+
+* JList, JTable and JTree have been hugely improved.
+
+* java.awt.Robot support with GdkRobot in the gtk+ awt peers. Needs
+XTest Extension (libXtst) XServer support.
+
+* Full java.awt.color implementation, with all standard ICC profiles,
+except for PhotoYCC color space.
+
+* java.awt.image support updated to 1.4.
+
+* Big-endian (PowerPC) fixes for native awt GTK+ peers.
+
+* Better AWT focus management fro GTK+ peers.
+
+* Much faster and better fonts support (for both gdk Graphics and cairo
+Graphics2D)
+
+* AWT Choice fixes for hidden components.
+
+* More javax.imageio support.
+
+* Better AWT Help MenuBar support.
+
+* Swing TabbedPane, ColorChooser and ComboBox improvements.
+
+* Start of JTree functionality.
+
+* javax.swing.Spring and SpringLayout support.
+
+* Added pluggable look and feel support for BasicTextFieldUI and
+BasicToolBarSeparatorUI.
+
+* java.swing.text support for (Default and Layered) Highlighter,
+FieldView, PlainView, TabExpander and TabableView added.
+
+* Start of JTable and JTree implementation.
+
+* Internal Swing frames work.
+
+* JMenu and JPopupMenu work.
+
+* New gtk+ AWT FileDialog peer now based on gtk+2.4 or higher.
+
+* java.awt.image LookupTables and kernel support.
+
+* Improved java.awt.image.BufferedImage support.
+
+* AWT 1.0 event model support.
+
+* Frame.setIconImage() support.
+
+* AWT GDKGraphics scaling.
+
+* New configure flag --enable-gtk-cairo to build Graphics2D
+implementation build on cairo and pangoft2. Enabled at runtime by
+defining the system property gnu.java.awt.peer.gtk.Graphics=Graphics2D.
+
+* javax.swing.JSpinner implemented.
+
+* java.awt.geom completed. Area, Arc2D, Ellipse2D and Line2D
+implemented.
+
+* JColorChooser, JComboBox and JTextField implemented, including
+example uses in GNU Classpath Examples swing Demo.
+
+* Better (non-black) default AWT System colors.
+
+* AWT lists use GTK treeviews.
+
+* Proper AWT focus management has been implemented.
+
+* Swing menus and scrollpanes are beginning to work.
+
+* Swing splitpanes, dialogs and internal frames were added.
+
+* Swing repainting / double buffering was redone.
+
+* Font management and Pango DPI conversion fixes.
+
+* A lot of AWT imaging and event bugs have been picked out.
+
+* More of javax.swing.text has been implemented.
+
+* javax.swing.Timer has been reimplemented.
+
+* The gnu.java.awt.EmbeddedWindow class has been improved, and now
+supports embedding AWT windows in other top-level X windows. This
+functionality is required by gcjwebplugin.
+
+* New javax.imageio, javax.imageio.event and javax.imageio.spi packages
+and classes.
+
+* Working implementation of javax.swing.undo.
+
+* java.awt.geom.CubicCurve2D/QuadCurve2D: Can now solve cubic and
+quadratic equations; implementation adapted from the GNU Scientific
+Library.
+
+* Lots of java.awt and gtk+ peer improvements. Also more Swing work.
+Start of EmbeddedWindow support.
+
*** Changes in GCC 3.4:
* Compiling a .jar file will now cause non-.class entries to be automatically
diff --git a/libjava/configure b/libjava/configure
index 277dd8b400e..7dee1e010dc 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -8557,222 +8557,22 @@ else
-for ac_func in strerror ioctl select fstat open fsync sleep opendir
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-#undef $ac_func
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-fi
-done
-for ac_func in gmtime_r localtime_r readdir_r getpwuid_r getcwd
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
@@ -8781,117 +8581,12 @@ done
-
-
-for ac_func in access stat mkdir rename rmdir unlink realpath utime chmod
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-for ac_func in nl_langinfo setlocale
+for ac_func in strerror ioctl select fstat open fsync sleep opendir \
+ gmtime_r localtime_r readdir_r getpwuid_r getcwd \
+ access stat mkdir rename rmdir unlink realpath utime chmod \
+ nl_langinfo setlocale \
+ inet_pton uname inet_ntoa \
+ fork execvp pipe sigaction ftruncate
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -9105,226 +8800,6 @@ _ACEOF
fi
done
-
-
-
-for ac_func in inet_pton uname inet_ntoa
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-
-for ac_func in fork execvp pipe sigaction ftruncate
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
@@ -13629,6 +13104,85 @@ echo "$as_me: error: Library requirements (libart-2.0 >= 2.1) not met; consider
+
+ # We require the XTest Extension to support java.awt.Robot.
+ echo "$as_me:$LINENO: checking for XTestQueryExtension in -lXtst" >&5
+echo $ECHO_N "checking for XTestQueryExtension in -lXtst... $ECHO_C" >&6
+if test "${ac_cv_lib_Xtst_XTestQueryExtension+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXtst ${X_LIBS} $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XTestQueryExtension ();
+int
+main ()
+{
+XTestQueryExtension ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_Xtst_XTestQueryExtension=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_Xtst_XTestQueryExtension=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xtst_XTestQueryExtension" >&5
+echo "${ECHO_T}$ac_cv_lib_Xtst_XTestQueryExtension" >&6
+if test $ac_cv_lib_Xtst_XTestQueryExtension = yes; then
+ true
+else
+ { { echo "$as_me:$LINENO: error: libXtst not found, required by java.awt.Robot" >&5
+echo "$as_me: error: libXtst not found, required by java.awt.Robot" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
fi
# On Solaris, and maybe other architectures, the Boehm collector
@@ -14301,6 +13855,8 @@ esac
# We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
# On that system, sys/ioctl.h will not include sys/filio.h unless
# BSD_COMP is defined; just including sys/filio.h is simpler.
+# We avoid AC_HEADER_DIRENT since we really only care about dirent.h
+# for now. If you change this, you also must update natFile.cc.
@@ -14320,159 +13876,12 @@ esac
-for ac_header in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h pwd.h sys/config.h stdint.h langinfo.h locale.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ---------------------------------- ##
-## Report this to the libjava lists. ##
-## ---------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-# We avoid AC_HEADER_DIRENT since we really only care about dirent.h
-# for now. If you change this, you also must update natFile.cc.
-for ac_header in dirent.h
+for ac_header in unistd.h bstring.h sys/time.h sys/types.h fcntl.h \
+ sys/ioctl.h sys/filio.h sys/stat.h sys/select.h \
+ sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h \
+ pwd.h sys/config.h stdint.h langinfo.h locale.h \
+ dirent.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
diff --git a/libjava/configure.ac b/libjava/configure.ac
index 292578547c1..c7da4f591f2 100644
--- a/libjava/configure.ac
+++ b/libjava/configure.ac
@@ -759,13 +759,13 @@ if test "x${with_newlib}" = "xyes"; then
AC_DEFINE(NO_GETUID, 1, [Define if getuid() and friends are missing.])
PLATFORMNET=NoNet
else
- AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep opendir)
- AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r getcwd)
- AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath utime chmod)
- AC_CHECK_FUNCS(nl_langinfo setlocale)
+ AC_CHECK_FUNCS([strerror ioctl select fstat open fsync sleep opendir \
+ gmtime_r localtime_r readdir_r getpwuid_r getcwd \
+ access stat mkdir rename rmdir unlink realpath utime chmod \
+ nl_langinfo setlocale \
+ inet_pton uname inet_ntoa \
+ fork execvp pipe sigaction ftruncate])
AC_CHECK_FUNCS(inet_aton inet_addr, break)
- AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
- AC_CHECK_FUNCS(fork execvp pipe sigaction ftruncate)
AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h)
AC_CHECK_FUNC(backtrace, [
case "$host" in
@@ -1014,6 +1014,11 @@ else
PKG_CHECK_MODULES(LIBART, libart-2.0 >= 2.1)
AC_SUBST(LIBART_CFLAGS)
AC_SUBST(LIBART_LIBS)
+
+ # We require the XTest Extension to support java.awt.Robot.
+ AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true],
+ [AC_MSG_ERROR([libXtst not found, required by java.awt.Robot])],
+ [${X_LIBS}])
fi
# On Solaris, and maybe other architectures, the Boehm collector
@@ -1207,10 +1212,13 @@ TL_AC_GXX_INCLUDE_DIR
# We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
# On that system, sys/ioctl.h will not include sys/filio.h unless
# BSD_COMP is defined; just including sys/filio.h is simpler.
-AC_CHECK_HEADERS(unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h pwd.h sys/config.h stdint.h langinfo.h locale.h)
# We avoid AC_HEADER_DIRENT since we really only care about dirent.h
# for now. If you change this, you also must update natFile.cc.
-AC_CHECK_HEADERS(dirent.h)
+AC_CHECK_HEADERS([unistd.h bstring.h sys/time.h sys/types.h fcntl.h \
+ sys/ioctl.h sys/filio.h sys/stat.h sys/select.h \
+ sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h \
+ pwd.h sys/config.h stdint.h langinfo.h locale.h \
+ dirent.h])
AC_CHECK_HEADERS(inttypes.h, [
AC_DEFINE(HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])
AC_DEFINE(JV_HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc
index a40bff1758e..382b321f591 100644
--- a/libjava/defineclass.cc
+++ b/libjava/defineclass.cc
@@ -908,16 +908,14 @@ _Jv_ClassReader::handleClassBegin (int access_flags, int this_class, int super_c
throw_no_class_def_found_error ("loading java.lang.Object");
}
- // In the pre-loading state, it can be looked up in the
- // cache only by this thread! This allows the super-class
- // to include references to this class.
-
def->state = JV_STATE_PRELOADING;
- {
- JvSynchronize sync (&java::lang::Class::class$);
- _Jv_RegisterClass (def);
- }
+ // Register this class with its defining loader as well (despite the
+ // name of the function we're calling), so that super class lookups
+ // work properly. If there is an error, our caller will unregister
+ // this class from the class loader. Also, we don't need to hold a
+ // lock here, as our caller has acquired it.
+ _Jv_RegisterInitiatingLoader (def, def->loader);
if (super_class != 0)
{
diff --git a/libjava/external/sax/Makefile.am b/libjava/external/sax/Makefile.am
index d6afe8c9332..d2d6ec9d087 100644
--- a/libjava/external/sax/Makefile.am
+++ b/libjava/external/sax/Makefile.am
@@ -15,7 +15,7 @@ AM_GCJFLAGS = \
--encoding=UTF-8 \
-Wno-deprecated
-all-local: classes.stamp
+BUILT_SOURCES = classes.stamp
classes.stamp: $(libsax_convenience_la_SOURCES)
here=`pwd`; cd $(srcdir); \
@@ -23,8 +23,8 @@ classes.stamp: $(libsax_convenience_la_SOURCES)
echo > classes.stamp
mostlyclean-local:
- find . -name '*.class' | xargs rm
- rm classes.stamp
+ -find . -name '*.class' | xargs rm
+ -rm classes.stamp
noinst_LTLIBRARIES = libsax_convenience.la
diff --git a/libjava/external/sax/Makefile.in b/libjava/external/sax/Makefile.in
index d1c32194f51..a4b95da0d61 100644
--- a/libjava/external/sax/Makefile.in
+++ b/libjava/external/sax/Makefile.in
@@ -336,6 +336,7 @@ AM_GCJFLAGS = \
--encoding=UTF-8 \
-Wno-deprecated
+BUILT_SOURCES = classes.stamp
noinst_LTLIBRARIES = libsax_convenience.la
libsax_convenience_la_SOURCES = \
org/xml/sax/SAXNotSupportedException.java \
@@ -375,7 +376,8 @@ org/xml/sax/DocumentHandler.java \
org/xml/sax/DTDHandler.java \
org/xml/sax/Parser.java
-all: all-am
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .java .lo .o .obj
@@ -749,10 +751,12 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) all-local
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES)
installdirs:
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@@ -782,6 +786,7 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
@@ -833,29 +838,27 @@ ps-am:
uninstall-am: uninstall-info-am
-.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
- clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \
- distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-exec install-exec-am install-info \
- install-info-am install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
- pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-local pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
-all-local: classes.stamp
-
classes.stamp: $(libsax_convenience_la_SOURCES)
here=`pwd`; cd $(srcdir); \
$(GCJ_WITH_FLAGS) -C -d $$here $(libsax_convenience_la_SOURCES)
echo > classes.stamp
mostlyclean-local:
- find . -name '*.class' | xargs rm
- rm classes.stamp
+ -find . -name '*.class' | xargs rm
+ -rm classes.stamp
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libjava/external/w3c_dom/Makefile.am b/libjava/external/w3c_dom/Makefile.am
index 8cf62e43e08..37ba5746a48 100644
--- a/libjava/external/w3c_dom/Makefile.am
+++ b/libjava/external/w3c_dom/Makefile.am
@@ -15,7 +15,7 @@ AM_GCJFLAGS = \
--encoding=UTF-8 \
-Wno-deprecated
-all-local: classes.stamp
+BUILT_SOURCES = classes.stamp
classes.stamp: $(libw3c_convenience_la_SOURCES)
here=`pwd`; cd $(srcdir); \
@@ -23,8 +23,8 @@ classes.stamp: $(libw3c_convenience_la_SOURCES)
echo > classes.stamp
mostlyclean-local:
- find . -name '*.class' | xargs rm
- rm classes.stamp
+ -find . -name '*.class' | xargs rm
+ -rm classes.stamp
noinst_LTLIBRARIES = libw3c_convenience.la
diff --git a/libjava/external/w3c_dom/Makefile.in b/libjava/external/w3c_dom/Makefile.in
index bb52ab7e0f3..56842d9b5df 100644
--- a/libjava/external/w3c_dom/Makefile.in
+++ b/libjava/external/w3c_dom/Makefile.in
@@ -430,6 +430,7 @@ AM_GCJFLAGS = \
--encoding=UTF-8 \
-Wno-deprecated
+BUILT_SOURCES = classes.stamp
noinst_LTLIBRARIES = libw3c_convenience.la
libw3c_convenience_la_SOURCES = \
org/w3c/dom/xpath/XPathNamespace.java \
@@ -579,7 +580,8 @@ org/w3c/dom/Text.java \
org/w3c/dom/DocumentType.java \
org/w3c/dom/DOMImplementationSource.java
-all: all-am
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .java .lo .o .obj
@@ -1623,10 +1625,12 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) all-local
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES)
installdirs:
-install: install-am
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
@@ -1672,6 +1676,7 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
@@ -1723,29 +1728,27 @@ ps-am:
uninstall-am: uninstall-info-am
-.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
- clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \
- distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-exec install-exec-am install-info \
- install-info-am install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
- pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-local pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
-all-local: classes.stamp
-
classes.stamp: $(libw3c_convenience_la_SOURCES)
here=`pwd`; cd $(srcdir); \
$(GCJ_WITH_FLAGS) -C -d $$here $(libw3c_convenience_la_SOURCES)
echo > classes.stamp
mostlyclean-local:
- find . -name '*.class' | xargs rm
- rm classes.stamp
+ -find . -name '*.class' | xargs rm
+ -rm classes.stamp
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libjava/gcj/cni.h b/libjava/gcj/cni.h
index ee39738d228..4aea4b6e4a7 100644
--- a/libjava/gcj/cni.h
+++ b/libjava/gcj/cni.h
@@ -17,6 +17,7 @@ details. */
#include <java/lang/Class.h>
#include <gcj/array.h>
+#include <gcj/javaprims.h>
#include <string.h>
@@ -113,8 +114,11 @@ JvFree (void *ptr)
return _Jv_Free (ptr);
}
+typedef struct _Jv_VMOption JvVMOption;
+typedef struct _Jv_VMInitArgs JvVMInitArgs;
+
extern inline jint
-JvCreateJavaVM (void* vm_args)
+JvCreateJavaVM (JvVMInitArgs* vm_args)
{
return _Jv_CreateJavaVM (vm_args);
}
diff --git a/libjava/gcj/javaprims.h b/libjava/gcj/javaprims.h
index 53c26fe1a8e..e972f7ba518 100644
--- a/libjava/gcj/javaprims.h
+++ b/libjava/gcj/javaprims.h
@@ -487,7 +487,30 @@ extern "C" jsize _Jv_GetStringUTFLength (jstring);
extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
extern "C" jint _Jv_hashUtf8String (char*, int);
-extern jint _Jv_CreateJavaVM (void* /*vm_args*/);
+struct _Jv_VMOption
+{
+ // a VM initialization option
+ char* optionString;
+ // extra information associated with this option
+ void* extraInfo;
+};
+
+struct _Jv_VMInitArgs
+{
+ // for compatibility with JavaVMInitArgs
+ jint version;
+
+ // number of VM initialization options
+ jint nOptions;
+
+ // an array of VM initialization options
+ struct _Jv_VMOption* options;
+
+ // true if the option parser should ignore unrecognized options
+ jboolean ignoreUnrecognized;
+};
+
+extern jint _Jv_CreateJavaVM (struct _Jv_VMInitArgs*);
void
_Jv_ThreadRun (java::lang::Thread* thread);
diff --git a/libjava/gcj/method.h b/libjava/gcj/method.h
index d4246e41ef8..f97f865f920 100644
--- a/libjava/gcj/method.h
+++ b/libjava/gcj/method.h
@@ -12,6 +12,8 @@ details. */
#define __GCJ_METHOD_H__
#include <java/lang/Class.h>
+#include <java/lang/reflect/Constructor.h>
+#include <java/lang/reflect/Method.h>
extern inline jmethodID
_Jv_FromReflectedMethod (java::lang::reflect::Method *method)
diff --git a/libjava/gij.cc b/libjava/gij.cc
index 64457857a13..1894d9b9c96 100644
--- a/libjava/gij.cc
+++ b/libjava/gij.cc
@@ -47,7 +47,7 @@ static void
version ()
{
printf ("gij (GNU libgcj) version %s\n\n", __VERSION__);
- printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
+ printf ("Copyright (C) 2005 Free Software Foundation, Inc.\n");
printf ("This is free software; see the source for copying conditions. There is NO\n");
printf ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
}
diff --git a/libjava/gnu/awt/xlib/XEventLoop.java b/libjava/gnu/awt/xlib/XEventLoop.java
index 66878185b51..8f7828770e8 100644
--- a/libjava/gnu/awt/xlib/XEventLoop.java
+++ b/libjava/gnu/awt/xlib/XEventLoop.java
@@ -21,12 +21,11 @@ import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.util.Vector;
-public class XEventLoop implements Runnable
+public class XEventLoop
{
Display display;
EventQueue queue;
XAnyEvent anyEvent;
- Thread eventLoopThread;
LightweightRedirector lightweightRedirector = new LightweightRedirector();
@@ -36,44 +35,40 @@ public class XEventLoop implements Runnable
this.queue = queue;
anyEvent = new XAnyEvent(display);
- eventLoopThread = new Thread(this, "AWT thread for XEventLoop");
- eventLoopThread.start();
}
- public void run()
+ void interrupt()
{
- while (true)
- postNextEvent();
+ anyEvent.interrupt();
}
- void postNextEvent()
+ void postNextEvent(boolean block)
{
- AWTEvent evt = getNextEvent();
- queue.postEvent(evt);
+ AWTEvent evt = getNextEvent(block);
+ if (evt != null)
+ queue.postEvent(evt);
}
/** get next event. Will block until events become available. */
- public AWTEvent getNextEvent()
+ public AWTEvent getNextEvent(boolean block)
{
// ASSERT:
if (isIdle())
throw new Error("should not be idle");
AWTEvent event = null;
- while (event == null)
+ if (loadNextEvent(block))
{
- loadNextEvent();
- event = createEvent();
- }
-
- event = lightweightRedirector.redirect(event);
-
+ event = createEvent();
+ event = lightweightRedirector.redirect(event);
+ }
return event;
}
- void loadNextEvent()
+ boolean loadNextEvent(boolean block)
{
+ boolean gotEvent = false;
try
{
setIdle(true);
@@ -100,7 +95,7 @@ public class XEventLoop implements Runnable
of events. */
//display.flush(); // implicit?
- anyEvent.loadNext();
+ gotEvent = anyEvent.loadNext(block);
}
catch (RuntimeException re)
{
@@ -110,6 +105,7 @@ public class XEventLoop implements Runnable
{
setIdle(false);
}
+ return gotEvent;
}
/**
diff --git a/libjava/gnu/awt/xlib/XFramePeer.java b/libjava/gnu/awt/xlib/XFramePeer.java
index ec159078aba..f3c655ecf80 100644
--- a/libjava/gnu/awt/xlib/XFramePeer.java
+++ b/libjava/gnu/awt/xlib/XFramePeer.java
@@ -78,7 +78,7 @@ public class XFramePeer extends XCanvasPeer implements FramePeer
bounds. */
public void setBounds(int x, int y, int width, int height)
{
- if (Thread.currentThread() == getXToolkit().eventLoop.eventLoopThread)
+ if (EventQueue.isDispatchThread())
return;
super.setBounds(x, y, width, height);
diff --git a/libjava/gnu/awt/xlib/XToolkit.java b/libjava/gnu/awt/xlib/XToolkit.java
index a1d2440eef5..1e937c23867 100644
--- a/libjava/gnu/awt/xlib/XToolkit.java
+++ b/libjava/gnu/awt/xlib/XToolkit.java
@@ -438,5 +438,29 @@ public class XToolkit extends ClasspathToolkit
{
throw new java.lang.UnsupportedOperationException ();
}
-
+
+ public RobotPeer createRobot (GraphicsDevice screen) throws AWTException
+ {
+ throw new java.lang.UnsupportedOperationException ();
+ }
+
+ boolean interrupted;
+
+ public boolean nativeQueueEmpty()
+ {
+ return eventLoop.isIdle();
+ }
+
+ public void wakeNativeQueue()
+ {
+ interrupted = true;
+ eventLoop.interrupt();
+ }
+
+ public void iterateNativeQueue(java.awt.EventQueue locked, boolean block)
+ {
+ interrupted = false;
+ while (!interrupted)
+ eventLoop.postNextEvent(block);
+ };
}
diff --git a/libjava/gnu/gcj/convert/Convert.java b/libjava/gnu/gcj/convert/Convert.java
index 3b2add6ef42..5d4a314d609 100644
--- a/libjava/gnu/gcj/convert/Convert.java
+++ b/libjava/gnu/gcj/convert/Convert.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2002 Free Software Foundation
+/* Copyright (C) 1999, 2002, 2005 Free Software Foundation
This file is part of libgcj.
@@ -45,7 +45,7 @@ public class Convert
+ ") "
+ System.getProperty("java.vm.version"));
System.out.println();
- System.out.println("Copyright (C) 2002 Free Software Foundation, Inc.");
+ System.out.println("Copyright (C) 2005 Free Software Foundation, Inc.");
System.out.println("This is free software; see the source for copying conditions. There is NO");
System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
System.exit(0);
diff --git a/libjava/gnu/gcj/runtime/NameFinder.java b/libjava/gnu/gcj/runtime/NameFinder.java
index 024a6eeb232..b14bbf93327 100644
--- a/libjava/gnu/gcj/runtime/NameFinder.java
+++ b/libjava/gnu/gcj/runtime/NameFinder.java
@@ -37,8 +37,8 @@ import java.io.File;
* Whether calls to unknown functions (class and method names are unknown)
* should be removed from the stack trace. Only done when the stack is
* sanitized.</ul>
- * <ul><code>gnu.gcj.runtime.NameFinder.remove_interpreter</code>
- * Whether runtime interpreter calls (methods in the _Jv_InterpMethod class
+ * <ul><code>gnu.gcj.runtime.NameFinder.remove_internal</code>
+ * Whether runtime internal calls (methods in the internal _Jv_* classes
* and functions starting with 'ffi_') should be removed from the stack
* trace. Only done when the stack is sanitized.</ul>
* <ul><code>gnu.gcj.runtime.NameFinder.use_addr2line</code>
@@ -72,10 +72,18 @@ public class NameFinder
= Boolean.valueOf(System.getProperty
("gnu.gcj.runtime.NameFinder.remove_unknown", "true")
).booleanValue();
- private static final boolean remove_interpreter
- = Boolean.valueOf(System.getProperty
+
+ // The remove_interpreter name is an old 3.3/3.4 (deprecated) synonym.
+ private static final boolean remove_internal
+ = (Boolean.valueOf(System.getProperty
+ ("gnu.gcj.runtime.NameFinder.remove_internal", "true")
+ ).booleanValue()
+ ||
+ Boolean.valueOf(System.getProperty
("gnu.gcj.runtime.NameFinder.remove_interpreter", "true")
- ).booleanValue();
+ ).booleanValue()
+ );
+
private static final boolean use_addr2line
= Boolean.valueOf(System.getProperty
("gnu.gcj.runtime.NameFinder.use_addr2line", "true")
@@ -280,7 +288,7 @@ public class NameFinder
consName = className.substring(lastDot + 1) + '(';
int unknown = 0;
- int interpreter = 0;
+ int internal = 0;
int last_throw = -1;
int length = elements.length;
int end = length-1;
@@ -300,19 +308,23 @@ public class NameFinder
|| MName.startsWith("fillInStackTrace("))))
{
last_throw = i;
- // Reset counting of unknown and interpreter frames.
+ // Reset counting of unknown and internal frames.
unknown = 0;
- interpreter = 0;
+ internal = 0;
}
else if (remove_unknown && CName == null
&& (MName == null || MName.startsWith("0x")))
unknown++;
- else if (remove_interpreter
+ else if (remove_internal
&& ((CName == null
&& MName != null && MName.startsWith("ffi_"))
- || (CName != null && CName.equals("_Jv_InterpMethod"))))
- interpreter++;
- else if ("main(java.lang.String[])".equals(MName))
+ || (CName != null && CName.startsWith("_Jv_"))
+ || (CName == null && MName != null
+ && MName.startsWith("_Jv_"))))
+ internal++;
+ else if (("java.lang.Thread".equals(CName)
+ || "gnu.java.lang.MainThread".equals(CName))
+ && "run()".equals(MName))
{
end = i;
break;
@@ -321,11 +333,11 @@ public class NameFinder
int begin = last_throw+1;
// Now filter out everything at the start and the end that is not part
- // of the "normal" user program including any elements that are interpreter
+ // of the "normal" user program including any elements that are internal
// calls or have no usefull information whatsoever.
// Unless that means we filter out all info.
- int nr_elements = end-begin-unknown-interpreter+1;
- if ((begin > 0 || end < length-1 || unknown > 0 || interpreter > 0)
+ int nr_elements = end - begin - unknown - internal + 1;
+ if ((begin > 0 || end < length-1 || unknown > 0 || internal > 0)
&& nr_elements > 0)
{
stack = new StackTraceElement[nr_elements];
@@ -337,14 +349,27 @@ public class NameFinder
if (remove_unknown && CName == null
&& (MName == null || MName.startsWith("0x")))
; // Skip unknown frame
- else if (remove_interpreter
+ else if (remove_internal
&& ((CName == null
- && MName != null && MName.startsWith("ffi_"))
- || (CName != null && CName.equals("_Jv_InterpMethod"))))
- ; // Skip interpreter runtime frame
+ && MName != null && MName.startsWith("ffi_"))
+ || (CName != null && CName.startsWith("_Jv_"))
+ || (CName == null && MName != null
+ && MName.startsWith("_Jv_"))))
+ ; // Skip internal runtime frame
else
{
- stack[pos] = elements[i];
+ // Null Class or Method name in elements are not allowed.
+ if (MName == null || CName == null)
+ {
+ MName = MName == null ? "" : MName;
+ CName = CName == null ? "" : CName;
+ stack[pos] = newElement(elements[i].getFileName(),
+ elements[i].getLineNumber(),
+ CName, MName,
+ elements[i].isNativeMethod());
+ }
+ else
+ stack[pos] = elements[i];
pos++;
}
}
@@ -359,11 +384,11 @@ public class NameFinder
* Native helper method to create a StackTraceElement. Needed to work
* around normal Java access restrictions.
*/
- native private StackTraceElement newElement(String fileName,
- int lineNumber,
- String className,
- String methName,
- boolean isNative);
+ native static private StackTraceElement newElement(String fileName,
+ int lineNumber,
+ String className,
+ String methName,
+ boolean isNative);
/**
* Creates a StackTraceElement given a string and a filename.
diff --git a/libjava/gnu/gcj/runtime/PersistentByteMap.java b/libjava/gnu/gcj/runtime/PersistentByteMap.java
index 230d7858576..a20f5b8ab2b 100644
--- a/libjava/gnu/gcj/runtime/PersistentByteMap.java
+++ b/libjava/gnu/gcj/runtime/PersistentByteMap.java
@@ -39,10 +39,6 @@ USAGE:
BUGS/FEATURES:
remove() isn't written yet.
- we can't change the capacity of a PersistentByteMap.
-
- 0x12345678 is a bad choice for the magic number.
-
capacity is fixed once the map has been created.
We use linear probing to resolve collisions. It might be
@@ -51,11 +47,7 @@ BUGS/FEATURES:
table is half full there are only on average 1.5 probes for a
successful search and 2.5 probes for an unsuccessful one.
- We don't use unique strings. This wastes space.
-
- capacity should probably be prime, but we don't check that.
-
- we don't do any locking at all: adding to a PersistentByteMap
+ We don't do any locking at all: adding to a PersistentByteMap
at runtime is possible, but it requires filesystem locks
around get(), put(), and remove().
*/
@@ -67,6 +59,7 @@ import java.nio.*;
import java.nio.channels.*;
import java.util.*;
import java.security.MessageDigest;
+import java.math.BigInteger;
public class PersistentByteMap
{
@@ -94,12 +87,18 @@ public class PersistentByteMap
private long length; // the length of the underlying file
+ private final File name; // The name of the underlying file
+
static private final int UNUSED_ENTRY = -1;
static public final int KEYS = 0;
static public final int VALUES = 1;
static public final int ENTRIES = 2;
+ private HashMap values; // A map of strings in the string table.
+
+ FileChannel fc; // The underlying file channel.
+
static final public class AccessMode
{
private final FileChannel.MapMode mapMode;
@@ -108,10 +107,12 @@ public class PersistentByteMap
{
READ_ONLY = new AccessMode(FileChannel.MapMode.READ_ONLY);
READ_WRITE = new AccessMode(FileChannel.MapMode.READ_WRITE);
+ PRIVATE = new AccessMode(FileChannel.MapMode.PRIVATE);
}
public static final AccessMode READ_ONLY;
public static final AccessMode READ_WRITE;
+ public static final AccessMode PRIVATE;
private AccessMode(FileChannel.MapMode mode)
{
@@ -119,8 +120,9 @@ public class PersistentByteMap
}
}
- private PersistentByteMap()
+ private PersistentByteMap(File name)
{
+ this.name = name;
}
public PersistentByteMap(String filename, AccessMode mode)
@@ -132,7 +134,7 @@ public class PersistentByteMap
public PersistentByteMap(File f, AccessMode mode)
throws IOException
{
- FileChannel fc;
+ name = f;
if (mode == AccessMode.READ_ONLY)
{
@@ -149,7 +151,7 @@ public class PersistentByteMap
buf = fc.map(mode.mapMode, 0, length);
int magic = getWord (MAGIC);
- if (magic != 0x12345678)
+ if (magic != 0x67636a64) /* "gcjd" */
throw new IllegalArgumentException(f.getName());
table_base = getWord (TABLE_BASE);
@@ -167,8 +169,27 @@ public class PersistentByteMap
{
f.createNewFile();
RandomAccessFile raf = new RandomAccessFile(f, "rw");
-
- this.capacity = capacity;
+
+ {
+ // The user has explicitly provided a size for the table.
+ // We're going to make that size prime. This isn't
+ // strictly necessary but it can't hurt.
+ //
+ // We expand the size by 3/2 because the hash table is
+ // intolerably slow when more than 2/3 full.
+
+ BigInteger size = new BigInteger(Integer.toString(capacity * 3/2));
+ BigInteger two = BigInteger.ONE.add(BigInteger.ONE);
+
+ if (size.getLowestSetBit() != 0) // A hard way to say isEven()
+ size = size.add(BigInteger.ONE);
+
+ while (! size.isProbablePrime(10))
+ size = size.add(two);
+
+ this.capacity = capacity = size.intValue();
+ }
+
table_base = 64;
string_base = table_base + capacity * TABLE_ENTRY_SIZE;
string_size = 0;
@@ -183,13 +204,13 @@ public class PersistentByteMap
for (long i = 0; i < totalFileSize; i+= 4096)
raf.write(_4k);
- FileChannel fc = raf.getChannel();
+ fc = raf.getChannel();
buf = fc.map(FileChannel.MapMode.READ_WRITE, 0, raf.length());
for (int i = 0; i < capacity; i++)
putKeyPos(UNUSED_ENTRY, i);
- putWord(0x12345678, MAGIC);
+ putWord(0x67636a64, MAGIC);
putWord(0x01, VERSION);
putWord(capacity, CAPACITY);
putWord(table_base, TABLE_BASE);
@@ -197,15 +218,17 @@ public class PersistentByteMap
putWord(file_size, FILE_SIZE);
putWord(elements, ELEMENTS);
buf.force();
+
+ length = fc.size();
+ string_size = 0;
}
- static public PersistentByteMap emptyPersistentByteMap(String filename,
- int capacity, int strtabSize)
+ static public PersistentByteMap
+ emptyPersistentByteMap(File name, int capacity, int strtabSize)
throws IOException
{
- File f = new File(filename);
- PersistentByteMap m = new PersistentByteMap();
- m.init(m, f, capacity, strtabSize);
+ PersistentByteMap m = new PersistentByteMap(name);
+ m.init(m, name, capacity, strtabSize);
return m;
}
@@ -313,9 +336,7 @@ public class PersistentByteMap
{
int hashIndex = hash(digest);
- // With the the table 2/3 full there will be on average 2 probes
- // for a successful search and 5 probes for an unsuccessful one.
- if (elements >= capacity * 2/3)
+ if (elements >= capacity())
throw new IllegalAccessException("Table Full: " + elements);
do
@@ -336,7 +357,7 @@ public class PersistentByteMap
int newValue = addBytes((byte[])value);
putValuePos(newValue, hashIndex);
return;
- }
+ }
hashIndex++;
hashIndex %= capacity;
@@ -347,6 +368,33 @@ public class PersistentByteMap
private int addBytes (byte[] data)
throws IllegalAccessException
{
+ if (data.length > 16)
+ {
+ // Keep track of long strings in the hope that we will be able
+ // to re-use them.
+ if (values == null)
+ {
+ values = new HashMap();
+
+ for (int i = 0; i < capacity; i++)
+ if (getKeyPos(i) != UNUSED_ENTRY)
+ {
+ int pos = getValuePos(i);
+ ByteWrapper bytes = new ByteWrapper(getBytes(pos));
+ values.put(bytes, new Integer(pos));
+ }
+ }
+
+ {
+ Object result = values.get(new ByteWrapper(data));
+ if (result != null)
+ {
+ // We already have this value in the string table
+ return ((Integer)result).intValue();
+ }
+ }
+ }
+
if (data.length + INT_SIZE >= this.length)
throw new IllegalAccessException("String table Full");
@@ -363,6 +411,9 @@ public class PersistentByteMap
file_size = extent;
putWord (string_size, STRING_SIZE);
putWord (file_size, FILE_SIZE);
+
+ if (data.length > 16)
+ values.put(new ByteWrapper(data), new Integer(top - string_base));
return top - string_base;
}
@@ -377,11 +428,68 @@ public class PersistentByteMap
return elements;
}
+ public int stringTableSize()
+ {
+ return string_size;
+ }
+
public int capacity()
{
- return capacity;
+ // With the the table 2/3 full there will be on average 2 probes
+ // for a successful search and 5 probes for an unsuccessful one.
+ return capacity * 2/3;
}
+ public void force()
+ {
+ buf.force();
+ }
+
+ public File getFile()
+ {
+ return name;
+ }
+
+ // Close the map. Once this has been done, the map can no longer be
+ // used.
+ public void close()
+ {
+ force();
+ fc.close();
+ }
+
+ public void
+ putAll(PersistentByteMap t)
+ throws IllegalAccessException
+ {
+ // We can use a fast copy if the size of a map has not changed.
+ if (this.elements == 0 && t.capacity == this.capacity
+ && t.length == this.length)
+ {
+ this.buf.position(0);
+ t.buf.position(0);
+ this.buf.put(t.buf);
+ this.table_base = t.table_base;
+ this.string_base = t.string_base;
+ this.string_size = t.string_size;
+ this.file_size = t.file_size;
+ this.elements = t.elements;
+ if (t.values != null)
+ this.values = (HashMap)t.values.clone();
+ return;
+ }
+
+ // Otherwise do it the hard way.
+ Iterator iterator = t.iterator(PersistentByteMap.ENTRIES);
+ while (iterator.hasNext())
+ {
+ PersistentByteMap.MapEntry entry
+ = (PersistentByteMap.MapEntry)iterator.next();
+ this.put((byte[])entry.getKey(), (byte[])entry.getValue());
+ }
+ }
+
+
private final class HashIterator implements Iterator
{
/** Current index in the physical hash table. */
@@ -481,4 +589,31 @@ public class PersistentByteMap
return bucket;
}
}
+
+ // A wrapper class for a byte array that allows collections to be
+ // made.
+ private final class ByteWrapper
+ {
+ final byte[] bytes;
+ final int hash;
+
+ public ByteWrapper (byte[] bytes)
+ {
+ int sum = 0;
+ this.bytes = bytes;
+ for (int i = 0; i < bytes.length; i++)
+ sum += bytes[i];
+ hash = sum;
+ }
+
+ public int hashCode()
+ {
+ return hash;
+ }
+
+ public boolean equals(Object obj)
+ {
+ return Arrays.equals(bytes, ((ByteWrapper)obj).bytes);
+ }
+ }
}
diff --git a/libjava/gnu/gcj/runtime/SharedLibHelper.java b/libjava/gnu/gcj/runtime/SharedLibHelper.java
index a0bfe68b83c..bdf7c0453ae 100644
--- a/libjava/gnu/gcj/runtime/SharedLibHelper.java
+++ b/libjava/gnu/gcj/runtime/SharedLibHelper.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2003, 2004 Free Software Foundation
+/* Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -28,13 +28,15 @@ public class SharedLibHelper
* @parem flags passed to dlopen
*/
SharedLibHelper(String libname, ClassLoader parent, CodeSource source,
- int flags)
+ ProtectionDomain domain, int flags)
{
// FIXME: ask security manager first.
loader = parent;
baseName = libname;
- domain = new ProtectionDomain(source,
- Policy.getPolicy().getPermissions(source));
+ if (domain == null)
+ domain = new ProtectionDomain(source,
+ Policy.getPolicy().getPermissions(source));
+ this.domain = domain;
this.flags = flags;
}
@@ -65,7 +67,16 @@ public class SharedLibHelper
}
public static SharedLibHelper findHelper (ClassLoader loader, String libname,
- CodeSource source)
+ CodeSource source,
+ boolean tryParents)
+ {
+ return findHelper (loader, libname, source, null, tryParents);
+ }
+
+ public static SharedLibHelper findHelper (ClassLoader loader, String libname,
+ CodeSource source,
+ ProtectionDomain domain,
+ boolean tryParents)
{
synchronized (map)
{
@@ -95,7 +106,7 @@ public class SharedLibHelper
return result;
l = l.getParent();
}
- while (l != null);
+ while (tryParents && l != null);
}
}
}
@@ -109,6 +120,7 @@ public class SharedLibHelper
".so", new File ("/tmp"));
File src = new File(libname);
copyFile (src, copy);
+ copy.deleteOnExit();
libname = copy.getPath();
}
catch (IOException e)
@@ -116,7 +128,7 @@ public class SharedLibHelper
return null;
}
}
- result = new SharedLibHelper(libname, loader, source, 0);
+ result = new SharedLibHelper(libname, loader, source, domain, 0);
s.add(new WeakReference(result));
return result;
}
diff --git a/libjava/gnu/gcj/runtime/SharedLibLoader.java b/libjava/gnu/gcj/runtime/SharedLibLoader.java
index 1f80bbc8289..b8e6a57de53 100644
--- a/libjava/gnu/gcj/runtime/SharedLibLoader.java
+++ b/libjava/gnu/gcj/runtime/SharedLibLoader.java
@@ -39,7 +39,7 @@ public class SharedLibLoader extends ClassLoader
url = null;
}
helper = SharedLibHelper.findHelper(this, libname,
- new CodeSource(url, null));
+ new CodeSource(url, null), true);
}
/** Load a shared library, and asociate a ClassLoader with it.
diff --git a/libjava/gnu/gcj/tools/gcj_dbtool/Main.java b/libjava/gnu/gcj/tools/gcj_dbtool/Main.java
index b9bea0e09fa..ea8f35cf3f4 100644
--- a/libjava/gnu/gcj/tools/gcj_dbtool/Main.java
+++ b/libjava/gnu/gcj/tools/gcj_dbtool/Main.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation
+/* Copyright (C) 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -11,13 +11,15 @@ package gnu.gcj.tools.gcj_dbtool;
import gnu.gcj.runtime.PersistentByteMap;
import java.io.*;
+import java.nio.channels.*;
import java.util.*;
import java.util.jar.*;
import java.security.MessageDigest;
-import java.math.BigInteger;
public class Main
{
+ static private boolean verbose = false;
+
public static void main (String[] s)
{
insist (s.length >= 1);
@@ -29,7 +31,7 @@ public class Main
+ ") "
+ System.getProperty("java.vm.version"));
System.out.println();
- System.out.println("Copyright 2004 Free Software Foundation, Inc.");
+ System.out.println("Copyright 2005 Free Software Foundation, Inc.");
System.out.println("This is free software; see the source for copying conditions. There is NO");
System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
return;
@@ -42,26 +44,14 @@ public class Main
if (s[0].equals("-n"))
{
+ // Create a new database.
insist (s.length >= 2 && s.length <= 3);
int capacity = 32749;
if (s.length == 3)
- {
- // The user has explicitly provided a size for the table.
- // We're going to make that size prime. This isn't
- // strictly necessary but it can't hurt.
-
- BigInteger size = new BigInteger(s[2], 10);
- BigInteger two = BigInteger.ONE.add(BigInteger.ONE);
-
- if (size.getLowestSetBit() != 0) // A hard way to say isEven()
- size = size.add(BigInteger.ONE);
-
- while (! size.isProbablePrime(10))
- size = size.add(two);
-
- capacity = size.intValue();
+ {
+ capacity = Integer.parseInt(s[2]);
if (capacity <= 2)
{
@@ -73,7 +63,8 @@ public class Main
try
{
PersistentByteMap b
- = PersistentByteMap.emptyPersistentByteMap (s[1], capacity, capacity*64);
+ = PersistentByteMap.emptyPersistentByteMap(new File(s[1]),
+ capacity, capacity*32);
}
catch (Exception e)
{
@@ -86,18 +77,26 @@ public class Main
if (s[0].equals("-a"))
{
+ // Add a jar file to a database, creating it if necessary.
+ // Copies the database, adds the jar file to the copy, and
+ // then renames the new database over the old.
try
{
insist (s.length == 4);
- File jar = new File(s[2]);
- PersistentByteMap b
- = new PersistentByteMap(new File(s[1]),
- PersistentByteMap.AccessMode.READ_WRITE);
+ File database = new File(s[1]);
+ database = database.getAbsoluteFile();
+ File jar = new File(s[2]);
+ PersistentByteMap map;
+ if (database.isFile())
+ map = new PersistentByteMap(database,
+ PersistentByteMap.AccessMode.READ_ONLY);
+ else
+ map = PersistentByteMap.emptyPersistentByteMap(database,
+ 100, 100*32);
File soFile = new File(s[3]);
if (! soFile.isFile())
throw new IllegalArgumentException(s[3] + " is not a file");
-
- addJar(jar, b, soFile);
+ map = addJar(jar, map, soFile);
}
catch (Exception e)
{
@@ -110,6 +109,7 @@ public class Main
if (s[0].equals("-t"))
{
+ // Test
try
{
insist (s.length == 2);
@@ -142,8 +142,60 @@ public class Main
return;
}
+ if (s[0].equals("-m"))
+ {
+ // Merge databases.
+ insist (s.length >= 3);
+ try
+ {
+ File database = new File(s[1]);
+ database = database.getAbsoluteFile();
+ File temp = File.createTempFile(database.getName(), "",
+ database.getParentFile());
+
+ int newSize = 0;
+ int newStringTableSize = 0;
+ PersistentByteMap[] sourceMaps = new PersistentByteMap[s.length - 2];
+ // Scan all the input files, calculating worst case string
+ // table and hash table use.
+ for (int i = 2; i < s.length; i++)
+ {
+ PersistentByteMap b
+ = new PersistentByteMap(new File(s[i]),
+ PersistentByteMap.AccessMode.READ_ONLY);
+ newSize += b.size();
+ newStringTableSize += b.stringTableSize();
+ sourceMaps[i - 2] = b;
+ }
+
+ newSize *= 1.5; // Scaling the new size by 1.5 results in
+ // fewer collisions.
+ PersistentByteMap map
+ = PersistentByteMap.emptyPersistentByteMap
+ (temp, newSize, newStringTableSize);
+
+ for (int i = 0; i < sourceMaps.length; i++)
+ {
+ if (verbose)
+ System.err.println("adding " + sourceMaps[i].size()
+ + " elements from "
+ + sourceMaps[i].getFile());
+ map.putAll(sourceMaps[i]);
+ }
+ map.close();
+ temp.renameTo(database);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(3);
+ }
+ return;
+ }
+
if (s[0].equals("-l"))
{
+ // List a database.
insist (s.length == 2);
try
{
@@ -180,6 +232,7 @@ public class Main
if (s[0].equals("-d"))
{
+ // For testing only: fill the byte map with random data.
insist (s.length == 2);
try
{
@@ -225,20 +278,49 @@ public class Main
+ " Usage: \n"
+ " gcj-dbtool -n file.gcjdb [size] - Create a new gcj map database\n"
+ " gcj-dbtool -a file.gcjdb file.jar file.so\n"
- + " - Add the contents of file.jar to the database\n"
+ + " - Add the contents of file.jar to a new gcj map database\n"
+ " gcj-dbtool -t file.gcjdb - Test a gcj map database\n"
- + " gcj-dbtool -l file.gcjdb - List a gcj map database\n");
+ + " gcj-dbtool -l file.gcjdb - List a gcj map database\n"
+ + " gcj-dbtool -m dest.gcjdb [source.gcjdb]...\n"
+ + " - Merge gcj map databases into dest\n"
+ + " Replaces dest\n"
+ + " To add to dest, include dest in the list of sources");
}
-
- private static void addJar(File f, PersistentByteMap b, File soFile)
- throws Exception
+ // Add a jar to a map. This copies the map first and returns a
+ // different map that contains the data. The original map is
+ // closed.
+
+ private static PersistentByteMap
+ addJar(File f, PersistentByteMap b, File soFile)
+ throws Exception
{
MessageDigest md = MessageDigest.getInstance("MD5");
JarFile jar = new JarFile (f);
+
+ int count = 0;
+ {
+ Enumeration entries = jar.entries();
+ while (entries.hasMoreElements())
+ {
+ JarEntry classfile = (JarEntry)entries.nextElement();
+ if (classfile.getName().endsWith(".class"))
+ count++;
+ }
+ }
+
+ if (verbose)
+ System.err.println("adding " + count + " elements from "
+ + f + " to " + b.getFile());
+
+ // Maybe resize the destination map. We're allowing plenty of
+ // extra space by using a loadFactor of 2.
+ b = resizeMap(b, (b.size() + count) * 2, true);
+
Enumeration entries = jar.entries();
+ byte[] soFileName = soFile.getCanonicalPath().getBytes("UTF-8");
while (entries.hasMoreElements())
{
JarEntry classfile = (JarEntry)entries.nextElement();
@@ -259,12 +341,41 @@ public class Main
+ classfile.getName());
pos += len;
}
- b.put(md.digest(data),
- soFile.getCanonicalPath().getBytes());
+ b.put(md.digest(data), soFileName);
}
- }
+ }
+ return b;
}
+ // Resize a map by creating a new one with the same data and
+ // renaming it. If close is true, close the original map.
+
+ static PersistentByteMap resizeMap(PersistentByteMap m, int newCapacity, boolean close)
+ throws IOException, IllegalAccessException
+ {
+ newCapacity = Math.max(m.capacity(), newCapacity);
+ File name = m.getFile();
+ File copy = File.createTempFile(name.getName(), "", name.getParentFile());
+ try
+ {
+ PersistentByteMap dest
+ = PersistentByteMap.emptyPersistentByteMap
+ (copy, newCapacity, newCapacity*32);
+ dest.putAll(m);
+ dest.force();
+ if (close)
+ m.close();
+ copy.renameTo(name);
+ return dest;
+ }
+ catch (Exception e)
+ {
+ copy.delete();
+ }
+ return null;
+ }
+
+
static String bytesToString(byte[] b)
{
StringBuffer hexBytes = new StringBuffer();
diff --git a/libjava/gnu/gcj/xlib/XAnyEvent.java b/libjava/gnu/gcj/xlib/XAnyEvent.java
index 061d6137b17..bce3a6150ee 100644
--- a/libjava/gnu/gcj/xlib/XAnyEvent.java
+++ b/libjava/gnu/gcj/xlib/XAnyEvent.java
@@ -70,7 +70,8 @@ public final class XAnyEvent
/**
* Load next event into the event structure.
*/
- public native void loadNext();
+ public native boolean loadNext(boolean block);
+ public native void interrupt();
public native int getType();
public native void setType(int type);
@@ -86,6 +87,7 @@ public final class XAnyEvent
public native void send(Window destination, boolean propagate,
long mask);
+ RawData pipefds;
RawData structure;
Display display;
diff --git a/libjava/gnu/gcj/xlib/natXAnyEvent.cc b/libjava/gnu/gcj/xlib/natXAnyEvent.cc
index 439f204b373..0bef563ed2d 100644
--- a/libjava/gnu/gcj/xlib/natXAnyEvent.cc
+++ b/libjava/gnu/gcj/xlib/natXAnyEvent.cc
@@ -6,6 +6,12 @@ This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
+#include <config.h>
+#include <platform.h>
+
+#include <gcj/javaprims.h>
+#include <jvm.h>
+
#include <X11/Xlib.h>
#include <gcj/cni.h>
@@ -22,24 +28,72 @@ details. */
#include <gnu/gcj/xlib/XExposeEvent.h>
#include <gnu/gcj/xlib/XException.h>
+#include <unistd.h>
+#include <posix.h>
+
void gnu::gcj::xlib::XAnyEvent::init()
{
::XEvent* event = new ::XEvent;
+ int *pipes = new int[2];
+ pipe(pipes);
structure = reinterpret_cast<gnu::gcj::RawData*>(event);
+ pipefds = reinterpret_cast<gnu::gcj::RawData*>(pipes);
}
void gnu::gcj::xlib::XAnyEvent::finalize()
{
delete structure;
+ int *pipe = reinterpret_cast<int *>(pipefds);
+ close(pipe[0]);
+ close(pipe[1]);
+ delete [] pipefds;
+ pipefds = 0;
structure = 0;
}
-void gnu::gcj::xlib::XAnyEvent::loadNext()
+jboolean gnu::gcj::xlib::XAnyEvent::loadNext(jboolean block)
{
::Display* dpy = (::Display*) display->display;
::XEvent* evt = (::XEvent*) structure;
- XNextEvent(dpy, evt);
- // What does XNextEvent return?
+
+ if (XPending(dpy))
+ {
+ XNextEvent(dpy, evt);
+ return true;
+ }
+
+ if (!block)
+ return false;
+
+ int *pipe = reinterpret_cast<int *>(pipefds);
+ int xfd = XConnectionNumber(dpy);
+ int pipefd = pipe[0];
+ int n = (xfd > pipefd ? xfd : pipefd) + 1;
+ fd_set rfds;
+ FD_ZERO(&rfds);
+ FD_SET(xfd, &rfds);
+ FD_SET(pipefd, &rfds);
+ int sel = _Jv_select (n, &rfds, NULL, NULL, NULL);
+ if (sel > 0)
+ {
+ if (FD_ISSET(xfd, &rfds))
+ {
+ XNextEvent(dpy, evt);
+ return true;
+ }
+ if (FD_ISSET(pipefd, &rfds))
+ {
+ char c;
+ read(pipefd, &c, 1);
+ }
+ }
+ return false;
+}
+
+void gnu::gcj::xlib::XAnyEvent::interrupt()
+{
+ int *pipe = reinterpret_cast<int *>(pipefds);
+ write(pipe[1], "W", 1);
}
jint gnu::gcj::xlib::XAnyEvent::getType()
diff --git a/libjava/gnu/java/awt/ClasspathToolkit.java b/libjava/gnu/java/awt/ClasspathToolkit.java
index c2492315b08..72302e11c30 100644
--- a/libjava/gnu/java/awt/ClasspathToolkit.java
+++ b/libjava/gnu/java/awt/ClasspathToolkit.java
@@ -41,16 +41,20 @@ package gnu.java.awt;
import gnu.java.awt.peer.ClasspathFontPeer;
import gnu.java.awt.peer.ClasspathTextLayoutPeer;
-import java.awt.Image;
+import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.DisplayMode;
+import java.awt.EventQueue;
import java.awt.Font;
import java.awt.FontMetrics;
+import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import java.awt.Image;
import java.awt.Toolkit;
import java.awt.font.FontRenderContext;
import java.awt.image.ColorModel;
import java.awt.image.ImageProducer;
+import java.awt.peer.RobotPeer;
import java.io.File;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -59,6 +63,7 @@ import java.text.AttributedString;
import java.util.HashMap;
import java.util.Map;
+import javax.imageio.spi.IIORegistry;
/**
* An abstract superclass for Classpath toolkits.
@@ -89,7 +94,7 @@ public abstract class ClasspathToolkit
* #getImage(java.net.URL)}. For images that were loaded via a path
* to an image file, the map contains a key with a file URL.
*/
- private Map imageCache;
+ private HashMap imageCache;
/**
@@ -168,7 +173,6 @@ public abstract class ClasspathToolkit
* this font peer should have, such as size, weight, family name, or
* transformation.
*/
-
public abstract ClasspathFontPeer getClasspathFontPeer (String name, Map attrs);
public abstract ClasspathTextLayoutPeer
@@ -183,7 +187,6 @@ public abstract class ClasspathToolkit
* implement {@link java.awt.font.OpenType} or
* {@link java.awt.font.MultipleMaster}.
*/
-
public Font getFont (String name, Map attrs)
{
return new Font (name, attrs);
@@ -348,4 +351,19 @@ public abstract class ClasspathToolkit
{
return null;
}
+
+ public abstract RobotPeer createRobot (GraphicsDevice screen)
+ throws AWTException;
+
+ /**
+ * Used to register ImageIO SPIs provided by the toolkit.
+ */
+
+ public void registerImageIOSpis(IIORegistry reg)
+ {
+ }
+
+ public abstract boolean nativeQueueEmpty();
+ public abstract void wakeNativeQueue();
+ public abstract void iterateNativeQueue(EventQueue locked, boolean block);
}
diff --git a/libjava/gnu/java/awt/EmbeddedWindow.java b/libjava/gnu/java/awt/EmbeddedWindow.java
index 08bc02755ea..c3cfac48b19 100644
--- a/libjava/gnu/java/awt/EmbeddedWindow.java
+++ b/libjava/gnu/java/awt/EmbeddedWindow.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.java.awt;
-import gnu.classpath.Configuration;
import gnu.java.awt.peer.EmbeddedWindowPeer;
import gnu.java.security.action.SetAccessibleAction;
diff --git a/libjava/gnu/java/awt/color/ClutProfileConverter.java b/libjava/gnu/java/awt/color/ClutProfileConverter.java
index d33a6887eec..5b06f48eed8 100644
--- a/libjava/gnu/java/awt/color/ClutProfileConverter.java
+++ b/libjava/gnu/java/awt/color/ClutProfileConverter.java
@@ -38,7 +38,6 @@
package gnu.java.awt.color;
-import java.awt.color.ColorSpace;
import java.awt.color.ICC_Profile;
diff --git a/libjava/gnu/java/awt/image/ImageDecoder.java b/libjava/gnu/java/awt/image/ImageDecoder.java
index 233dfb1b28d..d279d567467 100644
--- a/libjava/gnu/java/awt/image/ImageDecoder.java
+++ b/libjava/gnu/java/awt/image/ImageDecoder.java
@@ -74,6 +74,11 @@ public abstract class ImageDecoder implements ImageProducer
this.url = url;
}
+ public ImageDecoder (InputStream is)
+ {
+ this.input = is;
+ }
+
public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength)
{
data = imagedata;
@@ -99,7 +104,7 @@ public abstract class ImageDecoder implements ImageProducer
public void startProduction (ImageConsumer ic)
{
if (!isConsumer(ic))
- addConsumer (ic);
+ addConsumer(ic);
Vector list = (Vector) consumers.clone ();
try
@@ -108,17 +113,30 @@ public abstract class ImageDecoder implements ImageProducer
// ImageDecoder constructors so that exceptions cause
// imageComplete to be called with an appropriate error
// status.
- if (url != null)
- input = url.openStream();
- else
- {
- if (filename != null)
- input = new FileInputStream (filename);
- else
- input = new ByteArrayInputStream (data, offset, length);
- }
-
- produce (list, input);
+ if (input == null)
+ {
+ try
+ {
+ if (url != null)
+ input = url.openStream();
+ else
+ {
+ if (filename != null)
+ input = new FileInputStream (filename);
+ else
+ input = new ByteArrayInputStream (data, offset, length);
+ }
+ produce (list, input);
+ }
+ finally
+ {
+ input = null;
+ }
+ }
+ else
+ {
+ produce (list, input);
+ }
}
catch (Exception e)
{
diff --git a/libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java b/libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java
index 143412caf99..07b4b3eb403 100644
--- a/libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java
+++ b/libjava/gnu/java/awt/peer/ClasspathTextLayoutPeer.java
@@ -38,19 +38,12 @@ exception statement from your version. */
package gnu.java.awt.peer;
-import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.font.TextHitInfo;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
-import java.text.CharacterIterator;
-import java.text.AttributedCharacterIterator;
-import java.text.AttributedString;
-import java.util.Map;
-import java.awt.font.TextAttribute;
-
/**
* @author Graydon Hoare
diff --git a/libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java b/libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
index a4cb35a4fff..753c7cd46f1 100644
--- a/libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
+++ b/libjava/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java
@@ -3,7 +3,7 @@
--portable-native-sync option.
This is used by gthread-jni.c
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,10 +40,11 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.awt.peer.gtk;
+
import java.lang.ref.WeakReference;
-import java.util.Set;
import java.util.Collections;
import java.util.HashSet;
+import java.util.Set;
/** Implements pthread_create(), under glib's gthread abstraction, for use
with GNU Classpath's --portable-native-sync option. This is used in
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
index 3cd2f9a1cd2..e871587a4a9 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
@@ -63,8 +63,6 @@ public class GdkFontMetrics extends FontMetrics
static final int TEXT_METRICS_X_ADVANCE = 4;
static final int TEXT_METRICS_Y_ADVANCE = 5;
- static native void getPeerFontMetrics(GdkFontPeer peer, double [] metrics);
- static native void getPeerTextMetrics(GdkFontPeer peer, String str, double [] metrics);
public GdkFontMetrics (Font font)
{
@@ -77,12 +75,7 @@ public class GdkFontMetrics extends FontMetrics
font_metrics = new int[5];
double [] hires = new double[5];
-
- if (GtkToolkit.useGraphics2D ())
- GdkGraphics2D.getPeerFontMetrics(peer, hires);
- else
- getPeerFontMetrics (peer, hires);
-
+ peer.getFontMetrics (hires);
for (int i = 0; i < 5; ++i)
font_metrics[i] = (int) hires[i];
}
@@ -90,10 +83,7 @@ public class GdkFontMetrics extends FontMetrics
public int stringWidth (String str)
{
double [] hires = new double[6];
- if (GtkToolkit.useGraphics2D())
- GdkGraphics2D.getPeerTextMetrics(peer, str, hires);
- else
- getPeerTextMetrics(peer, str, hires);
+ peer.getTextMetrics(str, hires);
return (int) hires [TEXT_METRICS_WIDTH];
}
@@ -115,7 +105,6 @@ public class GdkFontMetrics extends FontMetrics
public int getLeading ()
{
return 1;
-// return metrics[ASCENT] + metrics[DESCENT];
}
public int getAscent ()
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java
index ee051451026..d130c117560 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkFontPeer.java
@@ -1,5 +1,5 @@
/* GdkFontPeer.java -- Implements FontPeer with GTK+
- Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,24 +37,25 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.peer.FontPeer;
-import java.awt.*;
-import java.awt.geom.*;
-import java.awt.font.*;
+
+import gnu.classpath.Configuration;
+import gnu.java.awt.peer.ClasspathFontPeer;
+
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
+import java.awt.font.LineMetrics;
+import java.awt.geom.Rectangle2D;
+import java.text.CharacterIterator;
+import java.text.StringCharacterIterator;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
-import java.util.MissingResourceException;
-import java.text.CharacterIterator;
-import java.text.AttributedCharacterIterator;
-import java.text.StringCharacterIterator;
-import gnu.classpath.Configuration;
-import gnu.java.awt.peer.ClasspathFontPeer;
public class GdkFontPeer extends ClasspathFontPeer
{
-
- native static void initStaticState ();
+ static native void initStaticState();
private final int native_state = GtkGenericPeer.getUniqueInteger ();
private static ResourceBundle bundle;
@@ -81,6 +82,9 @@ public class GdkFontPeer extends ClasspathFontPeer
private native void dispose ();
private native void setFont (String family, int style, int size, boolean useGraphics2D);
+ native void getFontMetrics(double [] metrics);
+ native void getTextMetrics(String str, double [] metrics);
+
protected void finalize ()
{
if (GtkToolkit.useGraphics2D ())
@@ -158,26 +162,33 @@ public class GdkFontPeer extends ClasspathFontPeer
public boolean canDisplay (Font font, char c)
{
- throw new UnsupportedOperationException ();
+ // FIXME: inquire with pango
+ return true;
}
public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit)
{
- throw new UnsupportedOperationException ();
+ // FIXME: inquire with pango
+ return -1;
}
+
+ private native GdkGlyphVector getGlyphVector(String txt,
+ Font f,
+ FontRenderContext ctx);
public GlyphVector createGlyphVector (Font font,
FontRenderContext ctx,
CharacterIterator i)
{
- return new GdkGlyphVector(font, this, ctx, buildString (i));
+ return getGlyphVector(buildString (i), font, ctx);
}
public GlyphVector createGlyphVector (Font font,
FontRenderContext ctx,
int[] glyphCodes)
{
- return new GdkGlyphVector (font, this, ctx, glyphCodes);
+ return null;
+ // return new GdkGlyphVector (font, this, ctx, glyphCodes);
}
public byte getBaselineFor (Font font, char c)
@@ -259,7 +270,8 @@ public class GdkFontPeer extends ClasspathFontPeer
public Rectangle2D getStringBounds (Font font, CharacterIterator ci,
int begin, int limit, FontRenderContext frc)
{
- throw new UnsupportedOperationException ();
+ GdkGlyphVector gv = getGlyphVector(buildString (ci, begin, limit), font, frc);
+ return gv.getVisualBounds();
}
public boolean hasUniformLineMetrics (Font font)
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java b/libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java
index c37de5274ac..29d38b5e3f4 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGlyphVector.java
@@ -1,5 +1,5 @@
/* GdkGlyphVector.java -- Glyph vector object
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,15 +38,13 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import gnu.classpath.Configuration;
-
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphJustificationInfo;
import java.awt.font.GlyphMetrics;
import java.awt.font.GlyphVector;
-import java.awt.font.GlyphJustificationInfo;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
@@ -54,36 +52,57 @@ import java.awt.geom.Rectangle2D;
public class GdkGlyphVector extends GlyphVector
{
- static
+ /* We use a simple representation for glyph vectors here. Glyph i
+ * consumes 8 doubles:
+ *
+ * logical x: extents[ 10*i ]
+ * logical y: extents[ 10*i + 1 ]
+ * logical width: extents[ 10*i + 2 ]
+ * logical height: extents[ 10*i + 3 ]
+ *
+ * visual x: extents[ 10*i + 4 ]
+ * visual y: extents[ 10*i + 5 ]
+ * visual width: extents[ 10*i + 6 ]
+ * visual height: extents[ 10*i + 7 ]
+ *
+ * origin pos x: extents[ 10*i + 8 ]
+ * origin pos y: extents[ 10*i + 9 ]
+ *
+ * as well as one int, code[i], representing the glyph code in the font.
+ */
+
+ double [] extents;
+ int [] codes;
+
+ Font font;
+ FontRenderContext fontRenderContext;
+
+ Rectangle2D allLogical;
+ Rectangle2D allVisual;
+
+ public GdkGlyphVector(double[] extents, int[] codes, Font font, FontRenderContext frc)
{
- if (Configuration.INIT_LOAD_LIBRARY)
+ this.extents = extents;
+ this.codes = codes;
+ this.font = font;
+ this.fontRenderContext = frc;
+
+ allLogical = new Rectangle2D.Double();
+ allVisual = new Rectangle2D.Double();
+
+ for (int i = 0; i < codes.length; ++i)
{
- System.loadLibrary("gtkpeer");
+ allLogical.add (new Rectangle2D.Double(extents[10*i ] + extents[10*i + 8],
+ extents[10*i + 1] + extents[10*i + 9],
+ extents[10*i + 2],
+ extents[10*i + 3]));
+
+ allVisual.add (new Rectangle2D.Double(extents[10*i + 4] + extents[10*i + 8],
+ extents[10*i + 5] + extents[10*i + 9],
+ extents[10*i + 6],
+ extents[10*i + 7]));
}
-
- if (GtkToolkit.useGraphics2D ())
- initStaticState ();
}
- native static void initStaticState ();
- private final int native_state = GtkGenericPeer.getUniqueInteger ();
-
- private Font font;
- private FontRenderContext ctx;
-
- private native void initState (GdkFontPeer peer, FontRenderContext ctx);
- private native void setChars (String s);
- private native void setGlyphCodes (int codes[]);
- private native void dispose ();
- private native int glyphCode (int idx);
- private native int numGlyphs ();
- private native int glyphCharIndex (int idx);
- private native double[] allLogicalExtents ();
- private native double[] allInkExtents ();
- private native double[] glyphLogicalExtents (int idx);
- private native double[] glyphInkExtents (int idx);
- private native boolean glyphIsHorizontal (int idx);
- private native boolean isEqual (GdkGlyphVector ggv);
-
/*
geometric notes:
@@ -108,26 +127,14 @@ public class GdkGlyphVector extends GlyphVector
*/
-
- public GdkGlyphVector (Font f, GdkFontPeer peer, FontRenderContext c, String s)
- {
- font = f;
- ctx = c;
- initState (peer, ctx);
- setChars (s);
- }
-
- public GdkGlyphVector (Font f, GdkFontPeer peer, FontRenderContext c, int codes[])
+ public double[] getExtents()
{
- font = f;
- ctx = c;
- initState (peer, ctx);
- setGlyphCodes (codes);
+ return extents;
}
- protected void finalize ()
+ public int[] getCodes()
{
- dispose ();
+ return codes;
}
public Font getFont ()
@@ -137,12 +144,15 @@ public class GdkGlyphVector extends GlyphVector
public FontRenderContext getFontRenderContext ()
{
- return ctx;
+ return fontRenderContext;
}
public int getGlyphCharIndex (int glyphIndex)
{
- return glyphCharIndex (glyphIndex);
+ // FIXME: currently pango does not provide glyph-by-glyph
+ // reverse mapping information, so we assume a broken 1:1
+ // glyph model here. This is plainly wrong.
+ return glyphIndex;
}
public int[] getGlyphCharIndices (int beginGlyphIndex,
@@ -154,50 +164,44 @@ public class GdkGlyphVector extends GlyphVector
ix = new int[numEntries];
for (int i = 0; i < numEntries; i++)
- ix[i] = glyphCharIndex (beginGlyphIndex + i);
+ ix[i] = getGlyphCharIndex (beginGlyphIndex + i);
return ix;
}
public int getGlyphCode (int glyphIndex)
{
- return glyphCode (glyphIndex);
+ return codes[glyphIndex];
}
public int[] getGlyphCodes (int beginGlyphIndex, int numEntries,
int[] codeReturn)
{
- int ix[] = codeReturn;
- if (ix == null)
- ix = new int[numEntries];
+ if (codeReturn == null)
+ codeReturn = new int[numEntries];
- for (int i = 0; i < numEntries; i++)
- ix[i] = glyphCode (beginGlyphIndex + i);
- return ix;
+ System.arraycopy(codes, beginGlyphIndex, codeReturn, 0, numEntries);
+ return codeReturn;
}
- public Shape getGlyphLogicalBounds (int glyphIndex)
+ public Shape getGlyphLogicalBounds (int i)
{
- double extents[] = glyphLogicalExtents (glyphIndex);
- return new Rectangle2D.Double (extents[0], extents[1],
- extents[2], extents[3]);
+ return new Rectangle2D.Double (extents[8*i], extents[8*i + 1],
+ extents[8*i + 2], extents[8*i + 3]);
}
- public GlyphMetrics getGlyphMetrics (int glyphIndex)
+ public GlyphMetrics getGlyphMetrics (int i)
{
- double extents[] = glyphLogicalExtents (glyphIndex);
- Rectangle2D log_bounds = new Rectangle2D.Double (extents[0], extents[1],
- extents[2], extents[3]);
-
- extents = glyphInkExtents (glyphIndex);
- Rectangle2D ink_bounds = new Rectangle2D.Double (extents[0], extents[1],
- extents[2], extents[3]);
-
- boolean is_horizontal = glyphIsHorizontal (glyphIndex);
-
- return new GlyphMetrics (is_horizontal,
- (float)(log_bounds.getWidth() + log_bounds.getX()),
- (float)(log_bounds.getHeight() + log_bounds.getY()),
- ink_bounds, GlyphMetrics.STANDARD);
+ // FIXME: pango does not yield vertical layout information at the
+ // moment.
+
+ boolean is_horizontal = true;
+ double advanceX = extents[8*i + 2]; // "logical width" == advanceX
+ double advanceY = 0;
+
+ return new GlyphMetrics (is_horizontal,
+ (float) advanceX, (float) advanceY,
+ (Rectangle2D) getGlyphVisualBounds(i),
+ GlyphMetrics.STANDARD);
}
public Shape getGlyphOutline (int glyphIndex)
@@ -210,20 +214,18 @@ public class GdkGlyphVector extends GlyphVector
throw new UnsupportedOperationException ();
}
- public Rectangle getGlyphPixelBounds (int glyphIndex,
+ public Rectangle getGlyphPixelBounds (int i,
FontRenderContext renderFRC,
float x, float y)
{
- double extents[] = glyphInkExtents(glyphIndex);
- return new Rectangle ((int)x, (int)y, (int)extents[2], (int)extents[3]);
+ return new Rectangle((int) x, (int) y,
+ (int) extents[8*i + 6], (int) extents[8*i + 7]);
}
- public Point2D getGlyphPosition (int glyphIndex)
+ public Point2D getGlyphPosition (int i)
{
- float[] ret = new float[2 * (glyphIndex + 1)];
- getGlyphPositions (0, glyphIndex + 1, ret);
- return new Point2D.Float (ret[2 * glyphIndex],
- ret[2 * glyphIndex + 1]);
+ return new Point2D.Double (extents[10*i + 8],
+ extents[10*i + 9]);
}
public float[] getGlyphPositions (int beginGlyphIndex,
@@ -234,35 +236,25 @@ public class GdkGlyphVector extends GlyphVector
if (fx == null)
fx = new float[numEntries * 2];
-
- float x = 0.0f;
- float y = 0.0f;
for (int i = 0; i < numEntries; ++i)
{
- boolean is_horizontal = glyphIsHorizontal (beginGlyphIndex + i);
- double log_extents[] = glyphLogicalExtents (beginGlyphIndex + i);
- fx[2*i] = x + (float)log_extents[0]; // x offset
- fx[2*i + 1] = y + (float)log_extents[1]; // y offset
- if (is_horizontal)
- x += (float)log_extents[2]; // x advance ("logical width") in pango-ese
- else
- y += (float)log_extents[3]; // y advance ("logical height") in pango-ese
+ fx[2*i ] = (float) extents[10*i + 8];
+ fx[2*i + 1] = (float) extents[10*i + 9];
}
return fx;
}
public AffineTransform getGlyphTransform (int glyphIndex)
{
- // glyphs don't have independent transforms in these simple glyph
+ // Glyphs don't have independent transforms in these simple glyph
// vectors; docs specify null is an ok return here.
return null;
}
- public Shape getGlyphVisualBounds (int glyphIndex)
+ public Shape getGlyphVisualBounds (int i)
{
- double extents[] = glyphInkExtents (glyphIndex);
- return new Rectangle2D.Double (extents[0], extents[1],
- extents[2], extents[3]);
+ return new Rectangle2D.Double(extents[8*i + 4], extents[8*i + 5],
+ extents[8*i + 6], extents[8*i + 7]);
}
public int getLayoutFlags ()
@@ -272,14 +264,12 @@ public class GdkGlyphVector extends GlyphVector
public Rectangle2D getLogicalBounds ()
{
- double extents[] = allLogicalExtents ();
- return new Rectangle2D.Double (extents[0], extents[1],
- extents[2], extents[3]);
+ return allLogical;
}
public int getNumGlyphs ()
{
- return numGlyphs ();
+ return codes.length;
}
public Shape getOutline ()
@@ -290,26 +280,28 @@ public class GdkGlyphVector extends GlyphVector
public Rectangle getPixelBounds (FontRenderContext renderFRC,
float x, float y)
{
- double extents[] = allInkExtents();
- return new Rectangle ((int)x, (int)y,
- (int)extents[2], (int)extents[3]);
+ return new Rectangle((int)x,
+ (int)y,
+ (int) allVisual.getWidth(),
+ (int) allVisual.getHeight());
}
public Rectangle2D getVisualBounds ()
{
- double extents[] = allInkExtents();
- return new Rectangle2D.Double (extents[0], extents[1],
- extents[2], extents[3]);
+ return allVisual;
}
public void performDefaultLayout ()
{
}
- public void setGlyphPosition (int glyphIndex, Point2D newPos)
+ public void setGlyphPosition (int i, Point2D newPos)
{
- // should we be ok twiddling pango's structure here?
- throw new UnsupportedOperationException ();
+ extents[8*i ] = newPos.getX();
+ extents[8*i + 1] = newPos.getY();
+
+ extents[8*i + 4] = newPos.getX();
+ extents[8*i + 5] = newPos.getY();
}
public void setGlyphTransform (int glyphIndex,
@@ -327,8 +319,31 @@ public class GdkGlyphVector extends GlyphVector
if (! (gv instanceof GdkGlyphVector))
return false;
- GdkGlyphVector ggv = (GdkGlyphVector)gv;
- return isEqual(ggv);
+ GdkGlyphVector ggv = (GdkGlyphVector) gv;
+
+ if ((ggv.codes.length != this.codes.length)
+ || (ggv.extents.length != this.extents.length))
+ return false;
+
+ if ((ggv.font == null && this.font != null)
+ || (ggv.font != null && this.font == null)
+ || (!ggv.font.equals(this.font)))
+ return false;
+
+ if ((ggv.fontRenderContext == null && this.fontRenderContext != null)
+ || (ggv.fontRenderContext != null && this.fontRenderContext == null)
+ || (!ggv.fontRenderContext.equals(this.fontRenderContext)))
+ return false;
+
+ for (int i = 0; i < ggv.codes.length; ++i)
+ if (ggv.codes[i] != this.codes[i])
+ return false;
+
+ for (int i = 0; i < ggv.extents.length; ++i)
+ if (ggv.extents[i] != this.extents[i])
+ return false;
+
+ return true;
}
public GlyphJustificationInfo getGlyphJustificationInfo(int idx)
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
index 5aacf5296c6..7361b291c94 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java
@@ -1,5 +1,5 @@
/* GdkGraphics.java
- Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -108,7 +108,7 @@ public class GdkGraphics extends Graphics
native void connectSignals (GtkComponentPeer component);
- public native void clearRect (int x, int y, int width, int height);
+ public native void clearRect(int x, int y, int width, int height);
public void clipRect (int x, int y, int width, int height)
{
@@ -119,15 +119,15 @@ public class GdkGraphics extends Graphics
setClipRectangle (clip.x, clip.y, clip.width, clip.height);
}
- native public void copyArea (int x, int y, int width, int height,
- int dx, int dy);
+ public native void copyArea(int x, int y, int width, int height,
+ int dx, int dy);
public Graphics create ()
{
return new GdkGraphics (this);
}
- native public void dispose ();
+ public native void dispose();
native void copyPixmap (Graphics g, int x, int y, int width, int height);
native void copyAndScalePixmap (Graphics g, boolean flip_x, boolean flip_y,
@@ -316,22 +316,22 @@ public class GdkGraphics extends Graphics
SystemColor.window, observer);
}
- native public void drawLine (int x1, int y1, int x2, int y2);
+ public native void drawLine(int x1, int y1, int x2, int y2);
- native public void drawArc (int x, int y, int width, int height,
- int startAngle, int arcAngle);
- native public void fillArc (int x, int y, int width, int height,
- int startAngle, int arcAngle);
- native public void drawOval(int x, int y, int width, int height);
- native public void fillOval(int x, int y, int width, int height);
+ public native void drawArc(int x, int y, int width, int height,
+ int startAngle, int arcAngle);
+ public native void fillArc(int x, int y, int width, int height,
+ int startAngle, int arcAngle);
+ public native void drawOval(int x, int y, int width, int height);
+ public native void fillOval(int x, int y, int width, int height);
- native public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
- native public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints);
+ public native void drawPolygon(int[] xPoints, int[] yPoints, int nPoints);
+ public native void fillPolygon(int[] xPoints, int[] yPoints, int nPoints);
- native public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints);
+ public native void drawPolyline(int[] xPoints, int[] yPoints, int nPoints);
- native public void drawRect(int x, int y, int width, int height);
- native public void fillRect (int x, int y, int width, int height);
+ public native void drawRect(int x, int y, int width, int height);
+ public native void fillRect(int x, int y, int width, int height);
GdkFontPeer getFontPeer()
{
@@ -426,7 +426,8 @@ public class GdkGraphics extends Graphics
public void setClip (int x, int y, int width, int height)
{
- if (component != null && ! component.isRealized ())
+ if ((component != null && ! component.isRealized ())
+ || clip == null)
return;
clip.x = x;
@@ -447,7 +448,7 @@ public class GdkGraphics extends Graphics
setClip (clip.getBounds ());
}
- native private void setFGColor (int red, int green, int blue);
+ private native void setFGColor(int red, int green, int blue);
public void setColor (Color c)
{
@@ -489,7 +490,7 @@ public class GdkGraphics extends Graphics
color.getBlue () ^ xorColor.getBlue ());
}
- native public void translateNative (int x, int y);
+ public native void translateNative(int x, int y);
public void translate (int x, int y)
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
index 82de03d5aec..513c75c094a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
@@ -1,5 +1,5 @@
-/* GdkGraphics2D.java
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* GdkGraphics2D.java --
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,6 @@ package gnu.java.awt.peer.gtk;
import gnu.classpath.Configuration;
import gnu.java.awt.ClasspathToolkit;
-import gnu.java.awt.peer.ClasspathFontPeer;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
@@ -60,17 +59,15 @@ import java.awt.Shape;
import java.awt.Stroke;
import java.awt.TexturePaint;
import java.awt.Toolkit;
-import java.awt.color.ColorSpace;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
-import java.awt.font.GlyphJustificationInfo;
+import java.awt.geom.AffineTransform;
import java.awt.geom.Arc2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
-import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;
@@ -78,16 +75,17 @@ import java.awt.image.ColorModel;
import java.awt.image.CropImageFilter;
import java.awt.image.DataBuffer;
import java.awt.image.DataBufferInt;
+import java.awt.image.DirectColorModel;
import java.awt.image.FilteredImageSource;
-import java.awt.image.ImageConsumer;
import java.awt.image.ImageObserver;
import java.awt.image.ImagingOpException;
-import java.awt.image.SampleModel;
+import java.awt.image.MultiPixelPackedSampleModel;
import java.awt.image.Raster;
import java.awt.image.RenderedImage;
+import java.awt.image.SampleModel;
import java.awt.image.WritableRaster;
-import java.awt.image.renderable.RenderableImage;
import java.awt.image.renderable.RenderContext;
+import java.awt.image.renderable.RenderableImage;
import java.text.AttributedCharacterIterator;
import java.util.HashMap;
import java.util.Map;
@@ -95,7 +93,6 @@ import java.util.Stack;
public class GdkGraphics2D extends Graphics2D
{
-
//////////////////////////////////////
////// State Management Methods //////
//////////////////////////////////////
@@ -103,14 +100,14 @@ public class GdkGraphics2D extends Graphics2D
static
{
if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("gtkpeer");
- }
+ System.loadLibrary("gtkpeer");
- if (GtkToolkit.useGraphics2D ())
- initStaticState ();
+ if (GtkToolkit.useGraphics2D())
+ initStaticState();
}
- native static void initStaticState ();
+
+ static native void initStaticState();
+
private final int native_state = GtkGenericPeer.getUniqueInteger();
private Paint paint;
@@ -120,247 +117,256 @@ public class GdkGraphics2D extends Graphics2D
private Shape clip;
private AffineTransform transform;
private GtkComponentPeer component;
- private Font font;
+ private Font font;
private RenderingHints hints;
private BufferedImage bimage;
-
+ private boolean pixelConversionRequired;
+ private int[] pixelBuffer;
private Composite comp;
-
private Stack stateStack;
-
- native private void initState (GtkComponentPeer component);
- native private void initState (int width, int height);
- native private void copyState (GdkGraphics2D g);
- native public void dispose ();
- native private int[] getImagePixels();
- native private void cairoSurfaceSetFilter(int filter);
- native void connectSignals (GtkComponentPeer component);
- public void finalize ()
+ private native void initState(GtkComponentPeer component);
+ private native void initState(int width, int height);
+ private native void initState(int[] pixes, int width, int height);
+ private native void copyState(GdkGraphics2D g);
+ public native void dispose();
+ private native void cairoSurfaceSetFilter(int filter);
+ native void connectSignals(GtkComponentPeer component);
+
+ public void finalize()
{
dispose();
}
- public Graphics create ()
+ public Graphics create()
{
- return new GdkGraphics2D (this);
+ return new GdkGraphics2D(this);
}
- public Graphics create (int x, int y, int width, int height)
+ public Graphics create(int x, int y, int width, int height)
{
- return new GdkGraphics2D (width, height);
+ return new GdkGraphics2D(width, height);
}
- GdkGraphics2D (GdkGraphics2D g)
+ GdkGraphics2D(GdkGraphics2D g)
{
paint = g.paint;
stroke = g.stroke;
- setRenderingHints (g.hints);
+ setRenderingHints(g.hints);
if (g.fg.getAlpha() != -1)
- fg = new Color (g.fg.getRed (), g.fg.getGreen (),
- g.fg.getBlue (), g.fg.getAlpha ());
- else
- fg = new Color (g.fg.getRGB ());
+ fg = new Color(g.fg.getRed(), g.fg.getGreen(), g.fg.getBlue(),
+ g.fg.getAlpha());
+ else
+ fg = new Color(g.fg.getRGB());
if (g.bg.getAlpha() != -1)
- bg = new Color(g.bg.getRed (), g.bg.getGreen (),
- g.bg.getBlue (), g.bg.getAlpha ());
+ bg = new Color(g.bg.getRed(), g.bg.getGreen(), g.bg.getBlue(),
+ g.bg.getAlpha());
else
- bg = new Color (g.bg.getRGB ());
+ bg = new Color(g.bg.getRGB());
if (g.clip == null)
clip = null;
else
- clip = new Rectangle (g.getClipBounds ());
+ clip = new Rectangle(g.getClipBounds());
if (g.transform == null)
- transform = new AffineTransform ();
+ transform = new AffineTransform();
else
- transform = new AffineTransform (g.transform);
+ transform = new AffineTransform(g.transform);
font = g.font;
component = g.component;
- copyState (g);
-
- setColor (fg);
- setBackground (bg);
- setPaint (paint);
- setStroke (stroke);
- setTransform (transform);
- setClip (clip);
+ copyState(g);
+
+ setColor(fg);
+ setBackground(bg);
+ setPaint(paint);
+ setStroke(stroke);
+ setTransform(transform);
+ setClip(clip);
stateStack = new Stack();
}
- GdkGraphics2D (int width, int height)
+ GdkGraphics2D(int width, int height)
{
- initState (width, height);
+ initState(width, height);
setColor(Color.black);
- setBackground (Color.black);
- setPaint (getColor());
- setFont (new Font("SansSerif", Font.PLAIN, 12));
- setTransform (new AffineTransform ());
- setStroke (new BasicStroke ());
- setRenderingHints (getDefaultHints());
+ setBackground(Color.black);
+ setPaint(getColor());
+ setFont(new Font("SansSerif", Font.PLAIN, 12));
+ setTransform(new AffineTransform());
+ setStroke(new BasicStroke());
+ setRenderingHints(getDefaultHints());
stateStack = new Stack();
}
- GdkGraphics2D (GtkComponentPeer component)
+ GdkGraphics2D(GtkComponentPeer component)
{
this.component = component;
-
- setFont (new Font("SansSerif", Font.PLAIN, 12));
-
- if (component.isRealized ())
- initComponentGraphics2D ();
+
+ if (component.isRealized())
+ initComponentGraphics2D();
else
- connectSignals (component);
+ connectSignals(component);
}
- void initComponentGraphics2D ()
+ void initComponentGraphics2D()
{
- initState (component);
+ initState(component);
- setColor (component.awtComponent.getForeground ());
- setBackground (component.awtComponent.getBackground ());
- setPaint (getColor());
- setTransform (new AffineTransform ());
- setStroke (new BasicStroke ());
- setRenderingHints (getDefaultHints());
+ setColor(component.awtComponent.getForeground());
+ setBackground(component.awtComponent.getBackground());
+ setPaint(getColor());
+ setTransform(new AffineTransform());
+ setStroke(new BasicStroke());
+ setRenderingHints(getDefaultHints());
+ setFont(new Font("SansSerif", Font.PLAIN, 12));
- stateStack = new Stack ();
+ stateStack = new Stack();
}
- GdkGraphics2D (BufferedImage bimage)
+ GdkGraphics2D(BufferedImage bimage)
{
-
- this.bimage = bimage;
- initState (bimage.getWidth(), bimage.getHeight());
+ this.bimage = bimage;
+ this.pixelBuffer = findSimpleIntegerArray(bimage.getColorModel(),
+ bimage.getRaster());
+ if (this.pixelBuffer == null)
+ {
+ this.pixelBuffer = new int[bimage.getRaster().getWidth() * bimage.getRaster()
+ .getHeight()];
+ this.pixelConversionRequired = true;
+ }
+ else
+ {
+ this.pixelConversionRequired = false;
+ }
+
+ initState(this.pixelBuffer, bimage.getWidth(), bimage.getHeight());
setColor(Color.black);
- setBackground (Color.black);
- setPaint (getColor());
- setFont (new Font("SansSerif", Font.PLAIN, 12));
- setTransform (new AffineTransform ());
- setStroke (new BasicStroke ());
- setRenderingHints (getDefaultHints());
+ setBackground(Color.black);
+ setPaint(getColor());
+ setFont(new Font("SansSerif", Font.PLAIN, 12));
+ setTransform(new AffineTransform());
+ setStroke(new BasicStroke());
+ setRenderingHints(getDefaultHints());
stateStack = new Stack();
-
+
// draw current buffered image to the pixmap associated
- // with it.
-
- drawImage (bimage, new AffineTransform (1,0,0,1,0,0), bg, null);
+ // with it, if the image is not equal to our paint buffer.
+ if (pixelConversionRequired)
+ drawImage(bimage, new AffineTransform(1, 0, 0, 1, 0, 0), bg, null);
}
-
////////////////////////////////////
////// Native Drawing Methods //////
////////////////////////////////////
// GDK drawing methods
- private native void gdkDrawDrawable (GdkGraphics2D other, int x, int y);
+ private native void gdkDrawDrawable(GdkGraphics2D other, int x, int y);
// drawing utility methods
- private native void drawPixels (int pixels[], int w, int h, int stride, double i2u[]);
- private native void setTexturePixels (int pixels[], int w, int h, int stride);
- private native void setGradient (double x1, double y1,
- double x2, double y2,
- int r1, int g1, int b1, int a1,
- int r2, int g2, int b2, int a2,
- boolean cyclic);
+ private native void drawPixels(int[] pixels, int w, int h, int stride,
+ double[] i2u);
+ private native void setTexturePixels(int[] pixels, int w, int h, int stride);
+ private native void setGradient(double x1, double y1, double x2, double y2,
+ int r1, int g1, int b1, int a1, int r2,
+ int g2, int b2, int a2, boolean cyclic);
// simple passthroughs to cairo
- private native void cairoSave ();
- private native void cairoRestore ();
- private native void cairoSetMatrix (double m[]);
- private native void cairoSetOperator (int cairoOperator);
- private native void cairoSetRGBColor (double red, double green, double blue);
- private native void cairoSetAlpha (double alpha);
- private native void cairoSetFillRule (int cairoFillRule);
- private native void cairoSetLineWidth (double width);
- private native void cairoSetLineCap (int cairoLineCap);
- private native void cairoSetLineJoin (int cairoLineJoin);
- private native void cairoSetDash (double dashes[], int ndash, double offset);
- private native void cairoSetMiterLimit (double limit);
- private native void cairoNewPath ();
- private native void cairoMoveTo (double x, double y);
- private native void cairoLineTo (double x, double y);
- private native void cairoCurveTo (double x1, double y1,
- double x2, double y2,
- double x3, double y3);
- private native void cairoRelMoveTo (double dx, double dy);
- private native void cairoRelLineTo (double dx, double dy);
- private native void cairoRelCurveTo (double dx1, double dy1,
- double dx2, double dy2,
- double dx3, double dy3);
- private native void cairoRectangle (double x, double y,
- double width, double height);
- private native void cairoClosePath ();
- private native void cairoStroke ();
- private native void cairoFill ();
- private native void cairoClip ();
-
+ private native void cairoSave();
+ private native void cairoRestore();
+ private native void cairoSetMatrix(double[] m);
+ private native void cairoSetOperator(int cairoOperator);
+ private native void cairoSetRGBColor(double red, double green, double blue);
+ private native void cairoSetAlpha(double alpha);
+ private native void cairoSetFillRule(int cairoFillRule);
+ private native void cairoSetLineWidth(double width);
+ private native void cairoSetLineCap(int cairoLineCap);
+ private native void cairoSetLineJoin(int cairoLineJoin);
+ private native void cairoSetDash(double[] dashes, int ndash, double offset);
+
+ private native void cairoSetMiterLimit(double limit);
+ private native void cairoNewPath();
+ private native void cairoMoveTo(double x, double y);
+ private native void cairoLineTo(double x, double y);
+ private native void cairoCurveTo(double x1, double y1, double x2, double y2,
+ double x3, double y3);
+ private native void cairoRelMoveTo(double dx, double dy);
+ private native void cairoRelLineTo(double dx, double dy);
+ private native void cairoRelCurveTo(double dx1, double dy1, double dx2,
+ double dy2, double dx3, double dy3);
+ private native void cairoRectangle(double x, double y, double width,
+ double height);
+ private native void cairoClosePath();
+ private native void cairoStroke();
+ private native void cairoFill();
+ private native void cairoClip();
/////////////////////////////////////////////
////// General Drawing Support Methods //////
/////////////////////////////////////////////
- private class DrawState
- {
- private Paint paint;
- private Stroke stroke;
- private Color fg;
- private Color bg;
- private Shape clip;
- private AffineTransform transform;
- private Font font;
- private Composite comp;
- DrawState (GdkGraphics2D g)
- {
- this.paint = g.paint;
- this.stroke = g.stroke;
- this.fg = g.fg;
- this.bg = g.bg;
- this.clip = g.clip;
- if (g.transform != null)
- this.transform = (AffineTransform) g.transform.clone();
- this.font = g.font;
- this.comp = g.comp;
- }
- public void restore(GdkGraphics2D g)
- {
- g.paint = this.paint;
- g.stroke = this.stroke;
- g.fg = this.fg;
- g.bg = this.bg;
- g.clip = this.clip;
- g.transform = this.transform;
- g.font = this.font;
- g.comp = this.comp;
- }
- }
-
- private void stateSave ()
+ private class DrawState
+ {
+ private Paint paint;
+ private Stroke stroke;
+ private Color fg;
+ private Color bg;
+ private Shape clip;
+ private AffineTransform transform;
+ private Font font;
+ private Composite comp;
+
+ DrawState(GdkGraphics2D g)
{
- stateStack.push (new DrawState (this));
- cairoSave ();
+ this.paint = g.paint;
+ this.stroke = g.stroke;
+ this.fg = g.fg;
+ this.bg = g.bg;
+ this.clip = g.clip;
+ if (g.transform != null)
+ this.transform = (AffineTransform) g.transform.clone();
+ this.font = g.font;
+ this.comp = g.comp;
}
- private void stateRestore ()
+ public void restore(GdkGraphics2D g)
{
- ((DrawState)(stateStack.pop ())).restore (this);
- cairoRestore ();
+ g.paint = this.paint;
+ g.stroke = this.stroke;
+ g.fg = this.fg;
+ g.bg = this.bg;
+ g.clip = this.clip;
+ g.transform = this.transform;
+ g.font = this.font;
+ g.comp = this.comp;
}
+ }
+
+ private void stateSave()
+ {
+ stateStack.push(new DrawState(this));
+ cairoSave();
+ }
+
+ private void stateRestore()
+ {
+ ((DrawState) (stateStack.pop())).restore(this);
+ cairoRestore();
+ }
// Some operations (drawing rather than filling) require that their
// coords be shifted to land on 0.5-pixel boundaries, in order to land on
// "middle of pixel" coordinates and light up complete pixels.
-
private boolean shiftDrawCalls = false;
- private final double shifted(double coord, boolean doShift)
+
+ private double shifted(double coord, boolean doShift)
{
if (doShift)
return Math.floor(coord) + 0.5;
@@ -368,410 +374,381 @@ public class GdkGraphics2D extends Graphics2D
return coord;
}
- private final void walkPath(PathIterator p, boolean doShift)
+ private void walkPath(PathIterator p, boolean doShift)
{
double x = 0;
double y = 0;
- double coords[] = new double[6];
+ double[] coords = new double[6];
- cairoSetFillRule (p.getWindingRule ());
- for ( ; ! p.isDone (); p.next())
+ cairoSetFillRule(p.getWindingRule());
+ for (; ! p.isDone(); p.next())
{
- int seg = p.currentSegment (coords);
- switch(seg)
- {
-
- case PathIterator.SEG_MOVETO:
- x = shifted(coords[0], doShift);
- y = shifted(coords[1], doShift);
- cairoMoveTo (x, y);
- break;
-
- case PathIterator.SEG_LINETO:
- x = shifted(coords[0], doShift);
- y = shifted(coords[1], doShift);
- cairoLineTo (x, y);
- break;
-
- case PathIterator.SEG_QUADTO:
-
- // splitting a quadratic bezier into a cubic:
- // see: http://pfaedit.sourceforge.net/bezier.html
-
- double x1 = x + (2.0/3.0) * (shifted(coords[0], doShift) - x);
- double y1 = y + (2.0/3.0) * (shifted(coords[1], doShift) - y);
-
- double x2 = x1 + (1.0/3.0) * (shifted(coords[2], doShift) - x);
- double y2 = y1 + (1.0/3.0) * (shifted(coords[3], doShift) - y);
-
- x = shifted(coords[2], doShift);
- y = shifted(coords[3], doShift);
- cairoCurveTo (x1, y1,
- x2, y2,
- x, y);
- break;
-
- case PathIterator.SEG_CUBICTO:
- x = shifted(coords[4], doShift);
- y = shifted(coords[5], doShift);
- cairoCurveTo (shifted(coords[0], doShift), shifted(coords[1], doShift),
- shifted(coords[2], doShift), shifted(coords[3], doShift),
- x, y);
- break;
-
- case PathIterator.SEG_CLOSE:
- cairoClosePath ();
- break;
- }
- }
- }
-
-
- private final Map getDefaultHints()
- {
- HashMap defaultHints = new HashMap ();
-
- defaultHints.put (RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
-
- defaultHints.put (RenderingHints.KEY_STROKE_CONTROL,
- RenderingHints.VALUE_STROKE_DEFAULT);
-
- defaultHints.put (RenderingHints.KEY_FRACTIONALMETRICS,
- RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
-
- defaultHints.put (RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_OFF);
-
- defaultHints.put (RenderingHints.KEY_RENDERING,
- RenderingHints.VALUE_RENDER_DEFAULT);
-
- return defaultHints;
-
+ int seg = p.currentSegment(coords);
+ switch (seg)
+ {
+ case PathIterator.SEG_MOVETO:
+ x = shifted(coords[0], doShift);
+ y = shifted(coords[1], doShift);
+ cairoMoveTo(x, y);
+ break;
+ case PathIterator.SEG_LINETO:
+ x = shifted(coords[0], doShift);
+ y = shifted(coords[1], doShift);
+ cairoLineTo(x, y);
+ break;
+ case PathIterator.SEG_QUADTO:
+ // splitting a quadratic bezier into a cubic:
+ // see: http://pfaedit.sourceforge.net/bezier.html
+ double x1 = x + (2.0 / 3.0) * (shifted(coords[0], doShift) - x);
+ double y1 = y + (2.0 / 3.0) * (shifted(coords[1], doShift) - y);
+
+ double x2 = x1 + (1.0 / 3.0) * (shifted(coords[2], doShift) - x);
+ double y2 = y1 + (1.0 / 3.0) * (shifted(coords[3], doShift) - y);
+
+ x = shifted(coords[2], doShift);
+ y = shifted(coords[3], doShift);
+ cairoCurveTo(x1, y1, x2, y2, x, y);
+ break;
+ case PathIterator.SEG_CUBICTO:
+ x = shifted(coords[4], doShift);
+ y = shifted(coords[5], doShift);
+ cairoCurveTo(shifted(coords[0], doShift),
+ shifted(coords[1], doShift),
+ shifted(coords[2], doShift),
+ shifted(coords[3], doShift), x, y);
+ break;
+ case PathIterator.SEG_CLOSE:
+ cairoClosePath();
+ break;
+ }
+ }
}
- private final void updateBufferedImage()
+ private Map getDefaultHints()
{
- int[] pixels = getImagePixels();
- updateImagePixels(pixels);
- }
+ HashMap defaultHints = new HashMap();
-
- private final boolean isBufferedImageGraphics ()
- {
- return bimage != null;
+ defaultHints.put(RenderingHints.KEY_TEXT_ANTIALIASING,
+ RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
+
+ defaultHints.put(RenderingHints.KEY_STROKE_CONTROL,
+ RenderingHints.VALUE_STROKE_DEFAULT);
+
+ defaultHints.put(RenderingHints.KEY_FRACTIONALMETRICS,
+ RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
+
+ defaultHints.put(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_OFF);
+
+ defaultHints.put(RenderingHints.KEY_RENDERING,
+ RenderingHints.VALUE_RENDER_DEFAULT);
+
+ return defaultHints;
}
-
- private final void updateImagePixels (int[] pixels)
+
+ public static int[] findSimpleIntegerArray (ColorModel cm, Raster raster)
{
+ if (cm == null || raster == null)
+ return null;
- // This function can only be used if
- // this graphics object is used to draw into
- // buffered image
-
- if (! isBufferedImageGraphics ())
- return;
+ if (! cm.getColorSpace().isCS_sRGB())
+ return null;
- WritableRaster raster = bimage.getRaster();
- DataBuffer db = raster.getDataBuffer ();
+ if (! (cm instanceof DirectColorModel))
+ return null;
- // update pixels in the bufferedImage
+ DirectColorModel dcm = (DirectColorModel) cm;
- if (raster.getSampleModel ().getDataType () == DataBuffer.TYPE_INT
- && db instanceof DataBufferInt
- && db.getNumBanks () == 1)
- {
+ if (dcm.getRedMask() != 0x00FF0000 || dcm.getGreenMask() != 0x0000FF00
+ || dcm.getBlueMask() != 0x000000FF)
+ return null;
- // single bank, ARGB-ints buffer in sRGB space
- DataBufferInt dbi = (DataBufferInt) raster.getDataBuffer ();
+ if (! (raster instanceof WritableRaster))
+ return null;
- for (int i=0; i < pixels.length; i++)
- dbi.setElem(i, pixels[i]);
-
- }
- else
- {
- bimage.getRaster().setPixels (0, 0, raster.getWidth (),
- raster.getHeight (), pixels);
- }
- }
+ if (raster.getSampleModel().getDataType() != DataBuffer.TYPE_INT)
+ return null;
+
+ if (! (raster.getDataBuffer() instanceof DataBufferInt))
+ return null;
+ DataBufferInt db = (DataBufferInt) raster.getDataBuffer();
- private final boolean drawImage(Image img,
- AffineTransform xform,
- Color bgcolor,
- ImageObserver obs)
+ if (db.getNumBanks() != 1)
+ return null;
+
+ // Finally, we have determined that this is a single bank, [A]RGB-int
+ // buffer in sRGB space. It's worth checking all this, because it means
+ // that cairo can paint directly into the data buffer, which is very
+ // fast compared to all the normal copying and converting.
+
+ return db.getData();
+ }
+
+ private void updateBufferedImage()
{
+ if (bimage != null && pixelConversionRequired)
+ {
+ int height = bimage.getHeight();
+ int width = bimage.getWidth();
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ bimage.setRGB(x, y, pixelBuffer[y*width+height]);
+ }
+ }
+ private boolean drawImage(Image img, AffineTransform xform,
+ Color bgcolor, ImageObserver obs)
+ {
if (img == null)
return false;
- if (img instanceof GtkOffScreenImage &&
- img.getGraphics () instanceof GdkGraphics2D &&
- (xform == null
- || xform.getType () == AffineTransform.TYPE_IDENTITY
- || xform.getType () == AffineTransform.TYPE_TRANSLATION)
- )
+ if (img instanceof GtkOffScreenImage
+ && img.getGraphics() instanceof GdkGraphics2D
+ && (xform == null || xform.getType() == AffineTransform.TYPE_IDENTITY
+ || xform.getType() == AffineTransform.TYPE_TRANSLATION))
{
- // we are being asked to flush a double buffer from Gdk
- GdkGraphics2D g2 = (GdkGraphics2D) img.getGraphics ();
- gdkDrawDrawable (g2, (int)xform.getTranslateX(), (int)xform.getTranslateY());
-
- if (isBufferedImageGraphics ())
- updateBufferedImage();
-
- return true;
+ // we are being asked to flush a double buffer from Gdk
+ GdkGraphics2D g2 = (GdkGraphics2D) img.getGraphics();
+ gdkDrawDrawable(g2, (int) xform.getTranslateX(),
+ (int) xform.getTranslateY());
+
+ updateBufferedImage();
+
+ return true;
}
else
- {
-
- // In this case, xform is an AffineTransform that transforms bounding
- // box of the specified image from image space to user space. However
- // when we pass this transform to cairo, cairo will use this transform
- // to map "user coordinates" to "pixel" coordinates, which is the
- // other way around. Therefore to get the "user -> pixel" transform
- // that cairo wants from "image -> user" transform that we currently
- // have, we will need to invert the transformation matrix.
-
- AffineTransform invertedXform = new AffineTransform();
-
- try
- {
- invertedXform = xform.createInverse();
- if (img instanceof BufferedImage)
- {
- // draw an image which has actually been loaded
- // into memory fully
-
- BufferedImage b = (BufferedImage) img;
- return drawRaster (b.getColorModel (),
- b.getData (),
- invertedXform,
- bgcolor);
- }
- else
- {
- return this.drawImage(GdkPixbufDecoder.createBufferedImage(img.getSource()),
- xform, bgcolor,obs);
- }
- }
- catch (NoninvertibleTransformException e)
- {
- throw new ImagingOpException("Unable to invert transform "
- + xform.toString());
- }
+ {
+ // In this case, xform is an AffineTransform that transforms bounding
+ // box of the specified image from image space to user space. However
+ // when we pass this transform to cairo, cairo will use this transform
+ // to map "user coordinates" to "pixel" coordinates, which is the
+ // other way around. Therefore to get the "user -> pixel" transform
+ // that cairo wants from "image -> user" transform that we currently
+ // have, we will need to invert the transformation matrix.
+ AffineTransform invertedXform = new AffineTransform();
+
+ try
+ {
+ invertedXform = xform.createInverse();
+ if (img instanceof BufferedImage)
+ {
+ // draw an image which has actually been loaded
+ // into memory fully
+ BufferedImage b = (BufferedImage) img;
+ return drawRaster(b.getColorModel(), b.getData(),
+ invertedXform, bgcolor);
+ }
+ else
+ return this.drawImage(GdkPixbufDecoder.createBufferedImage(img
+ .getSource()),
+ xform, bgcolor, obs);
+ }
+ catch (NoninvertibleTransformException e)
+ {
+ throw new ImagingOpException("Unable to invert transform "
+ + xform.toString());
+ }
}
}
-
//////////////////////////////////////////////////
////// Implementation of Graphics2D Methods //////
//////////////////////////////////////////////////
- public void draw (Shape s)
+ public void draw(Shape s)
{
-
- if (stroke != null &&
- !(stroke instanceof BasicStroke))
+ if (stroke != null && ! (stroke instanceof BasicStroke))
{
- fill (stroke.createStrokedShape (s));
- return;
+ fill(stroke.createStrokedShape(s));
+ return;
}
- cairoNewPath ();
-
+ cairoNewPath();
+
if (s instanceof Rectangle2D)
{
- Rectangle2D r = (Rectangle2D)s;
- cairoRectangle (shifted(r.getX (), shiftDrawCalls),
- shifted(r.getY (), shiftDrawCalls),
- r.getWidth (), r.getHeight ());
+ Rectangle2D r = (Rectangle2D) s;
+ cairoRectangle(shifted(r.getX(), shiftDrawCalls),
+ shifted(r.getY(), shiftDrawCalls), r.getWidth(),
+ r.getHeight());
}
- else
- walkPath (s.getPathIterator (null), shiftDrawCalls);
- cairoStroke ();
-
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ else
+ walkPath(s.getPathIterator(null), shiftDrawCalls);
+ cairoStroke();
+
+ updateBufferedImage();
}
- public void fill (Shape s)
+ public void fill(Shape s)
{
- cairoNewPath ();
+ cairoNewPath();
if (s instanceof Rectangle2D)
{
- Rectangle2D r = (Rectangle2D)s;
- cairoRectangle (r.getX (), r.getY (), r.getWidth (), r.getHeight ());
+ Rectangle2D r = (Rectangle2D) s;
+ cairoRectangle(r.getX(), r.getY(), r.getWidth(), r.getHeight());
}
- else
- walkPath (s.getPathIterator (null), false);
- cairoFill ();
-
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ else
+ walkPath(s.getPathIterator(null), false);
+ cairoFill();
+
+ updateBufferedImage();
}
- public void clip (Shape s)
+ public void clip(Shape s)
{
- // update it
+ // update it
+ if (clip == null || s == null)
+ clip = s;
+ else if (s instanceof Rectangle2D && clip instanceof Rectangle2D)
+ {
+ Rectangle2D r = (Rectangle2D) s;
+ Rectangle2D curr = (Rectangle2D) clip;
+ clip = curr.createIntersection(r);
+ }
+ else
+ throw new UnsupportedOperationException();
- if (clip == null || s == null)
- clip = s;
- else if (s instanceof Rectangle2D
- && clip instanceof Rectangle2D)
+ // draw it
+ if (clip != null)
+ {
+ cairoNewPath();
+ if (clip instanceof Rectangle2D)
{
- Rectangle2D r = (Rectangle2D)s;
- Rectangle2D curr = (Rectangle2D)clip;
- clip = curr.createIntersection (r);
+ Rectangle2D r = (Rectangle2D) clip;
+ cairoRectangle(r.getX(), r.getY(), r.getWidth(), r.getHeight());
}
- else
- throw new UnsupportedOperationException ();
+ else
+ walkPath(clip.getPathIterator(null), false);
- // draw it
- if (clip != null)
- {
- cairoNewPath ();
- if (clip instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D)clip;
- cairoRectangle (r.getX (), r.getY (),
- r.getWidth (), r.getHeight ());
- }
- else
- walkPath (clip.getPathIterator (null), false);
- // cairoClosePath ();
- cairoClip ();
- }
+ // cairoClosePath ();
+ cairoClip();
+ }
}
- public Paint getPaint ()
+ public Paint getPaint()
{
return paint;
}
- public AffineTransform getTransform ()
+ public AffineTransform getTransform()
{
- return (AffineTransform) transform.clone ();
+ return (AffineTransform) transform.clone();
}
- public void setPaint (Paint p)
+ public void setPaint(Paint p)
{
if (paint == null)
- return;
-
+ return;
+
paint = p;
if (paint instanceof Color)
{
- setColor ((Color) paint);
+ setColor((Color) paint);
}
else if (paint instanceof TexturePaint)
{
- TexturePaint tp = (TexturePaint) paint;
- BufferedImage img = tp.getImage ();
-
- // map the image to the anchor rectangle
+ TexturePaint tp = (TexturePaint) paint;
+ BufferedImage img = tp.getImage();
- int width = (int) tp.getAnchorRect ().getWidth ();
- int height = (int) tp.getAnchorRect ().getHeight ();
-
- double scaleX = width / (double) img.getWidth ();
- double scaleY = width / (double) img.getHeight ();
-
- AffineTransform at = new AffineTransform (scaleX, 0, 0, scaleY, 0, 0);
- AffineTransformOp op = new AffineTransformOp (at, getRenderingHints());
- BufferedImage texture = op.filter(img, null);
- int pixels[] = texture.getRGB (0, 0, width, height, null, 0, width);
- setTexturePixels (pixels, width, height, width);
+ // map the image to the anchor rectangle
+ int width = (int) tp.getAnchorRect().getWidth();
+ int height = (int) tp.getAnchorRect().getHeight();
+
+ double scaleX = width / (double) img.getWidth();
+ double scaleY = width / (double) img.getHeight();
+ AffineTransform at = new AffineTransform(scaleX, 0, 0, scaleY, 0, 0);
+ AffineTransformOp op = new AffineTransformOp(at, getRenderingHints());
+ BufferedImage texture = op.filter(img, null);
+ int[] pixels = texture.getRGB(0, 0, width, height, null, 0, width);
+ setTexturePixels(pixels, width, height, width);
}
else if (paint instanceof GradientPaint)
{
- GradientPaint gp = (GradientPaint) paint;
- Point2D p1 = gp.getPoint1 ();
- Point2D p2 = gp.getPoint2 ();
- Color c1 = gp.getColor1 ();
- Color c2 = gp.getColor2 ();
- setGradient (p1.getX (), p1.getY (),
- p2.getX (), p2.getY (),
- c1.getRed (), c1.getGreen (),
- c1.getBlue (), c1.getAlpha (),
- c2.getRed (), c2.getGreen (),
- c2.getBlue (), c2.getAlpha (),
- gp.isCyclic ());
+ GradientPaint gp = (GradientPaint) paint;
+ Point2D p1 = gp.getPoint1();
+ Point2D p2 = gp.getPoint2();
+ Color c1 = gp.getColor1();
+ Color c2 = gp.getColor2();
+ setGradient(p1.getX(), p1.getY(), p2.getX(), p2.getY(), c1.getRed(),
+ c1.getGreen(), c1.getBlue(), c1.getAlpha(), c2.getRed(),
+ c2.getGreen(), c2.getBlue(), c2.getAlpha(), gp.isCyclic());
}
else
- throw new java.lang.UnsupportedOperationException ();
+ throw new java.lang.UnsupportedOperationException();
}
- public void setTransform (AffineTransform tx)
+ public void setTransform(AffineTransform tx)
{
transform = tx;
if (transform != null)
{
- double m[] = new double[6];
- transform.getMatrix (m);
- cairoSetMatrix (m);
+ double[] m = new double[6];
+ transform.getMatrix(m);
+ cairoSetMatrix(m);
}
}
- public void transform (AffineTransform tx)
+ public void transform(AffineTransform tx)
{
if (transform == null)
- transform = new AffineTransform (tx);
+ transform = new AffineTransform(tx);
else
- transform.concatenate (tx);
- setTransform (transform);
+ transform.concatenate(tx);
+ setTransform(transform);
if (clip != null)
{
- // FIXME: this should actuall try to transform the shape
- // rather than degrade to bounds.
- Rectangle2D r = clip.getBounds2D();
- double[] coords = new double[] { r.getX(), r.getY(),
- r.getX() + r.getWidth(),
- r.getY() + r.getHeight() };
- try
- {
- tx.createInverse().transform(coords, 0, coords, 0, 2);
- r.setRect(coords[0], coords[1],
- coords[2] - coords[0],
- coords[3] - coords[1]);
- clip = r;
- }
- catch (java.awt.geom.NoninvertibleTransformException e)
- {
- }
+ // FIXME: this should actuall try to transform the shape
+ // rather than degrade to bounds.
+ Rectangle2D r = clip.getBounds2D();
+ double[] coords = new double[]
+ {
+ r.getX(), r.getY(), r.getX() + r.getWidth(),
+ r.getY() + r.getHeight()
+ };
+ try
+ {
+ tx.createInverse().transform(coords, 0, coords, 0, 2);
+ r.setRect(coords[0], coords[1], coords[2] - coords[0],
+ coords[3] - coords[1]);
+ clip = r;
+ }
+ catch (java.awt.geom.NoninvertibleTransformException e)
+ {
+ }
}
}
public void rotate(double theta)
{
- transform (AffineTransform.getRotateInstance (theta));
+ transform(AffineTransform.getRotateInstance(theta));
}
public void rotate(double theta, double x, double y)
{
- transform (AffineTransform.getRotateInstance (theta, x, y));
+ transform(AffineTransform.getRotateInstance(theta, x, y));
}
public void scale(double sx, double sy)
{
- transform (AffineTransform.getScaleInstance (sx, sy));
+ transform(AffineTransform.getScaleInstance(sx, sy));
}
- public void translate (double tx, double ty)
+ public void translate(double tx, double ty)
{
- transform (AffineTransform.getTranslateInstance (tx, ty));
+ transform(AffineTransform.getTranslateInstance(tx, ty));
}
- public void translate (int x, int y)
+ public void translate(int x, int y)
{
- translate ((double) x, (double) y);
+ translate((double) x, (double) y);
}
public void shear(double shearX, double shearY)
{
- transform (AffineTransform.getShearInstance (shearX, shearY));
+ transform(AffineTransform.getShearInstance(shearX, shearY));
}
public Stroke getStroke()
@@ -779,173 +756,165 @@ public class GdkGraphics2D extends Graphics2D
return stroke;
}
- public void setStroke (Stroke st)
+ public void setStroke(Stroke st)
{
stroke = st;
if (stroke instanceof BasicStroke)
{
- BasicStroke bs = (BasicStroke) stroke;
- cairoSetLineCap (bs.getEndCap());
- cairoSetLineWidth (bs.getLineWidth());
- cairoSetLineJoin (bs.getLineJoin());
- cairoSetMiterLimit (bs.getMiterLimit());
- float dashes[] = bs.getDashArray();
- if (dashes != null)
- {
- double double_dashes[] = new double[dashes.length];
- for (int i = 0; i < dashes.length; i++)
- double_dashes[i] = dashes[i];
- cairoSetDash (double_dashes, double_dashes.length,
- (double) bs.getDashPhase ());
- }
+ BasicStroke bs = (BasicStroke) stroke;
+ cairoSetLineCap(bs.getEndCap());
+ cairoSetLineWidth(bs.getLineWidth());
+ cairoSetLineJoin(bs.getLineJoin());
+ cairoSetMiterLimit(bs.getMiterLimit());
+ float[] dashes = bs.getDashArray();
+ if (dashes != null)
+ {
+ double[] double_dashes = new double[dashes.length];
+ for (int i = 0; i < dashes.length; i++)
+ double_dashes[i] = dashes[i];
+ cairoSetDash(double_dashes, double_dashes.length,
+ (double) bs.getDashPhase());
+ }
}
}
-
////////////////////////////////////////////////
////// Implementation of Graphics Methods //////
////////////////////////////////////////////////
- public void setPaintMode ()
- {
- setComposite (java.awt.AlphaComposite.SrcOver);
+ public void setPaintMode()
+ {
+ setComposite(java.awt.AlphaComposite.SrcOver);
}
- public void setXORMode (Color c)
- {
- setComposite (new gnu.java.awt.BitwiseXORComposite(c));
+ public void setXORMode(Color c)
+ {
+ setComposite(new gnu.java.awt.BitwiseXORComposite(c));
}
- public void setColor (Color c)
+ public void setColor(Color c)
{
if (c == null)
c = Color.BLACK;
-
+
fg = c;
paint = c;
- cairoSetRGBColor (fg.getRed() / 255.0,
- fg.getGreen() / 255.0,
- fg.getBlue() / 255.0);
- cairoSetAlpha ((fg.getAlpha() & 255) / 255.0);
+ cairoSetRGBColor(fg.getRed() / 255.0, fg.getGreen() / 255.0,
+ fg.getBlue() / 255.0);
+ cairoSetAlpha((fg.getAlpha() & 255) / 255.0);
}
- public Color getColor ()
+ public Color getColor()
{
return fg;
}
- public void clipRect (int x, int y, int width, int height)
+ public void clipRect(int x, int y, int width, int height)
{
- clip (new Rectangle (x, y, width, height));
+ clip(new Rectangle(x, y, width, height));
}
- public Shape getClip ()
+ public Shape getClip()
{
- return getClipInDevSpace ();
+ return clip.getBounds2D(); //getClipInDevSpace();
}
- public Rectangle getClipBounds ()
+ public Rectangle getClipBounds()
{
if (clip == null)
return null;
else
- return clip.getBounds ();
+ return clip.getBounds();
}
- protected Rectangle2D getClipInDevSpace ()
+ protected Rectangle2D getClipInDevSpace()
{
- Rectangle2D uclip = clip.getBounds2D ();
+ Rectangle2D uclip = clip.getBounds2D();
if (transform == null)
return uclip;
else
{
- Point2D pos = transform.transform (new Point2D.Double(uclip.getX (),
- uclip.getY ()),
- (Point2D)null);
- Point2D extent = transform.deltaTransform (new Point2D.Double(uclip.getWidth (),
- uclip.getHeight ()),
- (Point2D)null);
- return new Rectangle2D.Double (pos.getX (), pos.getY (),
- extent.getX (), extent.getY ());
+ Point2D pos = transform.transform(new Point2D.Double(uclip.getX(),
+ uclip.getY()),
+ (Point2D) null);
+ Point2D extent = transform.deltaTransform(new Point2D.Double(uclip
+ .getWidth(),
+ uclip
+ .getHeight()),
+ (Point2D) null);
+ return new Rectangle2D.Double(pos.getX(), pos.getY(), extent.getX(),
+ extent.getY());
}
}
- public void setClip (int x, int y, int width, int height)
+ public void setClip(int x, int y, int width, int height)
{
- setClip(new Rectangle2D.Double ((double)x, (double)y,
- (double)width, (double)height));
+ setClip(new Rectangle2D.Double((double) x, (double) y, (double) width,
+ (double) height));
}
-
- public void setClip (Shape s)
+
+ public void setClip(Shape s)
{
clip = s;
if (s != null)
{
- cairoNewPath ();
- if (s instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D)s;
- cairoRectangle (r.getX (), r.getY (),
- r.getWidth (), r.getHeight ());
- }
- else
- walkPath (s.getPathIterator (null), false);
- // cairoClosePath ();
- cairoClip ();
+ cairoNewPath();
+ if (s instanceof Rectangle2D)
+ {
+ Rectangle2D r = (Rectangle2D) s;
+ cairoRectangle(r.getX(), r.getY(), r.getWidth(), r.getHeight());
+ }
+ else
+ walkPath(s.getPathIterator(null), false);
+
+ // cairoClosePath ();
+ cairoClip();
}
}
-
+
private static BasicStroke draw3DRectStroke = new BasicStroke();
- public void draw3DRect(int x, int y, int width,
- int height, boolean raised)
+ public void draw3DRect(int x, int y, int width, int height, boolean raised)
{
Stroke tmp = stroke;
setStroke(draw3DRectStroke);
super.draw3DRect(x, y, width, height, raised);
- setStroke(tmp);
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ setStroke(tmp);
+ updateBufferedImage();
}
- public void fill3DRect(int x, int y, int width,
- int height, boolean raised)
+ public void fill3DRect(int x, int y, int width, int height, boolean raised)
{
Stroke tmp = stroke;
setStroke(draw3DRectStroke);
super.fill3DRect(x, y, width, height, raised);
- setStroke(tmp);
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ setStroke(tmp);
+ updateBufferedImage();
}
-
- public void drawRect (int x, int y, int width, int height)
+ public void drawRect(int x, int y, int width, int height)
{
- draw(new Rectangle (x, y, width, height));
+ draw(new Rectangle(x, y, width, height));
}
- public void fillRect (int x, int y, int width, int height)
+ public void fillRect(int x, int y, int width, int height)
{
- cairoNewPath ();
- cairoRectangle (x, y, width, height);
- cairoFill ();
+ cairoNewPath();
+ cairoRectangle(x, y, width, height);
+ cairoFill();
}
- public void clearRect (int x, int y, int width, int height)
+ public void clearRect(int x, int y, int width, int height)
{
- cairoSetRGBColor (bg.getRed() / 255.0,
- bg.getGreen() / 255.0,
- bg.getBlue() / 255.0);
- cairoSetAlpha (1.0);
- cairoNewPath ();
- cairoRectangle (x, y, width, height);
- cairoFill ();
- setColor (fg);
-
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ cairoSetRGBColor(bg.getRed() / 255.0, bg.getGreen() / 255.0,
+ bg.getBlue() / 255.0);
+ cairoSetAlpha(1.0);
+ cairoNewPath();
+ cairoRectangle(x, y, width, height);
+ cairoFill();
+ setColor(fg);
+ updateBufferedImage();
}
public void setBackground(Color c)
@@ -958,181 +927,172 @@ public class GdkGraphics2D extends Graphics2D
return bg;
}
- private final void doPolygon(int[] xPoints, int[] yPoints, int nPoints,
- boolean close, boolean fill)
- {
+ private void doPolygon(int[] xPoints, int[] yPoints, int nPoints,
+ boolean close, boolean fill)
+ {
if (nPoints < 1)
return;
- GeneralPath gp = new GeneralPath (PathIterator.WIND_EVEN_ODD);
- gp.moveTo ((float)xPoints[0], (float)yPoints[0]);
+ GeneralPath gp = new GeneralPath(PathIterator.WIND_EVEN_ODD);
+ gp.moveTo((float) xPoints[0], (float) yPoints[0]);
for (int i = 1; i < nPoints; i++)
- gp.lineTo ((float)xPoints[i], (float)yPoints[i]);
-
+ gp.lineTo((float) xPoints[i], (float) yPoints[i]);
+
if (close)
- gp.closePath ();
+ gp.closePath();
Shape sh = gp;
- if (fill == false &&
- stroke != null &&
- !(stroke instanceof BasicStroke))
+ if (fill == false && stroke != null && ! (stroke instanceof BasicStroke))
{
- sh = stroke.createStrokedShape (gp);
- fill = true;
+ sh = stroke.createStrokedShape(gp);
+ fill = true;
}
-
- if (fill)
- fill (sh);
- else
- draw (sh);
+
+ if (fill)
+ fill(sh);
+ else
+ draw(sh);
}
- public void drawLine (int x1, int y1, int x2, int y2)
+ public void drawLine(int x1, int y1, int x2, int y2)
{
- int xp[] = new int[2];
- int yp[] = new int[2];
+ int[] xp = new int[2];
+ int[] yp = new int[2];
xp[0] = x1;
xp[1] = x2;
yp[0] = y1;
yp[1] = y2;
-
- doPolygon (xp, yp, 2, false, false);
+
+ doPolygon(xp, yp, 2, false, false);
}
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
{
- doPolygon (xPoints, yPoints, nPoints, true, true);
+ doPolygon(xPoints, yPoints, nPoints, true, true);
}
-
+
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
- {
- doPolygon (xPoints, yPoints, nPoints, true, false);
+ {
+ doPolygon(xPoints, yPoints, nPoints, true, false);
}
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
{
- doPolygon (xPoints, yPoints, nPoints, false, false);
+ doPolygon(xPoints, yPoints, nPoints, false, false);
}
- private final boolean drawRaster (ColorModel cm, Raster r,
- AffineTransform imageToUser,
- Color bgcolor)
+ private boolean drawRaster(ColorModel cm, Raster r,
+ AffineTransform imageToUser, Color bgcolor)
{
if (r == null)
return false;
- SampleModel sm = r.getSampleModel ();
- DataBuffer db = r.getDataBuffer ();
+ SampleModel sm = r.getSampleModel();
+ DataBuffer db = r.getDataBuffer();
if (db == null || sm == null)
return false;
if (cm == null)
- cm = ColorModel.getRGBdefault ();
+ cm = ColorModel.getRGBdefault();
double[] i2u = new double[6];
if (imageToUser != null)
imageToUser.getMatrix(i2u);
else
{
- i2u[0] = 1; i2u[1] = 0;
- i2u[2] = 0; i2u[3] = 1;
- i2u[4] = 0; i2u[5] = 0;
+ i2u[0] = 1;
+ i2u[1] = 0;
+ i2u[2] = 0;
+ i2u[3] = 1;
+ i2u[4] = 0;
+ i2u[5] = 0;
}
- int pixels[] = null;
+ int[] pixels = findSimpleIntegerArray(cm, r);
- if (sm.getDataType () == DataBuffer.TYPE_INT &&
- db instanceof DataBufferInt &&
- db.getNumBanks () == 1)
+ if (pixels == null)
{
- // single bank, ARGB-ints buffer in sRGB space
- DataBufferInt dbi = (DataBufferInt)db;
- pixels = dbi.getData ();
+ // FIXME: I don't think this code will work correctly with a non-RGB
+ // MultiPixelPackedSampleModel. Although this entire method should
+ // probably be rewritten to better utilize Cairo's different supported
+ // data formats.
+ if (sm instanceof MultiPixelPackedSampleModel)
+ {
+ pixels = r.getPixels(0, 0, r.getWidth(), r.getHeight(), pixels);
+ for (int i = 0; i < pixels.length; i++)
+ pixels[i] = cm.getRGB(pixels[i]);
+ }
+ else
+ {
+ pixels = new int[r.getWidth() * r.getHeight()];
+ for (int i = 0; i < pixels.length; i++)
+ pixels[i] = cm.getRGB(db.getElem(i));
+ }
}
- else
- pixels = r.getPixels (0, 0, r.getWidth (), r.getHeight (), pixels);
-
- ColorSpace cs = cm.getColorSpace ();
- if (cs != null &&
- cs.getType () != ColorSpace.CS_sRGB)
+
+ // Change all transparent pixels in the image to the specified bgcolor,
+ // or (if there's no alpha) fill in an alpha channel so that it paints
+ // correctly.
+ if (cm.hasAlpha())
{
- int pixels2[] = new int[pixels.length];
- for (int i = 0; i < pixels2.length; i++)
- pixels2[i] = cm.getRGB (pixels[i]);
- pixels = pixels2;
+ if (bgcolor != null && cm.hasAlpha())
+ for (int i = 0; i < pixels.length; i++)
+ {
+ if (cm.getAlpha(pixels[i]) == 0)
+ pixels[i] = bgcolor.getRGB();
+ }
}
-
- // change all transparent pixels in the image to the
- // specified bgcolor
-
- if (bgcolor != null)
- {
- for (int i = 0; i < pixels.length; i++)
- {
- if (cm.getAlpha (pixels[i]) == 0)
- pixels[i] = bgcolor.getRGB ();
- }
- }
-
- drawPixels (pixels, r.getWidth (), r.getHeight (), r.getWidth (), i2u);
-
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ else
+ for (int i = 0; i < pixels.length; i++)
+ pixels[i] |= 0xFF000000;
+
+ drawPixels(pixels, r.getWidth(), r.getHeight(), r.getWidth(), i2u);
+
+ updateBufferedImage();
return true;
}
- public void drawRenderedImage(RenderedImage image,
- AffineTransform xform)
+ public void drawRenderedImage(RenderedImage image, AffineTransform xform)
{
- drawRaster (image.getColorModel(), image.getData(), xform, bg);
+ drawRaster(image.getColorModel(), image.getData(), xform, bg);
}
-
- public void drawRenderableImage(RenderableImage image,
- AffineTransform xform)
+
+ public void drawRenderableImage(RenderableImage image, AffineTransform xform)
{
- drawRenderedImage (image.createRendering (new RenderContext (xform)), xform);
+ drawRenderedImage(image.createRendering(new RenderContext(xform)), xform);
}
-
- public boolean drawImage(Image img,
- AffineTransform xform,
- ImageObserver obs)
+
+ public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
{
- return drawImage(img, xform, bg, obs);
+ return drawImage(img, xform, bg, obs);
}
- public void drawImage(BufferedImage image,
- BufferedImageOp op,
- int x,
- int y)
+ public void drawImage(BufferedImage image, BufferedImageOp op, int x, int y)
{
Image filtered = op.filter(image, null);
- drawImage(filtered, new AffineTransform(1f,0f,0f,1f,x,y), bg, null);
+ drawImage(filtered, new AffineTransform(1f, 0f, 0f, 1f, x, y), bg, null);
}
- public boolean drawImage (Image img, int x, int y,
- ImageObserver observer)
+ public boolean drawImage(Image img, int x, int y, ImageObserver observer)
{
- return drawImage(img, new AffineTransform(1f,0f,0f,1f,x,y), bg, observer);
+ return drawImage(img, new AffineTransform(1f, 0f, 0f, 1f, x, y), bg,
+ observer);
}
-
///////////////////////////////////////////////
////// Unimplemented Stubs and Overloads //////
///////////////////////////////////////////////
-
-
- public boolean hit(Rectangle rect, Shape text,
- boolean onStroke)
+ public boolean hit(Rectangle rect, Shape text, boolean onStroke)
{
- throw new java.lang.UnsupportedOperationException ();
+ throw new java.lang.UnsupportedOperationException();
}
public GraphicsConfiguration getDeviceConfiguration()
{
- throw new java.lang.UnsupportedOperationException ();
+ throw new java.lang.UnsupportedOperationException();
}
public void setComposite(Composite comp)
@@ -1141,87 +1101,81 @@ public class GdkGraphics2D extends Graphics2D
if (comp instanceof AlphaComposite)
{
- AlphaComposite a = (AlphaComposite) comp;
- cairoSetOperator(a.getRule());
- Color c = getColor();
- setColor(new Color(c.getRed(),
- c.getGreen(),
- c.getBlue(),
- (int) (a.getAlpha() * ((float) c.getAlpha()))));
+ AlphaComposite a = (AlphaComposite) comp;
+ cairoSetOperator(a.getRule());
+ Color c = getColor();
+ setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(),
+ (int) (a.getAlpha() * ((float) c.getAlpha()))));
}
else
- throw new java.lang.UnsupportedOperationException ();
+ throw new java.lang.UnsupportedOperationException();
}
- public void setRenderingHint(RenderingHints.Key hintKey,
- Object hintValue)
+ public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
{
- hints.put (hintKey, hintValue);
-
+ hints.put(hintKey, hintValue);
+
if (hintKey.equals(RenderingHints.KEY_INTERPOLATION)
- || hintKey.equals(RenderingHints.KEY_ALPHA_INTERPOLATION))
+ || hintKey.equals(RenderingHints.KEY_ALPHA_INTERPOLATION))
{
-
- if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- cairoSurfaceSetFilter(0);
-
- else if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- cairoSurfaceSetFilter(1);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
- cairoSurfaceSetFilter(2);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
- cairoSurfaceSetFilter(3);
-
- else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
- cairoSurfaceSetFilter(4);
-
+ if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
+ cairoSurfaceSetFilter(0);
+
+ else if (hintValue.equals(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
+ cairoSurfaceSetFilter(1);
+
+ else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
+ cairoSurfaceSetFilter(2);
+
+ else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
+ cairoSurfaceSetFilter(3);
+
+ else if (hintValue.equals(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
+ cairoSurfaceSetFilter(4);
}
- shiftDrawCalls = hints.containsValue (RenderingHints.VALUE_STROKE_NORMALIZE)
- || hints.containsValue (RenderingHints.VALUE_STROKE_DEFAULT);
-
+ shiftDrawCalls = hints.containsValue(RenderingHints.VALUE_STROKE_NORMALIZE)
+ || hints.containsValue(RenderingHints.VALUE_STROKE_DEFAULT);
}
public Object getRenderingHint(RenderingHints.Key hintKey)
{
- return hints.get (hintKey);
+ return hints.get(hintKey);
}
-
+
public void setRenderingHints(Map hints)
{
- this.hints = new RenderingHints (getDefaultHints ());
- this.hints.add (new RenderingHints (hints));
-
- if (hints.containsKey(RenderingHints.KEY_INTERPOLATION))
+ this.hints = new RenderingHints(getDefaultHints());
+ this.hints.add(new RenderingHints(hints));
+
+ if (hints.containsKey(RenderingHints.KEY_INTERPOLATION))
+ {
+ if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
+ cairoSurfaceSetFilter(0);
+
+ else if (hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
+ cairoSurfaceSetFilter(1);
+ }
+
+ if (hints.containsKey(RenderingHints.KEY_ALPHA_INTERPOLATION))
{
- if(hints.containsValue(RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR))
- cairoSurfaceSetFilter(0);
-
- else if(hints.containsValue(RenderingHints.VALUE_INTERPOLATION_BILINEAR))
- cairoSurfaceSetFilter(1);
+ if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
+ cairoSurfaceSetFilter(2);
+
+ else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
+ cairoSurfaceSetFilter(3);
+
+ else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
+ cairoSurfaceSetFilter(4);
}
-
- if (hints.containsKey(RenderingHints.KEY_ALPHA_INTERPOLATION))
- {
- if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED))
- cairoSurfaceSetFilter(2);
-
- else if (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY))
- cairoSurfaceSetFilter(3);
-
- else if(hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT))
- cairoSurfaceSetFilter(4);
- }
-
- shiftDrawCalls = hints.containsValue (RenderingHints.VALUE_STROKE_NORMALIZE)
- || hints.containsValue (RenderingHints.VALUE_STROKE_DEFAULT);
+
+ shiftDrawCalls = hints.containsValue(RenderingHints.VALUE_STROKE_NORMALIZE)
+ || hints.containsValue(RenderingHints.VALUE_STROKE_DEFAULT);
}
public void addRenderingHints(Map hints)
{
- this.hints.add (new RenderingHints (hints));
+ this.hints.add(new RenderingHints(hints));
}
public RenderingHints getRenderingHints()
@@ -1237,70 +1191,62 @@ public class GdkGraphics2D extends Graphics2D
return comp;
}
- public FontRenderContext getFontRenderContext ()
+ public FontRenderContext getFontRenderContext()
{
- return new FontRenderContext (transform, true, true);
+ return new FontRenderContext(transform, true, true);
}
- public void copyArea (int x, int y, int width, int height, int dx, int dy)
+ public void copyArea(int x, int y, int width, int height, int dx, int dy)
{
- throw new java.lang.UnsupportedOperationException ();
+ throw new java.lang.UnsupportedOperationException();
}
- public void drawArc (int x, int y, int width, int height,
- int startAngle, int arcAngle)
+ public void drawArc(int x, int y, int width, int height, int startAngle,
+ int arcAngle)
{
- draw (new Arc2D.Double((double)x, (double)y,
- (double)width, (double)height,
- (double)startAngle, (double)arcAngle,
- Arc2D.OPEN));
+ draw(new Arc2D.Double((double) x, (double) y, (double) width,
+ (double) height, (double) startAngle,
+ (double) arcAngle, Arc2D.OPEN));
}
- public boolean drawImage (Image img, int x, int y, Color bgcolor,
- ImageObserver observer)
+ public boolean drawImage(Image img, int x, int y, Color bgcolor,
+ ImageObserver observer)
{
- return drawImage (img, x, y, img.getWidth (observer),
- img.getHeight (observer), bgcolor, observer);
+ return drawImage(img, x, y, img.getWidth(observer),
+ img.getHeight(observer), bgcolor, observer);
}
- public boolean drawImage (Image img, int x, int y, int width, int height,
- Color bgcolor, ImageObserver observer)
+ public boolean drawImage(Image img, int x, int y, int width, int height,
+ Color bgcolor, ImageObserver observer)
{
-
- double scaleX = width / (double) img.getWidth (observer);
- double scaleY = height / (double) img.getHeight (observer);
-
- return drawImage (img,
- new AffineTransform(scaleX, 0f, 0f, scaleY, x, y),
- bgcolor,
- observer);
+ double scaleX = width / (double) img.getWidth(observer);
+ double scaleY = height / (double) img.getHeight(observer);
+ return drawImage(img, new AffineTransform(scaleX, 0f, 0f, scaleY, x, y),
+ bgcolor, observer);
}
- public boolean drawImage (Image img, int x, int y, int width, int height,
- ImageObserver observer)
+ public boolean drawImage(Image img, int x, int y, int width, int height,
+ ImageObserver observer)
{
-
- return drawImage (img, x, y, width, height, bg, observer);
-
+ return drawImage(img, x, y, width, height, bg, observer);
}
- public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- Color bgcolor, ImageObserver observer)
+ public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
+ int sx1, int sy1, int sx2, int sy2, Color bgcolor,
+ ImageObserver observer)
{
-
if (img == null)
return false;
- Image subImage;
-
+ Image subImage;
+
int sourceWidth = sx2 - sx1;
- int sourceHeight = sy2 - sy1;
-
+ int sourceHeight = sy2 - sy1;
+
int destWidth = dx2 - dx1;
int destHeight = dy2 - dy1;
-
+
double scaleX = destWidth / (double) sourceWidth;
double scaleY = destHeight / (double) sourceHeight;
@@ -1309,48 +1255,42 @@ public class GdkGraphics2D extends Graphics2D
if (img instanceof BufferedImage)
{
-
- BufferedImage b = (BufferedImage) img;
- subImage = b.getSubimage(sx1,sy1,sx2,sy2);
- }
- else
+ BufferedImage b = (BufferedImage) img;
+ subImage = b.getSubimage(sx1, sy1, sx2, sy2);
+ }
+ else
{
-
- // FIXME: This code currently doesn't work. Null Pointer
- // exception is thrown in this case. This happens
- // because img.getSource() always returns null, since source gets
- // never initialized when it is created with the help of
- // createImage(int width, int height).
-
- CropImageFilter filter = new CropImageFilter(sx1,sx2,sx2,sy2);
- FilteredImageSource src = new FilteredImageSource(img.getSource(),
- filter);
-
- subImage = Toolkit.getDefaultToolkit().createImage(src);
+ // FIXME: This code currently doesn't work. Null Pointer
+ // exception is thrown in this case. This happens
+ // because img.getSource() always returns null, since source gets
+ // never initialized when it is created with the help of
+ // createImage(int width, int height).
+ CropImageFilter filter = new CropImageFilter(sx1, sx2, sx2, sy2);
+ FilteredImageSource src = new FilteredImageSource(img.getSource(),
+ filter);
+
+ subImage = Toolkit.getDefaultToolkit().createImage(src);
}
- return drawImage(subImage, new AffineTransform(scaleX, 0, 0,
- scaleY, dx1, dy1),
- bgcolor,
- observer);
+ return drawImage(subImage,
+ new AffineTransform(scaleX, 0, 0, scaleY, dx1, dy1),
+ bgcolor, observer);
}
- public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- ImageObserver observer)
+ public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2,
+ int sx1, int sy1, int sx2, int sy2,
+ ImageObserver observer)
{
-
- return drawImage (img, dx1, dy1, dx2, dy2,
- sx1, sy1, sx2, sy2, bg, observer);
+ return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bg, observer);
}
public void drawOval(int x, int y, int width, int height)
{
- drawArc (x, y, width, height, 0, 360);
+ drawArc(x, y, width, height, 0, 360);
}
- public void drawRoundRect(int x, int y, int width, int height,
- int arcWidth, int arcHeight)
+ public void drawRoundRect(int x, int y, int width, int height, int arcWidth,
+ int arcHeight)
{
if (arcWidth > width)
arcWidth = width;
@@ -1360,93 +1300,89 @@ public class GdkGraphics2D extends Graphics2D
int xx = x + width - arcWidth;
int yy = y + height - arcHeight;
- drawArc (x, y, arcWidth, arcHeight, 90, 90);
- drawArc (xx, y, arcWidth, arcHeight, 0, 90);
- drawArc (xx, yy, arcWidth, arcHeight, 270, 90);
- drawArc (x, yy, arcWidth, arcHeight, 180, 90);
+ drawArc(x, y, arcWidth, arcHeight, 90, 90);
+ drawArc(xx, y, arcWidth, arcHeight, 0, 90);
+ drawArc(xx, yy, arcWidth, arcHeight, 270, 90);
+ drawArc(x, yy, arcWidth, arcHeight, 180, 90);
int y1 = y + arcHeight / 2;
int y2 = y + height - arcHeight / 2;
- drawLine (x, y1, x, y2);
- drawLine (x + width, y1, x + width, y2);
+ drawLine(x, y1, x, y2);
+ drawLine(x + width, y1, x + width, y2);
int x1 = x + arcWidth / 2;
int x2 = x + width - arcWidth / 2;
- drawLine (x1, y, x2, y);
- drawLine (x1, y + height, x2, y + height);
+ drawLine(x1, y, x2, y);
+ drawLine(x1, y + height, x2, y + height);
}
// these are the most accelerated painting paths
- native void cairoDrawGdkGlyphVector (GdkFontPeer f, GdkGlyphVector gv, float x, float y);
- native void cairoDrawGdkTextLayout (GdkFontPeer f, GdkTextLayout gl, float x, float y);
- native void cairoDrawString (GdkFontPeer f, String str, float x, float y);
+ native void cairoDrawGlyphVector(GdkFontPeer font,
+ float x, float y, int n,
+ int[] codes, float[] positions);
- GdkFontPeer getFontPeer()
- {
- return (GdkFontPeer) getFont().getPeer();
- }
+ native void cairoDrawGdkTextLayout(GdkTextLayout gl,
+ float x, float y);
- public void drawGdkGlyphVector(GdkGlyphVector gv, float x, float y)
+ GdkFontPeer getFontPeer()
{
- cairoDrawGdkGlyphVector(getFontPeer(), gv, x, y);
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ return (GdkFontPeer) getFont().getPeer();
}
public void drawGdkTextLayout(GdkTextLayout gl, float x, float y)
{
- cairoDrawGdkTextLayout(getFontPeer(), gl, x, y);
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ cairoDrawGdkTextLayout (gl, x, y);
+ updateBufferedImage ();
}
- public void drawString (String str, float x, float y)
+ public void drawString(String str, float x, float y)
{
- cairoDrawString(getFontPeer(), str, x, y);
- if (isBufferedImageGraphics ())
- updateBufferedImage();
+ drawGlyphVector(getFont().createGlyphVector(null, str), x, y);
+ updateBufferedImage ();
}
- public void drawString (String str, int x, int y)
+ public void drawString(String str, int x, int y)
{
- drawString (str, (float)x, (float)y);
+ drawString (str, (float) x, (float) y);
}
- public void drawString (AttributedCharacterIterator ci, int x, int y)
+ public void drawString(AttributedCharacterIterator ci, int x, int y)
{
- drawString (ci, (float)x, (float)y);
+ drawString (ci, (float) x, (float) y);
}
- public void drawGlyphVector (GlyphVector gv, float x, float y)
+ public void drawGlyphVector(GlyphVector gv, float x, float y)
{
- if (gv instanceof GdkGlyphVector)
- drawGdkGlyphVector((GdkGlyphVector)gv, x, y);
- else
- throw new java.lang.UnsupportedOperationException ();
+ int n = gv.getNumGlyphs ();
+ int[] codes = gv.getGlyphCodes (0, n, null);
+ float[] positions = gv.getGlyphPositions (0, n, null);
+
+ setFont (gv.getFont ());
+ cairoDrawGlyphVector (getFontPeer(), x, y, n, codes, positions);
+ updateBufferedImage ();
}
- public void drawString (AttributedCharacterIterator ci, float x, float y)
+ public void drawString(AttributedCharacterIterator ci, float x, float y)
{
- GlyphVector gv = font.createGlyphVector (getFontRenderContext(), ci);
- drawGlyphVector (gv, x, y);
+ GlyphVector gv = getFont().createGlyphVector(getFontRenderContext(), ci);
+ drawGlyphVector(gv, x, y);
}
- public void fillArc (int x, int y, int width, int height,
- int startAngle, int arcAngle)
+ public void fillArc(int x, int y, int width, int height, int startAngle,
+ int arcAngle)
{
- fill (new Arc2D.Double((double)x, (double)y,
- (double)width, (double)height,
- (double)startAngle, (double)arcAngle,
- Arc2D.OPEN));
+ fill(new Arc2D.Double((double) x, (double) y, (double) width,
+ (double) height, (double) startAngle,
+ (double) arcAngle, Arc2D.OPEN));
}
public void fillOval(int x, int y, int width, int height)
{
- fillArc (x, y, width, height, 0, 360);
+ fillArc(x, y, width, height, 0, 360);
}
- public void fillRoundRect (int x, int y, int width, int height,
- int arcWidth, int arcHeight)
+ public void fillRoundRect(int x, int y, int width, int height, int arcWidth,
+ int arcHeight)
{
if (arcWidth > width)
arcWidth = width;
@@ -1456,17 +1392,19 @@ public class GdkGraphics2D extends Graphics2D
int xx = x + width - arcWidth;
int yy = y + height - arcHeight;
- fillArc (x, y, arcWidth, arcHeight, 90, 90);
- fillArc (xx, y, arcWidth, arcHeight, 0, 90);
- fillArc (xx, yy, arcWidth, arcHeight, 270, 90);
- fillArc (x, yy, arcWidth, arcHeight, 180, 90);
+ fillArc(x, y, arcWidth, arcHeight, 90, 90);
+ fillArc(xx, y, arcWidth, arcHeight, 0, 90);
+ fillArc(xx, yy, arcWidth, arcHeight, 270, 90);
+ fillArc(x, yy, arcWidth, arcHeight, 180, 90);
- fillRect (x, y + arcHeight / 2, width, height - arcHeight + 1);
- fillRect (x + arcWidth / 2, y, width - arcWidth + 1, height);
+ fillRect(x, y + arcHeight / 2, width, height - arcHeight + 1);
+ fillRect(x + arcWidth / 2, y, width - arcWidth + 1, height);
}
- public Font getFont ()
+ public Font getFont()
{
+ if (font == null)
+ return new Font("SansSerif", Font.PLAIN, 12);
return font;
}
@@ -1475,38 +1413,34 @@ public class GdkGraphics2D extends Graphics2D
// GtkFontMetrics into the drawing kit and ask cairo ourselves.
static native void releasePeerGraphicsResource(GdkFontPeer f);
- static native void getPeerTextMetrics (GdkFontPeer f, String str, double [] metrics);
- static native void getPeerFontMetrics (GdkFontPeer f, double [] metrics);
- public FontMetrics getFontMetrics ()
+ public FontMetrics getFontMetrics()
{
- // the reason we go via the toolkit here is to try to get
- // a cached object. the toolkit keeps such a cache.
- return Toolkit.getDefaultToolkit ().getFontMetrics (font);
+ return getFontMetrics(getFont());
}
- public FontMetrics getFontMetrics (Font f)
+ public FontMetrics getFontMetrics(Font f)
{
// the reason we go via the toolkit here is to try to get
// a cached object. the toolkit keeps such a cache.
- return Toolkit.getDefaultToolkit ().getFontMetrics (f);
+ return Toolkit.getDefaultToolkit().getFontMetrics(f);
}
- public void setFont (Font f)
+ public void setFont(Font f)
{
if (f.getPeer() instanceof GdkFontPeer)
font = f;
else
font =
- ((ClasspathToolkit)(Toolkit.getDefaultToolkit ()))
- .getFont (f.getName(), f.getAttributes ());
+ ((ClasspathToolkit)(Toolkit.getDefaultToolkit()))
+ .getFont(f.getName(), f.getAttributes());
}
-
+
public String toString()
{
- return getClass ().getName () +
- "[font=" + font.toString () +
- ",color=" + fg.toString () + "]";
+ return (getClass().getName()
+ + "[font=" + getFont().toString()
+ + ",color=" + fg.toString()
+ + "]");
}
-
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
index 45e0c21c0f2..3f7b87f45cc 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java
@@ -1,5 +1,5 @@
/* GdkGraphicsEnvironment.java -- information about the graphics environment
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,34 +42,46 @@ import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
-import java.awt.Rectangle;
-import java.awt.Shape;
+import java.awt.HeadlessException;
import java.awt.image.BufferedImage;
import java.util.Locale;
public class GdkGraphicsEnvironment extends GraphicsEnvironment
{
- public GdkGraphicsEnvironment ()
+ GtkToolkit gtkToolkit;
+
+ public GtkToolkit getToolkit()
+ {
+ return gtkToolkit;
+ }
+
+ public GdkGraphicsEnvironment (GtkToolkit tk)
{
super();
+ gtkToolkit = tk;
}
public GraphicsDevice[] getScreenDevices ()
{
- throw new java.lang.UnsupportedOperationException ();
+ // FIXME: Support multiple screens, since GDK can.
+ return new GraphicsDevice[] { new GdkScreenGraphicsDevice (this) };
}
public GraphicsDevice getDefaultScreenDevice ()
{
- throw new java.lang.UnsupportedOperationException ();
+ if (GraphicsEnvironment.isHeadless ())
+ throw new HeadlessException ();
+
+ return new GdkScreenGraphicsDevice (this);
}
public Graphics2D createGraphics (BufferedImage image)
{
return new GdkGraphics2D (image);
}
- native private int nativeGetNumFontFamilies ();
- native private void nativeGetFontFamilies (String[] family_names);
+
+ private native int nativeGetNumFontFamilies();
+ private native void nativeGetFontFamilies(String[] family_names);
public Font[] getAllFonts ()
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java b/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
index a7b93e5b9ad..ee6c38f3c3a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
@@ -1,5 +1,5 @@
/* GdkPixbufDecoder.java -- Image data decoding object
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,14 +45,31 @@ import java.awt.image.ColorModel;
import java.awt.image.DirectColorModel;
import java.awt.image.ImageConsumer;
import java.awt.image.ImageProducer;
-import java.io.FileDescriptor;
-import java.io.FileInputStream;
+import java.awt.image.Raster;
+import java.awt.image.RenderedImage;
+import java.io.DataOutput;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Locale;
import java.util.Vector;
+import javax.imageio.IIOImage;
+import javax.imageio.ImageReadParam;
+import javax.imageio.ImageReader;
+import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.ImageWriteParam;
+import javax.imageio.ImageWriter;
+import javax.imageio.metadata.IIOMetadata;
+import javax.imageio.spi.IIORegistry;
+import javax.imageio.spi.ImageReaderSpi;
+import javax.imageio.spi.ImageWriterSpi;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.stream.ImageOutputStream;
+
public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
{
static
@@ -63,22 +80,30 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
}
initStaticState ();
}
- native static void initStaticState ();
+
+ static native void initStaticState();
private final int native_state = GtkGenericPeer.getUniqueInteger ();
+ private boolean initialized = false;
// the current set of ImageConsumers for this decoder
Vector curr;
// interface to GdkPixbuf
native void initState ();
- native void pumpBytes (byte bytes[], int len);
+ native void pumpBytes (byte[] bytes, int len);
native void finish ();
+ static native void streamImage(int[] bytes, String format, int width, int height, boolean hasAlpha, DataOutput sink);
// gdk-pixbuf provids data in RGBA format
static final ColorModel cm = new DirectColorModel (32, 0xff000000,
0x00ff0000,
0x0000ff00,
0x000000ff);
+ public GdkPixbufDecoder (InputStream in)
+ {
+ super (in);
+ }
+
public GdkPixbufDecoder (String filename)
{
super (filename);
@@ -150,24 +175,349 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
curr = null;
}
- // remaining helper class and static method is a convenience for the Gtk
- // peers, for loading a BufferedImage in off a disk file. one would think
- // this ought to be fairly straightforward, but it does not appear
- // anywhere else I can find.
+ public void finalize()
+ {
+ finish();
+ }
+
+
+ public static class ImageFormatSpec
+ {
+ public String name;
+ public boolean writable = false;
+ public ArrayList mimeTypes = new ArrayList();
+ public ArrayList extensions = new ArrayList();
+
+ public ImageFormatSpec(String name, boolean writable)
+ {
+ this.name = name;
+ this.writable = writable;
+ }
+
+ public synchronized void addMimeType(String m)
+ {
+ mimeTypes.add(m);
+ }
+
+ public synchronized void addExtension(String e)
+ {
+ extensions.add(e);
+ }
+ }
+
+ static ArrayList imageFormatSpecs;
+
+ public static ImageFormatSpec registerFormat(String name, boolean writable)
+ {
+ ImageFormatSpec ifs = new ImageFormatSpec(name, writable);
+ synchronized(GdkPixbufDecoder.class)
+ {
+ if (imageFormatSpecs == null)
+ imageFormatSpecs = new ArrayList();
+ imageFormatSpecs.add(ifs);
+ }
+ return ifs;
+ }
+
+ static String[] getFormatNames(boolean writable)
+ {
+ ArrayList names = new ArrayList();
+ synchronized (imageFormatSpecs)
+ {
+ Iterator i = imageFormatSpecs.iterator();
+ while (i.hasNext())
+ {
+ ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+ if (writable && !ifs.writable)
+ continue;
+ names.add(ifs.name);
+
+ /*
+ * In order to make the filtering code work, we need to register
+ * this type under every "format name" likely to be used as a synonym.
+ * This generally means "all the extensions people might use".
+ */
+
+ Iterator j = ifs.extensions.iterator();
+ while (j.hasNext())
+ names.add((String) j.next());
+ }
+ }
+ Object[] objs = names.toArray();
+ String[] strings = new String[objs.length];
+ for (int i = 0; i < objs.length; ++i)
+ strings[i] = (String) objs[i];
+ return strings;
+ }
+
+ static String[] getFormatExtensions(boolean writable)
+ {
+ ArrayList extensions = new ArrayList();
+ synchronized (imageFormatSpecs)
+ {
+ Iterator i = imageFormatSpecs.iterator();
+ while (i.hasNext())
+ {
+ ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+ if (writable && !ifs.writable)
+ continue;
+ Iterator j = ifs.extensions.iterator();
+ while (j.hasNext())
+ extensions.add((String) j.next());
+ }
+ }
+ Object[] objs = extensions.toArray();
+ String[] strings = new String[objs.length];
+ for (int i = 0; i < objs.length; ++i)
+ strings[i] = (String) objs[i];
+ return strings;
+ }
+
+ static String[] getFormatMimeTypes(boolean writable)
+ {
+ ArrayList mimeTypes = new ArrayList();
+ synchronized (imageFormatSpecs)
+ {
+ Iterator i = imageFormatSpecs.iterator();
+ while (i.hasNext())
+ {
+ ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+ if (writable && !ifs.writable)
+ continue;
+ Iterator j = ifs.mimeTypes.iterator();
+ while (j.hasNext())
+ mimeTypes.add((String) j.next());
+ }
+ }
+ Object[] objs = mimeTypes.toArray();
+ String[] strings = new String[objs.length];
+ for (int i = 0; i < objs.length; ++i)
+ strings[i] = (String) objs[i];
+ return strings;
+ }
+
+
+ static String findFormatName(Object ext, boolean needWritable)
+ {
+ if (ext == null)
+ throw new IllegalArgumentException("extension is null");
+
+ if (!(ext instanceof String))
+ throw new IllegalArgumentException("extension is not a string");
+
+ String str = (String) ext;
+
+ Iterator i = imageFormatSpecs.iterator();
+ while (i.hasNext())
+ {
+ ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+
+ if (needWritable && !ifs.writable)
+ continue;
+
+ if (ifs.name.equals(str))
+ return str;
+
+ Iterator j = ifs.extensions.iterator();
+ while (j.hasNext())
+ {
+ String extension = (String)j.next();
+ if (extension.equals(str))
+ return ifs.name;
+ }
+
+ j = ifs.mimeTypes.iterator();
+ while (j.hasNext())
+ {
+ String mimeType = (String)j.next();
+ if (mimeType.equals(str))
+ return ifs.name;
+ }
+ }
+ throw new IllegalArgumentException("unknown extension '" + str + "'");
+ }
+
+ private static GdkPixbufReaderSpi readerSpi;
+ private static GdkPixbufWriterSpi writerSpi;
+
+ public static synchronized GdkPixbufReaderSpi getReaderSpi()
+ {
+ if (readerSpi == null)
+ readerSpi = new GdkPixbufReaderSpi();
+ return readerSpi;
+ }
+
+ public static synchronized GdkPixbufWriterSpi getWriterSpi()
+ {
+ if (writerSpi == null)
+ writerSpi = new GdkPixbufWriterSpi();
+ return writerSpi;
+ }
+
+ public static void registerSpis(IIORegistry reg)
+ {
+ reg.registerServiceProvider(getReaderSpi(), ImageReaderSpi.class);
+ reg.registerServiceProvider(getWriterSpi(), ImageWriterSpi.class);
+ }
- private static class BufferedImageBuilder implements ImageConsumer
+ public static class GdkPixbufWriterSpi extends ImageWriterSpi
{
+ public GdkPixbufWriterSpi()
+ {
+ super("GdkPixbuf", "2.x",
+ GdkPixbufDecoder.getFormatNames(true),
+ GdkPixbufDecoder.getFormatExtensions(true),
+ GdkPixbufDecoder.getFormatMimeTypes(true),
+ "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufWriter",
+ new Class[] { ImageOutputStream.class },
+ new String[] { "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufReaderSpi" },
+ false, null, null, null, null,
+ false, null, null, null, null);
+ }
+
+ public boolean canEncodeImage(ImageTypeSpecifier ts)
+ {
+ return true;
+ }
+
+ public ImageWriter createWriterInstance(Object ext)
+ {
+ return new GdkPixbufWriter(this, ext);
+ }
+
+ public String getDescription(java.util.Locale loc)
+ {
+ return "GdkPixbuf Writer SPI";
+ }
+
+ }
+
+ public static class GdkPixbufReaderSpi extends ImageReaderSpi
+ {
+ public GdkPixbufReaderSpi()
+ {
+ super("GdkPixbuf", "2.x",
+ GdkPixbufDecoder.getFormatNames(false),
+ GdkPixbufDecoder.getFormatExtensions(false),
+ GdkPixbufDecoder.getFormatMimeTypes(false),
+ "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufReader",
+ new Class[] { ImageInputStream.class },
+ new String[] { "gnu.java.awt.peer.gtk.GdkPixbufDecoder$GdkPixbufWriterSpi" },
+ false, null, null, null, null,
+ false, null, null, null, null);
+ }
+
+ public boolean canDecodeInput(Object obj)
+ {
+ return true;
+ }
+
+ public ImageReader createReaderInstance(Object ext)
+ {
+ return new GdkPixbufReader(this, ext);
+ }
+
+ public String getDescription(Locale loc)
+ {
+ return "GdkPixbuf Reader SPI";
+ }
+ }
+
+ private static class GdkPixbufWriter
+ extends ImageWriter
+ {
+ String ext;
+ public GdkPixbufWriter(GdkPixbufWriterSpi ownerSpi, Object ext)
+ {
+ super(ownerSpi);
+ this.ext = findFormatName(ext, true);
+ }
+
+ public IIOMetadata convertImageMetadata (IIOMetadata inData,
+ ImageTypeSpecifier imageType,
+ ImageWriteParam param)
+ {
+ return null;
+ }
+
+ public IIOMetadata convertStreamMetadata (IIOMetadata inData,
+ ImageWriteParam param)
+ {
+ return null;
+ }
+
+ public IIOMetadata getDefaultImageMetadata (ImageTypeSpecifier imageType,
+ ImageWriteParam param)
+ {
+ return null;
+ }
+
+ public IIOMetadata getDefaultStreamMetadata (ImageWriteParam param)
+ {
+ return null;
+ }
+
+ public void write (IIOMetadata streamMetadata, IIOImage i, ImageWriteParam param)
+ throws IOException
+ {
+ RenderedImage image = i.getRenderedImage();
+ Raster ras = image.getData();
+ int width = ras.getWidth();
+ int height = ras.getHeight();
+ ColorModel model = image.getColorModel();
+ int[] pixels = GdkGraphics2D.findSimpleIntegerArray (image.getColorModel(), ras);
+
+ if (pixels == null)
+ {
+ BufferedImage img = new BufferedImage(width, height,
+ (model != null && model.hasAlpha() ?
+ BufferedImage.TYPE_INT_ARGB
+ : BufferedImage.TYPE_INT_RGB));
+ int[] pix = new int[4];
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ img.setRGB(x, y, model.getRGB(ras.getPixel(x, y, pix)));
+ pixels = GdkGraphics2D.findSimpleIntegerArray (img.getColorModel(),
+ img.getRaster());
+ model = img.getColorModel();
+ }
+
+ processImageStarted(1);
+ streamImage(pixels, this.ext, width, height, model.hasAlpha(),
+ (DataOutput) this.getOutput());
+ processImageComplete();
+ }
+ }
+
+ private static class GdkPixbufReader
+ extends ImageReader
+ implements ImageConsumer
+ {
+ // ImageConsumer parts
+ GdkPixbufDecoder dec;
BufferedImage bufferedImage;
ColorModel defaultModel;
+ int width;
+ int height;
+ String ext;
+
+ public GdkPixbufReader(GdkPixbufReaderSpi ownerSpi, Object ext)
+ {
+ super(ownerSpi);
+ this.ext = findFormatName(ext, false);
+ }
- public BufferedImage getBufferedImage()
+ public GdkPixbufReader(GdkPixbufReaderSpi ownerSpi, Object ext, GdkPixbufDecoder d)
{
- return bufferedImage;
+ this(ownerSpi, ext);
+ dec = d;
}
- public void setDimensions(int width, int height)
+ public void setDimensions(int w, int h)
{
- bufferedImage = new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB);
+ processImageStarted(1);
+ width = w;
+ height = h;
}
public void setProperties(Hashtable props) {}
@@ -189,65 +539,137 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
ColorModel model, int[] pixels,
int offset, int scansize)
{
- if (bufferedImage != null)
+ if (model == null)
+ model = defaultModel;
+
+ if (bufferedImage == null)
{
+ bufferedImage = new BufferedImage (width, height, (model != null && model.hasAlpha() ?
+ BufferedImage.TYPE_INT_ARGB
+ : BufferedImage.TYPE_INT_RGB));
+ }
- if (model == null)
- model = defaultModel;
-
- int pixels2[];
- if (model != null)
- {
- pixels2 = new int[pixels.length];
- for (int yy = 0; yy < h; yy++)
- for (int xx = 0; xx < w; xx++)
- {
- int i = yy * scansize + xx;
- pixels2[i] = model.getRGB (pixels[i]);
- }
- }
- else
- pixels2 = pixels;
-
- bufferedImage.setRGB (x, y, w, h, pixels2, offset, scansize);
+ int pixels2[];
+ if (model != null)
+ {
+ pixels2 = new int[pixels.length];
+ for (int yy = 0; yy < h; yy++)
+ for (int xx = 0; xx < w; xx++)
+ {
+ int i = yy * scansize + xx;
+ pixels2[i] = model.getRGB (pixels[i]);
+ }
}
+ else
+ pixels2 = pixels;
+
+ bufferedImage.setRGB (x, y, w, h, pixels2, offset, scansize);
+ processImageProgress(y / (height == 0 ? 1 : height));
+ }
+
+ public void imageComplete(int status)
+ {
+ processImageComplete();
+ }
+
+ public BufferedImage getBufferedImage()
+ {
+ if (bufferedImage == null && dec != null)
+ dec.startProduction (this);
+ return bufferedImage;
+ }
+
+ // ImageReader parts
+
+ public int getNumImages(boolean allowSearch)
+ throws IOException
+ {
+ return 1;
+ }
+
+ public IIOMetadata getImageMetadata(int i)
+ {
+ return null;
+ }
+
+ public IIOMetadata getStreamMetadata()
+ throws IOException
+ {
+ return null;
}
- public void imageComplete(int status) {}
+ public Iterator getImageTypes(int imageIndex)
+ throws IOException
+ {
+ BufferedImage img = getBufferedImage();
+ Vector vec = new Vector();
+ vec.add(new ImageTypeSpecifier(img));
+ return vec.iterator();
+ }
+
+ public int getHeight(int imageIndex)
+ throws IOException
+ {
+ return getBufferedImage().getHeight();
+ }
+
+ public int getWidth(int imageIndex)
+ throws IOException
+ {
+ return getBufferedImage().getWidth();
+ }
+
+ public void setInput(Object input,
+ boolean seekForwardOnly,
+ boolean ignoreMetadata)
+ {
+ super.setInput(input, seekForwardOnly, ignoreMetadata);
+ dec = new GdkPixbufDecoder((InputStream) getInput());
+ }
+
+ public BufferedImage read(int imageIndex, ImageReadParam param)
+ throws IOException
+ {
+ return getBufferedImage ();
+ }
}
+ // remaining helper class and static method is a convenience for the Gtk
+ // peers, for loading a BufferedImage in off a disk file without going
+ // through the whole imageio system.
+
public static BufferedImage createBufferedImage (String filename)
{
- BufferedImageBuilder bb = new BufferedImageBuilder ();
- GdkPixbufDecoder dec = new GdkPixbufDecoder (filename);
- dec.startProduction (bb);
- return bb.getBufferedImage ();
+ GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
+ "png", // reader auto-detects, doesn't matter
+ new GdkPixbufDecoder (filename));
+ return r.getBufferedImage ();
}
public static BufferedImage createBufferedImage (URL u)
{
- BufferedImageBuilder bb = new BufferedImageBuilder ();
- GdkPixbufDecoder dec = new GdkPixbufDecoder (u);
- dec.startProduction (bb);
- return bb.getBufferedImage ();
+ GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
+ "png", // reader auto-detects, doesn't matter
+ new GdkPixbufDecoder (u));
+ return r.getBufferedImage ();
}
public static BufferedImage createBufferedImage (byte[] imagedata, int imageoffset,
int imagelength)
{
- BufferedImageBuilder bb = new BufferedImageBuilder ();
- GdkPixbufDecoder dec = new GdkPixbufDecoder (imagedata, imageoffset, imagelength);
- dec.startProduction (bb);
- return bb.getBufferedImage ();
+ GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(),
+ "png", // reader auto-detects, doesn't matter
+ new GdkPixbufDecoder (imagedata,
+ imageoffset,
+ imagelength));
+ return r.getBufferedImage ();
}
public static BufferedImage createBufferedImage (ImageProducer producer)
{
- BufferedImageBuilder bb = new BufferedImageBuilder ();
- producer.startProduction(bb);
- return bb.getBufferedImage ();
+ GdkPixbufReader r = new GdkPixbufReader (getReaderSpi(), "png" /* ignored */, null);
+ producer.startProduction(r);
+ return r.getBufferedImage ();
}
-
-
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java b/libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java
index 26cfc16f0da..1a456d12a3c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkTextLayout.java
@@ -1,5 +1,5 @@
/* GdkTextLayout.java
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,25 +38,24 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import gnu.classpath.Configuration;
+import gnu.java.awt.peer.ClasspathTextLayoutPeer;
+
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphMetrics;
import java.awt.font.GlyphVector;
+import java.awt.font.TextAttribute;
import java.awt.font.TextHitInfo;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;
import java.awt.geom.Rectangle2D;
-import java.text.CharacterIterator;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
-import java.util.Map;
-import java.awt.font.TextAttribute;
-
-import gnu.classpath.Configuration;
-import gnu.java.awt.peer.ClasspathTextLayoutPeer;
+import java.text.CharacterIterator;
/**
* This is an implementation of the text layout peer interface which
@@ -83,7 +82,7 @@ public class GdkTextLayout
private native void indexToPos(int idx, double[] pos);
private native void initState ();
private native void dispose ();
- native static void initStaticState ();
+ static native void initStaticState();
private final int native_state = GtkGenericPeer.getUniqueInteger ();
protected void finalize ()
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkArg.java b/libjava/gnu/java/awt/peer/gtk/GtkArg.java
deleted file mode 100644
index 0491856849c..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkArg.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* GtkArg.java
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.awt.peer.gtk;
-
-public class GtkArg
-{
- String name;
- Object value;
-
- public GtkArg (String name, Object value)
- {
- this.name = name;
- this.value = value;
- }
-
- public String getName ()
- {
- return name;
- }
-
- public Object getValue ()
- {
- return value;
- }
-}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkArgList.java b/libjava/gnu/java/awt/peer/gtk/GtkArgList.java
deleted file mode 100644
index 28cea93db4a..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkArgList.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* GtkArgList.java
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.awt.peer.gtk;
-import java.util.Vector;
-
-public class GtkArgList extends Vector
-{
- void add (GtkArg arg)
- {
- addElement (arg);
- }
-
- void add (String name, boolean value)
- {
- addElement (new GtkArg (name, Boolean.valueOf(value)));
- }
-
- void add (String name, int value)
- {
- addElement (new GtkArg (name, new Integer (value)));
- }
-
- void add (String name, float value)
- {
- addElement (new GtkArg (name, new Float (value)));
- }
-
- void add (String name, Object value)
- {
- addElement (new GtkArg (name, value));
- }
-
- synchronized void setArgs (GtkComponentPeer cp)
- {
- for (int i = 0; i < elementCount; i++)
- cp.set ((GtkArg)elementData[i]);
- }
-}
-
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
index 9fba828b74b..1ef992f02df 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
@@ -41,7 +41,6 @@ package gnu.java.awt.peer.gtk;
import java.awt.AWTEvent;
import java.awt.Button;
import java.awt.Component;
-import java.awt.Font;
import java.awt.Point;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
index adb7008ca3f..83aa98981fd 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
@@ -1,5 +1,5 @@
/* GtkCheckboxMenuItemPeer.java -- Implements CheckboxMenuItemPeer with GTK+
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,8 +39,9 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
import java.awt.CheckboxMenuItem;
+import java.awt.ItemSelectable;
+import java.awt.event.ItemEvent;
import java.awt.peer.CheckboxMenuItemPeer;
-import java.awt.peer.MenuItemPeer;
public class GtkCheckboxMenuItemPeer extends GtkMenuItemPeer
implements CheckboxMenuItemPeer
@@ -53,5 +54,16 @@ public class GtkCheckboxMenuItemPeer extends GtkMenuItemPeer
setState (menu.getState ());
}
- native public void setState (boolean t);
+ public native void setState(boolean t);
+
+ protected void postMenuActionEvent ()
+ {
+ CheckboxMenuItem item = (CheckboxMenuItem)awtWidget;
+ q().postEvent (new ItemEvent ((ItemSelectable)awtWidget,
+ ItemEvent.ITEM_STATE_CHANGED,
+ item.getActionCommand(),
+ item.getState() ? ItemEvent.DESELECTED : ItemEvent.SELECTED));
+
+ super.postMenuActionEvent();
+ }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
index a6fd1bac183..4af88f5332c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
@@ -40,8 +40,6 @@ package gnu.java.awt.peer.gtk;
import java.awt.Checkbox;
import java.awt.CheckboxGroup;
-import java.awt.Component;
-import java.awt.Font;
import java.awt.peer.CheckboxPeer;
public class GtkCheckboxPeer extends GtkComponentPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
index 05464143dcf..43e48328da3 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
@@ -1,5 +1,5 @@
/* GtkChoicePeer.java -- Implements ChoicePeer with GTK
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.AWTEvent;
import java.awt.Choice;
import java.awt.event.ItemEvent;
import java.awt.peer.ChoicePeer;
@@ -73,7 +72,7 @@ public class GtkChoicePeer extends GtkComponentPeer
native void nativeRemove (int index);
native void nativeRemoveAll ();
- native public void select (int position);
+ public native void select (int position);
public void add (String item, int index)
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
index ecc4c5cf7a1..b9cc1613b78 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java
@@ -1,5 +1,5 @@
/* GtkClipboard.java
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ public class GtkClipboard extends Clipboard
/* the number of milliseconds that we'll wait around for the
owner of the GDK_SELECTION_PRIMARY selection to convert
the requested data */
- final static int SELECTION_RECEIVED_TIMEOUT = 5000;
+ static final int SELECTION_RECEIVED_TIMEOUT = 5000;
/* We currently only support transferring of text between applications */
static String selection;
@@ -165,6 +165,6 @@ public class GtkClipboard extends Clipboard
}
native void initNativeState();
- native static void requestStringConversion();
- native static void selectionGet();
+ static native void requestStringConversion();
+ static native void selectionGet();
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index 31d59ce19b0..2625f56a008 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -1,5 +1,5 @@
/* GtkComponentPeer.java -- Implements ComponentPeer with GTK
- Copyright (C) 1998, 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,14 +47,12 @@ import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
-import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.Image;
import java.awt.Insets;
import java.awt.ItemSelectable;
-import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
@@ -83,7 +81,7 @@ public class GtkComponentPeer extends GtkGenericPeer
knows if a parent is disabled. In that case Component.isEnabled
may return true, but our isEnabled will always return false */
native boolean isEnabled ();
- native static boolean modalHasGrab ();
+ static native boolean modalHasGrab();
native int[] gtkWidgetGetForeground ();
native int[] gtkWidgetGetBackground ();
@@ -386,7 +384,7 @@ public class GtkComponentPeer extends GtkGenericPeer
if (x == 0 && y == 0 && width == 0 && height == 0)
return;
- q.postEvent (new PaintEvent (awtComponent, PaintEvent.UPDATE,
+ q().postEvent (new PaintEvent (awtComponent, PaintEvent.UPDATE,
new Rectangle (x, y, width, height)));
}
@@ -508,14 +506,14 @@ public class GtkComponentPeer extends GtkGenericPeer
protected void postMouseEvent(int id, long when, int mods, int x, int y,
int clickCount, boolean popupTrigger)
{
- q.postEvent(new MouseEvent(awtComponent, id, when, mods, x, y,
+ q().postEvent(new MouseEvent(awtComponent, id, when, mods, x, y,
clickCount, popupTrigger));
}
protected void postExposeEvent (int x, int y, int width, int height)
{
if (!isInRepaint)
- q.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
+ q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
new Rectangle (x, y, width, height)));
}
@@ -535,23 +533,23 @@ public class GtkComponentPeer extends GtkGenericPeer
{
synchronized (q)
{
- q.postEvent (keyEvent);
- q.postEvent (new KeyEvent (awtComponent, KeyEvent.KEY_TYPED, when, mods,
+ q().postEvent (keyEvent);
+ q().postEvent (new KeyEvent (awtComponent, KeyEvent.KEY_TYPED, when, mods,
KeyEvent.VK_UNDEFINED, keyChar, keyLocation));
}
}
else
- q.postEvent (keyEvent);
+ q().postEvent (keyEvent);
}
protected void postFocusEvent (int id, boolean temporary)
{
- q.postEvent (new FocusEvent (awtComponent, id, temporary));
+ q().postEvent (new FocusEvent (awtComponent, id, temporary));
}
protected void postItemEvent (Object item, int stateChange)
{
- q.postEvent (new ItemEvent ((ItemSelectable)awtComponent,
+ q().postEvent (new ItemEvent ((ItemSelectable)awtComponent,
ItemEvent.ITEM_STATE_CHANGED,
item, stateChange));
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
index 7fddd56619f..61551835ec7 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
@@ -46,7 +45,6 @@ import java.awt.Font;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Window;
-import java.awt.event.PaintEvent;
import java.awt.peer.ComponentPeer;
import java.awt.peer.ContainerPeer;
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
index af22a2723ef..9bf234404d1 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.AWTEvent;
-import java.awt.Component;
import java.awt.Dialog;
import java.awt.Graphics;
import java.awt.Rectangle;
@@ -76,7 +74,7 @@ public class GtkDialogPeer extends GtkWindowPeer
protected void postExposeEvent (int x, int y, int width, int height)
{
if (!isInRepaint)
- q.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
+ q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
new Rectangle (x + insets.left,
y + insets.top,
width, height)));
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
index 19925568e87..4281b49cc65 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
@@ -1,5 +1,5 @@
/* GtkFileDialogPeer.java -- Implements FileDialogPeer with GTK
- Copyright (C) 1998, 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,12 +38,10 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.AWTEvent;
import java.awt.Dialog;
import java.awt.FileDialog;
import java.awt.Graphics;
import java.awt.Window;
-import java.awt.event.WindowEvent;
import java.awt.peer.FileDialogPeer;
import java.io.File;
import java.io.FilenameFilter;
@@ -59,11 +57,12 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
native void create (GtkContainerPeer parent);
native void connectSignals ();
native void nativeSetFile (String file);
- native public String nativeGetDirectory();
- native public void nativeSetDirectory(String directory);
+ public native String nativeGetDirectory();
+ public native void nativeSetDirectory(String directory);
native void nativeSetFilenameFilter (FilenameFilter filter);
- public void create() {
+ public void create()
+ {
create((GtkContainerPeer) awtComponent.getParent().getPeer());
FileDialog fd = (FileDialog) awtComponent;
@@ -114,7 +113,7 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
// GtkFileChooser requires absolute filenames. If the given filename
// is not absolute, let's construct it based on current directory.
- currentFile = fileName;
+ currentFile = fileName;
if (fileName.indexOf(FS) == 0)
{
nativeSetFile (fileName);
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
index 605d738a199..e0f070368c5 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java
@@ -1,5 +1,5 @@
/* GtkFontPeer.java -- Implements FontPeer with GTK+
- Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.LineMetrics;
import java.awt.geom.Rectangle2D;
-import java.awt.peer.FontPeer;
import java.text.CharacterIterator;
import java.util.Locale;
import java.util.MissingResourceException;
@@ -68,7 +67,7 @@ public class GtkFontPeer extends ClasspathFontPeer
}
}
- final private String Xname;
+ private final String Xname;
public GtkFontPeer (String name, int style)
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
index c0c1437b656..b22a25e8869 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java
@@ -38,11 +38,8 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.Component;
-import java.awt.Container;
import java.awt.Frame;
import java.awt.Graphics;
-import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.MenuBar;
import java.awt.Rectangle;
@@ -165,7 +162,7 @@ public class GtkFramePeer extends GtkWindowPeer
setMenuBar (frame.getMenuBar ());
setTitle (frame.getTitle ());
- setResizable (frame.isResizable ());
+ gtkWindowSetResizable (frame.isResizable ());
setIconImage(frame.getIconImage());
}
@@ -237,9 +234,9 @@ public class GtkFramePeer extends GtkWindowPeer
frame_y,
frame_width,
frame_height);
- }
- awtComponent.validate();
+ awtComponent.validate();
+ }
}
protected void postMouseEvent(int id, long when, int mods, int x, int y,
@@ -253,7 +250,7 @@ public class GtkFramePeer extends GtkWindowPeer
protected void postExposeEvent (int x, int y, int width, int height)
{
if (!isInRepaint)
- q.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
+ q().postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
new Rectangle (x + insets.left,
y + insets.top,
width, height)));
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
index 657e830bf2e..f161526f647 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
import java.awt.EventQueue;
+import java.awt.Toolkit;
import java.awt.event.ActionEvent;
public class GtkGenericPeer
@@ -57,6 +58,11 @@ public class GtkGenericPeer
// Dispose of our native state.
public native void dispose ();
+ static EventQueue q ()
+ {
+ return Toolkit.getDefaultToolkit ().getSystemEventQueue ();
+ }
+
protected GtkGenericPeer (Object awtWidget)
{
this.awtWidget = awtWidget;
@@ -70,7 +76,7 @@ public class GtkGenericPeer
protected void postActionEvent (String command, int mods)
{
- q.postEvent (new ActionEvent (awtWidget, ActionEvent.ACTION_PERFORMED,
+ q().postEvent (new ActionEvent (awtWidget, ActionEvent.ACTION_PERFORMED,
command, mods));
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
index 25473d78ea2..02251632b1a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
@@ -1,5 +1,5 @@
/* GtkLabelPeer.java -- Implements LabelPeer with GTK
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,8 +38,6 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.Component;
-import java.awt.Font;
import java.awt.Label;
import java.awt.peer.LabelPeer;
@@ -50,7 +48,7 @@ public class GtkLabelPeer extends GtkComponentPeer
native void gtkWidgetModifyFont (String name, int style, int size);
native void nativeSetAlignment (float alignment);
- native public void setText (String text);
+ public native void setText(String text);
native void setNativeBounds (int x, int y, int width, int height);
void create ()
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMainThread.java b/libjava/gnu/java/awt/peer/gtk/GtkMainThread.java
deleted file mode 100644
index 4cbe190731c..00000000000
--- a/libjava/gnu/java/awt/peer/gtk/GtkMainThread.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/* GtkMainThread.java -- Runs gtk_main()
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.awt.peer.gtk;
-
-public class GtkMainThread extends GtkGenericPeer implements Runnable
-{
- private static Thread mainThread = null;
- private static Object mainThreadLock = new Object();
-
- // Whether the gtk+ subsystem has been initialized.
- private boolean gtkInitCalled = false;
-
- /**
- * Call gtk_init. It is very important that this happen before any other
- * gtk calls.
- *
- * @param portableNativeSync 1 if the Java property
- * gnu.classpath.awt.gtk.portable.native.sync is set to "true". 0 if it is
- * set to "false". -1 if unset.
- */
- static native void gtkInit(int portableNativeSync);
- native void gtkMain();
-
- public GtkMainThread()
- {
- super (null);
- synchronized (mainThreadLock)
- {
- if (mainThread != null)
- throw new IllegalStateException();
- mainThread = new Thread(this, "GtkMain");
- }
-
- synchronized (this)
- {
- mainThread.start();
-
- while (!gtkInitCalled)
- {
- try
- {
- wait();
- }
- catch (InterruptedException e) { }
- }
- }
- }
-
- public void run()
- {
- /* Pass the value of the gnu.classpath.awt.gtk.portable.native.sync system
- * property to C. */
- int portableNativeSync;
- String portNatSyncProp =
- System.getProperty("gnu.classpath.awt.gtk.portable.native.sync");
-
- if (portNatSyncProp == null)
- portableNativeSync = -1; // unset
- else if (Boolean.valueOf(portNatSyncProp).booleanValue())
- portableNativeSync = 1; // true
- else
- portableNativeSync = 0; // false
-
- synchronized (this)
- {
- gtkInit(portableNativeSync);
- gtkInitCalled = true;
- notifyAll();
- }
- gtkMain();
- }
-}
-
-
-
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
index 90ad0c01b59..4b547f56afb 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
@@ -1,5 +1,5 @@
/* GtkMenuBarPeer.java -- Implements MenuBarPeer with GTK+
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -76,5 +76,5 @@ public class GtkMenuBarPeer extends GtkMenuComponentPeer
// nativeSetHelpMenu((MenuPeer) menu.getPeer());
}
- native public void delMenu (int index);
+ public native void delMenu(int index);
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
index dd061ed37b8..cd7ca8ac79b 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.Font;
-import java.awt.MenuComponent;
import java.awt.peer.MenuComponentPeer;
public class GtkMenuComponentPeer extends GtkGenericPeer
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
index 81da90df012..f85648ee89c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
@@ -1,5 +1,5 @@
/* GtkMenuItemPeer.java -- Implements MenuItemPeer with GTK+
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,11 +40,9 @@ package gnu.java.awt.peer.gtk;
import java.awt.Font;
import java.awt.Menu;
-import java.awt.MenuComponent;
import java.awt.MenuBar;
+import java.awt.MenuComponent;
import java.awt.MenuItem;
-import java.awt.peer.MenuBarPeer;
-import java.awt.peer.MenuComponentPeer;
import java.awt.peer.MenuItemPeer;
import java.awt.peer.MenuPeer;
@@ -111,9 +109,9 @@ public class GtkMenuItemPeer extends GtkMenuComponentPeer
setEnabled (true);
}
- native public void setEnabled (boolean b);
+ public native void setEnabled(boolean b);
- native public void setLabel (String label);
+ public native void setLabel(String label);
protected void postMenuActionEvent ()
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
index dc170b1cf12..971a349d26e 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java
@@ -1,5 +1,5 @@
/* GtkMenuPeer.java -- Implements MenuPeer with GTK+
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,8 +43,8 @@ import java.awt.Menu;
import java.awt.MenuContainer;
import java.awt.MenuItem;
import java.awt.MenuShortcut;
-import java.awt.peer.MenuPeer;
import java.awt.peer.MenuItemPeer;
+import java.awt.peer.MenuPeer;
public class GtkMenuPeer extends GtkMenuItemPeer
implements MenuPeer
@@ -99,5 +99,5 @@ public class GtkMenuPeer extends GtkMenuItemPeer
addItem (item, key, shiftModifier);
}
- native public void delItem (int index);
+ public native void delItem(int index);
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
index 233bed75a9b..ae337a0714f 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java
@@ -1,5 +1,5 @@
/* GtkScrollPanePeer.java -- Implements ScrollPanePeer with GTK
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,6 @@ package gnu.java.awt.peer.gtk;
import java.awt.Adjustable;
import java.awt.Dimension;
import java.awt.ScrollPane;
-import java.awt.peer.ComponentPeer;
import java.awt.peer.ScrollPanePeer;
public class GtkScrollPanePeer extends GtkContainerPeer
@@ -84,9 +83,9 @@ public class GtkScrollPanePeer extends GtkContainerPeer
setPolicy (((ScrollPane) awtComponent).getScrollbarDisplayPolicy ());
}
- native public int getHScrollbarHeight ();
- native public int getVScrollbarWidth ();
- native public void setScrollPosition (int x, int y);
+ public native int getHScrollbarHeight();
+ public native int getVScrollbarWidth();
+ public native void setScrollPosition(int x, int y);
public Dimension getPreferredSize ()
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
index ef4289633c4..065bab12e1d 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
@@ -1,5 +1,5 @@
/* GtkScrollbarPeer.java -- Implements ScrollbarPeer with GTK+
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,13 +67,13 @@ public class GtkScrollbarPeer extends GtkComponentPeer
super (s);
}
- native public void setLineIncrement (int amount);
- native public void setPageIncrement (int amount);
- native public void setValues (int value, int visible, int min, int max);
+ public native void setLineIncrement(int amount);
+ public native void setPageIncrement(int amount);
+ public native void setValues(int value, int visible, int min, int max);
protected void postAdjustmentEvent (int type, int value)
{
- q.postEvent (new AdjustmentEvent ((Adjustable)awtComponent,
+ q().postEvent (new AdjustmentEvent ((Adjustable)awtComponent,
AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
type, value));
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
index 8893e36e838..3051ecfcfa8 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
@@ -38,11 +38,8 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
-import java.awt.AWTEvent;
-import java.awt.Component;
import java.awt.Rectangle;
import java.awt.TextComponent;
-import java.awt.event.KeyEvent;
import java.awt.event.TextEvent;
import java.awt.peer.TextComponentPeer;
@@ -85,6 +82,6 @@ public class GtkTextComponentPeer extends GtkComponentPeer
protected void postTextEvent ()
{
- q.postEvent (new TextEvent (awtComponent, TextEvent.TEXT_VALUE_CHANGED));
+ q().postEvent (new TextEvent (awtComponent, TextEvent.TEXT_VALUE_CHANGED));
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
index def22e9874e..58987ee2a22 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -1,5 +1,5 @@
/* GtkToolkit.java -- Implements an AWT Toolkit using GTK for peers
- Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,14 +44,12 @@ import gnu.java.awt.EmbeddedWindowSupport;
import gnu.java.awt.peer.ClasspathFontPeer;
import gnu.java.awt.peer.ClasspathTextLayoutPeer;
import gnu.java.awt.peer.EmbeddedWindowPeer;
-import gnu.java.awt.peer.gtk.GdkPixbufDecoder;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.peer.DragSourceContextPeer;
import java.awt.font.FontRenderContext;
-import java.awt.font.TextAttribute;
import java.awt.im.InputMethodHighlight;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
@@ -59,16 +57,19 @@ import java.awt.image.ImageConsumer;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.peer.*;
+import java.io.InputStream;
import java.net.URL;
import java.text.AttributedString;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.MissingResourceException;
import java.util.Properties;
+import javax.imageio.spi.IIORegistry;
+
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer().
This merits comment. We are basically calling Sun's bluff on this one.
We think Sun has deprecated it simply to discourage its use as it is
@@ -86,9 +87,8 @@ import java.util.Properties;
public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
implements EmbeddedWindowSupport
{
- GtkMainThread main;
Hashtable containers = new Hashtable();
- static EventQueue q = new EventQueue();
+ static EventQueue q;
static Clipboard systemClipboard;
static boolean useGraphics2dSet;
static boolean useGraphics2d;
@@ -103,21 +103,34 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
return useGraphics2d;
}
+ static native void gtkInit(int portableNativeSync);
+
static
{
if (Configuration.INIT_LOAD_LIBRARY)
System.loadLibrary("gtkpeer");
+
+ int portableNativeSync;
+ String portNatSyncProp =
+ System.getProperty("gnu.classpath.awt.gtk.portable.native.sync");
+
+ if (portNatSyncProp == null)
+ portableNativeSync = -1; // unset
+ else if (Boolean.valueOf(portNatSyncProp).booleanValue())
+ portableNativeSync = 1; // true
+ else
+ portableNativeSync = 0; // false
+
+ gtkInit(portableNativeSync);
}
public GtkToolkit ()
{
- main = new GtkMainThread ();
systemClipboard = new GtkClipboard ();
- GtkGenericPeer.enableQueue (q);
}
-
- native public void beep ();
- native private void getScreenSizeDimensions (int[] xy);
+
+ public native void beep();
+ private native void getScreenSizeDimensions(int[] xy);
public int checkImage (Image image, int width, int height,
ImageObserver observer)
@@ -313,7 +326,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
"SansSerif" });
}
- private class LRUCache extends java.util.LinkedHashMap
+ private class LRUCache extends LinkedHashMap
{
int max_entries;
public LRUCache(int max)
@@ -333,15 +346,18 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
public FontMetrics getFontMetrics (Font font)
{
- if (metricsCache.containsKey(font))
- return (FontMetrics) metricsCache.get(font);
- else
+ synchronized (metricsCache)
+ {
+ if (metricsCache.containsKey(font))
+ return (FontMetrics) metricsCache.get(font);
+ }
+
+ FontMetrics m = new GdkFontMetrics (font);
+ synchronized (metricsCache)
{
- FontMetrics m;
- m = new GdkFontMetrics (font);
metricsCache.put(font, m);
- return m;
- }
+ }
+ return m;
}
public Image getImage (String filename)
@@ -373,9 +389,10 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
return null;
}
- native public int getScreenResolution();
+ public native int getScreenResolution();
- public Dimension getScreenSize () {
+ public Dimension getScreenSize ()
+ {
int dim[] = new int[2];
getScreenSizeDimensions(dim);
return new Dimension(dim[0], dim[1]);
@@ -414,7 +431,7 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
return false;
}
- native public void sync ();
+ public native void sync();
protected void setComponentState (Component c, GtkComponentPeer cp)
{
@@ -594,6 +611,14 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
protected EventQueue getSystemEventQueueImpl()
{
+ synchronized (GtkToolkit.class)
+ {
+ if (q == null)
+ {
+ q = new EventQueue();
+ GtkGenericPeer.enableQueue (q);
+ }
+ }
return q;
}
@@ -609,19 +634,37 @@ public class GtkToolkit extends gnu.java.awt.ClasspathToolkit
throw new Error("not implemented");
}
+ public Rectangle getBounds()
+ {
+ int[] dims = new int[2];
+ getScreenSizeDimensions(dims);
+ return new Rectangle(0, 0, dims[0], dims[1]);
+ }
+
// ClasspathToolkit methods
public GraphicsEnvironment getLocalGraphicsEnvironment()
{
- GraphicsEnvironment ge;
- ge = new GdkGraphicsEnvironment ();
- return ge;
+ return new GdkGraphicsEnvironment(this);
+ }
+
+ public Font createFont(int format, InputStream stream)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public RobotPeer createRobot (GraphicsDevice screen) throws AWTException
+ {
+ return new GdkRobotPeer (screen);
}
- public Font createFont(int format, java.io.InputStream stream)
+ public void registerImageIOSpis(IIORegistry reg)
{
- throw new java.lang.UnsupportedOperationException ();
+ GdkPixbufDecoder.registerSpis(reg);
}
+ public native boolean nativeQueueEmpty();
+ public native void wakeNativeQueue();
+ public native void iterateNativeQueue(EventQueue locked, boolean block);
} // class GtkToolkit
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
index c61eecd5aa5..eabe59140a6 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
@@ -1,5 +1,5 @@
/* GtkWindowPeer.java -- Implements WindowPeer with GTK
- Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,6 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
import java.awt.Component;
-import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Window;
import java.awt.event.WindowEvent;
@@ -48,14 +47,14 @@ import java.awt.peer.WindowPeer;
public class GtkWindowPeer extends GtkContainerPeer
implements WindowPeer
{
- static protected final int GDK_WINDOW_TYPE_HINT_NORMAL = 0;
- static protected final int GDK_WINDOW_TYPE_HINT_DIALOG = 1;
- static protected final int GDK_WINDOW_TYPE_HINT_MENU = 2;
- static protected final int GDK_WINDOW_TYPE_HINT_TOOLBAR = 3;
- static protected final int GDK_WINDOW_TYPE_HINT_SPLASHSCREEN = 4;
- static protected final int GDK_WINDOW_TYPE_HINT_UTILITY = 5;
- static protected final int GDK_WINDOW_TYPE_HINT_DOCK = 6;
- static protected final int GDK_WINDOW_TYPE_HINT_DESKTOP = 7;
+ protected static final int GDK_WINDOW_TYPE_HINT_NORMAL = 0;
+ protected static final int GDK_WINDOW_TYPE_HINT_DIALOG = 1;
+ protected static final int GDK_WINDOW_TYPE_HINT_MENU = 2;
+ protected static final int GDK_WINDOW_TYPE_HINT_TOOLBAR = 3;
+ protected static final int GDK_WINDOW_TYPE_HINT_SPLASHSCREEN = 4;
+ protected static final int GDK_WINDOW_TYPE_HINT_UTILITY = 5;
+ protected static final int GDK_WINDOW_TYPE_HINT_DOCK = 6;
+ protected static final int GDK_WINDOW_TYPE_HINT_DESKTOP = 7;
private boolean hasBeenShown = false;
private int oldState = Frame.NORMAL;
@@ -64,30 +63,27 @@ public class GtkWindowPeer extends GtkContainerPeer
native void gtkWindowSetResizable (boolean resizable);
native void gtkWindowSetModal (boolean modal);
- native void create (int type, boolean decorated,
- int width, int height,
- GtkWindowPeer parent,
- int[] insets);
+ int getWidth ()
+ {
+ return awtComponent.getWidth();
+ }
+
+ int getHeight ()
+ {
+ return awtComponent.getHeight();
+ }
+
+ native void create (int type, boolean decorated, GtkWindowPeer parent);
void create (int type, boolean decorated)
{
GtkWindowPeer parent_peer = null;
Component parent = awtComponent.getParent();
- int[] insets = new int [] { 0, 0, 0, 0 };
if (parent != null)
parent_peer = (GtkWindowPeer) awtComponent.getParent().getPeer();
- create (type, decorated,
- awtComponent.getWidth(),
- awtComponent.getHeight(),
- parent_peer,
- insets);
-
- this.insets.top = insets [0];
- this.insets.left = insets [1];
- this.insets.bottom = insets [2];
- this.insets.right = insets [3];
+ create (type, decorated, parent_peer);
}
void create ()
@@ -113,8 +109,8 @@ public class GtkWindowPeer extends GtkContainerPeer
super (window);
}
- native public void toBack ();
- native public void toFront ();
+ public native void toBack();
+ public native void toFront();
native void nativeSetBounds (int x, int y, int width, int height);
@@ -166,10 +162,12 @@ public class GtkWindowPeer extends GtkContainerPeer
|| frame_y != awtComponent.getY()
|| frame_width != awtComponent.getWidth()
|| frame_height != awtComponent.getHeight())
- setBoundsCallback ((Window) awtComponent,
- frame_x, frame_y, frame_width, frame_height);
+ {
+ setBoundsCallback ((Window) awtComponent,
+ frame_x, frame_y, frame_width, frame_height);
- awtComponent.validate();
+ awtComponent.validate();
+ }
}
native void nativeSetVisible (boolean b);
@@ -192,7 +190,7 @@ public class GtkWindowPeer extends GtkContainerPeer
// Post a WINDOW_OPENED event the first time this window is shown.
if (!hasBeenShown)
{
- q.postEvent (new WindowEvent ((Window) awtComponent, id,
+ q().postEvent (new WindowEvent ((Window) awtComponent, id,
opposite));
hasBeenShown = true;
}
@@ -201,12 +199,12 @@ public class GtkWindowPeer extends GtkContainerPeer
{
if (oldState != newState)
{
- q.postEvent (new WindowEvent ((Window) awtComponent, id, opposite,
+ q().postEvent (new WindowEvent ((Window) awtComponent, id, opposite,
oldState, newState));
oldState = newState;
}
}
else
- q.postEvent (new WindowEvent ((Window) awtComponent, id, opposite));
+ q().postEvent (new WindowEvent ((Window) awtComponent, id, opposite));
}
}
diff --git a/libjava/gnu/java/beans/EmptyBeanInfo.java b/libjava/gnu/java/beans/EmptyBeanInfo.java
deleted file mode 100644
index 97cdf0a0eb5..00000000000
--- a/libjava/gnu/java/beans/EmptyBeanInfo.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* gnu.java.beans.EmptyBeanInfo
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.beans;
-
-import java.beans.*;
-
-/**
- ** EmptyBeanInfo is a BeanInfo that discloses no
- ** information about the Bean and does not allow
- ** Introspection. The Introspector uses instances of this
- ** class to create empty BeanInfos, but it could also be
- ** used as a base class for BeanInfos that do not allow
- ** Introspection and provide only a little bit of
- ** information.<P>
- **
- ** @author John Keiser
- ** @version 1.1.0, 30 Jul 1998
- ** @see gnu.java.beans.ExplicitBeanInfo
- ** @see java.beans.BeanInfo
- **/
-
-public class EmptyBeanInfo extends ExplicitBeanInfo {
- /** Create a new EmptyBeanInfo. **/
- public EmptyBeanInfo(Class beanClass) {
- super(new BeanDescriptor(beanClass,null),
- new BeanInfo[0],
- new PropertyDescriptor[0],
- -1,
- new EventSetDescriptor[0],
- -1,
- new MethodDescriptor[0],
- null);
- }
-}
diff --git a/libjava/gnu/java/beans/IntrospectionIncubator.java b/libjava/gnu/java/beans/IntrospectionIncubator.java
index ac08f7ae5cd..21bf984d24c 100644
--- a/libjava/gnu/java/beans/IntrospectionIncubator.java
+++ b/libjava/gnu/java/beans/IntrospectionIncubator.java
@@ -99,8 +99,7 @@ public class IntrospectionIncubator {
* @param method The method instance to examine.
*/
public void addMethod(Method method) {
- if(Modifier.isPublic(method.getModifiers()) &&
- !Modifier.isStatic(method.getModifiers())) {
+ if(Modifier.isPublic(method.getModifiers())) {
String name = ClassHelper.getTruncatedName(method.getName());
Class retType = method.getReturnType();
Class[] params = method.getParameterTypes();
diff --git a/libjava/gnu/java/beans/info/ComponentBeanInfo.java b/libjava/gnu/java/beans/info/ComponentBeanInfo.java
deleted file mode 100644
index 877a18d65d2..00000000000
--- a/libjava/gnu/java/beans/info/ComponentBeanInfo.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* gnu.java.beans.info.ComponentBeanInfo
- Copyright (C) 1998 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.beans.info;
-
-import java.beans.IntrospectionException;
-import java.beans.PropertyDescriptor;
-import java.beans.SimpleBeanInfo;
-
-/** BeanInfo class for java.awt.Component.
- ** This provides a few properties, but that's
- ** it.
- ** @author John Keiser
- ** @version 1.1.0, Aug 1 1998
- **/
-public class ComponentBeanInfo extends SimpleBeanInfo {
- static PropertyDescriptor[] properties;
- static {
- try {
- properties = new PropertyDescriptor[6];
- properties[0] = new PropertyDescriptor("name",java.awt.Component.class);
- properties[1] = new PropertyDescriptor("background",java.awt.Component.class);
- properties[2] = new PropertyDescriptor("foreground",java.awt.Component.class);
- properties[3] = new PropertyDescriptor("font",java.awt.Component.class);
- properties[4] = new PropertyDescriptor("enabled",java.awt.Component.class);
- properties[5] = new PropertyDescriptor("visible",java.awt.Component.class);
- } catch(IntrospectionException E) {
- properties = null;
- throw new UnknownError("Could not introspect some java.awt.Component properties.");
- }
- }
- public ComponentBeanInfo() {
- super();
- }
-
- public PropertyDescriptor[] getPropertyDescriptors() {
- return properties;
- }
-}
-
diff --git a/libjava/gnu/java/io/Base64InputStream.java b/libjava/gnu/java/io/Base64InputStream.java
index 3780e952837..617e8315102 100644
--- a/libjava/gnu/java/io/Base64InputStream.java
+++ b/libjava/gnu/java/io/Base64InputStream.java
@@ -1,5 +1,5 @@
/* Base64InputStream.java -- base-64 input stream.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.java.io;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -90,6 +92,30 @@ public class Base64InputStream extends FilterInputStream
eof = false;
}
+ // Class method.
+ // ------------------------------------------------------------------------
+
+ /**
+ * Decode a single Base-64 string to a byte array.
+ *
+ * @param base64 The Base-64 encoded data.
+ * @return The decoded bytes.
+ * @throws IOException If the given data do not compose a valid Base-64
+ * sequence.
+ */
+ public static byte[] decode(String base64) throws IOException
+ {
+ Base64InputStream in =
+ new Base64InputStream(new ByteArrayInputStream(base64.getBytes()));
+ ByteArrayOutputStream out =
+ new ByteArrayOutputStream((int) (base64.length() / 0.666));
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) != -1)
+ out.write(buf, 0, len);
+ return out.toByteArray();
+ }
+
// Instance methods.
// ------------------------------------------------------------------------
diff --git a/libjava/gnu/java/lang/MainThread.java b/libjava/gnu/java/lang/MainThread.java
index 5937b870d3e..14a00ca8d9b 100644
--- a/libjava/gnu/java/lang/MainThread.java
+++ b/libjava/gnu/java/lang/MainThread.java
@@ -95,7 +95,9 @@ final class MainThread extends Thread
}
catch (ClassNotFoundException x)
{
- throw new NoClassDefFoundError(klass_name);
+ NoClassDefFoundError ncdfe = new NoClassDefFoundError(klass_name);
+ ncdfe.initCause(x);
+ throw ncdfe;
}
}
diff --git a/libjava/gnu/java/locale/LocaleInformation_en.java b/libjava/gnu/java/locale/LocaleInformation_en.java
index aa35091a526..df258095c1b 100644
--- a/libjava/gnu/java/locale/LocaleInformation_en.java
+++ b/libjava/gnu/java/locale/LocaleInformation_en.java
@@ -159,7 +159,7 @@ public class LocaleInformation_en extends ListResourceBundle
{ "shortWeekdays", shortWeekdays },
{ "ampms", ampms },
{ "eras", eras },
- { "localPatternChars", "GyMdkHmsSEDFwWahKz" },
+ { "localPatternChars", "GyMdkHmsSEDFwWahKzYeugAZ" },
{ "zoneStrings", zoneStrings },
{ "shortDateFormat", "M/d/yy" }, // Java's Y2K bug.
diff --git a/libjava/gnu/java/net/PlainSocketImpl.java b/libjava/gnu/java/net/PlainSocketImpl.java
index 4301a485cf3..f7e6cb89052 100644
--- a/libjava/gnu/java/net/PlainSocketImpl.java
+++ b/libjava/gnu/java/net/PlainSocketImpl.java
@@ -1,5 +1,5 @@
/* PlainSocketImpl.java -- Default socket implementation
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -200,8 +200,20 @@ public final class PlainSocketImpl extends SocketImpl
*/
public native Object getOption(int optID) throws SocketException;
+ /**
+ * Flushes the input stream and closes it. If you read from the input stream
+ * after calling this method a <code>IOException</code> will be thrown.
+ *
+ * @throws IOException if an error occurs
+ */
public native void shutdownInput() throws IOException;
+ /**
+ * Flushes the output stream and closes it. If you write to the output stream
+ * after calling this method a <code>IOException</code> will be thrown.
+ *
+ * @throws IOException if an error occurs
+ */
public native void shutdownOutput() throws IOException;
/**
diff --git a/libjava/gnu/java/net/protocol/http/Cookie.java b/libjava/gnu/java/net/protocol/http/Cookie.java
index fc4fde4f0dd..452ca0f7ad1 100644
--- a/libjava/gnu/java/net/protocol/http/Cookie.java
+++ b/libjava/gnu/java/net/protocol/http/Cookie.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.java.net.protocol.http;
-import java.text.ParseException;
import java.util.Date;
/**
diff --git a/libjava/gnu/java/net/protocol/http/HTTPConnection.java b/libjava/gnu/java/net/protocol/http/HTTPConnection.java
index 00cb7036c75..a3f14b51012 100644
--- a/libjava/gnu/java/net/protocol/http/HTTPConnection.java
+++ b/libjava/gnu/java/net/protocol/http/HTTPConnection.java
@@ -54,12 +54,10 @@ import java.net.InetSocketAddress;
import java.net.Socket;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import javax.net.SocketFactory;
import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
diff --git a/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java b/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java
index 22ef05631e9..0137596aa74 100644
--- a/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java
+++ b/libjava/gnu/java/net/protocol/http/HTTPDateFormat.java
@@ -38,9 +38,15 @@ exception statement from your version. */
package gnu.java.net.protocol.http;
-import java.io.PrintStream;
-import java.text.*;
-import java.util.*;
+import java.text.DateFormat;
+import java.text.DecimalFormat;
+import java.text.FieldPosition;
+import java.text.NumberFormat;
+import java.text.ParsePosition;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
/**
* HTTP date formatter and parser.
diff --git a/libjava/gnu/java/net/protocol/http/Request.java b/libjava/gnu/java/net/protocol/http/Request.java
index 123e889c065..62a1a535a12 100644
--- a/libjava/gnu/java/net/protocol/http/Request.java
+++ b/libjava/gnu/java/net/protocol/http/Request.java
@@ -46,7 +46,6 @@ import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.ProtocolException;
-import java.net.Socket;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
diff --git a/libjava/gnu/java/net/protocol/jar/Connection.java b/libjava/gnu/java/net/protocol/jar/Connection.java
index 9ba2e3fd1ff..1d27e4436ae 100644
--- a/libjava/gnu/java/net/protocol/jar/Connection.java
+++ b/libjava/gnu/java/net/protocol/jar/Connection.java
@@ -1,5 +1,5 @@
/* Connection - jar url connection for java.net
- Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -222,9 +222,8 @@ public final class Connection extends JarURLConnection
fos.write(buf, 0, len);
fos.close();
// Always verify the Manifest, open read only and delete when done.
- // XXX ZipFile.OPEN_DELETE not yet implemented.
- // jf = new JarFile(f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
- jar_file = new JarFile (f, true, ZipFile.OPEN_READ);
+ jar_file = new JarFile (f, true,
+ ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
}
return jar_file;
diff --git a/libjava/gnu/java/nio/PipeImpl.java b/libjava/gnu/java/nio/PipeImpl.java
index df79e17fd2b..ca374c52ff1 100644
--- a/libjava/gnu/java/nio/PipeImpl.java
+++ b/libjava/gnu/java/nio/PipeImpl.java
@@ -1,5 +1,5 @@
/* PipeImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -79,7 +79,8 @@ class PipeImpl extends Pipe
return read (srcs, 0, srcs.length);
}
- public synchronized final long read (ByteBuffer[] srcs, int offset, int len)
+ public final synchronized long read (ByteBuffer[] srcs, int offset,
+ int len)
throws IOException
{
if (offset < 0
@@ -138,7 +139,7 @@ class PipeImpl extends Pipe
return write (srcs, 0, srcs.length);
}
- public synchronized final long write (ByteBuffer[] srcs, int offset, int len)
+ public final synchronized long write (ByteBuffer[] srcs, int offset, int len)
throws IOException
{
if (offset < 0
diff --git a/libjava/gnu/java/nio/SelectorImpl.java b/libjava/gnu/java/nio/SelectorImpl.java
index 62d06624616..f64c86d1f54 100644
--- a/libjava/gnu/java/nio/SelectorImpl.java
+++ b/libjava/gnu/java/nio/SelectorImpl.java
@@ -1,5 +1,5 @@
/* SelectorImpl.java --
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package gnu.java.nio;
import java.io.IOException;
@@ -49,11 +50,9 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
-import gnu.classpath.Configuration;
public class SelectorImpl extends AbstractSelector
{
-
private Set keys;
private Set selected;
@@ -375,24 +374,13 @@ public class SelectorImpl extends AbstractSelector
SelectionKeyImpl result;
if (ch instanceof SocketChannelImpl)
- {
- SocketChannelImpl sc = (SocketChannelImpl) ch;
- result = new SocketChannelSelectionKey (ch, this);
- }
+ result = new SocketChannelSelectionKey (ch, this);
else if (ch instanceof DatagramChannelImpl)
- {
- DatagramChannelImpl dc = (DatagramChannelImpl) ch;
- result = new DatagramChannelSelectionKey (ch, this);
- }
+ result = new DatagramChannelSelectionKey (ch, this);
else if (ch instanceof ServerSocketChannelImpl)
- {
- ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch;
- result = new ServerSocketChannelSelectionKey (ch, this);
- }
+ result = new ServerSocketChannelSelectionKey (ch, this);
else
- {
- throw new InternalError ("No known channel type");
- }
+ throw new InternalError ("No known channel type");
synchronized (keys)
{
diff --git a/libjava/gnu/java/nio/channels/FileChannelImpl.java b/libjava/gnu/java/nio/channels/FileChannelImpl.java
index 678e10f2349..887d1dcc396 100644
--- a/libjava/gnu/java/nio/channels/FileChannelImpl.java
+++ b/libjava/gnu/java/nio/channels/FileChannelImpl.java
@@ -1,5 +1,5 @@
/* FileChannelImpl.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -192,6 +192,7 @@ public final class FileChannelImpl extends FileChannel
{
byte[] buffer = src.array();
write(buffer, src.arrayOffset() + src.position(), len);
+ src.position(src.position() + len);
}
else
{
diff --git a/libjava/gnu/java/nio/charset/ISO_8859_1.java b/libjava/gnu/java/nio/charset/ISO_8859_1.java
index a7fcb636353..45fe5cc6fba 100644
--- a/libjava/gnu/java/nio/charset/ISO_8859_1.java
+++ b/libjava/gnu/java/nio/charset/ISO_8859_1.java
@@ -1,5 +1,5 @@
/* ISO_8859_1.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,28 @@ final class ISO_8859_1 extends Charset
{
ISO_8859_1 ()
{
- super ("ISO-8859-1", new String[]{"ISO-LATIN-1"});
+ /* Canonical charset name chosen according to:
+ * http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
+ */
+ super ("ISO-8859-1", new String[] {
+ /* These names are provided by
+ * http://www.iana.org/assignments/character-sets
+ */
+ "iso-ir-100",
+ "ISO_8859-1",
+ "latin1",
+ "l1",
+ "IBM819",
+ "CP819",
+ "csISOLatin1",
+ "8859_1",
+ /* These names are provided by
+ * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
+ */
+ "ISO8859_1", "ISO_8859_1", "ibm-819", "ISO_8859-1:1987",
+ "819"
+ });
+
}
public boolean contains (Charset cs)
diff --git a/libjava/gnu/java/nio/charset/Provider.java b/libjava/gnu/java/nio/charset/Provider.java
index 13f637113e5..1a5606813cb 100644
--- a/libjava/gnu/java/nio/charset/Provider.java
+++ b/libjava/gnu/java/nio/charset/Provider.java
@@ -1,5 +1,5 @@
/* Provider.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,6 +48,7 @@ import java.util.Iterator;
* {@link Charset#charsetForName} and * {@link Charset#availableCharsets}.
*
* @author Jesse Rosenstock
+ * @author Robert Schuster (thebohemian@gmx.net)
* @see Charset
*/
public final class Provider extends CharsetProvider
@@ -63,12 +64,14 @@ public final class Provider extends CharsetProvider
}
/**
- * Map from charset name to charset canonical name.
+ * Map from charset name to charset canonical name. The strings
+ * are all lower-case to allow case-insensitive retrieval of
+ * Charset instances.
*/
private final HashMap canonicalNames;
/**
- * Map from canonical name to Charset.
+ * Map from lower-case canonical name to Charset.
* TODO: We may want to use soft references. We would then need to keep
* track of the class name to regenerate the object.
*/
@@ -76,8 +79,6 @@ public final class Provider extends CharsetProvider
private Provider ()
{
- // FIXME: We might need to make the name comparison case insensitive.
- // Verify this with the Sun JDK.
canonicalNames = new HashMap ();
charsets = new HashMap ();
@@ -106,24 +107,42 @@ public final class Provider extends CharsetProvider
.iterator ();
}
+ /**
+ * Returns a Charset instance by converting the given
+ * name to lower-case, looking up the canonical charset
+ * name and finally looking up the Charset with that name.
+ *
+ * <p>The lookup is therefore case-insensitive.</p>
+ *
+ * @returns The Charset having <code>charsetName</code>
+ * as its alias or null if no such Charset exist.
+ */
public Charset charsetForName (String charsetName)
{
- return (Charset) charsets.get (canonicalize (charsetName));
- }
-
- private Object canonicalize (String charsetName)
- {
- Object o = canonicalNames.get (charsetName);
- return o == null ? charsetName : o;
+ return (Charset) charsets.get(canonicalNames.get(charsetName.toLowerCase()));
}
+ /**
+ * Puts a Charset under its canonical name into the 'charsets' map.
+ * Then puts a mapping from all its alias names to the canonical name.
+ *
+ * <p>All names are converted to lower-case</p>.
+ *
+ * @param cs
+ */
private void addCharset (Charset cs)
{
- String canonicalName = cs.name ();
+ String canonicalName = cs.name().toLowerCase();
charsets.put (canonicalName, cs);
+
+ /* Adds a mapping between the canonical name
+ * itself making a lookup using that name
+ * no special case.
+ */
+ canonicalNames.put(canonicalName, canonicalName);
for (Iterator i = cs.aliases ().iterator (); i.hasNext (); )
- canonicalNames.put (i.next (), canonicalName);
+ canonicalNames.put (((String) i.next()).toLowerCase(), canonicalName);
}
public static synchronized Provider provider ()
diff --git a/libjava/gnu/java/nio/charset/US_ASCII.java b/libjava/gnu/java/nio/charset/US_ASCII.java
index 9efb8ecf6f8..f2c66960b6d 100644
--- a/libjava/gnu/java/nio/charset/US_ASCII.java
+++ b/libjava/gnu/java/nio/charset/US_ASCII.java
@@ -1,5 +1,5 @@
/* US_ASCII.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,29 @@ final class US_ASCII extends Charset
{
US_ASCII ()
{
- super ("US-ASCII", new String[]{"ISO646-US"});
+ /* Canonical charset name chosen according to:
+ * http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
+ */
+ super ("US-ASCII", new String[] {
+ /* These names are provided by
+ * http://www.iana.org/assignments/character-sets
+ */
+ "iso-ir-6",
+ "ANSI_X3.4-1986",
+ "ISO_646.irv:1991",
+ "ASCII",
+ "ISO646-US",
+ "ASCII",
+ "us",
+ "IBM367",
+ "cp367",
+ "csASCII",
+ /* These names are provided by
+ * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
+ */
+ "ANSI_X3.4-1968", "iso_646.irv:1983", "ascii7", "646",
+ "windows-20127"
+ });
}
public boolean contains (Charset cs)
diff --git a/libjava/gnu/java/nio/charset/UTF_16.java b/libjava/gnu/java/nio/charset/UTF_16.java
index aebd14608bd..1737101d75d 100644
--- a/libjava/gnu/java/nio/charset/UTF_16.java
+++ b/libjava/gnu/java/nio/charset/UTF_16.java
@@ -1,5 +1,5 @@
/* UTF_16.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,14 @@ final class UTF_16 extends Charset
{
UTF_16 ()
{
- super ("UTF-16", null);
+ super ("UTF-16", new String[] {
+ // witnessed by the internet
+ "UTF16",
+ /* These names are provided by
+ * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
+ */
+ "ISO-10646-UCS-2", "unicode", "csUnicode", "ucs-2"
+ });
}
public boolean contains (Charset cs)
diff --git a/libjava/gnu/java/nio/charset/UTF_16BE.java b/libjava/gnu/java/nio/charset/UTF_16BE.java
index efd84fe3fd9..dc0d1369850 100644
--- a/libjava/gnu/java/nio/charset/UTF_16BE.java
+++ b/libjava/gnu/java/nio/charset/UTF_16BE.java
@@ -1,5 +1,5 @@
/* UTF_16BE.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,18 @@ final class UTF_16BE extends Charset
{
UTF_16BE ()
{
- super ("UTF-16BE", null);
+ super ("UTF-16BE", new String[] {
+ // witnessed by the internet
+ "UTF16BE",
+ /* These names are provided by
+ * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
+ */
+ "x-utf-16be", "ibm-1200", "ibm-1201", "ibm-5297",
+ "ibm-13488", "ibm-17584", "windows-1201", "cp1200", "cp1201",
+ "UTF16_BigEndian",
+ // see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
+ "UnicodeBigUnmarked"
+ });
}
public boolean contains (Charset cs)
diff --git a/libjava/gnu/java/nio/charset/UTF_16LE.java b/libjava/gnu/java/nio/charset/UTF_16LE.java
index 6eafbbcc4f1..87ceab3033e 100644
--- a/libjava/gnu/java/nio/charset/UTF_16LE.java
+++ b/libjava/gnu/java/nio/charset/UTF_16LE.java
@@ -1,5 +1,5 @@
/* UTF_16LE.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,17 @@ final class UTF_16LE extends Charset
{
UTF_16LE ()
{
- super ("UTF-16LE", null);
+ super ("UTF-16LE", new String[] {
+ // witnessed by the internet
+ "UTF16LE",
+ /* These names are provided by
+ * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
+ */
+ "x-utf-16le", "ibm-1202", "ibm-13490", "ibm-17586",
+ "UTF16_LittleEndian",
+ // see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
+ "UnicodeLittleUnmarked"
+ });
}
public boolean contains (Charset cs)
diff --git a/libjava/gnu/java/nio/charset/UTF_8.java b/libjava/gnu/java/nio/charset/UTF_8.java
index acb34e2bbce..87df6442360 100644
--- a/libjava/gnu/java/nio/charset/UTF_8.java
+++ b/libjava/gnu/java/nio/charset/UTF_8.java
@@ -1,5 +1,5 @@
/* UTF_8.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -62,7 +62,15 @@ final class UTF_8 extends Charset
{
UTF_8 ()
{
- super ("UTF-8", null);
+ super ("UTF-8", new String[] {
+ /* These names are provided by
+ * http://oss.software.ibm.com/cgi-bin/icu/convexp?s=ALL
+ */
+ "ibm-1208", "ibm-1209", "ibm-5304", "ibm-5305",
+ "windows-65001", "cp1208",
+ // see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
+ "UTF8"
+ });
}
public boolean contains (Charset cs)
@@ -93,7 +101,7 @@ final class UTF_8 extends Charset
protected CoderResult decodeLoop (ByteBuffer in, CharBuffer out)
{
// TODO: Optimize this in the case in.hasArray() / out.hasArray()
- int inPos = 0;
+ int inPos = in.position();
try
{
while (in.hasRemaining ())
@@ -188,7 +196,7 @@ final class UTF_8 extends Charset
protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out)
{
- int inPos = 0;
+ int inPos = in.position();
try
{
// TODO: Optimize this in the case in.hasArray() / out.hasArray()
diff --git a/libjava/gnu/java/rmi/dgc/DGCImpl.java b/libjava/gnu/java/rmi/dgc/DGCImpl.java
index 4216b6466ba..483ac54f192 100644
--- a/libjava/gnu/java/rmi/dgc/DGCImpl.java
+++ b/libjava/gnu/java/rmi/dgc/DGCImpl.java
@@ -42,7 +42,6 @@ import java.rmi.dgc.Lease;
import java.rmi.dgc.VMID;
import java.rmi.server.ObjID;
import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
import java.rmi.server.RMISocketFactory;
import gnu.java.rmi.server.UnicastServerRef;
diff --git a/libjava/gnu/java/rmi/registry/RegistryImpl.java b/libjava/gnu/java/rmi/registry/RegistryImpl.java
index 007d5a97de9..43033c4b8ad 100644
--- a/libjava/gnu/java/rmi/registry/RegistryImpl.java
+++ b/libjava/gnu/java/rmi/registry/RegistryImpl.java
@@ -1,5 +1,6 @@
/*
- Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (c) 1996, 1997, 1998, 1999, 2002, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -109,7 +110,7 @@ public static void version() {
+ System.getProperty("java.vm.name")
+ ") "
+ System.getProperty("java.vm.version"));
- System.out.println("Copyright 2002 Free Software Foundation, Inc.");
+ System.out.println("Copyright 2005 Free Software Foundation, Inc.");
System.out.println("This is free software; see the source for copying conditions. There is NO");
System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
System.exit(0);
diff --git a/libjava/gnu/java/rmi/rmic/RMIC.java b/libjava/gnu/java/rmi/rmic/RMIC.java
index e81c0fb780b..0976cd279b2 100644
--- a/libjava/gnu/java/rmi/rmic/RMIC.java
+++ b/libjava/gnu/java/rmi/rmic/RMIC.java
@@ -1,5 +1,5 @@
/* RMIC.java --
- Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
+ Copyright (c) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -978,7 +978,7 @@ public class RMIC
System.out.println("rmic (" + System.getProperty("java.vm.name")
+ ") " + System.getProperty("java.vm.version"));
System.out.println();
- System.out.println("Copyright 2002 Free Software Foundation, Inc.");
+ System.out.println("Copyright 2005 Free Software Foundation, Inc.");
System.out.println("This is free software; see the source for copying conditions. There is NO");
System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
System.exit(0);
diff --git a/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java b/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java
index 5f5da8ca941..b917315cbb4 100644
--- a/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java
+++ b/libjava/gnu/java/rmi/server/ConnectionRunnerPool.java
@@ -1,5 +1,5 @@
/* gnu.java.rmi.server.ConnectionRunnerPool
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -118,7 +118,7 @@ class ConnectionRunnerPool
max_size = size;
}
- private synchronized static ConnectionRunner getConnectionRunner()
+ private static synchronized ConnectionRunner getConnectionRunner()
{
if(freelist.size() == 0){
if(size < max_size){
diff --git a/libjava/gnu/java/rmi/server/UnicastConnectionManager.java b/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
index cf08a08ab5b..ef01c8264e5 100644
--- a/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
+++ b/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
@@ -55,7 +55,6 @@ import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.RMIClientSocketFactory;
import java.util.ArrayList;
import java.util.ConcurrentModificationException;
-import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
diff --git a/libjava/gnu/java/security/PolicyFile.java b/libjava/gnu/java/security/PolicyFile.java
index d5c14dc7a17..c939dda47c4 100644
--- a/libjava/gnu/java/security/PolicyFile.java
+++ b/libjava/gnu/java/security/PolicyFile.java
@@ -1,18 +1,20 @@
-/* PolicyFile.java -- policy file reader.
- Copyright (C) 2004 Free Software Foundation, Inc.
+/* PolicyFile.java -- policy file reader
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-This program is distributed in the hope that it will be useful, but
+GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT 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
-along with this program; see the file COPYING. If not, write to the
+along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
@@ -33,7 +35,6 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-
package gnu.java.security;
import java.io.File;
@@ -143,7 +144,8 @@ public final class PolicyFile extends Policy
// -------------------------------------------------------------------------
private static final boolean DEBUG = true;
- private static void debug(String msg)
+ // Package-private to avoid a trampoline.
+ static void debug(String msg)
{
System.err.print(">> PolicyFile: ");
System.err.println(msg);
diff --git a/libjava/gnu/java/security/der/DERReader.java b/libjava/gnu/java/security/der/DERReader.java
index 7d7174d6d46..688b509eb2c 100644
--- a/libjava/gnu/java/security/der/DERReader.java
+++ b/libjava/gnu/java/security/der/DERReader.java
@@ -62,15 +62,15 @@ import gnu.java.security.OID;
*
* @author Casey Marshall (csm@gnu.org)
*/
-public final class DERReader implements DER
+public class DERReader implements DER
{
// Fields.
// ------------------------------------------------------------------------
- private InputStream in;
+ protected InputStream in;
- private final ByteArrayOutputStream encBuf;
+ protected final ByteArrayOutputStream encBuf;
// Constructor.
// ------------------------------------------------------------------------
@@ -185,6 +185,26 @@ public final class DERReader implements DER
return value;
}
+ protected int readLength() throws IOException
+ {
+ int i = in.read();
+ if (i == -1)
+ throw new EOFException();
+ encBuf.write(i);
+ if ((i & ~0x7F) == 0)
+ {
+ return i;
+ }
+ else if (i < 0xFF)
+ {
+ byte[] octets = new byte[i & 0x7F];
+ in.read(octets);
+ encBuf.write(octets);
+ return new BigInteger(1, octets).intValue();
+ }
+ throw new DEREncodingException();
+ }
+
// Own methods.
// ------------------------------------------------------------------------
@@ -236,26 +256,6 @@ public final class DERReader implements DER
}
}
- private int readLength() throws IOException
- {
- int i = in.read();
- if (i == -1)
- throw new EOFException();
- encBuf.write(i);
- if ((i & ~0x7F) == 0)
- {
- return i;
- }
- else if (i < 0xFF)
- {
- byte[] octets = new byte[i & 0x7F];
- in.read(octets);
- encBuf.write(octets);
- return new BigInteger(1, octets).intValue();
- }
- throw new DEREncodingException();
- }
-
private static String makeString(int tag, byte[] value)
throws IOException
{
diff --git a/libjava/gnu/java/security/der/DERWriter.java b/libjava/gnu/java/security/der/DERWriter.java
index 8bf80b5fc76..5568b69bbad 100644
--- a/libjava/gnu/java/security/der/DERWriter.java
+++ b/libjava/gnu/java/security/der/DERWriter.java
@@ -1,5 +1,5 @@
/* DERWriter.java -- write Java types in DER format.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,6 @@ import java.math.BigInteger;
import java.text.SimpleDateFormat;
-import java.util.BitSet;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
diff --git a/libjava/gnu/java/security/provider/EncodedKeyFactory.java b/libjava/gnu/java/security/provider/EncodedKeyFactory.java
index e308d443fc6..7dc5ee9337b 100644
--- a/libjava/gnu/java/security/provider/EncodedKeyFactory.java
+++ b/libjava/gnu/java/security/provider/EncodedKeyFactory.java
@@ -38,6 +38,11 @@ exception statement from your version. */
package gnu.java.security.provider;
+import gnu.java.security.OID;
+import gnu.java.security.der.BitString;
+import gnu.java.security.der.DERReader;
+import gnu.java.security.der.DERValue;
+
import java.io.IOException;
import java.math.BigInteger;
@@ -45,15 +50,12 @@ import java.math.BigInteger;
import java.security.AlgorithmParameters;
import java.security.InvalidKeyException;
import java.security.Key;
-import java.security.KeyFactory;
import java.security.KeyFactorySpi;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.DSAParameterSpec;
-import java.security.spec.DSAPrivateKeySpec;
-import java.security.spec.DSAPublicKeySpec;
import java.security.spec.InvalidParameterSpecException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
@@ -64,12 +66,6 @@ import java.security.spec.X509EncodedKeySpec;
import javax.crypto.spec.DHParameterSpec;
-import gnu.java.security.OID;
-import gnu.java.security.der.BitString;
-import gnu.java.security.der.DER;
-import gnu.java.security.der.DERReader;
-import gnu.java.security.der.DERValue;
-
/**
* A factory for keys encoded in either the X.509 format (for public
* keys) or the PKCS#8 format (for private keys).
diff --git a/libjava/gnu/java/security/provider/Gnu.java b/libjava/gnu/java/security/provider/Gnu.java
index 02f509dc2d5..34f86d8bad0 100644
--- a/libjava/gnu/java/security/provider/Gnu.java
+++ b/libjava/gnu/java/security/provider/Gnu.java
@@ -1,5 +1,5 @@
/* Gnu.java --- Gnu provider main class
- Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -129,6 +129,7 @@ public final class Gnu extends Provider
// Format "Alias", "Actual Name"
put("Alg.Alias.MessageDigest.SHA1", "SHA");
put("Alg.Alias.MessageDigest.SHA-1", "SHA");
+ put("Alg.Alias.MessageDigest.SHA-160", "SHA");
// Algorithm Parameters
put("AlgorithmParameters.DSA",
diff --git a/libjava/gnu/java/security/provider/GnuDHPublicKey.java b/libjava/gnu/java/security/provider/GnuDHPublicKey.java
index a650761dc8f..fbf9d9f8633 100644
--- a/libjava/gnu/java/security/provider/GnuDHPublicKey.java
+++ b/libjava/gnu/java/security/provider/GnuDHPublicKey.java
@@ -49,7 +49,6 @@ import gnu.java.security.OID;
import gnu.java.security.der.BitString;
import gnu.java.security.der.DER;
import gnu.java.security.der.DERValue;
-import gnu.java.security.der.DERWriter;
public class GnuDHPublicKey implements DHPublicKey
{
diff --git a/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java b/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java
index 4eceb0074da..72fe38784d5 100644
--- a/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java
+++ b/libjava/gnu/java/security/provider/GnuDSAPrivateKey.java
@@ -1,5 +1,5 @@
/* GnuDSAPrivateKey.java --- Gnu DSA Private Key
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999,2003,2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -38,19 +38,31 @@ exception statement from your version. */
package gnu.java.security.provider;
+import gnu.java.security.OID;
+import gnu.java.security.der.DER;
+import gnu.java.security.der.DERValue;
+import gnu.java.security.der.DERWriter;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
import java.math.BigInteger;
+
import java.security.interfaces.DSAPrivateKey;
import java.security.interfaces.DSAParams;
import java.security.spec.DSAParameterSpec;
+import java.util.ArrayList;
+
public class GnuDSAPrivateKey implements DSAPrivateKey
{
+ private byte[] encodedKey;
BigInteger x;
BigInteger p;
BigInteger q;
BigInteger g;
- public GnuDSAPrivateKey(BigInteger x, BigInteger p, BigInteger q, BigInteger g )
+ public GnuDSAPrivateKey(BigInteger x, BigInteger p, BigInteger q, BigInteger g )
{
this.x = x;
this.p = p;
@@ -65,12 +77,56 @@ public class GnuDSAPrivateKey implements DSAPrivateKey
public String getFormat()
{
- return null;
+ return "PKCS#8";
}
+ /**
+ * Encodes this key as a <code>PrivateKeyInfo</code>, as described in
+ * PKCS #8. The ASN.1 specification for this structure is:
+ *
+ * <blockquote><pre>
+ * PrivateKeyInfo ::= SEQUENCE {
+ * version Version,
+ * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
+ * privateKey PrivateKey,
+ * attributes [0] IMPLICIT Attributes OPTIONAL }
+ *
+ * Version ::= INTEGER
+ *
+ * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
+ *
+ * PrivateKey ::= OCTET STRING
+ *
+ * Attributes ::= SET OF Attribute
+ * </pre></blockquote>
+ *
+ * <p>DSA private keys (in Classpath at least) have no attributes.
+ */
public byte[] getEncoded()
{
- return null;
+ if (encodedKey != null)
+ return (byte[]) encodedKey.clone();
+ try
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ArrayList pki = new ArrayList(3);
+ pki.add(new DERValue(DER.INTEGER, BigInteger.ZERO));
+ ArrayList algId = new ArrayList(2);
+ algId.add(new DERValue(DER.OBJECT_IDENTIFIER,
+ new OID("1.2.840.10040.4.1")));
+ ArrayList algParams = new ArrayList(3);
+ algParams.add(new DERValue(DER.INTEGER, p));
+ algParams.add(new DERValue(DER.INTEGER, q));
+ algParams.add(new DERValue(DER.INTEGER, g));
+ algId.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, algParams));
+ pki.add(new DERValue(DER.OCTET_STRING, x.toByteArray()));
+ DERWriter.write(out, new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, pki));
+ return (byte[]) (encodedKey = out.toByteArray()).clone();
+ }
+ catch (IOException ioe)
+ {
+ return null;
+ }
}
public DSAParams getParams()
@@ -85,7 +141,10 @@ public class GnuDSAPrivateKey implements DSAPrivateKey
public String toString()
{
- return "GnuDSAPrivateKey: x=" + x.toString(16) + " p=" + p.toString(16)
- + " q=" + q.toString(16) + " g=" + g.toString(16);
+ return "GnuDSAPrivateKey: x="
+ + (x != null ? x.toString(16) : "null") + " p="
+ + (p != null ? p.toString(16) : "null") + " q="
+ + (q != null ? q.toString(16) : "null") + " g="
+ + (g != null ? g.toString(16) : "null");
}
}
diff --git a/libjava/gnu/java/security/provider/GnuDSAPublicKey.java b/libjava/gnu/java/security/provider/GnuDSAPublicKey.java
index 91d6b561c7f..9ec827d41ae 100644
--- a/libjava/gnu/java/security/provider/GnuDSAPublicKey.java
+++ b/libjava/gnu/java/security/provider/GnuDSAPublicKey.java
@@ -1,5 +1,5 @@
/* GnuDSAPublicKey.java --- Gnu DSA Public Key
- Copyright (C) 1999,2003 Free Software Foundation, Inc.
+ Copyright (C) 1999,2003,2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -38,19 +38,32 @@ exception statement from your version. */
package gnu.java.security.provider;
+import gnu.java.security.OID;
+import gnu.java.security.der.BitString;
+import gnu.java.security.der.DER;
+import gnu.java.security.der.DERValue;
+import gnu.java.security.der.DERWriter;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
import java.math.BigInteger;
+
import java.security.interfaces.DSAPublicKey;
import java.security.interfaces.DSAParams;
import java.security.spec.DSAParameterSpec;
+import java.util.ArrayList;
+
public class GnuDSAPublicKey implements DSAPublicKey
{
+ private byte[] encodedKey;
BigInteger y;
BigInteger p;
BigInteger q;
BigInteger g;
- public GnuDSAPublicKey(BigInteger y, BigInteger p, BigInteger q, BigInteger g )
+ public GnuDSAPublicKey(BigInteger y, BigInteger p, BigInteger q, BigInteger g )
{
this.y = y;
this.p = p;
@@ -65,16 +78,49 @@ public class GnuDSAPublicKey implements DSAPublicKey
public String getFormat()
{
- return null;
+ return "X.509";
}
+ /**
+ * The encoded form of DSA public keys is:
+ *
+ * <blockquote><pre>
+ * SubjectPublicKeyInfo ::= SEQUENCE {
+ * algorithm AlgorithmIdentifier,
+ * subjectPublicKey BIT STRING }
+ * </pre></blockquote>
+ */
public byte[] getEncoded()
{
- return null;
+ if (encodedKey != null)
+ return (byte[]) encodedKey.clone();
+ try
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ArrayList spki = new ArrayList(2);
+ ArrayList alg = new ArrayList(2);
+ alg.add(new DERValue(DER.OBJECT_IDENTIFIER,
+ new OID("1.2.840.113549.1.1.1")));
+ ArrayList params = new ArrayList(3);
+ params.add(new DERValue(DER.INTEGER, p));
+ params.add(new DERValue(DER.INTEGER, q));
+ params.add(new DERValue(DER.INTEGER, g));
+ alg.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, params));
+ spki.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, alg));
+ spki.add(new DERValue(DER.BIT_STRING, new BitString(y.toByteArray())));
+ DERWriter.write(out, new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, spki));
+ return (byte[]) (encodedKey = out.toByteArray()).clone();
+ }
+ catch (IOException ioe)
+ {
+ return null;
+ }
}
public DSAParams getParams()
{
+ if (p == null || q == null || g == null)
+ return null;
return (DSAParams)(new DSAParameterSpec(p,q,g));
}
@@ -85,7 +131,10 @@ public class GnuDSAPublicKey implements DSAPublicKey
public String toString()
{
- return "GnuDSAPublicKey: y=" + y.toString(16) + " p=" + p.toString(16)
- + " q=" + q.toString(16) + " g=" + g.toString(16);
+ return
+ "GnuDSAPublicKey: y=" + (y != null ? y.toString(16) : "(null)") +
+ " p=" + (p != null ? p.toString(16) : "(null)") +
+ " q=" + (q != null ? q.toString(16) : "(null)") +
+ " g=" + (g != null ? g.toString(16) : "(null)");
}
}
diff --git a/libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java b/libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
index 7d1d857a049..7bba5021338 100644
--- a/libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
+++ b/libjava/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
@@ -38,18 +38,40 @@ exception statement from your version. */
package gnu.java.security.provider;
+import gnu.java.security.OID;
+import gnu.java.security.x509.GnuPKIExtension;
+import gnu.java.security.x509.PolicyNodeImpl;
+import gnu.java.security.x509.X509CertSelectorImpl;
+import gnu.java.security.x509.X509CRLSelectorImpl;
+import gnu.java.security.x509.ext.BasicConstraints;
+import gnu.java.security.x509.ext.CertificatePolicies;
+import gnu.java.security.x509.ext.Extension;
+import gnu.java.security.x509.ext.KeyUsage;
+import gnu.java.security.x509.ext.PolicyConstraint;
+
import java.io.IOException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
-import java.security.Principal;
import java.security.PublicKey;
-import java.security.cert.*;
-
+import java.security.cert.CertificateException;
+import java.security.cert.CertPath;
+import java.security.cert.CertPathParameters;
+import java.security.cert.CertPathValidatorException;
+import java.security.cert.CertPathValidatorResult;
+import java.security.cert.CertPathValidatorSpi;
+import java.security.cert.CertStore;
+import java.security.cert.CertStoreException;
+import java.security.cert.CRL;
+import java.security.cert.PKIXCertPathChecker;
+import java.security.cert.PKIXCertPathValidatorResult;
+import java.security.cert.PKIXParameters;
+import java.security.cert.TrustAnchor;
+import java.security.cert.X509Certificate;
+import java.security.cert.X509CRL;
import java.security.interfaces.DSAParams;
import java.security.interfaces.DSAPublicKey;
-import java.security.spec.DSAParameterSpec;
import java.util.Arrays;
import java.util.Collection;
@@ -61,13 +83,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
-import gnu.java.security.x509.GnuPKIExtension;
-import gnu.java.security.x509.PolicyNodeImpl;
-import gnu.java.security.x509.X509CertSelectorImpl;
-import gnu.java.security.x509.X509CRLSelectorImpl;
-import gnu.java.security.x509.ext.*;
-import gnu.java.security.OID;
-
/**
* An implementation of the Public Key Infrastructure's X.509
* certificate path validation algorithm.
diff --git a/libjava/gnu/java/security/x509/X500DistinguishedName.java b/libjava/gnu/java/security/x509/X500DistinguishedName.java
index 64e320bef82..daf76a22dfa 100644
--- a/libjava/gnu/java/security/x509/X500DistinguishedName.java
+++ b/libjava/gnu/java/security/x509/X500DistinguishedName.java
@@ -55,7 +55,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.TreeMap;
import gnu.java.security.der.DER;
import gnu.java.security.der.DERReader;
diff --git a/libjava/gnu/java/security/x509/X509CRL.java b/libjava/gnu/java/security/x509/X509CRL.java
index adaa003f3cb..33263af4325 100644
--- a/libjava/gnu/java/security/x509/X509CRL.java
+++ b/libjava/gnu/java/security/x509/X509CRL.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.java.security.x509;
-import gnu.java.io.ASN1ParsingException;
import gnu.java.security.OID;
import gnu.java.security.der.BitString;
import gnu.java.security.der.DER;
diff --git a/libjava/gnu/java/security/x509/X509CRLEntry.java b/libjava/gnu/java/security/x509/X509CRLEntry.java
index 252737c0eaa..da161153c62 100644
--- a/libjava/gnu/java/security/x509/X509CRLEntry.java
+++ b/libjava/gnu/java/security/x509/X509CRLEntry.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.java.security.x509;
-import java.io.InputStream;
import java.io.IOException;
import java.math.BigInteger;
diff --git a/libjava/gnu/java/security/x509/X509Certificate.java b/libjava/gnu/java/security/x509/X509Certificate.java
index 25a56d4a8ef..721439ef238 100644
--- a/libjava/gnu/java/security/x509/X509Certificate.java
+++ b/libjava/gnu/java/security/x509/X509Certificate.java
@@ -38,18 +38,14 @@ exception statement from your version. */
package gnu.java.security.x509;
-import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.IOException;
-import java.io.ObjectStreamException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.math.BigInteger;
-import java.net.InetAddress;
-
import java.security.AlgorithmParameters;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
@@ -79,7 +75,6 @@ import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
diff --git a/libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java b/libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java
index 6f4e00b3f07..5441521990b 100644
--- a/libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java
+++ b/libjava/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java
@@ -40,7 +40,6 @@ package gnu.java.security.x509.ext;
import java.io.IOException;
import java.math.BigInteger;
-import java.util.List;
import gnu.java.security.OID;
import gnu.java.security.der.DER;
diff --git a/libjava/gnu/java/security/x509/ext/CertificatePolicies.java b/libjava/gnu/java/security/x509/ext/CertificatePolicies.java
index 206fa7efaf6..9c14dc96ef7 100644
--- a/libjava/gnu/java/security/x509/ext/CertificatePolicies.java
+++ b/libjava/gnu/java/security/x509/ext/CertificatePolicies.java
@@ -39,7 +39,6 @@ exception statement from your version. */
package gnu.java.security.x509.ext;
import java.io.IOException;
-import java.math.BigInteger;
import java.security.cert.PolicyQualifierInfo;
import java.util.ArrayList;
diff --git a/libjava/gnu/java/security/x509/ext/PolicyConstraint.java b/libjava/gnu/java/security/x509/ext/PolicyConstraint.java
index 0949b5000ae..e33f960b30b 100644
--- a/libjava/gnu/java/security/x509/ext/PolicyConstraint.java
+++ b/libjava/gnu/java/security/x509/ext/PolicyConstraint.java
@@ -42,10 +42,8 @@ import java.io.IOException;
import java.math.BigInteger;
import gnu.java.security.OID;
-import gnu.java.security.der.DER;
import gnu.java.security.der.DERReader;
import gnu.java.security.der.DERValue;
-import gnu.java.security.x509.Util;
public class PolicyConstraint extends Extension.Value
{
diff --git a/libjava/gnu/java/text/FormatCharacterIterator.java b/libjava/gnu/java/text/FormatCharacterIterator.java
index 116198bdc13..942641a0818 100644
--- a/libjava/gnu/java/text/FormatCharacterIterator.java
+++ b/libjava/gnu/java/text/FormatCharacterIterator.java
@@ -1,6 +1,6 @@
/* FormatCharacter.java -- Implementation of AttributedCharacterIterator for
formatters.
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -494,13 +494,13 @@ public class FormatCharacterIterator implements AttributedCharacterIterator
mergeAttributes(new HashMap[] { null, attributes }, new int[] { range_start, range_end });
}
- final private void debug(String s)
+ private void debug(String s)
{
if (Configuration.DEBUG)
System.out.println(s);
}
- final private void dumpTable()
+ private void dumpTable()
{
int start_range = 0;
diff --git a/libjava/gnu/regexp/RE.java b/libjava/gnu/regexp/RE.java
index d782975e9af..a01de58f1bb 100644
--- a/libjava/gnu/regexp/RE.java
+++ b/libjava/gnu/regexp/RE.java
@@ -43,15 +43,6 @@ import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import java.util.Vector;
-class IntPair implements Serializable {
- public int first, second;
-}
-
-class CharUnit implements Serializable {
- public char ch;
- public boolean bk;
-}
-
/**
* RE provides the user interface for compiling and matching regular
* expressions.
@@ -119,6 +110,16 @@ class CharUnit implements Serializable {
*/
public class RE extends REToken {
+
+ private static final class IntPair implements Serializable {
+ public int first, second;
+ }
+
+ private static final class CharUnit implements Serializable {
+ public char ch;
+ public boolean bk;
+ }
+
// This String will be returned by getVersion()
private static final String VERSION = "1.1.5-dev";
diff --git a/libjava/gnu/xml/aelfred2/SAXDriver.java b/libjava/gnu/xml/aelfred2/SAXDriver.java
index 4912f279464..0e7b3c719a6 100644
--- a/libjava/gnu/xml/aelfred2/SAXDriver.java
+++ b/libjava/gnu/xml/aelfred2/SAXDriver.java
@@ -150,10 +150,7 @@ final public class SAXDriver
private Stack entityStack;
// one vector (of object/struct): faster, smaller
- private List attributesList = Collections.synchronizedList(new ArrayList());
-
- private boolean attributeSpecified [] = new boolean[10];
- private boolean attributeDeclared [] = new boolean[10];
+ private List attributesList;
private boolean namespaces = true;
private boolean xmlNames = false;
@@ -183,8 +180,6 @@ final public class SAXDriver
elementName = null;
entityStack = new Stack ();
attributesList = Collections.synchronizedList(new ArrayList());
- attributeSpecified = new boolean[10];
- attributeDeclared = new boolean[10];
attributeCount = 0;
attributes = false;
nsTemp = new String[3];
@@ -849,17 +844,10 @@ final public class SAXDriver
}
// remember this attribute ...
- if (attributeCount == attributeSpecified.length) { // grow array?
- boolean temp [] = new boolean [attributeSpecified.length + 5];
- System.arraycopy (attributeSpecified, 0, temp, 0, attributeCount);
- attributeSpecified = temp;
- }
- attributeSpecified [attributeCount] = isSpecified;
-
attributeCount++;
// attribute type comes from querying parser's DTD records
- attributesList.add(new Attribute(qname, value));
+ attributesList.add(new Attribute(qname, value, isSpecified));
}
@@ -1043,7 +1031,7 @@ final public class SAXDriver
*/
public int getLength ()
{
- return attributesList.size ();
+ return attributesList.size();
}
/**
@@ -1051,7 +1039,11 @@ final public class SAXDriver
*/
public String getURI (int index)
{
- return ((Attribute) attributesList.get (index)).nameSpace;
+ if (index < 0 || index >= attributesList.size())
+ {
+ return null;
+ }
+ return ((Attribute) attributesList.get(index)).nameSpace;
}
/**
@@ -1059,7 +1051,11 @@ final public class SAXDriver
*/
public String getLocalName (int index)
{
- Attribute attr = (Attribute) attributesList.get (index);
+ if (index < 0 || index >= attributesList.size())
+ {
+ return null;
+ }
+ Attribute attr = (Attribute) attributesList.get(index);
// FIXME attr.localName is sometimes null, why?
if (namespaces && attr.localName == null)
{
@@ -1068,38 +1064,51 @@ final public class SAXDriver
attr.localName = (ci == -1) ? attr.name :
attr.name.substring(ci + 1);
}
- return attr.localName;
+ return (attr.localName == null) ? "" : attr.localName;
}
/**
* <b>SAX2 Attributes</b> method (don't invoke on parser);
*/
- public String getQName (int i)
+ public String getQName (int index)
{
- return ((Attribute) attributesList.get (i)).name;
+ if (index < 0 || index >= attributesList.size())
+ {
+ return null;
+ }
+ Attribute attr = (Attribute) attributesList.get(index);
+ return (attr.name == null) ? "" : attr.name;
}
/**
* <b>SAX1 AttributeList</b> method (don't invoke on parser);
*/
- public String getName (int i)
+ public String getName (int index)
{
- return ((Attribute) attributesList.get (i)).name;
+ return getQName(index);
}
/**
* <b>SAX1 AttributeList, SAX2 Attributes</b> method
* (don't invoke on parser);
*/
- public String getType (int i)
+ public String getType (int index)
{
- String type = parser.getAttributeType (elementName, getQName (i));
+ if (index < 0 || index >= attributesList.size())
+ {
+ return null;
+ }
+ String type = parser.getAttributeType(elementName, getQName(index));
if (type == null)
+ {
return "CDATA";
+ }
// ... use DeclHandler.attributeDecl to see enumerations
- if (type == "ENUMERATION")
- return "NMTOKEN";
- return type;
+ if (type == "ENUMERATION")
+ {
+ return "NMTOKEN";
+ }
+ return type;
}
@@ -1107,9 +1116,13 @@ final public class SAXDriver
* <b>SAX1 AttributeList, SAX2 Attributes</b> method
* (don't invoke on parser);
*/
- public String getValue (int i)
+ public String getValue (int index)
{
- return ((Attribute) attributesList.get (i)).value;
+ if (index < 0 || index >= attributesList.size())
+ {
+ return null;
+ }
+ return ((Attribute) attributesList.get(index)).value;
}
@@ -1118,14 +1131,19 @@ final public class SAXDriver
*/
public int getIndex (String uri, String local)
{
- int length = getLength ();
+ int length = getLength();
- for (int i = 0; i < length; i++) {
- if (!getURI (i).equals (uri))
+ for (int i = 0; i < length; i++)
+ {
+ if (!getURI(i).equals(uri))
+ {
continue;
- if (getLocalName (i).equals (local))
+ }
+ if (getLocalName(i).equals(local))
+ {
return i;
- }
+ }
+ }
return -1;
}
@@ -1135,12 +1153,15 @@ final public class SAXDriver
*/
public int getIndex (String xmlName)
{
- int length = getLength ();
+ int length = getLength();
- for (int i = 0; i < length; i++) {
- if (getQName (i).equals (xmlName))
+ for (int i = 0; i < length; i++)
+ {
+ if (getQName(i).equals(xmlName))
+ {
return i;
- }
+ }
+ }
return -1;
}
@@ -1150,11 +1171,13 @@ final public class SAXDriver
*/
public String getType (String uri, String local)
{
- int index = getIndex (uri, local);
+ int index = getIndex(uri, local);
if (index < 0)
+ {
return null;
- return getType (index);
+ }
+ return getType(index);
}
@@ -1164,11 +1187,13 @@ final public class SAXDriver
*/
public String getType (String xmlName)
{
- int index = getIndex (xmlName);
+ int index = getIndex(xmlName);
if (index < 0)
+ {
return null;
- return getType (index);
+ }
+ return getType(index);
}
@@ -1177,11 +1202,13 @@ final public class SAXDriver
*/
public String getValue (String uri, String local)
{
- int index = getIndex (uri, local);
+ int index = getIndex(uri, local);
if (index < 0)
+ {
return null;
- return getValue (index);
+ }
+ return getValue(index);
}
@@ -1191,11 +1218,13 @@ final public class SAXDriver
*/
public String getValue (String xmlName)
{
- int index = getIndex (xmlName);
+ int index = getIndex(xmlName);
if (index < 0)
+ {
return null;
- return getValue (index);
+ }
+ return getValue(index);
}
@@ -1212,31 +1241,31 @@ final public class SAXDriver
{
if (index < 0 || index >= attributeCount)
throw new ArrayIndexOutOfBoundsException ();
- return attributeDeclared [index];
+ String type = parser.getAttributeType(elementName, getQName(index));
+ return (type != null);
}
/** @return false unless the attribute was declared in the DTD.
* @throws java.lang.IllegalArgumentException
* When the supplied names do not identify an attribute.
*/
- public boolean isDeclared (java.lang.String qName)
+ public boolean isDeclared (String qName)
{
int index = getIndex (qName);
if (index < 0)
throw new IllegalArgumentException ();
- return attributeDeclared [index];
+ String type = parser.getAttributeType(elementName, qName);
+ return (type != null);
}
/** @return false unless the attribute was declared in the DTD.
* @throws java.lang.IllegalArgumentException
* When the supplied names do not identify an attribute.
*/
- public boolean isDeclared (java.lang.String uri, java.lang.String localName)
+ public boolean isDeclared (String uri, String localName)
{
int index = getIndex (uri, localName);
- if (index < 0)
- throw new IllegalArgumentException ();
- return attributeDeclared [index];
+ return isDeclared(index);
}
@@ -1245,9 +1274,7 @@ final public class SAXDriver
*/
public boolean isSpecified (int index)
{
- if (index < 0 || index >= attributeCount)
- throw new ArrayIndexOutOfBoundsException ();
- return attributeSpecified [index];
+ return ((Attribute) attributesList.get(index)).specified;
}
/**
@@ -1256,10 +1283,7 @@ final public class SAXDriver
public boolean isSpecified (String uri, String local)
{
int index = getIndex (uri, local);
-
- if (index < 0)
- throw new IllegalArgumentException ();
- return attributeSpecified [index];
+ return isSpecified(index);
}
/**
@@ -1268,10 +1292,7 @@ final public class SAXDriver
public boolean isSpecified (String xmlName)
{
int index = getIndex (xmlName);
-
- if (index < 0)
- throw new IllegalArgumentException ();
- return attributeSpecified [index];
+ return isSpecified(index);
}
@@ -1374,12 +1395,14 @@ class Attribute
String value;
String nameSpace;
String localName;
+ boolean specified;
- Attribute(String name, String value)
+ Attribute(String name, String value, boolean specified)
{
this.name = name;
this.value = value;
this.nameSpace = "";
+ this.specified = specified;
}
}
diff --git a/libjava/gnu/xml/dom/Consumer.java b/libjava/gnu/xml/dom/Consumer.java
index 1aad5be9273..426b1e5da62 100644
--- a/libjava/gnu/xml/dom/Consumer.java
+++ b/libjava/gnu/xml/dom/Consumer.java
@@ -38,16 +38,11 @@ exception statement from your version. */
package gnu.xml.dom;
-import java.io.IOException;
-
-import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
-import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import org.xml.sax.Attributes;
-import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.ext.Attributes2;
diff --git a/libjava/gnu/xml/dom/DomAttr.java b/libjava/gnu/xml/dom/DomAttr.java
index 2890430e315..555902e3ea3 100644
--- a/libjava/gnu/xml/dom/DomAttr.java
+++ b/libjava/gnu/xml/dom/DomAttr.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.xml.dom;
import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.TypeInfo;
@@ -194,7 +195,7 @@ public class DomAttr
{
if (readonly)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
if (value == null)
{
@@ -284,11 +285,11 @@ public class DomAttr
{
if (parent != null)
{
- throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR);
+ throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR);
}
if (!(e instanceof DomElement))
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR);
}
parent = (DomElement) e;
depth = parent.depth + 1;
diff --git a/libjava/gnu/xml/dom/DomCDATA.java b/libjava/gnu/xml/dom/DomCDATA.java
deleted file mode 100644
index f6f471c68f2..00000000000
--- a/libjava/gnu/xml/dom/DomCDATA.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/* DomCDATA.java --
- Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.xml.dom;
-
-import org.w3c.dom.CDATASection;
-
-/**
- * <p> "CDATASection" implementation.
- * This is a non-core DOM class, supporting the "XML" feature.
- * CDATA sections are just ways to represent text using different
- * delimeters. </p>
- *
- * <p> <em>You are strongly advised not to use CDATASection nodes.</em>
- * The advantage of having slightly prettier ways to print text that may
- * have lots of embedded XML delimiters, such as "&amp;" and "&lt;",
- * can be dwarfed by the cost of dealing with multiple kinds of text
- * nodes in all your algorithms. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomCDATA
- extends DomText
- implements CDATASection
-{
-
- /**
- * Constructs a CDATA section node associated with the specified
- * document and holding the specified data.
- *
- * <p>This constructor should only be invoked by a Document as part of
- * its createCDATASection functionality, or through a subclass which is
- * similarly used in a "Sub-DOM" style layer.
- *
- */
- protected DomCDATA(DomDocument owner, String value)
- {
- super(CDATA_SECTION_NODE, owner, value);
- }
-
- protected DomCDATA(DomDocument owner, char buf [], int off, int len)
- {
- super(CDATA_SECTION_NODE, owner, buf, off, len);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the string "#cdata-section".
- */
- final public String getNodeName()
- {
- return "#cdata-section";
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomCharacterData.java b/libjava/gnu/xml/dom/DomCharacterData.java
index 48ccb82d638..e5cc231891d 100644
--- a/libjava/gnu/xml/dom/DomCharacterData.java
+++ b/libjava/gnu/xml/dom/DomCharacterData.java
@@ -38,8 +38,7 @@ exception statement from your version. */
package gnu.xml.dom;
import org.w3c.dom.CharacterData;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+import org.w3c.dom.DOMException;
import org.w3c.dom.events.MutationEvent;
@@ -82,7 +81,7 @@ public abstract class DomCharacterData
{
if (isReadonly())
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
String value = text + arg;
mutating(value);
@@ -98,12 +97,12 @@ public abstract class DomCharacterData
{
if (isReadonly())
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
char[] raw = text.toCharArray();
if (offset < 0 || count < 0 || offset > raw.length)
{
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
if ((offset + count) > raw.length)
{
@@ -125,7 +124,7 @@ public abstract class DomCharacterData
}
catch (IndexOutOfBoundsException x)
{
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
}
@@ -164,7 +163,7 @@ public abstract class DomCharacterData
{
if (isReadonly())
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
char[] raw = text.toCharArray();
char[] tmp = arg.toCharArray ();
@@ -182,7 +181,7 @@ public abstract class DomCharacterData
}
catch (IndexOutOfBoundsException x)
{
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
}
@@ -195,14 +194,14 @@ public abstract class DomCharacterData
{
if (readonly)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
char[] raw = text.toCharArray();
// deleteData
if (offset < 0 || count < 0 || offset > raw.length)
{
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
if ((offset + count) > raw.length)
{
@@ -228,7 +227,7 @@ public abstract class DomCharacterData
}
catch (IndexOutOfBoundsException x)
{
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
}
@@ -241,7 +240,7 @@ public abstract class DomCharacterData
{
if (isReadonly())
{
- throw new DomEx (DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
if (value == null)
{
@@ -276,7 +275,7 @@ public abstract class DomCharacterData
{
return text.substring(offset);
}
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
}
diff --git a/libjava/gnu/xml/dom/DomDoctype.java b/libjava/gnu/xml/dom/DomDoctype.java
index 35fb613e55a..8c760a5317f 100644
--- a/libjava/gnu/xml/dom/DomDoctype.java
+++ b/libjava/gnu/xml/dom/DomDoctype.java
@@ -39,6 +39,7 @@ package gnu.xml.dom;
import java.util.HashMap;
import org.w3c.dom.DocumentType;
+import org.w3c.dom.DOMException;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Entity;
import org.w3c.dom.NamedNodeMap;
@@ -194,7 +195,7 @@ public class DomDoctype
}
if (isReadonly())
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
getEntities();
@@ -250,7 +251,7 @@ public class DomDoctype
if (isReadonly())
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
getNotations();
diff --git a/libjava/gnu/xml/dom/DomDocument.java b/libjava/gnu/xml/dom/DomDocument.java
index 10693ae1d58..d8ccc9d821c 100644
--- a/libjava/gnu/xml/dom/DomDocument.java
+++ b/libjava/gnu/xml/dom/DomDocument.java
@@ -54,7 +54,6 @@ import org.w3c.dom.Entity;
import org.w3c.dom.EntityReference;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.w3c.dom.Notation;
import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.Text;
@@ -292,16 +291,16 @@ public class DomDocument
if (newChild.getNodeType() == ELEMENT_NODE
&& getDocumentElement() != null)
{
- throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR,
- "document element already present: " +
- getDocumentElement(), newChild, 0);
+ throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
+ "document element already present: " +
+ getDocumentElement(), newChild, 0);
}
if (newChild.getNodeType() == DOCUMENT_TYPE_NODE
&& getDoctype() != null)
{
- throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR,
- "document type already present: " +
- getDoctype(), newChild, 0);
+ throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
+ "document type already present: " +
+ getDoctype(), newChild, 0);
}
}
@@ -376,12 +375,12 @@ public class DomDocument
{
if (name == null)
{
- throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
}
int len = name.length();
if (len == 0)
{
- throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
}
// dog: rewritten to use the rules for XML 1.0 and 1.1
@@ -407,7 +406,8 @@ public class DomDocument
(c < 0xfdf0 || c > 0xfffd) &&
(c < 0x10000 || c > 0xeffff))
{
- throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+ throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+ name, null, c);
}
}
else
@@ -425,14 +425,16 @@ public class DomDocument
(c >= 0x20dd && c <= 0x20e0))
{
// Compatibility area and Unicode 2.0 exclusions
- throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+ throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+ name, null, c);
}
break;
default:
if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) &&
c != 0x0559 && c != 0x06e5 && c != 0x06e6)
{
- throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+ throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+ name, null, c);
}
}
}
@@ -464,7 +466,8 @@ public class DomDocument
(c < 0x0300 || c > 0x036f) &&
(c < 0x203f || c > 0x2040))
{
- throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+ throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name,
+ null, c);
}
}
else
@@ -487,7 +490,8 @@ public class DomDocument
(c >= 0x20dd && c <= 0x20e0))
{
// Compatibility area and Unicode 2.0 exclusions
- throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+ throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+ name, null, c);
}
break;
default:
@@ -495,7 +499,8 @@ public class DomDocument
c != 0x0387 && (c < 0x02bb || c > 0x02c1) &&
c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7)
{
- throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c);
+ throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+ name, null, c);
}
}
}
@@ -517,7 +522,8 @@ public class DomDocument
if (index == 0 || index == (len - 1) ||
name.lastIndexOf(':') != index)
{
- throw new DomEx(DomEx.NAMESPACE_ERR, name, null, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ name, null, 0);
}
}
}
@@ -552,8 +558,8 @@ public class DomDocument
continue;
}
}
- throw new DomEx(DomEx.INVALID_CHARACTER_ERR,
- new String(buf, off, len), null, c);
+ throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR,
+ new String(buf, off, len), null, c);
}
}
@@ -602,22 +608,23 @@ public class DomDocument
if (namespaceURI != null
&& !XMLConstants.XML_NS_URI.equals(namespaceURI))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "xml namespace is always " +
- XMLConstants.XML_NS_URI, this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "xml namespace is always " +
+ XMLConstants.XML_NS_URI, this, 0);
}
namespaceURI = XMLConstants.XML_NS_URI;
}
else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) ||
name.startsWith("xmlns:"))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "xmlns is reserved", this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "xmlns is reserved", this, 0);
}
else if (namespaceURI == null && name.indexOf(':') != -1)
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "prefixed name '" + name + "' needs a URI", this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "prefixed name '" + name +
+ "' needs a URI", this, 0);
}
Element element = new DomElement(this, namespaceURI, name);
@@ -660,7 +667,7 @@ public class DomDocument
*/
public DocumentFragment createDocumentFragment()
{
- return new DomFragment(this);
+ return new DomDocumentFragment(this);
}
/**
@@ -711,7 +718,7 @@ public class DomDocument
{
checkChar(value, "1.1".equals(version));
}
- return new DomCDATA(this, value);
+ return new DomCDATASection(this, value);
}
/**
@@ -723,7 +730,7 @@ public class DomDocument
{
checkChar(buf, off, len, "1.1".equals(version));
}
- return new DomCDATA(this, buf, off, len);
+ return new DomCDATASection(this, buf, off, len);
}
/**
@@ -739,12 +746,13 @@ public class DomDocument
checkName(target, xml11);
if ("xml".equalsIgnoreCase(target))
{
- throw new DomEx(DomEx.SYNTAX_ERR,
- "illegal PI target name", this, 0);
+ throw new DomDOMException(DOMException.SYNTAX_ERR,
+ "illegal PI target name",
+ this, 0);
}
checkChar(data, xml11);
}
- return new DomPI(this, target, data);
+ return new DomProcessingInstruction(this, target, data);
}
/**
@@ -796,9 +804,10 @@ public class DomDocument
}
else if (!XMLConstants.XML_NS_URI.equals(namespaceURI))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "xml namespace is always " +
- XMLConstants.XML_NS_URI, this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "xml namespace is always " +
+ XMLConstants.XML_NS_URI,
+ this, 0);
}
}
else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) ||
@@ -810,14 +819,15 @@ public class DomDocument
}
else if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "xmlns namespace must be " +
- XMLConstants.XMLNS_ATTRIBUTE_NS_URI, this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "xmlns namespace must be " +
+ XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
+ this, 0);
}
}
else if (namespaceURI == null && name.indexOf(':') != -1)
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
"prefixed name needs a URI: " + name, this, 0);
}
return new DomAttr(this, namespaceURI, name);
@@ -913,7 +923,7 @@ public class DomDocument
dst = createEntityReference(src.getNodeName());
break;
case DOCUMENT_FRAGMENT_NODE:
- dst = new DomFragment(this);
+ dst = new DomDocumentFragment(this);
if (deep)
{
for (Node ctx = src.getFirstChild(); ctx != null;
@@ -988,7 +998,7 @@ public class DomDocument
// FALLTHROUGH
// can't import unrecognized or nonstandard nodes
default:
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, src, 0);
}
// FIXME cleanup a bit -- for deep copies, copy those
@@ -1083,7 +1093,7 @@ public class DomDocument
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
}
@@ -1149,10 +1159,10 @@ public class DomDocument
{
case DOCUMENT_NODE:
case DOCUMENT_TYPE_NODE:
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
case ENTITY_NODE:
case NOTATION_NODE:
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
if (source instanceof DomNode)
{
@@ -1284,11 +1294,12 @@ public class DomDocument
DomNsNode src = (DomNsNode) n;
if (src == null)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR);
}
if (src.owner != this)
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
+ null, src, 0);
}
boolean xml11 = "1.1".equals(version);
checkName(qualifiedName, xml11);
@@ -1305,7 +1316,7 @@ public class DomDocument
if (XMLConstants.XML_NS_PREFIX.equals(prefix) &&
!XMLConstants.XML_NS_URI.equals(namespaceURI))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
"xml namespace must be " +
XMLConstants.XML_NS_URI, src, 0);
}
@@ -1314,14 +1325,14 @@ public class DomDocument
XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) &&
!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
"xmlns namespace must be " +
XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0);
}
if (XMLConstants.XML_NS_URI.equals(namespaceURI) &&
!XMLConstants.XML_NS_PREFIX.equals(prefix))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
"xml namespace must be " +
XMLConstants.XML_NS_URI, src, 0);
}
@@ -1330,7 +1341,7 @@ public class DomDocument
!(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) ||
XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
"xmlns namespace must be " +
XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0);
}
@@ -1343,7 +1354,7 @@ public class DomDocument
// DOMElementNameChanged or DOMAttributeNameChanged
return src;
}
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, n, 0);
}
// -- XPathEvaluator --
diff --git a/libjava/gnu/xml/dom/DomDocumentBuilder.java b/libjava/gnu/xml/dom/DomDocumentBuilder.java
index 16ea2ae5dba..d321653ed73 100644
--- a/libjava/gnu/xml/dom/DomDocumentBuilder.java
+++ b/libjava/gnu/xml/dom/DomDocumentBuilder.java
@@ -40,7 +40,6 @@ package gnu.xml.dom;
import java.io.InputStream;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.DOMConfiguration;
import org.w3c.dom.DOMImplementation;
diff --git a/libjava/gnu/xml/dom/DomDocumentConfiguration.java b/libjava/gnu/xml/dom/DomDocumentConfiguration.java
index eebee09bba6..38d6e6d7bb3 100644
--- a/libjava/gnu/xml/dom/DomDocumentConfiguration.java
+++ b/libjava/gnu/xml/dom/DomDocumentConfiguration.java
@@ -99,8 +99,8 @@ class DomDocumentConfiguration
}
catch (ClassCastException e)
{
- throw new DomEx(DomEx.TYPE_MISMATCH_ERR,
- value.getClass().getName(), null, 0);
+ throw new DomDOMException(DOMException.TYPE_MISMATCH_ERR,
+ value.getClass().getName(), null, 0);
}
}
else if ("namespace-declarations".equals(name))
@@ -140,7 +140,8 @@ class DomDocumentConfiguration
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR, name, null, 0);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR,
+ name, null, 0);
}
}
@@ -197,7 +198,7 @@ class DomDocumentConfiguration
namespaceDeclarations == true &&
comments == true) ? Boolean.TRUE : Boolean.FALSE;
}
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR, name, null, 0);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, name, null, 0);
}
public boolean canSetParameter(String name, Object value)
diff --git a/libjava/gnu/xml/dom/DomElement.java b/libjava/gnu/xml/dom/DomElement.java
index fb04638af12..535608343f9 100644
--- a/libjava/gnu/xml/dom/DomElement.java
+++ b/libjava/gnu/xml/dom/DomElement.java
@@ -42,6 +42,7 @@ import java.util.Set;
import javax.xml.XMLConstants;
import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -262,7 +263,7 @@ public class DomElement
if (("xmlns".equals (aname) || aname.startsWith ("xmlns:"))
&& !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals (uri))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
"setting xmlns attribute to illegal value", this, 0);
}
@@ -318,9 +319,9 @@ public class DomElement
{
attributes.removeNamedItem(name);
}
- catch (DomEx e)
+ catch (DomDOMException e)
{
- if (e.code != DomEx.NOT_FOUND_ERR)
+ if (e.code != DOMException.NOT_FOUND_ERR)
{
throw e;
}
@@ -340,7 +341,7 @@ public class DomElement
{
if (attributes == null)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR, null, node, 0);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, node, 0);
}
return (Attr) attributes.removeNamedItem(node.getNodeName());
}
@@ -358,7 +359,7 @@ public class DomElement
{
if (attributes == null)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR, localPart, null, 0);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR, localPart, null, 0);
}
attributes.removeNamedItemNS (namespace, localPart);
}
@@ -487,11 +488,11 @@ public class DomElement
{
if (readonly)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
if (attr == null || attr.getOwnerElement() != this)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR);
}
if (isId)
{
diff --git a/libjava/gnu/xml/dom/DomEx.java b/libjava/gnu/xml/dom/DomEx.java
deleted file mode 100644
index aacac968932..00000000000
--- a/libjava/gnu/xml/dom/DomEx.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* DomEx.java --
- Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.xml.dom;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-
-/**
- * <p> DOMException implementation. The version that
- * is provided by the W3C is abstract, so it can't be instantiated.
- *
- * <p> This also provides a bit more information about the error
- * that is being reported, in terms of the relevant DOM structures
- * and data.
- *
- * @author David Brownell
- */
-public class DomEx
- extends DOMException
-{
-
- /** @serial Data that caused an error to be reported */
- private String data;
-
- /** @serial Node associated with the error. */
- private Node node;
-
- /** @serial Data associated with the error. */
- private int value;
-
- /**
- * Constructs an exception, with the diagnostic message
- * corresponding to the specified code.
- */
- public DomEx(short code)
- {
- super(code, diagnostic(code));
- }
-
- /**
- * Constructs an exception, with the diagnostic message
- * corresponding to the specified code and additional
- * information as provided.
- */
- public DomEx(short code, String data, Node node, int value)
- {
- super(code, diagnostic(code));
- this.data = data;
- this.node = node;
- this.value = value;
- }
-
- /** Returns the node to which the diagnotic applies, or null. */
- final public Node getNode()
- {
- return node;
- }
-
- /** Returns data to which the diagnotic applies, or null. */
- final public String getData()
- {
- return data;
- }
-
- /** Returns data to which the diagnotic applies, or null. */
- final public int getValue()
- {
- return value;
- }
-
- /**
- * Returns a diagnostic message that may be slightly more useful
- * than the generic one, where possible.
- */
- public String getMessage()
- {
- String retval = super.getMessage();
-
- if (data != null)
- {
- retval += "\nMore Information: " + data;
- }
- if (value != 0)
- {
- retval += "\nNumber: " + value;
- }
- if (node != null)
- {
- retval += "\nNode Name: " + node.getNodeName();
- }
- return retval;
- }
-
- // these strings should be localizable.
-
- private static String diagnostic(short code)
- {
- switch (code)
- {
- // DOM L1:
- case INDEX_SIZE_ERR:
- return "An index or size is out of range.";
- case DOMSTRING_SIZE_ERR:
- return "A string is too big.";
- case HIERARCHY_REQUEST_ERR:
- return "The node doesn't belong here.";
- case WRONG_DOCUMENT_ERR:
- return "The node belongs in another document.";
- case INVALID_CHARACTER_ERR:
- return "That character is not permitted.";
- case NO_DATA_ALLOWED_ERR:
- return "This node does not permit data.";
- case NO_MODIFICATION_ALLOWED_ERR:
- return "No changes are allowed.";
- case NOT_FOUND_ERR:
- return "The node was not found in that context.";
- case NOT_SUPPORTED_ERR:
- return "That object is not supported.";
- case INUSE_ATTRIBUTE_ERR:
- return "The attribute belongs to a different element.";
-
- // DOM L2:
- case INVALID_STATE_ERR:
- return "The object is not usable.";
- case SYNTAX_ERR:
- return "An illegal string was provided.";
- case INVALID_MODIFICATION_ERR:
- return "An object's type may not be changed.";
- case NAMESPACE_ERR:
- return "The operation violates XML Namespaces.";
- case INVALID_ACCESS_ERR:
- return "Parameter or operation isn't supported by this node.";
- case TYPE_MISMATCH_ERR:
- return "The type of the argument is incompatible with the expected type.";
- }
- return "Reserved exception number: " + code;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomFragment.java b/libjava/gnu/xml/dom/DomFragment.java
deleted file mode 100644
index 44763a956c0..00000000000
--- a/libjava/gnu/xml/dom/DomFragment.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/* DomFragment.java --
- Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.xml.dom;
-
-import org.w3c.dom.DocumentFragment;
-
-/**
- * <p> "DocumentFragment" implementation. </p>
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomFragment
- extends DomNode
- implements DocumentFragment
-{
-
- /**
- * Constructs a DocumentFragment node associated with the
- * specified document.
- *
- * <p>This constructor should only be invoked by a Document as part of
- * its createDocumentFragment functionality, or through a subclass which
- * is similarly used in a "Sub-DOM" style layer.
- */
- protected DomFragment(DomDocument owner)
- {
- super(DOCUMENT_FRAGMENT_NODE, owner);
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the string "#document-fragment".
- */
- final public String getNodeName()
- {
- return "#document-fragment";
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomImpl.java b/libjava/gnu/xml/dom/DomImpl.java
index 1a16de32593..feb7ea703cc 100644
--- a/libjava/gnu/xml/dom/DomImpl.java
+++ b/libjava/gnu/xml/dom/DomImpl.java
@@ -207,7 +207,8 @@ public class DomImpl
root = doc.createElementNS(namespaceURI, rootName);
if (rootName.startsWith("xmlns:"))
{
- throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", null, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "xmlns is reserved", null, 0);
}
}
// Bleech -- L2 seemingly _requires_ omission of xmlns attributes.
diff --git a/libjava/gnu/xml/dom/DomIterator.java b/libjava/gnu/xml/dom/DomIterator.java
index 3dfd9640334..bb1f2cff2af 100644
--- a/libjava/gnu/xml/dom/DomIterator.java
+++ b/libjava/gnu/xml/dom/DomIterator.java
@@ -37,8 +37,7 @@ exception statement from your version. */
package gnu.xml.dom;
-import java.util.Vector;
-
+import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
@@ -76,7 +75,7 @@ public final class DomIterator
{
if (!root.isSupported("MutationEvents", "2.0"))
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR,
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR,
"Iterator needs mutation events", root, 0);
}
@@ -154,7 +153,7 @@ public final class DomIterator
{
if (done)
{
- throw new DomEx(DomEx.INVALID_STATE_ERR);
+ throw new DomDOMException(DOMException.INVALID_STATE_ERR);
}
right = true;
return walk(true);
@@ -171,7 +170,7 @@ public final class DomIterator
{
if (done)
{
- throw new DomEx(DomEx.INVALID_STATE_ERR);
+ throw new DomDOMException(DOMException.INVALID_STATE_ERR);
}
Node previous = reference;
right = false;
diff --git a/libjava/gnu/xml/dom/DomNamedNodeMap.java b/libjava/gnu/xml/dom/DomNamedNodeMap.java
index af7594249be..2b1106e64c0 100644
--- a/libjava/gnu/xml/dom/DomNamedNodeMap.java
+++ b/libjava/gnu/xml/dom/DomNamedNodeMap.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package gnu.xml.dom;
+import org.w3c.dom.DOMException;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -166,24 +167,24 @@ public class DomNamedNodeMap
{
if (readonly)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
DomNode node = (DomNode) arg;
if (node.owner != owner.owner)
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR);
}
if (node.nodeType != type)
{
- throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR);
+ throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR);
}
if (node.nodeType == Node.ATTRIBUTE_NODE)
{
DomNode element = node.parent;
if (element != null && element != owner)
{
- throw new DomEx(DomEx.INUSE_ATTRIBUTE_ERR);
+ throw new DomDOMException(DOMException.INUSE_ATTRIBUTE_ERR);
}
node.parent = owner;
node.depth = owner.depth + 1;
@@ -302,7 +303,7 @@ public class DomNamedNodeMap
{
if (readonly)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
// report attribute REMOVAL event?
@@ -369,7 +370,7 @@ public class DomNamedNodeMap
return ctx;
}
}
- throw new DomEx(DomEx.NOT_FOUND_ERR);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR);
}
String getDefaultValue(String name)
diff --git a/libjava/gnu/xml/dom/DomNode.java b/libjava/gnu/xml/dom/DomNode.java
index 3858fe8bbb9..20a62c53ba5 100644
--- a/libjava/gnu/xml/dom/DomNode.java
+++ b/libjava/gnu/xml/dom/DomNode.java
@@ -40,7 +40,6 @@ package gnu.xml.dom;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import javax.xml.XMLConstants;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
@@ -58,7 +57,6 @@ import org.w3c.dom.events.EventTarget;
import org.w3c.dom.events.MutationEvent;
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.traversal.NodeIterator;
-import org.w3c.dom.traversal.TreeWalker;
/**
* <p> "Node", "EventTarget", and "DocumentEvent" implementation.
@@ -308,15 +306,16 @@ public abstract class DomNode
{
if (readonly && !owner.building)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR,
- null, this, 0);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
+ null, this, 0);
}
for (DomNode ctx = this; ctx != null; ctx = ctx.parent)
{
if (child == ctx)
{
- throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR,
- "can't make ancestor into a child", this, 0);
+ throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
+ "can't make ancestor into a child",
+ this, 0);
}
}
@@ -330,8 +329,8 @@ public abstract class DomNode
// new in DOM L2, this case -- patch it up later, in reparent()
if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null))
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,
- null, child, 0);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
+ null, child, 0);
}
}
@@ -376,10 +375,12 @@ public abstract class DomNode
}
if (owner.checkingWellformedness)
{
- throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR,
- "can't append " + nodeTypeToString(childNodeType) +
- " to node of type " + nodeTypeToString(nodeType),
- this, 0);
+ throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
+ "can't append " +
+ nodeTypeToString(childNodeType) +
+ " to node of type " +
+ nodeTypeToString(nodeType),
+ this, 0);
}
}
@@ -578,8 +579,8 @@ public abstract class DomNode
}
catch (ClassCastException e)
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,
- null, newChild, 0);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
+ null, newChild, 0);
}
}
@@ -630,12 +631,14 @@ public abstract class DomNode
checkMisc(child);
if (ref == null || ref.parent != this)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR,
+ null, ref, 0);
}
if (ref == child)
{
- throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR,
- "can't insert node before itself", ref, 0);
+ throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR,
+ "can't insert node before itself",
+ ref, 0);
}
if (child.parent != null)
@@ -672,8 +675,8 @@ public abstract class DomNode
}
catch (ClassCastException e)
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,
- null, newChild, 0);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
+ null, newChild, 0);
}
}
@@ -721,7 +724,8 @@ public abstract class DomNode
}
if (ref == null || ref.parent != this)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR,
+ null, ref, 0);
}
if (reportMutations)
@@ -784,7 +788,8 @@ public abstract class DomNode
checkMisc(child);
if (ref == null || ref.parent != this)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR,
+ null, ref, 0);
}
if (reportMutations)
@@ -837,8 +842,8 @@ public abstract class DomNode
}
catch (ClassCastException e)
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,
- null, newChild, 0);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
+ null, newChild, 0);
}
}
@@ -860,12 +865,13 @@ public abstract class DomNode
if (ref == null || ref.parent != this)
{
- throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR,
+ null, ref, 0);
}
if (readonly && !owner.building)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR,
- null, this, 0);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
+ null, this, 0);
}
for (DomNode child = first; child != null; child = child.next)
@@ -909,13 +915,13 @@ public abstract class DomNode
return ref;
}
}
- throw new DomEx(DomEx.NOT_FOUND_ERR,
- "that's no child of mine", refChild, 0);
+ throw new DomDOMException(DOMException.NOT_FOUND_ERR,
+ "that's no child of mine", refChild, 0);
}
catch (ClassCastException e)
{
- throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,
- null, refChild, 0);
+ throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
+ null, refChild, 0);
}
}
@@ -1446,8 +1452,8 @@ public abstract class DomNode
// mouse events
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR,
- eventType, null, 0);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR,
+ eventType, null, 0);
}
/**
diff --git a/libjava/gnu/xml/dom/DomNsNode.java b/libjava/gnu/xml/dom/DomNsNode.java
index ea41fff6b8c..15b2fb54228 100644
--- a/libjava/gnu/xml/dom/DomNsNode.java
+++ b/libjava/gnu/xml/dom/DomNsNode.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package gnu.xml.dom;
import javax.xml.XMLConstants;
+import org.w3c.dom.DOMException;
/**
* <p> Abstract implemention of namespace support. This facilitates
@@ -135,7 +136,7 @@ public abstract class DomNsNode
{
if (readonly)
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
if (prefix == null)
@@ -145,40 +146,42 @@ public abstract class DomNsNode
}
else if (namespace == null)
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "can't set prefix, node has no namespace URI",
- this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "can't set prefix, node has no namespace URI",
+ this, 0);
}
DomDocument.checkName(prefix, "1.1".equals(owner.getXmlVersion()));
if (prefix.indexOf (':') != -1)
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "illegal prefix " + prefix, this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "illegal prefix " + prefix, this, 0);
}
if (XMLConstants.XML_NS_PREFIX.equals(prefix)
&& !XMLConstants.XML_NS_URI.equals(namespace))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "xml namespace is always " +
- XMLConstants.XML_NS_URI, this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "xml namespace is always " +
+ XMLConstants.XML_NS_URI, this, 0);
}
if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix))
{
if (namespace != null || getNodeType() != ATTRIBUTE_NODE)
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "xmlns attribute prefix is reserved", this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "xmlns attribute prefix is reserved",
+ this, 0);
}
}
else if (getNodeType () == ATTRIBUTE_NODE
&& (XMLConstants.XMLNS_ATTRIBUTE.equals(name) ||
name.startsWith("xmlns:")))
{
- throw new DomEx(DomEx.NAMESPACE_ERR,
- "namespace declarations can't change names", this, 0);
+ throw new DomDOMException(DOMException.NAMESPACE_ERR,
+ "namespace declarations can't change names",
+ this, 0);
}
this.prefix = prefix.intern();
diff --git a/libjava/gnu/xml/dom/DomPI.java b/libjava/gnu/xml/dom/DomPI.java
deleted file mode 100644
index dedf375153c..00000000000
--- a/libjava/gnu/xml/dom/DomPI.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* DomPI.java --
- Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.xml.dom;
-
-import org.w3c.dom.ProcessingInstruction;
-
-/**
- * <p> "ProcessingInstruction" (PI) implementation.
- * This is a non-core DOM class, supporting the "XML" feature. </p>
- *
- * <p> Unlike other DOM APIs in the "XML" feature, this one fully
- * exposes the functionality it describes. So there is no reason
- * inherent in DOM to avoid using this API, unless you want to rely
- * on NOTATION declarations to associate meaning with your PIs;
- * there is no vendor-neutal way to record those notations in DOM.</p>
- *
- * <p> Also of note is that PI support is part of SAX, so that XML
- * systems using PIs can choose among multiple APIs. </p>
- *
- * @see DomNotation
- *
- * @author David Brownell
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomPI
- extends DomNode
- implements ProcessingInstruction
-{
-
- private String target;
- private String data;
-
- /**
- * Constructs a ProcessingInstruction node associated with the
- * specified document, with the specified data.
- *
- * <p>This constructor should only be invoked by a Document object as
- * part of its createProcessingInstruction functionality, or through
- * a subclass which is similarly used in a "Sub-DOM" style layer.
- */
- protected DomPI(DomDocument owner, String target, String data)
- {
- super(PROCESSING_INSTRUCTION_NODE, owner);
- this.target = target;
- this.data = data;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the target of the processing instruction.
- */
- public final String getTarget()
- {
- return target;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the target of the processing instruction
- * (same as getTarget).
- */
- public final String getNodeName()
- {
- return target;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the data associated with the processing instruction.
- */
- public final String getData()
- {
- return data;
- }
-
- /**
- * <b>DOM L1</b>
- * Returns the data associated with the processing instruction
- * (same as getData).
- */
- public final String getNodeValue()
- {
- return data;
- }
-
- /**
- * <b>DOM L1</b>
- * Assigns the data associated with the processing instruction;
- * same as setNodeValue.
- */
- public final void setData(String data)
- {
- setNodeValue(data);
- }
-
- /**
- * <b>DOM L1</b>
- * Assigns the data associated with the processing instruction.
- */
- public final void setNodeValue(String data)
- {
- if (isReadonly())
- {
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
- }
- this.data = data;
- }
-
-}
-
diff --git a/libjava/gnu/xml/dom/DomText.java b/libjava/gnu/xml/dom/DomText.java
index d714655e61d..dc2d50a8eb7 100644
--- a/libjava/gnu/xml/dom/DomText.java
+++ b/libjava/gnu/xml/dom/DomText.java
@@ -102,7 +102,7 @@ public class DomText
{
if (isReadonly())
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
try
{
@@ -134,7 +134,7 @@ public class DomText
}
catch (IndexOutOfBoundsException x)
{
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
}
diff --git a/libjava/gnu/xml/dom/DomXPathExpression.java b/libjava/gnu/xml/dom/DomXPathExpression.java
index d92670d7eff..c22f29413ee 100644
--- a/libjava/gnu/xml/dom/DomXPathExpression.java
+++ b/libjava/gnu/xml/dom/DomXPathExpression.java
@@ -37,7 +37,6 @@ exception statement from your version. */
package gnu.xml.dom;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
diff --git a/libjava/gnu/xml/dom/DomXPathResult.java b/libjava/gnu/xml/dom/DomXPathResult.java
index 1cc49d8f733..5c57e25e204 100644
--- a/libjava/gnu/xml/dom/DomXPathResult.java
+++ b/libjava/gnu/xml/dom/DomXPathResult.java
@@ -39,10 +39,8 @@ package gnu.xml.dom;
import java.util.Collection;
import java.util.Iterator;
-import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.xpath.XPathException;
-import org.w3c.dom.xpath.XPathNSResolver;
import org.w3c.dom.xpath.XPathResult;
/**
diff --git a/libjava/gnu/xml/dom/JAXPFactory.java b/libjava/gnu/xml/dom/JAXPFactory.java
index 42712081094..3602ef6b9ab 100644
--- a/libjava/gnu/xml/dom/JAXPFactory.java
+++ b/libjava/gnu/xml/dom/JAXPFactory.java
@@ -40,7 +40,6 @@ package gnu.xml.dom;
import java.io.IOException;
import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
import org.w3c.dom.DOMImplementation;
import org.xml.sax.EntityResolver;
diff --git a/libjava/gnu/xml/dom/ls/DomLSEx.java b/libjava/gnu/xml/dom/ls/DomLSEx.java
deleted file mode 100644
index 5bf1595363f..00000000000
--- a/libjava/gnu/xml/dom/ls/DomLSEx.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* DomLSEx.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.xml.dom.ls;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import org.w3c.dom.ls.LSException;
-
-/**
- * A DOM LS exception incorporating a cause.
- *
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
- */
-public class DomLSEx
- extends LSException
-{
-
- private final Exception cause2;
-
- public DomLSEx(short type, Exception cause)
- {
- super(type, cause.getMessage());
- cause2 = cause;
- }
-
- public void printStackTrace(PrintStream out)
- {
- super.printStackTrace(out);
- out.print("caused by ");
- cause2.printStackTrace(out);
- }
-
- public void printStackTrace(PrintWriter out)
- {
- super.printStackTrace(out);
- out.print("caused by ");
- cause2.printStackTrace(out);
- }
-
-}
diff --git a/libjava/gnu/xml/dom/ls/DomLSParser.java b/libjava/gnu/xml/dom/ls/DomLSParser.java
index b050b99a1a2..489777fc913 100644
--- a/libjava/gnu/xml/dom/ls/DomLSParser.java
+++ b/libjava/gnu/xml/dom/ls/DomLSParser.java
@@ -65,7 +65,7 @@ import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import gnu.xml.dom.DomDocument;
-import gnu.xml.dom.DomEx;
+import gnu.xml.dom.DomDOMException;
/**
* Parser implementation for GNU DOM.
@@ -117,7 +117,7 @@ public class DomLSParser
async = false;
break;
default:
- throw new DomEx(DOMException.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
// TODO schemaType
this.schemaType = schemaType;
@@ -307,13 +307,13 @@ public class DomLSParser
{
reader = null;
eventSink = null;
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
catch (IOException e)
{
reader = null;
eventSink = null;
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
// return document
Document ret = eventSink.doc;
@@ -341,11 +341,11 @@ public class DomLSParser
}
catch (ParserConfigurationException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
catch (SAXException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
}
return reader;
@@ -371,11 +371,11 @@ public class DomLSParser
}
catch (SAXException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
catch (IOException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
}
if (source == null)
@@ -403,7 +403,7 @@ public class DomLSParser
}
catch (IOException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
}
return source;
@@ -457,7 +457,7 @@ public class DomLSParser
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
// invalidate reader, a new one will be created
reader = null;
@@ -509,7 +509,7 @@ public class DomLSParser
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
}
diff --git a/libjava/gnu/xml/dom/ls/DomLSSerializer.java b/libjava/gnu/xml/dom/ls/DomLSSerializer.java
index 91a01c96e0e..ec27c5de65b 100644
--- a/libjava/gnu/xml/dom/ls/DomLSSerializer.java
+++ b/libjava/gnu/xml/dom/ls/DomLSSerializer.java
@@ -58,7 +58,7 @@ import org.w3c.dom.ls.LSOutput;
import org.w3c.dom.ls.LSSerializer;
import org.w3c.dom.ls.LSSerializerFilter;
import org.w3c.dom.traversal.NodeFilter;
-import gnu.xml.dom.DomEx;
+import gnu.xml.dom.DomDOMException;
import gnu.xml.transform.StreamSerializer;
/**
@@ -147,7 +147,7 @@ public class DomLSSerializer
}
catch (IOException e)
{
- throw new DomLSEx(LSException.SERIALIZE_ERR, e);
+ throw new DomLSException(LSException.SERIALIZE_ERR, e);
}
}
@@ -302,7 +302,7 @@ public class DomLSSerializer
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
}
@@ -319,7 +319,7 @@ public class DomLSSerializer
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
}
diff --git a/libjava/gnu/xml/pipeline/CallFilter.java b/libjava/gnu/xml/pipeline/CallFilter.java
index 0d8585991df..da1a2e9c102 100644
--- a/libjava/gnu/xml/pipeline/CallFilter.java
+++ b/libjava/gnu/xml/pipeline/CallFilter.java
@@ -37,11 +37,18 @@ exception statement from your version. */
package gnu.xml.pipeline;
-import java.io.*;
-import java.net.*;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.io.Writer;
+
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import gnu.xml.util.Resolver;
diff --git a/libjava/gnu/xml/pipeline/DomConsumer.java b/libjava/gnu/xml/pipeline/DomConsumer.java
index 17fdeeb3453..e3136093c50 100644
--- a/libjava/gnu/xml/pipeline/DomConsumer.java
+++ b/libjava/gnu/xml/pipeline/DomConsumer.java
@@ -37,17 +37,30 @@ exception statement from your version. */
package gnu.xml.pipeline;
-import java.util.Hashtable;
+import gnu.xml.aelfred2.ContentHandler2;
+import gnu.xml.util.DomParser;
-import org.w3c.dom.*;
-import org.xml.sax.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.ext.DeclHandler;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.AttributesImpl;
-
-import gnu.xml.aelfred2.ContentHandler2;
-import gnu.xml.util.DomParser;
-
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Document;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.Node;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
/**
* This consumer builds a DOM Document from its input, acting either as a
diff --git a/libjava/gnu/xml/pipeline/LinkFilter.java b/libjava/gnu/xml/pipeline/LinkFilter.java
index 28a45017046..465103b2251 100644
--- a/libjava/gnu/xml/pipeline/LinkFilter.java
+++ b/libjava/gnu/xml/pipeline/LinkFilter.java
@@ -43,7 +43,6 @@ import java.util.Enumeration;
import java.util.Vector;
import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
import org.xml.sax.SAXException;
diff --git a/libjava/gnu/xml/pipeline/NSFilter.java b/libjava/gnu/xml/pipeline/NSFilter.java
index 9e8a6436503..63e167361c1 100644
--- a/libjava/gnu/xml/pipeline/NSFilter.java
+++ b/libjava/gnu/xml/pipeline/NSFilter.java
@@ -37,16 +37,17 @@ exception statement from your version. */
package gnu.xml.pipeline;
-import java.util.EmptyStackException;
import java.util.Enumeration;
import java.util.Stack;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-
/**
* This filter ensures that element and attribute names are properly prefixed,
* and that such prefixes are declared. Such data is critical for operations
diff --git a/libjava/gnu/xml/pipeline/TeeConsumer.java b/libjava/gnu/xml/pipeline/TeeConsumer.java
index 6d3227eda11..922e79cf29f 100644
--- a/libjava/gnu/xml/pipeline/TeeConsumer.java
+++ b/libjava/gnu/xml/pipeline/TeeConsumer.java
@@ -37,11 +37,15 @@ exception statement from your version. */
package gnu.xml.pipeline;
-import java.io.IOException;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-//import gnu.xml.util;
-
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
/**
* Fans its events out to two other consumers, a "tee" filter stage in an
diff --git a/libjava/gnu/xml/pipeline/ValidationConsumer.java b/libjava/gnu/xml/pipeline/ValidationConsumer.java
index e73c0ffe21c..719270e0754 100644
--- a/libjava/gnu/xml/pipeline/ValidationConsumer.java
+++ b/libjava/gnu/xml/pipeline/ValidationConsumer.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package gnu.xml.pipeline;
-import java.io.*;
-
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
import java.util.EmptyStackException;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -46,11 +47,16 @@ import java.util.Stack;
import java.util.StringTokenizer;
import java.util.Vector;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
-
/**
* This class checks SAX2 events to report validity errors; it works as
* both a filter and a terminus on an event pipeline. It relies on the
diff --git a/libjava/gnu/xml/pipeline/WellFormednessFilter.java b/libjava/gnu/xml/pipeline/WellFormednessFilter.java
index 3047ae3567f..4f3f200c007 100644
--- a/libjava/gnu/xml/pipeline/WellFormednessFilter.java
+++ b/libjava/gnu/xml/pipeline/WellFormednessFilter.java
@@ -40,10 +40,11 @@ package gnu.xml.pipeline;
import java.util.EmptyStackException;
import java.util.Stack;
-import gnu.xml.aelfred2.SAXDriver;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-
+import org.xml.sax.Attributes;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
/**
* This filter reports fatal exceptions in the case of event streams that
diff --git a/libjava/gnu/xml/pipeline/XIncludeFilter.java b/libjava/gnu/xml/pipeline/XIncludeFilter.java
index efa05d942f9..042cadda613 100644
--- a/libjava/gnu/xml/pipeline/XIncludeFilter.java
+++ b/libjava/gnu/xml/pipeline/XIncludeFilter.java
@@ -42,7 +42,6 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
-import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Stack;
import java.util.Vector;
diff --git a/libjava/gnu/xml/pipeline/XsltFilter.java b/libjava/gnu/xml/pipeline/XsltFilter.java
index b1bebbe98a5..9f77f9937bf 100644
--- a/libjava/gnu/xml/pipeline/XsltFilter.java
+++ b/libjava/gnu/xml/pipeline/XsltFilter.java
@@ -44,7 +44,6 @@ import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.sax.*;
import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
import org.xml.sax.ext.LexicalHandler;
diff --git a/libjava/gnu/xml/transform/ApplyImportsNode.java b/libjava/gnu/xml/transform/ApplyImportsNode.java
index 2b286550484..39d9dea9af6 100644
--- a/libjava/gnu/xml/transform/ApplyImportsNode.java
+++ b/libjava/gnu/xml/transform/ApplyImportsNode.java
@@ -37,15 +37,9 @@ exception statement from your version. */
package gnu.xml.transform;
-import java.util.Collection;
-import java.util.Iterator;
-import java.text.DecimalFormat;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import gnu.xml.xpath.Expr;
/**
* A template node representing an XSLT <code>apply-imports</code> instruction.
diff --git a/libjava/gnu/xml/transform/Bindings.java b/libjava/gnu/xml/transform/Bindings.java
index f898a7288b0..75a8a165138 100644
--- a/libjava/gnu/xml/transform/Bindings.java
+++ b/libjava/gnu/xml/transform/Bindings.java
@@ -45,12 +45,8 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
import javax.xml.xpath.XPathVariableResolver;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
/**
* The set of variable bindings in effect for a stylesheet.
diff --git a/libjava/gnu/xml/transform/DocumentFunction.java b/libjava/gnu/xml/transform/DocumentFunction.java
index 03f22b4ced2..78862dc9e57 100644
--- a/libjava/gnu/xml/transform/DocumentFunction.java
+++ b/libjava/gnu/xml/transform/DocumentFunction.java
@@ -37,22 +37,16 @@ exception statement from your version. */
package gnu.xml.transform;
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
-import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource;
import javax.xml.xpath.XPathFunction;
import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
import gnu.xml.xpath.Constant;
import gnu.xml.xpath.Expr;
diff --git a/libjava/gnu/xml/transform/FormatNumberFunction.java b/libjava/gnu/xml/transform/FormatNumberFunction.java
index 73c5af43a2b..393cb99ffea 100644
--- a/libjava/gnu/xml/transform/FormatNumberFunction.java
+++ b/libjava/gnu/xml/transform/FormatNumberFunction.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.xml.transform;
import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
diff --git a/libjava/gnu/xml/transform/NodeNumberNode.java b/libjava/gnu/xml/transform/NodeNumberNode.java
index 76f8d7eea3d..aae86c6f2a3 100644
--- a/libjava/gnu/xml/transform/NodeNumberNode.java
+++ b/libjava/gnu/xml/transform/NodeNumberNode.java
@@ -43,13 +43,10 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.NodeTypeTest;
import gnu.xml.xpath.Pattern;
import gnu.xml.xpath.Selector;
-import gnu.xml.xpath.Test;
import gnu.xml.xpath.UnionExpr;
/**
diff --git a/libjava/gnu/xml/transform/NumberNode.java b/libjava/gnu/xml/transform/NumberNode.java
index 0970ac9733d..b01b983dff1 100644
--- a/libjava/gnu/xml/transform/NumberNode.java
+++ b/libjava/gnu/xml/transform/NumberNode.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.xml.transform;
import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
import gnu.xml.xpath.Expr;
diff --git a/libjava/gnu/xml/transform/Stylesheet.java b/libjava/gnu/xml/transform/Stylesheet.java
index 80f5781e2fd..6250fd542ef 100644
--- a/libjava/gnu/xml/transform/Stylesheet.java
+++ b/libjava/gnu/xml/transform/Stylesheet.java
@@ -58,7 +58,6 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFunction;
import javax.xml.xpath.XPathFunctionResolver;
import javax.xml.xpath.XPathExpressionException;
@@ -68,7 +67,6 @@ import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.w3c.dom.UserDataHandler;
import gnu.xml.xpath.Expr;
diff --git a/libjava/gnu/xml/transform/SystemPropertyFunction.java b/libjava/gnu/xml/transform/SystemPropertyFunction.java
index 3d95d21d585..03518e9cb89 100644
--- a/libjava/gnu/xml/transform/SystemPropertyFunction.java
+++ b/libjava/gnu/xml/transform/SystemPropertyFunction.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.xml.transform;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathFunction;
diff --git a/libjava/gnu/xml/transform/Template.java b/libjava/gnu/xml/transform/Template.java
index 6aaa4c1c69f..0e7c67a7e52 100644
--- a/libjava/gnu/xml/transform/Template.java
+++ b/libjava/gnu/xml/transform/Template.java
@@ -39,9 +39,7 @@ package gnu.xml.transform;
import java.io.PrintStream;
import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Node;
import gnu.xml.xpath.Expr;
import gnu.xml.xpath.NameTest;
diff --git a/libjava/gnu/xml/transform/TemplatesImpl.java b/libjava/gnu/xml/transform/TemplatesImpl.java
index a7403e9ee2c..173fb036fb8 100644
--- a/libjava/gnu/xml/transform/TemplatesImpl.java
+++ b/libjava/gnu/xml/transform/TemplatesImpl.java
@@ -38,12 +38,9 @@ exception statement from your version. */
package gnu.xml.transform;
import java.util.Properties;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.URIResolver;
/**
* GNU precompiled stylesheet implementation.
diff --git a/libjava/gnu/xml/transform/TransformerImpl.java b/libjava/gnu/xml/transform/TransformerImpl.java
index fb4632e3f38..c0af0fca440 100644
--- a/libjava/gnu/xml/transform/TransformerImpl.java
+++ b/libjava/gnu/xml/transform/TransformerImpl.java
@@ -48,9 +48,6 @@ import java.net.UnknownServiceException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
import java.util.Properties;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.OutputKeys;
@@ -67,7 +64,6 @@ import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import org.xml.sax.ContentHandler;
@@ -76,8 +72,6 @@ import org.xml.sax.ext.LexicalHandler;
import gnu.xml.dom.DomDoctype;
import gnu.xml.dom.DomDocument;
import gnu.xml.dom.ls.WriterOutputStream;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Root;
/**
* The transformation process for a given stylesheet.
diff --git a/libjava/gnu/xml/transform/ValueOfNode.java b/libjava/gnu/xml/transform/ValueOfNode.java
index 6027052e9e1..9eb2fde5d3a 100644
--- a/libjava/gnu/xml/transform/ValueOfNode.java
+++ b/libjava/gnu/xml/transform/ValueOfNode.java
@@ -37,9 +37,6 @@ exception statement from your version. */
package gnu.xml.transform;
-import java.util.Collection;
-import java.util.Iterator;
-import java.text.DecimalFormat;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
import org.w3c.dom.Document;
diff --git a/libjava/gnu/xml/transform/XSLURIResolver.java b/libjava/gnu/xml/transform/XSLURIResolver.java
index 2603cdd831f..f0f417202fb 100644
--- a/libjava/gnu/xml/transform/XSLURIResolver.java
+++ b/libjava/gnu/xml/transform/XSLURIResolver.java
@@ -41,7 +41,6 @@ import java.io.File;
import java.io.InputStream;
import java.io.IOException;
import java.io.Reader;
-import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
diff --git a/libjava/gnu/xml/util/DoParse.java b/libjava/gnu/xml/util/DoParse.java
index 23721de7657..6f255c80453 100644
--- a/libjava/gnu/xml/util/DoParse.java
+++ b/libjava/gnu/xml/util/DoParse.java
@@ -37,28 +37,22 @@ exception statement from your version. */
package gnu.xml.util;
-import java.io.*;
+import java.io.IOException;
-import org.xml.sax.*;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.ext.*;
-// import gnu.xml.pipeline.*;
-// Added imports directly to fix a GCJ problem.
-import gnu.xml.pipeline.CallFilter;
-import gnu.xml.pipeline.DomConsumer;
import gnu.xml.pipeline.EventConsumer;
import gnu.xml.pipeline.EventFilter;
-import gnu.xml.pipeline.LinkFilter;
import gnu.xml.pipeline.NSFilter;
import gnu.xml.pipeline.PipelineFactory;
import gnu.xml.pipeline.TeeConsumer;
-import gnu.xml.pipeline.TextConsumer;
import gnu.xml.pipeline.ValidationConsumer;
import gnu.xml.pipeline.WellFormednessFilter;
-import gnu.xml.pipeline.XIncludeFilter;
-import gnu.xml.pipeline.XsltFilter;
-
/**
* This class provides a driver which may be invoked from the command line
diff --git a/libjava/gnu/xml/util/Resolver.java b/libjava/gnu/xml/util/Resolver.java
index 4ca078774ec..97256c3c861 100644
--- a/libjava/gnu/xml/util/Resolver.java
+++ b/libjava/gnu/xml/util/Resolver.java
@@ -37,13 +37,13 @@ exception statement from your version. */
package gnu.xml.util;
-import java.io.*;
-
+import java.io.File;
+import java.io.IOException;
import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.xml.sax.*;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
/**
* Utility implementation of a SAX resolver, which can be used to improve
diff --git a/libjava/gnu/xml/util/SAXNullTransformerFactory.java b/libjava/gnu/xml/util/SAXNullTransformerFactory.java
index 3b199f6dc0d..ef03d42fc38 100644
--- a/libjava/gnu/xml/util/SAXNullTransformerFactory.java
+++ b/libjava/gnu/xml/util/SAXNullTransformerFactory.java
@@ -635,7 +635,8 @@ public class SAXNullTransformerFactory extends SAXTransformerFactory
// preserve original namespace prefixes
try
{
- producer.setFeature(handler.FEATURE_URI + "namespace-prefixes",
+ producer.setFeature(EventFilter.FEATURE_URI +
+ "namespace-prefixes",
true);
}
catch (Exception e)
@@ -646,7 +647,7 @@ public class SAXNullTransformerFactory extends SAXTransformerFactory
// arrange the output
handler.setResult (out);
- handler.bind (producer, handler);
+ EventFilter.bind (producer, handler);
// then parse ... single element pipeline
producer.parse (input);
diff --git a/libjava/gnu/xml/xpath/Expr.java b/libjava/gnu/xml/xpath/Expr.java
index 6a933c8c598..fcfae52addc 100644
--- a/libjava/gnu/xml/xpath/Expr.java
+++ b/libjava/gnu/xml/xpath/Expr.java
@@ -58,9 +58,7 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Document;
-import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
diff --git a/libjava/gnu/xml/xpath/FunctionCall.java b/libjava/gnu/xml/xpath/FunctionCall.java
index 2c77b586903..35eacb51678 100644
--- a/libjava/gnu/xml/xpath/FunctionCall.java
+++ b/libjava/gnu/xml/xpath/FunctionCall.java
@@ -38,7 +38,6 @@ exception statement from your version. */
package gnu.xml.xpath;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
diff --git a/libjava/gnu/xml/xpath/Predicate.java b/libjava/gnu/xml/xpath/Predicate.java
index 81e1755fbda..a857c16bbf1 100644
--- a/libjava/gnu/xml/xpath/Predicate.java
+++ b/libjava/gnu/xml/xpath/Predicate.java
@@ -63,7 +63,7 @@ class Predicate
// Same as [position() = x]
return ((Double) ret).intValue() == pos;
}
- return expr._boolean(node, expr.evaluate(node, pos, len));
+ return Expr._boolean(node, expr.evaluate(node, pos, len));
}
public Test clone(Object context)
diff --git a/libjava/gnu/xml/xpath/RelationalExpr.java b/libjava/gnu/xml/xpath/RelationalExpr.java
index e039cc1c600..fcdc932ab38 100644
--- a/libjava/gnu/xml/xpath/RelationalExpr.java
+++ b/libjava/gnu/xml/xpath/RelationalExpr.java
@@ -37,7 +37,6 @@ exception statement from your version. */
package gnu.xml.xpath;
-import java.util.Collection;
import org.w3c.dom.Node;
/**
diff --git a/libjava/gnu/xml/xpath/Selector.java b/libjava/gnu/xml/xpath/Selector.java
index 5431cbe1fdd..5fd45b9117a 100644
--- a/libjava/gnu/xml/xpath/Selector.java
+++ b/libjava/gnu/xml/xpath/Selector.java
@@ -39,7 +39,6 @@ package gnu.xml.xpath;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
@@ -48,7 +47,6 @@ import javax.xml.XMLConstants;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* A single component of a location path.
diff --git a/libjava/gnu/xml/xpath/XPathParser.java b/libjava/gnu/xml/xpath/XPathParser.java
index 973919bae69..188cfb5bf66 100644
--- a/libjava/gnu/xml/xpath/XPathParser.java
+++ b/libjava/gnu/xml/xpath/XPathParser.java
@@ -43,7 +43,6 @@ package gnu.xml.xpath;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathFunctionResolver;
diff --git a/libjava/include/Makefile.am b/libjava/include/Makefile.am
index 5b6177b3d68..089884b5fbd 100644
--- a/libjava/include/Makefile.am
+++ b/libjava/include/Makefile.am
@@ -5,4 +5,4 @@ AUTOMAKE_OPTIONS = foreign
# autoconf2.13's target_alias
target_noncanonical = @target_noncanonical@
-tool_include__HEADERS = jni.h jvmpi.h
+tool_include__HEADERS = jni.h jawt.h jawt_md.h jvmpi.h
diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in
index 7d2bb461bc9..4c05fcedf5e 100644
--- a/libjava/include/Makefile.in
+++ b/libjava/include/Makefile.in
@@ -296,7 +296,7 @@ toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
toolexecmainlibdir = @toolexecmainlibdir@
AUTOMAKE_OPTIONS = foreign
-tool_include__HEADERS = jni.h jvmpi.h
+tool_include__HEADERS = jni.h jawt.h jawt_md.h jvmpi.h
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/libjava/include/java-props.h b/libjava/include/java-props.h
index 9be30996ebc..19d7106f8f2 100644
--- a/libjava/include/java-props.h
+++ b/libjava/include/java-props.h
@@ -21,6 +21,7 @@ typedef struct
// Set to NULL-terminated list of properties set at compile time.
extern const char **_Jv_Compiler_Properties;
+extern int _Jv_Properties_Count;
// The JAR file to add to the beginning of java.class.path.
extern const char *_Jv_Jar_Class_Path;
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index cf4d7d640d0..61e426f2e66 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -278,6 +278,7 @@ private:
public:
+ static bool has_field_p (jclass, _Jv_Utf8Const *);
static void print_class_loaded (jclass);
static void resolve_class_ref (jclass, jclass *);
static void wait_for_state(jclass, int);
@@ -525,6 +526,9 @@ void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *);
/* Free a JNIEnv. */
void _Jv_FreeJNIEnv (_Jv_JNIEnv *);
+/* Free a JNIEnv. */
+void _Jv_FreeJNIEnv (_Jv_JNIEnv *);
+
struct _Jv_JavaVM;
_Jv_JavaVM *_Jv_GetJavaVM ();
diff --git a/libjava/java/applet/Applet.java b/libjava/java/applet/Applet.java
index a7609d9ab63..3adc5ce0a4b 100644
--- a/libjava/java/applet/Applet.java
+++ b/libjava/java/applet/Applet.java
@@ -1,5 +1,5 @@
/* Applet.java -- Java base applet class
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,8 +63,8 @@ import javax.accessibility.AccessibleStateSet;
* are init, stop, and destroy for control purposes, and getAppletInfo and
* getParameterInfo for descriptive purposes.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
@@ -477,7 +477,7 @@ public class Applet extends Panel
* This class provides accessibility support for Applets, and is the
* runtime type returned by {@link #getAccessibleContext()}.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
*/
protected class AccessibleApplet extends AccessibleAWTPanel
diff --git a/libjava/java/awt/AWTError.java b/libjava/java/awt/AWTError.java
index 1c253cb41a6..e92bc01e67c 100644
--- a/libjava/java/awt/AWTError.java
+++ b/libjava/java/awt/AWTError.java
@@ -1,5 +1,5 @@
/* AWTError.java -- A serious AWT error occurred.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt;
* This error is thrown when a critical Abstract Window Toolkit (AWT) error
* occurs.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class AWTError extends Error
diff --git a/libjava/java/awt/AWTEvent.java b/libjava/java/awt/AWTEvent.java
index 675c27f9511..faa6dac25ef 100644
--- a/libjava/java/awt/AWTEvent.java
+++ b/libjava/java/awt/AWTEvent.java
@@ -50,8 +50,8 @@ import java.util.EventObject;
* listeners. Event masks are appropriately set when registering on
* components.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/AWTEventMulticaster.java b/libjava/java/awt/AWTEventMulticaster.java
index b26d1f35d05..943ffacfad3 100644
--- a/libjava/java/awt/AWTEventMulticaster.java
+++ b/libjava/java/awt/AWTEventMulticaster.java
@@ -107,8 +107,8 @@ import java.util.EventListener;
* new listener is then chained to the old.
*
* @author Bryce McKinlay
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/AWTException.java b/libjava/java/awt/AWTException.java
index e4ab6c9961f..49462a460e1 100644
--- a/libjava/java/awt/AWTException.java
+++ b/libjava/java/awt/AWTException.java
@@ -1,5 +1,5 @@
/* AWTException.java -- Generic AWT exception
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt;
* This is a generic exception that indicates an exception occurred in the
* Abstract Window Toolkit (AWT) system.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class AWTException extends Exception
diff --git a/libjava/java/awt/AWTKeyStroke.java b/libjava/java/awt/AWTKeyStroke.java
index 53e64b7fb1b..977b3848d6d 100644
--- a/libjava/java/awt/AWTKeyStroke.java
+++ b/libjava/java/awt/AWTKeyStroke.java
@@ -1,5 +1,5 @@
/* AWTKeyStroke.java -- an immutable key stroke
- Copyright (C) 2002, 2004 Free Software Foundation
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -63,7 +63,7 @@ import java.util.StringTokenizer;
* instances of a subclass, using reflection, provided the subclass has a
* no-arg constructor (of any accessibility).
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see #getAWTKeyStroke(char)
* @since 1.4
* @status updated to 1.4
@@ -393,15 +393,16 @@ public class AWTKeyStroke implements Serializable
* </code>
*
* @param s the string to parse
+ * @throws IllegalArgumentException if s is null or cannot be parsed
* @return the specified keystroke
- * @throws NullPointerException if s is null
- * @throws IllegalArgumentException if s cannot be parsed
*/
public static AWTKeyStroke getAWTKeyStroke(String s)
{
+ if (s == null)
+ throw new IllegalArgumentException("null argument");
StringTokenizer t = new StringTokenizer(s, " ");
if (! t.hasMoreTokens())
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("no tokens '" + s + "'");
int modifiers = 0;
boolean released = false;
String token = null;
@@ -432,7 +433,8 @@ public class AWTKeyStroke implements Serializable
KeyEvent.VK_UNDEFINED, modifiers,
false);
}
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Invalid 'typed' argument '"
+ + s + "'");
}
else if ("pressed".equals(token))
{
@@ -453,8 +455,11 @@ public class AWTKeyStroke implements Serializable
while (t.hasMoreTokens());
// Now token contains the VK name we must parse.
Integer code = (Integer) vktable.get(token);
- if (code == null || t.hasMoreTokens())
- throw new IllegalArgumentException();
+ if (code == null)
+ throw new IllegalArgumentException("Unknown token '" + token
+ + "' in '" + s + "'");
+ if (t.hasMoreTokens())
+ throw new IllegalArgumentException("Too many tokens: " + s);
return getAWTKeyStroke(KeyEvent.CHAR_UNDEFINED, code.intValue(),
modifiers, released);
}
diff --git a/libjava/java/awt/AWTPermission.java b/libjava/java/awt/AWTPermission.java
index b5ba63d58d0..fc4ae08d55e 100644
--- a/libjava/java/awt/AWTPermission.java
+++ b/libjava/java/awt/AWTPermission.java
@@ -82,7 +82,7 @@ import java.security.BasicPermission;
* <td>malicious code could masquerade as a trusted program</td></tr>
* </table>
*
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/ActiveEvent.java b/libjava/java/awt/ActiveEvent.java
index d43fef16df1..5710b38c470 100644
--- a/libjava/java/awt/ActiveEvent.java
+++ b/libjava/java/awt/ActiveEvent.java
@@ -47,7 +47,7 @@ package java.awt;
* untrusted code. For example, system code should use an ActiveEvent to
* invoke user code securely.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/Adjustable.java b/libjava/java/awt/Adjustable.java
index 815c77ca936..053ddd1c1e3 100644
--- a/libjava/java/awt/Adjustable.java
+++ b/libjava/java/awt/Adjustable.java
@@ -1,5 +1,5 @@
/* Adjustable.java -- Objects with a numeric adjustment scale
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.awt.event.AdjustmentListener;
* This interface is for objects that take a numeric value that can be
* adjusted within a bounded range. For example, a scroll bar.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/AlphaComposite.java b/libjava/java/awt/AlphaComposite.java
index f0795a96010..3c7744ba51e 100644
--- a/libjava/java/awt/AlphaComposite.java
+++ b/libjava/java/awt/AlphaComposite.java
@@ -1,5 +1,5 @@
/* AlphaComposite.java -- provides a context for performing alpha compositing
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.Map;
/**
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Composite
* @see CompositeContext
* @since 1.3
diff --git a/libjava/java/awt/AttributeValue.java b/libjava/java/awt/AttributeValue.java
index f692c012f9f..10efab18375 100644
--- a/libjava/java/awt/AttributeValue.java
+++ b/libjava/java/awt/AttributeValue.java
@@ -1,5 +1,5 @@
/* AttributeValue.java -- parent of type-safe enums of attributes
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt;
* <code>equals</code>, <code>toString</code>, and <code>hashCode</code>, so
* that you don't have to (although hashCode is commonly overridden).
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
class AttributeValue
{
diff --git a/libjava/java/awt/BasicStroke.java b/libjava/java/awt/BasicStroke.java
index e302a0ebc9f..b1772548ac2 100644
--- a/libjava/java/awt/BasicStroke.java
+++ b/libjava/java/awt/BasicStroke.java
@@ -1,5 +1,5 @@
/* BasicStroke.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,6 +48,7 @@ public class BasicStroke implements Stroke
public static final int JOIN_MITER = 0;
public static final int JOIN_ROUND = 1;
public static final int JOIN_BEVEL = 2;
+
public static final int CAP_BUTT = 0;
public static final int CAP_ROUND = 1;
public static final int CAP_SQUARE = 2;
@@ -208,11 +209,34 @@ public class BasicStroke implements Stroke
return phase;
}
+ /**
+ * Returns the hash code for this object. The hash is calculated by
+ * xoring the hash, cap, join, limit, dash array and phase values
+ * (converted to <code>int</code> first with
+ * <code>Float.floatToIntBits()</code> if the value is a
+ * <code>float</code>).
+ */
public int hashCode()
{
- throw new Error("not implemented");
+ int hash = Float.floatToIntBits(width);
+ hash ^= cap;
+ hash ^= join;
+ hash ^= Float.floatToIntBits(limit);
+
+ if (dash != null)
+ for (int i = 0; i < dash.length; i++)
+ hash ^= Float.floatToIntBits(dash[i]);
+
+ hash ^= Float.floatToIntBits(phase);
+
+ return hash;
}
+ /**
+ * Returns true if the given Object is an instance of BasicStroke
+ * and the width, cap, join, limit, dash array and phase are all
+ * equal.
+ */
public boolean equals(Object o)
{
if (! (o instanceof BasicStroke))
diff --git a/libjava/java/awt/BorderLayout.java b/libjava/java/awt/BorderLayout.java
index a023cbb059b..7a955d38139 100644
--- a/libjava/java/awt/BorderLayout.java
+++ b/libjava/java/awt/BorderLayout.java
@@ -1,5 +1,5 @@
/* BorderLayout.java -- A layout manager class
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.awt;
* in certain sectors of the parent container.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public class BorderLayout implements LayoutManager2, java.io.Serializable
{
diff --git a/libjava/java/awt/BufferCapabilities.java b/libjava/java/awt/BufferCapabilities.java
index 871529e6e93..9f91711e18a 100644
--- a/libjava/java/awt/BufferCapabilities.java
+++ b/libjava/java/awt/BufferCapabilities.java
@@ -1,5 +1,5 @@
/* BufferCapabilities.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
/**
* Needs documentation...
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see BufferStrategy#getCapabilities()
* @see GraphicsConfiguration#getCapabilities()
* @since 1.4
diff --git a/libjava/java/awt/Button.java b/libjava/java/awt/Button.java
index 86cb37cac90..eb0fe3b7a20 100644
--- a/libjava/java/awt/Button.java
+++ b/libjava/java/awt/Button.java
@@ -1,5 +1,5 @@
/* Button.java -- AWT button widget
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,6 @@ import java.util.EventListener;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleAction;
import javax.accessibility.AccessibleContext;
-import javax.accessibility.AccessibleRelation;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleValue;
@@ -55,7 +54,7 @@ import javax.accessibility.AccessibleValue;
* This class provides a button widget for the AWT.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class Button extends Component
implements java.io.Serializable, Accessible
@@ -97,7 +96,10 @@ private transient ActionListener action_listeners;
protected class AccessibleAWTButton extends AccessibleAWTComponent
implements AccessibleAction, AccessibleValue
{
- protected AccessibleAWTButton() { }
+ protected AccessibleAWTButton()
+ {
+ // Do nothing here.
+ }
/* (non-Javadoc)
* @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
@@ -429,9 +431,18 @@ paramString()
+ getWidth () + "x" + getHeight () + ",label=" + getLabel ();
}
+/**
+ * Gets the AccessibleContext associated with this <code>Button</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
public AccessibleContext getAccessibleContext()
{
- return new AccessibleAWTButton();
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTButton();
+ return accessibleContext;
}
/**
diff --git a/libjava/java/awt/Canvas.java b/libjava/java/awt/Canvas.java
index d177c9b7d7a..e223d9eae77 100644
--- a/libjava/java/awt/Canvas.java
+++ b/libjava/java/awt/Canvas.java
@@ -54,8 +54,8 @@ import javax.accessibility.AccessibleRole;
* full-scale custom components.
*
* @author Original author unknown
- * @author Tom Tromey <tromey@redhat.com>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.0
*/
@@ -174,10 +174,7 @@ public class Canvas
{
/* Create the context if this is the first request */
if (accessibleContext == null)
- {
- /* Create the context */
- accessibleContext = new AccessibleAWTCanvas();
- }
+ accessibleContext = new AccessibleAWTCanvas();
return accessibleContext;
}
diff --git a/libjava/java/awt/Checkbox.java b/libjava/java/awt/Checkbox.java
index 04ace46cabe..2a8b62afd05 100644
--- a/libjava/java/awt/Checkbox.java
+++ b/libjava/java/awt/Checkbox.java
@@ -1,5 +1,5 @@
/* Checkbox.java -- An AWT checkbox widget
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,6 +48,7 @@ import javax.accessibility.AccessibleAction;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
import javax.accessibility.AccessibleValue;
/**
@@ -55,7 +56,7 @@ import javax.accessibility.AccessibleValue;
* or more Checkboxes can be grouped by a CheckboxGroup.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
*/
public class Checkbox extends Component
implements ItemSelectable, Accessible, Serializable
@@ -94,13 +95,42 @@ private boolean state;
// The list of listeners for this object.
private transient ItemListener item_listeners;
-protected class AccessibleAWTCheckBox
+ /*
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_checkbox_number;
+
+/**
+ * This class provides accessibility support for the
+ * checkbox.
+ *
+ * @author Jerry Quinn (jlquinn@optonline.net)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+protected class AccessibleAWTCheckbox
extends AccessibleAWTComponent
implements ItemListener, AccessibleAction, AccessibleValue
{
-
+ /**
+ * Serialization constant to match JDK 1.5
+ */
+ private static final long serialVersionUID = 7881579233144754107L;
+
+ /**
+ * Default constructor which simply calls the
+ * super class for generic component accessibility
+ * handling.
+ */
+ public AccessibleAWTCheckbox()
+ {
+ super();
+ }
- /* (non-Javadoc)
+ /**
+ * Captures changes to the state of the checkbox and
+ * fires appropriate accessible property change events.
+ *
+ * @param event the event fired.
* @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
*/
public void itemStateChanged(ItemEvent event)
@@ -110,58 +140,121 @@ protected class AccessibleAWTCheckBox
state ? AccessibleState.CHECKED : null);
}
+ /**
+ * Returns an implementation of the <code>AccessibleAction</code>
+ * interface for this accessible object. In this case, the
+ * current instance is simply returned (with a more appropriate
+ * type), as it also implements the accessible action as well as
+ * the context.
+ *
+ * @return the accessible action associated with this context.
+ * @see javax.accessibility.AccessibleAction
+ */
public AccessibleAction getAccessibleAction()
{
return this;
}
+ /**
+ * Returns an implementation of the <code>AccessibleValue</code>
+ * interface for this accessible object. In this case, the
+ * current instance is simply returned (with a more appropriate
+ * type), as it also implements the accessible value as well as
+ * the context.
+ *
+ * @return the accessible value associated with this context.
+ * @see javax.accessibility.AccessibleValue
+ */
public AccessibleValue getAccessibleValue()
{
return this;
}
- /* (non-Javadoc)
+ /*
+ * The following methods are implemented in the JDK (up to
+ * 1.5) as stubs. We do likewise here.
+ */
+
+ /**
+ * Returns the number of actions associated with this accessible
+ * object. This default implementation returns 0.
+ *
+ * @return the number of accessible actions available.
* @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
*/
public int getAccessibleActionCount()
{
- // 1.4.1 does this
+ // 1.4.1 and 1.5 do this
return 0;
}
- /* (non-Javadoc)
+ /**
+ * Returns a description of the action with the supplied id.
+ * This default implementation always returns null.
+ *
+ * @param i the id of the action whose description should be
+ * retrieved.
+ * @return a <code>String</code> describing the action.
* @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
*/
public String getAccessibleActionDescription(int i)
{
+ // 1.5 does this
return null;
}
- /* (non-Javadoc)
+ /**
+ * Executes the action with the specified id. This
+ * default implementation simply returns false.
+ *
+ * @param i the id of the action to perform.
+ * @return true if the action was performed.
* @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
*/
public boolean doAccessibleAction(int i)
{
+ // 1.5 does this
return false;
}
- /* (non-Javadoc)
+ /**
+ * Returns the current value of this accessible object.
+ * If no value has been set, null is returned. This
+ * default implementation always returns null, regardless.
+ *
+ * @return the numeric value of this object, or null if
+ * no value has been set.
* @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
*/
public Number getCurrentAccessibleValue()
{
+ // 1.5 does this
return null;
}
- /* (non-Javadoc)
+ /**
+ * Sets the current value of this accessible object
+ * to that supplied. In this default implementation,
+ * the value is never set and the method always returns
+ * false.
+ *
+ * @param number the new accessible value.
+ * @return true if the value was set.
* @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
*/
public boolean setCurrentAccessibleValue(Number number)
{
+ // 1.5 does this
return false;
}
- /* (non-Javadoc)
+ /**
+ * Returns the minimum acceptable accessible value used
+ * by this object, or null if no minimum value exists.
+ * This default implementation always returns null.
+ *
+ * @return the minimum acceptable accessible value, or null
+ * if there is no minimum.
* @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
*/
public Number getMinimumAccessibleValue()
@@ -169,7 +262,13 @@ protected class AccessibleAWTCheckBox
return null;
}
- /* (non-Javadoc)
+ /**
+ * Returns the maximum acceptable accessible value used
+ * by this object, or null if no maximum value exists.
+ * This default implementation always returns null.
+ *
+ * @return the maximum acceptable accessible value, or null
+ * if there is no maximum.
* @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
*/
public Number getMaximumAccessibleValue()
@@ -177,11 +276,35 @@ protected class AccessibleAWTCheckBox
return null;
}
+ /**
+ * Returns the role of this accessible object.
+ *
+ * @return the instance of <code>AccessibleRole</code>,
+ * which describes this object.
+ * @see javax.accessibility.AccessibleRole
+ */
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.CHECK_BOX;
}
+ /**
+ * Returns the state set of this accessible object.
+ *
+ * @return a set of <code>AccessibleState</code>s
+ * which represent the current state of the
+ * accessible object.
+ * @see javax.accessibility.AccessibleState
+ * @see javax.accessibility.AccessibleStateSet
+ */
+ public AccessibleStateSet getAccessibleStateSet()
+ {
+ AccessibleStateSet set = super.getAccessibleStateSet();
+ if (state)
+ set.add(AccessibleState.CHECKED);
+ return set;
+ }
+
}
/*************************************************************************/
@@ -490,11 +613,36 @@ paramString()
+ "," + super.paramString());
}
+/**
+ * Gets the AccessibleContext associated with this <code>Checkbox</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
public AccessibleContext getAccessibleContext()
{
- AccessibleAWTCheckBox ac = new AccessibleAWTCheckBox();
- addItemListener(ac);
- return ac;
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ {
+ AccessibleAWTCheckbox ac = new AccessibleAWTCheckbox();
+ accessibleContext = ac;
+ addItemListener(ac);
+ }
+ return accessibleContext;
}
-} // class Checkbox
+ /**
+ * Generate a unique name for this checkbox.
+ *
+ * @return A unique name for this checkbox.
+ */
+ String generateName()
+ {
+ return "checkbox" + getUniqueLong();
+ }
+
+ private static synchronized long getUniqueLong()
+ {
+ return next_checkbox_number++;
+ }
+}
diff --git a/libjava/java/awt/CheckboxGroup.java b/libjava/java/awt/CheckboxGroup.java
index 52af1903a9c..d5d22688ee3 100644
--- a/libjava/java/awt/CheckboxGroup.java
+++ b/libjava/java/awt/CheckboxGroup.java
@@ -1,5 +1,5 @@
/* CheckboxGroup.java -- A grouping class for checkboxes.
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.awt;
* one checkbox in the group can be selected at any one time.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
*/
public class CheckboxGroup implements java.io.Serializable
{
diff --git a/libjava/java/awt/CheckboxMenuItem.java b/libjava/java/awt/CheckboxMenuItem.java
index ab4cb60f03c..d5e4ef511fe 100644
--- a/libjava/java/awt/CheckboxMenuItem.java
+++ b/libjava/java/awt/CheckboxMenuItem.java
@@ -1,5 +1,5 @@
/* CheckboxMenuItem.java -- A menu option with a checkbox on it.
- Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,14 +43,20 @@ import java.awt.event.ItemListener;
import java.awt.peer.CheckboxMenuItemPeer;
import java.util.EventListener;
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleAction;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleValue;
+
/**
* This class implements a menu item that has a checkbox on it indicating
* the selected state of some option.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
*/
-public class CheckboxMenuItem extends MenuItem implements ItemSelectable
+public class CheckboxMenuItem extends MenuItem
+ implements ItemSelectable, Accessible
{
/*
@@ -268,6 +274,14 @@ processItemEvent(ItemEvent event)
void
dispatchEventImpl(AWTEvent e)
{
+ if (e instanceof ItemEvent)
+ {
+ synchronized (this)
+ {
+ state = (((ItemEvent) e).getStateChange() == ItemEvent.SELECTED);
+ }
+ }
+
if (e.id <= ItemEvent.ITEM_LAST
&& e.id >= ItemEvent.ITEM_FIRST
&& (item_listeners != null
@@ -315,5 +329,27 @@ paramString()
{
return (ItemListener[]) getListeners (ItemListener.class);
}
+
+
+ protected class AccessibleAWTCheckboxMenuItem extends AccessibleAWTMenuItem
+ implements AccessibleAction, AccessibleValue
+ {
+ // I think the base class provides the necessary implementation
+ }
+
+ /**
+ * Gets the AccessibleContext associated with this <code>CheckboxMenuItem</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTCheckboxMenuItem();
+ return accessibleContext;
+ }
+
} // class CheckboxMenuItem
diff --git a/libjava/java/awt/Choice.java b/libjava/java/awt/Choice.java
index 89e91ca78b8..c6a532a5b37 100644
--- a/libjava/java/awt/Choice.java
+++ b/libjava/java/awt/Choice.java
@@ -45,6 +45,7 @@ import java.io.Serializable;
import java.util.EventListener;
import java.util.Vector;
+import javax.accessibility.Accessible;
import javax.accessibility.AccessibleAction;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
@@ -54,7 +55,8 @@ import javax.accessibility.AccessibleRole;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class Choice extends Component implements ItemSelectable, Serializable
+public class Choice extends Component
+ implements ItemSelectable, Serializable, Accessible
{
/*
@@ -83,23 +85,65 @@ private int selectedIndex = -1;
// Listener chain
private ItemListener item_listeners;
+/**
+ * This class provides accessibility support for the
+ * combo box.
+ *
+ * @author Jerry Quinn (jlquinn@optonline.net)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
protected class AccessibleAWTChoice
- extends Component.AccessibleAWTComponent
- implements AccessibleAction
+ extends AccessibleAWTComponent
+ implements AccessibleAction
{
+
+ /**
+ * Serialization constant to match JDK 1.5
+ */
+ private static final long serialVersionUID = 7175603582428509322L;
+
+ /**
+ * Default constructor which simply calls the
+ * super class for generic component accessibility
+ * handling.
+ */
+ public AccessibleAWTChoice()
+ {
+ super();
+ }
+
+ /**
+ * Returns an implementation of the <code>AccessibleAction</code>
+ * interface for this accessible object. In this case, the
+ * current instance is simply returned (with a more appropriate
+ * type), as it also implements the accessible action as well as
+ * the context.
+ *
+ * @return the accessible action associated with this context.
+ * @see javax.accessibility.AccessibleAction
+ */
public AccessibleAction getAccessibleAction()
{
return this;
}
- // FIXME: I think this is right, but should be checked by someone who
- // knows better.
+ /**
+ * Returns the role of this accessible object.
+ *
+ * @return the instance of <code>AccessibleRole</code>,
+ * which describes this object.
+ * @see javax.accessibility.AccessibleRole
+ */
public AccessibleRole getAccessibleRole()
{
- return AccessibleRole.POPUP_MENU;
+ return AccessibleRole.COMBO_BOX;
}
- /* (non-Javadoc)
+ /**
+ * Returns the number of actions associated with this accessible
+ * object. In this case, it is the number of choices available.
+ *
+ * @return the number of choices available.
* @see javax.accessibility.AccessibleAction#getAccessibleActionCount()
*/
public int getAccessibleActionCount()
@@ -107,7 +151,14 @@ private ItemListener item_listeners;
return pItems.size();
}
- /* (non-Javadoc)
+ /**
+ * Returns a description of the action with the supplied id.
+ * In this case, it is the text used in displaying the particular
+ * choice on-screen.
+ *
+ * @param i the id of the choice whose description should be
+ * retrieved.
+ * @return the <code>String</code> used to describe the choice.
* @see javax.accessibility.AccessibleAction#getAccessibleActionDescription(int)
*/
public String getAccessibleActionDescription(int i)
@@ -115,7 +166,13 @@ private ItemListener item_listeners;
return (String) pItems.get(i);
}
- /* (non-Javadoc)
+ /**
+ * Executes the action with the specified id. In this case,
+ * calling this method provides the same behaviour as would
+ * choosing a choice from the list in a visual manner.
+ *
+ * @param i the id of the choice to select.
+ * @return true if a valid choice was specified.
* @see javax.accessibility.AccessibleAction#doAccessibleAction(int)
*/
public boolean doAccessibleAction(int i)
@@ -564,8 +621,17 @@ paramString()
return (ItemListener[]) getListeners (ItemListener.class);
}
+ /**
+ * Gets the AccessibleContext associated with this <code>Choice</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
public AccessibleContext getAccessibleContext()
{
- return new AccessibleAWTChoice();
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTChoice();
+ return accessibleContext;
}
} // class Choice
diff --git a/libjava/java/awt/Color.java b/libjava/java/awt/Color.java
index c32438521be..c00aa9da038 100644
--- a/libjava/java/awt/Color.java
+++ b/libjava/java/awt/Color.java
@@ -1,5 +1,5 @@
/* Color.java -- represents a color in Java
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ import java.io.Serializable;
* <a href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
* http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html</a>.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ColorSpace
* @see AlphaComposite
* @since 1.0
diff --git a/libjava/java/awt/ColorPaintContext.java b/libjava/java/awt/ColorPaintContext.java
index 9fdfe61962d..3e3bac48280 100644
--- a/libjava/java/awt/ColorPaintContext.java
+++ b/libjava/java/awt/ColorPaintContext.java
@@ -1,5 +1,5 @@
/* ColorPaintContext.java -- context for painting solid colors
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.awt.image.Raster;
* a raster scan with the given color. However, it is not yet completely
* implemented.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
class ColorPaintContext implements PaintContext
{
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
index cb47f777acb..847a31da4b6 100644
--- a/libjava/java/awt/Component.java
+++ b/libjava/java/awt/Component.java
@@ -140,7 +140,7 @@ import javax.accessibility.AccessibleStateSet;
* present but commented out.
*
* @author original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status still missing 1.4 support
*/
@@ -1080,7 +1080,7 @@ public abstract class Component
*
* @return the locale for this component
* @throws IllegalComponentStateException if it has no locale or parent
- * @see setLocale(Locale)
+ * @see #setLocale(Locale)
* @since 1.1
*/
public Locale getLocale()
@@ -1362,7 +1362,7 @@ public abstract class Component
peer.setBounds (x, y, width, height);
// Erase old bounds and repaint new bounds for lightweights.
- if (isLightweight())
+ if (isLightweight() && isShowing ())
{
boolean shouldRepaintParent = false;
boolean shouldRepaintSelf = false;
@@ -1386,13 +1386,16 @@ public abstract class Component
repaint();
}
- if (oldx != x || oldy != y)
+ // Only post event if this component is visible and has changed size.
+ if (isShowing ()
+ && (oldx != x || oldy != y))
{
ComponentEvent ce = new ComponentEvent(this,
ComponentEvent.COMPONENT_MOVED);
getToolkit().getSystemEventQueue().postEvent(ce);
}
- if (oldwidth != width || oldheight != height)
+ if (isShowing ()
+ && (oldwidth != width || oldheight != height))
{
ComponentEvent ce = new ComponentEvent(this,
ComponentEvent.COMPONENT_RESIZED);
@@ -1955,7 +1958,7 @@ public abstract class Component
* @see Graphics#drawImage(Image, int, int, ImageObserver)
* @see Graphics#drawImage(Image, int, int, int, int, Color, ImageObserver)
* @see Graphics#drawImage(Image, int, int, int, int, ImageObserver)
- * @see ImageObserver#update(Image, int, int, int, int, int)
+ * @see ImageObserver#imageUpdate(Image, int, int, int, int, int)
*/
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)
{
@@ -2097,7 +2100,7 @@ public abstract class Component
* @param observer the observer to notify of image loading progress
* @return the image observer flags indicating the status of the load
* @see #prepareImage(Image, int, int, ImageObserver)
- * @see #Toolkit#checkImage(Image, int, int, ImageObserver)
+ * @see Toolkit#checkImage(Image, int, int, ImageObserver)
* @throws NullPointerException if image is null
*/
public int checkImage(Image image, ImageObserver observer)
@@ -2115,7 +2118,7 @@ public abstract class Component
* @param observer the observer to notify of image loading progress
* @return the image observer flags indicating the status of the load
* @see #prepareImage(Image, int, int, ImageObserver)
- * @see #Toolkit#checkImage(Image, int, int, ImageObserver)
+ * @see Toolkit#checkImage(Image, int, int, ImageObserver)
*/
public int checkImage(Image image, int width, int height,
ImageObserver observer)
@@ -2134,7 +2137,7 @@ public abstract class Component
* @param ignoreRepaint the new setting for ignoring repaint events
* @see #getIgnoreRepaint()
* @see BufferStrategy
- * @see GraphicsDevice.setFullScreenWindow(Window)
+ * @see GraphicsDevice#setFullScreenWindow(Window)
* @since 1.4
*/
public void setIgnoreRepaint(boolean ignoreRepaint)
@@ -2250,9 +2253,9 @@ public abstract class Component
* calls {@link #postEvent}.
*
* @param e the event to deliver
- * @deprecated use {@link #dispatchEvent(AWTEvent)} instead
+ * @deprecated use {@link #dispatchEvent (AWTEvent)} instead
*/
- public void deliverEvent(Event e)
+ public void deliverEvent (Event e)
{
postEvent (e);
}
@@ -2284,7 +2287,7 @@ public abstract class Component
* @return true if the event was handled, false otherwise
* @deprecated use {@link #dispatchEvent(AWTEvent)} instead
*/
- public boolean postEvent(Event e)
+ public boolean postEvent (Event e)
{
boolean handled = handleEvent (e);
@@ -3178,8 +3181,8 @@ public abstract class Component
* AWT 1.0 event handler.
*
* This method calls one of the event-specific handler methods. For
- * example for key events, either {@link #keyDown (Event evt, int
- * key)} or {@link keyUp (Event evt, int key)} is called. A derived
+ * example for key events, either {@link #keyDown(Event,int)}
+ * or {@link #keyUp(Event,int)} is called. A derived
* component can override one of these event-specific methods if it
* only needs to handle certain event types. Otherwise it can
* override handleEvent itself and handle any event.
@@ -3188,7 +3191,7 @@ public abstract class Component
* @return true if the event was handled, false otherwise
* @deprecated use {@link #processEvent(AWTEvent)} instead
*/
- public boolean handleEvent(Event evt)
+ public boolean handleEvent (Event evt)
{
switch (evt.id)
{
@@ -3405,9 +3408,15 @@ public abstract class Component
*/
public void removeNotify()
{
- if (peer != null)
- peer.dispose();
+ // We null our peer field before disposing of it, such that if we're
+ // not the event dispatch thread and the dispatch thread is awoken by
+ // the dispose call, there will be no race checking the peer's null
+ // status.
+
+ ComponentPeer tmp = peer;
peer = null;
+ if (tmp != null)
+ tmp.dispose();
}
/**
@@ -3469,8 +3478,8 @@ public abstract class Component
* Specify whether this component can receive focus. This method also
* sets the {@link #isFocusTraversableOverridden} field to 1, which
* appears to be the undocumented way {@link
- * DefaultFocusTraversalPolicy#accept()} determines whether to respect
- * the {@link #isFocusable()} method of the component.
+ * DefaultFocusTraversalPolicy#accept(Component)} determines whether to
+ * respect the {@link #isFocusable()} method of the component.
*
* @param focusable the new focusable status
* @since 1.4
@@ -3484,10 +3493,10 @@ public abstract class Component
/**
* Sets the focus traversal keys for one of the three focus
- * traversal directions supported by Components: {@link
- * #KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS}, {@link
- * #KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}, or {@link
- * #KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}. Normally, the
+ * traversal directions supported by Components:
+ * {@link #KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS},
+ * {@link #KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS}, or
+ * {@link #KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS}. Normally, the
* default values should match the operating system's native
* choices. To disable a given traversal, use
* <code>Collections.EMPTY_SET</code>. The event dispatcher will
@@ -3716,7 +3725,7 @@ public abstract class Component
* receives a FOCUS_GAINED event.
*
* The behaviour of this method is platform-dependent.
- * {@link #requestFocusInWindow} should be used instead.
+ * {@link #requestFocusInWindow()} should be used instead.
*
* @see #requestFocusInWindow ()
* @see FocusEvent
@@ -3791,7 +3800,7 @@ public abstract class Component
* receives a FOCUS_GAINED event.
*
* The behaviour of this method is platform-dependent.
- * {@link #requestFocusInWindow} should be used instead.
+ * {@link #requestFocusInWindow()} should be used instead.
*
* If the return value is false, the request is guaranteed to fail.
* If the return value is true, the request will succeed unless it
@@ -3855,10 +3864,10 @@ public abstract class Component
currentFocusOwner));
}
else
- eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary));
+ eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary));
+ }
}
}
- }
else
// FIXME: need to add a focus listener to our top-level
// ancestor, so that we can post this event when it becomes
@@ -3973,10 +3982,10 @@ public abstract class Component
currentFocusOwner));
}
else
- eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary));
+ eq.postEvent (new FocusEvent(this, FocusEvent.FOCUS_GAINED, temporary));
+ }
}
}
- }
else
return false;
}
@@ -4069,8 +4078,8 @@ public abstract class Component
* However, if this is a Window, the default focus owner in the
* window in the current focus cycle is focused instead.
*
- * @see #requestFocus ()
- * @see #isFocusCycleRoot ()
+ * @see #requestFocus()
+ * @see #isFocusCycleRoot(Container)
* @since 1.4
*/
public void transferFocusUpCycle ()
@@ -4940,7 +4949,7 @@ p * <li>the set of backward traversal keys
/**
* This class provides accessibility support for subclasses of container.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
* @status updated to 1.4
*/
@@ -5468,7 +5477,7 @@ p * <li>the set of backward traversal keys
/**
* Converts component changes into property changes.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
* @status updated to 1.4
*/
@@ -5525,7 +5534,7 @@ p * <li>the set of backward traversal keys
/**
* Converts focus changes into property changes.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
* @status updated to 1.4
*/
@@ -5565,7 +5574,7 @@ p * <li>the set of backward traversal keys
/**
* This class provides support for blitting offscreen surfaces.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @XXX Shell class, to allow compilation. This needs documentation and
* correct implementation.
@@ -5601,7 +5610,7 @@ p * <li>the set of backward traversal keys
* This class provides support for flipping component buffers. It is only
* designed for use by Canvas and Window.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @XXX Shell class, to allow compilation. This needs documentation and
* correct implementation.
diff --git a/libjava/java/awt/ComponentOrientation.java b/libjava/java/awt/ComponentOrientation.java
index 02cf5967ff2..8897470da48 100644
--- a/libjava/java/awt/ComponentOrientation.java
+++ b/libjava/java/awt/ComponentOrientation.java
@@ -67,7 +67,7 @@ import java.util.ResourceBundle;
* of isHorizontal() and isLeftToRight() rather than comparing objects with
* ==, especially since more constants may be added in the future.
*
- * @author Bryce McKinlay <bryce@albatross.co.nz>
+ * @author Bryce McKinlay (bryce@albatross.co.nz)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/Composite.java b/libjava/java/awt/Composite.java
index de873981652..c636921cc69 100644
--- a/libjava/java/awt/Composite.java
+++ b/libjava/java/awt/Composite.java
@@ -1,5 +1,5 @@
/* Composite.java -- graphics formed from composite layers
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import java.awt.image.ColorModel;
* check on custom objects, <code>readDisplayPixels</code>, to prevent leaking
* restricted information graphically.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see AlphaComposite
* @see CompositeContext
* @see Graphics2D#setComposite(Composite)
diff --git a/libjava/java/awt/CompositeContext.java b/libjava/java/awt/CompositeContext.java
index dc3448b114b..301e7cff995 100644
--- a/libjava/java/awt/CompositeContext.java
+++ b/libjava/java/awt/CompositeContext.java
@@ -1,5 +1,5 @@
/* Composite.java -- the context for compositing graphics layers
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.awt.image.WritableRaster;
* This interface provides an optimized environment for compositing graphics.
* Several such contexts may exist for a given <code>Composite</code> object.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Composite
* @since 1.2
* @status updated to 1.4
diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java
index 6c835d23d8e..cd7fec02ecb 100644
--- a/libjava/java/awt/Container.java
+++ b/libjava/java/awt/Container.java
@@ -1,5 +1,5 @@
/* Container.java -- parent container class in AWT
- Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -67,7 +67,7 @@ import javax.swing.SwingUtilities;
* list or bottom of the stacking order.
*
* @author original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*
* @since 1.0
*
@@ -387,11 +387,14 @@ public class Container extends Component
layoutMgr.addLayoutComponent(null, comp);
}
- // Post event to notify of adding the container.
- ContainerEvent ce = new ContainerEvent(this,
- ContainerEvent.COMPONENT_ADDED,
- comp);
- getToolkit().getSystemEventQueue().postEvent(ce);
+ if (isShowing ())
+ {
+ // Post event to notify of adding the component.
+ ContainerEvent ce = new ContainerEvent(this,
+ ContainerEvent.COMPONENT_ADDED,
+ comp);
+ getToolkit().getSystemEventQueue().postEvent(ce);
+ }
}
}
@@ -419,11 +422,14 @@ public class Container extends Component
r.parent = null;
- // Post event to notify of adding the container.
- ContainerEvent ce = new ContainerEvent(this,
- ContainerEvent.COMPONENT_REMOVED,
- r);
- getToolkit().getSystemEventQueue().postEvent(ce);
+ if (isShowing ())
+ {
+ // Post event to notify of removing the component.
+ ContainerEvent ce = new ContainerEvent(this,
+ ContainerEvent.COMPONENT_REMOVED,
+ r);
+ getToolkit().getSystemEventQueue().postEvent(ce);
+ }
}
}
@@ -1046,11 +1052,14 @@ public class Container extends Component
*/
protected String paramString()
{
- String param = super.paramString();
- if (layoutMgr != null)
- param = param + ",layout=" + layoutMgr.getClass().getName();
+ if (layoutMgr == null)
+ return super.paramString();
- return param;
+ StringBuffer sb = new StringBuffer();
+ sb.append(super.paramString());
+ sb.append(",layout=");
+ sb.append(layoutMgr.getClass().getName());
+ return sb.toString();
}
/**
@@ -1677,32 +1686,48 @@ public class Container extends Component
static class GfxPaintVisitor extends GfxVisitor
{
- public void visit(Component c, Graphics gfx) { c.paint(gfx); }
public static final GfxVisitor INSTANCE = new GfxPaintVisitor();
+
+ public void visit(Component c, Graphics gfx)
+ {
+ c.paint(gfx);
+ }
}
static class GfxPrintVisitor extends GfxVisitor
{
- public void visit(Component c, Graphics gfx) { c.print(gfx); }
public static final GfxVisitor INSTANCE = new GfxPrintVisitor();
+
+ public void visit(Component c, Graphics gfx)
+ {
+ c.print(gfx);
+ }
}
static class GfxPaintAllVisitor extends GfxVisitor
{
- public void visit(Component c, Graphics gfx) { c.paintAll(gfx); }
public static final GfxVisitor INSTANCE = new GfxPaintAllVisitor();
+
+ public void visit(Component c, Graphics gfx)
+ {
+ c.paintAll(gfx);
+ }
}
static class GfxPrintAllVisitor extends GfxVisitor
{
- public void visit(Component c, Graphics gfx) { c.printAll(gfx); }
public static final GfxVisitor INSTANCE = new GfxPrintAllVisitor();
+
+ public void visit(Component c, Graphics gfx)
+ {
+ c.printAll(gfx);
+ }
}
/**
* This class provides accessibility support for subclasses of container.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*
* @since 1.3
*/
@@ -1791,7 +1816,7 @@ public class Container extends Component
* This class fires a <code>PropertyChange</code> listener, if registered,
* when children are added or removed from the enclosing accessible object.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*
* @since 1.3
*/
diff --git a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
index fa7ab4ad69a..91153e69935 100644
--- a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
+++ b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java
@@ -1,5 +1,5 @@
/* ContainerOrderFocusTraversalPolicy.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import java.io.Serializable;
* can override these acceptance criteria by overriding accept.
*
* @author Michael Koch
- * @author Thomas Fitzsimmons <fitzsim@redhat.com>
+ * @author Thomas Fitzsimmons (fitzsim@redhat.com)
* @since 1.4
*/
public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
diff --git a/libjava/java/awt/DefaultFocusTraversalPolicy.java b/libjava/java/awt/DefaultFocusTraversalPolicy.java
index f49f386a19c..f9bd647a0fe 100644
--- a/libjava/java/awt/DefaultFocusTraversalPolicy.java
+++ b/libjava/java/awt/DefaultFocusTraversalPolicy.java
@@ -1,5 +1,5 @@
/* DefaultFocusTraversalPolicy.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ package java.awt;
* A Component's focusability is independent of the focusability of
* its peer.
*
- * @author Thomas Fitzsimmons <fitzsim@redhat.com>
+ * @author Thomas Fitzsimmons (fitzsim@redhat.com)
* @since 1.4
*/
public class DefaultFocusTraversalPolicy
diff --git a/libjava/java/awt/DefaultKeyboardFocusManager.java b/libjava/java/awt/DefaultKeyboardFocusManager.java
index 800b01d4639..9c94d8a220b 100644
--- a/libjava/java/awt/DefaultKeyboardFocusManager.java
+++ b/libjava/java/awt/DefaultKeyboardFocusManager.java
@@ -226,7 +226,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager
Component focusOwner = getGlobalPermanentFocusOwner ();
if (focusOwner != null)
- processKeyEvent (focusOwner, (KeyEvent) e);
+ processKeyEvent (focusOwner, (KeyEvent) e);
if (e.isConsumed ())
return true;
diff --git a/libjava/java/awt/Dialog.java b/libjava/java/awt/Dialog.java
index 6bfb80c8563..8248df3c70d 100644
--- a/libjava/java/awt/Dialog.java
+++ b/libjava/java/awt/Dialog.java
@@ -1,5 +1,5 @@
/* Dialog.java -- An AWT dialog box
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,11 +40,16 @@ package java.awt;
import java.awt.peer.DialogPeer;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
/**
* A dialog box widget class.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@redhat.com)
*/
public class Dialog extends Window
{
@@ -511,5 +516,38 @@ paramString()
this.undecorated = undecorated;
}
+
+ protected class AccessibleAWTDialog extends AccessibleAWTWindow
+ {
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.DIALOG;
+ }
+
+ public AccessibleStateSet getAccessibleState()
+ {
+ AccessibleStateSet states = super.getAccessibleStateSet();
+ if (isResizable())
+ states.add(AccessibleState.RESIZABLE);
+ if (isModal())
+ states.add(AccessibleState.MODAL);
+ return states;
+ }
+ }
+
+ /**
+ * Gets the AccessibleContext associated with this <code>Dialog</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTDialog();
+ return accessibleContext;
+ }
+
} // class Dialog
diff --git a/libjava/java/awt/Dimension.java b/libjava/java/awt/Dimension.java
index 282291d7ca7..270e04e70d1 100644
--- a/libjava/java/awt/Dimension.java
+++ b/libjava/java/awt/Dimension.java
@@ -53,9 +53,9 @@ import java.io.Serializable;
* manner, it is your own fault when you get invalid results. Also, this
* class is not threadsafe.
*
- * @author Per Bothner <bothner@cygnus.com>
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Per Bothner (bothner@cygnus.com)
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Component
* @see LayoutManager
* @since 1.0
diff --git a/libjava/java/awt/DisplayMode.java b/libjava/java/awt/DisplayMode.java
index 533ab5ef482..a9fac604d0e 100644
--- a/libjava/java/awt/DisplayMode.java
+++ b/libjava/java/awt/DisplayMode.java
@@ -1,5 +1,5 @@
/* DisplayMode.java -- a description of display mode configurations
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.awt;
* device configuration. They are device dependent, and may not always be
* available.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see GraphicsDevice
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/awt/EventDispatchThread.java b/libjava/java/awt/EventDispatchThread.java
index 0803ff675c8..d55f0f5ea45 100644
--- a/libjava/java/awt/EventDispatchThread.java
+++ b/libjava/java/awt/EventDispatchThread.java
@@ -53,7 +53,6 @@ class EventDispatchThread extends Thread
setName("AWT-EventQueue-" + ++dispatchThreadNum);
this.queue = queue;
setPriority(NORM_PRIORITY + 1);
- start();
}
public void run()
@@ -63,11 +62,6 @@ class EventDispatchThread extends Thread
try
{
AWTEvent evt = queue.getNextEvent();
- if (isInterrupted ())
- {
- // We are interrupted when we should finish executing
- return;
- }
KeyboardFocusManager manager;
manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
@@ -80,6 +74,11 @@ class EventDispatchThread extends Thread
if (!manager.dispatchEvent (evt))
queue.dispatchEvent(evt);
}
+ catch (ThreadDeath death)
+ {
+ // If someone wants to kill us, let them.
+ return;
+ }
catch (InterruptedException ie)
{
// We are interrupted when we should finish executing
diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java
index fd1c8062d71..a2356cc6393 100644
--- a/libjava/java/awt/EventQueue.java
+++ b/libjava/java/awt/EventQueue.java
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+/* EventQueue.java --
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,9 +38,12 @@ exception statement from your version. */
package java.awt;
+import gnu.java.awt.ClasspathToolkit;
+
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.InvocationEvent;
+import java.awt.event.WindowEvent;
import java.lang.reflect.InvocationTargetException;
import java.util.EmptyStackException;
@@ -71,6 +75,35 @@ public class EventQueue
private long lastWhen = System.currentTimeMillis();
private EventDispatchThread dispatchThread = new EventDispatchThread(this);
+ private boolean shutdown = false;
+
+ private long lastNativeQueueAccess = 0;
+ private long humanLatencyThreshold = 100;
+
+ synchronized void setShutdown (boolean b)
+ {
+ shutdown = b;
+ }
+
+ synchronized boolean isShutdown ()
+ {
+ if (shutdown)
+ return true;
+
+ // This is the exact self-shutdown condition specified in J2SE:
+ // http://java.sun.com/j2se/1.4.2/docs/api/java/awt/doc-files/AWTThreadIssues.html
+
+ if (peekEvent() == null
+ && ((ClasspathToolkit) Toolkit.getDefaultToolkit()).nativeQueueEmpty())
+ {
+ Frame[] frames = Frame.getFrames();
+ for (int i = 0; i < frames.length; ++i)
+ if (frames[i].isDisplayable())
+ return false;
+ return true;
+ }
+ return false;
+ }
/**
* Initializes a new instance of <code>EventQueue</code>.
@@ -93,9 +126,51 @@ public class EventQueue
{
if (next != null)
return next.getNextEvent();
+
+ ClasspathToolkit tk = ((ClasspathToolkit) Toolkit.getDefaultToolkit());
+ long curr = System.currentTimeMillis();
+
+ if (! tk.nativeQueueEmpty() &&
+ (curr - lastNativeQueueAccess > humanLatencyThreshold))
+ {
+ tk.iterateNativeQueue(this, false);
+ lastNativeQueueAccess = curr;
+ }
while (next_in == next_out)
- wait();
+ {
+ // Only the EventDispatchThread associated with the top of the stack is
+ // allowed to get events from the native source; everyone else just
+ // waits on the head of the queue.
+
+ if (isDispatchThread())
+ {
+ // We are not allowed to return null from this method, yet it
+ // is possible that we actually have run out of native events
+ // in the enclosing while() loop, and none of the native events
+ // happened to cause AWT events. We therefore ought to check
+ // the isShutdown() condition here, before risking a "native
+ // wait". If we check it before entering this function we may
+ // wait forever for events after the shutdown condition has
+ // arisen.
+
+ if (isShutdown())
+ throw new InterruptedException();
+
+ tk.iterateNativeQueue(this, true);
+ lastNativeQueueAccess = System.currentTimeMillis();
+ }
+ else
+ {
+ try
+ {
+ wait();
+ }
+ catch (InterruptedException ie)
+ {
+ }
+ }
+ }
AWTEvent res = queue[next_out];
@@ -215,6 +290,22 @@ public class EventQueue
next_out = 0;
next_in = oldQueue.length;
}
+
+ if (dispatchThread == null || !dispatchThread.isAlive())
+ {
+ dispatchThread = new EventDispatchThread(this);
+ dispatchThread.start();
+ }
+
+ // Window events might represent the closing of a window, which
+ // might cause the end of the dispatch thread's life, so we'll wake
+ // it up here to give it a chance to check for shutdown.
+
+ if (!isDispatchThread()
+ || (evt.getID() == WindowEvent.WINDOW_CLOSED)
+ || (evt.getID() == WindowEvent.WINDOW_CLOSING))
+ ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue();
+
notify();
}
@@ -386,9 +477,10 @@ public class EventQueue
next_in = 0;
next_out = 0;
- // Tell our EventDispatchThread that it can end execution
- dispatchThread.interrupt ();
+ ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue();
+ setShutdown(true);
dispatchThread = null;
+ this.notifyAll();
}
}
}
diff --git a/libjava/java/awt/FileDialog.java b/libjava/java/awt/FileDialog.java
index e345018550a..3e22d02e53d 100644
--- a/libjava/java/awt/FileDialog.java
+++ b/libjava/java/awt/FileDialog.java
@@ -1,5 +1,5 @@
/* FileDialog.java -- A filename selection dialog box
- Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.io.Serializable;
* This class implements a file selection dialog box widget.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
*/
public class FileDialog extends Dialog implements Serializable
{
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index 4b2ad5a4f9f..c43297759ca 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -1,5 +1,5 @@
/* Font.java -- Font object
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -247,7 +247,10 @@ private static final long serialVersionUID = -4206021311591459213L;
{
tokenval = Integer.parseInt(token);
}
- catch(NumberFormatException e) { ; }
+ catch(NumberFormatException e)
+ {
+ // Ignored.
+ }
if (tokenval != 0)
size = tokenval;
diff --git a/libjava/java/awt/FontFormatException.java b/libjava/java/awt/FontFormatException.java
index 4ab53bbe834..2971e1de892 100644
--- a/libjava/java/awt/FontFormatException.java
+++ b/libjava/java/awt/FontFormatException.java
@@ -1,5 +1,5 @@
/* FontFormatException.java -- the specified font is bad
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
/**
* Thrown when a specified font is bad.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Font
* @since 1.3
* @status updated to 1.4
diff --git a/libjava/java/awt/Frame.java b/libjava/java/awt/Frame.java
index 80d2c99ae4d..d180984ab9d 100644
--- a/libjava/java/awt/Frame.java
+++ b/libjava/java/awt/Frame.java
@@ -1,5 +1,5 @@
/* Frame.java -- AWT toplevel window
- Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,8 +39,16 @@ exception statement from your version. */
package java.awt;
import java.awt.peer.FramePeer;
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Iterator;
import java.util.Vector;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+
/**
* This class is a top-level window with a title bar and window
* decorations.
@@ -196,7 +204,7 @@ private String title = "";
*/
private boolean undecorated = false;
-/*
+ /*
* The number used to generate the name returned by getName.
*/
private static transient long next_frame_number;
@@ -209,6 +217,7 @@ public
Frame()
{
this("");
+ noteFrame(this);
}
/**
@@ -224,6 +233,7 @@ Frame(String title)
this.title = title;
// Top-level frames are initially invisible.
visible = false;
+ noteFrame(this);
}
public
@@ -231,6 +241,7 @@ Frame(GraphicsConfiguration gc)
{
super(gc);
visible = false;
+ noteFrame(this);
}
public
@@ -239,6 +250,7 @@ Frame(String title, GraphicsConfiguration gc)
super(gc);
setTitle(title);
visible = false;
+ noteFrame(this);
}
/**
@@ -391,6 +403,17 @@ remove(MenuComponent menu)
/**
* Notifies this frame that it should create its native peer.
*/
+private static void fireDummyEvent()
+{
+ EventQueue.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ // Do nothing here.
+ }
+ });
+}
+
public void
addNotify()
{
@@ -398,6 +421,12 @@ addNotify()
menuBar.addNotify();
if (peer == null)
peer = getToolkit ().createFrame (this);
+
+ // We now know there's a Frame (us) with a live peer, so we can start the
+ // fundamental queue and dispatch thread, by inserting a dummy event.
+ if (parent != null && parent.isDisplayable())
+ fireDummyEvent();
+
super.addNotify();
}
@@ -406,15 +435,21 @@ public void removeNotify()
if (menuBar != null)
menuBar.removeNotify();
super.removeNotify();
+
+ // By now we've been disconnected from the peer, and the peer set to
+ // null. This is formally the same as saying "we just became
+ // un-displayable", so we wake up the event queue with a dummy event to
+ // see if it's time to shut down.
+ fireDummyEvent();
}
-/**
- * Returns a debugging string describing this window.
- *
- * @return A debugging string describing this window.
- */
+ /**
+ * Returns a debugging string describing this window.
+ *
+ * @return A debugging string describing this window.
+ */
protected String paramString ()
-{
+ {
String title = getTitle ();
String resizable = "";
@@ -442,15 +477,43 @@ public void removeNotify()
}
return super.paramString () + ",title=" + title + resizable + state;
+ }
+
+private static ArrayList weakFrames = new ArrayList();
+
+private static void noteFrame(Frame f)
+{
+ weakFrames.add(new WeakReference(f));
}
-public static Frame[]
-getFrames()
+public static Frame[] getFrames()
{
- //Frame[] array = new Frames[frames.size()];
- //return frames.toArray(array);
- String msg = "FIXME: can't be implemented without weak references";
- throw new UnsupportedOperationException(msg);
+ int n = 0;
+ synchronized (weakFrames)
+ {
+ Iterator i = weakFrames.iterator();
+ while (i.hasNext())
+ {
+ WeakReference wr = (WeakReference) i.next();
+ if (wr.get() != null)
+ ++n;
+ }
+ if (n == 0)
+ return new Frame[0];
+ else
+ {
+ Frame[] frames = new Frame[n];
+ n = 0;
+ i = weakFrames.iterator();
+ while (i.hasNext())
+ {
+ WeakReference wr = (WeakReference) i.next();
+ if (wr.get() != null)
+ frames[n++] = (Frame) wr.get();
+ }
+ return frames;
+ }
+ }
}
public void setState (int state)
@@ -549,4 +612,37 @@ getFrames()
{
return next_frame_number++;
}
+
+ protected class AccessibleAWTFrame extends AccessibleAWTWindow
+ {
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.FRAME;
+ }
+
+ public AccessibleStateSet getAccessibleState()
+ {
+ AccessibleStateSet states = super.getAccessibleStateSet();
+ if (isResizable())
+ states.add(AccessibleState.RESIZABLE);
+ if ((state & ICONIFIED) != 0)
+ states.add(AccessibleState.ICONIFIED);
+ return states;
+ }
+ }
+
+ /**
+ * Gets the AccessibleContext associated with this <code>Frame</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTFrame();
+ return accessibleContext;
+ }
+
}
diff --git a/libjava/java/awt/Graphics.java b/libjava/java/awt/Graphics.java
index 8dc703c3274..c1dfbda2a36 100644
--- a/libjava/java/awt/Graphics.java
+++ b/libjava/java/awt/Graphics.java
@@ -1,5 +1,5 @@
/* Graphics.java -- Abstract Java drawing class
- Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.text.AttributedCharacterIterator;
* devices such as the screen or printers.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public abstract class Graphics
{
diff --git a/libjava/java/awt/Graphics2D.java b/libjava/java/awt/Graphics2D.java
index e16c2d8fbef..c845c4c1d3b 100644
--- a/libjava/java/awt/Graphics2D.java
+++ b/libjava/java/awt/Graphics2D.java
@@ -49,7 +49,7 @@ import java.text.AttributedCharacterIterator;
import java.util.Map;
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public abstract class Graphics2D extends Graphics
{
diff --git a/libjava/java/awt/GraphicsConfigTemplate.java b/libjava/java/awt/GraphicsConfigTemplate.java
index 52da16799b7..76cf8b690a4 100644
--- a/libjava/java/awt/GraphicsConfigTemplate.java
+++ b/libjava/java/awt/GraphicsConfigTemplate.java
@@ -1,5 +1,5 @@
/* GraphicsConfigTemplate.java -- a template for selecting configurations
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.io.Serializable;
* one based on various requirements. The resulting configuration has had
* all non-default attributes set as required to meet or exceed the request.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see GraphicsConfiguration
* @see GraphicsDevice
* @since 1.2
diff --git a/libjava/java/awt/GraphicsConfiguration.java b/libjava/java/awt/GraphicsConfiguration.java
index c7d0ed4ac8a..97f687e92e6 100644
--- a/libjava/java/awt/GraphicsConfiguration.java
+++ b/libjava/java/awt/GraphicsConfiguration.java
@@ -53,7 +53,7 @@ import java.awt.image.VolatileImage;
* configuration will have a non-zero relative coordinate system in such
* a case.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Window
* @see Frame
* @see GraphicsEnvironment
diff --git a/libjava/java/awt/GraphicsDevice.java b/libjava/java/awt/GraphicsDevice.java
index 27d3cd67ca0..c01723356b3 100644
--- a/libjava/java/awt/GraphicsDevice.java
+++ b/libjava/java/awt/GraphicsDevice.java
@@ -1,5 +1,5 @@
/* GraphicsDevice.java -- information about a graphics device
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt;
* each device. Also, this allows you to create virtual devices which operate
* over a multi-screen environment.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see GraphicsEnvironment
* @see GraphicsConfiguration
* @since 1.3
diff --git a/libjava/java/awt/GridBagLayout.java b/libjava/java/awt/GridBagLayout.java
index 85fdfb56eaa..0ee996ce715 100644
--- a/libjava/java/awt/GridBagLayout.java
+++ b/libjava/java/awt/GridBagLayout.java
@@ -1,5 +1,5 @@
/* GridBagLayout - Layout manager for components according to GridBagConstraints
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,8 +44,8 @@ import java.util.HashMap;
import java.util.Hashtable;
/**
- * @author Michael Koch <konqueror@gmx.de>
- * @author Jeroen Frijters <jeroen@frijters.net>
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Jeroen Frijters (jeroen@frijters.net)
*/
public class GridBagLayout
implements Serializable, LayoutManager2
diff --git a/libjava/java/awt/GridBagLayoutInfo.java b/libjava/java/awt/GridBagLayoutInfo.java
index 6bd7f6787a8..bb919b5570a 100644
--- a/libjava/java/awt/GridBagLayoutInfo.java
+++ b/libjava/java/awt/GridBagLayoutInfo.java
@@ -1,5 +1,5 @@
/* GridBagLayoutInfo -
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
import java.io.Serializable;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
*/
class GridBagLayoutInfo implements Serializable
{
diff --git a/libjava/java/awt/GridLayout.java b/libjava/java/awt/GridLayout.java
index a9e9eac6629..95980e6ca0b 100644
--- a/libjava/java/awt/GridLayout.java
+++ b/libjava/java/awt/GridLayout.java
@@ -52,7 +52,7 @@ import java.io.Serializable;
* horizontal and vertical gaps; these are used as spacing between
* cells.
*
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class GridLayout implements LayoutManager, Serializable
diff --git a/libjava/java/awt/HeadlessException.java b/libjava/java/awt/HeadlessException.java
index 4e7ef337f23..e88279aecea 100644
--- a/libjava/java/awt/HeadlessException.java
+++ b/libjava/java/awt/HeadlessException.java
@@ -1,5 +1,5 @@
/* HeadlessException.java -- operation not possible in headless environment
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt;
* This exception is thrown when code dependent on a keyboard, mouse, or
* display is executed in a headless environment.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/IllegalComponentStateException.java b/libjava/java/awt/IllegalComponentStateException.java
index 413ed33a4f9..daa9d17dfde 100644
--- a/libjava/java/awt/IllegalComponentStateException.java
+++ b/libjava/java/awt/IllegalComponentStateException.java
@@ -1,5 +1,5 @@
/* IllegalComponentStateException.java -- bad component state
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt;
* This exception is thrown when the requested operation failed because
* a component was not in the proper state.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class IllegalComponentStateException extends IllegalStateException
diff --git a/libjava/java/awt/Image.java b/libjava/java/awt/Image.java
index 37617719b01..39ab0687301 100644
--- a/libjava/java/awt/Image.java
+++ b/libjava/java/awt/Image.java
@@ -1,5 +1,5 @@
/* Image.java -- superclass for images
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.awt.image.ReplicateScaleFilter;
/**
* This is the abstract superclass of all image objects in Java.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/Insets.java b/libjava/java/awt/Insets.java
index 573005a7689..e818629a0f1 100644
--- a/libjava/java/awt/Insets.java
+++ b/libjava/java/awt/Insets.java
@@ -1,5 +1,5 @@
/* Insets.java -- information about a container border
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,8 +43,8 @@ import java.io.Serializable;
/**
* This class represents the "margin" or space around a container.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status
*/
public class Insets implements Cloneable, Serializable
diff --git a/libjava/java/awt/ItemSelectable.java b/libjava/java/awt/ItemSelectable.java
index ddf77aeb10a..74129fdda98 100644
--- a/libjava/java/awt/ItemSelectable.java
+++ b/libjava/java/awt/ItemSelectable.java
@@ -1,5 +1,5 @@
/* ItemSelectable.java -- items that can be selected
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.awt.event.ItemListener;
* This interface is for objects that can have one or more items selected.
* For example, radio buttons.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/JobAttributes.java b/libjava/java/awt/JobAttributes.java
index b64234dda5f..fc4240d316c 100644
--- a/libjava/java/awt/JobAttributes.java
+++ b/libjava/java/awt/JobAttributes.java
@@ -1,5 +1,5 @@
/* JobAttributes.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
/**
* Needs documentation...
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
* @status updated to 1.4, lacks documentation
*/
diff --git a/libjava/java/awt/KeyEventDispatcher.java b/libjava/java/awt/KeyEventDispatcher.java
index 95aad8030d1..f9020e74bd3 100644
--- a/libjava/java/awt/KeyEventDispatcher.java
+++ b/libjava/java/awt/KeyEventDispatcher.java
@@ -1,5 +1,5 @@
/* KeyEventDispatcher.java -- dispatches key events
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import java.awt.event.KeyEvent;
* dispatched by other dispatchers. Therefore, it is unnecessary for the user
* to register the focus manager as a dispatcher.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see KeyboardFocusManager#addKeyEventDispatcher(KeyEventDispatcher)
* @see KeyboardFocusManager#removeKeyEventDispatcher(KeyEventDispatcher)
* @since 1.4
diff --git a/libjava/java/awt/KeyEventPostProcessor.java b/libjava/java/awt/KeyEventPostProcessor.java
index 5069aaf510c..0bf6fe650b7 100644
--- a/libjava/java/awt/KeyEventPostProcessor.java
+++ b/libjava/java/awt/KeyEventPostProcessor.java
@@ -1,5 +1,5 @@
/* KeyEventPostProcessor.java -- performs actions after a key event dispatch
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import java.awt.event.KeyEvent;
* post-processed elsewhere. Therefore, it is unnecessary for the user
* to register the focus manager as a dispatcher.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see KeyboardFocusManager#addKeyEventPostProcessor(KeyEventPostProcessor)
* @see KeyboardFocusManager#removeKeyEventPostProcessor(KeyEventPostProcessor)
* @since 1.4
diff --git a/libjava/java/awt/KeyboardFocusManager.java b/libjava/java/awt/KeyboardFocusManager.java
index 6fa56d8a88e..6ea213e3a78 100644
--- a/libjava/java/awt/KeyboardFocusManager.java
+++ b/libjava/java/awt/KeyboardFocusManager.java
@@ -109,9 +109,9 @@ import java.util.Set;
* applies recursively to any child components of such a window,
* which define no traversal keys of their own.
*
- * @author Eric Blake <ebb9@email.byu.edu>
- * @author Thomas Fitzsimmons <fitzsim@redhat.com>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Thomas Fitzsimmons (fitzsim@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.4
*/
public abstract class KeyboardFocusManager
diff --git a/libjava/java/awt/Label.java b/libjava/java/awt/Label.java
index 189bc10a756..e1a43c8d189 100644
--- a/libjava/java/awt/Label.java
+++ b/libjava/java/awt/Label.java
@@ -1,5 +1,5 @@
/* Label.java -- Java label widget
- Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,8 +49,8 @@ import javax.accessibility.AccessibleRole;
* be edited by the user.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
public class Label extends Component implements Accessible
{
@@ -306,10 +306,7 @@ public AccessibleContext getAccessibleContext()
{
/* Create the context if this is the first request */
if (accessibleContext == null)
- {
- /* Create the context */
- accessibleContext = new AccessibleAWTLabel();
- }
+ accessibleContext = new AccessibleAWTLabel();
return accessibleContext;
}
diff --git a/libjava/java/awt/LayoutManager.java b/libjava/java/awt/LayoutManager.java
index 1231c3eb62f..62d5b9f6d84 100644
--- a/libjava/java/awt/LayoutManager.java
+++ b/libjava/java/awt/LayoutManager.java
@@ -1,5 +1,5 @@
/* LayoutManager.java -- lay out elements in a Container
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
/**
* This interface is for laying out containers in a particular sequence.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Container
* @since 1.0
* @status updated to 1.4
diff --git a/libjava/java/awt/List.java b/libjava/java/awt/List.java
index 8fbbc07720e..e10cbaeeebf 100644
--- a/libjava/java/awt/List.java
+++ b/libjava/java/awt/List.java
@@ -47,6 +47,11 @@ import java.util.EventListener;
import java.util.Vector;
import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleSelection;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
/**
* Class that implements a listbox widget
@@ -106,6 +111,7 @@ private ItemListener item_listeners;
// The list of ActionListeners for this object.
private ActionListener action_listeners;
+
/*************************************************************************/
/*
@@ -1076,4 +1082,182 @@ paramString()
{
return (ItemListener[]) getListeners (ItemListener.class);
}
+
+ // Accessibility internal class
+ protected class AccessibleAWTList extends AccessibleAWTComponent
+ implements AccessibleSelection, ItemListener, ActionListener
+ {
+ protected class AccessibleAWTListChild extends AccessibleAWTComponent
+ implements Accessible
+ {
+ private int index;
+ private List parent;
+
+ public AccessibleAWTListChild(List parent, int indexInParent)
+ {
+ this.parent = parent;
+ index = indexInParent;
+ if (parent == null)
+ index = -1;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.Accessible#getAccessibleContext()
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ return this;
+ }
+
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.LIST_ITEM;
+ }
+
+ public AccessibleStateSet getAccessibleStateSet()
+ {
+ AccessibleStateSet states = super.getAccessibleStateSet();
+ if (parent.isIndexSelected(index))
+ states.add(AccessibleState.SELECTED);
+ return states;
+ }
+
+ public int getAccessibleIndexInParent()
+ {
+ return index;
+ }
+
+ }
+
+ public AccessibleAWTList()
+ {
+ addItemListener(this);
+ addActionListener(this);
+ }
+
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.LIST;
+ }
+
+ public AccessibleStateSet getAccessibleStateSet()
+ {
+ AccessibleStateSet states = super.getAccessibleStateSet();
+ states.add(AccessibleState.SELECTABLE);
+ if (isMultipleMode())
+ states.add(AccessibleState.MULTISELECTABLE);
+ return states;
+ }
+
+ public int getAccessibleChildrenCount()
+ {
+ return getItemCount();
+ }
+
+ public Accessible getAccessibleChild(int i)
+ {
+ if (i >= getItemCount())
+ return null;
+ return new AccessibleAWTListChild(List.this, i);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#getAccessibleSelectionCount()
+ */
+ public int getAccessibleSelectionCount()
+ {
+ return getSelectedIndexes().length;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#getAccessibleSelection()
+ */
+ public AccessibleSelection getAccessibleSelection()
+ {
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#getAccessibleSelection(int)
+ */
+ public Accessible getAccessibleSelection(int i)
+ {
+ int[] items = getSelectedIndexes();
+ if (i >= items.length)
+ return null;
+ return new AccessibleAWTListChild(List.this, items[i]);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#isAccessibleChildSelected(int)
+ */
+ public boolean isAccessibleChildSelected(int i)
+ {
+ return isIndexSelected(i);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#addAccessibleSelection(int)
+ */
+ public void addAccessibleSelection(int i)
+ {
+ select(i);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#removeAccessibleSelection(int)
+ */
+ public void removeAccessibleSelection(int i)
+ {
+ deselect(i);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#clearAccessibleSelection()
+ */
+ public void clearAccessibleSelection()
+ {
+ for (int i = 0; i < getItemCount(); i++)
+ deselect(i);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.accessibility.AccessibleSelection#selectAllAccessibleSelection()
+ */
+ public void selectAllAccessibleSelection()
+ {
+ if (isMultipleMode())
+ for (int i = 0; i < getItemCount(); i++)
+ select(i);
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
+ */
+ public void itemStateChanged(ItemEvent event)
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ public void actionPerformed(ActionEvent event)
+ {
+ }
+
+ }
+
+ /**
+ * Gets the AccessibleContext associated with this <code>List</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTList();
+ return accessibleContext;
+ }
} // class List
diff --git a/libjava/java/awt/Menu.java b/libjava/java/awt/Menu.java
index 35798a066df..3cc9cc301ae 100644
--- a/libjava/java/awt/Menu.java
+++ b/libjava/java/awt/Menu.java
@@ -451,12 +451,18 @@ paramString()
}
}
- /* (non-Javadoc)
- * @see java.awt.MenuComponent#getAccessibleContext()
+ /**
+ * Gets the AccessibleContext associated with this <code>Menu</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
*/
public AccessibleContext getAccessibleContext()
{
- return new AccessibleAWTMenu();
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTMenu();
+ return accessibleContext;
}
} // class Menu
diff --git a/libjava/java/awt/MenuBar.java b/libjava/java/awt/MenuBar.java
index 6a97fa95685..ce5256fece7 100644
--- a/libjava/java/awt/MenuBar.java
+++ b/libjava/java/awt/MenuBar.java
@@ -1,5 +1,5 @@
/* MenuBar.java -- An AWT menu bar class
- Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,8 +53,8 @@ import javax.accessibility.AccessibleRole;
* This class implements a menu bar in the AWT system.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@redhat.com>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
public class MenuBar extends MenuComponent
implements MenuContainer, Serializable, Accessible
@@ -381,17 +381,14 @@ public AccessibleContext getAccessibleContext()
{
/* Create the context if this is the first request */
if (accessibleContext == null)
- {
- /* Create the context */
- accessibleContext = new AccessibleAWTMenuBar();
- }
+ accessibleContext = new AccessibleAWTMenuBar();
return accessibleContext;
}
/**
* This class provides accessibility support for AWT menu bars.
*
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
protected class AccessibleAWTMenuBar
extends AccessibleAWTMenuComponent
diff --git a/libjava/java/awt/MenuComponent.java b/libjava/java/awt/MenuComponent.java
index 78adfaea6e3..f5677feeb96 100644
--- a/libjava/java/awt/MenuComponent.java
+++ b/libjava/java/awt/MenuComponent.java
@@ -1,5 +1,5 @@
/* MenuComponent.java -- Superclass of all AWT menu components
- Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ import javax.accessibility.AccessibleStateSet;
* This is the superclass of all menu AWT widgets.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
public abstract class MenuComponent implements Serializable
{
@@ -130,7 +130,7 @@ private static final long serialVersionUID = -4536902356223894379L;
* @see #getAccessibleContext()
* @serial the accessibility information for this component.
*/
- private AccessibleContext accessibleContext;
+ AccessibleContext accessibleContext;
/**
* Was the name of the component set? This value defaults
@@ -465,7 +465,7 @@ public AccessibleContext getAccessibleContext()
* This class provides a base for the accessibility support of menu
* components.
*
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
protected abstract class AccessibleAWTMenuComponent
extends AccessibleContext
diff --git a/libjava/java/awt/MenuContainer.java b/libjava/java/awt/MenuContainer.java
index dd8b3412e2b..08d1cb09c6f 100644
--- a/libjava/java/awt/MenuContainer.java
+++ b/libjava/java/awt/MenuContainer.java
@@ -1,5 +1,5 @@
/* MenuContainer.java -- container for menu items
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
/**
* This interface is a container for menu components.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/MenuItem.java b/libjava/java/awt/MenuItem.java
index a58774240ff..56082d36a9a 100644
--- a/libjava/java/awt/MenuItem.java
+++ b/libjava/java/awt/MenuItem.java
@@ -47,6 +47,7 @@ import java.util.EventListener;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleAction;
+import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleValue;
@@ -562,7 +563,10 @@ protected void
processActionEvent(ActionEvent event)
{
if (action_listeners != null)
- action_listeners.actionPerformed(event);
+ {
+ event.setSource(this);
+ action_listeners.actionPerformed(event);
+ }
}
/*************************************************************************/
@@ -579,7 +583,18 @@ paramString()
",actionCommand=" + actionCommand + "," + super.paramString());
}
-// Accessibility API not yet implemented.
-// public AccessibleContext getAccessibleContext()
+/**
+ * Gets the AccessibleContext associated with this <code>MenuItem</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+public AccessibleContext getAccessibleContext()
+{
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTMenuItem();
+ return accessibleContext;
+}
} // class MenuItem
diff --git a/libjava/java/awt/PageAttributes.java b/libjava/java/awt/PageAttributes.java
index 2501aa3eeaf..c94f857dc79 100644
--- a/libjava/java/awt/PageAttributes.java
+++ b/libjava/java/awt/PageAttributes.java
@@ -1,5 +1,5 @@
/* PageAttributes.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.util.Locale;
/**
* Missing Documentation
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
* @status updated to 1.4, but missing documentation
*/
diff --git a/libjava/java/awt/Paint.java b/libjava/java/awt/Paint.java
index 94c30c0ff5d..fa136ec3fba 100644
--- a/libjava/java/awt/Paint.java
+++ b/libjava/java/awt/Paint.java
@@ -48,7 +48,7 @@ import java.awt.image.ColorModel;
* of the graphics object. Instances must be immutable, because the graphics
* object does not clone them.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see PaintContext
* @see Color
* @see GradientPaint
diff --git a/libjava/java/awt/PaintContext.java b/libjava/java/awt/PaintContext.java
index fa26061f0ea..29003798d69 100644
--- a/libjava/java/awt/PaintContext.java
+++ b/libjava/java/awt/PaintContext.java
@@ -42,7 +42,7 @@ import java.awt.image.ColorModel;
import java.awt.image.Raster;
/**
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see Paint
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/awt/Panel.java b/libjava/java/awt/Panel.java
index 1ba9fbd246e..628e53e97a1 100644
--- a/libjava/java/awt/Panel.java
+++ b/libjava/java/awt/Panel.java
@@ -1,5 +1,5 @@
/* Panel.java -- Simple container object
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -127,7 +127,7 @@ public class Panel extends Container implements Accessible
* This class provides accessibility support for Panels, and is the
* runtime type returned by {@link #getAccessibleContext()}.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
*/
protected class AccessibleAWTPanel extends AccessibleAWTContainer
diff --git a/libjava/java/awt/Point.java b/libjava/java/awt/Point.java
index 3731b4134ee..48f5e33651d 100644
--- a/libjava/java/awt/Point.java
+++ b/libjava/java/awt/Point.java
@@ -50,9 +50,9 @@ import java.io.Serializable;
* manner, it is your own fault when you get invalid results. Also, this
* class is not threadsafe.
*
- * @author Per Bothner <bothner@cygnus.com>
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Per Bothner (bothner@cygnus.com)
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/Polygon.java b/libjava/java/awt/Polygon.java
index 4b89bd669f2..4b1eda85ce9 100644
--- a/libjava/java/awt/Polygon.java
+++ b/libjava/java/awt/Polygon.java
@@ -1,5 +1,5 @@
/* Polygon.java -- class representing a polygon
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,8 +57,8 @@ import java.io.Serializable;
* ArrayIndexOutOfBoundsException, or invalid results. Also, this class is
* not threadsafe.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/PopupMenu.java b/libjava/java/awt/PopupMenu.java
index 75082029186..92840dfa075 100644
--- a/libjava/java/awt/PopupMenu.java
+++ b/libjava/java/awt/PopupMenu.java
@@ -151,9 +151,18 @@ show(Component component, int x, int y)
}
+ /**
+ * Gets the AccessibleContext associated with this <code>PopupMenu</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
public AccessibleContext getAccessibleContext()
{
- return new AccessibleAWTPopupMenu();
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTPopupMenu();
+ return accessibleContext;
}
} // class PopupMenu
diff --git a/libjava/java/awt/PrintGraphics.java b/libjava/java/awt/PrintGraphics.java
index 4a65fcec510..ae664044d9b 100644
--- a/libjava/java/awt/PrintGraphics.java
+++ b/libjava/java/awt/PrintGraphics.java
@@ -1,5 +1,5 @@
/* PrintGraphics.java -- a print graphics context
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
/**
* This interface allows the originating print job to be obtained.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/PrintJob.java b/libjava/java/awt/PrintJob.java
index 9cf95f21495..7bf4534c7fc 100644
--- a/libjava/java/awt/PrintJob.java
+++ b/libjava/java/awt/PrintJob.java
@@ -1,5 +1,5 @@
/* PrintJob.java -- A print job class
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt;
/**
* This abstract class represents a print job.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Toolkit#getPrintJob(Frame, String, Properties)
* @since 1.0
* @status updated to 1.4
diff --git a/libjava/java/awt/Rectangle.java b/libjava/java/awt/Rectangle.java
index 66190960a12..df7cbbe6dee 100644
--- a/libjava/java/awt/Rectangle.java
+++ b/libjava/java/awt/Rectangle.java
@@ -57,9 +57,9 @@ import java.io.Serializable;
* ArrayIndexOutOfBoundsException, or invalid results. Also, this class is
* not threadsafe.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/RenderingHints.java b/libjava/java/awt/RenderingHints.java
index a1ccdff3097..86e0eb6f0ee 100644
--- a/libjava/java/awt/RenderingHints.java
+++ b/libjava/java/awt/RenderingHints.java
@@ -51,8 +51,8 @@ import java.util.Set;
* items are hints only, they may be ignored by a particular
* {@link java.awt.Graphics2D} implementation.
*
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
public class RenderingHints implements Map, Cloneable
{
diff --git a/libjava/java/awt/Robot.java b/libjava/java/awt/Robot.java
index f633fc0b354..23b6f810442 100644
--- a/libjava/java/awt/Robot.java
+++ b/libjava/java/awt/Robot.java
@@ -1,5 +1,5 @@
-/* Robot.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* Robot.java -- a native input event generator
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,112 +38,386 @@ exception statement from your version. */
package java.awt;
+import gnu.java.awt.ClasspathToolkit;
+
+import java.lang.reflect.InvocationTargetException;
+import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
+import java.awt.peer.RobotPeer;
/**
+ * The Robot class is used to simulate user interaction with graphical
+ * programs. It can generate native windowing system input events and
+ * retrieve image data from the current screen. Robot is used to test
+ * the AWT and Swing library implementations; it can also be used to
+ * create self-running demo programs.
+ *
+ * Since Robot generates native windowing system events, rather than
+ * simply inserting {@link AWTEvents} on the AWT event queue, its use
+ * is not restricted to Java programs. It can be used to
+ * programatically drive any graphical application.
+ *
+ * This implementation requires an X server that supports the XTest
+ * extension.
+ *
+ * @author Thomas Fitzsimmons (fitzsim@redhat.com)
+ *
* @since 1.3
*/
-/** STUB CLASS ONLY */
public class Robot
{
- private GraphicsDevice screen;
private boolean waitForIdle;
private int autoDelay;
-
+ private RobotPeer peer;
+
/**
- * Creates a <code>Robot</code> object.
- *
- * @exception AWTException If GraphicsEnvironment.isHeadless() returns true.
- * @exception SecurityException If createRobot permission is not granted.
+ * Construct a Robot object that operates on the default screen.
+ *
+ * @exception AWTException if GraphicsEnvironment.isHeadless()
+ * returns true or if the X server does not support the XTest
+ * extension
+ * @exception SecurityException if createRobot permission is not
+ * granted
*/
- public Robot() throws AWTException
+ public Robot () throws AWTException
{
- throw new Error("not implemented");
+ if (GraphicsEnvironment.isHeadless ())
+ throw new AWTException ("Robot: headless graphics environment");
+
+ SecurityManager sm = System.getSecurityManager ();
+ if (sm != null)
+ sm.checkPermission (new AWTPermission ("createRobot"));
+
+ ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit ();
+
+ // createRobot will throw AWTException if XTest is not supported.
+ peer = tk.createRobot (GraphicsEnvironment.getLocalGraphicsEnvironment ()
+ .getDefaultScreenDevice ());
}
/**
- * Creates a <code>Robot</code> object.
- *
- * @exception AWTException If GraphicsEnvironment.isHeadless() returns true.
- * @exception IllegalArgumentException If <code>screen</code> is not a screen
- * GraphicsDevice.
- * @exception SecurityException If createRobot permission is not granted.
+ * Construct a Robot object that operates on the specified screen.
+ *
+ * @exception AWTException if GraphicsEnvironment.isHeadless()
+ * returns true or if the X server does not support the XTest
+ * extension
+ * @exception IllegalArgumentException if screen is not a screen
+ * GraphicsDevice
+ * @exception SecurityException if createRobot permission is not
+ * granted
*/
- public Robot(GraphicsDevice screen) throws AWTException
+ public Robot (GraphicsDevice screen) throws AWTException
{
- this();
- this.screen = screen;
+ if (GraphicsEnvironment.isHeadless ())
+ throw new AWTException ("Robot: headless graphics environment");
+
+ if (screen.getType () != GraphicsDevice.TYPE_RASTER_SCREEN)
+ throw new IllegalArgumentException ("Robot: graphics"
+ + " device is not a screen");
+
+ SecurityManager sm = System.getSecurityManager ();
+ if (sm != null)
+ sm.checkPermission (new AWTPermission ("createRobot"));
+
+ ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit ();
+
+ // createRobot will throw AWTException if XTest is not supported.
+ peer = tk.createRobot (screen);
}
+ /**
+ * Move the mouse pointer to absolute coordinates (x, y).
+ *
+ * @param x the destination x coordinate
+ * @param y the destination y coordinate
+ */
public void mouseMove(int x, int y)
{
+ peer.mouseMove (x, y);
+
+ if (waitForIdle)
+ waitForIdle ();
+
+ if (autoDelay > 0)
+ delay (autoDelay);
}
- public void mousePress(int buttons)
+ /**
+ * Press one or more mouse buttons.
+ *
+ * @param buttons the buttons to press; a bitmask of one or more of
+ * these {@link InputEvent} fields:
+ *
+ * <ul>
+ * <li>BUTTON1_MASK</li>
+ * <li>BUTTON2_MASK</li>
+ * <li>BUTTON3_MASK</li>
+ * </ul>
+ *
+ * @exception IllegalArgumentException if the button mask is invalid
+ */
+ public void mousePress (int buttons)
{
+ if ((buttons & InputEvent.BUTTON1_MASK) == 0
+ && (buttons & InputEvent.BUTTON2_MASK) == 0
+ && (buttons & InputEvent.BUTTON3_MASK) == 0)
+ throw new IllegalArgumentException ("Robot: mousePress:"
+ + " invalid button mask");
+
+ peer.mousePress (buttons);
+
+ if (waitForIdle)
+ waitForIdle ();
+
+ if (autoDelay > 0)
+ delay (autoDelay);
}
+ /**
+ * Release one or more mouse buttons.
+ *
+ * @param buttons the buttons to release; a bitmask of one or more
+ * of these {@link InputEvent} fields:
+ *
+ * <ul>
+ * <li>BUTTON1_MASK</li>
+ * <li>BUTTON2_MASK</li>
+ * <li>BUTTON3_MASK</li>
+ * </ul>
+ *
+ * @exception IllegalArgumentException if the button mask is invalid
+ */
public void mouseRelease(int buttons)
{
+ if ((buttons & InputEvent.BUTTON1_MASK) == 0
+ && (buttons & InputEvent.BUTTON2_MASK) == 0
+ && (buttons & InputEvent.BUTTON3_MASK) == 0)
+ throw new IllegalArgumentException ("Robot: mouseRelease:"
+ + " invalid button mask");
+
+ peer.mouseRelease (buttons);
+
+ if (waitForIdle)
+ waitForIdle ();
+
+ if (autoDelay > 0)
+ delay (autoDelay);
}
- public void mouseWheel(int wheelAmt)
+ /**
+ * Rotate the mouse scroll wheel.
+ *
+ * @param wheelAmt number of steps to rotate mouse wheel. negative
+ * to rotate wheel up (away from the user), positive to rotate wheel
+ * down (toward the user).
+ *
+ * @since 1.4
+ */
+ public void mouseWheel (int wheelAmt)
{
+ peer.mouseWheel (wheelAmt);
+
+ if (waitForIdle)
+ waitForIdle ();
+
+ if (autoDelay > 0)
+ delay (autoDelay);
}
- public void keyPress(int keycode)
+ /**
+ * Press a key.
+ *
+ * @param keycode key to press, a {@link KeyEvent} VK_ constant
+ *
+ * @exception IllegalArgumentException if keycode is not a valid key
+ */
+ public void keyPress (int keycode)
{
+ peer.keyPress (keycode);
+
+ if (waitForIdle)
+ waitForIdle ();
+
+ if (autoDelay > 0)
+ delay (autoDelay);
}
- public void keyRelease(int keycode)
+ /**
+ * Release a key.
+ *
+ * @param keycode key to release, a {@link KeyEvent} VK_ constant
+ *
+ * @exception IllegalArgumentException if keycode is not a valid key
+ */
+ public void keyRelease (int keycode)
{
+ peer.keyRelease (keycode);
+
+ if (waitForIdle)
+ waitForIdle ();
+
+ if (autoDelay > 0)
+ delay (autoDelay);
}
-
- public Color getPixelColor(int x, int y)
+
+ /**
+ * Return the color of the pixel at the given screen coordinates.
+ *
+ * @param x the x coordinate of the pixel
+ * @param y the y coordinate of the pixel
+ *
+ * @return the Color of the pixel at screen coodinates <code>(x, y)</code>
+ */
+ public Color getPixelColor (int x, int y)
{
- return null;
+ return new Color (peer.getRGBPixel (x, y));
}
- public BufferedImage createScreenCapture(Rectangle screen)
+ /**
+ * Create an image containing pixels read from the screen. The
+ * image does not include the mouse pointer.
+ *
+ * @param screenRect the rectangle of pixels to capture, in screen
+ * coordinates
+ *
+ * @return a BufferedImage containing the requested pixels
+ *
+ * @exception IllegalArgumentException if requested width and height
+ * are not both greater than zero
+ * @exception SecurityException if readDisplayPixels permission is
+ * not granted
+ */
+ public BufferedImage createScreenCapture (Rectangle screenRect)
{
- return null;
+ if (screenRect.width <= 0)
+ throw new IllegalArgumentException ("Robot: capture width is <= 0");
+
+ if (screenRect.height <= 0)
+ throw new IllegalArgumentException ("Robot: capture height is <= 0");
+
+ SecurityManager sm = System.getSecurityManager ();
+ if (sm != null)
+ sm.checkPermission (new AWTPermission ("readDisplayPixels"));
+
+ int[] pixels = peer.getRGBPixels (screenRect);
+
+ BufferedImage bufferedImage =
+ new BufferedImage (screenRect.width, screenRect.height,
+ BufferedImage.TYPE_INT_ARGB);
+
+ bufferedImage.setRGB (0, 0, screenRect.width, screenRect.height,
+ pixels, 0, screenRect.width);
+
+ return bufferedImage;
}
-
- public boolean isAutoWaitForIdle()
+
+ /**
+ * Check if this Robot automatically calls {@link waitForIdle} after
+ * generating an event.
+ *
+ * @return true if waitForIdle is automatically called
+ */
+ public boolean isAutoWaitForIdle ()
{
return waitForIdle;
}
-
- public void setAutoWaitForIdle(boolean value)
+
+ /**
+ * Set whether or not this Robot automatically calls {@link
+ * waitForIdle} after generating an event.
+ *
+ * @param isOn true if waitForIdle should be called automatically
+ */
+ public void setAutoWaitForIdle (boolean isOn)
{
- waitForIdle = value;
+ waitForIdle = isOn;
}
-
- public int getAutoDelay()
+
+ /**
+ * Retrieve the length of time this Robot sleeps after generating an
+ * event.
+ *
+ * @return the length of time in milliseconds
+ */
+ public int getAutoDelay ()
{
return autoDelay;
}
-
- public void setAutoDelay(int ms)
+
+ /**
+ * Set the length of time this Robot sleeps after generating an
+ * event.
+ *
+ * @param ms the length of time in milliseconds
+ *
+ * @exception IllegalArgumentException if ms is not between 0 and
+ * 60,000 milliseconds inclusive
+ */
+ public void setAutoDelay (int ms)
{
- if (ms < 0 || ms > 60000)
- throw new IllegalArgumentException();
-
+ if (ms <= 0 || ms >= 60000)
+ throw new IllegalArgumentException ("Robot: delay length out-of-bounds");
+
autoDelay = ms;
}
- public void delay(int ms)
+ /**
+ * Sleep for a specified length of time.
+ *
+ * @param ms the length of time in milliseconds
+ *
+ * @exception IllegalArgumentException if ms is not between 0 and
+ * 60,000 milliseconds inclusive
+ */
+ public void delay (int ms)
{
if (ms < 0 || ms > 60000)
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException ("Robot: delay length out-of-bounds");
+
+ try
+ {
+ Thread.sleep (ms);
+ }
+ catch (InterruptedException e)
+ {
+ System.err.println ("Robot: delay interrupted");
+ }
}
- public void waitForIdle()
+ /**
+ * Wait until all events currently on the event queue have been
+ * dispatched.
+ */
+ public void waitForIdle ()
{
+ if (EventQueue.isDispatchThread ())
+ throw new IllegalThreadStateException ("Robot: waitForIdle called from "
+ + "the event dispatch thread");
+
+ EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
+ try
+ {
+ q.invokeAndWait (new Runnable () { public void run () { } });
+ }
+ catch (InterruptedException e)
+ {
+ System.err.println ("Robot: waitForIdle interrupted");
+ }
+ catch (InvocationTargetException e)
+ {
+ System.err.println ("Robot: waitForIdle cannot invoke target");
+ }
}
- public String toString()
+ /**
+ * Return a string representation of this Robot.
+ *
+ * @return a string representation
+ */
+ public String toString ()
{
- return "unimplemented";
+ return getClass ().getName ()
+ + "[ autoDelay = " + autoDelay + ", autoWaitForIdle = "
+ + waitForIdle + " ]";
}
-} // class Robot
+}
diff --git a/libjava/java/awt/ScrollPane.java b/libjava/java/awt/ScrollPane.java
index abd5514d8e3..c38feb339c5 100644
--- a/libjava/java/awt/ScrollPane.java
+++ b/libjava/java/awt/ScrollPane.java
@@ -43,6 +43,8 @@ import java.awt.peer.ComponentPeer;
import java.awt.peer.ScrollPanePeer;
import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
/**
* This widget provides a scrollable region that allows a single
@@ -587,5 +589,27 @@ paramString()
{
wheelScrollingEnabled = enable;
}
+
+ protected class AccessibleAWTScrollPane extends AccessibleAWTContainer
+ {
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.SCROLL_PANE;
+ }
+ }
+
+ /**
+ * Gets the AccessibleContext associated with this <code>ScrollPane</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTScrollPane();
+ return accessibleContext;
+ }
} // class ScrollPane
diff --git a/libjava/java/awt/Scrollbar.java b/libjava/java/awt/Scrollbar.java
index 7cc97153796..9141ea53e6d 100644
--- a/libjava/java/awt/Scrollbar.java
+++ b/libjava/java/awt/Scrollbar.java
@@ -1,5 +1,5 @@
/* Scrollbar.java -- AWT Scrollbar widget
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,694 +45,603 @@ import java.awt.peer.ScrollbarPeer;
import java.util.EventListener;
import javax.accessibility.Accessible;
-
-/**
- * This class implements a scrollbar widget.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
- */
-public class Scrollbar extends Component implements Accessible,
- Adjustable
-{
-
-// FIXME: Serialization readObject/writeObject
-
-/*
- * Static Variables
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
+import javax.accessibility.AccessibleValue;
+
+/**
+ * This class implements a scrollbar widget.
+ *
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
+public class Scrollbar extends Component implements Accessible, Adjustable
+{
+ // FIXME: Serialization readObject/writeObject
-/**
- * Constant indicating that a scrollbar is horizontal.
- */
-public static final int HORIZONTAL = 0;
-
-/**
- * Constant indicating that a scrollbar is vertical.
- */
-public static final int VERTICAL = 1;
+ /**
+ * Constant indicating that a scrollbar is horizontal.
+ */
+ public static final int HORIZONTAL = 0;
-// Serialization Constant
-private static final long serialVersionUID = 8451667562882310543L;
+ /**
+ * Constant indicating that a scrollbar is vertical.
+ */
+ public static final int VERTICAL = 1;
-/*************************************************************************/
+ /**
+ * Serialization Constant.
+ */
+ private static final long serialVersionUID = 8451667562882310543L;
-/**
- * @serial The amount by which the value of the scrollbar is changed
- * when incrementing in line mode.
- */
-private int lineIncrement;
+ /**
+ * @serial The amount by which the value of the scrollbar is changed
+ * when incrementing in line mode.
+ */
+ private int lineIncrement;
-/**
- * @serial The amount by which the value of the scrollbar is changed
- * when incrementing in page mode.
- */
-private int pageIncrement;
+ /**
+ * @serial The amount by which the value of the scrollbar is changed
+ * when incrementing in page mode.
+ */
+ private int pageIncrement;
-/**
- * @serial The maximum value for this scrollbar
- */
-private int maximum;
+ /**
+ * @serial The maximum value for this scrollbar
+ */
+ private int maximum;
-/**
- * @serial The minimum value for this scrollbar
- */
-private int minimum;
+ /**
+ * @serial The minimum value for this scrollbar
+ */
+ private int minimum;
-/**
- * @serial The orientation of this scrollbar, which will be either
- * the <code>HORIZONTAL</code> or <code>VERTICAL</code> constant
- * from this class.
- */
-private int orientation;
+ /**
+ * @serial The orientation of this scrollbar, which will be either
+ * the <code>HORIZONTAL</code> or <code>VERTICAL</code> constant
+ * from this class.
+ */
+ private int orientation;
-/**
- * @serial The current value of this scrollbar.
- */
-private int value;
+ /**
+ * @serial The current value of this scrollbar.
+ */
+ private int value;
-/**
- * @serial The width of the scrollbar's thumb, which is relative
- * to the minimum and maximum value of the scrollbar.
- */
-private int visibleAmount;
+ /**
+ * @serial The width of the scrollbar's thumb, which is relative
+ * to the minimum and maximum value of the scrollbar.
+ */
+ private int visibleAmount;
-// List of AdjustmentListener's.
-private AdjustmentListener adjustment_listeners;
+ /**
+ * List of AdjustmentListener's.
+ */
+ private AdjustmentListener adjustment_listeners;
-private transient boolean valueIsAdjusting = false;
+ /**
+ * true if the scrollbar is adjusting, false otherwise.
+ */
+ private transient boolean valueIsAdjusting = false;
- /*
+ /**
* The number used to generate the name returned by getName.
*/
private static transient long next_scrollbar_number;
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Initializes a new instance of <code>Scrollbar</code> with a
- * vertical orientation and default values for all other parameters.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- */
-public
-Scrollbar()
-{
- this(VERTICAL);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Scrollbar</code> with the
- * specified orientation and default values for all other parameters.
- * The orientation must be either the constant <code>HORIZONTAL</code> or
- * <code>VERTICAL</code> from this class. An incorrect value will throw
- * an exception.
- *
- * @param orientation The orientation of this scrollbar.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- * @exception IllegalArgumentException If the orientation value is not valid.
- */
-public
-Scrollbar(int orientation) throws IllegalArgumentException
-{
- this(orientation, 0, 10, 0, 100);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of <code>Scrollbar</code> with the
- * specified parameters. The orientation must be either the constant
- * <code>HORIZONTAL</code> or <code>VERTICAL</code>. An incorrect value
- * will throw an exception. Inconsistent values for other parameters
- * are silently corrected to valid values.
- *
- * @param orientation The orientation of this scrollbar.
- * @param value The initial value of the scrollbar.
- * @param visibleAmount The width of the scrollbar thumb.
- * @param minimum The minimum value of the scrollbar.
- * @param maximum The maximum value of the scrollbar.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- * @exception IllegalArgumentException If the orientation value is not valid.
- */
-public
-Scrollbar(int orientation, int value, int visibleAmount, int minimum,
- int maximum) throws IllegalArgumentException
-{
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-
- if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
- throw new IllegalArgumentException("Bad orientation value: "
- + orientation);
-
- this.orientation = orientation;
-
- setValues(value, visibleAmount, minimum, maximum);
-
- // Default is 1 according to online docs.
- lineIncrement = 1;
-
- // Default is 10 according to javadocs.
- pageIncrement = 10;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the orientation constant for this object.
- *
- * @return The orientation constant for this object.
- */
-public int
-getOrientation()
-{
- return(orientation);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the orientation of this scrollbar to the specified value. This
- * value must be either the constant <code>HORIZONTAL</code> or
- * <code>VERTICAL</code> from this class or an exception will be thrown.
- *
- * @param orientation The new orientation value.
- *
- * @exception IllegalArgumentException If the orientation value is not valid.
- */
-public void
-setOrientation(int orientation)
-{
- if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
- throw new IllegalArgumentException("Bad orientation value: "
- + orientation);
-
- // FIXME: Communicate to peer? Or must this be called before peer creation?
- this.orientation = orientation;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the current value for this scrollbar.
- *
- * @return The current value for this scrollbar.
- */
-public int
-getValue()
-{
- return(value);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the current value for this scrollbar to the specified value.
- * If this is inconsistent with the minimum and maximum values for this
- * scrollbar, the value is silently adjusted.
- *
- * @param value The new value for this scrollbar.
- */
-public void
-setValue(int value)
-{
- setValues(value, visibleAmount, minimum, maximum);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the maximum value for this scrollbar.
- *
- * @return The maximum value for this scrollbar.
- */
-public int
-getMaximum()
-{
- return(maximum);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the maximum value for this scrollbar to the specified value.
- * If the value is less than the current minimum value, it is silent
- * set to equal the minimum value.
- *
- * @param maximum The new maximum value for this scrollbar.
- */
-public void
-setMaximum(int maximum)
-{
- setValues(value, visibleAmount, minimum, maximum);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the minimum value for this scrollbar.
- *
- * @return The minimum value for this scrollbar.
- */
-public int
-getMinimum()
-{
- return(minimum);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the minimum value for this scrollbar to the specified value. If
- * this is not consistent with the current value and maximum, it is
- * silently adjusted to be consistent.
- *
- * @param minimum The new minimum value for this scrollbar.
- */
-public void
-setMinimum(int minimum)
-{
- setValues(value, visibleAmount, minimum, maximum);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the width of the scrollbar's thumb, in units relative to the
- * maximum and minimum value of the scrollbar.
- *
- * @return The width of the scrollbar's thumb.
- */
-public int
-getVisibleAmount()
-{
- return getVisible ();
-}
-
-/*************************************************************************/
-
-/**
- * Returns the width of the scrollbar's thumb, in units relative to the
- * maximum and minimum value of the scrollbar.
- *
- * @return The width of the scrollbar's thumb.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getVisibleAmount()</code>.
- */
-public int
-getVisible()
-{
- return visibleAmount;
-}
-
-/*************************************************************************/
-
-/**
- * Sets the width of the scrollbar's thumb, in units relative to the
- * maximum and minimum value of the scrollbar.
- *
- * @param visibleAmount The new visible amount value of the scrollbar.
- */
-public void
-setVisibleAmount(int visibleAmount)
-{
- setValues(value, visibleAmount, minimum, maximum);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the current value, visible amount, minimum, and maximum for this
- * scrollbar. These values are adjusted to be internally consistent
- * if necessary.
- *
- * @param value The new value for this scrollbar.
- * @param visibleAmount The new visible amount for this scrollbar.
- * @param minimum The new minimum value for this scrollbar.
- * @param maximum The new maximum value for this scrollbar.
- */
-public synchronized void
-setValues(int value, int visibleAmount, int minimum, int maximum)
-{
- if (maximum < minimum)
- maximum = minimum;
-
- if (value < minimum)
- value = minimum;
-
- if (value > maximum)
- value = maximum;
-
- if (visibleAmount > maximum - minimum)
- visibleAmount = maximum - minimum;
-
- ScrollbarPeer peer = (ScrollbarPeer) getPeer ();
- if (peer != null
- && (this.value != value || this.visibleAmount != visibleAmount
- || this.minimum != minimum || this.maximum != maximum))
- peer.setValues(value, visibleAmount, minimum, maximum);
-
- this.value = value;
- this.visibleAmount = visibleAmount;
- this.minimum = minimum;
- this.maximum = maximum;
-
- int range = maximum - minimum;
- if (lineIncrement > range)
- {
- if (range == 0)
- lineIncrement = 1;
- else
- lineIncrement = range;
-
- if (peer != null)
- peer.setLineIncrement(lineIncrement);
- }
-
- if (pageIncrement > range)
- {
- if (range == 0)
- pageIncrement = 1;
- else
- pageIncrement = range;
-
- if (peer != null)
- peer.setPageIncrement(pageIncrement);
- }
-}
-
-/*************************************************************************/
+ /**
+ * Initializes a new instance of <code>Scrollbar</code> with a
+ * vertical orientation and default values for all other parameters.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
+ */
+ public Scrollbar()
+ {
+ this(VERTICAL);
+ }
-/**
- * Returns the value added or subtracted when the user activates the scrollbar
- * scroll by a "unit" amount.
- *
- * @return The unit increment value.
- */
-public int
-getUnitIncrement()
-{
- return getLineIncrement ();
-}
+ /**
+ * Initializes a new instance of <code>Scrollbar</code> with the
+ * specified orientation and default values for all other parameters.
+ * The orientation must be either the constant <code>HORIZONTAL</code> or
+ * <code>VERTICAL</code> from this class. An incorrect value will throw
+ * an exception.
+ *
+ * @param orientation The orientation of this scrollbar.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
+ * @exception IllegalArgumentException If the orientation value is not valid.
+ */
+ public Scrollbar(int orientation) throws IllegalArgumentException
+ {
+ this(orientation, 0, 10, 0, 100);
+ }
-/*************************************************************************/
+ /**
+ * Initializes a new instance of <code>Scrollbar</code> with the
+ * specified parameters. The orientation must be either the constant
+ * <code>HORIZONTAL</code> or <code>VERTICAL</code>. An incorrect value
+ * will throw an exception. Inconsistent values for other parameters
+ * are silently corrected to valid values.
+ *
+ * @param orientation The orientation of this scrollbar.
+ * @param value The initial value of the scrollbar.
+ * @param visibleAmount The width of the scrollbar thumb.
+ * @param minimum The minimum value of the scrollbar.
+ * @param maximum The maximum value of the scrollbar.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
+ * @exception IllegalArgumentException If the orientation value is not valid.
+ */
+ public Scrollbar(int orientation, int value, int visibleAmount, int minimum,
+ int maximum) throws IllegalArgumentException
+ {
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException();
-/**
- * Returns the value added or subtracted when the user selects the scrollbar
- * scroll by a "unit" amount control.
- *
- * @return The unit increment value.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getUnitIncrement()</code>.
- */
-public int
-getLineIncrement()
-{
- return lineIncrement;
-}
+ if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
+ throw new IllegalArgumentException("Bad orientation value: "
+ + orientation);
-/*************************************************************************/
+ this.orientation = orientation;
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "unit" amount control.
- *
- * @param unitIncrement The new unit increment amount.
- */
-public synchronized void
-setUnitIncrement(int unitIncrement)
-{
- setLineIncrement (unitIncrement);
-}
+ setValues(value, visibleAmount, minimum, maximum);
-/*************************************************************************/
+ // Default is 1 according to online docs.
+ lineIncrement = 1;
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "unit" amount control.
- *
- * @param lineIncrement The new unit increment amount.
- *
- * @deprecated This method is deprecated in favor of
- * <code>setUnitIncrement()</code>.
- */
-public void
-setLineIncrement(int lineIncrement)
-{
- if (lineIncrement < 0)
- throw new IllegalArgumentException ("Unit increment less than zero.");
+ // Default is 10 according to javadocs.
+ pageIncrement = 10;
+ }
- int range = maximum - minimum;
- if (lineIncrement > range)
- {
- if (range == 0)
- lineIncrement = 1;
- else
- lineIncrement = range;
- }
+ /**
+ * Returns the orientation constant for this object.
+ *
+ * @return The orientation constant for this object.
+ */
+ public int getOrientation()
+ {
+ return orientation;
+ }
- if (lineIncrement == this.lineIncrement)
- return;
+ /**
+ * Sets the orientation of this scrollbar to the specified value. This
+ * value must be either the constant <code>HORIZONTAL</code> or
+ * <code>VERTICAL</code> from this class or an exception will be thrown.
+ *
+ * @param orientation The new orientation value.
+ *
+ * @exception IllegalArgumentException If the orientation value is not valid.
+ */
+ public void setOrientation(int orientation)
+ {
+ if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
+ throw new IllegalArgumentException("Bad orientation value: "
+ + orientation);
- this.lineIncrement = lineIncrement;
+ // FIXME: Communicate to peer? Or must this be called before peer creation?
+ this.orientation = orientation;
+ }
- ScrollbarPeer peer = (ScrollbarPeer) getPeer ();
- if (peer != null)
- peer.setLineIncrement (this.lineIncrement);
-}
+ /**
+ * Returns the current value for this scrollbar.
+ *
+ * @return The current value for this scrollbar.
+ */
+ public int getValue()
+ {
+ return value;
+ }
-/*************************************************************************/
+ /**
+ * Sets the current value for this scrollbar to the specified value.
+ * If this is inconsistent with the minimum and maximum values for this
+ * scrollbar, the value is silently adjusted.
+ *
+ * @param value The new value for this scrollbar.
+ */
+ public void setValue(int value)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
-/**
- * Returns the value added or subtracted when the user activates the scrollbar
- * scroll by a "block" amount.
- *
- * @return The block increment value.
- */
-public int
-getBlockIncrement()
-{
- return getPageIncrement ();
-}
+ /**
+ * Returns the maximum value for this scrollbar.
+ *
+ * @return The maximum value for this scrollbar.
+ */
+ public int getMaximum()
+ {
+ return maximum;
+ }
-/*************************************************************************/
+ /**
+ * Sets the maximum value for this scrollbar to the specified value.
+ * If the value is less than the current minimum value, it is silent
+ * set to equal the minimum value.
+ *
+ * @param maximum The new maximum value for this scrollbar.
+ */
+ public void setMaximum(int maximum)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
-/**
- * Returns the value added or subtracted when the user selects the scrollbar
- * scroll by a "block" amount control.
- *
- * @return The block increment value.
- *
- * @deprecated This method is deprecated in favor of
- * <code>getBlockIncrement()</code>.
- */
-public int
-getPageIncrement()
-{
- return pageIncrement;
-}
+ /**
+ * Returns the minimum value for this scrollbar.
+ *
+ * @return The minimum value for this scrollbar.
+ */
+ public int getMinimum()
+ {
+ return minimum;
+ }
-/*************************************************************************/
+ /**
+ * Sets the minimum value for this scrollbar to the specified value. If
+ * this is not consistent with the current value and maximum, it is
+ * silently adjusted to be consistent.
+ *
+ * @param minimum The new minimum value for this scrollbar.
+ */
+ public void setMinimum(int minimum)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "block" amount control.
- *
- * @param blockIncrement The new block increment amount.
- */
-public synchronized void
-setBlockIncrement(int blockIncrement)
-{
- setPageIncrement (blockIncrement);
-}
+ /**
+ * Returns the width of the scrollbar's thumb, in units relative to the
+ * maximum and minimum value of the scrollbar.
+ *
+ * @return The width of the scrollbar's thumb.
+ */
+ public int getVisibleAmount()
+ {
+ return getVisible();
+ }
-/*************************************************************************/
+ /**
+ * Returns the width of the scrollbar's thumb, in units relative to the
+ * maximum and minimum value of the scrollbar.
+ *
+ * @return The width of the scrollbar's thumb.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getVisibleAmount()</code>.
+ */
+ public int getVisible()
+ {
+ return visibleAmount;
+ }
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "block" amount control.
- *
- * @param pageIncrement The new block increment amount.
- *
- * @deprecated This method is deprecated in favor of
- * <code>setBlockIncrement()</code>.
- */
-public void
-setPageIncrement(int pageIncrement)
-{
- if (pageIncrement < 0)
- throw new IllegalArgumentException ("Block increment less than zero.");
+ /**
+ * Sets the width of the scrollbar's thumb, in units relative to the
+ * maximum and minimum value of the scrollbar.
+ *
+ * @param visibleAmount The new visible amount value of the scrollbar.
+ */
+ public void setVisibleAmount(int visibleAmount)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
- int range = maximum - minimum;
- if (pageIncrement > range)
- {
- if (range == 0)
- pageIncrement = 1;
- else
- pageIncrement = range;
- }
+ /**
+ * Sets the current value, visible amount, minimum, and maximum for this
+ * scrollbar. These values are adjusted to be internally consistent
+ * if necessary.
+ *
+ * @param value The new value for this scrollbar.
+ * @param visibleAmount The new visible amount for this scrollbar.
+ * @param minimum The new minimum value for this scrollbar.
+ * @param maximum The new maximum value for this scrollbar.
+ */
+ public synchronized void setValues(int value, int visibleAmount,
+ int minimum, int maximum)
+ {
+ if (maximum < minimum)
+ maximum = minimum;
+
+ if (value < minimum)
+ value = minimum;
+
+ if (value > maximum)
+ value = maximum;
+
+ if (visibleAmount > maximum - minimum)
+ visibleAmount = maximum - minimum;
+
+ ScrollbarPeer peer = (ScrollbarPeer) getPeer();
+ if (peer != null
+ && (this.value != value || this.visibleAmount != visibleAmount
+ || this.minimum != minimum || this.maximum != maximum))
+ peer.setValues(value, visibleAmount, minimum, maximum);
+
+ this.value = value;
+ this.visibleAmount = visibleAmount;
+ this.minimum = minimum;
+ this.maximum = maximum;
+
+ int range = maximum - minimum;
+ if (lineIncrement > range)
+ {
+ if (range == 0)
+ lineIncrement = 1;
+ else
+ lineIncrement = range;
+
+ if (peer != null)
+ peer.setLineIncrement(lineIncrement);
+ }
+
+ if (pageIncrement > range)
+ {
+ if (range == 0)
+ pageIncrement = 1;
+ else
+ pageIncrement = range;
+
+ if (peer != null)
+ peer.setPageIncrement(pageIncrement);
+ }
+ }
- if (pageIncrement == this.pageIncrement)
- return;
+ /**
+ * Returns the value added or subtracted when the user activates the scrollbar
+ * scroll by a "unit" amount.
+ *
+ * @return The unit increment value.
+ */
+ public int getUnitIncrement()
+ {
+ return getLineIncrement();
+ }
- this.pageIncrement = pageIncrement;
+ /**
+ * Returns the value added or subtracted when the user selects the scrollbar
+ * scroll by a "unit" amount control.
+ *
+ * @return The unit increment value.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getUnitIncrement()</code>.
+ */
+ public int getLineIncrement()
+ {
+ return lineIncrement;
+ }
- ScrollbarPeer peer = (ScrollbarPeer) getPeer ();
- if (peer != null)
- peer.setPageIncrement (this.pageIncrement);
-}
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "unit" amount control.
+ *
+ * @param unitIncrement The new unit increment amount.
+ */
+ public synchronized void setUnitIncrement(int unitIncrement)
+ {
+ setLineIncrement(unitIncrement);
+ }
-/*************************************************************************/
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "unit" amount control.
+ *
+ * @param lineIncrement The new unit increment amount.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>setUnitIncrement()</code>.
+ */
+ public void setLineIncrement(int lineIncrement)
+ {
+ if (lineIncrement < 0)
+ throw new IllegalArgumentException("Unit increment less than zero.");
+
+ int range = maximum - minimum;
+ if (lineIncrement > range)
+ {
+ if (range == 0)
+ lineIncrement = 1;
+ else
+ lineIncrement = range;
+ }
+
+ if (lineIncrement == this.lineIncrement)
+ return;
+
+ this.lineIncrement = lineIncrement;
+
+ ScrollbarPeer peer = (ScrollbarPeer) getPeer();
+ if (peer != null)
+ peer.setLineIncrement(this.lineIncrement);
+ }
-/**
- * Notifies this object to create its native peer.
- */
-public synchronized void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createScrollbar (this);
- super.addNotify ();
-}
+ /**
+ * Returns the value added or subtracted when the user activates the scrollbar
+ * scroll by a "block" amount.
+ *
+ * @return The block increment value.
+ */
+ public int getBlockIncrement()
+ {
+ return getPageIncrement();
+ }
-/*************************************************************************/
+ /**
+ * Returns the value added or subtracted when the user selects the scrollbar
+ * scroll by a "block" amount control.
+ *
+ * @return The block increment value.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>getBlockIncrement()</code>.
+ */
+ public int getPageIncrement()
+ {
+ return pageIncrement;
+ }
-/**
- * Adds a new adjustment listener to the list of registered listeners
- * for this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addAdjustmentListener(AdjustmentListener listener)
-{
- adjustment_listeners = AWTEventMulticaster.add(adjustment_listeners, listener);
- enableEvents(AWTEvent.ADJUSTMENT_EVENT_MASK);
-}
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "block" amount control.
+ *
+ * @param blockIncrement The new block increment amount.
+ */
+ public synchronized void setBlockIncrement(int blockIncrement)
+ {
+ setPageIncrement(blockIncrement);
+ }
-/*************************************************************************/
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "block" amount control.
+ *
+ * @param pageIncrement The new block increment amount.
+ *
+ * @deprecated This method is deprecated in favor of
+ * <code>setBlockIncrement()</code>.
+ */
+ public void setPageIncrement(int pageIncrement)
+ {
+ if (pageIncrement < 0)
+ throw new IllegalArgumentException("Block increment less than zero.");
+
+ int range = maximum - minimum;
+ if (pageIncrement > range)
+ {
+ if (range == 0)
+ pageIncrement = 1;
+ else
+ pageIncrement = range;
+ }
+
+ if (pageIncrement == this.pageIncrement)
+ return;
+
+ this.pageIncrement = pageIncrement;
+
+ ScrollbarPeer peer = (ScrollbarPeer) getPeer();
+ if (peer != null)
+ peer.setPageIncrement(this.pageIncrement);
+ }
-/**
- * Removes the specified listener from the list of registered listeners
- * for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeAdjustmentListener(AdjustmentListener listener)
-{
- adjustment_listeners = AWTEventMulticaster.remove(adjustment_listeners,
- listener);
-}
+ /**
+ * Notifies this object to create its native peer.
+ */
+ public synchronized void addNotify()
+ {
+ if (peer == null)
+ peer = getToolkit().createScrollbar(this);
+ super.addNotify();
+ }
-/*************************************************************************/
+ /**
+ * Adds a new adjustment listener to the list of registered listeners
+ * for this object.
+ *
+ * @param listener The listener to add.
+ */
+ public synchronized void addAdjustmentListener(AdjustmentListener listener)
+ {
+ adjustment_listeners = AWTEventMulticaster.add(adjustment_listeners,
+ listener);
+ enableEvents(AWTEvent.ADJUSTMENT_EVENT_MASK);
+ }
-/**
- * Processes events for this scrollbar. It does this by calling
- * <code>processAdjustmentEvent()</code> if the event is an instance of
- * <code>AdjustmentEvent</code>, otherwise it calls the superclass to
- * process the event.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof AdjustmentEvent)
- processAdjustmentEvent((AdjustmentEvent)event);
- else
- super.processEvent(event);
-}
+ /**
+ * Removes the specified listener from the list of registered listeners
+ * for this object.
+ *
+ * @param listener The listener to remove.
+ */
+ public synchronized void removeAdjustmentListener(AdjustmentListener listener)
+ {
+ adjustment_listeners = AWTEventMulticaster.remove(adjustment_listeners,
+ listener);
+ }
-/*************************************************************************/
+ /**
+ * Processes events for this scrollbar. It does this by calling
+ * <code>processAdjustmentEvent()</code> if the event is an instance of
+ * <code>AdjustmentEvent</code>, otherwise it calls the superclass to
+ * process the event.
+ *
+ * @param event The event to process.
+ */
+ protected void processEvent(AWTEvent event)
+ {
+ if (event instanceof AdjustmentEvent)
+ processAdjustmentEvent((AdjustmentEvent) event);
+ else
+ super.processEvent(event);
+ }
-/**
- * Processes adjustment events for this object by dispatching them to
- * any registered listeners. Note that this method will only be called
- * if adjustment events are enabled. This will happen automatically if
- * any listeners are registered. Otherwise, it can be enabled by a
- * call to <code>enableEvents()</code>.
- *
- * @param event The event to process.
- */
-protected void
-processAdjustmentEvent(AdjustmentEvent event)
-{
- value = event.getValue();
- if (adjustment_listeners != null)
- adjustment_listeners.adjustmentValueChanged(event);
-}
+ /**
+ * Processes adjustment events for this object by dispatching them to
+ * any registered listeners. Note that this method will only be called
+ * if adjustment events are enabled. This will happen automatically if
+ * any listeners are registered. Otherwise, it can be enabled by a
+ * call to <code>enableEvents()</code>.
+ *
+ * @param event The event to process.
+ */
+ protected void processAdjustmentEvent(AdjustmentEvent event)
+ {
+ value = event.getValue();
+ if (adjustment_listeners != null)
+ adjustment_listeners.adjustmentValueChanged(event);
+ }
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST
+ void dispatchEventImpl(AWTEvent e)
+ {
+ if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST
&& e.id >= AdjustmentEvent.ADJUSTMENT_FIRST
&& (adjustment_listeners != null
|| (eventMask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+ }
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-protected String
-paramString()
-{
- return("value=" + getValue() + ",visibleAmount=" +
- getVisibleAmount() + ",minimum=" + getMinimum()
- + ",maximum=" + getMaximum()
- + ",pageIncrement=" + pageIncrement
- + ",lineIncrement=" + lineIncrement
- + ",orientation=" + (orientation == HORIZONTAL
- ? "HORIZONTAL" : "VERTICAL")
- + super.paramString());
-}
+ /**
+ * Returns a debugging string for this object.
+ *
+ * @return A debugging string for this object.
+ */
+ protected String paramString()
+ {
+ return ("value=" + getValue() + ",visibleAmount=" + getVisibleAmount()
+ + ",minimum=" + getMinimum() + ",maximum=" + getMaximum()
+ + ",pageIncrement=" + pageIncrement + ",lineIncrement="
+ + lineIncrement + ",orientation="
+ + (orientation == HORIZONTAL ? "HORIZONTAL" : "VERTICAL")
+ + super.paramString());
+ }
/**
* Returns an array of all the objects currently registered as FooListeners
- * upon this <code>Scrollbar</code>. FooListeners are registered using the
+ * upon this <code>Scrollbar</code>. FooListeners are registered using the
* addFooListener method.
*
* @exception ClassCastException If listenerType doesn't specify a class or
* interface that implements java.util.EventListener.
*/
- public EventListener[] getListeners (Class listenerType)
+ public EventListener[] getListeners(Class listenerType)
{
if (listenerType == AdjustmentListener.class)
- return AWTEventMulticaster.getListeners (adjustment_listeners,
- listenerType);
+ return AWTEventMulticaster.getListeners(adjustment_listeners,
+ listenerType);
- return super.getListeners (listenerType);
+ return super.getListeners(listenerType);
}
/**
* Returns an array of all registered adjustment listeners.
*/
- public AdjustmentListener[] getAdjustmentListeners ()
+ public AdjustmentListener[] getAdjustmentListeners()
{
- return (AdjustmentListener[]) getListeners (AdjustmentListener.class);
+ return (AdjustmentListener[]) getListeners(AdjustmentListener.class);
}
/**
@@ -740,7 +649,7 @@ paramString()
*
* @since 1.4
*/
- public boolean getValueIsAdjusting ()
+ public boolean getValueIsAdjusting()
{
return valueIsAdjusting;
}
@@ -750,7 +659,7 @@ paramString()
*
* @since 1.4
*/
- public void setValueIsAdjusting (boolean valueIsAdjusting)
+ public void setValueIsAdjusting(boolean valueIsAdjusting)
{
this.valueIsAdjusting = valueIsAdjusting;
}
@@ -760,14 +669,157 @@ paramString()
*
* @return A unique name for this scroll bar.
*/
- String generateName ()
+ String generateName()
{
- return "scrollbar" + getUniqueLong ();
+ return "scrollbar" + getUniqueLong();
}
- private static synchronized long getUniqueLong ()
+ private static synchronized long getUniqueLong()
{
return next_scrollbar_number++;
}
-} // class Scrollbar
+ /**
+ * This class provides accessibility support for the
+ * scrollbar.
+ *
+ * @author Jerry Quinn (jlquinn@optonline.net)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
+ */
+ protected class AccessibleAWTScrollBar extends AccessibleAWTComponent
+ implements AccessibleValue
+ {
+ /**
+ * Serialization constant to match JDK 1.5
+ */
+ private static final long serialVersionUID = -344337268523697807L;
+
+ /**
+ * Returns the role of this accessible object.
+ *
+ * @return the instance of <code>AccessibleRole</code>,
+ * which describes this object.
+ *
+ * @see javax.accessibility.AccessibleRole
+ */
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.SCROLL_BAR;
+ }
+
+ /**
+ * Returns the state set of this accessible object.
+ *
+ * @return a set of <code>AccessibleState</code>s which
+ * represent the current state of the accessible object.
+ *
+ * @see javax.accessibility.AccessibleState
+ * @see javax.accessibility.AccessibleStateSet
+ */
+ public AccessibleStateSet getAccessibleStateSet()
+ {
+ AccessibleStateSet states = super.getAccessibleStateSet();
+ if (getOrientation() == HORIZONTAL)
+ states.add(AccessibleState.HORIZONTAL);
+ else
+ states.add(AccessibleState.VERTICAL);
+ if (getValueIsAdjusting())
+ states.add(AccessibleState.BUSY);
+ return states;
+ }
+
+ /**
+ * Returns an implementation of the <code>AccessibleValue</code>
+ * interface for this accessible object. In this case, the
+ * current instance is simply returned (with a more appropriate
+ * type), as it also implements the accessible value as well as
+ * the context.
+ *
+ * @return the accessible value associated with this context.
+ *
+ * @see javax.accessibility.AccessibleValue
+ */
+ public AccessibleValue getAccessibleValue()
+ {
+ return this;
+ }
+
+ /**
+ * Returns the current value of this accessible object.
+ * In this case, this is the same as the value for
+ * the scrollbar, wrapped in an <code>Integer</code>
+ * object.
+ *
+ * @return the numeric value of this scrollbar.
+ *
+ * @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
+ */
+ public Number getCurrentAccessibleValue()
+ {
+ return new Integer(getValue());
+ }
+
+ /**
+ * Sets the current value of this accessible object
+ * to that supplied. In this case, the value of the
+ * scrollbar is set, and this method always returns
+ * true.
+ *
+ * @param number the new accessible value.
+ *
+ * @return true if the value was set.
+ *
+ * @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
+ */
+ public boolean setCurrentAccessibleValue(Number number)
+ {
+ setValue(number.intValue());
+ return true;
+ }
+
+ /**
+ * Returns the minimum acceptable accessible value used
+ * by this object. In this case, this is the same as
+ * the minimum value of the scrollbar, wrapped in an
+ * object.
+ *
+ * @return the minimum value of this scrollbar.
+ *
+ * @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
+ */
+ public Number getMinimumAccessibleValue()
+ {
+ return new Integer(getMinimum());
+ }
+
+ /**
+ * Returns the maximum acceptable accessible value used
+ * by this object. In this case, this is the same as
+ * the maximum value of the scrollbar, wrapped in an
+ * object.
+ *
+ * @return the maximum value of this scrollbar.
+ *
+ * @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
+ */
+ public Number getMaximumAccessibleValue()
+ {
+ return new Integer(getMaximum());
+ }
+ }
+
+ /**
+ * Gets the AccessibleContext associated with this <code>Scrollbar</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTScrollBar();
+
+ return accessibleContext;
+ }
+}
diff --git a/libjava/java/awt/Shape.java b/libjava/java/awt/Shape.java
index 47c97192a17..1a0852b8d12 100644
--- a/libjava/java/awt/Shape.java
+++ b/libjava/java/awt/Shape.java
@@ -1,5 +1,5 @@
/* Shape.java -- the classic Object-Oriented shape interface
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,7 +54,7 @@ import java.awt.geom.Rectangle2D;
* Unclosed shapes are considered as implicitly closed when performing
* <code>contains</code> or <code>intersects</code>.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see PathIterator
* @see AffineTransform
* @see java.awt.geom.FlatteningPathIterator
diff --git a/libjava/java/awt/Stroke.java b/libjava/java/awt/Stroke.java
index 8b9b7fc777f..1fe1568a4fc 100644
--- a/libjava/java/awt/Stroke.java
+++ b/libjava/java/awt/Stroke.java
@@ -1,5 +1,5 @@
/* Stroke.java -- a stroked outline of a shape
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.awt;
* Strokes must be immutable, because the graphics object does not clone
* them.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see BasicStroke
* @see Graphics2D#setStroke(Stroke)
* @since 1.1
diff --git a/libjava/java/awt/SystemColor.java b/libjava/java/awt/SystemColor.java
index 3428fba3cc5..90aa577037b 100644
--- a/libjava/java/awt/SystemColor.java
+++ b/libjava/java/awt/SystemColor.java
@@ -1,5 +1,5 @@
/* SystemColor.java -- access dynamic system color values
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,8 +52,8 @@ import java.io.Serializable;
* track the actual color of instances in this class. This means that equals
* may give surprising results; you are better off relying on getRGB.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/TextArea.java b/libjava/java/awt/TextArea.java
index 9efc7754a20..dda45f34478 100644
--- a/libjava/java/awt/TextArea.java
+++ b/libjava/java/awt/TextArea.java
@@ -613,8 +613,17 @@ public class TextArea extends TextComponent implements java.io.Serializable
}
}
+ /**
+ * Gets the AccessibleContext associated with this <code>TextArea</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
public AccessibleContext getAccessibleContext()
{
- return new AccessibleAWTTextArea();
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTTextArea();
+ return accessibleContext;
}
}
diff --git a/libjava/java/awt/TextComponent.java b/libjava/java/awt/TextComponent.java
index 8f9f875acf3..4c384391adf 100644
--- a/libjava/java/awt/TextComponent.java
+++ b/libjava/java/awt/TextComponent.java
@@ -46,6 +46,7 @@ import java.text.BreakIterator;
import java.util.EventListener;
import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleState;
import javax.accessibility.AccessibleStateSet;
@@ -690,6 +691,21 @@ paramString()
return (TextListener[]) getListeners (TextListener.class);
}
+ /**
+ * Gets the AccessibleContext associated with this <code>TextComponent</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTTextComponent();
+ return accessibleContext;
+ }
+
+
/*******************************/
// Provide AccessibleAWTTextComponent access to several peer functions that
// aren't publicly exposed.
diff --git a/libjava/java/awt/Toolkit.java b/libjava/java/awt/Toolkit.java
index 504572a2d5b..c7f2de95620 100644
--- a/libjava/java/awt/Toolkit.java
+++ b/libjava/java/awt/Toolkit.java
@@ -1,5 +1,5 @@
/* Toolkit.java -- AWT Toolkit superclass
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ import java.util.Properties;
* toolkit <code>gnu.java.awt.peer.gtk.GtkToolkit</code> is used. This
* toolkit creates its peers using the GTK+ toolkit.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
*/
public abstract class Toolkit
{
@@ -526,6 +526,10 @@ public abstract class Toolkit
toolkit = (Toolkit) obj;
return toolkit;
}
+ catch (ThreadDeath death)
+ {
+ throw death;
+ }
catch (Throwable t)
{
AWTError e = new AWTError("Cannot load AWT toolkit: " + toolkit_name);
diff --git a/libjava/java/awt/Transparency.java b/libjava/java/awt/Transparency.java
index fc01f583955..9636458ff2e 100644
--- a/libjava/java/awt/Transparency.java
+++ b/libjava/java/awt/Transparency.java
@@ -40,7 +40,7 @@ package java.awt;
/**
* A common transparency mode for layering graphics.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index d084bb4350b..0a39d20b1ff 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -56,12 +56,15 @@ import java.util.Vector;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
/**
* This class represents a top-level window with no decorations.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class Window extends Container implements Accessible
{
@@ -84,11 +87,31 @@ public class Window extends Container implements Accessible
private transient WindowFocusListener windowFocusListener;
private transient WindowStateListener windowStateListener;
private transient GraphicsConfiguration graphicsConfiguration;
- private transient AccessibleContext accessibleContext;
private transient boolean shown;
private transient Component windowFocusOwner;
+
+ /*
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_window_number;
+
+ protected class AccessibleAWTWindow extends AccessibleAWTContainer
+ {
+ public AccessibleRole getAccessibleRole()
+ {
+ return AccessibleRole.WINDOW;
+ }
+
+ public AccessibleStateSet getAccessibleStateSet()
+ {
+ AccessibleStateSet states = super.getAccessibleStateSet();
+ if (isActive())
+ states.add(AccessibleState.ACTIVE);
+ return states;
+ }
+ }
/**
* This (package access) constructor is used by subclasses that want
@@ -200,12 +223,11 @@ public class Window extends Container implements Accessible
&& gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
throw new IllegalArgumentException ("gc must be from a screen device");
- // FIXME: until we implement this, it just causes AWT to crash.
-// if (gc == null)
-// graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()
-// .getDefaultScreenDevice()
-// .getDefaultConfiguration();
-// else
+ if (gc == null)
+ graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()
+ .getDefaultScreenDevice()
+ .getDefaultConfiguration();
+ else
graphicsConfiguration = gc;
}
@@ -672,8 +694,34 @@ public class Window extends Container implements Accessible
}
}
}
+
+ /**
+ * Identifies if this window is active. The active window is a Frame or
+ * Dialog that has focus or owns the active window.
+ *
+ * @return true if active, else false.
+ * @since 1.4
+ */
+ public boolean isActive()
+ {
+ KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
+ return manager.getActiveWindow() == this;
+ }
/**
+ * Identifies if this window is focused. A window is focused if it is the
+ * focus owner or it contains the focus owner.
+ *
+ * @return true if focused, else false.
+ * @since 1.4
+ */
+ public boolean isFocused()
+ {
+ KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager ();
+ return manager.getFocusedWindow() == this;
+ }
+
+ /**
* Returns the child window that has focus if this window is active.
* This method returns <code>null</code> if this window is not active
* or no children have focus.
@@ -731,6 +779,22 @@ public class Window extends Container implements Accessible
return super.isShowing();
}
+ public void setLocationRelativeTo (Component c)
+ {
+ if (c == null || !c.isShowing ())
+ {
+ int x = 0;
+ int y = 0;
+
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment ();
+ Point center = ge.getCenterPoint ();
+ x = center.x - (width / 2);
+ y = center.y - (height / 2);
+ setLocation (x, y);
+ }
+ // FIXME: handle case where component is non-null.
+ }
+
/**
* @since 1.2
*
@@ -754,11 +818,18 @@ public class Window extends Container implements Accessible
applyResourceBundle(rb);
}
+ /**
+ * Gets the AccessibleContext associated with this <code>Window</code>.
+ * The context is created, if necessary.
+ *
+ * @return the associated context
+ */
public AccessibleContext getAccessibleContext()
{
- // FIXME
- //return null;
- throw new Error ("Not implemented");
+ /* Create the context if this is the first request */
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleAWTWindow();
+ return accessibleContext;
}
/**
@@ -866,17 +937,32 @@ public class Window extends Container implements Accessible
this.y = y;
width = w;
height = h;
- if (resized)
+ if (resized && isShowing ())
{
ComponentEvent ce =
new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED);
getToolkit().getSystemEventQueue().postEvent(ce);
}
- if (moved)
+ if (moved && isShowing ())
{
ComponentEvent ce =
new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED);
getToolkit().getSystemEventQueue().postEvent(ce);
}
}
+
+ /**
+ * Generate a unique name for this window.
+ *
+ * @return A unique name for this window.
+ */
+ String generateName()
+ {
+ return "win" + getUniqueLong();
+ }
+
+ private static synchronized long getUniqueLong()
+ {
+ return next_window_number++;
+ }
}
diff --git a/libjava/java/awt/color/CMMException.java b/libjava/java/awt/color/CMMException.java
index a0948ef27eb..04ef3e2c849 100644
--- a/libjava/java/awt/color/CMMException.java
+++ b/libjava/java/awt/color/CMMException.java
@@ -1,5 +1,5 @@
/* CMMException.java -- error in the native CMM
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt.color;
/**
* Thrown when there is an error in the native CMM.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
public class CMMException extends RuntimeException
diff --git a/libjava/java/awt/color/ColorSpace.java b/libjava/java/awt/color/ColorSpace.java
index 905bf9cd769..dd7121ec0bf 100644
--- a/libjava/java/awt/color/ColorSpace.java
+++ b/libjava/java/awt/color/ColorSpace.java
@@ -43,7 +43,7 @@ import java.io.Serializable;
/**
* NEEDS DOCUMENTATION
*
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
* @since 1.2
*/
public abstract class ColorSpace implements Serializable
diff --git a/libjava/java/awt/color/ICC_ColorSpace.java b/libjava/java/awt/color/ICC_ColorSpace.java
index 5cc526adb7a..d6771cd52d2 100644
--- a/libjava/java/awt/color/ICC_ColorSpace.java
+++ b/libjava/java/awt/color/ICC_ColorSpace.java
@@ -76,7 +76,7 @@ import java.io.ObjectInputStream;
* guaranteed to have transforms from the PCS to device space.
*
* @author Sven de Marothy
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
* @since 1.2
*/
public class ICC_ColorSpace extends ColorSpace
diff --git a/libjava/java/awt/color/ICC_Profile.java b/libjava/java/awt/color/ICC_Profile.java
index 79aa886ec49..791ea9f6cf1 100644
--- a/libjava/java/awt/color/ICC_Profile.java
+++ b/libjava/java/awt/color/ICC_Profile.java
@@ -79,7 +79,7 @@ import java.util.Hashtable;
* (available at www.color.org)
*
* @author Sven de Marothy
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
* @since 1.2
*/
public class ICC_Profile implements Serializable
@@ -316,8 +316,6 @@ public class ICC_Profile implements Serializable
*/
protected void finalize()
{
- header = null;
- tagTable = null;
}
/**
diff --git a/libjava/java/awt/color/ProfileDataException.java b/libjava/java/awt/color/ProfileDataException.java
index 89f47a207e1..53b6d28bc3a 100644
--- a/libjava/java/awt/color/ProfileDataException.java
+++ b/libjava/java/awt/color/ProfileDataException.java
@@ -1,5 +1,5 @@
/* ProfileDataException.java -- error in processing an ICC_Profile
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.color;
* Thrown when there is an error accessing or processing an
* <code>ICC_Profile</code>.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
public class ProfileDataException extends RuntimeException
diff --git a/libjava/java/awt/datatransfer/FlavorTable.java b/libjava/java/awt/datatransfer/FlavorTable.java
index 3822cdec60b..1275d924ac3 100644
--- a/libjava/java/awt/datatransfer/FlavorTable.java
+++ b/libjava/java/awt/datatransfer/FlavorTable.java
@@ -1,5 +1,5 @@
/* FlavorTable.java -- A relaxed mapping between flavors
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.List;
* native can map to multiple flavors, and any flavor can map to multiple
* natives; although the mappings are usually symmetric.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/datatransfer/MimeTypeParseException.java b/libjava/java/awt/datatransfer/MimeTypeParseException.java
index 42aecac0528..85331c2b447 100644
--- a/libjava/java/awt/datatransfer/MimeTypeParseException.java
+++ b/libjava/java/awt/datatransfer/MimeTypeParseException.java
@@ -1,5 +1,5 @@
/* MimeTypeParseException.java -- thrown when MIME string couldn't be parsed
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt.datatransfer;
/**
* MIME string couldn't be parsed correctly.
*
- * @author Mark Wielaard <mark@klomp.org>
+ * @author Mark Wielaard (mark@klomp.org)
* @status updated to 1.4
*/
public class MimeTypeParseException extends Exception
diff --git a/libjava/java/awt/datatransfer/Transferable.java b/libjava/java/awt/datatransfer/Transferable.java
index 2b499314306..8fa56e82d80 100644
--- a/libjava/java/awt/datatransfer/Transferable.java
+++ b/libjava/java/awt/datatransfer/Transferable.java
@@ -1,5 +1,5 @@
/* Transferable.java -- Data transfer source
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.io.IOException;
/**
* This interface is implemented by classes that can transfer data.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/datatransfer/UnsupportedFlavorException.java b/libjava/java/awt/datatransfer/UnsupportedFlavorException.java
index 620452be6f8..57ea8568ff3 100644
--- a/libjava/java/awt/datatransfer/UnsupportedFlavorException.java
+++ b/libjava/java/awt/datatransfer/UnsupportedFlavorException.java
@@ -1,5 +1,5 @@
/* UnsupportedFlavorException.java -- ata flavor is not valid
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt.datatransfer;
/**
* The data flavor requested is not supported for the transfer data.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Transferable#getTransferData(DataFlavor)
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/dnd/Autoscroll.java b/libjava/java/awt/dnd/Autoscroll.java
index ae868c077b3..054bba898f3 100644
--- a/libjava/java/awt/dnd/Autoscroll.java
+++ b/libjava/java/awt/dnd/Autoscroll.java
@@ -1,5 +1,5 @@
/* Autoscroll.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.awt.Point;
* subject of the operation on a region of a scrollable GUI control that
* is not currently visible to the user.
*
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/dnd/DnDConstants.java b/libjava/java/awt/dnd/DnDConstants.java
index 3e78121a57a..e00b0003c2e 100644
--- a/libjava/java/awt/dnd/DnDConstants.java
+++ b/libjava/java/awt/dnd/DnDConstants.java
@@ -1,5 +1,5 @@
/* DnDConstants.java -- constants for drag-and-drop operations
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.dnd;
* This class contains various constants used in drag-and-drop operations.
* Why it is not an interface is beyond me.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
@@ -69,4 +69,9 @@ public final class DnDConstants
/** A synonym for {@link #ACTION_LINK}. */
public static final int ACTION_REFERENCE = ACTION_LINK;
-} // class DnDConstants
+
+ private DnDConstants()
+ {
+ // Do nothing here.
+ }
+}
diff --git a/libjava/java/awt/dnd/DragGestureListener.java b/libjava/java/awt/dnd/DragGestureListener.java
index 2673d0d5d1f..f8c7ab47466 100644
--- a/libjava/java/awt/dnd/DragGestureListener.java
+++ b/libjava/java/awt/dnd/DragGestureListener.java
@@ -1,5 +1,5 @@
/* DragGestureListener.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This is a listener for starting a drag-and-drop gesture. Upon receiving
* notification, the implementor then starts the drag operation.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see DragGestureRecognizer
* @see DragGestureEvent
* @see DragSource
diff --git a/libjava/java/awt/dnd/DragSourceAdapter.java b/libjava/java/awt/dnd/DragSourceAdapter.java
index 2b2e15541fd..8d65188f846 100644
--- a/libjava/java/awt/dnd/DragSourceAdapter.java
+++ b/libjava/java/awt/dnd/DragSourceAdapter.java
@@ -1,5 +1,5 @@
/* DragSourceAdapter.java -- drag-and-drop listener adapter
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.awt.dnd;
* a subset of these interfaces to extend this class and override only the
* desired methods.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see DragSourceEvent
* @see DragSourceListener
* @see DragSourceMotionListener
diff --git a/libjava/java/awt/dnd/DragSourceDropEvent.java b/libjava/java/awt/dnd/DragSourceDropEvent.java
index a645814f160..876b73d14dc 100644
--- a/libjava/java/awt/dnd/DragSourceDropEvent.java
+++ b/libjava/java/awt/dnd/DragSourceDropEvent.java
@@ -1,5 +1,5 @@
/* DragSourceDragEvent.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.awt.dnd;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
* @since 1.2
*
* Written using JDK 1.4.1 Online API
diff --git a/libjava/java/awt/dnd/DragSourceListener.java b/libjava/java/awt/dnd/DragSourceListener.java
index 2022a32ac76..c4a7bf2103f 100644
--- a/libjava/java/awt/dnd/DragSourceListener.java
+++ b/libjava/java/awt/dnd/DragSourceListener.java
@@ -1,5 +1,5 @@
/* DragSourceListener.java -- listen to events during the drag
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.util.EventListener;
* also use a <code>DragSourceAdapter</code> to filter the events you are
* interested in.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/dnd/DragSourceMotionListener.java b/libjava/java/awt/dnd/DragSourceMotionListener.java
index 38d025c3a06..d2568454486 100644
--- a/libjava/java/awt/dnd/DragSourceMotionListener.java
+++ b/libjava/java/awt/dnd/DragSourceMotionListener.java
@@ -1,5 +1,5 @@
/* DragSourceMotionListener.java -- tracks motion in the drag source
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.EventListener;
* event occurs. You can also use a <code>DragSourceAdapter</code> to filter
* the events you are interested in.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see DragSourceDragEvent
* @see DragSource
* @see DragSourceListener
diff --git a/libjava/java/awt/dnd/DropTarget.java b/libjava/java/awt/dnd/DropTarget.java
index 7379ca71c0d..2a8b79d8415 100644
--- a/libjava/java/awt/dnd/DropTarget.java
+++ b/libjava/java/awt/dnd/DropTarget.java
@@ -205,15 +205,14 @@ public class DropTarget
/**
* Adds a new <code>DropTargetListener</code>.
*
- * @exception TooManyListenersException If there is already a
- * <code>DropTargetListener</code>.
+ * @exception TooManyListenersException Sun's JDK does not, despite
+ * documentation, throw this exception here when you install an additional
+ * <code>DropTargetListener</code>. So to be compatible, we do the same
+ * thing.
*/
public void addDropTargetListener (DropTargetListener dtl)
throws TooManyListenersException
{
- if (dtl != null)
- throw new TooManyListenersException ();
-
dropTargetListener = dtl;
}
diff --git a/libjava/java/awt/dnd/DropTargetAdapter.java b/libjava/java/awt/dnd/DropTargetAdapter.java
index 4ece882121b..a9a81ac56d5 100644
--- a/libjava/java/awt/dnd/DropTargetAdapter.java
+++ b/libjava/java/awt/dnd/DropTargetAdapter.java
@@ -1,5 +1,5 @@
/* DragSourceAdapter.java -- drag-and-drop listener adapter
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.awt.dnd;
* a subset of these interfaces to extend this class and override only the
* desired methods.
*
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/dnd/DropTargetContext.java b/libjava/java/awt/dnd/DropTargetContext.java
index d61785545c9..0b3ba75b4b6 100644
--- a/libjava/java/awt/dnd/DropTargetContext.java
+++ b/libjava/java/awt/dnd/DropTargetContext.java
@@ -47,7 +47,7 @@ import java.util.Arrays;
import java.util.List;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
* @since 1.2
*/
public class DropTargetContext implements Serializable
diff --git a/libjava/java/awt/dnd/DropTargetListener.java b/libjava/java/awt/dnd/DropTargetListener.java
index 8025ff23920..1eda1e34822 100644
--- a/libjava/java/awt/dnd/DropTargetListener.java
+++ b/libjava/java/awt/dnd/DropTargetListener.java
@@ -1,5 +1,5 @@
/* DropTargetListener.java -- listen to events during the drop
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.awt.dnd;
import java.util.EventListener;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/dnd/InvalidDnDOperationException.java b/libjava/java/awt/dnd/InvalidDnDOperationException.java
index 927ab140627..d02c69b80d5 100644
--- a/libjava/java/awt/dnd/InvalidDnDOperationException.java
+++ b/libjava/java/awt/dnd/InvalidDnDOperationException.java
@@ -1,5 +1,5 @@
/* InvalidDnDOperationException.java -- thrown when drag-and-drop fails
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.awt.dnd;
* requested operation, usually because the underlying DnD system is in the
* wrong state.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/dnd/MouseDragGestureRecognizer.java b/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
index 6b21b43c598..52e19b17476 100644
--- a/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
+++ b/libjava/java/awt/dnd/MouseDragGestureRecognizer.java
@@ -1,5 +1,5 @@
/* MouseDragGestureRecognizer.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
*/
public abstract class MouseDragGestureRecognizer
extends DragGestureRecognizer
diff --git a/libjava/java/awt/dnd/peer/DropTargetContextPeer.java b/libjava/java/awt/dnd/peer/DropTargetContextPeer.java
index a2e3ba2189f..6c3816f00ac 100644
--- a/libjava/java/awt/dnd/peer/DropTargetContextPeer.java
+++ b/libjava/java/awt/dnd/peer/DropTargetContextPeer.java
@@ -1,5 +1,5 @@
/* DropTargetContextPeer.java -- interface for drag-and-drop peers
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import java.awt.dnd.InvalidDnDOperationException;
* with an associated <code>DropTarget</code> and visible geometry is first
* intersected by a logical cursor.
*
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
*/
public interface DropTargetContextPeer
{
diff --git a/libjava/java/awt/event/AWTEventListener.java b/libjava/java/awt/event/AWTEventListener.java
index b735ce1197b..b9ce7dc6690 100644
--- a/libjava/java/awt/event/AWTEventListener.java
+++ b/libjava/java/awt/event/AWTEventListener.java
@@ -1,5 +1,5 @@
/* AWTEventListener.java -- listen for all events in the AWT system
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.util.EventListener;
* system. In general, this should not be used except for classes like
* javax.accessibility or by event recorders.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see AWTEvent
* @see Toolkit#addAWTEventListener(AWTEventListener, long)
* @see Toolkit#removeAWTEventListener(AWTEventListener)
diff --git a/libjava/java/awt/event/AWTEventListenerProxy.java b/libjava/java/awt/event/AWTEventListenerProxy.java
index 7572e701a65..fef8ae70c5a 100644
--- a/libjava/java/awt/event/AWTEventListenerProxy.java
+++ b/libjava/java/awt/event/AWTEventListenerProxy.java
@@ -1,5 +1,5 @@
/* AWTEventListenerProxy.java -- wrapper/filter for AWTEventListener
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.EventListenerProxy;
* This class allows adding an AWTEventListener which only pays attention to
* a specific event mask.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Toolkit
* @see EventListenerProxy
* @since 1.4
diff --git a/libjava/java/awt/event/ActionEvent.java b/libjava/java/awt/event/ActionEvent.java
index 97f98070416..2b9763ee96d 100644
--- a/libjava/java/awt/event/ActionEvent.java
+++ b/libjava/java/awt/event/ActionEvent.java
@@ -1,5 +1,5 @@
/* ActionEvent.java -- an action has been triggered
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.awt.EventQueue;
* This event is generated when an action on a component (such as a
* button press) occurs.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ActionListener
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/awt/event/AdjustmentEvent.java b/libjava/java/awt/event/AdjustmentEvent.java
index 623dab5eaed..f7c7ae48e7c 100644
--- a/libjava/java/awt/event/AdjustmentEvent.java
+++ b/libjava/java/awt/event/AdjustmentEvent.java
@@ -1,5 +1,5 @@
/* AdjustmentEvent.java -- an adjustable value was changed
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.awt.Adjustable;
* This class represents an event that is generated when an adjustable
* value is changed.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Adjustable
* @see AdjustmentListener
* @since 1.1
diff --git a/libjava/java/awt/event/AdjustmentListener.java b/libjava/java/awt/event/AdjustmentListener.java
index 050528b00c9..d07663c5448 100644
--- a/libjava/java/awt/event/AdjustmentListener.java
+++ b/libjava/java/awt/event/AdjustmentListener.java
@@ -1,5 +1,5 @@
/* AdjustmentListener.java -- listen for adjustment events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.util.EventListener;
/**
* Interface for classes that listen for adjustment events.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/event/ComponentAdapter.java b/libjava/java/awt/event/ComponentAdapter.java
index a8d6044fa2e..6ef78478405 100644
--- a/libjava/java/awt/event/ComponentAdapter.java
+++ b/libjava/java/awt/event/ComponentAdapter.java
@@ -1,5 +1,5 @@
/* ComponentAdapter.java -- convenience class for writing component listeners
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.event;
* implementing only a subset of the <code>ComponentListener</code>
* interface to extend this class and override only the desired methods.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ComponentEvent
* @see ComponentListener
* @since 1.1
diff --git a/libjava/java/awt/event/ComponentEvent.java b/libjava/java/awt/event/ComponentEvent.java
index 0f208151d3c..08f0df7936f 100644
--- a/libjava/java/awt/event/ComponentEvent.java
+++ b/libjava/java/awt/event/ComponentEvent.java
@@ -1,5 +1,5 @@
/* ComponentEvent.java -- notification of events for components
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.awt.Component;
* is also the superclass for other events on components, but
* ComponentListeners ignore such subclasses.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ComponentAdapter
* @see ComponentListener
* @since 1.1
diff --git a/libjava/java/awt/event/ComponentListener.java b/libjava/java/awt/event/ComponentListener.java
index fbfc3335cf9..7f601740b31 100644
--- a/libjava/java/awt/event/ComponentListener.java
+++ b/libjava/java/awt/event/ComponentListener.java
@@ -1,5 +1,5 @@
/* ComponentListener.java -- receive all events for a component
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.util.EventListener;
* handles them internally, taking all appropriate actions. To watch a subset
* of these events, use a ComponentAdapter.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ComponentAdapter
* @see ComponentEvent
* @since 1.1
diff --git a/libjava/java/awt/event/ContainerAdapter.java b/libjava/java/awt/event/ContainerAdapter.java
index b4c97be47b0..bad475ecf04 100644
--- a/libjava/java/awt/event/ContainerAdapter.java
+++ b/libjava/java/awt/event/ContainerAdapter.java
@@ -1,5 +1,5 @@
/* ContainerAdapter.java -- convenience class for writing container listeners
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.event;
* implementing only a subset of the <code>ContainerListener</code>
* interface to extend this class and override only the desired methods.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ContainerEvent
* @see ContainerListener
* @since 1.1
diff --git a/libjava/java/awt/event/ContainerEvent.java b/libjava/java/awt/event/ContainerEvent.java
index fe087d2e507..08c55faf63c 100644
--- a/libjava/java/awt/event/ContainerEvent.java
+++ b/libjava/java/awt/event/ContainerEvent.java
@@ -1,5 +1,5 @@
/* ContainerEvent.java -- components added/removed from a container
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.awt.Container;
* container. Applications do not ordinarily need to handle these events
* since the AWT system handles them internally.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ContainerAdapter
* @see ContainerListener
* @since 1.1
diff --git a/libjava/java/awt/event/ContainerListener.java b/libjava/java/awt/event/ContainerListener.java
index a937e1550aa..2ad00f0b58d 100644
--- a/libjava/java/awt/event/ContainerListener.java
+++ b/libjava/java/awt/event/ContainerListener.java
@@ -1,5 +1,5 @@
/* ContainerListener.java -- listen for container events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.util.EventListener;
* listens for and processes these events. To watch a subset of these events,
* use a ContainerAdapter.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ContainerAdapter
* @see ContainerEvent
* @since 1.1
diff --git a/libjava/java/awt/event/FocusAdapter.java b/libjava/java/awt/event/FocusAdapter.java
index 721878efccb..471c7f25c0a 100644
--- a/libjava/java/awt/event/FocusAdapter.java
+++ b/libjava/java/awt/event/FocusAdapter.java
@@ -1,5 +1,5 @@
/* FocusAdapter.java -- convenience class for writing focus listeners
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.event;
* implementing only a subset of the <code>FocusListener</code> interface to
* extend this class and override only the desired methods.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see FocusEvent
* @see FocusListener
* @since 1.1
diff --git a/libjava/java/awt/event/FocusEvent.java b/libjava/java/awt/event/FocusEvent.java
index 9f2b98f762a..3bca6a7d49e 100644
--- a/libjava/java/awt/event/FocusEvent.java
+++ b/libjava/java/awt/event/FocusEvent.java
@@ -1,5 +1,5 @@
/* FocusEvent.java -- generated for a focus change
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.awt.Component;
* during a sroll then returned, and permanent changes, such as when the user
* TABs through focusable components.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see FocusAdapter
* @see FocusListener
* @since 1.1
diff --git a/libjava/java/awt/event/FocusListener.java b/libjava/java/awt/event/FocusListener.java
index e372843cb2a..d8ef5a81e28 100644
--- a/libjava/java/awt/event/FocusListener.java
+++ b/libjava/java/awt/event/FocusListener.java
@@ -1,5 +1,5 @@
/* FocusListener.java -- listen for focus changes
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.EventListener;
* keyboard focus for a component. To watch a subset of these events, use a
* FocusAdapter.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see FocusAdapter
* @see FocusEvent
* @since 1.1
diff --git a/libjava/java/awt/event/InputEvent.java b/libjava/java/awt/event/InputEvent.java
index b2a1e3114ec..cd59afc299c 100644
--- a/libjava/java/awt/event/InputEvent.java
+++ b/libjava/java/awt/event/InputEvent.java
@@ -1,5 +1,5 @@
/* InputEvent.java -- common superclass of component input events
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import java.awt.Component;
* passed to listeners before the component, so that listeners can consume
* the event before it does its default behavior.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see KeyEvent
* @see KeyAdapter
* @see MouseEvent
diff --git a/libjava/java/awt/event/InputMethodEvent.java b/libjava/java/awt/event/InputMethodEvent.java
index 880025b0a9f..98dc4263341 100644
--- a/libjava/java/awt/event/InputMethodEvent.java
+++ b/libjava/java/awt/event/InputMethodEvent.java
@@ -1,5 +1,5 @@
/* InputMethodEvent.java -- events from a text input method
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ import java.text.AttributedCharacterIterator;
/**
* This class is for event generated by change in a text input method.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see InputMethodListener
* @since 1.2
* @status updated to 1.4
diff --git a/libjava/java/awt/event/InputMethodListener.java b/libjava/java/awt/event/InputMethodListener.java
index bf09ed89336..08de16f7d3c 100644
--- a/libjava/java/awt/event/InputMethodListener.java
+++ b/libjava/java/awt/event/InputMethodListener.java
@@ -1,5 +1,5 @@
/* InputMethodListener.java -- listen for input method events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.EventListener;
* method. For a text component to use input methods, it must also install
* an InputMethodRequests handler.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see InputMethodEvent
* @see InputMethodRequests
* @since 1.2
diff --git a/libjava/java/awt/event/InvocationEvent.java b/libjava/java/awt/event/InvocationEvent.java
index fb58595c793..27546c010ec 100644
--- a/libjava/java/awt/event/InvocationEvent.java
+++ b/libjava/java/awt/event/InvocationEvent.java
@@ -1,5 +1,5 @@
/* InvocationEvent.java -- call a runnable when dispatched
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.awt.EventQueue;
* <code>invokeAndWait</code>, so client code can use this fact to avoid
* writing special-casing AWTEventListener objects.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ActiveEvent
* @see EventQueue#invokeLater(Runnable)
* @see EventQueue#invokeAndWait(Runnable)
diff --git a/libjava/java/awt/event/ItemEvent.java b/libjava/java/awt/event/ItemEvent.java
index 43784a86504..f9c3ee2fcf4 100644
--- a/libjava/java/awt/event/ItemEvent.java
+++ b/libjava/java/awt/event/ItemEvent.java
@@ -1,5 +1,5 @@
/* ItemEvent.java -- event for item state changes
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.awt.ItemSelectable;
* abstraction that distills a large number of individual mouse or keyboard
* events into a simpler "item selected" and "item deselected" events.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ItemSelectable
* @see ItemListener
* @since 1.1
diff --git a/libjava/java/awt/event/ItemListener.java b/libjava/java/awt/event/ItemListener.java
index 5c67357851b..cc8f8c79204 100644
--- a/libjava/java/awt/event/ItemListener.java
+++ b/libjava/java/awt/event/ItemListener.java
@@ -1,5 +1,5 @@
/* ItemListener.java -- listen for item events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This interface is for classes that wish to receive events when an
* item's selection state changes.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ItemSelectable
* @see ItemEvent
* @since 1.1
diff --git a/libjava/java/awt/event/KeyAdapter.java b/libjava/java/awt/event/KeyAdapter.java
index c60fd52e245..d27786c4347 100644
--- a/libjava/java/awt/event/KeyAdapter.java
+++ b/libjava/java/awt/event/KeyAdapter.java
@@ -1,5 +1,5 @@
/* KeyAdapter.java -- convenience class for writing key listeners
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.event;
* a subset of the <code>KeyListener</code> interface to extend this class
* and override only the desired methods.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see KeyEvent
* @see KeyListener
* @since 1.1
diff --git a/libjava/java/awt/event/KeyEvent.java b/libjava/java/awt/event/KeyEvent.java
index 7212c0c9791..cef05ae6241 100644
--- a/libjava/java/awt/event/KeyEvent.java
+++ b/libjava/java/awt/event/KeyEvent.java
@@ -1,5 +1,5 @@
/* KeyEvent.java -- event for key presses
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -70,8 +70,8 @@ import java.io.ObjectInputStream;
* as VK_ALL_CANDIDATES in place of ALT+VK_CONVERT. Do not rely on the value
* of the VK_* constants, except for VK_ENTER, VK_BACK_SPACE, and VK_TAB.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see KeyAdapter
* @see KeyListener
* @since 1.1
diff --git a/libjava/java/awt/event/KeyListener.java b/libjava/java/awt/event/KeyListener.java
index 7443eedd8fb..d46edf4f48f 100644
--- a/libjava/java/awt/event/KeyListener.java
+++ b/libjava/java/awt/event/KeyListener.java
@@ -1,5 +1,5 @@
/* KeyListener.java -- listen for keyboard presses
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This interface is for classes that wish to receive keyboard events. To
* watch a subset of these events, use a KeyAdapter.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see KeyAdapter
* @see KeyEvent
* @since 1.1
diff --git a/libjava/java/awt/event/MouseAdapter.java b/libjava/java/awt/event/MouseAdapter.java
index 2518d365576..5c8cbd0d51a 100644
--- a/libjava/java/awt/event/MouseAdapter.java
+++ b/libjava/java/awt/event/MouseAdapter.java
@@ -1,5 +1,5 @@
/* MouseAdapter.java -- convenience class for writing mouse listeners
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.event;
* a subset of the <code>MouseListener</code> interface to extend this class
* and override only the desired methods.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see MouseEvent
* @see MouseListener
* @since 1.1
diff --git a/libjava/java/awt/event/MouseEvent.java b/libjava/java/awt/event/MouseEvent.java
index 7f3e014a2ea..6e43183dd05 100644
--- a/libjava/java/awt/event/MouseEvent.java
+++ b/libjava/java/awt/event/MouseEvent.java
@@ -1,5 +1,5 @@
/* MouseEvent.java -- a mouse event
- Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,8 +63,8 @@ import java.io.ObjectInputStream;
* virtual device, some platforms may clip the path to fit in the bounds of
* the component.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see MouseAdapter
* @see MouseListener
* @see MouseMotionAdapter
diff --git a/libjava/java/awt/event/MouseListener.java b/libjava/java/awt/event/MouseListener.java
index 6162b089769..8b60ef70447 100644
--- a/libjava/java/awt/event/MouseListener.java
+++ b/libjava/java/awt/event/MouseListener.java
@@ -1,5 +1,5 @@
/* MouseListener.java -- listen for mouse clicks and crossing component edges
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.util.EventListener;
* use MouseWheelListener. To watch a subset of these events, use a
* MouseAdapter.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see MouseAdapter
* @see MouseEvent
* @since 1.1
diff --git a/libjava/java/awt/event/MouseMotionAdapter.java b/libjava/java/awt/event/MouseMotionAdapter.java
index cc7498820c7..0500cc5f58a 100644
--- a/libjava/java/awt/event/MouseMotionAdapter.java
+++ b/libjava/java/awt/event/MouseMotionAdapter.java
@@ -1,5 +1,5 @@
/* MouseMotionAdapter.java -- convenience class for mouse motion listeners
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.event;
* implementing only a subset of the <code>MouseMotionListener</code>
* interface to extend this class and override only the desired methods.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see MouseEvent
* @see MouseMotionListener
* @since 1.1
diff --git a/libjava/java/awt/event/MouseMotionListener.java b/libjava/java/awt/event/MouseMotionListener.java
index 16ced33c1f4..1a003eaca80 100644
--- a/libjava/java/awt/event/MouseMotionListener.java
+++ b/libjava/java/awt/event/MouseMotionListener.java
@@ -1,5 +1,5 @@
/* MouseMotionListener.java -- listen to mouse motion events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.util.EventListener;
* track other mouse events, use MouseListener or MouseWheelListener. To
* watch a subset of these events, use a MouseMotionAdapter.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see MouseMotionAdapter
* @see MouseEvent
* @since 1.1
diff --git a/libjava/java/awt/event/MouseWheelEvent.java b/libjava/java/awt/event/MouseWheelEvent.java
index 88d31a5467a..c16705759e7 100644
--- a/libjava/java/awt/event/MouseWheelEvent.java
+++ b/libjava/java/awt/event/MouseWheelEvent.java
@@ -1,5 +1,5 @@
/* MouseWheelEvent.java -- a mouse wheel event
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import java.awt.Component;
* "blocks" (pages at a time). The initial setting is taken from the platform,
* although the user can adjust the setting at any time.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see MouseWheelListener
* @see ScrollPane
* @see ScrollPane#setWheelScrollingEnabled(boolean)
diff --git a/libjava/java/awt/event/MouseWheelListener.java b/libjava/java/awt/event/MouseWheelListener.java
index 15cbd0370f1..cfb5528f4f8 100644
--- a/libjava/java/awt/event/MouseWheelListener.java
+++ b/libjava/java/awt/event/MouseWheelListener.java
@@ -1,5 +1,5 @@
/* MouseWheelListener.java -- listen for mouse wheel events
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This interface is for classes that wish to receive mouse wheel events. For
* other events, use MouseListener or MouseMotionListener.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see MouseWheelEvent
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/awt/event/PaintEvent.java b/libjava/java/awt/event/PaintEvent.java
index 107c6b390b6..c11e2b65fa4 100644
--- a/libjava/java/awt/event/PaintEvent.java
+++ b/libjava/java/awt/event/PaintEvent.java
@@ -1,5 +1,5 @@
/* PaintEvent.java -- an area of the screen needs to be repainted
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.awt.Rectangle;
* This event is not meant for users, but exists to allow proper serialization
* behavior in the EventQueue with user-accessible events.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/event/TextEvent.java b/libjava/java/awt/event/TextEvent.java
index 58d9ab6086f..7cf44b4c0d6 100644
--- a/libjava/java/awt/event/TextEvent.java
+++ b/libjava/java/awt/event/TextEvent.java
@@ -1,5 +1,5 @@
/* TextEvent.java -- event for text changes
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.awt.AWTEvent;
* abstraction that distills a large number of individual mouse or keyboard
* events into a simpler "text changed" event.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see TextComponent
* @see TextListener
* @since 1.1
diff --git a/libjava/java/awt/event/TextListener.java b/libjava/java/awt/event/TextListener.java
index efdd103d509..f764783510c 100644
--- a/libjava/java/awt/event/TextListener.java
+++ b/libjava/java/awt/event/TextListener.java
@@ -1,5 +1,5 @@
/* TextListener.java -- listen for text changes
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This interface is for classes that wish to be notified when text changes
* in a component.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see TextEvent
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/awt/event/WindowAdapter.java b/libjava/java/awt/event/WindowAdapter.java
index 5dea18c3e8f..39292862d29 100644
--- a/libjava/java/awt/event/WindowAdapter.java
+++ b/libjava/java/awt/event/WindowAdapter.java
@@ -1,5 +1,5 @@
/* WindowAdapter.java -- convenience class for writing window listeners
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.awt.event;
* interested in listening to only a subset of any <code>WindowEvent</code>
* actions to extend this class and override only the desired methods.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see ComponentEvent
* @see ComponentListener
* @since 1.1
diff --git a/libjava/java/awt/event/WindowEvent.java b/libjava/java/awt/event/WindowEvent.java
index 6e40d5165b8..68a8c25d08b 100644
--- a/libjava/java/awt/event/WindowEvent.java
+++ b/libjava/java/awt/event/WindowEvent.java
@@ -1,5 +1,5 @@
/* WindowEvent.java -- window change event
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.awt.Window;
* like maximization, and WindowFocusListeners deal with focus switching to
* or from a window.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see WindowAdapter
* @see WindowListener
* @see WindowFocusListener
diff --git a/libjava/java/awt/event/WindowFocusListener.java b/libjava/java/awt/event/WindowFocusListener.java
index de684fbfce1..42034b7c7ab 100644
--- a/libjava/java/awt/event/WindowFocusListener.java
+++ b/libjava/java/awt/event/WindowFocusListener.java
@@ -1,5 +1,5 @@
/* WindowFocusListener.java -- listens for window focus events
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This interface is for classes that wish to monitor events for window
* focus changes. To watch a subset of these events, use a WindowAdapter.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see WindowAdapter
* @see WindowEvent
* @since 1.4
diff --git a/libjava/java/awt/event/WindowListener.java b/libjava/java/awt/event/WindowListener.java
index ab22c8fb826..8bbcabaf64d 100644
--- a/libjava/java/awt/event/WindowListener.java
+++ b/libjava/java/awt/event/WindowListener.java
@@ -1,5 +1,5 @@
/* WindowListener.java -- listens for window events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This interface is for classes that wish to monitor events for window
* changes. To watch a subset of these events, use a WindowAdapter.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see WindowAdapter
* @see WindowEvent
* @since 1.1
diff --git a/libjava/java/awt/event/WindowStateListener.java b/libjava/java/awt/event/WindowStateListener.java
index 2d870a8dd9f..dcf4496c796 100644
--- a/libjava/java/awt/event/WindowStateListener.java
+++ b/libjava/java/awt/event/WindowStateListener.java
@@ -1,5 +1,5 @@
/* WindowStateListener.java -- listens for window state changes
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.EventListener;
* This interface is for classes that wish to monitor events for window
* state changes.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see WindowAdapter
* @see WindowEvent
* @since 1.4
diff --git a/libjava/java/awt/font/TextAttribute.java b/libjava/java/awt/font/TextAttribute.java
index 7d5444677a9..e63d2955e56 100644
--- a/libjava/java/awt/font/TextAttribute.java
+++ b/libjava/java/awt/font/TextAttribute.java
@@ -1,5 +1,5 @@
/* TextAttribute.java --
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,83 +41,269 @@ package java.awt.font;
import java.io.InvalidObjectException;
import java.text.AttributedCharacterIterator;
+/**
+ * Attributes (and associated values) that can be used to define an
+ * {@link java.text.AttributedString}.
+ */
public final class TextAttribute extends AttributedCharacterIterator.Attribute
{
private static final long serialVersionUID = 7744112784117861702L;
+ /** A key for the background paint attribute. */
public static final TextAttribute BACKGROUND =
- new TextAttribute ("BACKGROUND");
+ new TextAttribute("background");
+
+ /** A key for the BIDI_EMBEDDING attribute. */
public static final TextAttribute BIDI_EMBEDDING =
- new TextAttribute ("BIDI_EMBEDDING");
+ new TextAttribute("bidi_embedding");
+
+ /** A key for the CHAR_REPLACEMENT attribute. */
public static final TextAttribute CHAR_REPLACEMENT =
- new TextAttribute ("CHAR_REPLACEMENT");
- public static final TextAttribute FAMILY = new TextAttribute ("FAMILY");
- public static final TextAttribute FONT = new TextAttribute ("FONT");
- public static final TextAttribute FOREGROUND =
- new TextAttribute ("FOREGROUND");
+ new TextAttribute("char_replacement");
+
+ /** A key for the FAMILY attribute. */
+ public static final TextAttribute FAMILY = new TextAttribute("family");
+
+ /** A key for the font attribute. */
+ public static final TextAttribute FONT = new TextAttribute("font");
+
+ /** A key for the foreground paint attribute. */
+ public static final TextAttribute FOREGROUND =
+ new TextAttribute("foreground");
+
+ /** A key for the INPUT_METHOD_HIGHLIGHT attribute. */
public static final TextAttribute INPUT_METHOD_HIGHLIGHT =
- new TextAttribute ("INPUT_METHOD_HIGHLIGHT");
+ new TextAttribute("input method highlight");
+
+ /** A key for the INPUT_METHOD_UNDERLINE attribute. */
public static final TextAttribute INPUT_METHOD_UNDERLINE =
- new TextAttribute ("INPUT_METHOD_UNDERLINE");
+ new TextAttribute("input method underline");
+
+ /** A key for the text justification attribute. */
public static final TextAttribute JUSTIFICATION =
- new TextAttribute ("JUSTIFICATION");
- public static final Float JUSTIFICATION_FULL = new Float (1.0);
- public static final Float JUSTIFICATION_NONE = new Float (0.0);
+ new TextAttribute("justification");
+
+ /**
+ * A value that can be used with the {@link #JUSTIFICATION} attribute to
+ * indicate full justification of the text.
+ */
+ public static final Float JUSTIFICATION_FULL = new Float(1.0);
+
+ /**
+ * A value that can be used with the {@link #JUSTIFICATION} attribute to
+ * indicate no justification of the text.
+ */
+ public static final Float JUSTIFICATION_NONE = new Float(0.0);
+
+ /** A key for the NUMERIC_SHAPING attribute. */
public static final TextAttribute NUMERIC_SHAPING =
- new TextAttribute ("NUMERIC_SHAPING");
- public static final TextAttribute POSTURE = new TextAttribute ("POSTURE");
- public static final Float POSTURE_OBLIQUE = new Float (0.2);
- public static final Float POSTURE_REGULAR = new Float (0.0);
+ new TextAttribute("numeric_shaping");
+
+ /** A key for the POSTURE attribute. */
+ public static final TextAttribute POSTURE = new TextAttribute("posture");
+
+ /** A value that can be used with the {@link #POSTURE} attribute. */
+ public static final Float POSTURE_OBLIQUE = new Float(0.2);
+
+ /** A value that can be used with the {@link #POSTURE} attribute. */
+ public static final Float POSTURE_REGULAR = new Float(0.0);
+
+ /** A key for the RUN_DIRECTION attribute. */
public static final TextAttribute RUN_DIRECTION =
- new TextAttribute ("RUN_DIRECTION");
- public static final Boolean RUN_DIRECTION_LTR = Boolean.TRUE;
- public static final Boolean RUN_DIRECTION_RTL = Boolean.FALSE;
- public static final TextAttribute SIZE = new TextAttribute ("SIZE");
+ new TextAttribute("run_direction");
+
+ /** A value that can be used with the {@link #RUN_DIRECTION} attribute. */
+ public static final Boolean RUN_DIRECTION_LTR = Boolean.FALSE;
+
+ /** A value that can be used with the {@link #RUN_DIRECTION} attribute. */
+ public static final Boolean RUN_DIRECTION_RTL = Boolean.TRUE;
+
+ /** A key for the text size attribute. */
+ public static final TextAttribute SIZE = new TextAttribute("size");
+
+ /** A key for the STRIKETHROUGH attribute. */
public static final TextAttribute STRIKETHROUGH =
- new TextAttribute ("STRIKETHROUGH");
+ new TextAttribute("strikethrough");
+
+ /** A value that can be used with the {@link #STRIKETHROUGH} attribute. */
public static final Boolean STRIKETHROUGH_ON = Boolean.TRUE;
+
+ /** A key for the SUPERSCRIPT attribute. */
public static final TextAttribute SUPERSCRIPT =
- new TextAttribute ("SUPERSCRIPT");
- public static final Integer SUPERSCRIPT_SUB = new Integer (-1);
- public static final Integer SUPERSCRIPT_SUPER = new Integer (1);
+ new TextAttribute("superscript");
+
+ /** A value that can be used with the {@link #SUPERSCRIPT} attribute. */
+ public static final Integer SUPERSCRIPT_SUB = new Integer(-1);
+
+ /** A value that can be used with the {@link #SUPERSCRIPT} attribute. */
+ public static final Integer SUPERSCRIPT_SUPER = new Integer(1);
+
+ /** A key for the SWAP_COLORS attribute. */
public static final TextAttribute SWAP_COLORS =
- new TextAttribute ("SWAP_COLORS");
+ new TextAttribute("swap_colors");
+
+ /** A value that can be used with the {@link #SWAP_COLORS} attribute. */
public static final Boolean SWAP_COLORS_ON = Boolean.TRUE;
- public static final TextAttribute TRANSFORM = new TextAttribute ("TRANSFORM");
- public static final TextAttribute UNDERLINE = new TextAttribute ("UNDERLINE");
- public static final Integer UNDERLINE_LOW_DASHED = new Integer (0);
- public static final Integer UNDERLINE_LOW_DOTTED = new Integer (0);
- public static final Integer UNDERLINE_LOW_GRAY = new Integer (0);
- public static final Integer UNDERLINE_LOW_ONE_PIXEL = new Integer (0);
- public static final Integer UNDERLINE_LOW_TWO_PIXEL = new Integer (0);
- public static final Integer UNDERLINE_ON = new Integer (0);
- public static final TextAttribute WEIGHT = new TextAttribute ("WEIGHT");
- public static final Float WEIGHT_BOLD = new Float (2.0);
- public static final Float WEIGHT_DEMIBOLD = new Float (1.75);
- public static final Float WEIGHT_DEMILIGHT = new Float (0.875);
- public static final Float WEIGHT_EXTRA_LIGHT = new Float (0.5);
- public static final Float WEIGHT_EXTRABOLD = new Float (2.5);
- public static final Float WEIGHT_HEAVY = new Float (2.25);
- public static final Float WEIGHT_LIGHT = new Float (0.75);
- public static final Float WEIGHT_MEDIUM = new Float (1.5);
- public static final Float WEIGHT_REGULAR = new Float (1.0);
- public static final Float WEIGHT_SEMIBOLD = new Float (1.25);
- public static final Float WEIGHT_ULTRABOLD = new Float (2.75);
- public static final TextAttribute WIDTH = new TextAttribute ("");
- public static final Float WIDTH_CONDENSED = new Float (0.75);
- public static final Float WIDTH_EXTENDED = new Float (1.5);
- public static final Float WIDTH_REGULAR = new Float (1.0);
- public static final Float WIDTH_SEMI_CONDENSED = new Float (0.875);
- public static final Float WIDTH_SEMI_EXTENDED = new Float (1.25);
-
- protected TextAttribute (String name)
+
+ /** A key for the TRANFORM attribute. */
+ public static final TextAttribute TRANSFORM = new TextAttribute("transform");
+
+ /** A key for the UNDERLINE attribute. */
+ public static final TextAttribute UNDERLINE = new TextAttribute("underline");
+
+ /** A value that can be used with the {@link #UNDERLINE} attribute. */
+ public static final Integer UNDERLINE_LOW_DASHED = new Integer(5);
+
+ /** A value that can be used with the {@link #UNDERLINE} attribute. */
+ public static final Integer UNDERLINE_LOW_DOTTED = new Integer(3);
+
+ /** A value that can be used with the {@link #UNDERLINE} attribute. */
+ public static final Integer UNDERLINE_LOW_GRAY = new Integer(4);
+
+ /** A value that can be used with the {@link #UNDERLINE} attribute. */
+ public static final Integer UNDERLINE_LOW_ONE_PIXEL = new Integer(1);
+
+ /** A value that can be used with the {@link #UNDERLINE} attribute. */
+ public static final Integer UNDERLINE_LOW_TWO_PIXEL = new Integer(2);
+
+ /** A value that can be used with the {@link #UNDERLINE} attribute. */
+ public static final Integer UNDERLINE_ON = new Integer(0);
+
+ /** A key for the WEIGHT attribute. */
+ public static final TextAttribute WEIGHT = new TextAttribute("weight");
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_BOLD = new Float(2.0);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_DEMIBOLD = new Float(1.75);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_DEMILIGHT = new Float(0.875);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_EXTRA_LIGHT = new Float(0.5);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_EXTRABOLD = new Float(2.5);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_HEAVY = new Float(2.25);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_LIGHT = new Float(0.75);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_MEDIUM = new Float(1.5);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_REGULAR = new Float(1.0);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_SEMIBOLD = new Float(1.25);
+
+ /** A value that can be used with the {@link #WEIGHT} attribute. */
+ public static final Float WEIGHT_ULTRABOLD = new Float(2.75);
+
+ /** A key for the WIDTH attribute. */
+ public static final TextAttribute WIDTH = new TextAttribute("width");
+
+ /** A value that can be used with the {@link #WIDTH} attribute. */
+ public static final Float WIDTH_CONDENSED = new Float(0.75);
+
+ /** A value that can be used with the {@link #WIDTH} attribute. */
+ public static final Float WIDTH_EXTENDED = new Float(1.5);
+
+ /** A value that can be used with the {@link #WIDTH} attribute. */
+ public static final Float WIDTH_REGULAR = new Float(1.0);
+
+ /** A value that can be used with the {@link #WIDTH} attribute. */
+ public static final Float WIDTH_SEMI_CONDENSED = new Float(0.875);
+
+ /** A value that can be used with the {@link #WIDTH} attribute. */
+ public static final Float WIDTH_SEMI_EXTENDED = new Float(1.25);
+
+ /**
+ * Creates a new attribute.
+ *
+ * @param name the name.
+ */
+ protected TextAttribute(String name)
{
- super (name);
+ super(name);
}
- protected Object readResolve ()
+ /**
+ * After deserialization, this method ensures that only one instance of
+ * each attribute is used.
+ *
+ * @return The (single) attribute instance.
+ *
+ * @throws InvalidObjectException if the attribute is not recognised.
+ */
+ protected Object readResolve()
throws InvalidObjectException
{
- throw new Error ("not implemented");
+ if (this.getName().equals("background"))
+ return BACKGROUND;
+
+ if (this.getName().equals("bidi_embedding"))
+ return BIDI_EMBEDDING;
+
+ if (this.getName().equals("char_replacement"))
+ return CHAR_REPLACEMENT;
+
+ if (this.getName().equals("family"))
+ return FAMILY;
+
+ if (this.getName().equals("font"))
+ return FONT;
+
+ if (this.getName().equals("foreground"))
+ return FOREGROUND;
+
+ if (this.getName().equals("input method highlight"))
+ return INPUT_METHOD_HIGHLIGHT;
+
+ if (this.getName().equals("input method underline"))
+ return INPUT_METHOD_UNDERLINE;
+
+ if (this.getName().equals("justification"))
+ return JUSTIFICATION;
+
+ if (this.getName().equals("numeric_shaping"))
+ return NUMERIC_SHAPING;
+
+ if (this.getName().equals("posture"))
+ return POSTURE;
+
+ if (this.getName().equals("run_direction"))
+ return RUN_DIRECTION;
+
+ if (this.getName().equals("size"))
+ return SIZE;
+
+ if (this.getName().equals("strikethrough"))
+ return STRIKETHROUGH;
+
+ if (this.getName().equals("superscript"))
+ return SUPERSCRIPT;
+
+ if (this.getName().equals("swap_colors"))
+ return SWAP_COLORS;
+
+ if (this.getName().equals("transform"))
+ return TRANSFORM;
+
+ if (this.getName().equals("underline"))
+ return UNDERLINE;
+
+ if (this.getName().equals("weight"))
+ return WEIGHT;
+
+ if (this.getName().equals("width"))
+ return WIDTH;
+
+ throw new InvalidObjectException("Can't resolve Attribute: " + getName());
}
}
diff --git a/libjava/java/awt/font/TextHitInfo.java b/libjava/java/awt/font/TextHitInfo.java
index daeb7c689b3..2629ad2a54d 100644
--- a/libjava/java/awt/font/TextHitInfo.java
+++ b/libjava/java/awt/font/TextHitInfo.java
@@ -1,5 +1,5 @@
/* TextHitInfo.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.awt.font;
/**
- * @author John Leuner <jewel@debian.org>
+ * @author John Leuner (jewel@debian.org)
*/
public final class TextHitInfo
{
diff --git a/libjava/java/awt/font/TransformAttribute.java b/libjava/java/awt/font/TransformAttribute.java
index b2417041961..3bb3c3cf1c3 100644
--- a/libjava/java/awt/font/TransformAttribute.java
+++ b/libjava/java/awt/font/TransformAttribute.java
@@ -1,5 +1,5 @@
-/* TransformAttribute.java
- Copyright (C) 2003 Free Software Foundation, Inc.
+/* TransformAttribute.java --
+ Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,6 +42,13 @@ import java.awt.geom.AffineTransform;
import java.io.Serializable;
/**
+ * This class provides a mechanism for using an {@link AffineTransform} as
+ * an <i>immutable</i> attribute (for example, in the
+ * {@link java.text.AttributedString} class). Any transform passed to
+ * this class is copied before being stored, and any transform handed out
+ * by this class is a copy of the stored transform. In this way, it is
+ * not possible to modify the stored transform.
+ *
* @author Michael Koch
*/
public final class TransformAttribute implements Serializable
@@ -50,20 +57,40 @@ public final class TransformAttribute implements Serializable
private AffineTransform affineTransform;
+ /**
+ * Creates a new attribute that contains a copy of the given transform.
+ *
+ * @param transform the transform (<code>null</code> not permitted).
+ *
+ * @throws IllegalArgumentException if <code>transform</code> is
+ * <code>null</code>.
+ */
public TransformAttribute (AffineTransform transform)
{
- if (transform != null)
+ if (transform == null)
{
- this.affineTransform = new AffineTransform (transform);
+ throw new IllegalArgumentException("Null 'transform' not permitted.");
}
+ this.affineTransform = new AffineTransform (transform);
}
+ /**
+ * Returns a copy of the transform contained by this attribute.
+ *
+ * @return A copy of the transform.
+ */
public AffineTransform getTransform ()
{
- return affineTransform;
+ return (AffineTransform) affineTransform.clone();
}
/**
+ * Returns <code>true</code> if the transform contained by this attribute is
+ * an identity transform, and <code>false</code> otherwise.
+ *
+ * @return <code>true</code> if the transform contained by this attribute is
+ * an identity transform, and <code>false</code> otherwise.
+ *
* @since 1.4
*/
public boolean isIdentity ()
diff --git a/libjava/java/awt/geom/Area.java b/libjava/java/awt/geom/Area.java
index 9b1b9d3b109..68f905f08f4 100644
--- a/libjava/java/awt/geom/Area.java
+++ b/libjava/java/awt/geom/Area.java
@@ -2631,11 +2631,9 @@ public class Area implements Shape, Cloneable
double P = (y2 - 2 * y1 + y0);
double Q = 2 * (y1 - y0);
- double R = y0;
double A = (x2 - 2 * x1 + x0);
double B = 2 * (x1 - x0);
- double C = x0;
double area = (B * P - A * Q) / 3.0;
return (area);
@@ -2937,12 +2935,10 @@ public class Area implements Shape, Cloneable
double P = y3 - 3 * y2 + 3 * y1 - y0;
double Q = 3 * (y2 + y0 - 2 * y1);
double R = 3 * (y1 - y0);
- double S = y0;
double A = x3 - 3 * x2 + 3 * x1 - x0;
double B = 3 * (x2 + x0 - 2 * x1);
double C = 3 * (x1 - x0);
- double D = x0;
double area = (B * P - A * Q) / 5.0 + (C * P - A * R) / 2.0
+ (C * Q - B * R) / 3.0;
diff --git a/libjava/java/awt/geom/CubicCurve2D.java b/libjava/java/awt/geom/CubicCurve2D.java
index 20373061d18..1c500b00b5e 100644
--- a/libjava/java/awt/geom/CubicCurve2D.java
+++ b/libjava/java/awt/geom/CubicCurve2D.java
@@ -642,11 +642,11 @@ public abstract class CubicCurve2D implements Shape, Cloneable
* @see #solveCubic(double[], double[])
* @see QuadCurve2D#solveQuadratic(double[],double[])
*
- * @author <a href="mailto:bjg@network-theory.com">Brian Gough</a>
+ * @author Brian Gough (bjg@network-theory.com)
* (original C implementation in the <a href=
* "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
* (adaptation to Java)
*/
public static int solveCubic(double[] eqn)
@@ -689,11 +689,11 @@ public abstract class CubicCurve2D implements Shape, Cloneable
* result of -1 indicates that the equation is constant (i.e.,
* always or never zero).
*
- * @author <a href="mailto:bjg@network-theory.com">Brian Gough</a>
+ * @author Brain Gouph (bjg@network-theory.com)
* (original C implementation in the <a href=
* "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
* (adaptation to Java)
*/
public static int solveCubic(double[] eqn, double[] res)
diff --git a/libjava/java/awt/geom/Dimension2D.java b/libjava/java/awt/geom/Dimension2D.java
index dbbdf6b25b3..8654c745ec0 100644
--- a/libjava/java/awt/geom/Dimension2D.java
+++ b/libjava/java/awt/geom/Dimension2D.java
@@ -42,8 +42,8 @@ package java.awt.geom;
* This stores a dimension in 2-dimensional space - a width (along the x-axis)
* and height (along the y-axis). The storage is left to subclasses.
*
- * @author Per Bothner <bothner@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Per Bothner (bothner@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/geom/Ellipse2D.java b/libjava/java/awt/geom/Ellipse2D.java
index bd64adf1e3a..85ba1d1e9a5 100644
--- a/libjava/java/awt/geom/Ellipse2D.java
+++ b/libjava/java/awt/geom/Ellipse2D.java
@@ -46,10 +46,10 @@ package java.awt.geom;
* The ellipse is defined by it's bounding box (shown in red),
* and is defined by the implicit curve:<BR>
* <blockquote>(<i>x</i>/<i>a</i>)<sup>2</sup> +
- * (<i>y</i>/<i>b</i>)<sup>2</sup> = 1<BR><BR>
+ * (<i>y</i>/<i>b</i>)<sup>2</sup> = 1<BR><BR></blockquote>
*
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
*
* @since 1.2
*/
diff --git a/libjava/java/awt/geom/IllegalPathStateException.java b/libjava/java/awt/geom/IllegalPathStateException.java
index f0e388aac55..3aa432df14c 100644
--- a/libjava/java/awt/geom/IllegalPathStateException.java
+++ b/libjava/java/awt/geom/IllegalPathStateException.java
@@ -41,7 +41,7 @@ package java.awt.geom;
* Thrown when an operation on a path is in an illegal state, such as appending
* a segment to a <code>GeneralPath</code> without an initial moveto.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see GeneralPath
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/geom/Line2D.java b/libjava/java/awt/geom/Line2D.java
index 05eedcde4b2..3b64f455727 100644
--- a/libjava/java/awt/geom/Line2D.java
+++ b/libjava/java/awt/geom/Line2D.java
@@ -46,8 +46,8 @@ import java.util.NoSuchElementException;
* Remember, on-screen graphics have increasing x from left-to-right, and
* increasing y from top-to-bottom. The storage is left to subclasses.
*
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @author David Gilbert
* @since 1.2
* @status updated to 1.4
@@ -867,7 +867,7 @@ public abstract class Line2D implements Shape, Cloneable
/**
* This class defines a point in <code>double</code> precision.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
@@ -1017,7 +1017,7 @@ public abstract class Line2D implements Shape, Cloneable
/**
* This class defines a point in <code>float</code> precision.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/geom/NoninvertibleTransformException.java b/libjava/java/awt/geom/NoninvertibleTransformException.java
index 40b2c180298..0fa36674d4e 100644
--- a/libjava/java/awt/geom/NoninvertibleTransformException.java
+++ b/libjava/java/awt/geom/NoninvertibleTransformException.java
@@ -42,7 +42,7 @@ package java.awt.geom;
* <code>AffineTransform</code>, but the transform is in a non-invertible
* state.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see AffineTransform
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/geom/PathIterator.java b/libjava/java/awt/geom/PathIterator.java
index 8076b5c8353..6d38911b732 100644
--- a/libjava/java/awt/geom/PathIterator.java
+++ b/libjava/java/awt/geom/PathIterator.java
@@ -44,8 +44,8 @@ package java.awt.geom;
* MOVETO directive, and can close a circular path back to the previos
* MOVETO via the CLOSE directive.
*
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see java.awt.Shape
* @see java.awt.Stroke
* @see FlatteningPathIterator
diff --git a/libjava/java/awt/geom/Point2D.java b/libjava/java/awt/geom/Point2D.java
index d27505fa41d..e334ac7806b 100644
--- a/libjava/java/awt/geom/Point2D.java
+++ b/libjava/java/awt/geom/Point2D.java
@@ -229,7 +229,7 @@ public abstract class Point2D implements Cloneable
/**
* This class defines a point in <code>double</code> precision.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
@@ -307,7 +307,7 @@ public abstract class Point2D implements Cloneable
/**
* This class defines a point in <code>float</code> precision.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/geom/QuadCurve2D.java b/libjava/java/awt/geom/QuadCurve2D.java
index 0376d5a01af..db7c2abf2ec 100644
--- a/libjava/java/awt/geom/QuadCurve2D.java
+++ b/libjava/java/awt/geom/QuadCurve2D.java
@@ -41,7 +41,6 @@ import java.awt.Rectangle;
import java.awt.Shape;
import java.util.NoSuchElementException;
-
/**
* A two-dimensional curve that is parameterized with a quadratic
* function.
@@ -563,11 +562,11 @@ public abstract class QuadCurve2D implements Shape, Cloneable
* result of -1 indicates that the equation is constant (i.e.,
* always or never zero).
*
- * @author <a href="mailto:bjg@network-theory.com">Brian Gough</a>
+ * @author Brain Gouph (bjg@network-theory.com)
* (original C implementation in the <a href=
* "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
* (adaptation to Java)
*/
public static int solveQuadratic(double[] eqn)
@@ -608,11 +607,11 @@ public abstract class QuadCurve2D implements Shape, Cloneable
* result of -1 indicates that the equation is constant (i.e.,
* always or never zero).
*
- * @author <a href="mailto:bjg@network-theory.com">Brian Gough</a>
+ * @author Brian Gouph (bjg@network-theory.com)
* (original C implementation in the <a href=
* "http://www.gnu.org/software/gsl/">GNU Scientific Library</a>)
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
* (adaptation to Java)
*/
public static int solveQuadratic(double[] eqn, double[] res)
diff --git a/libjava/java/awt/geom/Rectangle2D.java b/libjava/java/awt/geom/Rectangle2D.java
index bd1a37c6e09..d8217fecdb5 100644
--- a/libjava/java/awt/geom/Rectangle2D.java
+++ b/libjava/java/awt/geom/Rectangle2D.java
@@ -1,5 +1,5 @@
/* Rectangle2D.java -- generic rectangles in 2-D space
- Copyright (C) 2000, 2001, 2002 Free Software Foundation
+ Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation
This file is part of GNU Classpath.
@@ -57,30 +57,30 @@ import java.util.NoSuchElementException;
public abstract class Rectangle2D extends RectangularShape
{
/**
- * The point lies left of the rectangle (p.x < r.x).
+ * The point lies left of the rectangle (p.x &lt; r.x).
*
- * @see #outcode()
+ * @see #outcode(double, double)
*/
public static final int OUT_LEFT = 1;
/**
- * The point lies above the rectangle (p.y < r.y).
+ * The point lies above the rectangle (p.y &lt; r.y).
*
- * @see #outcode()
+ * @see #outcode(double, double)
*/
public static final int OUT_TOP = 2;
/**
* The point lies right of the rectangle (p.x &gt; r.maxX).
*
- * @see #outcode()
+ * @see #outcode(double, double)
*/
public static final int OUT_RIGHT = 4;
/**
* The point lies below of the rectangle (p.y &gt; r.maxY).
*
- * @see #outcode()
+ * @see #outcode(double, double)
*/
public static final int OUT_BOTTOM = 8;
diff --git a/libjava/java/awt/geom/RectangularShape.java b/libjava/java/awt/geom/RectangularShape.java
index 78e393eafcb..8679d2e32d5 100644
--- a/libjava/java/awt/geom/RectangularShape.java
+++ b/libjava/java/awt/geom/RectangularShape.java
@@ -46,8 +46,8 @@ import java.awt.Shape;
* subclasses which represent geometric objects inside a rectangular frame.
* This does not specify any geometry except for the bounding box.
*
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @see Arc2D
* @see Ellipse2D
diff --git a/libjava/java/awt/geom/RoundRectangle2D.java b/libjava/java/awt/geom/RoundRectangle2D.java
index 3f004ed6bbc..b9af7efc7ee 100644
--- a/libjava/java/awt/geom/RoundRectangle2D.java
+++ b/libjava/java/awt/geom/RoundRectangle2D.java
@@ -41,7 +41,7 @@ import java.util.NoSuchElementException;
/** This class implements a rectangle with rounded corners.
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @date December 3, 2000
*/
public abstract class RoundRectangle2D extends RectangularShape
diff --git a/libjava/java/awt/im/InputContext.java b/libjava/java/awt/im/InputContext.java
index 04e70e313f5..03fbd361026 100644
--- a/libjava/java/awt/im/InputContext.java
+++ b/libjava/java/awt/im/InputContext.java
@@ -1,5 +1,5 @@
/* InputContext.java -- provides the context for text input
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -74,7 +74,7 @@ import java.util.Locale;
* one entry per line in UTF-8 encoding, each class in the jar that implements
* java.awt.im.spi.InputMethodDescriptor.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Component#getInputContext()
* @see Component#enableInputMethods(boolean)
* @since 1.2
@@ -102,8 +102,8 @@ public class InputContext
while (e.hasMoreElements())
{
URL url = (URL) e.nextElement();
- BufferedReader in = null;
- String line = null;
+ BufferedReader in;
+ String line;
try
{
in = new BufferedReader
diff --git a/libjava/java/awt/im/InputMethodHighlight.java b/libjava/java/awt/im/InputMethodHighlight.java
index 2946d259b91..92867624aaf 100644
--- a/libjava/java/awt/im/InputMethodHighlight.java
+++ b/libjava/java/awt/im/InputMethodHighlight.java
@@ -1,5 +1,5 @@
/* InputMethodHighlight.java -- highlights the current text selection
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import java.util.Map;
* AttributedCharacterIterators, and may be wrapped in Annotations to separate
* text segments.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see AttributedCharacterIterators
* @see Annotation
* @since 1.2
diff --git a/libjava/java/awt/im/InputMethodRequests.java b/libjava/java/awt/im/InputMethodRequests.java
index 88253ed6237..d39efcb9400 100644
--- a/libjava/java/awt/im/InputMethodRequests.java
+++ b/libjava/java/awt/im/InputMethodRequests.java
@@ -1,5 +1,5 @@
/* InputMethodRequests.java -- handles text insertion via input methods
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ import java.text.AttributedCharacterIterator.Attribute;
* usually below the main text window, until it is committed into place at
* the insertion point, overwriting any selected text</li></ul>
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Component#getInputMethodRequests()
* @see InputMethodListener
* @since 1.2
diff --git a/libjava/java/awt/im/InputSubset.java b/libjava/java/awt/im/InputSubset.java
index fd03269a891..78c2164ffab 100644
--- a/libjava/java/awt/im/InputSubset.java
+++ b/libjava/java/awt/im/InputSubset.java
@@ -1,5 +1,5 @@
/* InputSubset.java -- subsets of Unicode important in text input
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.im;
* These constants encompass several Unicode blocks, or portions thereof, for
* simplification over {@link Character.UnicodeBlock}.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/im/spi/InputMethod.java b/libjava/java/awt/im/spi/InputMethod.java
index 0e981efb87f..18f7a7b17a3 100644
--- a/libjava/java/awt/im/spi/InputMethod.java
+++ b/libjava/java/awt/im/spi/InputMethod.java
@@ -1,5 +1,5 @@
/* InputMethod.java -- defines an interface for complex text input
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ import java.util.Locale;
* <p>These contexts can be loaded by the input method framework, using
* {@link InputContext#selectInputMethod(Locale)}.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/im/spi/InputMethodDescriptor.java b/libjava/java/awt/im/spi/InputMethodDescriptor.java
index 9ba97744aef..57a1fda48ba 100644
--- a/libjava/java/awt/im/spi/InputMethodDescriptor.java
+++ b/libjava/java/awt/im/spi/InputMethodDescriptor.java
@@ -1,5 +1,5 @@
/* InputMethodDescriptor.java -- enables loading and use of an input method
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.Locale;
* This interface provides information about an InputMethod before it is
* loaded.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.3
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/image/BandCombineOp.java b/libjava/java/awt/image/BandCombineOp.java
index 48c61c57026..4c921ede9ae 100644
--- a/libjava/java/awt/image/BandCombineOp.java
+++ b/libjava/java/awt/image/BandCombineOp.java
@@ -53,7 +53,7 @@ import java.awt.geom.Rectangle2D;
* for the destination. Therefore the destination Raster must contain the
* same number of bands as the number of rows in the filter matrix.
*
- * @author Jerry Quinn <jlquinn@optonline.net>
+ * @author Jerry Quinn (jlquinn@optonline.net)
*/
public class BandCombineOp implements RasterOp
{
diff --git a/libjava/java/awt/image/BandedSampleModel.java b/libjava/java/awt/image/BandedSampleModel.java
index 93252d9cce6..68a4466eea2 100644
--- a/libjava/java/awt/image/BandedSampleModel.java
+++ b/libjava/java/awt/image/BandedSampleModel.java
@@ -41,7 +41,7 @@ package java.awt.image;
* multiple pixels in a single unit. Pixels have 2^n bits and 2^k pixels fit
* per data element.
*
- * @author Jerry Quinn <jlquinn@optonline.net>
+ * @author Jerry Quinn (jlquinn@optonline.net)
*/
public final class BandedSampleModel extends ComponentSampleModel
{
diff --git a/libjava/java/awt/image/ByteLookupTable.java b/libjava/java/awt/image/ByteLookupTable.java
index f0221915a71..8bea284e9d3 100644
--- a/libjava/java/awt/image/ByteLookupTable.java
+++ b/libjava/java/awt/image/ByteLookupTable.java
@@ -1,5 +1,5 @@
/* ByteLookupTable.java -- Java class for a pixel translation table.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.image;
* Alpha, R, G, and B. When doing translation, the offset is subtracted from
* the pixel values to allow a subset of an array to be used.
*
- * @author <a href="mailto:jlquinn@optonline.net">Jerry Quinn</a>
+ * @author Jerry Quinn (jlquinn@optonline.net)
* @version 1.0
*/
public class ByteLookupTable extends LookupTable
diff --git a/libjava/java/awt/image/ComponentSampleModel.java b/libjava/java/awt/image/ComponentSampleModel.java
index 0665f406793..86161e0ae39 100644
--- a/libjava/java/awt/image/ComponentSampleModel.java
+++ b/libjava/java/awt/image/ComponentSampleModel.java
@@ -56,7 +56,7 @@ import gnu.java.awt.Buffers;
* is controlled by bandOffset, pixelStride, and scanlineStride, which means
* that any combination of interleavings is supported.
*
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public class ComponentSampleModel extends SampleModel
{
diff --git a/libjava/java/awt/image/DataBuffer.java b/libjava/java/awt/image/DataBuffer.java
index b921953ec28..6f0215b10e1 100644
--- a/libjava/java/awt/image/DataBuffer.java
+++ b/libjava/java/awt/image/DataBuffer.java
@@ -41,7 +41,7 @@ package java.awt.image;
* of one or more banks. A bank is a continuous region of data
* elements.
*
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public abstract class DataBuffer
{
diff --git a/libjava/java/awt/image/DataBufferByte.java b/libjava/java/awt/image/DataBufferByte.java
index c56be6b31dd..a306ede6fd6 100644
--- a/libjava/java/awt/image/DataBufferByte.java
+++ b/libjava/java/awt/image/DataBufferByte.java
@@ -47,7 +47,7 @@ package java.awt.image;
code is a maintenance nightmare. */
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public final class DataBufferByte extends DataBuffer
{
diff --git a/libjava/java/awt/image/DataBufferDouble.java b/libjava/java/awt/image/DataBufferDouble.java
index 305cb00b2ff..c6d1e100d35 100644
--- a/libjava/java/awt/image/DataBufferDouble.java
+++ b/libjava/java/awt/image/DataBufferDouble.java
@@ -49,8 +49,8 @@ package java.awt.image;
/**
* @since 1.4
*
- * @author <a href="mailto:rolfwr@ii.uib.no">Rolf W. Rasmussen</a>
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public final class DataBufferDouble
extends DataBuffer
diff --git a/libjava/java/awt/image/DataBufferFloat.java b/libjava/java/awt/image/DataBufferFloat.java
index 9673eddb458..6b47e2be005 100644
--- a/libjava/java/awt/image/DataBufferFloat.java
+++ b/libjava/java/awt/image/DataBufferFloat.java
@@ -47,8 +47,8 @@ package java.awt.image;
code is a maintenance nightmare. */
/**
- * @author <a href="mailto:rolfwr@ii.uib.no">Rolf W. Rasmussen</a>
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public final class DataBufferFloat
extends DataBuffer
diff --git a/libjava/java/awt/image/DataBufferInt.java b/libjava/java/awt/image/DataBufferInt.java
index c5f08530d2b..c90f9558811 100644
--- a/libjava/java/awt/image/DataBufferInt.java
+++ b/libjava/java/awt/image/DataBufferInt.java
@@ -47,7 +47,7 @@ package java.awt.image;
code is a maintenance nightmare. */
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public final class DataBufferInt extends DataBuffer
{
diff --git a/libjava/java/awt/image/DataBufferShort.java b/libjava/java/awt/image/DataBufferShort.java
index 7a095c4e38e..a8d8cb5ef64 100644
--- a/libjava/java/awt/image/DataBufferShort.java
+++ b/libjava/java/awt/image/DataBufferShort.java
@@ -48,7 +48,7 @@ package java.awt.image;
code is a maintenance nightmare. */
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public final class DataBufferShort extends DataBuffer
{
diff --git a/libjava/java/awt/image/DataBufferUShort.java b/libjava/java/awt/image/DataBufferUShort.java
index 6efe73d83ab..7466d857956 100644
--- a/libjava/java/awt/image/DataBufferUShort.java
+++ b/libjava/java/awt/image/DataBufferUShort.java
@@ -48,7 +48,7 @@ package java.awt.image;
code is a maintenance nightmare. */
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public final class DataBufferUShort extends DataBuffer
{
diff --git a/libjava/java/awt/image/ImagingOpException.java b/libjava/java/awt/image/ImagingOpException.java
index 51bf02b281c..0018dc47cc3 100644
--- a/libjava/java/awt/image/ImagingOpException.java
+++ b/libjava/java/awt/image/ImagingOpException.java
@@ -1,5 +1,5 @@
/* ImagingOpException.java -- indicates an imaging filter failure
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.image;
* This exception is thrown when <code>BufferedImageOp</code> or
* <code>RasterOp</code> filters cannot process an image.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see BufferedImageOp
* @see RasterOp
* @status updated to 1.4
diff --git a/libjava/java/awt/image/IndexColorModel.java b/libjava/java/awt/image/IndexColorModel.java
index 6791589032e..e4ccc542903 100644
--- a/libjava/java/awt/image/IndexColorModel.java
+++ b/libjava/java/awt/image/IndexColorModel.java
@@ -125,7 +125,9 @@ public class IndexColorModel extends ColorModel
public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
byte[] blues, byte[] alphas)
{
- super (bits);
+ // FIXME: This super() constructor should not be used since it can give
+ // the wrong value for hasAlpha() which is final and cannot be overloaded
+ super(bits);
map_size = size;
opaque = (alphas == null);
@@ -416,10 +418,10 @@ public class IndexColorModel extends ColorModel
*/
public final int getAlpha (int pixel)
{
- if (pixel < map_size)
- return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
-
- return 0;
+ if (opaque || pixel >= map_size)
+ return 255;
+
+ return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
}
/**
diff --git a/libjava/java/awt/image/Kernel.java b/libjava/java/awt/image/Kernel.java
index 4898f9ed82b..2bc82ee74c6 100644
--- a/libjava/java/awt/image/Kernel.java
+++ b/libjava/java/awt/image/Kernel.java
@@ -1,5 +1,5 @@
/* Kernel.java -- Java class for an image processing kernel
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.awt.image;
* convolution filters among other purposes. It stores an array of float
* values representing a 2-dimensional array in row-major order.
*
- * @author <a href="mailto:jlquinn@optonline.net">Jerry Quinn</a>
+ * @author Jerry Quinn (jlquinn@optonline.net)
* @version 1.0
*/
public class Kernel implements Cloneable
diff --git a/libjava/java/awt/image/LookupTable.java b/libjava/java/awt/image/LookupTable.java
index eb89795c2c8..497cdb6e089 100644
--- a/libjava/java/awt/image/LookupTable.java
+++ b/libjava/java/awt/image/LookupTable.java
@@ -1,5 +1,5 @@
/* LookupTable.java -- Java class for a pixel translation table.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.awt.image;
* @see ByteLookupTable
* @see ShortLookupTable
*
- * @author <a href="mailto:jlquinn@optonline.net">Jerry Quinn</a>
+ * @author Jerry Quinn (jlquinn@optonline.net)
* @version 1.0
*/
public abstract class LookupTable
diff --git a/libjava/java/awt/image/MemoryImageSource.java b/libjava/java/awt/image/MemoryImageSource.java
index 07e42cf077d..6b43d00c37b 100644
--- a/libjava/java/awt/image/MemoryImageSource.java
+++ b/libjava/java/awt/image/MemoryImageSource.java
@@ -1,4 +1,4 @@
-/* MemoryImageSource.java -- Java class for providing image data
+/* MemoryImageSource.java -- Java class for providing image data
Copyright (C) 1999, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,335 +41,333 @@ package java.awt.image;
import java.util.Hashtable;
import java.util.Vector;
-public class MemoryImageSource implements ImageProducer
+public class MemoryImageSource implements ImageProducer
{
- private boolean animated = false;
- private boolean fullbuffers = false;
- private int pixeli[], width, height, offset, scansize;
- private byte pixelb[];
- private ColorModel cm;
- private Hashtable props = new Hashtable();
- private Vector consumers = new Vector();
-
- /**
- * Construct an image producer that reads image data from a byte
- * array.
- *
- * @param w width of image
- * @param h height of image
- * @param cm the color model used to represent pixel values
- * @param pix a byte array of pixel values
- * @param off the offset into the array at which the first pixel is stored
- * @param scan the number of array elements that represents a single pixel row
- */
- public MemoryImageSource(int w, int h, ColorModel cm,
- byte pix[], int off, int scan)
- {
- this ( w, h, cm, pix, off, scan, null );
- }
- /**
- Constructs an ImageProducer from memory
- */
- public MemoryImageSource( int w, int h, ColorModel cm,
- byte pix[], int off, int scan,
- Hashtable props)
- {
- width = w;
- height = h;
- this.cm = cm;
- offset = off;
- scansize = scan;
- this.props = props;
- int max = (( scansize > width ) ? scansize : width );
- pixelb = pix;
- }
- /**
- * Construct an image producer that reads image data from an
- * integer array.
- *
- * @param w width of image
- * @param h height of image
- * @param cm the color model used to represent pixel values
- * @param pix an integer array of pixel values
- * @param off the offset into the array at which the first pixel is stored
- * @param scan the number of array elements that represents a single pixel row
- */
- public MemoryImageSource(int w, int h, ColorModel cm,
- int pix[], int off, int scan)
- {
- this ( w, h, cm, pix, off, scan, null );
- }
-
- /**
- Constructs an ImageProducer from memory
- */
- public MemoryImageSource(int w, int h, ColorModel cm,
- int pix[], int off, int scan,
- Hashtable props)
- {
- width = w;
- height = h;
- this.cm = cm;
- offset = off;
- scansize = scan;
- this.props = props;
- int max = (( scansize > width ) ? scansize : width );
- pixeli = pix;
- }
- /**
- Constructs an ImageProducer from memory using the default RGB ColorModel
- */
- public MemoryImageSource(int w, int h,
- int pix[], int off, int scan,
- Hashtable props)
- {
- this ( w, h, ColorModel.getRGBdefault(), pix, off, scan, props);
- }
-
- /**
- Constructs an ImageProducer from memory using the default RGB ColorModel
- */
- public MemoryImageSource(int w, int h,
- int pix[], int off, int scan)
- {
- this ( w, h, ColorModel.getRGBdefault(), pix, off, scan, null);
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code>.
- */
- public synchronized void addConsumer(ImageConsumer ic) {
- if (consumers.contains(ic))
- return;
-
- consumers.addElement(ic);
- }
-
- /**
- * Used to determine if the given <code>ImageConsumer</code> is
- * already registered with this <code>ImageProducer</code>.
- */
- public synchronized boolean isConsumer(ImageConsumer ic) {
- if (consumers.contains(ic))
- return true;
- return false;
- }
-
- /**
- * Used to remove an <code>ImageConsumer</code> from the list of
- * registered consumers for this <code>ImageProducer</code>.
- */
- public synchronized void removeConsumer(ImageConsumer ic) {
- consumers.removeElement(ic);
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then immediately start
- * reconstruction of the image data to be delivered to all
- * registered consumers.
- */
- public void startProduction(ImageConsumer ic) {
- if (!(consumers.contains(ic))) {
- consumers.addElement(ic);
- }
-
+ private boolean animated = false;
+ private boolean fullbuffers = false;
+ private int[] pixeli;
+ private int width;
+ private int height;
+ private int offset;
+ private int scansize;
+ private byte[] pixelb;
+ private ColorModel cm;
+ private Hashtable props = new Hashtable();
+ private Vector consumers = new Vector();
+
+ /**
+ * Construct an image producer that reads image data from a byte
+ * array.
+ *
+ * @param w width of image
+ * @param h height of image
+ * @param cm the color model used to represent pixel values
+ * @param pix a byte array of pixel values
+ * @param off the offset into the array at which the first pixel is stored
+ * @param scan the number of array elements that represents a single pixel row
+ */
+ public MemoryImageSource(int w, int h, ColorModel cm, byte[] pix, int off,
+ int scan)
+ {
+ this(w, h, cm, pix, off, scan, null);
+ }
+
+ /**
+ * Constructs an ImageProducer from memory
+ */
+ public MemoryImageSource(int w, int h, ColorModel cm, byte[] pix, int off,
+ int scan, Hashtable props)
+ {
+ width = w;
+ height = h;
+ this.cm = cm;
+ offset = off;
+ scansize = scan;
+ this.props = props;
+ int max = ((scansize > width) ? scansize : width);
+ pixelb = pix;
+ }
+
+ /**
+ * Construct an image producer that reads image data from an
+ * integer array.
+ *
+ * @param w width of image
+ * @param h height of image
+ * @param cm the color model used to represent pixel values
+ * @param pix an integer array of pixel values
+ * @param off the offset into the array at which the first pixel is stored
+ * @param scan the number of array elements that represents a single pixel row
+ */
+ public MemoryImageSource(int w, int h, ColorModel cm, int[] pix, int off,
+ int scan)
+ {
+ this(w, h, cm, pix, off, scan, null);
+ }
+
+ /**
+ Constructs an ImageProducer from memory
+ */
+ public MemoryImageSource(int w, int h, ColorModel cm, int[] pix, int off,
+ int scan, Hashtable props)
+ {
+ width = w;
+ height = h;
+ this.cm = cm;
+ offset = off;
+ scansize = scan;
+ this.props = props;
+ int max = ((scansize > width) ? scansize : width);
+ pixeli = pix;
+ }
+
+ /**
+ * Constructs an ImageProducer from memory using the default RGB ColorModel
+ */
+ public MemoryImageSource(int w, int h, int[] pix, int off, int scan,
+ Hashtable props)
+ {
+ this(w, h, ColorModel.getRGBdefault(), pix, off, scan, props);
+ }
+
+ /**
+ * Constructs an ImageProducer from memory using the default RGB ColorModel
+ */
+ public MemoryImageSource(int w, int h, int[] pix, int off, int scan)
+ {
+ this(w, h, ColorModel.getRGBdefault(), pix, off, scan, null);
+ }
+
+ /**
+ * Used to register an <code>ImageConsumer</code> with this
+ * <code>ImageProducer</code>.
+ */
+ public synchronized void addConsumer(ImageConsumer ic)
+ {
+ if (consumers.contains(ic))
+ return;
+
+ consumers.addElement(ic);
+ }
+
+ /**
+ * Used to determine if the given <code>ImageConsumer</code> is
+ * already registered with this <code>ImageProducer</code>.
+ */
+ public synchronized boolean isConsumer(ImageConsumer ic)
+ {
+ if (consumers.contains(ic))
+ return true;
+ return false;
+ }
+
+ /**
+ * Used to remove an <code>ImageConsumer</code> from the list of
+ * registered consumers for this <code>ImageProducer</code>.
+ */
+ public synchronized void removeConsumer(ImageConsumer ic)
+ {
+ consumers.removeElement(ic);
+ }
+
+ /**
+ * Used to register an <code>ImageConsumer</code> with this
+ * <code>ImageProducer</code> and then immediately start
+ * reconstruction of the image data to be delivered to all
+ * registered consumers.
+ */
+ public void startProduction(ImageConsumer ic)
+ {
+ if (! (consumers.contains(ic)))
+ consumers.addElement(ic);
+
+ Vector list = (Vector) consumers.clone();
+ for (int i = 0; i < list.size(); i++)
+ {
+ ic = (ImageConsumer) list.elementAt(i);
+ sendPicture(ic);
+ if (animated)
+ ic.imageComplete(ImageConsumer.SINGLEFRAME);
+ else
+ ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
+ }
+ }
+
+ /**
+ * Used to register an <code>ImageConsumer</code> with this
+ * <code>ImageProducer</code> and then request that this producer
+ * resend the image data in the order top-down, left-right.
+ */
+ public void requestTopDownLeftRightResend(ImageConsumer ic)
+ {
+ startProduction(ic);
+ }
+
+ /**
+ * Changes a flag to indicate whether this MemoryImageSource supports
+ * animations.
+ *
+ * @param animated A flag indicating whether this class supports animations
+ */
+ public synchronized void setAnimated(boolean animated)
+ {
+ this.animated = animated;
+ }
+
+ /**
+ * A flag to indicate whether or not to send full buffer updates when
+ * sending animation. If this flag is set then full buffers are sent
+ * in the newPixels methods instead of just regions.
+ *
+ * @param fullbuffers - a flag indicating whether to send the full buffers
+ */
+ public synchronized void setFullBufferUpdates(boolean fullbuffers)
+ {
+ this.fullbuffers = fullbuffers;
+ }
+
+ /**
+ * Send an animation frame to the image consumers.
+ */
+ public void newPixels()
+ {
+ if (animated == true)
+ {
+ ImageConsumer ic;
Vector list = (Vector) consumers.clone();
- for(int i = 0; i < list.size(); i++) {
+ for (int i = 0; i < list.size(); i++)
+ {
ic = (ImageConsumer) list.elementAt(i);
- sendPicture( ic );
- if (animated)
- ic.imageComplete( ImageConsumer.SINGLEFRAME );
- else
- ic.imageComplete( ImageConsumer.STATICIMAGEDONE );
- }
- }
-
- /**
- * Used to register an <code>ImageConsumer</code> with this
- * <code>ImageProducer</code> and then request that this producer
- * resend the image data in the order top-down, left-right.
- */
- public void requestTopDownLeftRightResend(ImageConsumer ic) {
- startProduction ( ic );
- }
-
-
- /**
- Changes a flag to indicate whether this MemoryImageSource supports
- animations.
-
- @param animated A flag indicating whether this class supports animations
- */
- public synchronized void setAnimated(boolean animated)
- {
- this.animated = animated;
- }
-
-
- /**
- A flag to indicate whether or not to send full buffer updates when
- sending animation. If this flag is set then full buffers are sent
- in the newPixels methods instead of just regions.
-
- @param fullbuffers - a flag indicating whether to send the full buffers
- */
- public synchronized void setFullBufferUpdates(boolean fullbuffers)
- {
- this.fullbuffers = fullbuffers;
- }
-
- /**
- Send an animation frame to the image consumers.
- */
- public void newPixels()
- {
- if( animated == true ) {
- ImageConsumer ic;
- Vector list = (Vector) consumers.clone();
- for(int i = 0; i < list.size(); i++) {
- ic = (ImageConsumer) list.elementAt(i);
- sendPicture( ic );
- ic.imageComplete( ImageConsumer.SINGLEFRAME );
- }
- }
- }
-
-
- private void sendPicture ( ImageConsumer ic )
- {
- ic.setHints( ImageConsumer.TOPDOWNLEFTRIGHT );
- if( props != null ) {
- ic.setProperties( props );
- }
- ic.setDimensions(width, height);
- ic.setColorModel(cm);
- if( pixeli != null ) {
- ic.setPixels( 0, 0, width, height, cm, pixeli, offset, scansize );
- } else {
- ic.setPixels( 0, 0, width, height, cm, pixelb, offset, scansize );
- }
- }
-
- /**
- Send an animation frame to the image consumers containing the specified
- pixels unless setFullBufferUpdates is set.
- */
- public synchronized void newPixels(int x,
- int y,
- int w,
- int h)
- {
- if( animated == true )
- {
- if( fullbuffers ) {
- newPixels();
- } else {
- ImageConsumer ic;
- Vector list = (Vector) consumers.clone();
- for(int i = 0; i < list.size(); i++) {
- ic = (ImageConsumer) list.elementAt(i);
- ic.setHints( ImageConsumer.TOPDOWNLEFTRIGHT );
- if( props != null ) {
- ic.setProperties( props );
- }
- if( pixeli != null ) {
- int[] pixelbuf = new int[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixeli, row * scansize + x + offset, pixelbuf, 0, w * h);
- ic.setPixels( x, y, w, h, cm, pixelbuf, 0, w );
- } else {
- byte[] pixelbuf = new byte[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixelb, row * scansize + x + offset, pixelbuf, 0, w * h);
-
- ic.setPixels( x, y, w, h, cm, pixelbuf, 0, w );
- }
- ic.imageComplete( ImageConsumer.SINGLEFRAME );
- }
- }
- }
- }
-
-
-
- /**
- Send an animation frame to the image consumers containing the specified
- pixels unless setFullBufferUpdates is set.
-
- If framenotify is set then a notification is sent when the frame
- is sent otherwise no status is sent.
- */
- public synchronized void newPixels(int x,
- int y,
- int w,
- int h,
- boolean framenotify)
- {
- if( animated == true )
- {
- if( fullbuffers ) {
- newPixels();
- } else {
- ImageConsumer ic;
- Vector list = (Vector) consumers.clone();
- for(int i = 0; i < list.size(); i++) {
- ic = (ImageConsumer) list.elementAt(i);
- ic.setHints( ImageConsumer.TOPDOWNLEFTRIGHT );
- if( props != null ) {
- ic.setProperties( props );
- }
- if( pixeli != null ) {
- int[] pixelbuf = new int[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixeli, row * scansize + x + offset, pixelbuf, 0, w * h);
- ic.setPixels( x, y, w, h, cm, pixelbuf, 0, w );
- } else {
- byte[] pixelbuf = new byte[w * h];
- for (int row = y; row < y + h; row++)
- System.arraycopy(pixelb, row * scansize + x + offset, pixelbuf, 0, w * h);
- ic.setPixels( x, y, w, h, cm, pixelbuf, 0, w );
- }
- if( framenotify == true )
- ic.imageComplete( ImageConsumer.SINGLEFRAME );
- }
- }
- }
- }
-
- public synchronized void newPixels(byte newpix[],
- ColorModel newmodel,
- int offset,
- int scansize)
-
- {
- pixeli = null;
- pixelb = newpix;
- cm = newmodel;
- this.offset = offset;
- this.scansize = scansize;
- if( animated == true )
- {
- newPixels();
- }
- }
-
- public synchronized void newPixels(int newpix[],
- ColorModel newmodel,
- int offset,
- int scansize)
-
- {
- pixelb = null;
- pixeli = newpix;
- cm = newmodel;
- this.offset = offset;
- this.scansize = scansize;
- if( animated == true )
- {
- newPixels();
- }
- }
-
+ sendPicture(ic);
+ ic.imageComplete(ImageConsumer.SINGLEFRAME);
+ }
+ }
+ }
+
+ private void sendPicture(ImageConsumer ic)
+ {
+ ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
+ if (props != null)
+ ic.setProperties(props);
+ ic.setDimensions(width, height);
+ ic.setColorModel(cm);
+ if (pixeli != null)
+ ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize);
+ else
+ ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize);
+ }
+
+ /**
+ * Send an animation frame to the image consumers containing the specified
+ * pixels unless setFullBufferUpdates is set.
+ */
+ public synchronized void newPixels(int x, int y, int w, int h)
+ {
+ if (animated == true)
+ {
+ if (fullbuffers)
+ newPixels();
+ else
+ {
+ ImageConsumer ic;
+ Vector list = (Vector) consumers.clone();
+ for (int i = 0; i < list.size(); i++)
+ {
+ ic = (ImageConsumer) list.elementAt(i);
+ ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
+ if (props != null)
+ ic.setProperties(props);
+ if (pixeli != null)
+ {
+ int[] pixelbuf = new int[w * h];
+ for (int row = y; row < y + h; row++)
+ System.arraycopy(pixeli, row * scansize + x + offset,
+ pixelbuf, 0, w * h);
+ ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
+ }
+ else
+ {
+ byte[] pixelbuf = new byte[w * h];
+ for (int row = y; row < y + h; row++)
+ System.arraycopy(pixelb, row * scansize + x + offset,
+ pixelbuf, 0, w * h);
+
+ ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
+ }
+ ic.imageComplete(ImageConsumer.SINGLEFRAME);
+ }
+ }
+ }
+ }
+
+ /**
+ * Send an animation frame to the image consumers containing the specified
+ * pixels unless setFullBufferUpdates is set.
+ *
+ * If framenotify is set then a notification is sent when the frame
+ * is sent otherwise no status is sent.
+ */
+ public synchronized void newPixels(int x, int y, int w, int h,
+ boolean framenotify)
+ {
+ if (animated == true)
+ {
+ if (fullbuffers)
+ newPixels();
+ else
+ {
+ ImageConsumer ic;
+ Vector list = (Vector) consumers.clone();
+ for (int i = 0; i < list.size(); i++)
+ {
+ ic = (ImageConsumer) list.elementAt(i);
+ ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT);
+ if (props != null)
+ ic.setProperties(props);
+ if (pixeli != null)
+ {
+ int[] pixelbuf = new int[w * h];
+ for (int row = y; row < y + h; row++)
+ System.arraycopy(pixeli, row * scansize + x + offset,
+ pixelbuf, 0, w * h);
+ ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
+ }
+ else
+ {
+ byte[] pixelbuf = new byte[w * h];
+ for (int row = y; row < y + h; row++)
+ System.arraycopy(pixelb, row * scansize + x + offset,
+ pixelbuf, 0, w * h);
+ ic.setPixels(x, y, w, h, cm, pixelbuf, 0, w);
+ }
+ if (framenotify == true)
+ ic.imageComplete(ImageConsumer.SINGLEFRAME);
+ }
+ }
+ }
+ }
+
+ public synchronized void newPixels(byte[] newpix, ColorModel newmodel,
+ int offset, int scansize)
+ {
+ pixeli = null;
+ pixelb = newpix;
+ cm = newmodel;
+ this.offset = offset;
+ this.scansize = scansize;
+ if (animated == true)
+ newPixels();
+ }
+
+ public synchronized void newPixels(int[] newpix, ColorModel newmodel,
+ int offset, int scansize)
+ {
+ pixelb = null;
+ pixeli = newpix;
+ cm = newmodel;
+ this.offset = offset;
+ this.scansize = scansize;
+ if (animated == true)
+ newPixels();
+ }
}
diff --git a/libjava/java/awt/image/MultiPixelPackedSampleModel.java b/libjava/java/awt/image/MultiPixelPackedSampleModel.java
index 0525d37bd42..ab971c0e675 100644
--- a/libjava/java/awt/image/MultiPixelPackedSampleModel.java
+++ b/libjava/java/awt/image/MultiPixelPackedSampleModel.java
@@ -43,7 +43,7 @@ import gnu.java.awt.Buffers;
* multiple pixels in a single unit. Pixels have 2^n bits and 2^k pixels fit
* per data element.
*
- * @author Jerry Quinn <jlquinn@optonline.net>
+ * @author Jerry Quinn (jlquinn@optonline.net)
*/
public class MultiPixelPackedSampleModel extends SampleModel
{
@@ -59,7 +59,7 @@ public class MultiPixelPackedSampleModel extends SampleModel
public MultiPixelPackedSampleModel(int dataType, int w, int h,
int numberOfBits)
{
- this(dataType, w, h, 0, numberOfBits, 0);
+ this(dataType, w, h, numberOfBits, 0, 0);
}
public MultiPixelPackedSampleModel(int dataType, int w, int h,
@@ -101,7 +101,7 @@ public class MultiPixelPackedSampleModel extends SampleModel
// Compute scan line large enough for w pixels.
if (scanlineStride == 0)
- scanlineStride = ((dataBitOffset + w * numberOfBits) / elemBits) + 1;
+ scanlineStride = ((dataBitOffset + w * numberOfBits) / elemBits);
this.scanlineStride = scanlineStride;
@@ -112,8 +112,9 @@ public class MultiPixelPackedSampleModel extends SampleModel
bitOffsets = new int[numElems];
for (int i=0; i < numElems; i++)
{
- bitOffsets[i] = numberOfBits * i;
- bitMasks[i] = ((1 << numberOfBits) - 1) << bitOffsets[i];
+ bitOffsets[numElems - i- 1] = numberOfBits * i;
+ bitMasks[numElems - i - 1] = ((1 << numberOfBits) - 1) <<
+ bitOffsets[numElems - i - 1];
}
}
diff --git a/libjava/java/awt/image/PackedColorModel.java b/libjava/java/awt/image/PackedColorModel.java
index 1f18cf68eb1..457dded93db 100644
--- a/libjava/java/awt/image/PackedColorModel.java
+++ b/libjava/java/awt/image/PackedColorModel.java
@@ -43,7 +43,7 @@ import java.awt.Point;
import java.awt.color.ColorSpace;
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public abstract class PackedColorModel extends ColorModel
{
diff --git a/libjava/java/awt/image/PixelInterleavedSampleModel.java b/libjava/java/awt/image/PixelInterleavedSampleModel.java
index d17a68d9ae3..1c0408cd15b 100644
--- a/libjava/java/awt/image/PixelInterleavedSampleModel.java
+++ b/libjava/java/awt/image/PixelInterleavedSampleModel.java
@@ -1,5 +1,5 @@
/* PixelInterleavedSampleModel.java
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.awt.image;
*
* @since 1.2
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class PixelInterleavedSampleModel
extends ComponentSampleModel
diff --git a/libjava/java/awt/image/RGBImageFilter.java b/libjava/java/awt/image/RGBImageFilter.java
index 0fd977eab67..ca88d70e360 100644
--- a/libjava/java/awt/image/RGBImageFilter.java
+++ b/libjava/java/awt/image/RGBImageFilter.java
@@ -1,5 +1,5 @@
/* RGBImageFilter.java -- Java class for filtering Pixels by RGB values
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.image;
* A filter designed to filter images in the default RGBColorModel regardless of
* the ImageProducer's ColorModel.
*
- * @author Mark Benvenuto <mcb54@columbia.edu>
+ * @author Mark Benvenuto (mcb54@columbia.edu)
*/
public abstract class RGBImageFilter extends ImageFilter
{
@@ -83,7 +83,7 @@ public abstract class RGBImageFilter extends ImageFilter
}
else {
consumer.setColorModel(ColorModel.getRGBdefault());
- }
+ }
}
/**
diff --git a/libjava/java/awt/image/Raster.java b/libjava/java/awt/image/Raster.java
index 0fad4ba0acb..c3cb07fb219 100644
--- a/libjava/java/awt/image/Raster.java
+++ b/libjava/java/awt/image/Raster.java
@@ -41,7 +41,7 @@ import java.awt.Point;
import java.awt.Rectangle;
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public class Raster
{
diff --git a/libjava/java/awt/image/RasterFormatException.java b/libjava/java/awt/image/RasterFormatException.java
index 3a29877476b..4cfc5b5dc88 100644
--- a/libjava/java/awt/image/RasterFormatException.java
+++ b/libjava/java/awt/image/RasterFormatException.java
@@ -1,5 +1,5 @@
/* RasterFormatException.java -- indicates invalid layout in Raster
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.image;
* This exception is thrown when there is invalid layout information in
* <code>Raster</code>
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Raster
* @status updated to 1.4
*/
diff --git a/libjava/java/awt/image/ReplicateScaleFilter.java b/libjava/java/awt/image/ReplicateScaleFilter.java
index a572da7c3bd..091909d5bea 100644
--- a/libjava/java/awt/image/ReplicateScaleFilter.java
+++ b/libjava/java/awt/image/ReplicateScaleFilter.java
@@ -201,10 +201,10 @@ public class ReplicateScaleFilter extends ImageFilter
model, destPixels, 0, destScansize);
}
- protected byte[] replicatePixels(int srcx, int srcy, int srcw, int srch,
- ColorModel model, byte[] srcPixels,
- int srcOffset, int srcScansize,
- double rx, double ry, int destScansize)
+ private byte[] replicatePixels(int srcx, int srcy, int srcw, int srch,
+ ColorModel model, byte[] srcPixels,
+ int srcOffset, int srcScansize,
+ double rx, double ry, int destScansize)
{
byte[] destPixels =
new byte[(int) Math.ceil(srcw/rx) * (int) Math.ceil(srch/ry)];
@@ -221,10 +221,10 @@ public class ReplicateScaleFilter extends ImageFilter
return destPixels;
}
- protected int[] replicatePixels(int srcx, int srcy, int srcw, int srch,
- ColorModel model, int[] srcPixels,
- int srcOffset, int srcScansize,
- double rx, double ry, int destScansize)
+ private int[] replicatePixels(int srcx, int srcy, int srcw, int srch,
+ ColorModel model, int[] srcPixels,
+ int srcOffset, int srcScansize,
+ double rx, double ry, int destScansize)
{
int[] destPixels =
new int[(int) Math.ceil(srcw/rx) * (int) Math.ceil(srch/ry)];
diff --git a/libjava/java/awt/image/SampleModel.java b/libjava/java/awt/image/SampleModel.java
index 4e3b38b9922..b0d12c0ead0 100644
--- a/libjava/java/awt/image/SampleModel.java
+++ b/libjava/java/awt/image/SampleModel.java
@@ -37,7 +37,7 @@ exception statement from your version. */
package java.awt.image;
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public abstract class SampleModel
{
diff --git a/libjava/java/awt/image/ShortLookupTable.java b/libjava/java/awt/image/ShortLookupTable.java
index 36beb1df540..c57abeba795 100644
--- a/libjava/java/awt/image/ShortLookupTable.java
+++ b/libjava/java/awt/image/ShortLookupTable.java
@@ -1,5 +1,5 @@
/* ShortLookupTable.java -- Java class for a pixel translation table.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.awt.image;
* Alpha, R, G, and B. When doing translation, the offset is subtracted from
* the pixel values to allow a subset of an array to be used.
*
- * @author <a href="mailto:jlquinn@optonline.net">Jerry Quinn</a>
+ * @author Jerry Quinn (jlquinn@optonline.net)
* @version 1.0
*/
public class ShortLookupTable extends LookupTable
diff --git a/libjava/java/awt/image/SinglePixelPackedSampleModel.java b/libjava/java/awt/image/SinglePixelPackedSampleModel.java
index 94a9537318e..32789fc6350 100644
--- a/libjava/java/awt/image/SinglePixelPackedSampleModel.java
+++ b/libjava/java/awt/image/SinglePixelPackedSampleModel.java
@@ -40,7 +40,7 @@ import gnu.java.awt.BitMaskExtent;
import gnu.java.awt.Buffers;
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public class SinglePixelPackedSampleModel extends SampleModel
{
diff --git a/libjava/java/awt/image/WritableRaster.java b/libjava/java/awt/image/WritableRaster.java
index f735001e915..de3648af5f3 100644
--- a/libjava/java/awt/image/WritableRaster.java
+++ b/libjava/java/awt/image/WritableRaster.java
@@ -41,7 +41,7 @@ import java.awt.Point;
import java.awt.Rectangle;
/**
- * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
+ * @author Rolf W. Rasmussen (rolfwr@ii.uib.no)
*/
public class WritableRaster extends Raster
{
diff --git a/libjava/java/awt/peer/RobotPeer.java b/libjava/java/awt/peer/RobotPeer.java
index 2daa14d5e11..a187fc0217d 100644
--- a/libjava/java/awt/peer/RobotPeer.java
+++ b/libjava/java/awt/peer/RobotPeer.java
@@ -43,12 +43,12 @@ import java.awt.Rectangle;
public interface RobotPeer
{
void mouseMove (int x, int y);
- void mousePress (int x);
- void mouseRelease (int x);
- void mouseWheel (int x);
- void keyPress (int x);
- void keyRelease (int x);
+ void mousePress (int buttons);
+ void mouseRelease (int buttons);
+ void mouseWheel (int wheelAmt);
+ void keyPress (int keycode);
+ void keyRelease (int keycode);
int getRGBPixel (int x, int y);
- int[] getRGBPixels (Rectangle r);
+ int[] getRGBPixels (Rectangle screen);
} // interface RobotPeer
diff --git a/libjava/java/awt/print/Book.java b/libjava/java/awt/print/Book.java
index 9bdd7d6fd34..41f360beca0 100644
--- a/libjava/java/awt/print/Book.java
+++ b/libjava/java/awt/print/Book.java
@@ -1,5 +1,5 @@
/* Book.java -- A mixed group of pages to print.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,146 +41,119 @@ package java.awt.print;
import java.util.Vector;
/**
- * This class allows documents to be created with different paper types,
- * page formatters, and painters.
- *
- * @author Aaron M. Renn (arenn@urbanophile.com)
- */
-public class Book implements Pageable
-{
-
-/*
- * Instance Variables
- */
-
-// Painter objects for the book
-Vector printables = new Vector();
-
-// Page formats for the book
-Vector page_formats = new Vector();
-
-/*************************************************************************/
-
-/*
- * Constructors
+ * This class allows documents to be created with different paper types,
+ * page formatters, and painters.
+ *
+ * @author Aaron M. Renn (arenn@urbanophile.com)
*/
-
-/**
- * Initializes a new instance of <code>Book</code> that is empty.
- */
-public
-Book()
-{
- ;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the number of pages in this book.
- *
- * @return The number of pages in this book.
- */
-public int
-getNumberOfPages()
-{
- return(printables.size());
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the <code>PageFormat</code> object for the
- * specified page.
- *
- * @param page_number The number of the page to get information for, where
- * page numbers start at 0.
- *
- * @return The <code>PageFormat</code> object for the specified page.
- *
- * @exception IndexOutOfBoundsException If the page number is not valid.
- */
-public PageFormat
-getPageFormat(int page_number)
-{
- return((PageFormat)page_formats.elementAt(page_number));
-}
-
-/*************************************************************************/
-
-/**
- * This method returns the <code>Printable</code> object for the
- * specified page.
- *
- * @param page_number The number of the page to get information for, where
- * page numbers start at 0.
- *
- * @return The <code>Printable</code> object for the specified page.
- *
- * @exception IndexOutOfBoundsException If the page number is not valid.
- */
-public Printable
-getPrintable(int page_number)
-{
- return((Printable)printables.elementAt(page_number));
-}
-
-/*************************************************************************/
-
-/**
- * This method appends a page to the end of the book.
- *
- * @param printable The <code>Printable</code> for this page.
- * @param page_format The <code>PageFormat</code> for this page.
- *
- * @exception NullPointerException If either argument is <code>null</code>.
- */
-public void
-append(Printable printable, PageFormat page_format)
-{
- append(printable, page_format, 1);
-}
-
-/*************************************************************************/
-
-/**
- * This method appends the specified number of pages to the end of the book.
- * Each one will be associated with the specified <code>Printable</code>
- * and <code>PageFormat</code>.
- *
- * @param printable The <code>Printable</code> for this page.
- * @param page_format The <code>PageFormat</code> for this page.
- * @param num_pages The number of pages to append.
- *
- * @exception NullPointerException If any argument is <code>null</code>.
- */
-public void
-append(Printable printable, PageFormat page_format, int num_pages)
-{
- for (int i = 0; i < num_pages; i++)
- {
- printables.addElement(printable);
- page_formats.addElement(page_format);
- }
-}
-
-/*************************************************************************/
-
-/**
- * This method changes the <code>Printable</code> and <code>PageFormat</code>
- * for the specified page. The page must already exist or an exception
- * will be thrown.
- *
- * @param page_num The page number to alter.
- * @param printable The new <code>Printable</code> for the page.
- * @param page_format The new <code>PageFormat</code> for the page.
- *
- * @throws IndexOutOfBoundsException If the specified page does not exist.
- */
-public void
-setPage(int page_num, Printable printable, PageFormat page_format)
+public class Book implements Pageable
{
- printables.setElementAt(printable, page_num);
- page_formats.setElementAt(page_format, page_num);
-}
+ /**
+ * Painter objects for the book.
+ */
+ Vector printables = new Vector();
+
+ /**
+ * Page formats for the book.
+ */
+ Vector page_formats = new Vector();
+
+ /**
+ * Initializes a new instance of <code>Book</code> that is empty.
+ */
+ public Book()
+ {
+ }
+
+ /**
+ * Returns the number of pages in this book.
+ *
+ * @return The number of pages in this book.
+ */
+ public int getNumberOfPages()
+ {
+ return printables.size();
+ }
+
+ /**
+ * This method returns the <code>PageFormat</code> object for the
+ * specified page.
+ *
+ * @param page_number The number of the page to get information for, where
+ * page numbers start at 0.
+ *
+ * @return The <code>PageFormat</code> object for the specified page.
+ *
+ * @exception IndexOutOfBoundsException If the page number is not valid.
+ */
+ public PageFormat getPageFormat(int page_number)
+ {
+ return (PageFormat) page_formats.elementAt(page_number);
+ }
+
+ /**
+ * This method returns the <code>Printable</code> object for the
+ * specified page.
+ *
+ * @param page_number The number of the page to get information for, where
+ * page numbers start at 0.
+ *
+ * @return The <code>Printable</code> object for the specified page.
+ *
+ * @exception IndexOutOfBoundsException If the page number is not valid.
+ */
+ public Printable getPrintable(int page_number)
+ {
+ return (Printable) printables.elementAt(page_number);
+ }
+
+ /**
+ * This method appends a page to the end of the book.
+ *
+ * @param printable The <code>Printable</code> for this page.
+ * @param page_format The <code>PageFormat</code> for this page.
+ *
+ * @exception NullPointerException If either argument is <code>null</code>.
+ */
+ public void append(Printable printable, PageFormat page_format)
+ {
+ append(printable, page_format, 1);
+ }
+
+ /**
+ * This method appends the specified number of pages to the end of the book.
+ * Each one will be associated with the specified <code>Printable</code>
+ * and <code>PageFormat</code>.
+ *
+ * @param printable The <code>Printable</code> for this page.
+ * @param page_format The <code>PageFormat</code> for this page.
+ * @param num_pages The number of pages to append.
+ *
+ * @exception NullPointerException If any argument is <code>null</code>.
+ */
+ public void append(Printable printable, PageFormat page_format, int num_pages)
+ {
+ for (int i = 0; i < num_pages; i++)
+ {
+ printables.addElement(printable);
+ page_formats.addElement(page_format);
+ }
+ }
+
+ /**
+ * This method changes the <code>Printable</code> and <code>PageFormat</code>
+ * for the specified page. The page must already exist or an exception
+ * will be thrown.
+ *
+ * @param page_num The page number to alter.
+ * @param printable The new <code>Printable</code> for the page.
+ * @param page_format The new <code>PageFormat</code> for the page.
+ *
+ * @throws IndexOutOfBoundsException If the specified page does not exist.
+ */
+ public void setPage(int page_num, Printable printable, PageFormat page_format)
+ {
+ printables.setElementAt(printable, page_num);
+ page_formats.setElementAt(page_format, page_num);
+ }
}
diff --git a/libjava/java/awt/print/PrinterAbortException.java b/libjava/java/awt/print/PrinterAbortException.java
index 133fdfe116d..5507a4f6ef8 100644
--- a/libjava/java/awt/print/PrinterAbortException.java
+++ b/libjava/java/awt/print/PrinterAbortException.java
@@ -1,5 +1,5 @@
/* PrinterAbortException.java -- Indicates the print job was aborted
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.print;
* This exception is thrown when the print job is aborted, either by the
* user or by the application.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class PrinterAbortException extends PrinterException
diff --git a/libjava/java/awt/print/PrinterException.java b/libjava/java/awt/print/PrinterException.java
index 9476d935674..e27fdbff4ab 100644
--- a/libjava/java/awt/print/PrinterException.java
+++ b/libjava/java/awt/print/PrinterException.java
@@ -1,5 +1,5 @@
/* PrinterException.java -- generic problem in the printing subsystem
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.awt.print;
* This is the generic toplevel exception for printing errors. Subclasses
* provide more detailed descriptions of the problem.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class PrinterException extends Exception
diff --git a/libjava/java/awt/print/PrinterIOException.java b/libjava/java/awt/print/PrinterIOException.java
index 31f6381dc0d..e64ff4e6f7b 100644
--- a/libjava/java/awt/print/PrinterIOException.java
+++ b/libjava/java/awt/print/PrinterIOException.java
@@ -1,5 +1,5 @@
/* PrinterIOException.java -- The print job encountered an I/O error
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,8 +44,8 @@ import java.io.IOException;
* This exception is thrown when the print job encounters an I/O problem
* of some kind.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
public class PrinterIOException extends PrinterException
diff --git a/libjava/java/awt/print/PrinterJob.java b/libjava/java/awt/print/PrinterJob.java
index 8998aa0ff89..bc5cfcd5a1b 100644
--- a/libjava/java/awt/print/PrinterJob.java
+++ b/libjava/java/awt/print/PrinterJob.java
@@ -1,5 +1,5 @@
/* PrinterJob.java -- This job is the printer control class
- Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,10 +38,9 @@ exception statement from your version. */
package java.awt.print;
-import javax.print.DocFlavor;
+import java.awt.HeadlessException;
+
import javax.print.PrintService;
-import javax.print.PrintServiceLookup;
-//import javax.print.StreamPrintServiceFactory;
import javax.print.attribute.PrintRequestAttributeSet;
/**
@@ -61,7 +60,7 @@ public abstract class PrinterJob
*/
public static PrinterJob getPrinterJob()
{
- // FIXME: Need to fix this to load a default implementation instance.
+ // FIXME: Need to fix this to load a default implementation instance.
return null;
}
@@ -149,7 +148,8 @@ public abstract class PrinterJob
*
* @return The modified <code>PageFormat</code>.
*/
- public abstract PageFormat pageDialog(PageFormat page_format);
+ public abstract PageFormat pageDialog(PageFormat page_format)
+ throws HeadlessException;
/**
* Prints the pages.
@@ -169,7 +169,8 @@ public abstract class PrinterJob
* @return <code>false</code> if the user cancels the dialog box,
* <code>true</code> otherwise.
*/
- public abstract boolean printDialog();
+ public abstract boolean printDialog()
+ throws HeadlessException;
/**
* Displays a dialog box to the user which allows the print job
@@ -178,7 +179,8 @@ public abstract class PrinterJob
* @return <code>false</code> if the user cancels the dialog box,
* <code>true</code> otherwise.
*/
- public abstract boolean printDialog(PrintRequestAttributeSet attributes);
+ public abstract boolean printDialog(PrintRequestAttributeSet attributes)
+ throws HeadlessException;
/**
* This sets the pages that are to be printed.
diff --git a/libjava/java/beans/AppletInitializer.java b/libjava/java/beans/AppletInitializer.java
index 48c37b38061..0b20c86fefd 100644
--- a/libjava/java/beans/AppletInitializer.java
+++ b/libjava/java/beans/AppletInitializer.java
@@ -1,5 +1,5 @@
/* java.beans.AppletInitializer
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.beans.beancontext.BeanContext;
* Bean that is also an Applet. It is used by
* <code>Beans.instantiate()</code>.
*
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @since 1.2
*/
public interface AppletInitializer
diff --git a/libjava/java/beans/Beans.java b/libjava/java/beans/Beans.java
index 762e4d597ca..30f6642bbc3 100644
--- a/libjava/java/beans/Beans.java
+++ b/libjava/java/beans/Beans.java
@@ -1,5 +1,5 @@
/* java.beans.Beans
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,23 +35,26 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-
package java.beans;
+import gnu.java.beans.DummyAppletStub;
import gnu.java.io.ClassLoaderObjectInputStream;
import java.applet.Applet;
+import java.beans.beancontext.BeanContext;
import java.io.IOException;
-import java.io.InputStream;
import java.io.ObjectInputStream;
+import java.net.URL;
/**
* <code>Beans</code> provides some helper methods that allow the basic
* operations of Bean-ness.
*
* @author John Keiser
+ * @author Robert Schuster
+ *
* @since 1.1
- * @version 1.1.0, 29 Jul 1998
+ * @status updated to 1.4
*
*/
public class Beans
@@ -66,196 +69,300 @@ public class Beans
*/
public Beans()
{
- // Do nothing here.
+ // Does intentionally nothing here.
}
- /**
- * Allows you to instantiate a Bean. This method takes
- * a ClassLoader from which to read the Bean and the
- * name of the Bean.<P>
- *
- * The Bean name should be a dotted name, like a class.
- * It can represent several things. Beans will search
- * for the Bean using the name like this:<P>
- * <OL>
- * <LI>Searches for a serialized instance of the Bean
- * using getResource(), mangling the Bean name by
- * replacing the dots with slashes and appending .ser
- * (for example, gnu.beans.BlahDeBlah would cause
- * Beans to search for gnu/beans/BlahDeBlah.ser using
- * getResource()).</LI>
- * <LI>Searches for the Bean class using the beanName,
- * and then instantiates it with the no-arg constructor.
- * At that point, if it is an Applet, it provides it
- * with AppletContext and AppletStub, and then calls
- * init().</LI>
- * </OL>
- *
- * @param cl the ClassLoader to use, or <CODE>null</CODE>
- * to use the default ClassLoader.
- * @param beanName the name of the Bean.
- *
- * @return the Bean.
- *
- * @XXX
- */
- public static Object instantiate (ClassLoader cl, String beanName)
- throws IOException, ClassNotFoundException
- {
- Object bean;
- InputStream serStream;
-
- if (cl == null)
- {
- serStream = ClassLoader.getSystemResourceAsStream
- (beanName.replace ('.','/')+".ser");
- }
- else
- {
- serStream = cl.getResourceAsStream (beanName.replace ('.', '/')
- + ".ser");
- }
-
- if (serStream != null)
- {
- if(cl == null)
- {
- ObjectInputStream ois = new ObjectInputStream(serStream);
- bean = ois.readObject();
- }
- else
- {
- ClassLoaderObjectInputStream ois =
- new ClassLoaderObjectInputStream (serStream, cl);
+ /** Creates a bean.
+ * <p>This is a convenience method that calls <code>instantiate(cl, beanName, null, null)</code>.</p>
+ *
+ * @see instantiate(ClassLoader, String, BeanContext, AppletInitializer)
+ * @param cl ClassLoader to be used or <code>null</code> for the system classloader.
+ * @param beanName Name of a serialized bean or class name.
+ * @return A newly created bean.
+ * @throws IOException If access of an IO resource failed.
+ * @throws ClassNotFoundException If the class name is not known or does not lead to a proper bean class.
+ */
+ public static Object instantiate(ClassLoader cl, String beanName)
+ throws IOException, ClassNotFoundException
+ {
+ return instantiate(cl, beanName, null, null);
+ }
+
+ /** Creates a bean.
+ *
+ * <p>This is a convenience method that calls <code>instantiate(cl, beanName, beanContext, null)</code>.</p>
+ *
+ * @see instantiate(ClassLoader, String, BeanContext, AppletInitializer)
+ * @param cl ClassLoader to be used or <code>null</code> for the system classloader.
+ * @param beanName Name of a serialized bean or class name.
+ * @param beanContext Context to which the newly created Bean should be added.
+ * @return A newly created bean.
+ * @throws IOException If access of an IO resource failed.
+ * @throws ClassNotFoundException If the class name is not known or does not lead to a proper bean class.
+ */
+ public static Object instantiate(
+ ClassLoader cl,
+ String beanName,
+ BeanContext beanContext)
+ throws IOException, ClassNotFoundException
+ {
+ return instantiate(cl, beanName, beanContext, null);
+ }
+
+ /** Instantiates a bean according to Beans 1.0.
+ *
+ * <p>In Beans 1.0 the instantiation scheme is as follows:</p>
+ * <p>The name should be dot-separated (e.g "place.for.beans.myBean") and indicate either a
+ * serialized object or a class name. In the first case all dots in the name are replaced with
+ * slashes ('/') and ".ser" is appended ("place.for.beans.myBean" becomes "place/for/beans/myBean.ser").
+ * The bean is then loaded as an application or system resource depending on whether a
+ * <code>ClassLoader</code> was provided.</p>
+ *
+ * <p>If no such resource exists or if it contains no bean the name is interpreted as a class name of
+ * which an instance is then created.</p>
+ *
+ * <p>If a <code>BeanContext</code> instance is available the created bean is added to it.</p>
+ *
+ * <p>If the created Bean is an <code>Applet</code> or subclass and an <code>AppletInitializer</code>
+ * instance is available the applet is initialized and afterwards activated using the initializer. Additionally
+ * every instantiated <code>Applet</code> bean is initialized using the {@link Applet.init} method.
+ * Furthermore every applet gets a default <code>AppletStub</code>. The <code>Applet</code>'s
+ * document base is the location of the ".ser" file if it was deserialized or the location of its class
+ * file if it was instantiated.</p>
+ *
+ * <p>A <code>ClassNotFoundException</code> is not only thrown when a class name was unknown
+ * but even when the class has public no-argument constructor
+ * (<code>IllegalAccessException</code> is wrapped) or an exception is thrown while
+ * invoking such a constructor (causing exception is wrapped).</p>
+ *
+ * @param cl ClassLoader to be used or <code>null</code> for the system classloader.
+ * @param beanName Name of a serialized bean or class name.
+ * @param beanContext Context to which the newly created Bean should be added.
+ * @param initializer The AppletInitializer which is used for initializing <code>Applet</code> beans.
+ * @return A newly created bean.
+ * @throws IOException If access of an IO resource failed.
+ * @throws ClassNotFoundException If the class name is not known or does not lead to a proper bean class.
+ */
+ public static Object instantiate(
+ ClassLoader cl,
+ String beanName,
+ BeanContext beanContext,
+ AppletInitializer initializer)
+ throws IOException, ClassNotFoundException
+ {
+ Object bean = null;
+ URL beanLocation = null;
+ URL classLocation = null;
+
+ // Converts bean name into a resource name (eg. "a.b.c" -> "a/b/c").
+ String resourceName = beanName.replace('.', '/');
+
+ /* Tries to get an input stream of the Bean, reading it as a system resource
+ * if no ClassLoader is present or as an application resource if a classloader
+ * is given.
+ */
+ beanLocation =
+ (cl == null)
+ ? ClassLoader.getSystemResource(resourceName + ".ser")
+ : cl.getResource(resourceName + ".ser");
+
+ // Reads the serialized Bean from the returned URL.
+ if (beanLocation != null)
+ {
+ // Deserializes the bean instance.
+ ObjectInputStream ois =
+ (cl == null)
+ ? new ObjectInputStream(beanLocation.openStream())
+ : new ClassLoaderObjectInputStream(
+ beanLocation.openStream(),
+ cl);
+
bean = ois.readObject();
- }
- }
- else if(cl == null)
- {
- Class beanClass = Class.forName(beanName);
- try
- {
- bean = beanClass.newInstance();
- }
- catch(IllegalAccessException E)
- {
- bean = null;
- }
- catch(InstantiationException E)
- {
- bean = null;
- }
- }
- else
- {
- Class beanClass = cl.loadClass(beanName);
- try
- {
- bean = beanClass.newInstance();
- }
- catch(IllegalAccessException E)
- {
- bean = null;
- }
- catch(InstantiationException E)
- {
- bean = null;
- }
- }
-
- if(bean instanceof Applet)
- {
- Applet a = (Applet)bean;
- //a.setAppletContext(???);
- //a.setStub(???);
- if(serStream == null)
- {
- a.init();
- }
- }
-
- return bean;
- }
- /**
- * Get the Bean as a different class type.
- * This should be used instead of casting to get a new
- * type view of a Bean, because in the future there may
- * be new types of Bean, even Beans spanning multiple
- * Objects.
- *
- * @param bean the Bean to cast.
- * @param newClass the Class to cast it to.
- *
- * @return the Bean as a new view, or if the operation
- * could not be performed, the Bean itself.
- */
- public static Object getInstanceOf(Object bean, Class newClass)
- {
- return bean;
- }
+ /* Implementation note: The result of ObjectInputStream.readObject()
+ * may have been null at this point (its a valid value to deserialize)
+ * and we explicitly want to try instantiation in such a case
+ * (this is important for compatibility).
+ */
+ }
- /**
- * Determine whether the Bean can be cast to a different
- * class type.
- * This should be used instead of instanceof to determine
- * a Bean's castability, because in the future there may
- * be new types of Bean, even Beans spanning multiple
- * Objects.
- *
- * @param bean the Bean to cast.
- * @param newBeanClass the Class to cast it to.
- *
- * @return whether the Bean can be cast to the class type
- * in question.
- */
- public static boolean isInstanceOf(Object bean, Class newBeanClass)
- {
- return newBeanClass.isInstance(bean);
- }
+ // Instantiates the Bean using reflective instantiation if it has not been created yet.
+ if (bean == null)
+ {
+ // Makes sure that the deserialization was NOT done.
+ beanLocation = null;
- /**
- * Find out whether the GUI is available to use.
- * Defaults to true.
- *
- * @return whether the GUI is available to use.
- */
- public static boolean isGuiAvailable()
- {
- return guiAvailable;
- }
+ Class beanClass;
+ if (cl == null)
+ {
+ beanClass = Class.forName(beanName);
+ classLocation =
+ ClassLoader.getSystemResource(resourceName + ".class");
+ }
+ else
+ {
+ beanClass = cl.loadClass(beanName);
+ classLocation = cl.getResource(resourceName + ".class");
+ }
- /**
- * Find out whether it is design time. Design time means
- * we are in a RAD tool.
- * Defaults to false.
- *
- * @return whether it is design time.
- */
- public static boolean isDesignTime()
- {
- return designTime;
- }
+ // Instantiates and optionally registers the new bean.
+ try
+ {
+ bean = beanClass.newInstance();
+ }
+ catch(Exception e) {
+ /* Wraps all kinds of Exceptions in a ClassNotFoundException (this behavior
+ * matches with official >= 1.5, this was different for <=1.4)
+ */
+ throw new ClassNotFoundException(null, e);
+ }
+ }
- /**
- * Set whether the GUI is available to use.
- * @param guiAvailable whether the GUI is available to use.
- */
- public static void setGuiAvailable(boolean guiAvailable)
- throws SecurityException
- {
- Beans.guiAvailable = guiAvailable;
- }
+ /* Applet beans are treated in the following way:
+ * - all AppletS get a default AppletStub
+ * - all AppletS are initialized using the AppletInitializer instance (if it is available)
+ * - as every other Bean Applets are added to a BeanContext if one is available
+ * - each instantiated Applet is initialized using Applet.init() (this is not done for deserialized ones)
+ * - finally AppletS get activated using the AppletInitializerS activate-Method
+ *
+ * The order of operations is important for compatibility.
+ */
+ Applet applet = null;
+ if (bean instanceof Applet)
+ {
+ // Makes a second instanceof call unneccessary (instanceof is expensive).
+ applet = (Applet) bean;
+
+ /* The AppletStub's code and document base is set as follows:
+ * The code base is always the URL from where the class data originated
+ * (without the package name).
+ * If the Applet was deserialized the document base is the location of
+ * the serialized instance (usually the ".ser" file) otherwise its the URL
+ * from where the class data originated (usually the absolute directory
+ * location of the ".class" file).
+ */
+ applet.setStub(
+ new DummyAppletStub(
+ applet
+ .getClass()
+ .getProtectionDomain()
+ .getCodeSource()
+ .getLocation(),
+ (beanLocation == null) ? classLocation : beanLocation));
+
+ // Runs the Applet's initialization using an AppletInitializer.
+ if (initializer != null)
+ {
+ initializer.initialize(applet, beanContext);
+ }
+ }
+
+ // Adds the new bean to its BeanContext.
+ if (beanContext != null)
+ {
+ beanContext.add(bean);
+ }
+
+ if (applet != null)
+ {
+
+ // Initializes an instantiated (not deserialized) Applet using its own method.
+ if (beanLocation == null)
+ {
+ applet.init();
+ }
+
+ // Runs the Applet's activation using an AppletInitializer.
+ if (initializer != null)
+ {
+ initializer.activate(applet);
+ }
+ }
+
+ return bean;
+ }
+
+ /**
+ * Returns the Bean as a different class type.
+ * This should be used instead of casting to get a new
+ * type view of a Bean, because in the future there may
+ * be new types of Bean, even Beans spanning multiple
+ * Objects.
+ *
+ * @param bean the Bean to cast.
+ * @param newClass the Class to cast it to.
+ *
+ * @return the Bean as a new view, or if the operation
+ * could not be performed, the Bean itself.
+ */
+ public static Object getInstanceOf(Object bean, Class newClass)
+ {
+ return bean;
+ }
+
+ /**
+ * Determines whether the Bean can be cast to a different
+ * class type.
+ * This should be used instead of instanceof to determine
+ * a Bean's castability, because in the future there may
+ * be new types of Bean, even Beans spanning multiple
+ * Objects.
+ *
+ * @param bean the Bean to cast.
+ * @param newClass the Class to cast it to.
+ *
+ * @return whether the Bean can be cast to the class type
+ * in question.
+ */
+ public static boolean isInstanceOf(Object bean, Class newBeanClass)
+ {
+ return newBeanClass.isInstance(bean);
+ }
+
+ /**
+ * Returns whether the GUI is available to use.
+ * <p>Defaults to true.</p>
+ *
+ * @return whether the GUI is available to use.
+ */
+ public static boolean isGuiAvailable()
+ {
+ return guiAvailable;
+ }
+
+ /**
+ * Returns whether it is design time. Design time means
+ * we are in a RAD tool.
+ * <p>Defaults to false.</p>
+ *
+ * @return whether it is design time.
+ */
+ public static boolean isDesignTime()
+ {
+ return designTime;
+ }
+
+ /**
+ * Sets whether the GUI is available to use.
+ *
+ * @param guiAvailable whether the GUI is available to use.
+ */
+ public static void setGuiAvailable(boolean guiAvailable)
+ throws SecurityException
+ {
+ Beans.guiAvailable = guiAvailable;
+ }
+
+ /**
+ * Sets whether it is design time. Design time means we
+ * are in a RAD tool.
+ *
+ * @param designTime whether it is design time.
+ */
+ public static void setDesignTime(boolean designTime)
+ throws SecurityException
+ {
+ Beans.designTime = designTime;
+ }
- /**
- * Set whether it is design time. Design time means we
- * are in a RAD tool.
- *
- * @param designTime whether it is design time.
- */
- public static void setDesignTime(boolean designTime)
- throws SecurityException
- {
- Beans.designTime = designTime;
- }
}
diff --git a/libjava/java/beans/ExceptionListener.java b/libjava/java/beans/ExceptionListener.java
index 09f7d1a8a2e..01f952f8597 100644
--- a/libjava/java/beans/ExceptionListener.java
+++ b/libjava/java/beans/ExceptionListener.java
@@ -1,5 +1,5 @@
/* ExceptionListener.java -- listen for recoverable internal exceptions
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.beans;
* This interface allows a class to monitor internal exceptions, to try to
* recover from them.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/beans/PropertyChangeEvent.java b/libjava/java/beans/PropertyChangeEvent.java
index 418f92f8bb8..75e17b18be1 100644
--- a/libjava/java/beans/PropertyChangeEvent.java
+++ b/libjava/java/beans/PropertyChangeEvent.java
@@ -1,5 +1,5 @@
/* PropertyChangeEvent.java -- describes a change in a property
- Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ import java.util.EventObject;
* information.
*
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status udpated to 1.4
*/
diff --git a/libjava/java/beans/PropertyChangeListenerProxy.java b/libjava/java/beans/PropertyChangeListenerProxy.java
index 6e707038d06..3a04de2db5a 100644
--- a/libjava/java/beans/PropertyChangeListenerProxy.java
+++ b/libjava/java/beans/PropertyChangeListenerProxy.java
@@ -1,5 +1,5 @@
/* PropertyChangeListenerProxy.java -- adds a name to a property listener
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.EventListenerProxy;
* associating a name with the listener. This can be used to filter the
* changes that one is interested in.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status udpated to 1.4
*/
diff --git a/libjava/java/beans/PropertyChangeSupport.java b/libjava/java/beans/PropertyChangeSupport.java
index 4796a17f13e..76932bccda3 100644
--- a/libjava/java/beans/PropertyChangeSupport.java
+++ b/libjava/java/beans/PropertyChangeSupport.java
@@ -1,5 +1,5 @@
/* PropertyChangeSupport.java -- support to manage property change listeners
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import java.util.Vector;
* is thread-safe.
*
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/beans/PropertyDescriptor.java b/libjava/java/beans/PropertyDescriptor.java
index b62440a2e47..57ed4f8cadf 100644
--- a/libjava/java/beans/PropertyDescriptor.java
+++ b/libjava/java/beans/PropertyDescriptor.java
@@ -1,5 +1,5 @@
/* java.beans.PropertyDescriptor
- Copyright (C) 1998, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import java.lang.reflect.Method;
** </OL>
**
** @author John Keiser
- ** @author Robert Schuster <thebohemian@gmx.net>
+ ** @author Robert Schuster (thebohemian@gmx.net)
** @since 1.1
** @status updated to 1.4
**/
@@ -126,7 +126,7 @@ public class PropertyDescriptor extends FeatureDescriptor
}
// finally check the methods compatibility
- checkMethods(getMethod, setMethod);
+ propertyType = checkMethods(getMethod, setMethod);
}
/** Create a new PropertyDescriptor by introspection.
@@ -178,7 +178,7 @@ public class PropertyDescriptor extends FeatureDescriptor
"Cannot find a setter method called " + setMethodName);
}
- checkMethods(getMethod, setMethod);
+ propertyType = checkMethods(getMethod, setMethod);
}
/** Create a new PropertyDescriptor using explicit Methods.
@@ -205,17 +205,7 @@ public class PropertyDescriptor extends FeatureDescriptor
setName(name);
getMethod = readMethod;
setMethod = writeMethod;
-
- if (getMethod != null)
- {
- this.propertyType = getMethod.getReturnType();
- }
- else if (setMethod != null)
- {
- this.propertyType = setMethod.getParameterTypes()[0];
- }
-
- checkMethods(getMethod, setMethod);
+ propertyType = checkMethods(getMethod, setMethod);
}
/** Get the property type.
@@ -250,7 +240,7 @@ public class PropertyDescriptor extends FeatureDescriptor
*/
public void setReadMethod(Method readMethod) throws IntrospectionException
{
- checkMethods(readMethod, setMethod);
+ propertyType = checkMethods(readMethod, setMethod);
getMethod = readMethod;
}
@@ -448,7 +438,7 @@ public class PropertyDescriptor extends FeatureDescriptor
* <li>the property type and the read method's return type must be assignable from the
* write method's argument type</li>
* <li>the write method may not exist</li>
- * <ul>
+ * </ul>
* While checking the methods a common new property type is calculated. If the method
* succeeds this property type is returned.<br/>
* <br/>
diff --git a/libjava/java/beans/VetoableChangeListenerProxy.java b/libjava/java/beans/VetoableChangeListenerProxy.java
index f9d79958705..d5007317bd5 100644
--- a/libjava/java/beans/VetoableChangeListenerProxy.java
+++ b/libjava/java/beans/VetoableChangeListenerProxy.java
@@ -1,5 +1,5 @@
/* VetoableChangeListenerProxy.java -- adds a name to a vetoable listener
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.EventListenerProxy;
* associating a name with the listener. This can be used to filter the
* changes that one is interested in.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status udpated to 1.4
*/
diff --git a/libjava/java/beans/VetoableChangeSupport.java b/libjava/java/beans/VetoableChangeSupport.java
index bbac648dbd2..f1dbc50a778 100644
--- a/libjava/java/beans/VetoableChangeSupport.java
+++ b/libjava/java/beans/VetoableChangeSupport.java
@@ -1,5 +1,5 @@
/* VetoableChangeSupport.java -- support to manage vetoable change listeners
- Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import java.util.Vector;
* is thread-safe.
*
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/io/BufferedReader.java b/libjava/java/io/BufferedReader.java
index 19074703938..ab597884828 100644
--- a/libjava/java/io/BufferedReader.java
+++ b/libjava/java/io/BufferedReader.java
@@ -1,5 +1,5 @@
/* BufferedReader.java
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,8 +55,8 @@ package java.io;
* of remembering any number of input chars, to the limits of
* system memory or the size of <code>Integer.MAX_VALUE</code>
*
- * @author Per Bothner <bothner@cygnus.com>
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Per Bothner (bothner@cygnus.com)
+ * @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class BufferedReader extends Reader
{
diff --git a/libjava/java/io/ByteArrayInputStream.java b/libjava/java/io/ByteArrayInputStream.java
index 45a09a77b5d..906e71a0d94 100644
--- a/libjava/java/io/ByteArrayInputStream.java
+++ b/libjava/java/io/ByteArrayInputStream.java
@@ -1,5 +1,5 @@
/* ByteArrayInputStream.java -- Read an array as a stream
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.io;
/**
* This class permits an array of bytes to be read as an input stream.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class ByteArrayInputStream extends InputStream
diff --git a/libjava/java/io/ByteArrayOutputStream.java b/libjava/java/io/ByteArrayOutputStream.java
index 2e89cf5ee0a..095debefa7b 100644
--- a/libjava/java/io/ByteArrayOutputStream.java
+++ b/libjava/java/io/ByteArrayOutputStream.java
@@ -1,5 +1,5 @@
/* BufferedReader.java
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,7 +66,7 @@ package java.io;
* multibyte character encodings.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @date September 24, 1998
*/
public class ByteArrayOutputStream extends OutputStream
diff --git a/libjava/java/io/CharArrayReader.java b/libjava/java/io/CharArrayReader.java
index 9d5382bef1e..d0d5a28399c 100644
--- a/libjava/java/io/CharArrayReader.java
+++ b/libjava/java/io/CharArrayReader.java
@@ -1,5 +1,5 @@
/* CharArrayReader.java -- Read an array of characters as a stream
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.io;
* This class permits an array of chars to be read as an input stream.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class CharArrayReader extends Reader
{
diff --git a/libjava/java/io/CharArrayWriter.java b/libjava/java/io/CharArrayWriter.java
index 7453996c346..4593f15c784 100644
--- a/libjava/java/io/CharArrayWriter.java
+++ b/libjava/java/io/CharArrayWriter.java
@@ -1,5 +1,5 @@
/* CharArrayWriter.java -- Write chars to a buffer
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,7 +60,7 @@ package java.io;
* <p>
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class CharArrayWriter extends Writer
{
diff --git a/libjava/java/io/CharConversionException.java b/libjava/java/io/CharConversionException.java
index 0cb83d2d020..6f2afb53f7b 100644
--- a/libjava/java/io/CharConversionException.java
+++ b/libjava/java/io/CharConversionException.java
@@ -1,5 +1,5 @@
/* CharConversionException.java -- Character conversion exceptions
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.io;
* an attempted character conversion.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/io/DataInput.java b/libjava/java/io/DataInput.java
index 52cd246110d..0aa172b17a0 100644
--- a/libjava/java/io/DataInput.java
+++ b/libjava/java/io/DataInput.java
@@ -1,5 +1,5 @@
/* DataInput.java -- Interface for reading data from a stream
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.io;
* into Java primitive types.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public interface DataInput
{
diff --git a/libjava/java/io/DataInputStream.java b/libjava/java/io/DataInputStream.java
index d6068828c89..9cdbc695506 100644
--- a/libjava/java/io/DataInputStream.java
+++ b/libjava/java/io/DataInputStream.java
@@ -50,8 +50,8 @@ package java.io;
*
* @see DataInput
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @date October 20, 1998.
*/
public class DataInputStream extends FilterInputStream implements DataInput
diff --git a/libjava/java/io/DataOutput.java b/libjava/java/io/DataOutput.java
index e07eb628969..70fb7d48c69 100644
--- a/libjava/java/io/DataOutput.java
+++ b/libjava/java/io/DataOutput.java
@@ -1,5 +1,5 @@
/* DataOutput.java -- Interface for writing data from a stream
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ package java.io;
* by classes implementing the <code>DataInput</code> interface.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*
* @see DataInput
*/
diff --git a/libjava/java/io/DataOutputStream.java b/libjava/java/io/DataOutputStream.java
index ab2db95df99..9a2d172ac46 100644
--- a/libjava/java/io/DataOutputStream.java
+++ b/libjava/java/io/DataOutputStream.java
@@ -1,5 +1,5 @@
/* DataOutputStream.java -- Writes primitive Java datatypes to streams
- Copyright (C) 1998, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,8 +51,8 @@ package java.io;
*
* @see DataInputStream
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class DataOutputStream extends FilterOutputStream implements DataOutput
{
diff --git a/libjava/java/io/EOFException.java b/libjava/java/io/EOFException.java
index d129cd69249..2ec28c6c8ee 100644
--- a/libjava/java/io/EOFException.java
+++ b/libjava/java/io/EOFException.java
@@ -1,5 +1,5 @@
/* EOFException.java -- unexpected end of file exception
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.io;
* thus throw this exception.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class EOFException extends IOException
diff --git a/libjava/java/io/Externalizable.java b/libjava/java/io/Externalizable.java
index 09080a05831..71304e24abf 100644
--- a/libjava/java/io/Externalizable.java
+++ b/libjava/java/io/Externalizable.java
@@ -60,8 +60,6 @@ package java.io;
*/
public interface Externalizable extends Serializable
{
- long serialVersionUID = -282491828744381764L;
-
/**
* This method restores an object's state by reading in the instance data
* for the object from the passed in stream. Note that this stream is not
diff --git a/libjava/java/io/FileDescriptor.java b/libjava/java/io/FileDescriptor.java
index e3c1a18bd9f..1e44a60bb99 100644
--- a/libjava/java/io/FileDescriptor.java
+++ b/libjava/java/io/FileDescriptor.java
@@ -120,7 +120,7 @@ public final class FileDescriptor
if (ex instanceof SyncFailedException)
throw (SyncFailedException) ex;
else
- throw new SyncFailedException(ex.getMessage());
+ throw new SyncFailedException(ex.toString());
}
}
}
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java
index 908c00a19b9..17aaf799be0 100644
--- a/libjava/java/io/FileInputStream.java
+++ b/libjava/java/io/FileInputStream.java
@@ -1,5 +1,5 @@
/* FileInputStream.java -- An input stream that reads from disk files.
- Copyright (C) 1998, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,8 +51,8 @@ import java.nio.channels.FileChannel;
/**
* This class is a stream that reads its bytes from a file.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class FileInputStream extends InputStream
{
diff --git a/libjava/java/io/FileNotFoundException.java b/libjava/java/io/FileNotFoundException.java
index 7877aba150d..66809f5e7bb 100644
--- a/libjava/java/io/FileNotFoundException.java
+++ b/libjava/java/io/FileNotFoundException.java
@@ -1,5 +1,5 @@
/* FileNotFoundException.java -- the requested file could not be found
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,8 +43,8 @@ package java.io;
* does not exist, or is inaccessible for some other reason (such as writing
* a read-only file).
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class FileNotFoundException extends IOException
diff --git a/libjava/java/io/FileOutputStream.java b/libjava/java/io/FileOutputStream.java
index 1702ffe8f54..34b06cbf151 100644
--- a/libjava/java/io/FileOutputStream.java
+++ b/libjava/java/io/FileOutputStream.java
@@ -1,5 +1,5 @@
/* FileOutputStream.java -- Writes to a file on disk.
- Copyright (C) 1998, 2001, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,8 +51,8 @@ import java.nio.channels.FileChannel;
* This classes allows a stream of data to be written to a disk file or
* any open <code>FileDescriptor</code>.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class FileOutputStream extends OutputStream
{
diff --git a/libjava/java/io/FilenameFilter.java b/libjava/java/io/FilenameFilter.java
index e3b004d5499..dad3ccf28af 100644
--- a/libjava/java/io/FilenameFilter.java
+++ b/libjava/java/io/FilenameFilter.java
@@ -1,5 +1,5 @@
/* FilenameFilter.java -- Filter a list of filenames
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ package java.io;
* or should not be included in the file listing.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*
* @see File#listFiles(java.io.FilenameFilter)
* @see java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
diff --git a/libjava/java/io/FilterInputStream.java b/libjava/java/io/FilterInputStream.java
index c81259bd25b..477521aa816 100644
--- a/libjava/java/io/FilterInputStream.java
+++ b/libjava/java/io/FilterInputStream.java
@@ -1,5 +1,5 @@
/* FilterInputStream.java -- Base class for classes that filter input
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -65,7 +65,7 @@ package java.io;
* <code>InputStream read(byte[])</code> method.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class FilterInputStream extends InputStream
{
diff --git a/libjava/java/io/FilterOutputStream.java b/libjava/java/io/FilterOutputStream.java
index 2144213f0e1..98db4ac12c9 100644
--- a/libjava/java/io/FilterOutputStream.java
+++ b/libjava/java/io/FilterOutputStream.java
@@ -1,5 +1,5 @@
/* FilterOutputStream.java -- Parent class for output streams that filter
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ package java.io;
* underlying stream. Subclasses provide actual filtering.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class FilterOutputStream extends OutputStream
{
diff --git a/libjava/java/io/FilterReader.java b/libjava/java/io/FilterReader.java
index caf102b082a..4cc6940c518 100644
--- a/libjava/java/io/FilterReader.java
+++ b/libjava/java/io/FilterReader.java
@@ -1,5 +1,5 @@
/* FilterReader.java -- Base class for char stream classes that filter input
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,7 +59,7 @@ package java.io;
* <code>Reader} read(yte[])</code> method.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public abstract class FilterReader extends Reader
{
diff --git a/libjava/java/io/FilterWriter.java b/libjava/java/io/FilterWriter.java
index a717092d859..5a8ede572db 100644
--- a/libjava/java/io/FilterWriter.java
+++ b/libjava/java/io/FilterWriter.java
@@ -1,5 +1,5 @@
/* FilterWriter.java -- Parent class for output streams that filter
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ package java.io;
* underlying stream. Subclasses provide actual filtering.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public abstract class FilterWriter extends Writer
{
diff --git a/libjava/java/io/IOException.java b/libjava/java/io/IOException.java
index 8baf593c9c2..f1e3848da4a 100644
--- a/libjava/java/io/IOException.java
+++ b/libjava/java/io/IOException.java
@@ -1,5 +1,5 @@
/* IOException.java -- Generic input/output exception
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.io;
* detailed indication of what happened.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class IOException extends Exception
diff --git a/libjava/java/io/InputStream.java b/libjava/java/io/InputStream.java
index 610ccf1f177..1d942446711 100644
--- a/libjava/java/io/InputStream.java
+++ b/libjava/java/io/InputStream.java
@@ -1,5 +1,5 @@
/* InputStream.java -- Base class for input
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.io;
* or network connection.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public abstract class InputStream
{
diff --git a/libjava/java/io/InputStreamReader.java b/libjava/java/io/InputStreamReader.java
index 3ebbb4ec9e4..ee03a5e6175 100644
--- a/libjava/java/io/InputStreamReader.java
+++ b/libjava/java/io/InputStreamReader.java
@@ -1,5 +1,5 @@
/* InputStreamReader.java -- Reader than transforms bytes to chars
- Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -82,7 +82,7 @@ import gnu.gcj.convert.*;
* @see InputStream
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @date April 22, 1998.
*/
public class InputStreamReader extends Reader
diff --git a/libjava/java/io/InterruptedIOException.java b/libjava/java/io/InterruptedIOException.java
index 321c2697b43..614fb3b8947 100644
--- a/libjava/java/io/InterruptedIOException.java
+++ b/libjava/java/io/InterruptedIOException.java
@@ -1,5 +1,5 @@
/* InterruptedIOException.java -- an I/O operation was interrupted
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,8 +43,8 @@ package java.io;
* for some reason. The field bytesTransferred will contain the number of
* bytes that were read/written prior to the interruption.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
* @see Thread#interrupt()
* @status updated to 1.4
*/
diff --git a/libjava/java/io/LineNumberInputStream.java b/libjava/java/io/LineNumberInputStream.java
index ee0ce2c799e..ae6292e9284 100644
--- a/libjava/java/io/LineNumberInputStream.java
+++ b/libjava/java/io/LineNumberInputStream.java
@@ -1,5 +1,5 @@
/* LineNumberInputStream.java -- An input stream which counts line numbers
- Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,7 +67,7 @@ package java.io;
* compatibility only and should not be used in new applications.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class LineNumberInputStream extends FilterInputStream
{
diff --git a/libjava/java/io/LineNumberReader.java b/libjava/java/io/LineNumberReader.java
index b3cb5826930..0a4797bd6c1 100644
--- a/libjava/java/io/LineNumberReader.java
+++ b/libjava/java/io/LineNumberReader.java
@@ -1,5 +1,5 @@
/* LineNumberReader.java -- A character input stream which counts line numbers
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,9 +52,9 @@ package java.io;
* read from the stream does not end in a line termination sequence, it
* will not be counted as a line.
*
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Guilhem Lavaux <guilhem@kaffe.org>
+ * @author Guilhem Lavaux (guilhem@kaffe.org)
* @date December 28, 2003.
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java
index 0c79d332700..2cfe4c99419 100644
--- a/libjava/java/io/ObjectInputStream.java
+++ b/libjava/java/io/ObjectInputStream.java
@@ -1,5 +1,6 @@
/* ObjectInputStream.java -- Class used to read serialized objects
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,13 +43,14 @@ import gnu.classpath.Configuration;
import gnu.java.io.ObjectIdentityWrapper;
import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
-import java.security.PrivilegedAction;
import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
@@ -121,15 +123,6 @@ public class ObjectInputStream extends InputStream
*/
public final Object readObject() throws ClassNotFoundException, IOException
{
- if (callersClassLoader == null)
- {
- callersClassLoader = getCallersClassLoader ();
- if (Configuration.DEBUG && dump)
- {
- dumpElementln ("CallersClassLoader = " + callersClassLoader);
- }
- }
-
if (this.useSubclassMethod)
return readObjectOverride();
@@ -271,7 +264,7 @@ public class ObjectInputStream extends InputStream
readArrayElements(array, componentType);
if(dump)
for (int i = 0, len = Array.getLength(array); i < len; i++)
- dumpElementln(" ELEMENT[" + i + "]=" + Array.get(array, i));
+ dumpElementln(" ELEMENT[" + i + "]=" + Array.get(array, i));
ret_val = processResolution(null, array, handle);
break;
}
@@ -301,13 +294,18 @@ public class ObjectInputStream extends InputStream
obj.readExternal(this);
if (read_from_blocks)
- setBlockDataMode(oldmode);
+ {
+ setBlockDataMode(oldmode);
+ if (!oldmode)
+ if (this.realInputStream.readByte() != TC_ENDBLOCKDATA)
+ throw new IOException("No end of block data seen for class with readExternal (ObjectInputStream) method.");
+ }
ret_val = processResolution(osc, obj, handle);
break;
} // end if (osc.realClassIsExternalizable)
- Object obj = newObject(clazz, osc.firstNonSerializableParent);
+ Object obj = newObject(clazz, osc.firstNonSerializableParentConstructor);
int handle = assignNewHandle(obj);
Object prevObject = this.currentObject;
@@ -398,8 +396,6 @@ public class ObjectInputStream extends InputStream
setBlockDataMode(old_mode);
this.isDeserializing = was_deserializing;
-
- depth -= 2;
depth -= 2;
@@ -505,7 +501,8 @@ public class ObjectInputStream extends InputStream
flags, fields);
assignNewHandle(osc);
- ClassLoader currentLoader = currentLoader();
+ if (callersClassLoader == null)
+ callersClassLoader = currentLoader();
for (int i = 0; i < field_count; i++)
{
@@ -526,12 +523,40 @@ public class ObjectInputStream extends InputStream
class_name = String.valueOf(type_code);
fields[i] =
- new ObjectStreamField(field_name, class_name, currentLoader);
+ new ObjectStreamField(field_name, class_name, callersClassLoader);
}
/* Now that fields have been read we may resolve the class
* (and read annotation if needed). */
- Class clazz = resolveClass(osc);
+ Class clazz;
+ try
+ {
+ clazz = resolveClass(osc);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ // Maybe it was an primitive class?
+ if (name.equals("void"))
+ clazz = Void.TYPE;
+ else if (name.equals("boolean"))
+ clazz = Boolean.TYPE;
+ else if (name.equals("byte"))
+ clazz = Byte.TYPE;
+ else if (name.equals("short"))
+ clazz = Short.TYPE;
+ else if (name.equals("char"))
+ clazz = Character.TYPE;
+ else if (name.equals("int"))
+ clazz = Integer.TYPE;
+ else if (name.equals("long"))
+ clazz = Long.TYPE;
+ else if (name.equals("float"))
+ clazz = Float.TYPE;
+ else if (name.equals("double"))
+ clazz = Double.TYPE;
+ else
+ throw cnfe;
+ }
boolean oldmode = setBlockDataMode(true);
osc.setClass(clazz, lookupClass(clazz.getSuperclass()));
@@ -541,16 +566,45 @@ public class ObjectInputStream extends InputStream
// find the first non-serializable, non-abstract
// class in clazz's inheritance hierarchy
Class first_nonserial = clazz.getSuperclass();
- while (Serializable.class.isAssignableFrom(first_nonserial)
- || Modifier.isAbstract(first_nonserial.getModifiers()))
+ // Maybe it is a primitive class, those don't have a super class,
+ // or Object itself. Otherwise we can keep getting the superclass
+ // till we hit the Object class, or some other non-serializable class.
+
+ if (first_nonserial == null)
+ first_nonserial = clazz;
+ else
+ while (Serializable.class.isAssignableFrom(first_nonserial)
+ || Modifier.isAbstract(first_nonserial.getModifiers()))
first_nonserial = first_nonserial.getSuperclass();
- osc.firstNonSerializableParent = first_nonserial;
+ final Class local_constructor_class = first_nonserial;
+
+ osc.firstNonSerializableParentConstructor =
+ (Constructor)AccessController.doPrivileged(new PrivilegedAction()
+ {
+ public Object run()
+ {
+ try
+ {
+ Constructor c = local_constructor_class.
+ getDeclaredConstructor(new Class[0]);
+ if (Modifier.isPrivate(c.getModifiers()))
+ return null;
+ return c;
+ }
+ catch (NoSuchMethodException e)
+ {
+ // error will be reported later, in newObject()
+ return null;
+ }
+ }
+ });
+
osc.realClassIsSerializable = Serializable.class.isAssignableFrom(clazz);
osc.realClassIsExternalizable = Externalizable.class.isAssignableFrom(clazz);
ObjectStreamField[] stream_fields = osc.fields;
- ObjectStreamField[] real_fields = ObjectStreamClass.lookup(clazz).fields;
+ ObjectStreamField[] real_fields = ObjectStreamClass.lookupForClassObject(clazz).fields;
ObjectStreamField[] fieldmapping = new ObjectStreamField[2 * Math.max(stream_fields.length, real_fields.length)];
int stream_idx = 0;
@@ -716,6 +770,15 @@ public class ObjectInputStream extends InputStream
protected Class resolveClass(ObjectStreamClass osc)
throws ClassNotFoundException, IOException
{
+ if (callersClassLoader == null)
+ {
+ callersClassLoader = currentLoader ();
+ if (Configuration.DEBUG && dump)
+ {
+ dumpElementln ("CallersClassLoader = " + callersClassLoader);
+ }
+ }
+
return Class.forName(osc.getName(), true, callersClassLoader);
}
@@ -749,8 +812,10 @@ public class ObjectInputStream extends InputStream
*/
private ObjectStreamClass lookupClass(Class clazz)
{
- ObjectStreamClass oclazz;
+ if (clazz == null)
+ return null;
+ ObjectStreamClass oclazz;
oclazz = (ObjectStreamClass)classLookupTable.get(clazz);
if (oclazz == null)
return ObjectStreamClass.lookup(clazz);
@@ -1766,14 +1831,14 @@ public class ObjectInputStream extends InputStream
// returns a new instance of REAL_CLASS that has been constructed
// only to the level of CONSTRUCTOR_CLASS (a super class of REAL_CLASS)
- private Object newObject (Class real_class, Class constructor_class)
- throws ClassNotFoundException
+ private Object newObject (Class real_class, Constructor constructor)
+ throws ClassNotFoundException, IOException
{
+ if (constructor == null)
+ throw new InvalidClassException("Missing accessible no-arg base class constructor for " + real_class.getName());
try
{
- Object obj = allocateObject (real_class);
- callConstructor (constructor_class, obj);
- return obj;
+ return allocateObject(real_class, constructor.getDeclaringClass(), constructor);
}
catch (InstantiationException e)
{
@@ -1808,10 +1873,7 @@ public class ObjectInputStream extends InputStream
* @param sm SecurityManager instance which should be called.
* @return The current class loader in the calling stack.
*/
-
private static native ClassLoader currentClassLoader (SecurityManager sm);
-
- private native ClassLoader getCallersClassLoader();
private void callReadMethod (Method readObject, Class klass, Object obj)
throws ClassNotFoundException, IOException
@@ -1844,11 +1906,9 @@ public class ObjectInputStream extends InputStream
prereadFields = null;
}
- private native Object allocateObject (Class clazz)
+ private native Object allocateObject(Class clazz, Class constr_clazz, Constructor constructor)
throws InstantiationException;
- private native void callConstructor (Class clazz, Object obj);
-
private static final int BUFFER_SIZE = 1024;
private DataInputStream realInputStream;
@@ -1870,15 +1930,14 @@ public class ObjectInputStream extends InputStream
private Hashtable classLookupTable;
private GetField prereadFields;
- private static boolean dump = false && Configuration.DEBUG;
-
private ClassLoader callersClassLoader;
+ private static boolean dump;
// The nesting depth for debugging output
private int depth = 0;
private void dumpElement (String msg)
- {
+ {
System.out.print(msg);
}
@@ -1897,24 +1956,24 @@ public class ObjectInputStream extends InputStream
System.loadLibrary ("javaio");
}
}
-}
-
-
-// used to keep a prioritized list of object validators
-class ValidatorAndPriority implements Comparable
-{
- int priority;
- ObjectInputValidation validator;
-
- ValidatorAndPriority (ObjectInputValidation validator, int priority)
- {
- this.priority = priority;
- this.validator = validator;
- }
- public int compareTo (Object o)
+ // used to keep a prioritized list of object validators
+ private static final class ValidatorAndPriority implements Comparable
{
- ValidatorAndPriority vap = (ValidatorAndPriority)o;
- return this.priority - vap.priority;
+ int priority;
+ ObjectInputValidation validator;
+
+ ValidatorAndPriority (ObjectInputValidation validator, int priority)
+ {
+ this.priority = priority;
+ this.validator = validator;
+ }
+
+ public int compareTo (Object o)
+ {
+ ValidatorAndPriority vap = (ValidatorAndPriority)o;
+ return this.priority - vap.priority;
+ }
}
}
+
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index 3482225232a..55763eeddfe 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -250,6 +250,11 @@ public class ObjectOutputStream extends OutputStream
break;
}
+ Class clazz = obj.getClass();
+ ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(clazz);
+ if (osc == null)
+ throw new NotSerializableException(clazz.getName());
+
if ((replacementEnabled || obj instanceof Serializable)
&& ! replaceDone)
{
@@ -257,19 +262,11 @@ public class ObjectOutputStream extends OutputStream
if (obj instanceof Serializable)
{
- Method m = null;
try
{
- Class classArgs[] = {};
- m = getMethod(obj.getClass(), "writeReplace",
- classArgs);
- // m can't be null by definition since an
- // exception would have been thrown so a check
- // for null is not needed.
- obj = m.invoke(obj, new Object[] {});
- }
- catch (NoSuchMethodException ignore)
- {
+ Method m = osc.writeReplaceMethod;
+ if (m != null)
+ obj = m.invoke(obj, new Object[0]);
}
catch (IllegalAccessException ignore)
{
@@ -294,11 +291,6 @@ public class ObjectOutputStream extends OutputStream
break;
}
- Class clazz = obj.getClass();
- ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(clazz);
- if (osc == null)
- throw new NotSerializableException(clazz.getName());
-
if (clazz.isArray ())
{
realOutput.writeByte(TC_ARRAY);
@@ -347,8 +339,8 @@ public class ObjectOutputStream extends OutputStream
fieldsAlreadyWritten = false;
if (currentObjectStreamClass.hasWriteMethod())
{
- if (dump)
- dumpElementln ("WRITE METHOD CALLED FOR: " + obj);
+ if (dump)
+ dumpElementln ("WRITE METHOD CALLED FOR: " + obj);
setBlockDataMode(true);
callWriteMethod(obj, currentObjectStreamClass);
setBlockDataMode(false);
@@ -358,10 +350,10 @@ public class ObjectOutputStream extends OutputStream
}
else
{
- if (dump)
- dumpElementln ("WRITE FIELDS CALLED FOR: " + obj);
- writeFields(obj, currentObjectStreamClass);
- }
+ if (dump)
+ dumpElementln ("WRITE FIELDS CALLED FOR: " + obj);
+ writeFields(obj, currentObjectStreamClass);
+ }
}
this.currentObject = prevObject;
@@ -1261,18 +1253,11 @@ public class ObjectOutputStream extends OutputStream
private void callWriteMethod(Object obj, ObjectStreamClass osc)
throws IOException
{
- Class klass = osc.forClass();
currentPutField = null;
try
{
- Class classArgs[] = {ObjectOutputStream.class};
- Method m = getMethod(klass, "writeObject", classArgs);
- Object args[] = {this};
- m.invoke(obj, args);
- }
- catch (NoSuchMethodException nsme)
- {
- // Nothing.
+ Object args[] = {this};
+ osc.writeObjectMethod.invoke(obj, args);
}
catch (InvocationTargetException x)
{
@@ -1285,7 +1270,8 @@ public class ObjectOutputStream extends OutputStream
IOException ioe
= new IOException("Exception thrown from writeObject() on " +
- klass + ": " + exception.getClass().getName());
+ osc.forClass().getName() + ": " +
+ exception.getClass().getName());
ioe.initCause(exception);
throw ioe;
}
@@ -1293,7 +1279,8 @@ public class ObjectOutputStream extends OutputStream
{
IOException ioe
= new IOException("Failure invoking writeObject() on " +
- klass + ": " + x.getClass().getName());
+ osc.forClass().getName() + ": " +
+ x.getClass().getName());
ioe.initCause(x);
throw ioe;
}
@@ -1535,15 +1522,6 @@ public class ObjectOutputStream extends OutputStream
}
}
- private Method getMethod (Class klass, String name, Class[] args)
- throws java.lang.NoSuchMethodException
- {
- final Method m = klass.getDeclaredMethod(name, args);
- setAccessible.setMember(m);
- AccessController.doPrivileged(setAccessible);
- return m;
- }
-
private void dumpElementln (String msg)
{
for (int i = 0; i < depth; i++)
diff --git a/libjava/java/io/ObjectStreamClass.java b/libjava/java/io/ObjectStreamClass.java
index d133afc08f9..a5f6ea0be5e 100644
--- a/libjava/java/io/ObjectStreamClass.java
+++ b/libjava/java/io/ObjectStreamClass.java
@@ -452,27 +452,33 @@ public class ObjectStreamClass implements Serializable
}
private Method findMethod(Method[] methods, String name, Class[] params,
- Class returnType)
+ Class returnType, boolean mustBePrivate)
{
outer:
- for(int i = 0; i < methods.length; i++)
+ for (int i = 0; i < methods.length; i++)
{
- if(methods[i].getName().equals(name) &&
- methods[i].getReturnType() == returnType)
+ final Method m = methods[i];
+ int mods = m.getModifiers();
+ if (Modifier.isStatic(mods)
+ || (mustBePrivate && !Modifier.isPrivate(mods)))
+ {
+ continue;
+ }
+
+ if (m.getName().equals(name)
+ && m.getReturnType() == returnType)
{
- Class[] mp = methods[i].getParameterTypes();
- if(mp.length == params.length)
+ Class[] mp = m.getParameterTypes();
+ if (mp.length == params.length)
{
- for(int j = 0; j < mp.length; j++)
+ for (int j = 0; j < mp.length; j++)
{
- if(mp[j] != params[j])
+ if (mp[j] != params[j])
{
continue outer;
}
}
- final Method m = methods[i];
- SetAccessibleAction setAccessible = new SetAccessibleAction(m);
- AccessController.doPrivileged(setAccessible);
+ AccessController.doPrivileged(new SetAccessibleAction(m));
return m;
}
}
@@ -485,9 +491,14 @@ outer:
Method[] methods = forClass().getDeclaredMethods();
readObjectMethod = findMethod(methods, "readObject",
new Class[] { ObjectInputStream.class },
- Void.TYPE);
+ Void.TYPE, true);
+ writeObjectMethod = findMethod(methods, "writeObject",
+ new Class[] { ObjectOutputStream.class },
+ Void.TYPE, true);
readResolveMethod = findMethod(methods, "readResolve",
- new Class[0], Object.class);
+ new Class[0], Object.class, false);
+ writeReplaceMethod = findMethod(methods, "writeReplace",
+ new Class[0], Object.class, false);
}
private ObjectStreamClass(Class cl)
@@ -517,20 +528,8 @@ outer:
// only set this bit if CL is NOT Externalizable
flags |= ObjectStreamConstants.SC_SERIALIZABLE;
- try
- {
- Method writeMethod = cl.getDeclaredMethod("writeObject",
- writeMethodArgTypes);
- int modifiers = writeMethod.getModifiers();
-
- if (writeMethod.getReturnType() == Void.TYPE
- && Modifier.isPrivate(modifiers)
- && !Modifier.isStatic(modifiers))
- flags |= ObjectStreamConstants.SC_WRITE_METHOD;
- }
- catch(NoSuchMethodException oh_well)
- {
- }
+ if (writeObjectMethod != null)
+ flags |= ObjectStreamConstants.SC_WRITE_METHOD;
}
@@ -851,11 +850,11 @@ outer:
{
return (Externalizable)constructor.newInstance(null);
}
- catch(Throwable t)
+ catch(Exception x)
{
throw (InvalidClassException)
new InvalidClassException(clazz.getName(),
- "Unable to instantiate").initCause(t);
+ "Unable to instantiate").initCause(x);
}
}
@@ -884,10 +883,12 @@ outer:
Method readObjectMethod;
Method readResolveMethod;
+ Method writeReplaceMethod;
+ Method writeObjectMethod;
boolean realClassIsSerializable;
boolean realClassIsExternalizable;
ObjectStreamField[] fieldMapping;
- Class firstNonSerializableParent;
+ Constructor firstNonSerializableParentConstructor;
private Constructor constructor; // default constructor for Externalizable
boolean isProxyClass = false;
@@ -896,34 +897,33 @@ outer:
// but it will avoid showing up as a discrepancy when comparing SUIDs.
private static final long serialVersionUID = -6120832682080437368L;
-}
-
-// interfaces are compared only by name
-class InterfaceComparator implements Comparator
-{
- public int compare(Object o1, Object o2)
+ // interfaces are compared only by name
+ private static final class InterfaceComparator implements Comparator
{
- return ((Class) o1).getName().compareTo(((Class) o2).getName());
+ public int compare(Object o1, Object o2)
+ {
+ return ((Class) o1).getName().compareTo(((Class) o2).getName());
+ }
}
-}
-// Members (Methods and Constructors) are compared first by name,
-// conflicts are resolved by comparing type signatures
-class MemberComparator implements Comparator
-{
- public int compare(Object o1, Object o2)
+ // Members (Methods and Constructors) are compared first by name,
+ // conflicts are resolved by comparing type signatures
+ private static final class MemberComparator implements Comparator
{
- Member m1 = (Member) o1;
- Member m2 = (Member) o2;
+ public int compare(Object o1, Object o2)
+ {
+ Member m1 = (Member) o1;
+ Member m2 = (Member) o2;
- int comp = m1.getName().compareTo(m2.getName());
+ int comp = m1.getName().compareTo(m2.getName());
- if (comp == 0)
- return TypeSignature.getEncodingOfMember(m1).
- compareTo(TypeSignature.getEncodingOfMember(m2));
- else
- return comp;
+ if (comp == 0)
+ return TypeSignature.getEncodingOfMember(m1).
+ compareTo(TypeSignature.getEncodingOfMember(m2));
+ else
+ return comp;
+ }
}
}
diff --git a/libjava/java/io/ObjectStreamException.java b/libjava/java/io/ObjectStreamException.java
index da1ca46e662..fa2c78021c2 100644
--- a/libjava/java/io/ObjectStreamException.java
+++ b/libjava/java/io/ObjectStreamException.java
@@ -1,5 +1,5 @@
/* ObjectStreamException.java -- Superclass of all serialization exceptions
- Copyright (C) 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.io;
* indications of the precise failure.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/io/ObjectStreamField.java b/libjava/java/io/ObjectStreamField.java
index 93a121cd762..8c1a5db7b59 100644
--- a/libjava/java/io/ObjectStreamField.java
+++ b/libjava/java/io/ObjectStreamField.java
@@ -367,109 +367,46 @@ public class ObjectStreamField implements Comparable
final void setBooleanField(Object obj, boolean val)
{
- try
- {
- field.setBoolean(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setBooleanNative(field, obj, val);
}
final void setByteField(Object obj, byte val)
{
- try
- {
- field.setByte(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setByteNative(field, obj, val);
}
final void setCharField(Object obj, char val)
{
- try
- {
- field.setChar(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setCharNative(field, obj, val);
}
final void setShortField(Object obj, short val)
{
- try
- {
- field.setShort(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setShortNative(field, obj, val);
}
final void setIntField(Object obj, int val)
{
- try
- {
- field.setInt(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setIntNative(field, obj, val);
}
final void setLongField(Object obj, long val)
{
- try
- {
- field.setLong(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setLongNative(field, obj, val);
}
final void setFloatField(Object obj, float val)
{
- try
- {
- field.setFloat(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setFloatNative(field, obj, val);
}
final void setDoubleField(Object obj, double val)
{
- try
- {
- field.setDouble(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setDoubleNative(field, obj, val);
}
final void setObjectField(Object obj, Object val)
{
- try
- {
- field.set(obj, val);
- }
- catch(IllegalAccessException x)
- {
- throw new InternalError(x.getMessage());
- }
+ VMObjectStreamClass.setObjectNative(field, obj, val);
}
}
diff --git a/libjava/java/io/OptionalDataException.java b/libjava/java/io/OptionalDataException.java
index 919c2bf0f4d..858302c0486 100644
--- a/libjava/java/io/OptionalDataException.java
+++ b/libjava/java/io/OptionalDataException.java
@@ -1,5 +1,5 @@
/* OptionalDataException.java -- indicates unexpected data in serialized stream
- Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ package java.io;
* </ul>
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/io/OutputStream.java b/libjava/java/io/OutputStream.java
index cee98644b0f..2b1a90a7508 100644
--- a/libjava/java/io/OutputStream.java
+++ b/libjava/java/io/OutputStream.java
@@ -1,5 +1,5 @@
/* OutputStream.java -- Base class for byte output streams
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.io;
* destination such as a file on disk or network connection.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public abstract class OutputStream
{
diff --git a/libjava/java/io/OutputStreamWriter.java b/libjava/java/io/OutputStreamWriter.java
index a07470a7291..07050415aba 100644
--- a/libjava/java/io/OutputStreamWriter.java
+++ b/libjava/java/io/OutputStreamWriter.java
@@ -1,5 +1,5 @@
/* OutputStreamWriter.java -- Writer that converts chars to bytes
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -70,7 +70,7 @@ import gnu.gcj.convert.UnicodeToBytes;
* </ul>
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @date April 17, 1998.
*/
public class OutputStreamWriter extends Writer
diff --git a/libjava/java/io/PrintStream.java b/libjava/java/io/PrintStream.java
index 3526473a4fd..02a126b000f 100644
--- a/libjava/java/io/PrintStream.java
+++ b/libjava/java/io/PrintStream.java
@@ -1,5 +1,5 @@
/* PrintStream.java -- OutputStream for printing output
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,8 +55,8 @@ import gnu.gcj.convert.UnicodeToBytes;
* <p>
* This class converts char's into byte's using the system default encoding.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class PrintStream extends FilterOutputStream
{
diff --git a/libjava/java/io/PrintWriter.java b/libjava/java/io/PrintWriter.java
index 376b3c44e7b..e03f2f85a87 100644
--- a/libjava/java/io/PrintWriter.java
+++ b/libjava/java/io/PrintWriter.java
@@ -54,8 +54,8 @@ package java.io;
* class which also auto-flushes when it encounters a newline character
* in the chars written).
*
- * @author Per Bothner <bothner@cygnus.com>
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Per Bothner (bothner@cygnus.com)
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @date April 17, 1998.
*/
public class PrintWriter extends Writer
diff --git a/libjava/java/io/PushbackInputStream.java b/libjava/java/io/PushbackInputStream.java
index c07714ec61c..aedd7eb65ee 100644
--- a/libjava/java/io/PushbackInputStream.java
+++ b/libjava/java/io/PushbackInputStream.java
@@ -1,5 +1,5 @@
/* PushbackInputStream.java -- An input stream that can unread bytes
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ package java.io;
* <p>
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class PushbackInputStream extends FilterInputStream
{
diff --git a/libjava/java/io/PushbackReader.java b/libjava/java/io/PushbackReader.java
index cc2473a6c34..05f343ed9aa 100644
--- a/libjava/java/io/PushbackReader.java
+++ b/libjava/java/io/PushbackReader.java
@@ -1,5 +1,5 @@
/* PushbackReader.java -- An character stream that can unread chars
- Copyright (C) 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ package java.io;
* by the creator of the stream.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class PushbackReader extends FilterReader
{
diff --git a/libjava/java/io/RandomAccessFile.java b/libjava/java/io/RandomAccessFile.java
index 2b1e08599e8..c23ca3adf2e 100644
--- a/libjava/java/io/RandomAccessFile.java
+++ b/libjava/java/io/RandomAccessFile.java
@@ -1,5 +1,5 @@
/* RandomAccessFile.java -- Class supporting random file I/O
- Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,8 +55,8 @@ import java.nio.channels.FileChannel;
* <code>DataInput</code> and <code>DataOutput</code> interfaces to allow
* the reading and writing of Java primitives.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class RandomAccessFile implements DataOutput, DataInput
{
diff --git a/libjava/java/io/Reader.java b/libjava/java/io/Reader.java
index 18481ac697b..bb4494b431a 100644
--- a/libjava/java/io/Reader.java
+++ b/libjava/java/io/Reader.java
@@ -49,7 +49,7 @@ package java.io;
* methods to read characters from a particular input source such as a file
* or network connection.
*
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @date April 21, 1998.
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
diff --git a/libjava/java/io/SequenceInputStream.java b/libjava/java/io/SequenceInputStream.java
index e7b2f494c2a..a46b11d56aa 100644
--- a/libjava/java/io/SequenceInputStream.java
+++ b/libjava/java/io/SequenceInputStream.java
@@ -1,5 +1,5 @@
/* SequenceInputStream.java -- Reads multiple input streams in sequence
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ import java.util.Enumeration;
* to completion, all subordinate streams are closed.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class SequenceInputStream extends InputStream
{
diff --git a/libjava/java/io/Serializable.java b/libjava/java/io/Serializable.java
index b6c47c4ccbd..1ca6638c874 100644
--- a/libjava/java/io/Serializable.java
+++ b/libjava/java/io/Serializable.java
@@ -1,5 +1,5 @@
/* Serializable.java -- Interface to indicate a class may be serialized
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,9 +47,8 @@ package java.io;
* the implementing class may be serialized.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public interface Serializable
{
- long serialVersionUID = 1196656838076753133L;
} // interface Serializable
diff --git a/libjava/java/io/StreamCorruptedException.java b/libjava/java/io/StreamCorruptedException.java
index 004047fb654..86002cbe8a6 100644
--- a/libjava/java/io/StreamCorruptedException.java
+++ b/libjava/java/io/StreamCorruptedException.java
@@ -1,5 +1,5 @@
/* StreamCorruptedException.java -- Error in stream during serialization
- Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.io;
* read from a stream during de-serialization.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/io/StreamTokenizer.java b/libjava/java/io/StreamTokenizer.java
index dd6acb3fd36..b5bd38f2d78 100644
--- a/libjava/java/io/StreamTokenizer.java
+++ b/libjava/java/io/StreamTokenizer.java
@@ -42,7 +42,7 @@ package java.io;
* million-zillion flags that can be set to control the parsing, as
* described under the various method headings.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @date October 25, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
diff --git a/libjava/java/io/StringBufferInputStream.java b/libjava/java/io/StringBufferInputStream.java
index 96dc4a382f3..4ed9a9f7190 100644
--- a/libjava/java/io/StringBufferInputStream.java
+++ b/libjava/java/io/StringBufferInputStream.java
@@ -1,5 +1,5 @@
/* StringBufferInputStream.java -- Read an String as a stream
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -65,7 +65,7 @@ package java.io;
* @deprecated
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
*/
public class StringBufferInputStream extends InputStream
{
diff --git a/libjava/java/io/StringWriter.java b/libjava/java/io/StringWriter.java
index c5aab8d157c..7b6e14193cd 100644
--- a/libjava/java/io/StringWriter.java
+++ b/libjava/java/io/StringWriter.java
@@ -1,5 +1,5 @@
/* StringWriter.java -- Writes bytes to a StringBuffer
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.io;
* can then be used to retrieve a <code>String</code>.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public class StringWriter extends Writer
{
diff --git a/libjava/java/io/SyncFailedException.java b/libjava/java/io/SyncFailedException.java
index a896ffb5e43..5563268ffd5 100644
--- a/libjava/java/io/SyncFailedException.java
+++ b/libjava/java/io/SyncFailedException.java
@@ -1,5 +1,5 @@
/* SyncFailedException.java -- a file sync failed
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.io;
* Thrown when a file synchronization fails.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see FileDescriptor#sync()
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/io/UTFDataFormatException.java b/libjava/java/io/UTFDataFormatException.java
index a38e25179f5..d4f2df253e4 100644
--- a/libjava/java/io/UTFDataFormatException.java
+++ b/libjava/java/io/UTFDataFormatException.java
@@ -1,5 +1,5 @@
/* UTFDataFormatException.java -- thrown on bad format in UTF data
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.io;
* to indicate that the data read is invalid.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see DataInput
* @see DataInputStream#readUTF(DataInput)
* @status updated to 1.4
diff --git a/libjava/java/io/UnsupportedEncodingException.java b/libjava/java/io/UnsupportedEncodingException.java
index 8ee686bde03..5159fb2b246 100644
--- a/libjava/java/io/UnsupportedEncodingException.java
+++ b/libjava/java/io/UnsupportedEncodingException.java
@@ -1,5 +1,5 @@
/* UnsupportedEncodingException.java -- the requested encoding isn't supported
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.io;
* not supported.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/io/VMObjectStreamClass.java b/libjava/java/io/VMObjectStreamClass.java
index fd4023e402b..d21de72a130 100644
--- a/libjava/java/io/VMObjectStreamClass.java
+++ b/libjava/java/io/VMObjectStreamClass.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.io;
-import java.lang.reflect.Method;
+import java.lang.reflect.Field;
final class VMObjectStreamClass
{
@@ -47,4 +47,94 @@ final class VMObjectStreamClass
* (a.k.a. <clinit>).
*/
static native boolean hasClassInitializer (Class clazz);
+
+ /**
+ * Sets the value of the specified "double" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setDoubleNative(Field field, Object obj, double val);
+
+ /**
+ * Sets the value of the specified "float" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setFloatNative(Field field, Object obj, float val);
+
+ /**
+ * Sets the value of the specified "long" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setLongNative(Field field, Object obj, long val);
+
+ /**
+ * Sets the value of the specified "int" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setIntNative(Field field, Object obj, int val);
+
+ /**
+ * Sets the value of the specified "short" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setShortNative(Field field, Object obj, short val);
+
+ /**
+ * Sets the value of the specified "char" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setCharNative(Field field, Object obj, char val);
+
+ /**
+ * Sets the value of the specified "byte" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setByteNative(Field field, Object obj, byte val);
+
+ /**
+ * Sets the value of the specified "boolean" field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setBooleanNative(Field field, Object obj, boolean val);
+
+ /**
+ * Sets the value of the specified object field, allowing final values
+ * to be assigned.
+ *
+ * @param field Field to set the value.
+ * @param obj Instance which will have its field set.
+ * @param val Value to put in the field.
+ */
+ static native void setObjectNative(Field field, Object obj, Object val);
}
diff --git a/libjava/java/io/WriteAbortedException.java b/libjava/java/io/WriteAbortedException.java
index 7b683854d3d..a7787805f30 100644
--- a/libjava/java/io/WriteAbortedException.java
+++ b/libjava/java/io/WriteAbortedException.java
@@ -1,5 +1,5 @@
/* WriteAbortedException.java -- wraps an exception thrown while writing
- Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.io;
* objects are discarded.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/io/Writer.java b/libjava/java/io/Writer.java
index 49b6315231e..4a69030a5e2 100644
--- a/libjava/java/io/Writer.java
+++ b/libjava/java/io/Writer.java
@@ -1,5 +1,5 @@
/* Writer.java -- Base class for character output streams
- Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ package java.io;
* destination such as a file on disk or network connection.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
*/
public abstract class Writer
{
diff --git a/libjava/java/io/natObjectInputStream.cc b/libjava/java/io/natObjectInputStream.cc
index 9da4910aa06..0e0d5a719cc 100644
--- a/libjava/java/io/natObjectInputStream.cc
+++ b/libjava/java/io/natObjectInputStream.cc
@@ -12,6 +12,7 @@ details. */
#include <gcj/cni.h>
#include <jvm.h>
+#include <gcj/method.h>
#include <java/io/ObjectInputStream$GetField.h>
#include <java/io/ObjectInputStream.h>
@@ -21,6 +22,8 @@ details. */
#include <java/lang/reflect/Method.h>
#include <java/lang/ArrayIndexOutOfBoundsException.h>
#include <java/lang/SecurityManager.h>
+#include <java/lang/reflect/Constructor.h>
+#include <java/lang/reflect/Method.h>
#ifdef DEBUG
#include <java/lang/System.h>
@@ -28,7 +31,8 @@ details. */
#endif
jobject
-java::io::ObjectInputStream::allocateObject (jclass klass)
+java::io::ObjectInputStream::allocateObject (jclass klass, jclass,
+ ::java::lang::reflect::Constructor *ctr)
{
jobject obj = NULL;
using namespace java::lang::reflect;
@@ -41,21 +45,15 @@ java::io::ObjectInputStream::allocateObject (jclass klass)
else
{
obj = _Jv_AllocObject (klass);
- }
+ }
}
catch (jthrowable t)
{
return NULL;
}
- return obj;
-}
-
+ jmethodID meth = _Jv_FromReflectedConstructor (ctr);
-void
-java::io::ObjectInputStream::callConstructor (jclass klass, jobject obj)
-{
- jstring init_name = JvNewStringLatin1 ("<init>");
// This is a bit inefficient, and a bit of a hack, since we don't
// actually use the Method and since what is returned isn't
// technically a Method. We can't use Method.invoke as it looks up
@@ -63,36 +61,12 @@ java::io::ObjectInputStream::callConstructor (jclass klass, jobject obj)
JArray<jclass> *arg_types
= (JArray<jclass> *) JvNewObjectArray (0, &java::lang::Class::class$,
NULL);
- java::lang::reflect::Method *m = klass->getPrivateMethod (init_name,
- arg_types);
+
// We lie about this being a constructor. If we put `true' here
// then _Jv_CallAnyMethodA would try to allocate the object for us.
- jmethodID meth = (jmethodID) ((char *) (klass->methods)
- + m->offset);
_Jv_CallAnyMethodA (obj, JvPrimClass (void), meth, false, arg_types, NULL);
-}
-java::lang::ClassLoader*
-java::io::ObjectInputStream::getCallersClassLoader ()
-{
- java::lang::ClassLoader *loader = NULL;
- gnu::gcj::runtime::StackTrace *t
- = new gnu::gcj::runtime::StackTrace(4);
- java::lang::Class *klass = NULL;
- try
- {
- for (int i = 2; !klass; i++)
- {
- klass = t->classAt (i);
- }
- loader = klass->getClassLoaderInternal();
- }
- catch (::java::lang::ArrayIndexOutOfBoundsException *e)
- {
- // FIXME: RuntimeError
- }
-
- return loader;
+ return obj;
}
java::lang::ClassLoader*
diff --git a/libjava/java/io/natVMObjectStreamClass.cc b/libjava/java/io/natVMObjectStreamClass.cc
index b7a056c457f..847b540f0be 100644
--- a/libjava/java/io/natVMObjectStreamClass.cc
+++ b/libjava/java/io/natVMObjectStreamClass.cc
@@ -13,11 +13,75 @@ details. */
#include <java/io/VMObjectStreamClass.h>
#include <java/lang/Class.h>
+#include <java/lang/reflect/Field.h>
+
+using namespace java::lang::reflect;
jboolean
java::io::VMObjectStreamClass::hasClassInitializer (jclass klass)
{
+ if (klass->isPrimitive())
+ return false;
_Jv_Method *meth = _Jv_GetMethodLocal(klass, gcj::clinit_name,
gcj::void_signature);
return (meth != NULL);
}
+
+void
+java::io::VMObjectStreamClass::setDoubleNative (Field *f, jobject obj,
+ jdouble val)
+{
+ f->setDouble (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setFloatNative (Field *f, jobject obj,
+ jfloat val)
+{
+ f->setFloat (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setLongNative (Field *f, jobject obj, jlong val)
+{
+ f->setLong (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setIntNative (Field *f, jobject obj, jint val)
+{
+ f->setInt (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setShortNative (Field *f, jobject obj,
+ jshort val)
+{
+ f->setShort (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setCharNative (Field *f, jobject obj, jchar val)
+{
+ f->setChar (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setByteNative (Field *f, jobject obj, jbyte val)
+{
+ f->setByte (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setBooleanNative (Field *f, jobject obj,
+ jboolean val)
+{
+ f->setBoolean (NULL, obj, val, false);
+}
+
+void
+java::io::VMObjectStreamClass::setObjectNative (Field *f, jobject obj,
+ jobject val)
+{
+ f->set (NULL, obj, val, f->getType(), false);
+}
diff --git a/libjava/java/lang/AbstractMethodError.java b/libjava/java/lang/AbstractMethodError.java
index df961864a67..8fd20d3c0cf 100644
--- a/libjava/java/lang/AbstractMethodError.java
+++ b/libjava/java/lang/AbstractMethodError.java
@@ -1,5 +1,5 @@
/* AbstractMethodError.java -- thrown if an abstract method is invoked
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.lang;
* reflecting on methods.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class AbstractMethodError extends IncompatibleClassChangeError
diff --git a/libjava/java/lang/ArithmeticException.java b/libjava/java/lang/ArithmeticException.java
index de79b096ab3..7fb9c1cc4d6 100644
--- a/libjava/java/lang/ArithmeticException.java
+++ b/libjava/java/lang/ArithmeticException.java
@@ -1,6 +1,6 @@
/* ArithmeticException.java -- exception thrown to indicate conditions
like divide by zero.
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class ArithmeticException extends RuntimeException
diff --git a/libjava/java/lang/ArrayIndexOutOfBoundsException.java b/libjava/java/lang/ArrayIndexOutOfBoundsException.java
index 1a6db8daf04..abc6d1d607f 100644
--- a/libjava/java/lang/ArrayIndexOutOfBoundsException.java
+++ b/libjava/java/lang/ArrayIndexOutOfBoundsException.java
@@ -1,6 +1,6 @@
/* ArrayIndexOutOfBoundsException.java -- exception thrown when accessing
an illegal index.
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException
diff --git a/libjava/java/lang/ArrayStoreException.java b/libjava/java/lang/ArrayStoreException.java
index 3fa714d2ef4..00a084ec115 100644
--- a/libjava/java/lang/ArrayStoreException.java
+++ b/libjava/java/lang/ArrayStoreException.java
@@ -1,6 +1,6 @@
/* ArrayStoreException.java -- exception thrown to when trying to store an
object into an array of a different type.
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class ArrayStoreException extends RuntimeException
diff --git a/libjava/java/lang/AssertionError.java b/libjava/java/lang/AssertionError.java
index 2bbf81cac97..8851be1d30f 100644
--- a/libjava/java/lang/AssertionError.java
+++ b/libjava/java/lang/AssertionError.java
@@ -1,5 +1,5 @@
/* AssertionError.java -- indication of a failed assertion
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.lang;
* the string <code>"" + <em>expression</em></code>. This extends Error,
* because you usually do not want to inadvertently trap an assertion failure.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/Boolean.java b/libjava/java/lang/Boolean.java
index 3c09a1505c1..a30b669df1a 100644
--- a/libjava/java/lang/Boolean.java
+++ b/libjava/java/lang/Boolean.java
@@ -1,5 +1,5 @@
/* Boolean.java -- object wrapper for boolean
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.io.Serializable;
* <code>boolean</code> values.
*
* @author Paul Fisher
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/Byte.java b/libjava/java/lang/Byte.java
index 641c5cc8ee1..e59ac598aed 100644
--- a/libjava/java/lang/Byte.java
+++ b/libjava/java/lang/Byte.java
@@ -1,5 +1,5 @@
/* Byte.java -- object wrapper for byte
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* @author Paul Fisher
* @author John Keiser
* @author Per Bothner
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h
index 4e061cee574..d7b21e76b05 100644
--- a/libjava/java/lang/Class.h
+++ b/libjava/java/lang/Class.h
@@ -212,6 +212,7 @@ class java::io::ObjectStreamClass;
void _Jv_RegisterClassHookDefault (jclass klass);
void _Jv_RegisterInitiatingLoader (jclass,java::lang::ClassLoader*);
+void _Jv_UnregisterInitiatingLoader (jclass,java::lang::ClassLoader*);
void _Jv_UnregisterClass (jclass);
jclass _Jv_FindClass (_Jv_Utf8Const *name,
java::lang::ClassLoader *loader);
@@ -227,7 +228,7 @@ void _Jv_InitNewClassFields (jclass klass);
// Friend functions and classes in prims.cc
void _Jv_InitPrimClass (jclass, char *, char, int);
-jstring _Jv_GetMethodString (jclass, _Jv_Utf8Const *);
+jstring _Jv_GetMethodString (jclass, _Jv_Method *, jclass = NULL);
jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
jint flags);
@@ -436,6 +437,7 @@ private:
size_t count);
friend void ::_Jv_RegisterClassHookDefault (jclass klass);
friend void ::_Jv_RegisterInitiatingLoader (jclass,java::lang::ClassLoader*);
+ friend void ::_Jv_UnregisterInitiatingLoader (jclass,java::lang::ClassLoader*);
friend void ::_Jv_UnregisterClass (jclass);
friend jclass (::_Jv_FindClass) (_Jv_Utf8Const *name,
java::lang::ClassLoader *loader);
@@ -452,7 +454,7 @@ private:
// in prims.cc
friend void ::_Jv_InitPrimClass (jclass, char *, char, int);
- friend jstring (::_Jv_GetMethodString) (jclass, _Jv_Utf8Const *);
+ friend jstring (::_Jv_GetMethodString) (jclass, _Jv_Method *, jclass);
friend jboolean (::_Jv_CheckAccess) (jclass self_klass, jclass other_klass,
jint flags);
diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java
index 6a65482f637..bf11861985d 100644
--- a/libjava/java/lang/Class.java
+++ b/libjava/java/lang/Class.java
@@ -71,8 +71,8 @@ import java.util.HashSet;
* see {@link ObjectStreamClass}.
*
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Tom Tromey (tromey@cygnus.com)
* @since 1.0
* @see ClassLoader
*/
diff --git a/libjava/java/lang/ClassCastException.java b/libjava/java/lang/ClassCastException.java
index b552b23fbdb..49c5262222d 100644
--- a/libjava/java/lang/ClassCastException.java
+++ b/libjava/java/lang/ClassCastException.java
@@ -1,5 +1,5 @@
/* ClassCastException.java -- exception thrown on bad cast
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class ClassCastException extends RuntimeException
diff --git a/libjava/java/lang/ClassCircularityError.java b/libjava/java/lang/ClassCircularityError.java
index 8016eadb868..fb93327eb1d 100644
--- a/libjava/java/lang/ClassCircularityError.java
+++ b/libjava/java/lang/ClassCircularityError.java
@@ -1,5 +1,5 @@
/* ClassCircularityError.java -- thrown when linking circular classes
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* incompatible versions of class files, as the compiler normally catches this.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class ClassCircularityError extends LinkageError
diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java
index 71f41c1cf1b..2621281273f 100644
--- a/libjava/java/lang/ClassLoader.java
+++ b/libjava/java/lang/ClassLoader.java
@@ -109,7 +109,7 @@ import java.util.Map;
*
* @author John Keiser
* @author Mark Wielaard
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Class
* @since 1.0
* @status still missing 1.4 functionality
@@ -288,8 +288,6 @@ public abstract class ClassLoader
if (c != null)
return c;
- ClassNotFoundException ex = null;
-
// Can the class be loaded by a parent?
try
{
@@ -306,20 +304,9 @@ public abstract class ClassLoader
}
catch (ClassNotFoundException e)
{
- ex = e;
}
// Still not found, we have to do it ourself.
- try
- {
- c = findClass(name);
- }
- catch (ClassNotFoundException cause)
- {
- if (ex != null)
- throw new ClassNotFoundException(ex.toString(), cause);
- else
- throw cause;
- }
+ c = findClass(name);
if (resolve)
resolveClass(c);
return c;
diff --git a/libjava/java/lang/ClassNotFoundException.java b/libjava/java/lang/ClassNotFoundException.java
index cb546602e56..cfa03f59647 100644
--- a/libjava/java/lang/ClassNotFoundException.java
+++ b/libjava/java/lang/ClassNotFoundException.java
@@ -1,5 +1,5 @@
/* ClassNotFoundException.java -- thrown when class definition cannot be found
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.lang;
* cannot be found. This exception is often chained from another Throwable.
*
* @author Brian Jones
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Class#forName(String)
* @see ClassLoader#findSystemClass(String)
* @see ClassLoader#loadClass(String, boolean)
diff --git a/libjava/java/lang/CloneNotSupportedException.java b/libjava/java/lang/CloneNotSupportedException.java
index e13112ac350..488e9154c3a 100644
--- a/libjava/java/lang/CloneNotSupportedException.java
+++ b/libjava/java/lang/CloneNotSupportedException.java
@@ -1,5 +1,5 @@
/* CloneNotSupportedException.java -- thrown when an object cannot be cloned
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,8 +60,8 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Cloneable
* @see Object#clone()
* @status updated to 1.4
diff --git a/libjava/java/lang/Cloneable.java b/libjava/java/lang/Cloneable.java
index 64c7faf4863..0a8243ea21f 100644
--- a/libjava/java/lang/Cloneable.java
+++ b/libjava/java/lang/Cloneable.java
@@ -1,5 +1,5 @@
/* Cloneable.java -- Interface for marking objects cloneable by Object.clone()
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -65,8 +65,8 @@ package java.lang;
* <code>CloneNotSupportedException</code>.
*
* @author Paul Fisher
- * @author Eric Blake <ebb9@email.byu.edu>
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Warren Levy (warrenl@cygnus.com)
* @see Object#clone()
* @see CloneNotSupportedException
* @since 1.0
diff --git a/libjava/java/lang/Comparable.java b/libjava/java/lang/Comparable.java
index bfe72dbcb11..4ffec6056ca 100644
--- a/libjava/java/lang/Comparable.java
+++ b/libjava/java/lang/Comparable.java
@@ -1,5 +1,5 @@
/* Comparable.java -- Interface for comparaing objects to obtain an ordering
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ package java.lang;
* classes.
*
* @author Geoff Berry
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see java.util.Comparator
* @see java.util.Collections#sort(java.util.List)
* @see java.util.Arrays#sort(Object[])
diff --git a/libjava/java/lang/Compiler.java b/libjava/java/lang/Compiler.java
index 858f63ee993..1179f79faff 100644
--- a/libjava/java/lang/Compiler.java
+++ b/libjava/java/lang/Compiler.java
@@ -1,5 +1,5 @@
/* Compiler.java -- placeholder for Java-to-native runtime compilers
- Copyright (C) 1998, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ package java.lang;
*
* <p>Note that a VM might not have implemented any of this.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see System#getProperty(String)
* @see System#getProperty(String, String)
* @see System#loadLibrary(String)
diff --git a/libjava/java/lang/Double.java b/libjava/java/lang/Double.java
index be393b6b4b9..81985f04e05 100644
--- a/libjava/java/lang/Double.java
+++ b/libjava/java/lang/Double.java
@@ -1,5 +1,5 @@
/* Double.java -- object wrapper for double
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,8 +48,8 @@ import gnu.classpath.Configuration;
* related to doubles.
*
* @author Paul Fisher
- * @author Andrew Haley <aph@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Andrew Haley (aph@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/Error.java b/libjava/java/lang/Error.java
index 8bb42dc887c..fc1d6227861 100644
--- a/libjava/java/lang/Error.java
+++ b/libjava/java/lang/Error.java
@@ -1,5 +1,5 @@
/* Error.java -- Indication of fatal abnormal conditions
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,8 +49,8 @@ package java.lang;
* executing the method.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/Exception.java b/libjava/java/lang/Exception.java
index edf5de228c8..68a7dcb2d2b 100644
--- a/libjava/java/lang/Exception.java
+++ b/libjava/java/lang/Exception.java
@@ -1,6 +1,6 @@
/* Exception.java -- generic exception thrown to indicate an exceptional
condition has occurred.
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,8 +47,8 @@ package java.lang;
* mouse movements, keyboard clicking, etc.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
public class Exception extends Throwable
diff --git a/libjava/java/lang/ExceptionInInitializerError.java b/libjava/java/lang/ExceptionInInitializerError.java
index d04bdc010d7..966a9f3acee 100644
--- a/libjava/java/lang/ExceptionInInitializerError.java
+++ b/libjava/java/lang/ExceptionInInitializerError.java
@@ -1,6 +1,6 @@
/* ExceptionInInitializerError.java -- thrown when class initialization fails
with an uncaught exception
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,8 +48,8 @@ package java.lang;
* is initialized as part of another action.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/Float.java b/libjava/java/lang/Float.java
index d59912168da..0fa3547a77b 100644
--- a/libjava/java/lang/Float.java
+++ b/libjava/java/lang/Float.java
@@ -1,5 +1,5 @@
/* Float.java -- object wrapper for float
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,8 +47,8 @@ package java.lang;
* related to floats.
*
* @author Paul Fisher
- * @author Andrew Haley <aph@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Andrew Haley (aph@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/IllegalAccessError.java b/libjava/java/lang/IllegalAccessError.java
index a5c384e77fe..a45efd1633b 100644
--- a/libjava/java/lang/IllegalAccessError.java
+++ b/libjava/java/lang/IllegalAccessError.java
@@ -1,5 +1,5 @@
/* IllegalAccessError.java -- thrown when linking to an inaccessible member
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.lang;
* application.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class IllegalAccessError extends IncompatibleClassChangeError
diff --git a/libjava/java/lang/IllegalAccessException.java b/libjava/java/lang/IllegalAccessException.java
index f6fc8f67e91..f1ac3b0a32e 100644
--- a/libjava/java/lang/IllegalAccessException.java
+++ b/libjava/java/lang/IllegalAccessException.java
@@ -1,6 +1,6 @@
/* IllegalAccessException.java -- thrown on attempt to reflect on
inaccessible data
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.lang;
* variable that belongs to a class in another package is bad.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see Class#newInstance()
* @see Field#set(Object, Object)
* @see Field#setBoolean(Object, boolean)
diff --git a/libjava/java/lang/IllegalArgumentException.java b/libjava/java/lang/IllegalArgumentException.java
index deb6735c899..d0120135ca1 100644
--- a/libjava/java/lang/IllegalArgumentException.java
+++ b/libjava/java/lang/IllegalArgumentException.java
@@ -1,6 +1,6 @@
/* IllegalArgumentException.java -- thrown when a method is passed an
illegal or inappropriate argument
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class IllegalArgumentException extends RuntimeException
diff --git a/libjava/java/lang/IllegalMonitorStateException.java b/libjava/java/lang/IllegalMonitorStateException.java
index 08e1ba7a1ea..7461942ccd7 100644
--- a/libjava/java/lang/IllegalMonitorStateException.java
+++ b/libjava/java/lang/IllegalMonitorStateException.java
@@ -1,6 +1,6 @@
/* IllegalMonitorStateException.java -- thrown when trying to wait or
notify a monitor that is not owned
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class IllegalMonitorStateException extends RuntimeException
diff --git a/libjava/java/lang/IllegalStateException.java b/libjava/java/lang/IllegalStateException.java
index 16dcf1a80c8..f39ea539cc1 100644
--- a/libjava/java/lang/IllegalStateException.java
+++ b/libjava/java/lang/IllegalStateException.java
@@ -1,6 +1,6 @@
/* IllegalStateException.java -- thrown when invoking a method at
an illegal or inappropriate time
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/IllegalThreadStateException.java b/libjava/java/lang/IllegalThreadStateException.java
index bcc188e1a66..d7e0a2ba49b 100644
--- a/libjava/java/lang/IllegalThreadStateException.java
+++ b/libjava/java/lang/IllegalThreadStateException.java
@@ -1,6 +1,6 @@
/* IllegalThreadStateException.java -- thrown when trying to manipulate a
Thread when it is not in an appropriate state
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.lang;
* two methods are deprecated, this exception is likely very rare.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class IllegalThreadStateException extends IllegalArgumentException
diff --git a/libjava/java/lang/IncompatibleClassChangeError.java b/libjava/java/lang/IncompatibleClassChangeError.java
index 7f569fdc36d..7885a2542e6 100644
--- a/libjava/java/lang/IncompatibleClassChangeError.java
+++ b/libjava/java/lang/IncompatibleClassChangeError.java
@@ -1,5 +1,5 @@
/* IncompatibleClassChangeError.java -- thrown for binary incompatible classes
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* incompatible way.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class IncompatibleClassChangeError extends LinkageError
diff --git a/libjava/java/lang/IndexOutOfBoundsException.java b/libjava/java/lang/IndexOutOfBoundsException.java
index 336f87219a3..4886f01da9d 100644
--- a/libjava/java/lang/IndexOutOfBoundsException.java
+++ b/libjava/java/lang/IndexOutOfBoundsException.java
@@ -1,5 +1,5 @@
/* IndexOutOfBoundsException.java -- thrown for an invalid index
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.lang;
* which would be out of bounds.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class IndexOutOfBoundsException extends RuntimeException
diff --git a/libjava/java/lang/InheritableThreadLocal.java b/libjava/java/lang/InheritableThreadLocal.java
index 5dfbe9a6230..43810f80e87 100644
--- a/libjava/java/lang/InheritableThreadLocal.java
+++ b/libjava/java/lang/InheritableThreadLocal.java
@@ -1,5 +1,5 @@
/* InheritableThreadLocal -- a ThreadLocal which inherits values across threads
- Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,8 +55,8 @@ import java.util.WeakHashMap;
* is in transferring items like User ID or Transaction ID across threads
* automatically.
*
- * @author Mark Wielaard <mark@klomp.org>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Mark Wielaard (mark@klomp.org)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see ThreadLocal
* @since 1.2
* @status updated to 1.4
diff --git a/libjava/java/lang/InstantiationError.java b/libjava/java/lang/InstantiationError.java
index 54aa7b36609..3d2750ce8a3 100644
--- a/libjava/java/lang/InstantiationError.java
+++ b/libjava/java/lang/InstantiationError.java
@@ -1,5 +1,5 @@
/* InstantiationError.java -- thrown when the linker cannot create an instance
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.lang;
* with the previously compiled application.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class InstantiationError extends IncompatibleClassChangeError
diff --git a/libjava/java/lang/InstantiationException.java b/libjava/java/lang/InstantiationException.java
index 511481418c4..4aa4bd077ca 100644
--- a/libjava/java/lang/InstantiationException.java
+++ b/libjava/java/lang/InstantiationException.java
@@ -1,6 +1,6 @@
/* InstantiationException.java -- thrown when reflection cannot create an
instance
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* non-instantiable class (an interface or abstract class).
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see Class#newInstance()
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/Integer.java b/libjava/java/lang/Integer.java
index 9c8329dbd83..eddaea2292a 100644
--- a/libjava/java/lang/Integer.java
+++ b/libjava/java/lang/Integer.java
@@ -1,5 +1,5 @@
/* Integer.java -- object wrapper for int
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* @author Paul Fisher
* @author John Keiser
* @author Warren Levy
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/InternalError.java b/libjava/java/lang/InternalError.java
index d85aed11817..d612d092fa2 100644
--- a/libjava/java/lang/InternalError.java
+++ b/libjava/java/lang/InternalError.java
@@ -1,5 +1,5 @@
/* InternalError.java -- thrown when the VM encounters an internal error
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.lang;
* occurred in the Java Virtual Machine.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class InternalError extends VirtualMachineError
diff --git a/libjava/java/lang/InterruptedException.java b/libjava/java/lang/InterruptedException.java
index 2ee7867f610..58951abc46d 100644
--- a/libjava/java/lang/InterruptedException.java
+++ b/libjava/java/lang/InterruptedException.java
@@ -1,5 +1,5 @@
/* InterruptedException.java -- thrown when a thread is interrupted
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* <code>interrupt</code> method of class <code>Thread</code>.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see Object#wait()
* @see Object#wait(long)
* @see Object#wait(long, int)
diff --git a/libjava/java/lang/LinkageError.java b/libjava/java/lang/LinkageError.java
index 020fe0a9a7c..ead768f3756 100644
--- a/libjava/java/lang/LinkageError.java
+++ b/libjava/java/lang/LinkageError.java
@@ -1,6 +1,6 @@
/* LinkageError.java -- thrown when classes valid at separate compile times
cannot be linked to each other
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.lang;
* linked to one another.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class LinkageError extends Error
diff --git a/libjava/java/lang/Long.java b/libjava/java/lang/Long.java
index 012cc9c93e7..e93786d2571 100644
--- a/libjava/java/lang/Long.java
+++ b/libjava/java/lang/Long.java
@@ -1,5 +1,5 @@
/* Long.java -- object wrapper for long
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* @author Paul Fisher
* @author John Keiser
* @author Warren Levy
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/NegativeArraySizeException.java b/libjava/java/lang/NegativeArraySizeException.java
index ee73a97d5aa..695ee0e6e4a 100644
--- a/libjava/java/lang/NegativeArraySizeException.java
+++ b/libjava/java/lang/NegativeArraySizeException.java
@@ -1,6 +1,6 @@
/* NegativeArraySizeException.java -- thrown on attempt to create array
with a negative size
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* </pre>
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class NegativeArraySizeException extends RuntimeException
diff --git a/libjava/java/lang/NoClassDefFoundError.java b/libjava/java/lang/NoClassDefFoundError.java
index 5ca69bcaaa2..8fbdb29909c 100644
--- a/libjava/java/lang/NoClassDefFoundError.java
+++ b/libjava/java/lang/NoClassDefFoundError.java
@@ -1,5 +1,5 @@
/* NoClassDefFoundError.java -- thrown when a ClassLoader cannot find a class
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.lang;
* class was compiled, but now that definition cannot be found.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class NoClassDefFoundError extends LinkageError
diff --git a/libjava/java/lang/NoSuchFieldError.java b/libjava/java/lang/NoSuchFieldError.java
index 0a197b0c4bd..965dfd6603d 100644
--- a/libjava/java/lang/NoSuchFieldError.java
+++ b/libjava/java/lang/NoSuchFieldError.java
@@ -1,5 +1,5 @@
/* NoSuchFieldError.java -- thrown when the linker does not find a field
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.lang;
* using binary incompatible class versions.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class NoSuchFieldError extends IncompatibleClassChangeError
diff --git a/libjava/java/lang/NoSuchFieldException.java b/libjava/java/lang/NoSuchFieldException.java
index ee721ebef21..30beeefcd25 100644
--- a/libjava/java/lang/NoSuchFieldException.java
+++ b/libjava/java/lang/NoSuchFieldException.java
@@ -1,5 +1,5 @@
/* NoSuchFieldException.java -- thrown when reflecting a non-existant field
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.lang;
* caused by a variety of reflection methods, when looking up a field by name.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/NoSuchMethodError.java b/libjava/java/lang/NoSuchMethodError.java
index dced018cfe3..494f7a2713e 100644
--- a/libjava/java/lang/NoSuchMethodError.java
+++ b/libjava/java/lang/NoSuchMethodError.java
@@ -1,5 +1,5 @@
/* NoSuchMethodError.java -- thrown when the linker does not find a method
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.lang;
* using binary incompatible class versions.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class NoSuchMethodError extends IncompatibleClassChangeError
diff --git a/libjava/java/lang/NoSuchMethodException.java b/libjava/java/lang/NoSuchMethodException.java
index cba69203f7b..fa3e06e4f73 100644
--- a/libjava/java/lang/NoSuchMethodException.java
+++ b/libjava/java/lang/NoSuchMethodException.java
@@ -1,5 +1,5 @@
/* NoSuchMethodException.java -- thrown when reflecting a non-existant method
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.lang;
* caused by a variety of reflection methods, when looking up a method by name.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class NoSuchMethodException extends Exception
diff --git a/libjava/java/lang/NullPointerException.java b/libjava/java/lang/NullPointerException.java
index bab20719373..c55341cfd3c 100644
--- a/libjava/java/lang/NullPointerException.java
+++ b/libjava/java/lang/NullPointerException.java
@@ -1,5 +1,5 @@
/* NullPointerException.java -- thrown when using null instead of an object
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ package java.lang;
* <code>null</code> is an inappropriate parameter to a method.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class NullPointerException extends RuntimeException
diff --git a/libjava/java/lang/Number.java b/libjava/java/lang/Number.java
index 54bb1f763e5..70d0fe8543c 100644
--- a/libjava/java/lang/Number.java
+++ b/libjava/java/lang/Number.java
@@ -1,5 +1,5 @@
/* Number.java =- abstract superclass of numeric objects
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ import java.io.Serializable;
* @author Paul Fisher
* @author John Keiser
* @author Warren Levy
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/NumberFormatException.java b/libjava/java/lang/NumberFormatException.java
index d076cc83da9..478036ffc6c 100644
--- a/libjava/java/lang/NumberFormatException.java
+++ b/libjava/java/lang/NumberFormatException.java
@@ -1,5 +1,5 @@
/* NumberFormatException.java -- thrown when parsing a bad string as a number
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* has the wrong format.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class NumberFormatException extends IllegalArgumentException
diff --git a/libjava/java/lang/Object.h b/libjava/java/lang/Object.h
index 0842e0b291c..bf68a72399b 100644
--- a/libjava/java/lang/Object.h
+++ b/libjava/java/lang/Object.h
@@ -1,6 +1,6 @@
// Object.h - Header file for java.lang.Object. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000, 2001, 2004 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -15,6 +15,8 @@ details. */
#include <gcj/javaprims.h>
+extern "Java"
+{
// This class is mainly here as a kludge to get G++ to allocate two
// extra entries in each vtable.
struct _JvObjectPrefix
@@ -27,6 +29,7 @@ protected:
virtual void nacd_2 (void) {}; // Actually the GC bitmap marking descriptor.
# endif
};
+}
// Forward declarations for friends of java::lang::Object
void _Jv_MonitorEnter (jobject obj);
diff --git a/libjava/java/lang/OutOfMemoryError.java b/libjava/java/lang/OutOfMemoryError.java
index b56b8f4242e..105aae5c2e9 100644
--- a/libjava/java/lang/OutOfMemoryError.java
+++ b/libjava/java/lang/OutOfMemoryError.java
@@ -1,5 +1,5 @@
/* OutOfMemoryError.java -- thrown when a memory allocation fails
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* by the garbage collector.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class OutOfMemoryError extends VirtualMachineError
diff --git a/libjava/java/lang/Process.java b/libjava/java/lang/Process.java
index b87bd8068b5..e8c52760dfe 100644
--- a/libjava/java/lang/Process.java
+++ b/libjava/java/lang/Process.java
@@ -1,5 +1,5 @@
/* Process.java - Represent spawned system process
- Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ import java.io.OutputStream;
* owns this object.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see Runtime#exec(String[], String[], File)
* @since 1.0
* @status updated to 1.4
diff --git a/libjava/java/lang/Runnable.java b/libjava/java/lang/Runnable.java
index fd817b0e4a1..ee8d6842cef 100644
--- a/libjava/java/lang/Runnable.java
+++ b/libjava/java/lang/Runnable.java
@@ -1,5 +1,5 @@
/* Runnable -- interface for a method tied to an Object; often for Threads
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.lang;
* override run.
*
* @author Paul Fisher
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see Thread
* @since 1.0
* @status updated to 1.4
diff --git a/libjava/java/lang/Runtime.java b/libjava/java/lang/Runtime.java
index aaeb93eda2d..1094720404d 100644
--- a/libjava/java/lang/Runtime.java
+++ b/libjava/java/lang/Runtime.java
@@ -52,8 +52,8 @@ import java.util.StringTokenizer;
* Runtime represents the Virtual Machine.
*
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
- * @status still missing 1.4 functionality
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Jeroen Frijters
*/
// No idea why this class isn't final, since you can't build a subclass!
public class Runtime
diff --git a/libjava/java/lang/RuntimeException.java b/libjava/java/lang/RuntimeException.java
index 8fc9fb10aab..6e63ed3fd13 100644
--- a/libjava/java/lang/RuntimeException.java
+++ b/libjava/java/lang/RuntimeException.java
@@ -1,5 +1,5 @@
/* RuntimeException.java -- root of all unchecked exceptions
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,8 +45,8 @@ package java.lang;
* in their throws clause.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
public class RuntimeException extends Exception
diff --git a/libjava/java/lang/RuntimePermission.java b/libjava/java/lang/RuntimePermission.java
index b6adf383804..f4b46f68fb4 100644
--- a/libjava/java/lang/RuntimePermission.java
+++ b/libjava/java/lang/RuntimePermission.java
@@ -1,5 +1,5 @@
/* RuntimePermission.java -- permission for a secure runtime action
- Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -166,7 +166,7 @@ import java.security.BasicPermission;
* </table>
*
* @author Brian Jones
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see BasicPermission
* @see Permission
* @see SecurityManager
diff --git a/libjava/java/lang/SecurityException.java b/libjava/java/lang/SecurityException.java
index 5fbdb4ae222..91b015a895e 100644
--- a/libjava/java/lang/SecurityException.java
+++ b/libjava/java/lang/SecurityException.java
@@ -1,5 +1,5 @@
/* SecurityException.java -- thrown to indicate a security violation
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* deemed unsafe by the current security policies.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see SecurityManager
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/SecurityManager.java b/libjava/java/lang/SecurityManager.java
index 972b312d943..c9ed4be0b3f 100644
--- a/libjava/java/lang/SecurityManager.java
+++ b/libjava/java/lang/SecurityManager.java
@@ -1,5 +1,5 @@
/* SecurityManager.java -- security checks for privileged actions
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -101,7 +101,7 @@ import java.util.PropertyPermission;
* subclassing this class.
*
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see ClassLoader
* @see SecurityException
* @see #checkTopLevelWindow(Object)
diff --git a/libjava/java/lang/Short.java b/libjava/java/lang/Short.java
index 1a82e3edf36..1220f608acd 100644
--- a/libjava/java/lang/Short.java
+++ b/libjava/java/lang/Short.java
@@ -1,5 +1,5 @@
/* Short.java -- object wrapper for short
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.lang;
*
* @author Paul Fisher
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/StackOverflowError.java b/libjava/java/lang/StackOverflowError.java
index 8e8ed8d92b0..dc4c8ccf446 100644
--- a/libjava/java/lang/StackOverflowError.java
+++ b/libjava/java/lang/StackOverflowError.java
@@ -1,5 +1,5 @@
/* StackOverflowError.java -- thrown when the stack depth is exceeded
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.lang;
* overflow occurs. This often occurs when a method enters infinit recursion.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class StackOverflowError extends VirtualMachineError
diff --git a/libjava/java/lang/StackTraceElement.java b/libjava/java/lang/StackTraceElement.java
index 4495186e175..262d58228ee 100644
--- a/libjava/java/lang/StackTraceElement.java
+++ b/libjava/java/lang/StackTraceElement.java
@@ -1,5 +1,5 @@
/* StackTraceElement.java -- One function call or call stack element
- Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,8 +46,8 @@ import java.io.Serializable;
* the fully qualified class name, the method name and whether this method
* is native, if this information is known.
*
- * @author Mark Wielaard <mark@klomp.org>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Mark Wielaard (mark@klomp.org)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/StringBuffer.java b/libjava/java/lang/StringBuffer.java
index 4f04de265ca..eac1d5ae3ed 100644
--- a/libjava/java/lang/StringBuffer.java
+++ b/libjava/java/lang/StringBuffer.java
@@ -1,5 +1,5 @@
/* StringBuffer.java -- Growable strings
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,7 +67,7 @@ import java.io.Serializable;
* @author Paul Fisher
* @author John Keiser
* @author Tom Tromey
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see String
* @since 1.0
* @status updated to 1.4
diff --git a/libjava/java/lang/StringIndexOutOfBoundsException.java b/libjava/java/lang/StringIndexOutOfBoundsException.java
index 9a935ee8c44..ea0df6890e9 100644
--- a/libjava/java/lang/StringIndexOutOfBoundsException.java
+++ b/libjava/java/lang/StringIndexOutOfBoundsException.java
@@ -1,6 +1,6 @@
/* StringIndexOutOfBoundsException.java -- thrown to indicate attempt to
exceed string bounds
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.lang;
* which would be out of bounds.
*
* @author Brian Jones
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException
diff --git a/libjava/java/lang/ThreadDeath.java b/libjava/java/lang/ThreadDeath.java
index 3ba4cf899ec..29c452e30b8 100644
--- a/libjava/java/lang/ThreadDeath.java
+++ b/libjava/java/lang/ThreadDeath.java
@@ -1,5 +1,5 @@
/* ThreadDeath.java - special exception registering Thread death
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.lang;
* deprecated Thread.stop() method.
*
* @author John Keiser
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see Thread#stop()
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/ThreadGroup.java b/libjava/java/lang/ThreadGroup.java
index 89aff3f0249..0464767bf17 100644
--- a/libjava/java/lang/ThreadGroup.java
+++ b/libjava/java/lang/ThreadGroup.java
@@ -1,5 +1,5 @@
/* ThreadGroup -- a group of Threads
- Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.util.Vector;
* @author John Keiser
* @author Tom Tromey
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Thread
* @since 1.0
* @status updated to 1.4
diff --git a/libjava/java/lang/Throwable.java b/libjava/java/lang/Throwable.java
index e082548300b..ad5157823f5 100644
--- a/libjava/java/lang/Throwable.java
+++ b/libjava/java/lang/Throwable.java
@@ -1,5 +1,5 @@
/* java.lang.Throwable -- Root class for all Exceptions and Errors
- Copyright (C) 1998, 1999, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -98,7 +98,7 @@ import java.io.Serializable;
* @author John Keiser
* @author Mark Wielaard
* @author Tom Tromey
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.0
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/UnsatisfiedLinkError.java b/libjava/java/lang/UnsatisfiedLinkError.java
index 95c0b5333a4..ab4095644a7 100644
--- a/libjava/java/lang/UnsatisfiedLinkError.java
+++ b/libjava/java/lang/UnsatisfiedLinkError.java
@@ -1,5 +1,5 @@
/* UnsatisfiedLinkError.java -- thrown when a native method cannot be loaded
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* cannot be found by the Java Virtual Machine.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see Runtime
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/UnsupportedOperationException.java b/libjava/java/lang/UnsupportedOperationException.java
index 6c00bef4342..efbb844b337 100644
--- a/libjava/java/lang/UnsupportedOperationException.java
+++ b/libjava/java/lang/UnsupportedOperationException.java
@@ -1,6 +1,6 @@
/* UnsupportedOperationException.java -- thrown when an operation is not
supported
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.lang;
* This exception is thrown by an object when an operation is
* requested of it that it does not support.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/VMCompiler.java b/libjava/java/lang/VMCompiler.java
index 3eb4491ecec..b3f55603487 100644
--- a/libjava/java/lang/VMCompiler.java
+++ b/libjava/java/lang/VMCompiler.java
@@ -142,7 +142,8 @@ final class VMCompiler
{
Class c = null;
SharedLibHelper helper
- = SharedLibHelper.findHelper (loader, fileName, domain.getCodeSource());
+ = SharedLibHelper.findHelper (loader, fileName, domain.getCodeSource(),
+ domain, false);
c = helper.findClass (className);
if (c != null)
{
diff --git a/libjava/java/lang/VerifyError.java b/libjava/java/lang/VerifyError.java
index 3926530f9f3..c5ae8dd83ea 100644
--- a/libjava/java/lang/VerifyError.java
+++ b/libjava/java/lang/VerifyError.java
@@ -1,5 +1,5 @@
/* VerifyError.java -- thrown when a class fails verification
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.lang;
* internal inconsistency in a class file as detected by the "verifier."
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public class VerifyError extends LinkageError
diff --git a/libjava/java/lang/VirtualMachineError.java b/libjava/java/lang/VirtualMachineError.java
index b6f0758e862..161e4e647b3 100644
--- a/libjava/java/lang/VirtualMachineError.java
+++ b/libjava/java/lang/VirtualMachineError.java
@@ -1,5 +1,5 @@
/* VirtualMachineError.java -- thrown when the Virtual Machine has a problem
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.lang;
* it does not have the resources needed for it to continue execution.
*
* @author Brian Jones
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @status updated to 1.4
*/
public abstract class VirtualMachineError extends Error
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index 0e9c26c7b4f..f29f6674764 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -1,6 +1,6 @@
// natClass.cc - Implementation of java.lang.Class native methods.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation
This file is part of libgcj.
@@ -973,13 +973,13 @@ _Jv_LookupInterfaceMethod (jclass klass, _Jv_Utf8Const *name,
if (Modifier::isStatic(meth->accflags))
throw new java::lang::IncompatibleClassChangeError
- (_Jv_GetMethodString (klass, meth->name));
+ (_Jv_GetMethodString (klass, meth));
if (Modifier::isAbstract(meth->accflags))
throw new java::lang::AbstractMethodError
- (_Jv_GetMethodString (klass, meth->name));
+ (_Jv_GetMethodString (klass, meth));
if (! Modifier::isPublic(meth->accflags))
throw new java::lang::IllegalAccessError
- (_Jv_GetMethodString (klass, meth->name));
+ (_Jv_GetMethodString (klass, meth));
_Jv_AddMethodToCache (klass, meth);
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc
index 15fb9eb415c..17b2a883386 100644
--- a/libjava/java/lang/natClassLoader.cc
+++ b/libjava/java/lang/natClassLoader.cc
@@ -110,6 +110,16 @@ _Jv_RegisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader)
loader->loadedClasses->put(klass->name->toString(), klass);
}
+// If we found an error while defining an interpreted class, we must
+// go back and unregister it.
+void
+_Jv_UnregisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader)
+{
+ if (! loader)
+ loader = java::lang::ClassLoader::getSystemClassLoader();
+ loader->loadedClasses->remove(klass->name->toString());
+}
+
// This function is called many times during startup, before main() is
// run. At that point in time we know for certain we are running
// single-threaded, so we don't need to lock when adding classes to the
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index bf86522dd29..31f9b90b6fa 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -1,6 +1,6 @@
// natRuntime.cc - Implementation of native side of Runtime class.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -436,8 +436,18 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
if (! uname (&u))
{
SET ("os.name", u.sysname);
- SET ("os.arch", u.machine);
SET ("os.version", u.release);
+
+ // Normalize x86 architecture names to "i386" (except on Windows, which
+ // is handled in win32.cc).
+ if (u.machine[0] == 'i'
+ && u.machine[1] != 0
+ && u.machine[2] == '8'
+ && u.machine[3] == '6'
+ && u.machine[4] == 0)
+ SET ("os.arch", "i386");
+ else
+ SET ("os.arch", u.machine);
}
else
{
@@ -540,11 +550,14 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
// The java extensions directory.
SET ("java.ext.dirs", JAVA_EXT_DIRS);
+ // The path to libgcj's boot classes
+ SET ("sun.boot.class.path", BOOT_CLASS_PATH);
+
// Set some properties according to whatever was compiled in with
// `-D'. Important: after this point, the only properties that
// should be set are those which either the user cannot meaningfully
// override, or which augment whatever value the user has provided.
- for (int i = 0; _Jv_Compiler_Properties[i]; ++i)
+ for (int i = 0; i < _Jv_Properties_Count; ++i)
{
const char *s, *p;
// Find the `='.
@@ -594,9 +607,6 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
sb->toString ());
}
- // The path to libgcj's boot classes
- SET ("sun.boot.class.path", BOOT_CLASS_PATH);
-
// The name used to invoke this process (argv[0] in C).
SET ("gnu.gcj.progname", _Jv_GetSafeArg (0));
diff --git a/libjava/java/lang/natVMClassLoader.cc b/libjava/java/lang/natVMClassLoader.cc
index cd98e7e4561..1da79497154 100644
--- a/libjava/java/lang/natVMClassLoader.cc
+++ b/libjava/java/lang/natVMClassLoader.cc
@@ -57,13 +57,8 @@ java::lang::VMClassLoader::defineClass (java::lang::ClassLoader *loader,
jclass klass = VMCompiler::compileClass(loader, name, data,
offset, length, pd);
- if (klass != NULL)
- {
- JvSynchronize sync (&java::lang::Class::class$);
- _Jv_RegisterClass (klass);
- }
#ifdef INTERPRETER
- else
+ if (klass == NULL)
{
klass = new java::lang::Class ();
@@ -96,7 +91,7 @@ java::lang::VMClassLoader::defineClass (java::lang::ClassLoader *loader,
klass->state = JV_STATE_ERROR;
klass->notifyAll ();
- _Jv_UnregisterClass (klass);
+ _Jv_UnregisterInitiatingLoader (klass, klass->loader);
// If EX is not a ClassNotFoundException, that's ok, because we
// account for the possibility in defineClass().
diff --git a/libjava/java/lang/reflect/AccessibleObject.java b/libjava/java/lang/reflect/AccessibleObject.java
index 5b5b5f6ff52..d50f3de9dec 100644
--- a/libjava/java/lang/reflect/AccessibleObject.java
+++ b/libjava/java/lang/reflect/AccessibleObject.java
@@ -1,5 +1,5 @@
/* java.lang.reflect.AccessibleObject
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,8 +46,8 @@ package java.lang.reflect;
* to mess with this, don't try. Fortunately, there are adequate
* security checks before you can set a reflection object as accessible.
*
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Field
* @see Constructor
* @see Method
diff --git a/libjava/java/lang/reflect/Array.java b/libjava/java/lang/reflect/Array.java
index 11b0d97e9da..5df6dbd0e8d 100644
--- a/libjava/java/lang/reflect/Array.java
+++ b/libjava/java/lang/reflect/Array.java
@@ -1,5 +1,5 @@
/* java.lang.reflect.Array - manipulate arrays by reflection
- Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,8 +63,8 @@ import gnu.classpath.Configuration;
* worse if you do this and use the generic set() function.
*
* @author John Keiser
- * @author Eric Blake <ebb9@email.byu.edu>
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Per Bothner (bothner@cygnus.com)
* @see java.lang.Boolean#TYPE
* @see java.lang.Byte#TYPE
* @see java.lang.Short#TYPE
diff --git a/libjava/java/lang/reflect/Field.java b/libjava/java/lang/reflect/Field.java
index b54a103d9bc..cb852cf2fb2 100644
--- a/libjava/java/lang/reflect/Field.java
+++ b/libjava/java/lang/reflect/Field.java
@@ -23,6 +23,9 @@ public final class Field extends AccessibleObject implements Member
// Offset in bytes from the start of declaringClass's fields array.
private int offset;
+ // The Class (or primitive TYPE) of this field.
+ private Class type;
+
// This is instantiated by Class sometimes, but it uses C++ and
// avoids the Java protection check.
Field ()
@@ -136,76 +139,79 @@ public final class Field extends AccessibleObject implements Member
public void setByte (Object obj, byte b)
throws IllegalArgumentException, IllegalAccessException
{
- setByte(null, obj, b);
+ setByte(null, obj, b, true);
}
public void setShort (Object obj, short s)
throws IllegalArgumentException, IllegalAccessException
{
- setShort(null, obj, s);
+ setShort(null, obj, s, true);
}
public void setInt (Object obj, int i)
throws IllegalArgumentException, IllegalAccessException
{
- setInt(null, obj, i);
+ setInt(null, obj, i, true);
}
public void setLong (Object obj, long l)
throws IllegalArgumentException, IllegalAccessException
{
- setLong(null, obj, l);
+ setLong(null, obj, l, true);
}
public void setFloat (Object obj, float f)
throws IllegalArgumentException, IllegalAccessException
{
- setFloat(null, obj, f);
+ setFloat(null, obj, f, true);
}
public void setDouble (Object obj, double d)
throws IllegalArgumentException, IllegalAccessException
{
- setDouble(null, obj, d);
+ setDouble(null, obj, d, true);
}
public void setChar (Object obj, char c)
throws IllegalArgumentException, IllegalAccessException
{
- setChar(null, obj, c);
+ setChar(null, obj, c, true);
}
public void setBoolean (Object obj, boolean b)
throws IllegalArgumentException, IllegalAccessException
{
- setBoolean(null, obj, b);
+ setBoolean(null, obj, b, true);
}
- private native void setByte (Class caller, Object obj, byte b)
+ native void setByte (Class caller, Object obj, byte b, boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void setShort (Class caller, Object obj, short s)
+ native void setShort (Class caller, Object obj, short s, boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void setInt (Class caller, Object obj, int i)
+ native void setInt (Class caller, Object obj, int i, boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void setLong (Class caller, Object obj, long l)
+ native void setLong (Class caller, Object obj, long l, boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void setFloat (Class caller, Object obj, float f)
+ native void setFloat (Class caller, Object obj, float f, boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void setDouble (Class caller, Object obj, double d)
+ native void setDouble (Class caller, Object obj, double d,
+ boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void setChar (Class caller, Object obj, char c)
+ native void setChar (Class caller, Object obj, char c, boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void setBoolean (Class caller, Object obj, boolean b)
+ native void setBoolean (Class caller, Object obj, boolean b,
+ boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
- private native void set (Class caller, Object obj, Object val, Class type)
+ native void set (Class caller, Object obj, Object val, Class type,
+ boolean checkFinal)
throws IllegalArgumentException, IllegalAccessException;
public void set (Object object, Object value)
@@ -219,23 +225,23 @@ public final class Field extends AccessibleObject implements Member
{
Class type = getType();
if (! type.isPrimitive())
- set(caller, object, value, type);
+ set(caller, object, value, type, true);
else if (value instanceof Byte)
- setByte(caller, object, ((Byte) value).byteValue());
+ setByte(caller, object, ((Byte) value).byteValue(), true);
else if (value instanceof Short)
- setShort (caller, object, ((Short) value).shortValue());
+ setShort (caller, object, ((Short) value).shortValue(), true);
else if (value instanceof Integer)
- setInt(caller, object, ((Integer) value).intValue());
+ setInt(caller, object, ((Integer) value).intValue(), true);
else if (value instanceof Long)
- setLong(caller, object, ((Long) value).longValue());
+ setLong(caller, object, ((Long) value).longValue(), true);
else if (value instanceof Float)
- setFloat(caller, object, ((Float) value).floatValue());
+ setFloat(caller, object, ((Float) value).floatValue(), true);
else if (value instanceof Double)
- setDouble(caller, object, ((Double) value).doubleValue());
+ setDouble(caller, object, ((Double) value).doubleValue(), true);
else if (value instanceof Character)
- setChar(caller, object, ((Character) value).charValue());
+ setChar(caller, object, ((Character) value).charValue(), true);
else if (value instanceof Boolean)
- setBoolean(caller, object, ((Boolean) value).booleanValue());
+ setBoolean(caller, object, ((Boolean) value).booleanValue(), true);
else
throw new IllegalArgumentException();
}
diff --git a/libjava/java/lang/reflect/InvocationTargetException.java b/libjava/java/lang/reflect/InvocationTargetException.java
index 904cc631324..2593921a3e6 100644
--- a/libjava/java/lang/reflect/InvocationTargetException.java
+++ b/libjava/java/lang/reflect/InvocationTargetException.java
@@ -1,5 +1,5 @@
/* InvocationTargetException.java -- Wrapper exception for reflection
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,8 +45,8 @@ package java.lang.reflect;
* exceptions, but <code>getTargetException()</code> still works.
*
* @author John Keiser
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Method#invoke(Object,Object[])
* @see Constructor#newInstance(Object[])
* @since 1.1
diff --git a/libjava/java/lang/reflect/Member.java b/libjava/java/lang/reflect/Member.java
index 983d45230ec..ef980d8726d 100644
--- a/libjava/java/lang/reflect/Member.java
+++ b/libjava/java/lang/reflect/Member.java
@@ -1,5 +1,5 @@
/* java.lang.reflect.Member - common query methods in reflection
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,8 +44,8 @@ package java.lang.reflect;
* class, name or modifiers of the member with this interface.
*
* @author John Keiser
- * @author Per Bothner <bothner@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Per Bothner (bothner@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Class
* @see Field
* @see Method
diff --git a/libjava/java/lang/reflect/Modifier.java b/libjava/java/lang/reflect/Modifier.java
index 8171a88feb5..3b3baa6722e 100644
--- a/libjava/java/lang/reflect/Modifier.java
+++ b/libjava/java/lang/reflect/Modifier.java
@@ -1,5 +1,5 @@
/* java.lang.reflect.Modifier
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,8 +50,8 @@ package java.lang.reflect;
* Sun does it, but I'm willing to bet money that it is.
*
* @author John Keiser
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Member#getModifiers()
* @see Method#getModifiers()
* @see Field#getModifiers()
diff --git a/libjava/java/lang/reflect/Proxy.java b/libjava/java/lang/reflect/Proxy.java
index 8aee02fb47f..3f13254fdc3 100644
--- a/libjava/java/lang/reflect/Proxy.java
+++ b/libjava/java/lang/reflect/Proxy.java
@@ -1,5 +1,5 @@
/* Proxy.java -- build a proxy class that implements reflected interfaces
- Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -459,7 +459,7 @@ public class Proxy implements Serializable
* Helper class for mapping unique ClassLoader and interface combinations
* to proxy classes.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class ProxyType
{
@@ -565,7 +565,7 @@ public class Proxy implements Serializable
* without worrying about return type, declaring class, or throws clause,
* and which reduces the maximally common throws clause between two methods
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class ProxySignature
{
@@ -718,7 +718,7 @@ public class Proxy implements Serializable
* A flat representation of all data needed to generate bytecode/instantiate
* a proxy class. This is basically a struct.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class ProxyData
{
@@ -871,7 +871,7 @@ public class Proxy implements Serializable
* this code is not loaded in memory if the VM has a native
* implementation instead.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class ClassFactory
{
@@ -1347,7 +1347,7 @@ public class Proxy implements Serializable
return clazz;
}
- catch (Throwable e)
+ catch (Exception e)
{
// assert false;
throw (Error) new InternalError("Unexpected: " + e).initCause(e);
diff --git a/libjava/java/lang/reflect/ReflectPermission.java b/libjava/java/lang/reflect/ReflectPermission.java
index 400ca25afcc..26fd0fc4a7c 100644
--- a/libjava/java/lang/reflect/ReflectPermission.java
+++ b/libjava/java/lang/reflect/ReflectPermission.java
@@ -1,5 +1,5 @@
/* ReflectPermission.java - named permission for reflaction
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,8 +66,8 @@ import java.security.BasicPermission;
* </tr>
* </table>
*
- * @author Tom Tromey <tromey@redhat.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/lang/reflect/UndeclaredThrowableException.java b/libjava/java/lang/reflect/UndeclaredThrowableException.java
index d9596922beb..2e26e598859 100644
--- a/libjava/java/lang/reflect/UndeclaredThrowableException.java
+++ b/libjava/java/lang/reflect/UndeclaredThrowableException.java
@@ -1,6 +1,6 @@
/* UndeclaredThrowableException.java -- wraps an undeclared checked exception
thrown by a Proxy invocation handler
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ package java.lang.reflect;
* exception, never {@link Error} or {@link RuntimeException},
* which are unchecked.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Proxy
* @see InvocationHandler
* @since 1.3
diff --git a/libjava/java/lang/reflect/natField.cc b/libjava/java/lang/reflect/natField.cc
index 7eb032227ab..9a8107b795d 100644
--- a/libjava/java/lang/reflect/natField.cc
+++ b/libjava/java/lang/reflect/natField.cc
@@ -45,14 +45,19 @@ java::lang::reflect::Field::getName ()
jclass
java::lang::reflect::Field::getType ()
{
- jfieldID fld = _Jv_FromReflectedField (this);
- JvSynchronize sync (declaringClass);
- _Jv_Linker::resolve_field (fld, declaringClass->getClassLoaderInternal ());
- return fld->type;
+ if (type == NULL)
+ {
+ jfieldID fld = _Jv_FromReflectedField (this);
+ JvSynchronize sync (declaringClass);
+ _Jv_Linker::resolve_field (fld, declaringClass->getClassLoaderInternal ());
+ type = fld->type;
+ }
+ return type;
}
static void*
-getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
+getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj,
+ jboolean checkFinal)
{
// FIXME: we know CALLER is NULL here. At one point we planned to
// have the compiler insert the caller as a hidden argument in some
@@ -63,6 +68,12 @@ getAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
jfieldID fld = _Jv_FromReflectedField (field);
_Jv_ushort flags = fld->getModifiers();
+
+ // Setting a final field is usually not allowed.
+ if (checkFinal
+ && field->getModifiers() & java::lang::reflect::Modifier::FINAL)
+ throw new java::lang::IllegalAccessException(JvNewStringUTF
+ ("Field is final"));
// Check accessibility, if required.
if (! (Modifier::isPublic (flags) || field->isAccessible()))
@@ -180,56 +191,56 @@ getDouble (jclass cls, void* addr)
jboolean
java::lang::reflect::Field::getBoolean (jclass caller, jobject obj)
{
- return ::getBoolean (this->getType(), getAddr (this, caller, obj));
+ return ::getBoolean (this->getType(), getAddr (this, caller, obj, false));
}
jchar
java::lang::reflect::Field::getChar (jclass caller, jobject obj)
{
- return ::getChar (this->getType(), getAddr (this, caller, obj));
+ return ::getChar (this->getType(), getAddr (this, caller, obj, false));
}
jbyte
java::lang::reflect::Field::getByte (jclass caller, jobject obj)
{
- return ::getByte (this->getType(), getAddr (this, caller, obj));
+ return ::getByte (this->getType(), getAddr (this, caller, obj, false));
}
jshort
java::lang::reflect::Field::getShort (jclass caller, jobject obj)
{
- return ::getShort (this->getType(), getAddr (this, caller, obj));
+ return ::getShort (this->getType(), getAddr (this, caller, obj, false));
}
jint
java::lang::reflect::Field::getInt (jclass caller, jobject obj)
{
- return ::getInt (this->getType(), getAddr (this, caller, obj));
+ return ::getInt (this->getType(), getAddr (this, caller, obj, false));
}
jlong
java::lang::reflect::Field::getLong (jclass caller, jobject obj)
{
- return ::getLong (this->getType(), getAddr (this, caller, obj));
+ return ::getLong (this->getType(), getAddr (this, caller, obj, false));
}
jfloat
java::lang::reflect::Field::getFloat (jclass caller, jobject obj)
{
- return ::getFloat (this->getType(), getAddr (this, caller, obj));
+ return ::getFloat (this->getType(), getAddr (this, caller, obj, false));
}
jdouble
java::lang::reflect::Field::getDouble (jclass caller, jobject obj)
{
- return ::getDouble (this->getType(), getAddr (this, caller, obj));
+ return ::getDouble (this->getType(), getAddr (this, caller, obj, false));
}
jobject
java::lang::reflect::Field::get (jclass caller, jobject obj)
{
jclass type = this->getType();
- void* addr = getAddr (this, caller, obj);
+ void* addr = getAddr (this, caller, obj, false);
if (! type->isPrimitive ())
return * (jobject*) addr;
if (type == JvPrimClass (double))
@@ -257,16 +268,6 @@ java::lang::reflect::Field::get (jclass caller, jobject obj)
throw new java::lang::IllegalArgumentException;
}
-static void*
-setAddr (java::lang::reflect::Field* field, jclass caller, jobject obj)
-{
- void *addr = getAddr(field, caller, obj);
- if (!field->isAccessible()
- && field->getModifiers() & java::lang::reflect::Modifier::FINAL)
- throw new java::lang::IllegalAccessException();
- return addr;
-}
-
static void
setBoolean (jclass type, void *addr, jboolean value)
{
@@ -378,57 +379,66 @@ setDouble (jclass type, void *addr, jdouble value)
}
void
-java::lang::reflect::Field::setBoolean (jclass caller, jobject obj, jboolean b)
+java::lang::reflect::Field::setBoolean (jclass caller, jobject obj, jboolean b,
+ jboolean checkFinal)
{
- ::setBoolean (this->getType(), setAddr (this, caller, obj), b);
+ ::setBoolean (this->getType(), getAddr (this, caller, obj, checkFinal), b);
}
void
-java::lang::reflect::Field::setChar (jclass caller, jobject obj, jchar c)
+java::lang::reflect::Field::setChar (jclass caller, jobject obj, jchar c,
+ jboolean checkFinal)
{
- ::setChar (this->getType(), setAddr (this, caller, obj), c);
+ ::setChar (this->getType(), getAddr (this, caller, obj, checkFinal), c);
}
void
-java::lang::reflect::Field::setByte (jclass caller, jobject obj, jbyte b)
+java::lang::reflect::Field::setByte (jclass caller, jobject obj, jbyte b,
+ jboolean checkFinal)
{
- ::setByte (this->getType(), setAddr (this, caller, obj), b);
+ ::setByte (this->getType(), getAddr (this, caller, obj, checkFinal), b);
}
void
-java::lang::reflect::Field::setShort (jclass caller, jobject obj, jshort s)
+java::lang::reflect::Field::setShort (jclass caller, jobject obj, jshort s,
+ jboolean checkFinal)
{
- ::setShort (this->getType(), setAddr (this, caller, obj), s);
+ ::setShort (this->getType(), getAddr (this, caller, obj, checkFinal), s);
}
void
-java::lang::reflect::Field::setInt (jclass caller, jobject obj, jint i)
+java::lang::reflect::Field::setInt (jclass caller, jobject obj, jint i,
+ jboolean checkFinal)
{
- ::setInt (this->getType(), setAddr (this, caller, obj), i);
+ ::setInt (this->getType(), getAddr (this, caller, obj, checkFinal), i);
}
void
-java::lang::reflect::Field::setLong (jclass caller, jobject obj, jlong l)
+java::lang::reflect::Field::setLong (jclass caller, jobject obj, jlong l,
+ jboolean checkFinal)
{
- ::setLong (this->getType(), setAddr (this, caller, obj), l);
+ ::setLong (this->getType(), getAddr (this, caller, obj, checkFinal), l);
}
+
void
-java::lang::reflect::Field::setFloat (jclass caller, jobject obj, jfloat f)
+java::lang::reflect::Field::setFloat (jclass caller, jobject obj, jfloat f,
+ jboolean checkFinal)
{
- ::setFloat (this->getType(), setAddr (this, caller, obj), f);
+ ::setFloat (this->getType(), getAddr (this, caller, obj, checkFinal), f);
}
void
-java::lang::reflect::Field::setDouble (jclass caller, jobject obj, jdouble d)
+java::lang::reflect::Field::setDouble (jclass caller, jobject obj, jdouble d,
+ jboolean checkFinal)
{
- ::setDouble (this->getType(), setAddr (this, caller, obj), d);
+ ::setDouble (this->getType(), getAddr (this, caller, obj, checkFinal), d);
}
void
java::lang::reflect::Field::set (jclass caller, jobject object, jobject value,
- jclass type)
+ jclass type, jboolean checkFinal)
{
- void* addr = setAddr (this, caller, object);
+ void* addr = getAddr (this, caller, object, checkFinal);
if (value != NULL && ! _Jv_IsInstanceOf (value, type))
throw new java::lang::IllegalArgumentException;
* (jobject*) addr = value;
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc
index b4b3a7a9b06..27c26e19ac7 100644
--- a/libjava/java/lang/reflect/natMethod.cc
+++ b/libjava/java/lang/reflect/natMethod.cc
@@ -1,6 +1,6 @@
// natMethod.cc - Native code for Method class.
-/* Copyright (C) 1998, 1999, 2000, 2001 , 2002, 2003, 2004 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 , 2002, 2003, 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -496,7 +496,7 @@ _Jv_CallAnyMethodA (jobject obj,
|| concrete_meth->ncode == NULL
|| Modifier::isAbstract(concrete_meth->accflags))
throw new java::lang::IncompatibleClassChangeError
- (_Jv_GetMethodString (vtable->clas, meth->name));
+ (_Jv_GetMethodString (vtable->clas, meth));
ncode = concrete_meth->ncode;
}
else
diff --git a/libjava/java/math/BigInteger.java b/libjava/java/math/BigInteger.java
index 3a822aa81c6..df948a3ecce 100644
--- a/libjava/java/math/BigInteger.java
+++ b/libjava/java/math/BigInteger.java
@@ -1,5 +1,5 @@
/* java.math.BigInteger -- Arbitary precision integers
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,10 +50,10 @@ import java.util.Random;
* as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998) and
* "Applied Cryptography, Second Edition" by Bruce Schneier (Wiley, 1996).
*
- * Based primarily on IntNum.java BitOps.java by Per Bothner <per@bothner.com>
+ * Based primarily on IntNum.java BitOps.java by Per Bothner (per@bothner.com)
* (found in Kawa 1.6.62).
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @date December 20, 1999.
* @status believed complete and correct.
*/
diff --git a/libjava/java/net/NetworkInterface.java b/libjava/java/net/NetworkInterface.java
index dea4e3b444b..2b4da7392e6 100644
--- a/libjava/java/net/NetworkInterface.java
+++ b/libjava/java/net/NetworkInterface.java
@@ -1,5 +1,5 @@
/* NetworkInterface.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -212,7 +212,7 @@ public final class NetworkInterface
*
* @param obj The object to compare with
*
- * @return <code>true</code> if equal, <code>false<code> otherwise
+ * @return <code>true</code> if equal, <code>false</code> otherwise
*/
public boolean equals(Object obj)
{
diff --git a/libjava/java/net/URI.java b/libjava/java/net/URI.java
index 4de5095bbbb..23e3e7c9e4a 100644
--- a/libjava/java/net/URI.java
+++ b/libjava/java/net/URI.java
@@ -65,7 +65,7 @@ public final class URI implements Comparable, Serializable
"^(([^:/?#]+):)?((//([^/?#]*))?([^?#]*)(\\?([^#]*))?)?(#(.*))?";
private static final String AUTHORITY_REGEXP =
- "^(([^?#]*)@([^?#]*):([^?#]*))?";
+ "^((([^?#]*)@)?([^?#:]*)(:([^?#]*)))?";
/**
* Valid characters (taken from rfc2396)
@@ -115,9 +115,9 @@ public final class URI implements Comparable, Serializable
*/
private static final int FRAGMENT_GROUP = 10;
- private static final int AUTHORITY_USERINFO_GROUP = 2;
- private static final int AUTHORITY_HOST_GROUP = 3;
- private static final int AUTHORITY_PORT_GROUP = 4;
+ private static final int AUTHORITY_USERINFO_GROUP = 3;
+ private static final int AUTHORITY_HOST_GROUP = 4;
+ private static final int AUTHORITY_PORT_GROUP = 6;
private transient String scheme;
private transient String rawSchemeSpecificPart;
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 96f97991280..7ab30513b7c 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -1,5 +1,5 @@
/* URL.java -- Uniform Resource Locator Class
- Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -918,6 +918,10 @@ public final class URL implements Serializable
Class c = Class.forName(clsName, true, systemClassLoader);
ph = (URLStreamHandler) c.newInstance();
}
+ catch (ThreadDeath death)
+ {
+ throw death;
+ }
catch (Throwable t) { /* ignored */ }
}
while (ph == null && pkgPrefix.hasMoreTokens());
diff --git a/libjava/java/net/URLClassLoader.java b/libjava/java/net/URLClassLoader.java
index 3efc5dca76f..919fc9de0f6 100644
--- a/libjava/java/net/URLClassLoader.java
+++ b/libjava/java/net/URLClassLoader.java
@@ -1,5 +1,6 @@
/* URLClassLoader.java -- ClassLoader that loads classes from one or more URLs
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -305,8 +306,6 @@ public class URLClassLoader extends SecureClassLoader
Vector classPath; // The "Class-Path" attribute of this Jar's manifest
- SoURLLoader soURLLoader;
-
public JarURLLoader(URLClassLoader classloader, URL baseURL)
{
super(classloader, baseURL);
@@ -319,70 +318,44 @@ public class URLClassLoader extends SecureClassLoader
sb.append("!/");
String jarURL = sb.toString();
- this.soURLLoader = null;
this.classPath = null;
URL baseJarURL = null;
JarFile jarfile = null;
try
{
- baseJarURL
- = new URL(null, jarURL, classloader.getURLStreamHandler("jar"));
- jarfile
- = ((JarURLConnection) baseJarURL.openConnection()).getJarFile();
-
- if (jarfile != null)
+ baseJarURL =
+ new URL(null, jarURL, classloader.getURLStreamHandler("jar"));
+
+ jarfile =
+ ((JarURLConnection) baseJarURL.openConnection()).getJarFile();
+
+ Manifest manifest;
+ Attributes attributes;
+ String classPathString;
+
+ if ((manifest = jarfile.getManifest()) != null
+ && (attributes = manifest.getMainAttributes()) != null
+ && ((classPathString
+ = attributes.getValue(Attributes.Name.CLASS_PATH))
+ != null))
{
- String fileName = baseURL.getFile();
- if (fileName != null)
- {
- File f = new File(fileName);
- String libDirName = f.getCanonicalFile().getParent()
- + File.separator + "GCJLIBS";
- File libDir = new File(libDirName);
- if (libDir != null && (libDir.isDirectory()))
+ this.classPath = new Vector();
+
+ StringTokenizer st = new StringTokenizer(classPathString, " ");
+ while (st.hasMoreElements ())
+ {
+ String e = st.nextToken ();
+ try
{
- File soFile = new File (libDirName
- + File.separator + f.getName()
- + ".so");
- if (soFile != null && soFile.isFile())
- this.soURLLoader
- = new SoURLLoader (classloader, soFile.toURL(),
- baseURL);
- }
- }
-
- Manifest manifest;
- Attributes attributes;
- String classPathString;
-
- if ((manifest = jarfile.getManifest()) != null
- && (attributes = manifest.getMainAttributes()) != null
- && ((classPathString
- = attributes.getValue(Attributes.Name.CLASS_PATH))
- != null))
- {
- this.classPath = new Vector();
-
- StringTokenizer st
- = new StringTokenizer
- (classPathString,
- System.getProperty ("path.separator", ":"));
-
- while (st.hasMoreElements ())
- {
- String e = st.nextToken ();
- try
- {
- URL url = new URL(baseURL, e);
- this.classPath.add(url);
- }
- catch (java.net.MalformedURLException xx)
- {
- // Give up
- }
+ URL url = new URL(baseURL, e);
+ this.classPath.add(url);
+ }
+ catch (java.net.MalformedURLException xx)
+ {
+ // Give up
}
}
- }
+ }
}
catch (IOException ioe)
{
@@ -393,13 +366,6 @@ public class URLClassLoader extends SecureClassLoader
this.jarfile = jarfile;
}
- Class getClass(String className)
- {
- if (soURLLoader != null)
- return soURLLoader.getClass(className);
- return null;
- }
-
/** get resource with the name "name" in the jar url */
Resource getResource(String name)
{
@@ -416,11 +382,6 @@ public class URLClassLoader extends SecureClassLoader
return null;
}
- public String toString ()
- {
- return "jarfile " + jarfile.getName();
- }
-
Manifest getManifest()
{
try
@@ -461,7 +422,11 @@ public class URLClassLoader extends SecureClassLoader
Certificate[] getCertificates()
{
- return entry.getCertificates();
+ // We have to get the entry from the jar file again, because the
+ // certificates will not be available until the entire entry has
+ // been read.
+ return ((JarEntry) ((JarURLLoader) loader).jarfile.getEntry(name))
+ .getCertificates();
}
URL getURL()
@@ -582,7 +547,7 @@ public class URLClassLoader extends SecureClassLoader
{
super(classloader, url, overrideURL);
helper = SharedLibHelper.findHelper(classloader, url.getFile(),
- noCertCodeSource);
+ noCertCodeSource, true);
}
Class getClass(String className)
@@ -671,11 +636,6 @@ public class URLClassLoader extends SecureClassLoader
return (int) file.length();
}
- public String toString ()
- {
- return "file " +file.getAbsolutePath();
- }
-
public URL getURL()
{
try
@@ -958,7 +918,7 @@ public class URLClassLoader extends SecureClassLoader
resource = loader.getResource(resourceName);
}
if (resource == null)
- throw new ClassNotFoundException(className + " not found in " + urls);
+ throw new ClassNotFoundException(className + " not found in " + this);
// Try to read the class data, create the CodeSource, Package and
// construct the class (and watch out for those nasty IOExceptions)
@@ -1021,9 +981,10 @@ public class URLClassLoader extends SecureClassLoader
// And finally construct the class!
SecurityManager sm = System.getSecurityManager();
+ Class result = null;
if (sm != null && securityContext != null)
{
- return (Class)AccessController.doPrivileged
+ result = (Class)AccessController.doPrivileged
(new PrivilegedAction()
{
public Object run()
@@ -1035,12 +996,49 @@ public class URLClassLoader extends SecureClassLoader
}, securityContext);
}
else
- return defineClass(className, classData, 0, classData.length, source);
+ result = defineClass(className, classData, 0, classData.length, source);
+
+ super.setSigners(result, resource.getCertificates());
+ return result;
}
catch (IOException ioe)
{
- throw new ClassNotFoundException(className, ioe);
+ ClassNotFoundException cnfe;
+ cnfe = new ClassNotFoundException(className + " not found in " + this);
+ cnfe.initCause(ioe);
+ throw cnfe;
+ }
+ }
+
+ // Cached String representation of this URLClassLoader
+ private String thisString;
+
+ /**
+ * Returns a String representation of this URLClassLoader giving the
+ * actual Class name, the URLs that are searched and the parent
+ * ClassLoader.
+ */
+ public String toString()
+ {
+ if (thisString == null)
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append(this.getClass().getName());
+ sb.append("{urls=[" );
+ URL[] thisURLs = getURLs();
+ for (int i = 0; i < thisURLs.length; i++)
+ {
+ sb.append(thisURLs[i]);
+ if (i < thisURLs.length - 1)
+ sb.append(',');
+ }
+ sb.append(']');
+ sb.append(", parent=");
+ sb.append(getParent());
+ sb.append('}');
+ thisString = sb.toString();
}
+ return thisString;
}
/**
diff --git a/libjava/java/nio/ByteBufferHelper.java b/libjava/java/nio/ByteBufferHelper.java
index cbc1f110a6f..799d41c2a04 100644
--- a/libjava/java/nio/ByteBufferHelper.java
+++ b/libjava/java/nio/ByteBufferHelper.java
@@ -1,5 +1,5 @@
/* ByteBufferImpl.java --
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.nio;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
*/
final class ByteBufferHelper
{
diff --git a/libjava/java/nio/ByteBufferImpl.java b/libjava/java/nio/ByteBufferImpl.java
index 7734dbf12cd..d9f24627de0 100644
--- a/libjava/java/nio/ByteBufferImpl.java
+++ b/libjava/java/nio/ByteBufferImpl.java
@@ -1,5 +1,5 @@
/* ByteBufferImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -112,6 +112,8 @@ final class ByteBufferImpl extends ByteBuffer
public ByteBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int pos = position();
if (pos > 0)
{
@@ -120,6 +122,11 @@ final class ByteBufferImpl extends ByteBuffer
position(count);
limit(capacity());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
@@ -178,7 +185,7 @@ final class ByteBufferImpl extends ByteBuffer
}
/**
- * Absolute put method. Writes <code>value</value> to position
+ * Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
*
* @exception IndexOutOfBoundsException If index is negative or not smaller
diff --git a/libjava/java/nio/CharBufferImpl.java b/libjava/java/nio/CharBufferImpl.java
index 2ca44d94459..f9babe8287b 100644
--- a/libjava/java/nio/CharBufferImpl.java
+++ b/libjava/java/nio/CharBufferImpl.java
@@ -87,6 +87,8 @@ final class CharBufferImpl extends CharBuffer
public CharBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -96,6 +98,7 @@ final class CharBufferImpl extends CharBuffer
}
position (copied);
+ limit(capacity());
return this;
}
diff --git a/libjava/java/nio/CharViewBufferImpl.java b/libjava/java/nio/CharViewBufferImpl.java
index 2701983ead5..25a2cf7972a 100644
--- a/libjava/java/nio/CharViewBufferImpl.java
+++ b/libjava/java/nio/CharViewBufferImpl.java
@@ -122,6 +122,11 @@ class CharViewBufferImpl extends CharBuffer
position (count);
limit (capacity ());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/DirectByteBufferImpl.java b/libjava/java/nio/DirectByteBufferImpl.java
index c272bacbf72..83279382a22 100644
--- a/libjava/java/nio/DirectByteBufferImpl.java
+++ b/libjava/java/nio/DirectByteBufferImpl.java
@@ -42,21 +42,22 @@ import gnu.gcj.RawData;
abstract class DirectByteBufferImpl extends ByteBuffer
{
- /** The owner is used to keep alive the object that actually owns the
- * memory. There are three possibilities:
- * 1) owner == this: We allocated the memory and we should free it,
- * but *only* in finalize (if we've been sliced
- * other objects will also have access to the
- * memory).
- * 2) owner == null: The byte buffer was created thru
- * JNI.NewDirectByteBuffer. The JNI code is
- * responsible for freeing the memory.
- * 3) owner == some other object: The other object allocated the
- * memory and should free it.
- */
+ /**
+ * The owner is used to keep alive the object that actually owns the
+ * memory. There are three possibilities:
+ * 1) owner == this: We allocated the memory and we should free it,
+ * but *only* in finalize (if we've been sliced
+ * other objects will also have access to the
+ * memory).
+ * 2) owner == null: The byte buffer was created thru
+ * JNI.NewDirectByteBuffer. The JNI code is
+ * responsible for freeing the memory.
+ * 3) owner == some other object: The other object allocated the
+ * memory and should free it.
+ */
private final Object owner;
- final static class ReadOnly extends DirectByteBufferImpl
+ static final class ReadOnly extends DirectByteBufferImpl
{
ReadOnly(Object owner, RawData address,
int capacity, int limit,
@@ -81,7 +82,7 @@ abstract class DirectByteBufferImpl extends ByteBuffer
}
}
- final static class ReadWrite extends DirectByteBufferImpl
+ static final class ReadWrite extends DirectByteBufferImpl
{
ReadWrite(int capacity)
{
@@ -197,6 +198,8 @@ abstract class DirectByteBufferImpl extends ByteBuffer
public ByteBuffer compact()
{
+ checkIfReadOnly();
+ mark = -1;
int pos = position();
if (pos > 0)
{
@@ -205,6 +208,11 @@ abstract class DirectByteBufferImpl extends ByteBuffer
position(count);
limit(capacity());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/DoubleBufferImpl.java b/libjava/java/nio/DoubleBufferImpl.java
index 504ee8d61b0..bad883c7d6c 100644
--- a/libjava/java/nio/DoubleBufferImpl.java
+++ b/libjava/java/nio/DoubleBufferImpl.java
@@ -1,5 +1,5 @@
/* DoubleBufferImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,6 +80,8 @@ final class DoubleBufferImpl extends DoubleBuffer
public DoubleBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -89,6 +91,7 @@ final class DoubleBufferImpl extends DoubleBuffer
}
position (copied);
+ limit(capacity());
return this;
}
@@ -146,7 +149,7 @@ final class DoubleBufferImpl extends DoubleBuffer
}
/**
- * Absolute put method. Writes <code>value</value> to position
+ * Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
*
* @exception IndexOutOfBoundsException If index is negative or not smaller
diff --git a/libjava/java/nio/DoubleViewBufferImpl.java b/libjava/java/nio/DoubleViewBufferImpl.java
index 276e2757045..d47c96463f4 100644
--- a/libjava/java/nio/DoubleViewBufferImpl.java
+++ b/libjava/java/nio/DoubleViewBufferImpl.java
@@ -120,6 +120,11 @@ final class DoubleViewBufferImpl extends DoubleBuffer
position (count);
limit (capacity ());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/FloatBufferImpl.java b/libjava/java/nio/FloatBufferImpl.java
index a9eb7c1de8a..6f552cfabe3 100644
--- a/libjava/java/nio/FloatBufferImpl.java
+++ b/libjava/java/nio/FloatBufferImpl.java
@@ -1,5 +1,5 @@
/* FloatBufferImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,6 +80,8 @@ final class FloatBufferImpl extends FloatBuffer
public FloatBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -89,6 +91,7 @@ final class FloatBufferImpl extends FloatBuffer
}
position (copied);
+ limit(capacity());
return this;
}
@@ -146,7 +149,7 @@ final class FloatBufferImpl extends FloatBuffer
}
/**
- * Absolute put method. Writes <code>value</value> to position
+ * Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
*
* @exception IndexOutOfBoundsException If index is negative or not smaller
diff --git a/libjava/java/nio/FloatViewBufferImpl.java b/libjava/java/nio/FloatViewBufferImpl.java
index 3dd0736fb49..5d074b5bed3 100644
--- a/libjava/java/nio/FloatViewBufferImpl.java
+++ b/libjava/java/nio/FloatViewBufferImpl.java
@@ -120,6 +120,11 @@ final class FloatViewBufferImpl extends FloatBuffer
position (count);
limit (capacity ());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/IntBufferImpl.java b/libjava/java/nio/IntBufferImpl.java
index f68dd92fa04..6b22d40fb21 100644
--- a/libjava/java/nio/IntBufferImpl.java
+++ b/libjava/java/nio/IntBufferImpl.java
@@ -1,5 +1,5 @@
/* IntBufferImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,6 +80,8 @@ final class IntBufferImpl extends IntBuffer
public IntBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -89,6 +91,7 @@ final class IntBufferImpl extends IntBuffer
}
position (copied);
+ limit(capacity());
return this;
}
@@ -146,7 +149,7 @@ final class IntBufferImpl extends IntBuffer
}
/**
- * Absolute put method. Writes <code>value</value> to position
+ * Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
*
* @exception IndexOutOfBoundsException If index is negative or not smaller
diff --git a/libjava/java/nio/IntViewBufferImpl.java b/libjava/java/nio/IntViewBufferImpl.java
index ff8b27be1a4..77b04a8c3c0 100644
--- a/libjava/java/nio/IntViewBufferImpl.java
+++ b/libjava/java/nio/IntViewBufferImpl.java
@@ -120,6 +120,11 @@ final class IntViewBufferImpl extends IntBuffer
position (count);
limit (capacity ());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/LongBufferImpl.java b/libjava/java/nio/LongBufferImpl.java
index df720eec62c..e82f7749cd5 100644
--- a/libjava/java/nio/LongBufferImpl.java
+++ b/libjava/java/nio/LongBufferImpl.java
@@ -1,5 +1,5 @@
/* LongBufferImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,6 +80,8 @@ final class LongBufferImpl extends LongBuffer
public LongBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -89,6 +91,7 @@ final class LongBufferImpl extends LongBuffer
}
position (copied);
+ limit(capacity());
return this;
}
@@ -146,7 +149,7 @@ final class LongBufferImpl extends LongBuffer
}
/**
- * Absolute put method. Writes <code>value</value> to position
+ * Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
*
* @exception IndexOutOfBoundsException If index is negative or not smaller
diff --git a/libjava/java/nio/LongViewBufferImpl.java b/libjava/java/nio/LongViewBufferImpl.java
index bfa64d0ad9a..e2054757871 100644
--- a/libjava/java/nio/LongViewBufferImpl.java
+++ b/libjava/java/nio/LongViewBufferImpl.java
@@ -120,6 +120,11 @@ final class LongViewBufferImpl extends LongBuffer
position (count);
limit (capacity ());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/MappedByteBufferImpl.java b/libjava/java/nio/MappedByteBufferImpl.java
index 63e0225bc51..fdb64c5bb0f 100644
--- a/libjava/java/nio/MappedByteBufferImpl.java
+++ b/libjava/java/nio/MappedByteBufferImpl.java
@@ -117,6 +117,8 @@ final class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer compact()
{
+ checkIfReadOnly();
+ mark = -1;
int pos = position();
if (pos > 0)
{
@@ -126,6 +128,11 @@ final class MappedByteBufferImpl extends MappedByteBuffer
position(count);
limit(capacity());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/ShortBufferImpl.java b/libjava/java/nio/ShortBufferImpl.java
index 28f6efbd804..05424322b27 100644
--- a/libjava/java/nio/ShortBufferImpl.java
+++ b/libjava/java/nio/ShortBufferImpl.java
@@ -1,5 +1,5 @@
/* ShortBufferImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,6 +80,8 @@ final class ShortBufferImpl extends ShortBuffer
public ShortBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -89,6 +91,7 @@ final class ShortBufferImpl extends ShortBuffer
}
position (copied);
+ limit(capacity());
return this;
}
@@ -146,7 +149,7 @@ final class ShortBufferImpl extends ShortBuffer
}
/**
- * Absolute put method. Writes <code>value</value> to position
+ * Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
*
* @exception IndexOutOfBoundsException If index is negative or not smaller
diff --git a/libjava/java/nio/ShortViewBufferImpl.java b/libjava/java/nio/ShortViewBufferImpl.java
index acd6c233d07..f884ed54244 100644
--- a/libjava/java/nio/ShortViewBufferImpl.java
+++ b/libjava/java/nio/ShortViewBufferImpl.java
@@ -120,6 +120,11 @@ final class ShortViewBufferImpl extends ShortBuffer
position (count);
limit (capacity ());
}
+ else
+ {
+ position(limit());
+ limit(capacity());
+ }
return this;
}
diff --git a/libjava/java/nio/channels/Channel.java b/libjava/java/nio/channels/Channel.java
index 8e73f87f88f..5912695d053 100644
--- a/libjava/java/nio/channels/Channel.java
+++ b/libjava/java/nio/channels/Channel.java
@@ -1,5 +1,5 @@
/* Channel.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ public interface Channel
* Tells whether this channel is open or not
*
* @return <code>true</code>if channel is open,
- * </code>false</code> otherwise
+ * <code>false</code> otherwise
*/
boolean isOpen();
diff --git a/libjava/java/nio/channels/Channels.java b/libjava/java/nio/channels/Channels.java
index 3e5316efbe8..1da5d13193e 100644
--- a/libjava/java/nio/channels/Channels.java
+++ b/libjava/java/nio/channels/Channels.java
@@ -1,5 +1,5 @@
/* Channels.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,10 +35,12 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.nio.channels;
import gnu.java.nio.ChannelInputStream;
import gnu.java.nio.ChannelOutputStream;
+import gnu.java.nio.ChannelReader;
import gnu.java.nio.InputStreamChannel;
import gnu.java.nio.OutputStreamChannel;
import gnu.java.nio.channels.FileChannelImpl;
@@ -62,7 +64,10 @@ public final class Channels
/**
* This class isn't intended to be instantiated.
*/
- private Channels() {}
+ private Channels()
+ {
+ // Do nothing here.
+ }
/**
* Constructs a stream that reads bytes from the given channel.
@@ -111,7 +116,7 @@ public final class Channels
public static Reader newReader(ReadableByteChannel ch, CharsetDecoder dec,
int minBufferCap)
{
- throw new Error("not implemented");
+ return new ChannelReader(ch, dec, minBufferCap);
}
/**
@@ -133,6 +138,7 @@ public final class Channels
public static Writer newWriter(WritableByteChannel ch, CharsetEncoder enc,
int minBufferCap)
{
+ // FIXME: implement java.nio.channels.Channel.newWriter(WritableByteChannel, CharsetEncoder, int)
throw new Error("not implemented");
}
diff --git a/libjava/java/nio/channels/IllegalBlockingModeException.java b/libjava/java/nio/channels/IllegalBlockingModeException.java
index 5b70c1f5814..e6a3a2c29df 100644
--- a/libjava/java/nio/channels/IllegalBlockingModeException.java
+++ b/libjava/java/nio/channels/IllegalBlockingModeException.java
@@ -1,5 +1,5 @@
/* IllegalBlockingModeException.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ package java.nio.channels;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
* @since 1.4
*
* Written using JDK 1.4.1 Online API from Sun
diff --git a/libjava/java/nio/charset/Charset.java b/libjava/java/nio/charset/Charset.java
index 5bb78f63ca9..c7672c1c3df 100644
--- a/libjava/java/nio/charset/Charset.java
+++ b/libjava/java/nio/charset/Charset.java
@@ -117,9 +117,24 @@ public abstract class Charset implements Comparable
{
return charsetForName (charsetName) != null;
}
-
+
+ /**
+ * Returns the Charset instance for the charset of the given name.
+ *
+ * @param charsetName
+ * @return
+ * @throws UnsupportedCharsetException if this VM does not support
+ * the charset of the given name.
+ * @throws IllegalCharsetNameException if the given charset name is
+ * legal.
+ * @throws IllegalArgumentException if <code>charsetName</code> is null.
+ */
public static Charset forName (String charsetName)
{
+ // Throws IllegalArgumentException as the JDK does.
+ if(charsetName == null)
+ throw new IllegalArgumentException("Charset name must not be null.");
+
Charset cs = charsetForName (charsetName);
if (cs == null)
throw new UnsupportedCharsetException (charsetName);
@@ -132,19 +147,19 @@ public abstract class Charset implements Comparable
* Retrieves a charset for the given charset name.
*
* @return A charset object for the charset with the specified name, or
- * <code>null</code> if no such charset exists.
+ * <code>null</code> if no such charset exists.
*
* @throws IllegalCharsetNameException if the name is illegal
*/
- private static Charset charsetForName (String charsetName)
+ private static Charset charsetForName(String charsetName)
{
checkName (charsetName);
return provider ().charsetForName (charsetName);
}
- public static SortedMap availableCharsets ()
+ public static SortedMap availableCharsets()
{
- TreeMap charsets = new TreeMap (String.CASE_INSENSITIVE_ORDER);
+ TreeMap charsets = new TreeMap(String.CASE_INSENSITIVE_ORDER);
for (Iterator i = provider ().charsets (); i.hasNext (); )
{
@@ -152,15 +167,15 @@ public abstract class Charset implements Comparable
charsets.put (cs.name (), cs);
}
- return Collections.unmodifiableSortedMap (charsets);
+ return Collections.unmodifiableSortedMap(charsets);
}
// XXX: we need to support multiple providers, reading them from
// java.nio.charset.spi.CharsetProvider in the resource directory
// META-INF/services
- private static CharsetProvider provider ()
+ private static CharsetProvider provider()
{
- return Provider.provider ();
+ return Provider.provider();
}
public final String name ()
diff --git a/libjava/java/nio/charset/spi/CharsetProvider.java b/libjava/java/nio/charset/spi/CharsetProvider.java
index 1af7a8ef314..3cbc14b991c 100644
--- a/libjava/java/nio/charset/spi/CharsetProvider.java
+++ b/libjava/java/nio/charset/spi/CharsetProvider.java
@@ -52,7 +52,7 @@ import java.util.Iterator;
* ignored, and '#' starts comments. Duplicates are ignored. The
* implementations must be accessible to the classloader that requests them.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Charset
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/rmi/server/RemoteObject.java b/libjava/java/rmi/server/RemoteObject.java
index 1bc7648c8fc..6dca07f8e1a 100644
--- a/libjava/java/rmi/server/RemoteObject.java
+++ b/libjava/java/rmi/server/RemoteObject.java
@@ -45,14 +45,17 @@ import java.lang.reflect.Constructor;
import java.rmi.NoSuchObjectException;
import java.rmi.Remote;
import java.rmi.UnmarshalException;
+import java.util.WeakHashMap;
public abstract class RemoteObject
implements Remote, Serializable {
-public static final long serialVersionUID = -3215090123894869218l;
+private static final long serialVersionUID = -3215090123894869218l;
protected transient RemoteRef ref;
+private static final WeakHashMap stubs = new WeakHashMap();
+
protected RemoteObject() {
this(null);
}
@@ -65,21 +68,24 @@ public RemoteRef getRef() {
return (ref);
}
+synchronized static void addStub(Remote obj, Remote stub)
+{
+ stubs.put(obj, stub);
+}
+
+synchronized static void deleteStub(Remote obj)
+{
+ stubs.remove(obj);
+}
+
public static Remote toStub(Remote obj) throws NoSuchObjectException
{
- Class cls = obj.getClass();
- String classname = cls.getName();
- ClassLoader cl = cls.getClassLoader();
- try
- {
- Class scls = cl.loadClass(classname + "_Stub");
- // JDK 1.2 stubs
- Class[] stubprototype = new Class[] { RemoteRef.class };
- Constructor con = scls.getConstructor(stubprototype);
- return (Remote)(con.newInstance(new Object[]{obj}));
- }
- catch (Exception e) {}
- throw new NoSuchObjectException(obj.getClass().getName());
+ Remote stub = (Remote)stubs.get(obj);
+
+ if (stub == null)
+ throw new NoSuchObjectException(obj.getClass().getName());
+
+ return stub;
}
public int hashCode() {
diff --git a/libjava/java/rmi/server/RemoteRef.java b/libjava/java/rmi/server/RemoteRef.java
index a3f22c27a66..89cee1256b2 100644
--- a/libjava/java/rmi/server/RemoteRef.java
+++ b/libjava/java/rmi/server/RemoteRef.java
@@ -46,7 +46,7 @@ import java.rmi.RemoteException;
public interface RemoteRef extends Externalizable
{
- long serialVersionUID = 0;
+ long serialVersionUID = 3632638527362204081L;
String packagePrefix = "gnu.java.rmi.server";
diff --git a/libjava/java/rmi/server/ServerRef.java b/libjava/java/rmi/server/ServerRef.java
index a6e986750ba..906b1269889 100644
--- a/libjava/java/rmi/server/ServerRef.java
+++ b/libjava/java/rmi/server/ServerRef.java
@@ -43,7 +43,7 @@ import java.rmi.RemoteException;
public interface ServerRef extends RemoteRef
{
- long serialVersionUID = 0;
+ long serialVersionUID = -4557750989390278438L;
RemoteStub exportObject(Remote obj, Object data) throws RemoteException;
diff --git a/libjava/java/rmi/server/UID.java b/libjava/java/rmi/server/UID.java
index c6fd30e463a..d472e69c995 100644
--- a/libjava/java/rmi/server/UID.java
+++ b/libjava/java/rmi/server/UID.java
@@ -45,7 +45,7 @@ import java.io.Serializable;
public final class UID implements Serializable
{
-public static final long serialVersionUID = 1086053664494604050L;
+private static final long serialVersionUID = 1086053664494604050L;
private static final Object lock = UID.class;
private static long baseTime = System.currentTimeMillis();
diff --git a/libjava/java/rmi/server/UnicastRemoteObject.java b/libjava/java/rmi/server/UnicastRemoteObject.java
index 6e8fb253820..ed296f03341 100644
--- a/libjava/java/rmi/server/UnicastRemoteObject.java
+++ b/libjava/java/rmi/server/UnicastRemoteObject.java
@@ -98,7 +98,9 @@ public static RemoteStub exportObject(Remote obj) throws RemoteException {
{
sref = new UnicastServerRef(new ObjID (), port, ssf);
}
- return (sref.exportObject (obj));
+ Remote stub = sref.exportObject (obj);
+ addStub(obj, stub);
+ return stub;
}
/**
@@ -116,12 +118,15 @@ public static RemoteStub exportObject(Remote obj) throws RemoteException {
{
if (obj instanceof RemoteObject)
{
+ deleteStub(obj);
UnicastServerRef sref = (UnicastServerRef)((RemoteObject)obj).getRef();
return sref.unexportObject(obj, force);
}
else
- //FIX ME
- ;
+ {
+ //FIX ME
+ ;
+ }
return true;
}
diff --git a/libjava/java/security/AccessControlException.java b/libjava/java/security/AccessControlException.java
index ff8b5a93fb3..d7b1f2926a4 100644
--- a/libjava/java/security/AccessControlException.java
+++ b/libjava/java/security/AccessControlException.java
@@ -1,5 +1,5 @@
/* AccessControlException.java -- Permission is denied
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.security;
* an attempt to perform an operation. This often keeps track of the
* permission that was not granted.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see AccessController
* @status updated to 1.4
*/
diff --git a/libjava/java/security/AlgorithmParameterGenerator.java b/libjava/java/security/AlgorithmParameterGenerator.java
index cf245da5a62..ed2f344010b 100644
--- a/libjava/java/security/AlgorithmParameterGenerator.java
+++ b/libjava/java/security/AlgorithmParameterGenerator.java
@@ -174,7 +174,7 @@ public class AlgorithmParameterGenerator
Provider p = Security.getProvider(provider);
if (p == null)
- throw new NoSuchProviderException();
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
diff --git a/libjava/java/security/AlgorithmParameters.java b/libjava/java/security/AlgorithmParameters.java
index afeb843a97e..8ccd40a317c 100644
--- a/libjava/java/security/AlgorithmParameters.java
+++ b/libjava/java/security/AlgorithmParameters.java
@@ -178,7 +178,7 @@ public class AlgorithmParameters
Provider p = Security.getProvider(provider);
if (p == null)
- throw new NoSuchProviderException();
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
diff --git a/libjava/java/security/AllPermission.java b/libjava/java/security/AllPermission.java
index 32d0b45f57c..e7f316917c2 100644
--- a/libjava/java/security/AllPermission.java
+++ b/libjava/java/security/AllPermission.java
@@ -1,5 +1,5 @@
/* AllPermission.java -- Permission to do anything
- Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -135,64 +135,64 @@ public final class AllPermission extends Permission
{
return new AllPermissionCollection();
}
-} // class AllPermission
-
-/**
- * Implements AllPermission.newPermissionCollection, and obeys serialization
- * of JDK.
- *
- * @author Eric Blake <ebb9@email.byu.edu>
- */
-final class AllPermissionCollection extends PermissionCollection
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -4023755556366636806L;
-
- /**
- * Whether an AllPermission has been added to the collection.
- *
- * @serial if all permission is in the collection yet
- */
- private boolean all_allowed;
-
- /**
- * Add an AllPermission.
- *
- * @param perm the permission to add
- * @throws IllegalArgumentException if perm is not an AllPermission
- * @throws SecurityException if the collection is read-only
- */
- public void add(Permission perm)
- {
- if (isReadOnly())
- throw new SecurityException();
- if (! (perm instanceof AllPermission))
- throw new IllegalArgumentException();
- all_allowed = true;
- }
-
- /**
- * Returns true if this collection implies a permission.
- *
- * @param perm the permission to check
- * @return true if this collection contains an AllPermission
- */
- public boolean implies(Permission perm)
- {
- return all_allowed;
- }
/**
- * Returns an enumeration of the elements in the collection.
+ * Implements AllPermission.newPermissionCollection, and obeys serialization
+ * of JDK.
*
- * @return the elements in the collection
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
- public Enumeration elements()
+ private static final class AllPermissionCollection extends PermissionCollection
{
- return all_allowed
- ? Collections.enumeration(Collections.singleton(new AllPermission()))
- : EmptyEnumeration.getInstance();
- }
-} // class AllPermissionCollection
+ /**
+ * Compatible with JDK 1.1+.
+ */
+ private static final long serialVersionUID = -4023755556366636806L;
+
+ /**
+ * Whether an AllPermission has been added to the collection.
+ *
+ * @serial if all permission is in the collection yet
+ */
+ private boolean all_allowed;
+
+ /**
+ * Add an AllPermission.
+ *
+ * @param perm the permission to add
+ * @throws IllegalArgumentException if perm is not an AllPermission
+ * @throws SecurityException if the collection is read-only
+ */
+ public void add(Permission perm)
+ {
+ if (isReadOnly())
+ throw new SecurityException();
+ if (! (perm instanceof AllPermission))
+ throw new IllegalArgumentException();
+ all_allowed = true;
+ }
+
+ /**
+ * Returns true if this collection implies a permission.
+ *
+ * @param perm the permission to check
+ * @return true if this collection contains an AllPermission
+ */
+ public boolean implies(Permission perm)
+ {
+ return all_allowed;
+ }
+
+ /**
+ * Returns an enumeration of the elements in the collection.
+ *
+ * @return the elements in the collection
+ */
+ public Enumeration elements()
+ {
+ return all_allowed
+ ? Collections.enumeration(Collections.singleton(new AllPermission()))
+ : EmptyEnumeration.getInstance();
+ }
+ } // class AllPermissionCollection
+} // class AllPermission
diff --git a/libjava/java/security/BasicPermission.java b/libjava/java/security/BasicPermission.java
index fef0b87a8ad..741f2b02464 100644
--- a/libjava/java/security/BasicPermission.java
+++ b/libjava/java/security/BasicPermission.java
@@ -1,5 +1,5 @@
/* BasicPermission.java -- implements a simple named permission
- Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -58,8 +58,8 @@ import java.util.Hashtable;
* <p>This class ignores the action list. Subclasses can choose to implement
* actions on top of this class if desired.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Permission
* @see Permissions
* @see PermissionCollection
@@ -72,8 +72,9 @@ import java.util.Hashtable;
* @since 1.1
* @status updated to 1.4
*/
-public abstract class BasicPermission extends Permission
+public abstract class BasicPermission extends java.security.Permission
implements Serializable
+ // FIXME extends with fully qualified classname as workaround for gcj 3.3.
{
/**
* Compatible with JDK 1.1+.
@@ -197,111 +198,111 @@ public abstract class BasicPermission extends Permission
{
return new BasicPermissionCollection(getClass());
}
-} // class BasicPermission
-/**
- * Implements AllPermission.newPermissionCollection, and obeys serialization
- * of JDK.
- *
- * @author Eric Blake <ebb9@email.byu.edu>
- */
-final class BasicPermissionCollection extends PermissionCollection
-{
/**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = 739301742472979399L;
-
- /**
- * The permissions in the collection.
+ * Implements AllPermission.newPermissionCollection, and obeys serialization
+ * of JDK.
*
- * @serial a hash mapping name to permissions, all of type permClass
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
- private final Hashtable permissions = new Hashtable();
+ private static final class BasicPermissionCollection extends PermissionCollection
+ {
+ /**
+ * Compatible with JDK 1.1+.
+ */
+ private static final long serialVersionUID = 739301742472979399L;
- /**
- * If "*" is in the collection.
- *
- * @serial true if a permission named "*" is in the collection
- */
- private boolean all_allowed;
+ /**
+ * The permissions in the collection.
+ *
+ * @serial a hash mapping name to permissions, all of type permClass
+ */
+ private final Hashtable permissions = new Hashtable();
- /**
- * The runtime class which all entries in the table must belong to.
- *
- * @serial the limiting subclass of this collection
- */
- private final Class permClass;
+ /**
+ * If "*" is in the collection.
+ *
+ * @serial true if a permission named "*" is in the collection
+ */
+ private boolean all_allowed;
- /**
- * Construct a collection over the given runtime class.
- *
- * @param c the class
- */
- BasicPermissionCollection(Class c)
- {
- permClass = c;
- }
+ /**
+ * The runtime class which all entries in the table must belong to.
+ *
+ * @serial the limiting subclass of this collection
+ */
+ private final Class permClass;
- /**
- * Add a Permission. It must be of the same type as the permission which
- * created this collection.
- *
- * @param perm the permission to add
- * @throws IllegalArgumentException if perm is not the correct type
- * @throws SecurityException if the collection is read-only
- */
- public void add(Permission perm)
- {
- if (isReadOnly())
- throw new SecurityException("readonly");
- if (! permClass.isInstance(perm))
- throw new IllegalArgumentException("Expecting instance of " + permClass);
- BasicPermission bp = (BasicPermission) perm;
- String name = bp.getName();
- if (name.equals("*"))
- all_allowed = true;
- permissions.put(name, bp);
- }
+ /**
+ * Construct a collection over the given runtime class.
+ *
+ * @param c the class
+ */
+ BasicPermissionCollection(Class c)
+ {
+ permClass = c;
+ }
- /**
- * Returns true if this collection implies the given permission.
- *
- * @param permission the permission to check
- * @return true if it is implied by this
- */
- public boolean implies(Permission permission)
- {
- if (! permClass.isInstance(permission))
- return false;
- if (all_allowed)
- return true;
- BasicPermission toImply = (BasicPermission) permission;
- String name = toImply.getName();
- if (name.equals("*"))
- return false;
- int prefixLength = name.length();
- if (name.endsWith("*"))
- prefixLength -= 2;
+ /**
+ * Add a Permission. It must be of the same type as the permission which
+ * created this collection.
+ *
+ * @param perm the permission to add
+ * @throws IllegalArgumentException if perm is not the correct type
+ * @throws SecurityException if the collection is read-only
+ */
+ public void add(Permission perm)
+ {
+ if (isReadOnly())
+ throw new SecurityException("readonly");
+ if (! permClass.isInstance(perm))
+ throw new IllegalArgumentException("Expecting instance of " + permClass);
+ BasicPermission bp = (BasicPermission) perm;
+ String name = bp.getName();
+ if (name.equals("*"))
+ all_allowed = true;
+ permissions.put(name, bp);
+ }
- while (true)
- {
- if (permissions.get(name) != null)
- return true;
- prefixLength = name.lastIndexOf('.', prefixLength);
- if (prefixLength < 0)
- return false;
- name = name.substring(0, prefixLength + 1) + '*';
- }
- }
+ /**
+ * Returns true if this collection implies the given permission.
+ *
+ * @param permission the permission to check
+ * @return true if it is implied by this
+ */
+ public boolean implies(Permission permission)
+ {
+ if (! permClass.isInstance(permission))
+ return false;
+ if (all_allowed)
+ return true;
+ BasicPermission toImply = (BasicPermission) permission;
+ String name = toImply.getName();
+ if (name.equals("*"))
+ return false;
+ int prefixLength = name.length();
+ if (name.endsWith("*"))
+ prefixLength -= 2;
- /**
- * Enumerate over the collection.
- *
- * @return an enumeration of the collection contents
- */
- public Enumeration elements()
- {
- return permissions.elements();
- }
-} // class BasicPermissionCollection
+ while (true)
+ {
+ if (permissions.get(name) != null)
+ return true;
+ prefixLength = name.lastIndexOf('.', prefixLength);
+ if (prefixLength < 0)
+ return false;
+ name = name.substring(0, prefixLength + 1) + '*';
+ }
+ }
+
+ /**
+ * Enumerate over the collection.
+ *
+ * @return an enumeration of the collection contents
+ */
+ public Enumeration elements()
+ {
+ return permissions.elements();
+ }
+ } // class BasicPermissionCollection
+} // class BasicPermission
diff --git a/libjava/java/security/DigestException.java b/libjava/java/security/DigestException.java
index f5c8d627de6..bc672420207 100644
--- a/libjava/java/security/DigestException.java
+++ b/libjava/java/security/DigestException.java
@@ -1,5 +1,5 @@
/* DigestException.java -- A generic message digest exception
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This exception indicates that a generic message digest exception has
* occurred.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class DigestException extends GeneralSecurityException
diff --git a/libjava/java/security/DigestInputStream.java b/libjava/java/security/DigestInputStream.java
index 2ca9d1b3956..e8d2b63fdfc 100644
--- a/libjava/java/security/DigestInputStream.java
+++ b/libjava/java/security/DigestInputStream.java
@@ -1,5 +1,5 @@
/* DigestInputStream.java --- An Input stream tied to a message digest
- Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import java.io.InputStream;
* in the message digest.
*
* @version 0.0
- * @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ * @author Mark Benvenuto (ivymccough@worldnet.att.net)
*/
public class DigestInputStream extends FilterInputStream
{
diff --git a/libjava/java/security/DigestOutputStream.java b/libjava/java/security/DigestOutputStream.java
index caf059bf40e..d95533c97cc 100644
--- a/libjava/java/security/DigestOutputStream.java
+++ b/libjava/java/security/DigestOutputStream.java
@@ -1,5 +1,5 @@
/* DigestOutputStream.java --- An output stream tied to a message digest
- Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import java.io.OutputStream;
* message digest.
*
* @version 0.0
- * @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ * @author Mark Benvenuto (ivymccough@worldnet.att.net)
*/
public class DigestOutputStream extends FilterOutputStream
{
diff --git a/libjava/java/security/GeneralSecurityException.java b/libjava/java/security/GeneralSecurityException.java
index d1db3c5d6fb..8a26e85cd50 100644
--- a/libjava/java/security/GeneralSecurityException.java
+++ b/libjava/java/security/GeneralSecurityException.java
@@ -1,5 +1,5 @@
/* GeneralSecurityException.java -- Common superclass of security exceptions
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.security;
* (<code>RuntimeException</code>), and <code>InvalidParamterException</code>
* (<code>IllegalArgumentException</code>).
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class GeneralSecurityException extends Exception
diff --git a/libjava/java/security/Guard.java b/libjava/java/security/Guard.java
index 2654ba70c04..8a2ab0f0f5f 100644
--- a/libjava/java/security/Guard.java
+++ b/libjava/java/security/Guard.java
@@ -1,5 +1,5 @@
/* Guard.java -- Check access to a guarded object
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This interface specifies a mechanism for querying whether or not
* access is allowed to a guarded object.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see GuardedObject
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/security/GuardedObject.java b/libjava/java/security/GuardedObject.java
index a4cdf74bd3e..5aeaf91e385 100644
--- a/libjava/java/security/GuardedObject.java
+++ b/libjava/java/security/GuardedObject.java
@@ -1,5 +1,5 @@
/* GuardedObject.java -- An object protected by a Guard
- Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import java.io.Serializable;
* <code>Guard</code>. If the <code>Guard</code> disallows access, an
* exception will be thrown.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.1
* @status updated to 1.4
*/
diff --git a/libjava/java/security/InvalidAlgorithmParameterException.java b/libjava/java/security/InvalidAlgorithmParameterException.java
index 40f953079be..5b2ada1bfb9 100644
--- a/libjava/java/security/InvalidAlgorithmParameterException.java
+++ b/libjava/java/security/InvalidAlgorithmParameterException.java
@@ -1,6 +1,6 @@
/* InvalidAlgorithmParameterException.java -- an invalid parameter to a
security algorithm
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
/**
* Thrown for an invalid security algorithm parameter.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/security/InvalidKeyException.java b/libjava/java/security/InvalidKeyException.java
index 373e8625a68..ce6b8e5cd54 100644
--- a/libjava/java/security/InvalidKeyException.java
+++ b/libjava/java/security/InvalidKeyException.java
@@ -40,7 +40,7 @@ package java.security;
/**
* Thrown for an invalid key.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class InvalidKeyException extends KeyException
diff --git a/libjava/java/security/InvalidParameterException.java b/libjava/java/security/InvalidParameterException.java
index 220899197fa..f54d819de81 100644
--- a/libjava/java/security/InvalidParameterException.java
+++ b/libjava/java/security/InvalidParameterException.java
@@ -41,7 +41,7 @@ package java.security;
* Thrown when an invalid parameter is passed to a method of the JCA/JCE
* engine classes.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @status updated to 1.4
*/
public class InvalidParameterException extends IllegalArgumentException
diff --git a/libjava/java/security/Key.java b/libjava/java/security/Key.java
index 195e50bb527..5e74be9da9a 100644
--- a/libjava/java/security/Key.java
+++ b/libjava/java/security/Key.java
@@ -1,5 +1,5 @@
/* Key.java -- A abstract representation of a digital key
- Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import java.io.Serializable;
* keys may be serialized. Keys are generally obtained through key generators,
* including {@link KeyFactory}.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see PublicKey
* @see PrivateKey
* @see KeyPair
diff --git a/libjava/java/security/KeyException.java b/libjava/java/security/KeyException.java
index 3b7d3886e15..8d69a569318 100644
--- a/libjava/java/security/KeyException.java
+++ b/libjava/java/security/KeyException.java
@@ -1,5 +1,5 @@
/* KeyException.java -- Thrown when there is a problem with a key
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package java.security;
/**
* This exception is thrown when there is a problem with a key.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Key
* @status updated to 1.4
*/
diff --git a/libjava/java/security/KeyFactory.java b/libjava/java/security/KeyFactory.java
index 27171f50966..02709f4c8f3 100644
--- a/libjava/java/security/KeyFactory.java
+++ b/libjava/java/security/KeyFactory.java
@@ -163,7 +163,7 @@ public class KeyFactory
Provider p = Security.getProvider(provider);
if (p == null)
- throw new NoSuchProviderException();
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
diff --git a/libjava/java/security/KeyManagementException.java b/libjava/java/security/KeyManagementException.java
index 52c2786294f..ca642ba3422 100644
--- a/libjava/java/security/KeyManagementException.java
+++ b/libjava/java/security/KeyManagementException.java
@@ -1,5 +1,5 @@
/* KeyManagementException.java -- an exception in key management
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This exception is thrown whenever a problem related to the management of
* security keys is encountered.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Key
* @status updated to 1.4
*/
diff --git a/libjava/java/security/KeyStore.java b/libjava/java/security/KeyStore.java
index 99aaed3f123..f1e874786f5 100644
--- a/libjava/java/security/KeyStore.java
+++ b/libjava/java/security/KeyStore.java
@@ -164,7 +164,7 @@ public class KeyStore
Provider p = Security.getProvider(provider);
if (p == null)
- throw new NoSuchProviderException();
+ throw new NoSuchProviderException(provider);
return getInstance(type, p);
}
diff --git a/libjava/java/security/KeyStoreException.java b/libjava/java/security/KeyStoreException.java
index 369587a5984..8f45a555c52 100644
--- a/libjava/java/security/KeyStoreException.java
+++ b/libjava/java/security/KeyStoreException.java
@@ -1,5 +1,5 @@
/* KeyStoreException.java -- Indicates a problem with the key store
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package java.security;
/**
* Indicates a problem with the key store.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/security/MessageDigestSpi.java b/libjava/java/security/MessageDigestSpi.java
index f2447f17d86..036392ea928 100644
--- a/libjava/java/security/MessageDigestSpi.java
+++ b/libjava/java/security/MessageDigestSpi.java
@@ -1,5 +1,5 @@
/* MessageDigestSpi.java --- The message digest service provider interface.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ package java.security;
@version 0.0
- @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ @author Mark Benvenuto (ivymccough@worldnet.att.net)
*/
public abstract class MessageDigestSpi
{
diff --git a/libjava/java/security/NoSuchAlgorithmException.java b/libjava/java/security/NoSuchAlgorithmException.java
index 31e00537a50..7d167dd0e8f 100644
--- a/libjava/java/security/NoSuchAlgorithmException.java
+++ b/libjava/java/security/NoSuchAlgorithmException.java
@@ -1,5 +1,5 @@
/* NoSuchAlgorithmException.java -- an algorithm was not available
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This exception is thrown when the requested security algorithm is
* not available
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class NoSuchAlgorithmException extends GeneralSecurityException
diff --git a/libjava/java/security/NoSuchProviderException.java b/libjava/java/security/NoSuchProviderException.java
index 546b2dc6190..e676046aefd 100644
--- a/libjava/java/security/NoSuchProviderException.java
+++ b/libjava/java/security/NoSuchProviderException.java
@@ -1,5 +1,5 @@
/* NoSuchProviderException.java -- thrown when a provider is not found
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This exception is thrown when the requested security provider is
* not available.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class NoSuchProviderException extends GeneralSecurityException
diff --git a/libjava/java/security/Permission.java b/libjava/java/security/Permission.java
index 58702da2c0c..4310500ca45 100644
--- a/libjava/java/security/Permission.java
+++ b/libjava/java/security/Permission.java
@@ -1,5 +1,5 @@
/* Permission.java -- The superclass for all permission objects
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ import java.io.Serializable;
* <p><code>Permission</code>'s must be immutable - do not change their
* state after creation.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Permissions
* @see PermissionCollection
* @since 1.1
diff --git a/libjava/java/security/PermissionCollection.java b/libjava/java/security/PermissionCollection.java
index 703767ed9a9..337a8fca937 100644
--- a/libjava/java/security/PermissionCollection.java
+++ b/libjava/java/security/PermissionCollection.java
@@ -1,5 +1,5 @@
/* PermissionCollection.java -- A collection of permission objects
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,8 +67,8 @@ import java.util.Enumeration;
* in any type of collection unless it overrides that method to create its
* own collection type.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Permission
* @see Permissions
* @since 1.1
diff --git a/libjava/java/security/Permissions.java b/libjava/java/security/Permissions.java
index d44341c947a..b603dedcf86 100644
--- a/libjava/java/security/Permissions.java
+++ b/libjava/java/security/Permissions.java
@@ -1,5 +1,5 @@
/* Permissions.java -- a collection of permission collections
- Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,8 +53,8 @@ import java.util.NoSuchElementException;
* collection type which stores its permissions in a hash table will be
* used.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.1
*/
public final class Permissions extends PermissionCollection
@@ -188,58 +188,67 @@ public final class Permissions extends PermissionCollection
}
};
}
-} // class Permissions
-
-/**
- * Implements the permission collection for all permissions without one of
- * their own, and obeys serialization of JDK.
- *
- * @author Eric Blake <ebb9@email.byu.edu>
- */
-class PermissionsHash extends PermissionCollection
-{
- /**
- * Compatible with JDK 1.1+.
- */
- private static final long serialVersionUID = -8491988220802933440L;
-
- /**
- * Hashtable where we store permissions.
- *
- * @serial the stored permissions, both as key and value
- */
- private final Hashtable perms = new Hashtable();
-
- /**
- * Add a permission. We don't need to check for read-only, as this
- * collection is never exposed outside of Permissions, which has already
- * done that check.
- *
- * @param perm the permission to add
- */
- public void add(Permission perm)
- {
- perms.put(perm, perm);
- }
-
- /**
- * Returns true if perm is in the collection.
- *
- * @param perm the permission to check
- * @return true if it is implied
- */
- public boolean implies(Permission perm)
- {
- return perms.get(perm) != null;
- }
/**
- * Return the elements.
+ * Implements the permission collection for all permissions without one of
+ * their own, and obeys serialization of JDK.
*
- * @return the elements
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
- public Enumeration elements()
+ private static final class PermissionsHash extends PermissionCollection
{
- return perms.elements();
- }
+ /**
+ * Compatible with JDK 1.1+.
+ */
+ private static final long serialVersionUID = -8491988220802933440L;
+
+ /**
+ * Hashtable where we store permissions.
+ *
+ * @serial the stored permissions, both as key and value
+ */
+ private final Hashtable perms = new Hashtable();
+
+ /**
+ * Add a permission. We don't need to check for read-only, as this
+ * collection is never exposed outside of Permissions, which has already
+ * done that check.
+ *
+ * @param perm the permission to add
+ */
+ public void add(Permission perm)
+ {
+ perms.put(perm, perm);
+ }
+
+ /**
+ * Returns true if perm is in the collection.
+ *
+ * @param perm the permission to check
+ * @return true if it is implied
+ */
+ // FIXME: Should this method be synchronized?
+ public boolean implies(Permission perm)
+ {
+ Enumeration elements = elements();
+
+ while (elements.hasMoreElements())
+ {
+ Permission p = (Permission)elements.nextElement();
+ if (p.implies(perm))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Return the elements.
+ *
+ * @return the elements
+ */
+ public Enumeration elements()
+ {
+ return perms.elements();
+ }
+ } // class PermissionsHash
} // class Permissions
diff --git a/libjava/java/security/Principal.java b/libjava/java/security/Principal.java
index 2ac69b2c563..69990b8f8a7 100644
--- a/libjava/java/security/Principal.java
+++ b/libjava/java/security/Principal.java
@@ -1,5 +1,5 @@
/* Principal.java -- A security entity
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.security;
* This interface models an entity (such as a user or a certificate authority)
* for the purposes of applying the Java security model.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see X509Certificate
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/security/PrivateKey.java b/libjava/java/security/PrivateKey.java
index 40b97f58b9a..c4a628c4279 100644
--- a/libjava/java/security/PrivateKey.java
+++ b/libjava/java/security/PrivateKey.java
@@ -1,5 +1,5 @@
/* PrivateKey.java -- tagging interface for all private keys
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.security;
* This interface specified no methods. In simply provides a common
* super-interface for all algorithm specific private key values.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Key
* @see PublicKey
* @see Certificate
diff --git a/libjava/java/security/PrivilegedActionException.java b/libjava/java/security/PrivilegedActionException.java
index 633a872cfe5..d699abd8766 100644
--- a/libjava/java/security/PrivilegedActionException.java
+++ b/libjava/java/security/PrivilegedActionException.java
@@ -1,5 +1,5 @@
/* PrivilegedActionException.java -- wrap an exception in a privileged action
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,8 +43,8 @@ package java.security;
* <code>AccessController.doPrivileged()</code> method. It wraps the
* actual exception thrown in the privileged code.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see PrivilegedExceptionAction
* @see AccessController#doPrivileged(PrivilegedExceptionAction)
* @see AccessController#doPrivileged(PrivilegedExceptionAction, AccessControlContext)
diff --git a/libjava/java/security/ProviderException.java b/libjava/java/security/ProviderException.java
index eac3eb064c8..5b0e86e9b8e 100644
--- a/libjava/java/security/ProviderException.java
+++ b/libjava/java/security/ProviderException.java
@@ -1,5 +1,5 @@
/* ProviderException.java -- Generic security provider runtime exception
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This exception indicates that a runtime problem was encounterd with
* a security provider.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class ProviderException extends RuntimeException
diff --git a/libjava/java/security/PublicKey.java b/libjava/java/security/PublicKey.java
index 81ab764615f..f2a331e6862 100644
--- a/libjava/java/security/PublicKey.java
+++ b/libjava/java/security/PublicKey.java
@@ -1,5 +1,5 @@
/* PublicKey.java -- tagging interface for all public keys
- Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This interface specified no methods. In simply provides a common
* super-interface for all algorithm specific public key values.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Key
* @see PrivateKey
* @see Certificate
diff --git a/libjava/java/security/SecureClassLoader.java b/libjava/java/security/SecureClassLoader.java
index 7546edc85e5..89b5e4effce 100644
--- a/libjava/java/security/SecureClassLoader.java
+++ b/libjava/java/security/SecureClassLoader.java
@@ -48,6 +48,8 @@ package java.security;
*/
public class SecureClassLoader extends ClassLoader
{
+ java.util.WeakHashMap protectionDomainCache = new java.util.WeakHashMap();
+
protected SecureClassLoader(ClassLoader parent)
{
super(parent);
@@ -80,11 +82,29 @@ public class SecureClassLoader extends ClassLoader
protected final Class defineClass(String name, byte[] b, int off, int len,
CodeSource cs)
{
- // FIXME: Need to cache ProtectionDomains according to 1.3 docs.
if (cs != null)
{
- ProtectionDomain protectionDomain
- = new ProtectionDomain(cs, getPermissions(cs), this, null);
+ ProtectionDomain protectionDomain;
+
+ synchronized (protectionDomainCache)
+ {
+ protectionDomain = (ProtectionDomain)protectionDomainCache.get(cs);
+ }
+
+ if (protectionDomain == null)
+ {
+ protectionDomain
+ = new ProtectionDomain(cs, getPermissions(cs), this, null);
+ synchronized (protectionDomainCache)
+ {
+ ProtectionDomain domain
+ = (ProtectionDomain)protectionDomainCache.get(cs);
+ if (domain == null)
+ protectionDomainCache.put(cs, protectionDomain);
+ else
+ protectionDomain = domain;
+ }
+ }
return super.defineClass(name, b, off, len, protectionDomain);
}
else
diff --git a/libjava/java/security/SecureRandom.java b/libjava/java/security/SecureRandom.java
index 5e410c0405c..5d200383843 100644
--- a/libjava/java/security/SecureRandom.java
+++ b/libjava/java/security/SecureRandom.java
@@ -1,5 +1,5 @@
/* SecureRandom.java --- Secure Random class implementation
- Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ import java.util.Random;
* keys and initialization vectors to the generation of random padding
* bytes.
*
- * @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ * @author Mark Benvenuto (ivymccough@worldnet.att.net)
* @author Casey Marshall
*/
public class SecureRandom extends Random
@@ -112,6 +112,10 @@ public class SecureRandom extends Random
provider = p[i];
return;
}
+ catch (ThreadDeath death)
+ {
+ throw death;
+ }
catch (Throwable t)
{
// Ignore.
@@ -214,7 +218,7 @@ public class SecureRandom extends Random
Provider p = Security.getProvider(provider);
if (p == null)
- throw new NoSuchProviderException();
+ throw new NoSuchProviderException(provider);
return getInstance(algorithm, p);
}
diff --git a/libjava/java/security/SecureRandomSpi.java b/libjava/java/security/SecureRandomSpi.java
index 6831173688f..5218a985899 100644
--- a/libjava/java/security/SecureRandomSpi.java
+++ b/libjava/java/security/SecureRandomSpi.java
@@ -1,5 +1,5 @@
/* SecureRandomSpi.java --- Secure Random Service Provider Interface
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.io.Serializable;
@since JDK 1.2
- @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ @author Mark Benvenuto (ivymccough@worldnet.att.net)
*/
public abstract class SecureRandomSpi implements Serializable
{
diff --git a/libjava/java/security/SignatureException.java b/libjava/java/security/SignatureException.java
index 8762b0683cc..daccdf09cf7 100644
--- a/libjava/java/security/SignatureException.java
+++ b/libjava/java/security/SignatureException.java
@@ -1,5 +1,5 @@
/* SignatureException.java -- Generic error in signature
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This exception is thrown when a problem is encountered with a
* digital signature.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class SignatureException extends GeneralSecurityException
diff --git a/libjava/java/security/SignatureSpi.java b/libjava/java/security/SignatureSpi.java
index 3b6bdbc99ab..3dd3e4f4952 100644
--- a/libjava/java/security/SignatureSpi.java
+++ b/libjava/java/security/SignatureSpi.java
@@ -49,7 +49,7 @@ import java.security.spec.AlgorithmParameterSpec;
* cryptographic service provider who wishes to supply the implementation of a
* particular signature algorithm.
*
- * @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ * @author Mark Benvenuto (ivymccough@worldnet.att.net)
* @since 1.2
* @see Signature
*/
diff --git a/libjava/java/security/SignedObject.java b/libjava/java/security/SignedObject.java
index 0d9f733e70d..f7ef0d5cb44 100644
--- a/libjava/java/security/SignedObject.java
+++ b/libjava/java/security/SignedObject.java
@@ -123,7 +123,7 @@ import java.io.Serializable;
* of signatures, resembling a chain of authorization and delegation.</li>
* </ul>
*
- * @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ * @author Mark Benvenuto (ivymccough@worldnet.att.net)
* @since 1.2
* @see Signature
*/
diff --git a/libjava/java/security/Signer.java b/libjava/java/security/Signer.java
index 425933a8cea..a9e20d42cab 100644
--- a/libjava/java/security/Signer.java
+++ b/libjava/java/security/Signer.java
@@ -45,7 +45,7 @@ package java.security;
* issue that should be handled by subclasses as appropriate to their intended
* use.</p>
*
- * @author Mark Benvenuto <ivymccough@worldnet.att.net>
+ * @author Mark Benvenuto (ivymccough@worldnet.att.net)
* @deprecated This class is no longer used. Its functionality has been replaced
* by <code>java.security.KeyStore</code>, the <code>java.security.cert</code>
* package, and <code>java.security.Principal</code>.
diff --git a/libjava/java/security/UnrecoverableKeyException.java b/libjava/java/security/UnrecoverableKeyException.java
index 3e93153ad7d..9708625a636 100644
--- a/libjava/java/security/UnrecoverableKeyException.java
+++ b/libjava/java/security/UnrecoverableKeyException.java
@@ -1,5 +1,5 @@
/* UnrecoverableKeyException.java -- Cannot recover a key from the key store
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security;
* This exception is thrown when a key cannot be recovered from the key
* store.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/java/security/UnresolvedPermission.java b/libjava/java/security/UnresolvedPermission.java
index c96bce0cc14..c1f6f049360 100644
--- a/libjava/java/security/UnresolvedPermission.java
+++ b/libjava/java/security/UnresolvedPermission.java
@@ -1,5 +1,5 @@
/* UnresolvedPermission.java -- Placeholder for unresolved permissions
- Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -207,7 +207,7 @@ public final class UnresolvedPermission extends Permission
* Implements the permission collection for unresolved permissions, and
* obeys serialization of JDK.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
class UnresolvedPermissionCollection extends PermissionCollection
{
diff --git a/libjava/java/security/acl/AclNotFoundException.java b/libjava/java/security/acl/AclNotFoundException.java
index a843fac1761..4462ffc3493 100644
--- a/libjava/java/security/acl/AclNotFoundException.java
+++ b/libjava/java/security/acl/AclNotFoundException.java
@@ -1,5 +1,5 @@
/* AclNotFoundException.java -- thrown when an ACL is not found
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security.acl;
* This exception is thrown when a requested access control list (ACL) is
* not found.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class AclNotFoundException extends Exception
diff --git a/libjava/java/security/acl/LastOwnerException.java b/libjava/java/security/acl/LastOwnerException.java
index be2815192fb..13e13907988 100644
--- a/libjava/java/security/acl/LastOwnerException.java
+++ b/libjava/java/security/acl/LastOwnerException.java
@@ -1,5 +1,5 @@
/* LastOwnerException.java -- User attempted to delete last ACL owner
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package java.security.acl;
* This exception is thrown when an attempt is made to delete the last owner
* of an access control list (ACL)
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @see Owner#deleteOwner(java.security.Principal, java.security.Principal)
* @status updated to 1.4
*/
diff --git a/libjava/java/security/acl/NotOwnerException.java b/libjava/java/security/acl/NotOwnerException.java
index 8b2739d9cc4..7c3a6c431a7 100644
--- a/libjava/java/security/acl/NotOwnerException.java
+++ b/libjava/java/security/acl/NotOwnerException.java
@@ -1,5 +1,5 @@
/* NotOwnerException.java -- Attempt to modify an unowned ACL
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.security.acl;
* the caller to be the owner of the access control list (ACL) when the caller
* is in fact not the owner of the ACL.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
* @status updated to 1.4
*/
public class NotOwnerException extends Exception
diff --git a/libjava/java/security/cert/CertPath.java b/libjava/java/security/cert/CertPath.java
index 53f42e752de..c57bd313bc1 100644
--- a/libjava/java/security/cert/CertPath.java
+++ b/libjava/java/security/cert/CertPath.java
@@ -1,5 +1,5 @@
/* CertPath.java -- a sequence of certificates
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,7 +54,7 @@ import java.util.List;
* the path is consolidated into a {@link CertPathRep}, which preserves the
* data regardless of the underlying implementation of the path.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status updated to 1.4
*/
@@ -63,7 +63,7 @@ public abstract class CertPath implements Serializable
/**
* The serialized representation of a path.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
protected static class CertPathRep implements Serializable
{
diff --git a/libjava/java/security/cert/CertPathBuilderException.java b/libjava/java/security/cert/CertPathBuilderException.java
index 7cfdb79e536..2db7d337c98 100644
--- a/libjava/java/security/cert/CertPathBuilderException.java
+++ b/libjava/java/security/cert/CertPathBuilderException.java
@@ -1,6 +1,6 @@
/* CertPathBuilderException.java -- wraps an exception during certificate
path building
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import java.security.GeneralSecurityException;
* Indicates a problem while using a <code>CertPathBuilder</code>, wrapping
* the lower exception. This class is not thread-safe.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see CertPathBuilder
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/security/cert/CertPathValidatorException.java b/libjava/java/security/cert/CertPathValidatorException.java
index e7b40b8d3d6..9c7ad03c925 100644
--- a/libjava/java/security/cert/CertPathValidatorException.java
+++ b/libjava/java/security/cert/CertPathValidatorException.java
@@ -1,6 +1,6 @@
/* CertPathValidatorException.java -- wraps an exception during validation
of a CertPath
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.security.GeneralSecurityException;
* it can store the path an index in that path that caused the problem. This
* class is not thread-safe.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see CertPathValidator
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/security/cert/CertStoreException.java b/libjava/java/security/cert/CertStoreException.java
index 7d7bd148e9a..d157b1dc950 100644
--- a/libjava/java/security/cert/CertStoreException.java
+++ b/libjava/java/security/cert/CertStoreException.java
@@ -1,5 +1,5 @@
/* CertStoreException.java -- wraps an exception during certificate storage
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import java.security.GeneralSecurityException;
* <code>CertStore</code>, wrapping the lower exception. This class is not
* thread-safe.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see CertStore
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/security/cert/CertificateFactory.java b/libjava/java/security/cert/CertificateFactory.java
index 31664401aea..6a9231703e4 100644
--- a/libjava/java/security/cert/CertificateFactory.java
+++ b/libjava/java/security/cert/CertificateFactory.java
@@ -138,7 +138,7 @@ public class CertificateFactory
{
Provider p = Security.getProvider(provider);
if( p == null)
- throw new NoSuchProviderException();
+ throw new NoSuchProviderException(provider);
return getInstance(type, p);
}
diff --git a/libjava/java/security/interfaces/DSAPrivateKey.java b/libjava/java/security/interfaces/DSAPrivateKey.java
index 4e6f13ddbe5..223db91e806 100644
--- a/libjava/java/security/interfaces/DSAPrivateKey.java
+++ b/libjava/java/security/interfaces/DSAPrivateKey.java
@@ -50,6 +50,11 @@ import java.security.PrivateKey;
public interface DSAPrivateKey extends DSAKey, PrivateKey
{
/**
+ * The version identifier used for serialization.
+ */
+ long serialVersionUID = 7776497482533790279L;
+
+ /**
* This method returns the value of the DSA private key
*/
BigInteger getX();
diff --git a/libjava/java/security/interfaces/DSAPublicKey.java b/libjava/java/security/interfaces/DSAPublicKey.java
index aec1c606dcd..3f8d211d295 100644
--- a/libjava/java/security/interfaces/DSAPublicKey.java
+++ b/libjava/java/security/interfaces/DSAPublicKey.java
@@ -50,6 +50,11 @@ import java.security.PublicKey;
public interface DSAPublicKey extends DSAKey, PublicKey
{
/**
+ * The version identifier used for serialization.
+ */
+ long serialVersionUID = 1234526332779022332L;
+
+ /**
* This method returns the value of the DSA public key
*/
BigInteger getY();
diff --git a/libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java b/libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
index 7e115fabcd1..68a5e448877 100644
--- a/libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
+++ b/libjava/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
@@ -54,6 +54,7 @@ public interface RSAMultiPrimePrivateCrtKey extends RSAPrivateKey
{
// Constants
// --------------------------------------------------------------------------
+ long serialVersionUID = 618058533534628008L;
// Methods
// --------------------------------------------------------------------------
diff --git a/libjava/java/security/interfaces/RSAPrivateCrtKey.java b/libjava/java/security/interfaces/RSAPrivateCrtKey.java
index 8af1bb9168e..1fb2881ed50 100644
--- a/libjava/java/security/interfaces/RSAPrivateCrtKey.java
+++ b/libjava/java/security/interfaces/RSAPrivateCrtKey.java
@@ -49,6 +49,8 @@ import java.math.BigInteger;
*/
public interface RSAPrivateCrtKey extends RSAPrivateKey
{
+ long serialVersionUID = -5682214253527700368L;
+
/**
* Returns the public exponent for this key
*
diff --git a/libjava/java/security/interfaces/RSAPrivateKey.java b/libjava/java/security/interfaces/RSAPrivateKey.java
index d287d67327a..b4e34292340 100644
--- a/libjava/java/security/interfaces/RSAPrivateKey.java
+++ b/libjava/java/security/interfaces/RSAPrivateKey.java
@@ -49,6 +49,8 @@ import java.security.PrivateKey;
*/
public interface RSAPrivateKey extends PrivateKey, RSAKey
{
+ long serialVersionUID = 5187144804936595022L;
+
/**
* Returns the private exponent value for this key
*
diff --git a/libjava/java/security/interfaces/RSAPublicKey.java b/libjava/java/security/interfaces/RSAPublicKey.java
index 22d64b1bb7a..9847ae9d257 100644
--- a/libjava/java/security/interfaces/RSAPublicKey.java
+++ b/libjava/java/security/interfaces/RSAPublicKey.java
@@ -49,6 +49,8 @@ import java.security.PublicKey;
*/
public interface RSAPublicKey extends PublicKey, RSAKey
{
+ long serialVersionUID = -8727434096241101194L;
+
/**
* Returns the public exponent value for this key
*
diff --git a/libjava/java/text/BreakIterator.java b/libjava/java/text/BreakIterator.java
index a79db8c5f23..7fbc16b5849 100644
--- a/libjava/java/text/BreakIterator.java
+++ b/libjava/java/text/BreakIterator.java
@@ -1,5 +1,5 @@
/* BreakIterator.java -- Breaks text into elements
- Copyright (C) 1998, 1999, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ import java.util.ResourceBundle;
* class will be valid upon creation. That is, their methods will
* not cause exceptions if called before you call setText().
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
* @date March 19, 1999
*/
diff --git a/libjava/java/text/ChoiceFormat.java b/libjava/java/text/ChoiceFormat.java
index ff3c9f667d9..3c390278b88 100644
--- a/libjava/java/text/ChoiceFormat.java
+++ b/libjava/java/text/ChoiceFormat.java
@@ -1,5 +1,5 @@
/* ChoiceFormat.java -- Format over a range of numbers
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -71,7 +71,7 @@ formats = { "file", "files" }</pre>
* array must be sorted in ascending order and the format string array
* must be the same length as the terminator array.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
* @date March 9, 1999
*/
diff --git a/libjava/java/text/CollationElementIterator.java b/libjava/java/text/CollationElementIterator.java
index 91f341f55b2..481b286c479 100644
--- a/libjava/java/text/CollationElementIterator.java
+++ b/libjava/java/text/CollationElementIterator.java
@@ -53,9 +53,9 @@ import java.util.ArrayList;
* <code>getCollationElementIterator</code> method on
* <code>RuleBasedCollator</code>.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Guilhem Lavaux <guilhem.lavaux@free.fr>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Guilhem Lavaux (guilhem.lavaux@free.fr)
*/
public final class CollationElementIterator
{
@@ -369,8 +369,9 @@ public final class CollationElementIterator
idx_idx += idxToMove;
idxToMove = 0;
}
- } else
- idx_idx += prefix.key.length();
+ }
+ else
+ idx_idx += prefix.key.length();
}
}
diff --git a/libjava/java/text/CollationKey.java b/libjava/java/text/CollationKey.java
index 4e6aca2635d..1fa380f3595 100644
--- a/libjava/java/text/CollationKey.java
+++ b/libjava/java/text/CollationKey.java
@@ -1,5 +1,5 @@
/* CollationKey.java -- Precomputed collation value
- Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,8 +59,8 @@ package java.text;
* <code>CollationKey</code> is created by calling the
* <code>getCollationKey</code> method on an instance of <code>Collator</code>.
*
- * @author Aaron M. Renn <arenn@urbanophile.com>
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Aaron M. Renn (arenn@urbanophile.com)
+ * @author Tom Tromey (tromey@cygnus.com)
* @date March 25, 1999
*/
public final class CollationKey implements Comparable
diff --git a/libjava/java/text/Collator.java b/libjava/java/text/Collator.java
index 6464d137041..4e634e1c137 100644
--- a/libjava/java/text/Collator.java
+++ b/libjava/java/text/Collator.java
@@ -1,5 +1,5 @@
/* Collator.java -- Perform locale dependent String comparisons.
- Copyright (C) 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -64,7 +64,7 @@ import java.util.ResourceBundle;
* are described in detail in the documentation for the methods and values
* that are related to them.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
* @date March 18, 1999
*/
diff --git a/libjava/java/text/DateFormat.java b/libjava/java/text/DateFormat.java
index 6fe4461b030..1571672dc43 100644
--- a/libjava/java/text/DateFormat.java
+++ b/libjava/java/text/DateFormat.java
@@ -1,5 +1,5 @@
/* DateFormat.java -- Class for formatting/parsing date/times
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.util.ResourceBundle;
import java.util.TimeZone;
/**
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @date October 25, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
@@ -70,29 +70,221 @@ public abstract class DateFormat extends Format implements Cloneable
/* These constants need to have these exact values. They
* correspond to index positions within the localPatternChars
- * string for a given locale. For example, the US locale uses
- * the string "GyMdkHmsSEDFwWahKz", where 'G' is the character
- * for era, 'y' for year, and so on down to 'z' for time zone.
+ * string for a given locale. Each locale may specify its
+ * own character for a particular field, but the position
+ * of these characters must correspond to an appropriate field
+ * number (as listed below), in order for their meaning to
+ * be determined. For example, the US locale uses
+ * the string "GyMdkHmsSEDFwWahKzYeugAZ", where 'G' is the character
+ * for era, 'y' for year, and so on down to 'Z' for time zone.
*/
+ /**
+ * Represents the position of the era
+ * pattern character in the array of
+ * localized pattern characters.
+ * For example, 'AD' is an era used
+ * in the Gregorian calendar system.
+ * In the U.S. locale, this is 'G'.
+ */
public static final int ERA_FIELD = 0;
+ /**
+ * Represents the position of the year
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'y'.
+ */
public static final int YEAR_FIELD = 1;
+ /**
+ * Represents the position of the month
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'M'.
+ */
public static final int MONTH_FIELD = 2;
+ /**
+ * Represents the position of the date
+ * or day of the month pattern character
+ * in the array of localized pattern
+ * characters. In the U.S. locale,
+ * this is 'd'.
+ */
public static final int DATE_FIELD = 3;
+ /**
+ * Represents the position of the 24
+ * hour pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'k'.
+ * This field numbers hours from 1 to 24.
+ */
public static final int HOUR_OF_DAY1_FIELD = 4;
+ /**
+ * Represents the position of the 24
+ * hour pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'H'.
+ * This field numbers hours from 0 to 23.
+ */
public static final int HOUR_OF_DAY0_FIELD = 5;
+ /**
+ * Represents the position of the minute
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'm'.
+ */
public static final int MINUTE_FIELD = 6;
+ /**
+ * Represents the position of the second
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 's'.
+ */
public static final int SECOND_FIELD = 7;
+ /**
+ * Represents the position of the millisecond
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'S'.
+ */
public static final int MILLISECOND_FIELD = 8;
+ /**
+ * Represents the position of the day of the
+ * week pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'E'.
+ */
public static final int DAY_OF_WEEK_FIELD = 9;
+ /**
+ * Represents the position of the day of the
+ * year pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'D'.
+ */
public static final int DAY_OF_YEAR_FIELD = 10;
+ /**
+ * Represents the position of the day of the
+ * week in the month pattern character in the
+ * array of localized pattern characters.
+ * In the U.S. locale, this is 'F'.
+ */
public static final int DAY_OF_WEEK_IN_MONTH_FIELD = 11;
+ /**
+ * Represents the position of the week of the
+ * year pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'w'.
+ */
public static final int WEEK_OF_YEAR_FIELD = 12;
+ /**
+ * Represents the position of the week of the
+ * month pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'W'.
+ */
public static final int WEEK_OF_MONTH_FIELD = 13;
+ /**
+ * Represents the position of the am/pm
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'a'.
+ */
public static final int AM_PM_FIELD = 14;
+ /**
+ * Represents the position of the 12
+ * hour pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'h'.
+ * This field numbers hours from 1 to 12.
+ */
public static final int HOUR1_FIELD = 15;
+ /**
+ * Represents the position of the 12
+ * hour pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'K'.
+ * This field numbers hours from 0 to 11.
+ */
public static final int HOUR0_FIELD = 16;
+ /**
+ * Represents the position of the generic
+ * timezone pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'z'.
+ */
public static final int TIMEZONE_FIELD = 17;
-
+ /**
+ * Represents the position of the ISO year
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'Y'.
+ * This is a GNU extension in accordance with
+ * the CLDR data used. This value may
+ * differ from the normal year value.
+ */
+ public static final int ISO_YEAR_FIELD = 18;
+ /**
+ * Represents the position of the localized
+ * day of the week pattern character in the
+ * array of localized pattern characters.
+ * In the U.S. locale, this is 'e'.
+ * This is a GNU extension in accordance with
+ * the CLDR data used. This value only
+ * differs from the day of the week with
+ * numeric formatting, in which case the
+ * locale's first day of the week is used.
+ */
+ public static final int LOCALIZED_DAY_OF_WEEK_FIELD = 19;
+ /**
+ * Represents the position of the extended year
+ * pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'u'.
+ * This is a GNU extension in accordance with
+ * the CLDR data used. This value modifies
+ * the year value, so as to incorporate the era.
+ * For example, in the Gregorian calendar system,
+ * the extended year is negative instead of being
+ * marked as BC.
+ */
+ public static final int EXTENDED_YEAR_FIELD = 20;
+ /**
+ * Represents the position of the modified Julian
+ * day pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'g'.
+ * This is a GNU extension in accordance with
+ * the CLDR data used. This value differs
+ * from the standard Julian day in that days
+ * are marked from midnight onwards rather than
+ * noon, and the local time zone affects the value.
+ * In simple terms, it can be thought of as all
+ * the date fields represented as a single number.
+ */
+ public static final int MODIFIED_JULIAN_DAY_FIELD = 21;
+ /**
+ * Represents the position of the millisecond
+ * in the day pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'A'.
+ * This is a GNU extension in accordance with
+ * the CLDR data used. This value represents
+ * all the time fields (excluding the time zone)
+ * numerically, giving the number of milliseconds
+ * into the day (e.g. 10 in the morning would
+ * be 10 * 60 * 60 * 1000). Any daylight savings
+ * offset also affects this value.
+ */
+ public static final int MILLISECOND_IN_DAY_FIELD = 22;
+ /**
+ * Represents the position of the RFC822
+ * timezone pattern character in the array of
+ * localized pattern characters.
+ * In the U.S. locale, this is 'Z'.
+ * This is a GNU extension in accordance with
+ * the CLDR data used. The value is the offset
+ * of the current time from GMT e.g. -0500 would
+ * be five hours prior to GMT.
+ */
+ public static final int RFC822_TIMEZONE_FIELD = 23;
public static class Field extends Format.Field
{
@@ -136,14 +328,28 @@ public abstract class DateFormat extends Format implements Cloneable
= new Field("hour0", Calendar.HOUR);
public static final DateFormat.Field TIME_ZONE
= new Field("timezone", Calendar.ZONE_OFFSET);
-
+ public static final DateFormat.Field ISO_YEAR
+ = new Field("iso year", Calendar.YEAR);
+ public static final DateFormat.Field LOCALIZED_DAY_OF_WEEK
+ = new Field("localized day of week", Calendar.DAY_OF_WEEK);
+ public static final DateFormat.Field EXTENDED_YEAR
+ = new Field("extended year", Calendar.YEAR);
+ public static final DateFormat.Field MODIFIED_JULIAN_DAY
+ = new Field("julian day", -1);
+ public static final DateFormat.Field MILLISECOND_IN_DAY
+ = new Field("millisecond in day", -1);
+ public static final DateFormat.Field RFC822_TIME_ZONE
+ = new Field("rfc822 timezone", Calendar.ZONE_OFFSET);
+
static final DateFormat.Field[] allFields =
{
ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY1,
HOUR_OF_DAY0, MINUTE, SECOND, MILLISECOND,
DAY_OF_WEEK, DAY_OF_YEAR, DAY_OF_WEEK_IN_MONTH,
WEEK_OF_YEAR, WEEK_OF_MONTH, AM_PM, HOUR1, HOUR0,
- TIME_ZONE
+ TIME_ZONE, ISO_YEAR, LOCALIZED_DAY_OF_WEEK,
+ EXTENDED_YEAR, MODIFIED_JULIAN_DAY, MILLISECOND_IN_DAY,
+ RFC822_TIME_ZONE
};
// For deserialization
@@ -288,7 +494,7 @@ public abstract class DateFormat extends Format implements Cloneable
* This method returns a list of available locales supported by this
* class.
*/
- public static Locale[] getAvailableLocales ()
+ public static Locale[] getAvailableLocales()
{
// FIXME
Locale[] l = new Locale[1];
diff --git a/libjava/java/text/DateFormatSymbols.java b/libjava/java/text/DateFormatSymbols.java
index b9b71ba36a7..9555cfb67bc 100644
--- a/libjava/java/text/DateFormatSymbols.java
+++ b/libjava/java/text/DateFormatSymbols.java
@@ -1,5 +1,5 @@
/* DateFormatSymbols.java -- Format over a range of numbers
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.ResourceBundle;
/**
* This class acts as container for locale specific date/time formatting
* information such as the days of the week and the months of the year.
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @date October 24, 1998.
*/
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3.
diff --git a/libjava/java/text/DecimalFormat.java b/libjava/java/text/DecimalFormat.java
index 8b2c25cd3c3..a085875a1ae 100644
--- a/libjava/java/text/DecimalFormat.java
+++ b/libjava/java/text/DecimalFormat.java
@@ -49,7 +49,8 @@ import java.util.HashMap;
import java.util.Locale;
/**
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @date March 4, 1999
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
diff --git a/libjava/java/text/DecimalFormatSymbols.java b/libjava/java/text/DecimalFormatSymbols.java
index 7a4e56e9a42..72a132e002a 100644
--- a/libjava/java/text/DecimalFormatSymbols.java
+++ b/libjava/java/text/DecimalFormatSymbols.java
@@ -52,7 +52,7 @@ import java.util.ResourceBundle;
* normally handled automatically, but an application can override
* values as desired using this class.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
* @date February 24, 1999
*/
diff --git a/libjava/java/text/FieldPosition.java b/libjava/java/text/FieldPosition.java
index 47cf7a146f4..6dd3a626705 100644
--- a/libjava/java/text/FieldPosition.java
+++ b/libjava/java/text/FieldPosition.java
@@ -1,5 +1,5 @@
/* FieldPosition.java -- Keeps track of field positions while formatting
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.text;
* typically define constant values for the field identifiers.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
*/
public class FieldPosition
{
diff --git a/libjava/java/text/Format.java b/libjava/java/text/Format.java
index 2c75578243c..970c7ce631f 100644
--- a/libjava/java/text/Format.java
+++ b/libjava/java/text/Format.java
@@ -1,5 +1,5 @@
/* Format.java -- Abstract superclass for formatting/parsing strings.
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import java.io.Serializable;
* available locales in the current runtime environment.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
*/
public abstract class Format implements Serializable, Cloneable
{
diff --git a/libjava/java/text/MessageFormat.java b/libjava/java/text/MessageFormat.java
index 6a031bc7254..6c1b0508bda 100644
--- a/libjava/java/text/MessageFormat.java
+++ b/libjava/java/text/MessageFormat.java
@@ -46,107 +46,107 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Vector;
-/**
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Jorge Aliss <jaliss@hotmail.com>
- * @date March 3, 1999
- */
-/* Written using "Java Class Libraries", 2nd edition, plus online
- * API docs for JDK 1.2 from http://www.javasoft.com.
- * Status: Believed complete and correct to 1.2, except serialization.
- * and parsing.
- */
-final class MessageFormatElement
+public class MessageFormat extends Format
{
- // Argument number.
- int argNumber;
- // Formatter to be used. This is the format set by setFormat.
- Format setFormat;
- // Formatter to be used based on the type.
- Format format;
-
- // Argument will be checked to make sure it is an instance of this
- // class.
- Class formatClass;
-
- // Formatter type.
- String type;
- // Formatter style.
- String style;
-
- // Text to follow this element.
- String trailer;
-
- // Recompute the locale-based formatter.
- void setLocale (Locale loc)
+ /**
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Jorge Aliss (jaliss@hotmail.com)
+ * @date March 3, 1999
+ */
+ /* Written using "Java Class Libraries", 2nd edition, plus online
+ * API docs for JDK 1.2 from http://www.javasoft.com.
+ * Status: Believed complete and correct to 1.2, except serialization.
+ * and parsing.
+ */
+ private static final class MessageFormatElement
{
- if (type == null)
- ;
- else if (type.equals("number"))
- {
- formatClass = java.lang.Number.class;
-
- if (style == null)
- format = NumberFormat.getInstance(loc);
- else if (style.equals("currency"))
- format = NumberFormat.getCurrencyInstance(loc);
- else if (style.equals("percent"))
- format = NumberFormat.getPercentInstance(loc);
- else if (style.equals("integer"))
- {
- NumberFormat nf = NumberFormat.getNumberInstance(loc);
- nf.setMaximumFractionDigits(0);
- nf.setGroupingUsed(false);
- format = nf;
- }
- else
- {
- format = NumberFormat.getNumberInstance(loc);
- DecimalFormat df = (DecimalFormat) format;
- df.applyPattern(style);
- }
- }
- else if (type.equals("time") || type.equals("date"))
- {
- formatClass = java.util.Date.class;
-
- int val = DateFormat.DEFAULT;
- if (style == null)
- ;
- else if (style.equals("short"))
- val = DateFormat.SHORT;
- else if (style.equals("medium"))
- val = DateFormat.MEDIUM;
- else if (style.equals("long"))
- val = DateFormat.LONG;
- else if (style.equals("full"))
- val = DateFormat.FULL;
-
- if (type.equals("time"))
- format = DateFormat.getTimeInstance(val, loc);
- else
- format = DateFormat.getDateInstance(val, loc);
-
- if (style != null && val == DateFormat.DEFAULT)
- {
- SimpleDateFormat sdf = (SimpleDateFormat) format;
- sdf.applyPattern(style);
- }
- }
- else if (type.equals("choice"))
- {
- formatClass = java.lang.Number.class;
-
- if (style == null)
- throw new
- IllegalArgumentException ("style required for choice format");
- format = new ChoiceFormat (style);
- }
+ // Argument number.
+ int argNumber;
+ // Formatter to be used. This is the format set by setFormat.
+ Format setFormat;
+ // Formatter to be used based on the type.
+ Format format;
+
+ // Argument will be checked to make sure it is an instance of this
+ // class.
+ Class formatClass;
+
+ // Formatter type.
+ String type;
+ // Formatter style.
+ String style;
+
+ // Text to follow this element.
+ String trailer;
+
+ // Recompute the locale-based formatter.
+ void setLocale (Locale loc)
+ {
+ if (type == null)
+ ;
+ else if (type.equals("number"))
+ {
+ formatClass = java.lang.Number.class;
+
+ if (style == null)
+ format = NumberFormat.getInstance(loc);
+ else if (style.equals("currency"))
+ format = NumberFormat.getCurrencyInstance(loc);
+ else if (style.equals("percent"))
+ format = NumberFormat.getPercentInstance(loc);
+ else if (style.equals("integer"))
+ {
+ NumberFormat nf = NumberFormat.getNumberInstance(loc);
+ nf.setMaximumFractionDigits(0);
+ nf.setGroupingUsed(false);
+ format = nf;
+ }
+ else
+ {
+ format = NumberFormat.getNumberInstance(loc);
+ DecimalFormat df = (DecimalFormat) format;
+ df.applyPattern(style);
+ }
+ }
+ else if (type.equals("time") || type.equals("date"))
+ {
+ formatClass = java.util.Date.class;
+
+ int val = DateFormat.DEFAULT;
+ if (style == null)
+ ;
+ else if (style.equals("short"))
+ val = DateFormat.SHORT;
+ else if (style.equals("medium"))
+ val = DateFormat.MEDIUM;
+ else if (style.equals("long"))
+ val = DateFormat.LONG;
+ else if (style.equals("full"))
+ val = DateFormat.FULL;
+
+ if (type.equals("time"))
+ format = DateFormat.getTimeInstance(val, loc);
+ else
+ format = DateFormat.getDateInstance(val, loc);
+
+ if (style != null && val == DateFormat.DEFAULT)
+ {
+ SimpleDateFormat sdf = (SimpleDateFormat) format;
+ sdf.applyPattern(style);
+ }
+ }
+ else if (type.equals("choice"))
+ {
+ formatClass = java.lang.Number.class;
+
+ if (style == null)
+ throw new
+ IllegalArgumentException ("style required for choice format");
+ format = new ChoiceFormat (style);
+ }
+ }
}
-}
-public class MessageFormat extends Format
-{
private static final long serialVersionUID = 6479157306784022952L;
public static class Field extends Format.Field
diff --git a/libjava/java/text/NumberFormat.java b/libjava/java/text/NumberFormat.java
index 368292686bc..4fc98b15c54 100644
--- a/libjava/java/text/NumberFormat.java
+++ b/libjava/java/text/NumberFormat.java
@@ -59,7 +59,7 @@ import java.util.ResourceBundle;
* static factory methods in this class such as
* <code>getCurrencyInstance</code>.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @author Aaron M. Renn (arenn@urbanophile.com)
* @date March 4, 1999
*/
diff --git a/libjava/java/text/ParseException.java b/libjava/java/text/ParseException.java
index 20e828e18a7..13229c8c89a 100644
--- a/libjava/java/text/ParseException.java
+++ b/libjava/java/text/ParseException.java
@@ -1,5 +1,5 @@
/* ParseException.java -- an error occurred while parsing
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.text;
* This exception is thrown when an unexpected error occurs during parsing.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
* @see Format
* @see FieldPosition
* @status updated to 1.4
diff --git a/libjava/java/text/ParsePosition.java b/libjava/java/text/ParsePosition.java
index c6dffed8f59..91fa44fccf4 100644
--- a/libjava/java/text/ParsePosition.java
+++ b/libjava/java/text/ParsePosition.java
@@ -1,5 +1,5 @@
/* ParsePosition.java -- Keep track of position while parsing.
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package java.text;
* operations.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Per Bothner <bothner@cygnus.com>
+ * @author Per Bothner (bothner@cygnus.com)
*/
public class ParsePosition
{
diff --git a/libjava/java/text/RuleBasedCollator.java b/libjava/java/text/RuleBasedCollator.java
index c2cff5a0c8c..afb766ff8ae 100644
--- a/libjava/java/text/RuleBasedCollator.java
+++ b/libjava/java/text/RuleBasedCollator.java
@@ -1,5 +1,5 @@
/* RuleBasedCollator.java -- Concrete Collator Class
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -435,56 +435,57 @@ main_parse_loop:
continue;
}
- switch (c) {
- case '!':
- throw new ParseException
- ("Modifier '!' is not yet supported by Classpath", i+base_offset);
- case '<':
- type = CollationSorter.GREATERP;
- break;
- case ';':
- type = CollationSorter.GREATERS;
- break;
- case ',':
- type = CollationSorter.GREATERT;
- break;
- case '=':
- type = CollationSorter.EQUAL;
- break;
- case '\'':
- eatingChars = !eatingChars;
- doubleQuote = true;
- break;
- case '@':
- if (ignoreChars)
- throw new ParseException
- ("comparison list has not yet been started. You may only use"
- + "(<,;=&)", i+base_offset);
- // Inverse the order of secondaries from now on.
- nextIsModifier = true;
- type = CollationSorter.INVERSE_SECONDARY;
- break;
- case '&':
- type = CollationSorter.RESET;
- if (stop_on_reset)
- break main_parse_loop;
- break;
- default:
- if (operator < 0)
- throw new ParseException
- ("operator missing at " + (i+base_offset), i+base_offset);
- if (!eatingChars &&
- ((c >= 0x21 && c <= 0x2F)
- || (c >= 0x3A && c <= 0x40)
- || (c >= 0x5B && c <= 0x60)
- || (c >= 0x7B && c <= 0x7E)))
+ switch (c)
+ {
+ case '!':
throw new ParseException
- ("unquoted punctuation character '"+c+"'", i+base_offset);
-
- //type = ignoreChars ? CollationSorter.IGNORE : -1;
- sb.append(c);
- break;
- }
+ ("Modifier '!' is not yet supported by Classpath", i + base_offset);
+ case '<':
+ type = CollationSorter.GREATERP;
+ break;
+ case ';':
+ type = CollationSorter.GREATERS;
+ break;
+ case ',':
+ type = CollationSorter.GREATERT;
+ break;
+ case '=':
+ type = CollationSorter.EQUAL;
+ break;
+ case '\'':
+ eatingChars = !eatingChars;
+ doubleQuote = true;
+ break;
+ case '@':
+ if (ignoreChars)
+ throw new ParseException
+ ("comparison list has not yet been started. You may only use"
+ + "(<,;=&)", i + base_offset);
+ // Inverse the order of secondaries from now on.
+ nextIsModifier = true;
+ type = CollationSorter.INVERSE_SECONDARY;
+ break;
+ case '&':
+ type = CollationSorter.RESET;
+ if (stop_on_reset)
+ break main_parse_loop;
+ break;
+ default:
+ if (operator < 0)
+ throw new ParseException
+ ("operator missing at " + (i + base_offset), i + base_offset);
+ if (! eatingChars
+ && ((c >= 0x21 && c <= 0x2F)
+ || (c >= 0x3A && c <= 0x40)
+ || (c >= 0x5B && c <= 0x60)
+ || (c >= 0x7B && c <= 0x7E)))
+ throw new ParseException
+ ("unquoted punctuation character '" + c + "'", i + base_offset);
+
+ //type = ignoreChars ? CollationSorter.IGNORE : -1;
+ sb.append(c);
+ break;
+ }
if (type < 0)
continue;
diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java
index 35083eb887e..c1eb3cd3a70 100644
--- a/libjava/java/text/SimpleDateFormat.java
+++ b/libjava/java/text/SimpleDateFormat.java
@@ -1,6 +1,6 @@
/* SimpleDateFormat.java -- A class for parsing/formating simple
date constructs
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,6 +46,7 @@ import gnu.java.text.FormatCharacterIterator;
import gnu.java.text.StringFormatBuffer;
import java.io.IOException;
+import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Calendar;
@@ -53,8 +54,9 @@ import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.Locale;
-import java.util.SimpleTimeZone;
import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* SimpleDateFormat provides convenient methods for parsing and formatting
@@ -62,34 +64,190 @@ import java.util.TimeZone;
*/
public class SimpleDateFormat extends DateFormat
{
- /** A pair class used by SimpleDateFormat as a compiled representation
- * of a format string.
+ /**
+ * This class is used by <code>SimpleDateFormat</code> as a
+ * compiled representation of a format string. The field
+ * ID, size, and character used are stored for each sequence
+ * of pattern characters.
*/
- private class FieldSizePair
+ private class CompiledField
{
- public int field;
- public int size;
+ /**
+ * The ID of the field within the local pattern characters,
+ */
+ private int field;
+
+ /**
+ * The size of the character sequence.
+ */
+ private int size;
+
+ /**
+ * The character used.
+ */
+ private char character;
- /** Constructs a pair with the given field and size values */
- public FieldSizePair(int f, int s) {
+ /**
+ * Constructs a compiled field using the
+ * the given field ID, size and character
+ * values.
+ *
+ * @param f the field ID.
+ * @param s the size of the field.
+ * @param c the character used.
+ */
+ public CompiledField(int f, int s, char c)
+ {
field = f;
size = s;
+ character = c;
+ }
+
+ /**
+ * Retrieves the ID of the field relative to
+ * the local pattern characters.
+ */
+ public int getField()
+ {
+ return field;
+ }
+
+ /**
+ * Retrieves the size of the character sequence.
+ */
+ public int getSize()
+ {
+ return size;
+ }
+
+ /**
+ * Retrieves the character used in the sequence.
+ */
+ public char getCharacter()
+ {
+ return character;
+ }
+
+ /**
+ * Returns a <code>String</code> representation
+ * of the compiled field, primarily for debugging
+ * purposes.
+ *
+ * @return a <code>String</code> representation.
+ */
+ public String toString()
+ {
+ StringBuffer builder;
+
+ builder = new StringBuffer(getClass().getName());
+ builder.append("[field=");
+ builder.append(field);
+ builder.append(", size=");
+ builder.append(size);
+ builder.append(", character=");
+ builder.append(character);
+ builder.append("]");
+
+ return builder.toString();
}
}
+ /**
+ * A list of <code>CompiledField</code>s,
+ * representing the compiled version of the pattern.
+ *
+ * @see CompiledField
+ * @serial Ignored.
+ */
private transient ArrayList tokens;
- private DateFormatSymbols formatData; // formatData
+
+ /**
+ * The localised data used in formatting,
+ * such as the day and month names in the local
+ * language, and the localized pattern characters.
+ *
+ * @see DateFormatSymbols
+ * @serial The localisation data. May not be null.
+ */
+ private DateFormatSymbols formatData;
+
+ /**
+ * The date representing the start of the century
+ * used for interpreting two digit years. For
+ * example, 24/10/2004 would cause two digit
+ * years to be interpreted as representing
+ * the years between 2004 and 2104.
+ *
+ * @see get2DigitYearStart()
+ * @see set2DigitYearStart(java.util.Date)
+ * @see Date
+ * @serial The start date of the century for parsing two digit years.
+ * May not be null.
+ */
private Date defaultCenturyStart;
+
+ /**
+ * The year at which interpretation of two
+ * digit years starts.
+ *
+ * @see get2DigitYearStart()
+ * @see set2DigitYearStart(java.util.Date)
+ * @serial Ignored.
+ */
private transient int defaultCentury;
+
+ /**
+ * The non-localized pattern string. This
+ * only ever contains the pattern characters
+ * stored in standardChars. Localized patterns
+ * are translated to this form.
+ *
+ * @see applyPattern(String)
+ * @see applyLocalizedPattern(String)
+ * @see toPattern()
+ * @see toLocalizedPattern()
+ * @serial The non-localized pattern string. May not be null.
+ */
private String pattern;
+
+ /**
+ * The version of serialized data used by this class.
+ * Version 0 only includes the pattern and formatting
+ * data. Version 1 adds the start date for interpreting
+ * two digit years.
+ *
+ * @serial This specifies the version of the data being serialized.
+ * Version 0 (or no version) specifies just <code>pattern</code>
+ * and <code>formatData</code>. Version 1 adds
+ * the <code>defaultCenturyStart</code>. This implementation
+ * always writes out version 1 data.
+ */
private int serialVersionOnStream = 1; // 0 indicates JDK1.1.3 or earlier
+
+ /**
+ * For compatability.
+ */
private static final long serialVersionUID = 4774881970558875024L;
- // This string is specified in the JCL. We set it here rather than
- // do a DateFormatSymbols(Locale.US).getLocalPatternChars() since
- // someone could theoretically change those values (though unlikely).
- private static final String standardChars = "GyMdkHmsSEDFwWahKzZ";
+ // This string is specified in the root of the CLDR. We set it here
+ // rather than doing a DateFormatSymbols(Locale.US).getLocalPatternChars()
+ // since someone could theoretically change those values (though unlikely).
+ private static final String standardChars = "GyMdkHmsSEDFwWahKzYeugAZ";
+ /**
+ * Reads the serialized version of this object.
+ * If the serialized data is only version 0,
+ * then the date for the start of the century
+ * for interpreting two digit years is computed.
+ * The pattern is parsed and compiled following the process
+ * of reading in the serialized data.
+ *
+ * @param stream the object stream to read the data from.
+ * @throws IOException if an I/O error occurs.
+ * @throws ClassNotFoundException if the class of the serialized data
+ * could not be found.
+ * @throws InvalidObjectException if the pattern is invalid.
+ */
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException
{
@@ -105,9 +263,25 @@ public class SimpleDateFormat extends DateFormat
// Set up items normally taken care of by the constructor.
tokens = new ArrayList();
- compileFormat(pattern);
+ try
+ {
+ compileFormat(pattern);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new InvalidObjectException("The stream pattern was invalid.");
+ }
}
+ /**
+ * Compiles the supplied non-localized pattern into a form
+ * from which formatting and parsing can be performed.
+ * This also detects errors in the pattern, which will
+ * be raised on later use of the compiled data.
+ *
+ * @param pattern the non-localized pattern to compile.
+ * @throws IllegalArgumentException if the pattern is invalid.
+ */
private void compileFormat(String pattern)
{
// Any alphabetical characters are treated as pattern characters
@@ -116,24 +290,25 @@ public class SimpleDateFormat extends DateFormat
char thisChar;
int pos;
int field;
- FieldSizePair current = null;
+ CompiledField current = null;
for (int i=0; i<pattern.length(); i++) {
thisChar = pattern.charAt(i);
- field = formatData.getLocalPatternChars().indexOf(thisChar);
+ field = standardChars.indexOf(thisChar);
if (field == -1) {
current = null;
if ((thisChar >= 'A' && thisChar <= 'Z')
|| (thisChar >= 'a' && thisChar <= 'z')) {
- // Not a valid letter
- tokens.add(new FieldSizePair(-1,0));
+ // Not a valid letter
+ throw new IllegalArgumentException("Invalid letter " + thisChar +
+ "encountered at character " + i
+ + ".");
} else if (thisChar == '\'') {
// Quoted text section; skip to next single quote
pos = pattern.indexOf('\'',i+1);
if (pos == -1) {
- // This ought to be an exception, but spec does not
- // let us throw one.
- tokens.add(new FieldSizePair(-1,0));
+ throw new IllegalArgumentException("Quotes starting at character "
+ + i + " not closed.");
}
if ((pos+1 < pattern.length()) && (pattern.charAt(pos+1) == '\'')) {
tokens.add(pattern.substring(i+1,pos+1));
@@ -150,20 +325,38 @@ public class SimpleDateFormat extends DateFormat
if ((current != null) && (field == current.field)) {
current.size++;
} else {
- current = new FieldSizePair(field,1);
+ current = new CompiledField(field,1,thisChar);
tokens.add(current);
}
}
}
}
+ /**
+ * Returns a string representation of this
+ * class.
+ *
+ * @return a string representation of the <code>SimpleDateFormat</code>
+ * instance.
+ */
public String toString()
{
- StringBuffer output = new StringBuffer();
- Iterator i = tokens.iterator();
- while (i.hasNext()) {
- output.append(i.next().toString());
- }
+ StringBuffer output = new StringBuffer(getClass().getName());
+ output.append("[tokens=");
+ output.append(tokens);
+ output.append(", formatData=");
+ output.append(formatData);
+ output.append(", defaultCenturyStart=");
+ output.append(defaultCenturyStart);
+ output.append(", defaultCentury=");
+ output.append(defaultCentury);
+ output.append(", pattern=");
+ output.append(pattern);
+ output.append(", serialVersionOnStream=");
+ output.append(serialVersionOnStream);
+ output.append(", standardChars=");
+ output.append(standardChars);
+ output.append("]");
return output.toString();
}
@@ -194,8 +387,12 @@ public class SimpleDateFormat extends DateFormat
}
/**
- * Creates a date formatter using the specified pattern, with the default
- * DateFormatSymbols for the default locale.
+ * Creates a date formatter using the specified non-localized pattern,
+ * with the default DateFormatSymbols for the default locale.
+ *
+ * @param pattern the pattern to use.
+ * @throws NullPointerException if the pattern is null.
+ * @throws IllegalArgumentException if the pattern is invalid.
*/
public SimpleDateFormat(String pattern)
{
@@ -203,8 +400,13 @@ public class SimpleDateFormat extends DateFormat
}
/**
- * Creates a date formatter using the specified pattern, with the default
- * DateFormatSymbols for the given locale.
+ * Creates a date formatter using the specified non-localized pattern,
+ * with the default DateFormatSymbols for the given locale.
+ *
+ * @param pattern the non-localized pattern to use.
+ * @param locale the locale to use for the formatting symbols.
+ * @throws NullPointerException if the pattern is null.
+ * @throws IllegalArgumentException if the pattern is invalid.
*/
public SimpleDateFormat(String pattern, Locale locale)
{
@@ -222,8 +424,14 @@ public class SimpleDateFormat extends DateFormat
}
/**
- * Creates a date formatter using the specified pattern. The
- * specified DateFormatSymbols will be used when formatting.
+ * Creates a date formatter using the specified non-localized
+ * pattern. The specified DateFormatSymbols will be used when
+ * formatting.
+ *
+ * @param pattern the non-localized pattern to use.
+ * @param formatData the formatting symbols to use.
+ * @throws NullPointerException if the pattern or formatData is null.
+ * @throws IllegalArgumentException if the pattern is invalid.
*/
public SimpleDateFormat(String pattern, DateFormatSymbols formatData)
{
@@ -231,6 +439,8 @@ public class SimpleDateFormat extends DateFormat
calendar = new GregorianCalendar();
computeCenturyStart ();
tokens = new ArrayList();
+ if (formatData == null)
+ throw new NullPointerException("formatData");
this.formatData = formatData;
compileFormat(pattern);
this.pattern = pattern;
@@ -240,9 +450,6 @@ public class SimpleDateFormat extends DateFormat
numberFormat.setMaximumFractionDigits (0);
}
- // What is the difference between localized and unlocalized? The
- // docs don't say.
-
/**
* This method returns a string with the formatting pattern being used
* by this object. This string is unlocalized.
@@ -263,7 +470,7 @@ public class SimpleDateFormat extends DateFormat
public String toLocalizedPattern()
{
String localChars = formatData.getLocalPatternChars();
- return applyLocalizedPattern (pattern, standardChars, localChars);
+ return translateLocalizedPattern(pattern, standardChars, localChars);
}
/**
@@ -271,6 +478,8 @@ public class SimpleDateFormat extends DateFormat
* object. This string is not localized.
*
* @param pattern The new format pattern.
+ * @throws NullPointerException if the pattern is null.
+ * @throws IllegalArgumentException if the pattern is invalid.
*/
public void applyPattern(String pattern)
{
@@ -284,16 +493,34 @@ public class SimpleDateFormat extends DateFormat
* object. This string is localized.
*
* @param pattern The new format pattern.
+ * @throws NullPointerException if the pattern is null.
+ * @throws IllegalArgumentException if the pattern is invalid.
*/
public void applyLocalizedPattern(String pattern)
{
String localChars = formatData.getLocalPatternChars();
- pattern = applyLocalizedPattern (pattern, localChars, standardChars);
+ pattern = translateLocalizedPattern(pattern, localChars, standardChars);
applyPattern(pattern);
}
- private String applyLocalizedPattern(String pattern,
- String oldChars, String newChars)
+ /**
+ * Translates either from or to a localized variant of the pattern
+ * string. For example, in the German locale, 't' (for 'tag') is
+ * used instead of 'd' (for 'date'). This method translates
+ * a localized pattern (such as 'ttt') to a non-localized pattern
+ * (such as 'ddd'), or vice versa. Non-localized patterns use
+ * a standard set of characters, which match those of the U.S. English
+ * locale.
+ *
+ * @param pattern the pattern to translate.
+ * @param oldChars the old set of characters (used in the pattern).
+ * @param newChars the new set of characters (which will be used in the
+ * pattern).
+ * @return a version of the pattern using the characters in
+ * <code>newChars</code>.
+ */
+ private String translateLocalizedPattern(String pattern,
+ String oldChars, String newChars)
{
int len = pattern.length();
StringBuffer buf = new StringBuffer(len);
@@ -341,14 +568,14 @@ public class SimpleDateFormat extends DateFormat
}
/**
- * This method returns the format symbol information used for parsing
- * and formatting dates.
+ * This method returns a copy of the format symbol information used
+ * for parsing and formatting dates.
*
- * @return The date format symbols.
+ * @return a copy of the date format symbols.
*/
public DateFormatSymbols getDateFormatSymbols()
{
- return formatData;
+ return (DateFormatSymbols) formatData.clone();
}
/**
@@ -356,9 +583,15 @@ public class SimpleDateFormat extends DateFormat
* and formatting dates.
*
* @param formatData The date format symbols.
+ * @throws NullPointerException if <code>formatData</code> is null.
*/
public void setDateFormatSymbols(DateFormatSymbols formatData)
{
+ if (formatData == null)
+ {
+ throw new
+ NullPointerException("The supplied format data was null.");
+ }
this.formatData = formatData;
}
@@ -431,12 +664,12 @@ public class SimpleDateFormat extends DateFormat
while (iter.hasNext())
{
Object o = iter.next();
- if (o instanceof FieldSizePair)
+ if (o instanceof CompiledField)
{
- FieldSizePair p = (FieldSizePair) o;
+ CompiledField cf = (CompiledField) o;
int beginIndex = buffer.length();
- switch (p.field)
+ switch (cf.getField())
{
case ERA_FIELD:
buffer.append (formatData.eras[calendar.get (Calendar.ERA)], DateFormat.Field.ERA);
@@ -445,75 +678,75 @@ public class SimpleDateFormat extends DateFormat
// If we have two digits, then we truncate. Otherwise, we
// use the size of the pattern, and zero pad.
buffer.setDefaultAttribute (DateFormat.Field.YEAR);
- if (p.size == 2)
+ if (cf.getSize() == 2)
{
temp = String.valueOf (calendar.get (Calendar.YEAR));
buffer.append (temp.substring (temp.length() - 2));
}
else
- withLeadingZeros (calendar.get (Calendar.YEAR), p.size, buffer);
+ withLeadingZeros (calendar.get (Calendar.YEAR), cf.getSize(), buffer);
break;
case MONTH_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.MONTH);
- if (p.size < 3)
- withLeadingZeros (calendar.get (Calendar.MONTH) + 1, p.size, buffer);
- else if (p.size < 4)
+ if (cf.getSize() < 3)
+ withLeadingZeros (calendar.get (Calendar.MONTH) + 1, cf.getSize(), buffer);
+ else if (cf.getSize() < 4)
buffer.append (formatData.shortMonths[calendar.get (Calendar.MONTH)]);
else
buffer.append (formatData.months[calendar.get (Calendar.MONTH)]);
break;
case DATE_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_MONTH);
- withLeadingZeros (calendar.get (Calendar.DATE), p.size, buffer);
+ withLeadingZeros (calendar.get (Calendar.DATE), cf.getSize(), buffer);
break;
case HOUR_OF_DAY1_FIELD: // 1-24
buffer.setDefaultAttribute(DateFormat.Field.HOUR_OF_DAY1);
withLeadingZeros ( ((calendar.get (Calendar.HOUR_OF_DAY) + 23) % 24) + 1,
- p.size, buffer);
+ cf.getSize(), buffer);
break;
case HOUR_OF_DAY0_FIELD: // 0-23
buffer.setDefaultAttribute (DateFormat.Field.HOUR_OF_DAY0);
- withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), p.size, buffer);
+ withLeadingZeros (calendar.get (Calendar.HOUR_OF_DAY), cf.getSize(), buffer);
break;
case MINUTE_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.MINUTE);
withLeadingZeros (calendar.get (Calendar.MINUTE),
- p.size, buffer);
+ cf.getSize(), buffer);
break;
case SECOND_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.SECOND);
withLeadingZeros(calendar.get (Calendar.SECOND),
- p.size, buffer);
+ cf.getSize(), buffer);
break;
case MILLISECOND_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.MILLISECOND);
- withLeadingZeros (calendar.get (Calendar.MILLISECOND), p.size, buffer);
+ withLeadingZeros (calendar.get (Calendar.MILLISECOND), cf.getSize(), buffer);
break;
case DAY_OF_WEEK_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK);
- if (p.size < 4)
+ if (cf.getSize() < 4)
buffer.append (formatData.shortWeekdays[calendar.get (Calendar.DAY_OF_WEEK)]);
else
buffer.append (formatData.weekdays[calendar.get (Calendar.DAY_OF_WEEK)]);
break;
case DAY_OF_YEAR_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_YEAR);
- withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), p.size, buffer);
+ withLeadingZeros (calendar.get (Calendar.DAY_OF_YEAR), cf.getSize(), buffer);
break;
case DAY_OF_WEEK_IN_MONTH_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.DAY_OF_WEEK_IN_MONTH);
withLeadingZeros (calendar.get (Calendar.DAY_OF_WEEK_IN_MONTH),
- p.size, buffer);
+ cf.getSize(), buffer);
break;
case WEEK_OF_YEAR_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_YEAR);
withLeadingZeros (calendar.get (Calendar.WEEK_OF_YEAR),
- p.size, buffer);
+ cf.getSize(), buffer);
break;
case WEEK_OF_MONTH_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.WEEK_OF_MONTH);
withLeadingZeros (calendar.get (Calendar.WEEK_OF_MONTH),
- p.size, buffer);
+ cf.getSize(), buffer);
break;
case AM_PM_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.AM_PM);
@@ -521,25 +754,39 @@ public class SimpleDateFormat extends DateFormat
break;
case HOUR1_FIELD: // 1-12
buffer.setDefaultAttribute (DateFormat.Field.HOUR1);
- withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1, p.size, buffer);
+ withLeadingZeros (((calendar.get (Calendar.HOUR) + 11) % 12) + 1,
+ cf.getSize(), buffer);
break;
case HOUR0_FIELD: // 0-11
buffer.setDefaultAttribute (DateFormat.Field.HOUR0);
- withLeadingZeros (calendar.get (Calendar.HOUR), p.size, buffer);
+ withLeadingZeros (calendar.get (Calendar.HOUR), cf.getSize(), buffer);
break;
case TIMEZONE_FIELD:
buffer.setDefaultAttribute (DateFormat.Field.TIME_ZONE);
TimeZone zone = calendar.getTimeZone();
boolean isDST = calendar.get (Calendar.DST_OFFSET) != 0;
// FIXME: XXX: This should be a localized time zone.
- String zoneID = zone.getDisplayName (isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT);
+ String zoneID = zone.getDisplayName
+ (isDST, cf.getSize() > 3 ? TimeZone.LONG : TimeZone.SHORT);
buffer.append (zoneID);
break;
+ case RFC822_TIMEZONE_FIELD:
+ buffer.setDefaultAttribute(DateFormat.Field.RFC822_TIME_ZONE);
+ int pureMinutes = (calendar.get(Calendar.ZONE_OFFSET) +
+ calendar.get(Calendar.DST_OFFSET)) / (1000 * 60);
+ String sign = (pureMinutes < 0) ? "-" : "+";
+ int hours = pureMinutes / 60;
+ int minutes = pureMinutes % 60;
+ buffer.append(sign);
+ withLeadingZeros(hours, 2, buffer);
+ withLeadingZeros(minutes, 2, buffer);
+ break;
default:
- throw new IllegalArgumentException ("Illegal pattern character " + p.field);
+ throw new IllegalArgumentException ("Illegal pattern character " +
+ cf.getCharacter());
}
if (pos != null && (buffer.getDefaultAttribute() == pos.getFieldAttribute()
- || p.field == pos.getField()))
+ || cf.getField() == pos.getField()))
{
pos.setBeginIndex(beginIndex);
pos.setEndIndex(buffer.length());
@@ -614,232 +861,265 @@ public class SimpleDateFormat extends DateFormat
boolean saw_timezone = false;
int quote_start = -1;
boolean is2DigitYear = false;
- for (; fmt_index < fmt_max; ++fmt_index)
+ try
{
- char ch = pattern.charAt(fmt_index);
- if (ch == '\'')
+ for (; fmt_index < fmt_max; ++fmt_index)
{
- int index = pos.getIndex();
- if (fmt_index < fmt_max - 1
- && pattern.charAt(fmt_index + 1) == '\'')
+ char ch = pattern.charAt(fmt_index);
+ if (ch == '\'')
+ {
+ int index = pos.getIndex();
+ if (fmt_index < fmt_max - 1
+ && pattern.charAt(fmt_index + 1) == '\'')
+ {
+ if (! expect (dateStr, pos, ch))
+ return null;
+ ++fmt_index;
+ }
+ else
+ quote_start = quote_start < 0 ? fmt_index : -1;
+ continue;
+ }
+
+ if (quote_start != -1
+ || ((ch < 'a' || ch > 'z')
+ && (ch < 'A' || ch > 'Z')))
{
if (! expect (dateStr, pos, ch))
return null;
- ++fmt_index;
+ continue;
}
- else
- quote_start = quote_start < 0 ? fmt_index : -1;
- continue;
- }
-
- if (quote_start != -1
- || ((ch < 'a' || ch > 'z')
- && (ch < 'A' || ch > 'Z')))
- {
- if (! expect (dateStr, pos, ch))
- return null;
- continue;
- }
-
- // We've arrived at a potential pattern character in the
- // pattern.
- int first = fmt_index;
- while (++fmt_index < fmt_max && pattern.charAt(fmt_index) == ch)
- ;
- int fmt_count = fmt_index - first;
-
- // We might need to limit the number of digits to parse in
- // some cases. We look to the next pattern character to
- // decide.
- boolean limit_digits = false;
- if (fmt_index < fmt_max
- && standardChars.indexOf(pattern.charAt(fmt_index)) >= 0)
- limit_digits = true;
- --fmt_index;
-
- // We can handle most fields automatically: most either are
- // numeric or are looked up in a string vector. In some cases
- // we need an offset. When numeric, `offset' is added to the
- // resulting value. When doing a string lookup, offset is the
- // initial index into the string array.
- int calendar_field;
- boolean is_numeric = true;
- String[] match = null;
- int offset = 0;
- boolean maybe2DigitYear = false;
- switch (ch)
- {
- case 'd':
- calendar_field = Calendar.DATE;
- break;
- case 'D':
- calendar_field = Calendar.DAY_OF_YEAR;
- break;
- case 'F':
- calendar_field = Calendar.DAY_OF_WEEK_IN_MONTH;
- break;
- case 'E':
- is_numeric = false;
- offset = 1;
- calendar_field = Calendar.DAY_OF_WEEK;
- match = (fmt_count <= 3
- ? formatData.getShortWeekdays()
- : formatData.getWeekdays());
- break;
- case 'w':
- calendar_field = Calendar.WEEK_OF_YEAR;
- break;
- case 'W':
- calendar_field = Calendar.WEEK_OF_MONTH;
- break;
- case 'M':
- calendar_field = Calendar.MONTH;
- if (fmt_count <= 2)
- offset = -1;
- else
+
+ // We've arrived at a potential pattern character in the
+ // pattern.
+ int fmt_count = 1;
+ while (++fmt_index < fmt_max && pattern.charAt(fmt_index) == ch)
{
- is_numeric = false;
- match = (fmt_count <= 3
- ? formatData.getShortMonths()
- : formatData.getMonths());
+ ++fmt_count;
}
- break;
- case 'y':
- calendar_field = Calendar.YEAR;
- if (fmt_count <= 2)
- maybe2DigitYear = true;
- break;
- case 'K':
- calendar_field = Calendar.HOUR;
- break;
- case 'h':
- calendar_field = Calendar.HOUR;
- break;
- case 'H':
- calendar_field = Calendar.HOUR_OF_DAY;
- break;
- case 'k':
- calendar_field = Calendar.HOUR_OF_DAY;
- break;
- case 'm':
- calendar_field = Calendar.MINUTE;
- break;
- case 's':
- calendar_field = Calendar.SECOND;
- break;
- case 'S':
- calendar_field = Calendar.MILLISECOND;
- break;
- case 'a':
- is_numeric = false;
- calendar_field = Calendar.AM_PM;
- match = formatData.getAmPmStrings();
- break;
- case 'z':
- // We need a special case for the timezone, because it
- // uses a different data structure than the other cases.
- is_numeric = false;
- calendar_field = Calendar.DST_OFFSET;
- String[][] zoneStrings = formatData.getZoneStrings();
- int zoneCount = zoneStrings.length;
- int index = pos.getIndex();
- boolean found_zone = false;
- for (int j = 0; j < zoneCount; j++)
+
+ // We might need to limit the number of digits to parse in
+ // some cases. We look to the next pattern character to
+ // decide.
+ boolean limit_digits = false;
+ if (fmt_index < fmt_max
+ && standardChars.indexOf(pattern.charAt(fmt_index)) >= 0)
+ limit_digits = true;
+ --fmt_index;
+
+ // We can handle most fields automatically: most either are
+ // numeric or are looked up in a string vector. In some cases
+ // we need an offset. When numeric, `offset' is added to the
+ // resulting value. When doing a string lookup, offset is the
+ // initial index into the string array.
+ int calendar_field;
+ boolean is_numeric = true;
+ int offset = 0;
+ boolean maybe2DigitYear = false;
+ Integer simpleOffset;
+ String[] set1 = null;
+ String[] set2 = null;
+ switch (ch)
{
- String[] strings = zoneStrings[j];
- int k;
- for (k = 1; k < strings.length; ++k)
+ case 'd':
+ calendar_field = Calendar.DATE;
+ break;
+ case 'D':
+ calendar_field = Calendar.DAY_OF_YEAR;
+ break;
+ case 'F':
+ calendar_field = Calendar.DAY_OF_WEEK_IN_MONTH;
+ break;
+ case 'E':
+ is_numeric = false;
+ offset = 1;
+ calendar_field = Calendar.DAY_OF_WEEK;
+ set1 = formatData.getWeekdays();
+ set2 = formatData.getShortWeekdays();
+ break;
+ case 'w':
+ calendar_field = Calendar.WEEK_OF_YEAR;
+ break;
+ case 'W':
+ calendar_field = Calendar.WEEK_OF_MONTH;
+ break;
+ case 'M':
+ calendar_field = Calendar.MONTH;
+ if (fmt_count <= 2)
+ offset = -1;
+ else
{
- if (dateStr.startsWith(strings[k], index))
- break;
+ is_numeric = false;
+ set1 = formatData.getMonths();
+ set2 = formatData.getShortMonths();
}
- if (k != strings.length)
+ break;
+ case 'y':
+ calendar_field = Calendar.YEAR;
+ if (fmt_count <= 2)
+ maybe2DigitYear = true;
+ break;
+ case 'K':
+ calendar_field = Calendar.HOUR;
+ break;
+ case 'h':
+ calendar_field = Calendar.HOUR;
+ break;
+ case 'H':
+ calendar_field = Calendar.HOUR_OF_DAY;
+ break;
+ case 'k':
+ calendar_field = Calendar.HOUR_OF_DAY;
+ break;
+ case 'm':
+ calendar_field = Calendar.MINUTE;
+ break;
+ case 's':
+ calendar_field = Calendar.SECOND;
+ break;
+ case 'S':
+ calendar_field = Calendar.MILLISECOND;
+ break;
+ case 'a':
+ is_numeric = false;
+ calendar_field = Calendar.AM_PM;
+ set1 = formatData.getAmPmStrings();
+ break;
+ case 'z':
+ case 'Z':
+ // We need a special case for the timezone, because it
+ // uses a different data structure than the other cases.
+ is_numeric = false;
+ calendar_field = Calendar.ZONE_OFFSET;
+ String[][] zoneStrings = formatData.getZoneStrings();
+ int zoneCount = zoneStrings.length;
+ int index = pos.getIndex();
+ boolean found_zone = false;
+ simpleOffset = computeOffset(dateStr.substring(index));
+ if (simpleOffset != null)
{
found_zone = true;
saw_timezone = true;
- TimeZone tz = TimeZone.getTimeZone (strings[0]);
- calendar.set (Calendar.ZONE_OFFSET, tz.getRawOffset ());
- offset = 0;
- if (k > 2 && tz instanceof SimpleTimeZone)
+ calendar.set(Calendar.DST_OFFSET, 0);
+ offset = simpleOffset.intValue();
+ }
+ else
+ {
+ for (int j = 0; j < zoneCount; j++)
{
- SimpleTimeZone stz = (SimpleTimeZone) tz;
- offset = stz.getDSTSavings ();
+ String[] strings = zoneStrings[j];
+ int k;
+ for (k = 0; k < strings.length; ++k)
+ {
+ if (dateStr.startsWith(strings[k], index))
+ break;
+ }
+ if (k != strings.length)
+ {
+ found_zone = true;
+ saw_timezone = true;
+ TimeZone tz = TimeZone.getTimeZone (strings[0]);
+ // Check if it's a DST zone or ordinary
+ if(k == 3 || k == 4)
+ calendar.set (Calendar.DST_OFFSET, tz.getDSTSavings());
+ else
+ calendar.set (Calendar.DST_OFFSET, 0);
+ offset = tz.getRawOffset ();
+ pos.setIndex(index + strings[k].length());
+ break;
+ }
}
- pos.setIndex(index + strings[k].length());
- break;
}
- }
- if (! found_zone)
- {
+ if (! found_zone)
+ {
+ pos.setErrorIndex(pos.getIndex());
+ return null;
+ }
+ break;
+ default:
pos.setErrorIndex(pos.getIndex());
return null;
}
- break;
- default:
- pos.setErrorIndex(pos.getIndex());
- return null;
- }
-
- // Compute the value we should assign to the field.
- int value;
- int index = -1;
- if (is_numeric)
- {
- numberFormat.setMinimumIntegerDigits(fmt_count);
- if (limit_digits)
- numberFormat.setMaximumIntegerDigits(fmt_count);
- if (maybe2DigitYear)
- index = pos.getIndex();
- Number n = numberFormat.parse(dateStr, pos);
- if (pos == null || ! (n instanceof Long))
- return null;
- value = n.intValue() + offset;
- }
- else if (match != null)
- {
- index = pos.getIndex();
- int i;
- for (i = offset; i < match.length; ++i)
+
+ // Compute the value we should assign to the field.
+ int value;
+ int index = -1;
+ if (is_numeric)
{
- if (dateStr.startsWith(match[i], index))
- break;
+ numberFormat.setMinimumIntegerDigits(fmt_count);
+ if (limit_digits)
+ numberFormat.setMaximumIntegerDigits(fmt_count);
+ if (maybe2DigitYear)
+ index = pos.getIndex();
+ Number n = numberFormat.parse(dateStr, pos);
+ if (pos == null || ! (n instanceof Long))
+ return null;
+ value = n.intValue() + offset;
}
- if (i == match.length)
+ else if (set1 != null)
{
- pos.setErrorIndex(index);
- return null;
+ index = pos.getIndex();
+ int i;
+ boolean found = false;
+ for (i = offset; i < set1.length; ++i)
+ {
+ if (set1[i] != null)
+ if (dateStr.toUpperCase().startsWith(set1[i].toUpperCase(),
+ index))
+ {
+ found = true;
+ pos.setIndex(index + set1[i].length());
+ break;
+ }
+ }
+ if (!found && set2 != null)
+ {
+ for (i = offset; i < set2.length; ++i)
+ {
+ if (set2[i] != null)
+ if (dateStr.toUpperCase().startsWith(set2[i].toUpperCase(),
+ index))
+ {
+ found = true;
+ pos.setIndex(index + set2[i].length());
+ break;
+ }
+ }
+ }
+ if (!found)
+ {
+ pos.setErrorIndex(index);
+ return null;
+ }
+ value = i;
}
- pos.setIndex(index + match[i].length());
- value = i;
- }
- else
- value = offset;
+ else
+ value = offset;
- if (maybe2DigitYear)
- {
- // Parse into default century if the numeric year string has
- // exactly 2 digits.
- int digit_count = pos.getIndex() - index;
- if (digit_count == 2)
- is2DigitYear = true;
+ if (maybe2DigitYear)
+ {
+ // Parse into default century if the numeric year string has
+ // exactly 2 digits.
+ int digit_count = pos.getIndex() - index;
+ if (digit_count == 2)
+ {
+ is2DigitYear = true;
+ value += defaultCentury;
+ }
+ }
+
+ // Assign the value and move on.
+ calendar.set(calendar_field, value);
}
-
- // Assign the value and move on.
- calendar.set(calendar_field, value);
- }
- if (is2DigitYear)
- {
- // Apply the 80-20 heuristic to dermine the full year based on
- // defaultCenturyStart.
- int year = defaultCentury + calendar.get(Calendar.YEAR);
- calendar.set(Calendar.YEAR, year);
- if (calendar.getTime().compareTo(defaultCenturyStart) < 0)
- calendar.set(Calendar.YEAR, year + 100);
- }
-
- try
- {
+ if (is2DigitYear)
+ {
+ // Apply the 80-20 heuristic to dermine the full year based on
+ // defaultCenturyStart.
+ int year = calendar.get(Calendar.YEAR);
+ if (calendar.getTime().compareTo(defaultCenturyStart) < 0)
+ calendar.set(Calendar.YEAR, year + 100);
+ }
if (! saw_timezone)
{
// Use the real rules to determine whether or not this
@@ -854,6 +1134,69 @@ public class SimpleDateFormat extends DateFormat
pos.setErrorIndex(pos.getIndex());
return null;
}
+ }
+
+ /**
+ * <p>
+ * Computes the time zone offset in milliseconds
+ * relative to GMT, based on the supplied
+ * <code>String</code> representation.
+ * </p>
+ * <p>
+ * The supplied <code>String</code> must be a three
+ * or four digit signed number, with an optional 'GMT'
+ * prefix. The first one or two digits represents the hours,
+ * while the last two represent the minutes. The
+ * two sets of digits can optionally be separated by
+ * ':'. The mandatory sign prefix (either '+' or '-')
+ * indicates the direction of the offset from GMT.
+ * </p>
+ * <p>
+ * For example, 'GMT+0200' specifies 2 hours after
+ * GMT, while '-05:00' specifies 5 hours prior to
+ * GMT. The special case of 'GMT' alone can be used
+ * to represent the offset, 0.
+ * </p>
+ * <p>
+ * If the <code>String</code> can not be parsed,
+ * the result will be null. The resulting offset
+ * is wrapped in an <code>Integer</code> object, in
+ * order to allow such failure to be represented.
+ * </p>
+ *
+ * @param zoneString a string in the form
+ * (GMT)? sign hours : minutes
+ * where sign = '+' or '-', hours
+ * is a one or two digits representing
+ * a number between 0 and 23, and
+ * minutes is two digits representing
+ * a number between 0 and 59.
+ * @return the parsed offset, or null if parsing
+ * failed.
+ */
+ private Integer computeOffset(String zoneString)
+ {
+ Pattern pattern =
+ Pattern.compile("(GMT)?([+-])([012])?([0-9]):?([0-9]{2})");
+ Matcher matcher = pattern.matcher(zoneString);
+ if (matcher.matches())
+ {
+ int sign = matcher.group(2).equals("+") ? 1 : -1;
+ int hour = (Integer.parseInt(matcher.group(3)) * 10)
+ + Integer.parseInt(matcher.group(4));
+ int minutes = Integer.parseInt(matcher.group(5));
+
+ if (hour > 23)
+ return null;
+
+ int offset = sign * ((hour * 60) + minutes) * 60000;
+ return new Integer(offset);
+ }
+ else if (zoneString.startsWith("GMT"))
+ {
+ return new Integer(0);
+ }
+ return null;
}
// Compute the start of the current century as defined by
@@ -864,4 +1207,19 @@ public class SimpleDateFormat extends DateFormat
calendar.set(Calendar.YEAR, year - 80);
set2DigitYearStart(calendar.getTime());
}
+
+ /**
+ * Returns a copy of this instance of
+ * <code>SimpleDateFormat</code>. The copy contains
+ * clones of the formatting symbols and the 2-digit
+ * year century start date.
+ */
+ public Object clone()
+ {
+ SimpleDateFormat clone = (SimpleDateFormat) super.clone();
+ clone.setDateFormatSymbols((DateFormatSymbols) formatData.clone());
+ clone.set2DigitYearStart((Date) defaultCenturyStart.clone());
+ return clone;
+ }
+
}
diff --git a/libjava/java/text/StringCharacterIterator.java b/libjava/java/text/StringCharacterIterator.java
index 44bac6b74a3..82df7c44992 100644
--- a/libjava/java/text/StringCharacterIterator.java
+++ b/libjava/java/text/StringCharacterIterator.java
@@ -1,5 +1,5 @@
/* StringCharacterIterator.java -- Iterate over a character range in a string
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.text;
* the index to be set.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
*/
public final class StringCharacterIterator implements CharacterIterator
{
diff --git a/libjava/java/util/AbstractCollection.java b/libjava/java/util/AbstractCollection.java
index a98f41efbea..567380c1a9d 100644
--- a/libjava/java/util/AbstractCollection.java
+++ b/libjava/java/util/AbstractCollection.java
@@ -1,5 +1,5 @@
/* AbstractCollection.java -- Abstract implementation of most of Collection
- Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ import java.lang.reflect.Array;
*
* @author Original author unknown
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see AbstractSet
* @see AbstractList
diff --git a/libjava/java/util/AbstractList.java b/libjava/java/util/AbstractList.java
index 15cb5814ab8..37288a7bb9e 100644
--- a/libjava/java/util/AbstractList.java
+++ b/libjava/java/util/AbstractList.java
@@ -1,5 +1,5 @@
/* AbstractList.java -- Abstract implementation of most of List
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,7 +59,7 @@ package java.util;
*
* @author Original author unknown
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see List
* @see AbstractSequentialList
@@ -751,476 +751,475 @@ while (i.hasNext())
return new SubList(this, fromIndex, toIndex);
}
-} // class AbstractList
-
-
-/**
- * This class follows the implementation requirements set forth in
- * {@link AbstractList#subList(int, int)}. It matches Sun's implementation
- * by using a non-public top-level class in the same package.
- *
- * @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
- */
-class SubList extends AbstractList
-{
- // Package visible, for use by iterator.
- /** The original list. */
- final AbstractList backingList;
- /** The index of the first element of the sublist. */
- final int offset;
- /** The size of the sublist. */
- int size;
-
- /**
- * Construct the sublist.
- *
- * @param backing the list this comes from
- * @param fromIndex the lower bound, inclusive
- * @param toIndex the upper bound, exclusive
- */
- SubList(AbstractList backing, int fromIndex, int toIndex)
- {
- backingList = backing;
- modCount = backing.modCount;
- offset = fromIndex;
- size = toIndex - fromIndex;
- }
-
- /**
- * This method checks the two modCount fields to ensure that there has
- * not been a concurrent modification, returning if all is okay.
- *
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- */
- // This can be inlined. Package visible, for use by iterator.
- void checkMod()
- {
- if (modCount != backingList.modCount)
- throw new ConcurrentModificationException();
- }
-
- /**
- * This method checks that a value is between 0 and size (inclusive). If
- * it is not, an exception is thrown.
- *
- * @param index the value to check
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- */
- // This will get inlined, since it is private.
- private void checkBoundsInclusive(int index)
- {
- if (index < 0 || index > size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
- }
-
- /**
- * This method checks that a value is between 0 (inclusive) and size
- * (exclusive). If it is not, an exception is thrown.
- *
- * @param index the value to check
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- // This will get inlined, since it is private.
- private void checkBoundsExclusive(int index)
- {
- if (index < 0 || index >= size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
- }
-
- /**
- * Specified by AbstractList.subList to return the private field size.
- *
- * @return the sublist size
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- */
- public int size()
- {
- checkMod();
- return size;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the location to modify
- * @param o the new value
- * @return the old value
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws UnsupportedOperationException if the backing list does not
- * support the set operation
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws ClassCastException if o cannot be added to the backing list due
- * to its type
- * @throws IllegalArgumentException if o cannot be added to the backing list
- * for some other reason
- */
- public Object set(int index, Object o)
- {
- checkMod();
- checkBoundsExclusive(index);
- return backingList.set(index + offset, o);
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the location to get from
- * @return the object at that location
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- */
- public Object get(int index)
- {
- checkMod();
- checkBoundsExclusive(index);
- return backingList.get(index + offset);
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the index to insert at
- * @param o the object to add
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws UnsupportedOperationException if the backing list does not
- * support the add operation.
- * @throws ClassCastException if o cannot be added to the backing list due
- * to its type.
- * @throws IllegalArgumentException if o cannot be added to the backing
- * list for some other reason.
- */
- public void add(int index, Object o)
- {
- checkMod();
- checkBoundsInclusive(index);
- backingList.add(index + offset, o);
- size++;
- modCount = backingList.modCount;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the index to remove
- * @return the removed object
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
- * @throws UnsupportedOperationException if the backing list does not
- * support the remove operation
- */
- public Object remove(int index)
- {
- checkMod();
- checkBoundsExclusive(index);
- Object o = backingList.remove(index + offset);
- size--;
- modCount = backingList.modCount;
- return o;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- * This does no bounds checking, as it assumes it will only be called
- * by trusted code like clear() which has already checked the bounds.
- *
- * @param fromIndex the lower bound, inclusive
- * @param toIndex the upper bound, exclusive
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws UnsupportedOperationException if the backing list does
- * not support removing elements.
- */
- protected void removeRange(int fromIndex, int toIndex)
- {
- checkMod();
-
- backingList.removeRange(offset + fromIndex, offset + toIndex);
- size -= toIndex - fromIndex;
- modCount = backingList.modCount;
- }
-
- /**
- * Specified by AbstractList.subList to delegate to the backing list.
- *
- * @param index the location to insert at
- * @param c the collection to insert
- * @return true if this list was modified, in other words, c is non-empty
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if the specified collection is null
- */
- public boolean addAll(int index, Collection c)
- {
- checkMod();
- checkBoundsInclusive(index);
- int csize = c.size();
- boolean result = backingList.addAll(offset + index, c);
- size += csize;
- modCount = backingList.modCount;
- return result;
- }
-
- /**
- * Specified by AbstractList.subList to return addAll(size, c).
- *
- * @param c the collection to insert
- * @return true if this list was modified, in other words, c is non-empty
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws UnsupportedOperationException if this list does not support the
- * addAll operation
- * @throws ClassCastException if some element of c cannot be added to this
- * list due to its type
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this list for some other reason
- * @throws NullPointerException if the specified collection is null
- */
- public boolean addAll(Collection c)
- {
- return addAll(size, c);
- }
-
- /**
- * Specified by AbstractList.subList to return listIterator().
- *
- * @return an iterator over the sublist
- */
- public Iterator iterator()
- {
- return listIterator();
- }
-
/**
- * Specified by AbstractList.subList to return a wrapper around the
- * backing list's iterator.
+ * This class follows the implementation requirements set forth in
+ * {@link AbstractList#subList(int, int)}. It matches Sun's implementation
+ * by using a non-public top-level class in the same package.
*
- * @param index the start location of the iterator
- * @return a list iterator over the sublist
- * @throws ConcurrentModificationException if the backing list has been
- * modified externally to this sublist
- * @throws IndexOutOfBoundsException if the value is out of range
+ * @author Original author unknown
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
- public ListIterator listIterator(final int index)
+ private static class SubList extends AbstractList
{
- checkMod();
- checkBoundsInclusive(index);
-
- return new ListIterator()
+ // Package visible, for use by iterator.
+ /** The original list. */
+ final AbstractList backingList;
+ /** The index of the first element of the sublist. */
+ final int offset;
+ /** The size of the sublist. */
+ int size;
+
+ /**
+ * Construct the sublist.
+ *
+ * @param backing the list this comes from
+ * @param fromIndex the lower bound, inclusive
+ * @param toIndex the upper bound, exclusive
+ */
+ SubList(AbstractList backing, int fromIndex, int toIndex)
{
- private final ListIterator i = backingList.listIterator(index + offset);
- private int position = index;
-
- /**
- * Tests to see if there are any more objects to
- * return.
- *
- * @return True if the end of the list has not yet been
- * reached.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public boolean hasNext()
- {
- checkMod();
- return position < size;
- }
-
- /**
- * Tests to see if there are objects prior to the
- * current position in the list.
- *
- * @return True if objects exist prior to the current
- * position of the iterator.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public boolean hasPrevious()
- {
- checkMod();
- return position > 0;
- }
-
- /**
- * Retrieves the next object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * more objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object next()
- {
- if (position == size)
- throw new NoSuchElementException();
- position++;
- return i.next();
- }
-
- /**
- * Retrieves the previous object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * previous objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public Object previous()
- {
- if (position == 0)
- throw new NoSuchElementException();
- position--;
- return i.previous();
- }
-
- /**
- * Returns the index of the next element in the
- * list, which will be retrieved by <code>next()</code>
- *
- * @return The index of the next element.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public int nextIndex()
- {
- return i.nextIndex() - offset;
- }
-
- /**
- * Returns the index of the previous element in the
- * list, which will be retrieved by <code>previous()</code>
- *
- * @return The index of the previous element.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public int previousIndex()
- {
- return i.previousIndex() - offset;
- }
-
- /**
- * Removes the last object retrieved by <code>next()</code>
- * from the list, if the list supports object removal.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list does
- * not support removing elements.
- */
- public void remove()
- {
- i.remove();
- size--;
- position = nextIndex();
- modCount = backingList.modCount;
- }
-
-
- /**
- * Replaces the last object retrieved by <code>next()</code>
- * or <code>previous</code> with o, if the list supports object
- * replacement and an add or remove operation has not already
- * been performed.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition or removal of elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void set(Object o)
- {
- i.set(o);
- }
+ backingList = backing;
+ modCount = backing.modCount;
+ offset = fromIndex;
+ size = toIndex - fromIndex;
+ }
+
+ /**
+ * This method checks the two modCount fields to ensure that there has
+ * not been a concurrent modification, returning if all is okay.
+ *
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ */
+ // This can be inlined. Package visible, for use by iterator.
+ void checkMod()
+ {
+ if (modCount != backingList.modCount)
+ throw new ConcurrentModificationException();
+ }
+
+ /**
+ * This method checks that a value is between 0 and size (inclusive). If
+ * it is not, an exception is thrown.
+ *
+ * @param index the value to check
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
+ */
+ // This will get inlined, since it is private.
+ private void checkBoundsInclusive(int index)
+ {
+ if (index < 0 || index > size)
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ + size);
+ }
+
+ /**
+ * This method checks that a value is between 0 (inclusive) and size
+ * (exclusive). If it is not, an exception is thrown.
+ *
+ * @param index the value to check
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
+ */
+ // This will get inlined, since it is private.
+ private void checkBoundsExclusive(int index)
+ {
+ if (index < 0 || index >= size)
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ + size);
+ }
+
+ /**
+ * Specified by AbstractList.subList to return the private field size.
+ *
+ * @return the sublist size
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ */
+ public int size()
+ {
+ checkMod();
+ return size;
+ }
+
+ /**
+ * Specified by AbstractList.subList to delegate to the backing list.
+ *
+ * @param index the location to modify
+ * @param o the new value
+ * @return the old value
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws UnsupportedOperationException if the backing list does not
+ * support the set operation
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
+ * @throws ClassCastException if o cannot be added to the backing list due
+ * to its type
+ * @throws IllegalArgumentException if o cannot be added to the backing list
+ * for some other reason
+ */
+ public Object set(int index, Object o)
+ {
+ checkMod();
+ checkBoundsExclusive(index);
+ return backingList.set(index + offset, o);
+ }
+
+ /**
+ * Specified by AbstractList.subList to delegate to the backing list.
+ *
+ * @param index the location to get from
+ * @return the object at that location
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
+ */
+ public Object get(int index)
+ {
+ checkMod();
+ checkBoundsExclusive(index);
+ return backingList.get(index + offset);
+ }
+
+ /**
+ * Specified by AbstractList.subList to delegate to the backing list.
+ *
+ * @param index the index to insert at
+ * @param o the object to add
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
+ * @throws UnsupportedOperationException if the backing list does not
+ * support the add operation.
+ * @throws ClassCastException if o cannot be added to the backing list due
+ * to its type.
+ * @throws IllegalArgumentException if o cannot be added to the backing
+ * list for some other reason.
+ */
+ public void add(int index, Object o)
+ {
+ checkMod();
+ checkBoundsInclusive(index);
+ backingList.add(index + offset, o);
+ size++;
+ modCount = backingList.modCount;
+ }
+
+ /**
+ * Specified by AbstractList.subList to delegate to the backing list.
+ *
+ * @param index the index to remove
+ * @return the removed object
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt;= size()
+ * @throws UnsupportedOperationException if the backing list does not
+ * support the remove operation
+ */
+ public Object remove(int index)
+ {
+ checkMod();
+ checkBoundsExclusive(index);
+ Object o = backingList.remove(index + offset);
+ size--;
+ modCount = backingList.modCount;
+ return o;
+ }
+
+ /**
+ * Specified by AbstractList.subList to delegate to the backing list.
+ * This does no bounds checking, as it assumes it will only be called
+ * by trusted code like clear() which has already checked the bounds.
+ *
+ * @param fromIndex the lower bound, inclusive
+ * @param toIndex the upper bound, exclusive
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws UnsupportedOperationException if the backing list does
+ * not support removing elements.
+ */
+ protected void removeRange(int fromIndex, int toIndex)
+ {
+ checkMod();
+
+ backingList.removeRange(offset + fromIndex, offset + toIndex);
+ size -= toIndex - fromIndex;
+ modCount = backingList.modCount;
+ }
+
+ /**
+ * Specified by AbstractList.subList to delegate to the backing list.
+ *
+ * @param index the location to insert at
+ * @param c the collection to insert
+ * @return true if this list was modified, in other words, c is non-empty
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size()
+ * @throws UnsupportedOperationException if this list does not support the
+ * addAll operation
+ * @throws ClassCastException if some element of c cannot be added to this
+ * list due to its type
+ * @throws IllegalArgumentException if some element of c cannot be added
+ * to this list for some other reason
+ * @throws NullPointerException if the specified collection is null
+ */
+ public boolean addAll(int index, Collection c)
+ {
+ checkMod();
+ checkBoundsInclusive(index);
+ int csize = c.size();
+ boolean result = backingList.addAll(offset + index, c);
+ size += csize;
+ modCount = backingList.modCount;
+ return result;
+ }
+
+ /**
+ * Specified by AbstractList.subList to return addAll(size, c).
+ *
+ * @param c the collection to insert
+ * @return true if this list was modified, in other words, c is non-empty
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws UnsupportedOperationException if this list does not support the
+ * addAll operation
+ * @throws ClassCastException if some element of c cannot be added to this
+ * list due to its type
+ * @throws IllegalArgumentException if some element of c cannot be added
+ * to this list for some other reason
+ * @throws NullPointerException if the specified collection is null
+ */
+ public boolean addAll(Collection c)
+ {
+ return addAll(size, c);
+ }
+
+ /**
+ * Specified by AbstractList.subList to return listIterator().
+ *
+ * @return an iterator over the sublist
+ */
+ public Iterator iterator()
+ {
+ return listIterator();
+ }
+
+ /**
+ * Specified by AbstractList.subList to return a wrapper around the
+ * backing list's iterator.
+ *
+ * @param index the start location of the iterator
+ * @return a list iterator over the sublist
+ * @throws ConcurrentModificationException if the backing list has been
+ * modified externally to this sublist
+ * @throws IndexOutOfBoundsException if the value is out of range
+ */
+ public ListIterator listIterator(final int index)
+ {
+ checkMod();
+ checkBoundsInclusive(index);
- /**
- * Adds the supplied object before the element that would be returned
- * by a call to <code>next()</code>, if the list supports addition.
- *
- * @param o The object to add to the list.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition of new elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void add(Object o)
+ return new ListIterator()
{
- i.add(o);
- size++;
- position++;
- modCount = backingList.modCount;
- }
-
- // Here is the reason why the various modCount fields are mostly
- // ignored in this wrapper listIterator.
- // If the backing listIterator is failfast, then the following holds:
- // Using any other method on this list will call a corresponding
- // method on the backing list *after* the backing listIterator
- // is created, which will in turn cause a ConcurrentModException
- // when this listIterator comes to use the backing one. So it is
- // implicitly failfast.
- // If the backing listIterator is NOT failfast, then the whole of
- // this list isn't failfast, because the modCount field of the
- // backing list is not valid. It would still be *possible* to
- // make the iterator failfast wrt modifications of the sublist
- // only, but somewhat pointless when the list can be changed under
- // us.
- // Either way, no explicit handling of modCount is needed.
- // However modCount = backingList.modCount must be executed in add
- // and remove, and size must also be updated in these two methods,
- // since they do not go through the corresponding methods of the subList.
- };
- }
-} // class SubList
+ private final ListIterator i = backingList.listIterator(index + offset);
+ private int position = index;
+
+ /**
+ * Tests to see if there are any more objects to
+ * return.
+ *
+ * @return True if the end of the list has not yet been
+ * reached.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public boolean hasNext()
+ {
+ checkMod();
+ return position < size;
+ }
+
+ /**
+ * Tests to see if there are objects prior to the
+ * current position in the list.
+ *
+ * @return True if objects exist prior to the current
+ * position of the iterator.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public boolean hasPrevious()
+ {
+ checkMod();
+ return position > 0;
+ }
+
+ /**
+ * Retrieves the next object from the list.
+ *
+ * @return The next object.
+ * @throws NoSuchElementException if there are no
+ * more objects to retrieve.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public Object next()
+ {
+ if (position == size)
+ throw new NoSuchElementException();
+ position++;
+ return i.next();
+ }
+
+ /**
+ * Retrieves the previous object from the list.
+ *
+ * @return The next object.
+ * @throws NoSuchElementException if there are no
+ * previous objects to retrieve.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public Object previous()
+ {
+ if (position == 0)
+ throw new NoSuchElementException();
+ position--;
+ return i.previous();
+ }
+
+ /**
+ * Returns the index of the next element in the
+ * list, which will be retrieved by <code>next()</code>
+ *
+ * @return The index of the next element.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public int nextIndex()
+ {
+ return i.nextIndex() - offset;
+ }
+
+ /**
+ * Returns the index of the previous element in the
+ * list, which will be retrieved by <code>previous()</code>
+ *
+ * @return The index of the previous element.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public int previousIndex()
+ {
+ return i.previousIndex() - offset;
+ }
+
+ /**
+ * Removes the last object retrieved by <code>next()</code>
+ * from the list, if the list supports object removal.
+ *
+ * @throws IllegalStateException if the iterator is positioned
+ * before the start of the list or the last object has already
+ * been removed.
+ * @throws UnsupportedOperationException if the list does
+ * not support removing elements.
+ */
+ public void remove()
+ {
+ i.remove();
+ size--;
+ position = nextIndex();
+ modCount = backingList.modCount;
+ }
+
+
+ /**
+ * Replaces the last object retrieved by <code>next()</code>
+ * or <code>previous</code> with o, if the list supports object
+ * replacement and an add or remove operation has not already
+ * been performed.
+ *
+ * @throws IllegalStateException if the iterator is positioned
+ * before the start of the list or the last object has already
+ * been removed.
+ * @throws UnsupportedOperationException if the list doesn't support
+ * the addition or removal of elements.
+ * @throws ClassCastException if the type of o is not a valid type
+ * for this list.
+ * @throws IllegalArgumentException if something else related to o
+ * prevents its addition.
+ * @throws ConcurrentModificationException if the list
+ * has been modified elsewhere.
+ */
+ public void set(Object o)
+ {
+ i.set(o);
+ }
+
+ /**
+ * Adds the supplied object before the element that would be returned
+ * by a call to <code>next()</code>, if the list supports addition.
+ *
+ * @param o The object to add to the list.
+ * @throws UnsupportedOperationException if the list doesn't support
+ * the addition of new elements.
+ * @throws ClassCastException if the type of o is not a valid type
+ * for this list.
+ * @throws IllegalArgumentException if something else related to o
+ * prevents its addition.
+ * @throws ConcurrentModificationException if the list
+ * has been modified elsewhere.
+ */
+ public void add(Object o)
+ {
+ i.add(o);
+ size++;
+ position++;
+ modCount = backingList.modCount;
+ }
+
+ // Here is the reason why the various modCount fields are mostly
+ // ignored in this wrapper listIterator.
+ // If the backing listIterator is failfast, then the following holds:
+ // Using any other method on this list will call a corresponding
+ // method on the backing list *after* the backing listIterator
+ // is created, which will in turn cause a ConcurrentModException
+ // when this listIterator comes to use the backing one. So it is
+ // implicitly failfast.
+ // If the backing listIterator is NOT failfast, then the whole of
+ // this list isn't failfast, because the modCount field of the
+ // backing list is not valid. It would still be *possible* to
+ // make the iterator failfast wrt modifications of the sublist
+ // only, but somewhat pointless when the list can be changed under
+ // us.
+ // Either way, no explicit handling of modCount is needed.
+ // However modCount = backingList.modCount must be executed in add
+ // and remove, and size must also be updated in these two methods,
+ // since they do not go through the corresponding methods of the subList.
+ };
+ }
+ } // class SubList
-/**
- * This class is a RandomAccess version of SubList, as required by
- * {@link AbstractList#subList(int, int)}.
- *
- * @author Eric Blake <ebb9@email.byu.edu>
- */
-final class RandomAccessSubList extends SubList
- implements RandomAccess
-{
/**
- * Construct the sublist.
+ * This class is a RandomAccess version of SubList, as required by
+ * {@link AbstractList#subList(int, int)}.
*
- * @param backing the list this comes from
- * @param fromIndex the lower bound, inclusive
- * @param toIndex the upper bound, exclusive
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
- RandomAccessSubList(AbstractList backing, int fromIndex, int toIndex)
+ private static final class RandomAccessSubList extends SubList
+ implements RandomAccess
{
- super(backing, fromIndex, toIndex);
- }
-} // class RandomAccessSubList
+ /**
+ * Construct the sublist.
+ *
+ * @param backing the list this comes from
+ * @param fromIndex the lower bound, inclusive
+ * @param toIndex the upper bound, exclusive
+ */
+ RandomAccessSubList(AbstractList backing, int fromIndex, int toIndex)
+ {
+ super(backing, fromIndex, toIndex);
+ }
+ } // class RandomAccessSubList
+
+} // class AbstractList
diff --git a/libjava/java/util/AbstractMap.java b/libjava/java/util/AbstractMap.java
index d27e93b65d1..81093f8e374 100644
--- a/libjava/java/util/AbstractMap.java
+++ b/libjava/java/util/AbstractMap.java
@@ -1,5 +1,5 @@
/* AbstractMap.java -- Abstract implementation of most of Map
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ package java.util;
*
* @author Original author unknown
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Map
* @see Collection
* @see HashMap
@@ -622,7 +622,7 @@ public abstract class AbstractMap implements Map
* life much easier.
*
* @author Jon Zeppieri
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
// XXX - FIXME Use fully qualified implements as gcj 3.1 workaround.
// Bug still exists in 3.4.1
diff --git a/libjava/java/util/AbstractSequentialList.java b/libjava/java/util/AbstractSequentialList.java
index 0e5d59fceec..f942e578ba1 100644
--- a/libjava/java/util/AbstractSequentialList.java
+++ b/libjava/java/util/AbstractSequentialList.java
@@ -1,5 +1,5 @@
/* AbstractSequentialList.java -- List implementation for sequential access
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ package java.util;
*
* @author Original author unknown
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see List
* @see AbstractList
diff --git a/libjava/java/util/AbstractSet.java b/libjava/java/util/AbstractSet.java
index ce266283ebe..dcab1c9d3ea 100644
--- a/libjava/java/util/AbstractSet.java
+++ b/libjava/java/util/AbstractSet.java
@@ -1,5 +1,5 @@
/* AbstractSet.java -- Abstract implementation of most of Set
- Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package java.util;
* the requirements placed on them by the Set interface.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see AbstractCollection
* @see Set
diff --git a/libjava/java/util/ArrayList.java b/libjava/java/util/ArrayList.java
index e39e4e0171b..2479efdf8b9 100644
--- a/libjava/java/util/ArrayList.java
+++ b/libjava/java/util/ArrayList.java
@@ -1,6 +1,6 @@
/* ArrayList.java -- JDK1.2's answer to Vector; this is an array-backed
implementation of the List interface
- Copyright (C) 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -72,7 +72,7 @@ import java.lang.reflect.Array;
*
* @author Jon A. Zeppieri
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see List
* @see LinkedList
diff --git a/libjava/java/util/Arrays.java b/libjava/java/util/Arrays.java
index f2337aee6dc..f3f15e6ec2b 100644
--- a/libjava/java/util/Arrays.java
+++ b/libjava/java/util/Arrays.java
@@ -1,5 +1,5 @@
/* Arrays.java -- Utility class with methods to operate on arrays
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,7 +59,7 @@ import java.lang.reflect.Array;
*
* @author Original author unknown
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Comparable
* @see Comparator
* @since 1.2
@@ -935,7 +935,7 @@ public class Arrays
// sort
- // Thanks to Paul Fisher <rao@gnu.org> for finding this quicksort algorithm
+ // Thanks to Paul Fisher (rao@gnu.org) for finding this quicksort algorithm
// as specified by Sun and porting it to Java. The algorithm is an optimised
// quicksort, as described in Jon L. Bentley and M. Douglas McIlroy's
// "Engineering a Sort Function", Software-Practice and Experience, Vol.
@@ -2358,7 +2358,7 @@ public class Arrays
* Sun's choice for Serialization purposes. Element addition and removal
* is prohibited, but values can be modified.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
private static final class ArrayList extends AbstractList
diff --git a/libjava/java/util/BitSet.java b/libjava/java/util/BitSet.java
index d152ba1d96b..cf7a83ed083 100644
--- a/libjava/java/util/BitSet.java
+++ b/libjava/java/util/BitSet.java
@@ -1,5 +1,5 @@
/* BitSet.java -- A vector of bits.
- Copyright (C) 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,8 +61,8 @@ import java.io.Serializable;
* undefined.
*
* @author Jochen Hoenicke
- * @author Tom Tromey <tromey@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status updated to 1.4
*/
public class BitSet implements Cloneable, Serializable
diff --git a/libjava/java/util/Calendar.java b/libjava/java/util/Calendar.java
index 1f0b27a56e8..0e9284c7c21 100644
--- a/libjava/java/util/Calendar.java
+++ b/libjava/java/util/Calendar.java
@@ -1,5 +1,5 @@
/* Calendar.java --
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ import java.lang.reflect.InvocationTargetException;
* integer fields which represent <code>YEAR</code>,
* <code>MONTH</code>, <code>DAY</code>, etc. The <code>Date</code>
* object represents a time in milliseconds since the Epoch. <br>
- *
+ *
* This class is locale sensitive. To get the Object matching the
* current locale you can use <code>getInstance</code>. You can even provide
* a locale or a timezone. <code>getInstance</code> returns currently
@@ -78,13 +78,13 @@ import java.lang.reflect.InvocationTargetException;
* and for the first line all fields are set, that line is used to
* compute the day. <br>
*
- *
+ *
<pre>month + day_of_month
month + week_of_month + day_of_week
month + day_of_week_of_month + day_of_week
day_of_year
day_of_week + week_of_year</pre>
- *
+ *
* The hour_of_day-field takes precedence over the ampm and
* hour_of_ampm fields. <br>
*
@@ -92,7 +92,7 @@ day_of_week + week_of_year</pre>
*
* To convert a calendar to a human readable form and vice versa, use
* the <code>java.text.DateFormat</code> class. <br>
- *
+ *
* Other useful things you can do with an calendar, is
* <code>roll</code>ing fields (that means increase/decrease a
* specific field by one, propagating overflows), or
@@ -101,7 +101,7 @@ day_of_week + week_of_year</pre>
* @see Date
* @see GregorianCalendar
* @see TimeZone
- * @see java.text.DateFormat
+ * @see java.text.DateFormat
*/
public abstract class Calendar implements Serializable, Cloneable
{
@@ -109,43 +109,52 @@ public abstract class Calendar implements Serializable, Cloneable
* Constant representing the era time field.
*/
public static final int ERA = 0;
+
/**
* Constant representing the year time field.
*/
public static final int YEAR = 1;
+
/**
* Constant representing the month time field. This field
* should contain one of the JANUARY,...,DECEMBER constants below.
*/
public static final int MONTH = 2;
+
/**
* Constant representing the week of the year field.
* @see #setFirstDayOfWeek(int)
*/
public static final int WEEK_OF_YEAR = 3;
+
/**
* Constant representing the week of the month time field.
* @see #setFirstDayOfWeek(int)
*/
public static final int WEEK_OF_MONTH = 4;
+
/**
* Constant representing the day time field, synonym for DAY_OF_MONTH.
*/
public static final int DATE = 5;
+
/**
* Constant representing the day time field.
*/
public static final int DAY_OF_MONTH = 5;
+
/**
* Constant representing the day of year time field. This is
* 1 for the first day in month.
*/
public static final int DAY_OF_YEAR = 6;
+
/**
* Constant representing the day of week time field. This field
* should contain one of the SUNDAY,...,SATURDAY constants below.
*/
public static final int DAY_OF_WEEK = 7;
+
/**
* Constant representing the day-of-week-in-month field. For
* instance this field contains 2 for the second thursday in a
@@ -153,42 +162,51 @@ public abstract class Calendar implements Serializable, Cloneable
* from the end of the month.
*/
public static final int DAY_OF_WEEK_IN_MONTH = 8;
+
/**
* Constant representing the part of the day for 12-hour clock. This
* should be one of AM or PM.
*/
public static final int AM_PM = 9;
+
/**
* Constant representing the hour time field for 12-hour clock.
*/
public static final int HOUR = 10;
+
/**
* Constant representing the hour of day time field for 24-hour clock.
*/
public static final int HOUR_OF_DAY = 11;
+
/**
* Constant representing the minute of hour time field.
*/
public static final int MINUTE = 12;
+
/**
* Constant representing the second time field.
*/
public static final int SECOND = 13;
+
/**
* Constant representing the millisecond time field.
*/
public static final int MILLISECOND = 14;
+
/**
* Constant representing the time zone offset time field for the
* time given in the other fields. It is measured in
- * milliseconds. The default is the offset of the time zone.
+ * milliseconds. The default is the offset of the time zone.
*/
public static final int ZONE_OFFSET = 15;
+
/**
* Constant representing the daylight saving time offset in
- * milliseconds. The default is the value given by the time zone.
+ * milliseconds. The default is the value given by the time zone.
*/
public static final int DST_OFFSET = 16;
+
/**
* Number of time fields.
*/
@@ -198,26 +216,32 @@ public abstract class Calendar implements Serializable, Cloneable
* Constant representing Sunday.
*/
public static final int SUNDAY = 1;
+
/**
* Constant representing Monday.
*/
public static final int MONDAY = 2;
+
/**
* Constant representing Tuesday.
*/
public static final int TUESDAY = 3;
+
/**
* Constant representing Wednesday.
*/
public static final int WEDNESDAY = 4;
+
/**
* Constant representing Thursday.
*/
public static final int THURSDAY = 5;
+
/**
* Constant representing Friday.
*/
public static final int FRIDAY = 6;
+
/**
* Constant representing Saturday.
*/
@@ -227,50 +251,62 @@ public abstract class Calendar implements Serializable, Cloneable
* Constant representing January.
*/
public static final int JANUARY = 0;
+
/**
* Constant representing February.
*/
public static final int FEBRUARY = 1;
+
/**
* Constant representing March.
*/
public static final int MARCH = 2;
+
/**
* Constant representing April.
*/
public static final int APRIL = 3;
+
/**
* Constant representing May.
*/
public static final int MAY = 4;
+
/**
* Constant representing June.
*/
public static final int JUNE = 5;
+
/**
* Constant representing July.
*/
public static final int JULY = 6;
+
/**
* Constant representing August.
*/
public static final int AUGUST = 7;
+
/**
* Constant representing September.
*/
public static final int SEPTEMBER = 8;
+
/**
* Constant representing October.
*/
public static final int OCTOBER = 9;
+
/**
* Constant representing November.
*/
public static final int NOVEMBER = 10;
+
/**
* Constant representing December.
*/
public static final int DECEMBER = 11;
+
/**
* Constant representing Undecimber. This is an artificial name useful
* for lunar calendars.
@@ -281,6 +317,7 @@ public abstract class Calendar implements Serializable, Cloneable
* Useful constant for 12-hour clock.
*/
public static final int AM = 0;
+
/**
* Useful constant for 12-hour clock.
*/
@@ -292,21 +329,25 @@ public abstract class Calendar implements Serializable, Cloneable
* @serial
*/
protected int[] fields = new int[FIELD_COUNT];
+
/**
* The flags which tell if the fields above have a value.
* @serial
*/
protected boolean[] isSet = new boolean[FIELD_COUNT];
+
/**
* The time in milliseconds since the epoch.
* @serial
*/
protected long time;
+
/**
* Tells if the above field has a valid value.
* @serial
*/
protected boolean isTimeSet;
+
/**
* Tells if the fields have a valid value. This superseeds the isSet
* array.
@@ -332,7 +373,7 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Sets what the first day of week is. This is used for
- * WEEK_OF_MONTH and WEEK_OF_YEAR fields.
+ * WEEK_OF_MONTH and WEEK_OF_YEAR fields.
* @serial
*/
private int firstDayOfWeek;
@@ -347,13 +388,20 @@ public abstract class Calendar implements Serializable, Cloneable
private int minimalDaysInFirstWeek;
/**
- * The version of the serialized data on the stream.
+ * Is set to true if DST_OFFSET is explicitly set. In that case
+ * it's value overrides the value computed from the current
+ * time and the timezone.
+ */
+ private boolean explicitDSTOffset = false;
+
+ /**
+ * The version of the serialized data on the stream.
* <dl><dt>0 or not present</dt>
* <dd> JDK 1.1.5 or later.</dd>
- * <dl><dt>1</dt>
+ * <dt>1</dt>
* <dd>JDK 1.1.6 or later. This always writes a correct `time' value
* on the stream, as well as the other fields, to be compatible with
- * earlier versions</dd>
+ * earlier versions</dd></dl>
* @since JDK1.1.6
* @serial
*/
@@ -371,14 +419,14 @@ public abstract class Calendar implements Serializable, Cloneable
private static final String bundleName = "gnu.java.locale.Calendar";
/**
- * get resource bundle:
+ * get resource bundle:
* The resources should be loaded via this method only. Iff an application
- * uses this method, the resourcebundle is required.
+ * uses this method, the resourcebundle is required.
*/
- private static ResourceBundle getBundle(Locale locale)
+ private static ResourceBundle getBundle(Locale locale)
{
return ResourceBundle.getBundle(bundleName, locale,
- ClassLoader.getSystemClassLoader());
+ ClassLoader.getSystemClassLoader());
}
/**
@@ -404,8 +452,9 @@ public abstract class Calendar implements Serializable, Cloneable
ResourceBundle rb = getBundle(locale);
firstDayOfWeek = ((Integer) rb.getObject("firstDayOfWeek")).intValue();
- minimalDaysInFirstWeek =
- ((Integer) rb.getObject("minimalDaysInFirstWeek")).intValue();
+ minimalDaysInFirstWeek = ((Integer) rb.getObject("minimalDaysInFirstWeek"))
+ .intValue();
+ clear();
}
/**
@@ -437,15 +486,17 @@ public abstract class Calendar implements Serializable, Cloneable
return getInstance(TimeZone.getDefault(), locale);
}
- /**
+ /**
* Cache of locale->calendar-class mappings. This avoids having to do a ResourceBundle
- * lookup for every getInstance call.
+ * lookup for every getInstance call.
*/
private static HashMap cache = new HashMap();
/** Preset argument types for calendar-class constructor lookup. */
- private static Class[] ctorArgTypes
- = new Class[] {TimeZone.class, Locale.class};
+ private static Class[] ctorArgTypes = new Class[]
+ {
+ TimeZone.class, Locale.class
+ };
/**
* Creates a calendar representing the actual time, using the given
@@ -473,7 +524,7 @@ public abstract class Calendar implements Serializable, Cloneable
}
}
- // GregorianCalendar is by far the most common case. Optimize by
+ // GregorianCalendar is by far the most common case. Optimize by
// avoiding reflection.
if (calendarClass == GregorianCalendar.class)
return new GregorianCalendar(zone, locale);
@@ -481,7 +532,7 @@ public abstract class Calendar implements Serializable, Cloneable
if (Calendar.class.isAssignableFrom(calendarClass))
{
Constructor ctor = calendarClass.getConstructor(ctorArgTypes);
- return (Calendar) ctor.newInstance(new Object[] {zone, locale});
+ return (Calendar) ctor.newInstance(new Object[] { zone, locale });
}
}
catch (ClassNotFoundException ex)
@@ -504,9 +555,9 @@ public abstract class Calendar implements Serializable, Cloneable
{
exception = ex;
}
-
- throw new RuntimeException("Error instantiating calendar for locale " +
- locale, exception);
+
+ throw new RuntimeException("Error instantiating calendar for locale "
+ + locale, exception);
}
/**
@@ -530,7 +581,7 @@ public abstract class Calendar implements Serializable, Cloneable
* Converts the milliseconds since the epoch UTC
* (<code>time</code>) to time fields
* (<code>fields</code>). Override this method if you write your
- * own Calendar.
+ * own Calendar.
*/
protected abstract void computeFields();
@@ -541,7 +592,7 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public final Date getTime()
{
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
return new Date(time);
}
@@ -562,7 +613,7 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public long getTimeInMillis()
{
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
return time;
}
@@ -575,9 +626,9 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public void setTimeInMillis(long time)
{
+ clear();
this.time = time;
isTimeSet = true;
- computeFields();
}
/**
@@ -593,14 +644,14 @@ public abstract class Calendar implements Serializable, Cloneable
public int get(int field)
{
// If the requested field is invalid, force all fields to be recomputed.
- if (!isSet[field])
+ if (! isSet[field])
areFieldsSet = false;
complete();
return fields[field];
}
/**
- * Gets the value of the specified field. This method doesn't
+ * Gets the value of the specified field. This method doesn't
* recompute the fields, if they are invalid.
* @param field the time field. One of the time field constants.
* @return the value of the specified field, undefined if
@@ -626,21 +677,72 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public void set(int field, int value)
{
+ if (isTimeSet)
+ for (int i = 0; i < FIELD_COUNT; i++)
+ isSet[i] = false;
isTimeSet = false;
fields[field] = value;
isSet[field] = true;
+
+ // The five valid date patterns, in order of priority
+ // 1 YEAR + MONTH + DAY_OF_MONTH
+ // 2 YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
+ // 3 YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
+ // 4 YEAR + DAY_OF_YEAR
+ // 5 YEAR + DAY_OF_WEEK + WEEK_OF_YEAR
switch (field)
{
- case YEAR:
- case MONTH:
- case DATE:
+ case MONTH: // pattern 1,2 or 3
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
+ case DAY_OF_MONTH: // pattern 1
+ isSet[YEAR] = true;
+ isSet[MONTH] = true;
+ isSet[WEEK_OF_MONTH] = true;
+ isSet[DAY_OF_WEEK] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
+ case WEEK_OF_MONTH: // pattern 2
+ isSet[YEAR] = true;
+ isSet[MONTH] = true;
+ isSet[DAY_OF_WEEK] = true;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
isSet[WEEK_OF_YEAR] = false;
+ break;
+ case DAY_OF_WEEK_IN_MONTH: // pattern 3
+ isSet[YEAR] = true;
+ isSet[MONTH] = true;
+ isSet[DAY_OF_WEEK] = true;
isSet[DAY_OF_YEAR] = false;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
+ case DAY_OF_YEAR: // pattern 4
+ isSet[YEAR] = true;
+ isSet[MONTH] = false;
isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_MONTH] = false;
isSet[DAY_OF_WEEK] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ break;
+ case WEEK_OF_YEAR: // pattern 5
+ isSet[YEAR] = true;
+ isSet[DAY_OF_WEEK] = true;
+ isSet[MONTH] = false;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
isSet[DAY_OF_WEEK_IN_MONTH] = false;
break;
case AM_PM:
+ isSet[HOUR] = true;
isSet[HOUR_OF_DAY] = false;
break;
case HOUR_OF_DAY:
@@ -648,12 +750,15 @@ public abstract class Calendar implements Serializable, Cloneable
isSet[HOUR] = false;
break;
case HOUR:
+ isSet[AM_PM] = true;
isSet[HOUR_OF_DAY] = false;
break;
+ case DST_OFFSET:
+ explicitDSTOffset = true;
}
// May have crossed over a DST boundary.
- if (field != DST_OFFSET && field != ZONE_OFFSET)
+ if (! explicitDSTOffset && (field != DST_OFFSET && field != ZONE_OFFSET))
isSet[DST_OFFSET] = false;
}
@@ -675,8 +780,10 @@ public abstract class Calendar implements Serializable, Cloneable
isSet[WEEK_OF_MONTH] = false;
isSet[DAY_OF_WEEK] = false;
isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[ERA] = false;
- isSet[DST_OFFSET] = false; // May have crossed a DST boundary.
+ if (! explicitDSTOffset)
+ isSet[DST_OFFSET] = false; // May have crossed a DST boundary.
}
/**
@@ -706,8 +813,8 @@ public abstract class Calendar implements Serializable, Cloneable
* @param minute the minute.
* @param second the second.
*/
- public final void set(int year, int month, int date,
- int hour, int minute, int second)
+ public final void set(int year, int month, int date, int hour, int minute,
+ int second)
{
set(year, month, date, hour, minute);
fields[SECOND] = second;
@@ -721,11 +828,15 @@ public abstract class Calendar implements Serializable, Cloneable
{
isTimeSet = false;
areFieldsSet = false;
+ int zoneOffs = zone.getRawOffset();
+ int[] tempFields =
+ {
+ 1, 1970, JANUARY, 1, 1, 1, 1, THURSDAY, 1, AM, 0, 0, 0,
+ 0, 0, zoneOffs, 0
+ };
+ fields = tempFields;
for (int i = 0; i < FIELD_COUNT; i++)
- {
- isSet[i] = false;
- fields[i] = 0;
- }
+ isSet[i] = false;
}
/**
@@ -737,10 +848,15 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public final void clear(int field)
{
+ int[] tempFields =
+ {
+ 1, 1970, JANUARY, 1, 1, 1, 1, THURSDAY, 1, AM, 0, 0, 0,
+ 0, 0, zone.getRawOffset(), 0
+ };
isTimeSet = false;
areFieldsSet = false;
isSet[field] = false;
- fields[field] = 0;
+ fields[field] = tempFields[field];
}
/**
@@ -757,18 +873,18 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Fills any unset fields in the time field list
- * @return true if the specified field has a value.
+ * @return true if the specified field has a value.
*/
protected void complete()
{
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
- if (!areFieldsSet)
+ if (! areFieldsSet)
computeFields();
}
/**
- * Compares the given calendar with this.
+ * Compares the given calendar with this.
* @param o the object to that we should compare.
* @return true, if the given object is a calendar, that represents
* the same time (but doesn't necessary have the same fields).
@@ -776,12 +892,12 @@ public abstract class Calendar implements Serializable, Cloneable
public boolean equals(Object o)
{
return (o instanceof Calendar)
- && getTimeInMillis() == ((Calendar) o).getTimeInMillis();
+ && getTimeInMillis() == ((Calendar) o).getTimeInMillis();
}
/**
* Returns a hash code for this calendar.
- * @return a hash code, which fullfits the general contract of
+ * @return a hash code, which fullfits the general contract of
* <code>hashCode()</code>
*/
public int hashCode()
@@ -791,7 +907,7 @@ public abstract class Calendar implements Serializable, Cloneable
}
/**
- * Compares the given calendar with this.
+ * Compares the given calendar with this.
* @param o the object to that we should compare.
* @return true, if the given object is a calendar, and this calendar
* represents a smaller time than the calendar o.
@@ -804,7 +920,7 @@ public abstract class Calendar implements Serializable, Cloneable
}
/**
- * Compares the given calendar with this.
+ * Compares the given calendar with this.
* @param o the object to that we should compare.
* @return true, if the given object is a calendar, and this calendar
* represents a bigger time than the calendar o.
@@ -831,11 +947,11 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Rolls the specified time field up or down. This means add one
* to the specified field, but don't change the other fields. If
- * the maximum for this field is reached, start over with the
+ * the maximum for this field is reached, start over with the
* minimum value. <br>
*
* <strong>Note:</strong> There may be situation, where the other
- * fields must be changed, e.g rolling the month on May, 31.
+ * fields must be changed, e.g rolling the month on May, 31.
* The date June, 31 is automatically converted to July, 1.
* @param field the time field. One of the time field constants.
* @param up the direction, true for up, false for down.
@@ -854,7 +970,7 @@ public abstract class Calendar implements Serializable, Cloneable
*
* @param field the time field. One of the time field constants.
* @param amount the amount to roll by, positive for rolling up,
- * negative for rolling down.
+ * negative for rolling down.
* @throws ArrayIndexOutOfBoundsException if the field is outside
* the valid range. The value of field must be >= 0 and
* <= <code>FIELD_COUNT</code>.
@@ -874,7 +990,6 @@ public abstract class Calendar implements Serializable, Cloneable
}
}
-
/**
* Sets the time zone to the specified value.
* @param zone the new time zone
@@ -918,7 +1033,7 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Sets what the first day of week is. This is used for
- * WEEK_OF_MONTH and WEEK_OF_YEAR fields.
+ * WEEK_OF_MONTH and WEEK_OF_YEAR fields.
* @param value the first day of week. One of SUNDAY to SATURDAY.
*/
public void setFirstDayOfWeek(int value)
@@ -928,7 +1043,7 @@ public abstract class Calendar implements Serializable, Cloneable
/**
* Gets what the first day of week is. This is used for
- * WEEK_OF_MONTH and WEEK_OF_YEAR fields.
+ * WEEK_OF_MONTH and WEEK_OF_YEAR fields.
* @return the first day of week. One of SUNDAY to SATURDAY.
*/
public int getFirstDayOfWeek()
@@ -972,7 +1087,6 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public abstract int getMaximum(int field);
-
/**
* Gets the greatest minimum value that is allowed for the specified field.
* @param field the time field. One of the time field constants.
@@ -984,7 +1098,7 @@ public abstract class Calendar implements Serializable, Cloneable
* Gets the smallest maximum value that is allowed for the
* specified field. For example this is 28 for DAY_OF_MONTH.
* @param field the time field. One of the time field constants.
- * @return the least maximum value.
+ * @return the least maximum value.
*/
public abstract int getLeastMaximum(int field);
@@ -1000,16 +1114,15 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public int getActualMinimum(int field)
{
- Calendar tmp = (Calendar)clone(); // To avoid restoring state
+ Calendar tmp = (Calendar) clone(); // To avoid restoring state
int min = tmp.getGreatestMinimum(field);
int end = tmp.getMinimum(field);
tmp.set(field, min);
for (; min > end; min--)
{
- tmp.add(field, -1); // Try to get smaller
+ tmp.add(field, -1); // Try to get smaller
if (tmp.get(field) != min - 1)
- break; // Done if not successful
-
+ break; // Done if not successful
}
return min;
}
@@ -1018,7 +1131,7 @@ public abstract class Calendar implements Serializable, Cloneable
* Gets the actual maximum value that is allowed for the specified field.
* This value is dependent on the values of the other fields.
* @param field the time field. One of the time field constants.
- * @return the actual maximum value.
+ * @return the actual maximum value.
* @throws ArrayIndexOutOfBoundsException if the field is outside
* the valid range. The value of field must be >= 0 and
* <= <code>FIELD_COUNT</code>.
@@ -1026,7 +1139,7 @@ public abstract class Calendar implements Serializable, Cloneable
*/
public int getActualMaximum(int field)
{
- Calendar tmp = (Calendar)clone(); // To avoid restoring state
+ Calendar tmp = (Calendar) clone(); // To avoid restoring state
int max = tmp.getLeastMaximum(field);
int end = tmp.getMaximum(field);
tmp.set(field, max);
@@ -1048,7 +1161,7 @@ public abstract class Calendar implements Serializable, Cloneable
{
Calendar cal = (Calendar) super.clone();
cal.fields = (int[]) fields.clone();
- cal.isSet = (boolean[])isSet.clone();
+ cal.isSet = (boolean[]) isSet.clone();
return cal;
}
catch (CloneNotSupportedException ex)
@@ -1057,16 +1170,19 @@ public abstract class Calendar implements Serializable, Cloneable
}
}
- private static final String[] fieldNames = {
- ",ERA=", ",YEAR=", ",MONTH=",
- ",WEEK_OF_YEAR=", ",WEEK_OF_MONTH=",
- ",DAY_OF_MONTH=", ",DAY_OF_YEAR=", ",DAY_OF_WEEK=",
- ",DAY_OF_WEEK_IN_MONTH=",
- ",AM_PM=", ",HOUR=", ",HOUR_OF_DAY=",
- ",MINUTE=", ",SECOND=", ",MILLISECOND=",
- ",ZONE_OFFSET=", ",DST_OFFSET="
- };
-
+ private static final String[] fieldNames =
+ {
+ ",ERA=", ",YEAR=", ",MONTH=",
+ ",WEEK_OF_YEAR=",
+ ",WEEK_OF_MONTH=",
+ ",DAY_OF_MONTH=",
+ ",DAY_OF_YEAR=", ",DAY_OF_WEEK=",
+ ",DAY_OF_WEEK_IN_MONTH=",
+ ",AM_PM=", ",HOUR=",
+ ",HOUR_OF_DAY=", ",MINUTE=",
+ ",SECOND=", ",MILLISECOND=",
+ ",ZONE_OFFSET=", ",DST_OFFSET="
+ };
/**
* Returns a string representation of this object. It is mainly
@@ -1109,7 +1225,7 @@ public abstract class Calendar implements Serializable, Cloneable
* says, that it could be omitted. */
private void writeObject(ObjectOutputStream stream) throws IOException
{
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
stream.defaultWriteObject();
}
@@ -1121,7 +1237,7 @@ public abstract class Calendar implements Serializable, Cloneable
throws IOException, ClassNotFoundException
{
stream.defaultReadObject();
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
if (serialVersionOnStream > 1)
@@ -1130,7 +1246,6 @@ public abstract class Calendar implements Serializable, Cloneable
// Sun wants to remove all fields from the stream someday
// and will then increase the serialVersion number again.
// We prepare to be compatible.
-
fields = new int[FIELD_COUNT];
isSet = new boolean[FIELD_COUNT];
areFieldsSet = false;
diff --git a/libjava/java/util/Collection.java b/libjava/java/util/Collection.java
index be500b20086..910a893c35a 100644
--- a/libjava/java/util/Collection.java
+++ b/libjava/java/util/Collection.java
@@ -1,5 +1,5 @@
/* Collection.java -- Interface that represents a collection of objects
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,7 +66,7 @@ package java.util;
* copy of the argument using its own implementation).
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see List
* @see Set
* @see Map
diff --git a/libjava/java/util/Collections.java b/libjava/java/util/Collections.java
index 6da84296e7e..e25fbc36493 100644
--- a/libjava/java/util/Collections.java
+++ b/libjava/java/util/Collections.java
@@ -1,5 +1,5 @@
/* Collections.java -- Utility class with methods to operate on collections
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ import java.io.Serializable;
* modify the set.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see Set
* @see List
@@ -112,7 +112,7 @@ public class Collections
* The implementation of {@link #EMPTY_SET}. This class name is required
* for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class EmptySet extends AbstractSet
implements Serializable
@@ -266,7 +266,7 @@ public class Collections
* The implementation of {@link #EMPTY_LIST}. This class name is required
* for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class EmptyList extends AbstractList
implements Serializable, RandomAccess
@@ -444,7 +444,7 @@ public class Collections
* The implementation of {@link #EMPTY_MAP}. This class name is required
* for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class EmptyMap extends AbstractMap
implements Serializable
@@ -958,7 +958,7 @@ public class Collections
* The implementation of {@link #nCopies(int, Object)}. This class name
* is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class CopiesList extends AbstractList
implements Serializable, RandomAccess
@@ -1169,7 +1169,7 @@ public class Collections
* The implementation of {@link #reverseOrder()}. This class name
* is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class ReverseComparator
implements Comparator, Serializable
@@ -1384,7 +1384,7 @@ public class Collections
* The implementation of {@link #singleton(Object)}. This class name
* is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class SingletonSet extends AbstractSet
implements Serializable
@@ -1558,7 +1558,7 @@ public class Collections
* The implementation of {@link #singletonList(Object)}. This class name
* is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class SingletonList extends AbstractList
implements Serializable, RandomAccess
@@ -1734,7 +1734,7 @@ public class Collections
* The implementation of {@link #singletonMap(Object)}. This class name
* is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class SingletonMap extends AbstractMap
implements Serializable
@@ -1999,7 +1999,7 @@ public class Collections
* Package visible, so that collections such as the one for
* Hashtable.values() can specify which object to synchronize on.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
static class SynchronizedCollection
implements Collection, Serializable
@@ -2332,7 +2332,7 @@ public class Collections
* synchronized classes. These iterators must "sync" on the same object
* as the collection they iterate over.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class SynchronizedIterator implements Iterator
{
@@ -2451,7 +2451,7 @@ public class Collections
* serializability. Package visible, so that lists such as Vector.subList()
* can specify which object to synchronize on.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
static class SynchronizedList extends SynchronizedCollection
implements List
@@ -2757,7 +2757,7 @@ public class Collections
* lists. This class name is required for compatibility with Sun's JDK
* serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class SynchronizedRandomAccessList
extends SynchronizedList implements RandomAccess
@@ -2822,7 +2822,7 @@ public class Collections
* The implementation of {@link SynchronizedList#listIterator()}. This
* iterator must "sync" on the same object as the list it iterates over.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class SynchronizedListIterator
extends SynchronizedIterator implements ListIterator
@@ -2997,7 +2997,7 @@ public class Collections
* The implementation of {@link #synchronizedMap(Map)}. This
* class name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class SynchronizedMap implements Map, Serializable
{
@@ -3527,7 +3527,7 @@ public class Collections
* Package visible, so that sets such as Hashtable.keySet()
* can specify which object to synchronize on.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
static class SynchronizedSet extends SynchronizedCollection
implements Set
@@ -3631,7 +3631,7 @@ public class Collections
* The implementation of {@link #synchronizedSortedMap(SortedMap)}. This
* class name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class SynchronizedSortedMap extends SynchronizedMap
implements SortedMap
@@ -3827,7 +3827,7 @@ public class Collections
* The implementation of {@link #synchronizedSortedSet(SortedSet)}. This
* class name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class SynchronizedSortedSet extends SynchronizedSet
implements SortedSet
@@ -4019,7 +4019,7 @@ public class Collections
* The implementation of {@link #unmodifiableCollection(Collection)}. This
* class name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class UnmodifiableCollection
implements Collection, Serializable
@@ -4250,7 +4250,7 @@ public class Collections
* The implementation of the various iterator methods in the
* unmodifiable classes.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class UnmodifiableIterator implements Iterator
{
@@ -4336,7 +4336,7 @@ public class Collections
* lists. This class name is required for compatibility with Sun's JDK
* serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class UnmodifiableList extends UnmodifiableCollection
implements List
@@ -4554,7 +4554,7 @@ public class Collections
* lists. This class name is required for compatibility with Sun's JDK
* serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class UnmodifiableRandomAccessList
extends UnmodifiableList implements RandomAccess
@@ -4578,7 +4578,7 @@ public class Collections
/**
* The implementation of {@link UnmodifiableList#listIterator()}.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class UnmodifiableListIterator
extends UnmodifiableIterator implements ListIterator
@@ -4702,7 +4702,7 @@ public class Collections
* The implementation of {@link #unmodifiableMap(Map)}. This
* class name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class UnmodifiableMap implements Map, Serializable
{
@@ -4811,7 +4811,7 @@ public class Collections
* The implementation of {@link UnmodifiableMap#entrySet()}. This class
* name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class UnmodifiableEntrySet extends UnmodifiableSet
implements Serializable
@@ -5100,7 +5100,7 @@ public class Collections
* The implementation of {@link #unmodifiableSet(Set)}. This class
* name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class UnmodifiableSet extends UnmodifiableCollection
implements Set
@@ -5169,7 +5169,7 @@ public class Collections
* The implementation of {@link #unmodifiableSortedMap(SortedMap)}. This
* class name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class UnmodifiableSortedMap extends UnmodifiableMap
implements SortedMap
@@ -5342,7 +5342,7 @@ public class Collections
* The implementation of {@link #synchronizedSortedMap(SortedMap)}. This
* class name is required for compatibility with Sun's JDK serializability.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static class UnmodifiableSortedSet extends UnmodifiableSet
implements SortedSet
diff --git a/libjava/java/util/Comparator.java b/libjava/java/util/Comparator.java
index adf6fd01d74..d536520cb47 100644
--- a/libjava/java/util/Comparator.java
+++ b/libjava/java/util/Comparator.java
@@ -1,5 +1,5 @@
/* Comparator.java -- Interface for objects that specify an ordering
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,7 +60,7 @@ package java.util;
* Serializable.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Comparable
* @see TreeMap
* @see TreeSet
@@ -84,7 +84,7 @@ public interface Comparator
* <li>if compare(a, b) &lt; 0 and compare(b, c) &lt; 0 then compare(a, c)
* &lt; 0</li>
* <li>if compare(a, b) == 0 then compare(a, c) and compare(b, c) must
- * have the same sign</li
+ * have the same sign</li>
* </ul>
* To be consistent with equals, the following additional constraint is
* in place:
diff --git a/libjava/java/util/ConcurrentModificationException.java b/libjava/java/util/ConcurrentModificationException.java
index 9e22267d36b..9492eb97628 100644
--- a/libjava/java/util/ConcurrentModificationException.java
+++ b/libjava/java/util/ConcurrentModificationException.java
@@ -1,5 +1,5 @@
/* ConcurrentModificationException.java -- Data structure concurrently modified
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,8 +52,8 @@ package java.util;
* this condition is referred to as fail-fast. Notice that this can occur
* even in single-threaded designs, if you call methods out of order.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see Iterator
* @see ListIterator
diff --git a/libjava/java/util/Currency.java b/libjava/java/util/Currency.java
index 98a599e65cf..ffe593dfcc4 100644
--- a/libjava/java/util/Currency.java
+++ b/libjava/java/util/Currency.java
@@ -1,5 +1,5 @@
/* Currency.java -- Representation of a currency
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,10 +49,10 @@ import java.text.NumberFormat;
* a constructor.
*
* @see java.util.Locale
- * @author Guilhem Lavaux <guilhem.lavaux@free.fr>
- * @author Dalibor Topic <robilad@kaffe.org>
- * @author Bryce McKinlay <mckinlay@redhat.com>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Guilhem Lavaux (guilhem.lavaux@free.fr)
+ * @author Dalibor Topic (robilad@kaffe.org)
+ * @author Bryce McKinlay (mckinlay@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.4
*/
public final class Currency
diff --git a/libjava/java/util/Date.java b/libjava/java/util/Date.java
index 4a96ff03d5a..3d8f2a69d9d 100644
--- a/libjava/java/util/Date.java
+++ b/libjava/java/util/Date.java
@@ -1,5 +1,5 @@
/* java.util.Date
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -685,6 +685,7 @@ public class Date
* <p>
* A sequence of consecutive alphabetic characters is recognised as a word,
* and interpreted as follows, in a case-insentive fashion:
+ * <ul>
* <li>
* The characters 'AM' or 'PM' restrict the hour value to a value between 0
* and 12. In the latter case, 12 is added to the hour value before storage.
diff --git a/libjava/java/util/EmptyStackException.java b/libjava/java/util/EmptyStackException.java
index 3236fbf6788..90109513e93 100644
--- a/libjava/java/util/EmptyStackException.java
+++ b/libjava/java/util/EmptyStackException.java
@@ -1,5 +1,5 @@
/* EmptyStackException.java -- Attempt to pop from an empty stack
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,8 +47,8 @@ package java.util;
* This exception is thrown by the Stack class when an attempt is made to pop
* or otherwise access elements from an empty stack.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Stack
* @since 1.0
* @status updated to 1.4
diff --git a/libjava/java/util/Enumeration.java b/libjava/java/util/Enumeration.java
index 1b23cfc5c8d..ebd75427ddf 100644
--- a/libjava/java/util/Enumeration.java
+++ b/libjava/java/util/Enumeration.java
@@ -1,5 +1,5 @@
/* Enumeration.java -- Interface for enumerating lists of objects
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,8 +52,8 @@ package java.util;
* the new collections classes, for use with legacy APIs that require them, can
* be obtained by the enumeration method in class Collections.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Iterator
* @see Hashtable
* @see Vector
diff --git a/libjava/java/util/EventListener.java b/libjava/java/util/EventListener.java
index f8443314bde..32dc563af2a 100644
--- a/libjava/java/util/EventListener.java
+++ b/libjava/java/util/EventListener.java
@@ -1,5 +1,5 @@
/* EventListener.java -- tagging interface for all event listeners
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package java.util;
* <code>Listener</code> and all method described by the subinterface
* take as argument an subclass of <code>EventObject</code>.
*
- * @author Tom Tromey <tromey@cygnus.com>
+ * @author Tom Tromey (tromey@cygnus.com)
* @see EventObject
* @status updated to 1.4
*/
diff --git a/libjava/java/util/EventListenerProxy.java b/libjava/java/util/EventListenerProxy.java
index 2955f455f73..484e1f2b449 100644
--- a/libjava/java/util/EventListenerProxy.java
+++ b/libjava/java/util/EventListenerProxy.java
@@ -1,5 +1,5 @@
/* EventListenerProxy.java -- abstract wrapper for event listeners
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package java.util;
* a new one. Subclasses are expected to add methods to set and retrieve
* any attached properties.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/util/EventObject.java b/libjava/java/util/EventObject.java
index 3ccb6ecd29a..f6fbd8a47b2 100644
--- a/libjava/java/util/EventObject.java
+++ b/libjava/java/util/EventObject.java
@@ -1,5 +1,5 @@
/* EventObject.java -- represents an event on an object
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.io.Serializable;
/**
* Represents Events fired by Objects.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see EventListener
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/util/GregorianCalendar.java b/libjava/java/util/GregorianCalendar.java
index d99a9f2c612..710dd56f58b 100644
--- a/libjava/java/util/GregorianCalendar.java
+++ b/libjava/java/util/GregorianCalendar.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.util;
+
/**
* <p>
* This class represents the Gregorian calendar, that is used in most
@@ -46,7 +47,7 @@ package java.util;
* for dates smaller than the date of the change to the Gregorian calendar.
* The Gregorian calendar differs from the Julian calendar by a different
* leap year rule (no leap year every 100 years, except if year is divisible
- * by 400).
+ * by 400).
* </p>
* <p>
* This change date is different from country to country, and can be changed with
@@ -136,7 +137,7 @@ public class GregorianCalendar extends Calendar
* Constant representing the era BC (Before Christ).
*/
public static final int BC = 0;
-
+
/**
* Constant representing the era AD (Anno Domini).
*/
@@ -164,43 +165,46 @@ public class GregorianCalendar extends Calendar
private static final String bundleName = "gnu.java.locale.Calendar";
/**
- * Retrieves the resource bundle. The resources should be loaded
- * via this method only. Iff an application uses this method, the
- * resourcebundle is required.
+ * Days in the epoch. Relative Jan 1, year '0' which is not a leap year.
+ * (although there is no year zero, this does not matter.)
+ * This is consistent with the formula:
+ * = (year-1)*365L + ((year-1) >> 2)
+ *
+ * Plus the gregorian correction:
+ * Math.floor((year-1) / 400.) - Math.floor((year-1) / 100.);
+ * For a correct julian date, the correction is -2 instead.
*
- * @param locale the locale in use for this calendar.
- * @return A resource bundle for the calendar for the specified locale.
+ * The gregorian cutover in 1582 was 10 days, so by calculating the
+ * correction from year zero, we have 15 non-leap days (even centuries)
+ * minus 3 leap days (year 400,800,1200) = 12. Subtracting two corrects
+ * this to the correct number 10.
*/
- private static ResourceBundle getBundle(Locale locale)
- {
- return ResourceBundle.getBundle(bundleName, locale,
- ClassLoader.getSystemClassLoader());
- }
+ private static final int EPOCH_DAYS = 719162;
/**
* Constructs a new GregorianCalender representing the current
- * time, using the default time zone and the default locale.
+ * time, using the default time zone and the default locale.
*/
public GregorianCalendar()
{
this(TimeZone.getDefault(), Locale.getDefault());
}
-
+
/**
* Constructs a new GregorianCalender representing the current
- * time, using the specified time zone and the default locale.
- *
+ * time, using the specified time zone and the default locale.
+ *
* @param zone a time zone.
*/
public GregorianCalendar(TimeZone zone)
{
this(zone, Locale.getDefault());
}
-
+
/**
* Constructs a new GregorianCalender representing the current
* time, using the default time zone and the specified locale.
- *
+ *
* @param locale a locale.
*/
public GregorianCalendar(Locale locale)
@@ -212,15 +216,30 @@ public class GregorianCalendar extends Calendar
* Constructs a new GregorianCalender representing the current
* time with the given time zone and the given locale.
*
- * @param zone a time zone.
- * @param locale a locale.
+ * @param zone a time zone.
+ * @param locale a locale.
*/
public GregorianCalendar(TimeZone zone, Locale locale)
{
+ this(zone, locale, false);
+ setTimeInMillis(System.currentTimeMillis());
+ complete();
+ }
+
+ /**
+ * Common constructor that all constructors should call.
+ * @param zone a time zone.
+ * @param locale a locale.
+ * @param unused unused parameter to make the signature differ from
+ * the public constructor (TimeZone, Locale).
+ */
+ private GregorianCalendar(TimeZone zone, Locale locale, boolean unused)
+ {
super(zone, locale);
- ResourceBundle rb = getBundle(locale);
+ ResourceBundle rb = ResourceBundle.getBundle(bundleName, locale,
+ ClassLoader
+ .getSystemClassLoader());
gregorianCutover = ((Date) rb.getObject("gregorianCutOver")).getTime();
- setTimeInMillis(System.currentTimeMillis());
}
/**
@@ -232,7 +251,7 @@ public class GregorianCalendar extends Calendar
*/
public GregorianCalendar(int year, int month, int day)
{
- super();
+ this(TimeZone.getDefault(), Locale.getDefault(), false);
set(year, month, day);
}
@@ -248,7 +267,7 @@ public class GregorianCalendar extends Calendar
*/
public GregorianCalendar(int year, int month, int day, int hour, int minute)
{
- super();
+ this(TimeZone.getDefault(), Locale.getDefault(), false);
set(year, month, day, hour, minute);
}
@@ -264,10 +283,10 @@ public class GregorianCalendar extends Calendar
* @param minute corresponds to the MINUTE time field.
* @param second corresponds to the SECOND time field.
*/
- public GregorianCalendar(int year, int month, int day,
- int hour, int minute, int second)
+ public GregorianCalendar(int year, int month, int day, int hour, int minute,
+ int second)
{
- super();
+ this(TimeZone.getDefault(), Locale.getDefault(), false);
set(year, month, day, hour, minute, second);
}
@@ -308,71 +327,23 @@ public class GregorianCalendar extends Calendar
* </p>
*
* @param year a year (use a negative value for BC).
- * @return true, if the given year is a leap year, false otherwise.
+ * @return true, if the given year is a leap year, false otherwise.
*/
public boolean isLeapYear(int year)
{
+ // Only years divisible by 4 can be leap years
if ((year & 3) != 0)
- // Only years divisible by 4 can be leap years
return false;
- // compute the linear day of the 29. February of that year.
- // The 13 is the number of days, that were omitted in the Gregorian
- // Calender until the epoch.
- int julianDay = (((year-1) * (365*4+1)) >> 2) + (31+29 -
- (((1970-1) * (365*4+1)) / 4 + 1 - 13));
-
- // If that day is smaller than the gregorianChange the julian
- // rule applies: This is a leap year since it is divisible by 4.
- if (julianDay * (24 * 60 * 60 * 1000L) < gregorianCutover)
+ // Is the leap-day a Julian date? Then it's a leap year
+ if (! isGregorian(year, 31 + 29 - 1))
return true;
+ // Apply gregorian rules otherwise
return ((year % 100) != 0 || (year % 400) == 0);
}
/**
- * Get the linear time in milliseconds since the epoch. If you
- * specify a nonpositive year it is interpreted as BC as
- * following: 0 is 1 BC, -1 is 2 BC and so on. The date is
- * interpreted as gregorian if the change occurred before that date.
- *
- * @param year the year of the date.
- * @param dayOfYear the day of year of the date; 1 based.
- * @param millis the millisecond in that day.
- * @return the days since the epoch, may be negative.
- */
- private long getLinearTime(int year, int dayOfYear, int millis)
- {
- // The 13 is the number of days, that were omitted in the Gregorian
- // Calendar until the epoch.
- // We shift right by 2 instead of dividing by 4, to get correct
- // results for negative years (and this is even more efficient).
- int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear -
- ((1970 * (365 * 4 + 1)) / 4 + 1 - 13);
- long time = julianDay * (24 * 60 * 60 * 1000L) + millis;
-
- if (time >= gregorianCutover)
- {
- // subtract the days that are missing in gregorian calendar
- // with respect to julian calendar.
- //
- // Okay, here we rely on the fact that the gregorian
- // calendar was introduced in the AD era. This doesn't work
- // with negative years.
- //
- // The additional leap year factor accounts for the fact that
- // a leap day is not seen on Jan 1 of the leap year.
- // And on and after the leap day, the leap day has already been
- // included in dayOfYear.
- int gregOffset = (year / 400) - (year / 100) + 2;
- if (isLeapYear (year, true))
- --gregOffset;
- time += gregOffset * (24 * 60 * 60 * 1000L);
- }
- return time;
- }
-
- /**
* Retrieves the day of the week corresponding to the specified
* day of the specified year.
*
@@ -382,8 +353,8 @@ public class GregorianCalendar extends Calendar
*/
private int getWeekDay(int year, int dayOfYear)
{
- int day =
- (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L));
+ boolean greg = isGregorian(year, dayOfYear);
+ int day = (int) getLinearDay(year, dayOfYear, greg);
// The epoch was a thursday.
int weekday = (day + THURSDAY) % 7;
@@ -393,235 +364,360 @@ public class GregorianCalendar extends Calendar
}
/**
- * <p>
- * Calculate the dayOfYear from the fields array.
- * The relativeDays is used, to account for weeks that begin before
- * the Gregorian change and end after it.
- * </p>
- * <p>
- * We return two values. The first is used to determine, if we
- * should use the Gregorian calendar or the Julian calendar, in order
- * to handle the change year. The second is a relative day after the given
- * day. This is necessary for week calculation in the year in
- * which the Gregorian change occurs.
- * </p>
- *
- * @param year the year, negative for BC.
- * @return an array of two integer values, the first containing a reference
- * day in the current year, the second a relative count since this reference
- * day.
+ * Returns the day of the week for the first day of a given month (0..11)
*/
- private int[] getDayOfYear(int year)
+ private int getFirstDayOfMonth(int year, int month)
{
- if (isSet[MONTH])
- {
- int dayOfYear;
- if (fields[MONTH] > FEBRUARY)
- {
+ int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
- // The months after February are regular:
- // 9 is an offset found by try and error.
- dayOfYear = (fields[MONTH] * (31 + 30 + 31 + 30 + 31) - 9) / 5;
- if (isLeapYear(year))
- dayOfYear++;
- }
- else
- dayOfYear = 31 * fields[MONTH];
+ if (month > 11)
+ {
+ year += (month / 12);
+ month = month % 12;
+ }
- if (isSet[DAY_OF_MONTH])
+ if (month < 0)
+ {
+ year += (int) month / 12;
+ month = month % 12;
+ if (month < 0)
{
- return new int[]
- {
- dayOfYear + fields[DAY_OF_MONTH], 0};
+ month += 12;
+ year--;
}
- if (isSet[WEEK_OF_MONTH] && isSet[DAY_OF_WEEK])
- {
- // the weekday of the first day in that month is:
- int weekday = getWeekDay(year, ++dayOfYear);
+ }
- return new int[]
- {
- dayOfYear,
- // the day of week in the first week
- // (weeks starting on sunday) is:
- fields[DAY_OF_WEEK] - weekday +
- // Now jump to the right week and correct the possible
- // error made by assuming sunday is the first week day.
- 7 * (fields[WEEK_OF_MONTH]
- + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1)
- + (weekday < getFirstDayOfWeek()? -1 : 0))};
- }
- if (isSet[DAY_OF_WEEK] && isSet[DAY_OF_WEEK_IN_MONTH])
- {
- // the weekday of the first day in that month is:
- int weekday = getWeekDay(year, ++dayOfYear);
- return new int[] {
- dayOfYear,
- fields[DAY_OF_WEEK] - weekday +
- 7 * (fields[DAY_OF_WEEK_IN_MONTH]
- + (fields[DAY_OF_WEEK] < weekday ? 0 : -1))};
- }
+ int dayOfYear = dayCount[month] + 1;
+ if (month > 1)
+ if (isLeapYear(year))
+ dayOfYear++;
+
+ boolean greg = isGregorian(year, dayOfYear);
+ int day = (int) getLinearDay(year, dayOfYear, greg);
+
+ // The epoch was a thursday.
+ int weekday = (day + THURSDAY) % 7;
+ if (weekday <= 0)
+ weekday += 7;
+ return weekday;
+ }
+
+ /**
+ * Takes a year, and a (zero based) day of year and determines
+ * if it is gregorian or not.
+ */
+ private boolean isGregorian(int year, int dayOfYear)
+ {
+ int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear
+ - EPOCH_DAYS; // gregorian days from 1 to epoch.
+ int gregFactor = (int) Math.floor((double) (year - 1) / 400.)
+ - (int) Math.floor((double) (year - 1) / 100.);
+
+ return ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover);
+ }
+
+ /**
+ * Check set fields for validity, without leniency.
+ *
+ * @throws IllegalArgumentException if a field is invalid
+ */
+ private void nonLeniencyCheck() throws IllegalArgumentException
+ {
+ int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+ int year = fields[YEAR];
+ int month = fields[MONTH];
+ int leap = isLeapYear(year) ? 1 : 0;
+
+ if (isSet[ERA] && fields[ERA] != AD && fields[ERA] != BC)
+ throw new IllegalArgumentException("Illegal ERA.");
+ if (isSet[YEAR] && fields[YEAR] < 1)
+ throw new IllegalArgumentException("Illegal YEAR.");
+ if (isSet[MONTH] && (month < 0 || month > 11))
+ throw new IllegalArgumentException("Illegal MONTH.");
+ if (isSet[WEEK_OF_YEAR])
+ {
+ int daysInYear = 365 + leap;
+ daysInYear += (getFirstDayOfMonth(year, 0) - 1); // pad first week
+ int last = getFirstDayOfMonth(year, 11) + 4;
+ if (last > 7)
+ last -= 7;
+ daysInYear += 7 - last;
+ int weeks = daysInYear / 7;
+ if (fields[WEEK_OF_YEAR] < 1 || fields[WEEK_OF_YEAR] > weeks)
+ throw new IllegalArgumentException("Illegal WEEK_OF_YEAR.");
}
- // MONTH + something did not succeed.
- if (isSet[DAY_OF_YEAR])
+ if (isSet[WEEK_OF_MONTH])
{
- return new int[] {0, fields[DAY_OF_YEAR]};
+ int weeks = (month == 1 && leap == 0) ? 4 : 5;
+ if (fields[WEEK_OF_MONTH] < 1 || fields[WEEK_OF_MONTH] > weeks)
+ throw new IllegalArgumentException("Illegal WEEK_OF_MONTH.");
}
-
- if (isSet[DAY_OF_WEEK] && isSet[WEEK_OF_YEAR])
+
+ if (isSet[DAY_OF_MONTH])
+ if (fields[DAY_OF_MONTH] < 1
+ || fields[DAY_OF_MONTH] > month_days[month]
+ + ((month == 1) ? leap : 0))
+ throw new IllegalArgumentException("Illegal DAY_OF_MONTH.");
+
+ if (isSet[DAY_OF_YEAR]
+ && (fields[DAY_OF_YEAR] < 1 || fields[DAY_OF_YEAR] > 365 + leap))
+ throw new IllegalArgumentException("Illegal DAY_OF_YEAR.");
+
+ if (isSet[DAY_OF_WEEK]
+ && (fields[DAY_OF_WEEK] < 1 || fields[DAY_OF_WEEK] > 7))
+ throw new IllegalArgumentException("Illegal DAY_OF_WEEK.");
+
+ if (isSet[DAY_OF_WEEK_IN_MONTH])
{
- int dayOfYear = getMinimalDaysInFirstWeek();
- // the weekday of the day, that begins the first week
- // in that year is:
- int weekday = getWeekDay(year, dayOfYear);
-
- return new int[] {
- dayOfYear,
- // the day of week in the first week
- // (weeks starting on sunday) is:
- fields[DAY_OF_WEEK] - weekday
- // Now jump to the right week and correct the possible
- // error made by assuming sunday is the first week day.
- + 7 * (fields[WEEK_OF_YEAR]
- + (fields[DAY_OF_WEEK] < getFirstDayOfWeek()? 0 : -1)
- + (weekday < getFirstDayOfWeek()? -1 : 0))};
+ int weeks = (month == 1 && leap == 0) ? 4 : 5;
+ if (fields[DAY_OF_WEEK_IN_MONTH] < -weeks
+ || fields[DAY_OF_WEEK_IN_MONTH] > weeks)
+ throw new IllegalArgumentException("Illegal DAY_OF_WEEK_IN_MONTH.");
}
- // As last resort return Jan, 1st.
- return new int[] {1, 0};
+ if (isSet[AM_PM] && fields[AM_PM] != AM && fields[AM_PM] != PM)
+ throw new IllegalArgumentException("Illegal AM_PM.");
+ if (isSet[HOUR] && (fields[HOUR] < 0 || fields[HOUR] > 12))
+ throw new IllegalArgumentException("Illegal HOUR.");
+ if (isSet[HOUR_OF_DAY]
+ && (fields[HOUR_OF_DAY] < 0 || fields[HOUR_OF_DAY] > 23))
+ throw new IllegalArgumentException("Illegal HOUR_OF_DAY.");
+ if (isSet[MINUTE] && (fields[MINUTE] < 0 || fields[MINUTE] > 59))
+ throw new IllegalArgumentException("Illegal MINUTE.");
+ if (isSet[SECOND] && (fields[SECOND] < 0 || fields[SECOND] > 59))
+ throw new IllegalArgumentException("Illegal SECOND.");
+ if (isSet[MILLISECOND]
+ && (fields[MILLISECOND] < 0 || fields[MILLISECOND] > 999))
+ throw new IllegalArgumentException("Illegal MILLISECOND.");
+ if (isSet[ZONE_OFFSET]
+ && (fields[ZONE_OFFSET] < -12 * 60 * 60 * 1000L
+ || fields[ZONE_OFFSET] > 12 * 60 * 60 * 1000L))
+ throw new IllegalArgumentException("Illegal ZONE_OFFSET.");
+ if (isSet[DST_OFFSET]
+ && (fields[DST_OFFSET] < -12 * 60 * 60 * 1000L
+ || fields[DST_OFFSET] > 12 * 60 * 60 * 1000L))
+ throw new IllegalArgumentException("Illegal DST_OFFSET.");
}
/**
* Converts the time field values (<code>fields</code>) to
- * milliseconds since the epoch UTC (<code>time</code>).
+ * milliseconds since the epoch UTC (<code>time</code>).
*
* @throws IllegalArgumentException if any calendar fields
* are invalid.
*/
protected synchronized void computeTime()
{
- int era = isSet[ERA] ? fields[ERA] : AD;
- int year = isSet[YEAR] ? fields[YEAR] : 1970;
- if (era == BC)
- year = 1 - year;
+ int millisInDay = 0;
+ int era = fields[ERA];
+ int year = fields[YEAR];
+ int month = fields[MONTH];
+ int day = fields[DAY_OF_MONTH];
+
+ int minute = fields[MINUTE];
+ int second = fields[SECOND];
+ int millis = fields[MILLISECOND];
+ int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+ int[] dayCount = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+ int hour = 0;
- int[] daysOfYear = getDayOfYear(year);
+ if (! isLenient())
+ nonLeniencyCheck();
- int hour = 0;
- if (isSet[HOUR_OF_DAY])
- hour = fields[HOUR_OF_DAY];
- else if (isSet[HOUR])
+ if (! isSet[MONTH] && (! isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]))
+ {
+ // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR
+ if (isSet[WEEK_OF_YEAR])
+ {
+ int first = getFirstDayOfMonth(year, 0);
+ int offs = 1;
+ int daysInFirstWeek = getFirstDayOfWeek() - first;
+ if (daysInFirstWeek <= 0)
+ daysInFirstWeek += 7;
+
+ if (daysInFirstWeek < getMinimalDaysInFirstWeek())
+ offs += daysInFirstWeek;
+ else
+ offs -= 7 - daysInFirstWeek;
+ month = 0;
+ day = offs + 7 * (fields[WEEK_OF_YEAR] - 1);
+ offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
+
+ if (offs < 0)
+ offs += 7;
+ day += offs;
+ }
+ else
+ {
+ // 4: YEAR + DAY_OF_YEAR
+ month = 0;
+ day = fields[DAY_OF_YEAR];
+ }
+ }
+ else
+ {
+ if (isSet[DAY_OF_WEEK])
+ {
+ int first = getFirstDayOfMonth(year, month);
+
+ // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
+ if (isSet[DAY_OF_WEEK_IN_MONTH])
+ {
+ int offs = fields[DAY_OF_WEEK] - first;
+ if (offs < 0)
+ offs += 7;
+ day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1);
+ day += offs;
+ }
+ else
+ { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
+ int offs = 1;
+ int daysInFirstWeek = getFirstDayOfWeek() - first;
+ if (daysInFirstWeek <= 0)
+ daysInFirstWeek += 7;
+
+ if (daysInFirstWeek < getMinimalDaysInFirstWeek())
+ offs += daysInFirstWeek;
+ else
+ offs -= 7 - daysInFirstWeek;
+
+ day = offs + 7 * (fields[WEEK_OF_MONTH] - 1);
+ offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
+ if (offs < 0)
+ offs += 7;
+ day += offs;
+ }
+ }
+
+ // 1: YEAR + MONTH + DAY_OF_MONTH
+ }
+ if (era == BC && year > 0)
+ year = 1 - year;
+
+ // rest of code assumes day/month/year set
+ // should negative BC years be AD?
+ // get the hour (but no check for validity)
+ if (isSet[HOUR])
{
hour = fields[HOUR];
- if (isSet[AM_PM] && fields[AM_PM] == PM)
+ if (fields[AM_PM] == PM)
if (hour != 12) /* not Noon */
- hour += 12;
+ hour += 12;
/* Fix the problem of the status of 12:00 AM (midnight). */
- if (isSet[AM_PM] && fields[AM_PM] == AM && hour == 12)
+ if (fields[AM_PM] == AM && hour == 12)
hour = 0;
}
+ else
+ hour = fields[HOUR_OF_DAY];
- int minute = isSet[MINUTE] ? fields[MINUTE] : 0;
- int second = isSet[SECOND] ? fields[SECOND] : 0;
- int millis = isSet[MILLISECOND] ? fields[MILLISECOND] : 0;
- int millisInDay;
+ // Read the era,year,month,day fields and convert as appropriate.
+ // Calculate number of milliseconds into the day
+ // This takes care of both h, m, s, ms over/underflows.
+ long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L + millis;
+ day += allMillis / (24 * 60 * 60 * 1000L);
+ millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L));
- if (isLenient())
+ if (month < 0)
{
- // prevent overflow
- long allMillis = (((hour * 60L) + minute) * 60L + second) * 1000L
- + millis;
- daysOfYear[1] += allMillis / (24 * 60 * 60 * 1000L);
- millisInDay = (int) (allMillis % (24 * 60 * 60 * 1000L));
+ year += (int) month / 12;
+ month = month % 12;
+ if (month < 0)
+ {
+ month += 12;
+ year--;
+ }
}
- else
+ if (month > 11)
{
- if (hour < 0 || hour >= 24 || minute < 0 || minute > 59
- || second < 0 || second > 59 || millis < 0 || millis >= 1000)
- throw new IllegalArgumentException();
- millisInDay = (((hour * 60) + minute) * 60 + second) * 1000 + millis;
+ year += (month / 12);
+ month = month % 12;
}
- time = getLinearTime(year, daysOfYear[0], millisInDay);
- // Add the relative days after calculating the linear time, to
- // get right behaviour when jumping over the gregorianCutover.
- time += daysOfYear[1] * (24 * 60 * 60 * 1000L);
+ month_days[1] = isLeapYear(year) ? 29 : 28;
+ while (day <= 0)
+ {
+ if (month == 0)
+ {
+ year--;
+ month_days[1] = isLeapYear(year) ? 29 : 28;
+ }
+ month = (month + 11) % 12;
+ day += month_days[month];
+ }
+ while (day > month_days[month])
+ {
+ day -= (month_days[month]);
+ month = (month + 1) % 12;
+ if (month == 0)
+ {
+ year++;
+ month_days[1] = isLeapYear(year) ? 29 : 28;
+ }
+ }
- TimeZone zone = getTimeZone();
- int rawOffset = isSet[ZONE_OFFSET]
- ? fields[ZONE_OFFSET] : zone.getRawOffset();
-
- int dayOfYear = daysOfYear[0] + daysOfYear[1];
- // This formula isn't right, so check for month as a quick fix.
- // It doesn't compensate for leap years and puts day 30 in month 1
- // instead of month 0.
- int month = isSet[MONTH]
- ? fields[MONTH] : (dayOfYear * 5 + 3) / (31 + 30 + 31 + 30 + 31);
- // This formula isn't right, so check for day as a quick fix. It
- // doesn't compensate for leap years, either.
- int day = isSet[DAY_OF_MONTH] ? fields[DAY_OF_MONTH]
- : (6 + (dayOfYear * 5 + 3) % (31 + 30 + 31 + 30 + 31)) / 5;
- int weekday = ((int) (time / (24 * 60 * 60 * 1000L)) + THURSDAY) % 7;
+ // ok, by here we have valid day,month,year,era and millisinday
+ int dayOfYear = dayCount[month] + day - 1; // (day starts on 1)
+ if (isLeapYear(year) && month > 1)
+ dayOfYear++;
+
+ int relativeDay = (year - 1) * 365 + ((year - 1) >> 2) + dayOfYear
+ - EPOCH_DAYS; // gregorian days from 1 to epoch.
+ int gregFactor = (int) Math.floor((double) (year - 1) / 400.)
+ - (int) Math.floor((double) (year - 1) / 100.);
+
+ if ((relativeDay + gregFactor) * 60L * 60L * 24L * 1000L >= gregorianCutover)
+ relativeDay += gregFactor;
+ else
+ relativeDay -= 2;
+
+ time = relativeDay * (24 * 60 * 60 * 1000L) + millisInDay;
+
+ // the epoch was a Thursday.
+ int weekday = (int) (relativeDay + THURSDAY) % 7;
if (weekday <= 0)
weekday += 7;
- int dstOffset = isSet[DST_OFFSET]
- ? fields[DST_OFFSET] : (zone.getOffset((year < 0) ? BC : AD,
- (year < 0) ? 1 - year : year,
- month, day, weekday, millisInDay)
- - zone.getRawOffset());
- time -= rawOffset + dstOffset;
- isTimeSet = true;
- }
+ fields[DAY_OF_WEEK] = weekday;
- /**
- * <p>
- * Determines if the given year is a leap year.
- * </p>
- * <p>
- * To specify a year in the BC era, use a negative value calculated
- * as 1 - y, where y is the required year in BC. So, 1 BC is 0,
- * 2 BC is -1, 3 BC is -2, etc.
- * </p>
- *
- * @param year a year (use a negative value for BC).
- * @param gregorian if true, use the gregorian leap year rule.
- * @return true, if the given year is a leap year, false otherwise.
- */
- private boolean isLeapYear(int year, boolean gregorian)
- {
- if ((year & 3) != 0)
- // Only years divisible by 4 can be leap years
- return false;
+ // Time zone corrections.
+ TimeZone zone = getTimeZone();
+ int rawOffset = isSet[ZONE_OFFSET] ? fields[ZONE_OFFSET]
+ : zone.getRawOffset();
- if (!gregorian)
- return true;
+ int dstOffset = isSet[DST_OFFSET] ? fields[DST_OFFSET]
+ : (zone.getOffset((year < 0) ? BC : AD,
+ (year < 0) ? 1 - year
+ : year,
+ month, day, weekday,
+ millisInDay)
+ - zone.getRawOffset());
- // We rely on AD area here.
- return ((year % 100) != 0 || (year % 400) == 0);
+ time -= rawOffset + dstOffset;
+
+ isTimeSet = true;
}
/**
* Get the linear day in days since the epoch, using the
* Julian or Gregorian calendar as specified. If you specify a
* nonpositive year it is interpreted as BC as following: 0 is 1
- * BC, -1 is 2 BC and so on.
+ * BC, -1 is 2 BC and so on.
*
* @param year the year of the date.
* @param dayOfYear the day of year of the date; 1 based.
* @param gregorian <code>true</code>, if we should use the Gregorian rules.
* @return the days since the epoch, may be negative.
*/
- private int getLinearDay(int year, int dayOfYear, boolean gregorian)
- {
- // The 13 is the number of days, that were omitted in the Gregorian
- // Calender until the epoch.
- // We shift right by 2 instead of dividing by 4, to get correct
- // results for negative years (and this is even more efficient).
- int julianDay = ((year * (365 * 4 + 1)) >> 2) + dayOfYear -
- ((1970 * (365 * 4 + 1)) / 4 + 1 - 13);
-
+ public long getLinearDay(int year, int dayOfYear, boolean gregorian)
+ {
+ // The 13 is the number of days, that were omitted in the Gregorian
+ // Calender until the epoch.
+ // We shift right by 2 instead of dividing by 4, to get correct
+ // results for negative years (and this is even more efficient).
+ long julianDay = (year - 1) * 365L + ((year - 1) >> 2) + (dayOfYear - 1)
+ - EPOCH_DAYS; // gregorian days from 1 to epoch.
+
if (gregorian)
{
// subtract the days that are missing in gregorian calendar
@@ -633,11 +729,13 @@ public class GregorianCalendar extends Calendar
//
// The additional leap year factor accounts for the fact that
// a leap day is not seen on Jan 1 of the leap year.
- int gregOffset = (year / 400) - (year / 100) + 2;
- if (isLeapYear (year, true) && dayOfYear < 31 + 29)
- --gregOffset;
- julianDay += gregOffset;
+ int gregOffset = (int) Math.floor((double) (year - 1) / 400.)
+ - (int) Math.floor((double) (year - 1) / 100.);
+
+ return julianDay + gregOffset;
}
+ else
+ julianDay -= 2;
return julianDay;
}
@@ -646,26 +744,27 @@ public class GregorianCalendar extends Calendar
* day_of_year, day_of_month, day_of_week, and writes the result
* into the fields array.
*
- * @param day the linear day.
+ * @param day the linear day.
* @param gregorian true, if we should use Gregorian rules.
*/
- private void calculateDay(int day, boolean gregorian)
+ private void calculateDay(int[] fields, long day, boolean gregorian)
{
- // the epoch is a Thursday.
- int weekday = (day + THURSDAY) % 7;
+ // the epoch was a Thursday.
+ int weekday = (int) (day + THURSDAY) % 7;
if (weekday <= 0)
weekday += 7;
fields[DAY_OF_WEEK] = weekday;
// get a first approximation of the year. This may be one
// year too big.
- int year = 1970 + (gregorian
- ? ((day - 100) * 400) / (365 * 400 + 100 - 4 + 1)
- : ((day - 100) * 4) / (365 * 4 + 1));
+ int year = 1970
+ + (int) (gregorian
+ ? ((day - 100L) * 400L) / (365L * 400L + 100L - 4L
+ + 1L) : ((day - 100L) * 4L) / (365L * 4L + 1L));
if (day >= 0)
year++;
- int firstDayOfYear = getLinearDay(year, 1, gregorian);
+ long firstDayOfYear = getLinearDay(year, 1, gregorian);
// Now look in which year day really lies.
if (day < firstDayOfYear)
@@ -674,9 +773,9 @@ public class GregorianCalendar extends Calendar
firstDayOfYear = getLinearDay(year, 1, gregorian);
}
- day -= firstDayOfYear - 1; // day of year, one based.
+ day -= firstDayOfYear - 1; // day of year, one based.
- fields[DAY_OF_YEAR] = day;
+ fields[DAY_OF_YEAR] = (int) day;
if (year <= 0)
{
fields[ERA] = BC;
@@ -688,16 +787,16 @@ public class GregorianCalendar extends Calendar
fields[YEAR] = year;
}
- int leapday = isLeapYear(year, gregorian) ? 1 : 0;
+ int leapday = isLeapYear(year) ? 1 : 0;
if (day <= 31 + 28 + leapday)
{
- fields[MONTH] = day / 32; // 31->JANUARY, 32->FEBRUARY
- fields[DAY_OF_MONTH] = day - 31 * fields[MONTH];
+ fields[MONTH] = (int) day / 32; // 31->JANUARY, 32->FEBRUARY
+ fields[DAY_OF_MONTH] = (int) day - 31 * fields[MONTH];
}
else
{
// A few more magic formulas
- int scaledDay = (day - leapday) * 5 + 8;
+ int scaledDay = ((int) day - leapday) * 5 + 8;
fields[MONTH] = scaledDay / (31 + 30 + 31 + 30 + 31);
fields[DAY_OF_MONTH] = (scaledDay % (31 + 30 + 31 + 30 + 31)) / 5 + 1;
}
@@ -716,25 +815,26 @@ public class GregorianCalendar extends Calendar
fields[ZONE_OFFSET] = zone.getRawOffset();
long localTime = time + fields[ZONE_OFFSET];
- int day = (int) (localTime / (24 * 60 * 60 * 1000L));
+ long day = localTime / (24 * 60 * 60 * 1000L);
int millisInDay = (int) (localTime % (24 * 60 * 60 * 1000L));
+
if (millisInDay < 0)
{
millisInDay += (24 * 60 * 60 * 1000);
day--;
}
- calculateDay(day, gregorian);
- fields[DST_OFFSET] =
- zone.getOffset(fields[ERA], fields[YEAR], fields[MONTH],
- fields[DAY_OF_MONTH], fields[DAY_OF_WEEK],
- millisInDay) - fields[ZONE_OFFSET];
+ calculateDay(fields, day, gregorian);
+ fields[DST_OFFSET] = zone.getOffset(fields[ERA], fields[YEAR],
+ fields[MONTH], fields[DAY_OF_MONTH],
+ fields[DAY_OF_WEEK], millisInDay)
+ - fields[ZONE_OFFSET];
millisInDay += fields[DST_OFFSET];
if (millisInDay >= 24 * 60 * 60 * 1000)
{
millisInDay -= 24 * 60 * 60 * 1000;
- calculateDay(++day, gregorian);
+ calculateDay(fields, ++day, gregorian);
}
fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7;
@@ -749,13 +849,12 @@ public class GregorianCalendar extends Calendar
// Do the Correction: getMinimalDaysInFirstWeek() is always in the
// first week.
int minDays = getMinimalDaysInFirstWeek();
- int firstWeekday =
- (7 + getWeekDay(fields[YEAR], minDays) - getFirstDayOfWeek()) % 7;
+ int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays)
+ - getFirstDayOfWeek()) % 7;
if (minDays - firstWeekday < 1)
weekOfYear++;
fields[WEEK_OF_YEAR] = weekOfYear;
-
int hourOfDay = millisInDay / (60 * 60 * 1000);
fields[AM_PM] = (hourOfDay < 12) ? AM : PM;
int hour = hourOfDay % 12;
@@ -767,14 +866,7 @@ public class GregorianCalendar extends Calendar
fields[SECOND] = millisInDay / (1000);
fields[MILLISECOND] = millisInDay % 1000;
-
- areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] =
- isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] =
- isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] =
- isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] =
- isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] =
- isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true;
-
+ areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true;
}
/**
@@ -782,7 +874,7 @@ public class GregorianCalendar extends Calendar
* equivalent to this if it is also a <code>GregorianCalendar</code>
* with the same time since the epoch under the same conditions
* (same change date and same time zone).
- *
+ *
* @param o the object to that we should compare.
* @return true, if the given object is a calendar, that represents
* the same time (but doesn't necessarily have the same fields).
@@ -794,48 +886,20 @@ public class GregorianCalendar extends Calendar
*/
public boolean equals(Object o)
{
- if (!(o instanceof GregorianCalendar))
+ if (! (o instanceof GregorianCalendar))
return false;
GregorianCalendar cal = (GregorianCalendar) o;
return (cal.getTimeInMillis() == getTimeInMillis());
}
-// /**
-// * Compares the given calender with this.
-// * @param o the object to that we should compare.
-// * @return true, if the given object is a calendar, and this calendar
-// * represents a smaller time than the calender o.
-// */
-// public boolean before(Object o) {
-// if (!(o instanceof GregorianCalendar))
-// return false;
-
-// GregorianCalendar cal = (GregorianCalendar) o;
-// return (cal.getTimeInMillis() < getTimeInMillis());
-// }
-
-// /**
-// * Compares the given calender with this.
-// * @param o the object to that we should compare.
-// * @return true, if the given object is a calendar, and this calendar
-// * represents a bigger time than the calender o.
-// */
-// public boolean after(Object o) {
-// if (!(o instanceof GregorianCalendar))
-// return false;
-
-// GregorianCalendar cal = (GregorianCalendar) o;
-// return (cal.getTimeInMillis() > getTimeInMillis());
-// }
-
/**
* Adds the specified amount of time to the given time field. The
* amount may be negative to subtract the time. If the field overflows
* it does what you expect: Jan, 25 + 10 Days is Feb, 4.
* @param field one of the time field constants.
* @param amount the amount of time to add.
- * @exception IllegalArgumentException if <code>field</code> is
+ * @exception IllegalArgumentException if <code>field</code> is
* <code>ZONE_OFFSET</code>, <code>DST_OFFSET</code>, or invalid; or
* if <code>amount</code> contains an out-of-range value and the calendar
* is not in lenient mode.
@@ -859,18 +923,18 @@ public class GregorianCalendar extends Calendar
fields[MONTH] += 12;
fields[YEAR]--;
}
- isTimeSet = false;
int maxDay = getActualMaximum(DAY_OF_MONTH);
if (fields[DAY_OF_MONTH] > maxDay)
{
fields[DAY_OF_MONTH] = maxDay;
- isTimeSet = false;
}
+ set(YEAR, fields[YEAR]);
+ set(MONTH, fields[MONTH]);
break;
case DAY_OF_MONTH:
case DAY_OF_YEAR:
case DAY_OF_WEEK:
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
time += amount * (24 * 60 * 60 * 1000L);
areFieldsSet = false;
@@ -878,59 +942,57 @@ public class GregorianCalendar extends Calendar
case WEEK_OF_YEAR:
case WEEK_OF_MONTH:
case DAY_OF_WEEK_IN_MONTH:
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
time += amount * (7 * 24 * 60 * 60 * 1000L);
areFieldsSet = false;
break;
case AM_PM:
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
time += amount * (12 * 60 * 60 * 1000L);
areFieldsSet = false;
break;
case HOUR:
case HOUR_OF_DAY:
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
time += amount * (60 * 60 * 1000L);
areFieldsSet = false;
break;
case MINUTE:
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
time += amount * (60 * 1000L);
areFieldsSet = false;
break;
case SECOND:
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
time += amount * (1000L);
areFieldsSet = false;
break;
case MILLISECOND:
- if (!isTimeSet)
+ if (! isTimeSet)
computeTime();
time += amount;
areFieldsSet = false;
break;
case ZONE_OFFSET:
- case DST_OFFSET:
- default:
+ case DST_OFFSET:default:
throw new IllegalArgumentException("Invalid or unknown field");
}
}
-
/**
* Rolls the specified time field up or down. This means add one
* to the specified field, but don't change the other fields. If
- * the maximum for this field is reached, start over with the
- * minimum value.
+ * the maximum for this field is reached, start over with the
+ * minimum value.
*
* <strong>Note:</strong> There may be situation, where the other
- * fields must be changed, e.g rolling the month on May, 31.
- * The date June, 31 is automatically converted to July, 1.
+ * fields must be changed, e.g rolling the month on May, 31.
+ * The date June, 31 is automatically converted to July, 1.
* This requires lenient settings.
*
* @param field the time field. One of the time field constants.
@@ -972,7 +1034,6 @@ public class GregorianCalendar extends Calendar
isSet[DAY_OF_YEAR] = false;
isSet[WEEK_OF_YEAR] = false;
break;
-
case DAY_OF_MONTH:
isSet[WEEK_OF_MONTH] = false;
isSet[DAY_OF_WEEK] = false;
@@ -981,7 +1042,6 @@ public class GregorianCalendar extends Calendar
isSet[WEEK_OF_YEAR] = false;
time += delta * (24 * 60 * 60 * 1000L);
break;
-
case WEEK_OF_MONTH:
isSet[DAY_OF_MONTH] = false;
isSet[DAY_OF_WEEK_IN_MONTH] = false;
@@ -1013,7 +1073,6 @@ public class GregorianCalendar extends Calendar
isSet[DAY_OF_YEAR] = false;
time += delta * (7 * 24 * 60 * 60 * 1000L);
break;
-
case AM_PM:
isSet[HOUR_OF_DAY] = false;
time += delta * (12 * 60 * 60 * 1000L);
@@ -1027,7 +1086,6 @@ public class GregorianCalendar extends Calendar
isSet[AM_PM] = false;
time += delta * (60 * 60 * 1000L);
break;
-
case MINUTE:
time += delta * (60 * 1000L);
break;
@@ -1047,7 +1105,7 @@ public class GregorianCalendar extends Calendar
* with the minimum value and vice versa for negative amounts.
*
* <strong>Note:</strong> There may be situation, where the other
- * fields must be changed, e.g rolling the month on May, 31.
+ * fields must be changed, e.g rolling the month on May, 31.
* The date June, 31 is automatically corrected to June, 30.
*
* @param field the time field. One of the time field constants.
@@ -1084,16 +1142,23 @@ public class GregorianCalendar extends Calendar
/**
* The minimum values for the calendar fields.
*/
- private static final int[] minimums =
- { BC, 1, 0, 0, 1, 1, 1, SUNDAY, 1,
- AM, 1, 0, 1, 1, 1, -(12*60*60*1000), 0 };
+ private static final int[] minimums =
+ {
+ BC, 1, 0, 0, 1, 1, 1, SUNDAY, 1, AM,
+ 1, 0, 0, 0, 0, -(12 * 60 * 60 * 1000),
+ 0
+ };
/**
* The maximum values for the calendar fields.
*/
- private static final int[] maximums =
- { AD, 5000000, 11, 53, 5, 31, 366, SATURDAY, 5,
- PM, 12, 23, 59, 59, 999, +(12*60*60*1000), (12*60*60*1000) };
+ private static final int[] maximums =
+ {
+ AD, 5000000, 11, 53, 5, 31, 366,
+ SATURDAY, 5, PM, 12, 23, 59, 59, 999,
+ +(12 * 60 * 60 * 1000),
+ (12 * 60 * 60 * 1000)
+ };
/**
* Gets the smallest value that is allowed for the specified field.
@@ -1117,7 +1182,6 @@ public class GregorianCalendar extends Calendar
return maximums[field];
}
-
/**
* Gets the greatest minimum value that is allowed for the specified field.
* This is the largest value returned by the <code>getActualMinimum(int)</code>
@@ -1142,7 +1206,7 @@ public class GregorianCalendar extends Calendar
* 28 days).
*
* @param field the time field. One of the time field constants.
- * @return the least maximum value.
+ * @return the least maximum value.
* @see #getActualMaximum(int)
* @since 1.2
*/
@@ -1182,7 +1246,7 @@ public class GregorianCalendar extends Calendar
int min = getMinimalDaysInFirstWeek();
if (min == 0)
return 1;
- if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR])
+ if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
complete();
int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
@@ -1203,45 +1267,46 @@ public class GregorianCalendar extends Calendar
* 29, rather than 28.
*
* @param field the time field. One of the time field constants.
- * @return the actual maximum value.
+ * @return the actual maximum value.
*/
public int getActualMaximum(int field)
{
switch (field)
{
case WEEK_OF_YEAR:
- {
- if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR])
+ {
+ if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
complete();
+
// This is wrong for the year that contains the gregorian change.
// I.e it gives the weeks in the julian year or in the gregorian
// year in that case.
int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
int lastDay = isLeapYear(year) ? 366 : 365;
int weekday = getWeekDay(year, lastDay);
- int week = (lastDay + 6
- - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
+ int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
int minimalDays = getMinimalDaysInFirstWeek();
int firstWeekday = getWeekDay(year, minimalDays);
- /*
+ /*
* Is there a set of days at the beginning of the year, before the
* first day of the week, equal to or greater than the minimum number
* of days required in the first week?
*/
if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1)
return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */
- }
- case DAY_OF_MONTH:
- {
- if (!areFieldsSet || !isSet[MONTH])
+ }
+ case DAY_OF_MONTH:
+ {
+ if (! areFieldsSet || ! isSet[MONTH])
complete();
int month = fields[MONTH];
+
// If you change this, you should also change
// SimpleTimeZone.getDaysInMonth();
if (month == FEBRUARY)
{
- if (!isSet[YEAR] || !isSet[ERA])
+ if (! isSet[YEAR] || ! isSet[ERA])
complete();
int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
return isLeapYear(year) ? 29 : 28;
@@ -1250,33 +1315,31 @@ public class GregorianCalendar extends Calendar
return 31 - (month & 1);
else
return 30 + (month & 1);
- }
+ }
case DAY_OF_YEAR:
- {
- if (!areFieldsSet || !isSet[ERA] || !isSet[YEAR])
+ {
+ if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
complete();
int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
return isLeapYear(year) ? 366 : 365;
- }
+ }
case DAY_OF_WEEK_IN_MONTH:
- {
+ {
// This is wrong for the month that contains the gregorian change.
int daysInMonth = getActualMaximum(DAY_OF_MONTH);
+
// That's black magic, I know
return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7;
- }
+ }
case WEEK_OF_MONTH:
- {
+ {
int daysInMonth = getActualMaximum(DAY_OF_MONTH);
int weekday = (daysInMonth - fields[DAY_OF_MONTH]
- + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY;
- return (daysInMonth + 6
- - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
- }
+ + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY;
+ return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
+ }
default:
return maximums[field];
}
}
-
-
}
diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java
index fe4c8b06022..5265daf7a85 100644
--- a/libjava/java/util/HashMap.java
+++ b/libjava/java/util/HashMap.java
@@ -1,6 +1,6 @@
/* HashMap.java -- a class providing a basic hashtable data structure,
mapping Object --> Object
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -85,7 +85,7 @@ import java.io.Serializable;
* @author Jon Zeppieri
* @author Jochen Hoenicke
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Object#hashCode()
* @see Collection
* @see Map
@@ -160,7 +160,7 @@ public class HashMap extends AbstractMap
* Class to represent an entry in the hash table. Holds a single key-value
* pair. Package visible for use by subclass.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
static class HashEntry extends AbstractMap.BasicMapEntry
{
diff --git a/libjava/java/util/HashSet.java b/libjava/java/util/HashSet.java
index caad3ad16e7..4b6d1270406 100644
--- a/libjava/java/util/HashSet.java
+++ b/libjava/java/util/HashSet.java
@@ -1,5 +1,5 @@
/* HashSet.java -- a class providing a HashMap-backed Set
- Copyright (C) 1998, 1999, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,7 +66,7 @@ import java.io.Serializable;
* non-deterministic behavior.
*
* @author Jon Zeppieri
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see Set
* @see TreeSet
diff --git a/libjava/java/util/Hashtable.java b/libjava/java/util/Hashtable.java
index 3f5ae4c18c7..8d6e81fc7ef 100644
--- a/libjava/java/util/Hashtable.java
+++ b/libjava/java/util/Hashtable.java
@@ -1,6 +1,6 @@
/* Hashtable.java -- a class providing a basic hashtable data structure,
mapping Object --> Object
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,7 +91,7 @@ import java.io.Serializable;
* @author Jon Zeppieri
* @author Warren Levy
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see HashMap
* @see TreeMap
* @see IdentityHashMap
diff --git a/libjava/java/util/IdentityHashMap.java b/libjava/java/util/IdentityHashMap.java
index 5b2e9967c70..54f4aca81e2 100644
--- a/libjava/java/util/IdentityHashMap.java
+++ b/libjava/java/util/IdentityHashMap.java
@@ -1,6 +1,6 @@
/* IdentityHashMap.java -- a class providing a hashtable data structure,
mapping Object --> Object, which uses object identity for hashing.
- Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -78,8 +78,8 @@ import java.io.Serializable;
* iterator, and in the case of the entrySet, the Map.Entry, to
* fail with a {@link ConcurrentModificationException}.
*
- * @author Tom Tromey <tromey@redhat.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see System#identityHashCode(Object)
* @see Collection
* @see Map
@@ -676,8 +676,8 @@ public class IdentityHashMap extends AbstractMap
* creates the appropriate Map.Entry object with the correct fail-fast
* semantics and identity comparisons.
*
- * @author Tom Tromey <tromey@redhat.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Tom Tromey (tromey@redhat.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private class IdentityIterator implements Iterator
{
@@ -769,7 +769,7 @@ public class IdentityHashMap extends AbstractMap
* the general contract of Map.Entry, and is probably unsuitable for
* comparison to normal maps; but it works among other IdentityHashMaps.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private final class IdentityEntry implements Map.Entry
{
diff --git a/libjava/java/util/Iterator.java b/libjava/java/util/Iterator.java
index 1c55a35e582..0d8441a172c 100644
--- a/libjava/java/util/Iterator.java
+++ b/libjava/java/util/Iterator.java
@@ -1,5 +1,5 @@
/* Iterator.java -- Interface for iterating over collections
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package java.util;
* have the remove method and had less conveniently named methods.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see ListIterator
* @see Enumeration
diff --git a/libjava/java/util/LinkedHashMap.java b/libjava/java/util/LinkedHashMap.java
index 0a8484bae88..f58cf3fe70e 100644
--- a/libjava/java/util/LinkedHashMap.java
+++ b/libjava/java/util/LinkedHashMap.java
@@ -412,7 +412,7 @@ public class LinkedHashMap extends HashMap
e.next = buckets[idx];
buckets[idx] = e;
if (callRemove && removeEldestEntry(root))
- remove(root);
+ remove(root.key);
}
/**
diff --git a/libjava/java/util/LinkedHashSet.java b/libjava/java/util/LinkedHashSet.java
index 4641e52b64a..567602818d3 100644
--- a/libjava/java/util/LinkedHashSet.java
+++ b/libjava/java/util/LinkedHashSet.java
@@ -1,6 +1,6 @@
/* LinkedHashSet.java -- a set backed by a LinkedHashMap, for linked
list traversal.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -78,7 +78,7 @@ import java.io.Serializable;
* {@link ConcurrentModificationException} rather than exhibit
* non-deterministic behavior.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Object#hashCode()
* @see Collection
* @see Set
diff --git a/libjava/java/util/LinkedList.java b/libjava/java/util/LinkedList.java
index 4789a387ad5..b2bfda42e2a 100644
--- a/libjava/java/util/LinkedList.java
+++ b/libjava/java/util/LinkedList.java
@@ -1,5 +1,5 @@
/* LinkedList.java -- Linked list implementation of the List interface
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,7 +63,7 @@ import java.lang.reflect.Array;
*
* @author Original author unknown
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see List
* @see ArrayList
* @see Vector
@@ -750,7 +750,7 @@ public class LinkedList extends AbstractSequentialList
* position in the list and the two list entries it is between.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private final class LinkedListItr implements ListIterator
{
diff --git a/libjava/java/util/List.java b/libjava/java/util/List.java
index 0f7f409dae6..6d3df8593be 100644
--- a/libjava/java/util/List.java
+++ b/libjava/java/util/List.java
@@ -1,5 +1,5 @@
/* List.java -- An ordered collection which allows indexed access
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -66,7 +66,7 @@ package java.util;
* hashCode or equals.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see Set
* @see ArrayList
diff --git a/libjava/java/util/ListIterator.java b/libjava/java/util/ListIterator.java
index 6d53469ec99..c957e3f217a 100644
--- a/libjava/java/util/ListIterator.java
+++ b/libjava/java/util/ListIterator.java
@@ -1,5 +1,5 @@
/* ListIterator.java -- Extended Iterator for iterating over ordered lists
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,7 +51,7 @@ package java.util;
* or <code>previous</code>.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see List
* @see Iterator
diff --git a/libjava/java/util/ListResourceBundle.java b/libjava/java/util/ListResourceBundle.java
index b7b32c212f9..3c7336eaffd 100644
--- a/libjava/java/util/ListResourceBundle.java
+++ b/libjava/java/util/ListResourceBundle.java
@@ -1,5 +1,5 @@
/* ListResourceBundle -- a resource bundle build around a list
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -72,7 +72,7 @@ package java.util;
}</pre>
*
* @author Jochen Hoenicke
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Locale
* @see PropertyResourceBundle
* @since 1.1
diff --git a/libjava/java/util/Map.java b/libjava/java/util/Map.java
index 093e13d215d..3298d8ea28c 100644
--- a/libjava/java/util/Map.java
+++ b/libjava/java/util/Map.java
@@ -1,6 +1,6 @@
/* Map.java: interface Map -- An object that maps keys to values
interface Map.Entry -- an Entry in a Map
- Copyright (C) 1998, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -68,7 +68,7 @@ package java.util;
* normally fail with a non-empty argument.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see HashMap
* @see TreeMap
* @see Hashtable
@@ -267,7 +267,7 @@ public interface Map
* for undefined behavior.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Map
* @see Map#entrySet()
* @since 1.2
diff --git a/libjava/java/util/MissingResourceException.java b/libjava/java/util/MissingResourceException.java
index 47525e55bfa..1bfed625247 100644
--- a/libjava/java/util/MissingResourceException.java
+++ b/libjava/java/util/MissingResourceException.java
@@ -1,5 +1,5 @@
/* MissingResourceException.java -- thrown for a missing resource
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.util;
* This exception is thrown when a resource is missing.
*
* @author Jochen Hoenicke
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see ResourceBundle
* @since 1.1
* @status updated to 1.4
diff --git a/libjava/java/util/NoSuchElementException.java b/libjava/java/util/NoSuchElementException.java
index a040e901be7..d0c53a0a808 100644
--- a/libjava/java/util/NoSuchElementException.java
+++ b/libjava/java/util/NoSuchElementException.java
@@ -1,5 +1,5 @@
/* NoSuchElementException.java -- Attempt to access element that does not exist
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -51,8 +51,8 @@ package java.util;
* thrown by Vector and Stack when attempting to access the first or last
* element of an empty collection.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Enumeration
* @see Iterator
* @see ListIterator
diff --git a/libjava/java/util/Observable.java b/libjava/java/util/Observable.java
index 7616f5160f8..4fd9919e4c0 100644
--- a/libjava/java/util/Observable.java
+++ b/libjava/java/util/Observable.java
@@ -1,5 +1,5 @@
/* Observable.java -- an object to be observed
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,8 +47,8 @@ package java.util;
* Note that the <code>notifyObservers()</code> method of this class is
* unrelated to the <code>notify()</code> of Object.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Observer
* @status updated to 1.4
*/
diff --git a/libjava/java/util/Observer.java b/libjava/java/util/Observer.java
index 884a263888f..88d1e4d80d4 100644
--- a/libjava/java/util/Observer.java
+++ b/libjava/java/util/Observer.java
@@ -1,5 +1,5 @@
/* Observer.java -- an object that will be informed of changes in an Observable
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ package java.util;
* Interface that is implemented when a class wants to be informed of changes
* in Observable objects.
*
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see Observable
* @status updated to 1.4
*/
diff --git a/libjava/java/util/Properties.java b/libjava/java/util/Properties.java
index eac90e490fb..5e351056c70 100644
--- a/libjava/java/util/Properties.java
+++ b/libjava/java/util/Properties.java
@@ -1,5 +1,5 @@
/* Properties.java -- a set of persistent properties
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -86,7 +86,7 @@ s16=1,3</pre>
* a single <code>u</code> for any character which cannot be represented.
*
* @author Jochen Hoenicke
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see PropertyResourceBundle
* @status updated to 1.4
*/
diff --git a/libjava/java/util/PropertyPermission.java b/libjava/java/util/PropertyPermission.java
index ec2ca7abab6..7b2667a39dd 100644
--- a/libjava/java/util/PropertyPermission.java
+++ b/libjava/java/util/PropertyPermission.java
@@ -1,5 +1,5 @@
/* PropertyPermission.java -- permission to get and set System properties
- Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -154,17 +154,18 @@ public final class PropertyPermission extends BasicPermission
actions = WRITE;
else if ("read,write".equals(str) || "write,read".equals(str))
actions = READ | WRITE;
- else {
- String lstr = str.toLowerCase();
- if ("read".equals(lstr))
- actions = READ;
- else if ("write".equals(lstr))
- actions = WRITE;
- else if ("read,write".equals(lstr) || "write,read".equals(lstr))
- actions = READ | WRITE;
- else
- throw new IllegalArgumentException("illegal action " + str);
- }
+ else
+ {
+ String lstr = str.toLowerCase();
+ if ("read".equals(lstr))
+ actions = READ;
+ else if ("write".equals(lstr))
+ actions = WRITE;
+ else if ("read,write".equals(lstr) || "write,read".equals(lstr))
+ actions = READ | WRITE;
+ else
+ throw new IllegalArgumentException("illegal action " + str);
+ }
}
/**
diff --git a/libjava/java/util/PropertyPermissionCollection.java b/libjava/java/util/PropertyPermissionCollection.java
index 5c799238f3f..6a14c9bd740 100644
--- a/libjava/java/util/PropertyPermissionCollection.java
+++ b/libjava/java/util/PropertyPermissionCollection.java
@@ -1,5 +1,5 @@
/* PropertyPermissionCollection.java -- a collection of PropertyPermissions
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import java.security.PermissionCollection;
* PropertyPermissions, and correctly implements <code>implies</code>. It
* is synchronized, as specified in the superclass.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @status an undocumented class, but this matches Sun's serialization
*/
class PropertyPermissionCollection extends PermissionCollection
diff --git a/libjava/java/util/RandomAccess.java b/libjava/java/util/RandomAccess.java
index 151ceac08aa..a38b6a5f48c 100644
--- a/libjava/java/util/RandomAccess.java
+++ b/libjava/java/util/RandomAccess.java
@@ -1,6 +1,6 @@
/* RandomAccess.java -- A tagging interface that lists can use to tailor
operations to the correct algorithm
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ package java.util;
* <br>runs faster than this loop:<br>
* <code>for (Iterator i = list.iterator(); i.hasNext(); ) i.next();</code>
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see List
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/util/Set.java b/libjava/java/util/Set.java
index eb4df3ef299..58736d81544 100644
--- a/libjava/java/util/Set.java
+++ b/libjava/java/util/Set.java
@@ -1,5 +1,5 @@
/* Set.java -- A collection that prohibits duplicates
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ package java.util;
* allowed to be an element of itself, without risking undefined behavior.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see List
* @see SortedSet
diff --git a/libjava/java/util/SimpleTimeZone.java b/libjava/java/util/SimpleTimeZone.java
index 7d0e2019861..4da1847a29c 100644
--- a/libjava/java/util/SimpleTimeZone.java
+++ b/libjava/java/util/SimpleTimeZone.java
@@ -1,5 +1,5 @@
/* java.util.SimpleTimeZone
- Copyright (C) 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.util;
+
/**
* This class represents a simple time zone offset and handles
* daylight savings. It can only handle one daylight savings rule, so
@@ -49,14 +50,14 @@ package java.util;
* lying in the AD era.
*
* @see Calendar
- * @see GregorianCalender
+ * @see GregorianCalender
* @author Jochen Hoenicke
*/
public class SimpleTimeZone extends TimeZone
{
/**
* The raw time zone offset in milliseconds to GMT, ignoring
- * daylight savings.
+ * daylight savings.
* @serial
*/
private int rawOffset;
@@ -77,16 +78,15 @@ public class SimpleTimeZone extends TimeZone
private int dstSavings = 60 * 60 * 1000;
/**
- * The first year, in which daylight savings rules applies.
+ * The first year, in which daylight savings rules applies.
* @serial
*/
private int startYear;
-
private static final int DOM_MODE = 1;
private static final int DOW_IN_MONTH_MODE = 2;
private static final int DOW_GE_DOM_MODE = 3;
private static final int DOW_LE_DOM_MODE = 4;
-
+
/**
* The mode of the start rule. This takes one of the following values:
* <dl>
@@ -119,7 +119,7 @@ public class SimpleTimeZone extends TimeZone
/**
* The month in which daylight savings start. This is one of the
- * constants Calendar.JANUARY, ..., Calendar.DECEMBER.
+ * constants Calendar.JANUARY, ..., Calendar.DECEMBER.
* @serial
*/
private int startMonth;
@@ -128,21 +128,21 @@ public class SimpleTimeZone extends TimeZone
* This variable can have different meanings. See startMode for details
* @see #startMode;
* @serial
- */
+ */
private int startDay;
-
+
/**
- * This variable specifies the day of week the change takes place. If
+ * This variable specifies the day of week the change takes place. If
* startMode == DOM_MODE, this is undefined.
* @serial
* @see #startMode;
- */
+ */
private int startDayOfWeek;
-
+
/**
* This variable specifies the time of change to daylight savings.
* This time is given in milliseconds after midnight local
- * standard time.
+ * standard time.
* @serial
*/
private int startTime;
@@ -157,9 +157,9 @@ public class SimpleTimeZone extends TimeZone
/**
* The month in which daylight savings ends. This is one of the
- * constants Calendar.JANUARY, ..., Calendar.DECEMBER.
+ * constants Calendar.JANUARY, ..., Calendar.DECEMBER.
* @serial
- */
+ */
private int endMonth;
/**
@@ -167,7 +167,7 @@ public class SimpleTimeZone extends TimeZone
* It can take the same values as startMode.
* @serial
* @see #startMode
- */
+ */
private int endMode;
/**
@@ -176,19 +176,19 @@ public class SimpleTimeZone extends TimeZone
* @see #startMode;
*/
private int endDay;
-
+
/**
- * This variable specifies the day of week the change takes place. If
+ * This variable specifies the day of week the change takes place. If
* endMode == DOM_MODE, this is undefined.
* @serial
* @see #startMode;
*/
private int endDayOfWeek;
-
+
/**
* This variable specifies the time of change back to standard time.
* This time is given in milliseconds after midnight local
- * standard time.
+ * standard time.
* @serial
*/
private int endTime;
@@ -210,8 +210,11 @@ public class SimpleTimeZone extends TimeZone
* @serial
*/
private byte[] monthLength = monthArr;
- private static final byte[] monthArr =
- {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+ private static final byte[] monthArr =
+ {
+ 31, 28, 31, 30, 31, 30, 31, 31, 30,
+ 31, 30, 31
+ };
/**
* The version of the serialized data on the stream.
@@ -225,6 +228,7 @@ public class SimpleTimeZone extends TimeZone
* startMode, endMode and dstSavings. And there is a optional section
* as described in writeObject.
* </dd>
+ * </dl>
*
* XXX - JDK 1.2 Beta 4 docu states 1.1.4, but my 1.1.5 has the old
* version.
@@ -232,10 +236,9 @@ public class SimpleTimeZone extends TimeZone
* When streaming out this class it is always written in the latest
* version.
* @serial
- * @since JDK1.1.4
+ * @since JDK1.1.4
*/
private int serialVersionOnStream = 2;
-
private static final long serialVersionUID = -403250971215465050L;
/**
@@ -257,9 +260,9 @@ public class SimpleTimeZone extends TimeZone
/**
* Create a <code>SimpleTimeZone</code> with the given time offset
- * from GMT and without daylight savings.
+ * from GMT and without daylight savings.
* @param rawOffset the time offset from GMT in milliseconds.
- * @param id The identifier of this time zone.
+ * @param id The identifier of this time zone.
*/
public SimpleTimeZone(int rawOffset, String id)
{
@@ -273,7 +276,7 @@ public class SimpleTimeZone extends TimeZone
* Create a <code>SimpleTimeZone</code> with the given time offset
* from GMT and with daylight savings. The start/end parameters
* can have different meaning (replace WEEKDAY with a real day of
- * week). Only the first two meanings were supported by earlier
+ * week). Only the first two meanings were supported by earlier
* versions of jdk.
*
* <dl>
@@ -296,12 +299,12 @@ public class SimpleTimeZone extends TimeZone
* must make sure that this day lies in the same month. </dd>
* </dl>
*
- * If you give a non existing month, a day that is zero, or too big,
+ * If you give a non existing month, a day that is zero, or too big,
* or a dayOfWeek that is too big, the result is undefined.
*
* The start rule must have a different month than the end rule.
* This restriction shouldn't hurt for all possible time zones.
- *
+ *
* @param rawOffset The time offset from GMT in milliseconds.
* @param id The identifier of this time zone.
* @param startMonth The start month of daylight savings; use the
@@ -312,29 +315,26 @@ public class SimpleTimeZone extends TimeZone
* @param startTime A time in millis in standard time.
* @param endMonth The end month of daylight savings; use the
* constants in Calendar.
- * @param endday A day in month or a day of week number, as
+ * @param endday A day in month or a day of week number, as
* described above.
* @param endDayOfWeek The end rule day of week; see above.
* @param endTime A time in millis in standard time.
* @throws IllegalArgumentException if parameters are invalid or out of
* range.
*/
- public SimpleTimeZone(int rawOffset, String id,
- int startMonth, int startDayOfWeekInMonth,
- int startDayOfWeek, int startTime,
- int endMonth, int endDayOfWeekInMonth,
- int endDayOfWeek, int endTime)
+ public SimpleTimeZone(int rawOffset, String id, int startMonth,
+ int startDayOfWeekInMonth, int startDayOfWeek,
+ int startTime, int endMonth, int endDayOfWeekInMonth,
+ int endDayOfWeek, int endTime)
{
this.rawOffset = rawOffset;
setID(id);
useDaylight = true;
- setStartRule(startMonth, startDayOfWeekInMonth,
- startDayOfWeek, startTime);
+ setStartRule(startMonth, startDayOfWeekInMonth, startDayOfWeek, startTime);
setEndRule(endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime);
if (startMonth == endMonth)
- throw new IllegalArgumentException
- ("startMonth and endMonth must be different");
+ throw new IllegalArgumentException("startMonth and endMonth must be different");
this.startYear = 0;
}
@@ -347,15 +347,13 @@ public class SimpleTimeZone extends TimeZone
* time in milliseconds. This must be positive.
* @since 1.2
*/
- public SimpleTimeZone(int rawOffset, String id,
- int startMonth, int startDayOfWeekInMonth,
- int startDayOfWeek, int startTime,
- int endMonth, int endDayOfWeekInMonth,
- int endDayOfWeek, int endTime, int dstSavings)
+ public SimpleTimeZone(int rawOffset, String id, int startMonth,
+ int startDayOfWeekInMonth, int startDayOfWeek,
+ int startTime, int endMonth, int endDayOfWeekInMonth,
+ int endDayOfWeek, int endTime, int dstSavings)
{
- this(rawOffset, id,
- startMonth, startDayOfWeekInMonth, startDayOfWeek, startTime,
- endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime);
+ this(rawOffset, id, startMonth, startDayOfWeekInMonth, startDayOfWeek,
+ startTime, endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime);
this.dstSavings = dstSavings;
}
@@ -376,12 +374,11 @@ public class SimpleTimeZone extends TimeZone
* range.
* @since 1.4
*/
- public SimpleTimeZone(int rawOffset, String id,
- int startMonth, int startDayOfWeekInMonth,
- int startDayOfWeek, int startTime, int startTimeMode,
- int endMonth, int endDayOfWeekInMonth,
- int endDayOfWeek, int endTime, int endTimeMode,
- int dstSavings)
+ public SimpleTimeZone(int rawOffset, String id, int startMonth,
+ int startDayOfWeekInMonth, int startDayOfWeek,
+ int startTime, int startTimeMode, int endMonth,
+ int endDayOfWeekInMonth, int endDayOfWeek,
+ int endTime, int endTimeMode, int dstSavings)
{
this.rawOffset = rawOffset;
setID(id);
@@ -394,12 +391,10 @@ public class SimpleTimeZone extends TimeZone
this.startTimeMode = startTimeMode;
this.endTimeMode = endTimeMode;
- setStartRule(startMonth, startDayOfWeekInMonth,
- startDayOfWeek, startTime);
+ setStartRule(startMonth, startDayOfWeekInMonth, startDayOfWeek, startTime);
setEndRule(endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime);
if (startMonth == endMonth)
- throw new IllegalArgumentException
- ("startMonth and endMonth must be different");
+ throw new IllegalArgumentException("startMonth and endMonth must be different");
this.startYear = 0;
this.dstSavings = dstSavings;
@@ -432,6 +427,7 @@ public class SimpleTimeZone extends TimeZone
{
if (month < 0 || month > 11)
throw new IllegalArgumentException("month out of range");
+
int daysInMonth = getDaysInMonth(month, 1);
if (dayOfWeek == 0)
{
@@ -460,7 +456,6 @@ public class SimpleTimeZone extends TimeZone
}
}
-
/**
* Sets the daylight savings start rule. You must also set the
* end rule with <code>setEndRule</code> or the result of
@@ -514,14 +509,16 @@ public class SimpleTimeZone extends TimeZone
* @since 1.2
* @see SimpleTimeZone
*/
- public void setStartRule(int month, int day, int dayOfWeek, int time, boolean after)
+ public void setStartRule(int month, int day, int dayOfWeek, int time,
+ boolean after)
{
// FIXME: XXX: Validate that checkRule and offset processing work with on
// or before mode.
this.startDay = after ? Math.abs(day) : -Math.abs(day);
this.startDayOfWeek = after ? Math.abs(dayOfWeek) : -Math.abs(dayOfWeek);
- this.startMode = (dayOfWeek != 0) ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE)
- : checkRule(month, day, dayOfWeek);
+ this.startMode = (dayOfWeek != 0)
+ ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE)
+ : checkRule(month, day, dayOfWeek);
this.startDay = Math.abs(this.startDay);
this.startDayOfWeek = Math.abs(this.startDayOfWeek);
@@ -591,7 +588,7 @@ public class SimpleTimeZone extends TimeZone
*
* Note that this API isn't incredibly well specified. It appears that the
* after flag must override the parameters, since normally, the day and
- * dayofweek can select this. I.e., if day &lt; 0 and dayOfWeek &lt; 0, on or
+ * dayofweek can select this. I.e., if day < 0 and dayOfWeek < 0, on or
* before mode is chosen. But if after == true, this implementation
* overrides the signs of the other arguments. And if dayOfWeek == 0, it
* falls back to the behavior in the other APIs. I guess this should be
@@ -606,14 +603,16 @@ public class SimpleTimeZone extends TimeZone
* @since 1.2
* @see #setStartRule
*/
- public void setEndRule(int month, int day, int dayOfWeek, int time, boolean after)
+ public void setEndRule(int month, int day, int dayOfWeek, int time,
+ boolean after)
{
// FIXME: XXX: Validate that checkRule and offset processing work with on
// or before mode.
this.endDay = after ? Math.abs(day) : -Math.abs(day);
this.endDayOfWeek = after ? Math.abs(dayOfWeek) : -Math.abs(dayOfWeek);
- this.endMode = (dayOfWeek != 0) ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE)
- : checkRule(month, day, dayOfWeek);
+ this.endMode = (dayOfWeek != 0)
+ ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE)
+ : checkRule(month, day, dayOfWeek);
this.endDay = Math.abs(this.endDay);
this.endDayOfWeek = Math.abs(endDayOfWeek);
@@ -648,7 +647,7 @@ public class SimpleTimeZone extends TimeZone
}
/**
- * Gets the time zone offset, for current date, modified in case of
+ * Gets the time zone offset, for current date, modified in case of
* daylight savings. This is the offset to add to UTC to get the local
* time.
*
@@ -674,8 +673,8 @@ public class SimpleTimeZone extends TimeZone
* @return the time zone offset in milliseconds.
* @throws IllegalArgumentException if arguments are incorrect.
*/
- public int getOffset(int era, int year, int month,
- int day, int dayOfWeek, int millis)
+ public int getOffset(int era, int year, int month, int day, int dayOfWeek,
+ int millis)
{
int daysInMonth = getDaysInMonth(month, year);
if (day < 1 || day > daysInMonth)
@@ -683,7 +682,7 @@ public class SimpleTimeZone extends TimeZone
if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY)
throw new IllegalArgumentException("dayOfWeek out of range");
if (month < Calendar.JANUARY || month > Calendar.DECEMBER)
- throw new IllegalArgumentException("month out of range");
+ throw new IllegalArgumentException("month out of range:" + month);
// This method is called by Calendar, so we mustn't use that class.
int daylightSavings = 0;
@@ -691,27 +690,22 @@ public class SimpleTimeZone extends TimeZone
{
// This does only work for Gregorian calendars :-(
// This is mainly because setStartYear doesn't take an era.
-
- boolean afterStart = !isBefore(year, month, day, dayOfWeek, millis,
- startMode, startMonth,
- startDay, startDayOfWeek, startTime);
+ boolean afterStart = ! isBefore(year, month, day, dayOfWeek, millis,
+ startMode, startMonth, startDay,
+ startDayOfWeek, startTime);
boolean beforeEnd = isBefore(year, month, day, dayOfWeek,
millis + dstSavings,
- endMode, endMonth,
- endDay, endDayOfWeek, endTime);
+ endMode, endMonth, endDay, endDayOfWeek,
+ endTime);
if (startMonth < endMonth)
- {
- // use daylight savings, if the date is after the start of
- // savings, and before the end of savings.
- daylightSavings = afterStart && beforeEnd ? dstSavings : 0;
- }
+ // use daylight savings, if the date is after the start of
+ // savings, and before the end of savings.
+ daylightSavings = afterStart && beforeEnd ? dstSavings : 0;
else
- {
- // use daylight savings, if the date is before the end of
- // savings, or after the start of savings.
- daylightSavings = beforeEnd || afterStart ? dstSavings : 0;
- }
+ // use daylight savings, if the date is before the end of
+ // savings, or after the start of savings.
+ daylightSavings = beforeEnd || afterStart ? dstSavings : 0;
}
return rawOffset + daylightSavings;
}
@@ -740,7 +734,7 @@ public class SimpleTimeZone extends TimeZone
* milliseconds with respect to standard time. Typically this
* is one hour, but for some time zones this may be half an our.
* @return the daylight savings offset in milliseconds.
- *
+ *
* @since 1.2
*/
public int getDSTSavings()
@@ -760,7 +754,7 @@ public class SimpleTimeZone extends TimeZone
{
if (dstSavings <= 0)
throw new IllegalArgumentException("illegal value for dstSavings");
-
+
this.dstSavings = dstSavings;
}
@@ -774,23 +768,28 @@ public class SimpleTimeZone extends TimeZone
}
/**
- * Returns the number of days in the given month. It does always
- * use the Gregorian leap year rule.
+ * Returns the number of days in the given month.
+ * Uses gregorian rules prior to 1582 (The default and earliest cutover)
* @param month The month, zero based; use one of the Calendar constants.
* @param year The year.
*/
private int getDaysInMonth(int month, int year)
{
- // Most of this is copied from GregorianCalendar.getActualMaximum()
if (month == Calendar.FEBRUARY)
{
- return ((year & 3) == 0 && (year % 100 != 0 || year % 400 == 0))
- ? 29 : 28;
+ if ((year & 3) != 0)
+ return 28;
+
+ // Assume default Gregorian cutover,
+ // all years prior to this must be Julian
+ if (year < 1582)
+ return 29;
+
+ // Gregorian rules
+ return ((year % 100) != 0 || (year % 400) == 0) ? 29 : 28;
}
- else if (month < Calendar.AUGUST)
- return 31 - (month & 1);
else
- return 30 + (month & 1);
+ return monthArr[month];
}
/**
@@ -804,23 +803,19 @@ public class SimpleTimeZone extends TimeZone
* @param mode the change mode; same semantic as startMode.
* @param month the change month; same semantic as startMonth.
* @param day the change day; same semantic as startDay.
- * @param dayOfWeek the change day of week;
+ * @param dayOfWeek the change day of week;
* @param millis the change time in millis since midnight standard time.
* same semantic as startDayOfWeek.
* @return true, if cal is before the change, false if cal is on
* or after the change.
*/
- private boolean isBefore(int calYear,
- int calMonth, int calDayOfMonth, int calDayOfWeek,
- int calMillis, int mode, int month,
- int day, int dayOfWeek, int millis)
+ private boolean isBefore(int calYear, int calMonth, int calDayOfMonth,
+ int calDayOfWeek, int calMillis, int mode,
+ int month, int day, int dayOfWeek, int millis)
{
-
// This method is called by Calendar, so we mustn't use that class.
// We have to do all calculations by hand.
-
// check the months:
-
// XXX - this is not correct:
// for the DOW_GE_DOM and DOW_LE_DOM modes the change date may
// be in a different month.
@@ -835,7 +830,7 @@ public class SimpleTimeZone extends TimeZone
return calDayOfMonth < day;
break;
case DOW_IN_MONTH_MODE:
- {
+ {
// This computes the day of month of the day of type
// "dayOfWeek" that lies in the same (sunday based) week as cal.
calDayOfMonth += (dayOfWeek - calDayOfWeek);
@@ -844,7 +839,6 @@ public class SimpleTimeZone extends TimeZone
// after dividing by 7). If we count from the end of the
// month, we get want a -7 based number counting the days from
// the end:
-
if (day < 0)
calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7;
else
@@ -857,9 +851,9 @@ public class SimpleTimeZone extends TimeZone
// 20 21 22 23 24 25 26 -23-22-21-20-19-18-17
// 27 28 29 30 31 32 33 -16-15-14-13-12-11-10
// 34 35 36 -9 -8 -7
-
// Now we calculate the day of week in month:
int week = calDayOfMonth / 7;
+
// day > 0 day < 0
// S M T W T F S S M T W T F S
// 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4
@@ -867,7 +861,6 @@ public class SimpleTimeZone extends TimeZone
// 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2
// 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1
// 4 5 5 -1 -1 -1
-
if (week != day)
return week < day;
@@ -876,26 +869,25 @@ public class SimpleTimeZone extends TimeZone
// daylight savings starts/ends on the given day.
break;
- }
-
+ }
case DOW_LE_DOM_MODE:
// The greatest sunday before or equal December, 12
// is the same as smallest sunday after or equal December, 6.
day = Math.abs(day) - 6;
-
case DOW_GE_DOM_MODE:
-
// Calculate the day of month of the day of type
// "dayOfWeek" that lies before (or on) the given date.
- calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0)
- + calDayOfWeek - dayOfWeek;
+ calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek
+ - dayOfWeek;
if (calDayOfMonth < day)
return true;
if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7)
return false;
+
// now we have the same day
break;
}
+
// the millis decides:
return (calMillis < millis);
}
@@ -914,40 +906,35 @@ public class SimpleTimeZone extends TimeZone
/**
* Generates the hashCode for the SimpleDateFormat object. It is
* the rawOffset, possibly, if useDaylightSavings is true, xored
- * with startYear, startMonth, startDayOfWeekInMonth, ..., endTime.
+ * with startYear, startMonth, startDayOfWeekInMonth, ..., endTime.
*/
public synchronized int hashCode()
{
- return rawOffset ^
- (useDaylight ?
- startMonth ^ startDay ^ startDayOfWeek ^ startTime
- ^ endMonth ^ endDay ^ endDayOfWeek ^ endTime : 0);
+ return rawOffset
+ ^ (useDaylight
+ ? startMonth ^ startDay ^ startDayOfWeek ^ startTime ^ endMonth
+ ^ endDay ^ endDayOfWeek ^ endTime : 0);
}
public synchronized boolean equals(Object o)
{
if (this == o)
return true;
- if (!(o instanceof SimpleTimeZone))
+ if (! (o instanceof SimpleTimeZone))
return false;
SimpleTimeZone zone = (SimpleTimeZone) o;
- if (zone.hashCode() != hashCode()
- || !getID().equals(zone.getID())
- || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight)
+ if (zone.hashCode() != hashCode() || ! getID().equals(zone.getID())
+ || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight)
return false;
- if (!useDaylight)
+ if (! useDaylight)
return true;
- return (startYear == zone.startYear
- && startMonth == zone.startMonth
- && startDay == zone.startDay
- && startDayOfWeek == zone.startDayOfWeek
- && startTime == zone.startTime
- && startTimeMode == zone.startTimeMode
- && endMonth == zone.endMonth
- && endDay == zone.endDay
- && endDayOfWeek == zone.endDayOfWeek
- && endTime == zone.endTime
- && endTimeMode == zone.endTimeMode);
+ return (startYear == zone.startYear && startMonth == zone.startMonth
+ && startDay == zone.startDay
+ && startDayOfWeek == zone.startDayOfWeek
+ && startTime == zone.startTime
+ && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth
+ && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek
+ && endTime == zone.endTime && endTimeMode == zone.endTimeMode);
}
/**
@@ -962,25 +949,21 @@ public class SimpleTimeZone extends TimeZone
{
if (this == other)
return true;
- if (!(other instanceof SimpleTimeZone))
+ if (! (other instanceof SimpleTimeZone))
return false;
SimpleTimeZone zone = (SimpleTimeZone) other;
- if (zone.hashCode() != hashCode()
- || rawOffset != zone.rawOffset || useDaylight != zone.useDaylight)
+ if (zone.hashCode() != hashCode() || rawOffset != zone.rawOffset
+ || useDaylight != zone.useDaylight)
return false;
- if (!useDaylight)
+ if (! useDaylight)
return true;
- return (startYear == zone.startYear
- && startMonth == zone.startMonth
- && startDay == zone.startDay
- && startDayOfWeek == zone.startDayOfWeek
- && startTime == zone.startTime
- && startTimeMode == zone.startTimeMode
- && endMonth == zone.endMonth
- && endDay == zone.endDay
- && endDayOfWeek == zone.endDayOfWeek
- && endTime == zone.endTime
- && endTimeMode == zone.endTimeMode);
+ return (startYear == zone.startYear && startMonth == zone.startMonth
+ && startDay == zone.startDay
+ && startDayOfWeek == zone.startDayOfWeek
+ && startTime == zone.startTime
+ && startTimeMode == zone.startTimeMode && endMonth == zone.endMonth
+ && endDay == zone.endDay && endDayOfWeek == zone.endDayOfWeek
+ && endTime == zone.endTime && endTimeMode == zone.endTimeMode);
}
/**
@@ -991,26 +974,17 @@ public class SimpleTimeZone extends TimeZone
{
// the test for useDaylight is an incompatibility to jdk1.2, but
// I think this shouldn't hurt.
- return getClass().getName() + "["
- + "id=" + getID()
- + ",offset=" + rawOffset
- + ",dstSavings=" + dstSavings
- + ",useDaylight=" + useDaylight
- + (useDaylight ?
- ",startYear=" + startYear
- + ",startMode=" + startMode
- + ",startMonth=" + startMonth
- + ",startDay=" + startDay
- + ",startDayOfWeek=" + startDayOfWeek
- + ",startTime=" + startTime
- + ",startTimeMode=" + startTimeMode
- + ",endMode=" + endMode
- + ",endMonth=" + endMonth
- + ",endDay=" + endDay
- + ",endDayOfWeek=" + endDayOfWeek
- + ",endTime=" + endTime
- + ",endTimeMode=" + endTimeMode
- : "") + "]";
+ return getClass().getName() + "[" + "id=" + getID() + ",offset="
+ + rawOffset + ",dstSavings=" + dstSavings + ",useDaylight="
+ + useDaylight
+ + (useDaylight
+ ? ",startYear=" + startYear + ",startMode=" + startMode
+ + ",startMonth=" + startMonth + ",startDay=" + startDay
+ + ",startDayOfWeek=" + startDayOfWeek + ",startTime="
+ + startTime + ",startTimeMode=" + startTimeMode + ",endMode="
+ + endMode + ",endMonth=" + endMonth + ",endDay=" + endDay
+ + ",endDayOfWeek=" + endDayOfWeek + ",endTime=" + endTime
+ + ",endTimeMode=" + endTimeMode : "") + "]";
}
/**
@@ -1029,7 +1003,8 @@ public class SimpleTimeZone extends TimeZone
startMode = DOW_IN_MONTH_MODE;
startTimeMode = WALL_TIME;
endTimeMode = WALL_TIME;
- serialVersionOnStream = 2; }
+ serialVersionOnStream = 2;
+ }
else
{
int length = input.readInt();
@@ -1054,29 +1029,31 @@ public class SimpleTimeZone extends TimeZone
* <code>start/endDay(OfWeek)</code>-Fields are written in the
* DOW_IN_MONTH_MODE rule, since this was the only supported rule
* in 1.1.
- *
+ *
* In the optional section, we write first the length of an byte
* array as int and afterwards the byte array itself. The byte
* array contains in this release four elements, namely the real
* startDay, startDayOfWeek endDay, endDayOfWeek in that Order.
* These fields are needed, because for compatibility reasons only
* approximative values are written to the required section, as
- * described above.
+ * described above.
*/
private void writeObject(java.io.ObjectOutputStream output)
throws java.io.IOException
{
byte[] byteArray = new byte[]
- {
- (byte) startDay, (byte) startDayOfWeek,
- (byte) endDay, (byte) endDayOfWeek};
+ {
+ (byte) startDay, (byte) startDayOfWeek, (byte) endDay,
+ (byte) endDayOfWeek
+ };
/* calculate the approximation for JDK 1.1 */
switch (startMode)
{
case DOM_MODE:
- startDayOfWeek = Calendar.SUNDAY; // random day of week
- // fall through
+ startDayOfWeek = Calendar.SUNDAY; // random day of week
+
+ // fall through
case DOW_GE_DOM_MODE:
case DOW_LE_DOM_MODE:
startDay = (startDay + 6) / 7;
@@ -1085,7 +1062,8 @@ public class SimpleTimeZone extends TimeZone
{
case DOM_MODE:
endDayOfWeek = Calendar.SUNDAY;
- // fall through
+
+ // fall through
case DOW_GE_DOM_MODE:
case DOW_LE_DOM_MODE:
endDay = (endDay + 6) / 7;
diff --git a/libjava/java/util/SortedMap.java b/libjava/java/util/SortedMap.java
index 1d2d5a3cc46..f19809a5e3d 100644
--- a/libjava/java/util/SortedMap.java
+++ b/libjava/java/util/SortedMap.java
@@ -1,5 +1,5 @@
/* SortedMap.java -- A map that makes guarantees about the order of its keys
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -61,7 +61,7 @@ package java.util;
* Unfortunately, the Java language does not provide a way to enforce this.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Map
* @see TreeMap
* @see SortedSet
diff --git a/libjava/java/util/SortedSet.java b/libjava/java/util/SortedSet.java
index 8cdbe878f63..17537b70c70 100644
--- a/libjava/java/util/SortedSet.java
+++ b/libjava/java/util/SortedSet.java
@@ -1,6 +1,6 @@
/* SortedSet.java -- A set that makes guarantees about the order of its
elements
- Copyright (C) 1998, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,7 +63,7 @@ package java.util;
* enforce this.
*
* @author Original author unknown
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Set
* @see TreeSet
* @see SortedMap
diff --git a/libjava/java/util/Stack.java b/libjava/java/util/Stack.java
index 00e32e5b710..e256eb653b3 100644
--- a/libjava/java/util/Stack.java
+++ b/libjava/java/util/Stack.java
@@ -1,6 +1,6 @@
/* Stack.java - Class that provides a Last In First Out (LIFO)
datatype, known more commonly as a Stack
- Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,8 +50,8 @@ package java.util;
* methods for stack manipulation (push, pop, peek). You can also seek for
* the 1-based position of an element on the stack.
*
- * @author Warren Levy <warrenl@cygnus.com>
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Warren Levy (warrenl@cygnus.com)
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see List
* @see AbstractList
* @see LinkedList
diff --git a/libjava/java/util/StringTokenizer.java b/libjava/java/util/StringTokenizer.java
index 472d8951e5d..90f97dba516 100644
--- a/libjava/java/util/StringTokenizer.java
+++ b/libjava/java/util/StringTokenizer.java
@@ -1,5 +1,5 @@
/* StringTokenizer -- breaks a String into tokens
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,7 +54,7 @@ package java.util;
* single character.
*
* @author Jochen Hoenicke
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see java.io.StreamTokenizer
* @status updated to 1.4
*/
diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java
index 0685e604600..7c811795790 100644
--- a/libjava/java/util/TimeZone.java
+++ b/libjava/java/util/TimeZone.java
@@ -447,6 +447,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones0.put("CET", tz);
+ timezones0.put("CEST", tz);
timezones0.put("ECT", tz);
timezones0.put("MET", tz);
timezones0.put("Africa/Ceuta", tz);
diff --git a/libjava/java/util/Timer.java b/libjava/java/util/Timer.java
index e4eb246a1db..3c7223b2782 100644
--- a/libjava/java/util/Timer.java
+++ b/libjava/java/util/Timer.java
@@ -343,6 +343,12 @@ public class Timer
{
task.run();
}
+ catch (ThreadDeath death)
+ {
+ // If an exception escapes, the Timer becomes invalid.
+ queue.stop();
+ throw death;
+ }
catch (Throwable t)
{
/* ignore all errors */
diff --git a/libjava/java/util/TooManyListenersException.java b/libjava/java/util/TooManyListenersException.java
index 883bdbc7086..dfe326b9aae 100644
--- a/libjava/java/util/TooManyListenersException.java
+++ b/libjava/java/util/TooManyListenersException.java
@@ -1,6 +1,6 @@
/* TooManyListenersException.java -- thrown when a unicast event can't accept
another Listener
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package java.util;
* single event listener.
*
* @author Jochen Hoenicke
- * @author Warren Levy <warrenl@cygnus.com>
+ * @author Warren Levy (warrenl@cygnus.com)
* @see EventListener
* @see EventObject
* @since 1.1
diff --git a/libjava/java/util/TreeMap.java b/libjava/java/util/TreeMap.java
index 440536845d7..fd5c12206ee 100644
--- a/libjava/java/util/TreeMap.java
+++ b/libjava/java/util/TreeMap.java
@@ -1,6 +1,6 @@
/* TreeMap.java -- a class providing a basic Red-Black Tree data structure,
mapping Object --> Object
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -78,7 +78,7 @@ import java.io.Serializable;
*
* @author Jon Zeppieri
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Map
* @see HashMap
* @see Hashtable
@@ -160,7 +160,7 @@ public class TreeMap extends AbstractMap
* Class to represent an entry in the tree. Holds a single key-value pair,
* plus pointers to parent and child nodes.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private static final class Node extends AbstractMap.BasicMapEntry
{
@@ -1382,7 +1382,7 @@ public class TreeMap extends AbstractMap
* Iterate over TreeMap's entries. This implementation is parameterized
* to give a sequential view of keys, values, or entries.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private final class TreeIterator implements Iterator
{
@@ -1490,7 +1490,7 @@ public class TreeMap extends AbstractMap
* map, and throws {@link IllegalArgumentException} for attempts to
* access beyond that range.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
*/
private final class SubMap extends AbstractMap implements SortedMap
{
diff --git a/libjava/java/util/TreeSet.java b/libjava/java/util/TreeSet.java
index f38357082d3..78504c51e8e 100644
--- a/libjava/java/util/TreeSet.java
+++ b/libjava/java/util/TreeSet.java
@@ -1,5 +1,5 @@
/* TreeSet.java -- a class providing a TreeMap-backed SortedSet
- Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,7 +67,7 @@ import java.io.Serializable;
*
* @author Jon Zeppieri
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see Set
* @see HashSet
diff --git a/libjava/java/util/Vector.java b/libjava/java/util/Vector.java
index 06eab1e9002..13a12b4cc82 100644
--- a/libjava/java/util/Vector.java
+++ b/libjava/java/util/Vector.java
@@ -1,5 +1,5 @@
/* Vector.java -- Class that provides growable arrays.
- Copyright (C) 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -72,7 +72,7 @@ import java.lang.reflect.Array;
*
* @author Scott G. Miller
* @author Bryce McKinlay
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Collection
* @see List
* @see ArrayList
diff --git a/libjava/java/util/jar/Attributes.java b/libjava/java/util/jar/Attributes.java
index 06dc4f89fc5..b8961411b6e 100644
--- a/libjava/java/util/jar/Attributes.java
+++ b/libjava/java/util/jar/Attributes.java
@@ -1,5 +1,5 @@
/* Attributes.java -- Represents attribute name/value pairs from a Manifest
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -98,14 +98,23 @@ public class Attributes implements Cloneable, Map
* converted to lowercase. But you can get the original case sensitive
* string with the <code>toString()</code> method.</p>
*
+ * <p>Most important attributes have a constant defined in this
+ * class. Some other attributes used in Manifest files are:
+ * <ul>
+ * <li> "Created-By" - General main attribute, tool and version
+ * that created this Manifest file.</li>
+ * <li> "Java-Bean" - Bean objects attribute, whether the entry is a Bean.
+ * Value is either "true" or "false".</li>
+ * <li> "Magic" - Signing attribute, application specific signing attribute.
+ * Must be understood by the manifest parser when present to validate the
+ * jar (entry).</li>
+ * </ul>
+ *
* @since 1.2
* @author Mark Wielaard (mark@klomp.org)
*/
public static class Name
{
-
- // Fields
-
// General Main Attributes
/**
@@ -113,21 +122,18 @@ public class Attributes implements Cloneable, Map
* the version of this Manifest file.
*/
public static final Name MANIFEST_VERSION = new Name("Manifest-Version");
- /**
- * General main attribute -
- * tool and version that created this Manifest file.
- */
- public static final Name CREATED_BY = new Name("Created-By");
+
/**
* General main attribute -
* the version of the jar file signature.
*/
public static final Name SIGNATURE_VERSION
= new Name("Signature-Version");
+
/**
* General main attribute -
- * (relative) URLs of the libraries/classpaths that the Classes in
- * this jar file depend on.
+ * (relative) file paths of the libraries/classpaths that the Classes in
+ * this jar file depend on. Paths are separated by spaces.
*/
public static final Name CLASS_PATH = new Name("Class-Path");
@@ -164,6 +170,7 @@ public class Attributes implements Cloneable, Map
* the name if the extension library contained in the jar.
*/
public static final Name EXTENSION_NAME = new Name("Extension-Name");
+
/**
* Extension identification attribute -
* synonym for <code>EXTENSTION_NAME</code>.
@@ -171,48 +178,56 @@ public class Attributes implements Cloneable, Map
public static final Name EXTENSION_INSTALLATION = EXTENSION_NAME;
// Package versioning and sealing attributes
+
/**
* Package versioning -
* name of extension library contained in this jar.
*/
public static final Name IMPLEMENTATION_TITLE
= new Name("Implementation-Title");
+
/**
* Package versioning -
* version of the extension library contained in this jar.
*/
public static final Name IMPLEMENTATION_VERSION
= new Name("Implementation-Version");
+
/**
* Package versioning -
* name of extension library creator contained in this jar.
*/
public static final Name IMPLEMENTATION_VENDOR
= new Name("Implementation-Vendor");
+
/**
* Package versioning -
* unique id of extension library creator.
*/
public static final Name IMPLEMENTATION_VENDOR_ID
= new Name("Implementation-Vendor-Id");
+
/**
* Package versioning -
* location where this implementation can be downloaded.
*/
public static final Name IMPLEMENTATION_URL
= new Name("Implementation-URL");
+
/**
* Package versioning -
* title of the specification contained in this jar.
*/
public static final Name SPECIFICATION_TITLE
= new Name("Specification-Title");
+
/**
* Package versioning -
* version of the specification contained in this jar.
*/
public static final Name SPECIFICATION_VERSION
= new Name("Specification-Version");
+
/**
* Package versioning -
* organisation that maintains the specification contains in this
@@ -220,6 +235,7 @@ public class Attributes implements Cloneable, Map
*/
public static final Name SPECIFICATION_VENDOR
= new Name("Specification-Vendor");
+
/**
* Package sealing -
* whether (all) package(s) is(/are) sealed. Value is either "true"
@@ -233,21 +249,9 @@ public class Attributes implements Cloneable, Map
*/
public static final Name CONTENT_TYPE = new Name("Content-Type");
- /**
- * Bean objects attribute -
- * whether the entry is a Java Bean. Value is either "true" or "false".
- */
- public static final Name JAVA_BEAN = new Name("Java-Bean");
-
- /**
- * Signing attribute -
- * application specific signing attribute. Must be understood by
- * the manifest parser when present to validate the jar (entry).
- */
- public static final Name MAGIC = new Name("Magic");
-
/** The (lowercase) String representation of this Name */
private final String name;
+
/** The original String given to the constructor */
private final String origName;
diff --git a/libjava/java/util/jar/JarFile.java b/libjava/java/util/jar/JarFile.java
index 070b3375d19..cb2cbf4900c 100644
--- a/libjava/java/util/jar/JarFile.java
+++ b/libjava/java/util/jar/JarFile.java
@@ -35,13 +35,38 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package java.util.jar;
+import gnu.java.io.Base64InputStream;
+import gnu.java.security.OID;
+import gnu.java.security.pkcs.PKCS7SignedData;
+import gnu.java.security.pkcs.SignerInfo;
+
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
+import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.security.InvalidKeyException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.Signature;
+import java.security.SignatureException;
+import java.security.cert.CRLException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Arrays;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
@@ -52,11 +77,11 @@ import java.util.zip.ZipFile;
* Note that this class is not a subclass of java.io.File but a subclass of
* java.util.zip.ZipFile and you can only read JarFiles with it (although
* there are constructors that take a File object).
- * <p>
- * XXX - verification of Manifest signatures is not yet implemented.
*
* @since 1.2
* @author Mark Wielaard (mark@klomp.org)
+ * @author Casey Marshall (csm@gnu.org) wrote the certificate and entry
+ * verification code.
*/
public class JarFile extends ZipFile
{
@@ -65,6 +90,29 @@ public class JarFile extends ZipFile
/** The name of the manifest entry: META-INF/MANIFEST.MF */
public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF";
+ /** The META-INF directory entry. */
+ private static final String META_INF = "META-INF/";
+
+ /** The suffix for PKCS7 DSA signature entries. */
+ private static final String PKCS7_DSA_SUFFIX = ".DSA";
+
+ /** The suffix for PKCS7 RSA signature entries. */
+ private static final String PKCS7_RSA_SUFFIX = ".RSA";
+
+ /** The suffix for digest attributes. */
+ private static final String DIGEST_KEY_SUFFIX = "-Digest";
+
+ /** The suffix for signature files. */
+ private static final String SF_SUFFIX = ".SF";
+
+ // Signature OIDs.
+ private static final OID MD2_OID = new OID("1.2.840.113549.2.2");
+ private static final OID MD4_OID = new OID("1.2.840.113549.2.4");
+ private static final OID MD5_OID = new OID("1.2.840.113549.2.5");
+ private static final OID SHA1_OID = new OID("1.3.14.3.2.26");
+ private static final OID DSA_ENCRYPTION_OID = new OID("1.2.840.10040.4.1");
+ private static final OID RSA_ENCRYPTION_OID = new OID("1.2.840.113549.1.1.1");
+
/**
* The manifest of this file, if any, otherwise null.
* Read when first needed.
@@ -72,11 +120,34 @@ public class JarFile extends ZipFile
private Manifest manifest;
/** Whether to verify the manifest and all entries. */
- private boolean verify;
+ boolean verify;
/** Whether the has already been loaded. */
private boolean manifestRead = false;
+ /** Whether the signature files have been loaded. */
+ boolean signaturesRead = false;
+
+ /**
+ * A map between entry names and booleans, signaling whether or
+ * not that entry has been verified.
+ * Only be accessed with lock on this JarFile*/
+ HashMap verified = new HashMap();
+
+ /**
+ * A mapping from entry name to certificates, if any.
+ * Only accessed with lock on this JarFile.
+ */
+ HashMap entryCerts;
+
+ static boolean DEBUG = false;
+ static void debug(Object msg)
+ {
+ System.err.print(JarFile.class.getName());
+ System.err.print(" >>> ");
+ System.err.println(msg);
+ }
+
// Constructors
/**
@@ -235,22 +306,23 @@ public class JarFile extends ZipFile
*/
public Enumeration entries() throws IllegalStateException
{
- return new JarEnumeration(super.entries());
+ return new JarEnumeration(super.entries(), this);
}
/**
* Wraps a given Zip Entries Enumeration. For every zip entry a
* JarEntry is created and the corresponding Attributes are looked up.
- * XXX - Should also look up the certificates.
*/
- private class JarEnumeration implements Enumeration
+ private static class JarEnumeration implements Enumeration
{
private final Enumeration entries;
+ private final JarFile jarfile;
- JarEnumeration(Enumeration e)
+ JarEnumeration(Enumeration e, JarFile f)
{
entries = e;
+ jarfile = f;
}
public boolean hasMoreElements()
@@ -265,7 +337,7 @@ public class JarFile extends ZipFile
Manifest manifest;
try
{
- manifest = getManifest();
+ manifest = jarfile.getManifest();
}
catch (IOException ioe)
{
@@ -276,7 +348,36 @@ public class JarFile extends ZipFile
{
jar.attr = manifest.getAttributes(jar.getName());
}
- // XXX jar.certs
+
+ synchronized(jarfile)
+ {
+ if (!jarfile.signaturesRead)
+ try
+ {
+ jarfile.readSignatures();
+ }
+ catch (IOException ioe)
+ {
+ if (JarFile.DEBUG)
+ {
+ JarFile.debug(ioe);
+ ioe.printStackTrace();
+ }
+ jarfile.signaturesRead = true; // fudge it.
+ }
+
+ // Include the certificates only if we have asserted that the
+ // signatures are valid. This means the certificates will not be
+ // available if the entry hasn't been read yet.
+ if (jarfile.entryCerts != null
+ && jarfile.verified.get(zip.getName()) == Boolean.TRUE)
+ {
+ Set certs = (Set) jarfile.entryCerts.get(jar.getName());
+ if (certs != null)
+ jar.certs = (Certificate[])
+ certs.toArray(new Certificate[certs.size()]);
+ }
+ }
return jar;
}
}
@@ -286,7 +387,7 @@ public class JarFile extends ZipFile
* It actually returns a JarEntry not a zipEntry
* @param name XXX
*/
- public ZipEntry getEntry(String name)
+ public synchronized ZipEntry getEntry(String name)
{
ZipEntry entry = super.getEntry(name);
if (entry != null)
@@ -305,7 +406,33 @@ public class JarFile extends ZipFile
if (manifest != null)
{
jarEntry.attr = manifest.getAttributes(name);
- // XXX jarEntry.certs
+ }
+
+ if (!signaturesRead)
+ try
+ {
+ readSignatures();
+ }
+ catch (IOException ioe)
+ {
+ if (DEBUG)
+ {
+ debug(ioe);
+ ioe.printStackTrace();
+ }
+ signaturesRead = true;
+ }
+ // See the comments in the JarEnumeration for why we do this
+ // check.
+ if (DEBUG)
+ debug("entryCerts=" + entryCerts + " verified " + name
+ + " ? " + verified.get(name));
+ if (entryCerts != null && verified.get(name) == Boolean.TRUE)
+ {
+ Set certs = (Set) entryCerts.get(name);
+ if (certs != null)
+ jarEntry.certs = (Certificate[])
+ certs.toArray(new Certificate[certs.size()]);
}
return jarEntry;
}
@@ -313,15 +440,32 @@ public class JarFile extends ZipFile
}
/**
- * XXX should verify the inputstream
- * @param entry XXX
+ * Returns an input stream for the given entry. If configured to
+ * verify entries, the input stream returned will verify them while
+ * the stream is read, but only on the first time.
+ *
+ * @param entry The entry to get the input stream for.
* @exception ZipException XXX
* @exception IOException XXX
*/
public synchronized InputStream getInputStream(ZipEntry entry) throws
ZipException, IOException
{
- return super.getInputStream(entry); // XXX verify
+ // If we haven't verified the hash, do it now.
+ if (!verified.containsKey(entry.getName()) && verify)
+ {
+ if (DEBUG)
+ debug("reading and verifying " + entry);
+ return new EntryInputStream(entry, super.getInputStream(entry), this);
+ }
+ else
+ {
+ if (DEBUG)
+ debug("reading already verified entry " + entry);
+ if (verify && verified.get(entry.getName()) == Boolean.FALSE)
+ throw new ZipException("digest for " + entry + " is invalid");
+ return super.getInputStream(entry);
+ }
}
/**
@@ -342,11 +486,573 @@ public class JarFile extends ZipFile
* Returns the manifest for this JarFile or null when the JarFile does not
* contain a manifest file.
*/
- public Manifest getManifest() throws IOException
+ public synchronized Manifest getManifest() throws IOException
{
if (!manifestRead)
manifest = readManifest();
return manifest;
}
+
+ // Only called with lock on this JarFile.
+ private void readSignatures() throws IOException
+ {
+ Map pkcs7Dsa = new HashMap();
+ Map pkcs7Rsa = new HashMap();
+ Map sigFiles = new HashMap();
+
+ // Phase 1: Read all signature files. These contain the user
+ // certificates as well as the signatures themselves.
+ for (Enumeration e = super.entries(); e.hasMoreElements(); )
+ {
+ ZipEntry ze = (ZipEntry) e.nextElement();
+ String name = ze.getName();
+ if (name.startsWith(META_INF))
+ {
+ String alias = name.substring(META_INF.length());
+ if (alias.lastIndexOf('.') >= 0)
+ alias = alias.substring(0, alias.lastIndexOf('.'));
+
+ if (name.endsWith(PKCS7_DSA_SUFFIX) || name.endsWith(PKCS7_RSA_SUFFIX))
+ {
+ if (DEBUG)
+ debug("reading PKCS7 info from " + name + ", alias=" + alias);
+ PKCS7SignedData sig = null;
+ try
+ {
+ sig = new PKCS7SignedData(super.getInputStream(ze));
+ }
+ catch (CertificateException ce)
+ {
+ IOException ioe = new IOException("certificate parsing error");
+ ioe.initCause(ce);
+ throw ioe;
+ }
+ catch (CRLException crle)
+ {
+ IOException ioe = new IOException("CRL parsing error");
+ ioe.initCause(crle);
+ throw ioe;
+ }
+ if (name.endsWith(PKCS7_DSA_SUFFIX))
+ pkcs7Dsa.put(alias, sig);
+ else if (name.endsWith(PKCS7_RSA_SUFFIX))
+ pkcs7Rsa.put(alias, sig);
+ }
+ else if (name.endsWith(SF_SUFFIX))
+ {
+ if (DEBUG)
+ debug("reading signature file for " + alias + ": " + name);
+ Manifest sf = new Manifest(super.getInputStream(ze));
+ sigFiles.put(alias, sf);
+ if (DEBUG)
+ debug("result: " + sf);
+ }
+ }
+ }
+
+ // Phase 2: verify the signatures on any signature files.
+ Set validCerts = new HashSet();
+ Map entryCerts = new HashMap();
+ for (Iterator it = sigFiles.entrySet().iterator(); it.hasNext(); )
+ {
+ int valid = 0;
+ Map.Entry e = (Map.Entry) it.next();
+ String alias = (String) e.getKey();
+
+ PKCS7SignedData sig = (PKCS7SignedData) pkcs7Dsa.get(alias);
+ if (sig != null)
+ {
+ Certificate[] certs = sig.getCertificates();
+ Set signerInfos = sig.getSignerInfos();
+ for (Iterator it2 = signerInfos.iterator(); it2.hasNext(); )
+ verify(certs, (SignerInfo) it2.next(), alias, validCerts);
+ }
+
+ sig = (PKCS7SignedData) pkcs7Rsa.get(alias);
+ if (sig != null)
+ {
+ Certificate[] certs = sig.getCertificates();
+ Set signerInfos = sig.getSignerInfos();
+ for (Iterator it2 = signerInfos.iterator(); it2.hasNext(); )
+ verify(certs, (SignerInfo) it2.next(), alias, validCerts);
+ }
+
+ // It isn't a signature for anything. Punt it.
+ if (validCerts.isEmpty())
+ {
+ it.remove();
+ continue;
+ }
+
+ entryCerts.put(e.getValue(), new HashSet(validCerts));
+ validCerts.clear();
+ }
+
+ // Phase 3: verify the signature file signatures against the manifest,
+ // mapping the entry name to the target certificates.
+ this.entryCerts = new HashMap();
+ for (Iterator it = entryCerts.entrySet().iterator(); it.hasNext(); )
+ {
+ Map.Entry e = (Map.Entry) it.next();
+ Manifest sigfile = (Manifest) e.getKey();
+ Map entries = sigfile.getEntries();
+ Set certificates = (Set) e.getValue();
+
+ for (Iterator it2 = entries.entrySet().iterator(); it2.hasNext(); )
+ {
+ Map.Entry e2 = (Map.Entry) it2.next();
+ String entryname = String.valueOf(e2.getKey());
+ Attributes attr = (Attributes) e2.getValue();
+ if (verifyHashes(entryname, attr))
+ {
+ if (DEBUG)
+ debug("entry " + entryname + " has certificates " + certificates);
+ Set s = (Set) this.entryCerts.get(entryname);
+ if (s != null)
+ s.addAll(certificates);
+ else
+ this.entryCerts.put(entryname, new HashSet(certificates));
+ }
+ }
+ }
+
+ signaturesRead = true;
+ }
+
+ /**
+ * Tell if the given signer info is over the given alias's signature file,
+ * given one of the certificates specified.
+ */
+ private void verify(Certificate[] certs, SignerInfo signerInfo,
+ String alias, Set validCerts)
+ {
+ Signature sig = null;
+ try
+ {
+ OID alg = signerInfo.getDigestEncryptionAlgorithmId();
+ if (alg.equals(DSA_ENCRYPTION_OID))
+ {
+ if (!signerInfo.getDigestAlgorithmId().equals(SHA1_OID))
+ return;
+ sig = Signature.getInstance("SHA1withDSA");
+ }
+ else if (alg.equals(RSA_ENCRYPTION_OID))
+ {
+ OID hash = signerInfo.getDigestAlgorithmId();
+ if (hash.equals(MD2_OID))
+ sig = Signature.getInstance("md2WithRsaEncryption");
+ else if (hash.equals(MD4_OID))
+ sig = Signature.getInstance("md4WithRsaEncryption");
+ else if (hash.equals(MD5_OID))
+ sig = Signature.getInstance("md5WithRsaEncryption");
+ else if (hash.equals(SHA1_OID))
+ sig = Signature.getInstance("sha1WithRsaEncryption");
+ else
+ return;
+ }
+ else
+ {
+ if (DEBUG)
+ debug("unsupported signature algorithm: " + alg);
+ return;
+ }
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ if (DEBUG)
+ {
+ debug(nsae);
+ nsae.printStackTrace();
+ }
+ return;
+ }
+ ZipEntry sigFileEntry = super.getEntry(META_INF + alias + SF_SUFFIX);
+ if (sigFileEntry == null)
+ return;
+ for (int i = 0; i < certs.length; i++)
+ {
+ if (!(certs[i] instanceof X509Certificate))
+ continue;
+ X509Certificate cert = (X509Certificate) certs[i];
+ if (!cert.getIssuerX500Principal().equals(signerInfo.getIssuer()) ||
+ !cert.getSerialNumber().equals(signerInfo.getSerialNumber()))
+ continue;
+ try
+ {
+ sig.initVerify(cert.getPublicKey());
+ InputStream in = super.getInputStream(sigFileEntry);
+ if (in == null)
+ continue;
+ byte[] buf = new byte[1024];
+ int len = 0;
+ while ((len = in.read(buf)) != -1)
+ sig.update(buf, 0, len);
+ if (sig.verify(signerInfo.getEncryptedDigest()))
+ {
+ if (DEBUG)
+ debug("signature for " + cert.getSubjectDN() + " is good");
+ validCerts.add(cert);
+ }
+ }
+ catch (IOException ioe)
+ {
+ continue;
+ }
+ catch (InvalidKeyException ike)
+ {
+ continue;
+ }
+ catch (SignatureException se)
+ {
+ continue;
+ }
+ }
+ }
+
+ /**
+ * Verifies that the digest(s) in a signature file were, in fact, made
+ * over the manifest entry for ENTRY.
+ *
+ * @param entry The entry name.
+ * @param attr The attributes from the signature file to verify.
+ */
+ private boolean verifyHashes(String entry, Attributes attr)
+ {
+ int verified = 0;
+
+ // The bytes for ENTRY's manifest entry, which are signed in the
+ // signature file.
+ byte[] entryBytes = null;
+ try
+ {
+ ZipEntry e = super.getEntry(entry);
+ if (e == null)
+ {
+ if (DEBUG)
+ debug("verifyHashes: no entry '" + entry + "'");
+ return false;
+ }
+ entryBytes = readManifestEntry(e);
+ }
+ catch (IOException ioe)
+ {
+ if (DEBUG)
+ {
+ debug(ioe);
+ ioe.printStackTrace();
+ }
+ return false;
+ }
+
+ for (Iterator it = attr.entrySet().iterator(); it.hasNext(); )
+ {
+ Map.Entry e = (Map.Entry) it.next();
+ String key = String.valueOf(e.getKey());
+ if (!key.endsWith(DIGEST_KEY_SUFFIX))
+ continue;
+ String alg = key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length());
+ try
+ {
+ byte[] hash = Base64InputStream.decode((String) e.getValue());
+ MessageDigest md = MessageDigest.getInstance(alg);
+ md.update(entryBytes);
+ byte[] hash2 = md.digest();
+ if (DEBUG)
+ debug("verifying SF entry " + entry + " alg: " + md.getAlgorithm()
+ + " expect=" + new java.math.BigInteger(hash).toString(16)
+ + " comp=" + new java.math.BigInteger(hash2).toString(16));
+ if (!Arrays.equals(hash, hash2))
+ return false;
+ verified++;
+ }
+ catch (IOException ioe)
+ {
+ if (DEBUG)
+ {
+ debug(ioe);
+ ioe.printStackTrace();
+ }
+ return false;
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ if (DEBUG)
+ {
+ debug(nsae);
+ nsae.printStackTrace();
+ }
+ return false;
+ }
+ }
+
+ // We have to find at least one valid digest.
+ return verified > 0;
+ }
+
+ /**
+ * Read the raw bytes that comprise a manifest entry. We can't use the
+ * Manifest object itself, because that loses information (such as line
+ * endings, and order of entries).
+ */
+ private byte[] readManifestEntry(ZipEntry entry) throws IOException
+ {
+ InputStream in = super.getInputStream(super.getEntry(MANIFEST_NAME));
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ byte[] target = ("Name: " + entry.getName()).getBytes();
+ int t = 0, c, prev = -1, state = 0, l = -1;
+
+ while ((c = in.read()) != -1)
+ {
+// if (DEBUG)
+// debug("read "
+// + (c == '\n' ? "\\n" : (c == '\r' ? "\\r" : String.valueOf((char) c)))
+// + " state=" + state + " prev="
+// + (prev == '\n' ? "\\n" : (prev == '\r' ? "\\r" : String.valueOf((char) prev)))
+// + " t=" + t + (t < target.length ? (" target[t]=" + (char) target[t]) : "")
+// + " l=" + l);
+ switch (state)
+ {
+
+ // Step 1: read until we find the "target" bytes: the start
+ // of the entry we need to read.
+ case 0:
+ if (((byte) c) != target[t])
+ t = 0;
+ else
+ {
+ t++;
+ if (t == target.length)
+ {
+ out.write(target);
+ state = 1;
+ }
+ }
+ break;
+
+ // Step 2: assert that there is a newline character after
+ // the "target" bytes.
+ case 1:
+ if (c != '\n' && c != '\r')
+ {
+ out.reset();
+ t = 0;
+ state = 0;
+ }
+ else
+ {
+ out.write(c);
+ state = 2;
+ }
+ break;
+
+ // Step 3: read this whole entry, until we reach an empty
+ // line.
+ case 2:
+ if (c == '\n')
+ {
+ out.write(c);
+ // NL always terminates a line.
+ if (l == 0 || (l == 1 && prev == '\r'))
+ return out.toByteArray();
+ l = 0;
+ }
+ else
+ {
+ // Here we see a blank line terminated by a CR,
+ // followed by the next entry. Technically, `c' should
+ // always be 'N' at this point.
+ if (l == 1 && prev == '\r')
+ return out.toByteArray();
+ out.write(c);
+ l++;
+ }
+ prev = c;
+ break;
+
+ default:
+ throw new RuntimeException("this statement should be unreachable");
+ }
+ }
+
+ // The last entry, with a single CR terminating the line.
+ if (state == 2 && prev == '\r' && l == 0)
+ return out.toByteArray();
+
+ // We should not reach this point, we didn't find the entry (or, possibly,
+ // it is the last entry and is malformed).
+ throw new IOException("could not find " + entry + " in manifest");
+ }
+
+ /**
+ * A utility class that verifies jar entries as they are read.
+ */
+ private static class EntryInputStream extends FilterInputStream
+ {
+ private final JarFile jarfile;
+ private final long length;
+ private long pos;
+ private final ZipEntry entry;
+ private final byte[][] hashes;
+ private final MessageDigest[] md;
+ private boolean checked;
+
+ EntryInputStream(final ZipEntry entry,
+ final InputStream in,
+ final JarFile jar)
+ throws IOException
+ {
+ super(in);
+ this.entry = entry;
+ this.jarfile = jar;
+
+ length = entry.getSize();
+ pos = 0;
+ checked = false;
+
+ Attributes attr;
+ Manifest manifest = jarfile.getManifest();
+ if (manifest != null)
+ attr = manifest.getAttributes(entry.getName());
+ else
+ attr = null;
+ if (DEBUG)
+ debug("verifying entry " + entry + " attr=" + attr);
+ if (attr == null)
+ {
+ hashes = new byte[0][];
+ md = new MessageDigest[0];
+ }
+ else
+ {
+ List hashes = new LinkedList();
+ List md = new LinkedList();
+ for (Iterator it = attr.entrySet().iterator(); it.hasNext(); )
+ {
+ Map.Entry e = (Map.Entry) it.next();
+ String key = String.valueOf(e.getKey());
+ if (key == null)
+ continue;
+ if (!key.endsWith(DIGEST_KEY_SUFFIX))
+ continue;
+ hashes.add(Base64InputStream.decode((String) e.getValue()));
+ try
+ {
+ md.add(MessageDigest.getInstance
+ (key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length())));
+ }
+ catch (NoSuchAlgorithmException nsae)
+ {
+ IOException ioe = new IOException("no such message digest: " + key);
+ ioe.initCause(nsae);
+ throw ioe;
+ }
+ }
+ if (DEBUG)
+ debug("digests=" + md);
+ this.hashes = (byte[][]) hashes.toArray(new byte[hashes.size()][]);
+ this.md = (MessageDigest[]) md.toArray(new MessageDigest[md.size()]);
+ }
+ }
+
+ public boolean markSupported()
+ {
+ return false;
+ }
+
+ public void mark(int readLimit)
+ {
+ }
+
+ public void reset()
+ {
+ }
+
+ public int read() throws IOException
+ {
+ int b = super.read();
+ if (b == -1)
+ {
+ eof();
+ return -1;
+ }
+ for (int i = 0; i < md.length; i++)
+ md[i].update((byte) b);
+ pos++;
+ if (length > 0 && pos >= length)
+ eof();
+ return b;
+ }
+
+ public int read(byte[] buf, int off, int len) throws IOException
+ {
+ int count = super.read(buf, off, (int) Math.min(len, (length != 0
+ ? length - pos
+ : Integer.MAX_VALUE)));
+ if (count == -1 || (length > 0 && pos >= length))
+ {
+ eof();
+ return -1;
+ }
+ for (int i = 0; i < md.length; i++)
+ md[i].update(buf, off, count);
+ pos += count;
+ if (length != 0 && pos >= length)
+ eof();
+ return count;
+ }
+
+ public int read(byte[] buf) throws IOException
+ {
+ return read(buf, 0, buf.length);
+ }
+
+ public long skip(long bytes) throws IOException
+ {
+ byte[] b = new byte[1024];
+ long amount = 0;
+ while (amount < bytes)
+ {
+ int l = read(b, 0, (int) Math.min(b.length, bytes - amount));
+ if (l == -1)
+ break;
+ amount += l;
+ }
+ return amount;
+ }
+
+ private void eof() throws IOException
+ {
+ if (checked)
+ return;
+ checked = true;
+ for (int i = 0; i < md.length; i++)
+ {
+ byte[] hash = md[i].digest();
+ if (DEBUG)
+ debug("verifying " + md[i].getAlgorithm() + " expect="
+ + new java.math.BigInteger(hashes[i]).toString(16)
+ + " comp=" + new java.math.BigInteger(hash).toString(16));
+ if (!Arrays.equals(hash, hashes[i]))
+ {
+ synchronized(jarfile)
+ {
+ if (DEBUG)
+ debug(entry + " could NOT be verified");
+ jarfile.verified.put(entry.getName(), Boolean.FALSE);
+ }
+ return;
+ // XXX ??? what do we do here?
+ // throw new ZipException("message digest mismatch");
+ }
+ }
+
+ synchronized(jarfile)
+ {
+ if (DEBUG)
+ debug(entry + " has been VERIFIED");
+ jarfile.verified.put(entry.getName(), Boolean.TRUE);
+ }
+ }
+ }
}
diff --git a/libjava/java/util/logging/FileHandler.java b/libjava/java/util/logging/FileHandler.java
index 6bbc23c0a9c..ae8eb865ae3 100644
--- a/libjava/java/util/logging/FileHandler.java
+++ b/libjava/java/util/logging/FileHandler.java
@@ -1,5 +1,5 @@
/* FileHandler.java -- a class for publishing log messages to log files
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -403,7 +403,7 @@ public class FileHandler
* the system property <code>"user.home"</code>, <code>"%g"</code>
* by the value of <code>generation</code>, <code>"%u"</code> by the
* value of <code>uniqueNumber</code>, and <code>"%%"</code> by a
- * single percent character. If <code>pattern<code> does
+ * single percent character. If <code>pattern</code> does
* <em>not</em> contain the sequence <code>"%g"</code>,
* the value of <code>generation</code> will be appended to
* the result.
diff --git a/libjava/java/util/logging/Level.java b/libjava/java/util/logging/Level.java
index b121437dd93..5c3c22bf906 100644
--- a/libjava/java/util/logging/Level.java
+++ b/libjava/java/util/logging/Level.java
@@ -1,5 +1,5 @@
/* Level.java -- a class for indicating logging levels
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.util.ResourceBundle;
* purposes, however, applications can sub-class Level in order to define
* custom logging levels.
*
- * @author Sascha Brawer <brawer@acm.org>
+ * @author Sascha Brawer (brawer@acm.org)
*/
public class Level implements Serializable
{
diff --git a/libjava/java/util/logging/Logger.java b/libjava/java/util/logging/Logger.java
index 99c9be9a311..29635558598 100644
--- a/libjava/java/util/logging/Logger.java
+++ b/libjava/java/util/logging/Logger.java
@@ -1,5 +1,5 @@
/* Logger.java -- a class for logging messages
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -1169,17 +1169,5 @@ public class Logger
* That should be the initial caller of a logging method.
* @return caller of the initial looging method
*/
- private StackTraceElement getCallerStackFrame()
- {
- Throwable t = new Throwable();
- StackTraceElement[] stackTrace = t.getStackTrace();
- int index = 0;
- // skip to stackentries until this class
- while(!stackTrace[index].getClassName().equals(getClass().getName())){index++;}
- // skip the stackentries of this class
- while(stackTrace[index].getClassName().equals(getClass().getName())){index++;}
-
- return stackTrace[index];
- }
-
+ private native StackTraceElement getCallerStackFrame();
}
diff --git a/libjava/java/util/prefs/AbstractPreferences.java b/libjava/java/util/prefs/AbstractPreferences.java
index 69f4426e6d3..159a887c831 100644
--- a/libjava/java/util/prefs/AbstractPreferences.java
+++ b/libjava/java/util/prefs/AbstractPreferences.java
@@ -550,6 +550,8 @@ public abstract class AbstractPreferences extends Preferences {
String value;
try {
value = getSpi(key);
+ } catch (ThreadDeath death) {
+ throw death;
} catch (Throwable t) {
value = null;
}
diff --git a/libjava/java/util/prefs/BackingStoreException.java b/libjava/java/util/prefs/BackingStoreException.java
index 2607142d0e8..850825155d9 100644
--- a/libjava/java/util/prefs/BackingStoreException.java
+++ b/libjava/java/util/prefs/BackingStoreException.java
@@ -1,6 +1,6 @@
/* BackingStoreException.java - chained exception thrown when backing store
fails
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import java.io.ObjectOutputStream;
* <p>Note that although this class inherits the Serializable interface, an
* attempt to serialize will fail with a <code>NotSerializableException</code>.
*
- * @author Mark Wielaard <mark@klomp.org>
+ * @author Mark Wielaard (mark@klomp.org)
* @since 1.4
* @status updated to 1.4
*/
diff --git a/libjava/java/util/prefs/InvalidPreferencesFormatException.java b/libjava/java/util/prefs/InvalidPreferencesFormatException.java
index 05996315261..220e1420c52 100644
--- a/libjava/java/util/prefs/InvalidPreferencesFormatException.java
+++ b/libjava/java/util/prefs/InvalidPreferencesFormatException.java
@@ -1,6 +1,6 @@
/* InvalidPreferencesFormatException - indicates reading prefs from stream
failed
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,8 +49,9 @@ import java.io.ObjectOutputStream;
*
* <p>Note that although this class inherits the Serializable interface, an
* attempt to serialize will fail with a <code>NotSerializableException</code>.
+ * </p>
*
- * @author Mark Wielaard <mark@klomp.org>
+ * @author Mark Wielaard (mark@klomp.org)
* @see Preferences
* @since 1.4
* @status updated to 1.4
diff --git a/libjava/java/util/prefs/Preferences.java b/libjava/java/util/prefs/Preferences.java
index c0f0231951f..4186c805a0c 100644
--- a/libjava/java/util/prefs/Preferences.java
+++ b/libjava/java/util/prefs/Preferences.java
@@ -1,5 +1,5 @@
/* Preferences -- Preference node containing key value entries and subnodes
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -234,7 +234,7 @@ public abstract class Preferences {
* The package node name of the object is determined by dropping the
* class name of the object of the fully quallified class name and
* replacing all '.' to '/' in the package name. If the class of the
- * object has no package then the package node name is "<unnamed>".
+ * object has no package then the package node name is "&lt;unnamed&gt;".
* The returened node is <code>systemRoot().node(packageNodeName)</code>.
*
* @param o Object whose default system preference node is requested
@@ -253,7 +253,7 @@ public abstract class Preferences {
* The package node name of the object is determined by dropping the
* class name of the object of the fully quallified class name and
* replacing all '.' to '/' in the package name. If the class of the
- * object has no package then the package node name is "<unnamed>".
+ * object has no package then the package node name is "&lt;unnamed&gt;".
* The returened node is <code>userRoot().node(packageNodeName)</code>.
*
* @param o Object whose default user preference node is requested
diff --git a/libjava/java/util/regex/Matcher.java b/libjava/java/util/regex/Matcher.java
index 994893ad84b..f8c8f1a4a1e 100644
--- a/libjava/java/util/regex/Matcher.java
+++ b/libjava/java/util/regex/Matcher.java
@@ -212,7 +212,10 @@ public final class Matcher
if (match != null)
{
if (match.getStartIndex() == 0)
- return true;
+ {
+ position = match.getEndIndex();
+ return true;
+ }
match = null;
}
return false;
@@ -230,7 +233,13 @@ public final class Matcher
*/
public boolean matches ()
{
- return find(0);
+ if (lookingAt())
+ {
+ if (position == input.length())
+ return true;
+ match = null;
+ }
+ return false;
}
/**
diff --git a/libjava/java/util/regex/Pattern.java b/libjava/java/util/regex/Pattern.java
index fa722cfb9b8..06418a22a34 100644
--- a/libjava/java/util/regex/Pattern.java
+++ b/libjava/java/util/regex/Pattern.java
@@ -198,8 +198,11 @@ public final class Pattern implements Serializable
empties++;
else
{
- while (empties-- > 0)
- list.add("");
+ while (empties > 0)
+ {
+ list.add("");
+ empties--;
+ }
String text = input.subSequence(start, end).toString();
list.add(text);
@@ -222,8 +225,11 @@ public final class Pattern implements Serializable
int max = limit - list.size();
empties = (empties > max) ? max : empties;
}
- while (empties-- > 0)
- list.add("");
+ while (empties > 0)
+ {
+ list.add("");
+ empties--;
+ }
}
// last token at end
diff --git a/libjava/java/util/zip/InflaterInputStream.java b/libjava/java/util/zip/InflaterInputStream.java
index b2c03ced0c8..7c3a211c306 100644
--- a/libjava/java/util/zip/InflaterInputStream.java
+++ b/libjava/java/util/zip/InflaterInputStream.java
@@ -1,5 +1,5 @@
/* InflaterInputStream.java - Input stream filter for decompressing
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -245,4 +245,18 @@ public class InflaterInputStream extends FilterInputStream
return skipped;
}
+
+ public boolean markSupported()
+ {
+ return false;
+ }
+
+ public void mark(int readLimit)
+ {
+ }
+
+ public void reset() throws IOException
+ {
+ throw new IOException("reset not supported");
+ }
}
diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java
index 38ec9e6b565..b2dbe705bbf 100644
--- a/libjava/java/util/zip/ZipFile.java
+++ b/libjava/java/util/zip/ZipFile.java
@@ -1,5 +1,5 @@
/* ZipFile.java --
- Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -117,8 +117,6 @@ public class ZipFile implements ZipConstants
*
* The contents of the zip file will be accessible until it is closed.
*
- * The OPEN_DELETE mode is currently unimplemented in this library
- *
* @since JDK1.3
* @param mode Must be one of OPEN_READ or OPEN_READ | OPEN_DELETE
*
@@ -128,11 +126,10 @@ public class ZipFile implements ZipConstants
*/
public ZipFile(File file, int mode) throws ZipException, IOException
{
+ if (mode != OPEN_READ && mode != (OPEN_READ | OPEN_DELETE))
+ throw new IllegalArgumentException("invalid mode");
if ((mode & OPEN_DELETE) != 0)
- {
- throw new IllegalArgumentException
- ("OPEN_DELETE mode not supported yet in java.util.zip.ZipFile");
- }
+ file.deleteOnExit();
this.raf = new RandomAccessFile(file, "r");
this.name = file.getPath();
}
diff --git a/libjava/javax/accessibility/Accessible.java b/libjava/javax/accessibility/Accessible.java
index 1c407a682f5..e26cf850cb9 100644
--- a/libjava/javax/accessibility/Accessible.java
+++ b/libjava/javax/accessibility/Accessible.java
@@ -1,5 +1,5 @@
/* Accessible.java -- primary Java accessibility interface
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ package javax.accessibility;
* for the Accessibility API which must be implemented by all user
* interface components.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/javax/accessibility/AccessibleAction.java b/libjava/javax/accessibility/AccessibleAction.java
index b05883aa98c..b65fb96a4e4 100644
--- a/libjava/javax/accessibility/AccessibleAction.java
+++ b/libjava/javax/accessibility/AccessibleAction.java
@@ -1,5 +1,5 @@
/* AccessibleAction.java -- aids in accessibly performing actions
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package javax.accessibility;
* <p>The <code>AccessibleContext.getAccessibleAction()</code> method should
* return <code>null</code> if an object does not implement this interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleAction()
diff --git a/libjava/javax/accessibility/AccessibleBundle.java b/libjava/javax/accessibility/AccessibleBundle.java
index 11b9cb38efa..de806709615 100644
--- a/libjava/javax/accessibility/AccessibleBundle.java
+++ b/libjava/javax/accessibility/AccessibleBundle.java
@@ -1,5 +1,5 @@
/* AccessibleBundle.java -- base class for accessibility "enumerations"
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.Locale;
* objects are strongly typed; to make up for the lack of true enums in Java.
* Display should be locale dependent.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see AccessibleRole
* @see AccessibleState
* @since 1.2
diff --git a/libjava/javax/accessibility/AccessibleComponent.java b/libjava/javax/accessibility/AccessibleComponent.java
index 7634eb5ba93..e57d84a2f55 100644
--- a/libjava/javax/accessibility/AccessibleComponent.java
+++ b/libjava/javax/accessibility/AccessibleComponent.java
@@ -1,5 +1,5 @@
/* AccessibleComponent.java -- aids in accessibly rendering Java components
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -56,7 +56,7 @@ import java.awt.event.FocusListener;
* should return <code>null</code> if an object does not implement this
* interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleComponent()
diff --git a/libjava/javax/accessibility/AccessibleContext.java b/libjava/javax/accessibility/AccessibleContext.java
index 18679d4a4f5..582bd28e926 100644
--- a/libjava/javax/accessibility/AccessibleContext.java
+++ b/libjava/javax/accessibility/AccessibleContext.java
@@ -55,7 +55,7 @@ import java.util.Locale;
* <li>{@link AccessibleValue} - the object represents a numerical value</li>
* </ul>
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/javax/accessibility/AccessibleEditableText.java b/libjava/javax/accessibility/AccessibleEditableText.java
index e1ffb617a2f..ae1ef23f8cc 100644
--- a/libjava/javax/accessibility/AccessibleEditableText.java
+++ b/libjava/javax/accessibility/AccessibleEditableText.java
@@ -1,5 +1,5 @@
/* AccessibleEditableText.java -- aids in accessibly for editable text
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ import javax.swing.text.AttributeSet;
* should return <code>null</code> if an object does not implement this
* interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleText()
diff --git a/libjava/javax/accessibility/AccessibleExtendedComponent.java b/libjava/javax/accessibility/AccessibleExtendedComponent.java
index d57de19745f..230c73972df 100644
--- a/libjava/javax/accessibility/AccessibleExtendedComponent.java
+++ b/libjava/javax/accessibility/AccessibleExtendedComponent.java
@@ -1,5 +1,5 @@
/* AccessibleExtendedComponent.java -- aids in extended component access
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package javax.accessibility;
* <p>The <code>AccessibleContext.getAccessibleComponent()</code> method
* should return an instance of this interface only when it is supported.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleComponent()
diff --git a/libjava/javax/accessibility/AccessibleExtendedTable.java b/libjava/javax/accessibility/AccessibleExtendedTable.java
index 627b0242825..f7c237db6b4 100644
--- a/libjava/javax/accessibility/AccessibleExtendedTable.java
+++ b/libjava/javax/accessibility/AccessibleExtendedTable.java
@@ -1,5 +1,5 @@
/* AccessibleExtendedTable.java -- aids in extended table access
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ package javax.accessibility;
* <p>The <code>AccessibleContext.getAccessibleTable()</code> method
* should return an instance of this interface only when it is supported.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleTable()
diff --git a/libjava/javax/accessibility/AccessibleHyperlink.java b/libjava/javax/accessibility/AccessibleHyperlink.java
index 0503f2a14ef..663f30af017 100644
--- a/libjava/javax/accessibility/AccessibleHyperlink.java
+++ b/libjava/javax/accessibility/AccessibleHyperlink.java
@@ -1,5 +1,5 @@
/* AccessibleHyperlink.java -- aids in accessibly navigating hypertext
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.accessibility;
/**
* This object encapsulates actions associated with navigating hypertext.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleText
diff --git a/libjava/javax/accessibility/AccessibleHypertext.java b/libjava/javax/accessibility/AccessibleHypertext.java
index ae0d150bd02..b10fb9af115 100644
--- a/libjava/javax/accessibility/AccessibleHypertext.java
+++ b/libjava/javax/accessibility/AccessibleHypertext.java
@@ -1,5 +1,5 @@
/* AccessibleHypertext.java -- aids in accessibly rendering hypertext
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package javax.accessibility;
* <p>The <code>AccessibleContext.getAccessibleText()</code> method
* should return an instance of this interface only when it is supported.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleText
diff --git a/libjava/javax/accessibility/AccessibleIcon.java b/libjava/javax/accessibility/AccessibleIcon.java
index c13b14009b9..b1e5dde41f5 100644
--- a/libjava/javax/accessibility/AccessibleIcon.java
+++ b/libjava/javax/accessibility/AccessibleIcon.java
@@ -1,5 +1,5 @@
/* AccessibleIcon.java -- aids in accessibly rendering icons
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package javax.accessibility;
* <p>The <code>AccessibleContext.getAccessibleIcon()</code> method should
* return <code>null</code> if an object does not implement this interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleIcon()
diff --git a/libjava/javax/accessibility/AccessibleKeyBinding.java b/libjava/javax/accessibility/AccessibleKeyBinding.java
index 777f8b734d6..16d7e36e594 100644
--- a/libjava/javax/accessibility/AccessibleKeyBinding.java
+++ b/libjava/javax/accessibility/AccessibleKeyBinding.java
@@ -1,5 +1,5 @@
/* AccessibleKeyBinding.java -- aids in using keyboard navigation
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ package javax.accessibility;
* should return <code>null</code> if an object does not implement this
* interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleKeyBinding()
diff --git a/libjava/javax/accessibility/AccessibleRelation.java b/libjava/javax/accessibility/AccessibleRelation.java
index 68f1f646a59..d77a90a3d36 100644
--- a/libjava/javax/accessibility/AccessibleRelation.java
+++ b/libjava/javax/accessibility/AccessibleRelation.java
@@ -44,7 +44,7 @@ package javax.accessibility;
* supports localized strings. If the constants of this class are not
* adequate, new ones may be added in a similar matter.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/javax/accessibility/AccessibleRelationSet.java b/libjava/javax/accessibility/AccessibleRelationSet.java
index 27dc58da3c3..767aa0647bb 100644
--- a/libjava/javax/accessibility/AccessibleRelationSet.java
+++ b/libjava/javax/accessibility/AccessibleRelationSet.java
@@ -43,7 +43,7 @@ import java.util.Vector;
* Describes all relations of an accessible object. For example, an object
* by labeled by one object and control another.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see AccessibleRelation
* @since 1.2
* @status updated to 1.4
diff --git a/libjava/javax/accessibility/AccessibleResourceBundle.java b/libjava/javax/accessibility/AccessibleResourceBundle.java
index 01c2bcfdf98..b34dd73b09f 100644
--- a/libjava/javax/accessibility/AccessibleResourceBundle.java
+++ b/libjava/javax/accessibility/AccessibleResourceBundle.java
@@ -1,5 +1,5 @@
/* AccessibleResourceBundle.java -- deprecated class
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.ListResourceBundle;
* This class is deprecated. It once was used for localizing accessibility
* strings, and was never meant for external use anyway.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see AccessibleBundle.toDisplayString(String, Locale)
* @since 1.2
* @deprecated this class is no longer used
diff --git a/libjava/javax/accessibility/AccessibleRole.java b/libjava/javax/accessibility/AccessibleRole.java
index 86bfa6d382d..34f75602b14 100644
--- a/libjava/javax/accessibility/AccessibleRole.java
+++ b/libjava/javax/accessibility/AccessibleRole.java
@@ -43,7 +43,7 @@ package javax.accessibility;
* the constants of this class are not adequate, new ones may be added in a
* similar matter, while avoiding a public constructor.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/javax/accessibility/AccessibleSelection.java b/libjava/javax/accessibility/AccessibleSelection.java
index d1e8c7c2a46..ad52ebc7365 100644
--- a/libjava/javax/accessibility/AccessibleSelection.java
+++ b/libjava/javax/accessibility/AccessibleSelection.java
@@ -1,5 +1,5 @@
/* AccessibleSelection.java -- aids in accessibly selecting components
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package javax.accessibility;
* <p>The <code>AccessibleContext.getAccessibleSelection()</code> method should
* return <code>null</code> if an object does not implement this interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleSelection()
diff --git a/libjava/javax/accessibility/AccessibleState.java b/libjava/javax/accessibility/AccessibleState.java
index 24005ae9a6e..74e5d08a0f4 100644
--- a/libjava/javax/accessibility/AccessibleState.java
+++ b/libjava/javax/accessibility/AccessibleState.java
@@ -44,7 +44,7 @@ package javax.accessibility;
* localized strings. If the constants of this class are not adequate, new
* ones may be added in a similar matter, while avoiding a public constructor.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @since 1.2
* @status updated to 1.4
*/
diff --git a/libjava/javax/accessibility/AccessibleStateSet.java b/libjava/javax/accessibility/AccessibleStateSet.java
index e1b112abf79..06218f3f95b 100644
--- a/libjava/javax/accessibility/AccessibleStateSet.java
+++ b/libjava/javax/accessibility/AccessibleStateSet.java
@@ -43,7 +43,7 @@ import java.util.Vector;
* Describes all elements of an accessible object's state. For example, an
* object may be enabled and have focus.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see AccessibleState
* @since 1.2
* @status updated to 1.4
diff --git a/libjava/javax/accessibility/AccessibleTable.java b/libjava/javax/accessibility/AccessibleTable.java
index 4fd58c5a237..c008f455ed1 100644
--- a/libjava/javax/accessibility/AccessibleTable.java
+++ b/libjava/javax/accessibility/AccessibleTable.java
@@ -1,5 +1,5 @@
/* AccessibleTable.java -- aids in accessibly manipulating tables
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package javax.accessibility;
* should return <code>null</code> if an object does not implement this
* interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleTable()
diff --git a/libjava/javax/accessibility/AccessibleTableModelChange.java b/libjava/javax/accessibility/AccessibleTableModelChange.java
index 9cff7bfa749..0001a612a33 100644
--- a/libjava/javax/accessibility/AccessibleTableModelChange.java
+++ b/libjava/javax/accessibility/AccessibleTableModelChange.java
@@ -1,5 +1,5 @@
/* AccessibleTableModelChange.java -- describes change to an accessible table
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ package javax.accessibility;
* the implementations of this interface to update their state after a
* change to a table.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleTable()
diff --git a/libjava/javax/accessibility/AccessibleText.java b/libjava/javax/accessibility/AccessibleText.java
index 7c3d9a9ccd6..cffabe4545d 100644
--- a/libjava/javax/accessibility/AccessibleText.java
+++ b/libjava/javax/accessibility/AccessibleText.java
@@ -1,5 +1,5 @@
/* AccessibleText.java -- aids in accessibly manipulating text
- Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ import javax.swing.text.AttributeSet;
* should return <code>null</code> if an object does not implement this
* interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleText()
diff --git a/libjava/javax/accessibility/AccessibleValue.java b/libjava/javax/accessibility/AccessibleValue.java
index 69da5c8a4eb..a58e9ed1d57 100644
--- a/libjava/javax/accessibility/AccessibleValue.java
+++ b/libjava/javax/accessibility/AccessibleValue.java
@@ -1,5 +1,5 @@
/* AccessibleValue.java -- aids in accessibly controlling values
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package javax.accessibility;
* <p>The <code>AccessibleContext.getAccessibleValue()</code> method should
* return <code>null</code> if an object does not implement this interface.
*
- * @author Eric Blake <ebb9@email.byu.edu>
+ * @author Eric Blake (ebb9@email.byu.edu)
* @see Accessible
* @see AccessibleContext
* @see AccessibleContext#getAccessibleValue()
diff --git a/libjava/javax/crypto/SecretKey.java b/libjava/javax/crypto/SecretKey.java
index ce7057e7092..3865db4a6d1 100644
--- a/libjava/javax/crypto/SecretKey.java
+++ b/libjava/javax/crypto/SecretKey.java
@@ -61,4 +61,5 @@ import java.security.Key;
*/
public interface SecretKey extends Key
{
+ long serialVersionUID = -4795878709595146952L;
}
diff --git a/libjava/javax/imageio/IIOException.java b/libjava/javax/imageio/IIOException.java
index 5b743963a95..490c8c555c9 100644
--- a/libjava/javax/imageio/IIOException.java
+++ b/libjava/javax/imageio/IIOException.java
@@ -1,5 +1,5 @@
/* IIOException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ import java.io.IOException;
/**
- * @author Michael Koch <konqueror@gmx.de>
+ * @author Michael Koch (konqueror@gmx.de)
*/
public class IIOException extends IOException
{
diff --git a/libjava/javax/imageio/IIOParam.java b/libjava/javax/imageio/IIOParam.java
index bbab1cf79f6..1a59123995f 100644
--- a/libjava/javax/imageio/IIOParam.java
+++ b/libjava/javax/imageio/IIOParam.java
@@ -141,6 +141,11 @@ public abstract class IIOParam
this.destinationOffset = destinationOffset;
}
+ public void setSourceBands(int[] sourceBands)
+ {
+ this.sourceBands = sourceBands;
+ }
+
public void setSourceRegion(Rectangle sourceRegion)
{
if (sourceRegion != null
@@ -154,4 +159,13 @@ public abstract class IIOParam
this.sourceRegion = sourceRegion;
}
+
+ public void setSourceSubsampling(int sourceXSubsampling, int sourceYSubsampling,
+ int subsamplingXOffset, int subsamplingYOffset)
+ {
+ this.sourceXSubsampling = sourceXSubsampling;
+ this.sourceYSubsampling = sourceYSubsampling;
+ this.subsamplingXOffset = subsamplingXOffset;
+ this.subsamplingYOffset = subsamplingYOffset;
+ }
}
diff --git a/libjava/javax/imageio/ImageIO.java b/libjava/javax/imageio/ImageIO.java
index 6aa5558919c..7afb7207a79 100644
--- a/libjava/javax/imageio/ImageIO.java
+++ b/libjava/javax/imageio/ImageIO.java
@@ -1,5 +1,5 @@
/* ImageIO.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,8 +38,15 @@ exception statement from your version. */
package javax.imageio;
+import java.awt.image.BufferedImage;
+import java.awt.image.RenderedImage;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -48,6 +55,10 @@ import javax.imageio.spi.IIORegistry;
import javax.imageio.spi.ImageReaderSpi;
import javax.imageio.spi.ImageWriterSpi;
import javax.imageio.spi.ServiceRegistry;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.stream.ImageOutputStream;
+import javax.imageio.stream.MemoryCacheImageInputStream;
+import javax.imageio.stream.MemoryCacheImageOutputStream;
public final class ImageIO
{
@@ -142,14 +153,14 @@ public final class ImageIO
public boolean filter(Object provider)
{
- if (provider instanceof ImageReaderSpi)
+ if (provider instanceof ImageWriterSpi)
{
- ImageReaderSpi spi = (ImageReaderSpi) provider;
+ ImageWriterSpi spi = (ImageWriterSpi) provider;
String[] formatNames = spi.getFormatNames();
for (int i = formatNames.length - 1; i >= 0; --i)
- if (formatName.equals(formatNames[i]))
- return true;
+ if (formatName.equals(formatNames[i]))
+ return true;
}
return false;
@@ -167,7 +178,7 @@ public final class ImageIO
public boolean filter(Object provider)
{
- if (provider instanceof ImageReaderSpi)
+ if (provider instanceof ImageWriterSpi)
{
ImageWriterSpi spi = (ImageWriterSpi) provider;
String[] mimetypes = spi.getMIMETypes();
@@ -192,7 +203,7 @@ public final class ImageIO
public boolean filter(Object provider)
{
- if (provider instanceof ImageReaderSpi)
+ if (provider instanceof ImageWriterSpi)
{
ImageWriterSpi spi = (ImageWriterSpi) provider;
String[] suffixes = spi.getFileSuffixes();
@@ -209,10 +220,12 @@ public final class ImageIO
private static final class ImageReaderIterator implements Iterator
{
Iterator it;
+ Object readerExtension;
- public ImageReaderIterator(Iterator it)
+ public ImageReaderIterator(Iterator it, Object readerExtension)
{
this.it = it;
+ this.readerExtension = readerExtension;
}
public boolean hasNext()
@@ -224,7 +237,7 @@ public final class ImageIO
{
try
{
- return ((ImageReaderSpi) it.next()).createReaderInstance();
+ return ((ImageReaderSpi) it.next()).createReaderInstance(readerExtension);
}
catch (IOException e)
{
@@ -241,10 +254,12 @@ public final class ImageIO
private static final class ImageWriterIterator implements Iterator
{
Iterator it;
+ Object writerExtension;
- public ImageWriterIterator(Iterator it)
+ public ImageWriterIterator(Iterator it, Object writerExtension)
{
this.it = it;
+ this.writerExtension = writerExtension;
}
public boolean hasNext()
@@ -256,7 +271,7 @@ public final class ImageIO
{
try
{
- return ((ImageWriterSpi) it.next()).createWriterInstance();
+ return ((ImageWriterSpi) it.next()).createWriterInstance(writerExtension);
}
catch (IOException e)
{
@@ -274,12 +289,13 @@ public final class ImageIO
private static boolean useCache = true;
private static Iterator getReadersByFilter(Class type,
- ServiceRegistry.Filter filter)
+ ServiceRegistry.Filter filter,
+ Object readerExtension)
{
try
{
Iterator it = getRegistry().getServiceProviders(type, filter, true);
- return new ImageReaderIterator(it);
+ return new ImageReaderIterator(it, readerExtension);
}
catch (IllegalArgumentException e)
{
@@ -288,12 +304,13 @@ public final class ImageIO
}
private static Iterator getWritersByFilter(Class type,
- ServiceRegistry.Filter filter)
+ ServiceRegistry.Filter filter,
+ Object writerExtension)
{
try
{
Iterator it = getRegistry().getServiceProviders(type, filter, true);
- return new ImageWriterIterator(it);
+ return new ImageWriterIterator(it, writerExtension);
}
catch (IllegalArgumentException e)
{
@@ -312,7 +329,8 @@ public final class ImageIO
throw new IllegalArgumentException("formatName may not be null");
return getReadersByFilter(ImageReaderSpi.class,
- new ReaderFormatFilter(formatName));
+ new ReaderFormatFilter(formatName),
+ formatName);
}
public static Iterator getImageReadersByMIMEType(String MIMEType)
@@ -321,7 +339,8 @@ public final class ImageIO
throw new IllegalArgumentException("MIMEType may not be null");
return getReadersByFilter(ImageReaderSpi.class,
- new ReaderMIMETypeFilter(MIMEType));
+ new ReaderMIMETypeFilter(MIMEType),
+ MIMEType);
}
public static Iterator getImageReadersBySuffix(String fileSuffix)
@@ -330,7 +349,8 @@ public final class ImageIO
throw new IllegalArgumentException("formatName may not be null");
return getReadersByFilter(ImageReaderSpi.class,
- new ReaderSuffixFilter(fileSuffix));
+ new ReaderSuffixFilter(fileSuffix),
+ fileSuffix);
}
public static Iterator getImageWritersByFormatName(String formatName)
@@ -339,7 +359,8 @@ public final class ImageIO
throw new IllegalArgumentException("formatName may not be null");
return getWritersByFilter(ImageWriterSpi.class,
- new WriterFormatFilter(formatName));
+ new WriterFormatFilter(formatName),
+ formatName);
}
public static Iterator getImageWritersByMIMEType(String MIMEType)
@@ -348,7 +369,8 @@ public final class ImageIO
throw new IllegalArgumentException("MIMEType may not be null");
return getWritersByFilter(ImageWriterSpi.class,
- new WriterMIMETypeFilter(MIMEType));
+ new WriterMIMETypeFilter(MIMEType),
+ MIMEType);
}
public static Iterator getImageWritersBySuffix(String fileSuffix)
@@ -357,7 +379,8 @@ public final class ImageIO
throw new IllegalArgumentException("fileSuffix may not be null");
return getWritersByFilter(ImageWriterSpi.class,
- new WriterSuffixFilter(fileSuffix));
+ new WriterSuffixFilter(fileSuffix),
+ fileSuffix);
}
public static String[] getReaderFormatNames()
@@ -496,4 +519,87 @@ public final class ImageIO
{
ImageIO.useCache = useCache;
}
+
+ /*
+ * "Standard" simplified entry points.
+ */
+
+ public static boolean write(RenderedImage im,
+ String formatName,
+ File output)
+ throws IOException
+ {
+ return write(im, formatName, new FileOutputStream(output));
+ }
+
+ public static boolean write(RenderedImage im,
+ String formatName,
+ OutputStream output)
+ throws IOException
+ {
+ return write(im, formatName, new MemoryCacheImageOutputStream(output));
+ }
+
+
+ public static boolean write(RenderedImage im,
+ String formatName,
+ ImageOutputStream output)
+ throws IOException
+ {
+ Iterator writers = getImageWritersByFormatName(formatName);
+ IIOImage img = new IIOImage(im, null, null);
+ while (writers.hasNext())
+ {
+ ImageWriter w = (ImageWriter) writers.next();
+ try
+ {
+ w.setOutput(output);
+ }
+ catch (IllegalArgumentException e)
+ {
+ continue;
+ }
+
+ w.write(null, img, null);
+ output.close();
+ return true;
+ }
+ return false;
+ }
+
+ public static BufferedImage read(ImageInputStream stream)
+ throws IOException
+ {
+ Iterator providers = getRegistry().getServiceProviders(ImageReaderSpi.class, true);
+ while (providers.hasNext())
+ {
+ ImageReaderSpi spi = (ImageReaderSpi) providers.next();
+ if (spi.canDecodeInput(stream))
+ {
+ ImageReader reader = spi.createReaderInstance();
+ reader.setInput(stream);
+ return reader.read(0, null);
+ }
+ }
+ return null;
+ }
+
+ public static BufferedImage read(URL input)
+ throws IOException
+ {
+ return read(input.openStream());
+ }
+
+ public static BufferedImage read(InputStream input)
+ throws IOException
+ {
+ return read(new MemoryCacheImageInputStream(input));
+ }
+
+ public static BufferedImage read(File input)
+ throws IOException
+ {
+ return read(new FileInputStream(input));
+ }
+
}
diff --git a/libjava/javax/imageio/ImageReadParam.java b/libjava/javax/imageio/ImageReadParam.java
index e5414bda17e..4192c563b14 100644
--- a/libjava/javax/imageio/ImageReadParam.java
+++ b/libjava/javax/imageio/ImageReadParam.java
@@ -94,6 +94,22 @@ public class ImageReadParam extends IIOParam
{
return sourceRenderSize;
}
+
+ public void setDestination(BufferedImage destination)
+ {
+ this.destination = destination;
+ }
+
+ public void setDestinationBands(int[] destinationBands)
+ {
+ this.destinationBands = destinationBands;
+ }
+
+ public void setSourceProgressivePasses(int minPass, int numPasses)
+ {
+ this.minProgressivePass = minPass;
+ this.numProgressivePasses = numPasses;
+ }
public void setSourceRenderSize(Dimension size)
throws UnsupportedOperationException
diff --git a/libjava/javax/imageio/ImageReader.java b/libjava/javax/imageio/ImageReader.java
index 91cb53cd8b4..6e5a1b2d87e 100644
--- a/libjava/javax/imageio/ImageReader.java
+++ b/libjava/javax/imageio/ImageReader.java
@@ -51,6 +51,7 @@ import javax.imageio.event.IIOReadUpdateListener;
import javax.imageio.event.IIOReadWarningListener;
import javax.imageio.metadata.IIOMetadata;
import javax.imageio.spi.ImageReaderSpi;
+import javax.imageio.stream.ImageInputStream;
public abstract class ImageReader
{
@@ -62,7 +63,7 @@ public abstract class ImageReader
protected Locale locale;
protected int minIndex;
protected ImageReaderSpi originatingProvider;
- protected List progressListeners;
+ protected List progressListeners = new ArrayList();
protected boolean seekForwardOnly;
protected List updateListeners = new ArrayList();
protected List warningListeners = new ArrayList();
@@ -156,6 +157,42 @@ public abstract class ImageReader
public abstract Iterator getImageTypes(int imageIndex)
throws IOException;
+ public void setInput(Object input,
+ boolean seekForwardOnly,
+ boolean ignoreMetadata)
+ {
+ Class[] okClasses = originatingProvider.getInputTypes();
+ if (okClasses == null)
+ {
+ if (!(input instanceof ImageInputStream))
+ throw new IllegalArgumentException();
+ }
+ else
+ {
+ boolean classOk = false;
+ for (int i = 0; i < okClasses.length; ++i)
+ if (okClasses[i].isInstance(input))
+ classOk = true;
+ if (!classOk)
+ throw new IllegalArgumentException();
+ }
+
+ this.input = input;
+ this.seekForwardOnly = seekForwardOnly;
+ this.ignoreMetadata = ignoreMetadata;
+ this.minIndex = 0;
+ }
+
+ public void setInput(Object in, boolean seekForwardOnly)
+ {
+ setInput(in, seekForwardOnly, false);
+ }
+
+ public void setInput(Object in)
+ {
+ setInput(in, false, false);
+ }
+
public Object getInput()
{
return input;
diff --git a/libjava/javax/imageio/ImageWriter.java b/libjava/javax/imageio/ImageWriter.java
index 64466b151f0..389ca4360a7 100644
--- a/libjava/javax/imageio/ImageWriter.java
+++ b/libjava/javax/imageio/ImageWriter.java
@@ -40,6 +40,7 @@ package javax.imageio;
import java.awt.Dimension;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -59,9 +60,9 @@ public abstract class ImageWriter
protected Locale locale;
protected ImageWriterSpi originatingProvider;
protected Object output;
- protected List progressListeners;
- protected List warningListeners;
- protected List warningLocales;
+ protected List progressListeners = new ArrayList();
+ protected List warningListeners = new ArrayList();
+ protected List warningLocales = new ArrayList();
protected ImageWriter(ImageWriterSpi originatingProvider)
{
@@ -371,11 +372,11 @@ public abstract class ImageWriter
if (originatingProvider != null)
types = originatingProvider.getOutputTypes();
-
+
if (types != null)
for (int i = types.length - 1; i >= 0; --i)
- if (types[i].equals(output.getClass()))
- found = true;
+ if (types[i].isInstance(output))
+ found = true;
if (! found)
throw new IllegalArgumentException("output type not available");
diff --git a/libjava/javax/imageio/metadata/IIOInvalidTreeException.java b/libjava/javax/imageio/metadata/IIOInvalidTreeException.java
index c3ce42482c6..af84f0732c2 100644
--- a/libjava/javax/imageio/metadata/IIOInvalidTreeException.java
+++ b/libjava/javax/imageio/metadata/IIOInvalidTreeException.java
@@ -40,23 +40,28 @@ package javax.imageio.metadata;
import javax.imageio.IIOException;
+import org.w3c.dom.Node;
+
public class IIOInvalidTreeException extends IIOException
{
- protected /*Node*/ Object offendingNode;
+ private static final long serialVersionUID = -1314083172544132777L;
+
+ protected Node offendingNode;
- public IIOInvalidTreeException(String message, /*Node*/ Object offendingNode)
+ public IIOInvalidTreeException(String message, Node offendingNode)
{
super(message);
this.offendingNode = offendingNode;
}
- public IIOInvalidTreeException(String message, Throwable cause, /*Node*/ Object offendingNode)
+ public IIOInvalidTreeException(String message, Throwable cause,
+ Node offendingNode)
{
super(message, cause);
this.offendingNode = offendingNode;
}
- public /*Node*/ Object getOffendingNode()
+ public Node getOffendingNode()
{
return offendingNode;
}
diff --git a/libjava/javax/imageio/metadata/IIOMetadataNode.java b/libjava/javax/imageio/metadata/IIOMetadataNode.java
index 3d1c7d26742..609db4d7823 100644
--- a/libjava/javax/imageio/metadata/IIOMetadataNode.java
+++ b/libjava/javax/imageio/metadata/IIOMetadataNode.java
@@ -38,6 +38,555 @@ exception statement from your version. */
package javax.imageio.metadata;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.TypeInfo;
+import org.w3c.dom.UserDataHandler;
+
public class IIOMetadataNode
+ implements Element, NodeList
{
+ private String name;
+ private HashMap attrs = new HashMap();
+ private List children = new ArrayList();
+ private IIOMetadataNode parent;
+ private Object obj;
+
+ public IIOMetadataNode()
+ {
+ // Do nothing here.
+ }
+
+ public IIOMetadataNode(String nodename)
+ {
+ name = nodename;
+ }
+
+ public Object getUserObject()
+ {
+ return obj;
+ }
+
+ public void setUserObject(Object o)
+ {
+ obj = o;
+ }
+
+ public short compareDocumentPosition(Node other)
+ throws DOMException
+ {
+ throw new Error("not implemented");
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#getAttribute(java.lang.String)
+ */
+ public String getAttribute(String name)
+ {
+ Attr anode = (Attr) attrs.get(name);
+ return anode != null ? anode.getValue() : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#getAttributeNode(java.lang.String)
+ */
+ public Attr getAttributeNode(String name)
+ {
+ String val = getAttribute(name);
+ if (val != null)
+ return new IIOAttr(name, val, this);
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#getAttributeNodeNS(java.lang.String, java.lang.String)
+ */
+ public Attr getAttributeNodeNS(String namespaceURI, String localName)
+ {
+ return getAttributeNode(localName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#getAttributeNS(java.lang.String, java.lang.String)
+ */
+ public String getAttributeNS(String namespaceURI, String localName)
+ {
+ return getAttribute(localName);
+ }
+
+ public String getBaseURI()
+ {
+ throw new Error("not implemented");
+ }
+
+ // Recursive function for assembling a node list.
+ private void getElementsRecurse(IIONodeList list, String name)
+ {
+ for (int i=0; i < children.size(); i++)
+ {
+ if (((Node)children.get(i)).getNodeName().equals(name))
+ list.children.add(children.get(i));
+ getElementsRecurse(list, name);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String)
+ */
+ public NodeList getElementsByTagName(String name)
+ {
+ IIONodeList list = new IIONodeList();
+ getElementsRecurse(list, name);
+ return list;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#getElementsByTagNameNS(java.lang.String, java.lang.String)
+ */
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
+ {
+ IIONodeList list = new IIONodeList();
+ getElementsRecurse(list, name);
+ return list;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#getTagName()
+ */
+ public String getTagName()
+ {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#hasAttribute(java.lang.String)
+ */
+ public boolean hasAttribute(String name)
+ {
+ return attrs.containsKey(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#hasAttributeNS(java.lang.String, java.lang.String)
+ */
+ public boolean hasAttributeNS(String namespaceURI, String localName)
+ {
+ return attrs.containsKey(localName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#removeAttribute(java.lang.String)
+ */
+ public void removeAttribute(String name)
+ {
+ attrs.remove(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#removeAttributeNode(org.w3c.dom.Attr)
+ */
+ public Attr removeAttributeNode(Attr oldAttr)
+ {
+ return (Attr)attrs.remove(oldAttr.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#removeAttributeNS(java.lang.String, java.lang.String)
+ */
+ public void removeAttributeNS(String namespaceURI, String localName)
+ {
+ removeAttribute(localName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#setAttribute(java.lang.String, java.lang.String)
+ */
+ public void setAttribute(String name, String value)
+ {
+ Attr attr = (Attr) getAttributeNode(name);
+ if (attr != null)
+ attr.setValue(value);
+ else
+ attrs.put(name, new IIOAttr(name, value, this));
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#setAttributeNode(org.w3c.dom.Attr)
+ */
+ public Attr setAttributeNode(Attr newAttr)
+ {
+ return (Attr)attrs.put(newAttr.getName(), newAttr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr)
+ */
+ public Attr setAttributeNodeNS(Attr newAttr)
+ {
+ return (Attr)attrs.put(newAttr.getName(), newAttr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Element#setAttributeNS(java.lang.String, java.lang.String, java.lang.String)
+ */
+ public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
+ {
+ setAttribute(qualifiedName, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.NodeList#getLength()
+ */
+ public int getLength()
+ {
+ return children.size();
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.NodeList#item(int)
+ */
+ public Node item(int index)
+ {
+ if (index < children.size())
+ return (Node)children.get(index);
+ else
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node)
+ */
+ public Node appendChild(Node newChild)
+ {
+ if (newChild == null)
+ throw new IllegalArgumentException("Child node is null");
+
+ IIOMetadataNode child = (IIOMetadataNode) newChild;
+
+ children.add(child);
+ child.parent = this;
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#cloneNode(boolean)
+ */
+ public Node cloneNode(boolean deep)
+ {
+ IIOMetadataNode newnode = new IIOMetadataNode(name);
+ newnode.parent = null;
+ newnode.obj = obj;
+ if (deep)
+ {
+ for (int i=0; i < children.size(); i++)
+ newnode.children.add(((Node)children.get(i)).cloneNode(deep));
+ }
+
+ // clone attrs
+ for (Iterator it = attrs.values().iterator(); it.hasNext();)
+ {
+ IIOAttr attr = (IIOAttr)it.next();
+ newnode.attrs.put(attr.name, attr.cloneNode(deep));
+ attr.owner = newnode;
+ }
+
+ return newnode;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getAttributes()
+ */
+ public NamedNodeMap getAttributes()
+ {
+ return new IIONamedNodeMap(attrs);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getChildNodes()
+ */
+ public NodeList getChildNodes()
+ {
+ return this;
+ }
+
+ public Object getFeature(String feature, String version)
+ {
+ throw new Error("not implemented");
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getFirstChild()
+ */
+ public Node getFirstChild()
+ {
+ return (children.size() > 0) ? (Node)children.get(0) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getLastChild()
+ */
+ public Node getLastChild()
+ {
+ return (children.size() > 0) ? (Node)children.get(children.size() - 1)
+ : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getLocalName()
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getNamespaceURI()
+ */
+ public String getNamespaceURI()
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getNextSibling()
+ */
+ public Node getNextSibling()
+ {
+ // If this op needs to be faster, add links to prev and next nodes.
+ if (parent == null) return null;
+ int idx = parent.children.indexOf(this);
+ return (idx == parent.children.size() - 1) ? null
+ : (Node)parent.children.get(idx + 1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getNodeName()
+ */
+ public String getNodeName()
+ {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getNodeType()
+ */
+ public short getNodeType()
+ {
+ return ELEMENT_NODE;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getNodeValue()
+ */
+ public String getNodeValue()
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getOwnerDocument()
+ */
+ public Document getOwnerDocument()
+ {
+ // IOMetadataNodes have no owner
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getParentNode()
+ */
+ public Node getParentNode()
+ {
+ return parent;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getPrefix()
+ */
+ public String getPrefix()
+ {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#getPreviousSibling()
+ */
+ public Node getPreviousSibling()
+ {
+ // If this op needs to be faster, add links to prev and next nodes.
+ if (parent == null) return null;
+ int idx = parent.children.indexOf(this);
+ return (idx == 0) ? null
+ : (Node)parent.children.get(idx - 1);
+ }
+
+ public TypeInfo getSchemaTypeInfo()
+ {
+ throw new Error("not implemented");
+ }
+
+ public String getTextContent()
+ throws DOMException
+ {
+ throw new Error("not implemented");
+ }
+
+ public Object getUserData(String key)
+ {
+ throw new Error("not implemented");
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#hasAttributes()
+ */
+ public boolean hasAttributes()
+ {
+ return !attrs.isEmpty();
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#hasChildNodes()
+ */
+ public boolean hasChildNodes()
+ {
+ return !children.isEmpty();
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
+ */
+ public Node insertBefore(Node newChild, Node refChild)
+ {
+ if (newChild == null)
+ throw new IllegalArgumentException();
+
+ int idx = children.indexOf(refChild);
+ if (idx == -1)
+ children.add(newChild);
+ else
+ children.add(idx, newChild);
+ ((IIOMetadataNode)newChild).parent = this;
+
+ return newChild;
+ }
+
+ public boolean isDefaultNamespace(String namespaceURI)
+ {
+ throw new Error("not implemented");
+ }
+
+ public boolean isEqualNode(Node arg)
+ {
+ throw new Error("not implemented");
+ }
+
+ public boolean isSameNode(Node other)
+ {
+ return this == other;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String)
+ */
+ public boolean isSupported(String feature, String version)
+ {
+ // No DOM features are supported
+ return false;
+ }
+
+ public String lookupNamespaceURI(String prefix)
+ {
+ throw new Error("not implemented");
+ }
+
+ public String lookupPrefix(String namespaceURI)
+ {
+ throw new Error("not implemented");
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#normalize()
+ */
+ public void normalize()
+ {
+ // No text nodes so no action
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#removeChild(org.w3c.dom.Node)
+ */
+ public Node removeChild(Node oldChild)
+ {
+ if (oldChild == null)
+ throw new IllegalArgumentException();
+ children.remove(oldChild);
+ ((IIOMetadataNode)oldChild).parent = null;
+
+ return oldChild;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
+ */
+ public Node replaceChild(Node newChild, Node oldChild)
+ {
+ if (newChild == null)
+ throw new IllegalArgumentException();
+ children.set(children.indexOf(oldChild), newChild);
+ ((IIOMetadataNode)oldChild).parent = null;
+ return oldChild;
+ }
+
+ public void setIdAttribute(String name, boolean isId)
+ throws DOMException
+ {
+ throw new Error("not implemented");
+ }
+
+ public void setIdAttributeNode(Attr idAttr, boolean isId)
+ throws DOMException
+ {
+ throw new Error("not implemented");
+ }
+
+ public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
+ throws DOMException
+ {
+ throw new Error("not implemented");
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#setNodeValue(java.lang.String)
+ */
+ public void setNodeValue(String nodeValue) throws DOMException
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#setPrefix(java.lang.String)
+ */
+ public void setPrefix(String prefix)
+ {
+ }
+
+ public void setTextContent(String textContent)
+ throws DOMException
+ {
+ throw new Error("not implemented");
+ }
+
+ public Object setUserData(String key, Object data, UserDataHandler handler)
+ {
+ throw new Error("not implemented");
+ }
}
diff --git a/libjava/javax/imageio/spi/IIORegistry.java b/libjava/javax/imageio/spi/IIORegistry.java
index 7728cf428a3..6531fabca10 100644
--- a/libjava/javax/imageio/spi/IIORegistry.java
+++ b/libjava/javax/imageio/spi/IIORegistry.java
@@ -39,7 +39,9 @@ exception statement from your version. */
package javax.imageio.spi;
import gnu.classpath.ServiceFactory;
+import gnu.java.awt.ClasspathToolkit;
+import java.awt.Toolkit;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -52,8 +54,8 @@ public final class IIORegistry extends ServiceRegistry
static
{
- //defaultCategories.add(ImageReaderSpi.class);
- //defaultCategories.add(ImageWriterSpi.class);
+ defaultCategories.add(ImageReaderSpi.class);
+ defaultCategories.add(ImageWriterSpi.class);
defaultCategories.add(ImageTranscoderSpi.class);
defaultCategories.add(ImageInputStreamSpi.class);
defaultCategories.add(ImageOutputStreamSpi.class);
@@ -78,6 +80,8 @@ public final class IIORegistry extends ServiceRegistry
super(defaultCategories.iterator());
// XXX: Register built-in Spis here.
+
+ ((ClasspathToolkit)Toolkit.getDefaultToolkit()).registerImageIOSpis(this);
registerApplicationClasspathSpis();
}
diff --git a/libjava/javax/imageio/spi/IIOServiceProvider.java b/libjava/javax/imageio/spi/IIOServiceProvider.java
index bd0a449331c..a0d8b79bc54 100644
--- a/libjava/javax/imageio/spi/IIOServiceProvider.java
+++ b/libjava/javax/imageio/spi/IIOServiceProvider.java
@@ -1,5 +1,5 @@
/* IIOServiceProvider.java -- General service provider for image I/O.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import java.util.Locale;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class IIOServiceProvider
implements RegisterableService
diff --git a/libjava/javax/imageio/spi/ImageInputStreamSpi.java b/libjava/javax/imageio/spi/ImageInputStreamSpi.java
index 6e33d1d392c..8679ed1f4d7 100644
--- a/libjava/javax/imageio/spi/ImageInputStreamSpi.java
+++ b/libjava/javax/imageio/spi/ImageInputStreamSpi.java
@@ -1,5 +1,5 @@
/* ImageInputStreamSpi.java -- Service provider for image input streams.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import javax.imageio.stream.ImageInputStream;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class ImageInputStreamSpi
extends IIOServiceProvider
diff --git a/libjava/javax/imageio/spi/ImageOutputStreamSpi.java b/libjava/javax/imageio/spi/ImageOutputStreamSpi.java
index 935aa7c6799..43781aa1112 100644
--- a/libjava/javax/imageio/spi/ImageOutputStreamSpi.java
+++ b/libjava/javax/imageio/spi/ImageOutputStreamSpi.java
@@ -1,5 +1,5 @@
/* ImageOutputStreamSpi.java -- Service provider for image output streams.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import javax.imageio.stream.ImageOutputStream;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class ImageOutputStreamSpi
extends IIOServiceProvider
diff --git a/libjava/javax/imageio/spi/ImageReaderWriterSpi.java b/libjava/javax/imageio/spi/ImageReaderWriterSpi.java
index 74dbb3859bb..9821adf88af 100644
--- a/libjava/javax/imageio/spi/ImageReaderWriterSpi.java
+++ b/libjava/javax/imageio/spi/ImageReaderWriterSpi.java
@@ -1,5 +1,5 @@
/* ImageReaderWriterSpi.java -- Superclass for image reader and writer spis.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package javax.imageio.spi;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class ImageReaderWriterSpi
extends IIOServiceProvider
diff --git a/libjava/javax/imageio/spi/ImageTranscoderSpi.java b/libjava/javax/imageio/spi/ImageTranscoderSpi.java
index 85ca77d4639..d3a4d89b08e 100644
--- a/libjava/javax/imageio/spi/ImageTranscoderSpi.java
+++ b/libjava/javax/imageio/spi/ImageTranscoderSpi.java
@@ -1,5 +1,5 @@
/* ImageTranscoderSpi.java -- Factory for image metadata transcoders.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import javax.imageio.ImageTranscoder;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public abstract class ImageTranscoderSpi
extends IIOServiceProvider
diff --git a/libjava/javax/imageio/spi/RegisterableService.java b/libjava/javax/imageio/spi/RegisterableService.java
index 40cb05f81ac..2afee80ab30 100644
--- a/libjava/javax/imageio/spi/RegisterableService.java
+++ b/libjava/javax/imageio/spi/RegisterableService.java
@@ -1,5 +1,5 @@
/* RegisterableService.java -- An interface for service providers.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ package javax.imageio.spi;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public interface RegisterableService
{
diff --git a/libjava/javax/imageio/spi/ServiceRegistry.java b/libjava/javax/imageio/spi/ServiceRegistry.java
index 3d7134ed53f..a08ea69e8ee 100644
--- a/libjava/javax/imageio/spi/ServiceRegistry.java
+++ b/libjava/javax/imageio/spi/ServiceRegistry.java
@@ -1,5 +1,5 @@
/* ServiceRegistry.java -- A simple registry for service providers.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,8 +57,8 @@ import java.util.Set;
*
* @since 1.4
*
- * @author <a href="mailto:konqueror@gmx.de">Michael Koch</a>
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class ServiceRegistry
{
@@ -941,8 +941,8 @@ public class ServiceRegistry
*
* @since 1.4
*
- * @author <a href="mailto:konqueror@gmx.de">Michael Koch</a>
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public static interface Filter
{
diff --git a/libjava/javax/imageio/stream/FileCacheImageInputStream.java b/libjava/javax/imageio/stream/FileCacheImageInputStream.java
index 49827d4e0fb..a8db4779bba 100644
--- a/libjava/javax/imageio/stream/FileCacheImageInputStream.java
+++ b/libjava/javax/imageio/stream/FileCacheImageInputStream.java
@@ -45,7 +45,7 @@ import java.io.InputStream;
/**
* @author Michael Koch (konqueror@gmx.de)
*/
-public class FileCacheImageInputStream
+public class FileCacheImageInputStream extends ImageInputStreamImpl
{
private InputStream stream;
private File cacheDir;
@@ -90,4 +90,20 @@ public class FileCacheImageInputStream
{
return false;
}
+
+ public int read()
+ throws IOException
+ {
+ checkStreamClosed();
+ setBitOffset(0);
+ return stream.read();
+ }
+
+ public int read(byte[] data, int offset, int len)
+ throws IOException
+ {
+ checkStreamClosed();
+ setBitOffset(0);
+ return stream.read(data, offset, len);
+ }
}
diff --git a/libjava/javax/imageio/stream/FileCacheImageOutputStream.java b/libjava/javax/imageio/stream/FileCacheImageOutputStream.java
index f8bb3100275..912b368d146 100644
--- a/libjava/javax/imageio/stream/FileCacheImageOutputStream.java
+++ b/libjava/javax/imageio/stream/FileCacheImageOutputStream.java
@@ -45,7 +45,7 @@ import java.io.OutputStream;
/**
* @author Michael Koch (konqueror@gmx.de)
*/
-public class FileCacheImageOutputStream
+public class FileCacheImageOutputStream extends ImageOutputStreamImpl
{
private OutputStream stream;
private File cacheDir;
@@ -90,4 +90,34 @@ public class FileCacheImageOutputStream
{
return false;
}
+
+ public int read()
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
+ public int read(byte[] data, int offset, int len)
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
+ public void write(byte[] data, int offset, int len)
+ throws IOException
+ {
+ checkStreamClosed();
+ // FIXME: Flush pending bits.
+ stream.write(data, offset, len);
+ }
+
+ public void write(int value)
+ throws IOException
+ {
+ checkStreamClosed();
+ // FIXME: Flush pending bits.
+ stream.write(value);
+ }
}
diff --git a/libjava/javax/imageio/stream/FileImageInputStream.java b/libjava/javax/imageio/stream/FileImageInputStream.java
index 67fd07518b1..1684632553e 100644
--- a/libjava/javax/imageio/stream/FileImageInputStream.java
+++ b/libjava/javax/imageio/stream/FileImageInputStream.java
@@ -46,7 +46,7 @@ import java.io.RandomAccessFile;
/**
* @author Michael Koch (konqueror@gmx.de)
*/
-public class FileImageInputStream
+public class FileImageInputStream extends ImageInputStreamImpl
{
private RandomAccessFile file;
@@ -84,4 +84,25 @@ public class FileImageInputStream
return -1L;
}
}
+
+ public int read()
+ throws IOException
+ {
+ setBitOffset(0);
+ return file.read();
+ }
+
+ public int read(byte[] data, int offset, int len)
+ throws IOException
+ {
+ setBitOffset(0);
+ return file.read(data, offset, len);
+ }
+
+ public void seek(long position)
+ throws IOException
+ {
+ super.seek(position);
+ file.seek(position);
+ }
}
diff --git a/libjava/javax/imageio/stream/FileImageOutputStream.java b/libjava/javax/imageio/stream/FileImageOutputStream.java
index 073faed19f4..5b47af840d4 100644
--- a/libjava/javax/imageio/stream/FileImageOutputStream.java
+++ b/libjava/javax/imageio/stream/FileImageOutputStream.java
@@ -46,7 +46,7 @@ import java.io.RandomAccessFile;
/**
* @author Michael Koch (konqueror@gmx.de)
*/
-public class FileImageOutputStream
+public class FileImageOutputStream extends ImageOutputStreamImpl
{
private RandomAccessFile file;
@@ -87,4 +87,47 @@ public class FileImageOutputStream
return -1L;
}
}
+
+ public int read()
+ throws IOException
+ {
+ checkClosed();
+
+ setBitOffset(0);
+ return file.read();
+ }
+
+ public int read(byte[] data, int offset, int len)
+ throws IOException
+ {
+ checkClosed();
+
+ setBitOffset(0);
+ return file.read(data, offset, len);
+ }
+
+ public void seek(long position)
+ throws IOException
+ {
+ super.seek(position);
+ file.seek(position);
+ }
+
+ public void write(byte[] data, int offset, int len)
+ throws IOException
+ {
+ checkClosed();
+
+ flushBits();
+ file.write(data, offset, len);
+ }
+
+ public void write(int value)
+ throws IOException
+ {
+ checkClosed();
+
+ // FIXME: Flush pending bits.
+ file.write(value);
+ }
}
diff --git a/libjava/javax/imageio/stream/IIOByteBuffer.java b/libjava/javax/imageio/stream/IIOByteBuffer.java
index c9e230f5f79..e303255b3d3 100644
--- a/libjava/javax/imageio/stream/IIOByteBuffer.java
+++ b/libjava/javax/imageio/stream/IIOByteBuffer.java
@@ -1,5 +1,5 @@
/* IIOByteBuffer.java
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ package javax.imageio.stream;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class IIOByteBuffer
{
diff --git a/libjava/javax/imageio/stream/ImageInputStream.java b/libjava/javax/imageio/stream/ImageInputStream.java
index 39296a711c6..c75939e9418 100644
--- a/libjava/javax/imageio/stream/ImageInputStream.java
+++ b/libjava/javax/imageio/stream/ImageInputStream.java
@@ -1,5 +1,5 @@
/* ImageInputStream.java
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ import java.nio.ByteOrder;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public interface ImageInputStream
extends DataInput
diff --git a/libjava/javax/imageio/stream/ImageInputStreamImpl.java b/libjava/javax/imageio/stream/ImageInputStreamImpl.java
index 3a5d6dcb6d7..dbe6d1aaab9 100644
--- a/libjava/javax/imageio/stream/ImageInputStreamImpl.java
+++ b/libjava/javax/imageio/stream/ImageInputStreamImpl.java
@@ -38,8 +38,11 @@ exception statement from your version. */
package javax.imageio.stream;
+import java.io.DataInputStream;
+import java.io.EOFException;
import java.io.IOException;
import java.nio.ByteOrder;
+import java.util.Stack;
/**
* @author Michael Koch (konqueror@gmx.de)
@@ -47,6 +50,9 @@ import java.nio.ByteOrder;
public abstract class ImageInputStreamImpl implements ImageInputStream
{
private boolean closed;
+ private Stack markStack = new Stack();
+
+ byte[] buffer = new byte[8];
protected int bitOffset;
protected ByteOrder byteOrder;
@@ -99,6 +105,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream
public int getBitOffset()
throws IOException
{
+ checkClosed();
return bitOffset;
}
@@ -115,6 +122,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream
public long getStreamPosition()
throws IOException
{
+ checkClosed();
return streamPos;
}
@@ -138,6 +146,18 @@ public abstract class ImageInputStreamImpl implements ImageInputStream
return -1L;
}
+ public void mark()
+ {
+ try
+ {
+ markStack.push(new Long(getStreamPosition()));
+ }
+ catch (IOException e)
+ {
+ // Ignored.
+ }
+ }
+
public abstract int read()
throws IOException;
@@ -150,8 +170,346 @@ public abstract class ImageInputStreamImpl implements ImageInputStream
public abstract int read(byte[] data, int offset, int len)
throws IOException;
- public void setByteOrder (ByteOrder byteOrder)
+ public int readBit()
+ throws IOException
+ {
+ checkClosed();
+
+ // Calc new bit offset here, readByte resets it.
+ int newOffset = (bitOffset + 1) & 0x7;
+
+ byte data = readByte();
+
+ if (bitOffset != 0)
+ {
+ seek(getStreamPosition() - 1);
+ data = (byte) (data >> (8 - newOffset));
+ }
+
+ bitOffset = newOffset;
+ return data & 0x1;
+ }
+
+ public long readBits(int numBits)
+ throws IOException
+ {
+ checkClosed();
+
+ if (numBits < 0 || numBits > 64)
+ throw new IllegalArgumentException();
+
+ if (numBits == 0)
+ return 0L;
+
+ long bits = 0L;
+
+ for (int i = 0; i < numBits; i++)
+ {
+ bits <<= 1;
+ bits |= readBit();
+ }
+
+ return bits;
+ }
+
+ public boolean readBoolean()
+ throws IOException
+ {
+ byte data = readByte();
+ return data != 0;
+ }
+
+ public byte readByte()
+ throws IOException
+ {
+ int data = read();
+
+ if (data == -1)
+ throw new EOFException();
+
+ return (byte) data;
+ }
+
+ public void readBytes(IIOByteBuffer buffer, int len)
+ throws IOException
+ {
+ int result = read(buffer.getData(), buffer.getOffset(), len);
+
+ if (result == -1 || result < len)
+ throw new EOFException();
+
+ buffer.setLength(len);
+ }
+
+ public char readChar()
+ throws IOException
+ {
+ return (char) readShort();
+ }
+
+ public double readDouble()
+ throws IOException
+ {
+ return (double) readLong();
+ }
+
+ public float readFloat()
+ throws IOException
+ {
+ return (float) readInt();
+ }
+
+ public void readFully(byte[] data)
+ throws IOException
+ {
+ readFully(data, 0, data.length);
+ }
+
+ public void readFully(byte[] data, int offset, int len)
+ throws IOException
+ {
+ for (int i = 0; i < len; ++i)
+ data[offset + i] = readByte();
+ }
+
+ public void readFully(char[] data, int offset, int len)
+ throws IOException
+ {
+ for (int i = 0; i < len; ++i)
+ data[offset + i] = readChar();
+ }
+
+ public void readFully(double[] data, int offset, int len)
+ throws IOException
+ {
+ for (int i = 0; i < len; ++i)
+ data[offset + i] = readDouble();
+ }
+
+ public void readFully(float[] data, int offset, int len)
+ throws IOException
+ {
+ for (int i = 0; i < len; ++i)
+ data[offset + i] = readFloat();
+ }
+
+ public void readFully(int[] data, int offset, int len)
+ throws IOException
+ {
+ for (int i = 0; i < len; ++i)
+ data[offset + i] = readInt();
+ }
+
+ public void readFully(long[] data, int offset, int len)
+ throws IOException
+ {
+ for (int i = 0; i < len; ++i)
+ data[offset + i] = readLong();
+ }
+
+ public void readFully(short[] data, int offset, int len)
+ throws IOException
+ {
+ for (int i = 0; i < len; ++i)
+ data[offset + i] = readShort();
+ }
+
+ public int readInt()
+ throws IOException
+ {
+ int result = read(buffer, 0, 4);
+
+ if (result == -1)
+ throw new EOFException();
+
+ if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
+ {
+ return ((buffer[0] & 0xff)
+ + (buffer[1] << 8)
+ + (buffer[2] << 16)
+ + (buffer[3] << 24));
+ }
+
+ return ((buffer[4] << 24)
+ + (buffer[3] << 16)
+ + (buffer[2] << 8)
+ + (buffer[1] & 0xff));
+ }
+
+ public String readLine()
+ throws IOException
+ {
+ checkClosed();
+
+ int c = -1;
+ boolean eol = false;
+ StringBuffer buffer = new StringBuffer();
+
+ while (!eol && (c = read()) != -1)
+ {
+ switch(c)
+ {
+ case '\r':
+ // Consume following \n'
+ long oldPosition = getStreamPosition();
+ if (read() != '\n')
+ seek(oldPosition);
+ case '\n':
+ eol = true;
+ break;
+ default:
+ buffer.append((char) c);
+ break;
+ }
+ }
+
+ if (c == -1 && buffer.length() == 0)
+ return null;
+
+ return buffer.toString();
+ }
+
+ public long readLong()
+ throws IOException
+ {
+ int result = read(buffer, 0, 8);
+
+ if (result == -1)
+ throw new EOFException();
+
+ if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
+ {
+ return ((buffer[0] & 0xff)
+ + (((buffer[1] & 0xff)) << 8)
+ + (((buffer[2] & 0xff)) << 16)
+ + (((buffer[3] & 0xffL)) << 24)
+ + (((buffer[4] & 0xffL)) << 32)
+ + (((buffer[5] & 0xffL)) << 40)
+ + (((buffer[6] & 0xffL)) << 48)
+ + (((long) buffer[7]) << 56));
+ }
+
+ return ((((long) buffer[7]) << 56)
+ + ((buffer[6] & 0xffL) << 48)
+ + ((buffer[5] & 0xffL) << 40)
+ + ((buffer[4] & 0xffL) << 32)
+ + ((buffer[3] & 0xffL) << 24)
+ + ((buffer[2] & 0xff) << 16)
+ + ((buffer[1] & 0xff) << 8)
+ + (buffer[0] & 0xff));
+ }
+
+ public short readShort()
+ throws IOException
+ {
+ int result = read(buffer, 0, 2);
+
+ if (result == -1)
+ throw new EOFException();
+
+ if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
+ {
+ return (short) ((buffer[0] & 0xff)
+ + (buffer[1] << 8));
+ }
+
+ return (short) ((buffer[0] << 8)
+ + (buffer[1] & 0xff));
+ }
+
+ public int readUnsignedByte()
+ throws IOException
+ {
+ return readByte() & 0xff;
+ }
+
+ public long readUnsignedInt()
+ throws IOException
+ {
+ return readInt() & 0xffffffff;
+ }
+
+ public int readUnsignedShort()
+ throws IOException
+ {
+ return readShort() & 0xffff;
+ }
+
+ public String readUTF()
+ throws IOException
+ {
+ checkClosed();
+
+ String data;
+ ByteOrder old = getByteOrder();
+ setByteOrder(ByteOrder.BIG_ENDIAN); // Strings are always big endian.
+
+ try
+ {
+ data = DataInputStream.readUTF(this);
+ }
+ finally
+ {
+ setByteOrder(old);
+ }
+
+ return data;
+ }
+
+ public void reset()
+ throws IOException
+ {
+ checkClosed();
+
+ long mark = ((Long) markStack.pop()).longValue();
+ seek(mark);
+ }
+
+ public void seek(long position)
+ throws IOException
+ {
+ checkClosed();
+
+ if (position < getFlushedPosition())
+ throw new IndexOutOfBoundsException("position < flushed position");
+
+ streamPos = position;
+ bitOffset = 0;
+ }
+
+ public void setBitOffset (int bitOffset)
+ throws IOException
+ {
+ checkClosed();
+
+ if (bitOffset < 0 || bitOffset > 7)
+ throw new IllegalArgumentException();
+
+ this.bitOffset = bitOffset;
+ }
+
+ public void setByteOrder(ByteOrder byteOrder)
{
this.byteOrder = byteOrder;
}
+
+ public int skipBytes(int num)
+ throws IOException
+ {
+ checkClosed();
+
+ seek(getStreamPosition() + num);
+ bitOffset = 0;
+ return num;
+ }
+
+ public long skipBytes(long num)
+ throws IOException
+ {
+ checkClosed();
+
+ seek(getStreamPosition() + num);
+ bitOffset = 0;
+ return num;
+ }
}
diff --git a/libjava/javax/imageio/stream/ImageOutputStream.java b/libjava/javax/imageio/stream/ImageOutputStream.java
index f53feab717c..b00b37ff9b7 100644
--- a/libjava/javax/imageio/stream/ImageOutputStream.java
+++ b/libjava/javax/imageio/stream/ImageOutputStream.java
@@ -1,5 +1,5 @@
/* ImageOutputStream.java
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.io.IOException;
*
* @since 1.4
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public interface ImageOutputStream
extends ImageInputStream, DataOutput
diff --git a/libjava/javax/imageio/stream/ImageOutputStreamImpl.java b/libjava/javax/imageio/stream/ImageOutputStreamImpl.java
index d6009431900..2149255457d 100644
--- a/libjava/javax/imageio/stream/ImageOutputStreamImpl.java
+++ b/libjava/javax/imageio/stream/ImageOutputStreamImpl.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package javax.imageio.stream;
import java.io.IOException;
+import java.nio.ByteOrder;
/**
* @author Michael Koch (konqueror@gmx.de)
@@ -51,6 +52,13 @@ public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl
// Do nothing here.
}
+ protected void flushBits()
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
public void write(byte[] data)
throws IOException
{
@@ -62,4 +70,176 @@ public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl
public abstract void write(int value)
throws IOException;
+
+ public void writeBit(int bit)
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
+ public void writeBits(long bits, int numBits)
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
+ public void writeBoolean(boolean value)
+ throws IOException
+ {
+ writeByte(value ? 1 : 0);
+ }
+
+ public void writeByte(int value)
+ throws IOException
+ {
+ write(value & 0xff);
+ }
+
+ public void writeBytes(String data)
+ throws IOException
+ {
+ write(data.getBytes());
+ }
+
+ public void writeChar(int value)
+ throws IOException
+ {
+ writeShort((short) value);
+ }
+
+ public void writeChars(char[] data, int offset, int len)
+ throws IOException
+ {
+ for(int i = 0; i < len; ++len)
+ writeChar(data[offset + i]);
+ }
+
+ public void writeChars(String data)
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
+ public void writeDouble(double value)
+ throws IOException
+ {
+ writeLong((long) value);
+ }
+
+ public void writeDoubles(double[] data, int offset, int len)
+ throws IOException
+ {
+ for(int i = 0; i < len; ++len)
+ writeDouble(data[offset + i]);
+ }
+
+ public void writeFloat(float value)
+ throws IOException
+ {
+ writeInt((int) value);
+ }
+
+ public void writeFloats(float[] data, int offset, int len)
+ throws IOException
+ {
+ for(int i = 0; i < len; ++len)
+ writeFloat(data[offset + i]);
+ }
+
+ public void writeInt(int value)
+ throws IOException
+ {
+ if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
+ {
+ buffer[0] = ((byte) value);
+ buffer[1] = ((byte) (value >> 8));
+ buffer[2] = ((byte) (value >> 16));
+ buffer[3] = ((byte) (value >> 24));
+ }
+ else
+ {
+ buffer[0] = ((byte) (value >> 24));
+ buffer[1] = ((byte) (value >> 16));
+ buffer[2] = ((byte) (value >> 8));
+ buffer[3] = ((byte) value);
+ }
+
+ write(buffer, 0, 4);
+ }
+
+ public void writeInts(int[] data, int offset, int len)
+ throws IOException
+ {
+ for(int i = 0; i < len; ++len)
+ writeInt(data[offset + i]);
+ }
+
+ public void writeLong(long value)
+ throws IOException
+ {
+ if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
+ {
+ buffer[0] = ((byte) value);
+ buffer[1] = ((byte) (value >> 8));
+ buffer[2] = ((byte) (value >> 16));
+ buffer[3] = ((byte) (value >> 24));
+ buffer[4] = ((byte) (value >> 32));
+ buffer[5] = ((byte) (value >> 40));
+ buffer[6] = ((byte) (value >> 48));
+ buffer[7] = ((byte) (value >> 56));
+ }
+ else
+ {
+ buffer[0] = ((byte) (value >> 56));
+ buffer[1] = ((byte) (value >> 48));
+ buffer[2] = ((byte) (value >> 40));
+ buffer[3] = ((byte) (value >> 32));
+ buffer[4] = ((byte) (value >> 24));
+ buffer[5] = ((byte) (value >> 16));
+ buffer[6] = ((byte) (value >> 8));
+ buffer[7] = ((byte) value);
+ }
+
+ write(buffer, 0, 8);
+ }
+
+ public void writeLongs(long[] data, int offset, int len)
+ throws IOException
+ {
+ for(int i = 0; i < len; ++len)
+ writeLong(data[offset + i]);
+ }
+
+ public void writeShort(int value)
+ throws IOException
+ {
+ if (getByteOrder() == ByteOrder.LITTLE_ENDIAN)
+ {
+ buffer[0] = ((byte) value);
+ buffer[1] = ((byte) (value >> 8));
+ }
+ else
+ {
+ buffer[0] = ((byte) (value >> 8));
+ buffer[1] = ((byte) value);
+ }
+
+ write(buffer, 0, 2);
+ }
+
+ public void writeShorts(short[] data, int offset, int len)
+ throws IOException
+ {
+ for(int i = 0; i < len; ++len)
+ writeShort(data[offset + i]);
+ }
+
+ public void writeUTF(String data)
+ throws IOException
+ {
+ throw new Error("not implemented");
+ }
}
diff --git a/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java b/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java
index c7ca6d6e06d..3631e64fc20 100644
--- a/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java
+++ b/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java
@@ -38,11 +38,35 @@ exception statement from your version. */
package javax.imageio.stream;
+import java.io.IOException;
+import java.io.InputStream;
+
/**
* @author Michael Koch (konqueror@gmx.de)
*/
-public class MemoryCacheImageInputStream
+public class MemoryCacheImageInputStream extends ImageInputStreamImpl
{
+ private InputStream stream;
+
+ public MemoryCacheImageInputStream(InputStream stream)
+ {
+ this.stream = stream;
+ }
+
+ public void close()
+ throws IOException
+ {
+ super.close();
+ stream.close();
+ }
+
+ public void flushBefore(long position)
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
public boolean isCached()
{
return true;
@@ -57,4 +81,18 @@ public class MemoryCacheImageInputStream
{
return true;
}
+
+ public int read()
+ throws IOException
+ {
+ setBitOffset(0);
+ return stream.read();
+ }
+
+ public int read(byte[] data, int offset, int len)
+ throws IOException
+ {
+ setBitOffset(0);
+ return stream.read(data, offset, len);
+ }
}
diff --git a/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java b/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java
index b91fd666382..a21efae984f 100644
--- a/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java
+++ b/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java
@@ -38,11 +38,35 @@ exception statement from your version. */
package javax.imageio.stream;
+import java.io.IOException;
+import java.io.OutputStream;
+
/**
* @author Michael Koch (konqueror@gmx.de)
*/
-public class MemoryCacheImageOutputStream
+public class MemoryCacheImageOutputStream extends ImageOutputStreamImpl
{
+ private OutputStream stream;
+
+ public MemoryCacheImageOutputStream(OutputStream stream)
+ {
+ this.stream = stream;
+ }
+
+ public void close()
+ throws IOException
+ {
+ super.close();
+ stream.close();
+ }
+
+ public void flushBefore(long position)
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
public boolean isCached()
{
return true;
@@ -57,4 +81,32 @@ public class MemoryCacheImageOutputStream
{
return true;
}
+
+ public int read()
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
+ public int read (byte[] data, int offset, int len)
+ throws IOException
+ {
+ // FIXME: Implement me.
+ throw new Error("not implemented");
+ }
+
+ public void write(byte[] data, int offset, int len)
+ throws IOException
+ {
+ // FIXME: Flush pending bits.
+ stream.write(data, offset, len);
+ }
+
+ public void write(int value)
+ throws IOException
+ {
+ // FIXME: Flush pending bits.
+ stream.write(value);
+ }
}
diff --git a/libjava/javax/naming/Binding.java b/libjava/javax/naming/Binding.java
index 45f0d13ea5f..066d84ecd5e 100644
--- a/libjava/javax/naming/Binding.java
+++ b/libjava/javax/naming/Binding.java
@@ -1,5 +1,5 @@
/* Binding.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.naming;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date May 16, 2001
*/
public class Binding extends NameClassPair
diff --git a/libjava/javax/naming/CannotProceedException.java b/libjava/javax/naming/CannotProceedException.java
index 0fe382b73aa..db457729c8d 100644
--- a/libjava/javax/naming/CannotProceedException.java
+++ b/libjava/javax/naming/CannotProceedException.java
@@ -1,5 +1,5 @@
/* CannotProceedException.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming;
import java.util.Hashtable;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 14, 2001
*/
diff --git a/libjava/javax/naming/CompositeName.java b/libjava/javax/naming/CompositeName.java
index e3559a911cf..cd77723ea1f 100644
--- a/libjava/javax/naming/CompositeName.java
+++ b/libjava/javax/naming/CompositeName.java
@@ -1,5 +1,5 @@
/* CompositeName.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.NoSuchElementException;
import java.util.Vector;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date May 16, 2001
*
* FIXME: must write readObject and writeObject to conform to
diff --git a/libjava/javax/naming/CompoundName.java b/libjava/javax/naming/CompoundName.java
index 17f2aab7ea7..2299715877e 100644
--- a/libjava/javax/naming/CompoundName.java
+++ b/libjava/javax/naming/CompoundName.java
@@ -1,5 +1,5 @@
/* CompoundName.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.Properties;
import java.util.Vector;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date May 16, 2001
*
* FIXME: must write readObject and writeObject to conform to
diff --git a/libjava/javax/naming/LinkException.java b/libjava/javax/naming/LinkException.java
index 2b0524d91eb..29179ff5226 100644
--- a/libjava/javax/naming/LinkException.java
+++ b/libjava/javax/naming/LinkException.java
@@ -1,5 +1,5 @@
/* LinkException.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.naming;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 14, 2001
*/
diff --git a/libjava/javax/naming/LinkRef.java b/libjava/javax/naming/LinkRef.java
index 53597d38fc7..313574f1685 100644
--- a/libjava/javax/naming/LinkRef.java
+++ b/libjava/javax/naming/LinkRef.java
@@ -1,5 +1,5 @@
/* LinkRef.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.naming;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date May 16, 2001
*/
public class LinkRef extends Reference
diff --git a/libjava/javax/naming/NameClassPair.java b/libjava/javax/naming/NameClassPair.java
index 2f115598641..bc90f224e25 100644
--- a/libjava/javax/naming/NameClassPair.java
+++ b/libjava/javax/naming/NameClassPair.java
@@ -1,5 +1,5 @@
/* NameClassPair.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming;
import java.io.Serializable;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date May 16, 2001
*/
public class NameClassPair implements Serializable
diff --git a/libjava/javax/naming/Reference.java b/libjava/javax/naming/Reference.java
index 7309ebd293f..4b06f4ab910 100644
--- a/libjava/javax/naming/Reference.java
+++ b/libjava/javax/naming/Reference.java
@@ -1,5 +1,5 @@
/* Reference.java --
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.util.Enumeration;
import java.util.Vector;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date May 16, 2001
*/
public class Reference implements Cloneable, Serializable
diff --git a/libjava/javax/naming/ReferralException.java b/libjava/javax/naming/ReferralException.java
index 63e83030cd5..430a38d4da5 100644
--- a/libjava/javax/naming/ReferralException.java
+++ b/libjava/javax/naming/ReferralException.java
@@ -1,5 +1,5 @@
/* ReferralException.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming;
import java.util.Hashtable;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 14, 2001
*/
diff --git a/libjava/javax/naming/directory/Attribute.java b/libjava/javax/naming/directory/Attribute.java
index f812f166284..e46a563b806 100644
--- a/libjava/javax/naming/directory/Attribute.java
+++ b/libjava/javax/naming/directory/Attribute.java
@@ -1,5 +1,5 @@
/* Attribute.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 14, 2001
*/
public interface Attribute extends Cloneable, Serializable
diff --git a/libjava/javax/naming/directory/AttributeModificationException.java b/libjava/javax/naming/directory/AttributeModificationException.java
index 0012458007b..a1bffba76d3 100644
--- a/libjava/javax/naming/directory/AttributeModificationException.java
+++ b/libjava/javax/naming/directory/AttributeModificationException.java
@@ -1,5 +1,5 @@
/* AttributeModificationException.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.directory;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 14, 2001
*/
diff --git a/libjava/javax/naming/directory/Attributes.java b/libjava/javax/naming/directory/Attributes.java
index b0ee5cdc45e..34bb8c09940 100644
--- a/libjava/javax/naming/directory/Attributes.java
+++ b/libjava/javax/naming/directory/Attributes.java
@@ -1,5 +1,5 @@
/* Attributes.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.io.Serializable;
import javax.naming.NamingEnumeration;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 14, 2001
*/
diff --git a/libjava/javax/naming/directory/DirContext.java b/libjava/javax/naming/directory/DirContext.java
index c7c821683e5..a42908b8011 100644
--- a/libjava/javax/naming/directory/DirContext.java
+++ b/libjava/javax/naming/directory/DirContext.java
@@ -1,5 +1,5 @@
/* DirContext.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 13, 2001
*/
diff --git a/libjava/javax/naming/directory/ModificationItem.java b/libjava/javax/naming/directory/ModificationItem.java
index 6b9127df8f0..e5530aa1147 100644
--- a/libjava/javax/naming/directory/ModificationItem.java
+++ b/libjava/javax/naming/directory/ModificationItem.java
@@ -1,5 +1,5 @@
/* ModificationItem.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.directory;
import java.io.Serializable;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 13, 2001
*/
diff --git a/libjava/javax/naming/directory/SearchControls.java b/libjava/javax/naming/directory/SearchControls.java
index 0bccb357f94..5e630807a63 100644
--- a/libjava/javax/naming/directory/SearchControls.java
+++ b/libjava/javax/naming/directory/SearchControls.java
@@ -1,5 +1,5 @@
/* SearchControls.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.directory;
import java.io.Serializable;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 5, 2001
*/
diff --git a/libjava/javax/naming/directory/SearchResult.java b/libjava/javax/naming/directory/SearchResult.java
index eb4c182e21a..793a28d47d6 100644
--- a/libjava/javax/naming/directory/SearchResult.java
+++ b/libjava/javax/naming/directory/SearchResult.java
@@ -1,5 +1,5 @@
/* SearchResult.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.directory;
import javax.naming.Binding;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 13, 2001
*/
diff --git a/libjava/javax/naming/event/EventContext.java b/libjava/javax/naming/event/EventContext.java
index 81626e1c853..365d73a0624 100644
--- a/libjava/javax/naming/event/EventContext.java
+++ b/libjava/javax/naming/event/EventContext.java
@@ -1,5 +1,5 @@
/* EventContext.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import javax.naming.Name;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/event/EventDirContext.java b/libjava/javax/naming/event/EventDirContext.java
index 5d89e6b8bb2..288ecb171ac 100644
--- a/libjava/javax/naming/event/EventDirContext.java
+++ b/libjava/javax/naming/event/EventDirContext.java
@@ -1,5 +1,5 @@
/* EventDirContext.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import javax.naming.directory.SearchControls;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
public interface EventDirContext extends EventContext, DirContext
diff --git a/libjava/javax/naming/event/NamespaceChangeListener.java b/libjava/javax/naming/event/NamespaceChangeListener.java
index f9163b8fa59..7952d7193db 100644
--- a/libjava/javax/naming/event/NamespaceChangeListener.java
+++ b/libjava/javax/naming/event/NamespaceChangeListener.java
@@ -1,5 +1,5 @@
/* NamespaceChangeListener.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.naming.event;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/event/NamingExceptionEvent.java b/libjava/javax/naming/event/NamingExceptionEvent.java
index 17b71d92963..8fb4255a689 100644
--- a/libjava/javax/naming/event/NamingExceptionEvent.java
+++ b/libjava/javax/naming/event/NamingExceptionEvent.java
@@ -1,5 +1,5 @@
/* NamingExceptionEvent.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.util.EventObject;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 5, 2001
*/
diff --git a/libjava/javax/naming/event/NamingListener.java b/libjava/javax/naming/event/NamingListener.java
index d75dd5b9316..bc820dcb094 100644
--- a/libjava/javax/naming/event/NamingListener.java
+++ b/libjava/javax/naming/event/NamingListener.java
@@ -1,5 +1,5 @@
/* NamingListener.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.event;
import java.util.EventListener;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/event/ObjectChangeListener.java b/libjava/javax/naming/event/ObjectChangeListener.java
index cda1052a70a..0a2b19d1a03 100644
--- a/libjava/javax/naming/event/ObjectChangeListener.java
+++ b/libjava/javax/naming/event/ObjectChangeListener.java
@@ -1,5 +1,5 @@
/* ObjectChangeListener.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.naming.event;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/ldap/Control.java b/libjava/javax/naming/ldap/Control.java
index 20ccafebe5e..03de2159ba9 100644
--- a/libjava/javax/naming/ldap/Control.java
+++ b/libjava/javax/naming/ldap/Control.java
@@ -1,5 +1,5 @@
/* Control.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.ldap;
import java.io.Serializable;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/ldap/ExtendedResponse.java b/libjava/javax/naming/ldap/ExtendedResponse.java
index 4815ad9ab22..66251284812 100644
--- a/libjava/javax/naming/ldap/ExtendedResponse.java
+++ b/libjava/javax/naming/ldap/ExtendedResponse.java
@@ -1,5 +1,5 @@
/* ExtendedResponse.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.ldap;
import java.io.Serializable;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/ldap/HasControls.java b/libjava/javax/naming/ldap/HasControls.java
index 079afa3a95f..6153e5451c6 100644
--- a/libjava/javax/naming/ldap/HasControls.java
+++ b/libjava/javax/naming/ldap/HasControls.java
@@ -1,5 +1,5 @@
/* HasControls.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.ldap;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/ldap/LdapContext.java b/libjava/javax/naming/ldap/LdapContext.java
index db7bf254a71..7f554a61845 100644
--- a/libjava/javax/naming/ldap/LdapContext.java
+++ b/libjava/javax/naming/ldap/LdapContext.java
@@ -1,5 +1,5 @@
/* LdapContext.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import javax.naming.NamingException;
import javax.naming.directory.DirContext;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotification.java b/libjava/javax/naming/ldap/UnsolicitedNotification.java
index 6c37eb807b5..5a97227b1e9 100644
--- a/libjava/javax/naming/ldap/UnsolicitedNotification.java
+++ b/libjava/javax/naming/ldap/UnsolicitedNotification.java
@@ -1,5 +1,5 @@
/* UnsolicitedNotification.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.ldap;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java b/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
index 4d5161c3093..bade7e1c39c 100644
--- a/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
+++ b/libjava/javax/naming/ldap/UnsolicitedNotificationEvent.java
@@ -1,5 +1,5 @@
/* UnsolicitedNotificationEvent.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.ldap;
import java.util.EventObject;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 5, 2001
*/
public class UnsolicitedNotificationEvent extends EventObject
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java b/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
index d540d9675db..e5b15c566c6 100644
--- a/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
+++ b/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
@@ -1,5 +1,5 @@
/* UnsolicitedNotificationListener.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.naming.ldap;
import javax.naming.event.NamingListener;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/naming/spi/DirectoryManager.java b/libjava/javax/naming/spi/DirectoryManager.java
index c43a28d2dfe..a98b05df803 100644
--- a/libjava/javax/naming/spi/DirectoryManager.java
+++ b/libjava/javax/naming/spi/DirectoryManager.java
@@ -1,5 +1,5 @@
/* DirectoryManager.java --
- Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,7 +54,7 @@ import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date June 25, 2001
*/
public class DirectoryManager extends NamingManager
diff --git a/libjava/javax/naming/spi/ResolveResult.java b/libjava/javax/naming/spi/ResolveResult.java
index 25dd8494e70..d9c637629a6 100644
--- a/libjava/javax/naming/spi/ResolveResult.java
+++ b/libjava/javax/naming/spi/ResolveResult.java
@@ -1,5 +1,5 @@
/* ResolveResult.java --
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import javax.naming.InvalidNameException;
import javax.naming.Name;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 5, 2001
*/
diff --git a/libjava/javax/naming/spi/Resolver.java b/libjava/javax/naming/spi/Resolver.java
index 68ec5d69233..0f7f3868e55 100644
--- a/libjava/javax/naming/spi/Resolver.java
+++ b/libjava/javax/naming/spi/Resolver.java
@@ -1,5 +1,5 @@
/* Resolver.java --
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import javax.naming.Name;
import javax.naming.NamingException;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date June 1, 2001
*/
diff --git a/libjava/javax/net/ssl/SSLContext.java b/libjava/javax/net/ssl/SSLContext.java
index f69e2678beb..6cab45351bf 100644
--- a/libjava/javax/net/ssl/SSLContext.java
+++ b/libjava/javax/net/ssl/SSLContext.java
@@ -140,7 +140,7 @@ public class SSLContext
{
if (provider == null)
{
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("null provider");
}
Provider p = Security.getProvider(provider);
if (p == null)
@@ -174,13 +174,13 @@ public class SSLContext
}
catch (InvocationTargetException ite)
{
- ite.printStackTrace();
- throw new NoSuchAlgorithmException();
+ NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
+ throw (NoSuchAlgorithmException) nsae.initCause(ite);
}
catch (ClassCastException cce)
{
- cce.printStackTrace();
- throw new NoSuchAlgorithmException();
+ NoSuchAlgorithmException nsae = new NoSuchAlgorithmException(protocol);
+ throw (NoSuchAlgorithmException) nsae.initCause(cce);
}
}
diff --git a/libjava/javax/security/auth/Subject.java b/libjava/javax/security/auth/Subject.java
index 5391acec825..37baecc8aed 100644
--- a/libjava/javax/security/auth/Subject.java
+++ b/libjava/javax/security/auth/Subject.java
@@ -235,7 +235,7 @@ public final class Subject implements Serializable
*/
public static Object doAsPrivileged (final Subject subject,
final PrivilegedExceptionAction action,
- final AccessControlContext acc)
+ AccessControlContext acc)
throws PrivilegedActionException
{
final SecurityManager sm = System.getSecurityManager();
@@ -243,6 +243,8 @@ public final class Subject implements Serializable
{
sm.checkPermission (new AuthPermission ("doAsPrivileged"));
}
+ if (acc == null)
+ acc = new AccessControlContext (new java.security.ProtectionDomain[0]);
AccessControlContext context =
new AccessControlContext (acc, new SubjectDomainCombiner (subject));
return AccessController.doPrivileged (action, context);
diff --git a/libjava/javax/security/auth/callback/Callback.java b/libjava/javax/security/auth/callback/Callback.java
index 655ad3348ba..71932cb0f13 100644
--- a/libjava/javax/security/auth/callback/Callback.java
+++ b/libjava/javax/security/auth/callback/Callback.java
@@ -59,7 +59,6 @@ package javax.security.auth.callback;
* @see PasswordCallback
* @see TextInputCallback
* @see TextOutputCallback
- * @version $Revision: 1.1 $
*/
public interface Callback {
}
diff --git a/libjava/javax/security/auth/callback/CallbackHandler.java b/libjava/javax/security/auth/callback/CallbackHandler.java
index 289999c5ee1..ed1195a89e3 100644
--- a/libjava/javax/security/auth/callback/CallbackHandler.java
+++ b/libjava/javax/security/auth/callback/CallbackHandler.java
@@ -80,7 +80,6 @@ import java.io.IOException;
* <p>All default handler implementations must provide a public zero-argument
* constructor.</p>
*
- * @version $Revision: 1.1 $
*/
public interface CallbackHandler
{
diff --git a/libjava/javax/security/auth/callback/ChoiceCallback.java b/libjava/javax/security/auth/callback/ChoiceCallback.java
index 44b5ffcba5e..8fd038edf70 100644
--- a/libjava/javax/security/auth/callback/ChoiceCallback.java
+++ b/libjava/javax/security/auth/callback/ChoiceCallback.java
@@ -47,7 +47,6 @@ import java.io.Serializable;
* selected choice(s).
*
* @see CallbackHandler
- * @version $Revision: 1.1 $
*/
public class ChoiceCallback implements Callback, Serializable
{
diff --git a/libjava/javax/security/auth/callback/ConfirmationCallback.java b/libjava/javax/security/auth/callback/ConfirmationCallback.java
index 8abd393f52c..aa912189fb2 100644
--- a/libjava/javax/security/auth/callback/ConfirmationCallback.java
+++ b/libjava/javax/security/auth/callback/ConfirmationCallback.java
@@ -47,7 +47,6 @@ import java.io.Serializable;
* similar confirmations.
*
* @see CallbackHandler
- * @version $Revision: 1.1 $
*/
public class ConfirmationCallback implements Callback, Serializable
{
@@ -254,7 +253,7 @@ public class ConfirmationCallback implements Callback, Serializable
* NO, CANCEL or OK).
* @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
* if <code>prompt</code> has a length of <code>0</code>, if
- * <code>messageType</code> is not either <ode>INFORMATION</code>,
+ * <code>messageType</code> is not either <code>INFORMATION</code>,
* <code>WARNING</code>, or <code>ERROR</code>, if <code>optionType</code> is
* not either <code>YES_NO_OPTION</code>, <code>YES_NO_CANCEL_OPTION</code>,
* or <code>OK_CANCEL_OPTION</code>, or if <code>defaultOption</code> does
@@ -289,7 +288,7 @@ public class ConfirmationCallback implements Callback, Serializable
* <code>options</code> array.
* @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
* if <code>prompt</code> has a length of <code>0</code>, if
- * <code>messageType</code> is not either <ode>INFORMATION</code>,
+ * <code>messageType</code> is not either <code>INFORMATION</code>,
* <code>WARNING</code>, or <code>ERROR</code>, if <code>options</code> is
* <code>null</code>, if <code>options</code> has a length of <code>0</code>,
* if any element from <code>options</code> is <code>null</code>, if any
diff --git a/libjava/javax/security/auth/callback/LanguageCallback.java b/libjava/javax/security/auth/callback/LanguageCallback.java
index 71910632b48..b53149adcb3 100644
--- a/libjava/javax/security/auth/callback/LanguageCallback.java
+++ b/libjava/javax/security/auth/callback/LanguageCallback.java
@@ -47,7 +47,6 @@ import java.util.Locale;
* the {@link Locale} used for localizing text.
*
* @see CallbackHandler
- * @version $Revision: 1.1 $
*/
public class LanguageCallback implements Callback, Serializable
{
diff --git a/libjava/javax/security/auth/callback/NameCallback.java b/libjava/javax/security/auth/callback/NameCallback.java
index c98edfdbea9..094349e19a0 100644
--- a/libjava/javax/security/auth/callback/NameCallback.java
+++ b/libjava/javax/security/auth/callback/NameCallback.java
@@ -46,7 +46,6 @@ import java.io.Serializable;
* name information.
*
* @see CallbackHandler
- * @version $Revision: 1.1 $
*/
public class NameCallback implements Callback, Serializable
{
diff --git a/libjava/javax/security/auth/callback/PasswordCallback.java b/libjava/javax/security/auth/callback/PasswordCallback.java
index 5620bc5cd79..7e5f9cb7cab 100644
--- a/libjava/javax/security/auth/callback/PasswordCallback.java
+++ b/libjava/javax/security/auth/callback/PasswordCallback.java
@@ -46,7 +46,6 @@ import java.io.Serializable;
* password information.
*
* @see CallbackHandler,
- * @version $Revision: 1.1 $
*/
public class PasswordCallback implements Callback, Serializable
{
diff --git a/libjava/javax/security/auth/callback/TextInputCallback.java b/libjava/javax/security/auth/callback/TextInputCallback.java
index 55c1aa2534d..01b544cb24b 100644
--- a/libjava/javax/security/auth/callback/TextInputCallback.java
+++ b/libjava/javax/security/auth/callback/TextInputCallback.java
@@ -46,7 +46,6 @@ import java.io.Serializable;
* generic text information.
*
* @see CallbackHandler
- * @version $Revision: 1.1 $
*/
public class TextInputCallback implements Callback, Serializable
{
diff --git a/libjava/javax/security/auth/callback/TextOutputCallback.java b/libjava/javax/security/auth/callback/TextOutputCallback.java
index fac08874df1..47202bcaa72 100644
--- a/libjava/javax/security/auth/callback/TextOutputCallback.java
+++ b/libjava/javax/security/auth/callback/TextOutputCallback.java
@@ -47,7 +47,6 @@ import java.io.Serializable;
* error messages.</p>
*
* @see CallbackHandler
- * @version $Revision: 1.1 $
*/
public class TextOutputCallback implements Callback, Serializable
{
diff --git a/libjava/javax/security/auth/callback/UnsupportedCallbackException.java b/libjava/javax/security/auth/callback/UnsupportedCallbackException.java
index 215942c40b5..167a5e23671 100644
--- a/libjava/javax/security/auth/callback/UnsupportedCallbackException.java
+++ b/libjava/javax/security/auth/callback/UnsupportedCallbackException.java
@@ -42,7 +42,6 @@ package javax.security.auth.callback;
* Signals that a {@link CallbackHandler} does not recognize a particular
* {@link Callback}.
*
- * @version $Revision: 1.1 $
*/
public class UnsupportedCallbackException extends Exception
{
diff --git a/libjava/javax/security/sasl/Sasl.java b/libjava/javax/security/sasl/Sasl.java
index 334aac602ba..257198b0e45 100644
--- a/libjava/javax/security/sasl/Sasl.java
+++ b/libjava/javax/security/sasl/Sasl.java
@@ -1,5 +1,5 @@
/* Sasl.java --
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -221,7 +221,7 @@ public class Sasl
* breaking into future sessions. The property contains <code>"true"</code>
* if mechanisms that implement forward secrecy between sessions are
* required; <code>"false"</code> if such mechanisms are not required. The
- * default is <code>"false"</code>.</p>
+ * default is <code>"false"</code>.
*
* <p>The value of this constant is <code>"javax.security.sasl.policy.forward"</code>.
* </p>
@@ -233,7 +233,6 @@ public class Sasl
* credentials are required. The property contains <code>"true"</code> if
* mechanisms that pass client credentials are required; <code>"false"</code>
* if such mechanisms are not required. The default is <code>"false"</code>.
- * </p>
*
* <p>The value of this constant is <code>"javax.security.sasl.policy.credentials"</code>.
* </p>
@@ -280,7 +279,7 @@ public class Sasl
// -------------------------------------------------------------------------
/**
- * <p>Creates a {@link SaslClient} for the specified mechanism.</p>
+ * Creates a {@link SaslClient} for the specified mechanism.
*
* <p>This method uses the JCA Security Provider Framework, described in the
* "Java Cryptography Architecture API Specification &amp; Reference", for
@@ -490,7 +489,7 @@ public class Sasl
}
/**
- * <p>Creates a {@link SaslServer} for the specified mechanism.</p>
+ * Creates a {@link SaslServer} for the specified mechanism.
*
* <p>This method uses the JCA Security Provider Framework, described in the
* "Java Cryptography Architecture API Specification &amp; Reference", for
@@ -521,7 +520,7 @@ public class Sasl
*
* <pre>
* SaslServerFactory.DIGEST-MD5 com.wiz.sasl.digest.ServerFactory
- * </pre></p>
+ * </pre>
*
* <p>See the "Java Cryptography Architecture API Specification &amp;
* Reference" for information about how to install and configure security
diff --git a/libjava/javax/security/sasl/SaslServerFactory.java b/libjava/javax/security/sasl/SaslServerFactory.java
index 1299634d8b5..d2f279190fa 100644
--- a/libjava/javax/security/sasl/SaslServerFactory.java
+++ b/libjava/javax/security/sasl/SaslServerFactory.java
@@ -48,8 +48,8 @@ import javax.security.auth.callback.CallbackHandler;
* simultaneous requests. It must also have a public constructor that accepts
* no arguments.</p>
*
- * This interface is not normally accessed directly by a server, which will use
- * the {@link Sasl} static methods to create a {@link SaslServer} instance
+ * <p>This interface is not normally accessed directly by a server, which will
+ * use the {@link Sasl} static methods to create a {@link SaslServer} instance
* instead. However, a particular environment may provide and install a new or
* different <code>SaslServerFactory</code>.</p>
*
diff --git a/libjava/javax/swing/AbstractAction.java b/libjava/javax/swing/AbstractAction.java
index 4f0af1c9dd4..c0ddf44ffa5 100644
--- a/libjava/javax/swing/AbstractAction.java
+++ b/libjava/javax/swing/AbstractAction.java
@@ -1,5 +1,5 @@
/* AbstractAction.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,15 +55,13 @@ import javax.swing.event.SwingPropertyChangeSupport;
public abstract class AbstractAction
implements Action, Cloneable, Serializable
{
- static final long serialVersionUID = -6803159439231523484L;
+ private static final long serialVersionUID = -6803159439231523484L;
/**
* enabled
*/
protected boolean enabled = true;
- public static final String ENABLED_PROPERTY = "enabled";
-
/**
* changeSupport
*/
@@ -193,7 +191,7 @@ public abstract class AbstractAction
if (enabled != this.enabled)
{
this.enabled = enabled;
- firePropertyChange(ENABLED_PROPERTY, !this.enabled, this.enabled);
+ firePropertyChange("enabled", !this.enabled, this.enabled);
}
}
diff --git a/libjava/javax/swing/AbstractButton.java b/libjava/javax/swing/AbstractButton.java
index adb3af40823..1232a4ab4fd 100644
--- a/libjava/javax/swing/AbstractButton.java
+++ b/libjava/javax/swing/AbstractButton.java
@@ -661,7 +661,7 @@ public abstract class AbstractButton extends JComponent
*
* @param e The event signifying that the button's model changed state
*/
- public void fireItemStateChanged(ItemEvent e)
+ protected void fireItemStateChanged(ItemEvent e)
{
e.setSource(this);
ItemListener[] listeners = getItemListeners();
@@ -676,7 +676,7 @@ public abstract class AbstractButton extends JComponent
*
* @param e The event signifying that the button's model was clicked
*/
- public void fireActionPerformed(ActionEvent e)
+ protected void fireActionPerformed(ActionEvent e)
{
e.setSource(this);
ActionListener[] listeners = getActionListeners();
@@ -689,7 +689,7 @@ public abstract class AbstractButton extends JComponent
* Calls {@link ChangeEvent.stateChanged} on each {@link ChangeListener}
* in the button's listener list.
*/
- public void fireStateChanged()
+ protected void fireStateChanged()
{
ChangeListener[] listeners = getChangeListeners();
@@ -740,10 +740,10 @@ public abstract class AbstractButton extends JComponent
if (old != mne)
{
- getModel().setMnemonic(mne);
+ getModel().setMnemonic(mne);
if (text != null && ! text.equals(""))
- {
+ {
// Since lower case char = upper case char for
// mnemonic, we will convert both text and mnemonic
// to upper case before checking if mnemonic character occurs
@@ -753,9 +753,9 @@ public abstract class AbstractButton extends JComponent
setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne));
}
- firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne);
- revalidate();
- repaint();
+ firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne);
+ revalidate();
+ repaint();
}
}
@@ -806,7 +806,7 @@ public abstract class AbstractButton extends JComponent
public void setRolloverEnabled(boolean r)
{
if (rollOverEnabled != r)
- {
+ {
rollOverEnabled = r;
firePropertyChange(ROLLOVER_ENABLED_CHANGED_PROPERTY, !r, r);
revalidate();
@@ -1450,7 +1450,7 @@ public abstract class AbstractButton extends JComponent
// Set actionCommand to button's text by default if it is not specified
if (actionCommand != null)
- setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY)));
+ setActionCommand((String)(a.getValue(Action.ACTION_COMMAND_KEY)));
else
setActionCommand(getText());
}
@@ -1509,7 +1509,7 @@ public abstract class AbstractButton extends JComponent
public void propertyChange(PropertyChangeEvent e)
{
Action act = (Action) (e.getSource());
- if (e.getPropertyName().equals(AbstractAction.ENABLED_PROPERTY))
+ if (e.getPropertyName().equals("enabled"))
setEnabled(act.isEnabled());
else if (e.getPropertyName().equals(Action.NAME))
setText((String)(act.getValue(Action.NAME)));
@@ -1847,7 +1847,39 @@ public abstract class AbstractButton extends JComponent
*/
protected String paramString()
{
- return "AbstractButton";
+ StringBuffer sb = new StringBuffer();
+ sb.append(super.paramString());
+ sb.append(",defaultIcon=");
+ if (getIcon() != null)
+ sb.append(getIcon());
+ sb.append(",disabledIcon=");
+ if (getDisabledIcon() != null)
+ sb.append(getDisabledIcon());
+ sb.append(",disabledSelectedIcon=");
+ if (getDisabledSelectedIcon() != null)
+ sb.append(getDisabledSelectedIcon());
+ sb.append(",margin=");
+ if (getMargin() != null)
+ sb.append(getMargin());
+ sb.append(",paintBorder=").append(isBorderPainted());
+ sb.append(",paintFocus=").append(isFocusPainted());
+ sb.append(",pressedIcon=");
+ if (getPressedIcon() != null)
+ sb.append(getPressedIcon());
+ sb.append(",rolloverEnabled=").append(isRolloverEnabled());
+ sb.append(",rolloverIcon=");
+ if (getRolloverIcon() != null)
+ sb.append(getRolloverIcon());
+ sb.append(",rolloverSelected=");
+ if (getRolloverSelectedIcon() != null)
+ sb.append(getRolloverSelectedIcon());
+ sb.append(",selectedIcon=");
+ if (getSelectedIcon() != null)
+ sb.append(getSelectedIcon());
+ sb.append(",text=");
+ if (getText() != null)
+ sb.append(getText());
+ return sb.toString();
}
/**
diff --git a/libjava/javax/swing/AbstractCellEditor.java b/libjava/javax/swing/AbstractCellEditor.java
index 196e2e2696c..7cc57516a1c 100644
--- a/libjava/javax/swing/AbstractCellEditor.java
+++ b/libjava/javax/swing/AbstractCellEditor.java
@@ -53,7 +53,7 @@ import javax.swing.event.EventListenerList;
public abstract class AbstractCellEditor
implements CellEditor, Serializable
{
- static final long serialVersionUID = -1048006551406220959L;
+ private static final long serialVersionUID = -1048006551406220959L;
/**
* listenerList
diff --git a/libjava/javax/swing/AbstractListModel.java b/libjava/javax/swing/AbstractListModel.java
index 9fe1bcbee2f..a380b2a2eda 100644
--- a/libjava/javax/swing/AbstractListModel.java
+++ b/libjava/javax/swing/AbstractListModel.java
@@ -54,7 +54,7 @@ import javax.swing.event.ListDataListener;
*/
public abstract class AbstractListModel implements ListModel, Serializable
{
- static final long serialVersionUID = -3285184064379168730L;
+ private static final long serialVersionUID = -3285184064379168730L;
/** List of ListDataListeners called for each change to the list. */
protected EventListenerList listenerList;
@@ -100,25 +100,12 @@ public abstract class AbstractListModel implements ListModel, Serializable
protected void fireContentsChanged(Object source, int startIndex,
int endIndex)
{
- // Variables
- ListDataEvent event;
- ListDataListener[] listeners;
- ListDataListener listener;
- int index;
-
- // Create Event
- event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED,
- startIndex, endIndex);
-
- // Get Listeners
- listeners = getListDataListeners();
-
- // Process Listeners
- for (index = 0; index < listeners.length; index++)
- {
- listener = (ListDataListener) listeners[index];
- listener.contentsChanged(event);
- }
+ ListDataEvent event = new ListDataEvent(source, ListDataEvent.CONTENTS_CHANGED,
+ startIndex, endIndex);
+ ListDataListener[] listeners = getListDataListeners();
+
+ for (int index = 0; index < listeners.length; index++)
+ listeners[index].contentsChanged(event);
}
/**
@@ -134,25 +121,13 @@ public abstract class AbstractListModel implements ListModel, Serializable
*/
protected void fireIntervalAdded(Object source, int startIndex, int endIndex)
{
- // Variables
- ListDataEvent event;
- ListDataListener[] listeners;
- ListDataListener listener;
- int index;
-
- // Create Event
- event = new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED,
- startIndex, endIndex);
-
- // Get Listeners
- listeners = getListDataListeners();
-
- // Process Listeners
- for (index = 0; index < listeners.length; index++)
- {
- listener = listeners[index];
- listener.intervalAdded(event);
- }
+ ListDataEvent event =
+ new ListDataEvent(source, ListDataEvent.INTERVAL_ADDED,
+ startIndex, endIndex);
+ ListDataListener[] listeners = getListDataListeners();
+
+ for (int index = 0; index < listeners.length; index++)
+ listeners[index].intervalAdded(event);
}
/**
@@ -169,25 +144,13 @@ public abstract class AbstractListModel implements ListModel, Serializable
protected void fireIntervalRemoved(Object source, int startIndex,
int endIndex)
{
- // Variables
- ListDataEvent event;
- ListDataListener[] listeners;
- ListDataListener listener;
- int index;
-
- // Create Event
- event = new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED,
- startIndex, endIndex);
-
- // Get Listeners
- listeners = getListDataListeners();
-
- // Process Listeners
- for (index = 0; index < listeners.length; index++)
- {
- listener = listeners[index];
- listener.intervalRemoved(event);
- }
+ ListDataEvent event =
+ new ListDataEvent(source, ListDataEvent.INTERVAL_REMOVED,
+ startIndex, endIndex);
+ ListDataListener[] listeners = getListDataListeners();
+
+ for (int index = 0; index < listeners.length; index++)
+ listeners[index].intervalRemoved(event);
}
/**
diff --git a/libjava/javax/swing/AbstractSet.java b/libjava/javax/swing/AbstractSet.java
deleted file mode 100644
index 01bb58fd883..00000000000
--- a/libjava/javax/swing/AbstractSet.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/* AbstractSet.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package javax.swing;
-
-import java.util.AbstractCollection;
-import java.util.Collection;
-import java.util.Set;
-
-/**
- * Empty
- *
- * @author Ronald Veldema (rveldema@cs.vu.nl)
- */
-public abstract class AbstractSet extends AbstractCollection implements Set
-{
- boolean contained(Object []a1, Object b)
- {
- for (int i=0;i<a1.length;i++)
- {
- if (a1[i] == b)
- return true;
- }
- return false;
- }
-
- public boolean equals(Object o)
- {
- if (! (o instanceof AbstractSet))
- return false;
- AbstractSet s = (AbstractSet) o;
-
- if (s == this)
- return true;
-
- if (s.size() != size())
- return false;
-
- Object[] a1 = s.toArray();
- Object[] a2 = toArray();
-
- for (int i=0;i<a1.length;i++)
- {
- if (! contained(a2, a1[i]))
- return false;
- }
- return true;
- }
-
- public int hashCode()
- {
- int hash = 0;
- Object[] a1 = toArray();
-
- if (a1 == null)
- return 0;
-
- for (int i=0; i<a1.length; i++)
- {
- hash += a1[i].hashCode();
- }
- return hash;
- }
-
- public boolean removeAll(Collection c)
- {
- return false;
- }
-}
diff --git a/libjava/javax/swing/ActionMap.java b/libjava/javax/swing/ActionMap.java
index 645252f5b26..26d1d6fa989 100644
--- a/libjava/javax/swing/ActionMap.java
+++ b/libjava/javax/swing/ActionMap.java
@@ -49,7 +49,7 @@ import java.util.Set;
/**
- * @author Andrew Selkirk
+ * @author Andrew Selkirk
* @author Michael Koch
*/
public class ActionMap
@@ -57,30 +57,30 @@ public class ActionMap
{
private static final long serialVersionUID = -6277518704513986346L;
- /**
- * actionMap
- */
- private Map actionMap = new HashMap();
+ /**
+ * actionMap
+ */
+ private Map actionMap = new HashMap();
- /**
- * parent
- */
+ /**
+ * parent
+ */
private ActionMap parent;
- /**
+ /**
* Creates a new <code>ActionMap</code> instance.
- */
+ */
public ActionMap()
{
}
- /**
+ /**
* Returns an action associated with an object.
*
* @param key the key of the enty
*
* @return the action associated with key, may be null
- */
+ */
public Action get(Object key)
{
Object result = actionMap.get(key);
@@ -88,123 +88,123 @@ public class ActionMap
if (result == null && parent != null)
result = parent.get(key);
- return (Action) result;
+ return (Action) result;
}
- /**
+ /**
* Puts a new <code>Action</code> into the <code>ActionMap</code>.
* If action is null an existing entry will be removed.
*
* @param key the key for the entry
* @param action the action.
- */
+ */
public void put(Object key, Action action)
{
if (action == null)
- actionMap.remove(key);
+ actionMap.remove(key);
else
- actionMap.put(key, action);
+ actionMap.put(key, action);
}
- /**
+ /**
* Remove an entry from the <code>ActionMap</code>.
*
* @param key the key of the entry to remove
- */
+ */
public void remove(Object key)
{
- actionMap.remove(key);
+ actionMap.remove(key);
}
- /**
+ /**
* Returns the parent of this <code>ActionMap</code>.
*
* @return the parent, may be null.
- */
+ */
public ActionMap getParent()
{
- return parent;
+ return parent;
}
- /**
+ /**
* Sets a parent for this <code>ActionMap</code>.
*
* @param parentMap the new parent
- */
+ */
public void setParent(ActionMap parentMap)
{
- parent = parentMap;
+ parent = parentMap;
}
- /**
+ /**
* Returns the number of entries in this <code>ActionMap</code>.
*
* @return the number of entries
- */
+ */
public int size()
{
- return actionMap.size();
+ return actionMap.size();
}
- /**
+ /**
* Clears the <code>ActionMap</code>.
- */
+ */
public void clear()
{
- actionMap.clear();
+ actionMap.clear();
}
- /**
+ /**
* Returns all keys of entries in this <code>ActionMap</code>.
*
* @return an array of keys
- */
+ */
public Object[] keys()
{
return actionMap.keySet().toArray();
}
- /**
+ /**
* Returns all keys of entries in this <code>ActionMap</code>
* and all its parents.
*
* @return an array of keys
- */
+ */
public Object[] allKeys()
{
Set set = new HashSet();
if (parent != null)
- set.addAll(Arrays.asList(parent.allKeys()));
+ set.addAll(Arrays.asList(parent.allKeys()));
set.addAll(actionMap.keySet());
return set.toArray();
}
- /**
- * writeObject
+ /**
+ * writeObject
*
* @param stream the stream to write to
*
* @exception IOException If an error occurs
- */
+ */
private void writeObject(ObjectOutputStream stream)
throws IOException
{
- // TODO
+ // TODO
}
- /**
- * readObject
+ /**
+ * readObject
*
* @param stream the stream to read from
*
* @exception ClassNotFoundException If the serialized class cannot be found
* @exception IOException If an error occurs
- */
+ */
private void readObject(ObjectInputStream stream)
throws ClassNotFoundException, IOException
{
- // TODO
+ // TODO
}
}
diff --git a/libjava/javax/swing/BoundedRangeModel.java b/libjava/javax/swing/BoundedRangeModel.java
index 907e7045dc1..92cf69df816 100644
--- a/libjava/javax/swing/BoundedRangeModel.java
+++ b/libjava/javax/swing/BoundedRangeModel.java
@@ -35,103 +35,134 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
import javax.swing.event.ChangeListener;
/**
- * BoundedRangeModel
- * @author Andrew Selkirk
- * @version 1.0
+ * @author Andrew Selkirk
*/
-public interface BoundedRangeModel {
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * getValue
- * @returns int
- */
- int getValue();
-
- /**
- * setValue
- * @param value TODO
- */
- void setValue(int value);
-
- /**
- * getMinimum
- * @returns int
- */
- int getMinimum();
-
- /**
- * setMinimum
- * @param minimum TODO
- */
- void setMinimum(int minimum);
-
- /**
- * getMaximum
- * @returns int
- */
- int getMaximum();
-
- /**
- * setMaximum
- * @param maximum TODO
- */
- void setMaximum(int maximum);
-
- /**
- * getValueIsAdjusting
- * @returns boolean
- */
- boolean getValueIsAdjusting();
-
- /**
- * setValueIsAdjusting
- * @param adjusting TODO
- */
- void setValueIsAdjusting(boolean adjusting);
-
- /**
- * getExtent
- * @returns int
- */
- int getExtent();
-
- /**
- * setExtent
- * @param extent TODO
- */
- void setExtent(int extent);
-
- /**
- * setRangeProperties
- * @param value TODO
- * @param extent TODO
- * @param min TODO
- * @param max TODO
- * @param adjusting TODO
- */
- void setRangeProperties(int value, int extent, int min,
- int max, boolean adjusting);
-
- /**
- * addChangeListener
- * @param listener TODO
- */
- void addChangeListener(ChangeListener listener);
-
- /**
- * removeChangeListener
- * @param listener TODO
- */
- void removeChangeListener(ChangeListener listener);
-
-
-} // BoundedRangeModel
+public interface BoundedRangeModel
+{
+ /**
+ * getValue
+ *
+ * @return int
+ *
+ * @see #setValue(int)
+ */
+ int getValue();
+
+ /**
+ * setValue
+ *
+ * @param value the value
+ *
+ * @see #getValue()
+ */
+ void setValue(int value);
+
+ /**
+ * getMinimum
+ *
+ * @return int
+ *
+ * @see #setMinimum(int)
+ */
+ int getMinimum();
+
+ /**
+ * setMinimum
+ *
+ * @param minimum the minimum value
+ *
+ * @see #getMinimum()
+ */
+ void setMinimum(int minimum);
+
+ /**
+ * getMaximum
+ *
+ * @return int
+ *
+ * @see #setMaximum(int)
+ */
+ int getMaximum();
+
+ /**
+ * setMaximum
+ *
+ * @param maximum the maximum value
+ *
+ * @see #getMaximum()
+ */
+ void setMaximum(int maximum);
+
+ /**
+ * Returns the value of the <code>valueIsAdjusting</code> property.
+ *
+ * @return <code>true</code> if value is adjusting,
+ * otherwise <code>false</code>
+ *
+ * @see setValueIsAdjusting(boolean)
+ */
+ boolean getValueIsAdjusting();
+
+ /**
+ * setValueIsAdjusting
+ *
+ * @param adjusting <code>true</code> if adjusting,
+ * <code>false</code> otherwise
+ *
+ * @see #getValueIsAdjusting()
+ */
+ void setValueIsAdjusting(boolean adjusting);
+
+ /**
+ * Returns the current extent.
+ *
+ * @return the extent
+ *
+ * @see #setExtent(int)
+ */
+ int getExtent();
+
+ /**
+ * setExtent
+ *
+ * @param extent the extent
+ *
+ * @see #getExtent()
+ */
+ void setExtent(int extent);
+
+ /**
+ * setRangeProperties
+ * @param value the value
+ * @param extent the extent
+ * @param minnimum the minimum value
+ * @param maximum the maximum value
+ * @param adjusting TODO
+ */
+ void setRangeProperties(int value, int extent, int minimum, int maximum,
+ boolean adjusting);
+
+ /**
+ * Adds a <code>ChangeListener</code> to this object.
+ *
+ * @param listener the listener to add
+ *
+ * @see #removeChangeListener(javax.swing.event.ChangeListener)
+ */
+ void addChangeListener(ChangeListener listener);
+
+ /**
+ * Removes a <code>ChangeListener</code> from this object.
+ *
+ * @param listener the listener to remove
+ *
+ * @see #addChangeListener(javax.swing.event.ChangeListener)
+ */
+ void removeChangeListener(ChangeListener listener);
+}
diff --git a/libjava/javax/swing/ComponentInputMap.java b/libjava/javax/swing/ComponentInputMap.java
index 84110c5f0f2..1c85892f56a 100644
--- a/libjava/javax/swing/ComponentInputMap.java
+++ b/libjava/javax/swing/ComponentInputMap.java
@@ -39,17 +39,17 @@ package javax.swing;
/**
- * @author Andrew Selkirk
+ * @author Andrew Selkirk
* @author Michael Koch
*/
public class ComponentInputMap extends InputMap
{
- /**
+ /**
* The component to notify.
- */
- private JComponent component;
+ */
+ private JComponent component;
- /**
+ /**
* Creates <code>ComponentInputMap</code> object that notifies the given
* component about changes to it.
*
diff --git a/libjava/javax/swing/DebugGraphics.java b/libjava/javax/swing/DebugGraphics.java
index 6aa80adf5af..074d4511477 100644
--- a/libjava/javax/swing/DebugGraphics.java
+++ b/libjava/javax/swing/DebugGraphics.java
@@ -1,5 +1,5 @@
/* DebugGraphics.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -56,6 +56,30 @@ import java.text.AttributedCharacterIterator;
*/
public class DebugGraphics extends Graphics
{
+ /**
+ * LOG_OPTION
+ */
+ public static final int LOG_OPTION = 1;
+
+ /**
+ * FLASH_OPTION
+ */
+ public static final int FLASH_OPTION = 2;
+
+ /**
+ * BUFFERED_OPTION
+ */
+ public static final int BUFFERED_OPTION = 4;
+
+ /**
+ * NONE_OPTION
+ */
+ public static final int NONE_OPTION = -1;
+
+ static Color debugFlashColor = Color.RED;
+ static int debugFlashCount = 10;
+ static int debugFlashTime = 1000;
+ static PrintStream debugLogStream = System.out;
/**
* graphics
@@ -63,6 +87,11 @@ public class DebugGraphics extends Graphics
Graphics graphics;
/**
+ * color
+ */
+ Color color = Color.BLACK;
+
+ /**
* buffer
*/
Image buffer;
@@ -88,26 +117,6 @@ public class DebugGraphics extends Graphics
int yOffset;
/**
- * LOG_OPTION
- */
- public static final int LOG_OPTION = 1;
-
- /**
- * FLASH_OPTION
- */
- public static final int FLASH_OPTION = 2;
-
- /**
- * BUFFERED_OPTION
- */
- public static final int BUFFERED_OPTION = 4;
-
- /**
- * NONE_OPTION
- */
- public static final int NONE_OPTION = -1;
-
- /**
* Creates a <code>DebugGraphics</code> object.
*/
public DebugGraphics()
@@ -116,55 +125,62 @@ public class DebugGraphics extends Graphics
}
/**
- * Constructor DebugGraphics
- * @param graphics TODO
+ * Creates a <code>DebugGraphics</code> object.
+ *
+ * @param graphics The <code>Graphics</code> object to wrap
* @param component TODO
*/
public DebugGraphics(Graphics graphics, JComponent component)
{
- // TODO
+ this.graphics = graphics;
+ // FIXME: What shall we do with component ?
}
/**
- * Constructor DebugGraphics
- * @param graphics TODO
+ * Creates a <code>DebugGraphics</code> object.
+ *
+ * @param graphics The <code>Graphics</code> object to wrap
*/
public DebugGraphics(Graphics graphics)
{
- // TODO
+ this.graphics = graphics;
}
/**
- * setColor
- * @param value0 TODO
+ * Sets the color to draw stuff with.
+ *
+ * @param color The color
*/
public void setColor(Color color)
{
- // TODO
+ this.color = color;
}
/**
- * create
+ * Creates a overrides <code>Graphics.create</code> to create a
+ * <code>DebugGraphics</code> object.
*
- * @return Graphics
+ * @return a new <code>DebugGraphics</code> object.
*/
public Graphics create()
{
- return null; // TODO
+ return new DebugGraphics(graphics.create());
}
/**
- * create
+ * Creates a overrides <code>Graphics.create</code> to create a
+ * <code>DebugGraphics</code> object.
*
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
- * @returns Graphics
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @param width the width
+ * @param height the height
+ *
+ * @return a new <code>DebugGraphics</code> object.
*/
- public Graphics create(int valx, int y, int w, int h)
+ public Graphics create(int x, int y, int width, int height)
{
- return null; // TODO
+ return new DebugGraphics(graphics.create(x, y, width, height));
}
/**
@@ -174,7 +190,7 @@ public class DebugGraphics extends Graphics
*/
public static Color flashColor()
{
- return null; // TODO
+ return debugFlashColor;
}
/**
@@ -184,7 +200,7 @@ public class DebugGraphics extends Graphics
*/
public static void setFlashColor(Color color)
{
- // TODO
+ debugFlashColor = color;
}
/**
@@ -194,7 +210,7 @@ public class DebugGraphics extends Graphics
*/
public static int flashTime()
{
- return 0; // TODO
+ return debugFlashTime;
}
/**
@@ -204,16 +220,17 @@ public class DebugGraphics extends Graphics
*/
public static void setFlashTime(int time)
{
- // TODO
+ debugFlashTime = time;
}
/**
* flashCount
- * @returns int
+ *
+ * @return The number of flashes
*/
public static int flashCount()
{
- return 0; // TODO
+ return debugFlashCount;
}
/**
@@ -223,7 +240,7 @@ public class DebugGraphics extends Graphics
*/
public static void setFlashCount(int count)
{
- // TODO
+ debugFlashCount = count;
}
/**
@@ -233,7 +250,7 @@ public class DebugGraphics extends Graphics
*/
public static PrintStream logStream()
{
- return null; // TODO
+ return debugLogStream;
}
/**
@@ -243,16 +260,17 @@ public class DebugGraphics extends Graphics
*/
public static void setLogStream(PrintStream stream)
{
- // TODO
+ debugLogStream = stream;
}
/**
* getFont
- * @returns Font
+ *
+ * @return The font
*/
public Font getFont()
{
- return null; // TODO
+ return graphics.getFont();
}
/**
@@ -262,46 +280,50 @@ public class DebugGraphics extends Graphics
*/
public void setFont(Font font)
{
- // TODO
+ graphics.setFont(font);
}
/**
- * getColor
- * @returns Color
+ * Returns the color used for drawing.
+ *
+ * @return The color.
*/
public Color getColor()
{
- return null; // TODO
+ return color;
}
/**
- * getFontMetrics
- * @returns FontMetrics
+ * Returns the font metrics of the current font.
+ *
+ * @return a <code>FontMetrics</code> object
*/
public FontMetrics getFontMetrics()
{
- return null; // TODO
+ return graphics.getFontMetrics();
}
/**
- * getFontMetrics
- * @param font TODO
- * @returns FontMetrics
+ * Returns the font metrics for a given font.
+ *
+ * @param font the font to get the metrics for
+ *
+ * @return a <code>FontMetrics</code> object
*/
public FontMetrics getFontMetrics(Font font)
{
- return null; // TODO
+ return graphics.getFontMetrics(font);
}
/**
* translate
*
- * @param x TODO
- * @param y TODO
+ * @param x the x coordinate
+ * @param y the y coordinate
*/
public void translate(int x, int y)
{
- // TODO
+ graphics.translate(x, y);
}
/**
@@ -309,237 +331,291 @@ public class DebugGraphics extends Graphics
*/
public void setPaintMode()
{
- // TODO
+ graphics.setPaintMode();
}
/**
* setXORMode
*
- * @param color TODO
+ * @param color the color
*/
public void setXORMode(Color color)
{
- // TODO
+ graphics.setXORMode(color);
}
/**
* getClipBounds
- * @returns Rectangle
+ *
+ * @return Rectangle
*/
public Rectangle getClipBounds()
{
- return null; // TODO
+ return graphics.getClipBounds();
}
/**
- * clipRect
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- * @param value3 TODO
+ * Intersects the current clip region with the given region.
+ *
+ * @param x The x-position of the region
+ * @param y The y-position of the region
+ * @param width The width of the region
+ * @param height The height of the region
*/
- public void clipRect(int value0, int value1, int value2, int value3)
+ public void clipRect(int x, int y, int width, int height)
{
- // TODO
+ graphics.clipRect(x, y, width, height);
}
/**
- * setClip
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ * Sets the clipping region.
+ *
+ * @param x The x-position of the region
+ * @param y The y-position of the region
+ * @param width The width of the region
+ * @param height The height of the region
*/
- public void setClip(int x, int y, int w, int h)
+ public void setClip(int x, int y, int width, int height)
{
- // TODO
+ graphics.setClip(x, y, width, height);
}
/**
- * getClip
- * @returns Shape
+ * Returns the current clipping region.
+ *
+ * @return Shape
*/
public Shape getClip()
{
- return null; // TODO
+ return graphics.getClip();
}
/**
- * setClip
- * @param shape TODO
+ * Sets the current clipping region
+ *
+ * @param shape The clippin region
*/
public void setClip(Shape shape)
{
- // TODO
+ graphics.setClip(shape);
}
+ private void sleep(int milliseconds)
+ {
+ try
+ {
+ Thread.sleep(milliseconds);
+ }
+ catch (InterruptedException e)
+ {
+ // Ignore this.
+ }
+ }
+
/**
- * drawRect
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param valh TODO
+ * Draws a rectangle.
+ *
+ * @param x The x-position of the rectangle
+ * @param y The y-position of the rectangle
+ * @param width The width of the rectangle
+ * @param height The height of the rectangle
*/
- public void drawRect(int x, int y, int w, int h)
+ public void drawRect(int x, int y, int width, int height)
{
- // TODO
- } // drawRect()
+ for (int index = 0; index < (debugFlashCount - 1); ++index)
+ {
+ graphics.setColor(color);
+ graphics.drawRect(x, y, width, height);
+ sleep(debugFlashTime);
+
+ graphics.setColor(debugFlashColor);
+ graphics.drawRect(x, y, width, height);
+ sleep(debugFlashTime);
+ }
+
+ graphics.setColor(color);
+ graphics.drawRect(x, y, width, height);
+ }
/**
- * fillRect
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ * Draws a filled rectangle.
+ *
+ * @param x The x-position of the rectangle
+ * @param y The y-position of the rectangle
+ * @param width The width of the rectangle
+ * @param height The height of the rectangle
*/
- public void fillRect(int x, int y, int w, int h)
+ public void fillRect(int x, int y, int width, int height)
{
- // TODO
- } // fillRect()
+ for (int index = 0; index < (debugFlashCount - 1); ++index)
+ {
+ graphics.setColor(color);
+ graphics.fillRect(x, y, width, height);
+ sleep(debugFlashTime);
+
+ graphics.setColor(debugFlashColor);
+ graphics.fillRect(x, y, width, height);
+ sleep(debugFlashTime);
+ }
+
+ graphics.setColor(color);
+ graphics.fillRect(x, y, width, height);
+ }
/**
* clearRect
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ *
+ * @param x The x-position of the rectangle
+ * @param y The y-position of the rectangle
+ * @param width The width of the rectangle
+ * @param height The height of the rectangle
*/
- public void clearRect(int x, int y, int w, int h)
+ public void clearRect(int x, int y, int width, int height)
{
- // TODO
+ graphics.clearRect(x, y, width, height);
}
/**
* drawRoundRect
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ *
+ * @param x The x-position of the rectangle
+ * @param y The y-position of the rectangle
+ * @param width The width of the rectangle
+ * @param height The height of the rectangle
* @param arcWidth TODO
* @param arcHeight TODO
*/
- public void drawRoundRect(int x, int y, int w, int h, int arcWidth,
- int arcHeight)
+ public void drawRoundRect(int x, int y, int width, int height,
+ int arcWidth, int arcHeight)
{
- // TODO
+ graphics.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
}
/**
* fillRoundRect
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ *
+ * @param x The x-position of the rectangle
+ * @param y The y-position of the rectangle
+ * @param width The width of the rectangle
+ * @param height The height of the rectangle
* @param arcWidth TODO
* @param arcHeight TODO
*/
- public void fillRoundRect(int x, int y, int w, int h, int arcWidth,
- int arcHeight)
+ public void fillRoundRect(int x, int y, int width, int height,
+ int arcWidth, int arcHeight)
{
- // TODO
+ graphics.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
}
/**
* drawLine
- * @param x1 TODO
- * @param y1 TODO
- * @param x2 TODO
- * @param y2 TODO
+ *
+ * @param x1 The x-position of the start
+ * @param y1 The y-position of the start
+ * @param x2 The x-position of the end
+ * @param y2 The y-position of the end
*/
public void drawLine(int x1, int y1, int x2, int y2)
{
- // TODO
+ graphics.drawLine(x1, y1, x2, y2);
}
/**
* draw3DRect
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ *
+ * @param x The x-position of the rectangle
+ * @param y The y-position of the rectangle
+ * @param width The width of the rectangle
+ * @param height The height of the rectangle
* @param raised TODO
*/
- public void draw3DRect(int x, int y, int w, int h, boolean raised)
+ public void draw3DRect(int x, int y, int width, int height, boolean raised)
{
- // TODO
+ graphics.draw3DRect(x, y, width, height, raised);
}
/**
* fill3DRect
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ *
+ * @param x The x-position of the rectangle
+ * @param y The y-position of the rectangle
+ * @param width The width of the rectangle
+ * @param height The height of the rectangle
* @param raised TODO
*/
- public void fill3DRect(int x, int y, int w, int h, boolean raised)
+ public void fill3DRect(int x, int y, int width, int height, boolean raised)
{
- // TODO
+ graphics.fill3DRect(x, y, width, height, raised);
}
/**
* drawOval
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ *
+ * @param x the x coordinate
+ * @param y the y coordiante
+ * @param width the width
+ * @param height the height
*/
- public void drawOval(int x, int y, int w, int h)
+ public void drawOval(int x, int y, int width, int height)
{
- // TODO
+ graphics.drawOval(x, y, width, height);
}
/**
* fillOval
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ *
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @param width the width
+ * @param height the height
*/
- public void fillOval(int x, int y, int w, int h)
+ public void fillOval(int x, int y, int width, int height)
{
- // TODO
+ graphics.fillOval(x, y, width, height);
}
/**
* drawArc
*
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @param width the width
+ * @param height the height
* @param startAngle TODO
* @param arcAngle TODO
*/
- public void drawArc(int x, int y, int w, int h, int startAngle, int arcAngle)
+ public void drawArc(int x, int y, int width, int height,
+ int startAngle, int arcAngle)
{
- // TODO
+ graphics.drawArc(x, y, width, height, startAngle, arcAngle);
}
/**
* fillArc
*
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
+ * @param x the coordinate
+ * @param y the y coordinate
+ * @param width the width
+ * @param height the height
* @param startAngle TODO
* @param arcAngle TODO
*/
- public void fillArc(int x, int y, int w, int h, int startAngle, int arcAngle)
+ public void fillArc(int x, int y, int width, int height,
+ int startAngle, int arcAngle)
{
- // TODO
+ graphics.fillArc(x, y, width, height, startAngle, arcAngle);
}
/**
* drawPolyline
+ *
* @param xpoints TODO
* @param ypoints TODO
* @param npoints TODO
*/
public void drawPolyline(int[] xpoints, int[] ypoints, int npoints)
{
- // TODO
+ graphics.drawPolyline(xpoints, ypoints, npoints);
}
/**
@@ -551,7 +627,7 @@ public class DebugGraphics extends Graphics
*/
public void drawPolygon(int[] xpoints, int[] ypoints, int npoints)
{
- // TODO
+ graphics.drawPolygon(xpoints, ypoints, npoints);
}
/**
@@ -563,31 +639,32 @@ public class DebugGraphics extends Graphics
*/
public void fillPolygon(int[] xpoints, int[] ypoints, int npoints)
{
- // TODO
+ graphics.fillPolygon(xpoints, ypoints, npoints);
}
/**
* drawString
*
- * @param string TODO
- * @param x TODO
- * @param y TODO
+ * @param string the string
+ * @param x the x coordinate
+ * @param y the y coordinate
*/
- public void drawString(String string, int s, int y)
+ public void drawString(String string, int x, int y)
{
- // TODO
+ graphics.drawString(string, x, y);
}
/**
* drawString
*
* @param iterator TODO
- * @param x TODO
- * @param y TODO
+ * @param x the x coordinate
+ * @param y the y coordinate
*/
- public void drawString(AttributedCharacterIterator iterator, int x, int y)
+ public void drawString(AttributedCharacterIterator iterator,
+ int x, int y)
{
- // TODO
+ graphics.drawString(iterator, x, y);
}
/**
@@ -596,86 +673,111 @@ public class DebugGraphics extends Graphics
* @param data TODO
* @param offset TODO
* @param length TODO
- * @param x TODO
- * @param y TODO
+ * @param x the x coordinate
+ * @param y the y coordinate
*/
- public void drawBytes(byte[] data, int offset, int length, int x, int y)
+ public void drawBytes(byte[] data, int offset, int length,
+ int x, int y)
{
- // TODO
+ graphics.drawBytes(data, offset, length, x, y);
}
/**
* drawChars
- * @param data TODO
- * @param offset TODO
- * @param length TODO
- * @param value3 TODO
- * @param value4 TODO
+ *
+ * @param data array of characters to draw
+ * @param offset offset in array
+ * @param length number of characters in array to draw
+ * @param x x-position
+ * @param y y-position
*/
- public void drawChars(char[] data, int offset, int value2, int x, int y)
+ public void drawChars(char[] data, int offset, int length,
+ int x, int y)
{
- // TODO
- } // drawChars()
+ for (int index = 0; index < (debugFlashCount - 1); ++index)
+ {
+ graphics.setColor(color);
+ graphics.drawChars(data, offset, length, x, y);
+ sleep(debugFlashTime);
+
+ graphics.setColor(debugFlashColor);
+ graphics.drawChars(data, offset, length, x, y);
+ sleep(debugFlashTime);
+ }
+
+ graphics.setColor(color);
+ graphics.drawChars(data, offset, length, x, y);
+ }
/**
* drawImage
- * @param image TODO
- * @param x TODO
- * @param y TODO
- * @param observer TODO
- * @returns boolean
+ *
+ * @param image The image to draw
+ * @param x The x position
+ * @param y The y position
+ * @param observer The image observer
+ * @return boolean
*/
- public boolean drawImage(Image image, int x, int y, ImageObserver observer)
+ public boolean drawImage(Image image, int x, int y,
+ ImageObserver observer)
{
- return false; // TODO
+ return graphics.drawImage(image, x, y, observer);
}
/**
* drawImage
- * @param image TODO
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
- * @param observer TODO
- * @returns boolean
+ *
+ * @param image The image to draw
+ * @param x The x position
+ * @param y The y position
+ * @param width The width of the area to draw the image
+ * @param height The height of the area to draw the image
+ * @param observer The image observer
+ *
+ * @return boolean
*/
- public boolean drawImage(Image image, int x, int y, int w, int h,
- ImageObserver observer)
+ public boolean drawImage(Image image, int x, int y, int width,
+ int height, ImageObserver observer)
{
- return false; // TODO
+ return graphics.drawImage(image, x, y, width, height, observer);
}
/**
* drawImage
- * @param image TODO
- * @param x TODO
- * @param y TODO
- * @param background TODO
- * @param observer TODO
- * @returns boolean
+ *
+ * @param image The image to draw
+ * @param x The x position
+ * @param y The y position
+ * @param background The color for the background in the opaque regions
+ * of the image
+ * @param observer The image observer
+ *
+ * @return boolean
*/
- public boolean drawImage(Image image, int x, int y, Color background,
- ImageObserver observer)
+ public boolean drawImage(Image image, int x, int y,
+ Color background, ImageObserver observer)
{
- return false; // TODO
+ return graphics.drawImage(image, x, y, background, observer);
}
/**
* drawImage
- * @param image TODO
- * @param x TODO
- * @param y TODO
- * @param w TODO
- * @param h TODO
- * @param background TODO
- * @param observer TODO
- * @returns boolean
- */
- public boolean drawImage(Image image, int x, int y, int w, int h,
- Color background, ImageObserver observer)
+ *
+ * @param image The image to draw
+ * @param x The x position
+ * @param y The y position
+ * @param width The width of the area to draw the image
+ * @param height The height of the area to draw the image
+ * @param background The color for the background in the opaque regions
+ * of the image
+ * @param observer The image observer
+ *
+ * @return boolean
+ */
+ public boolean drawImage(Image image, int x, int y, int width, int height,
+ Color background, ImageObserver observer)
{
- return false; // TODO
+ return graphics.drawImage(image, x, y, width, height, background, observer);
}
/**
@@ -690,14 +792,15 @@ public class DebugGraphics extends Graphics
* @param sy1 TODO
* @param sx2 TODO
* @param sy2 TODO
- * @param observer TODO
- * @returns boolean
+ * @param observer The image observer
+ *
+ * @return boolean
*/
- public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- ImageObserver observer)
+ public boolean drawImage(Image image, int dx1, int dy1,
+ int dx2, int dy2, int sx1, int sy1, int sx2, int sy2,
+ ImageObserver observer)
{
- return false; // TODO
+ return graphics.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer);
}
/**
@@ -712,15 +815,17 @@ public class DebugGraphics extends Graphics
* @param sy1 TODO
* @param sx2 TODO
* @param sy2 TODO
- * @param background TODO
- * @param observer TODO
- * @returns boolean
+ * @param background The color for the background in the opaque regions
+ * of the image
+ * @param observer The image observer
+ *
+ * @return boolean
*/
- public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2,
- int sx1, int sy1, int sx2, int sy2,
- Color background, ImageObserver observer)
+ public boolean drawImage(Image image, int dx1, int dy1,
+ int dx2, int dy2, int sx1, int sy1, int sx2, int sy2,
+ Color background, ImageObserver observer)
{
- return false; // TODO
+ return graphics.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, background, observer);
}
/**
@@ -733,9 +838,10 @@ public class DebugGraphics extends Graphics
* @param destx The x position of the destination area
* @param desty The y posiiton of the destination area
*/
- public void copyArea(int x, int y, int w, int h, int destx, int desty)
+ public void copyArea(int x, int y, int width, int height,
+ int destx, int desty)
{
- // TODO
+ graphics.copyArea(x, y, width, height, destx, desty);
}
/**
@@ -743,7 +849,8 @@ public class DebugGraphics extends Graphics
*/
public void dispose()
{
- // TODO
+ graphics.dispose();
+ graphics = null;
}
/**
@@ -757,22 +864,13 @@ public class DebugGraphics extends Graphics
}
/**
- * toShortString
- * @returns String
- */
- String toShortString()
- {
- return null; // TODO
- } // toShortString()
-
- /**
* setDebugOptions
*
* @param options the debug options
*/
public void setDebugOptions(int options)
{
- // TODO
+ debugOptions = options;
}
/**
@@ -782,6 +880,6 @@ public class DebugGraphics extends Graphics
*/
public int getDebugOptions()
{
- return 0; // TODO
+ return debugOptions;
}
}
diff --git a/libjava/javax/swing/DefaultBoundedRangeModel.java b/libjava/javax/swing/DefaultBoundedRangeModel.java
index 9a2d974cbaa..9c1962379a8 100644
--- a/libjava/javax/swing/DefaultBoundedRangeModel.java
+++ b/libjava/javax/swing/DefaultBoundedRangeModel.java
@@ -1,6 +1,6 @@
/* DefaultBoundedRangeModel.java -- Default implementation
of BoundedRangeModel.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,10 +47,10 @@ import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
/**
- * A default implementation of BoundedRangeModel.
+ * A default implementation of <code>BoundedRangeModel</code>.
*
- * @author <a href="mailto:aselkirk@sympatico.ca">Andrew Selkirk</a>
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class DefaultBoundedRangeModel
implements BoundedRangeModel, Serializable
@@ -59,7 +59,7 @@ public class DefaultBoundedRangeModel
* The identifier of this class in object serialization. Verified
* using the serialver tool of Sun J2SE 1.4.1_01.
*/
- static final long serialVersionUID = 5034068491295259790L;
+ private static final long serialVersionUID = 5034068491295259790L;
/**
@@ -67,7 +67,7 @@ public class DefaultBoundedRangeModel
* when the state of this range model has changed.
*
* <p>The event object is created on demand, the first time it
- * is actually needed.
+ * is actually needed.</p>
*
* @see #fireStateChanged()
*/
@@ -155,7 +155,7 @@ public class DefaultBoundedRangeModel
* @param maximum the initial maximal value of the range model.
*
* @throws IllegalArgumentException if the following condition is
- * not satisfied: <code>minimum <= value <= value + extent <=
+ * not satisfied: <code>minimum &lt;= value &lt;= value + extent &lt;=
* maximum</code>.
*/
public DefaultBoundedRangeModel(int value, int extent, int minimum,
@@ -176,6 +176,8 @@ public class DefaultBoundedRangeModel
/**
* Returns a string with all relevant properties of this range
* model.
+ *
+ * @return a string representing the object
*/
public String toString()
{
@@ -193,6 +195,8 @@ public class DefaultBoundedRangeModel
* Returns the current value of this bounded range model. In a
* scroll bar visualization of a {@link BoundedRangeModel}, the
* <code>value</code> is displayed as the position of the thumb.
+ *
+ * @return the value
*/
public int getValue()
{
@@ -206,6 +210,8 @@ public class DefaultBoundedRangeModel
* <code>value</code> is displayed as the position of the thumb;
* changing the <code>value</code> of a scroll bar's model
* thus moves the thumb to a different position.
+ *
+ * @param value the value
*/
public void setValue(int value)
{
@@ -226,6 +232,8 @@ public class DefaultBoundedRangeModel
* a number greater than or equal to zero. In a scroll bar
* visualization of a {@link BoundedRangeModel}, the
* <code>extent</code> is displayed as the size of the thumb.
+ *
+ * @return the extent
*/
public int getExtent()
{
@@ -282,6 +290,8 @@ public class DefaultBoundedRangeModel
/**
* Returns the current maximal value of this bounded range model.
+ *
+ * @return the maximum
*/
public int getMaximum()
{
@@ -313,7 +323,7 @@ public class DefaultBoundedRangeModel
* around; when the mouse is relased, they set the property to
* <code>false</code> and post a final {@link ChangeEvent}.
*
- * @returns <code>true</code> if the value will change soon again;
+ * @return <code>true</code> if the value will change soon again;
* <code>false</code> if the value will probably not change soon.
*/
public boolean getValueIsAdjusting()
@@ -344,7 +354,7 @@ public class DefaultBoundedRangeModel
/**
- * setRangeProperties
+ * Sets all properties.
*
* @param value the new value of the range model. In a scroll bar
* visualization of a {@link BoundedRangeModel}, the
@@ -422,16 +432,13 @@ public class DefaultBoundedRangeModel
*/
protected void fireStateChanged()
{
- Object[] listeners;
-
- listeners = listenerList.getListenerList();
- for (int i = listeners.length - 2; i >= 0; i -= 2)
- if (listeners[i] == ChangeListener.class)
- {
- if (changeEvent == null)
- changeEvent = new ChangeEvent(this);
- ((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);
- }
+ ChangeListener[] listeners = getChangeListeners();
+
+ if (changeEvent == null)
+ changeEvent = new ChangeEvent(this);
+
+ for (int i = listeners.length - 1; i >= 0; --i)
+ listeners[i].stateChanged(changeEvent);
}
diff --git a/libjava/javax/swing/DefaultButtonModel.java b/libjava/javax/swing/DefaultButtonModel.java
index 543428a931d..0473f53bc21 100644
--- a/libjava/javax/swing/DefaultButtonModel.java
+++ b/libjava/javax/swing/DefaultButtonModel.java
@@ -71,7 +71,7 @@ import javax.swing.event.EventListenerList;
public class DefaultButtonModel implements ButtonModel, Serializable
{
/** DOCUMENT ME! */
- static final long serialVersionUID = -5342609566534980231L;
+ private static final long serialVersionUID = -5342609566534980231L;
/**
* Indicates that the button is <em>partially</em> committed to being
@@ -272,7 +272,7 @@ public class DefaultButtonModel implements ButtonModel, Serializable
*
* @param e The ItemEvent to fire
*/
- public void fireItemStateChanged(ItemEvent e)
+ protected void fireItemStateChanged(ItemEvent e)
{
ItemListener[] ll = getItemListeners();
@@ -288,7 +288,7 @@ public class DefaultButtonModel implements ButtonModel, Serializable
*
* @param e The ActionEvent to fire
*/
- public void fireActionPerformed(ActionEvent e)
+ protected void fireActionPerformed(ActionEvent e)
{
ActionListener[] ll = getActionListeners();
@@ -301,7 +301,7 @@ public class DefaultButtonModel implements ButtonModel, Serializable
* has occurred. This happens in response to the any change to a property
* of the model.
*/
- public void fireStateChanged()
+ protected void fireStateChanged()
{
ChangeListener[] ll = getChangeListeners();
@@ -315,7 +315,7 @@ public class DefaultButtonModel implements ButtonModel, Serializable
* @param stateflag DOCUMENT ME!
* @param b DOCUMENT ME!
*/
- protected void changeState(int stateflag, boolean b)
+ private void changeState(int stateflag, boolean b)
{
int oldstate = stateMask;
int newstate;
diff --git a/libjava/javax/swing/DefaultCellEditor.java b/libjava/javax/swing/DefaultCellEditor.java
index 1dd17b43555..26bf708be2d 100644
--- a/libjava/javax/swing/DefaultCellEditor.java
+++ b/libjava/javax/swing/DefaultCellEditor.java
@@ -58,7 +58,7 @@ public class DefaultCellEditor
extends AbstractCellEditor
implements TableCellEditor, TreeCellEditor
{
- static final long serialVersionUID = 3564035141373880027L;
+ private static final long serialVersionUID = 3564035141373880027L;
/**
* EditorDelegate
diff --git a/libjava/javax/swing/DefaultCellRenderer.java b/libjava/javax/swing/DefaultCellRenderer.java
deleted file mode 100644
index fca2f1d70c9..00000000000
--- a/libjava/javax/swing/DefaultCellRenderer.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* DefaultCellRenderer.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package javax.swing;
-
-// this is what SUN basically told us to do so:
-// no icon though as that's not implemented yet....
-
-import java.awt.Component;
-
-public class DefaultCellRenderer extends JLabel implements ListCellRenderer
-{
- public Component getListCellRendererComponent(JList list,
- Object value,
- int index,
- boolean isSelected,
- boolean cellHasFocus)
- {
- String s = value.toString();
- setText(s);
-
- // System.out.println("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" + s);
-
-
- if (isSelected)
- {
- setBackground(list.getSelectionBackground());
- setForeground(list.getSelectionForeground());
- }
- else
- {
- setBackground(list.getBackground());
- setForeground(list.getForeground());
- }
-
- setEnabled(list.isEnabled());
- setFont(list.getFont());
- return this;
- }
-}
diff --git a/libjava/javax/swing/DefaultComboBoxModel.java b/libjava/javax/swing/DefaultComboBoxModel.java
index a5546f2954a..c2ece643551 100644
--- a/libjava/javax/swing/DefaultComboBoxModel.java
+++ b/libjava/javax/swing/DefaultComboBoxModel.java
@@ -50,12 +50,13 @@ import java.util.Vector;
*
* @author Andrew Selkirk
* @author Olga Rodimina
+ * @author Robert Schuster
* @version 1.0
*/
public class DefaultComboBoxModel extends AbstractListModel
implements MutableComboBoxModel, Serializable
{
- static final long serialVersionUID = 6698657703676921904L;
+ private static final long serialVersionUID = 6698657703676921904L;
/**
* List containing items in the combo box
@@ -182,13 +183,23 @@ public class DefaultComboBoxModel extends AbstractListModel
* ListDataEvent to all registered ListDataListeners of the JComboBox. The
* start and end index of the event is set to -1 to indicate combo box's
* selection has changed, and not its contents.
+ *
+ * <p>If the given object is not contained in the combo box list then nothing
+ * happens.</p>
*
* @param object item to select in the JComboBox
*/
public void setSelectedItem(Object object)
{
- selectedItem = object;
- fireContentsChanged(this, -1, -1);
+
+ /* Updates the selected item only if the given object
+ * is null or in the list (this is how the JDK behaves).
+ */
+ if(object == null || list.contains(object)) {
+ selectedItem = object;
+ fireContentsChanged(this, -1, -1);
+ }
+
}
/**
diff --git a/libjava/javax/swing/DefaultDesktopManager.java b/libjava/javax/swing/DefaultDesktopManager.java
index 4928c5dc9f4..a0dd5e2d1a1 100644
--- a/libjava/javax/swing/DefaultDesktopManager.java
+++ b/libjava/javax/swing/DefaultDesktopManager.java
@@ -1,5 +1,5 @@
/* DefaultDesktopManager.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
import java.awt.Component;
@@ -56,7 +57,7 @@ import javax.swing.JInternalFrame.JDesktopIcon;
public class DefaultDesktopManager implements DesktopManager, Serializable
{
/** DOCUMENT ME! */
- static final long serialVersionUID = 4657624909838017887L;
+ private static final long serialVersionUID = 4657624909838017887L;
/** The property change event fired when the wasIcon property changes. */
static final String WAS_ICON_ONCE_PROPERTY = "wasIconOnce";
@@ -80,7 +81,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
private transient Container pane;
/**
- * An array of Rectangles that holds the bounds of the JDesktopIcons in the
+ * An array of Rectangles that holds the bounds of the JDesktopIcons in the
* JDesktopPane when looking for where to place a new icon.
*/
private transient Rectangle[] iconRects;
@@ -90,7 +91,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
*/
public DefaultDesktopManager()
{
- } // DefaultDesktopManager()
+ }
/**
* This method is not normally called since the user will typically add the
@@ -111,7 +112,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
c.remove(frame.getDesktopIcon());
c.add(frame);
frame.setVisible(true);
- } // openFrame()
+ }
/**
* This method removes the JInternalFrame and JDesktopIcon (if one is
@@ -132,7 +133,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
c.remove(frame);
c.repaint();
}
- } // closeFrame()
+ }
/**
* This method resizes the JInternalFrame to match its parent's bounds.
@@ -171,7 +172,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
// Do nothing.
}
}
- } // maximizeFrame()
+ }
/**
* This method restores the JInternalFrame's bounds to what they were
@@ -200,7 +201,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
setBoundsForFrame(frame, normalBounds.x, normalBounds.y,
normalBounds.width, normalBounds.height);
- } // minimizeFrame()
+ }
/**
* This method removes the JInternalFrame from its parent and adds its
@@ -231,7 +232,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
{
Rectangle r = getBoundsForIconOf(frame);
icon.setBounds(r);
- setWasIcon(frame, true);
+ setWasIcon(frame, Boolean.TRUE);
}
if (c != null)
@@ -243,7 +244,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
}
c.remove(frame);
}
- } // iconifyFrame()
+ }
/**
* This method removes the JInternalFrame's JDesktopIcon representation and
@@ -279,7 +280,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
}
c.invalidate();
- } // deiconifyFrame()
+ }
/**
* This method activates the JInternalFrame by moving it to the front and
@@ -305,7 +306,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
}
frame.toFront();
- } // activateFrame()
+ }
/**
* This method is called when the JInternalFrame loses focus.
@@ -330,7 +331,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
{
}
}
- } // deactivateFrame()
+ }
/**
* This method is called to indicate that the DesktopManager should prepare
@@ -354,7 +355,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
currentDragMode = JDesktopPane.LIVE_DRAG_MODE;
else
currentDragMode = ((JDesktopPane) pane).getDragMode();
- } // beginDraggingFrame()
+ }
/**
* This method is called to drag the JInternalFrame to a new location.
@@ -378,7 +379,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
setBoundsForFrame((JInternalFrame) component, newX, newY, b.width,
b.height);
}
- } // dragFrame()
+ }
/**
* This method indicates that the dragging is done. Any state information
@@ -396,7 +397,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
dragCache = null;
}
component.repaint();
- } // endDraggingFrame()
+ }
/**
* This method is called to indicate that the given JComponent will be
@@ -417,7 +418,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
currentDragMode = JDesktopPane.LIVE_DRAG_MODE;
else
currentDragMode = ((JDesktopPane) pane).getDragMode();
- } // beginResizingFrame()
+ }
/**
* This method resizes the give JComponent.
@@ -440,7 +441,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
else
setBoundsForFrame(component, dragCache.x, dragCache.y, dragCache.width,
dragCache.height);
- } // resizeFrame()
+ }
/**
* This method is called to indicate that the given JComponent has finished
@@ -459,7 +460,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
dragCache = null;
}
component.repaint();
- } // endResizingFrame()
+ }
/**
* This method calls setBounds with the given parameters and repaints the
@@ -482,7 +483,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
component.getParent().repaint();
else
component.repaint();
- } // setBoundsForFrame()
+ }
/**
* This is a helper method that removes the JDesktopIcon of the given
@@ -496,7 +497,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
Container c = icon.getParent();
if (c != null && icon != null)
c.remove(icon);
- } // removeIconFor()
+ }
/**
* This method is called by iconifyFrame to determine the bounds of the
@@ -570,7 +571,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
}
return ideal;
- } // getBoundsForIconOf()
+ }
/**
* This method sets the bounds of the JInternalFrame right before the
@@ -582,7 +583,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
protected void setPreviousBounds(JInternalFrame frame, Rectangle rect)
{
frame.setNormalBounds(rect);
- } // setPreviousBounds()
+ }
/**
* This method returns the normal bounds of the JInternalFrame from before
@@ -595,7 +596,7 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
protected Rectangle getPreviousBounds(JInternalFrame frame)
{
return frame.getNormalBounds();
- } // getPreviousBounds()
+ }
/**
* This method sets the value to true if the given JInternalFrame has been
@@ -605,10 +606,10 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
* @param value True if the JInternalFrame has been iconized and the bounds
* of the JDesktopIcon are valid.
*/
- protected void setWasIcon(JInternalFrame frame, boolean value)
+ protected void setWasIcon(JInternalFrame frame, Boolean value)
{
- frame.setWasIcon(value, WAS_ICON_ONCE_PROPERTY);
- } // setWasIcon()
+ frame.setWasIcon(value.booleanValue(), WAS_ICON_ONCE_PROPERTY);
+ }
/**
* This method returns true if the given JInternalFrame has been iconized
@@ -622,5 +623,5 @@ public class DefaultDesktopManager implements DesktopManager, Serializable
protected boolean wasIcon(JInternalFrame frame)
{
return frame.getWasIcon();
- } // wasIcon()
-} // DefaultDesktopManager
+ }
+}
diff --git a/libjava/javax/swing/DefaultListCellRenderer.java b/libjava/javax/swing/DefaultListCellRenderer.java
index 4c4cee3c2bb..91b8a8a2edd 100644
--- a/libjava/javax/swing/DefaultListCellRenderer.java
+++ b/libjava/javax/swing/DefaultListCellRenderer.java
@@ -52,10 +52,10 @@ import javax.swing.border.EmptyBorder;
* @author Andrew Selkirk
* @version 1.0
*/
-public class DefaultListCellRenderer extends JLabel implements ListCellRenderer,
- Serializable
+public class DefaultListCellRenderer extends JLabel
+ implements ListCellRenderer, Serializable
{
- static final long serialVersionUID = 7708947179685189462L;
+ private static final long serialVersionUID = 7708947179685189462L;
public static class UIResource extends DefaultListCellRenderer
implements javax.swing.plaf.UIResource
@@ -89,6 +89,7 @@ public class DefaultListCellRenderer extends JLabel implements ListCellRenderer,
String s = value.toString();
setText(s);
setOpaque(true);
+ setHorizontalAlignment(LEFT);
if (isSelected)
{
diff --git a/libjava/javax/swing/DefaultListModel.java b/libjava/javax/swing/DefaultListModel.java
index 53dd20cbc10..c3704dbea9e 100644
--- a/libjava/javax/swing/DefaultListModel.java
+++ b/libjava/javax/swing/DefaultListModel.java
@@ -1,5 +1,5 @@
/* DefaultListModel.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -198,7 +198,7 @@ public class DefaultListModel extends AbstractListModel
public void add(int index, Object element)
{
elements.add(index, element);
- fireContentsChanged(this, index, index);
+ fireIntervalAdded(this, index, index);
}
/**
@@ -209,8 +209,9 @@ public class DefaultListModel extends AbstractListModel
*/
public void addElement(Object element)
{
+ int s = elements.size();
elements.add(element);
- fireIntervalAdded(this, elements.size(), elements.size());
+ fireIntervalAdded(this, s, s);
}
/**
@@ -266,8 +267,12 @@ public class DefaultListModel extends AbstractListModel
*/
public void clear()
{
- elements.clear();
- fireIntervalRemoved(this, 0, elements.size());
+ int s = elements.size();
+ if (s > 0)
+ {
+ elements.clear();
+ fireIntervalRemoved(this, 0, s - 1);
+ }
}
/**
@@ -341,7 +346,16 @@ public class DefaultListModel extends AbstractListModel
*/
public void setSize(int size)
{
+ int oldSize = elements.size();
elements.setSize(size);
+ if (oldSize < size)
+ {
+ fireIntervalAdded(this, oldSize, size - 1);
+ }
+ else if (oldSize > size)
+ {
+ this.fireIntervalRemoved(this, size, oldSize - 1);
+ }
}
/**
diff --git a/libjava/javax/swing/DefaultListSelectionModel.java b/libjava/javax/swing/DefaultListSelectionModel.java
index d5801c7dde0..ccae2804c3d 100644
--- a/libjava/javax/swing/DefaultListSelectionModel.java
+++ b/libjava/javax/swing/DefaultListSelectionModel.java
@@ -118,7 +118,7 @@ public class DefaultListSelectionModel implements Cloneable,
* @see #isLeadAnchorNotificationEnabled
* @see #setLeadAnchorNotificationEnabled
*/
- boolean leadAnchorNotificationEnabled = true;
+ protected boolean leadAnchorNotificationEnabled = true;
/**
@@ -520,6 +520,18 @@ public class DefaultListSelectionModel implements Cloneable,
*
* @param firstIndex The low index of the changed range
* @param lastIndex The high index of the changed range
+ */
+ protected void fireValueChanged(int firstIndex, int lastIndex)
+ {
+ fireValueChanged(firstIndex, lastIndex, getValueIsAdjusting());
+ }
+
+ /**
+ * Fires a {@link ListSelectionEvent} to all the listeners of type {@link
+ * ListSelectionListener} registered with this selection model.
+ *
+ * @param firstIndex The low index of the changed range
+ * @param lastIndex The high index of the changed range
* @param isAdjusting Whether this change is part of a seqence of adjustments
* made to the selection, such as during interactive scrolling
*/
@@ -588,4 +600,21 @@ public class DefaultListSelectionModel implements Cloneable,
{
return (ListSelectionListener[]) getListeners(ListSelectionListener.class);
}
+
+ /**
+ * Returns a clone of this object.
+ * <code>listenerList</code> don't gets duplicated.
+ *
+ * @return the cloned object
+ *
+ * @throws CloneNotSupportedException if an error occurs
+ */
+ public Object clone()
+ throws CloneNotSupportedException
+ {
+ DefaultListSelectionModel model =
+ (DefaultListSelectionModel) super.clone();
+ model.sel = (BitSet) sel.clone();
+ return model;
+ }
}
diff --git a/libjava/javax/swing/DefaultSingleSelectionModel.java b/libjava/javax/swing/DefaultSingleSelectionModel.java
index 0b1371ed9e1..63611f4a09a 100644
--- a/libjava/javax/swing/DefaultSingleSelectionModel.java
+++ b/libjava/javax/swing/DefaultSingleSelectionModel.java
@@ -47,23 +47,23 @@ import javax.swing.event.EventListenerList;
/**
* DefaultSingleSelectionModel
- * @author Andrew Selkirk
- * @version 1.0
+ *
+ * @author Andrew Selkirk
*/
public class DefaultSingleSelectionModel
implements SingleSelectionModel, Serializable
{
- static final long serialVersionUID = 3676229404753786004L;
+ private static final long serialVersionUID = 3676229404753786004L;
/**
* changeEvent
*/
- protected transient ChangeEvent changeEvent = new ChangeEvent (this);
+ protected transient ChangeEvent changeEvent = new ChangeEvent(this);
/**
* listenerList
*/
- protected EventListenerList listenerList= new EventListenerList ();
+ protected EventListenerList listenerList = new EventListenerList();
/**
* index
@@ -73,15 +73,16 @@ public class DefaultSingleSelectionModel
/**
* Constructor DefaultSingleSelectionModel
*/
- public DefaultSingleSelectionModel ()
+ public DefaultSingleSelectionModel()
{
+ // Do nothing.
}
/**
* getSelectedIndex
* @return int
*/
- public int getSelectedIndex ()
+ public int getSelectedIndex()
{
return index;
}
@@ -90,34 +91,28 @@ public class DefaultSingleSelectionModel
* setSelectedIndex
* @param index TODO
*/
- public void setSelectedIndex (int index)
+ public void setSelectedIndex(int index)
{
- // Set Data
this.index = index;
-
- // Notify Listeners
- fireStateChanged ();
+ fireStateChanged();
}
/**
* clearSelection
*/
- public void clearSelection ()
+ public void clearSelection()
{
- // Set Data
index = -1;
-
- // Notify Listeners
- fireStateChanged ();
+ fireStateChanged();
}
/**
* isSelected
* @return boolean
*/
- public boolean isSelected ()
+ public boolean isSelected()
{
- return (index != -1);
+ return index != -1;
}
/**
@@ -125,9 +120,9 @@ public class DefaultSingleSelectionModel
*
* @param listener the listener to add
*/
- public void addChangeListener (ChangeListener listener)
+ public void addChangeListener(ChangeListener listener)
{
- listenerList.add (ChangeListener.class, listener);
+ listenerList.add(ChangeListener.class, listener);
}
/**
@@ -135,30 +130,20 @@ public class DefaultSingleSelectionModel
*
* @param listener the listener to remove
*/
- public void removeChangeListener (ChangeListener listener)
+ public void removeChangeListener(ChangeListener listener)
{
- listenerList.remove (ChangeListener.class, listener);
+ listenerList.remove(ChangeListener.class, listener);
}
/**
* fireStateChanged
*/
- protected void fireStateChanged ()
+ protected void fireStateChanged()
{
- // Variables
- ChangeListener listener;
- ChangeListener[] listeners;
- int index;
-
- // Get Listeners
- listeners = getChangeListeners ();
-
- // Process Listeners
- for (index = 0; index < listeners.length; index++)
- {
- listener = listeners [index];
- listener.stateChanged (changeEvent);
- }
+ ChangeListener[] listeners = getChangeListeners();
+
+ for (int i = 0; i < listeners.length; i++)
+ listeners[i].stateChanged(changeEvent);
}
/**
@@ -170,9 +155,9 @@ public class DefaultSingleSelectionModel
*
* @since 1.3
*/
- public EventListener[] getListeners (Class listenerClass)
+ public EventListener[] getListeners(Class listenerClass)
{
- return listenerList.getListeners (listenerClass);
+ return listenerList.getListeners(listenerClass);
}
/**
@@ -180,8 +165,8 @@ public class DefaultSingleSelectionModel
*
* @since 1.4
*/
- public ChangeListener[] getChangeListeners ()
+ public ChangeListener[] getChangeListeners()
{
- return (ChangeListener[]) getListeners (ChangeListener.class);
+ return (ChangeListener[]) getListeners(ChangeListener.class);
}
}
diff --git a/libjava/javax/swing/ImageIcon.java b/libjava/javax/swing/ImageIcon.java
index c0e8e0d3117..36bd088ff6b 100644
--- a/libjava/javax/swing/ImageIcon.java
+++ b/libjava/javax/swing/ImageIcon.java
@@ -1,4 +1,4 @@
-/* ImageIcon.java --
+/* ImageIcon.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ public class ImageIcon
public ImageIcon()
{
}
-
+
public ImageIcon(String file)
{
this(file, file);
@@ -98,12 +98,12 @@ public class ImageIcon
this.image = Toolkit.getDefaultToolkit().createImage(image.getSource());
this.description = description;
}
-
+
public ImageObserver getImageObserver()
{
return observer;
}
-
+
public void setImageObserver(ImageObserver newObserver)
{
observer = newObserver;
@@ -114,6 +114,11 @@ public class ImageIcon
return image;
}
+ public void setImage(Image image)
+ {
+ this.image = Toolkit.getDefaultToolkit().createImage(image.getSource());
+ }
+
public String getDescription()
{
return description;
diff --git a/libjava/javax/swing/InputMap.java b/libjava/javax/swing/InputMap.java
index 3f0bc3f47e6..53be5b1b1d7 100644
--- a/libjava/javax/swing/InputMap.java
+++ b/libjava/javax/swing/InputMap.java
@@ -49,7 +49,7 @@ import java.util.Set;
/**
- * @author Andrew Selkirk
+ * @author Andrew Selkirk
* @author Michael Koch
*
* @since 1.3
@@ -59,31 +59,31 @@ public class InputMap
{
private static final long serialVersionUID = -5429059542008604257L;
- /**
- * inputMap
- */
- private Map inputMap = new HashMap();
+ /**
+ * inputMap
+ */
+ private Map inputMap = new HashMap();
- /**
- * parent
- */
+ /**
+ * parent
+ */
private InputMap parent;
- /**
+ /**
* Creates a new <code>InputMap</code> instance.
- */
+ */
public InputMap()
{
- // TODO
+ // TODO
}
- /**
+ /**
* Returns the binding for keystroke.
*
* @param key the key of the enty
*
* @return the binding associated with keystroke may be null
- */
+ */
public Object get(KeyStroke keystroke)
{
Object result = inputMap.get(keystroke);
@@ -93,121 +93,121 @@ public class InputMap
return result;
}
- /**
+ /**
* Puts a new entry into the <code>InputMap</code>.
* If actionMapKey is null an existing entry will be removed.
*
* @param keystroke the keystroke for the entry
* @param actionMapKey the action.
- */
+ */
public void put(KeyStroke keystroke, Object actionMapKey)
{
if (actionMapKey == null)
- inputMap.remove(keystroke);
+ inputMap.remove(keystroke);
else
- inputMap.put(keystroke, actionMapKey);
+ inputMap.put(keystroke, actionMapKey);
}
- /**
+ /**
* Remove an entry from the <code>InputMap</code>.
*
* @param key the key of the entry to remove
- */
+ */
public void remove(KeyStroke keystroke)
{
- inputMap.remove(keystroke);
+ inputMap.remove(keystroke);
}
- /**
+ /**
* Returns the parent of this <code>InputMap</code>.
*
* @return the parent, may be null.
- */
+ */
public InputMap getParent()
{
- return parent;
+ return parent;
}
- /**
+ /**
* Sets a parent for this <code>InputMap</code>.
*
* @param parentMap the new parent
- */
+ */
public void setParent(InputMap parentMap)
{
- parent = parentMap;
+ parent = parentMap;
}
- /**
+ /**
* Returns the number of entries in this <code>InputMap</code>.
*
* @return the number of entries
- */
+ */
public int size()
{
- return inputMap.size();
+ return inputMap.size();
}
- /**
+ /**
* Clears the <code>InputMap</code>.
- */
+ */
public void clear()
{
- inputMap.clear();
+ inputMap.clear();
}
- /**
+ /**
* Returns all keys of entries in this <code>InputMap</code>.
*
* @return an array of keys
- */
+ */
public KeyStroke[] keys()
{
KeyStroke[] array = new KeyStroke[size()];
return (KeyStroke[]) inputMap.keySet().toArray(array);
}
- /**
+ /**
* Returns all keys of entries in this <code>InputMap</code>
* and all its parents.
*
* @return an array of keys
- */
+ */
public KeyStroke[] allKeys()
{
Set set = new HashSet();
if (parent != null)
- set.addAll(Arrays.asList(parent.allKeys()));
+ set.addAll(Arrays.asList(parent.allKeys()));
set.addAll(inputMap.keySet());
KeyStroke[] array = new KeyStroke[size()];
return (KeyStroke[]) set.toArray(array);
}
- /**
- * writeObject
+ /**
+ * writeObject
*
* @param stream the stream to write to
*
* @exception IOException If an error occurs
- */
+ */
private void writeObject(ObjectOutputStream stream) throws IOException
{
- // TODO
+ // TODO
}
- /**
- * readObject
+ /**
+ * readObject
*
* @param stream the stream to read from
*
* @exception ClassNotFoundException If the serialized class cannot be found
* @exception IOException If an error occurs
- */
+ */
private void readObject(ObjectInputStream stream)
throws ClassNotFoundException, IOException
{
- // TODO
+ // TODO
}
}
diff --git a/libjava/javax/swing/JApplet.java b/libjava/javax/swing/JApplet.java
index 42d7426abcf..8446e27b1d9 100644
--- a/libjava/javax/swing/JApplet.java
+++ b/libjava/javax/swing/JApplet.java
@@ -1,5 +1,5 @@
/* JApplet.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.LayoutManager;
import java.awt.event.KeyEvent;
-import java.awt.event.WindowEvent;
import javax.accessibility.AccessibleContext;
@@ -55,38 +54,18 @@ public class JApplet extends Applet
{
private static final long serialVersionUID = 7269359214497372587L;
- public static final int HIDE_ON_CLOSE = 0;
- public static final int EXIT_ON_CLOSE = 1;
- public static final int DISPOSE_ON_CLOSE = 2;
- public static final int DO_NOTHING_ON_CLOSE = 3;
-
- private int close_action = EXIT_ON_CLOSE;
-
protected JRootPane rootPane;
protected boolean rootPaneCheckingEnabled;
public JApplet()
{
- frameInit();
- }
-
- public JApplet(String title)
- {
- frameInit();
- }
-
- protected void frameInit()
- {
super.setLayout(new BorderLayout(1, 1));
getRootPane(); // will do set/create
}
public Dimension getPreferredSize()
{
- Dimension d = super.getPreferredSize();
- System.out.println("JFrame.getPrefSize(): " + d + " , comp="
- + getComponentCount() + ", layout=" + getLayout());
- return d;
+ return super.getPreferredSize();
}
public void setLayout(LayoutManager manager)
@@ -111,7 +90,7 @@ public class JApplet extends Applet
return rootPane;
}
- public void setRootPane(JRootPane root)
+ protected void setRootPane(JRootPane root)
{
if (rootPane != null)
remove(rootPane);
@@ -120,7 +99,7 @@ public class JApplet extends Applet
add(rootPane, BorderLayout.CENTER);
}
- public JRootPane createRootPane()
+ protected JRootPane createRootPane()
{
return new JRootPane();
}
@@ -155,11 +134,6 @@ public class JApplet extends Applet
return null;
}
- int getDefaultCloseOperation()
- {
- return close_action;
- }
-
public JMenuBar getJMenuBar()
{
return getRootPane().getJMenuBar();
@@ -179,56 +153,12 @@ public class JApplet extends Applet
{
super.processKeyEvent(e);
}
-
- protected void processWindowEvent(WindowEvent e)
- {
- // System.out.println("PROCESS_WIN_EV-1: " + e);
- // super.processWindowEvent(e);
- // System.out.println("PROCESS_WIN_EV-2: " + e);
- switch (e.getID())
- {
- case WindowEvent.WINDOW_CLOSING:
- {
- switch (close_action)
- {
- case EXIT_ON_CLOSE:
- {
- System.out.println("user requested exit on close");
- System.exit(1);
- break;
- }
- case DISPOSE_ON_CLOSE:
- {
- System.out.println("user requested dispose on close");
- //dispose();
- break;
- }
- case HIDE_ON_CLOSE:
- case DO_NOTHING_ON_CLOSE:
- break;
- }
- break;
- }
- case WindowEvent.WINDOW_CLOSED:
- case WindowEvent.WINDOW_OPENED:
- case WindowEvent.WINDOW_ICONIFIED:
- case WindowEvent.WINDOW_DEICONIFIED:
- case WindowEvent.WINDOW_ACTIVATED:
- case WindowEvent.WINDOW_DEACTIVATED:
- break;
- }
- }
-
+
public void remove(Component comp)
{
getContentPane().remove(comp);
}
- void setDefaultCloseOperation(int operation)
- {
- close_action = operation;
- }
-
protected boolean isRootPaneCheckingEnabled()
{
return rootPaneCheckingEnabled;
diff --git a/libjava/javax/swing/JButton.java b/libjava/javax/swing/JButton.java
index 13e3d571634..dea37811a7f 100644
--- a/libjava/javax/swing/JButton.java
+++ b/libjava/javax/swing/JButton.java
@@ -53,90 +53,90 @@ public class JButton extends AbstractButton
private static final long serialVersionUID = -1907255238954382202L;
boolean def;
boolean is_def;
-
- public JButton()
- {
- this(null, null);
- }
-
- public JButton(Action a)
- {
- this();
- setAction(a);
- }
-
- public JButton(Icon icon)
- {
- this(null, icon);
- }
-
- public JButton(String text)
- {
- this(text, null);
- }
-
- public JButton(String text, Icon icon)
- {
- super(text, icon);
- }
-
- public Object[] getSelectedObjects()
- {
- return null;
- }
-
- protected void configurePropertiesFromAction(Action a)
- {
- //Factory method which sets the AbstractButton's properties according to values from the Action instance.
- super.configurePropertiesFromAction(a);
- }
-
- public AccessibleContext getAccessibleContext()
- {
- //Gets the AccessibleContext associated with this JButton.
- return null;
- }
-
- public String getUIClassID()
- {
+
+ public JButton()
+ {
+ this(null, null);
+ }
+
+ public JButton(Action a)
+ {
+ this();
+ setAction(a);
+ }
+
+ public JButton(Icon icon)
+ {
+ this(null, icon);
+ }
+
+ public JButton(String text)
+ {
+ this(text, null);
+ }
+
+ public JButton(String text, Icon icon)
+ {
+ super(text, icon);
+ }
+
+ public Object[] getSelectedObjects()
+ {
+ return null;
+ }
+
+ protected void configurePropertiesFromAction(Action a)
+ {
+ //Factory method which sets the AbstractButton's properties according to values from the Action instance.
+ super.configurePropertiesFromAction(a);
+ }
+
+ public AccessibleContext getAccessibleContext()
+ {
+ //Gets the AccessibleContext associated with this JButton.
+ return null;
+ }
+
+ public String getUIClassID()
+ {
//Returns a string that specifies the name of the L&F class that renders this component.
- return "ButtonUI";
- }
-
- public boolean isDefaultButton()
- {
- //Returns whether or not this button is the default button on the RootPane.
- return is_def;
- }
-
- public boolean isDefaultCapable()
- {
- //Returns whether or not this button is capable of being the default button on the RootPane.
- return def;
- }
-
- protected String paramString()
- {
- return "JButton";
- }
-
+ return "ButtonUI";
+ }
+
+ public boolean isDefaultButton()
+ {
+ //Returns whether or not this button is the default button on the RootPane.
+ return is_def;
+ }
+
+ public boolean isDefaultCapable()
+ {
+ //Returns whether or not this button is capable of being the default button on the RootPane.
+ return def;
+ }
+
+ protected String paramString()
+ {
+ return "JButton";
+ }
+
/**
* Overrides JComponent.removeNotify to check if this button is currently
* set as the default button on the RootPane, and if so, sets the RootPane's
* default button to null to ensure the RootPane doesn't hold onto an invalid
* button reference.
*/
- public void removeNotify()
- {
- }
-
- public void setDefaultCapable(boolean defaultCapable)
+ public void removeNotify()
+ {
+ }
+
+ public void setDefaultCapable(boolean defaultCapable)
{
def = defaultCapable;
}
-
- public void updateUI()
- {
+
+ public void updateUI()
+ {
setUI((ButtonUI) UIManager.getUI(this));
- }
+ }
}
diff --git a/libjava/javax/swing/JCheckBox.java b/libjava/javax/swing/JCheckBox.java
index 36cd0715c70..a8506e5f822 100644
--- a/libjava/javax/swing/JCheckBox.java
+++ b/libjava/javax/swing/JCheckBox.java
@@ -60,20 +60,20 @@ public class JCheckBox extends JToggleButton
contentAreaFilled = false;
}
- public JCheckBox()
- {
+ public JCheckBox()
+ {
super();
init();
- }
+ }
public JCheckBox(Action action)
- {
+ {
super(action);
init();
- }
+ }
- public JCheckBox(Icon icon)
- {
+ public JCheckBox(Icon icon)
+ {
super(icon);
init();
}
@@ -82,10 +82,10 @@ public class JCheckBox extends JToggleButton
{
super(icon, selected);
init();
- }
+ }
- public JCheckBox(String text)
- {
+ public JCheckBox(String text)
+ {
super(text);
init();
}
@@ -94,41 +94,41 @@ public class JCheckBox extends JToggleButton
{
super(text, selected);
init();
- }
+ }
- public JCheckBox(String text, Icon icon)
- {
- super(text, icon);
+ public JCheckBox(String text, Icon icon)
+ {
+ super(text, icon);
init();
- }
+ }
public JCheckBox(String text, Icon icon, boolean selected)
{
super(text, icon, selected);
init();
}
-
+
/**
* Gets the AccessibleContext associated with this JCheckBox.
*/
- public AccessibleContext getAccessibleContext()
- {
- return null;
- }
+ public AccessibleContext getAccessibleContext()
+ {
+ return null;
+ }
/**
* Returns a string that specifies the name of the Look and Feel class
* that renders this component.
*/
- public String getUIClassID()
- {
- return "CheckBoxUI";
- }
+ public String getUIClassID()
+ {
+ return "CheckBoxUI";
+ }
- protected String paramString()
- {
- return "JCheckBox";
- }
+ protected String paramString()
+ {
+ return "JCheckBox";
+ }
public boolean isBorderPaintedFlat()
{
diff --git a/libjava/javax/swing/JCheckBoxMenuItem.java b/libjava/javax/swing/JCheckBoxMenuItem.java
index 76377b618fc..090c3c2044a 100644
--- a/libjava/javax/swing/JCheckBoxMenuItem.java
+++ b/libjava/javax/swing/JCheckBoxMenuItem.java
@@ -206,7 +206,7 @@ public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants,
* This method overrides JComponent.requestFocus with an empty
* implementation, since JCheckBoxMenuItems should not
* receve focus in general.
- */
+ */
public void requestFocus()
{
// Should do nothing here
diff --git a/libjava/javax/swing/JComboBox.java b/libjava/javax/swing/JComboBox.java
index 86f20b099eb..4e2a88110fc 100644
--- a/libjava/javax/swing/JComboBox.java
+++ b/libjava/javax/swing/JComboBox.java
@@ -1,5 +1,5 @@
/* JComboBox.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,7 +60,6 @@ import javax.swing.event.ListDataListener;
import javax.swing.event.PopupMenuListener;
import javax.swing.plaf.ComboBoxUI;
-
/**
* JComboBox. JComboBox is a container, that keeps track of elements added to
* it by the user. JComboBox allows user to select any item in its list and
@@ -69,12 +68,14 @@ import javax.swing.plaf.ComboBoxUI;
*
* @author Andrew Selkirk
* @author Olga Rodimina
+ * @author Robert Schuster
*/
public class JComboBox extends JComponent implements ItemSelectable,
ListDataListener,
ActionListener,
Accessible
{
+
private static final long serialVersionUID = 5654585963292734470L;
/**
@@ -91,43 +92,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
* Maximum number of rows that should be visible by default in the
* JComboBox's popup
*/
- public static final int DEFAULT_MAXIMUM_ROW_COUNT = 8;
-
- /**
- * Fired in a PropertyChangeEvent when the 'editable' property changes.
- */
- public static final String EDITABLE_CHANGED_PROPERTY = "editable";
-
- /**
- * Fired in a PropertyChangeEvent when the 'maximumRowCount' property
- * changes.
- */
- public static final String MAXIMUM_ROW_COUNT_CHANGED_PROPERTY = "maximumRowCount";
-
- /**
- * Fired in a PropertyChangeEvent when the 'enabled' property changes.
- */
- public static final String ENABLED_CHANGED_PROPERTY = "enabled";
-
- /**
- * Fired in a PropertyChangeEvent when the 'renderer' property changes.
- */
- public static final String RENDERER_CHANGED_PROPERTY = "renderer";
-
- /**
- * Fired in a PropertyChangeEvent when the 'editor' property changes.
- */
- public static final String EDITOR_CHANGED_PROPERTY = "editor";
-
- /**
- * Fired in a PropertyChangeEvent when the 'dataModel' property changes.
- */
- public static final String MODEL_CHANGED_PROPERTY = "dataModel";
-
- /**
- * name for the UI delegate for this combo box.
- */
- private static final String uiClassID = "ComboBoxUI";
+ private static final int DEFAULT_MAXIMUM_ROW_COUNT = 8;
/**
* dataModel used by JComboBox to keep track of its list data and currently
@@ -143,7 +108,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
protected ListCellRenderer renderer;
/**
- * editor that is responsible for editting an object in a combo box list
+ * Editor that is responsible for editing an object in a combo box list.
*/
protected ComboBoxEditor editor;
@@ -191,8 +156,9 @@ public class JComboBox extends JComponent implements ItemSelectable,
private Object prototypeDisplayValue;
/**
- * Constructs JComboBox object with specified data model for it. The first
- * item in the specified data model is selected by default.
+ * Constructs JComboBox object with specified data model for it.
+ * <p>Note that the JComboBox will not change the value that
+ * is preselected by your ComboBoxModel implementation.</p>
*
* @param model Data model that will be used by this JComboBox to keep track
* of its list of items.
@@ -205,10 +171,6 @@ public class JComboBox extends JComponent implements ItemSelectable,
setModel(model);
setActionCommand("comboBoxChanged");
- // by default set selected item to the first element in the combo box
- if (getItemCount() != 0)
- setSelectedItem(getItemAt(0));
-
lightWeightPopupEnabled = true;
isEditable = false;
@@ -300,7 +262,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public String getUIClassID()
{
- return uiClassID;
+ return "ComboBoxUI";
}
/**
@@ -322,21 +284,29 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public void setModel(ComboBoxModel newDataModel)
{
- if (this.dataModel == newDataModel)
- return;
- if (this.dataModel != null)
- // remove all listeners currently registered with the model.
- dataModel.removeListDataListener(this);
+ // dataModel is null if it this method is called from inside the constructors.
+ if(dataModel != null) {
+ // Prevents unneccessary updates.
+ if (dataModel == newDataModel)
+ return;
- ComboBoxModel oldDataModel = this.dataModel;
- this.dataModel = newDataModel;
+ // Removes itself (as DataListener) from the to-be-replaced model.
+ dataModel.removeListDataListener(this);
+ }
+
+ /* Adds itself as a DataListener to the new model.
+ * It is intentioned that this operation will fail with a NullPointerException if the
+ * caller delivered a null argument.
+ */
+ newDataModel.addListDataListener(this);
- if (this.dataModel != null)
- // register all listeners with the new data model
- dataModel.addListDataListener(this);
+ // Stores old data model for event notification.
+ ComboBoxModel oldDataModel = dataModel;
+ dataModel = newDataModel;
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldDataModel, this.dataModel);
+ // Notifies the listeners of the model change.
+ firePropertyChange("model", oldDataModel, dataModel);
}
/**
@@ -351,8 +321,8 @@ public class JComboBox extends JComponent implements ItemSelectable,
/**
* This method sets JComboBox's popup to be either lightweight or
- * heavyweight. If 'enabled' is true then lightweight popup is used and
- * heavyweight otherwise. By default lightweight popup is used to display
+ * heavyweight. If 'enabled' is true then lightweight popup is used and
+ * heavyweight otherwise. By default lightweight popup is used to display
* this JComboBox's elements.
*
* @param enabled indicates if lightweight popup or heavyweight popup should
@@ -360,7 +330,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public void setLightWeightPopupEnabled(boolean enabled)
{
- this.lightWeightPopupEnabled = enabled;
+ lightWeightPopupEnabled = enabled;
}
/**
@@ -388,10 +358,10 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public void setEditable(boolean editable)
{
- if (this.isEditable != editable)
+ if (isEditable != editable)
{
- this.isEditable = editable;
- firePropertyChange(EDITABLE_CHANGED_PROPERTY, ! isEditable, isEditable);
+ isEditable = editable;
+ firePropertyChange("editable", ! isEditable, isEditable);
}
}
@@ -407,10 +377,10 @@ public class JComboBox extends JComponent implements ItemSelectable,
{
if (maximumRowCount != rowCount)
{
- int oldMaximumRowCount = this.maximumRowCount;
- this.maximumRowCount = rowCount;
- firePropertyChange(MAXIMUM_ROW_COUNT_CHANGED_PROPERTY,
- oldMaximumRowCount, this.maximumRowCount);
+ int oldMaximumRowCount = maximumRowCount;
+ maximumRowCount = rowCount;
+ firePropertyChange("maximumRowCount",
+ oldMaximumRowCount, maximumRowCount);
}
}
@@ -437,12 +407,12 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public void setRenderer(ListCellRenderer aRenderer)
{
- if (this.renderer != aRenderer)
+ if (renderer != aRenderer)
{
- ListCellRenderer oldRenderer = this.renderer;
- this.renderer = aRenderer;
- firePropertyChange(RENDERER_CHANGED_PROPERTY, oldRenderer,
- this.renderer);
+ ListCellRenderer oldRenderer = renderer;
+ renderer = aRenderer;
+ firePropertyChange("renderer", oldRenderer,
+ renderer);
}
}
@@ -477,11 +447,11 @@ public class JComboBox extends JComponent implements ItemSelectable,
if (editor != null)
editor.addActionListener(this);
- firePropertyChange(EDITOR_CHANGED_PROPERTY, oldEditor, editor);
+ firePropertyChange("editor", oldEditor, editor);
}
/**
- * Returns editor component that is responsible for displaying/editting
+ * Returns editor component that is responsible for displaying/editing
* selected item in the combo box.
*
* @return ComboBoxEditor
@@ -503,45 +473,76 @@ public class JComboBox extends JComponent implements ItemSelectable,
/**
* Returns currently selected item in the combo box.
+ * The result may be <code>null</code> to indicate that nothing is
+ * currently selected.
*
* @return element that is currently selected in this combo box.
*/
public Object getSelectedItem()
{
- Object item = dataModel.getSelectedItem();
-
- if (item == null && getItemCount() != 0)
- item = getItemAt(0);
-
- return item;
+ return dataModel.getSelectedItem();
}
/**
- * Forces JComboBox to select component located in the given index in the
+ * Forces JComboBox to select component located in the given index in the
* combo box.
+ * <p>If the index is below -1 or exceeds the upper bound an
+ * <code>IllegalArgumentException</code> is thrown.<p/>
+ * <p>If the index is -1 then no item gets selected.</p>
*
* @param index index specifying location of the component that should be
* selected.
*/
public void setSelectedIndex(int index)
{
- // FIXME: if index == -1 then nothing should be selected
- setSelectedItem(dataModel.getElementAt(index));
+ if(index < -1 || index >= dataModel.getSize()) {
+ // Fails because index is out of bounds.
+ throw new IllegalArgumentException("illegal index: " + index);
+ } else {
+ /* Selects the item at the given index or clears the selection if the
+ * index value is -1.
+ */
+ setSelectedItem((index == -1) ? null : dataModel.getElementAt(index));
+ }
}
/**
* Returns index of the item that is currently selected in the combo box.
* If no item is currently selected, then -1 is returned.
+ *
+ * <p>Note: For performance reasons you should minimize invocation of this
+ * method. If the data model is not an instance of
+ * <code>DefaultComboBoxModel</code> the complexity is O(n) where
+ * n is the number of elements in the combo box.</p>
*
- * @return int index specifying location of the currently selected item in
+ * @return int Index specifying location of the currently selected item in
* the combo box or -1 if nothing is selected in the combo box.
*/
public int getSelectedIndex()
{
Object selectedItem = getSelectedItem();
- if (selectedItem != null && (dataModel instanceof DefaultComboBoxModel))
- return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem);
+
+ if (selectedItem != null) {
+
+ if(dataModel instanceof DefaultComboBoxModel) {
+ // Uses special method of DefaultComboBoxModel to retrieve the index.
+ return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem);
+ } else {
+ // Iterates over all items to retrieve the index.
+ int size = dataModel.getSize();
+
+ for(int i=0; i < size; i++) {
+ Object o = dataModel.getElementAt(i);
+
+ // XXX: Is special handling of ComparableS neccessary?
+ if((selectedItem != null) ? selectedItem.equals(o) : o == null) {
+ return i;
+ }
+ }
+ }
+ }
+ // returns that no item is currently selected
return -1;
}
@@ -550,60 +551,104 @@ public class JComboBox extends JComponent implements ItemSelectable,
return prototypeDisplayValue;
}
- public void setPrototypeDisplayValue(Object prototypeDisplayValue)
+ public void setPrototypeDisplayValue(Object newPrototypeDisplayValue)
{
- this.prototypeDisplayValue = prototypeDisplayValue;
+ prototypeDisplayValue = newPrototypeDisplayValue;
}
/**
* This method adds given element to this JComboBox.
+ * <p>A <code>RuntimeException</code> is thrown if the data model is not
+ * an instance of {@link MutableComboBoxModel}.</p>
*
* @param element element to add
*/
public void addItem(Object element)
{
- ((MutableComboBoxModel) dataModel).addElement(element);
+ if(dataModel instanceof MutableComboBoxModel) {
+ ((MutableComboBoxModel) dataModel).addElement(element);
+ } else {
+ throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel.");
+ }
}
/**
- * Inserts given element at the specified index to this JComboBox
+ * Inserts given element at the specified index to this JComboBox.
+ * <p>A <code>RuntimeException</code> is thrown if the data model is not
+ * an instance of {@link MutableComboBoxModel}.</p>
*
* @param element element to insert
* @param index position where to insert the element
*/
public void insertItemAt(Object element, int index)
{
- ((MutableComboBoxModel) dataModel).insertElementAt(element, index);
+ if(dataModel instanceof MutableComboBoxModel) {
+ ((MutableComboBoxModel) dataModel).insertElementAt(element, index);
+ } else {
+ throw new RuntimeException("Unable to insert the item because the data model it is not an instance of MutableComboBoxModel.");
+ }
}
/**
* This method removes given element from this JComboBox.
+ * <p>A <code>RuntimeException</code> is thrown if the data model is not
+ * an instance of {@link MutableComboBoxModel}.</p>
*
* @param element element to remove
*/
public void removeItem(Object element)
{
- ((MutableComboBoxModel) dataModel).removeElement(element);
+ if(dataModel instanceof MutableComboBoxModel) {
+ ((MutableComboBoxModel) dataModel).removeElement(element);
+ } else {
+ throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel.");
+ }
}
/**
* This method remove element location in the specified index in the
* JComboBox.
+ * <p>A <code>RuntimeException</code> is thrown if the data model is not
+ * an instance of {@link MutableComboBoxModel}.</p>
*
* @param index index specifying position of the element to remove
*/
public void removeItemAt(int index)
{
- ((MutableComboBoxModel) dataModel).removeElementAt(index);
+ if(dataModel instanceof MutableComboBoxModel) {
+ ((MutableComboBoxModel) dataModel).removeElementAt(index);
+ } else {
+ throw new RuntimeException("Unable to remove the item because the data model it is not an instance of MutableComboBoxModel.");
+ }
}
/**
* This method removes all elements from this JComboBox.
+ * <p>A <code>RuntimeException</code> is thrown if the data model is not
+ * an instance of {@link MutableComboBoxModel}.</p>
+ *
*/
public void removeAllItems()
{
- if (dataModel instanceof DefaultComboBoxModel)
- ((DefaultComboBoxModel) dataModel).removeAllElements();
+ if (dataModel instanceof DefaultComboBoxModel) {
+ // Uses special method if we have a DefaultComboBoxModel.
+ ((DefaultComboBoxModel) dataModel).removeAllElements();
+ } else if(dataModel instanceof MutableComboBoxModel){
+ // Iterates over all items and removes each.
+ MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel;
+
+ /* We intentionally remove the items backwards to support
+ * models which shift their content to the beginning (e.g.
+ * linked lists)
+ */
+ for(int i=mcbm.getSize()-1; i >= 0; i--) {
+ mcbm.removeElementAt(i);
+ }
+
+ } else {
+ throw new RuntimeException("Unable to remove the items because the data model it is not an instance of MutableComboBoxModel.");
+ }
+
}
/**
@@ -801,8 +846,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public Object[] getSelectedObjects()
{
- Object selectedObject = getSelectedItem();
- return new Object[] { selectedObject };
+ return new Object[] { getSelectedItem() };
}
/**
@@ -887,8 +931,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
if (enabled != oldEnabled)
{
super.setEnabled(enabled);
- firePropertyChange(ENABLED_CHANGED_PROPERTY, oldEnabled,
- (boolean) enabled);
+ firePropertyChange("enabled", oldEnabled, enabled);
}
}
@@ -951,7 +994,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public int getItemCount()
{
- return ((DefaultComboBoxModel) dataModel).getSize();
+ return dataModel.getSize();
}
/**
@@ -963,7 +1006,7 @@ public class JComboBox extends JComponent implements ItemSelectable,
*/
public Object getItemAt(int index)
{
- return ((MutableComboBoxModel) dataModel).getElementAt(index);
+ return dataModel.getElementAt(index);
}
/**
diff --git a/libjava/javax/swing/JComponent.java b/libjava/javax/swing/JComponent.java
index c22c2b2e702..ad7603cf76a 100644
--- a/libjava/javax/swing/JComponent.java
+++ b/libjava/javax/swing/JComponent.java
@@ -1,5 +1,5 @@
/* JComponent.java -- Every component in swing inherits from this class.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,6 +50,7 @@ import java.awt.Image;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.dnd.DropTarget;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ContainerEvent;
@@ -72,6 +73,7 @@ import java.util.Locale;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleKeyBinding;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleStateSet;
import javax.swing.border.Border;
@@ -133,6 +135,9 @@ public abstract class JComponent extends Container implements Serializable
public String getAccessibleDescription() { return null; }
public AccessibleRole getAccessibleRole() { return null; }
protected String getBorderTitle(Border value0) { return null; }
+ public String getToolTipText() { return null; }
+ public String getTitledBorderText() { return null; }
+ public AccessibleKeyBinding getAccessibleKeyBinding() { return null; }
}
/**
@@ -323,6 +328,8 @@ public abstract class JComponent extends Container implements Serializable
private InputMap inputMap_whenAncestorOfFocused;
private InputMap inputMap_whenInFocusedWindow;
private ActionMap actionMap;
+ /** @since 1.3 */
+ private boolean verifyInputWhenFocusTarget;
private InputVerifier inputVerifier;
private TransferHandler transferHandler;
@@ -389,6 +396,7 @@ public abstract class JComponent extends Container implements Serializable
{
super();
super.setLayout(new FlowLayout());
+ setDropTarget(new DropTarget());
defaultLocale = Locale.getDefault();
debugGraphicsOptions = DebugGraphics.NONE_OPTION;
}
@@ -421,7 +429,7 @@ public abstract class JComponent extends Container implements Serializable
* @see #getClientProperties
* @see #putClientProperty
*/
- public Object getClientProperty(Object key)
+ public final Object getClientProperty(Object key)
{
return getClientProperties().get(key);
}
@@ -438,7 +446,7 @@ public abstract class JComponent extends Container implements Serializable
* @see #getClientProperties
* @see #getClientProperty
*/
- public void putClientProperty(Object key, Object value)
+ public final void putClientProperty(Object key, Object value)
{
getClientProperties().put(key, value);
}
@@ -1295,7 +1303,7 @@ public abstract class JComponent extends Container implements Serializable
}
/**
- * Return <code>true<code> if you wish this component to manage its own
+ * Return <code>true</code> if you wish this component to manage its own
* focus. In particular: if you want this component to be sent
* <code>TAB</code> and <code>SHIFT+TAB</code> key events, and to not
* have its children considered as focus transfer targets. If
@@ -1533,7 +1541,23 @@ public abstract class JComponent extends Container implements Serializable
*/
protected String paramString()
{
- return "JComponent";
+ StringBuffer sb = new StringBuffer();
+ sb.append(super.paramString());
+ sb.append(",alignmentX=").append(getAlignmentX());
+ sb.append(",alignmentY=").append(getAlignmentY());
+ sb.append(",border=");
+ if (getBorder() != null)
+ sb.append(getBorder());
+ sb.append(",maximumSize=");
+ if (getMaximumSize() != null)
+ sb.append(getMaximumSize());
+ sb.append(",minimumSize=");
+ if (getMinimumSize() != null)
+ sb.append(getMinimumSize());
+ sb.append(",preferredSize=");
+ if (getPreferredSize() != null)
+ sb.append(getPreferredSize());
+ return sb.toString();
}
/**
@@ -2092,9 +2116,14 @@ public abstract class JComponent extends Container implements Serializable
* @see ComponentUI#getTransferHandler
*/
- void setTransferHandler (TransferHandler newHandler)
+ public void setTransferHandler(TransferHandler newHandler)
{
+ if (transferHandler == newHandler)
+ return;
+
+ TransferHandler oldHandler = transferHandler;
transferHandler = newHandler;
+ firePropertyChange("transferHandler", oldHandler, newHandler);
}
/**
@@ -2225,4 +2254,26 @@ public abstract class JComponent extends Container implements Serializable
inputVerifier = verifier;
firePropertyChange("inputVerifier", oldVerifier, verifier);
}
+
+ /**
+ * @since 1.3
+ */
+ public boolean getVerifyInputWhenFocusTarget()
+ {
+ return verifyInputWhenFocusTarget;
+ }
+
+ /**
+ * @since 1.3
+ */
+ public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)
+ {
+ if (this.verifyInputWhenFocusTarget == verifyInputWhenFocusTarget)
+ return;
+
+ this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget;
+ firePropertyChange("verifyInputWhenFocusTarget",
+ ! verifyInputWhenFocusTarget,
+ verifyInputWhenFocusTarget);
+ }
}
diff --git a/libjava/javax/swing/JEditorPane.java b/libjava/javax/swing/JEditorPane.java
index 3b66c2bcb4e..8361b20371b 100644
--- a/libjava/javax/swing/JEditorPane.java
+++ b/libjava/javax/swing/JEditorPane.java
@@ -1,5 +1,5 @@
/* JEditorPane.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,6 +47,7 @@ import java.net.URL;
import javax.accessibility.AccessibleContext;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
+import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.EditorKit;
import javax.swing.text.JTextComponent;
@@ -56,29 +57,31 @@ public class JEditorPane extends JTextComponent
{
private static final long serialVersionUID = 3140472492599046285L;
- URL page_url;
- EditorKit kit;
- String ctype = "text/plain";
+ private URL page;
+ private EditorKit editorKit;
+
boolean focus_root;
boolean manages_focus;
public JEditorPane()
{
+ setEditorKit(createDefaultEditorKit());
}
public JEditorPane(String url) throws IOException
{
- setPage(url);
+ this(new URL(url));
}
public JEditorPane(String type, String text)
{
- ctype = text;
+ setEditorKit(createEditorKitForContentType(type));
setText(text);
}
public JEditorPane(URL url) throws IOException
{
+ this();
setPage(url);
}
@@ -110,14 +113,14 @@ public class JEditorPane extends JTextComponent
return null;
}
- public String getContentType()
+ public final String getContentType()
{
- return ctype;
+ return getEditorKit().getContentType();
}
public EditorKit getEditorKit()
{
- return kit;
+ return editorKit;
}
public static String getEditorKitClassNameForContentType(String type)
@@ -127,7 +130,7 @@ public class JEditorPane extends JTextComponent
public EditorKit getEditorKitForContentType(String type)
{
- return kit;
+ return editorKit;
}
/**
@@ -150,7 +153,7 @@ public class JEditorPane extends JTextComponent
public URL getPage()
{
- return page_url;
+ return page;
}
protected InputStream getStream(URL page)
@@ -216,7 +219,7 @@ public class JEditorPane extends JTextComponent
}
/**
- * Establishes the default bindings of type to classname.
+ * Establishes the default bindings of type to classname.
*/
public static void registerEditorKitForContentType(String type,
String classname,
@@ -240,24 +243,43 @@ public class JEditorPane extends JTextComponent
{
}
- public void setContentType(String type)
- {
- ctype = type;
- invalidate();
- repaint();
- }
-
- public void setEditorKit(EditorKit kit)
- {
- this.kit = kit;
+ public final void setContentType(String type)
+ {
+ if (editorKit != null
+ && editorKit.getContentType().equals(type))
+ return;
+
+ EditorKit kit = getEditorKitForContentType(type);
+
+ if (kit != null)
+ setEditorKit(kit);
+ }
+
+ public void setEditorKit(EditorKit newValue)
+ {
+ if (editorKit == newValue)
+ return;
+
+ if (editorKit != null)
+ editorKit.deinstall(this);
+
+ EditorKit oldValue = editorKit;
+ editorKit = newValue;
+
+ if (editorKit != null)
+ {
+ editorKit.install(this);
+ setDocument(editorKit.createDefaultDocument());
+ }
+
+ firePropertyChange("editorKit", oldValue, newValue);
invalidate();
repaint();
}
public void setEditorKitForContentType(String type, EditorKit k)
{
- ctype = type;
- setEditorKit(k);
+ // FIXME: editorKitCache.put(type, kit);
}
/**
@@ -265,6 +287,7 @@ public class JEditorPane extends JTextComponent
*/
public void setPage(String url) throws IOException
{
+ setPage(new URL(url));
}
/**
@@ -272,6 +295,18 @@ public class JEditorPane extends JTextComponent
*/
public void setPage(URL page) throws IOException
{
+ if (page == null)
+ throw new IOException("invalid url");
+
+ try
+ {
+ this.page = page;
+ getEditorKit().read(page.openStream(), getDocument(), 0);
+ }
+ catch (BadLocationException e)
+ {
+ // Ignored. '0' is always a valid offset.
+ }
}
public void setText(String t)
diff --git a/libjava/javax/swing/JFileChooser.java b/libjava/javax/swing/JFileChooser.java
index f653c708bd9..9b937178901 100644
--- a/libjava/javax/swing/JFileChooser.java
+++ b/libjava/javax/swing/JFileChooser.java
@@ -522,7 +522,7 @@ public class JFileChooser extends JComponent implements Accessible {
* @returns int
*/
public int showOpenDialog(Component parent) {
- return 0; // TODO
+ return CANCEL_OPTION; // TODO
} // showOpenDialog()
/**
@@ -531,7 +531,7 @@ public class JFileChooser extends JComponent implements Accessible {
* @returns int
*/
public int showSaveDialog(Component parent) {
- return 0; // TODO
+ return CANCEL_OPTION; // TODO
} // showSaveDialog()
/**
@@ -541,7 +541,7 @@ public class JFileChooser extends JComponent implements Accessible {
* @returns int
*/
public int showDialog(Component parent, String approveButtonText) {
- return 0; // TODO
+ return CANCEL_OPTION; // TODO
} // showDialog()
/**
diff --git a/libjava/javax/swing/JFormattedTextField.java b/libjava/javax/swing/JFormattedTextField.java
index eaf53555ba1..f544aec117f 100644
--- a/libjava/javax/swing/JFormattedTextField.java
+++ b/libjava/javax/swing/JFormattedTextField.java
@@ -59,6 +59,8 @@ public class JFormattedTextField extends JTextField
{
private static final long serialVersionUID = -5193212041738979680L;
+ private JFormattedTextField textField;
+
public AbstractFormatter ()
{
//Do nothing here.
@@ -72,7 +74,7 @@ public class JFormattedTextField extends JTextField
protected Action[] getActions ()
{
- throw new InternalError ("not implemented");
+ return textField.getActions();
}
protected DocumentFilter getDocumentFilter ()
@@ -82,32 +84,35 @@ public class JFormattedTextField extends JTextField
protected JFormattedTextField getFormattedTextField ()
{
- throw new InternalError ("not implemented");
+ return textField;
}
protected NavigationFilter getNavigationFilter ()
{
- throw new InternalError ("not implemented");
+ return textField.getNavigationFilter();
}
- public void install (JFormattedTextField ftf)
+ public void install(JFormattedTextField textField)
{
- throw new InternalError ("not implemented");
+ if (this.textField != null)
+ uninstall();
+
+ this.textField = textField;
}
public void uninstall ()
{
- throw new InternalError ("not implemented");
+ this.textField = null;
}
protected void invalidEdit ()
{
- throw new InternalError ("not implemented");
+ textField.invalidEdit();
}
protected void setEditValid (boolean valid)
{
- throw new InternalError ("not implemented");
+ textField.editValid = valid;
}
public abstract Object stringToValue (String text)
@@ -127,16 +132,34 @@ public class JFormattedTextField extends JTextField
public abstract AbstractFormatter getFormatter (JFormattedTextField tf);
}
+ static class FormatterFactoryWrapper extends AbstractFormatterFactory
+ {
+ AbstractFormatter formatter;
+
+ public FormatterFactoryWrapper(AbstractFormatter formatter)
+ {
+ this.formatter = formatter;
+ }
+
+ public AbstractFormatter getFormatter(JFormattedTextField tf)
+ {
+ return formatter;
+ }
+ }
+
public static final int COMMIT = 0;
public static final int COMMIT_OR_REVERT = 1;
public static final int REVERT = 2;
public static final int PERSIST = 3;
private Object value;
+ private int focusLostBehavior = COMMIT_OR_REVERT;
+ private AbstractFormatterFactory formatterFactory;
+ private boolean editValid = true;
public JFormattedTextField ()
{
- this((AbstractFormatterFactory) null);
+ this((AbstractFormatterFactory) null, null);
}
public JFormattedTextField (Format format)
@@ -146,7 +169,7 @@ public class JFormattedTextField extends JTextField
public JFormattedTextField (AbstractFormatter formatter)
{
- throw new InternalError ("not implemented");
+ this(new FormatterFactoryWrapper(formatter), null);
}
public JFormattedTextField (AbstractFormatterFactory factory)
@@ -156,7 +179,8 @@ public class JFormattedTextField extends JTextField
public JFormattedTextField (AbstractFormatterFactory factory, Object value)
{
- throw new InternalError ("not implemented");
+ this.formatterFactory = factory;
+ this.value = value;
}
public JFormattedTextField (Object value)
@@ -175,19 +199,22 @@ public class JFormattedTextField extends JTextField
throw new InternalError ("not implemented");
}
- public int getFocusLostBehaviour ()
+ public int getFocusLostBehavior()
{
- throw new InternalError ("not implemented");
+ return focusLostBehavior;
}
public AbstractFormatter getFormatter ()
{
- throw new InternalError ("not implemented");
+ if (formatterFactory == null)
+ return null;
+
+ return formatterFactory.getFormatter(this);
}
public AbstractFormatterFactory getFormatterFactory ()
{
- throw new InternalError ("not implemented");
+ return formatterFactory;
}
public String getUIClassID ()
@@ -202,12 +229,12 @@ public class JFormattedTextField extends JTextField
protected void invalidEdit ()
{
- throw new InternalError ("not implemented");
+ UIManager.getLookAndFeel().provideErrorFeedback(this);
}
public boolean isEditValid ()
{
- throw new InternalError ("not implemented");
+ return editValid;
}
protected void processFocusEvent (FocusEvent evt)
@@ -215,34 +242,58 @@ public class JFormattedTextField extends JTextField
throw new InternalError ("not implemented");
}
- public void setDocument(Document newdoc)
+ public void setDocument(Document newDocument)
{
- Document document = getDocument();
+ Document oldDocument = getDocument();
- if (document == newdoc)
+ if (oldDocument == newDocument)
return;
- setDocument(newdoc);
- firePropertyChange("document", document, newdoc);
+ super.setDocument(newDocument);
}
- public void setLostFocusBehavior (int behavior)
+ public void setFocusLostBehavior(int behavior)
{
- throw new InternalError ("not implemented");
+ if (behavior != COMMIT
+ && behavior != COMMIT_OR_REVERT
+ && behavior != PERSIST
+ && behavior != REVERT)
+ throw new IllegalArgumentException("invalid behavior");
+
+ this.focusLostBehavior = behavior;
}
protected void setFormatter (AbstractFormatter formatter)
{
- throw new InternalError ("not implemented");
+ AbstractFormatter oldFormatter = null;
+
+ if (formatterFactory != null)
+ oldFormatter = formatterFactory.getFormatter(this);
+
+ if (oldFormatter == formatter)
+ return;
+
+ setFormatterFactory(new FormatterFactoryWrapper(formatter));
+ firePropertyChange("formatter", oldFormatter, formatter);
}
public void setFormatterFactory (AbstractFormatterFactory factory)
{
- throw new InternalError ("not implemented");
+ if (formatterFactory == factory)
+ return;
+
+ AbstractFormatterFactory oldFactory = formatterFactory;
+ formatterFactory = factory;
+ firePropertyChange("formatterFactory", oldFactory, factory);
}
public void setValue (Object newValue)
{
+ if (value == newValue)
+ return;
+
+ Object oldValue = value;
value = newValue;
+ firePropertyChange("value", oldValue, newValue);
}
}
diff --git a/libjava/javax/swing/JFrame.java b/libjava/javax/swing/JFrame.java
index aa641caa3c4..c450d0f50e7 100644
--- a/libjava/javax/swing/JFrame.java
+++ b/libjava/javax/swing/JFrame.java
@@ -1,5 +1,5 @@
/* JFrame.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -123,7 +123,7 @@ public class JFrame extends Frame
return rootPane;
}
- public void setRootPane(JRootPane root)
+ protected void setRootPane(JRootPane root)
{
if (rootPane != null)
remove(rootPane);
@@ -132,7 +132,7 @@ public class JFrame extends Frame
add(rootPane, BorderLayout.CENTER);
}
- public JRootPane createRootPane()
+ protected JRootPane createRootPane()
{
return new JRootPane();
}
diff --git a/libjava/javax/swing/JInternalFrame.java b/libjava/javax/swing/JInternalFrame.java
index ead61f218fa..dba15460c48 100644
--- a/libjava/javax/swing/JInternalFrame.java
+++ b/libjava/javax/swing/JInternalFrame.java
@@ -1,5 +1,5 @@
-/* JInternalFrame.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* JInternalFrame.java --
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -780,9 +780,11 @@ public class JInternalFrame extends JComponent implements Accessible,
* This method returns null because this must always be the root of a focus
* traversal.
*
- * @return null.
+ * @return always null
+ *
+ * @since 1.4
*/
- public Container getFocusCycleRootAncestor()
+ public final Container getFocusCycleRootAncestor()
{
// as defined.
return null;
@@ -860,7 +862,7 @@ public class JInternalFrame extends JComponent implements Accessible,
{
JDesktopPane pane = getDesktopPane();
if (pane != null)
- return pane.getLayer(this).intValue();
+ return pane.getLayer(this);
return -1;
}
@@ -968,7 +970,7 @@ public class JInternalFrame extends JComponent implements Accessible,
*
* @return null.
*/
- public String getWarningString()
+ public final String getWarningString()
{
// as defined.
return null;
@@ -1019,9 +1021,11 @@ public class JInternalFrame extends JComponent implements Accessible,
/**
* This must always return true.
*
- * @return True
+ * @return always true
+ *
+ * @since 1.4
*/
- public boolean isFocusCycleRoot()
+ public final boolean isFocusCycleRoot()
{
return true;
}
@@ -1272,8 +1276,9 @@ public class JInternalFrame extends JComponent implements Accessible,
*/
public void setDefaultCloseOperation(int operation)
{
- if (operation != DO_NOTHING_ON_CLOSE || operation != HIDE_ON_CLOSE
- || operation != DISPOSE_ON_CLOSE)
+ if (operation != DO_NOTHING_ON_CLOSE
+ && operation != HIDE_ON_CLOSE
+ && operation != DISPOSE_ON_CLOSE)
throw new Error("Close operation must be one of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
defaultCloseOperation = operation;
}
diff --git a/libjava/javax/swing/JLabel.java b/libjava/javax/swing/JLabel.java
index b3d7225b1e4..c01d8110d9b 100644
--- a/libjava/javax/swing/JLabel.java
+++ b/libjava/javax/swing/JLabel.java
@@ -1,5 +1,5 @@
/* JLabel.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -92,59 +92,6 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
private transient int iconTextGap = 4;
/**
- * Fired in a PropertyChangeEvent when the "disabledIcon" property changes.
- */
- public static final String DISABLED_ICON_CHANGED_PROPERTY = "disabledIcon";
-
- /**
- * Fired in a PropertyChangeEvent when the "displayedMnemonic" property
- * changes.
- */
- public static final String DISPLAYED_MNEMONIC_CHANGED_PROPERTY = "displayedMnemonic";
-
- /**
- * Fired in a PropertyChangeEvent when the "displayedMnemonicIndex" property
- * changes.
- */
- public static final String DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY = "displayedMnemonicIndex";
-
- /**
- * Fired in a PropertyChangeEvent when the "horizontalAlignment" property
- * changes.
- */
- public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY = "horizontalAlignment";
-
- /**
- * Fired in a PropertyChangeEvent when the "horizontalTextPosition" property
- * changes.
- */
- public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY = "horizontalTextPosition";
-
- /** Fired in a PropertyChangeEvent when the "icon" property changes. */
- public static final String ICON_CHANGED_PROPERTY = "icon";
-
- /** Fired in a PropertyChangeEvent when the "iconTextGap" property changes. */
- public static final String ICON_TEXT_GAP_CHANGED_PROPERTY = "iconTextGap";
-
- /** Fired in a PropertyChangeEvent when the "labelFor" property changes. */
- public static final String LABEL_FOR_CHANGED_PROPERTY = "labelFor";
-
- /** Fired in a PropertyChangeEvent when the "text" property changes. */
- public static final String TEXT_CHANGED_PROPERTY = "text";
-
- /**
- * Fired in a PropertyChangeEvent when the "verticalAlignment" property
- * changes.
- */
- public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY = "verticalAlignment";
-
- /**
- * Fired in a PropertyChangeEvent when the "verticalTextPosition" property
- * changes.
- */
- public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY = "verticalTextPosition";
-
- /**
* Creates a new horizontally and vertically centered JLabel object with no
* text and no icon.
*/
@@ -289,7 +236,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
{
String oldText = text;
text = newText;
- firePropertyChange(TEXT_CHANGED_PROPERTY, oldText, newText);
+ firePropertyChange("text", oldText, newText);
if (text != null && text.length() <= displayedMnemonicIndex)
setDisplayedMnemonicIndex(text.length() - 1);
@@ -319,7 +266,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
{
Icon oldIcon = icon;
icon = newIcon;
- firePropertyChange(ICON_CHANGED_PROPERTY, oldIcon, newIcon);
+ firePropertyChange("icon", oldIcon, newIcon);
}
}
@@ -352,7 +299,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
{
Icon oldIcon = disabledIcon;
disabledIcon = newIcon;
- firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldIcon, newIcon);
+ firePropertyChange("disabledIcon", oldIcon, newIcon);
}
}
@@ -367,12 +314,12 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
{
if (displayedMnemonic != mnemonic)
{
- firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY,
+ firePropertyChange("displayedMnemonic",
displayedMnemonic, mnemonic);
displayedMnemonic = mnemonic;
if (text != null)
- setDisplayedMnemonicIndex(text.indexOf(mnemonic));
+ setDisplayedMnemonicIndex(text.toUpperCase().indexOf(mnemonic));
}
}
@@ -385,7 +332,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
public void setDisplayedMnemonic(char mnemonic)
{
- setDisplayedMnemonic((int) mnemonic);
+ setDisplayedMnemonic((int) Character.toUpperCase(mnemonic));
}
/**
@@ -399,7 +346,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
}
/**
- * This method sets which character in the text will be the underlined
+ * This method sets which character in the text will be the underlined
* character. If the given index is -1, then this indicates that there is
* no mnemonic. If the index is less than -1 or if the index is equal to
* the length, this method will throw an IllegalArgumentException.
@@ -410,19 +357,22 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
* length.
*/
public void setDisplayedMnemonicIndex(int newIndex)
- throws IllegalArgumentException
+ throws IllegalArgumentException
{
if (newIndex < -1 || (text != null && newIndex >= text.length()))
throw new IllegalArgumentException();
- if (text == null || text.charAt(newIndex) != displayedMnemonic)
+ if (newIndex == -1
+ || text == null
+ || text.charAt(newIndex) != displayedMnemonic)
newIndex = -1;
if (newIndex != displayedMnemonicIndex)
{
- firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY,
- displayedMnemonicIndex, newIndex);
+ int oldIndex = displayedMnemonicIndex;
displayedMnemonicIndex = newIndex;
+ firePropertyChange("displayedMnemonicIndex",
+ oldIndex, newIndex);
}
}
@@ -498,7 +448,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
{
if (iconTextGap != newGap)
{
- firePropertyChange(ICON_TEXT_GAP_CHANGED_PROPERTY, iconTextGap, newGap);
+ firePropertyChange("iconTextGap", iconTextGap, newGap);
iconTextGap = newGap;
}
}
@@ -523,13 +473,12 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
public void setVerticalAlignment(int alignment)
{
- if (alignment != verticalAlignment)
- {
- int oldAlignment = verticalAlignment;
- verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
- firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, oldAlignment,
- verticalAlignment);
- }
+ if (alignment == verticalAlignment)
+ return;
+
+ int oldAlignment = verticalAlignment;
+ verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
+ firePropertyChange("verticalAlignment", oldAlignment, verticalAlignment);
}
/**
@@ -550,9 +499,12 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
*/
public void setHorizontalAlignment(int alignment)
{
+ if (horizontalAlignment == alignment)
+ return;
+
int oldAlignment = horizontalAlignment;
horizontalAlignment = checkHorizontalKey(alignment, "horizontalAlignment");
- firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, oldAlignment,
+ firePropertyChange("horizontalAlignment", oldAlignment,
horizontalAlignment);
}
@@ -580,7 +532,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
int oldPos = verticalTextPosition;
verticalTextPosition = checkVerticalKey(textPosition,
"verticalTextPosition");
- firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos,
+ firePropertyChange("verticalTextPosition", oldPos,
verticalTextPosition);
}
}
@@ -609,7 +561,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
int oldPos = horizontalTextPosition;
horizontalTextPosition = checkHorizontalKey(textPosition,
"horizontalTextPosition");
- firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos,
+ firePropertyChange("horizontalTextPosition", oldPos,
horizontalTextPosition);
}
}
@@ -665,8 +617,9 @@ public class JLabel extends JComponent implements Accessible, SwingConstants
{
if (c != labelFor)
{
- firePropertyChange(LABEL_FOR_CHANGED_PROPERTY, labelFor, c);
+ Component oldLabelFor = labelFor;
labelFor = c;
+ firePropertyChange("labelFor", oldLabelFor, labelFor);
}
}
diff --git a/libjava/javax/swing/JLayeredPane.java b/libjava/javax/swing/JLayeredPane.java
index a200f289258..cdafd8b869f 100644
--- a/libjava/javax/swing/JLayeredPane.java
+++ b/libjava/javax/swing/JLayeredPane.java
@@ -89,7 +89,7 @@ import javax.accessibility.Accessible;
* <p><b>Note:</b> the layer numbering order is the <em>reverse</em> of the
* component indexing and position order</p>
*
- * @author Graydon Hoare <graydon@redhat.com>
+ * @author Graydon Hoare (graydon@redhat.com)
*/
public class JLayeredPane extends JComponent implements Accessible
{
@@ -122,12 +122,11 @@ public class JLayeredPane extends JComponent implements Accessible
* @return the layer the component is currently assigned to, in this container.
* @throws IllegalArgumentException if the component is not a child of this container.
*/
-
- protected Integer getLayer (Component c)
+ public int getLayer(Component c)
{
if (! componentToLayer.containsKey (c))
throw new IllegalArgumentException ();
- return (Integer) componentToLayer.get (c);
+ return ((Integer) componentToLayer.get(c)).intValue();
}
/**
@@ -144,8 +143,7 @@ public class JLayeredPane extends JComponent implements Accessible
* @throws IllegalArgumentException if layer does not refer to an active layer
* in this container.
*/
-
- protected int[] layerToRange (Integer layer)
+ private int[] layerToRange (Integer layer)
{
int[] ret = new int[2];
ret[1] = getComponents ().length;
@@ -175,8 +173,7 @@ public class JLayeredPane extends JComponent implements Accessible
* @param layer the layer number to increment.
* @see #incrLayer()
*/
-
- protected void incrLayer(Integer layer)
+ private void incrLayer(Integer layer)
{
int sz = 1;
if (layers.containsKey (layer))
@@ -190,8 +187,7 @@ public class JLayeredPane extends JComponent implements Accessible
* @param layer the layer number to decrement.
* @see #decrLayer()
*/
-
- protected void decrLayer(Integer layer)
+ private void decrLayer(Integer layer)
{
int sz = 0;
if (layers.containsKey (layer))
@@ -206,7 +202,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @return the least layer number.
* @see #lowestLayer()
*/
-
public int highestLayer()
{
if (layers.size() == 0)
@@ -221,7 +216,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @return the least layer number.
* @see #highestLayer()
*/
-
public int lowestLayer()
{
if (layers.size() == 0)
@@ -240,7 +234,6 @@ public class JLayeredPane extends JComponent implements Accessible
* this container.
* @see #moveToBack()
*/
-
public void moveToFront(Component c)
{
setPosition (c, 0);
@@ -260,7 +253,6 @@ public class JLayeredPane extends JComponent implements Accessible
* this container.
* @see #moveToFront()
*/
-
public void moveToBack(Component c)
{
setPosition (c, -1);
@@ -276,11 +268,10 @@ public class JLayeredPane extends JComponent implements Accessible
* this container.
* @see #setPosition()
*/
-
public int getPosition(Component c)
{
- Integer layer = getLayer (c);
- int[] range = layerToRange (layer);
+ int layer = getLayer (c);
+ int[] range = layerToRange(new Integer(layer));
int top = range[0];
int bot = range[1];
Component[] comps = getComponents ();
@@ -304,33 +295,32 @@ public class JLayeredPane extends JComponent implements Accessible
* this container.
* @see #getPosition()
*/
-
public void setPosition(Component c, int position)
{
- Integer layer = getLayer (c);
- int[] range = layerToRange (layer);
+ int layer = getLayer (c);
+ int[] range = layerToRange(new Integer(layer));
if (range[0] == range[1])
- throw new IllegalArgumentException ();
+ throw new IllegalArgumentException ();
int top = range[0];
int bot = range[1];
if (position == -1)
- position = (bot - top) - 1;
+ position = (bot - top) - 1;
int targ = Math.min(top + position, bot-1);
int curr = -1;
Component[] comps = getComponents();
for (int i = top; i < bot; ++i)
- {
+ {
if (comps[i] == c)
{
curr = i;
break;
}
- }
+ }
if (curr == -1)
- // should have found it
- throw new IllegalArgumentException ();
+ // should have found it
+ throw new IllegalArgumentException();
super.swapComponents (curr, targ);
revalidate();
@@ -345,7 +335,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @param layer the layer to return components from.
* @return the components in the layer.
*/
-
public Component[] getComponentsInLayer(int layer)
{
int[] range = layerToRange (getObjectForLayer (layer));
@@ -369,7 +358,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @param layer the layer count components in.
* @return the number of components in the layer.
*/
-
public int getComponentCountInLayer(int layer)
{
int[] range = layerToRange (getObjectForLayer (layer));
@@ -383,7 +371,6 @@ public class JLayeredPane extends JComponent implements Accessible
* Return a hashtable mapping child components of this container to
* Integer objects representing the component's layer assignments.
*/
-
protected Hashtable getComponentToLayer()
{
return componentToLayer;
@@ -400,11 +387,10 @@ public class JLayeredPane extends JComponent implements Accessible
* @throws IllegalArgumentException if the component is not a child of
* this container.
*/
-
public int getIndexOf(Component c)
{
- Integer layer = getLayer (c);
- int[] range = layerToRange (layer);
+ int layer = getLayer (c);
+ int[] range = layerToRange(new Integer(layer));
Component[] comps = getComponents();
for (int i = range[0]; i < range[1]; ++i)
{
@@ -423,7 +409,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @param layer the layer number as an int.
* @return the layer number as an Integer, possibly shared.
*/
-
protected Integer getObjectForLayer(int layer)
{
switch (layer)
@@ -462,7 +447,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @param position the position in the layer at which to insert a component.
* @return the index at which to insert the component.
*/
-
protected int insertIndexForLayer(int layer, int position)
{
@@ -488,12 +472,11 @@ public class JLayeredPane extends JComponent implements Accessible
*
* @param index the index of the child component to remove.
*/
-
public void remove (int index)
{
Component c = getComponent (index);
- Integer layer = getLayer (c);
- decrLayer (layer);
+ int layer = getLayer (c);
+ decrLayer (new Integer(layer));
componentToLayer.remove (c);
super.remove (index);
revalidate();
@@ -506,7 +489,6 @@ public class JLayeredPane extends JComponent implements Accessible
*
* @param comp the child to remove.
*/
-
public void remove (Component comp)
{
remove (getIndexOf (comp));
@@ -523,7 +505,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @param c the component to set the layer property for.
* @param layer the layer number to assign to the component.
*/
-
public void setLayer(Component c, int layer)
{
componentToLayer.put (c, getObjectForLayer (layer));
@@ -536,7 +517,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @param layer the layer number to assign to the component.
* @param position the position number to assign to the component.
*/
-
public void setLayer(Component c,
int layer,
int position)
@@ -558,7 +538,6 @@ public class JLayeredPane extends JComponent implements Accessible
* @param layerConstraint an integer specifying the layer to add the component to.
* @param index an ignored parameter, for compatibility.
*/
-
protected void addImpl(Component comp, Object layerConstraint, int index)
{
Integer layer;
diff --git a/libjava/javax/swing/JList.java b/libjava/javax/swing/JList.java
index d88a4db599c..adb72892450 100644
--- a/libjava/javax/swing/JList.java
+++ b/libjava/javax/swing/JList.java
@@ -1,5 +1,5 @@
/* JList.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -129,34 +129,6 @@ public class JList extends JComponent implements Accessible, Scrollable
*/
public static final int HORIZONTAL_WRAP = 2;
- /** Fired in a PropertyChangeEvent when the "cellRenderer" property changes. */
- public static final String CELL_RENDERER_PROPERTY_CHANGED = "cellRenderer";
-
- /** Fired in a PropertyChangeEvent when the "fixedCellHeight" property changes. */
- public static final String FIXED_CELL_HEIGHT_PROPERTY_CHANGED = "fixedCellHeight";
-
- /** Fired in a PropertyChangeEvent when the "fixedCellWidth" property changes. */
- public static final String FIXED_CELL_WIDTH_PROPERTY_CHANGED = "fixedCellWidth";
-
- /** Fired in a PropertyChangeEvent when the "layoutOrientation" property changes. */
- public static final String LAYOUT_ORIENTATION_PROPERTY_CHANGED = "layoutOrientation";
-
- /** Fired in a PropertyChangeEvent when the "model" property changes. */
- public static final String MODEL_PROPERTY_CHANGED = "model";
-
- /** Fired in a PropertyChangeEvent when the "prototypeCellValue" property changes. */
- public static final String PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED = "prototypeCellValue";
-
- /** Fired in a PropertyChangeEvent when the "selectionBackground" property changes. */
- public static final String SELECTION_BACKGROUND_PROPERTY_CHANGED = "selectionBackground";
-
- /** Fired in a PropertyChangeEvent when the "selectionForeground" property changes. */
- public static final String SELECTION_FOREGROUND_PROPERTY_CHANGED = "selectionForeground";
-
- /** Fired in a PropertyChangeEvent when the "selectionModel" property changes. */
- public static final String SELECTION_MODEL_PROPERTY_CHANGED = "selectionModel";
-
-
/**
* This property indicates whether "drag and drop" functions are enabled
* on the list.
@@ -187,7 +159,6 @@ public class JList extends JComponent implements Accessible, Scrollable
* is one of the integer constants {@link #VERTICAL}, {@link
* #VERTICAL_WRAP}, or {@link #HORIZONTAL_WRAP}.
*/
-
int layoutOrientation;
/** This property holds the data elements displayed by the list. */
@@ -250,12 +221,10 @@ public class JList extends JComponent implements Accessible, Scrollable
*/
int visibleRowCount;
-
-
/**
* Fire a {@link ListSelectionEvent} to all the registered ListSelectionListeners.
*/
- void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
+ protected void fireSelectionValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
{
ListSelectionEvent evt = new ListSelectionEvent(this, firstIndex, lastIndex, isAdjusting);
ListSelectionListener listeners[] = getListSelectionListeners();
@@ -265,7 +234,6 @@ public class JList extends JComponent implements Accessible, Scrollable
}
}
-
/**
* This private listener propagates {@link ListSelectionEvent} events
* from the list's "selectionModel" property to the list's {@link
@@ -365,12 +333,22 @@ public class JList extends JComponent implements Accessible, Scrollable
listListener = new ListListener();
setModel(new DefaultListModel());
- setSelectionModel(new DefaultListSelectionModel());
+ setSelectionModel(createSelectionModel());
updateUI();
}
/**
+ * Creates the default <code>ListSelectionModel</code>.
+ *
+ * @return the <code>ListSelectionModel</code>
+ */
+ protected ListSelectionModel createSelectionModel()
+ {
+ return new DefaultListSelectionModel();
+ }
+
+ /**
* Gets the value of the {@link #fixedCellHeight} property. This property
* may be <code>-1</code> to indicate that no cell height has been
* set. This property is also set implicitly when the
@@ -399,9 +377,12 @@ public class JList extends JComponent implements Accessible, Scrollable
*/
public void setFixedCellHeight(int h)
{
+ if (fixedCellHeight == h)
+ return;
+
int old = fixedCellHeight;
fixedCellHeight = h;
- firePropertyChange(FIXED_CELL_WIDTH_PROPERTY_CHANGED, old, h);
+ firePropertyChange("fixedCellWidth", old, h);
}
@@ -428,17 +409,19 @@ public class JList extends JComponent implements Accessible, Scrollable
* #prototypeCellValue} property is set, but setting it explicitly
* overrides the width computed from {@link #prototypeCellValue}.
*
- * @see #getFixedCellWidth
+ * @see #getFixedCellHeight
* @see #getPrototypeCellValue
*/
- public void setFixedCellWidth(int h)
+ public void setFixedCellWidth(int w)
{
- int old = fixedCellHeight;
- fixedCellHeight = h;
- firePropertyChange(FIXED_CELL_HEIGHT_PROPERTY_CHANGED, old, h);
+ if (fixedCellWidth == w)
+ return;
+
+ int old = fixedCellWidth;
+ fixedCellWidth = w;
+ firePropertyChange("fixedCellWidth", old, w);
}
-
/**
* Gets the value of the {@link #visibleRowCount} property.
*
@@ -501,6 +484,11 @@ public class JList extends JComponent implements Accessible, Scrollable
return (ListSelectionListener[]) getListeners(ListSelectionListener.class);
}
+ public int getSelectionMode()
+ {
+ return selectionModel.getSelectionMode();
+ }
+
/**
* Sets the list's "selectionMode" property, which simply mirrors the
* same property on the list's {@link #selectionModel} property. This
@@ -723,9 +711,12 @@ public class JList extends JComponent implements Accessible, Scrollable
*/
public void setSelectionBackground(Color c)
{
+ if (selectionBackground == c)
+ return;
+
Color old = selectionBackground;
selectionBackground = c;
- firePropertyChange(SELECTION_BACKGROUND_PROPERTY_CHANGED, old, c);
+ firePropertyChange("selectionBackground", old, c);
repaint();
}
@@ -746,9 +737,12 @@ public class JList extends JComponent implements Accessible, Scrollable
*/
public void setSelectionForeground(Color c)
{
+ if (selectionForeground == c)
+ return;
+
Color old = selectionForeground;
selectionForeground = c;
- firePropertyChange(SELECTION_FOREGROUND_PROPERTY_CHANGED, old, c);
+ firePropertyChange("selectionForeground", old, c);
}
/**
@@ -850,13 +844,16 @@ public class JList extends JComponent implements Accessible, Scrollable
/**
* Sets the value of the {@link #celLRenderer} property.
*
- * @param cellRenderer The new property value
+ * @param renderer The new property value
*/
- public void setCellRenderer(ListCellRenderer cr)
+ public void setCellRenderer(ListCellRenderer renderer)
{
+ if (cellRenderer == renderer)
+ return;
+
ListCellRenderer old = cellRenderer;
- cellRenderer = cr;
- firePropertyChange(CELL_RENDERER_PROPERTY_CHANGED, old, cr);
+ cellRenderer = renderer;
+ firePropertyChange("cellRenderer", old, renderer);
revalidate();
repaint();
}
@@ -878,15 +875,21 @@ public class JList extends JComponent implements Accessible, Scrollable
*
* @param model The new property value
*/
- public void setModel(ListModel m)
+ public void setModel(ListModel model)
{
- ListModel old = model;
- if (old != null)
- old.removeListDataListener(listListener);
- model = m;
- if (model != null)
- model.addListDataListener(listListener);
- firePropertyChange(MODEL_PROPERTY_CHANGED, old, m);
+ if (this.model == model)
+ return;
+
+ if (this.model != null)
+ this.model.removeListDataListener(listListener);
+
+ ListModel old = this.model;
+ this.model = model;
+
+ if (this.model != null)
+ this.model.addListDataListener(listListener);
+
+ firePropertyChange("model", old, model);
revalidate();
repaint();
}
@@ -902,17 +905,23 @@ public class JList extends JComponent implements Accessible, Scrollable
* {@link #listListener} is unsubscribed from the existing selection
* model, if it exists, and re-subscribed to the new selection model.
*
- * @param l The new property value
+ * @param model The new property value
*/
- public void setSelectionModel(ListSelectionModel l)
+ public void setSelectionModel(ListSelectionModel model)
{
+ if (selectionModel == model)
+ return;
+
+ if (selectionModel != null)
+ selectionModel.removeListSelectionListener(listListener);
+
ListSelectionModel old = selectionModel;
- if (old != null)
- old.removeListSelectionListener(listListener);
- selectionModel = l;
+ selectionModel = model;
+
if (selectionModel != null)
selectionModel.addListSelectionListener(listListener);
- firePropertyChange(SELECTION_MODEL_PROPERTY_CHANGED, old, l);
+
+ firePropertyChange("selectionModel", old, model);
revalidate();
repaint();
}
@@ -992,6 +1001,9 @@ public class JList extends JComponent implements Accessible, Scrollable
*/
public void setPrototypeCellValue(Object obj)
{
+ if (prototypeCellValue == obj)
+ return;
+
Object old = prototypeCellValue;
Component comp = getCellRenderer()
.getListCellRendererComponent(this, obj, 0, false, false);
@@ -999,7 +1011,7 @@ public class JList extends JComponent implements Accessible, Scrollable
fixedCellWidth = d.width;
fixedCellHeight = d.height;
prototypeCellValue = obj;
- firePropertyChange(PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED, old, obj);
+ firePropertyChange("prototypeCellValue", old, obj);
}
public AccessibleContext getAccessibleContext()
@@ -1196,4 +1208,119 @@ public class JList extends JComponent implements Accessible, Scrollable
{
return false;
}
+
+ public int getAnchorSelectionIndex()
+ {
+ return selectionModel.getAnchorSelectionIndex();
+ }
+
+ public int getLeadSelectionIndex()
+ {
+ return selectionModel.getLeadSelectionIndex();
+ }
+
+ public int getMinSelectionIndex()
+ {
+ return selectionModel.getMaxSelectionIndex();
+ }
+
+ public int getMaxSelectionIndex()
+ {
+ return selectionModel.getMaxSelectionIndex();
+ }
+
+ public void clearSelection()
+ {
+ selectionModel.clearSelection();
+ }
+
+ public void setSelectionInterval(int anchor, int lead)
+ {
+ selectionModel.setSelectionInterval(anchor, lead);
+ }
+
+ public void addSelectionInterval(int anchor, int lead)
+ {
+ selectionModel.addSelectionInterval(anchor, lead);
+ }
+
+ public void removeSelectionInterval(int index0, int index1)
+ {
+ selectionModel.removeSelectionInterval(index0, index1);
+ }
+
+ /**
+ * Returns the value of the <code>valueIsAdjusting</code> property.
+ *
+ * @return the value
+ */
+ public boolean getValueIsAdjusting()
+ {
+ return valueIsAdjusting;
+ }
+
+ /**
+ * Sets the <code>valueIsAdjusting</code> property.
+ *
+ * @param isAdjusting the new value
+ */
+ public void setValueIsAdjusting(boolean isAdjusting)
+ {
+ valueIsAdjusting = isAdjusting;
+ }
+
+ /**
+ * Return the value of the <code>dragEnabled</code> property.
+ *
+ * @return the value
+ *
+ * @since 1.4
+ */
+ public boolean getDragEnabled()
+ {
+ return dragEnabled;
+ }
+
+ /**
+ * Set the <code>dragEnabled</code> property.
+ *
+ * @param enabled new value
+ *
+ * @since 1.4
+ */
+ public void setDragEnabled(boolean enabled)
+ {
+ dragEnabled = enabled;
+ }
+
+ /**
+ * Returns the layout orientation.
+ *
+ * @return the orientation, one of <code>JList.VERTICAL</code>,
+ * <code>JList.VERTICAL_WRAP</code> and <code>JList.HORIZONTAL_WRAP</code>
+ *
+ * @since 1.4
+ */
+ public int getLayoutOrientation()
+ {
+ return layoutOrientation;
+ }
+
+ /**
+ * Sets the layout orientation.
+ *
+ * @param orientation the orientation to set, one of <code>JList.VERTICAL</code>,
+ * <code>JList.VERTICAL_WRAP</code> and <code>JList.HORIZONTAL_WRAP</code>
+ *
+ * @since 1.4
+ */
+ public void setLayoutOrientation(int orientation)
+ {
+ if (layoutOrientation == orientation)
+ return;
+
+ int old = layoutOrientation;
+ layoutOrientation = orientation;
+ firePropertyChange("layoutOrientation", old, orientation);
+ }
}
diff --git a/libjava/javax/swing/JMenu.java b/libjava/javax/swing/JMenu.java
index 812c26bed01..d9ad317a7ef 100644
--- a/libjava/javax/swing/JMenu.java
+++ b/libjava/javax/swing/JMenu.java
@@ -1,5 +1,5 @@
/* JMenu.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,11 +59,9 @@ import javax.swing.event.MenuListener;
import javax.swing.plaf.MenuItemUI;
/**
- * <p>
* This class represents a menu that can be added to a menu bar or
* can be a submenu in some other menu. When JMenu is selected it
* displays JPopupMenu containing its menu items.
- * </p>
*
* <p>
* JMenu's fires MenuEvents when this menu's selection changes. If this menu
@@ -71,14 +69,10 @@ import javax.swing.plaf.MenuItemUI;
* deselected or cancelled, then fireMenuDeselectedEvent() or
* fireMenuCancelledEvent() is invoked, respectivelly.
* </p>
- *
*/
public class JMenu extends JMenuItem implements Accessible, MenuElement
{
- static final long serialVersionUID = 4227225638931828014L;
-
- /** name for the UI delegate for this menu. */
- private static final String uiClassID = "MenuUI";
+ private static final long serialVersionUID = 4227225638931828014L;
/** A Popup menu associated with this menu, which pops up when menu is selected */
private JPopupMenu popupMenu = new JPopupMenu();
@@ -107,30 +101,32 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
}
/**
- * Creates a new JMenu with the spicified label
+ * Creates a new <code>JMenu</code> with the specified label.
*
* @param text label for this menu
*/
public JMenu(String text)
{
super(text);
+ popupMenu.setInvoker(this);
}
/**
- * Creates a new JMenu object
+ * Creates a new <code>JMenu</code> object.
*
- * @param action Action that is used to create menu item tha will be
+ * @param action Action that is used to create menu item tha will be
* added to the menu.
*/
public JMenu(Action action)
{
super(action);
createActionChangeListener(this);
+ popupMenu.setInvoker(this);
}
/**
- * Creates a new JMenu with specified label and an option
- * for this menu to be tear-off menu
+ * Creates a new <code>JMenu</code> with specified label and an option
+ * for this menu to be tear-off menu.
*
* @param text label for this menu
* @param tearoff true if this menu should be tear-off and false otherwise
@@ -273,7 +269,6 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
throw new IllegalArgumentException("index less than zero");
popupMenu.insert(item, index);
-
return item;
}
@@ -312,7 +307,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
public String getUIClassID()
{
- return uiClassID;
+ return "MenuUI";
}
/**
@@ -347,7 +342,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
// display popup associated with this menu
if (selected)
{
- super.setArmed(true);
+ super.setArmed(true);
super.setSelected(true);
// FIXME: The popup menu should be shown on the screen after certain
@@ -355,7 +350,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
// this amount of seconds. 'delay' property is 0 by default.
if (this.isShowing())
{
- fireMenuSelected();
+ fireMenuSelected();
int x = 0;
int y = 0;
@@ -388,8 +383,8 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
/**
* Checks if PopupMenu associated with this menu is visible
*
- * @return true if the popup associated with this menu is currently visible on the screen and
- * false otherwise.
+ * @return true if the popup associated with this menu is currently visible
+ * on the screen and false otherwise.
*/
public boolean isPopupMenuVisible()
{
@@ -528,15 +523,15 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
}
/**
- * Returns number of items in the menu
+ * Returns number of items in the menu including separators.
*
* @return number of items in the menu
+ *
+ * @see #getMenuComponentCount()
*/
public int getItemCount()
{
- // returns the number of items on
- // the menu, including separators.
- return getComponents().length;
+ return getMenuComponentCount();
}
/**
@@ -592,10 +587,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
public boolean isTopLevelMenu()
{
- if (getParent() instanceof JMenuBar)
- return true;
- else
- return false;
+ return getParent() instanceof JMenuBar;
}
/**
@@ -790,7 +782,7 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
*/
protected String paramString()
{
- return "JMenu";
+ return super.paramString();
}
public AccessibleContext getAccessibleContext()
diff --git a/libjava/javax/swing/JMenuBar.java b/libjava/javax/swing/JMenuBar.java
index 904ba3b69a3..e14c2627073 100644
--- a/libjava/javax/swing/JMenuBar.java
+++ b/libjava/javax/swing/JMenuBar.java
@@ -1,5 +1,5 @@
-/* JMenuBar.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* JMenuBar.java --
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,6 @@ import javax.accessibility.AccessibleContext;
import javax.swing.plaf.MenuBarUI;
/**
- * <p>
* JMenuBar is a container for menu's. For a menu bar to be seen on the
* screen, at least one menu should be added to it. Just like adding
* components to container, one can use add() to add menu's to the menu bar.
@@ -57,18 +56,9 @@ import javax.swing.plaf.MenuBarUI;
* The JMenuBar uses selectionModel to keep track of selected menu index.
* JMenuBar's selectionModel will fire ChangeEvents to its registered
* listeners when the selected index changes.
- * </p>
*/
public class JMenuBar extends JComponent implements Accessible, MenuElement
{
- /** Fired in a PropertyChangeEvent when the "borderPainted" property changes. */
- public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted";
-
- /** Fired in a PropertyChangeEvent when the "model" changes. */
- public static final String MODEL_CHANGED_PROPERTY = "model";
-
- /** Fired in a PropertyChangeEvent when the "margin" changes. */
- public static final String MARGIN_CHANGED_PROPERTY = "margin";
private static final long serialVersionUID = -8191026883931977036L;
/** JMenuBar's model. It keeps track of selected menu's index */
@@ -294,7 +284,7 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
* This method does nothing by default. This method is need for the
* MenuElement interface to be implemented.
*
- * @param isIncluded true if menuBar is included in the selection
+ * @param isIncluded true if menuBar is included in the selection
* and false otherwise
*/
public void menuSelectionChanged(boolean isIncluded)
@@ -303,7 +293,7 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
}
/**
- * Paints border of the menu bar, if its borderPainted property is set to
+ * Paints border of the menu bar, if its borderPainted property is set to
* true.
*
* @param g The graphics context with which to paint the border
@@ -323,7 +313,13 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
*/
protected String paramString()
{
- return "JMenuBar";
+ StringBuffer sb = new StringBuffer();
+ sb.append(super.paramString());
+ sb.append(",margin=");
+ if (getMargin() != null)
+ sb.append(getMargin());
+ sb.append(",paintBorder=").append(isBorderPainted());
+ return sb.toString();
}
/**
@@ -374,11 +370,11 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
*/
public void setBorderPainted(boolean b)
{
- boolean old = borderPainted;
- borderPainted = b;
- if (b != old)
+ if (b != borderPainted)
{
- firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, old, b);
+ boolean old = borderPainted;
+ borderPainted = b;
+ firePropertyChange("borderPainted", old, b);
revalidate();
repaint();
}
@@ -404,14 +400,12 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
*/
public void setMargin(Insets m)
{
- if (m.equals(this.margin))
+ if (m != margin)
{
- Insets oldMargin = this.margin;
- this.margin = m;
- firePropertyChange(MARGIN_CHANGED_PROPERTY, oldMargin, margin);
+ Insets oldMargin = margin;
+ margin = m;
+ firePropertyChange("margin", oldMargin, margin);
}
-
- this.margin = m;
}
/**
@@ -434,15 +428,11 @@ public class JMenuBar extends JComponent implements Accessible, MenuElement
*/
public void setSelectionModel(SingleSelectionModel model)
{
- selectionModel = model;
if (selectionModel != model)
{
SingleSelectionModel oldModel = selectionModel;
-
selectionModel = model;
-
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel,
- this.selectionModel);
+ firePropertyChange("model", oldModel, selectionModel);
}
}
diff --git a/libjava/javax/swing/JMenuItem.java b/libjava/javax/swing/JMenuItem.java
index 0aaf0c790e2..0ea38e0f7ba 100644
--- a/libjava/javax/swing/JMenuItem.java
+++ b/libjava/javax/swing/JMenuItem.java
@@ -1,5 +1,5 @@
/* JMenuItem.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,9 +60,7 @@ import javax.swing.event.MenuKeyEvent;
import javax.swing.event.MenuKeyListener;
import javax.swing.plaf.MenuItemUI;
-
/**
- * <p>
* JMenuItem represents element in the menu. It inherits most of
* its functionality from AbstractButton, however its behavior somewhat
* varies from it. JMenuItem fire different kinds of events.
@@ -71,16 +69,12 @@ import javax.swing.plaf.MenuItemUI;
* fired when menu item is selected. In addition to this events menuItem also
* fire MenuDragMouseEvent and MenuKeyEvents when mouse is dragged over
* the menu item or associated key with menu item is invoked respectively.
- * </p>
*/
public class JMenuItem extends AbstractButton implements Accessible,
MenuElement
{
private static final long serialVersionUID = -1681004643499461044L;
- /** name for the UI delegate for this menuItem. */
- private static final String uiClassID = "MenuItemUI";
-
/** Combination of keyboard keys that can be used to activate this menu item */
private KeyStroke accelerator;
@@ -212,7 +206,7 @@ public class JMenuItem extends AbstractButton implements Accessible,
*/
public String getUIClassID()
{
- return uiClassID;
+ return "MenuItemUI";
}
/**
@@ -325,11 +319,11 @@ public class JMenuItem extends AbstractButton implements Accessible,
break;
case MouseEvent.MOUSE_ENTERED:
if (isRolloverEnabled())
- model.setRollover(true);
+ model.setRollover(true);
break;
case MouseEvent.MOUSE_EXITED:
if (isRolloverEnabled())
- model.setRollover(false);
+ model.setRollover(false);
// for JMenu last element on the path is its popupMenu.
// JMenu shouldn't me disarmed.
@@ -532,14 +526,14 @@ public class JMenuItem extends AbstractButton implements Accessible,
Component parent = this.getParent();
if (changed)
{
- model.setArmed(true);
+ model.setArmed(true);
if (parent != null && parent instanceof JPopupMenu)
((JPopupMenu) parent).setSelected(this);
}
else
{
- model.setArmed(false);
+ model.setArmed(false);
if (parent != null && parent instanceof JPopupMenu)
((JPopupMenu) parent).getSelectionModel().clearSelection();
@@ -551,7 +545,7 @@ public class JMenuItem extends AbstractButton implements Accessible,
*
* @return $MenuElement[]$ Returns array of sub-components for this menu
* item. By default menuItem doesn't have any subcomponents and so
- * empty array is returned instead.
+ * empty array is returned instead.
*/
public MenuElement[] getSubElements()
{
@@ -644,7 +638,7 @@ public class JMenuItem extends AbstractButton implements Accessible,
*/
protected String paramString()
{
- return "JMenuItem";
+ return super.paramString();
}
public AccessibleContext getAccessibleContext()
diff --git a/libjava/javax/swing/JOptionPane.java b/libjava/javax/swing/JOptionPane.java
index 26236822cec..0a00729b5cc 100644
--- a/libjava/javax/swing/JOptionPane.java
+++ b/libjava/javax/swing/JOptionPane.java
@@ -64,7 +64,7 @@ public class JOptionPane extends JComponent implements Accessible
{
/** DOCUMENT ME! */
private static final long serialVersionUID = 686071432213084821L;
-
+
/**
* Creates a new AccessibleJOptionPane object.
*/
@@ -85,7 +85,7 @@ public class JOptionPane extends JComponent implements Accessible
/** DOCUMENT ME! */
private static final long serialVersionUID = 5231143276678566796L;
-
+
/** The value returned when cancel option is selected. */
public static final int CANCEL_OPTION = 2;
diff --git a/libjava/javax/swing/JPasswordField.java b/libjava/javax/swing/JPasswordField.java
index 133c99ac310..449aa82cd2c 100644
--- a/libjava/javax/swing/JPasswordField.java
+++ b/libjava/javax/swing/JPasswordField.java
@@ -47,9 +47,10 @@ import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
/**
- * JPasswordField
- * @author Andrew Selkirk
- * @version 1.0
+ * class JPasswordField
+ *
+ * @author Andrew Selkirk
+ * @version 1.0
*/
public class JPasswordField extends JTextField
{
@@ -69,6 +70,7 @@ public class JPasswordField extends JTextField
/**
* getAccessibleRole
+ *
* @return AccessibleRole
*/
public AccessibleRole getAccessibleRole()
@@ -83,7 +85,7 @@ public class JPasswordField extends JTextField
private char echoChar = 0;
/**
- * Constructor JPasswordField
+ * Creates a <code>JPasswordField</code> object.
*/
public JPasswordField()
{
@@ -240,7 +242,7 @@ public class JPasswordField extends JTextField
*/
public char[] getPassword()
{
- return null; // TODO
+ return new char[0]; // TODO
}
/**
diff --git a/libjava/javax/swing/JPopupMenu.java b/libjava/javax/swing/JPopupMenu.java
index 76f63621d7e..00998b81a6f 100644
--- a/libjava/javax/swing/JPopupMenu.java
+++ b/libjava/javax/swing/JPopupMenu.java
@@ -1,5 +1,5 @@
-/* JPopupMenu.java
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* JPopupMenu.java --
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,6 @@ package javax.swing;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
-import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.Panel;
@@ -53,6 +52,7 @@ import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.util.ArrayList;
import java.util.EventListener;
import javax.accessibility.Accessible;
@@ -92,12 +92,6 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
{
private static final long serialVersionUID = -8336996630009646009L;
- /** name for the UI delegate for this menuItem. */
- private static final String uiClassID = "PopupMenuUI";
-
- /** Fire a PropertyChangeEvent when the "borderPainted" property changes. */
- public static final String LABEL_CHANGED_PROPERTY = "label";
-
/* indicates if popup's menu border should be painted*/
private boolean borderPainted = true;
@@ -142,19 +136,12 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
/* Field indicating if popup menu is visible or not */
private boolean visible = false;
- /* Bound Property indicating visibility of the popup menu*/
- public static final String VISIBLE_CHANGED_PROPERTY = "visible";
-
/**
* Creates a new JPopupMenu object.
*/
public JPopupMenu()
{
- updateUI();
-
- lightWeightPopupEnabled = DefaultLightWeightPopupEnabled;
- selectionModel = new DefaultSingleSelectionModel();
- super.setVisible(false);
+ this(null);
}
/**
@@ -164,7 +151,11 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
*/
public JPopupMenu(String label)
{
+ lightWeightPopupEnabled = getDefaultLightWeightPopupEnabled();
setLabel(label);
+ setSelectionModel(new DefaultSingleSelectionModel());
+ super.setVisible(false);
+ updateUI();
}
private void readObject(ObjectInputStream stream)
@@ -177,12 +168,12 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
}
/**
- * Adds given menu item to the popup menu
- *
- * @param item menu item to add to the popup menu
- *
- * @return menu item that was added to the popup menu
- */
+ * Adds given menu item to the popup menu
+ *
+ * @param item menu item to add to the popup menu
+ *
+ * @return menu item that was added to the popup menu
+ */
public JMenuItem add(JMenuItem item)
{
this.insert(item, -1);
@@ -291,18 +282,6 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
}
/**
- * Paints popup menu's border if borderPainted is true
- *
- * @param graphics graphics context used to paint this popup's menu border.
- */
- protected void borderPainted(Graphics graphics)
- {
- if (borderPainted)
- getBorder().paintBorder(this, graphics, 0, 0, getSize(null).width,
- getSize(null).height);
- }
-
- /**
* Returns flag indicating if newly created JPopupMenu will use
* heavyweight or lightweight container to display its menu items
*
@@ -386,10 +365,7 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
*/
public void setSelectionModel(SingleSelectionModel model)
{
- if (selectionModel != model)
- {
- SingleSelectionModel oldModel = this.selectionModel;
- }
+ selectionModel = model;
}
/**
@@ -452,7 +428,7 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
/**
* Sets label for this popup menu. This method fires PropertyChangeEvent
* when the label property is changed. Please note that most
- * of the Look & Feel will ignore this property.
+ * of the Look &amp; Feel will ignore this property.
*
* @param label label for this popup menu
*/
@@ -461,8 +437,8 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
if (label != this.label)
{
String oldLabel = this.label;
- this.label = label;
- firePropertyChange(LABEL_CHANGED_PROPERTY, oldLabel, label);
+ this.label = label;
+ firePropertyChange("label", oldLabel, label);
}
}
@@ -574,11 +550,14 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
*/
public void setVisible(boolean visible)
{
+ if (visible == isVisible())
+ return;
+
boolean old = isVisible();
this.visible = visible;
if (old != isVisible())
{
- firePropertyChange(VISIBLE_CHANGED_PROPERTY, old, (boolean) isVisible());
+ firePropertyChange("visible", old, isVisible());
if (visible)
{
firePopupMenuWillBecomeVisible();
@@ -619,11 +598,11 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
{
// Subtract insets of the top-level container if popup menu's
// top-left corner is inside it.
- Insets insets = rootContainer.getInsets();
- popup.show(popupLocation.x - insets.left,
- popupLocation.y - insets.top, size.width,
- size.height);
- }
+ Insets insets = rootContainer.getInsets();
+ popup.show(popupLocation.x - insets.left,
+ popupLocation.y - insets.top, size.width,
+ size.height);
+ }
}
else
{
@@ -791,7 +770,17 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
*/
protected String paramString()
{
- return "JPopupMenu";
+ StringBuffer sb = new StringBuffer();
+ sb.append(super.paramString());
+ sb.append(",label=");
+ if (getLabel() != null)
+ sb.append(getLabel());
+ sb.append(",lightWeightPopupEnabled=").append(isLightWeightPopupEnabled());
+ sb.append(",margin=");
+ if (getMargin() != null)
+ sb.append(margin);
+ sb.append(",paintBorder=").append(isBorderPainted());
+ return sb.toString();
}
/**
@@ -839,19 +828,22 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
}
/**
- * Return subcomonents of this popup menu.
+ * Return subcomonents of this popup menu. This method returns only
+ * components that implement the <code>MenuElement</code> interface.
*
- * @return Array containing menuItem's of belonging to this popup menu.
+ * @return array of menu items belonging to this popup menu
*/
public MenuElement[] getSubElements()
{
Component[] items = getComponents();
- MenuElement[] subElements = new MenuElement[items.length];
+ ArrayList subElements = new ArrayList();
for (int i = 0; i < items.length; i++)
- subElements[i] = (MenuElement) items[i];
+ if (items[i] instanceof MenuElement)
+ subElements.add(items[i]);
- return subElements;
+ return (MenuElement[])
+ subElements.toArray(new MenuElement[subElements.size()]);
}
/**
@@ -1038,14 +1030,6 @@ public class JPopupMenu extends JComponent implements Accessible, MenuElement
this.setBounds(x, y, width, height);
this.show();
}
-
- /**
- * Hides JWindow with menu item's from the screen.
- */
- public void hide()
- {
- super.hide();
- }
}
/**
diff --git a/libjava/javax/swing/JProgressBar.java b/libjava/javax/swing/JProgressBar.java
index 3c4084724f2..105f7c49073 100644
--- a/libjava/javax/swing/JProgressBar.java
+++ b/libjava/javax/swing/JProgressBar.java
@@ -1,5 +1,5 @@
/* JProgressBar.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
import java.awt.Graphics;
@@ -48,21 +49,18 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ProgressBarUI;
-
/**
- * <p>
* The ProgressBar is a widget that displays in two modes. In
* determinate mode, it displays fills a percentage of its bar
* based on its current value. In indeterminate mode, it creates
* box and bounces it between its bounds.
- * </p>
*
* <p>
* JProgressBars have the following properties:
* </p>
*
* <table>
- * <tr><th> Property </td><th> Stored in </td><th> Bound? </td></tr>
+ * <tr><th> Property </th><th> Stored in </th><th> Bound? </th></tr>
* <tr><td> borderPainted </td><td> progressBar </td><td> yes </td></tr>
* <tr><td> changeListeners </td><td> progressBar </td><td> no </td></tr>
* <tr><td> indeterminate </td><td> progressBar </td><td> yes </td></tr>
@@ -171,21 +169,6 @@ public class JProgressBar extends JComponent implements SwingConstants,
private static final long serialVersionUID = 1980046021813598781L;
- /** Fired in a PropertyChangeEvent when the "borderPainted" property changes. */
- public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted";
-
- /** Fired in a PropertyChangeEvent when the "orientation" property changes. */
- public static final String ORIENTATION_CHANGED_PROPERTY = "orientation";
-
- /** Fired in a PropertyChangeEvent when the "string" property changes. */
- public static final String STRING_CHANGED_PROPERTY = "string";
-
- /** Fired in a PropertyChangeEvent when the "stringPainted" property changes. */
- public static final String STRING_PAINTED_CHANGED_PROPERTY = "stringPainted";
-
- /** Fired in a PropertyChangeEvent when the "indeterminate" property changes. */
- public static final String INDETERMINATE_CHANGED_PROPERTY = "indeterminate";
-
/** Whether the ProgressBar is determinate. */
private transient boolean indeterminate = false;
@@ -331,7 +314,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
{
int oldOrientation = this.orientation;
this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
+ firePropertyChange("orientation", oldOrientation,
this.orientation);
}
}
@@ -357,7 +340,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
{
boolean oldPainted = paintString;
paintString = painted;
- firePropertyChange(STRING_PAINTED_CHANGED_PROPERTY, oldPainted,
+ firePropertyChange("stringPainted", oldPainted,
paintString);
}
}
@@ -394,7 +377,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
{
String oldString = progressString;
progressString = string;
- firePropertyChange(STRING_CHANGED_PROPERTY, oldString, progressString);
+ firePropertyChange("string", oldString, progressString);
}
}
@@ -435,7 +418,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
{
boolean oldPainted = paintBorder;
paintBorder = painted;
- firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, oldPainted,
+ firePropertyChange("borderPainted", oldPainted,
paintBorder);
}
}
@@ -641,7 +624,7 @@ public class JProgressBar extends JComponent implements SwingConstants,
{
boolean olddeter = indeterminate;
indeterminate = newValue;
- firePropertyChange(INDETERMINATE_CHANGED_PROPERTY, olddeter,
+ firePropertyChange("indeterminate", olddeter,
indeterminate);
}
}
diff --git a/libjava/javax/swing/JRadioButton.java b/libjava/javax/swing/JRadioButton.java
index fc06d15a114..da8c8395a24 100644
--- a/libjava/javax/swing/JRadioButton.java
+++ b/libjava/javax/swing/JRadioButton.java
@@ -1,5 +1,5 @@
/* JRadioButton.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,9 +59,9 @@ import javax.swing.plaf.ButtonUI;
* within the same panel, possibly with an appropriate border to denote
* the connection between the components.
*
- * @author Michael Koch <konqueror@gmx.de>
- * @author Graydon Hoare <graydon@redhat.com>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Graydon Hoare (graydon@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see JToggleButton
* @see ButtonGroup
* @since 1.2
diff --git a/libjava/javax/swing/JRootPane.java b/libjava/javax/swing/JRootPane.java
index 4f067c9aab9..145750758a4 100644
--- a/libjava/javax/swing/JRootPane.java
+++ b/libjava/javax/swing/JRootPane.java
@@ -100,7 +100,7 @@ public class JRootPane extends JComponent
protected RootLayout()
{
}
-
+
/**
* DOCUMENT ME!
*
@@ -230,8 +230,8 @@ public class JRootPane extends JComponent
{
glassPane.setBounds(0, 0, containerSize.width,
containerSize.height);
- contentPane.setBounds(0, 0, containerSize.width,
- containerSize.height);
+ contentPane.setBounds(0, 0, containerSize.width,
+ containerSize.height);
}
layeredPane.setSize(containerSize.width, containerSize.height);
@@ -333,6 +333,11 @@ public class JRootPane extends JComponent
protected Container contentPane;
protected JButton defaultButton;
+
+ /**
+ * @since 1.4
+ */
+ private int windowDecorationStyle = NONE;
/**
* DOCUMENT ME!
@@ -341,8 +346,20 @@ public class JRootPane extends JComponent
*/
public void setJMenuBar(JMenuBar m)
{
+ JLayeredPane jlPane = getLayeredPane();
+ if (menuBar != null)
+ jlPane.remove(menuBar);
menuBar = m;
- getLayeredPane().add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER);
+ if (menuBar != null)
+ jlPane.add(menuBar, JLayeredPane.FRAME_CONTENT_LAYER);
+ }
+
+ /**
+ * @deprecated Replaced by <code>setJMenuBar()</code>
+ */
+ public void setMenuBar(JMenuBar m)
+ {
+ setJMenuBar(m);
}
/**
@@ -356,6 +373,14 @@ public class JRootPane extends JComponent
}
/**
+ * @deprecated Replaced by <code>getJMenuBar()</code>
+ */
+ public JMenuBar getMenuBar()
+ {
+ return getJMenuBar();
+ }
+
+ /**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
@@ -569,4 +594,32 @@ public class JRootPane extends JComponent
defaultButton = newButton;
firePropertyChange("defaultButton", oldButton, newButton);
}
+
+ /**
+ * @since 1.4
+ */
+ public int getWindowDecorationStyle()
+ {
+ return windowDecorationStyle;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public void setWindowDecorationStyle(int style)
+ {
+ if (style != NONE
+ && style != FRAME
+ && style != INFORMATION_DIALOG
+ && style != ERROR_DIALOG
+ && style != COLOR_CHOOSER_DIALOG
+ && style != FILE_CHOOSER_DIALOG
+ && style != QUESTION_DIALOG
+ && style != WARNING_DIALOG)
+ throw new IllegalArgumentException("invalid style");
+
+ int oldStyle = windowDecorationStyle;
+ windowDecorationStyle = style;
+ firePropertyChange("windowDecorationStyle", oldStyle, style);
+ }
}
diff --git a/libjava/javax/swing/JScrollBar.java b/libjava/javax/swing/JScrollBar.java
index b755c6f2a99..0ed7679e77f 100644
--- a/libjava/javax/swing/JScrollBar.java
+++ b/libjava/javax/swing/JScrollBar.java
@@ -1,5 +1,5 @@
/* JScrollBar.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
import java.awt.Adjustable;
@@ -47,11 +48,8 @@ import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleStateSet;
import javax.accessibility.AccessibleValue;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
import javax.swing.plaf.ScrollBarUI;
-
/**
* The JScrollBar. Two buttons control how the values that the
* scroll bar can take. You can also drag the thumb or click the track
@@ -154,18 +152,6 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
private static final long serialVersionUID = -8195169869225066566L;
- /** Fired in a PropertyChangeEvent when the "blockIncrement" changes. */
- public static final String BLOCK_INCREMENT_CHANGED_PROPERTY = "blockIncrement";
-
- /** Fired in a PropertyChangeEvent when the "model" changes. */
- public static final String MODEL_CHANGED_PROPERTY = "model";
-
- /** Fired in a PropertyChangeEvent when the "orientation" changes. */
- public static final String ORIENTATION_CHANGED_PROPERTY = "orientation";
-
- /** Fired in a PropertyChangeEvent when the "unitIncrement" changes. */
- public static final String UNIT_INCREMENT_CHANGED_PROPERTY = "unitIncrement";
-
/** How much the thumb moves when moving in a block. */
protected int blockIncrement = 10;
@@ -178,12 +164,6 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
/** How much the thumb moves when moving in a unit. */
protected int unitIncrement = 1;
- /** The ChangeListener that listens to the model. */
- private transient ChangeListener changeListener;
-
- /** The ChangeEvent that's fired. */
- private transient ChangeEvent changeEvent;
-
/**
* Creates a new horizontal JScrollBar object with a minimum
* of 0, a maxmium of 100, a value of 0 and an extent of 10.
@@ -223,8 +203,6 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
throw new IllegalArgumentException(orientation
+ " is not a legal orientation");
this.orientation = orientation;
- changeListener = createChangeListener();
- model.addChangeListener(changeListener);
updateUI();
}
@@ -297,7 +275,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
{
int oldOrientation = this.orientation;
this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
+ firePropertyChange("orientation", oldOrientation,
this.orientation);
}
}
@@ -325,9 +303,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
{
BoundedRangeModel oldModel = model;
model = newModel;
- oldModel.removeChangeListener(changeListener);
- model.addChangeListener(changeListener);
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, model);
+ firePropertyChange("model", oldModel, model);
}
}
@@ -356,7 +332,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
{
int oldInc = this.unitIncrement;
this.unitIncrement = unitIncrement;
- firePropertyChange(UNIT_INCREMENT_CHANGED_PROPERTY, oldInc,
+ firePropertyChange("unitIncrement", oldInc,
this.unitIncrement);
}
}
@@ -386,7 +362,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
{
int oldInc = this.blockIncrement;
this.blockIncrement = blockIncrement;
- firePropertyChange(BLOCK_INCREMENT_CHANGED_PROPERTY, oldInc,
+ firePropertyChange("blockIncrement", oldInc,
this.blockIncrement);
}
}
@@ -558,70 +534,6 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible
}
/**
- * This method creates a new ChangeListener.
- *
- * @return A new ChangeListener.
- */
- private ChangeListener createChangeListener()
- {
- return new ChangeListener()
- {
- public void stateChanged(ChangeEvent e)
- {
- fireStateChanged();
- }
- };
- }
-
- /**
- * This method is called whenever the model fires a ChangeEvent. It should
- * propagate the ChangeEvent to its listeners with a new ChangeEvent that
- * identifies the scroll bar as the source.
- */
- private void fireStateChanged()
- {
- Object[] changeListeners = listenerList.getListenerList();
- if (changeEvent == null)
- changeEvent = new ChangeEvent(this);
- for (int i = changeListeners.length - 2; i >= 0; i -= 2)
- {
- if (changeListeners[i] == ChangeListener.class)
- ((ChangeListener) changeListeners[i + 1]).stateChanged(changeEvent);
- }
- }
-
- /**
- * This method adds a ChangeListener to the scroll bar.
- *
- * @param listener The listener to add.
- */
- public void addChangeListener(ChangeListener listener)
- {
- listenerList.add(ChangeListener.class, listener);
- }
-
- /**
- * This method removes a ChangeListener from the scroll bar.
- *
- * @param listener The listener to remove.
- */
- public void removeChangeListener(ChangeListener listener)
- {
- listenerList.remove(ChangeListener.class, listener);
- }
-
- /**
- * This method returns an array of all ChangeListeners listening to this
- * scroll bar.
- *
- * @return An array of ChangeListeners listening to this scroll bar.
- */
- public ChangeListener[] getChangeListeners()
- {
- return (ChangeListener[]) listenerList.getListeners(ChangeListener.class);
- }
-
- /**
* This method adds an AdjustmentListener to the scroll bar.
*
* @param listener The listener to add.
diff --git a/libjava/javax/swing/JScrollPane.java b/libjava/javax/swing/JScrollPane.java
index 01131b7268e..dfe5a76b196 100644
--- a/libjava/javax/swing/JScrollPane.java
+++ b/libjava/javax/swing/JScrollPane.java
@@ -1,5 +1,5 @@
/* JScrollPane.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -99,18 +99,6 @@ public class JScrollPane
boolean wheelScrollingEnabled;
ChangeListener scrollListener;
- public static final String COLUMN_HEADER_CHANGED_PROPERTY = "columnHeader";
- public static final String COMPONENT_ORIENTATION_CHANGED_PROPERTY = "componentOrientation";
- public static final String HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY = "horizontalScrollBar";
- public static final String HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY = "horizontalScrollBarPolicy";
- public static final String LAYOUT_CHANGED_PROPERTY = "layout";
- public static final String ROW_HEADER_CHANGED_PROPERTY = "rowHeader";
- public static final String VERTICAL_SCROLLBAR_CHANGED_PROPERTY = "verticalScrollBar";
- public static final String VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY = "verticalScrollBarPolicy";
- public static final String VIEWPORT_CHANGED_PROPERTY = "viewport";
- public static final String VIEWPORT_BORDER_CHANGED_PROPERTY = "viewportBorder";
- public static final String WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY = "wheelScrollingEnabled";
-
public JViewport getColumnHeader()
{
return columnHeader;
@@ -247,17 +235,20 @@ public class JScrollPane
{
ComponentOrientation old = super.getComponentOrientation();
super.setComponentOrientation(co);
- firePropertyChange(COMPONENT_ORIENTATION_CHANGED_PROPERTY, old, co);
+ firePropertyChange("componentOrientation", old, co);
sync();
}
public void setColumnHeader(JViewport h)
{
+ if (columnHeader == h)
+ return;
+
JViewport old = columnHeader;
removeNonNull(old);
columnHeader = h;
addNonNull(h);
- firePropertyChange(COLUMN_HEADER_CHANGED_PROPERTY, old, h);
+ firePropertyChange("columnHeader", old, h);
sync();
}
@@ -327,11 +318,14 @@ public class JScrollPane
public void setHorizontalScrollBar(JScrollBar h)
{
+ if (horizontalScrollBar == h)
+ return;
+
JScrollBar old = horizontalScrollBar;
removeNonNull(old);
horizontalScrollBar = h;
addNonNull(h);
- firePropertyChange(HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY, old, h);
+ firePropertyChange("horizontalScrollBar", old, h);
sync();
if (old != null)
@@ -349,14 +343,18 @@ public class JScrollPane
}
public void setHorizontalScrollBarPolicy(int h)
- {
+ {
+ if (horizontalScrollBarPolicy == h)
+ return;
+
if (h != HORIZONTAL_SCROLLBAR_AS_NEEDED
&& h != HORIZONTAL_SCROLLBAR_NEVER
&& h != HORIZONTAL_SCROLLBAR_ALWAYS)
throw new IllegalArgumentException("unknown horizontal scrollbar policy");
+
int old = horizontalScrollBarPolicy;
horizontalScrollBarPolicy = h;
- firePropertyChange(HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY, old, h);
+ firePropertyChange("horizontalScrollBarPolicy", old, h);
sync();
}
@@ -366,17 +364,20 @@ public class JScrollPane
ScrollPaneLayout tmp = (ScrollPaneLayout) l;
super.setLayout(l);
tmp.syncWithScrollPane(this);
- firePropertyChange(LAYOUT_CHANGED_PROPERTY, old, l);
+ firePropertyChange("layout", old, l);
sync();
}
public void setRowHeader(JViewport v)
{
+ if (rowHeader == v)
+ return;
+
JViewport old = rowHeader;
removeNonNull(old);
rowHeader = v;
addNonNull(v);
- firePropertyChange(ROW_HEADER_CHANGED_PROPERTY, old, v);
+ firePropertyChange("rowHeader", old, v);
sync();
}
@@ -390,11 +391,14 @@ public class JScrollPane
public void setVerticalScrollBar(JScrollBar v)
{
+ if (verticalScrollBar == v)
+ return;
+
JScrollBar old = verticalScrollBar;
removeNonNull(old);
verticalScrollBar = v;
addNonNull(v);
- firePropertyChange(VERTICAL_SCROLLBAR_CHANGED_PROPERTY, old, v);
+ firePropertyChange("verticalScrollBar", old, v);
sync();
if (old != null)
@@ -413,26 +417,36 @@ public class JScrollPane
public void setVerticalScrollBarPolicy(int v)
{
+ if (verticalScrollBarPolicy == v)
+ return;
+
if (v != VERTICAL_SCROLLBAR_AS_NEEDED
&& v != VERTICAL_SCROLLBAR_NEVER
&& v != VERTICAL_SCROLLBAR_ALWAYS)
throw new IllegalArgumentException("unknown vertical scrollbar policy");
+
int old = verticalScrollBarPolicy;
verticalScrollBarPolicy = v;
- firePropertyChange(VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY, old, v);
+ firePropertyChange("verticalScrollBarPolicy", old, v);
sync();
}
public void setWheelScrollingEnabled(boolean b)
{
+ if (wheelScrollingEnabled == b)
+ return;
+
boolean old = wheelScrollingEnabled;
wheelScrollingEnabled = b;
- firePropertyChange(WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY, old, b);
+ firePropertyChange("wheelScrollingEnabled", old, b);
sync();
}
public void setViewport(JViewport v)
{
+ if (viewport == v)
+ return;
+
JViewport old = viewport;
removeNonNull(old);
if (old != null)
@@ -443,15 +457,18 @@ public class JScrollPane
addNonNull(v);
revalidate();
repaint();
- firePropertyChange(VIEWPORT_CHANGED_PROPERTY, old, v);
+ firePropertyChange("viewport", old, v);
sync();
}
public void setViewportBorder(Border b)
{
+ if (viewportBorder == b)
+ return;
+
Border old = viewportBorder;
viewportBorder = b;
- firePropertyChange(VIEWPORT_BORDER_CHANGED_PROPERTY, old, b);
+ firePropertyChange("viewportBorder", old, b);
sync();
}
@@ -588,7 +605,7 @@ public class JScrollPane
return new ScrollBar(SwingConstants.VERTICAL);
}
- public JViewport createViewport()
+ protected JViewport createViewport()
{
return new JViewport();
}
@@ -624,7 +641,7 @@ public class JScrollPane
super.setUI(ui);
}
- class ScrollBar
+ protected class ScrollBar
extends JScrollBar
implements UIResource
{
@@ -660,8 +677,5 @@ public class JScrollPane
direction);
}
}
-
-
}
-
}
diff --git a/libjava/javax/swing/JSlider.java b/libjava/javax/swing/JSlider.java
index 0bc013cb128..cfe7880df65 100644
--- a/libjava/javax/swing/JSlider.java
+++ b/libjava/javax/swing/JSlider.java
@@ -1,5 +1,5 @@
/* JSlider.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
import java.awt.Dimension;
@@ -54,14 +55,11 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.SliderUI;
-
/**
- * <p>
* The JSlider is a Swing component that allows selection of a value within a
* range by adjusting a thumb in a track. The values for the minimum,
* maximum, extent and value are stored in a {@link
* DefaultBoundedRangeModel}.
- * </p>
*
* <p>
* JSliders have the following properties:
@@ -114,7 +112,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
MenuContainer, Serializable
{
/** DOCUMENT ME! */
- static final long serialVersionUID = -1441275936141218479L;
+ private static final long serialVersionUID = -1441275936141218479L;
/**
* DOCUMENT ME!
@@ -206,36 +204,6 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
}
}
- /** Fired in a PropertyChangeEvent when the "inverted" property changes. */
- public static final String INVERTED_CHANGED_PROPERTY = "inverted";
-
- /** Fired in a PropertyChangeEvent when the "labelTable" property changes. */
- public static final String LABEL_TABLE_CHANGED_PROPERTY = "labelTable";
-
- /**
- * Fired in a PropertyChangeEvent when the "majorTickSpacing" property
- * changes.
- */
- public static final String MAJOR_TICK_SPACING_CHANGED_PROPERTY = "majorTickSpacing";
-
- /**
- * Fired in a PropertyChangeEvent when the "minorTickSpacing" property
- * changes.
- */
- public static final String MINOR_TICK_SPACING_CHANGED_PROPERTY = "minorTickSpacing";
-
- /** Fired in a PropertyChangeEvent when the "model" property changes. */
- public static final String MODEL_CHANGED_PROPERTY = "model";
-
- /** Fired in a PropertyChangeEvent when the "orientation" property changes. */
- public static final String ORIENTATION_CHANGED_PROPERTY = "orientation";
-
- /** Fired in a PropertyChangeEvent when the "paintLabels" property changes. */
- public static final String PAINT_LABELS_CHANGED_PROPERTY = "paintLabels";
-
- /** Fired in a PropertyChangeEvent when the "paintTicks" property changes. */
- public static final String PAINT_TICKS_CHANGED_PROPERTY = "paintTicks";
-
/** Whether or not this slider paints its ticks. */
private transient boolean paintTicks = false;
@@ -515,7 +483,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
sliderModel = model;
oldModel.removeChangeListener(changeListener);
sliderModel.addChangeListener(changeListener);
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, sliderModel);
+ firePropertyChange("model", oldModel, sliderModel);
}
}
@@ -624,7 +592,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
int oldOrientation = this.orientation;
this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
+ firePropertyChange("orientation", oldOrientation,
this.orientation);
}
}
@@ -650,7 +618,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
Dictionary oldTable = labelTable;
labelTable = table;
- firePropertyChange(LABEL_TABLE_CHANGED_PROPERTY, oldTable, labelTable);
+ firePropertyChange("labelTable", oldTable, labelTable);
}
}
@@ -751,7 +719,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
boolean oldInverted = isInverted;
isInverted = inverted;
- firePropertyChange(INVERTED_CHANGED_PROPERTY, oldInverted, isInverted);
+ firePropertyChange("inverted", oldInverted, isInverted);
}
}
@@ -777,7 +745,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
int oldSpacing = majorTickSpacing;
majorTickSpacing = spacing;
- firePropertyChange(MAJOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing,
+ firePropertyChange("majorTickSpacing", oldSpacing,
majorTickSpacing);
}
}
@@ -804,7 +772,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
int oldSpacing = minorTickSpacing;
minorTickSpacing = spacing;
- firePropertyChange(MINOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing,
+ firePropertyChange("minorTickSpacing", oldSpacing,
minorTickSpacing);
}
}
@@ -864,8 +832,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
boolean oldPaintTicks = paintTicks;
paintTicks = paint;
- firePropertyChange(PAINT_TICKS_CHANGED_PROPERTY, oldPaintTicks,
- paintTicks);
+ firePropertyChange("paintTicks", oldPaintTicks, paintTicks);
}
}
@@ -910,8 +877,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible,
{
boolean oldPaintLabels = paintLabels;
paintLabels = paint;
- firePropertyChange(PAINT_LABELS_CHANGED_PROPERTY, oldPaintLabels,
- paintLabels);
+ firePropertyChange("paintLabels", oldPaintLabels, paintLabels);
}
}
diff --git a/libjava/javax/swing/JSpinner.java b/libjava/javax/swing/JSpinner.java
index 271c5119f22..fbf2bbf5fcc 100644
--- a/libjava/javax/swing/JSpinner.java
+++ b/libjava/javax/swing/JSpinner.java
@@ -1,5 +1,5 @@
/* JSpinner.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,6 @@ import java.text.ParseException;
import javax.swing.border.EtchedBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
import javax.swing.plaf.SpinnerUI;
@@ -59,7 +58,8 @@ import javax.swing.plaf.SpinnerUI;
* way to manipulate the value.
*
* @author Ka-Hing Cheung
- * @version 1.0
+ *
+ * @since 1.4
*/
public class JSpinner extends JComponent
{
@@ -286,9 +286,6 @@ public class JSpinner extends JComponent
private JComponent editor;
/** DOCUMENT ME! */
- private EventListenerList listenerList = new EventListenerList();
-
- /** DOCUMENT ME! */
private ChangeListener listener = new ChangeListener()
{
public void stateChanged(ChangeEvent evt)
diff --git a/libjava/javax/swing/JTabbedPane.java b/libjava/javax/swing/JTabbedPane.java
index 25733df4a79..748ee214050 100644
--- a/libjava/javax/swing/JTabbedPane.java
+++ b/libjava/javax/swing/JTabbedPane.java
@@ -1,5 +1,5 @@
/* JTabbedPane.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -56,10 +56,8 @@ import javax.swing.plaf.TabbedPaneUI;
import javax.swing.plaf.UIResource;
/**
- * <p>
* This is a container for components. One component is displayed at a time.
* Users can switch between components by clicking on tabs.
- * </p>
*
* <p>
* Tabs can be oriented in several ways. They can be above, below, left and
@@ -520,32 +518,18 @@ public class JTabbedPane extends JComponent implements Serializable,
* or equal to title.length.
*/
public void setDisplayedMnemonicIndex(int index)
- throws IllegalArgumentException
+ throws IllegalArgumentException
{
if (index < -1 || title != null && index >= title.length())
throw new IllegalArgumentException();
- if (title == null || title.charAt(index) != mnemonicKey)
+ if (title == null || mnemonicKey == 0 || title.charAt(index) != mnemonicKey)
index = -1;
underlinedChar = index;
}
}
- /** Fired in a PropertyChangeEvent when the "model" property changes. */
- public static final String MODEL_CHANGED_PROPERTY = "model";
-
- /**
- * Fired in a PropertyChangeEvent when the "tabPlacement" property changes.
- */
- public static final String TAB_PLACEMENT_CHANGED_PROPERTY = "tabPlacement";
-
- /**
- * Fired in a PropertyChangeEvent when the "tabLayoutPolicy" property
- * changes.
- */
- public static final String TAB_LAYOUT_POLICY_CHANGED_PROPERTY = "tabLayoutPolicy";
-
/** The changeEvent used to fire changes to listeners. */
protected ChangeEvent changeEvent;
@@ -739,7 +723,7 @@ public class JTabbedPane extends JComponent implements Serializable,
this.model.removeChangeListener(changeListener);
this.model = model;
this.model.addChangeListener(changeListener);
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, this.model);
+ firePropertyChange("model", oldModel, this.model);
}
}
@@ -770,8 +754,7 @@ public class JTabbedPane extends JComponent implements Serializable,
{
int oldPlacement = this.tabPlacement;
this.tabPlacement = tabPlacement;
- firePropertyChange(TAB_PLACEMENT_CHANGED_PROPERTY, oldPlacement,
- this.tabPlacement);
+ firePropertyChange("tabPlacement", oldPlacement, this.tabPlacement);
}
}
@@ -802,8 +785,7 @@ public class JTabbedPane extends JComponent implements Serializable,
{
int oldPolicy = layoutPolicy;
layoutPolicy = tabLayoutPolicy;
- firePropertyChange(TAB_LAYOUT_POLICY_CHANGED_PROPERTY, oldPolicy,
- layoutPolicy);
+ firePropertyChange("tabLayoutPolicy", oldPolicy, layoutPolicy);
}
}
diff --git a/libjava/javax/swing/JTable.java b/libjava/javax/swing/JTable.java
index ae2c4af5fb5..ca38aa0ba09 100644
--- a/libjava/javax/swing/JTable.java
+++ b/libjava/javax/swing/JTable.java
@@ -1,5 +1,5 @@
/* JTable.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,9 +41,10 @@ package javax.swing;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
+import java.awt.Point;
import java.awt.Rectangle;
-import java.util.Vector;
import java.util.Hashtable;
+import java.util.Vector;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
@@ -113,14 +114,35 @@ public class JTable extends JComponent
/**
* A table mapping {@link java.lang.Class} objects to
* {@link TableCellEditor} objects. This table is consulted by the
- *
+ * FIXME
*/
protected Hashtable defaultEditorsByColumnClass;
+
+ /**
+ * A table mapping {@link java.lang.Class} objects to
+ * {@link TableCellEditor} objects. This table is consulted by the
+ * FIXME
+ */
protected Hashtable defaultRenderersByColumnClass;
+
+ /**
+ * The column that is edited, -1 if the table is not edited currently.
+ */
protected int editingColumn;
+
+ /**
+ * The row that is edited, -1 if the table is not edited currently.
+ */
protected int editingRow;
/**
+ * The component that is used for editing.
+ * <code>null</code> if the table is not editing currently.
+ *
+ */
+ protected transient Component editorComp;
+
+ /**
* Whether or not the table should automatically compute a matching
* {@link TableColumnModel} and assign it to the {@link #columnModel}
* property when the {@link #dataModel} property is changed.
@@ -163,8 +185,8 @@ public class JTable extends JComponent
*
* @see #setRowMargin()
* @see #getRowHeight()
- * @see #getInterCellSpacing()
- * @see #setInterCellSpacing()
+ * @see #getIntercellSpacing()
+ * @see #setIntercellSpacing()
* @see TableColumnModel#getColumnMargin()
* @see TableColumnModel#setColumnMargin()
*/
@@ -257,7 +279,7 @@ public class JTable extends JComponent
* @see #setDragEnabled()
* @see #getDragEnabled()
*/
- protected boolean dragEnabled;
+ private boolean dragEnabled;
/**
* The color to paint the grid lines of the table, when either {@link
@@ -275,7 +297,7 @@ public class JTable extends JComponent
* @see #setPreferredScrollableViewportSize()
* @see #getPreferredScrollableViewportSize()
*/
- protected Dimension preferredScrollableViewportSize;
+ protected Dimension preferredViewportSize;
/**
* The color to paint the background of selected cells. Fires a property
@@ -285,7 +307,7 @@ public class JTable extends JComponent
* @see #setSelectionBackground()
* @see #getSelectionBackground()
*/
- Color selectionBackground;
+ protected Color selectionBackground;
/**
* The name carried in property change events when the {@link
@@ -301,7 +323,7 @@ public class JTable extends JComponent
* @see #setSelectionForeground()
* @see #getSelectionForeground()
*/
- Color selectionForeground;
+ protected Color selectionForeground;
/**
* The name carried in property change events when the
@@ -386,11 +408,17 @@ public class JTable extends JComponent
public JTable (TableModel dm, TableColumnModel cm, ListSelectionModel sm)
{
this.dataModel = dm == null ? createDefaultDataModel() : dm;
- setSelectionModel(sm == null ? createDefaultListSelectionModel() : sm);
+ setSelectionModel(sm == null ? createDefaultSelectionModel() : sm);
this.columnModel = cm;
+ initializeLocalVars();
+ updateUI();
+ }
+
+ protected void initializeLocalVars()
+ {
this.autoCreateColumnsFromModel = false;
- if (cm == null)
+ if (columnModel == null)
{
this.autoCreateColumnsFromModel = true;
createColumnsFromModel();
@@ -398,7 +426,10 @@ public class JTable extends JComponent
this.columnModel.addColumnModelListener(this);
this.defaultRenderersByColumnClass = new Hashtable();
+ createDefaultRenderers();
+
this.defaultEditorsByColumnClass = new Hashtable();
+ createDefaultEditors();
this.autoResizeMode = AUTO_RESIZE_ALL_COLUMNS;
this.rowHeight = 16;
@@ -407,12 +438,13 @@ public class JTable extends JComponent
// this.accessibleContext = new AccessibleJTable();
this.cellEditor = null;
this.dragEnabled = false;
- this.preferredScrollableViewportSize = new Dimension(450,400);
+ this.preferredViewportSize = new Dimension(450,400);
this.showHorizontalLines = true;
this.showVerticalLines = true;
- setInterCellSpacing(new Dimension(1,1));
- setTableHeader(new JTableHeader(columnModel));
- updateUI();
+ this.editingColumn = -1;
+ this.editingRow = -1;
+ setIntercellSpacing(new Dimension(1,1));
+ setTableHeader(createDefaultTableHeader());
}
/**
@@ -426,6 +458,27 @@ public class JTable extends JComponent
this(new DefaultTableModel(data, columnNames));
}
+ public void addColumn(TableColumn column)
+ {
+ if (column.getHeaderValue() == null)
+ {
+ String name = getColumnName(column.getModelIndex());
+ column.setHeaderValue(name);
+ }
+
+ columnModel.addColumn(column);
+ }
+
+ protected void createDefaultEditors()
+ {
+ //FIXME: Create the editor object.
+ }
+
+ protected void createDefaultRenderers()
+ {
+ //FIXME: Create the renderer object.
+ }
+
/**
* @deprecated 1.0.2, replaced by <code>new JScrollPane(JTable)</code>
*/
@@ -433,7 +486,7 @@ public class JTable extends JComponent
{
return new JScrollPane(table);
}
-
+
protected TableColumnModel createDefaultColumnModel()
{
return new DefaultTableColumnModel();
@@ -444,11 +497,16 @@ public class JTable extends JComponent
return new DefaultTableModel();
}
- protected ListSelectionModel createDefaultListSelectionModel()
+ protected ListSelectionModel createDefaultSelectionModel()
{
return new DefaultListSelectionModel();
}
+ protected JTableHeader createDefaultTableHeader()
+ {
+ return new JTableHeader(columnModel);
+ }
+
private void createColumnsFromModel()
{
if (dataModel == null)
@@ -514,6 +572,58 @@ public class JTable extends JComponent
repaint();
}
+ /**
+ * Returns index of the column that contains specified point
+ * or -1 if this table doesn't contain this point.
+ *
+ * @param point point to identify the column
+ * @return index of the column that contains specified point or
+ * -1 if this table doesn't contain this point.
+ */
+ public int columnAtPoint(Point point)
+ {
+ int x0 = getLocation().x;
+ int ncols = getColumnCount();
+ Dimension gap = getIntercellSpacing();
+ TableColumnModel cols = getColumnModel();
+ int x = point.x;
+
+ for (int i = 0; i < ncols; ++i)
+ {
+ int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width);
+ if (0 <= x && x < width)
+ return i;
+ x -= width;
+ }
+
+ return -1;
+ }
+
+ /**
+ * Returns index of the row that contains specified point or
+ * -1 if this table doesn't contain this point.
+ *
+ * @param point point to identify the row
+ * @return index of the row that contains specified point or
+ * -1 if this table doesn't contain this point.
+ */
+ public int rowAtPoint(Point point)
+ {
+ int y0 = getLocation().y;
+ int nrows = getRowCount();
+ Dimension gap = getIntercellSpacing();
+ int height = getRowHeight() + (gap == null ? 0 : gap.height);
+ int y = point.y;
+
+ for (int i = 0; i < nrows; ++i)
+ {
+ if (0 <= y && y < height)
+ return i;
+ y -= height;
+ }
+
+ return -1;
+ }
/**
* Calculate the visible rectangle for a particular row and column. The
@@ -656,6 +766,7 @@ public class JTable extends JComponent
return (TableCellEditor) defaultEditorsByColumnClass.get(columnClass);
else
{
+ // FIXME: We have at least an editor for Object.class in our defaults.
TableCellEditor r = new DefaultCellEditor(new JTextField());
defaultEditorsByColumnClass.put(columnClass, r);
return r;
@@ -729,7 +840,7 @@ public class JTable extends JComponent
return renderer.getTableCellRendererComponent(this,
dataModel.getValueAt(row,
- convertColumnIndexToView(column)),
+ convertColumnIndexToModel(column)),
isSelected,
false, // hasFocus
row, column);
@@ -808,13 +919,13 @@ public class JTable extends JComponent
/**
* Get the value of the {@link #columnCount} property by
- * delegation to the @{link #dataModel} field.
+ * delegation to the @{link #columnModel} field.
*
* @return The current value of the columnCount property
*/
public int getColumnCount()
{
- return dataModel.getColumnCount();
+ return columnModel.getColumnCount();
}
/**
@@ -863,11 +974,11 @@ public class JTable extends JComponent
break;
case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
- sum = hi - lo;
+ sum = hi - lo + 1;
break;
case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
- for (int i = lo; i < hi; ++i)
+ for (int i = lo; i <= hi; ++i)
if (lsm.isSelectedIndex(i))
++sum;
break;
@@ -894,12 +1005,12 @@ public class JTable extends JComponent
break;
case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
- for (int i = lo; i < hi; ++i)
+ for (int i = lo; i <= hi; ++i)
ret[j++] = i;
break;
case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
- for (int i = lo; i < hi; ++i)
+ for (int i = lo; i <= hi; ++i)
if (lsm.isSelectedIndex(i))
ret[j++] = i;
break;
@@ -1003,23 +1114,23 @@ public class JTable extends JComponent
}
/**
- * Get the value of the {@link #interCellSpacing} property.
+ * Get the value of the {@link #intercellSpacing} property.
*
* @return The current value of the property
*/
- public Dimension getInterCellSpacing()
+ public Dimension getIntercellSpacing()
{
return new Dimension(columnModel.getColumnMargin(), rowMargin);
}
/**
- * Get the value of the {@link #preferredScrollableViewportSize} property.
+ * Get the value of the {@link #preferredViewportSize} property.
*
* @return The current value of the property
*/
public Dimension getPreferredScrollableViewportSize()
{
- return preferredScrollableViewportSize;
+ return preferredViewportSize;
}
/**
@@ -1073,6 +1184,27 @@ public class JTable extends JComponent
}
/**
+ * Removes specified column from displayable columns of this table.
+ *
+ * @param column column to removed
+ */
+ public void removeColumn(TableColumn column)
+ {
+ columnModel.removeColumn(column);
+ }
+
+ /**
+ * Moves column at the specified index to new given location.
+ *
+ * @param column index of the column to move
+ * @param targetColumn index specifying new location of the column
+ */
+ public void moveColumn(int column,int targetColumn)
+ {
+ columnModel.moveColumn(column, targetColumn);
+ }
+
+ /**
* Set the value of the {@link #autoCreateColumnsFromModel} property.
*
* @param a The new value of the autoCreateColumnsFromModel property
@@ -1101,6 +1233,9 @@ public class JTable extends JComponent
*/
public void setRowHeight(int r)
{
+ if (rowHeight < 1)
+ throw new IllegalArgumentException();
+
rowHeight = r;
revalidate();
repaint();
@@ -1246,13 +1381,16 @@ public class JTable extends JComponent
/**
* Set the value of the {@link #selectionMode} property by
- * delegation to the {@link #selectionModel} field.
+ * delegation to the {@link #selectionModel} field. The same selection
+ * mode is set for row and column selection models.
*
* @param s The new value of the property
*/
public void setSelectionMode(int s)
- {
- selectionModel.setSelectionMode(s);
+ {
+ selectionModel.setSelectionMode(s);
+ columnModel.getSelectionModel().setSelectionMode(s);
+
repaint();
}
@@ -1297,11 +1435,11 @@ public class JTable extends JComponent
}
/**
- * Set the value of the {@link #interCellSpacing} property.
+ * Set the value of the {@link #intercellSpacing} property.
*
- * @param i The new value of the interCellSpacing property
+ * @param i The new value of the intercellSpacing property
*/
- public void setInterCellSpacing(Dimension i)
+ public void setIntercellSpacing(Dimension i)
{
rowMargin = i.height;
columnModel.setColumnMargin(i.width);
@@ -1309,13 +1447,13 @@ public class JTable extends JComponent
}
/**
- * Set the value of the {@link #preferredScrollableViewportSize} property.
+ * Set the value of the {@link #preferredViewportSize} property.
*
- * @param p The new value of the preferredScrollableViewportSize property
+ * @param p The new value of the preferredViewportSize property
*/
public void setPreferredScrollableViewportSize(Dimension p)
{
- preferredScrollableViewportSize = p;
+ preferredViewportSize = p;
revalidate();
repaint();
}
@@ -1551,11 +1689,17 @@ public class JTable extends JComponent
}
}
+ /**
+ * @deprecated Replaced by <code>doLayout()</code>
+ */
public void sizeColumnsToFit(boolean lastColumnOnly)
{
doLayout();
}
+ /**
+ * Obsolete since JDK 1.4. Please use <code>doLayout()</code>.
+ */
public void sizeColumnsToFit(int resizingColumn)
{
doLayout();
@@ -1593,4 +1737,141 @@ public class JTable extends JComponent
repaint();
}
+ public Class getColumnClass(int column)
+ {
+ return dataModel.getColumnClass(column);
+ }
+
+ public String getColumnName(int column)
+ {
+ return dataModel.getColumnName(column);
+ }
+
+ public int getEditingColumn()
+ {
+ return editingColumn;
+ }
+
+ public void setEditingColumn(int column)
+ {
+ editingColumn = column;
+ }
+
+ public int getEditingRow()
+ {
+ return editingRow;
+ }
+
+ public void setEditingRow(int column)
+ {
+ editingRow = column;
+ }
+
+ public Component getEditorComponent()
+ {
+ return editorComp;
+ }
+
+ public boolean isEditing()
+ {
+ return editorComp != null;
+ }
+
+ public void setDefaultEditor(Class columnClass, TableCellEditor editor)
+ {
+ if (editor != null)
+ defaultEditorsByColumnClass.put(columnClass, editor);
+ else
+ defaultEditorsByColumnClass.remove(columnClass);
+ }
+
+ public void addColumnSelectionInterval(int index0, int index1)
+ {
+ if ((index0 < 0 || index0 > (getColumnCount()-1)
+ || index1 < 0 || index1 > (getColumnCount()-1)))
+ throw new IllegalArgumentException("Column index out of range.");
+
+ getColumnModel().getSelectionModel().addSelectionInterval(index0, index1);
+ }
+
+ public void addRowSelectionInterval(int index0, int index1)
+ {
+ if ((index0 < 0 || index0 > (getRowCount()-1)
+ || index1 < 0 || index1 > (getRowCount()-1)))
+ throw new IllegalArgumentException("Row index out of range.");
+
+ getSelectionModel().addSelectionInterval(index0, index1);
+ }
+
+ public void setColumnSelectionInterval(int index0, int index1)
+ {
+ if ((index0 < 0 || index0 > (getColumnCount()-1)
+ || index1 < 0 || index1 > (getColumnCount()-1)))
+ throw new IllegalArgumentException("Column index out of range.");
+
+ getColumnModel().getSelectionModel().setSelectionInterval(index0, index1);
+ }
+
+ public void setRowSelectionInterval(int index0, int index1)
+ {
+ if ((index0 < 0 || index0 > (getRowCount()-1)
+ || index1 < 0 || index1 > (getRowCount()-1)))
+ throw new IllegalArgumentException("Row index out of range.");
+
+ getSelectionModel().setSelectionInterval(index0, index1);
+ }
+
+ public void removeColumnSelectionInterval(int index0, int index1)
+ {
+ if ((index0 < 0 || index0 > (getColumnCount()-1)
+ || index1 < 0 || index1 > (getColumnCount()-1)))
+ throw new IllegalArgumentException("Column index out of range.");
+
+ getColumnModel().getSelectionModel().removeSelectionInterval(index0, index1);
+ }
+
+ public void removeRowSelectionInterval(int index0, int index1)
+ {
+ if ((index0 < 0 || index0 > (getRowCount()-1)
+ || index1 < 0 || index1 > (getRowCount()-1)))
+ throw new IllegalArgumentException("Row index out of range.");
+
+ getSelectionModel().removeSelectionInterval(index0, index1);
+ }
+
+ public boolean isColumnSelected(int column)
+ {
+ return getColumnModel().getSelectionModel().isSelectedIndex(column);
+ }
+
+ public boolean isRowSelected(int row)
+ {
+ return getSelectionModel().isSelectedIndex(row);
+ }
+
+ public boolean isCellSelected(int row, int column)
+ {
+ return isRowSelected(row) && isColumnSelected(column);
+ }
+
+ public void selectAll()
+ {
+ setColumnSelectionInterval(0, getColumnCount() - 1);
+ setRowSelectionInterval(0, getRowCount() - 1);
+ }
+
+ public Object getValueAt(int row, int column)
+ {
+ return dataModel.getValueAt(row, convertColumnIndexToModel(column));
+ }
+
+ public void setValueAt(Object value, int row, int column)
+ {
+ dataModel.setValueAt(value, row, convertColumnIndexToModel(column));
+ }
+
+ public TableColumn getColumn(Object identifier)
+ {
+ return columnModel.getColumn(columnModel.getColumnIndex(identifier));
+ }
}
diff --git a/libjava/javax/swing/JTextArea.java b/libjava/javax/swing/JTextArea.java
index 2561775286b..3510e6dead6 100644
--- a/libjava/javax/swing/JTextArea.java
+++ b/libjava/javax/swing/JTextArea.java
@@ -1,5 +1,5 @@
/* JTextArea.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -74,8 +74,8 @@ import javax.swing.text.PlainDocument;
* are used in calculating the preferred size of the scroll pane's
* view port.
*
- * @author Michael Koch <konqueror@gmx.de>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see java.awt.TextArea
* @see javax.swing.JTextComponent
* @see javax.swing.JTextField
diff --git a/libjava/javax/swing/JTextField.java b/libjava/javax/swing/JTextField.java
index 5fe104b5093..409e2a5970f 100644
--- a/libjava/javax/swing/JTextField.java
+++ b/libjava/javax/swing/JTextField.java
@@ -1,5 +1,5 @@
/* JTextField.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
import java.awt.Dimension;
@@ -49,7 +50,7 @@ import javax.accessibility.AccessibleStateSet;
import javax.swing.text.Document;
import javax.swing.text.JTextComponent;
import javax.swing.text.PlainDocument;
-
+import javax.swing.text.TextAction;
public class JTextField extends JTextComponent
implements SwingConstants
@@ -80,12 +81,29 @@ public class JTextField extends JTextComponent
private static final long serialVersionUID = 353853209832607592L;
+ private static final Action[] actions;
+
+ /**
+ * Name of the action that gets sent when the content of the text field
+ * gets accepted.
+ */
public static final String notifyAction = "notify-field-accept";
+ static
+ {
+ actions = new Action[1];
+ actions[0] = new TextAction(notifyAction)
+ {
+ public void actionPerformed(ActionEvent event)
+ {
+ JTextField textField = (JTextField) event.getSource();
+ textField.fireActionPerformed();
+ }
+ };
+ }
+
private int columns;
-
private int align;
-
private int scrollOffset;
/** @since 1.3 */
@@ -272,19 +290,10 @@ public class JTextField extends JTextComponent
public Dimension getPreferredSize()
{
- Dimension size;
- FontMetrics fm = getFontMetrics(getFont());
- int fontHeight = fm.getMaxAscent() + fm.getMaxDescent();
- int columnWidth = fm.charWidth('m');
-
+ Dimension size = super.getPreferredSize();
+
if (columns != 0)
- {
- size = new Dimension(columns * columnWidth + 4, fontHeight + 4);
- }
- else
- {
- size = new Dimension(10, 10);
- }
+ size.width = columns * getColumnWidth();
return size;
}
@@ -309,9 +318,15 @@ public class JTextField extends JTextComponent
scrollOffset = offset;
}
+ public Action[] getActions()
+ {
+ return TextAction.augmentList(super.getActions(), actions);
+ }
+
public void postActionEvent()
{
- ActionEvent event = new ActionEvent(this, 0, actionCommand);
+ String command = actionCommand != null ? actionCommand : getText();
+ ActionEvent event = new ActionEvent(this, 0, command);
ActionListener[] listeners = getActionListeners();
for (int index = 0; index < listeners.length; ++index)
@@ -358,17 +373,9 @@ public class JTextField extends JTextComponent
/**
* @since 1.3
*/
- public String getActionCommand()
- {
- return actionCommand;
- }
-
- /**
- * @since 1.3
- */
public void setActionCommand(String command)
{
- this.actionCommand = command;
+ actionCommand = command;
}
/**
diff --git a/libjava/javax/swing/JToggleButton.java b/libjava/javax/swing/JToggleButton.java
index 8a38d48d3aa..41eab07b53c 100644
--- a/libjava/javax/swing/JToggleButton.java
+++ b/libjava/javax/swing/JToggleButton.java
@@ -1,5 +1,5 @@
/* JToggleButton.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,16 +53,15 @@ import javax.swing.plaf.ButtonUI;
* for the implementations of radio buttons (<code>JRadioButton</code>)
* and check boxes (<code>JCheckBox</code>).
*
- * @author Michael Koch <konqueror@gmx.de>
- * @author Graydon Hoare <graydon@redhat.com>
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Michael Koch (konqueror@gmx.de)
+ * @author Graydon Hoare (graydon@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see JRadioButton
* @see JCheckBox
* @since 1.2
*/
public class JToggleButton extends AbstractButton implements Accessible
{
-
/**
* This class provides accessibility support for the toggle button.
*/
diff --git a/libjava/javax/swing/JToolBar.java b/libjava/javax/swing/JToolBar.java
index db8bb569e9f..55f4c155f80 100644
--- a/libjava/javax/swing/JToolBar.java
+++ b/libjava/javax/swing/JToolBar.java
@@ -1,5 +1,5 @@
/* JToolBar.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -100,7 +100,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
}
}
- /**
+ /**
* This is the private JToolBar layout manager.
*/
private class DefaultToolBarLayout implements LayoutManager
@@ -110,7 +110,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
*
* @param name The name of the component added.
* @param comp The component that was added.
- */
+ */
public void addLayoutComponent(String name, Component comp)
{
// Do nothing.
@@ -142,7 +142,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
Dimension tdims = c.getSize();
int start = 0;
Dimension pref;
-
+
if (getOrientation() == SwingUtilities.HORIZONTAL)
{
start += insets.left;
@@ -194,14 +194,14 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
return preferredLayoutSize(parent);
}
- /**
+ /**
* This method returns the preferred size of the given container given the
* child components.
*
* @param parent The container to measure.
*
* @return The preferred size of the given container.
- */
+ */
public Dimension preferredLayoutSize(Container parent)
{
int orientation = getOrientation();
@@ -259,23 +259,23 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
return new Dimension(w, h);
}
- /**
+ /**
* This method is called when the given component is removed from the
* container.
*
* @param comp The component removed.
- */
+ */
public void removeLayoutComponent(Component comp)
{
// Do nothing.
}
}
- /**
+ /**
* This is an extension of JSeparator used in toolbars. Unlike JSeparator,
* nothing is painted for this Separator, it is only blank space that
* separates components.
- */
+ */
public static class Separator extends JSeparator
{
/** DOCUMENT ME! */
@@ -299,70 +299,70 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
setPreferredSize(size);
} // Separator()
- /**
+ /**
* This method returns the String ID of the UI class of Separator.
*
* @return The UI class' String ID.
- */
+ */
public String getUIClassID()
{
return "ToolBarSeparatorUI";
- } // getUIClassID()
+ } // getUIClassID()
- /**
+ /**
* This method returns the preferred size of the Separator.
*
* @return The preferred size of the Separator.
- */
+ */
public Dimension getPreferredSize()
{
return super.getPreferredSize();
- } // getPreferredSize()
+ } // getPreferredSize()
- /**
+ /**
* This method returns the maximum size of the Separator.
*
* @return The maximum size of the Separator.
- */
+ */
public Dimension getMaximumSize()
{
return super.getPreferredSize();
- } // getMaximumSize()
+ } // getMaximumSize()
- /**
+ /**
* This method returns the minimum size of the Separator.
*
* @return The minimum size of the Separator.
- */
+ */
public Dimension getMinimumSize()
{
return super.getPreferredSize();
- } // getMinimumSize()
+ } // getMinimumSize()
- /**
+ /**
* This method returns the size of the Separator.
*
* @return The size of the Separator.
- */
+ */
public Dimension getSeparatorSize()
{
return super.getPreferredSize();
- } // getSeparatorSize()
+ } // getSeparatorSize()
- /**
+ /**
* This method sets the size of the Separator.
*
* @param size The new size of the Separator.
- */
+ */
public void setSeparatorSize(Dimension size)
{
setPreferredSize(size);
- } // setSeparatorSize()
- } // Separator
+ } // setSeparatorSize()
+ } // Separator
/** DOCUMENT ME! */
- private static final long serialVersionUID = -1269915519555129643L;
-
+ private static final long serialVersionUID = -1269915519555129643L;
+
/** Whether the JToolBar paints its border. */
private transient boolean paintBorder = true;
@@ -376,150 +376,135 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
private transient boolean rollover;
/** The orientation of the JToolBar. */
- private int orientation = HORIZONTAL;
+ private int orientation = HORIZONTAL;
- /** Fired in a PropertyChangeEvent when the orientation property changes. */
- public static final String ORIENTATION_CHANGED_PROPERTY = "orientation";
-
- /** Fired in a PropertyChangeEvent when the floatable property changes. */
- public static final String FLOATABLE_CHANGED_PROPERTY = "floatable";
-
- /** Fired in a PropertyChangeEvent when the borderPainted property changes. */
- public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted";
-
- /** Fired in a PropertyChangeEvent when the margin property changes. */
- public static final String MARGIN_CHANGED_PROPERTY = "margin";
-
- /** Fired in a PropertyChangeEvent when the rollover property changes. */
- public static final String ROLLOVER_CHANGED_PROPERTY = "rollover";
-
- /**
+ /**
* This method creates a new JToolBar object with horizontal orientation
* and no name.
- */
+ */
public JToolBar()
{
this(null, HORIZONTAL);
- } // JToolBar()
+ } // JToolBar()
- /**
+ /**
* This method creates a new JToolBar with the given orientation and no
* name.
*
- * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL)
- */
+ * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL)
+ */
public JToolBar(int orientation)
{
- this(null, orientation);
- } // JToolBar()
+ this(null, orientation);
+ } // JToolBar()
- /**
+ /**
* This method creates a new JToolBar object with the given name and
* horizontal orientation.
*
- * @param name Name assigned to undocked tool bar.
- */
+ * @param name Name assigned to undocked tool bar.
+ */
public JToolBar(String name)
{
- this(name, HORIZONTAL);
- } // JToolBar()
+ this(name, HORIZONTAL);
+ } // JToolBar()
- /**
+ /**
* This method creates a new JToolBar object with the given name and
* orientation.
*
- * @param name Name assigned to undocked tool bar.
- * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL)
- */
+ * @param name Name assigned to undocked tool bar.
+ * @param orientation JToolBar orientation (HORIZONTAL or VERTICAL)
+ */
public JToolBar(String name, int orientation)
{
- setName(name);
+ setName(name);
setOrientation(orientation);
setLayout(new DefaultToolBarLayout());
revalidate();
- updateUI();
- } // JToolBar()
+ updateUI();
+ } // JToolBar()
- /**
+ /**
* This method adds a new JButton that performs the given Action to the
* JToolBar.
*
* @param action The Action to add to the JToolBar.
*
* @return The JButton that wraps the Action.
- */
+ */
public JButton add(Action action)
{
JButton b = createActionComponent(action);
add(b);
return b;
- } // add()
+ } // add()
- /**
+ /**
* This method paints the border if the borderPainted property is true.
*
* @param graphics The graphics object to paint with.
- */
+ */
protected void paintBorder(Graphics graphics)
{
if (paintBorder && isFloatable())
super.paintBorder(graphics);
- } // paintBorder()
+ } // paintBorder()
- /**
+ /**
* This method returns the UI class used to paint this JToolBar.
*
* @return The UI class for this JToolBar.
- */
+ */
public ToolBarUI getUI()
{
- return (ToolBarUI) ui;
- } // getUI()
+ return (ToolBarUI) ui;
+ } // getUI()
- /**
+ /**
* This method sets the UI used with the JToolBar.
*
* @param ui The UI used with the JToolBar.
- */
+ */
public void setUI(ToolBarUI ui)
{
- super.setUI(ui);
- } // setUI()
+ super.setUI(ui);
+ } // setUI()
- /**
+ /**
* This method resets the UI used to the Look and Feel defaults.
- */
+ */
public void updateUI()
{
- setUI((ToolBarUI)UIManager.getUI(this));
+ setUI((ToolBarUI) UIManager.getUI(this));
revalidate();
repaint();
- } // updateUI()
+ } // updateUI()
- /**
+ /**
* This method returns the String identifier for the UI class to the used
* with the JToolBar.
*
* @return The String identifier for the UI class.
- */
+ */
public String getUIClassID()
{
return "ToolBarUI";
- } // getUIClassID()
+ } // getUIClassID()
- /**
+ /**
* This method sets the rollover property for the JToolBar. In rollover
* mode, JButtons inside the JToolBar will only display their borders when
* the mouse is moving over them.
*
* @param b The new rollover property.
- */
+ */
public void setRollover(boolean b)
{
if (b != rollover)
{
rollover = b;
- firePropertyChange(ROLLOVER_CHANGED_PROPERTY, ! rollover, rollover);
+ firePropertyChange("rollover", ! rollover, rollover);
revalidate();
repaint();
}
@@ -553,37 +538,37 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
return i;
return -1;
- } // getComponentIndex()
+ } // getComponentIndex()
- /**
+ /**
* This method returns the component at the given index.
*
* @param index The index of the component.
*
* @return The component at the given index.
- */
+ */
public Component getComponentAtIndex(int index)
{
return getComponent(index);
- } // getComponentAtIndex()
+ } // getComponentAtIndex()
- /**
+ /**
* This method returns the margin property.
*
* @return The margin property.
- */
+ */
public Insets getMargin()
{
return margin;
- } // getMargin()
+ } // getMargin()
- /**
+ /**
* This method sets the margin property. The margin property determines the
* extra space between the children components of the JToolBar and the
* border.
*
* @param margin The margin property.
- */
+ */
public void setMargin(Insets margin)
{
if ((this.margin != null && margin == null)
@@ -595,142 +580,141 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
{
Insets oldMargin = this.margin;
this.margin = margin;
- firePropertyChange(MARGIN_CHANGED_PROPERTY, oldMargin, this.margin);
+ firePropertyChange("margin", oldMargin, this.margin);
revalidate();
repaint();
}
- } // setMargin()
+ } // setMargin()
- /**
+ /**
* This method returns the borderPainted property.
*
* @return The borderPainted property.
- */
+ */
public boolean isBorderPainted()
{
return paintBorder;
- } // isBorderPainted()
+ } // isBorderPainted()
- /**
+ /**
* This method sets the borderPainted property. If set to false, the border
* will not be painted.
*
* @param painted Whether the border will be painted.
- */
+ */
public void setBorderPainted(boolean painted)
{
if (painted != paintBorder)
{
paintBorder = painted;
- firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, ! paintBorder,
+ firePropertyChange("borderPainted", ! paintBorder,
paintBorder);
repaint();
}
- } // setBorderPainted()
+ } // setBorderPainted()
- /**
+ /**
* This method returns the floatable property.
*
* @return The floatable property.
- */
+ */
public boolean isFloatable()
{
return floatable;
- } // isFloatable()
+ } // isFloatable()
- /**
+ /**
* This method sets the floatable property. If set to false, the JToolBar
* cannot be dragged.
*
* @param floatable Whether the JToolBar can be dragged.
- */
+ */
public void setFloatable(boolean floatable)
{
if (floatable != this.floatable)
{
this.floatable = floatable;
- firePropertyChange(FLOATABLE_CHANGED_PROPERTY, ! floatable, floatable);
+ firePropertyChange("floatable", ! floatable, floatable);
}
- } // setFloatable()
+ } // setFloatable()
- /**
+ /**
* This method returns the orientation of the JToolBar.
*
* @return The orientation of the JToolBar.
- */
+ */
public int getOrientation()
{
return orientation;
- } // getOrientation()
+ } // getOrientation()
- /**
+ /**
* This method sets the layout manager to be used with the JToolBar.
*
* @param mgr The Layout Manager used with the JToolBar.
- */
+ */
public void setLayout(LayoutManager mgr)
{
- super.setLayout(mgr);
+ super.setLayout(mgr);
revalidate();
repaint();
- } // setLayout()
+ } // setLayout()
- /**
+ /**
* This method sets the orientation property for JToolBar.
*
* @param orientation The new orientation for JToolBar.
*
* @throws IllegalArgumentException If the orientation is not HORIZONTAL or
* VERTICAL.
- */
+ */
public void setOrientation(int orientation)
{
- if (orientation != HORIZONTAL && orientation != VERTICAL)
+ if (orientation != HORIZONTAL && orientation != VERTICAL)
throw new IllegalArgumentException(orientation
+ " is not a legal orientation");
- if (orientation != this.orientation)
- {
- int oldOrientation = this.orientation;
- this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
- this.orientation);
+ if (orientation != this.orientation)
+ {
+ int oldOrientation = this.orientation;
+ this.orientation = orientation;
+ firePropertyChange("orientation", oldOrientation, this.orientation);
revalidate();
repaint();
- }
- } // setOrientation()
+ }
+ } // setOrientation()
- /**
+ /**
* This method adds a Separator of default size to the JToolBar.
- */
+ */
public void addSeparator()
{
add(new Separator());
- } // addSeparator()
+ } // addSeparator()
- /**
+ /**
* This method adds a Separator with the given size to the JToolBar.
*
* @param size The size of the Separator.
- */
+ */
public void addSeparator(Dimension size)
{
add(new Separator(size));
- } // addSeparator()
+ } // addSeparator()
- /**
+ /**
* This method is used to create JButtons which can be added to the JToolBar
* for the given action.
*
* @param action The action to create a JButton for.
*
* @return The JButton created from the action.
- */
+ */
protected JButton createActionComponent(Action action)
{
return new JButton(action);
- } // createActionComponent()
+ } // createActionComponent()
- /**
+ /**
* This method creates a pre-configured PropertyChangeListener which updates
* the control as changes are made to the Action. However, this is no
* longer the recommended way of adding Actions to Containers. As such,
@@ -739,36 +723,36 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
* @param button The JButton to configure a PropertyChangeListener for.
*
* @return null.
- */
+ */
protected PropertyChangeListener createActionChangeListener(JButton button)
{
// XXX: As specified, this returns null. But seems kind of strange, usually deprecated methods don't just return null, verify!
return null;
- } // createActionChangeListener()
+ } // createActionChangeListener()
- /**
+ /**
* This method overrides Container's addImpl method. If a JButton is added,
* it is disabled.
*
* @param component The Component to add.
* @param constraints The Constraints placed on the component.
* @param index The index to place the Component at.
- */
+ */
protected void addImpl(Component component, Object constraints, int index)
{
// XXX: Sun says disable button but test cases show otherwise.
super.addImpl(component, constraints, index);
} // addImpl()
- /**
+ /**
* This method returns a String description of the JToolBar.
*
* @return A String description of the JToolBar.
- */
+ */
protected String paramString()
{
return "JToolBar";
- } // paramString()
+ } // paramString()
/**
* getAccessibleContext
@@ -779,7 +763,7 @@ public class JToolBar extends JComponent implements SwingConstants, Accessible
{
if (accessibleContext == null)
accessibleContext = new AccessibleJToolBar();
-
+
return accessibleContext;
}
}
diff --git a/libjava/javax/swing/JTree.java b/libjava/javax/swing/JTree.java
index 8d52257c536..170fd3014b2 100644
--- a/libjava/javax/swing/JTree.java
+++ b/libjava/javax/swing/JTree.java
@@ -1,5 +1,5 @@
/* JTree.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,10 +53,10 @@ import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.event.TreeWillExpandListener;
import javax.swing.plaf.TreeUI;
-import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.TreeCellEditor;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
@@ -70,14 +70,11 @@ public class JTree extends JComponent
{
private static final long serialVersionUID = 7559816092864483649L;
- public static final String ANCHOR_SELECTION_PATH_PROPERTY = "anchorSelectionPath";
public static final String CELL_EDITOR_PROPERTY = "cellEditor";
public static final String CELL_RENDERER_PROPERTY = "cellRenderer";
public static final String EDITABLE_PROPERTY = "editable";
- public static final String EXPANDS_SELECTED_PATHS_PROPERTY = "expandsSelectedPaths";
public static final String INVOKES_STOP_CELL_EDITING_PROPERTY = "invokesStopCellEditing";
public static final String LARGE_MODEL_PROPERTY = "largeModel";
- public static final String LEAD_SELECTION_PATH_PROPERTY = "leadSelectionPath";
public static final String ROOT_VISIBLE_PROPERTY = "rootVisible";
public static final String ROW_HEIGHT_PROPERTY = "rowHeight";
public static final String SCROLLS_ON_EXPAND_PROPERTY = "scrollsOnExpand";
@@ -87,18 +84,40 @@ public class JTree extends JComponent
public static final String TREE_MODEL_PROPERTY = "model";
public static final String VISIBLE_ROW_COUNT_PROPERTY = "visibleRowCount";
- protected TreeCellEditor cellEditor;
- protected TreeCellRenderer cellRenderer;
+ /** @since 1.3 */
+ public static final String ANCHOR_SELECTION_PATH_PROPERTY = "anchorSelectionPath";
+ /** @since 1.3 */
+ public static final String LEAD_SELECTION_PATH_PROPERTY = "leadSelectionPath";
+ /** @since 1.3 */
+ public static final String EXPANDS_SELECTED_PATHS_PROPERTY = "expandsSelectedPaths";
+
+ private static final Object EXPANDED = new Object();
+ private static final Object COLLAPSED = new Object();
+
+ private boolean dragEnabled;
+ private boolean expandsSelectedPaths;
+ private TreePath anchorSelectionPath;
+ private TreePath leadSelectionPath;
+
+ /*
+ * This contains the state of all nodes in the tree. Al/ entries map the
+ * TreePath of a note to to its state. Valid states are EXPANDED and
+ * COLLAPSED. Nodes not in this Hashtable are assumed state COLLAPSED.
+ */
+ private Hashtable nodeStates;
+
+ protected transient TreeCellEditor cellEditor;
+ protected transient TreeCellRenderer cellRenderer;
protected boolean editable;
protected boolean invokesStopCellEditing;
protected boolean largeModel;
protected boolean rootVisible;
protected int rowHeight;
protected boolean scrollsOnExpand;
- protected TreeSelectionModel selectionModel;
+ protected transient TreeSelectionModel selectionModel;
protected boolean showsRootHandles;
protected int toggleClickCount;
- protected TreeModel treeModel;
+ protected transient TreeModel treeModel;
protected int visibleRowCount;
/**
@@ -178,6 +197,13 @@ public class JTree extends JComponent
{
protected Object childValue;
protected boolean loadedChildren;
+
+ /**
+ * Currently not set or used by this class.
+ * It might be set and used in later versions of this class.
+ */
+ protected boolean hasChildren;
+
public DynamicUtilTreeNode(Object value,
Object children)
{
@@ -247,6 +273,39 @@ public class JTree extends JComponent
}
}
+ public int getRowForPath(TreePath path)
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ return ui.getRowForPath(this, path);
+
+ return -1;
+ }
+
+ public TreePath getPathForRow(int row)
+ {
+ TreeUI ui = getUI();
+ return ui != null ? ui.getPathForRow(this, row) : null;
+ }
+
+ protected TreePath[] getPathBetweenRows(int index0, int index1)
+ {
+ TreeUI ui = getUI();
+
+ if (ui == null)
+ return null;
+
+ int minIndex = Math.min(index0, index1);
+ int maxIndex = Math.max(index0, index1);
+ TreePath[] paths = new TreePath[maxIndex - minIndex + 1];
+
+ for (int i = minIndex; i <= maxIndex; ++i)
+ paths[i - minIndex] = ui.getPathForRow(this, i);
+
+ return paths;
+ }
+
/**
* Creates a new <code>TreeModel</code> object.
*
@@ -511,13 +570,18 @@ public class JTree extends JComponent
}
/**
- * Sets the model to use in <code>JTree</object>.
+ * Sets the model to use in <code>JTree</code>.
*
* @param model the <code>TreeModel</code> to use
*/
public void setModel(TreeModel model)
{
+ if (treeModel == model)
+ return;
+
+ TreeModel oldValue = treeModel;
treeModel = model;
+ firePropertyChange(TREE_MODEL_PROPERTY, oldValue, model);
}
/**
@@ -544,7 +608,7 @@ public class JTree extends JComponent
boolean oldValue = editable;
editable = flag;
- firePropertyChange("editable", oldValue, editable);
+ firePropertyChange(EDITABLE_PROPERTY, oldValue, editable);
}
/**
@@ -560,7 +624,12 @@ public class JTree extends JComponent
public void setRootVisible(boolean flag)
{
+ if (rootVisible == flag)
+ return;
+
+ boolean oldValue = rootVisible;
rootVisible = flag;
+ firePropertyChange(ROOT_VISIBLE_PROPERTY, oldValue, flag);
}
public boolean getShowsRootHandles()
@@ -570,7 +639,12 @@ public class JTree extends JComponent
public void setShowsRootHandles(boolean flag)
{
+ if (showsRootHandles == flag)
+ return;
+
+ boolean oldValue = showsRootHandles;
showsRootHandles = flag;
+ firePropertyChange(SHOWS_ROOT_HANDLES_PROPERTY, oldValue, flag);
}
public TreeCellEditor getCellEditor()
@@ -580,7 +654,12 @@ public class JTree extends JComponent
public void setCellEditor(TreeCellEditor editor)
{
+ if (cellEditor == editor)
+ return;
+
+ TreeCellEditor oldValue = cellEditor;
cellEditor = editor;
+ firePropertyChange(CELL_EDITOR_PROPERTY, oldValue, editor);
}
public TreeCellRenderer getCellRenderer()
@@ -590,7 +669,12 @@ public class JTree extends JComponent
public void setCellRenderer(TreeCellRenderer newRenderer)
{
+ if (cellRenderer == newRenderer)
+ return;
+
+ TreeCellRenderer oldValue = cellRenderer;
cellRenderer = newRenderer;
+ firePropertyChange(CELL_RENDERER_PROPERTY, oldValue, newRenderer);
}
public TreeSelectionModel getSelectionModel()
@@ -600,7 +684,12 @@ public class JTree extends JComponent
public void setSelectionModel(TreeSelectionModel model)
{
+ if (selectionModel == model)
+ return;
+
+ TreeSelectionModel oldValue = selectionModel;
selectionModel = model;
+ firePropertyChange(SELECTION_MODEL_PROPERTY, oldValue, model);
}
public int getVisibleRowCount()
@@ -610,7 +699,12 @@ public class JTree extends JComponent
public void setVisibleRowCount(int rows)
{
+ if (visibleRowCount == rows)
+ return;
+
+ int oldValue = visibleRowCount;
visibleRowCount = rows;
+ firePropertyChange(VISIBLE_ROW_COUNT_PROPERTY, oldValue, rows);
}
public boolean isLargeModel()
@@ -620,7 +714,12 @@ public class JTree extends JComponent
public void setLargeModel(boolean large)
{
+ if (largeModel == large)
+ return;
+
+ boolean oldValue = largeModel;
largeModel = large;
+ firePropertyChange(LARGE_MODEL_PROPERTY, oldValue, large);
}
public int getRowHeight()
@@ -630,7 +729,17 @@ public class JTree extends JComponent
public void setRowHeight(int height)
{
+ if (rowHeight == height)
+ return;
+
+ int oldValue = rowHeight;
rowHeight = height;
+ firePropertyChange(ROW_HEIGHT_PROPERTY, oldValue, height);
+ }
+
+ public boolean isFixedRowHeight()
+ {
+ return rowHeight > 0;
}
public boolean getInvokesStopCellEditing()
@@ -640,7 +749,12 @@ public class JTree extends JComponent
public void setInvokesStopCellEditing(boolean invoke)
{
+ if (invokesStopCellEditing == invoke)
+ return;
+
+ boolean oldValue = invokesStopCellEditing;
invokesStopCellEditing = invoke;
+ firePropertyChange(INVOKES_STOP_CELL_EDITING_PROPERTY, oldValue, invoke);
}
/**
@@ -656,9 +770,32 @@ public class JTree extends JComponent
*/
public void setToggleClickCount(int count)
{
+ if (toggleClickCount == count)
+ return;
+
+ int oldValue = toggleClickCount;
toggleClickCount = count;
+ firePropertyChange(TOGGLE_CLICK_COUNT_PROPERTY, oldValue, count);
+ }
+
+ public void scrollPathToVisible(TreePath path)
+ {
+ if (path == null)
+ return;
+
+ Rectangle rect = getPathBounds(path);
+
+ if (rect == null)
+ return;
+
+ scrollRectToVisible(rect);
}
+ public void scrollRowToVisible(int row)
+ {
+ scrollPathToVisible(getPathForRow(row));
+ }
+
public boolean getScrollsOnExpand()
{
return scrollsOnExpand;
@@ -666,6 +803,590 @@ public class JTree extends JComponent
public void setScrollsOnExpand(boolean scroll)
{
+ if (scrollsOnExpand == scroll)
+ return;
+
+ boolean oldValue = scrollsOnExpand;
scrollsOnExpand = scroll;
+ firePropertyChange(SCROLLS_ON_EXPAND_PROPERTY, oldValue, scroll);
+ }
+
+ public void setSelectionPath(TreePath path)
+ {
+ selectionModel.setSelectionPath(path);
+ }
+
+ public void setSelectionPaths(TreePath[] paths)
+ {
+ selectionModel.setSelectionPaths(paths);
+ }
+
+ public void setSelectionRow(int row)
+ {
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ selectionModel.setSelectionPath(path);
+ }
+
+ public void setSelectionRows(int[] rows)
+ {
+ // Make sure we have an UI so getPathForRow() does not return null.
+ if (rows == null || getUI() == null)
+ return;
+
+ TreePath[] paths = new TreePath[rows.length];
+
+ for (int i = rows.length - 1; i >= 0; --i)
+ paths[i] = getPathForRow(rows[i]);
+
+ setSelectionPaths(paths);
+ }
+
+ public void setSelectionInterval(int index0, int index1)
+ {
+ TreePath[] paths = getPathBetweenRows(index0, index1);
+
+ if (paths != null)
+ setSelectionPaths(paths);
+ }
+
+ public void addSelectionPath(TreePath path)
+ {
+ selectionModel.addSelectionPath(path);
+ }
+
+ public void addSelectionPaths(TreePath[] paths)
+ {
+ selectionModel.addSelectionPaths(paths);
+ }
+
+ public void addSelectionRow(int row)
+ {
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ selectionModel.addSelectionPath(path);
+ }
+
+ public void addSelectionRows(int[] rows)
+ {
+ // Make sure we have an UI so getPathForRow() does not return null.
+ if (rows == null || getUI() == null)
+ return;
+
+ TreePath[] paths = new TreePath[rows.length];
+
+ for (int i = rows.length - 1; i >= 0; --i)
+ paths[i] = getPathForRow(rows[i]);
+
+ addSelectionPaths(paths);
+ }
+
+ public void addSelectionInterval(int index0, int index1)
+ {
+ TreePath[] paths = getPathBetweenRows(index0, index1);
+
+ if (paths != null)
+ addSelectionPaths(paths);
+ }
+
+ public void removeSelectionPath(TreePath path)
+ {
+ selectionModel.removeSelectionPath(path);
+ }
+
+ public void removeSelectionPaths(TreePath[] paths)
+ {
+ selectionModel.removeSelectionPaths(paths);
+ }
+
+ public void removeSelectionRow(int row)
+ {
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ selectionModel.removeSelectionPath(path);
+ }
+
+ public void removeSelectionRows(int[] rows)
+ {
+ // Make sure we have an UI so getPathForRow() does not return null.
+ if (rows == null || getUI() == null)
+ return;
+
+ TreePath[] paths = new TreePath[rows.length];
+
+ for (int i = rows.length - 1; i >= 0; --i)
+ paths[i] = getPathForRow(rows[i]);
+
+ removeSelectionPaths(paths);
+ }
+
+ public void removeSelectionInterval(int index0, int index1)
+ {
+ TreePath[] paths = getPathBetweenRows(index0, index1);
+
+ if (paths != null)
+ removeSelectionPaths(paths);
+ }
+
+ public void clearSelection()
+ {
+ selectionModel.clearSelection();
+ }
+
+ public TreePath getLeadSelectionPath()
+ {
+ return leadSelectionPath;
+ }
+
+ /**
+ * @since 1.3
+ */
+ public void setLeadSelectionPath(TreePath path)
+ {
+ if (leadSelectionPath == path)
+ return;
+
+ TreePath oldValue = leadSelectionPath;
+ leadSelectionPath = path;
+ firePropertyChange(LEAD_SELECTION_PATH_PROPERTY, oldValue, path);
+ }
+
+ /**
+ * @since 1.3
+ */
+ public TreePath getAnchorSelectionPath()
+ {
+ return anchorSelectionPath;
+ }
+
+ /**
+ * @since 1.3
+ */
+ public void setAnchorSelectionPath(TreePath path)
+ {
+ if (anchorSelectionPath == path)
+ return;
+
+ TreePath oldValue = anchorSelectionPath;
+ anchorSelectionPath = path;
+ firePropertyChange(ANCHOR_SELECTION_PATH_PROPERTY, oldValue, path);
+ }
+
+ public int getLeadSelectionRow()
+ {
+ return selectionModel.getLeadSelectionRow();
+ }
+
+ public int getMaxSelectionRow()
+ {
+ return selectionModel.getMaxSelectionRow();
+ }
+
+ public int getMinSelectionRow()
+ {
+ return selectionModel.getMinSelectionRow();
+ }
+
+ public int getSelectionCount()
+ {
+ return selectionModel.getSelectionCount();
+ }
+
+ public TreePath getSelectionPath()
+ {
+ return selectionModel.getSelectionPath();
+ }
+
+ public TreePath[] getSelectionPaths()
+ {
+ return selectionModel.getSelectionPaths();
+ }
+
+ public int[] getSelectionRows()
+ {
+ return selectionModel.getSelectionRows();
+ }
+
+ public boolean isPathSelected(TreePath path)
+ {
+ return selectionModel.isPathSelected(path);
+ }
+
+ public boolean isRowSelected(int row)
+ {
+ return selectionModel.isRowSelected(row);
+ }
+
+ public boolean isSelectionEmpty()
+ {
+ return selectionModel.isSelectionEmpty();
+ }
+
+ /**
+ * Return the value of the <code>dragEnabled</code> property.
+ *
+ * @return the value
+ *
+ * @since 1.4
+ */
+ public boolean getDragEnabled()
+ {
+ return dragEnabled;
+ }
+
+ /**
+ * Set the <code>dragEnabled</code> property.
+ *
+ * @param enabled new value
+ *
+ * @since 1.4
+ */
+ public void setDragEnabled(boolean enabled)
+ {
+ dragEnabled = enabled;
+ }
+
+ public int getRowCount()
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ return ui.getRowCount(this);
+
+ return 0;
+ }
+
+ public void collapsePath(TreePath path)
+ {
+ setExpandedState(path, false);
+ }
+
+ public void collapseRow(int row)
+ {
+ if (row < 0 || row >= getRowCount())
+ return;
+
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ collapsePath(path);
+ }
+
+ public void expandPath(TreePath path)
+ {
+ // Don't expand if last path component is a leaf node.
+ if ((path == null)
+ || (treeModel.isLeaf(path.getLastPathComponent())))
+ return;
+
+ setExpandedState(path, true);
+ }
+
+ public void expandRow(int row)
+ {
+ if (row < 0 || row >= getRowCount())
+ return;
+
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ expandPath(path);
+ }
+
+ public boolean isCollapsed(TreePath path)
+ {
+ return ! isExpanded(path);
+ }
+
+ public boolean isCollapsed(int row)
+ {
+ if (row < 0 || row >= getRowCount())
+ return false;
+
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ return isCollapsed(path);
+
+ return false;
+ }
+
+ public boolean isExpanded(TreePath path)
+ {
+ if (path == null)
+ return false;
+
+ Object state = nodeStates.get(path);
+
+ if ((state == null) || (state != EXPANDED))
+ return false;
+
+ TreePath parent = path.getParentPath();
+
+ if (parent != null)
+ return isExpanded(parent);
+
+ return true;
+ }
+
+ public boolean isExpanded(int row)
+ {
+ if (row < 0 || row >= getRowCount())
+ return false;
+
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ return isExpanded(path);
+
+ return false;
+ }
+
+ /**
+ * @since 1.3
+ */
+ public boolean getExpandsSelectedPaths()
+ {
+ return expandsSelectedPaths;
+ }
+
+ /**
+ * @since 1.3
+ */
+ public void setExpandsSelectedPaths(boolean flag)
+ {
+ if (expandsSelectedPaths == flag)
+ return;
+
+ boolean oldValue = expandsSelectedPaths;
+ expandsSelectedPaths = flag;
+ firePropertyChange(EXPANDS_SELECTED_PATHS_PROPERTY, oldValue, flag);
+ }
+
+ public Rectangle getPathBounds(TreePath path)
+ {
+ TreeUI ui = getUI();
+
+ if (ui == null)
+ return null;
+
+ return ui.getPathBounds(this, path);
+ }
+
+ public Rectangle getRowBounds(int row)
+ {
+ TreePath path = getPathForRow(row);
+
+ if (path != null)
+ return getPathBounds(path);
+
+ return null;
+ }
+
+ public boolean isEditing()
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ return ui.isEditing(this);
+
+ return false;
+ }
+
+ public boolean stopEditing()
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ return ui.stopEditing(this);
+
+ return false;
+ }
+
+ public void cancelEditing()
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ ui.cancelEditing(this);
+ }
+
+ public void startEditingAtPath(TreePath path)
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ ui.startEditingAtPath(this, path);
+ }
+
+ public TreePath getEditingPath()
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ return ui.getEditingPath(this);
+
+ return null;
+ }
+
+ public TreePath getPathForLocation(int x, int y)
+ {
+ TreePath path = getClosestPathForLocation(x, y);
+
+ if (path != null)
+ {
+ Rectangle rect = getPathBounds(path);
+
+ if ((rect != null) && rect.contains(x, y))
+ return path;
+ }
+
+ return null;
+ }
+
+ public int getRowForLocation(int x, int y)
+ {
+ TreePath path = getPathForLocation(x, y);
+
+ if (path != null)
+ return getRowForPath(path);
+
+ return -1;
+ }
+
+ public TreePath getClosestPathForLocation(int x, int y)
+ {
+ TreeUI ui = getUI();
+
+ if (ui != null)
+ return ui.getClosestPathForLocation(this, x, y);
+
+ return null;
+ }
+
+ public int getClosestRowForLocation(int x, int y)
+ {
+ TreePath path = getClosestPathForLocation(x, y);
+
+ if (path != null)
+ return getRowForPath(path);
+
+ return -1;
+ }
+
+ public Object getLastSelectedPathComponent()
+ {
+ TreePath path = getSelectionPath();
+
+ if (path != null)
+ return path.getLastPathComponent();
+
+ return null;
+ }
+
+ private void checkExpandParents(TreePath path)
+ throws ExpandVetoException
+ {
+ TreePath parent = path.getParentPath();
+
+ if (parent != null)
+ checkExpandParents(parent);
+
+ fireTreeWillExpand(path);
+ }
+
+ private void doExpandParents(TreePath path, boolean state)
+ {
+ TreePath parent = path.getParentPath();
+
+ if (isExpanded(parent))
+ return;
+
+ if (parent != null)
+ doExpandParents(parent, false);
+
+ nodeStates.put(path, state ? EXPANDED : COLLAPSED);
+ }
+
+ protected void setExpandedState(TreePath path, boolean state)
+ {
+ if (path == null)
+ return;
+
+ TreePath parent = path.getParentPath();
+
+ try
+ {
+ while (parent != null)
+ checkExpandParents(parent);
+ }
+ catch (ExpandVetoException e)
+ {
+ // Expansion vetoed.
+ return;
+ }
+
+ doExpandParents(path, state);
+ }
+
+ protected void clearToggledPaths()
+ {
+ nodeStates.clear();
+ }
+
+ protected Enumeration getDescendantToggledPaths(TreePath parent)
+ {
+ if (parent == null)
+ return null;
+
+ Enumeration nodes = nodeStates.keys();
+ Vector result = new Vector();
+
+ while (nodes.hasMoreElements())
+ {
+ TreePath path = (TreePath) nodes.nextElement();
+
+ if (path.isDescendant(parent))
+ result.addElement(path);
+ }
+
+ return result.elements();
+ }
+
+ public boolean hasBeenExpanded(TreePath path)
+ {
+ if (path == null)
+ return false;
+
+ return nodeStates.get(path) != null;
+ }
+
+ public boolean isVisible(TreePath path)
+ {
+ if (path == null)
+ return false;
+
+ TreePath parent = path.getParentPath();
+
+ if (parent == null)
+ return true; // Is root node.
+
+ return isExpanded(parent);
+ }
+
+ public void makeVisible(TreePath path)
+ {
+ if (path == null)
+ return;
+
+ expandPath(path.getParentPath());
+ }
+
+ public boolean isPathEditable(TreePath path)
+ {
+ return isEditable();
}
}
diff --git a/libjava/javax/swing/JViewport.java b/libjava/javax/swing/JViewport.java
index 9b26c8b21af..657f192fd04 100644
--- a/libjava/javax/swing/JViewport.java
+++ b/libjava/javax/swing/JViewport.java
@@ -1,5 +1,5 @@
/* JViewport.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,6 +45,7 @@ import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
+import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ViewportUI;
@@ -157,12 +158,23 @@ public class JViewport extends JComponent
fireStateChanged();
}
+ /**
+ * Returns the viewSize when set, or the preferred size of the set
+ * Component view. If no viewSize and no Component view is set an
+ * empty Dimension is returned.
+ */
public Dimension getViewSize()
{
if (isViewSizeSet)
return viewSize;
else
- return getView().getSize();
+ {
+ Component view = getView();
+ if (view != null)
+ return view.getPreferredSize();
+ else
+ return new Dimension();
+ }
}
@@ -281,7 +293,7 @@ public class JViewport extends JComponent
fireStateChanged();
}
- public void addImpl(Component comp, Object constraints, int index)
+ protected void addImpl(Component comp, Object constraints, int index)
{
if (getComponentCount() > 0)
remove(getComponents()[0]);
@@ -374,4 +386,10 @@ public class JViewport extends JComponent
{
super.setUI(ui);
}
+
+ public final void setBorder(Border border)
+ {
+ if (border != null)
+ throw new IllegalArgumentException();
+ }
}
diff --git a/libjava/javax/swing/JWindow.java b/libjava/javax/swing/JWindow.java
index 3601b694105..94efa3aa795 100644
--- a/libjava/javax/swing/JWindow.java
+++ b/libjava/javax/swing/JWindow.java
@@ -1,5 +1,5 @@
/* JWindow.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,10 +44,10 @@ import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
import java.awt.LayoutManager;
import java.awt.Window;
import java.awt.event.KeyEvent;
-import java.awt.event.WindowEvent;
import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
@@ -62,180 +62,144 @@ public class JWindow extends Window implements Accessible, RootPaneContainer
{
private static final long serialVersionUID = 5420698392125238833L;
- public static final int HIDE_ON_CLOSE = 0;
- public static final int EXIT_ON_CLOSE = 1;
- public static final int DISPOSE_ON_CLOSE = 2;
- public static final int DO_NOTHING_ON_CLOSE = 3;
-
- protected AccessibleContext accessibleContext;
-
- private int close_action = EXIT_ON_CLOSE;
-
-
- /***************************************************
- *
- *
- * constructors
- *
- *
- *************/
-
- public JWindow()
- {
- super(SwingUtilities.getOwnerFrame());
- }
-
- // huuu ?
- public JWindow(Frame f)
- {
- super(f);
- }
-
- /***************************************************
- *
- *
- * methods, this part is shared with JDialog, JFrame
- *
- *
- *************/
+ protected JRootPane rootPane;
+ protected boolean rootPaneCheckingEnabled;
+ protected AccessibleContext accessibleContext;
+ public JWindow()
+ {
+ super(SwingUtilities.getOwnerFrame());
+ windowInit();
+ }
+
+ public JWindow(GraphicsConfiguration gc)
+ {
+ super(SwingUtilities.getOwnerFrame(), gc);
+ windowInit();
+ }
- private boolean checking;
- protected JRootPane rootPane;
-
-
- protected void frameInit()
- {
- super.setLayout(new BorderLayout(1, 1));
- getRootPane(); // will do set/create
- }
-
+ public JWindow(Frame owner)
+ {
+ super(owner);
+ windowInit();
+ }
+
+ public JWindow(Window owner)
+ {
+ super(owner);
+ windowInit();
+ }
+
+ public JWindow(Window owner, GraphicsConfiguration gc)
+ {
+ super(owner, gc);
+ windowInit();
+ }
+
+ protected void windowInit()
+ {
+ super.setLayout(new BorderLayout(1, 1));
+ getRootPane(); // will do set/create
+ }
+
public Dimension getPreferredSize()
{
- Dimension d = super.getPreferredSize();
- return d;
+ return super.getPreferredSize();
}
- public void setLayout(LayoutManager manager)
- { super.setLayout(manager); }
+ public void setLayout(LayoutManager manager)
+ {
+ super.setLayout(manager);
+ }
- public void setLayeredPane(JLayeredPane layeredPane)
- { getRootPane().setLayeredPane(layeredPane); }
-
- public JLayeredPane getLayeredPane()
- { return getRootPane().getLayeredPane(); }
-
- public JRootPane getRootPane()
- {
- if (rootPane == null)
- setRootPane(createRootPane());
- return rootPane;
- }
-
- public void setRootPane(JRootPane root)
- {
- if (rootPane != null)
- remove(rootPane);
-
- rootPane = root;
- add(rootPane, BorderLayout.CENTER);
- }
-
- public JRootPane createRootPane()
- { return new JRootPane(); }
-
- public Container getContentPane()
- { return getRootPane().getContentPane(); }
-
- public void setContentPane(Container contentPane)
- { getRootPane().setContentPane(contentPane); }
-
- public Component getGlassPane()
- { return getRootPane().getGlassPane(); }
-
- public void setGlassPane(Component glassPane)
- { getRootPane().setGlassPane(glassPane); }
+ public void setLayeredPane(JLayeredPane layeredPane)
+ {
+ getRootPane().setLayeredPane(layeredPane);
+ }
-
- protected void addImpl(Component comp, Object constraints, int index)
- { super.addImpl(comp, constraints, index); }
+ public JLayeredPane getLayeredPane()
+ {
+ return getRootPane().getLayeredPane();
+ }
+
+ public JRootPane getRootPane()
+ {
+ if (rootPane == null)
+ setRootPane(createRootPane());
+ return rootPane;
+ }
+ protected void setRootPane(JRootPane root)
+ {
+ if (rootPane != null)
+ remove(rootPane);
- public void remove(Component comp)
- { getContentPane().remove(comp); }
-
- protected boolean isRootPaneCheckingEnabled()
- { return checking; }
+ rootPane = root;
+ add(rootPane, BorderLayout.CENTER);
+ }
+ protected JRootPane createRootPane()
+ {
+ return new JRootPane();
+ }
- protected void setRootPaneCheckingEnabled(boolean enabled)
- { checking = enabled; }
+ public Container getContentPane()
+ {
+ return getRootPane().getContentPane();
+ }
+ public void setContentPane(Container contentPane)
+ {
+ getRootPane().setContentPane(contentPane);
+ }
- public void update(Graphics g)
- { paint(g); }
+ public Component getGlassPane()
+ {
+ return getRootPane().getGlassPane();
+ }
- protected void processKeyEvent(KeyEvent e)
- { super.processKeyEvent(e); }
+ public void setGlassPane(Component glassPane)
+ {
+ getRootPane().setGlassPane(glassPane);
+ }
- /////////////////////////////////////////////////////////////////////////////////
-
- public AccessibleContext getAccessibleContext()
- { return null; }
-
- int getDefaultCloseOperation()
- { return close_action; }
-
- protected String paramString()
- { return "JWindow"; }
-
-
- protected void processWindowEvent(WindowEvent e)
- {
- // System.out.println("PROCESS_WIN_EV-1: " + e);
- super.processWindowEvent(e);
- // System.out.println("PROCESS_WIN_EV-2: " + e);
- switch (e.getID())
- {
- case WindowEvent.WINDOW_CLOSING:
- {
- switch(close_action)
- {
- case EXIT_ON_CLOSE:
- {
- System.out.println("user requested exit on close");
- System.exit(1);
- break;
- }
- case DISPOSE_ON_CLOSE:
- {
- System.out.println("user requested dispose on close");
- dispose();
- break;
- }
- case HIDE_ON_CLOSE:
- {
- setVisible(false);
- break;
- }
- case DO_NOTHING_ON_CLOSE:
- break;
- }
- break;
- }
-
- case WindowEvent.WINDOW_CLOSED:
- case WindowEvent.WINDOW_OPENED:
- case WindowEvent.WINDOW_ICONIFIED:
- case WindowEvent.WINDOW_DEICONIFIED:
- case WindowEvent.WINDOW_ACTIVATED:
- case WindowEvent.WINDOW_DEACTIVATED:
- break;
- }
- }
-
-
- void setDefaultCloseOperation(int operation)
- { close_action = operation; }
+ protected void addImpl(Component comp, Object constraints, int index)
+ {
+ super.addImpl(comp, constraints, index);
+ }
+
+ public void remove(Component comp)
+ {
+ getContentPane().remove(comp);
+ }
+ protected boolean isRootPaneCheckingEnabled()
+ {
+ return rootPaneCheckingEnabled;
+ }
+
+ protected void setRootPaneCheckingEnabled(boolean enabled)
+ {
+ rootPaneCheckingEnabled = enabled;
+ }
+
+ public void update(Graphics g)
+ {
+ paint(g);
+ }
+
+ protected void processKeyEvent(KeyEvent e)
+ {
+ super.processKeyEvent(e);
+ }
+
+ public AccessibleContext getAccessibleContext()
+ {
+ return null;
+ }
+
+ protected String paramString()
+ {
+ return "JWindow";
+ }
}
diff --git a/libjava/javax/swing/KeyStroke.java b/libjava/javax/swing/KeyStroke.java
index afdbae8300a..239c8dd1f84 100644
--- a/libjava/javax/swing/KeyStroke.java
+++ b/libjava/javax/swing/KeyStroke.java
@@ -1,5 +1,5 @@
/* KeyStroke.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
import java.awt.AWTKeyStroke;
@@ -45,12 +46,15 @@ public class KeyStroke
extends AWTKeyStroke
implements Serializable
{
- static final long serialVersionUID = -9060180771037902530L;
- private KeyStroke() {
+ private static final long serialVersionUID = -9060180771037902530L;
+
+ // Called by java.awt.AWTKeyStroke.registerSubclass via reflection.
+ private KeyStroke()
+ {
}
- protected KeyStroke(char keyChar, int keyCode, int modifiers,
- boolean onKeyRelease)
+ private KeyStroke(char keyChar, int keyCode, int modifiers,
+ boolean onKeyRelease)
{
super(keyChar, keyCode, modifiers, onKeyRelease);
}
@@ -92,9 +96,22 @@ public class KeyStroke
return (KeyStroke) getAWTKeyStroke(keyCode, modifiers);
}
+ /**
+ * Returns the KeyStroke according to <code>getAWTKeyStroke()</code>.
+ * But it returns null instead of throwing
+ * <code>IllegalArugmentException</code> when
+ * the keystoke sequence cannot be parsed from the given string.
+ */
public static KeyStroke getKeyStroke(String str)
{
- return (KeyStroke) getAWTKeyStroke(str);
+ try
+ {
+ return (KeyStroke) getAWTKeyStroke(str);
+ }
+ catch (IllegalArgumentException iae)
+ {
+ return null;
+ }
}
public static KeyStroke getKeyStrokeForEvent(KeyEvent event)
diff --git a/libjava/javax/swing/LookAndFeel.java b/libjava/javax/swing/LookAndFeel.java
index 3a56a114943..a2508386d5e 100644
--- a/libjava/javax/swing/LookAndFeel.java
+++ b/libjava/javax/swing/LookAndFeel.java
@@ -58,6 +58,12 @@ public abstract class LookAndFeel
public abstract String getDescription();
+ public static Object getDesktopPropertyValue(String systemPropertyName, Object fallbackValue)
+ {
+ Object value = Toolkit.getDefaultToolkit().getDesktopProperty(systemPropertyName);
+ return value != null ? value : fallbackValue;
+ }
+
public abstract String getID();
public abstract String getName();
diff --git a/libjava/javax/swing/MenuSelectionManager.java b/libjava/javax/swing/MenuSelectionManager.java
index 2e93c01e934..f78e21467b2 100644
--- a/libjava/javax/swing/MenuSelectionManager.java
+++ b/libjava/javax/swing/MenuSelectionManager.java
@@ -271,10 +271,10 @@ public class MenuSelectionManager
MenuElement[] subComponents = ((MenuElement) mouseOverMenuComp)
.getSubElements();
- for (int i = 0; i < subComponents.length; i++)
- {
- subComponents[i].processMouseEvent(event, path, manager);
- }
+ for (int i = 0; i < subComponents.length; i++)
+ {
+ subComponents[i].processMouseEvent(event, path, manager);
+ }
*/
}
}
diff --git a/libjava/javax/swing/OverlayLayout.java b/libjava/javax/swing/OverlayLayout.java
index 1e1d4aeff0d..706ffe2a2f6 100644
--- a/libjava/javax/swing/OverlayLayout.java
+++ b/libjava/javax/swing/OverlayLayout.java
@@ -51,7 +51,7 @@ import java.io.Serializable;
public class OverlayLayout
implements LayoutManager2, Serializable
{
- static final long serialVersionUID = 18082829169631543L;
+ private static final long serialVersionUID = 18082829169631543L;
//-------------------------------------------------------------
// Variables --------------------------------------------------
diff --git a/libjava/javax/swing/RepaintManager.java b/libjava/javax/swing/RepaintManager.java
index 1c9208e7a3b..c29ba787e37 100644
--- a/libjava/javax/swing/RepaintManager.java
+++ b/libjava/javax/swing/RepaintManager.java
@@ -263,7 +263,7 @@ public class RepaintManager
&& ancestor instanceof JComponent
&& ((JComponent) ancestor).isValidateRoot())
component = (JComponent) ancestor;
-
+
if (invalidComponents.contains(component))
return;
diff --git a/libjava/javax/swing/ScrollPaneLayout.java b/libjava/javax/swing/ScrollPaneLayout.java
index 0da8f18e549..a0461b4d037 100644
--- a/libjava/javax/swing/ScrollPaneLayout.java
+++ b/libjava/javax/swing/ScrollPaneLayout.java
@@ -57,7 +57,7 @@ import javax.swing.border.Border;
public class ScrollPaneLayout
implements LayoutManager, ScrollPaneConstants, Serializable
{
- static final long serialVersionUID = -4480022884523193743L;
+ private static final long serialVersionUID = -4480022884523193743L;
public static class UIResource extends ScrollPaneLayout
implements javax.swing.plaf.UIResource {
@@ -240,7 +240,7 @@ public class ScrollPaneLayout
if (viewportBorder != null)
{
- viewportInsets = viewportBorder.getBorderInsets(parent);
+ viewportInsets = viewportBorder.getBorderInsets(parent);
if (viewportInsets != null)
viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right,
viewportInsets.top + viewportInsets.bottom);
@@ -311,19 +311,19 @@ public class ScrollPaneLayout
if (viewportBorder != null)
{
- viewportInsets = viewportBorder.getBorderInsets(parent);
+ viewportInsets = viewportBorder.getBorderInsets(parent);
if (viewportInsets != null)
viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right,
viewportInsets.top + viewportInsets.bottom);
}
-
+
if (insets != null)
insetsSize.setSize(insets.left + insets.right,
insets.top + insets.bottom);
maybeSetMinimumSize(colHead, columnHeaderSize);
maybeSetMinimumSize(rowHead, rowHeaderSize);
-
+
if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER)
maybeSetMinimumSize(vsb, verticalScrollBarSize);
@@ -420,7 +420,7 @@ public class ScrollPaneLayout
if (!showVsb)
x3 = x4;
-
+
if (!showHsb)
y3 = y4;
@@ -438,7 +438,7 @@ public class ScrollPaneLayout
if (showVsb)
{
vsb.setVisible(true);
- vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2));
+ vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2));
}
else if (vsb != null)
vsb.setVisible(false);
@@ -446,7 +446,7 @@ public class ScrollPaneLayout
if (showHsb)
{
hsb.setVisible(true);
- hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3));
+ hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3));
}
else if (hsb != null)
hsb.setVisible(false);
diff --git a/libjava/javax/swing/SizeRequirements.java b/libjava/javax/swing/SizeRequirements.java
index eb641fbd1c7..dd34d9cd97b 100644
--- a/libjava/javax/swing/SizeRequirements.java
+++ b/libjava/javax/swing/SizeRequirements.java
@@ -47,7 +47,7 @@ import java.io.Serializable;
*/
public class SizeRequirements implements Serializable
{
- static final long serialVersionUID = 9217749429906736553L;
+ private static final long serialVersionUID = 9217749429906736553L;
//-------------------------------------------------------------
// Variables --------------------------------------------------
diff --git a/libjava/javax/swing/SpinnerListModel.java b/libjava/javax/swing/SpinnerListModel.java
index 4da26146906..9b2667182f2 100644
--- a/libjava/javax/swing/SpinnerListModel.java
+++ b/libjava/javax/swing/SpinnerListModel.java
@@ -1,5 +1,5 @@
/* SpinnerListModel.java -- A spinner model backed by a list or an array.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,7 +59,7 @@ import java.util.List;
* is changed via <code>setList()</code> or when the current value is
* set directly using <code>setValue()</code>.
*
- * @author Andrew John Hughes <gnu_andrew@member.fsf.org>
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @see SpinnerModel
* @see AbstractSpinnerModel
* @see JSpinner
diff --git a/libjava/javax/swing/SwingUtilities.java b/libjava/javax/swing/SwingUtilities.java
index feacf4fca22..8e987425fc4 100644
--- a/libjava/javax/swing/SwingUtilities.java
+++ b/libjava/javax/swing/SwingUtilities.java
@@ -1,5 +1,5 @@
/* SwingUtilities.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,15 +42,14 @@ import java.applet.Applet;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
-import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Insets;
+import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
-import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
@@ -58,6 +57,8 @@ import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.lang.reflect.InvocationTargetException;
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleStateSet;
import javax.swing.plaf.ActionMapUIResource;
import javax.swing.plaf.InputMapUIResource;
@@ -67,8 +68,10 @@ import javax.swing.plaf.InputMapUIResource;
* regions which need painting.
*
* @author Graydon Hoare (graydon@redhat.com)
+ * @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
-public class SwingUtilities implements SwingConstants
+public class SwingUtilities
+ implements SwingConstants
{
/**
* This frame should be used as parent for JWindow or JDialog
@@ -129,6 +132,152 @@ public class SwingUtilities implements SwingConstants
}
/**
+ * Returns the focus owner or <code>null</code> if <code>comp</code> is not
+ * the focus owner or a parent of it.
+ *
+ * @param comp the focus owner or a parent of it
+ *
+ * @return the focus owner, or <code>null</code>
+ *
+ * @deprecated 1.4 Replaced by
+ * <code>KeyboardFocusManager.getFocusOwner()</code>.
+ */
+ public static Component findFocusOwner(Component comp)
+ {
+ // Get real focus owner.
+ Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager()
+ .getFocusOwner();
+
+ // Check if comp is the focus owner or a parent of it.
+ Component tmp = focusOwner;
+
+ while (tmp != null)
+ {
+ if (tmp == comp)
+ return focusOwner;
+
+ tmp = tmp.getParent();
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the <code>Accessible</code> child of the specified component
+ * which appears at the supplied <code>Point</code>. If there is no
+ * child located at that particular pair of co-ordinates, null is returned
+ * instead.
+ *
+ * @param c the component whose children may be found at the specified
+ * point.
+ * @param p the point at which to look for the existence of children
+ * of the specified component.
+ * @return the <code>Accessible</code> child at the point, <code>p</code>,
+ * or null if there is no child at this point.
+ * @see javax.accessibility.AccessibleComponent#getAccessibleAt
+ */
+ public static Accessible getAccessibleAt(Component c, Point p)
+ {
+ return c.getAccessibleContext().getAccessibleComponent().getAccessibleAt(p);
+ }
+
+ /**
+ * <p>
+ * Returns the <code>Accessible</code> child of the specified component
+ * that has the supplied index within the parent component. The indexing
+ * of the children is zero-based, making the first child have an index of
+ * 0.
+ * </p>
+ * <p>
+ * Caution is advised when using this method, as its operation relies
+ * on the behaviour of varying implementations of an abstract method.
+ * For greater surety, direct use of the AWT component implementation
+ * of this method is advised.
+ * </p>
+ *
+ * @param c the component whose child should be returned.
+ * @param i the index of the child within the parent component.
+ * @return the <code>Accessible</code> child at index <code>i</code>
+ * in the component, <code>c</code>.
+ * @see javax.accessibility.AccessibleContext#getAccessibleChild
+ * @see java.awt.Component.AccessibleAWTComponent#getAccessibleChild
+ */
+ public static Accessible getAccessibleChild(Component c, int i)
+ {
+ return c.getAccessibleContext().getAccessibleChild(i);
+ }
+
+ /**
+ * <p>
+ * Returns the number of <code>Accessible</code> children within
+ * the supplied component.
+ * </p>
+ * <p>
+ * Caution is advised when using this method, as its operation relies
+ * on the behaviour of varying implementations of an abstract method.
+ * For greater surety, direct use of the AWT component implementation
+ * of this method is advised.
+ * </p>
+ *
+ * @param c the component whose children should be counted.
+ * @return the number of children belonging to the component,
+ * <code>c</code>.
+ * @see javax.accessibility.AccessibleContext#getAccessibleChildrenCount
+ * @see java.awt.Component.AccessibleAWTComponent#getAccessibleChildrenCount
+ */
+ public static int getAccessibleChildrenCount(Component c)
+ {
+ return c.getAccessibleContext().getAccessibleChildrenCount();
+ }
+
+ /**
+ * <p>
+ * Returns the zero-based index of the specified component
+ * within its parent. If the component doesn't have a parent,
+ * -1 is returned.
+ * </p>
+ * <p>
+ * Caution is advised when using this method, as its operation relies
+ * on the behaviour of varying implementations of an abstract method.
+ * For greater surety, direct use of the AWT component implementation
+ * of this method is advised.
+ * </p>
+ *
+ * @param c the component whose parental index should be found.
+ * @return the index of the component within its parent, or -1
+ * if the component doesn't have a parent.
+ * @see javax.accessibility.AccessibleContext#getAccessibleIndexInParent
+ * @see java.awt.Component.AccessibleAWTComponent#getAccessibleIndexInParent
+ */
+ public static int getAccessibleIndexInParent(Component c)
+ {
+ return c.getAccessibleContext().getAccessibleIndexInParent();
+ }
+
+ /**
+ * <p>
+ * Returns a set of <code>AccessibleState</code>s, which represent
+ * the state of the supplied component.
+ * </p>
+ * <p>
+ * Caution is advised when using this method, as its operation relies
+ * on the behaviour of varying implementations of an abstract method.
+ * For greater surety, direct use of the AWT component implementation
+ * of this method is advised.
+ * </p>
+ *
+ * @param c the component whose accessible state should be retrieved.
+ * @return a set of <code>AccessibleState</code> objects, which represent
+ * the state of the supplied component.
+ * @see javax.accessibility.AccessibleContext#getAccessibleStateSet
+ * @see java.awt.Component.AccessibleAWTComponent#getAccessibleStateSet
+ */
+ public static AccessibleStateSet getAccessibleStateSet(Component c)
+ {
+ return c.getAccessibleContext().getAccessibleStateSet();
+ }
+
+ /**
* Calculates the bounds of a component in the component's own coordinate
* space. The result has the same height and width as the component's
* bounds, but its location is set to (0,0).
@@ -144,22 +293,6 @@ public class SwingUtilities implements SwingConstants
}
/**
- * Returns the font metrics object for a given font. The metrics can be
- * used to calculate crude bounding boxes and positioning information,
- * for laying out components with textual elements.
- *
- * @param font The font to get metrics for
- *
- * @return The font's metrics
- *
- * @see java.awt.font.GlyphMetrics
- */
- public static FontMetrics getFontMetrics(Font font)
- {
- return Toolkit.getDefaultToolkit().getFontMetrics(font);
- }
-
- /**
* If <code>comp</code> is a RootPaneContainer, return its JRootPane.
* Otherwise call <code>getAncestorOfClass(JRootPane.class, a)</code>.
*
diff --git a/libjava/javax/swing/Timer.java b/libjava/javax/swing/Timer.java
index afdf4f32d58..0906b8d93bb 100644
--- a/libjava/javax/swing/Timer.java
+++ b/libjava/javax/swing/Timer.java
@@ -72,6 +72,14 @@ public class Timer implements Serializable
/** DOCUMENT ME! */
private Waker waker;
+ private Runnable drainer = new Runnable()
+ {
+ public void run()
+ {
+ drainEvents();
+ }
+ };
+
/**
* DOCUMENT ME!
*/
@@ -81,14 +89,7 @@ public class Timer implements Serializable
{
queue++;
if (queue == 1)
- SwingUtilities.invokeLater(new Runnable()
- {
- public void run()
- {
- drainEvents();
- }
- });
-
+ SwingUtilities.invokeLater(drainer);
}
}
diff --git a/libjava/javax/swing/TransferHandler.java b/libjava/javax/swing/TransferHandler.java
index 16b5016b3af..9d6fa4e3f7c 100644
--- a/libjava/javax/swing/TransferHandler.java
+++ b/libjava/javax/swing/TransferHandler.java
@@ -35,44 +35,119 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing;
-import java.io.Serializable;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
-import java.awt.datatransfer.*;
+import java.io.Serializable;
public class TransferHandler implements Serializable
{
+ static class TransferAction extends AbstractAction
+ {
+ private String command;
+
+ public TransferAction(String command)
+ {
+ this.command = command;
+ }
+
+ public void actionPerformed(ActionEvent event)
+ {
+ JComponent component = (JComponent) event.getSource();
+ TransferHandler transferHandler = component.getTransferHandler();
+ Clipboard clipboard = getClipboard(component);
+
+ if (command.equals(COMMAND_COPY))
+ transferHandler.exportToClipboard(component, clipboard, COPY);
+ else if (command.equals(COMMAND_CUT))
+ transferHandler.exportToClipboard(component, clipboard, MOVE);
+ else if (command.equals(COMMAND_PASTE))
+ {
+ Transferable transferable = clipboard.getContents(null);
+
+ if (transferable != null)
+ transferHandler.importData(component, transferable);
+ }
+ }
+
+ private static Clipboard getClipboard(JComponent component)
+ {
+ SecurityManager sm = System.getSecurityManager();
+
+ if (sm != null)
+ {
+ try
+ {
+ sm.checkSystemClipboardAccess();
+
+ // We may access system clipboard.
+ return component.getToolkit().getSystemClipboard();
+ }
+ catch (SecurityException e)
+ {
+ // We may not access system clipboard.
+ }
+ }
+
+ // Create VM-local clipboard if non exists yet.
+ if (clipboard == null)
+ clipboard = new Clipboard("Clipboard");
+
+ return clipboard;
+ }
+ }
+
private static final long serialVersionUID = -7908749299918704233L;
+ private static final String COMMAND_COPY = "copy";
+ private static final String COMMAND_CUT = "cut";
+ private static final String COMMAND_PASTE = "paste";
+
public static final int NONE = 0;
public static final int COPY = 1;
public static final int MOVE = 2;
public static final int COPY_OR_MOVE = 3;
- static Action getCopyAction ()
+ private static Action copyAction = new TransferAction(COMMAND_COPY);
+ private static Action cutAction = new TransferAction(COMMAND_CUT);
+ private static Action pasteAction = new TransferAction(COMMAND_PASTE);
+
+ /**
+ * Clipboard if system clipboard may not be used.
+ */
+ private static Clipboard clipboard;
+
+ private int sourceActions;
+ private Icon visualRepresentation;
+
+ public static Action getCopyAction()
{
- return null;
+ return copyAction;
}
- static Action getCutAction ()
+ public static Action getCutAction()
{
- return null;
+ return cutAction;
}
- static Action getPasteAction ()
+ public static Action getPasteAction()
{
- return null;
+ return pasteAction;
}
-
protected TransferHandler()
{
- // Do nothing here.
+ this.sourceActions = NONE;
}
public TransferHandler(String property)
{
+ this.sourceActions = property != null ? COPY : NONE;
}
public boolean canImport (JComponent c, DataFlavor[] flavors)
@@ -80,7 +155,7 @@ public class TransferHandler implements Serializable
return false;
}
- public Transferable createTransferable(JComponent c)
+ protected Transferable createTransferable(JComponent c)
{
return null;
}
@@ -99,17 +174,16 @@ public class TransferHandler implements Serializable
public int getSourceActions (JComponent c)
{
- return 0;
+ return sourceActions;
}
public Icon getVisualRepresentation (Transferable t)
{
- return null;
+ return visualRepresentation;
}
public boolean importData (JComponent c, Transferable t)
{
return false;
}
-
}
diff --git a/libjava/javax/swing/UIDefaults.java b/libjava/javax/swing/UIDefaults.java
index c32cebd5a81..a2deae4978d 100644
--- a/libjava/javax/swing/UIDefaults.java
+++ b/libjava/javax/swing/UIDefaults.java
@@ -1,5 +1,5 @@
/* UIDefaults.java -- database for all settings and interface bindings.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,8 +57,8 @@ import javax.swing.plaf.ComponentUI;
/**
* UIDefaults is a database where all settings and interface bindings are
- * stored into. An PLAF implementation fills one of these (see for example
- * plaf/basic/BasicLookAndFeel.java) with "ButtonUI" -> new BasicButtonUI().
+ * stored into. A PLAF implementation fills one of these (see for example
+ * plaf/basic/BasicLookAndFeel.java) with "ButtonUI" -&gt; new BasicButtonUI().
*
* @author Ronald Veldema (rveldema@cs.vu.nl)
*/
@@ -68,7 +68,7 @@ public class UIDefaults extends Hashtable
private Locale defaultLocale;
private PropertyChangeSupport propertyChangeSupport;
- public interface ActiveValue
+ public static interface ActiveValue
{
Object createValue(UIDefaults table);
}
@@ -92,7 +92,7 @@ public class UIDefaults extends Hashtable
}
}
- public interface LazyValue
+ public static interface LazyValue
{
Object createValue(UIDefaults table);
}
@@ -110,9 +110,9 @@ public class UIDefaults extends Hashtable
try
{
return Class
- .forName (className)
- .getConstructor (new Class[] {})
- .newInstance (new Object[] {});
+ .forName(className)
+ .getConstructor(new Class[] {})
+ .newInstance(new Object[] {});
}
catch (Exception e)
{
@@ -145,54 +145,54 @@ public class UIDefaults extends Hashtable
};
}
- public ProxyLazyValue (String c, Object[] os)
+ public ProxyLazyValue(String c, Object[] os)
{
final String className = c;
final Object[] objs = os;
final Class[] clss = new Class[objs.length];
for (int i = 0; i < objs.length; ++i)
{
- clss[i] = objs[i].getClass ();
+ clss[i] = objs[i].getClass();
}
- inner = new LazyValue ()
+ inner = new LazyValue()
{
- public Object createValue (UIDefaults table)
+ public Object createValue(UIDefaults table)
{
try
{
return Class
- .forName (className)
- .getConstructor (clss)
- .newInstance (objs);
- }
+ .forName(className)
+ .getConstructor(clss)
+ .newInstance(objs);
+ }
catch (Exception e)
- {
+ {
return null;
}
}
};
}
- public ProxyLazyValue (String c, String m, Object[] os)
+ public ProxyLazyValue(String c, String m, Object[] os)
{
final String className = c;
final String methodName = m;
final Object[] objs = os;
final Class[] clss = new Class[objs.length];
for (int i = 0; i < objs.length; ++i)
- {
- clss[i] = objs[i].getClass ();
- }
- inner = new LazyValue ()
+ {
+ clss[i] = objs[i].getClass();
+ }
+ inner = new LazyValue()
{
- public Object createValue(UIDefaults table)
- {
+ public Object createValue(UIDefaults table)
+ {
try
{
return Class
- .forName (className)
- .getMethod (methodName, clss)
- .invoke (null, objs);
+ .forName(className)
+ .getMethod(methodName, clss)
+ .invoke(null, objs);
}
catch (Exception e)
{
@@ -202,9 +202,9 @@ public class UIDefaults extends Hashtable
};
}
- public Object createValue (UIDefaults table)
+ public Object createValue(UIDefaults table)
{
- return inner.createValue (table);
+ return inner.createValue(table);
}
}
@@ -212,46 +212,46 @@ public class UIDefaults extends Hashtable
public UIDefaults()
{
- bundles = new LinkedList ();
- defaultLocale = Locale.getDefault ();
+ bundles = new LinkedList();
+ defaultLocale = Locale.getDefault();
propertyChangeSupport = new PropertyChangeSupport(this);
}
public UIDefaults(Object[] entries)
{
this();
-
- for (int i = 0; (2*i+1) < entries.length; ++i)
- put (entries[2*i], entries[2*i+1]);
- }
+
+ for (int i = 0; (2 * i + 1) < entries.length; ++i)
+ put(entries[2 * i], entries[2 * i + 1]);
+ }
public Object get(Object key)
{
- return this.get (key, getDefaultLocale ());
+ return this.get(key, getDefaultLocale());
}
- public Object get (Object key, Locale loc)
+ public Object get(Object key, Locale loc)
{
Object obj = null;
- if (super.containsKey (key))
+ if (super.containsKey(key))
{
- obj = super.get (key);
+ obj = super.get(key);
}
else if (key instanceof String)
{
String keyString = (String) key;
- ListIterator i = bundles.listIterator (0);
- while (i.hasNext ())
- {
- String bundle_name = (String) i.next ();
+ ListIterator i = bundles.listIterator(0);
+ while (i.hasNext())
+ {
+ String bundle_name = (String) i.next();
ResourceBundle res =
- ResourceBundle.getBundle (bundle_name, loc);
+ ResourceBundle.getBundle(bundle_name, loc);
if (res != null)
{
try
{
- obj = res.getObject (keyString);
+ obj = res.getObject(keyString);
break;
}
catch (MissingResourceException me)
@@ -271,14 +271,14 @@ public class UIDefaults extends Hashtable
if (obj instanceof LazyValue)
{
- Object resolved = ((LazyValue)obj).createValue (this);
- super.remove (key);
- super.put (key, resolved);
+ Object resolved = ((LazyValue) obj).createValue(this);
+ super.remove(key);
+ super.put(key, resolved);
return resolved;
}
else if (obj instanceof ActiveValue)
{
- return ((ActiveValue)obj).createValue (this);
+ return ((ActiveValue) obj).createValue(this);
}
return obj;
@@ -286,19 +286,23 @@ public class UIDefaults extends Hashtable
public Object put(Object key, Object value)
{
- Object old = super.put (key, value);
+ Object old;
+ if (value != null)
+ old = super.put(key, value);
+ else
+ old = super.remove(key);
if (key instanceof String && old != value)
- firePropertyChange ((String) key, old, value);
+ firePropertyChange((String) key, old, value);
return old;
}
public void putDefaults(Object[] entries)
{
- for (int i = 0; (2*i+1) < entries.length; ++i)
+ for (int i = 0; (2 * i + 1) < entries.length; ++i)
{
- super.put (entries[2*i], entries[2*i+1]);
+ super.put(entries[2 * i], entries[2 * i + 1]);
}
- firePropertyChange ("UIDefaults", null, null);
+ firePropertyChange("UIDefaults", null, null);
}
public Font getFont(Object key)
@@ -454,20 +458,20 @@ public class UIDefaults extends Hashtable
{
getUIError ("failed to locate createUI method on " + cls.toString ());
return null;
- }
+ }
try
- {
+ {
return (ComponentUI) factory.invoke (null, new Object[] { target });
- }
+ }
catch (java.lang.reflect.InvocationTargetException ite)
- {
+ {
getUIError ("InvocationTargetException ("+ ite.getTargetException()
+") calling createUI(...) on " + cls.toString ());
return null;
- }
+ }
catch (Exception e)
- {
+ {
getUIError ("exception calling createUI(...) on " + cls.toString ());
return null;
}
@@ -496,12 +500,12 @@ public class UIDefaults extends Hashtable
public void addResourceBundle(String name)
{
- bundles.addFirst (name);
+ bundles.addFirst(name);
}
public void removeResourceBundle(String name)
{
- bundles.remove (name);
+ bundles.remove(name);
}
public void setDefaultLocale(Locale loc)
diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java
index 9722129ab7c..dfc6a82ac46 100644
--- a/libjava/javax/swing/UIManager.java
+++ b/libjava/javax/swing/UIManager.java
@@ -1,5 +1,5 @@
/* UIManager.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -94,7 +94,7 @@ public class UIManager implements Serializable
*
* @param listener the listener to add
*/
- public static void addPropertyChangeListener (PropertyChangeListener listener)
+ public static void addPropertyChangeListener(PropertyChangeListener listener)
{
// FIXME
}
@@ -104,7 +104,7 @@ public class UIManager implements Serializable
*
* @param listener the listener to remove
*/
- public static void removePropertyChangeListener (PropertyChangeListener listener)
+ public static void removePropertyChangeListener(PropertyChangeListener listener)
{
// FIXME
}
@@ -116,7 +116,7 @@ public class UIManager implements Serializable
*
* @since 1.4
*/
- public static PropertyChangeListener[] getPropertyChangeListeners ()
+ public static PropertyChangeListener[] getPropertyChangeListeners()
{
// FIXME
throw new Error ("Not implemented");
diff --git a/libjava/javax/swing/ViewportLayout.java b/libjava/javax/swing/ViewportLayout.java
index 4738baccd1a..3abf31da385 100644
--- a/libjava/javax/swing/ViewportLayout.java
+++ b/libjava/javax/swing/ViewportLayout.java
@@ -52,7 +52,7 @@ import java.io.Serializable;
*/
public class ViewportLayout implements LayoutManager, Serializable
{
- static final long serialVersionUID = -788225906076097229L;
+ private static final long serialVersionUID = -788225906076097229L;
public ViewportLayout()
{
@@ -63,17 +63,25 @@ public class ViewportLayout implements LayoutManager, Serializable
public void removeLayoutComponent(Component c)
{
}
+
public Dimension preferredLayoutSize(Container parent)
{
JViewport vp = (JViewport)parent;
Component view = vp.getView();
+ if (view != null)
return view.getPreferredSize();
+ else
+ return new Dimension();
}
+
public Dimension minimumLayoutSize(Container parent)
{
JViewport vp = (JViewport)parent;
Component view = vp.getView();
- return view.getMinimumSize();
+ if (view != null)
+ return view.getMinimumSize();
+ else
+ return new Dimension();
}
/**
@@ -113,6 +121,9 @@ public class ViewportLayout implements LayoutManager, Serializable
JViewport port = (JViewport) parent;
Component view = port.getView();
+ if (view == null)
+ return;
+
// These dimensions and positions are in *view space*. Do not mix
// variables in here from port space (eg. parent.getBounds()). This
// function should be entirely in view space, because the methods on
diff --git a/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java b/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java
index 6002854c01d..9f85164041b 100644
--- a/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java
+++ b/libjava/javax/swing/colorchooser/DefaultRGBChooserPanel.java
@@ -1,5 +1,5 @@
/* DefaultRGHChooserPanel.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,7 +57,7 @@ import javax.swing.event.ChangeListener;
* This is the default RGB panel for the JColorChooser. The color is selected
* using three sliders that represent the RGB values.
*/
-public class DefaultRGBChooserPanel extends AbstractColorChooserPanel
+class DefaultRGBChooserPanel extends AbstractColorChooserPanel
{
/**
* This class handles the slider value changes for all three sliders.
diff --git a/libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java b/libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java
index 7e5a4eff0c5..20a72f438a8 100644
--- a/libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java
+++ b/libjava/javax/swing/colorchooser/DefaultSwatchChooserPanel.java
@@ -1,5 +1,5 @@
/* DefaultSwatchChooserPanel.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -432,7 +432,7 @@ class DefaultSwatchChooserPanel extends AbstractColorChooserPanel
/**
* This class is the recent swatch panel. It holds recently selected colors.
*/
- public static class RecentSwatchPanel extends SwatchPanel
+ static class RecentSwatchPanel extends SwatchPanel
{
/** The array for storing recently stored colors. */
Color[] colors;
diff --git a/libjava/javax/swing/event/EventListenerList.java b/libjava/javax/swing/event/EventListenerList.java
index e7294afcef4..226cac17916 100644
--- a/libjava/javax/swing/event/EventListenerList.java
+++ b/libjava/javax/swing/event/EventListenerList.java
@@ -1,5 +1,5 @@
/* EventListenerList.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -84,8 +84,8 @@ import java.util.EventListener;
* }
* }</pre></blockquote>
*
- * @author <a href="mailto:aselkirk@sympatico.ca">Andrew Selkirk</a>
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class EventListenerList
implements Serializable
diff --git a/libjava/javax/swing/event/MouseInputAdapter.java b/libjava/javax/swing/event/MouseInputAdapter.java
index 23caed0a8d9..b94b5f8d995 100644
--- a/libjava/javax/swing/event/MouseInputAdapter.java
+++ b/libjava/javax/swing/event/MouseInputAdapter.java
@@ -1,5 +1,5 @@
/* MouseInputAdapter.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,72 +44,76 @@ import java.awt.event.MouseEvent;
* MouseInputAdapter
* @author Andrew Selkirk
*/
-public class MouseInputAdapter extends Object
- implements MouseInputListener {
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor MouseInputAdapter
- */
- public MouseInputAdapter() {
- } // MouseInputAdapter()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Mouse clicked
- * @param event Mouse event
- */
- public void mouseClicked(MouseEvent event) {
- } // mouseClicked()
-
- /**
- * Mouse dragged
- * @param event Mouse event
- */
- public void mouseDragged(MouseEvent event) {
- } // mouseDragged()
-
- /**
- * Mouse entered
- * @param event Mouse event
- */
- public void mouseEntered(MouseEvent event) {
- } // mouseEntered()
-
- /**
- * Mouse exited
- * @param event Mouse event
- */
- public void mouseExited(MouseEvent event) {
- } // mouseExited()
-
- /**
- * Mouse moved
- * @param event Mouse event
- */
- public void mouseMoved(MouseEvent event) {
- } // mouseMoved()
-
- /**
- * Mouse pressed
- * @param event Mouse event
- */
- public void mousePressed(MouseEvent event) {
- } // mousePressed()
-
- /**
- * Mouse released
- * @param event Mouse event
- */
- public void mouseReleased(MouseEvent event) {
- } // mouseReleased()
-
-
-} // MouseInputAdapterEvent
+public abstract class MouseInputAdapter implements MouseInputListener
+{
+ /**
+ * Constructor MouseInputAdapter
+ */
+ public MouseInputAdapter()
+ {
+ // Do nothing here.
+ }
+
+ /**
+ * Mouse clicked
+ * @param event Mouse event
+ */
+ public void mouseClicked(MouseEvent event)
+ {
+ // Do nothing by default.
+ }
+
+ /**
+ * Mouse dragged
+ * @param event Mouse event
+ */
+ public void mouseDragged(MouseEvent event)
+ {
+ // Do nothing by default.
+ }
+
+ /**
+ * Mouse entered
+ * @param event Mouse event
+ */
+ public void mouseEntered(MouseEvent event)
+ {
+ // Do nothing by default.
+ }
+
+ /**
+ * Mouse exited
+ * @param event Mouse event
+ */
+ public void mouseExited(MouseEvent event)
+ {
+ // Do nothing by default.
+ }
+
+ /**
+ * Mouse moved
+ * @param event Mouse event
+ */
+ public void mouseMoved(MouseEvent event)
+ {
+ // Do nothing by default.
+ }
+
+ /**
+ * Mouse pressed
+ * @param event Mouse event
+ */
+ public void mousePressed(MouseEvent event)
+ {
+ // Do nothing by default.
+ }
+
+ /**
+ * Mouse released
+ * @param event Mouse event
+ */
+ public void mouseReleased(MouseEvent event)
+ {
+ // Do nothing by default.
+ }
+}
diff --git a/libjava/javax/swing/plaf/basic/BasicButtonListener.java b/libjava/javax/swing/plaf/basic/BasicButtonListener.java
index 2b4be67697c..48451c2373a 100644
--- a/libjava/javax/swing/plaf/basic/BasicButtonListener.java
+++ b/libjava/javax/swing/plaf/basic/BasicButtonListener.java
@@ -1,4 +1,4 @@
-/* BasicButtonListener.java
+/* BasicButtonListener.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.event.ActionEvent;
@@ -58,12 +59,19 @@ public class BasicButtonListener
implements MouseListener, MouseMotionListener, FocusListener,
ChangeListener, PropertyChangeListener
{
+ public BasicButtonListener(AbstractButton b)
+ {
+ // Do nothing here.
+ }
+
public void propertyChange(PropertyChangeEvent e)
{
}
+
protected void checkOpacity(AbstractButton b)
{
}
+
public void focusGained(FocusEvent e)
{
if (e.getSource() instanceof AbstractButton)
@@ -86,6 +94,7 @@ public class BasicButtonListener
button.repaint();
}
}
+
public void installKeyboardActions(JComponent c)
{
c.getActionMap().put("pressed",
@@ -114,20 +123,25 @@ public class BasicButtonListener
}
});
}
+
public void uninstallKeyboardActions(JComponent c)
{
c.getActionMap().put("pressed", null);
c.getActionMap().put("released", null);
}
+
public void stateChanged(ChangeEvent e)
{
}
+
public void mouseMoved(MouseEvent e)
{
}
+
public void mouseDragged(MouseEvent e)
{
}
+
public void mouseClicked(MouseEvent e)
{
}
@@ -152,7 +166,6 @@ public class BasicButtonListener
}
}
-
/**
* Accept a mouse release event and set the button's
* "pressed" property to <code>true</code>, if the model
@@ -175,7 +188,6 @@ public class BasicButtonListener
}
}
-
/**
* Accept a mouse enter event and set the button's "rollover" property to
* <code>true</code>, if the button's "rolloverEnabled" property is
diff --git a/libjava/javax/swing/plaf/basic/BasicButtonUI.java b/libjava/javax/swing/plaf/basic/BasicButtonUI.java
index ed04d281254..ed352e76794 100644
--- a/libjava/javax/swing/plaf/basic/BasicButtonUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicButtonUI.java
@@ -1,5 +1,5 @@
-/* BasicButtonUI.java
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* BasicButtonUI.java --
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -133,10 +134,10 @@ public class BasicButtonUI extends ButtonUI
protected BasicButtonListener createButtonListener(AbstractButton b)
{
- return new BasicButtonListener();
+ return new BasicButtonListener(b);
}
- public void installListeners(AbstractButton b)
+ protected void installListeners(AbstractButton b)
{
listener = createButtonListener(b);
b.addChangeListener(listener);
@@ -146,7 +147,7 @@ public class BasicButtonUI extends ButtonUI
b.addMouseMotionListener(listener);
}
- public void uninstallListeners(AbstractButton b)
+ protected void uninstallListeners(AbstractButton b)
{
b.removeChangeListener(listener);
b.removePropertyChangeListener(listener);
diff --git a/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
index a0cf5a43fec..5d7bbcd2c33 100644
--- a/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicCheckBoxMenuItemUI.java
@@ -98,7 +98,7 @@ public class BasicCheckBoxMenuItemUI extends BasicMenuItemUI
*/
public void processMouseEvent(JMenuItem item, MouseEvent e,
MenuElement[] path,
- MenuSelectionManager manager)
+ MenuSelectionManager manager)
{
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java b/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
index b306af71d1d..a55e13c954c 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboBoxEditor.java
@@ -46,7 +46,6 @@ import java.awt.event.FocusListener;
import javax.swing.ComboBoxEditor;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
-import javax.swing.plaf.UIResource;
/**
* This is a component that is responsible for displaying/editting selected
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
index 5dc0f489e20..9f61e0d18e2 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboBoxRenderer.java
@@ -50,7 +50,6 @@ import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-import javax.swing.plaf.UIResource;
/**
* This class is renderer for the combo box.
diff --git a/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java b/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
index 3ba13a2a1e1..9044ed76c86 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboBoxUI.java
@@ -1,5 +1,5 @@
/* BasicComboBoxUI.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,6 +80,7 @@ import javax.swing.plaf.ComponentUI;
* UI Delegate for JComboBox
*
* @author Olga Rodimina
+ * @author Robert Schuster
*/
public class BasicComboBoxUI extends ComboBoxUI
{
@@ -783,22 +784,25 @@ public class BasicComboBoxUI extends ComboBoxUI
{
Object currentValue = comboBox.getSelectedItem();
boolean isPressed = arrowButton.getModel().isPressed();
- if (currentValue != null)
- {
- Component comp = comboBox.getRenderer()
+
+ /* Gets the component to be drawn for the current value.
+ * If there is currently no selected item we will take an empty
+ * String as replacement.
+ */
+ Component comp = comboBox.getRenderer()
.getListCellRendererComponent(listBox,
- currentValue,
+ (currentValue != null ? currentValue : ""),
-1,
isPressed,
hasFocus);
- if (! comboBox.isEnabled())
+ if (! comboBox.isEnabled())
comp.setEnabled(false);
- g.translate(borderInsets.left, borderInsets.top);
+ g.translate(borderInsets.left, borderInsets.top);
comp.setBounds(0, 0, bounds.width, bounds.height);
comp.paint(g);
g.translate(-borderInsets.left, -borderInsets.top);
- }
+
comboBox.revalidate();
}
else
@@ -1142,7 +1146,7 @@ public class BasicComboBoxUI extends ComboBoxUI
*/
public void propertyChange(PropertyChangeEvent e)
{
- if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("enabled"))
{
arrowButton.setEnabled(comboBox.isEnabled());
@@ -1150,7 +1154,7 @@ public class BasicComboBoxUI extends ComboBoxUI
comboBox.getEditor().getEditorComponent().setEnabled(comboBox
.isEnabled());
}
- else if (e.getPropertyName().equals(JComboBox.EDITABLE_CHANGED_PROPERTY))
+ else if (e.getPropertyName().equals("editable"))
{
if (comboBox.isEditable())
{
@@ -1166,7 +1170,7 @@ public class BasicComboBoxUI extends ComboBoxUI
comboBox.revalidate();
comboBox.repaint();
}
- else if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY))
+ else if (e.getPropertyName().equals("dataModel"))
{
// remove ListDataListener from old model and add it to new model
ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue();
diff --git a/libjava/javax/swing/plaf/basic/BasicComboPopup.java b/libjava/javax/swing/plaf/basic/BasicComboPopup.java
index bec7f058f9d..2acc21fa7d4 100644
--- a/libjava/javax/swing/plaf/basic/BasicComboPopup.java
+++ b/libjava/javax/swing/plaf/basic/BasicComboPopup.java
@@ -1,5 +1,5 @@
/* BasicComboPopup.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -938,13 +938,13 @@ public class BasicComboPopup extends JPopupMenu implements ComboPopup
public void propertyChange(PropertyChangeEvent e)
{
- if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("renderer"))
{
list.setCellRenderer((ListCellRenderer) e.getNewValue());
revalidate();
repaint();
}
- if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("dataModel"))
{
list.setModel((ComboBoxModel) e.getNewValue());
revalidate();
diff --git a/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
index 36bb4ec2e93..fd2832a4073 100644
--- a/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
+++ b/libjava/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
@@ -288,6 +288,14 @@ public class BasicInternalFrameTitlePane extends JComponent
protected class TitlePaneLayout implements LayoutManager
{
/**
+ * Creates a new <code>TitlePaneLayout</code> object.
+ */
+ public TitlePaneLayout()
+ {
+ // Do nothing.
+ }
+
+ /**
* This method is called when adding a Component to the Container.
*
* @param name The name to reference the added Component by.
diff --git a/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java b/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
index 990a3e3f9e0..594bb7ecf93 100644
--- a/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java
@@ -821,7 +821,7 @@ public class BasicInternalFrameUI extends InternalFrameUI
if (e instanceof MouseEvent)
{
MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane()
- .getGlassPane(),
+ .getGlassPane(),
(MouseEvent) e,
frame.getRootPane()
.getGlassPane());
@@ -1105,7 +1105,7 @@ public class BasicInternalFrameUI extends InternalFrameUI
installDefaults();
installListeners();
- installComponents();
+ installComponents();
installKeyboardActions();
frame.setOpaque(true);
@@ -1122,7 +1122,7 @@ public class BasicInternalFrameUI extends InternalFrameUI
public void uninstallUI(JComponent c)
{
uninstallKeyboardActions();
- uninstallComponents();
+ uninstallComponents();
uninstallListeners();
uninstallDefaults();
diff --git a/libjava/javax/swing/plaf/basic/BasicLabelUI.java b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
index 46d012ddd58..b278f1f593b 100644
--- a/libjava/javax/swing/plaf/basic/BasicLabelUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicLabelUI.java
@@ -176,12 +176,12 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener
if (icon != null)
icon.paintIcon(b, g, ir.x, ir.y);
if (text != null && ! text.equals(""))
- {
- if (b.isEnabled())
- paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent());
- else
- paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent());
- }
+ {
+ if (b.isEnabled())
+ paintEnabledText(b, g, text, tr.x, tr.y + fm.getAscent());
+ else
+ paintDisabledText(b, g, text, tr.x, tr.y + fm.getAscent());
+ }
g.setFont(saved_font);
}
diff --git a/libjava/javax/swing/plaf/basic/BasicListUI.java b/libjava/javax/swing/plaf/basic/BasicListUI.java
index 50bbb819f62..b39421798fa 100644
--- a/libjava/javax/swing/plaf/basic/BasicListUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicListUI.java
@@ -686,7 +686,7 @@ public class BasicListUI extends ListUI
{
Rectangle bounds = getCellBounds(list, row, row);
if (bounds.intersects(clip))
- paintCell(g, row, bounds, render, model, sel, lead);
+ paintCell(g, row, bounds, render, model, sel, lead);
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
index 40bf972f25e..4a0f6d75728 100644
--- a/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
+++ b/libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
@@ -255,7 +255,7 @@ public abstract class BasicLookAndFeel extends LookAndFeel
"Button.foreground", new ColorUIResource(Color.black),
"Button.highlight", new ColorUIResource(Color.white),
"Button.light", new ColorUIResource(Color.lightGray.brighter()),
- "Button.margin", new InsetsUIResource(2, 14, 2, 14),
+ "Button.margin", new InsetsUIResource(2, 2, 2, 2),
"Button.shadow", new ColorUIResource(Color.gray),
"Button.textIconGap", new Integer(4),
"Button.textShiftOffset", new Integer(0),
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java b/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
index a1920fb5e31..bed2d051cc3 100644
--- a/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicMenuBarUI.java
@@ -1,5 +1,5 @@
/* BasicMenuBarUI.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -294,9 +294,9 @@ public class BasicMenuBarUI extends MenuBarUI
*/
public void propertyChange(PropertyChangeEvent e)
{
- if (e.getPropertyName().equals(JMenuBar.BORDER_PAINTED_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("borderPainted"))
menuBar.repaint();
- if (e.getPropertyName().equals(JMenuBar.MARGIN_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("margin"))
menuBar.repaint();
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
index da3f5598d05..ff48a74f074 100644
--- a/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicMenuItemUI.java
@@ -619,9 +619,9 @@ public class BasicMenuItemUI extends MenuItemUI
textRect.y
+ fm.getAscent());
else
- BasicGraphicsUtils.drawString(g, text, 0, textRect.x,
- textRect.y + fm.getAscent());
- }
+ BasicGraphicsUtils.drawString(g, text, 0, textRect.x,
+ textRect.y + fm.getAscent());
+ }
}
/**
@@ -760,7 +760,7 @@ public class BasicMenuItemUI extends MenuItemUI
FontMetrics fm = g.getFontMetrics(acceleratorFont);
if (menuItem.isEnabled())
- g.setColor(acceleratorForeground);
+ g.setColor(acceleratorForeground);
else
// FIXME: should fix this to use 'disabledForeground', but its
// default value in BasicLookAndFeel is null.
diff --git a/libjava/javax/swing/plaf/basic/BasicMenuUI.java b/libjava/javax/swing/plaf/basic/BasicMenuUI.java
index 98af9546a4b..7cd16f9e75e 100644
--- a/libjava/javax/swing/plaf/basic/BasicMenuUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicMenuUI.java
@@ -299,7 +299,7 @@ public class BasicMenuUI extends BasicMenuItemUI
if (i) if this menu is a submenu in some other menu
(ii) or if this menu is in a menu bar and some other menu in a menu bar was just
selected. (If nothing was selected, menu should be pressed before
- it will be selected)
+ it will be selected)
*/
JMenu menu = (JMenu) menuItem;
if (! menu.isTopLevelMenu()
@@ -328,15 +328,15 @@ public class BasicMenuUI extends BasicMenuItemUI
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
JMenu menu = (JMenu) menuItem;
manager.processMouseEvent(e);
-
+
// Menu should be displayed when the menu is pressed only if
// it is top-level menu
if (menu.isTopLevelMenu())
{
if (menu.getPopupMenu().isVisible())
- // If menu is visible and menu button was pressed..
- // then need to cancel the menu
- manager.clearSelectedPath();
+ // If menu is visible and menu button was pressed..
+ // then need to cancel the menu
+ manager.clearSelectedPath();
else
{
// Display the menu
diff --git a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java b/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
index 609fd11ab8a..7d5e0149388 100644
--- a/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicOptionPaneUI.java
@@ -847,17 +847,17 @@ public class BasicOptionPaneUI extends OptionPaneUI
addIcon(messageArea);
JPanel rightSide = new JPanel()
- {
- public Dimension getPreferredSize()
- {
+ {
+ public Dimension getPreferredSize()
+ {
int w = Math.max(optionPane.getSize().width, minimumWidth);
- Insets i = optionPane.getInsets();
- Dimension orig = super.getPreferredSize();
- Dimension value = new Dimension(w - i.left - i.right - iconSize,
- orig.height);
- return value;
- }
- };
+ Insets i = optionPane.getInsets();
+ Dimension orig = super.getPreferredSize();
+ Dimension value = new Dimension(w - i.left - i.right - iconSize,
+ orig.height);
+ return value;
+ }
+ };
rightSide.setLayout(new GridBagLayout());
GridBagConstraints con = createConstraints();
diff --git a/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java b/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
index 9398ab86c1b..1feb2c4ce45 100644
--- a/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicProgressBarUI.java
@@ -1,5 +1,5 @@
/* BasicProgressBarUI.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -103,7 +103,7 @@ public class BasicProgressBarUI extends ProgressBarUI
{
// Only need to listen for indeterminate changes.
// All other things are done on a repaint.
- if (e.getPropertyName().equals(JProgressBar.INDETERMINATE_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("inderterminate"))
if (((Boolean) e.getNewValue()).booleanValue())
startAnimationTimer();
else
@@ -467,7 +467,7 @@ public class BasicProgressBarUI extends ProgressBarUI
/**
* This method increments the animation index.
*/
- public void incrementAnimationIndex()
+ protected void incrementAnimationIndex()
{
animationIndex++;
//numFrames is like string length, it should be named numFrames or something
diff --git a/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java b/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
index 3b17f3608d0..55cfdc033e5 100644
--- a/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicRadioButtonMenuItemUI.java
@@ -66,11 +66,11 @@ public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI
/**
* Factory method to create a BasicRadioButtonMenuItemUI for the given {@link
* JComponent}, which should be a JRadioButtonMenuItem.
- *
+ *
* @param b The {@link JComponent} a UI is being created for.
- *
+ *
* @return A BasicRadioButtonMenuItemUI for the {@link JComponent}.
- */
+ */
public static ComponentUI createUI(JComponent b)
{
return new BasicRadioButtonMenuItemUI();
@@ -96,7 +96,7 @@ public class BasicRadioButtonMenuItemUI extends BasicMenuItemUI
*/
public void processMouseEvent(JMenuItem item, MouseEvent e,
MenuElement[] path,
- MenuSelectionManager manager)
+ MenuSelectionManager manager)
{
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java b/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
index 110200e58ab..4923b90b265 100644
--- a/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicRootPaneUI.java
@@ -49,17 +49,17 @@ import javax.swing.plaf.RootPaneUI;
public class BasicRootPaneUI extends RootPaneUI
implements PropertyChangeListener
{
- public static ComponentUI createUI(JComponent x)
- {
- return new BasicRootPaneUI();
- }
+ public static ComponentUI createUI(JComponent x)
+ {
+ return new BasicRootPaneUI();
+ }
- public void installUI(JComponent c)
- {
- c.setOpaque(true);
+ public void installUI(JComponent c)
+ {
+ c.setOpaque(true);
c.setBackground(UIManager.getColor("control"));
- super.installUI(c);
- }
+ super.installUI(c);
+ }
public void propertyChange(PropertyChangeEvent event)
{
diff --git a/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java b/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
index 446726e8bf8..36939b21da0 100644
--- a/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicScrollBarUI.java
@@ -1,5 +1,5 @@
/* BasicScrollBarUI.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -142,13 +142,13 @@ public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager,
*/
public void propertyChange(PropertyChangeEvent e)
{
- if (e.getPropertyName().equals(JScrollBar.MODEL_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("model"))
{
((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener);
scrollbar.getModel().addChangeListener(modelListener);
getThumbBounds();
}
- else if (e.getPropertyName().equals(JScrollBar.ORIENTATION_CHANGED_PROPERTY))
+ else if (e.getPropertyName().equals("orientation"))
{
incrButton.removeMouseListener(buttonListener);
decrButton.removeMouseListener(buttonListener);
diff --git a/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java b/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java
index 4d70412479a..b4618b2f7bf 100644
--- a/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java
@@ -53,11 +53,11 @@ import javax.swing.plaf.ScrollPaneUI;
public class BasicScrollPaneUI extends ScrollPaneUI
implements ScrollPaneConstants
{
-
- public static ComponentUI createUI(final JComponent c)
- {
- return new BasicScrollPaneUI();
- }
+
+ public static ComponentUI createUI(final JComponent c)
+ {
+ return new BasicScrollPaneUI();
+ }
protected void installDefaults(JScrollPane p)
{
@@ -77,9 +77,9 @@ public class BasicScrollPaneUI extends ScrollPaneUI
p.setBorder(null);
}
- public void installUI(final JComponent c)
- {
- super.installUI(c);
+ public void installUI(final JComponent c)
+ {
+ super.installUI(c);
this.installDefaults((JScrollPane)c);
}
@@ -87,29 +87,29 @@ public class BasicScrollPaneUI extends ScrollPaneUI
{
super.uninstallUI(c);
this.uninstallDefaults((JScrollPane)c);
- }
-
+ }
+
- public Dimension getMinimumSize(JComponent c)
- {
- JScrollPane p = (JScrollPane ) c;
- ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
- return sl.minimumLayoutSize(c);
- }
-
- public Dimension getPreferredSize(JComponent c)
- {
- JScrollPane p = (JScrollPane ) c;
- ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
- return sl.preferredLayoutSize(c);
- }
-
-
- public void paint(Graphics g, JComponent c)
- {
- // do nothing; the normal painting-of-children algorithm, along with
- // ScrollPaneLayout, does all the relevant work.
- }
+ public Dimension getMinimumSize(JComponent c)
+ {
+ JScrollPane p = (JScrollPane ) c;
+ ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
+ return sl.minimumLayoutSize(c);
+ }
+
+ public Dimension getPreferredSize(JComponent c)
+ {
+ JScrollPane p = (JScrollPane ) c;
+ ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout();
+ return sl.preferredLayoutSize(c);
+ }
+
+
+ public void paint(Graphics g, JComponent c)
+ {
+ // do nothing; the normal painting-of-children algorithm, along with
+ // ScrollPaneLayout, does all the relevant work.
+ }
}
diff --git a/libjava/javax/swing/plaf/basic/BasicSliderUI.java b/libjava/javax/swing/plaf/basic/BasicSliderUI.java
index 648e332639b..a08acc9bdad 100644
--- a/libjava/javax/swing/plaf/basic/BasicSliderUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicSliderUI.java
@@ -1,5 +1,5 @@
/* BasicSliderUI.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -139,7 +139,7 @@ public class BasicSliderUI extends SliderUI
/**
* Helper class that listens to the {@link JSlider}'s model for changes.
*/
- protected class ChangeHandler implements ChangeListener
+ public class ChangeHandler implements ChangeListener
{
/**
* Called when the slider's model has been altered. The UI delegate should
@@ -182,7 +182,7 @@ public class BasicSliderUI extends SliderUI
/**
* Helper class that listens for focus events.
*/
- protected class FocusHandler implements FocusListener
+ public class FocusHandler implements FocusListener
{
/**
* Called when the {@link JSlider} has gained focus. It should repaint
@@ -211,7 +211,7 @@ public class BasicSliderUI extends SliderUI
* Helper class that listens for changes to the properties of the {@link
* JSlider}.
*/
- protected class PropertyChangeHandler implements PropertyChangeListener
+ public class PropertyChangeHandler implements PropertyChangeListener
{
/**
* Called when one of the properties change. The UI should recalculate any
@@ -222,15 +222,15 @@ public class BasicSliderUI extends SliderUI
public void propertyChange(PropertyChangeEvent e)
{
// Check for orientation changes.
- if (e.getPropertyName().equals(JSlider.ORIENTATION_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("orientation"))
recalculateIfOrientationChanged();
- else if (e.getPropertyName().equals(JSlider.MODEL_CHANGED_PROPERTY))
- {
- BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
- oldModel.removeChangeListener(changeListener);
- slider.getModel().addChangeListener(changeListener);
- calculateThumbLocation();
- }
+ else if (e.getPropertyName().equals("model"))
+ {
+ BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue();
+ oldModel.removeChangeListener(changeListener);
+ slider.getModel().addChangeListener(changeListener);
+ calculateThumbLocation();
+ }
// elif the componentOrientation changes (this is a bound property,
// just undocumented) we change leftToRightCache. In Sun's
@@ -247,7 +247,7 @@ public class BasicSliderUI extends SliderUI
* for listening to the timer and moving the thumb in the proper direction
* every interval.
*/
- protected class ScrollListener implements ActionListener
+ public class ScrollListener implements ActionListener
{
/** Indicates which direction the thumb should scroll. */
private transient int direction;
@@ -346,15 +346,15 @@ public class BasicSliderUI extends SliderUI
currentMouseX = e.getX();
currentMouseY = e.getY();
if (slider.getValueIsAdjusting())
- {
- int value;
- if (slider.getOrientation() == JSlider.HORIZONTAL)
- value = valueForXPosition(currentMouseX) - offset;
- else
- value = valueForYPosition(currentMouseY) - offset;
-
- slider.setValue(value);
- }
+ {
+ int value;
+ if (slider.getOrientation() == JSlider.HORIZONTAL)
+ value = valueForXPosition(currentMouseX) - offset;
+ else
+ value = valueForYPosition(currentMouseY) - offset;
+
+ slider.setValue(value);
+ }
}
/**
@@ -391,7 +391,7 @@ public class BasicSliderUI extends SliderUI
value = findClosestTick(value);
// If the thumb is hit, then we don't need to set the timers to move it.
- if (!thumbRect.contains(e.getPoint()))
+ if (! thumbRect.contains(e.getPoint()))
{
// The mouse has hit some other part of the slider.
// The value moves no matter where in the slider you hit.
@@ -403,8 +403,8 @@ public class BasicSliderUI extends SliderUI
else
{
slider.setValueIsAdjusting(true);
- offset = value - slider.getValue();
- }
+ offset = value - slider.getValue();
+ }
}
/**
@@ -419,11 +419,11 @@ public class BasicSliderUI extends SliderUI
currentMouseY = e.getY();
if (slider.getValueIsAdjusting())
- {
- slider.setValueIsAdjusting(false);
- if (slider.getSnapToTicks())
- slider.setValue(findClosestTick(slider.getValue()));
- }
+ {
+ slider.setValueIsAdjusting(false);
+ if (slider.getSnapToTicks())
+ slider.setValue(findClosestTick(slider.getValue()));
+ }
if (scrollTimer != null)
scrollTimer.stop();
}
@@ -862,22 +862,22 @@ public class BasicSliderUI extends SliderUI
public Dimension getPreferredHorizontalSize()
{
Insets insets = slider.getInsets();
-
+
// The width should cover all the labels (which are usually the
// deciding factor of the width)
int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0
: slider.getLabelTable()
.size());
-
+
// If there are not enough labels.
// This number is pretty much arbitrary, but it looks nice.
if (width < 200)
width = 200;
-
+
// We can only draw inside of the focusRectangle, so we have to
// pad it with insets.
width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
+
// Height is determined by the thumb, the ticks and the labels.
int height = thumbHeight;
@@ -887,10 +887,10 @@ public class BasicSliderUI extends SliderUI
if (slider.getPaintLabels())
height += getHeightOfTallestLabel();
-
+
height += insets.top + insets.bottom + focusInsets.top
+ focusInsets.bottom;
-
+
return new Dimension(width, height);
}
@@ -903,19 +903,19 @@ public class BasicSliderUI extends SliderUI
public Dimension getPreferredVerticalSize()
{
Insets insets = slider.getInsets();
-
+
int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null
? 0 : slider.getLabelTable()
.size());
-
+
if (height < 200)
height = 200;
-
+
height += insets.top + insets.bottom + focusInsets.top
+ focusInsets.bottom;
int width = thumbHeight;
-
+
if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0
|| slider.getMinorTickSpacing() > 0)
width += tickHeight;
@@ -924,7 +924,7 @@ public class BasicSliderUI extends SliderUI
width += getWidthOfWidestLabel();
width += insets.left + insets.right + focusInsets.left + focusInsets.right;
-
+
return new Dimension(width, height);
}
@@ -960,7 +960,7 @@ public class BasicSliderUI extends SliderUI
* @return The dimensions of the preferred size.
*/
public Dimension getPreferredSize(JComponent c)
- {
+ {
if (slider.getOrientation() == JSlider.HORIZONTAL)
return getPreferredHorizontalSize();
else
@@ -1000,22 +1000,22 @@ public class BasicSliderUI extends SliderUI
else
return getPreferredVerticalSize();
}
-
+
/**
* This method calculates all the sizes of the rectangles by delegating to
* the helper methods calculateXXXRect.
*/
- protected void calculateGeometry()
- {
- calculateFocusRect();
- calculateContentRect();
- calculateThumbSize();
- calculateTrackBuffer();
- calculateTrackRect();
- calculateTickRect();
- calculateLabelRect();
- calculateThumbLocation();
- }
+ protected void calculateGeometry()
+ {
+ calculateFocusRect();
+ calculateContentRect();
+ calculateThumbSize();
+ calculateTrackBuffer();
+ calculateTrackRect();
+ calculateTickRect();
+ calculateLabelRect();
+ calculateThumbLocation();
+ }
/**
* This method calculates the size and position of the focusRect. This
@@ -1412,7 +1412,7 @@ public class BasicSliderUI extends SliderUI
leftToRightCache = slider.getComponentOrientation() != ComponentOrientation.RIGHT_TO_LEFT;
// FIXME: This next line is only here because the above line is here.
calculateThumbLocation();
-
+
if (slider.getPaintTrack())
paintTrack(g);
if (slider.getPaintTicks())
@@ -1573,8 +1573,8 @@ public class BasicSliderUI extends SliderUI
{
double loc = tickRect.x;
double increment = (max == min) ? 0
- : majorSpace * (double) tickRect.width / (max
- - min);
+ : majorSpace * (double) tickRect.width / (max
+ - min);
if (drawInverted())
{
loc += tickRect.width;
@@ -1590,8 +1590,8 @@ public class BasicSliderUI extends SliderUI
{
double loc = tickRect.height + tickRect.y;
double increment = (max == min) ? 0
- : -majorSpace * (double) tickRect.height / (max
- - min);
+ : -majorSpace * (double) tickRect.height / (max
+ - min);
if (drawInverted())
{
loc = tickRect.y;
@@ -1610,8 +1610,8 @@ public class BasicSliderUI extends SliderUI
{
double loc = tickRect.x;
double increment = (max == min) ? 0
- : minorSpace * (double) tickRect.width / (max
- - min);
+ : minorSpace * (double) tickRect.width / (max
+ - min);
if (drawInverted())
{
loc += tickRect.width;
@@ -1627,8 +1627,8 @@ public class BasicSliderUI extends SliderUI
{
double loc = tickRect.height + tickRect.y;
double increment = (max == min) ? 0
- : -minorSpace * (double) tickRect.height / (max
- - min);
+ : -minorSpace * (double) tickRect.height / (max
+ - min);
if (drawInverted())
{
loc = tickRect.y;
@@ -1800,13 +1800,13 @@ public class BasicSliderUI extends SliderUI
Dimension dim = label.getPreferredSize();
int w = (int) dim.getWidth();
int h = (int) dim.getHeight();
-
+
int max = slider.getMaximum();
int min = slider.getMinimum();
if (value > max || value < min)
return;
-
+
// value
// |
// ------------
@@ -2027,7 +2027,7 @@ public class BasicSliderUI extends SliderUI
protected void scrollDueToClickInTrack(int dir)
{
scrollTimer.stop();
-
+
scrollListener.setDirection(dir);
scrollListener.setScrollByBlock(true);
diff --git a/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
index 1ee1bb6d993..987f86bdb1b 100644
--- a/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
+++ b/libjava/javax/swing/plaf/basic/BasicSplitPaneDivider.java
@@ -160,6 +160,7 @@ public class BasicSplitPaneDivider extends Container
*/
private transient int currentDividerLocation = 1;
+ /** DOCUMENT ME! */
private transient Border tmpBorder = new Border()
{
public Insets getBorderInsets(Component c)
diff --git a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
index 7073086aae5..a533f0820aa 100644
--- a/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
@@ -1,5 +1,5 @@
-/* BasicTabbedPaneUI.java
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* BasicTabbedPaneUI.java --
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.plaf.basic;
import java.awt.Color;
@@ -75,7 +76,6 @@ import javax.swing.plaf.TabbedPaneUI;
import javax.swing.plaf.UIResource;
import javax.swing.text.View;
-
/**
* This is the Basic Look and Feel's UI delegate for JTabbedPane.
*/
@@ -84,7 +84,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
/**
* A helper class that handles focus.
*/
- protected class FocusHandler extends FocusAdapter
+ public class FocusHandler extends FocusAdapter
{
/**
* This method is called when the component gains focus.
@@ -112,7 +112,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
* sets the index appropriately. In SCROLL_TAB_MODE, this class also
* handles the mouse clicks on the scrolling buttons.
*/
- protected class MouseHandler extends MouseAdapter
+ public class MouseHandler extends MouseAdapter
{
/**
* This method is called when the mouse is pressed. The index cannot
@@ -184,13 +184,13 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
*/
public void propertyChange(PropertyChangeEvent e)
{
- if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("tabLayoutPolicy"))
{
layoutManager = createLayoutManager();
tabPane.setLayout(layoutManager);
}
- else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY)
+ else if (e.getPropertyName().equals("tabPlacement")
&& tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)
{
incrButton = createIncreaseButton();
@@ -1459,7 +1459,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
*
* @return A layout manager given the tab layout policy.
*/
- public LayoutManager createLayoutManager()
+ protected LayoutManager createLayoutManager()
{
if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT)
return new TabbedPaneLayout();
diff --git a/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java b/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
index ea7dfc0cd6d..ebc702ad393 100644
--- a/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTableHeaderUI.java
@@ -191,8 +191,8 @@ public class BasicTableHeaderUI
int spacing = 0;
if (header.getTable() != null
- && header.getTable().getInterCellSpacing() != null)
- spacing = header.getTable().getInterCellSpacing().width;
+ && header.getTable().getIntercellSpacing() != null)
+ spacing = header.getTable().getIntercellSpacing().width;
for (int i = 0; i < ncols; ++i)
{
diff --git a/libjava/javax/swing/plaf/basic/BasicTableUI.java b/libjava/javax/swing/plaf/basic/BasicTableUI.java
index eb0054bb645..9be6d60e918 100644
--- a/libjava/javax/swing/plaf/basic/BasicTableUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTableUI.java
@@ -104,45 +104,12 @@ public class BasicTableUI
{
Point begin, curr;
- private int getRowForPoint(Point p)
- {
- int y0 = table.getLocation().y;
- int nrows = table.getRowCount();
- Dimension gap = table.getInterCellSpacing();
- int height = table.getRowHeight() + (gap == null ? 0 : gap.height);
- int y = p.y;
- for (int i = 0; i < nrows; ++i)
- {
- if (0 <= y && y < height)
- return i;
- y -= height;
- }
- return -1;
- }
-
- private int getColForPoint(Point p)
- {
- int x0 = table.getLocation().x;
- int ncols = table.getColumnCount();
- Dimension gap = table.getInterCellSpacing();
- TableColumnModel cols = table.getColumnModel();
- int x = p.x;
- for (int i = 0; i < ncols; ++i)
- {
- int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width);
- if (0 <= x && x < width)
- return i;
- x -= width;
- }
- return -1;
- }
-
private void updateSelection()
{
if (table.getRowSelectionAllowed())
{
- int lo_row = getRowForPoint(begin);
- int hi_row = getRowForPoint(curr);
+ int lo_row = table.rowAtPoint(begin);
+ int hi_row = table.rowAtPoint(curr);
ListSelectionModel rowModel = table.getSelectionModel();
if (lo_row != -1 && hi_row != -1)
rowModel.setSelectionInterval(lo_row, hi_row);
@@ -150,8 +117,8 @@ public class BasicTableUI
if (table.getColumnSelectionAllowed())
{
- int lo_col = getColForPoint(begin);
- int hi_col = getColForPoint(curr);
+ int lo_col = table.columnAtPoint(begin);
+ int hi_col = table.columnAtPoint(curr);
ListSelectionModel colModel = table.getColumnModel().getSelectionModel();
if (lo_col != -1 && hi_col != -1)
colModel.setSelectionInterval(lo_col, hi_col);
@@ -294,7 +261,7 @@ public class BasicTableUI
int x = x0;
int y = y0;
- Dimension gap = table.getInterCellSpacing();
+ Dimension gap = table.getIntercellSpacing();
int ymax = clip.y + clip.height;
int xmax = clip.x + clip.width;
diff --git a/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java b/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java
index 615c74b2bff..ac20a0a990c 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextPaneUI.java
@@ -38,23 +38,22 @@ exception statement from your version. */
package javax.swing.plaf.basic;
-import java.beans.PropertyChangeEvent;
-
import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.text.Element;
import javax.swing.text.PlainView;
import javax.swing.text.View;
-public class BasicTextPaneUI extends BasicTextUI
+public class BasicTextPaneUI extends BasicEditorPaneUI
{
- public static ComponentUI createUI(JComponent comp)
+ public BasicTextPaneUI()
{
- return new BasicTextPaneUI();
+ // Do nothing here.
}
- public BasicTextPaneUI()
+ public static ComponentUI createUI(JComponent comp)
{
+ return new BasicTextPaneUI();
}
public View create(Element elem)
diff --git a/libjava/javax/swing/plaf/basic/BasicTextUI.java b/libjava/javax/swing/plaf/basic/BasicTextUI.java
index b3d03dbae68..a94ca2bb420 100644
--- a/libjava/javax/swing/plaf/basic/BasicTextUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTextUI.java
@@ -1,5 +1,5 @@
-/* BasicTextUI.java
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* BasicTextUI.java --
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -94,7 +94,7 @@ public abstract class BasicTextUI extends TextUI
{
}
}
-
+
private class RootView extends View
{
private View view;
@@ -104,6 +104,8 @@ public abstract class BasicTextUI extends TextUI
super(null);
}
+ // View methods.
+
public ViewFactory getViewFactory()
{
// FIXME: Handle EditorKit somehow.
@@ -111,8 +113,8 @@ public abstract class BasicTextUI extends TextUI
}
public void setView(View v)
- {
- if (view != null)
+ {
+ if (view != null)
view.setParent(null);
if (v != null)
@@ -122,17 +124,17 @@ public abstract class BasicTextUI extends TextUI
}
public Container getContainer()
- {
+ {
return textComponent;
}
-
+
public float getPreferredSpan(int axis)
{
if (view != null)
return view.getPreferredSpan(axis);
return Integer.MAX_VALUE;
- }
+ }
public void paint(Graphics g, Shape s)
{
@@ -140,9 +142,12 @@ public abstract class BasicTextUI extends TextUI
view.paint(g, s);
}
- protected Rectangle modelToView(int position, Shape a, Position.Bias bias)
+ public Shape modelToView(int position, Shape a, Position.Bias bias)
throws BadLocationException
{
+ if (view == null)
+ return null;
+
return ((PlainView) view).modelToView(position, a, bias).getBounds();
}
}
@@ -183,7 +188,7 @@ public abstract class BasicTextUI extends TextUI
{
return textComponent;
}
-
+
public void installUI(final JComponent c)
{
super.installUI(c);
@@ -327,11 +332,12 @@ public abstract class BasicTextUI extends TextUI
rootView.setView(null);
textComponent.removePropertyChangeListener(updateHandler);
- textComponent = null;
uninstallDefaults();
uninstallListeners();
uninstallKeyboardActions();
+
+ textComponent = null;
}
protected void uninstallDefaults()
@@ -360,7 +366,7 @@ public abstract class BasicTextUI extends TextUI
return new Dimension((int) w, (int) h);
}
-
+
public final void paint(Graphics g, JComponent c)
{
paintSafely(g);
@@ -442,13 +448,13 @@ public abstract class BasicTextUI extends TextUI
public View create(Element elem)
{
- // subclasses have to implement this to get this functionality
+ // Subclasses have to implement this to get this functionality.
return null;
}
public View create(Element elem, int p0, int p1)
{
- // subclasses have to implement this to get this functionality
+ // Subclasses have to implement this to get this functionality.
return null;
}
diff --git a/libjava/javax/swing/plaf/basic/BasicToolBarUI.java b/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
index 8315fc05f09..fad0108e096 100644
--- a/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicToolBarUI.java
@@ -1,5 +1,5 @@
/* BasicToolBarUI.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -92,40 +92,40 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
private static Border rolloverBorder;
/** The last known BorderLayout constraint before floating. */
- protected String constraintBeforeFloating;
+ protected String constraintBeforeFloating;
/** The last known orientation of the JToolBar before floating. */
private int lastGoodOrientation;
/** The color of the border when it is dockable. */
- protected Color dockingBorderColor;
+ protected Color dockingBorderColor;
/** The background color of the JToolBar when it is dockable. */
- protected Color dockingColor;
+ protected Color dockingColor;
/** The docking listener responsible for mouse events on the JToolBar. */
- protected MouseInputListener dockingListener;
+ protected MouseInputListener dockingListener;
/** The window used for dragging the JToolBar. */
- protected BasicToolBarUI.DragWindow dragWindow;
+ protected BasicToolBarUI.DragWindow dragWindow;
/** The color of the border when it is not dockable. */
- protected Color floatingBorderColor;
+ protected Color floatingBorderColor;
/** The background color of the JToolBar when it is not dockable. */
- protected Color floatingColor;
+ protected Color floatingColor;
/** The index of the focused component. */
- protected int focusedCompIndex;
+ protected int focusedCompIndex;
/** The PropertyChangeListener for the JToolBar. */
- protected PropertyChangeListener propertyListener;
+ protected PropertyChangeListener propertyListener;
/** The JToolBar this UI delegate is responsible for. */
- protected JToolBar toolBar;
+ protected JToolBar toolBar;
/** The Container listener for the JToolBar. */
- protected ContainerListener toolBarContListener;
+ protected ContainerListener toolBarContListener;
/** The Focus listener for the JToolBar. */
protected FocusListener toolBarFocusListener;
@@ -152,11 +152,11 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
private transient int cachedOrientation;
/**
- * This method creates a new BasicToolBarUI object for the given JToolBar.
+ * This method creates a new <code>BasicToolBarUI</code> object for the given JToolBar.
*/
public BasicToolBarUI()
{
- super();
+ // Do nothing here.
}
/**
@@ -168,13 +168,10 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @return Whether the JToolBar can dock.
*/
- protected boolean canDock(Component c, Point p)
- {
- if (areaOfClick(c, p) != -1)
- return true;
-
- return false;
- }
+ public boolean canDock(Component c, Point p)
+ {
+ return areaOfClick(c, p) != -1;
+ }
/**
* This helper method returns the position of the JToolBar if it can dock.
@@ -219,10 +216,10 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @return A new DockingListener for the JToolBar.
*/
- protected MouseInputListener createDockingListener()
- {
+ protected MouseInputListener createDockingListener()
+ {
return new DockingListener(toolBar);
- }
+ }
/**
* This method creates a new DragWindow for the given JToolBar.
@@ -231,10 +228,10 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @return A new DragWindow.
*/
- protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
- {
+ protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
+ {
return new DragWindow();
- }
+ }
/**
* This method creates a new floating frame for the JToolBar. By default,
@@ -245,11 +242,11 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @return A new floating frame.
*/
- protected JFrame createFloatingFrame(JToolBar toolbar)
- {
+ protected JFrame createFloatingFrame(JToolBar toolbar)
+ {
// FIXME: Though deprecated, this should still work.
- return null;
- }
+ return null;
+ }
/**
* This method creates a new floating window for the JToolBar. This is the
@@ -259,21 +256,21 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @return A new floating window.
*/
- protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
- {
+ protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
+ {
// This one is used by default though.
return new ToolBarDialog();
- }
+ }
/**
* This method creates a new WindowListener for the JToolBar.
*
* @return A new WindowListener.
*/
- protected WindowListener createFrameListener()
- {
+ protected WindowListener createFrameListener()
+ {
return new FrameListener();
- }
+ }
/**
* This method creates a new nonRolloverBorder for JButtons when the
@@ -281,20 +278,20 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @return A new NonRolloverBorder.
*/
- protected Border createNonRolloverBorder()
- {
+ protected Border createNonRolloverBorder()
+ {
return new EtchedBorderUIResource();
- }
+ }
/**
* This method creates a new PropertyChangeListener for the JToolBar.
*
* @return A new PropertyChangeListener.
*/
- protected PropertyChangeListener createPropertyListener()
- {
+ protected PropertyChangeListener createPropertyListener()
+ {
return new PropertyListener();
- }
+ }
/**
* This method creates a new rollover border for JButtons when the
@@ -302,8 +299,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @return A new rollover border.
*/
- protected Border createRolloverBorder()
- {
+ protected Border createRolloverBorder()
+ {
return new EtchedBorderUIResource()
{
public void paintBorder(Component c, Graphics g, int x, int y,
@@ -316,27 +313,27 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
}
}
};
- }
+ }
/**
* This method creates a new Container listener for the JToolBar.
*
* @return A new Container listener.
*/
- protected ContainerListener createToolBarContListener()
- {
+ protected ContainerListener createToolBarContListener()
+ {
return new ToolBarContListener();
- }
+ }
/**
* This method creates a new FocusListener for the JToolBar.
*
* @return A new FocusListener for the JToolBar.
*/
- protected FocusListener createToolBarFocusListener()
- {
+ protected FocusListener createToolBarFocusListener()
+ {
return new ToolBarFocusListener();
- }
+ }
/**
* This method creates a new UI delegate for the given JComponent.
@@ -357,8 +354,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param position The mouse cursor coordinates relative to the JToolBar.
* @param origin The screen position of the JToolBar.
*/
- protected void dragTo(Point position, Point origin)
- {
+ protected void dragTo(Point position, Point origin)
+ {
int loc = areaOfClick(origParent,
SwingUtilities.convertPoint(toolBar, position,
origParent));
@@ -390,7 +387,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
{
w = cachedBounds.height;
h = cachedBounds.width;
- }
+ }
Point p = dragWindow.getOffset();
Insets insets = toolBar.getInsets();
@@ -414,8 +411,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param origin The screen position of the JToolBar before the drag session
* started.
*/
- protected void floatAt(Point position, Point origin)
- {
+ protected void floatAt(Point position, Point origin)
+ {
Point p = new Point(position);
int aoc = areaOfClick(origParent,
SwingUtilities.convertPoint(toolBar, p, origParent));
@@ -434,7 +431,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
{
floatFrame.hide();
newParent = origParent;
- }
+ }
String constraint;
switch (aoc)
@@ -499,9 +496,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @return The docking color.
*/
public Color getDockingColor()
- {
- return dockingColor;
- }
+ {
+ return dockingColor;
+ }
/**
* This method returns the Color which is displayed when over a floating
@@ -510,9 +507,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @return The color which is displayed when over a floating area.
*/
public Color getFloatingColor()
- {
- return floatingColor;
- }
+ {
+ return floatingColor;
+ }
/**
* This method returns the maximum size of the given JComponent for this UI.
@@ -522,9 +519,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @return The maximum size for this UI.
*/
public Dimension getMaximumSize(JComponent c)
- {
+ {
return getPreferredSize(c);
- }
+ }
/**
* This method returns the minimum size of the given JComponent for this UI.
@@ -534,9 +531,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @return The minimum size for this UI.
*/
public Dimension getMinimumSize(JComponent c)
- {
+ {
return getPreferredSize(c);
- }
+ }
/**
* This method returns the preferred size of the given JComponent for this
@@ -547,15 +544,15 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @return The preferred size for this UI.
*/
public Dimension getPreferredSize(JComponent c)
- {
+ {
return toolBar.getLayout().preferredLayoutSize(c);
- }
+ }
/**
* This method installs the needed components for the JToolBar.
*/
- protected void installComponents()
- {
+ protected void installComponents()
+ {
floatFrame = (Window) createFloatingWindow(toolBar);
dragWindow = createDragWindow(toolBar);
@@ -569,13 +566,13 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
borders = new Hashtable();
fillHashtable();
- }
+ }
/**
* This method installs the defaults as specified by the look and feel.
*/
- protected void installDefaults()
- {
+ protected void installDefaults()
+ {
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
toolBar.setBorder(new ToolBarBorder());
@@ -588,24 +585,24 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
floatingBorderColor = defaults.getColor("ToolBar.floatingForeground");
floatingColor = defaults.getColor("ToolBar.floatingBackground");
- }
+ }
/**
* This method installs the keyboard actions for the JToolBar as specified
* by the look and feel.
*/
- protected void installKeyboardActions()
- {
+ protected void installKeyboardActions()
+ {
// FIXME: implement.
- }
+ }
/**
* This method installs listeners for the JToolBar.
*
* @param toolbar The JToolBar to register listeners for.
*/
- protected void installListeners(JToolBar toolbar)
- {
+ protected void installListeners(JToolBar toolbar)
+ {
dockingListener = createDockingListener();
toolBar.addMouseListener(dockingListener);
toolBar.addMouseMotionListener(dockingListener);
@@ -630,13 +627,13 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param c The JComponent whose children need to have non rollover borders
* installed.
*/
- protected void installNonRolloverBorders(JComponent c)
- {
+ protected void installNonRolloverBorders(JComponent c)
+ {
Component[] components = toolBar.getComponents();
for (int i = 0; i < components.length; i++)
setBorderToNonRollover(components[i]);
- }
+ }
/**
* This method installs normal (or their original) borders for each
@@ -645,13 +642,13 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param c The JComponent whose children need to have their original
* borders installed.
*/
- protected void installNormalBorders(JComponent c)
- {
+ protected void installNormalBorders(JComponent c)
+ {
Component[] components = toolBar.getComponents();
for (int i = 0; i < components.length; i++)
setBorderToNormal(components[i]);
- }
+ }
/**
* This method install rollover borders for each component inside the given
@@ -660,13 +657,13 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param c The JComponent whose children need to have rollover borders
* installed.
*/
- protected void installRolloverBorders(JComponent c)
- {
+ protected void installRolloverBorders(JComponent c)
+ {
Component[] components = toolBar.getComponents();
for (int i = 0; i < components.length; i++)
setBorderToRollover(components[i]);
- }
+ }
/**
* This method fills the borders hashtable with a list of components that
@@ -694,20 +691,20 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @param c The JComponent to install a UI for.
*/
- public void installUI(JComponent c)
- {
- super.installUI(c);
+ public void installUI(JComponent c)
+ {
+ super.installUI(c);
- if (c instanceof JToolBar)
- {
- toolBar = (JToolBar) c;
- toolBar.setOpaque(true);
+ if (c instanceof JToolBar)
+ {
+ toolBar = (JToolBar) c;
+ toolBar.setOpaque(true);
installDefaults();
installComponents();
- installListeners(toolBar);
+ installListeners(toolBar);
installKeyboardActions();
- }
- }
+ }
+ }
/**
* This method returns whether the JToolBar is floating.
@@ -715,9 +712,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @return Whether the JToolBar is floating.
*/
public boolean isFloating()
- {
+ {
return floatFrame.isVisible();
- }
+ }
/**
* This method returns whether rollover borders have been set.
@@ -725,9 +722,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @return Whether rollover borders have been set.
*/
public boolean isRolloverBorders()
- {
+ {
return toolBar.isRollover();
- }
+ }
/**
* This method navigates in the given direction giving focus to the next
@@ -735,10 +732,10 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @param direction The direction to give focus to.
*/
- protected void navigateFocusedComp(int direction)
- {
+ protected void navigateFocusedComp(int direction)
+ {
// FIXME: Implement.
- }
+ }
/**
* This method sets the border of the given component to a non rollover
@@ -746,45 +743,45 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
*
* @param c The Component whose border needs to be set.
*/
- protected void setBorderToNonRollover(Component c)
- {
+ protected void setBorderToNonRollover(Component c)
+ {
if (c instanceof JButton)
{
JButton b = (JButton) c;
b.setRolloverEnabled(false);
b.setBorder(nonRolloverBorder);
}
- }
+ }
/**
* This method sets the border of the given component to its original value.
*
* @param c The Component whose border needs to be set.
*/
- protected void setBorderToNormal(Component c)
- {
+ protected void setBorderToNormal(Component c)
+ {
if (c instanceof JButton)
{
JButton b = (JButton) c;
Border border = (Border) borders.get(b);
b.setBorder(border);
}
- }
+ }
/**
* This method sets the border of the given component to a rollover border.
*
* @param c The Component whose border needs to be set.
*/
- protected void setBorderToRollover(Component c)
- {
+ protected void setBorderToRollover(Component c)
+ {
if (c instanceof JButton)
{
JButton b = (JButton) c;
b.setRolloverEnabled(true);
b.setBorder(rolloverBorder);
}
- }
+ }
/**
* This method sets the docking color.
@@ -792,9 +789,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param c The docking color.
*/
public void setDockingColor(Color c)
- {
- dockingColor = c;
- }
+ {
+ dockingColor = c;
+ }
/**
* This method sets the floating property for the JToolBar.
@@ -816,9 +813,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param c The floating color.
*/
public void setFloatingColor(Color c)
- {
+ {
floatingColor = c;
- }
+ }
/**
* This method sets the floating location of the JToolBar.
@@ -866,7 +863,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* This method uninstall UI installed components from the JToolBar.
*/
protected void uninstallComponents()
- {
+ {
installNormalBorders(toolBar);
borders = null;
rolloverBorder = null;
@@ -890,21 +887,21 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
dockingColor = null;
floatingBorderColor = null;
floatingColor = null;
- }
+ }
/**
* This method uninstalls keyboard actions installed by the UI.
*/
protected void uninstallKeyboardActions()
- {
+ {
// FIXME: implement.
- }
+ }
/**
* This method uninstalls listeners installed by the UI.
*/
protected void uninstallListeners()
- {
+ {
toolBar.removeFocusListener(toolBarFocusListener);
toolBarFocusListener = null;
@@ -917,7 +914,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
toolBar.removeMouseMotionListener(dockingListener);
toolBar.removeMouseListener(dockingListener);
dockingListener = null;
- }
+ }
/**
* This method uninstalls the UI.
@@ -925,7 +922,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* @param c The JComponent that is having this UI removed.
*/
public void uninstallUI(JComponent c)
- {
+ {
uninstallKeyboardActions();
uninstallListeners();
uninstallComponents();
@@ -937,7 +934,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
* This is the MouseHandler class that allows the user to drag the JToolBar
* in and out of the parent and dock it if it can.
*/
- protected class DockingListener implements MouseInputListener
+ public class DockingListener implements MouseInputListener
{
/** Whether the JToolBar is being dragged. */
protected boolean isDragging;
@@ -1032,7 +1029,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
{
if (e.getX() > insets.left)
return;
- }
+ }
else
{
if (e.getY() > insets.top)
@@ -1221,7 +1218,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants
public void propertyChange(PropertyChangeEvent e)
{
// FIXME: need name properties so can change floatFrame title.
- if (e.getPropertyName().equals(JToolBar.ROLLOVER_CHANGED_PROPERTY))
+ if (e.getPropertyName().equals("rollover"))
setRolloverBorders(toolBar.isRollover());
}
}
diff --git a/libjava/javax/swing/plaf/basic/BasicTreeUI.java b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
index 93e3900750a..db74f067ef0 100644
--- a/libjava/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/libjava/javax/swing/plaf/basic/BasicTreeUI.java
@@ -45,14 +45,13 @@ import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JComponent;
+import javax.swing.JTree;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
-import javax.swing.JTree;
import javax.swing.plaf.TreeUI;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.TreePath;
import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
/**
* A delegate providing the user interface for <code>JTree</code>
diff --git a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
index fb6f27b88c1..b33205004b0 100644
--- a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -36,35 +36,275 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-
package javax.swing.plaf.metal;
import javax.swing.UIDefaults;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.FontUIResource;
import javax.swing.plaf.basic.BasicLookAndFeel;
public class MetalLookAndFeel extends BasicLookAndFeel
{
private static final long serialVersionUID = 6680646159193457980L;
-
- public boolean isNativeLookAndFeel() { return true; }
- public boolean isSupportedLookAndFeel() { return true; }
- public String getDescription() { return "Metal look and feel"; }
- public String getID() { return "MetalLookAndFeel"; }
- public String getName() { return "MetalLookAndFeel"; }
-
-
- UIDefaults LAF_defaults;
-
- public MetalLookAndFeel()
- {
- }
-
- public UIDefaults getDefaults()
- {
- if (LAF_defaults == null)
- LAF_defaults = super.getDefaults();
-
- // Returns the default values for this look and feel.
- return LAF_defaults;
- }
- }
+ private static MetalTheme theme;
+ private UIDefaults LAF_defaults;
+
+ public MetalLookAndFeel()
+ {
+ createDefaultTheme();
+ }
+
+ protected void createDefaultTheme()
+ {
+ setCurrentTheme(new DefaultMetalTheme());
+ }
+
+ public boolean isNativeLookAndFeel()
+ {
+ return true;
+ }
+
+ public boolean isSupportedLookAndFeel()
+ {
+ return true;
+ }
+
+ public String getDescription()
+ {
+ return "Metal look and feel";
+ }
+
+ public String getID()
+ {
+ return "MetalLookAndFeel";
+ }
+
+ public String getName()
+ {
+ return "MetalLookAndFeel";
+ }
+
+ public UIDefaults getDefaults()
+ {
+ if (LAF_defaults == null)
+ LAF_defaults = super.getDefaults();
+
+ // Returns the default values for this look and feel.
+ return LAF_defaults;
+ }
+
+ public static ColorUIResource getAcceleratorForeground()
+ {
+ return theme.getAcceleratorForeground();
+ }
+
+ public static ColorUIResource getAcceleratorSelectedForeground()
+ {
+ return theme.getAcceleratorSelectedForeground();
+ }
+
+ public static ColorUIResource getBlack()
+ {
+ return theme.getBlack();
+ }
+
+ public static ColorUIResource getControl()
+ {
+ return theme.getControl();
+ }
+
+ public static ColorUIResource getControlDarkShadow()
+ {
+ return theme.getControlDarkShadow();
+ }
+
+ public static ColorUIResource getControlDisabled()
+ {
+ return theme.getControlDisabled();
+ }
+
+ public static ColorUIResource getControlHighlight()
+ {
+ return theme.getControlHighlight();
+ }
+
+ public static ColorUIResource getControlInfo()
+ {
+ return theme.getControlInfo();
+ }
+
+ public static ColorUIResource getControlShadow()
+ {
+ return theme.getControlShadow();
+ }
+
+ public static ColorUIResource getControlTextColor()
+ {
+ return theme.getControlTextColor();
+ }
+
+ public static FontUIResource getControlTextFont()
+ {
+ return theme.getControlTextFont();
+ }
+
+ public static ColorUIResource getDesktopColor()
+ {
+ return theme.getDesktopColor();
+ }
+
+ public static ColorUIResource getFocusColor()
+ {
+ return theme.getFocusColor();
+ }
+
+ public static ColorUIResource getHighlightedTextColor()
+ {
+ return theme.getHighlightedTextColor();
+ }
+
+ public static ColorUIResource getInactiveControlTextColor()
+ {
+ return theme.getInactiveControlTextColor();
+ }
+
+ public static ColorUIResource getInactiveSystemTextColor()
+ {
+ return theme.getInactiveSystemTextColor();
+ }
+
+ public static ColorUIResource getMenuBackground()
+ {
+ return theme.getMenuBackground();
+ }
+
+ public static ColorUIResource getMenuDisabledForeground()
+ {
+ return theme.getMenuDisabledForeground();
+ }
+
+ public static ColorUIResource getMenuForeground()
+ {
+ return theme.getMenuForeground();
+ }
+
+ public static ColorUIResource getMenuSelectedBackground()
+ {
+ return theme.getMenuSelectedBackground();
+ }
+
+ public static ColorUIResource getMenuSelectedForeground()
+ {
+ return theme.getMenuSelectedForeground();
+ }
+
+ public static FontUIResource getMenuTextFont()
+ {
+ return theme.getMenuTextFont();
+ }
+
+ public static ColorUIResource getPrimaryControl()
+ {
+ return theme.getPrimaryControl();
+ }
+
+ public static ColorUIResource getPrimaryControlDarkShadow()
+ {
+ return theme.getPrimaryControlDarkShadow();
+ }
+
+ public static ColorUIResource getPrimaryControlHighlight()
+ {
+ return theme.getPrimaryControlHighlight();
+ }
+
+ public static ColorUIResource getPrimaryControlInfo()
+ {
+ return theme.getPrimaryControlInfo();
+ }
+
+ public static ColorUIResource getPrimaryControlShadow()
+ {
+ return theme.getPrimaryControlShadow();
+ }
+
+ public static ColorUIResource getSeparatorBackground()
+ {
+ return theme.getSeparatorBackground();
+ }
+
+ public static ColorUIResource getSeparatorForeground()
+ {
+ return theme.getSeparatorForeground();
+ }
+
+ public static FontUIResource getSubTextFont()
+ {
+ return theme.getSubTextFont();
+ }
+
+ public static ColorUIResource getSystemTextColor()
+ {
+ return theme.getSystemTextColor();
+ }
+
+ public static FontUIResource getSystemTextFont()
+ {
+ return theme.getSystemTextFont();
+ }
+
+ public static ColorUIResource getTextHighlightColor()
+ {
+ return theme.getTextHighlightColor();
+ }
+
+ public static ColorUIResource getUserTextColor()
+ {
+ return theme.getUserTextColor();
+ }
+
+ public static FontUIResource getUserTextFont()
+ {
+ return theme.getUserTextFont();
+ }
+
+ public static ColorUIResource getWhite()
+ {
+ return theme.getWhite();
+ }
+
+ public static ColorUIResource getWindowBackground()
+ {
+ return theme.getWindowBackground();
+ }
+
+ public static ColorUIResource getWindowTitleBackground()
+ {
+ return theme.getWindowTitleBackground();
+ }
+
+ public static FontUIResource getWindowTitleFont()
+ {
+ return theme.getWindowTitleFont();
+ }
+
+ public static ColorUIResource getWindowTitleForeground()
+ {
+ return theme.getWindowTitleForeground();
+ }
+
+ public static ColorUIResource getWindowTitleInactiveBackground()
+ {
+ return theme.getWindowTitleInactiveBackground();
+ }
+
+ public static ColorUIResource getWindowTitleInactiveForeground()
+ {
+ return theme.getWindowTitleInactiveForeground();
+ }
+
+ public static void setCurrentTheme(MetalTheme theme)
+ {
+ MetalLookAndFeel.theme = theme;
+ }
+}
diff --git a/libjava/javax/swing/table/DefaultTableCellRenderer.java b/libjava/javax/swing/table/DefaultTableCellRenderer.java
index ac5edb99586..790d0450f7f 100644
--- a/libjava/javax/swing/table/DefaultTableCellRenderer.java
+++ b/libjava/javax/swing/table/DefaultTableCellRenderer.java
@@ -1,5 +1,5 @@
/* DefaultTableCellRenderer.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -199,8 +199,8 @@ public class DefaultTableCellRenderer extends JLabel
* <p>This method needs to be overridden in a subclass to actually
* do something.</p>
*/
- public void firePropertyChange(String propertyName, Object oldValue,
- Object newValue)
+ protected void firePropertyChange(String propertyName, Object oldValue,
+ Object newValue)
{
// Does nothing.
}
diff --git a/libjava/javax/swing/table/DefaultTableColumnModel.java b/libjava/javax/swing/table/DefaultTableColumnModel.java
index b66b6951a99..3a8b1a3bf6d 100644
--- a/libjava/javax/swing/table/DefaultTableColumnModel.java
+++ b/libjava/javax/swing/table/DefaultTableColumnModel.java
@@ -66,37 +66,37 @@ public class DefaultTableColumnModel
private static final long serialVersionUID = 6580012493508960512L;
/**
- * tableColumns
+ * Columns that this model keeps track of.
*/
protected Vector tableColumns;
/**
- * selectionModel
+ * Selection Model that keeps track of columns selection
*/
protected ListSelectionModel selectionModel;
/**
- * columnMargin
+ * Space between two columns. By default it is set to 1
*/
protected int columnMargin;
/**
- * listenerList
+ * listenerList keeps track of all listeners registered with this model
*/
protected EventListenerList listenerList = new EventListenerList();
/**
- * changeEvent
+ * changeEvent is fired when change occurs in one of the columns properties
*/
protected transient ChangeEvent changeEvent = new ChangeEvent(this);
/**
- * columnSelectionAllowed
+ * Indicates whether columns can be selected
*/
protected boolean columnSelectionAllowed;
/**
- * totalColumnWidth
+ * Total width of all the columns in this model
*/
protected int totalColumnWidth;
@@ -106,103 +106,116 @@ public class DefaultTableColumnModel
public DefaultTableColumnModel()
{
tableColumns = new Vector();
- setSelectionModel(new DefaultListSelectionModel());
+ setSelectionModel(createSelectionModel());
columnMargin = 1;
columnSelectionAllowed = false;
}
/**
- * addColumn
- * @param value0 TODO
+ * addColumn adds column to the model. This method fires ColumnAdded
+ * event to model's registered TableColumnModelListeners.
+ *
+ * @param col column to add
*/
public void addColumn(TableColumn col)
{
tableColumns.add(col);
invalidateWidthCache();
+ fireColumnAdded(new TableColumnModelEvent(this,0,tableColumns.size()));
}
/**
- * removeColumn
- * @param value0 TODO
+ * removeColumn removes table column from the model. This method fires
+ * ColumnRemoved event to model's registered TableColumnModelListeners.
+ *
+ * @param col column to be removed
*/
public void removeColumn(TableColumn col)
{
+ int index = getColumnIndex(col);
+ fireColumnRemoved(new TableColumnModelEvent(this,index,0));
tableColumns.remove(col);
invalidateWidthCache();
}
/**
- * moveColumn
- * @param value0 TODO
- * @param value1 TODO
+ * moveColumn moves column at index i to index j. This method fires
+ * ColumnMoved event to model's registered TableColumnModelListeners.
+ *
+ * @param i index of the column that will be moved
+ * @param j index of column's new location
*/
public void moveColumn(int i, int j)
{
Object tmp = tableColumns.get(i);
tableColumns.set(i, tableColumns.get(j));
tableColumns.set(j, tmp);
+ fireColumnAdded(new TableColumnModelEvent(this,i,j));
}
/**
- * setColumnMargin
- * @param value0 TODO
+ * setColumnMargin sets margin of the columns.
+ * @param m new column margin
*/
public void setColumnMargin(int m)
{
columnMargin = m;
+ fireColumnMarginChanged();
}
- /**
- * getColumnCount
- * @return int
- */
+ /**
+ * getColumnCount returns number of columns in the model
+ * @return int number of columns in the model
+ */
public int getColumnCount()
{
return tableColumns.size();
}
- /**
- * getColumns
+ /**
+ * getColumns
* @return Enumeration
- */
+ */
public Enumeration getColumns()
{
return tableColumns.elements();
}
- /**
- * getColumnIndex
- * @param value0 TODO
- * @return int
+ /**
+ * getColumnIndex returns index of the specified column
+ *
+ * @param identifier identifier of the column
+ * @return int index of the given column
*/
- public int getColumnIndex(Object obj)
+ public int getColumnIndex(Object identifier)
{
- return tableColumns.indexOf(obj, 0);
+ return tableColumns.indexOf(identifier, 0);
}
- /**
- * getColumn
- * @param value0 TODO
- * @return TableColumn
+ /**
+ * getColumn returns column at the specified index
+ * @param i index of the column
+ * @return TableColumn column at the specified index
*/
public TableColumn getColumn(int i)
{
return (TableColumn) tableColumns.get(i);
}
- /**
- * getColumnMargin
- * @return int
- */
+ /**
+ * getColumnMargin returns column margin
+ * @return int column margin
+ */
public int getColumnMargin()
{
return columnMargin;
}
- /**
- * getColumnIndexAtX
- * @param value0 TODO
- * @return int
+ /**
+ * getColumnIndexAtX returns column that contains specified x-coordinate.
+ * @param x x-coordinate that column should contain
+ * @return int index of the column that contains specified x-coordinate relative
+ * to this column model
*/
public int getColumnIndexAtX(int x)
{
@@ -217,10 +230,12 @@ public class DefaultTableColumnModel
return -1;
}
- /**
- * getTotalColumnWidth
- * @return int
- */
+ /**
+ * getTotalColumnWidth returns total width of all the columns including
+ * column's margins.
+ *
+ * @return total width of all the columns
+ */
public int getTotalColumnWidth()
{
if (totalColumnWidth == -1)
@@ -229,8 +244,10 @@ public class DefaultTableColumnModel
}
/**
- * setSelectionModel
- * @param model TODO
+ * setSelectionModel sets selection model that will be used by this ColumnTableModel
+ * to keep track of currently selected columns
+ *
+ * @param model new selection model
* @exception IllegalArgumentException if model is null
*/
public void setSelectionModel(ListSelectionModel model)
@@ -242,53 +259,124 @@ public class DefaultTableColumnModel
selectionModel.addListSelectionListener(this);
}
- /**
- * getSelectionModel
- * @return ListSelectionModel
- */
+ /**
+ * getSelectionModel returns selection model
+ * @return ListSelectionModel selection model
+ */
public ListSelectionModel getSelectionModel()
{
return selectionModel;
}
/**
- * setColumnSelectionAllowed
- * @param value0 TODO
+ * setColumnSelectionAllowed sets whether column selection is allowed
+ * or not.
+ *
+ * @param flag true if column selection is allowed and false otherwise
*/
- public void setColumnSelectionAllowed(boolean a)
+ public void setColumnSelectionAllowed(boolean flag)
{
- columnSelectionAllowed = a;
+ columnSelectionAllowed = flag;
}
- /**
- * getColumnSelectionAllowed
- * @return boolean
- */
+ /**
+ * getColumnSelectionAllowed indicates whether column selection is
+ * allowed or not.
+ *
+ * @return boolean true if column selection is allowed and false otherwise.
+ */
public boolean getColumnSelectionAllowed()
{
return columnSelectionAllowed;
}
- /**
- * getSelectedColumns
- * @return int[]
- */
+ /**
+ * getSelectedColumns returns array containing indexes of currently
+ * selected columns
+ *
+ * @return int[] array containing indexes of currently selected columns
+ */
public int[] getSelectedColumns()
{
- return null; // TODO
+ // FIXME: Implementation of this method was taken from private method
+ // JTable.getSelections(), which is used in various places in JTable
+ // including selected row calculations and cannot be simply removed.
+ // This design should be improved to illuminate duplication of code.
+
+ ListSelectionModel lsm = this.selectionModel;
+ int sz = getSelectedColumnCount();
+ int [] ret = new int[sz];
+
+ int lo = lsm.getMinSelectionIndex();
+ int hi = lsm.getMaxSelectionIndex();
+ int j = 0;
+ java.util.ArrayList ls = new java.util.ArrayList();
+ if (lo != -1 && hi != -1)
+ {
+ switch (lsm.getSelectionMode())
+ {
+ case ListSelectionModel.SINGLE_SELECTION:
+ ret[0] = lo;
+ break;
+
+ case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
+ for (int i = lo; i <= hi; ++i)
+ ret[j++] = i;
+ break;
+
+ case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
+ for (int i = lo; i <= hi; ++i)
+ if (lsm.isSelectedIndex(i))
+ ret[j++] = i;
+ break;
+ }
+ }
+ return ret;
}
- /**
- * getSelectedColumnCount
- * @return int
- */
+ /**
+ * getSelectedColumnCount returns number of currently selected columns
+ * @return int number of currently selected columns
+ */
public int getSelectedColumnCount()
{
- return 0; // TODO
+ // FIXME: Implementation of this method was taken from private method
+ // JTable.countSelections(), which is used in various places in JTable
+ // including selected row calculations and cannot be simply removed.
+ // This design should be improved to illuminate duplication of code.
+
+ ListSelectionModel lsm = this.selectionModel;
+ int lo = lsm.getMinSelectionIndex();
+ int hi = lsm.getMaxSelectionIndex();
+ int sum = 0;
+
+ if (lo != -1 && hi != -1)
+ {
+ switch (lsm.getSelectionMode())
+ {
+ case ListSelectionModel.SINGLE_SELECTION:
+ sum = 1;
+ break;
+
+ case ListSelectionModel.SINGLE_INTERVAL_SELECTION:
+ sum = hi - lo + 1;
+ break;
+
+ case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION:
+ for (int i = lo; i <= hi; ++i)
+ if (lsm.isSelectedIndex(i))
+ ++sum;
+ break;
+ }
+ }
+
+ return sum;
}
/**
- * addColumnModelListener
+ * addColumnModelListener adds specified listener to the model's
+ * listener list
+ *
* @param listener the listener to add
*/
public void addColumnModelListener(TableColumnModelListener listener)
@@ -297,7 +385,9 @@ public class DefaultTableColumnModel
}
/**
- * removeColumnModelListener
+ * removeColumnModelListener removes specified listener from the model's
+ * listener list.
+ *
* @param listener the listener to remove
*/
public void removeColumnModelListener(TableColumnModelListener listener)
@@ -315,35 +405,53 @@ public class DefaultTableColumnModel
}
/**
- * fireColumnAdded
- * @param value0 TODO
+ * fireColumnAdded fires TableColumnModelEvent to registered
+ * TableColumnModelListeners to indicate that column was added
+ *
+ * @param e TableColumnModelEvent
*/
- protected void fireColumnAdded(TableColumnModelEvent value0)
- {
- // TODO
+ protected void fireColumnAdded(TableColumnModelEvent e)
+ {
+ TableColumnModelListener[] listeners = getColumnModelListeners();
+
+ for (int i=0; i< listeners.length; i++)
+ listeners[i].columnAdded(e);
}
- /**
- * fireColumnRemoved
- * @param value0 TODO
- */
- protected void fireColumnRemoved(TableColumnModelEvent value0)
+ /**
+ * fireColumnAdded fires TableColumnModelEvent to registered
+ * TableColumnModelListeners to indicate that column was removed
+ *
+ * @param e TableColumnModelEvent
+ */
+ protected void fireColumnRemoved(TableColumnModelEvent e)
{
- // TODO
+ TableColumnModelListener[] listeners = getColumnModelListeners();
+
+ for (int i=0; i< listeners.length; i++)
+ listeners[i].columnRemoved(e);
}
- /**
- * fireColumnMoved
- * @param value0 TODO
- */
- protected void fireColumnMoved(TableColumnModelEvent value0)
+ /**
+ * fireColumnAdded fires TableColumnModelEvent to registered
+ * TableColumnModelListeners to indicate that column was moved
+ *
+ * @param e TableColumnModelEvent
+ */
+ protected void fireColumnMoved(TableColumnModelEvent e)
{
- // TODO
+ TableColumnModelListener[] listeners = getColumnModelListeners();
+
+ for (int i=0; i< listeners.length; i++)
+ listeners[i].columnMoved(e);
}
/**
- * fireColumnSelectionChanged
- * @param value0 TODO
+ * fireColumnSelectionChanged fires TableColumnModelEvent to model's
+ * registered TableColumnModelListeners to indicate that different column
+ * was selected.
+ *
+ * @param evt ListSelectionEvent
*/
protected void fireColumnSelectionChanged(ListSelectionEvent evt)
{
@@ -352,54 +460,66 @@ public class DefaultTableColumnModel
((TableColumnModelListener)listeners[i]).columnSelectionChanged(evt);
}
- /**
- * fireColumnMarginChanged
- */
+ /**
+ * fireColumnMarginChanged fires TableColumnModelEvent to model's
+ * registered TableColumnModelListeners to indicate that column margin
+ * was changed.
+ */
protected void fireColumnMarginChanged()
{
- // TODO
+ EventListener [] listeners = getListeners(TableColumnModelListener.class);
+ for (int i = 0; i < listeners.length; ++i)
+ ((TableColumnModelListener)listeners[i]).columnMarginChanged(changeEvent);
}
- /**
- * getListeners
- * @param value0 TODO
- * @return EventListener[]
+ /**
+ * getListeners returns currently registered listeners with this model.
+ * @param listenerType type of listeners to return
+ *
+ * @return EventListener[] array of model's listeners of the specified type
*/
- public EventListener[] getListeners(Class klass)
+ public EventListener[] getListeners(Class listenerType)
{
- return listenerList.getListeners(klass);
+ return listenerList.getListeners(listenerType);
}
- /**
- * propertyChange
- * @param value0 TODO
- */
- public void propertyChange(PropertyChangeEvent value0)
+ /**
+ * propertyChange handles changes occuring in the properties of the
+ * model's columns.
+ *
+ * @param evt PropertyChangeEvent
+ */
+ public void propertyChange(PropertyChangeEvent evt)
{
- // TODO
+ if (evt.getPropertyName().equals(TableColumn.COLUMN_WIDTH_PROPERTY))
+ invalidateWidthCache();
}
- /**
- * valueChanged
- * @param value0 TODO
- */
- public void valueChanged(ListSelectionEvent value0)
+ /**
+ * valueChanged handles changes in the selectionModel.
+ * @param e ListSelectionEvent
+ */
+ public void valueChanged(ListSelectionEvent e)
{
- fireColumnSelectionChanged(value0);
+ fireColumnSelectionChanged(e);
}
- /**
- * createSelectionModel
- * @return ListSelectionModel
- */
+ /**
+ * createSelectionModel creates selection model that will keep track
+ * of currently selected column(s)
+ *
+ * @return ListSelectionModel selection model of the columns
+ */
protected ListSelectionModel createSelectionModel()
- {
- return null; // TODO
+ {
+ return new DefaultListSelectionModel();
}
- /**
- * recalcWidthCache
- */
+ /**
+ * recalcWidthCache calculates total width of the columns.
+ * If the current cache of the total width is in invalidated state,
+ * then width is recalculated. Otherwise nothing is done.
+ */
protected void recalcWidthCache()
{
if (totalColumnWidth == -1)
@@ -412,9 +532,9 @@ public class DefaultTableColumnModel
}
}
- /**
- * invalidateWidthCache
- */
+ /**
+ * invalidateWidthCache
+ */
private void invalidateWidthCache()
{
totalColumnWidth = -1;
diff --git a/libjava/javax/swing/table/DefaultTableModel.java b/libjava/javax/swing/table/DefaultTableModel.java
index dd8e3b84612..aab4202012e 100644
--- a/libjava/javax/swing/table/DefaultTableModel.java
+++ b/libjava/javax/swing/table/DefaultTableModel.java
@@ -1,5 +1,5 @@
/* DefaultTableModel.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,15 +44,19 @@ import java.util.Vector;
import javax.swing.event.TableModelEvent;
/**
- * DefaultTableModel
+ * A two dimensional data structure used to store <code>Object</code>
+ * instances, usually for display in a <code>JTable</code> component.
+ *
* @author Andrew Selkirk
*/
public class DefaultTableModel extends AbstractTableModel
implements Serializable
{
static final long serialVersionUID = 6680042567037222321L;
+
/**
- * dataVector
+ * Storage for the rows in the table (each row is itself
+ * a <code>Vector</code>).
*/
protected Vector dataVector;
@@ -62,7 +66,7 @@ public class DefaultTableModel extends AbstractTableModel
protected Vector columnIdentifiers;
/**
- * Constructor DefaultTableModel
+ * Creates an empty table with zero rows and zero columns.
*/
public DefaultTableModel()
{
@@ -70,9 +74,11 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * Constructor DefaultTableModel
- * @param value0 TODO
- * @param value1 TODO
+ * Creates a new table with the specified number of rows and columns.
+ * All cells in the table are initially empty (set to <code>null</code>).
+ *
+ * @param numRows the number of rows.
+ * @param numColumns the number of columns.
*/
public DefaultTableModel(int numRows, int numColumns)
{
@@ -81,20 +87,28 @@ public class DefaultTableModel extends AbstractTableModel
for (int i = 0; i < numColumns; i++)
{
defaultNames.add(super.getColumnName(i));
+ }
+ for (int r = 0; r < numRows; r++)
+ {
Vector tmp = new Vector(numColumns);
tmp.setSize(numColumns);
data.add(tmp);
- }
- setDataVector(defaultNames, data);
+ }
+ setDataVector(data, defaultNames);
}
/**
- * Constructor DefaultTableModel
- * @param value0 TODO
- * @param value1 TODO
+ * Creates a new table with the specified column names and number of
+ * rows. The number of columns is determined by the number of column
+ * names supplied.
+ *
+ * @param columnNames the column names.
+ * @param numRows the number of rows.
*/
public DefaultTableModel(Vector columnNames, int numRows)
{
+ if (numRows < 0)
+ throw new IllegalArgumentException("numRows < 0");
Vector data = new Vector();
int numColumns = 0;
@@ -111,9 +125,10 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * Constructor DefaultTableModel
- * @param value0 TODO
- * @param value1 TODO
+ * Creates a new table with the specified column names and row count.
+ *
+ * @param columnNames the column names.
+ * @param numRows the number of rows.
*/
public DefaultTableModel(Object[] columnNames, int numRows)
{
@@ -121,9 +136,10 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * Constructor DefaultTableModel
- * @param value0 TODO
- * @param value1 TODO
+ * Creates a new table with the specified data values and column names.
+ *
+ * @param data the data values.
+ * @param columnNames the column names.
*/
public DefaultTableModel(Vector data, Vector columnNames)
{
@@ -131,9 +147,10 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * Constructor DefaultTableModel
- * @param value0 TODO
- * @param value1 TODO
+ * Creates a new table with the specified data values and column names.
+ *
+ * @param data the data values.
+ * @param columnNames the column names.
*/
public DefaultTableModel(Object[][] data, Object[] columnNames)
{
@@ -141,8 +158,9 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * getDataVector
- * @returns Vector
+ * Returns the vector containing the row data for the table.
+ *
+ * @returns The data vector.
*/
public Vector getDataVector()
{
@@ -150,9 +168,16 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * setDataVector
- * @param value0 TODO
- * @param value1 TODO
+ * Sets the data and column identifiers for the table. The data vector
+ * contains a <code>Vector</code> for each row in the table - if the
+ * number of objects in each row does not match the number of column
+ * names specified, the row data is truncated or expanded (by adding
+ * <code>null</code> values) as required.
+ *
+ * @param data the data for the table (a vector of row vectors).
+ * @param columnNames the column names.
+ *
+ * @throws NullPointerException if either argument is <code>null</code>.
*/
public void setDataVector(Vector data, Vector columnNames)
{
@@ -164,9 +189,12 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * setDataVector
- * @param value0 TODO
- * @param value1 TODO
+ * Sets the data and column identifiers for the table.
+ *
+ * @param data the data for the table.
+ * @param columnNames the column names.
+ *
+ * @throws NullPointerException if either argument is <code>null</code>.
*/
public void setDataVector(Object[][] data, Object[] columnNames)
{
@@ -175,8 +203,11 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * newDataAvailable
- * @param value0 TODO
+ * Sends the specified <code>event</code> to all registered listeners.
+ * This method is equivalent to
+ * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}.
+ *
+ * @param event the event.
*/
public void newDataAvailable(TableModelEvent event)
{
@@ -184,8 +215,11 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * newRowsAdded
- * @param value0 TODO
+ * Sends the specified <code>event</code> to all registered listeners.
+ * This method is equivalent to
+ * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}.
+ *
+ * @param event the event.
*/
public void newRowsAdded(TableModelEvent event)
{
@@ -193,8 +227,11 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * rowsRemoved
- * @param value0 TODO
+ * Sends the specified <code>event</code> to all registered listeners.
+ * This method is equivalent to
+ * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}.
+ *
+ * @param event the event.
*/
public void rowsRemoved(TableModelEvent event)
{
@@ -202,18 +239,26 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * setColumnIdentifiers
- * @param value0 TODO
+ * Sets the column identifiers, updates the data rows (truncating
+ * or padding each row with <code>null</code> values) to match the
+ * number of columns, and sends a {@link TableModelEvent} to all
+ * registered listeners.
+ *
+ * @param columnIdentifiers the column identifiers.
*/
public void setColumnIdentifiers(Vector columnIdentifiers)
{
this.columnIdentifiers = columnIdentifiers;
- setColumnCount(columnIdentifiers.size());
+ setColumnCount((columnIdentifiers == null ? 0 : columnIdentifiers.size()));
}
/**
- * setColumnIdentifiers
- * @param value0 TODO
+ * Sets the column identifiers, updates the data rows (truncating
+ * or padding each row with <code>null</code> values) to match the
+ * number of columns, and sends a {@link TableModelEvent} to all
+ * registered listeners.
+ *
+ * @param columnIdentifiers the column identifiers.
*/
public void setColumnIdentifiers(Object[] columnIdentifiers)
{
@@ -221,8 +266,9 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * setNumRows
- * @param value0 TODO
+ * This method is obsolete, use {@link #setRowCount(int)} instead.
+ *
+ * @param numRows the number of rows.
*/
public void setNumRows(int numRows)
{
@@ -230,18 +276,40 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * setRowCount
- * @param value0 TODO
+ * Sets the number of rows in the table. If <code>rowCount</code> is less
+ * than the current number of rows in the table, rows are discarded.
+ * If <code>rowCount</code> is greater than the current number of rows in
+ * the table, new (empty) rows are added.
+ *
+ * @param the row count.
*/
public void setRowCount(int rowCount)
{
- dataVector.setSize(rowCount);
- fireTableDataChanged();
+ int existingRowCount = dataVector.size();
+ if (rowCount < existingRowCount)
+ {
+ dataVector.setSize(rowCount);
+ fireTableRowsDeleted(rowCount,existingRowCount-1);
+ }
+ else
+ {
+ int rowsToAdd = rowCount - existingRowCount;
+ for (int i = 0; i < rowsToAdd; i++)
+ {
+ Vector tmp = new Vector();
+ tmp.setSize(columnIdentifiers.size());
+ dataVector.add(tmp);
+ }
+ fireTableRowsInserted(existingRowCount,rowCount-1);
+ }
}
/**
- * setColumnCount
- * @param value0 TODO
+ * Sets the number of columns in the table. Existing rows are truncated
+ * or padded with <code>null</code> values to match the new column count.
+ * A {@link TableModelEvent} is sent to all registered listeners.
+ *
+ * @param columnCount the column count.
*/
public void setColumnCount(int columnCount)
{
@@ -249,13 +317,16 @@ public class DefaultTableModel extends AbstractTableModel
{
((Vector) dataVector.get(i)).setSize(columnCount);
}
- columnIdentifiers.setSize(columnCount);
+ if (columnIdentifiers != null)
+ columnIdentifiers.setSize(columnCount);
fireTableDataChanged();
}
/**
- * addColumn
- * @param value0 TODO
+ * Adds a column with the specified name to the table. All cell values
+ * for the column are initially set to <code>null</code>.
+ *
+ * @param columnName the column name (<code>null</code> permitted).
*/
public void addColumn(Object columnName)
{
@@ -263,21 +334,52 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * addColumn
- * @param value0 TODO
- * @param value1 TODO
+ * Adds a column with the specified name and data values to the table.
+ *
+ * @param columnName the column name (<code>null</code> permitted).
+ * @param columnData the column data.
*/
public void addColumn(Object columnName, Vector columnData)
{
- addColumn(columnName, columnData == null ? null : columnData.toArray());
+ Object[] dataArray = null;
+ if (columnData != null)
+ {
+ int rowCount = dataVector.size();
+ if (columnData.size() < rowCount)
+ columnData.setSize(rowCount);
+ dataArray = columnData.toArray();
+ }
+ addColumn(columnName, dataArray);
}
/**
- * addColumn
- * @param value0 TODO
- * @param value1 TODO
+ * Adds a column with the specified name and data values to the table.
+ *
+ * @param columnName the column name (<code>null</code> permitted).
+ * @param columnData the column data.
*/
public void addColumn(Object columnName, Object[] columnData) {
+ if (columnData != null)
+ {
+ // check columnData array for cases where the number of items
+ // doesn't match the number of rows in the existing table
+ if (columnData.length > dataVector.size())
+ {
+ int rowsToAdd = columnData.length - dataVector.size();
+ for (int i = 0; i < rowsToAdd; i++)
+ {
+ Vector tmp = new Vector();
+ tmp.setSize(columnIdentifiers.size());
+ dataVector.add(tmp);
+ }
+ }
+ else if (columnData.length < dataVector.size())
+ {
+ Object[] tmp = new Object[dataVector.size()];
+ System.arraycopy(columnData, 0, tmp, 0, columnData.length);
+ columnData = tmp;
+ }
+ }
for (int i = 0; i < dataVector.size(); ++i)
{
((Vector) dataVector.get(i)).add(columnData == null ? null : columnData[i]);
@@ -287,62 +389,79 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * addRow
- * @param value0 TODO
+ * Adds a new row containing the specified data to the table and sends a
+ * {@link TableModelEvent} to all registered listeners.
+ *
+ * @param rowData the row data (<code>null</code> permitted).
*/
public void addRow(Vector rowData) {
dataVector.add(rowData);
- fireTableDataChanged();
+ newRowsAdded(new TableModelEvent(
+ this, dataVector.size(), dataVector.size(), -1, TableModelEvent.INSERT)
+ );
}
/**
- * addRow
- * @param value0 TODO
+ * Adds a new row containing the specified data to the table and sends a
+ * {@link TableModelEvent} to all registered listeners.
+ *
+ * @param rowData the row data (<code>null</code> permitted).
*/
public void addRow(Object[] rowData) {
addRow(convertToVector(rowData));
}
/**
- * insertRow
- * @param value0 TODO
- * @param value1 TODO
+ * Inserts a new row into the table.
+ *
+ * @param row the row index.
+ * @param rowData the row data.
*/
public void insertRow(int row, Vector rowData) {
dataVector.add(row, rowData);
- fireTableDataChanged();
+ fireTableRowsInserted(row,row);
}
/**
- * insertRow
- * @param value0 TODO
- * @param value1 TODO
+ * Inserts a new row into the table.
+ *
+ * @param row the row index.
+ * @param rowData the row data.
*/
public void insertRow(int row, Object[] rowData) {
insertRow(row, convertToVector(rowData));
}
/**
- * moveRow
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
+ * Moves the rows from <code>startIndex</code> to <code>endIndex</code>
+ * (inclusive) to the specified row.
+ *
+ * @param startIndex the start row.
+ * @param endIndex the end row.
+ * @param toIndex the row to move to.
*/
public void moveRow(int startIndex, int endIndex, int toIndex) {
- for (int index = 0; index < (endIndex - startIndex); index++) {
- Vector vector = (Vector) dataVector.remove(startIndex);
- dataVector.add(toIndex, vector);
+ Vector removed = new Vector();
+ for (int i = endIndex; i >= startIndex; i--)
+ {
+ removed.add(this.dataVector.remove(i));
+ }
+ for (int i = 0; i <= endIndex - startIndex; i++)
+ {
+ dataVector.insertElementAt(removed.get(i), toIndex);
}
fireTableDataChanged();
}
/**
- * removeRow
- * @param value0 TODO
+ * Removes a row from the table and sends a {@link TableModelEvent} to
+ * all registered listeners.
+ *
+ * @param row the row index.
*/
public void removeRow(int row) {
dataVector.remove(row);
- fireTableDataChanged();
+ fireTableRowsDeleted(row,row);
}
/**
@@ -354,63 +473,86 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * getColumnCount
- * @returns int
+ * Returns the number of columns in the model.
+ *
+ * @return The column count.
*/
public int getColumnCount() {
- return columnIdentifiers.size();
+ return (columnIdentifiers == null ? 0 : columnIdentifiers.size());
}
/**
- * getColumnName
- * @param value0 TODO
- * @returns String
+ * Returns the name of the specified column.
+ *
+ * @param column the column index.
+ *
+ * @returns The column name.
*/
public String getColumnName(int column) {
- // Check for Column
- if (columnIdentifiers == null || column >= getColumnCount()) {
- return super.getColumnName(column);
+ String result = "";
+ if (columnIdentifiers == null)
+ result = super.getColumnName(column);
+ else
+ {
+ if (column < getColumnCount())
+ {
+ Object id = columnIdentifiers.get(column);
+ if (id != null)
+ result = id.toString();
+ else
+ result = super.getColumnName(column);
+ }
}
-
- // Return Column name
- return (String) columnIdentifiers.get(column);
+ return result;
}
/**
- * isCellEditable
- * @param value0 TODO
- * @param value1 TODO
- * @returns boolean
+ * Returns <code>true</code> if the specified cell can be modified, and
+ * <code>false</code> otherwise. For this implementation, the method
+ * always returns <code>true</code>.
+ *
+ * @param row the row index.
+ * @param column the column index.
+ *
+ * @returns <code>true</code> in all cases.
*/
public boolean isCellEditable(int row, int column) {
return true;
}
/**
- * getValueAt
- * @param value0 TODO
- * @param value1 TODO
- * @returns Object
+ * Returns the value at the specified cell in the table.
+ *
+ * @param row the row index.
+ * @param column the column index.
+ *
+ * @returns The value (<code>Object</code>, possibly <code>null</code>) at
+ * the specified cell in the table.
*/
public Object getValueAt(int row, int column) {
return ((Vector) dataVector.get(row)).get(column);
}
/**
- * setValueAt
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
+ * Sets the value for the specified cell in the table and sends a
+ * {@link TableModelEvent} to all registered listeners.
+ *
+ * @param value the value (<code>Object</code>, <code>null</code> permitted).
+ * @param row the row index.
+ * @param column the column index.
*/
public void setValueAt(Object value, int row, int column) {
((Vector) dataVector.get(row)).set(column, value);
- fireTableDataChanged();
+ fireTableCellUpdated(row,column);
}
/**
- * convertToVector
- * @param value0 TODO
- * @returns Vector
+ * Converts the data array to a <code>Vector</code>.
+ *
+ * @param data the data array (<code>null</code> permitted).
+ *
+ * @returns A vector (or <code>null</code> if the data array
+ * is <code>null</code>).
*/
protected static Vector convertToVector(Object[] data) {
if (data == null)
@@ -422,9 +564,12 @@ public class DefaultTableModel extends AbstractTableModel
}
/**
- * convertToVector
- * @param value0 TODO
- * @returns Vector
+ * Converts the data array to a <code>Vector</code> of rows.
+ *
+ * @param the data array (<code>null</code> permitted).
+ *
+ * @returns A vector (or <code>null</code> if the data array
+ * is <code>null</code>.
*/
protected static Vector convertToVector(Object[][] data) {
if (data == null)
diff --git a/libjava/javax/swing/table/JTableHeader.java b/libjava/javax/swing/table/JTableHeader.java
index 95ff92006cf..0f538ed2490 100644
--- a/libjava/javax/swing/table/JTableHeader.java
+++ b/libjava/javax/swing/table/JTableHeader.java
@@ -1,5 +1,5 @@
/* JTableHeader.java --
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -70,6 +70,11 @@ public class JTableHeader extends JComponent
protected class AccessibleJTableHeaderEntry extends AccessibleContext
implements Accessible, AccessibleComponent
{
+ public AccessibleJTableHeaderEntry(int c, JTableHeader p, JTable t)
+ {
+ throw new Error("not implemented");
+ }
+
public void addFocusListener(FocusListener l)
{
throw new Error("not implemented");
@@ -616,4 +621,11 @@ public class JTableHeader extends JComponent
setUI((TableHeaderUI) UIManager.getUI(this));
}
+ public int columnAtPoint(Point point)
+ {
+ if (getBounds().contains(point))
+ return columnModel.getColumnIndexAtX(point.x);
+
+ return -1;
+ }
}
diff --git a/libjava/javax/swing/table/TableColumn.java b/libjava/javax/swing/table/TableColumn.java
index 0aaad8b3f95..c2de7f0e1a7 100644
--- a/libjava/javax/swing/table/TableColumn.java
+++ b/libjava/javax/swing/table/TableColumn.java
@@ -141,81 +141,87 @@ public class TableColumn
private SwingPropertyChangeSupport changeSupport =
new SwingPropertyChangeSupport(this);
- /**
- * Constructor TableColumn
- */
+ /**
+ * Constructor TableColumn
+ */
public TableColumn()
{
- this(0, 75, null, null);
+ this(0, 75, null, null);
}
- /**
- * Constructor TableColumn
- * @param modelIndex TODO
- */
+ /**
+ * Constructor TableColumn
+ *
+ * @param modelIndex the index of the column in the model
+ */
public TableColumn(int modelIndex)
{
- this(modelIndex, 75, null, null);
+ this(modelIndex, 75, null, null);
}
- /**
- * Constructor TableColumn
- * @param modelIndex TODO
- * @param width TODO
- */
+ /**
+ * Constructor TableColumn
+ *
+ * @param modelIndex the index of the column in the model
+ * @param width the width
+ */
public TableColumn(int modelIndex, int width)
{
- this(modelIndex, width, null, null);
+ this(modelIndex, width, null, null);
}
- /**
- * Constructor TableColumn
- * @param modelIndex TODO
- * @param width TODO
- * @param cellRenderer TODO
- * @param cellEditor TODO
- */
- public TableColumn(int modelIndex, int width,
+ /**
+ * Constructor TableColumn
+ *
+ * @param modelIndex the index of the column in the model
+ * @param width the width
+ * @param cellRenderer the cell renderer
+ * @param cellEditor the cell editor
+ */
+ public TableColumn(int modelIndex, int width,
TableCellRenderer cellRenderer, TableCellEditor cellEditor)
{
- this.modelIndex = modelIndex;
- this.width = width;
- this.preferredWidth = width;
- this.cellRenderer = cellRenderer;
- this.cellEditor = cellEditor;
- this.headerValue = null;
- this.identifier = null;
- }
-
- /**
- * firePropertyChange
- * @param property TODO
- * @param oldValue TODO
- * @param newValue TODO
- */
+ this.modelIndex = modelIndex;
+ this.width = width;
+ this.preferredWidth = width;
+ this.cellRenderer = cellRenderer;
+ this.cellEditor = cellEditor;
+ this.headerValue = null;
+ this.identifier = null;
+ }
+
+ /**
+ * firePropertyChange
+ *
+ * @param property the name of the property
+ * @param oldValue the old value
+ * @param newValue the new value
+ */
private void firePropertyChange(String property, Object oldValue,
Object newValue)
{
- changeSupport.firePropertyChange(property, oldValue, newValue);
+ changeSupport.firePropertyChange(property, oldValue, newValue);
}
- /**
- * firePropertyChange
- * @param property TODO
- * @param oldValue TODO
- * @param newValue TODO
- */
+ /**
+ * firePropertyChange
+ *
+ * @param property the name of the property
+ * @param oldValue the old value
+ * @param newValue the new value
+ */
private void firePropertyChange(String property, int oldValue, int newValue)
{
- firePropertyChange(property, new Integer(oldValue), new Integer(newValue));
+ firePropertyChange(property, new Integer(oldValue), new Integer(newValue));
}
- /**
- * firePropertyChange
- * @param property TODO
- * @param oldValue TODO
- * @param newValue TODO
- */
+ /**
+ * firePropertyChange
+ *
+ * @param property the name of the property
+ * @param oldValue the old value
+ * @param newValue the new value
+ */
private void firePropertyChange(String property, boolean oldValue,
boolean newValue)
{
@@ -225,73 +231,75 @@ public class TableColumn
/**
* setModelIndex
- * @param modelIndex TODO
+ *
+ * @param modelIndex the index to set
*/
public void setModelIndex(int modelIndex)
{
- this.modelIndex = modelIndex;
+ this.modelIndex = modelIndex;
}
- /**
- * getModelIndex
- * @return int
- */
+ /**
+ * getModelIndex
+ *
+ * @return the model index
+ */
public int getModelIndex()
{
- return modelIndex;
+ return modelIndex;
}
- /**
- * setIdentifier
- * @param identifier TODO
- */
+ /**
+ * setIdentifier
+ *
+ * @param identifier the identifier
+ */
public void setIdentifier(Object identifier)
{
- this.identifier = identifier;
+ this.identifier = identifier;
}
- /**
- * getIdentifier
- * @return Object
- */
+ /**
+ * getIdentifier
+ *
+ * @return the identifier
+ */
public Object getIdentifier()
{
if (identifier == null)
- return getHeaderValue();
- return identifier;
+ return getHeaderValue();
+ return identifier;
}
- /**
- * setHeaderValue
- * @param headerValue TODO
- */
+ /**
+ * setHeaderValue
+ *
+ * @param headerValue the value of the header
+ */
public void setHeaderValue(Object headerValue)
{
- // Variables
- Object oldValue;
-
- // Get Old Value
- oldValue = this.headerValue;
-
- // Set Propeprty
- this.headerValue = headerValue;
-
- // Notify Listeners of change
+ if (this.headerValue == headerValue)
+ return;
+
+ Object oldValue = this.headerValue;
+ this.headerValue = headerValue;
firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, headerValue);
}
- /**
- * getHeaderValue
- * @return Object
- */
+ /**
+ * getHeaderValue
+ *
+ * @return the value of the header
+ */
public Object getHeaderValue()
{
- return headerValue;
+ return headerValue;
}
/**
* setHeaderRenderer
- * @param headerRenderer TODO
+ *
+ * @param headerRenderer the renderer to se
*/
public void setHeaderRenderer(TableCellRenderer renderer)
{
@@ -304,18 +312,19 @@ public class TableColumn
oldRenderer, headerRenderer);
}
- /**
- * getHeaderRenderer
+ /**
+ * getHeaderRenderer
* @return TableCellRenderer
- */
+ */
public TableCellRenderer getHeaderRenderer()
{
- return headerRenderer;
+ return headerRenderer;
}
/**
* setCellRenderer
- * @param cellRenderer TODO
+ *
+ * @param cellRenderer the cell renderer
*/
public void setCellRenderer(TableCellRenderer renderer)
{
@@ -328,36 +337,40 @@ public class TableColumn
oldRenderer, cellRenderer);
}
- /**
- * getCellRenderer
- * @return TableCellRenderer
- */
+ /**
+ * getCellRenderer
+ *
+ * @return the cell renderer
+ */
public TableCellRenderer getCellRenderer()
{
- return cellRenderer;
+ return cellRenderer;
}
- /**
- * setCellEditor
- * @param cellEditor TODO
- */
+ /**
+ * setCellEditor
+ *
+ * @param cellEditor the cell editor
+ */
public void setCellEditor(TableCellEditor cellEditor)
{
- this.cellEditor = cellEditor;
+ this.cellEditor = cellEditor;
}
- /**
- * getCellEditor
- * @return TableCellEditor
- */
+ /**
+ * getCellEditor
+ *
+ * @return the cell editor
+ */
public TableCellEditor getCellEditor()
{
- return cellEditor;
+ return cellEditor;
}
/**
* setWidth
- * @param newWidth TODO
+ *
+ * @param newWidth the width
*/
public void setWidth(int newWidth)
{
@@ -376,102 +389,112 @@ public class TableColumn
firePropertyChange(COLUMN_WIDTH_PROPERTY, oldWidth, width);
}
- /**
- * getWidth
+ /**
+ * getWidth
+ *
* @return int
- */
+ */
public int getWidth()
{
- return width;
+ return width;
}
- /**
- * setPreferredWidth
- * @param preferredWidth TODO
- */
+ /**
+ * setPreferredWidth
+ *
+ * @param preferredWidth the preferred width
+ */
public void setPreferredWidth(int preferredWidth)
{
if (preferredWidth < minWidth)
- this.preferredWidth = minWidth;
+ this.preferredWidth = minWidth;
else if (preferredWidth > maxWidth)
- this.preferredWidth = maxWidth;
+ this.preferredWidth = maxWidth;
else
- this.preferredWidth = preferredWidth;
+ this.preferredWidth = preferredWidth;
}
- /**
- * getPreferredWidth
- * @return int
- */
+ /**
+ * getPreferredWidth
+ *
+ * @return the preferred width
+ */
public int getPreferredWidth()
{
- return preferredWidth;
+ return preferredWidth;
}
- /**
- * setMinWidth
- * @param minWidth TODO
- */
+ /**
+ * setMinWidth
+ *
+ * @param minWidth the minium width
+ */
public void setMinWidth(int minWidth)
{
- this.minWidth = minWidth;
- setWidth(getWidth());
- setPreferredWidth(getPreferredWidth());
+ this.minWidth = minWidth;
+ setWidth(getWidth());
+ setPreferredWidth(getPreferredWidth());
}
- /**
- * getMinWidth
- * @return int
- */
+ /**
+ * getMinWidth
+ *
+ * @return the minimum width
+ */
public int getMinWidth()
{
- return minWidth;
+ return minWidth;
}
- /**
- * setMaxWidth
- * @param maxWidth TODO
- */
+ /**
+ * setMaxWidth
+ *
+ * @param maxWidth the maximum width
+ */
public void setMaxWidth(int maxWidth)
{
- this.maxWidth = maxWidth;
- setWidth(getWidth());
- setPreferredWidth(getPreferredWidth());
+ this.maxWidth = maxWidth;
+ setWidth(getWidth());
+ setPreferredWidth(getPreferredWidth());
}
- /**
- * getMaxWidth
- * @return int
- */
+ /**
+ * getMaxWidth
+ * @return the maximim width
+ */
public int getMaxWidth()
{
- return maxWidth;
+ return maxWidth;
}
- /**
- * setResizable
- * @param isResizable TODO
- */
+ /**
+ * setResizable
+ *
+ * @param isResizable <code>true</code> if this column is resizable,
+ * <code>false</code> otherwise
+ */
public void setResizable(boolean isResizable)
{
- this.isResizable = isResizable;
+ this.isResizable = isResizable;
}
- /**
- * getResizable
- * @return boolean
- */
+ /**
+ * getResizable
+ *
+ * @return <code>true</code> if this column is resizable,
+ * <code>false</code> otherwise
+ */
public boolean getResizable()
{
- return isResizable;
+ return isResizable;
}
- /**
- * sizeWidthToFit
- */
+ /**
+ * sizeWidthToFit
+ */
public void sizeWidthToFit()
{
- // TODO
+ // TODO
}
/**
@@ -481,7 +504,7 @@ public class TableColumn
*/
public void disableResizedPosting()
{
- // Does nothing
+ // Does nothing
}
/**
@@ -491,25 +514,25 @@ public class TableColumn
*/
public void enableResizedPosting()
{
- // Does nothing
+ // Does nothing
}
- /**
- * addPropertyChangeListener
+ /**
+ * addPropertyChangeListener
* @param listener the listener to all
- */
+ */
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
{
- changeSupport.addPropertyChangeListener(listener);
+ changeSupport.addPropertyChangeListener(listener);
}
- /**
- * removePropertyChangeListener
+ /**
+ * removePropertyChangeListener
* @param listener the listener to remove
- */
+ */
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
{
- changeSupport.removePropertyChangeListener(listener);
+ changeSupport.removePropertyChangeListener(listener);
}
/**
@@ -523,9 +546,9 @@ public class TableColumn
/**
* createDefaultHeaderRenderer
* @return TableCellRenderer
- */
+ */
protected TableCellRenderer createDefaultHeaderRenderer()
{
- return new DefaultTableCellRenderer();
+ return new DefaultTableCellRenderer();
}
}
diff --git a/libjava/javax/swing/table/TableColumnModel.java b/libjava/javax/swing/table/TableColumnModel.java
index b825ca0606c..1c036d8a11e 100644
--- a/libjava/javax/swing/table/TableColumnModel.java
+++ b/libjava/javax/swing/table/TableColumnModel.java
@@ -49,118 +49,118 @@ import javax.swing.event.TableColumnModelListener;
*/
public interface TableColumnModel
{
- /**
- * addColumn
- * @param column TableColumn
- */
- void addColumn(TableColumn column);
-
- /**
- * removeColumn
- * @param column TableColumn
- */
- void removeColumn(TableColumn column);
-
- /**
- * moveColumn
- * @param columnIndex Index of column to move
- * @param newIndex New index of column
- */
- void moveColumn(int columnIndex, int newIndex);
-
- /**
- * setColumnMargin
- * @param margin Margin of column
- */
- void setColumnMargin(int margin);
-
- /**
- * getColumnCount
+ /**
+ * addColumn
+ * @param column TableColumn
+ */
+ void addColumn(TableColumn column);
+
+ /**
+ * removeColumn
+ * @param column TableColumn
+ */
+ void removeColumn(TableColumn column);
+
+ /**
+ * moveColumn
+ * @param columnIndex Index of column to move
+ * @param newIndex New index of column
+ */
+ void moveColumn(int columnIndex, int newIndex);
+
+ /**
+ * setColumnMargin
+ * @param margin Margin of column
+ */
+ void setColumnMargin(int margin);
+
+ /**
+ * getColumnCount
* @return Column count
- */
- int getColumnCount();
+ */
+ int getColumnCount();
- /**
- * getColumns
+ /**
+ * getColumns
* @return Enumeration of columns
- */
- Enumeration getColumns();
-
- /**
- * getColumnIndex
- * @param columnIdentifier Column id
- */
- int getColumnIndex(Object columnIdentifier);
-
- /**
- * getColumn
- * @param columnIndex Index of column
- */
- TableColumn getColumn(int columnIndex);
-
- /**
- * getColumnMargin
+ */
+ Enumeration getColumns();
+
+ /**
+ * getColumnIndex
+ * @param columnIdentifier Column id
+ */
+ int getColumnIndex(Object columnIdentifier);
+
+ /**
+ * getColumn
+ * @param columnIndex Index of column
+ */
+ TableColumn getColumn(int columnIndex);
+
+ /**
+ * getColumnMargin
* @return Column margin
- */
- int getColumnMargin();
+ */
+ int getColumnMargin();
- /**
- * getColumnIndexAtX
+ /**
+ * getColumnIndexAtX
* @return Column index as position x
- */
- int getColumnIndexAtX(int xPosition);
+ */
+ int getColumnIndexAtX(int xPosition);
- /**
- * getTotalColumnWidth
+ /**
+ * getTotalColumnWidth
* @return Total column width
- */
- int getTotalColumnWidth();
+ */
+ int getTotalColumnWidth();
- /**
- * setColumnSelectionAllowed
- * @param value Set column selection
- */
- void setColumnSelectionAllowed(boolean value);
+ /**
+ * setColumnSelectionAllowed
+ * @param value Set column selection
+ */
+ void setColumnSelectionAllowed(boolean value);
- /**
- * getColumnSelectionAllowed
+ /**
+ * getColumnSelectionAllowed
* @return true if column selection allowed, false otherwise
- */
- boolean getColumnSelectionAllowed();
+ */
+ boolean getColumnSelectionAllowed();
- /**
- * getSelectedColumns
+ /**
+ * getSelectedColumns
* @return Selected columns
- */
- int[] getSelectedColumns();
+ */
+ int[] getSelectedColumns();
- /**
- * getSelectedColumnCount
+ /**
+ * getSelectedColumnCount
* @return Count of selected columns
- */
- int getSelectedColumnCount();
-
- /**
- * setSelectionModel
- * @param model ListSelectionModel
- */
- void setSelectionModel(ListSelectionModel model);
-
- /**
- * getSelectionModel
- * @param column TableColumn
- */
- ListSelectionModel getSelectionModel();
-
- /**
- * addColumnModelListener
- * @param listener TableColumnModelListener
- */
- void addColumnModelListener(TableColumnModelListener listener);
-
- /**
- * removeColumnModelListener
- * @param listener TableColumnModelListener
- */
- void removeColumnModelListener(TableColumnModelListener listener);
+ */
+ int getSelectedColumnCount();
+
+ /**
+ * setSelectionModel
+ * @param model ListSelectionModel
+ */
+ void setSelectionModel(ListSelectionModel model);
+
+ /**
+ * getSelectionModel
+ * @param column TableColumn
+ */
+ ListSelectionModel getSelectionModel();
+
+ /**
+ * addColumnModelListener
+ * @param listener TableColumnModelListener
+ */
+ void addColumnModelListener(TableColumnModelListener listener);
+
+ /**
+ * removeColumnModelListener
+ * @param listener TableColumnModelListener
+ */
+ void removeColumnModelListener(TableColumnModelListener listener);
}
diff --git a/libjava/javax/swing/table/TableModel.java b/libjava/javax/swing/table/TableModel.java
index a4732d061b9..591ce4342a0 100644
--- a/libjava/javax/swing/table/TableModel.java
+++ b/libjava/javax/swing/table/TableModel.java
@@ -1,5 +1,5 @@
/* TableModel.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,72 +39,96 @@ package javax.swing.table;
import javax.swing.event.TableModelListener;
-
/**
- * TableModel public interface
+ * A <code>TableModel</code> is a two dimensional data structure that
+ * can store arbitrary <code>Object</code> instances, usually for the
+ * purpose of display in a {@link JTable} component. Individual objects
+ * can be accessed by specifying the row index and column index for
+ * the object. Each column in the model has a name associated with it.
+ * <p>
+ * The {@link DefaultTableModel} class provides one implementation of
+ * this interface.
+ *
* @author Andrew Selkirk
*/
public interface TableModel
{
- /**
- * getRowCount
- * @return row count
- */
- int getRowCount();
-
- /**
- * getColumnCount
- * @return column count
- */
- int getColumnCount();
-
- /**
- * getColumnName
- * @param columnIndex Column index
- * @return Column name
- */
- String getColumnName(int columnIndex);
-
- /**
- * getColumnClass
- * @param columnIndex Column index
- * @return Column class
- */
- Class getColumnClass(int columnIndex);
-
- /**
- * isCellEditable
- * @param rowIndex Row index
- * @param columnIndex Column index
- * @return true if editable, false otherwise
- */
- boolean isCellEditable(int rowIndex, int columnIndex);
-
- /**
- * getValueAt
- * @param rowIndex Row index
- * @param columnIndex Column index
- * @return Value at specified indices
- */
- Object getValueAt(int rowIndex, int columnIndex);
-
- /**
- * setValueAt
- * @param aValue Value to set
- * @param rowIndex Row index
- * @param columnIndex Column index
- */
- void setValueAt(Object aValue, int rowIndex, int columnIndex);
-
- /**
- * addTableModelListener
- * @param listener TableModelListener
- */
- void addTableModelListener(TableModelListener listener);
-
- /**
- * removeTableModelListener
- * @param listener TableModelListener
- */
- void removeTableModelListener(TableModelListener listener);
+ /**
+ * Returns the number of rows in the model.
+ *
+ * @return The row count.
+ */
+ int getRowCount();
+
+ /**
+ * Returns the number of columns in the model.
+ *
+ * @return The column count
+ */
+ int getColumnCount();
+
+ /**
+ * Returns the name of a column in the model.
+ *
+ * @param columnIndex the column index.
+ *
+ * @return The column name.
+ */
+ String getColumnName(int columnIndex);
+
+ /**
+ * Returns the <code>Class</code> for all <code>Object</code> instances
+ * in the specified column.
+ *
+ * @param columnIndex the column index.
+ *
+ * @return The class.
+ */
+ Class getColumnClass(int columnIndex);
+
+ /**
+ * Returns <code>true</code> if the cell is editable, and <code>false</code>
+ * otherwise.
+ *
+ * @param rowIndex the row index.
+ * @param columnIndex the column index.
+ *
+ * @return <code>true</code> if editable, <code>false</code> otherwise.
+ */
+ boolean isCellEditable(int rowIndex, int columnIndex);
+
+ /**
+ * Returns the value (<code>Object</code>) at a particular cell in the
+ * table.
+ *
+ * @param rowIndex the row index.
+ * @param columnIndex the column index.
+ *
+ * @return The value at the specified cell.
+ */
+ Object getValueAt(int rowIndex, int columnIndex);
+
+ /**
+ * Sets the value at a particular cell in the table.
+ *
+ * @param aValue the value (<code>null</code> permitted).
+ * @param rowIndex the row index.
+ * @param columnIndex the column index.
+ */
+ void setValueAt(Object aValue, int rowIndex, int columnIndex);
+
+ /**
+ * Adds a listener to the model. The listener will receive notification
+ * of updates to the model.
+ *
+ * @param listener the listener.
+ */
+ void addTableModelListener(TableModelListener listener);
+
+ /**
+ * Removes a listener from the model.
+ *
+ * @param listener the listener.
+ */
+ void removeTableModelListener(TableModelListener listener);
}
diff --git a/libjava/javax/swing/text/AbstractDocument.java b/libjava/javax/swing/text/AbstractDocument.java
index f579fbb213b..a2c3fa65701 100644
--- a/libjava/javax/swing/text/AbstractDocument.java
+++ b/libjava/javax/swing/text/AbstractDocument.java
@@ -1,5 +1,5 @@
/* AbstractDocument.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,8 +38,8 @@ exception statement from your version. */
package javax.swing.text;
+import java.io.PrintStream;
import java.io.Serializable;
-import java.util.Collections;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.EventListener;
@@ -59,7 +59,9 @@ public abstract class AbstractDocument
implements Document, Serializable
{
private static final long serialVersionUID = -116069779446114664L;
+
protected static final String BAD_LOCATION = "document location failure";
+
public static final String BidiElementName = "bidi level";
public static final String ContentElementName = "content";
public static final String ParagraphElementName = "paragraph";
@@ -68,6 +70,8 @@ public abstract class AbstractDocument
Content content;
AttributeContext context;
+ DocumentFilter documentFilter;
+
protected EventListenerList listenerList = new EventListenerList();
protected AbstractDocument(Content doc)
@@ -139,7 +143,7 @@ public abstract class AbstractDocument
protected void fireUndoableEditUpdate(UndoableEditEvent event)
{
UndoableEditListener[] listeners = getUndoableEditListeners();
-
+
for (int index = 0; index < listeners.length; ++index)
listeners[index].undoableEditHappened(event);
}
@@ -187,7 +191,7 @@ public abstract class AbstractDocument
public int getLength()
{
- return content.length();
+ return content.length() - 1;
}
public EventListener[] getListeners(Class listenerType)
@@ -219,9 +223,9 @@ public abstract class AbstractDocument
}
public String getText(int offset, int length) throws BadLocationException
- {
- return content.getString(offset, length);
- }
+ {
+ return content.getString(offset, length);
+ }
public void getText(int offset, int length, Segment segment)
throws BadLocationException
@@ -372,6 +376,27 @@ public abstract class AbstractDocument
{
}
+ /**
+ * @since 1.4
+ */
+ public DocumentFilter getDocumentFilter()
+ {
+ return documentFilter;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public void setDocumentFilter(DocumentFilter filter)
+ {
+ this.documentFilter = filter;
+ }
+
+ public void dump(PrintStream out)
+ {
+ ((AbstractElement) getDefaultRootElement()).dump(out, 0);
+ }
+
public interface AttributeContext
{
AttributeSet addAttribute(AttributeSet old, Object name, Object value);
@@ -415,7 +440,6 @@ public abstract class AbstractDocument
AttributeSet attributes;
Element element_parent;
- Vector element_children;
TreeNode tree_parent;
Vector tree_children;
@@ -428,15 +452,9 @@ public abstract class AbstractDocument
// TreeNode implementation
- public Enumeration children()
- {
- return Collections.enumeration(tree_children);
- }
+ public abstract Enumeration children();
- public boolean getAllowsChildren()
- {
- return true;
- }
+ public abstract boolean getAllowsChildren();
public TreeNode getChildAt(int index)
{
@@ -553,10 +571,7 @@ public abstract class AbstractDocument
return AbstractDocument.this;
}
- public Element getElement(int index)
- {
- return (Element) element_children.get(index);
- }
+ public abstract Element getElement(int index);
public String getName()
{
@@ -575,13 +590,49 @@ public abstract class AbstractDocument
public abstract int getElementIndex(int offset);
public abstract int getStartOffset();
+
+ private void dumpElement(PrintStream stream, String indent, Element element)
+ {
+ System.out.println(indent + "<" + element.getName() +">");
+
+ if (element.isLeaf())
+ {
+ int start = element.getStartOffset();
+ int end = element.getEndOffset();
+ String text = "";
+ try
+ {
+ text = getContent().getString(start, end - start);
+ }
+ catch (BadLocationException e)
+ {
+ }
+ System.out.println(indent + " ["
+ + start + ","
+ + end + "]["
+ + text + "]");
+ }
+ else
+ {
+ for (int i = 0; i < element.getElementCount(); ++i)
+ dumpElement(stream, indent + " ", element.getElement(i));
+ }
+ }
+
+ public void dump(PrintStream stream, int indent)
+ {
+ String indentStr = "";
+ for (int i = 0; i < indent; ++i)
+ indentStr += " ";
+ dumpElement(stream, indentStr, this);
+ }
}
public class BranchElement extends AbstractElement
{
private static final long serialVersionUID = -8595176318868717313L;
- private Vector children = new Vector();
+ private Element[] children = new Element[0];
public BranchElement(Element parent, AttributeSet attributes)
{
@@ -590,7 +641,15 @@ public abstract class AbstractDocument
public Enumeration children()
{
- return children.elements();
+ if (children.length == 0)
+ return null;
+
+ Vector tmp = new Vector();
+
+ for (int index = 0; index < children.length; ++index)
+ tmp.add(children[index]);
+
+ return tmp.elements();
}
public boolean getAllowsChildren()
@@ -600,43 +659,46 @@ public abstract class AbstractDocument
public Element getElement(int index)
{
- if (index < 0 || index >= children.size())
+ if (index < 0 || index >= children.length)
return null;
- return (Element) children.get(index);
+ return children[index];
}
public int getElementCount()
{
- return children.size();
+ return children.length;
}
public int getElementIndex(int offset)
{
- if (children.size() == 0)
- return 0;
-
- Element element = positionToElement(offset);
+ // XXX: There is surely a better algorithm
+ // as beginning from first element each time.
+ for (int index = 0; index < children.length; ++index)
+ {
+ Element elem = children[index];
- if (element == null)
- return 0;
-
- return children.indexOf(element);
+ if ((elem.getStartOffset() <= offset)
+ && (offset < elem.getEndOffset()))
+ return index;
+ }
+
+ return 0;
}
public int getEndOffset()
{
- return ((Element) children.lastElement()).getEndOffset();
+ return children[children.length - 1].getEndOffset();
}
public String getName()
{
- return "AbstractDocument.BranchElement";
+ return ParagraphElementName;
}
public int getStartOffset()
{
- return ((Element) children.firstElement()).getStartOffset();
+ return children[0].getStartOffset();
}
public boolean isLeaf()
@@ -648,9 +710,9 @@ public abstract class AbstractDocument
{
// XXX: There is surely a better algorithm
// as beginning from first element each time.
- for (int index = 0; index < children.size(); ++index)
+ for (int index = 0; index < children.length; ++index)
{
- Element elem = (Element) children.get(index);
+ Element elem = children[index];
if ((elem.getStartOffset() <= position)
&& (position < elem.getEndOffset()))
@@ -660,18 +722,22 @@ public abstract class AbstractDocument
return null;
}
- public void replace(int offset, int length, Element[] elems)
+ public void replace(int offset, int length, Element[] elements)
{
- for (int index = 0; index < length; ++index)
- children.removeElementAt(offset);
-
- for (int index = 0; index < elems.length; ++index)
- children.add(offset + index, elems[index]);
+ Element[] target = new Element[children.length - length
+ + elements.length];
+ System.arraycopy(children, 0, target, 0, offset);
+ System.arraycopy(elements, 0, target, offset, elements.length);
+ System.arraycopy(children, offset + length, target,
+ offset + elements.length,
+ children.length - offset - length);
+ children = target;
}
public String toString()
{
- return getName() + ": " + "content";
+ return ("BranchElement(" + getName() + ") "
+ + getStartOffset() + "," + getEndOffset() + "\n");
}
}
@@ -782,7 +848,7 @@ public abstract class AbstractDocument
return false;
}
- public Element getElement()
+ public Element getElement(int index)
{
return null;
}
@@ -804,7 +870,7 @@ public abstract class AbstractDocument
public String getName()
{
- return "AbstractDocument.LeafElement";
+ return ContentElementName;
}
public int getStartOffset()
@@ -819,7 +885,8 @@ public abstract class AbstractDocument
public String toString()
{
- return getName() + ": " + "content";
+ return ("LeafElement(" + getName() + ") "
+ + getStartOffset() + "," + getEndOffset() + "\n");
}
}
}
diff --git a/libjava/javax/swing/text/DefaultEditorKit.java b/libjava/javax/swing/text/DefaultEditorKit.java
index 0e3be209688..ecec70731ce 100644
--- a/libjava/javax/swing/text/DefaultEditorKit.java
+++ b/libjava/javax/swing/text/DefaultEditorKit.java
@@ -1,5 +1,5 @@
-/* DefaultEditorKit.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+/* DefaultEditorKit.java --
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,14 +40,16 @@ package javax.swing.text;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
+import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import javax.swing.Action;
-import javax.swing.JEditorPane;
public class DefaultEditorKit extends EditorKit
{
@@ -84,6 +86,7 @@ public class DefaultEditorKit extends EditorKit
{
super(cutAction);
}
+
public void actionPerformed(ActionEvent event)
{
}
@@ -96,6 +99,7 @@ public class DefaultEditorKit extends EditorKit
{
super(defaultKeyTypedAction);
}
+
public void actionPerformed(ActionEvent event)
{
JTextComponent t = getTextComponent(event);
@@ -123,6 +127,7 @@ public class DefaultEditorKit extends EditorKit
{
super(insertBreakAction);
}
+
public void actionPerformed(ActionEvent event)
{
}
@@ -147,6 +152,7 @@ public class DefaultEditorKit extends EditorKit
{
super(insertTabAction);
}
+
public void actionPerformed(ActionEvent event)
{
}
@@ -159,6 +165,7 @@ public class DefaultEditorKit extends EditorKit
{
super(pasteAction);
}
+
public void actionPerformed(ActionEvent event)
{
}
@@ -328,17 +335,6 @@ public class DefaultEditorKit extends EditorKit
},
};
- /**
- * Called when the kit is being removed from the JEditorPane.
- */
- public void deinstall(JEditorPane c)
- {
- }
-
- public void install(JEditorPane c)
- {
- }
-
public Caret createCaret()
{
return new DefaultCaret();
@@ -355,32 +351,47 @@ public class DefaultEditorKit extends EditorKit
}
public String getContentType()
- {
- return "text/plain";
- }
-
+ {
+ return "text/plain";
+ }
+
public ViewFactory getViewFactory()
- {
- return null;
- }
+ {
+ return null;
+ }
- public void read(InputStream in, Document doc, int pos)
+ public void read(InputStream in, Document document, int offset)
throws BadLocationException, IOException
- {
- }
+ {
+ read(new InputStreamReader(in), document, offset);
+ }
- public void read(Reader in, Document doc, int pos)
+ public void read(Reader in, Document document, int offset)
throws BadLocationException, IOException
- {
- }
+ {
+ BufferedReader reader = new BufferedReader(in);
+
+ String line;
+ StringBuffer content = new StringBuffer();
- public void write(OutputStream out, Document doc, int pos, int len)
+ while ((line = reader.readLine()) != null)
+ {
+ content.append(line);
+ content.append("\n");
+ }
+
+ document.insertString(offset, content.toString(),
+ SimpleAttributeSet.EMPTY);
+ }
+
+ public void write(OutputStream out, Document document, int offset, int len)
throws BadLocationException, IOException
- {
- }
+ {
+ write(new OutputStreamWriter(out), document, offset, len);
+ }
- public void write(Writer out, Document doc, int pos, int len)
+ public void write(Writer out, Document document, int offset, int len)
throws BadLocationException, IOException
- {
- }
+ {
+ }
}
diff --git a/libjava/javax/swing/text/EditorKit.java b/libjava/javax/swing/text/EditorKit.java
index efca9657e26..5d89a11ba7f 100644
--- a/libjava/javax/swing/text/EditorKit.java
+++ b/libjava/javax/swing/text/EditorKit.java
@@ -1,4 +1,4 @@
-/* EditorKit.java --
+/* EditorKit.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,31 +54,31 @@ public abstract class EditorKit
private static final long serialVersionUID = -5044124649345887822L;
public EditorKit()
- {
- }
+ {
+ }
public Object clone()
- {
+ {
try
{
return super.clone();
- }
+ }
catch (CloneNotSupportedException e)
- {
+ {
return null;
- }
+ }
}
/**
* Called when the kit is being removed from the JEditorPane.
*/
public void deinstall(JEditorPane c)
- {
- }
+ {
+ }
public void install(JEditorPane c)
{
-}
+ }
public abstract Caret createCaret();
public abstract Document createDefaultDocument();
diff --git a/libjava/javax/swing/text/GapContent.java b/libjava/javax/swing/text/GapContent.java
index 5826128724f..44a8dcb5864 100644
--- a/libjava/javax/swing/text/GapContent.java
+++ b/libjava/javax/swing/text/GapContent.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.text;
import java.io.Serializable;
@@ -57,6 +58,7 @@ public class GapContent
public GapContent(int size)
{
+ buf.append("\n");
}
public Position createPosition(final int offset) throws BadLocationException
diff --git a/libjava/javax/swing/text/JTextComponent.java b/libjava/javax/swing/text/JTextComponent.java
index 0bca84b0fcf..2a05e95306b 100644
--- a/libjava/javax/swing/text/JTextComponent.java
+++ b/libjava/javax/swing/text/JTextComponent.java
@@ -1,5 +1,5 @@
/* JTextComponent.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,8 +44,15 @@ import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.ActionEvent;
import java.awt.event.InputMethodListener;
import java.awt.event.KeyEvent;
+import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -61,6 +68,7 @@ import javax.swing.JComponent;
import javax.swing.JViewport;
import javax.swing.KeyStroke;
import javax.swing.Scrollable;
+import javax.swing.TransferHandler;
import javax.swing.UIManager;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
@@ -294,7 +302,7 @@ public abstract class JTextComponent extends JComponent
* report</a>, a pair of private classes wraps a {@link
* javax.swing.text.Keymap} in the new {@link InputMap} / {@link
* ActionMap} interfaces, such that old Keymap-using code can make use of
- * the new framework.</p>
+ * the new framework.
*
* <p>A little bit of experimentation with these classes reveals the following
* structure:
@@ -546,7 +554,92 @@ public abstract class JTextComponent extends JComponent
{
parent = p;
}
+ }
+
+ class DefaultTransferHandler
+ extends TransferHandler
+ {
+ public boolean canImport(JComponent component, DataFlavor[] flavors)
+ {
+ JTextComponent textComponent = (JTextComponent) component;
+
+ if (! (textComponent.isEnabled()
+ && textComponent.isEditable()
+ && flavors != null))
+ return false;
+
+ for (int i = 0; i < flavors.length; ++i)
+ if (flavors[i].equals(DataFlavor.stringFlavor))
+ return true;
+
+ return false;
+ }
+
+ public void exportToClipboard(JComponent component, Clipboard clipboard,
+ int action)
+ {
+ JTextComponent textComponent = (JTextComponent) component;
+ int start = textComponent.getSelectionStart();
+ int end = textComponent.getSelectionEnd();
+ if (start == end)
+ return;
+
+ try
+ {
+ // Copy text to clipboard.
+ String data = textComponent.getDocument().getText(start, end);
+ StringSelection selection = new StringSelection(data);
+ clipboard.setContents(selection, null);
+
+ // Delete selected text on cut action.
+ if (action == MOVE)
+ doc.remove(start, end - start);
+ }
+ catch (BadLocationException e)
+ {
+ // Ignore this and do nothing.
+ }
+ }
+
+ public int getSourceActions()
+ {
+ return NONE;
+ }
+
+ public boolean importData(JComponent component, Transferable transferable)
+ {
+ DataFlavor flavor = null;
+ DataFlavor[] flavors = transferable.getTransferDataFlavors();
+
+ if (flavors == null)
+ return false;
+
+ for (int i = 0; i < flavors.length; ++i)
+ if (flavors[i].equals(DataFlavor.stringFlavor))
+ flavor = flavors[i];
+
+ if (flavor == null)
+ return false;
+
+ try
+ {
+ JTextComponent textComponent = (JTextComponent) component;
+ String data = (String) transferable.getTransferData(flavor);
+ textComponent.replaceSelection(data);
+ return true;
+ }
+ catch (IOException e)
+ {
+ // Ignored.
+ }
+ catch (UnsupportedFlavorException e)
+ {
+ // Ignored.
+ }
+
+ return false;
+ }
}
private static final long serialVersionUID = -8796518220218978795L;
@@ -554,8 +647,11 @@ public abstract class JTextComponent extends JComponent
public static final String DEFAULT_KEYMAP = "default";
public static final String FOCUS_ACCELERATOR_KEY = "focusAcceleratorKey";
+ private static DefaultTransferHandler defaultTransferHandler;
private static Hashtable keymaps = new Hashtable();
private Keymap keymap;
+ private char focusAccelerator = '\0';
+ private NavigationFilter navigationFilter;
/**
* Get a Keymap from the global keymap table, by name.
@@ -747,7 +843,7 @@ public abstract class JTextComponent extends JComponent
* <code>b</code>, if there exists a provided action <code>a</code> such
* that <code>a.getValue(Action.NAME) == b.ActionName</code> then an
* entry is added to the Keymap mapping <code>b</code> to
- * </code>a</code>.
+ * <code>a</code>.
*
* @param map The Keymap to add new mappings to
* @param bindings The set of bindings to add to the Keymap
@@ -847,7 +943,7 @@ public abstract class JTextComponent extends JComponent
}
/**
- * Get the <code>AccessibleContext<code> of this object.
+ * Get the <code>AccessibleContext</code> of this object.
*
* @return an <code>AccessibleContext</code> object
*/
@@ -875,6 +971,7 @@ public abstract class JTextComponent extends JComponent
}
catch (BadLocationException e)
{
+ // This can never happen.
}
}
@@ -1369,4 +1466,67 @@ public abstract class JTextComponent extends JComponent
{
dragEnabled = enabled;
}
+
+ public void copy()
+ {
+ doTransferAction("copy", TransferHandler.getCopyAction());
+ }
+
+ public void cut()
+ {
+ doTransferAction("cut", TransferHandler.getCutAction());
+ }
+
+ public void paste()
+ {
+ doTransferAction("paste", TransferHandler.getPasteAction());
+ }
+
+ private void doTransferAction(String name, Action action)
+ {
+ // Install default TransferHandler if none set.
+ if (getTransferHandler() == null)
+ {
+ if (defaultTransferHandler == null)
+ defaultTransferHandler = new DefaultTransferHandler();
+
+ setTransferHandler(defaultTransferHandler);
+ }
+
+ // Perform action.
+ ActionEvent event = new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
+ action.getValue(Action.NAME).toString());
+ action.actionPerformed(event);
+ }
+
+ public void setFocusAccelerator(char newKey)
+ {
+ if (focusAccelerator == newKey)
+ return;
+
+ char oldKey = focusAccelerator;
+ focusAccelerator = newKey;
+ firePropertyChange(FOCUS_ACCELERATOR_KEY, oldKey, newKey);
+ }
+
+ public char getFocusAccelerator()
+ {
+ return focusAccelerator;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public NavigationFilter getNavigationFilter()
+ {
+ return navigationFilter;
+ }
+
+ /**
+ * @since 1.4
+ */
+ public void setNavigationFilter(NavigationFilter filter)
+ {
+ navigationFilter = filter;
+ }
}
diff --git a/libjava/javax/swing/text/PasswordView.java b/libjava/javax/swing/text/PasswordView.java
index f9db0417057..ad18350e947 100644
--- a/libjava/javax/swing/text/PasswordView.java
+++ b/libjava/javax/swing/text/PasswordView.java
@@ -56,6 +56,16 @@ public class PasswordView extends FieldView
super(elem);
}
+ /**
+ * Draws one echo character at a given position.
+ *
+ * @param g the <code>Graphics</code> object to draw to
+ * @param x the x-position
+ * @param y the y-position
+ * @param ch the echo character
+ *
+ * @return the next x position right of the drawn character
+ */
protected int drawEchoCharacter(Graphics g, int x, int y, char ch)
{
// Update font metrics.
@@ -79,6 +89,17 @@ public class PasswordView extends FieldView
return ch;
}
+ /**
+ * Draws selected text at a given position.
+ *
+ * @param g the <code>Graphics</code> object to draw to
+ * @param x the x-position
+ * @param y the y-position
+ * @param p0 the position of the first character to draw
+ * @param p1 the position of the first character not to draw
+ *
+ * @return the next x position right of the drawn character
+ */
protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1)
throws BadLocationException
{
@@ -107,6 +128,17 @@ public class PasswordView extends FieldView
return x + len * metrics.charWidth(ch);
}
+ /**
+ * Draws unselected text at a given position.
+ *
+ * @param g the <code>Graphics</code> object to draw to
+ * @param x the x-position
+ * @param y the y-position
+ * @param p0 the position of the first character to draw
+ * @param p1 the position of the first character not to draw
+ *
+ * @return the next x position right of the drawn character
+ */
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
throws BadLocationException
{
diff --git a/libjava/javax/swing/text/PlainDocument.java b/libjava/javax/swing/text/PlainDocument.java
index 22808700a03..64e9c8ab3f4 100644
--- a/libjava/javax/swing/text/PlainDocument.java
+++ b/libjava/javax/swing/text/PlainDocument.java
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.text;
import java.util.ArrayList;
@@ -61,7 +62,7 @@ public class PlainDocument extends AbstractDocument
rootElement = createDefaultRoot();
}
- protected void reindex()
+ private void reindex()
{
Element[] lines;
try
@@ -70,24 +71,23 @@ public class PlainDocument extends AbstractDocument
ArrayList elts = new ArrayList();
int j = 0;
- for (int i = str.indexOf('\n', 0); i != -1; i = str.indexOf('\n', i+1))
+ for (int i = str.indexOf('\n', 0); i != -1; i = str.indexOf('\n', i + 1))
{
- elts.add(createLeafElement(rootElement, null, j, i));
- j = i;
+ elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1));
+ j = i + 1;
}
if (j < content.length())
- elts.add(createLeafElement(rootElement, null, j, content.length()));
+ elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, content.length()));
lines = new Element[elts.size()];
for (int i = 0; i < elts.size(); ++i)
lines[i] = (Element) elts.get(i);
-
}
catch (BadLocationException e)
{
lines = new Element[1];
- lines[0] = createLeafElement(rootElement, null, 0, 1);
+ lines[0] = createLeafElement(rootElement, SimpleAttributeSet.EMPTY, 0, 1);
}
((BranchElement) rootElement).replace(0, rootElement.getElementCount(), lines);
@@ -95,19 +95,28 @@ public class PlainDocument extends AbstractDocument
protected AbstractDocument.AbstractElement createDefaultRoot()
{
- rootElement = createBranchElement(null, null);
- reindex();
- return (AbstractElement) rootElement;
+ BranchElement root =
+ (BranchElement) createBranchElement(null, SimpleAttributeSet.EMPTY);
+
+ Element[] array = new Element[1];
+ array[0] = createLeafElement(root, SimpleAttributeSet.EMPTY, 0, 1);
+ root.replace(0, 0, array);
+
+ return root;
}
- protected void insertUpdate(DefaultDocumentEvent chng, AttributeSet attr)
+ protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes)
{
reindex();
+
+ super.insertUpdate(event, attributes);
}
- protected void removeUpdate(DefaultDocumentEvent chng)
+ protected void removeUpdate(DefaultDocumentEvent event)
{
reindex();
+
+ super.removeUpdate(event);
}
public Element getDefaultRootElement()
@@ -117,6 +126,7 @@ public class PlainDocument extends AbstractDocument
public Element getParagraphElement(int pos)
{
- return null;
+ Element root = getDefaultRootElement();
+ return root.getElement(root.getElementIndex(pos));
}
}
diff --git a/libjava/javax/swing/text/PlainView.java b/libjava/javax/swing/text/PlainView.java
index bcec3538d64..c852c1d69b4 100644
--- a/libjava/javax/swing/text/PlainView.java
+++ b/libjava/javax/swing/text/PlainView.java
@@ -1,5 +1,5 @@
/* PlainView.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,6 @@ import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.Shape;
-
public class PlainView extends View
implements TabExpander
{
@@ -93,6 +92,9 @@ public class PlainView extends View
public Shape modelToView(int position, Shape a, Position.Bias b)
throws BadLocationException
{
+ // Ensure metrics are up-to-date.
+ updateMetrics();
+
Document document = getDocument();
// Get rectangle of the line containing position.
@@ -115,13 +117,14 @@ public class PlainView extends View
return rect;
}
- public void drawLine(int lineIndex, Graphics g, int x, int y)
+ protected void drawLine(int lineIndex, Graphics g, int x, int y)
{
try
{
metrics = g.getFontMetrics();
// FIXME: Selected text are not drawn yet.
- drawUnselectedText(g, x, y, 0, getDocument().getLength());
+ Element line = getDocument().getDefaultRootElement().getElement(lineIndex);
+ drawUnselectedText(g, x, y, line.getStartOffset(), line.getEndOffset());
//drawSelectedText(g, , , , );
}
catch (BadLocationException e)
@@ -150,6 +153,9 @@ public class PlainView extends View
public void paint(Graphics g, Shape s)
{
+ // Ensure metrics are up-to-date.
+ updateMetrics();
+
JTextComponent textComponent = (JTextComponent) getContainer();
g.setFont(textComponent.getFont());
@@ -159,10 +165,18 @@ public class PlainView extends View
Rectangle rect = s.getBounds();
// FIXME: Text may be scrolled.
- drawLine(0, g, rect.x, rect.y);
+ Document document = textComponent.getDocument();
+ Element root = document.getDefaultRootElement();
+ int y = rect.y;
+
+ for (int i = 0; i < root.getElementCount(); i++)
+ {
+ drawLine(i, g, rect.x, y);
+ y += metrics.getHeight();
+ }
}
- public int getTabSize()
+ protected int getTabSize()
{
return 8;
}
diff --git a/libjava/javax/swing/text/Position.java b/libjava/javax/swing/text/Position.java
index 64a91f2e1a4..2fe2bd347d3 100644
--- a/libjava/javax/swing/text/Position.java
+++ b/libjava/javax/swing/text/Position.java
@@ -40,8 +40,8 @@ package javax.swing.text;
public interface Position
{
- static class Bias
- {
+ static class Bias
+ {
public static final Bias Backward = new Bias("backward");
public static final Bias Forward = new Bias("forward");
@@ -56,7 +56,7 @@ public interface Position
{
return name;
}
- }
+ }
- int getOffset();
+ int getOffset();
}
diff --git a/libjava/javax/swing/text/Segment.java b/libjava/javax/swing/text/Segment.java
index 218768e05e2..3b1d9e7aa91 100644
--- a/libjava/javax/swing/text/Segment.java
+++ b/libjava/javax/swing/text/Segment.java
@@ -1,4 +1,4 @@
-/* Segment.java --
+/* Segment.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,13 +59,13 @@ public class Segment
this.offset = offset;
this.count = count;
}
-
- public Object clone()
- {
+
+ public Object clone()
+ {
try
{
- return super.clone();
- }
+ return super.clone();
+ }
catch (CloneNotSupportedException e)
{
return null;
diff --git a/libjava/javax/swing/text/StyledEditorKit.java b/libjava/javax/swing/text/StyledEditorKit.java
index f1858309a5a..148ebd32bd2 100644
--- a/libjava/javax/swing/text/StyledEditorKit.java
+++ b/libjava/javax/swing/text/StyledEditorKit.java
@@ -52,452 +52,452 @@ import javax.swing.event.CaretListener;
/**
* StyledEditorKit
*
- * @author Andrew Selkirk
+ * @author Andrew Selkirk
*/
public class StyledEditorKit extends DefaultEditorKit
{
private static final long serialVersionUID = 7002391892985555948L;
- /**
- * UnderlineAction
- */
+ /**
+ * UnderlineAction
+ */
public static class UnderlineAction extends StyledEditorKit.StyledTextAction
{
- /**
- * Constructor UnderlineAction
- */
+ /**
+ * Constructor UnderlineAction
+ */
public UnderlineAction()
{
- super("TODO");
- // TODO
+ super("TODO");
+ // TODO
}
- /**
- * actionPerformed
- * @param event TODO
- */
+ /**
+ * actionPerformed
+ * @param event TODO
+ */
public void actionPerformed(ActionEvent event)
{
- // TODO
+ // TODO
}
}
- /**
- * ItalicAction
- */
+ /**
+ * ItalicAction
+ */
public static class ItalicAction extends StyledEditorKit.StyledTextAction
{
- /**
- * Constructor ItalicAction
- */
+ /**
+ * Constructor ItalicAction
+ */
public ItalicAction()
{
- super("TODO");
- // TODO
+ super("TODO");
+ // TODO
}
- /**
- * actionPerformed
- * @param event TODO
- */
+ /**
+ * actionPerformed
+ * @param event TODO
+ */
public void actionPerformed(ActionEvent event)
{
- // TODO
+ // TODO
}
}
- /**
- * BoldAction
- */
+ /**
+ * BoldAction
+ */
public static class BoldAction extends StyledEditorKit.StyledTextAction
{
- /**
- * Constructor BoldAction
- */
+ /**
+ * Constructor BoldAction
+ */
public BoldAction()
{
- super("TODO");
- // TODO
+ super("TODO");
+ // TODO
}
- /**
- * actionPerformed
- * @param event TODO
- */
+ /**
+ * actionPerformed
+ * @param event TODO
+ */
public void actionPerformed(ActionEvent event)
{
- // TODO
+ // TODO
}
}
- /**
- * AlignmentAction
- */
+ /**
+ * AlignmentAction
+ */
public static class AlignmentAction extends StyledEditorKit.StyledTextAction
{
- /**
- * a
- */
- private int a;
-
- /**
- * Constructor AlignmentAction
- * @param nm TODO
- * @param a TODO
- */
+ /**
+ * a
+ */
+ private int a;
+
+ /**
+ * Constructor AlignmentAction
+ * @param nm TODO
+ * @param a TODO
+ */
public AlignmentAction(String nm, int a)
{
- super("TODO");
- // TODO
+ super("TODO");
+ // TODO
}
- /**
- * actionPerformed
- * @param event TODO
- */
+ /**
+ * actionPerformed
+ * @param event TODO
+ */
public void actionPerformed(ActionEvent event)
{
- // TODO
+ // TODO
}
}
- /**
- * ForegroundAction
- */
+ /**
+ * ForegroundAction
+ */
public static class ForegroundAction extends StyledEditorKit.StyledTextAction
{
- /**
- * fg
- */
- private Color fg;
-
- /**
- * Constructor ForegroundAction
- * @param nm TODO
- * @param fg TODO
- */
+ /**
+ * fg
+ */
+ private Color fg;
+
+ /**
+ * Constructor ForegroundAction
+ * @param nm TODO
+ * @param fg TODO
+ */
public ForegroundAction(String nm, Color fg)
{
- super("TODO");
- // TODO
+ super("TODO");
+ // TODO
}
- /**
- * actionPerformed
- * @param event TODO
- */
+ /**
+ * actionPerformed
+ * @param event TODO
+ */
public void actionPerformed(ActionEvent event)
{
- // TODO
+ // TODO
}
}
- /**
- * FontSizeAction
- */
+ /**
+ * FontSizeAction
+ */
public static class FontSizeAction extends StyledEditorKit.StyledTextAction
{
- /**
- * size
- */
- private int size;
-
- /**
- * Constructor FontSizeAction
- * @param nm TODO
- * @param size TODO
- */
+ /**
+ * size
+ */
+ private int size;
+
+ /**
+ * Constructor FontSizeAction
+ * @param nm TODO
+ * @param size TODO
+ */
public FontSizeAction(String nm, int size)
{
- super("TODO");
- // TODO
+ super("TODO");
+ // TODO
}
- /**
- * actionPerformed
- * @param event TODO
- */
+ /**
+ * actionPerformed
+ * @param event TODO
+ */
public void actionPerformed(ActionEvent event)
{
- // TODO
+ // TODO
}
}
- /**
- * FontFamilyAction
- */
+ /**
+ * FontFamilyAction
+ */
public static class FontFamilyAction extends StyledEditorKit.StyledTextAction
{
- /**
- * family
- */
- private String family;
-
- /**
- * Constructor FontFamilyAction
- * @param nm TODO
- * @param family TODO
- */
+ /**
+ * family
+ */
+ private String family;
+
+ /**
+ * Constructor FontFamilyAction
+ * @param nm TODO
+ * @param family TODO
+ */
public FontFamilyAction(String nm, String family)
{
- super("TODO");
- // TODO
+ super("TODO");
+ // TODO
}
- /**
- * actionPerformed
- * @param event TODO
- */
+ /**
+ * actionPerformed
+ * @param event TODO
+ */
public void actionPerformed(ActionEvent event)
{
- // TODO
+ // TODO
}
}
- /**
- * StyledTextAction
- */
+ /**
+ * StyledTextAction
+ */
public abstract static class StyledTextAction extends TextAction
{
- /**
- * Constructor StyledTextAction
- * @param nm TODO
- */
+ /**
+ * Constructor StyledTextAction
+ * @param nm TODO
+ */
public StyledTextAction(String nm)
{
- super(nm);
- // TODO
+ super(nm);
+ // TODO
}
- /**
- * getEditor
- * @param event TODO
- * @returns JEditorPane
- */
+ /**
+ * getEditor
+ * @param event TODO
+ * @returns JEditorPane
+ */
protected final JEditorPane getEditor(ActionEvent event)
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * setCharacterAttributes
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
+ /**
+ * setCharacterAttributes
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
protected final void setCharacterAttributes(JEditorPane value0,
AttributeSet value1,
boolean value2)
{
- // TODO
+ // TODO
}
- /**
- * getStyledDocument
- * @param value0 TODO
- * @returns StyledDocument
- */
+ /**
+ * getStyledDocument
+ * @param value0 TODO
+ * @returns StyledDocument
+ */
protected final StyledDocument getStyledDocument(JEditorPane value0)
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * getStyledEditorKit
- * @param value0 TODO
- * @returns StyledEditorKit
- */
+ /**
+ * getStyledEditorKit
+ * @param value0 TODO
+ * @returns StyledEditorKit
+ */
protected final StyledEditorKit getStyledEditorKit(JEditorPane value0)
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * setParagraphAttributes
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
+ /**
+ * setParagraphAttributes
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
protected final void setParagraphAttributes(JEditorPane value0,
AttributeSet value1,
boolean value2)
{
- // TODO
+ // TODO
}
}
- /**
- * StyledViewFactory
- */
+ /**
+ * StyledViewFactory
+ */
static class StyledViewFactory
implements ViewFactory
{
- /**
- * Constructor StyledViewFactory
- */
+ /**
+ * Constructor StyledViewFactory
+ */
StyledViewFactory()
{
- // TODO
+ // TODO
}
- /**
- * create
- * @param value0 TODO
- * @returns View
- */
+ /**
+ * create
+ * @param value0 TODO
+ * @returns View
+ */
public View create(Element value0)
{
- return null; // TODO
+ return null; // TODO
}
}
- /**
- * AttributeTracker
- */
+ /**
+ * AttributeTracker
+ */
class AttributeTracker
implements CaretListener, PropertyChangeListener, Serializable
{
- /**
- * Constructor AttributeTracker
- * @param value0 TODO
- */
+ /**
+ * Constructor AttributeTracker
+ * @param value0 TODO
+ */
AttributeTracker(StyledEditorKit value0)
{
- // TODO
+ // TODO
}
- /**
- * updateInputAttributes
- * @param value0 TODO
- * @param value1 TODO
- * @param value2 TODO
- */
+ /**
+ * updateInputAttributes
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
void updateInputAttributes(int value0, int value1, JTextComponent value2)
{
- // TODO
+ // TODO
}
- /**
- * propertyChange
- * @param value0 TODO
- */
+ /**
+ * propertyChange
+ * @param value0 TODO
+ */
public void propertyChange(PropertyChangeEvent value0)
{
- // TODO
+ // TODO
}
- /**
- * caretUpdate
- * @param value0 TODO
- */
+ /**
+ * caretUpdate
+ * @param value0 TODO
+ */
public void caretUpdate(CaretEvent value0)
{
- // TODO
+ // TODO
}
}
- /**
- * currentRun
- */
- Element currentRun;
+ /**
+ * currentRun
+ */
+ Element currentRun;
- /**
- * currentParagraph
- */
- Element currentParagraph;
+ /**
+ * currentParagraph
+ */
+ Element currentParagraph;
- /**
- * inputAttributes
- */
- MutableAttributeSet inputAttributes;
+ /**
+ * inputAttributes
+ */
+ MutableAttributeSet inputAttributes;
- /**
- * Constructor StyledEditorKit
- */
+ /**
+ * Constructor StyledEditorKit
+ */
public StyledEditorKit()
{
- // TODO
+ // TODO
}
- /**
- * clone
- * @returns Object
- */
+ /**
+ * clone
+ * @returns Object
+ */
public Object clone()
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * getActions
- * @returns Action[]
- */
+ /**
+ * getActions
+ * @returns Action[]
+ */
public Action[] getActions()
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * getInputAttributes
- * @returns MutableAttributeSet
- */
+ /**
+ * getInputAttributes
+ * @returns MutableAttributeSet
+ */
public MutableAttributeSet getInputAttributes()
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * getCharacterAttributeRun
- * @returns Element
- */
+ /**
+ * getCharacterAttributeRun
+ * @returns Element
+ */
public Element getCharacterAttributeRun()
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * createDefaultDocument
- * @returns Document
- */
+ /**
+ * createDefaultDocument
+ * @returns Document
+ */
public Document createDefaultDocument()
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * install
- * @param component TODO
- */
+ /**
+ * install
+ * @param component TODO
+ */
public void install(JEditorPane component)
{
- // TODO
+ // TODO
}
- /**
- * deinstall
- * @param component TODO
- */
+ /**
+ * deinstall
+ * @param component TODO
+ */
public void deinstall(JEditorPane component)
{
- // TODO
+ // TODO
}
- /**
- * getViewFactory
- * @returns ViewFactory
- */
+ /**
+ * getViewFactory
+ * @returns ViewFactory
+ */
public ViewFactory getViewFactory()
{
- return null; // TODO
+ return null; // TODO
}
- /**
- * createInputAttributes
- * @param element TODO
- * @param set TODO
- */
+ /**
+ * createInputAttributes
+ * @param element TODO
+ * @param set TODO
+ */
protected void createInputAttributes(Element element, MutableAttributeSet set)
{
- // TODO
+ // TODO
}
}
diff --git a/libjava/javax/swing/text/TextAction.java b/libjava/javax/swing/text/TextAction.java
index d07bcbf1f43..0191a2dc41c 100644
--- a/libjava/javax/swing/text/TextAction.java
+++ b/libjava/javax/swing/text/TextAction.java
@@ -39,56 +39,73 @@ exception statement from your version. */
package javax.swing.text;
import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.HashSet;
import javax.swing.AbstractAction;
import javax.swing.Action;
/**
* TextAction
- * @author Andrew Selkirk
+ * @author Andrew Selkirk
*/
public abstract class TextAction extends AbstractAction
{
- /**
- * Constructor TextAction
- * @param name TODO
- */
+ /**
+ * Constructor TextAction
+ * @param name TODO
+ */
public TextAction(String name)
{
super(name);
}
- /**
- * getTextComponent
- * @param event TODO
- * @return JTextComponent
- */
+ /**
+ * Returns the <code>JTextComponent</code> object associated with the given
+ * <code>ActionEvent</code>. If the source of the event is not a
+ * <code>JTextComponent</code> the currently focused text component is returned.
+ *
+ * @param event the action event
+ *
+ * @return the <code>JTextComponent</code>
+ */
protected final JTextComponent getTextComponent(ActionEvent event)
{
- if (event.getSource() != null &&
- event.getSource() instanceof JTextComponent)
+ if (event.getSource() instanceof JTextComponent)
return (JTextComponent) event.getSource();
- else
- return getFocusedComponent();
+
+ return getFocusedComponent();
}
- /**
- * augmentList
- * @param list1 TODO
- * @param list2 TODO
- * @return Action[]
- */
+ /**
+ * Creates a new array of <code>Action</code> containing both given arrays.
+ *
+ * @param list1 the first action array
+ * @param list2 the second action array
+ *
+ * @return the augmented array of actions
+ */
public static final Action[] augmentList(Action[] list1, Action[] list2)
{
- return null; // TODO
+ HashSet actionSet = new HashSet();
+
+ for (int i = 0; i < list1.length; ++i)
+ actionSet.add(list1[i]);
+
+ for (int i = 0; i < list2.length; ++i)
+ actionSet.add(list2[i]);
+
+ ArrayList list = new ArrayList(actionSet);
+ return (Action[]) list.toArray(new Action[actionSet.size()]);
}
- /**
- * getFocusedComponent
- * @return JTextComponent
- */
+ /**
+ * Returns the current focused <code>JTextComponent</code> object.
+ *
+ * @return the <code>JTextComponent</code>
+ */
protected final JTextComponent getFocusedComponent()
{
- return null; // TODO
+ return null; // TODO
}
}
diff --git a/libjava/javax/swing/text/Utilities.java b/libjava/javax/swing/text/Utilities.java
index 6d2b54680a0..c55f48e0a5f 100644
--- a/libjava/javax/swing/text/Utilities.java
+++ b/libjava/javax/swing/text/Utilities.java
@@ -1,5 +1,5 @@
/* Utilities.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.awt.Graphics;
* A set of utilities to deal with text. This is used by several other classes
* inside this package.
*
- * @author Roman Kennke <roman@ontographics.com>
+ * @author Roman Kennke (roman@ontographics.com)
*/
public class Utilities
{
diff --git a/libjava/javax/swing/text/View.java b/libjava/javax/swing/text/View.java
index f9e44a90f54..46f42b50374 100644
--- a/libjava/javax/swing/text/View.java
+++ b/libjava/javax/swing/text/View.java
@@ -1,5 +1,5 @@
/* View.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,6 +35,7 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
+
package javax.swing.text;
import java.awt.Container;
@@ -57,91 +58,113 @@ public abstract class View implements SwingConstants
private Element elt;
private View parent;
- /**
+ /**
* Creates a new <code>View</code> instance.
*
* @param elem an <code>Element</code> value
- */
- public View(Element elem)
- {
- elt = elem;
- }
+ */
+ public View(Element elem)
+ {
+ elt = elem;
+ }
public abstract void paint(Graphics g, Shape s);
- public void setParent(View a)
- {
- parent = a;
- }
-
+ public void setParent(View parent)
+ {
+ this.parent = parent;
+ }
+
public View getParent()
- {
+ {
return parent;
- }
-
- public void setSize(int w, int h)
- {
- width = w;
- height = h;
- }
+ }
public Container getContainer()
- {
+ {
+ View parent = getParent();
return parent != null ? parent.getContainer() : null;
- }
-
+ }
+
public Document getDocument()
- {
+ {
return getElement().getDocument();
- }
-
+ }
+
public Element getElement()
- {
+ {
return elt;
- }
+ }
public abstract float getPreferredSpan(int axis);
+
+ public int getResizeWeight(int axis)
+ {
+ return 0;
+ }
+
+ public float getMaximumSpan(int axis)
+ {
+ if (getResizeWeight(axis) <= 0)
+ return getPreferredSpan(axis);
+
+ return Integer.MAX_VALUE;
+ }
+
+ public float getMinimumSpan(int axis)
+ {
+ if (getResizeWeight(axis) <= 0)
+ return getPreferredSpan(axis);
+
+ return Integer.MAX_VALUE;
+ }
+
+ public void setSize(float width, float height)
+ {
+ // The default implementation does nothing.
+ }
public float getAlignment(int axis)
- {
+ {
return 0.5f;
- }
-
+ }
+
public AttributeSet getAttributes()
- {
- return elt.getAttributes();
- }
-
+ {
+ return getElement().getAttributes();
+ }
+
public boolean isVisible()
- {
+ {
return true;
- }
+ }
public int getViewCount()
- {
+ {
return 0;
- }
-
+ }
+
public View getView(int index)
- {
+ {
return null;
- }
+ }
public ViewFactory getViewFactory()
- {
+ {
+ View parent = getParent();
return parent != null ? parent.getViewFactory() : null;
}
public void replace(int offset, int length, View[] views)
- {
+ {
// Default implementation does nothing.
}
public void insert(int offset, View view)
- {
+ {
View[] array = { view };
replace(offset, 1, array);
- }
+ }
public void append(View view)
{
@@ -152,7 +175,7 @@ public abstract class View implements SwingConstants
public void removeAll()
{
replace(0, getViewCount(), null);
- }
+ }
public void remove(int index)
{
@@ -167,12 +190,12 @@ public abstract class View implements SwingConstants
public int getStartOffset()
{
- return elt.getStartOffset();
+ return getElement().getStartOffset();
}
public int getEndOffset()
{
- return elt.getEndOffset();
+ return getElement().getEndOffset();
}
public Shape getChildAllocation(int index, Shape a)
@@ -205,5 +228,37 @@ public abstract class View implements SwingConstants
return null;
}
+
+ /**
+ * @since 1.3
+ */
+ public Graphics getGraphics()
+ {
+ return getContainer().getGraphics();
+ }
+
+ public void preferenceChanged(View child, boolean width, boolean height)
+ {
+ if (parent != null)
+ parent.preferenceChanged(this, width, height);
+ }
+
+ public int getBreakWeight(int axis, float pos, float len)
+ {
+ return BadBreakWeight;
+ }
+
+ public View breakView(int axis, int offset, float pos, float len)
+ {
+ return this;
+ }
+
+ /**
+ * @since 1.3
+ */
+ public int getViewIndex(int pos, Position.Bias b)
+ {
+ return -1;
+ }
}
diff --git a/libjava/javax/swing/text/ViewFactory.java b/libjava/javax/swing/text/ViewFactory.java
index 52be67ba557..c9cc4b792b8 100644
--- a/libjava/javax/swing/text/ViewFactory.java
+++ b/libjava/javax/swing/text/ViewFactory.java
@@ -46,5 +46,5 @@ public interface ViewFactory
*
* @return a new created view
*/
- View create (Element elem);
+ View create(Element elem);
}
diff --git a/libjava/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/javax/swing/tree/DefaultMutableTreeNode.java
index b6dd1d0b870..de34ee07250 100644
--- a/libjava/javax/swing/tree/DefaultMutableTreeNode.java
+++ b/libjava/javax/swing/tree/DefaultMutableTreeNode.java
@@ -1,5 +1,5 @@
/* DefaultMutableTreeNode.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,984 +38,917 @@ exception statement from your version. */
package javax.swing.tree;
+import gnu.java.util.EmptyEnumeration;
+
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Random;
import java.util.Stack;
import java.util.Vector;
/**
* DefaultMutableTreeNode
+ *
* @author Andrew Selkirk
*/
public class DefaultMutableTreeNode
implements Cloneable, MutableTreeNode, Serializable
{
- static final long serialVersionUID = -4298474751201349152L;
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * EMPTY_ENUMERATION
- */
- public static final Enumeration EMPTY_ENUMERATION = null; // TODO
-
- /**
- * parent
- */
- protected MutableTreeNode parent = null;
-
- /**
- * children
- */
- protected Vector children = new Vector();
-
- /**
- * userObject
- */
- protected transient Object userObject = "";
-
- /**
- * allowsChildren
- */
- protected boolean allowsChildren = true;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Constructor DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode() {
- // TODO
- } // DefaultMutableTreeNode()
-
- /**
- * Constructor DefaultMutableTreeNode
- * @param value0 TODO
- */
- public DefaultMutableTreeNode(Object userObject) {
- this.userObject = userObject;
- } // DefaultMutableTreeNode()
-
- /**
- * Constructor DefaultMutableTreeNode
- * @param value0 TODO
- * @param value1 TODO
- */
- public DefaultMutableTreeNode(Object userObject, boolean allowsChildren) {
- this.userObject = userObject;
- this.allowsChildren = allowsChildren;
- } // DefaultMutableTreeNode()
-
-
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * clone
- * @returns Object
- */
- public Object clone() {
- return null; // TODO
- } // clone()
-
- /**
- * toString
- * @returns String
- */
- public String toString() {
- if (userObject == null) {
- return null;
- } // if
- return userObject.toString();
- } // toString()
-
- /**
- * add
- * @param value0 TODO
- */
- public void add(MutableTreeNode child) {
- children.add(child);
- child.setParent(this);
- } // add()
-
- /**
- * getParent
- * @returns TreeNode
- */
- public TreeNode getParent() {
- return parent;
- } // getParent()
-
- /**
- * remove
- * @param value0 TODO
- */
- public void remove(int index) {
- children.remove(index);
- } // remove()
-
- /**
- * remove
- * @param value0 TODO
- */
- public void remove(MutableTreeNode node) {
- children.remove(node);
- } // remove()
-
- /**
- * writeObject
- * @param value0 TODO
- * @exception IOException TODO
- */
- private void writeObject(ObjectOutputStream value0) throws IOException {
- // TODO
- } // writeObject()
-
- /**
- * readObject
- * @param value0 TODO
- * @exception IOException TODO
- * @exception ClassNotFoundException TODO
- */
- private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException {
- // TODO
- } // readObject()
-
- /**
- * insert
- * @param value0 TODO
- * @param value1 TODO
- */
- public void insert(MutableTreeNode node, int index) {
- children.insertElementAt(node, index);
- } // insert()
-
- /**
- * getPath
- * @returns TreeNode[]
- */
- public TreeNode[] getPath() {
-
- // Variables
- TreeNode[] path;
- int size;
- int index;
- TreeNode current;
-
- // Determine length of Path
- size = getLevel() + 1;
-
- // Create Path
- path = new TreeNode[size];
- current = this;
- for (index = size - 1; index >= 0; index--) {
- path[index] = current;
- current = current.getParent();
- } // for
-
- // Return Path
- return path;
-
- } // getPath()
-
- /**
- * children
- * @returns Enumeration
- */
- public Enumeration children() {
- return children.elements();
- } // children()
-
- /**
- * setParent
- * @param value0 TODO
- */
- public void setParent(MutableTreeNode node) {
- parent = node;
- } // setParent()
-
- /**
- * getChildAt
- * @param value0 TODO
- * @returns TreeNode
- */
- public TreeNode getChildAt(int index) {
- return (TreeNode) children.elementAt(index);
- } // getChildAt()
-
- /**
- * getChildCount
- * @returns int
- */
- public int getChildCount() {
- return children.size();
- } // getChildCount()
-
- /**
- * getIndex
- * @param value0 TODO
- * @returns int
- */
- public int getIndex(TreeNode node) {
- return children.indexOf(node);
- } // getIndex()
-
- /**
- * setAllowsChildren
- * @param value0 TODO
- */
- public void setAllowsChildren(boolean allowsChildren) {
- this.allowsChildren = allowsChildren;
- } // setAllowsChildren()
-
- /**
- * getAllowsChildren
- * @returns boolean
- */
- public boolean getAllowsChildren() {
- return allowsChildren;
- } // getAllowsChildren()
-
- /**
- * setUserObject
- * @param value0 TODO
- */
- public void setUserObject(Object userObject) {
- this.userObject = userObject;
- } // setUserObject()
-
- /**
- * getUserObject
- * @returns Object
- */
- public Object getUserObject() {
- return userObject;
- } // getUserObject()
-
- /**
- * removeFromParent
- */
- public void removeFromParent() {
- parent = null;
- // TODO
- } // removeFromParent()
-
- /**
- * removeAllChildren
- */
- public void removeAllChildren() {
- children.removeAllElements();
- } // removeAllChildren()
-
- /**
- * isNodeAncestor
- * @param value0 TODO
- * @returns boolean
- */
- public boolean isNodeAncestor(TreeNode node) {
-
- // Variables
- TreeNode current;
-
- // Sanity Check
- if (node == null) {
- return false;
- } // if
-
- // Search For Ancestor
- current = this;
- while (current != null && current != node) {
- current = current.getParent();
- } // while
-
- // Check for Ancestor
- if (current == node) {
- return true;
- } // if
-
- // Otherwise, no
- return false;
-
- } // isNodeAncestor()
-
- /**
- * isNodeDescendant
- * @param value0 TODO
- * @returns boolean
- */
- public boolean isNodeDescendant(DefaultMutableTreeNode node) {
-
- // Variables
- TreeNode current;
-
- // Sanity Check
- if (node == null) {
- return false;
- } // if
-
- // Search For Descendant
- current = node;
- while (current != null && current != this) {
- current = current.getParent();
- } // while
-
- // Check for Descendant
- if (current == this) {
- return true;
- } // if
-
- // Otherwise, no
- return false;
-
- } // isNodeDescendant()
-
- /**
- * getSharedAncestor
- * @param value0 TODO
- * @returns TreeNode
- */
- public TreeNode getSharedAncestor(DefaultMutableTreeNode node) {
-
- // Variables
- ArrayList list;
- TreeNode current;
-
- // Get List of Path Elements for this node
- current = this;
- list = new ArrayList();
- while (current != null) {
- list.add(current);
- current = current.getParent();
- } // while
-
- // Check if any path element of node are in list
- current = node;
- while (current != null) {
- if (list.contains(current) == true) {
- return current;
- } // if
- current = current.getParent();
- } // while
-
- // Unable to locate shared ancestor
- return null;
-
- } // getSharedAncestor()
-
- /**
- * isNodeRelated
- * @param value0 TODO
- * @returns boolean
- */
- public boolean isNodeRelated(DefaultMutableTreeNode node) {
-
- // Sanity Check
- if (node == null) {
- return false;
- } // if
-
- // Check for the same root
- if (node.getRoot() == getRoot()) {
- return true;
- } // if
-
- // Nodes are not related
- return false;
-
- } // isNodeRelated()
-
- /**
- * getDepth
- * @returns int
- */
- public int getDepth() {
-
- // Variables
- TreeNode node;
- int depth;
- int current;
- int size;
- Stack stack;
- int index;
-
- // Check for children
- if (allowsChildren == false || children.size() == 0) {
- return 0;
- } // if
-
- // Process Depths
- stack = new Stack();
- stack.push(new Integer(0));
- node = getChildAt(0);
-//System.out.println(" * Descend: 0-0");
- depth = 0;
- current = 1;
- while (stack.empty() == false) {
-
- // Check if node has children
- if (node.getChildCount() != 0) {
- node = node.getChildAt(0);
- stack.push(new Integer(0));
- current++;
-// System.out.println(" * Descend: 0-" + current);
-
- // Check for next sibling
- } else {
-
- // Check Depth
- if (current > depth) {
- depth = current;
- } // if
-
- do {
-
- // Traverse to Parent
- node = node.getParent();
- size = node.getChildCount();
- current--;
- index = ((Integer) stack.pop()).intValue();
-// System.out.println(" * Ascend from: " + index + "-" + current);
- index++;
-
- } while (index >= size && node != this);
-
- // Check for child
- if (index < size) {
- node = node.getChildAt(index);
- stack.push(new Integer(index));
- current++;
-// System.out.println(" * Descend: " + index + "-" + current);
- } // if
-
- } // if
-
- } // while
-
- return depth;
-
- } // getDepth()
-
- static Random random = new Random(System.currentTimeMillis());
-
- public static void growTree(DefaultMutableTreeNode root) {
-
- // Variables
- int index;
- DefaultMutableTreeNode node;
- DefaultMutableTreeNode current;
-
- current = root;
- index = 0;
-// while (current != root) {
- do {
-
-// if (random.nextInt(3) < 2) {
- if (random.nextBoolean()) {
- node = new DefaultMutableTreeNode(String.valueOf(index));
- index++;
- current.add(node);
- current = node;
- } else {
- current = (DefaultMutableTreeNode) current.getParent();
- } // if
-
-// } // while
- } while (current != root && current != null);
-
- System.out.println("Number of nodes: " + index);
-
-/*
- // Calc # children
- size = random.nextInt(4);
-
- for (index = 0; index < size; index++) {
-
- // Create Node
- node = new DefaultMutableTreeNode(String.valueOf(index));
- growTree(node);
-
- // Add Node to root
- root.add(node);
-
- } // for
-*/
- } // growTree()
-
- public static void main(String[] argv) {
-/*
- DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1");
- DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("node2");
- DefaultMutableTreeNode node3 = new DefaultMutableTreeNode("node3");
- DefaultMutableTreeNode node4 = new DefaultMutableTreeNode("node4");
- DefaultMutableTreeNode node5 = new DefaultMutableTreeNode("node5");
- DefaultMutableTreeNode node6 = new DefaultMutableTreeNode("node6");
- DefaultMutableTreeNode node7 = new DefaultMutableTreeNode("node7");
- DefaultMutableTreeNode node8 = new DefaultMutableTreeNode("node8");
-
- node1.add(node2);
- node1.add(node3);
- node2.add(node4);
- node2.add(node5);
- node3.add(node6);
- node3.add(node7);
- node5.add(node8);
-
- System.out.println("Depth (node1): " + node1.getDepth());
- System.out.println("Depth (node2): " + node2.getDepth());
- System.out.println("Depth (node3): " + node3.getDepth());
-*/
-
- System.out.println("Create tree...");
- DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
- growTree(root);
- System.out.println("Find depth...");
- System.out.println("Depth (root): " + root.getDepth());
-
- } // main
-
- /**
- * getLevel
- * @returns int
- */
- public int getLevel() {
-
- // Variables
- TreeNode current;
- int count;
-
- // Lookup Parent
- count = -1;
- current = this;
- do {
- current = current.getParent();
- count++;
- } while (current != null);
-
- return count;
-
- } // getLevel()
-
- /**
- * getPathToRoot
- * @param value0 TODO
- * @param value1 TODO
- * @returns TreeNode[]
- */
- protected TreeNode[] getPathToRoot(TreeNode value0, int value1) {
- return null; // TODO
- } // getPathToRoot()
-
- /**
- * getUserObjectPath
- * @returns Object[]
- */
- public Object[] getUserObjectPath() {
-
- // Variables
- TreeNode[] path;
- Object[] object;
- int index;
-
- // Get Path for Tree Nodes
- path = getPath();
-
- // Construct Object Path
- object = new Object[path.length];
- for (index = 0; index < path.length; index++) {
- object[index] = ((DefaultMutableTreeNode) path[index]).getUserObject();
- } // for
-
- // Return Object Path
- return object;
-
- } // getUserObjectPath()
-
- /**
- * getRoot
- * @returns TreeNode
- */
- public TreeNode getRoot() {
-
- // Variables
- TreeNode current;
- TreeNode check;
-
- // Lookup Parent
- current = this;
- check = current.getParent();
- while (check != null) {
- current = check;
- check = current.getParent();
- } // while
-
- return current;
-
- } // getRoot()
-
- /**
- * isRoot
- * @returns boolean
- */
- public boolean isRoot() {
- return (parent == null);
- } // isRoot()
-
- /**
- * getNextNode
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getNextNode() {
- return null; // TODO
- } // getNextNode()
-
- /**
- * getPreviousNode
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getPreviousNode() {
- return null; // TODO
- } // getPreviousNode()
-
- /**
- * preorderEnumeration
- * @returns Enumeration
- */
- public Enumeration preorderEnumeration() {
- return null; // TODO
- } // preorderEnumeration()
-
- /**
- * postorderEnumeration
- * @returns Enumeration
- */
- public Enumeration postorderEnumeration() {
- return null; // TODO
- } // postorderEnumeration()
-
- /**
- * breadthFirstEnumeration
- * @returns Enumeration
- */
- public Enumeration breadthFirstEnumeration() {
- return null; // TODO
- } // breadthFirstEnumeration()
-
- /**
- * depthFirstEnumeration
- * @returns Enumeration
- */
- public Enumeration depthFirstEnumeration() {
- return null; // TODO
- } // depthFirstEnumeration()
-
- /**
- * pathFromAncestorEnumeration
- * @param value0 TODO
- * @returns Enumeration
- */
- public Enumeration pathFromAncestorEnumeration(TreeNode value0) {
- return null; // TODO
- } // pathFromAncestorEnumeration()
-
- /**
- * isNodeChild
- * @param value0 TODO
- * @returns boolean
- */
- public boolean isNodeChild(TreeNode node) {
-
- // Variables
- TreeNode current;
-
- // Sanity Check
- if (node == null) {
- return false;
- } // if
-
- // Process Path
- current = node;
- while (current != null) {
- if (current == this) {
- return true;
- } // if
- current = current.getParent();
- } // while
-
- // Node not located in path, not child
- return false;
-
- } // isNodeChild()
-
- /**
- * getFirstChild
- * @returns TreeNode
- */
- public TreeNode getFirstChild() {
- return (TreeNode) children.firstElement();
- } // getFirstChild()
-
- /**
- * getLastChild
- * @returns TreeNode
- */
- public TreeNode getLastChild() {
- return (TreeNode) children.lastElement();
- } // getLastChild()
-
- /**
- * getChildAfter
- * @param value0 TODO
- * @returns TreeNode
- */
- public TreeNode getChildAfter(TreeNode node) {
-
- // Variables
- int index;
-
- // Check node
- if (node == null || node.getParent() != this) {
- throw new IllegalArgumentException();
- } // if
-
- // Get index of child node
- index = getIndex(node);
-
- // Check for child after
- index++;
- if (index == getChildCount()) {
- return null;
- } // if
-
- // Retrieve Child After
- return getChildAt(index);
-
- } // getChildAfter()
-
- /**
- * getChildBefore
- * @param value0 TODO
- * @returns TreeNode
- */
- public TreeNode getChildBefore(TreeNode node) {
-
- // Variables
- int index;
-
- // Check node
- if (node == null || node.getParent() != this) {
- throw new IllegalArgumentException();
- } // if
-
- // Get index of child node
- index = getIndex(node);
-
- // Check for child before
- index--;
- if (index < 0) {
- return null;
- } // if
-
- // Retrieve Child Before
- return getChildAt(index);
-
- } // getChildBefore()
-
- /**
- * isNodeSibling
- * @param value0 TODO
- * @returns boolean
- */
- public boolean isNodeSibling(TreeNode node) {
-
- // Check for null
- if (node == null) {
- return false;
- } // if
-
- // Check if nodes share a parent
- if (node.getParent() == getParent() && getParent() != null) {
- return true;
- } // if
-
- // Nodes are not siblings
- return false;
-
- } // isNodeSibling()
-
- /**
- * getSiblingCount
- * @returns int
- */
- public int getSiblingCount() {
-
- // Variables
-
- // Check for no parent
- if (parent == null) {
- return 1;
- } // if
-
- // Calculate sibling count from parent's child count
- return parent.getChildCount();
-
- } // getSiblingCount()
-
- /**
- * getNextSibling
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getNextSibling() {
-
- // Variables
- int index;
- int size;
-
- // Check for Parent
- if (parent == null) {
- return null;
- } // if
-
- // Get Index of this node
- index = parent.getIndex(this);
-
- // Check for Next Sibling
- size = parent.getChildCount();
- index++;
- if (index == size) {
- return null;
- } // if
-
- return (DefaultMutableTreeNode) parent.getChildAt(index);
-
- } // getNextSibling()
-
- /**
- * getPreviousSibling
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getPreviousSibling() {
-
- // Variables
- int index;
-
- // Check for Parent
- if (parent == null) {
- return null;
- } // if
-
- // Get Index of this node
- index = parent.getIndex(this);
-
- // Check for Previous Sibling
- index--;
- if (index < 0) {
- return null;
- } // if
-
- return (DefaultMutableTreeNode) parent.getChildAt(index);
-
- } // getPreviousSibling()
-
- /**
- * isLeaf
- * @returns boolean
- */
- public boolean isLeaf() {
- return (children.size() == 0); // TODO: check allowsChildren??
- } // isLeaf()
-
- /**
- * getFirstLeaf
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getFirstLeaf() {
-
- // Variables
- TreeNode current;
-
- current = this;
- while (current.getChildCount() > 0) {
- current = current.getChildAt(0);
- } // while
-
- return (DefaultMutableTreeNode) current;
-
- } // getFirstLeaf()
-
- /**
- * getLastLeaf
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getLastLeaf() {
-
- // Variables
- TreeNode current;
- int size;
-
- current = this;
- size = current.getChildCount();
- while (size > 0) {
- current = current.getChildAt(size - 1);
- size = current.getChildCount();
- } // while
-
- return (DefaultMutableTreeNode) current;
-
- } // getLastLeaf()
-
- /**
- * getNextLeaf
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getNextLeaf() {
- return null; // TODO
- } // getNextLeaf()
-
- /**
- * getPreviousLeaf
- * @returns DefaultMutableTreeNode
- */
- public DefaultMutableTreeNode getPreviousLeaf() {
- return null; // TODO
- } // getPreviousLeaf()
-
- /**
- * getLeafCount
- * @returns int
- */
- public int getLeafCount() {
-
- // Variables
- Enumeration e;
- int count;
- TreeNode current;
-
- // Get Enumeration of all descendants
- e = depthFirstEnumeration();
-
- // Process Nodes
- count = 0;
- while (e.hasMoreElements() == true) {
- current = (TreeNode) e.nextElement();
- if (current.isLeaf() == true) {
- count++;
- } // if
- } // if
-
- return count;
-
- } // getLeafCount()
-
-
-} // DefaultMutableTreeNode
+ private static final long serialVersionUID = -4298474751201349152L;
+
+ /**
+ * EMPTY_ENUMERATION
+ */
+ public static final Enumeration EMPTY_ENUMERATION =
+ EmptyEnumeration.getInstance();
+
+ /**
+ * parent
+ */
+ protected MutableTreeNode parent;
+
+ /**
+ * children
+ */
+ protected Vector children = new Vector();
+
+ /**
+ * userObject
+ */
+ protected transient Object userObject;
+
+ /**
+ * allowsChildren
+ */
+ protected boolean allowsChildren;
+
+ /**
+ * Creates a <code>DefaultMutableTreeNode</code> object.
+ * This node allows to add child nodes.
+ */
+ public DefaultMutableTreeNode()
+ {
+ this(null, true);
+ }
+
+ /**
+ * Creates a <code>DefaultMutableTreeNode</code> object with the given
+ * user object attached to it. This node allows to add child nodes.
+ *
+ * @param userObject the user object
+ */
+ public DefaultMutableTreeNode(Object userObject)
+ {
+ this(userObject, true);
+ }
+
+ /**
+ * Creates a <code>DefaultMutableTreeNode</code> object with the given
+ * user object attached to it.
+ *
+ * @param userObject the user object
+ * @param allowsChildren <code>true</code> if the code allows to add child
+ * nodes, <code>false</code> otherwise
+ */
+ public DefaultMutableTreeNode(Object userObject, boolean allowsChildren)
+ {
+ this.userObject = userObject;
+ this.allowsChildren = allowsChildren;
+ }
+
+ /**
+ * clone
+ *
+ * @return Object
+ */
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ // TODO: Do we need to do more here ?
+ }
+ catch (CloneNotSupportedException e)
+ {
+ // This never happens.
+ return null;
+ }
+ }
+
+ /**
+ * Returns a string representation of this node
+ *
+ * @return a human-readable String representing this node
+ */
+ public String toString()
+ {
+ if (userObject == null)
+ return null;
+
+ return userObject.toString();
+ }
+
+ /**
+ * Adds a new child node to this node.
+ *
+ * @param child the child node
+ *
+ * @throws IllegalArgumentException if <code>child</code> is null
+ * @throws IllegalStateException if the node does not allow children
+ */
+ public void add(MutableTreeNode child)
+ {
+ if (child == null)
+ throw new IllegalArgumentException();
+
+ if (! allowsChildren)
+ throw new IllegalStateException();
+
+ children.add(child);
+ child.setParent(this);
+ }
+
+ /**
+ * Returns the parent node of this node.
+ *
+ * @return the parent node
+ */
+ public TreeNode getParent()
+ {
+ return parent;
+ }
+
+ /**
+ * Removes the child with the given index from this node
+ *
+ * @param index the index
+ */
+ public void remove(int index)
+ {
+ children.remove(index);
+ }
+
+ /**
+ * Removes the given child from this node.
+ *
+ * @param node the child node
+ */
+ public void remove(MutableTreeNode node)
+ {
+ children.remove(node);
+ }
+
+ /**
+ * writeObject
+ *
+ * @param stream the output stream
+ *
+ * @exception IOException If an error occurs
+ */
+ private void writeObject(ObjectOutputStream stream)
+ throws IOException
+ {
+ // TODO: Implement me.
+ }
+
+ /**
+ * readObject
+ *
+ * @param stream the input stream
+ *
+ * @exception IOException If an error occurs
+ * @exception ClassNotFoundException TODO
+ */
+ private void readObject(ObjectInputStream stream)
+ throws IOException, ClassNotFoundException
+ {
+ // TODO: Implement me.
+ }
+
+ /**
+ * Inserts given child node at the given index.
+ *
+ * @param node the child node
+ * @param value the index.
+ */
+ public void insert(MutableTreeNode node, int index)
+ {
+ children.insertElementAt(node, index);
+ }
+
+ /**
+ * Returns a path to this node from the root.
+ *
+ * @return an array of tree nodes
+ */
+ public TreeNode[] getPath()
+ {
+ return getPathToRoot(this, 0);
+ }
+
+ /**
+ * Returns an enumeration containing all children of this node.
+ * <code>EMPTY_ENUMERATION</code> is returned if this node has no children.
+ *
+ * @return an enumeration of tree nodes
+ */
+ public Enumeration children()
+ {
+ if (children.size() == 0)
+ return EMPTY_ENUMERATION;
+
+ return children.elements();
+ }
+
+ /**
+ * Set the parent node for this node.
+ *
+ * @param node the parent node
+ */
+ public void setParent(MutableTreeNode node)
+ {
+ parent = node;
+ }
+
+ /**
+ * Returns the child node at a given index.
+ *
+ * @param index the index
+ *
+ * @return the child node
+ */
+ public TreeNode getChildAt(int index)
+ {
+ return (TreeNode) children.elementAt(index);
+ }
+
+ /**
+ * Returns the number of children of this node.
+ *
+ * @return the number of children
+ */
+ public int getChildCount()
+ {
+ return children.size();
+ }
+
+ /**
+ * Returns the child index for a given node.
+ *
+ * @param node this node
+ *
+ * @return the index
+ */
+ public int getIndex(TreeNode node)
+ {
+ return children.indexOf(node);
+ }
+
+ /**
+ * setAllowsChildren
+ *
+ * @param allowsChildren TODO
+ */
+ public void setAllowsChildren(boolean allowsChildren)
+ {
+ this.allowsChildren = allowsChildren;
+ }
+
+ /**
+ * getAllowsChildren
+ *
+ * @return boolean
+ */
+ public boolean getAllowsChildren()
+ {
+ return allowsChildren;
+ }
+
+ /**
+ * Sets the user object for this node
+ *
+ * @param userObject the user object
+ */
+ public void setUserObject(Object userObject)
+ {
+ this.userObject = userObject;
+ }
+
+ /**
+ * Returns the user object attached to this node. <code>null</code> is
+ * returned when no user object is set.
+ *
+ * @return the user object
+ */
+ public Object getUserObject()
+ {
+ return userObject;
+ }
+
+ /**
+ * Removes this node from its parent.
+ */
+ public void removeFromParent()
+ {
+ // FIXME: IS this implementation really correct ?
+ parent = null;
+ }
+
+ /**
+ * Removes all child nodes from this node.
+ */
+ public void removeAllChildren()
+ {
+ children.removeAllElements();
+ }
+
+ /**
+ * isNodeAncestor
+ *
+ * @param node TODO
+ *
+ * @return boolean
+ */
+ public boolean isNodeAncestor(TreeNode node)
+ {
+ if (node == null)
+ return false;
+
+ TreeNode current = this;
+
+ while (current != null
+ && current != node)
+ current = current.getParent();
+
+ return current == node;
+ }
+
+ /**
+ * isNodeDescendant
+ *
+ * @param node0 TODO
+ *
+ * @return boolean
+ */
+ public boolean isNodeDescendant(DefaultMutableTreeNode node)
+ {
+ if (node == null)
+ return false;
+
+ TreeNode current = node;
+
+ while (current != null
+ && current != this)
+ current = current.getParent();
+
+ return current == this;
+ }
+
+ /**
+ * getSharedAncestor
+ *
+ * @param node TODO
+ *
+ * @return TreeNode
+ */
+ public TreeNode getSharedAncestor(DefaultMutableTreeNode node)
+ {
+ TreeNode current = this;
+ ArrayList list = new ArrayList();
+
+ while (current != null)
+ {
+ list.add(current);
+ current = current.getParent();
+ }
+
+ current = node;
+
+ while (current != null)
+ {
+ if (list.contains(current))
+ return current;
+
+ current = current.getParent();
+ }
+
+ return null;
+ }
+
+ /**
+ * isNodeRelated
+ *
+ * @param node TODO
+ *
+ * @return boolean
+ */
+ public boolean isNodeRelated(DefaultMutableTreeNode node)
+ {
+ if (node == null)
+ return false;
+
+ return node.getRoot() == getRoot();
+ }
+
+ /**
+ * getDepth
+ *
+ * @return int
+ */
+ public int getDepth()
+ {
+ if ((! allowsChildren)
+ || children.size() == 0)
+ return 0;
+
+ Stack stack = new Stack();
+ stack.push(new Integer(0));
+ TreeNode node = getChildAt(0);
+ int depth = 0;
+ int current = 1;
+
+ while (! stack.empty())
+ {
+ if (node.getChildCount() != 0)
+ {
+ node = node.getChildAt(0);
+ stack.push(new Integer(0));
+ current++;
+ }
+ else
+ {
+ if (current > depth)
+ depth = current;
+
+ int size;
+ int index;
+
+ do
+ {
+ node = node.getParent();
+ size = node.getChildCount();
+ index = ((Integer) stack.pop()).intValue() + 1;
+ current--;
+ }
+ while (index >= size
+ && node != this);
+
+ if (index < size)
+ {
+ node = node.getChildAt(index);
+ stack.push(new Integer(index));
+ current++;
+ }
+ }
+ }
+
+ return depth;
+ }
+
+ /**
+ * getLevel
+ *
+ * @return int
+ */
+ public int getLevel()
+ {
+ int count = -1;
+ TreeNode current = this;
+
+ do
+ {
+ current = current.getParent();
+ count++;
+ }
+ while (current != null);
+
+ return count;
+ }
+
+ /**
+ * getPathToRoot
+ *
+ * @param node TODO
+ * @param depth TODO
+ *
+ * @return TreeNode[]
+ */
+ protected TreeNode[] getPathToRoot(TreeNode node, int depth)
+ {
+ if (node == null)
+ {
+ if (depth == 0)
+ return null;
+
+ return new TreeNode[depth];
+ }
+
+ TreeNode[] path = getPathToRoot(node.getParent(), depth + 1);
+ path[path.length - depth - 1] = node;
+ return path;
+ }
+
+ /**
+ * getUserObjectPath
+ *
+ * @return Object[]
+ */
+ public Object[] getUserObjectPath()
+ {
+ TreeNode[] path = getPathToRoot(this, 0);
+ Object[] object = new Object[path.length];
+
+ for (int index = 0; index < path.length; ++index)
+ object[index] = ((DefaultMutableTreeNode) path[index]).getUserObject();
+
+ return object;
+ }
+
+ /**
+ * Returns the root node by iterating the parents of this node.
+ *
+ * @return the root node
+ */
+ public TreeNode getRoot()
+ {
+ TreeNode current = this;
+ TreeNode check = current.getParent();
+
+ while (check != null)
+ {
+ current = check;
+ check = current.getParent();
+ }
+
+ return current;
+ }
+
+ /**
+ * Tells whether this node is the root node or not.
+ *
+ * @return <code>true</code> if this is the root node,
+ * <code>false</code>otherwise
+ */
+ public boolean isRoot()
+ {
+ return parent == null;
+ }
+
+ /**
+ * getNextNode
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getNextNode()
+ {
+ // Return first child.
+ if (getChildCount() != 0)
+ return (DefaultMutableTreeNode) getChildAt(0);
+
+ // Return next sibling (if needed the sibling of some parent).
+ DefaultMutableTreeNode node = this;
+ DefaultMutableTreeNode sibling;
+
+ do
+ {
+ sibling = node.getNextSibling();
+ node = (DefaultMutableTreeNode) node.getParent();
+ }
+ while (sibling == null &&
+ node != null);
+
+ // Return sibling.
+ return sibling;
+ }
+
+ /**
+ * getPreviousNode
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getPreviousNode()
+ {
+ // Return null if no parent.
+ if (parent == null)
+ return null;
+
+ DefaultMutableTreeNode sibling = getPreviousSibling();
+
+ // Return parent if no sibling.
+ if (sibling == null)
+ return (DefaultMutableTreeNode) parent;
+
+ // Return last leaf of sibling.
+ if (sibling.getChildCount() != 0)
+ return sibling.getLastLeaf();
+
+ // Return sibling.
+ return sibling;
+ }
+
+ /**
+ * preorderEnumeration
+ *
+ * @return Enumeration
+ */
+ public Enumeration preorderEnumeration()
+ {
+ return null; // TODO: Implement me.
+ }
+
+ /**
+ * postorderEnumeration
+ *
+ * @return Enumeration
+ */
+ public Enumeration postorderEnumeration()
+ {
+ return null; // TODO: Implement me.
+ }
+
+ /**
+ * breadthFirstEnumeration
+ *
+ * @return Enumeration
+ */
+ public Enumeration breadthFirstEnumeration()
+ {
+ return null; // TODO: Implement me.
+ }
+
+ /**
+ * depthFirstEnumeration
+ *
+ * @return Enumeration
+ */
+ public Enumeration depthFirstEnumeration()
+ {
+ return postorderEnumeration();
+ }
+
+ /**
+ * pathFromAncestorEnumeration
+ *
+ * @param node TODO
+ *
+ * @return Enumeration
+ */
+ public Enumeration pathFromAncestorEnumeration(TreeNode node)
+ {
+ if (node == null)
+ throw new IllegalArgumentException();
+
+ TreeNode parent = this;
+ Vector nodes = new Vector();
+ nodes.add(this);
+
+ while (parent != node && parent != null)
+ {
+ parent = parent.getParent();
+ nodes.add(0, parent);
+ }
+
+ if (parent != node)
+ throw new IllegalArgumentException();
+
+ return nodes.elements();
+ }
+
+ /**
+ * isNodeChild
+ *
+ * @param node TODO
+ *
+ * @return boolean
+ */
+ public boolean isNodeChild(TreeNode node)
+ {
+ if (node == null)
+ return false;
+
+ return node.getParent() == this;
+ }
+
+ /**
+ * getFirstChild
+ *
+ * @return TreeNode
+ */
+ public TreeNode getFirstChild()
+ {
+ return (TreeNode) children.firstElement();
+ }
+
+ /**
+ * getLastChild
+ *
+ * @return TreeNode
+ */
+ public TreeNode getLastChild()
+ {
+ return (TreeNode) children.lastElement();
+ }
+
+ /**
+ * getChildAfter
+ *
+ * @param node TODO
+ *
+ * @return TreeNode
+ */
+ public TreeNode getChildAfter(TreeNode node)
+ {
+ if (node == null
+ || node.getParent() != this)
+ throw new IllegalArgumentException();
+
+ int index = getIndex(node) + 1;
+
+ if (index == getChildCount())
+ return null;
+
+ return getChildAt(index);
+ }
+
+ /**
+ * getChildBefore
+ *
+ * @param node TODO
+ *
+ * @return TreeNode
+ */
+ public TreeNode getChildBefore(TreeNode node)
+ {
+ if (node == null
+ || node.getParent() != this)
+ throw new IllegalArgumentException();
+
+ int index = getIndex(node) - 1;
+
+ if (index < 0)
+ return null;
+
+ return getChildAt(index);
+ }
+
+ /**
+ * isNodeSibling
+ *
+ * @param node TODO
+ *
+ * @return boolean
+ */
+ public boolean isNodeSibling(TreeNode node)
+ {
+ if (node == null)
+ return false;
+
+ return (node.getParent() == getParent()
+ && getParent() != null);
+ }
+
+ /**
+ * getSiblingCount
+ *
+ * @return int
+ */
+ public int getSiblingCount()
+ {
+ if (parent == null)
+ return 1;
+
+ return parent.getChildCount();
+ }
+
+ /**
+ * getNextSibling
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getNextSibling()
+ {
+ if (parent == null)
+ return null;
+
+ int index = parent.getIndex(this) + 1;
+
+ if (index == parent.getChildCount())
+ return null;
+
+ return (DefaultMutableTreeNode) parent.getChildAt(index);
+ }
+
+ /**
+ * getPreviousSibling
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getPreviousSibling()
+ {
+ if (parent == null)
+ return null;
+
+ int index = parent.getIndex(this) - 1;
+
+ if (index < 0)
+ return null;
+
+ return (DefaultMutableTreeNode) parent.getChildAt(index);
+ }
+
+ /**
+ * isLeaf
+ *
+ * @return boolean
+ */
+ public boolean isLeaf()
+ {
+ return children.size() == 0;
+ }
+
+ /**
+ * getFirstLeaf
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getFirstLeaf()
+ {
+ TreeNode current = this;
+
+ while (current.getChildCount() > 0)
+ current = current.getChildAt(0);
+
+ return (DefaultMutableTreeNode) current;
+ }
+
+ /**
+ * getLastLeaf
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getLastLeaf()
+ {
+ TreeNode current = this;
+ int size = current.getChildCount();
+
+ while (size > 0)
+ {
+ current = current.getChildAt(size - 1);
+ size = current.getChildCount();
+ }
+
+ return (DefaultMutableTreeNode) current;
+ }
+
+ /**
+ * getNextLeaf
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getNextLeaf()
+ {
+ if (parent == null)
+ return null;
+
+ return null;
+ //return parent.getChildAfter(this);
+ }
+
+ /**
+ * getPreviousLeaf
+ *
+ * @return DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getPreviousLeaf()
+ {
+ if (parent == null)
+ return null;
+
+ return null;
+ //return parent.getChildBefore(this);
+ }
+
+ /**
+ * getLeafCount
+ *
+ * @return int
+ */
+ public int getLeafCount()
+ {
+ int count = 0;
+ Enumeration e = depthFirstEnumeration();
+
+ while (e.hasMoreElements())
+ {
+ TreeNode current = (TreeNode) e.nextElement();
+
+ if (current.isLeaf())
+ count++;
+ }
+
+ return count;
+ }
+}
diff --git a/libjava/javax/swing/tree/MutableTreeNode.java b/libjava/javax/swing/tree/MutableTreeNode.java
index ff038d5b3f1..1f0c943aad9 100644
--- a/libjava/javax/swing/tree/MutableTreeNode.java
+++ b/libjava/javax/swing/tree/MutableTreeNode.java
@@ -1,5 +1,5 @@
/* MutableTreeNode.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,45 +39,66 @@ package javax.swing.tree;
/**
* MutableTreeNode public interface
+
* @author Andrew Selkirk
*/
-public interface MutableTreeNode extends TreeNode {
-
- /**
- * insert
- * @param child MutableTreeNode
- * @param index Index
- */
- void insert(MutableTreeNode child, int index);
-
- /**
- * remove
- * @param index Index
- */
- void remove(int index);
-
- /**
- * remove
- * @param node MutableTreeNode
- */
- void remove(MutableTreeNode node);
-
- /**
- * setUserObject
- * @param object Object
- */
- void setUserObject(Object object);
-
- /**
- * removeFromParent
- */
- void removeFromParent();
-
- /**
- * setParent
- * @param parent MutableTreeNode
- */
- void setParent(MutableTreeNode parent);
-
-
-} // MutableTreeNode
+public interface MutableTreeNode extends TreeNode
+{
+ /**
+ * Inserts a node as child at a given index.
+ *
+ * @param child the note to insert
+ * @param index the index
+ *
+ * @see #remove(int)
+ * @see #remove(MutableTreeNode)
+ * @see #setParent(MutableTreeNode)
+ */
+ void insert(MutableTreeNode child, int index);
+
+ /**
+ * Removes the child node a given index.
+ *
+ * @param index the index
+ *
+ * @see #add(MutableTreeNode,int)
+ * @see #remove(MutableTreeNode)
+ * @see #removeFromParent()
+ */
+ void remove(int index);
+
+ /**
+ * Removes a given child node.
+ *
+ * @param node the node to remove
+ *
+ * @see #add(MutableTreeNode,int)
+ * @see #remove(int)
+ * @see #removeFromParent()
+ */
+ void remove(MutableTreeNode node);
+
+ /**
+ * Sets a user object, the data represented by the node.
+ *
+ * @param object the data
+ */
+ void setUserObject(Object object);
+
+ /**
+ * Removes this node from its parent.
+ *
+ * @see #remove(int)
+ * @see #remove(MutableTreeNode)
+ */
+ void removeFromParent();
+
+ /**
+ * Sets the parent of the node.
+ *
+ * @param parent the parent
+ *
+ * @see insert(MutableTreeNode,int)
+ */
+ void setParent(MutableTreeNode parent);
+}
diff --git a/libjava/javax/swing/tree/TreeCellEditor.java b/libjava/javax/swing/tree/TreeCellEditor.java
index d9de676dd8d..4b4357a1611 100644
--- a/libjava/javax/swing/tree/TreeCellEditor.java
+++ b/libjava/javax/swing/tree/TreeCellEditor.java
@@ -49,19 +49,17 @@ import javax.swing.JTree;
*/
public interface TreeCellEditor extends CellEditor
{
- /**
- * getTreeCellEditorComponent
- * @param tree TODO
- * @param value TODO
- * @param isSelected TODO
- * @param expanded TODO
- * @param leaf TODO
- * @param row TODO
- * @returns TODO
- */
- Component getTreeCellEditorComponent(JTree tree,
- Object value, boolean isSelected, boolean expanded,
- boolean leaf, int row);
-
-
-} // TreeCellEditor
+ /**
+ * getTreeCellEditorComponent
+ * @param tree TODO
+ * @param value TODO
+ * @param isSelected TODO
+ * @param expanded TODO
+ * @param leaf TODO
+ * @param row TODO
+ * @return TODO
+ */
+ Component getTreeCellEditorComponent(JTree tree, Object value,
+ boolean isSelected, boolean expanded,
+ boolean leaf, int row);
+}
diff --git a/libjava/javax/swing/undo/UndoManager.java b/libjava/javax/swing/undo/UndoManager.java
index c1b7cb88ffa..fcdcf34ec0f 100644
--- a/libjava/javax/swing/undo/UndoManager.java
+++ b/libjava/javax/swing/undo/UndoManager.java
@@ -1,5 +1,5 @@
/* AbstractTableModel.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -81,7 +81,7 @@ import javax.swing.event.UndoableEditListener;
* {@link javax.swing.event.UndoableEvent} sources do not need to
* broadcast their events from inside the Swing worker thread.
*
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class UndoManager
extends CompoundEdit
diff --git a/libjava/javax/swing/undo/UndoableEditSupport.java b/libjava/javax/swing/undo/UndoableEditSupport.java
index 8b4cef77588..80234aa8a75 100644
--- a/libjava/javax/swing/undo/UndoableEditSupport.java
+++ b/libjava/javax/swing/undo/UndoableEditSupport.java
@@ -1,5 +1,5 @@
/* UndoableEditSupport.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,8 +48,8 @@ import javax.swing.event.UndoableEditListener;
* A helper class for supporting {@link
* javax.swing.event.UndoableEditListener}.
*
- * @author <a href="mailto:aselkirk@sympatico.ca">Andrew Selkirk</a>
- * @author <a href="mailto:brawer@dandelis.ch">Sascha Brawer</a>
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public class UndoableEditSupport
{
diff --git a/libjava/javax/transaction/HeuristicCommitException.java b/libjava/javax/transaction/HeuristicCommitException.java
index e1ef8e2def2..15d3091f220 100644
--- a/libjava/javax/transaction/HeuristicCommitException.java
+++ b/libjava/javax/transaction/HeuristicCommitException.java
@@ -1,5 +1,5 @@
/* HeuristicCommitException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/HeuristicMixedException.java b/libjava/javax/transaction/HeuristicMixedException.java
index 68986b60672..8ac7ecd7d83 100644
--- a/libjava/javax/transaction/HeuristicMixedException.java
+++ b/libjava/javax/transaction/HeuristicMixedException.java
@@ -1,5 +1,5 @@
/* HeuristicMixedException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/HeuristicRollbackException.java b/libjava/javax/transaction/HeuristicRollbackException.java
index 72ac3b4d4d5..e3f77c412eb 100644
--- a/libjava/javax/transaction/HeuristicRollbackException.java
+++ b/libjava/javax/transaction/HeuristicRollbackException.java
@@ -1,5 +1,5 @@
/* HeuristicRollbackException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/InvalidTransactionException.java b/libjava/javax/transaction/InvalidTransactionException.java
index 0c47912be46..bcc31eb295d 100644
--- a/libjava/javax/transaction/InvalidTransactionException.java
+++ b/libjava/javax/transaction/InvalidTransactionException.java
@@ -1,5 +1,5 @@
/* InvalidTransactionException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.transaction;
import java.rmi.RemoteException;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date April 18, 2001
*/
diff --git a/libjava/javax/transaction/NotSupportedException.java b/libjava/javax/transaction/NotSupportedException.java
index b239574fcb4..16462beb1b5 100644
--- a/libjava/javax/transaction/NotSupportedException.java
+++ b/libjava/javax/transaction/NotSupportedException.java
@@ -1,5 +1,5 @@
/* NotSupportedException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/RollbackException.java b/libjava/javax/transaction/RollbackException.java
index c8706f5bb86..2f0ad46c8f9 100644
--- a/libjava/javax/transaction/RollbackException.java
+++ b/libjava/javax/transaction/RollbackException.java
@@ -1,5 +1,5 @@
/* RollbackException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/Status.java b/libjava/javax/transaction/Status.java
index 7b3c4aea946..3f47b5227cf 100644
--- a/libjava/javax/transaction/Status.java
+++ b/libjava/javax/transaction/Status.java
@@ -1,5 +1,5 @@
/* Status.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/Synchronization.java b/libjava/javax/transaction/Synchronization.java
index e8d8eb917f8..7cd02489fe5 100644
--- a/libjava/javax/transaction/Synchronization.java
+++ b/libjava/javax/transaction/Synchronization.java
@@ -1,5 +1,5 @@
/* Synchronization.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/SystemException.java b/libjava/javax/transaction/SystemException.java
index ed9c9e4f273..e2339938b7a 100644
--- a/libjava/javax/transaction/SystemException.java
+++ b/libjava/javax/transaction/SystemException.java
@@ -1,5 +1,5 @@
/* SystemException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/Transaction.java b/libjava/javax/transaction/Transaction.java
index 55303b7c782..0c0910c172a 100644
--- a/libjava/javax/transaction/Transaction.java
+++ b/libjava/javax/transaction/Transaction.java
@@ -1,5 +1,5 @@
/* Transaction.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,7 +41,7 @@ package javax.transaction;
import javax.transaction.xa.XAResource;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/TransactionManager.java b/libjava/javax/transaction/TransactionManager.java
index 0a79bd3f6de..f8a26f1df55 100644
--- a/libjava/javax/transaction/TransactionManager.java
+++ b/libjava/javax/transaction/TransactionManager.java
@@ -1,5 +1,5 @@
/* TransactionManager.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/TransactionRequiredException.java b/libjava/javax/transaction/TransactionRequiredException.java
index ebc5679d941..ec624270f69 100644
--- a/libjava/javax/transaction/TransactionRequiredException.java
+++ b/libjava/javax/transaction/TransactionRequiredException.java
@@ -1,5 +1,5 @@
/* TransactionRequiredException --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.transaction;
import java.rmi.RemoteException;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date April 18, 2001
*/
diff --git a/libjava/javax/transaction/TransactionRolledbackException.java b/libjava/javax/transaction/TransactionRolledbackException.java
index ef4f1cc2641..45ac60fd817 100644
--- a/libjava/javax/transaction/TransactionRolledbackException.java
+++ b/libjava/javax/transaction/TransactionRolledbackException.java
@@ -1,5 +1,5 @@
/* TransactionRolledbackException --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.transaction;
import java.rmi.RemoteException;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date April 18, 2001
*/
diff --git a/libjava/javax/transaction/UserTransaction.java b/libjava/javax/transaction/UserTransaction.java
index 1327a0c50ea..00dbd206226 100644
--- a/libjava/javax/transaction/UserTransaction.java
+++ b/libjava/javax/transaction/UserTransaction.java
@@ -1,5 +1,5 @@
/* UserTransaction.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ exception statement from your version. */
package javax.transaction;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/xa/XAException.java b/libjava/javax/transaction/xa/XAException.java
index 48c7ca8126d..96e614e8404 100644
--- a/libjava/javax/transaction/xa/XAException.java
+++ b/libjava/javax/transaction/xa/XAException.java
@@ -1,5 +1,5 @@
/* XAException.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,7 @@ exception statement from your version. */
package javax.transaction.xa;
/**
- * @author Tom Tromey <tromey@redhat.com>
+ * @author Tom Tromey (tromey@redhat.com)
* @date April 18, 2001
*/
diff --git a/libjava/javax/transaction/xa/XAResource.java b/libjava/javax/transaction/xa/XAResource.java
index 6fd0717e2d0..194b02f867e 100644
--- a/libjava/javax/transaction/xa/XAResource.java
+++ b/libjava/javax/transaction/xa/XAResource.java
@@ -1,5 +1,5 @@
/* XAResource.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,7 @@ exception statement from your version. */
package javax.transaction.xa;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/transaction/xa/Xid.java b/libjava/javax/transaction/xa/Xid.java
index c91843d303b..e34256dc8de 100644
--- a/libjava/javax/transaction/xa/Xid.java
+++ b/libjava/javax/transaction/xa/Xid.java
@@ -1,5 +1,5 @@
/* Xid.java --
- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,7 @@ exception statement from your version. */
package javax.transaction.xa;
/**
- * @author Warren Levy <warrenl@redhat.com>
+ * @author Warren Levy (warrenl@redhat.com)
* @date May 25, 2001
*/
diff --git a/libjava/javax/xml/XMLConstants.java b/libjava/javax/xml/XMLConstants.java
index 4b9b0661736..4c256f44329 100644
--- a/libjava/javax/xml/XMLConstants.java
+++ b/libjava/javax/xml/XMLConstants.java
@@ -1,5 +1,5 @@
/* XMLConstants.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml;
/**
* Repository for well-known XML constants.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public final class XMLConstants
diff --git a/libjava/javax/xml/datatype/DatatypeConfigurationException.java b/libjava/javax/xml/datatype/DatatypeConfigurationException.java
index 15440798807..0e3243b87f0 100644
--- a/libjava/javax/xml/datatype/DatatypeConfigurationException.java
+++ b/libjava/javax/xml/datatype/DatatypeConfigurationException.java
@@ -1,5 +1,5 @@
/* DatatypeConfigurationException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.datatype;
/**
* A serious error during datatype configuration.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public class DatatypeConfigurationException
diff --git a/libjava/javax/xml/datatype/DatatypeConstants.java b/libjava/javax/xml/datatype/DatatypeConstants.java
index a761f88d50e..5724502e7e7 100644
--- a/libjava/javax/xml/datatype/DatatypeConstants.java
+++ b/libjava/javax/xml/datatype/DatatypeConstants.java
@@ -1,5 +1,5 @@
/* DatatypeConstants.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import javax.xml.namespace.QName;
/**
* Basic data type constants.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public final class DatatypeConstants
diff --git a/libjava/javax/xml/datatype/DatatypeFactory.java b/libjava/javax/xml/datatype/DatatypeFactory.java
index 2299435fc4a..b3c8cf43142 100644
--- a/libjava/javax/xml/datatype/DatatypeFactory.java
+++ b/libjava/javax/xml/datatype/DatatypeFactory.java
@@ -1,5 +1,5 @@
/* DatatypeFactory.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import java.util.GregorianCalendar;
* Factory class to create new datatype objects mapping XML to and from Java
* objects.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class DatatypeFactory
diff --git a/libjava/javax/xml/datatype/Duration.java b/libjava/javax/xml/datatype/Duration.java
index ed1221dbf20..b7d188cd7b8 100644
--- a/libjava/javax/xml/datatype/Duration.java
+++ b/libjava/javax/xml/datatype/Duration.java
@@ -1,5 +1,5 @@
/* Duration.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import javax.xml.namespace.QName;
/**
* An immutable time space as specified in XML Schema 1.0.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class Duration
diff --git a/libjava/javax/xml/datatype/XMLGregorianCalendar.java b/libjava/javax/xml/datatype/XMLGregorianCalendar.java
index c3585a48905..48280381c9c 100644
--- a/libjava/javax/xml/datatype/XMLGregorianCalendar.java
+++ b/libjava/javax/xml/datatype/XMLGregorianCalendar.java
@@ -1,5 +1,5 @@
/* XMLGregorianCalendar.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import javax.xml.namespace.QName;
/**
* An XML Schema 1.0 date/time data type.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class XMLGregorianCalendar
diff --git a/libjava/javax/xml/namespace/NamespaceContext.java b/libjava/javax/xml/namespace/NamespaceContext.java
index 2e790654870..4b768dcdeb7 100644
--- a/libjava/javax/xml/namespace/NamespaceContext.java
+++ b/libjava/javax/xml/namespace/NamespaceContext.java
@@ -1,5 +1,5 @@
/* NamespaceContext.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import java.util.Iterator;
/**
* Interface by which namespace properties are made available.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public interface NamespaceContext
diff --git a/libjava/javax/xml/namespace/QName.java b/libjava/javax/xml/namespace/QName.java
index 62dc8cd08a6..fbb222efc07 100644
--- a/libjava/javax/xml/namespace/QName.java
+++ b/libjava/javax/xml/namespace/QName.java
@@ -1,5 +1,5 @@
/* QName.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import javax.xml.XMLConstants;
* An XML
* <a href='http://www.w3.org/TR/REC-xml-names/#ns-qualnames'>qualified name</a>.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public class QName
diff --git a/libjava/javax/xml/parsers/DocumentBuilder.java b/libjava/javax/xml/parsers/DocumentBuilder.java
index 13d7658de36..15130e89583 100644
--- a/libjava/javax/xml/parsers/DocumentBuilder.java
+++ b/libjava/javax/xml/parsers/DocumentBuilder.java
@@ -1,5 +1,5 @@
/* DocumentBuilder.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,6 @@ import org.w3c.dom.DOMImplementation;
import org.xml.sax.InputSource;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
@@ -55,7 +54,7 @@ import org.xml.sax.SAXException;
* graph.
* Instances of this class are <em>not</em> guaranteed to be thread safe.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class DocumentBuilder
{
diff --git a/libjava/javax/xml/parsers/DocumentBuilderFactory.java b/libjava/javax/xml/parsers/DocumentBuilderFactory.java
index c531005164d..1ba51d0217f 100644
--- a/libjava/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/libjava/javax/xml/parsers/DocumentBuilderFactory.java
@@ -1,5 +1,5 @@
/* DocumentBuilderFactory.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,15 +45,12 @@ import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Properties;
import javax.xml.validation.Schema;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
/**
* Factory for obtaining document builders.
* Instances of this class are <em>not</em> guaranteed to be thread safe.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class DocumentBuilderFactory
{
diff --git a/libjava/javax/xml/parsers/FactoryConfigurationError.java b/libjava/javax/xml/parsers/FactoryConfigurationError.java
index e7ff57e2a90..351b340a0e0 100644
--- a/libjava/javax/xml/parsers/FactoryConfigurationError.java
+++ b/libjava/javax/xml/parsers/FactoryConfigurationError.java
@@ -1,5 +1,5 @@
/* FactoryConfigurationError.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.parsers;
/**
* An error occurred during configuration of the parser factory.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class FactoryConfigurationError
extends Error
diff --git a/libjava/javax/xml/parsers/ParserConfigurationException.java b/libjava/javax/xml/parsers/ParserConfigurationException.java
index d7b54cf7b46..a8cd546cf20 100644
--- a/libjava/javax/xml/parsers/ParserConfigurationException.java
+++ b/libjava/javax/xml/parsers/ParserConfigurationException.java
@@ -1,5 +1,5 @@
/* ParserConfigurationException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.parsers;
/**
* An exception occurred during configuration of the XML parser.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class ParserConfigurationException
extends Exception
diff --git a/libjava/javax/xml/parsers/SAXParser.java b/libjava/javax/xml/parsers/SAXParser.java
index 10289dc6a20..f05cc510dec 100644
--- a/libjava/javax/xml/parsers/SAXParser.java
+++ b/libjava/javax/xml/parsers/SAXParser.java
@@ -1,5 +1,5 @@
/* SAXParser.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -55,7 +55,7 @@ import org.xml.sax.helpers.DefaultHandler;
* Convenience class for using or accessing a SAX version 1 or 2 parser.
* Instances of this class are <em>not</em> guaranteed to be thread safe.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class SAXParser
{
diff --git a/libjava/javax/xml/parsers/SAXParserFactory.java b/libjava/javax/xml/parsers/SAXParserFactory.java
index 143ee620697..7b87bf24e72 100644
--- a/libjava/javax/xml/parsers/SAXParserFactory.java
+++ b/libjava/javax/xml/parsers/SAXParserFactory.java
@@ -1,5 +1,5 @@
/* SAXParserFactory.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,7 @@ import org.xml.sax.SAXNotSupportedException;
* Factory for obtaining SAX parsers.
* Instances of this class are <em>not</em> guaranteed to be thread safe.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class SAXParserFactory
{
diff --git a/libjava/javax/xml/transform/ErrorListener.java b/libjava/javax/xml/transform/ErrorListener.java
index f2021cd02d3..153de5c6612 100644
--- a/libjava/javax/xml/transform/ErrorListener.java
+++ b/libjava/javax/xml/transform/ErrorListener.java
@@ -1,5 +1,5 @@
/* ErrorListener.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.transform;
* Error reporting callback handler.
* Equivalent to the SAX ErrorHandler.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface ErrorListener
{
diff --git a/libjava/javax/xml/transform/OutputKeys.java b/libjava/javax/xml/transform/OutputKeys.java
index 784194c87d6..f034a921bd6 100644
--- a/libjava/javax/xml/transform/OutputKeys.java
+++ b/libjava/javax/xml/transform/OutputKeys.java
@@ -1,5 +1,5 @@
/* OutputKeys.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.transform;
/**
* Constants for XSLT output attributes.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class OutputKeys
{
diff --git a/libjava/javax/xml/transform/Result.java b/libjava/javax/xml/transform/Result.java
index ec9420f6e41..88b4659ca56 100644
--- a/libjava/javax/xml/transform/Result.java
+++ b/libjava/javax/xml/transform/Result.java
@@ -1,5 +1,5 @@
/* Result.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ package javax.xml.transform;
/**
* The result of an XSL transformation.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface Result
{
diff --git a/libjava/javax/xml/transform/Source.java b/libjava/javax/xml/transform/Source.java
index 4d6002b5344..ef1730a6899 100644
--- a/libjava/javax/xml/transform/Source.java
+++ b/libjava/javax/xml/transform/Source.java
@@ -1,5 +1,5 @@
/* Source.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.transform;
* An XML input source.
* This is equivalent to a SAX InputSource.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface Source
{
diff --git a/libjava/javax/xml/transform/SourceLocator.java b/libjava/javax/xml/transform/SourceLocator.java
index dfeea46d143..bc39e52db61 100644
--- a/libjava/javax/xml/transform/SourceLocator.java
+++ b/libjava/javax/xml/transform/SourceLocator.java
@@ -1,5 +1,5 @@
/* SourceLocator.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.transform;
* The location in an XML resource at which an event occurred.
* Tis is equivalent to the SAX Locator.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface SourceLocator
{
diff --git a/libjava/javax/xml/transform/Templates.java b/libjava/javax/xml/transform/Templates.java
index 3e9293ee122..2cae7adfb73 100644
--- a/libjava/javax/xml/transform/Templates.java
+++ b/libjava/javax/xml/transform/Templates.java
@@ -1,5 +1,5 @@
/* Templates.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.util.Properties;
* A compiled, reusable XSL transformation.
* Implementations of this class are guaranteed to be thread safe.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface Templates
{
diff --git a/libjava/javax/xml/transform/Transformer.java b/libjava/javax/xml/transform/Transformer.java
index 3bf1e886de4..fe2a9ce3432 100644
--- a/libjava/javax/xml/transform/Transformer.java
+++ b/libjava/javax/xml/transform/Transformer.java
@@ -1,5 +1,5 @@
/* Transformer.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import java.util.Properties;
* Instances of this class may be reused, but the same instance may not be
* used concurrently by different threads.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class Transformer
{
diff --git a/libjava/javax/xml/transform/TransformerConfigurationException.java b/libjava/javax/xml/transform/TransformerConfigurationException.java
index 006fc2f4f22..9915d1a0d3f 100644
--- a/libjava/javax/xml/transform/TransformerConfigurationException.java
+++ b/libjava/javax/xml/transform/TransformerConfigurationException.java
@@ -1,5 +1,5 @@
/* TransformerConfigurationException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.transform;
/**
* An exception occurred during configuration of the transformer.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class TransformerConfigurationException
extends TransformerException
diff --git a/libjava/javax/xml/transform/TransformerException.java b/libjava/javax/xml/transform/TransformerException.java
index c10fa8a4fc2..7e40cd294a4 100644
--- a/libjava/javax/xml/transform/TransformerException.java
+++ b/libjava/javax/xml/transform/TransformerException.java
@@ -1,5 +1,5 @@
/* TransformerException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import java.io.PrintWriter;
/**
* An exception occurred during the transformation process.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class TransformerException
extends Exception
diff --git a/libjava/javax/xml/transform/TransformerFactory.java b/libjava/javax/xml/transform/TransformerFactory.java
index a1f50fc2466..53d9173cdde 100644
--- a/libjava/javax/xml/transform/TransformerFactory.java
+++ b/libjava/javax/xml/transform/TransformerFactory.java
@@ -1,5 +1,5 @@
/* TransformerFactory.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.util.Properties;
/**
* Factory for obtaining transformation contexts.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class TransformerFactory
{
diff --git a/libjava/javax/xml/transform/TransformerFactoryConfigurationError.java b/libjava/javax/xml/transform/TransformerFactoryConfigurationError.java
index 3ec8809918b..ae1521f9354 100644
--- a/libjava/javax/xml/transform/TransformerFactoryConfigurationError.java
+++ b/libjava/javax/xml/transform/TransformerFactoryConfigurationError.java
@@ -1,5 +1,5 @@
/* TransformerFactoryConfigurationError.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,7 +39,7 @@ package javax.xml.transform;
/**
* An error occurred during configuration of the transformer factory.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class TransformerFactoryConfigurationError
extends Error
diff --git a/libjava/javax/xml/transform/URIResolver.java b/libjava/javax/xml/transform/URIResolver.java
index 7dca029e836..a859b7a9266 100644
--- a/libjava/javax/xml/transform/URIResolver.java
+++ b/libjava/javax/xml/transform/URIResolver.java
@@ -1,5 +1,5 @@
/* URIResolver.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.transform;
* Callback that can resolve a URI into source XML for transformation.
* Equivalent to the SAX EntityResolver.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface URIResolver
{
diff --git a/libjava/javax/xml/transform/dom/DOMLocator.java b/libjava/javax/xml/transform/dom/DOMLocator.java
index 7e0f8304eda..29953bed263 100644
--- a/libjava/javax/xml/transform/dom/DOMLocator.java
+++ b/libjava/javax/xml/transform/dom/DOMLocator.java
@@ -1,5 +1,5 @@
/* DOMLocator.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import org.w3c.dom.Node;
/**
* Locator for reporting a location in a W3C DOM object graph.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface DOMLocator
extends SourceLocator
diff --git a/libjava/javax/xml/transform/dom/DOMResult.java b/libjava/javax/xml/transform/dom/DOMResult.java
index e62e30bfca0..5a4ee3337e0 100644
--- a/libjava/javax/xml/transform/dom/DOMResult.java
+++ b/libjava/javax/xml/transform/dom/DOMResult.java
@@ -1,5 +1,5 @@
/* DOMResult.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import org.w3c.dom.Node;
* If no target node is specified, the result tree will be made available by
* the {@link #getNode} method after the transformation.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class DOMResult
implements Result
diff --git a/libjava/javax/xml/transform/dom/DOMSource.java b/libjava/javax/xml/transform/dom/DOMSource.java
index e002dbf06b9..d87c4fba7fa 100644
--- a/libjava/javax/xml/transform/dom/DOMSource.java
+++ b/libjava/javax/xml/transform/dom/DOMSource.java
@@ -1,5 +1,5 @@
/* DOMSource.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import org.w3c.dom.Node;
/**
* An XML source specified as a W3C DOM node context.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class DOMSource
implements Source
diff --git a/libjava/javax/xml/transform/sax/SAXResult.java b/libjava/javax/xml/transform/sax/SAXResult.java
index d9bf9a57ed3..94cbacdf478 100644
--- a/libjava/javax/xml/transform/sax/SAXResult.java
+++ b/libjava/javax/xml/transform/sax/SAXResult.java
@@ -1,5 +1,5 @@
/* SAXResult.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,7 @@ import org.xml.sax.ext.LexicalHandler;
* Specifies SAX handlers to be used as a result sink during a
* transformation.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class SAXResult implements Result
{
diff --git a/libjava/javax/xml/transform/sax/SAXSource.java b/libjava/javax/xml/transform/sax/SAXSource.java
index 15df252c727..f26a433522f 100644
--- a/libjava/javax/xml/transform/sax/SAXSource.java
+++ b/libjava/javax/xml/transform/sax/SAXSource.java
@@ -1,5 +1,5 @@
/* SAXSource.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import org.xml.sax.XMLReader;
* Specifies a SAX XML source. This is a tuple of input source and SAX
* parser.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class SAXSource
implements Source
diff --git a/libjava/javax/xml/transform/sax/SAXTransformerFactory.java b/libjava/javax/xml/transform/sax/SAXTransformerFactory.java
index 66d51979b7e..e73b3169622 100644
--- a/libjava/javax/xml/transform/sax/SAXTransformerFactory.java
+++ b/libjava/javax/xml/transform/sax/SAXTransformerFactory.java
@@ -1,5 +1,5 @@
/* SAXTransformerFactory.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,13 +37,10 @@ exception statement from your version. */
package javax.xml.transform.sax;
-import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
-import org.xml.sax.InputSource;
import org.xml.sax.XMLFilter;
/**
@@ -52,7 +49,7 @@ import org.xml.sax.XMLFilter;
* This factory provides SAX content handlers that can create transformation
* templates and transformers.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public abstract class SAXTransformerFactory extends TransformerFactory
{
diff --git a/libjava/javax/xml/transform/sax/TemplatesHandler.java b/libjava/javax/xml/transform/sax/TemplatesHandler.java
index 8ee840d70f2..f4d288b3215 100644
--- a/libjava/javax/xml/transform/sax/TemplatesHandler.java
+++ b/libjava/javax/xml/transform/sax/TemplatesHandler.java
@@ -1,5 +1,5 @@
/* TemplatesHandler.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,7 +44,7 @@ import org.xml.sax.ContentHandler;
* A content handler that processes SAX parse events into a compiled
* transformation template.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface TemplatesHandler
extends ContentHandler
diff --git a/libjava/javax/xml/transform/sax/TransformerHandler.java b/libjava/javax/xml/transform/sax/TransformerHandler.java
index 0b2b1bd24d7..3341f621c20 100644
--- a/libjava/javax/xml/transform/sax/TransformerHandler.java
+++ b/libjava/javax/xml/transform/sax/TransformerHandler.java
@@ -1,5 +1,5 @@
/* TransformerHandler.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import org.xml.sax.ext.LexicalHandler;
/**
* A content handler that transforms SAX events into a result tree.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public interface TransformerHandler
extends ContentHandler, LexicalHandler, DTDHandler
diff --git a/libjava/javax/xml/transform/stream/StreamResult.java b/libjava/javax/xml/transform/stream/StreamResult.java
index fe4462d920d..df7b0dd9987 100644
--- a/libjava/javax/xml/transform/stream/StreamResult.java
+++ b/libjava/javax/xml/transform/stream/StreamResult.java
@@ -1,5 +1,5 @@
/* StreamResult.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import javax.xml.transform.Result;
/**
* Specifies a stream to which to write the transformation result.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class StreamResult
implements Result
diff --git a/libjava/javax/xml/transform/stream/StreamSource.java b/libjava/javax/xml/transform/stream/StreamSource.java
index d65dcafed4f..f6499a4d989 100644
--- a/libjava/javax/xml/transform/stream/StreamSource.java
+++ b/libjava/javax/xml/transform/stream/StreamSource.java
@@ -1,5 +1,5 @@
/* StreamSource.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import javax.xml.transform.Source;
/**
* Specifies a stream from which to read the source XML data.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
*/
public class StreamSource
implements Source
diff --git a/libjava/javax/xml/validation/Schema.java b/libjava/javax/xml/validation/Schema.java
index 099a77e0b98..fc196e104c6 100644
--- a/libjava/javax/xml/validation/Schema.java
+++ b/libjava/javax/xml/validation/Schema.java
@@ -1,5 +1,5 @@
/* Schema.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.validation;
/**
* An immutable grammar.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class Schema
diff --git a/libjava/javax/xml/validation/SchemaFactory.java b/libjava/javax/xml/validation/SchemaFactory.java
index 4310cc5f543..3c5155d22b4 100644
--- a/libjava/javax/xml/validation/SchemaFactory.java
+++ b/libjava/javax/xml/validation/SchemaFactory.java
@@ -1,5 +1,5 @@
/* SchemaFactory.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,7 +50,7 @@ import org.xml.sax.SAXNotSupportedException;
/**
* Factory for obtaining schemata.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class SchemaFactory
diff --git a/libjava/javax/xml/validation/TypeInfoProvider.java b/libjava/javax/xml/validation/TypeInfoProvider.java
index bec632ca64a..11da16c15f8 100644
--- a/libjava/javax/xml/validation/TypeInfoProvider.java
+++ b/libjava/javax/xml/validation/TypeInfoProvider.java
@@ -1,5 +1,5 @@
/* TypeInfoProvider.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import org.w3c.dom.TypeInfo;
* Provides access to the PSVI type info supplied by
* <code>ValidatorHandler</code>.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class TypeInfoProvider
diff --git a/libjava/javax/xml/validation/Validator.java b/libjava/javax/xml/validation/Validator.java
index 291bcbdafa9..48107ee1d2f 100644
--- a/libjava/javax/xml/validation/Validator.java
+++ b/libjava/javax/xml/validation/Validator.java
@@ -1,5 +1,5 @@
/* Validator.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -49,7 +49,7 @@ import org.xml.sax.SAXNotSupportedException;
/**
* A processor that validates a document against a schema.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class Validator
diff --git a/libjava/javax/xml/validation/ValidatorHandler.java b/libjava/javax/xml/validation/ValidatorHandler.java
index dc36909ecaa..c7427e68059 100644
--- a/libjava/javax/xml/validation/ValidatorHandler.java
+++ b/libjava/javax/xml/validation/ValidatorHandler.java
@@ -1,5 +1,5 @@
/* ValidatorHandler.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,7 +46,7 @@ import org.xml.sax.SAXNotSupportedException;
/**
* A streaming validator that operates on a SAX event stream.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class ValidatorHandler
diff --git a/libjava/javax/xml/xpath/XPathConstants.java b/libjava/javax/xml/xpath/XPathConstants.java
index a4b0b163fdb..70b9d45518f 100644
--- a/libjava/javax/xml/xpath/XPathConstants.java
+++ b/libjava/javax/xml/xpath/XPathConstants.java
@@ -1,5 +1,5 @@
/* XPathConstants.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import javax.xml.namespace.QName;
/**
* XPath constants.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public class XPathConstants
diff --git a/libjava/javax/xml/xpath/XPathException.java b/libjava/javax/xml/xpath/XPathException.java
index 4ca992bb015..a6e59ae2386 100644
--- a/libjava/javax/xml/xpath/XPathException.java
+++ b/libjava/javax/xml/xpath/XPathException.java
@@ -1,5 +1,5 @@
/* XPathException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import java.io.PrintWriter;
/**
* A generic XPath exception.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public class XPathException
diff --git a/libjava/javax/xml/xpath/XPathExpression.java b/libjava/javax/xml/xpath/XPathExpression.java
index b7af8f6bb3a..b87fbd2d5e3 100644
--- a/libjava/javax/xml/xpath/XPathExpression.java
+++ b/libjava/javax/xml/xpath/XPathExpression.java
@@ -1,5 +1,5 @@
/* XPathExpression.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,7 +43,7 @@ import org.xml.sax.InputSource;
/**
* An XPath expression.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public interface XPathExpression
diff --git a/libjava/javax/xml/xpath/XPathExpressionException.java b/libjava/javax/xml/xpath/XPathExpressionException.java
index 4ba19915428..ff10c3014cb 100644
--- a/libjava/javax/xml/xpath/XPathExpressionException.java
+++ b/libjava/javax/xml/xpath/XPathExpressionException.java
@@ -1,5 +1,5 @@
/* XPathExpressionException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.xpath;
/**
* An exception in an XPath expression.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public class XPathExpressionException
diff --git a/libjava/javax/xml/xpath/XPathFactory.java b/libjava/javax/xml/xpath/XPathFactory.java
index 64076f51ded..8aad6cf7a22 100644
--- a/libjava/javax/xml/xpath/XPathFactory.java
+++ b/libjava/javax/xml/xpath/XPathFactory.java
@@ -1,5 +1,5 @@
/* XPathFactory.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,7 +48,7 @@ import java.util.Properties;
/**
* Factory for creating XPath environments.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public abstract class XPathFactory
diff --git a/libjava/javax/xml/xpath/XPathFactoryConfigurationException.java b/libjava/javax/xml/xpath/XPathFactoryConfigurationException.java
index 56c45d12e22..64ffbbeec14 100644
--- a/libjava/javax/xml/xpath/XPathFactoryConfigurationException.java
+++ b/libjava/javax/xml/xpath/XPathFactoryConfigurationException.java
@@ -1,5 +1,5 @@
/* XPathFactoryConfigurationException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.xpath;
/**
* A configuration exception in an XPath factory environment.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public class XPathFactoryConfigurationException
diff --git a/libjava/javax/xml/xpath/XPathFunction.java b/libjava/javax/xml/xpath/XPathFunction.java
index a071eb59620..c9e450a216a 100644
--- a/libjava/javax/xml/xpath/XPathFunction.java
+++ b/libjava/javax/xml/xpath/XPathFunction.java
@@ -1,5 +1,5 @@
/* XPathFunction.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import java.util.List;
/**
* An XPath extension function.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public interface XPathFunction
diff --git a/libjava/javax/xml/xpath/XPathFunctionException.java b/libjava/javax/xml/xpath/XPathFunctionException.java
index 9a6751a2f32..fb784171a84 100644
--- a/libjava/javax/xml/xpath/XPathFunctionException.java
+++ b/libjava/javax/xml/xpath/XPathFunctionException.java
@@ -1,5 +1,5 @@
/* XPathFunctionException.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -40,7 +40,7 @@ package javax.xml.xpath;
/**
* An exception in an XPath function.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public class XPathFunctionException
diff --git a/libjava/javax/xml/xpath/XPathFunctionResolver.java b/libjava/javax/xml/xpath/XPathFunctionResolver.java
index 8fb0bd4234e..bf1cd82e1f6 100644
--- a/libjava/javax/xml/xpath/XPathFunctionResolver.java
+++ b/libjava/javax/xml/xpath/XPathFunctionResolver.java
@@ -1,5 +1,5 @@
/* XPathFunctionResolver.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,7 +42,7 @@ import javax.xml.namespace.QName;
/**
* Interface providing the means to access XPath extension functions.
*
- * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
+ * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
* @since 1.3
*/
public interface XPathFunctionResolver
diff --git a/libjava/jni.cc b/libjava/jni.cc
index 6e0ab899c3e..5f9d5f79e71 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -1,6 +1,6 @@
// jni.cc - JNI implementation, including the jump table.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation
This file is part of libgcj.
@@ -1880,7 +1880,8 @@ nathash_add (const JNINativeMethod *method)
return;
// FIXME
slot->name = strdup (method->name);
- slot->signature = strdup (method->signature);
+ // This was already strduped in _Jv_JNI_RegisterNatives.
+ slot->signature = method->signature;
slot->fnPtr = method->fnPtr;
}
@@ -1894,6 +1895,8 @@ _Jv_JNI_RegisterNatives (JNIEnv *env, jclass klass,
// the nathash table.
JvSynchronize sync (global_ref_table);
+ JNINativeMethod dottedMethod;
+
// Look at each descriptor given us, and find the corresponding
// method in the class.
for (int j = 0; j < nMethods; ++j)
@@ -1905,15 +1908,28 @@ _Jv_JNI_RegisterNatives (JNIEnv *env, jclass klass,
{
_Jv_Method *self = &imeths[i];
- if (! strcmp (self->name->chars (), methods[j].name)
- && ! strcmp (self->signature->chars (), methods[j].signature))
+ // Copy this JNINativeMethod and do a slash to dot
+ // conversion on the signature.
+ dottedMethod.name = methods[j].name;
+ dottedMethod.signature = strdup (methods[j].signature);
+ dottedMethod.fnPtr = methods[j].fnPtr;
+ char *c = dottedMethod.signature;
+ while (*c)
+ {
+ if (*c == '/')
+ *c = '.';
+ c++;
+ }
+
+ if (! strcmp (self->name->chars (), dottedMethod.name)
+ && ! strcmp (self->signature->chars (), dottedMethod.signature))
{
if (! (self->accflags & java::lang::reflect::Modifier::NATIVE))
break;
// Found a match that is native.
found = true;
- nathash_add (&methods[j]);
+ nathash_add (&dottedMethod);
break;
}
@@ -2482,7 +2498,16 @@ JNI_CreateJavaVM (JavaVM **vm, void **penv, void *args)
{
JvAssert (! the_vm);
- _Jv_CreateJavaVM (NULL);
+ jint version = * (jint *) args;
+ // We only support 1.2 and 1.4.
+ if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_4)
+ return JNI_EVERSION;
+
+ JvVMInitArgs* vm_args = reinterpret_cast<JvVMInitArgs *> (args);
+
+ jint result = _Jv_CreateJavaVM (vm_args);
+ if (result)
+ return result;
// FIXME: synchronize
JavaVM *nvm = (JavaVM *) _Jv_MallocUnchecked (sizeof (JavaVM));
@@ -2490,48 +2515,6 @@ JNI_CreateJavaVM (JavaVM **vm, void **penv, void *args)
return JNI_ERR;
nvm->functions = &_Jv_JNI_InvokeFunctions;
- // Parse the arguments.
- if (args != NULL)
- {
- jint version = * (jint *) args;
- // We only support 1.2 and 1.4.
- if (version != JNI_VERSION_1_2 && version != JNI_VERSION_1_4)
- return JNI_EVERSION;
- JavaVMInitArgs *ia = reinterpret_cast<JavaVMInitArgs *> (args);
- for (int i = 0; i < ia->nOptions; ++i)
- {
- if (! strcmp (ia->options[i].optionString, "vfprintf")
- || ! strcmp (ia->options[i].optionString, "exit")
- || ! strcmp (ia->options[i].optionString, "abort"))
- {
- // We are required to recognize these, but for now we
- // don't handle them in any way. FIXME.
- continue;
- }
- else if (! strncmp (ia->options[i].optionString,
- "-verbose", sizeof ("-verbose") - 1))
- {
- // We don't do anything with this option either. We
- // might want to make sure the argument is valid, but we
- // don't really care all that much for now.
- continue;
- }
- else if (! strncmp (ia->options[i].optionString, "-D", 2))
- {
- // FIXME.
- continue;
- }
- else if (ia->ignoreUnrecognized)
- {
- if (ia->options[i].optionString[0] == '_'
- || ! strncmp (ia->options[i].optionString, "-X", 2))
- continue;
- }
-
- return JNI_ERR;
- }
- }
-
jint r =_Jv_JNI_AttachCurrentThread (nvm, penv, NULL);
if (r < 0)
return r;
diff --git a/libjava/jni/gtk-peer/gdkfont.h b/libjava/jni/gtk-peer/gdkfont.h
index 792cee4f1cf..3370152e4e3 100644
--- a/libjava/jni/gtk-peer/gdkfont.h
+++ b/libjava/jni/gtk-peer/gdkfont.h
@@ -102,6 +102,21 @@ extern struct state_table *native_text_layout_state_table;
#define TEXT_METRICS_Y_ADVANCE 5
#define NUM_TEXT_METRICS 6
+#define NUM_GLYPH_METRICS 10
+
+#define GLYPH_LOG_X(i) (NUM_GLYPH_METRICS * (i) )
+#define GLYPH_LOG_Y(i) (NUM_GLYPH_METRICS * (i) + 1)
+#define GLYPH_LOG_WIDTH(i) (NUM_GLYPH_METRICS * (i) + 2)
+#define GLYPH_LOG_HEIGHT(i) (NUM_GLYPH_METRICS * (i) + 3)
+
+#define GLYPH_INK_X(i) (NUM_GLYPH_METRICS * (i) + 4)
+#define GLYPH_INK_Y(i) (NUM_GLYPH_METRICS * (i) + 5)
+#define GLYPH_INK_WIDTH(i) (NUM_GLYPH_METRICS * (i) + 6)
+#define GLYPH_INK_HEIGHT(i) (NUM_GLYPH_METRICS * (i) + 7)
+
+#define GLYPH_POS_X(i) (NUM_GLYPH_METRICS * (i) + 8)
+#define GLYPH_POS_Y(i) (NUM_GLYPH_METRICS * (i) + 9)
+
struct peerfont
{
PangoFont *font;
@@ -119,16 +134,6 @@ struct peerfont
void *graphics_resource;
};
-struct glyphvec
-{
- /* the GList is list of PangoGlyphItems, each of which is a pair of 1
- PangoItem and 1 PangoGlyphString. */
- GList *glyphitems;
- PangoFontDescription *desc;
- PangoFont *font;
- PangoContext *ctx;
-};
-
struct textlayout
{
PangoLayout *pango_layout;
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
index c94e6647850..7787eb4c47a 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
@@ -49,7 +49,7 @@ exception statement from your version. */
*/
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun
- (JNIEnv *gdk_env __attribute__((unused)),
+ (JNIEnv *env __attribute__((unused)),
jobject lcl_obj __attribute__((unused)),
jlong funcAddr, jlong funcArg)
{
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
deleted file mode 100644
index 52489386839..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* gdkfontmetrics.c
- Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include "gtkpeer.h"
-#include "gdkfont.h"
-
-#include "gnu_java_awt_peer_gtk_GdkFontMetrics.h"
-#include <gdk/gdkx.h>
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerFontMetrics
- (JNIEnv *env, jclass clazz __attribute__ ((unused)), jobject java_font, jdoubleArray java_metrics)
-{
- struct peerfont *pfont = NULL;
- jdouble *native_metrics = NULL;
- PangoFontMetrics *pango_metrics;
-
- gdk_threads_enter();
-
- pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, java_font);
- g_assert (pfont != NULL);
-
- pango_metrics = pango_context_get_metrics (pfont->ctx, pfont->desc,
- gtk_get_default_language ());
-
- native_metrics = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
- g_assert (native_metrics != NULL);
-
- native_metrics[FONT_METRICS_ASCENT] = PANGO_PIXELS (pango_font_metrics_get_ascent (pango_metrics));
- native_metrics[FONT_METRICS_MAX_ASCENT] = native_metrics[FONT_METRICS_ASCENT];
- native_metrics[FONT_METRICS_DESCENT] = PANGO_PIXELS (pango_font_metrics_get_descent (pango_metrics));
- if (native_metrics[FONT_METRICS_DESCENT] < 0)
- native_metrics[FONT_METRICS_DESCENT] = - native_metrics[FONT_METRICS_DESCENT];
- native_metrics[FONT_METRICS_MAX_DESCENT] = native_metrics[FONT_METRICS_DESCENT];
- native_metrics[FONT_METRICS_MAX_ADVANCE] = PANGO_PIXELS (pango_font_metrics_get_approximate_char_width (pango_metrics));
-
- (*env)->ReleaseDoubleArrayElements (env, java_metrics, native_metrics, 0);
-
- pango_font_metrics_unref (pango_metrics);
-
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkFontMetrics_getPeerTextMetrics
- (JNIEnv *env, jclass clazz __attribute__ ((unused)), jobject java_font, jstring str, jdoubleArray java_metrics)
-{
- struct peerfont *pfont = NULL;
- const char *cstr = NULL;
- jdouble *native_metrics = NULL;
- PangoRectangle log;
-
- gdk_threads_enter();
-
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, java_font);
- g_assert (pfont != NULL);
-
- cstr = (*env)->GetStringUTFChars (env, str, NULL);
- g_assert(cstr != NULL);
-
- pango_layout_set_text (pfont->layout, cstr, -1);
- pango_layout_get_extents (pfont->layout, NULL, &log);
-
- (*env)->ReleaseStringUTFChars (env, str, cstr);
- pango_layout_set_text (pfont->layout, "", -1);
-
- native_metrics = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
- g_assert (native_metrics != NULL);
-
- native_metrics[TEXT_METRICS_X_BEARING] = PANGO_PIXELS(log.x);
- native_metrics[TEXT_METRICS_Y_BEARING] = PANGO_PIXELS(log.y);
- native_metrics[TEXT_METRICS_WIDTH] = PANGO_PIXELS(log.width);
- native_metrics[TEXT_METRICS_HEIGHT] = PANGO_PIXELS(log.height);
- native_metrics[TEXT_METRICS_X_ADVANCE] = PANGO_PIXELS(log.x + log.width);
- native_metrics[TEXT_METRICS_Y_ADVANCE] = PANGO_PIXELS(log.y + log.height);
-
- (*env)->ReleaseDoubleArrayElements (env, java_metrics, native_metrics, 0);
-
- gdk_threads_leave();
-}
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
index d9926532bfb..7a8a2ceefd8 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
@@ -40,23 +40,6 @@
struct state_table *native_font_state_table;
-/*
-rough sketch of the mapping between java and
-pango text objects:
-
- Font <-> - PangoFont
- - PangoFontDescription
- - PangoContext
- - PangoLayout (for rendering and measuring)
-
- GlyphVector <-> - GList of PangoGlyphItem
- - PangoFontDescription
- - PangoContext
-
- FontRenderContext <-> stays in plain java
-
-*/
-
enum java_awt_font_style {
java_awt_font_PLAIN = 0,
java_awt_font_BOLD = 1,
@@ -69,11 +52,22 @@ enum java_awt_font_baseline {
java_awt_font_HANGING_BASELINE = 2
};
+static jmethodID glyphVector_ctor;
+static jclass glyphVector_class;
+static PangoAttrList *attrs = NULL;
+
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkFontPeer_initStaticState
(JNIEnv *env, jclass clazz)
{
NSA_FONT_INIT (env, clazz);
+
+ glyphVector_class = (*env)->FindClass
+ (env, "gnu/java/awt/peer/gtk/GdkGlyphVector");
+
+ glyphVector_ctor = (*env)->GetMethodID
+ (env, glyphVector_class, "<init>",
+ "([D[ILjava/awt/Font;Ljava/awt/font/FontRenderContext;)V");
}
JNIEXPORT void JNICALL
@@ -111,6 +105,223 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_dispose
gdk_threads_leave ();
}
+
+JNIEXPORT jobject JNICALL
+Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector
+ (JNIEnv *env, jobject self,
+ jstring chars,
+ jobject font,
+ jobject fontRenderContext)
+{
+ struct peerfont *pfont = NULL;
+ GList *items = NULL, *i = NULL;
+ gchar *str = NULL;
+ int len, j;
+ double *native_extents;
+ int *native_codes;
+ jintArray java_codes = NULL;
+ jdoubleArray java_extents = NULL;
+
+ gdk_threads_enter ();
+
+ pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self);
+ g_assert (pfont != NULL);
+
+ len = (*gdk_env())->GetStringUTFLength (env, chars);
+ str = (gchar *)(*env)->GetStringUTFChars (env, chars, NULL);
+ g_assert (str != NULL);
+
+ if (attrs == NULL)
+ attrs = pango_attr_list_new ();
+
+ if (len > 0 && str[len-1] == '\0')
+ len--;
+
+ items = pango_itemize (pfont->ctx, str, 0, len, attrs, NULL);
+
+ i = g_list_first (items);
+
+ if (i == NULL)
+ {
+ java_extents = (*env)->NewDoubleArray (env, 0);
+ java_codes = (*env)->NewIntArray (env, 0);
+ }
+ else
+ {
+ PangoGlyphString *glyphs;
+ PangoItem *item = (PangoItem *)i->data;
+
+ pango_context_set_font_description (pfont->ctx, pfont->desc);
+ pango_context_set_language (pfont->ctx, gtk_get_default_language());
+ pango_context_load_font (pfont->ctx, pfont->desc);
+
+ glyphs = pango_glyph_string_new ();
+ g_assert (glyphs != NULL);
+
+ pango_shape (str + item->offset, item->length,
+ &(item->analysis), glyphs);
+
+ if (glyphs->num_glyphs > 0)
+ {
+ int x = 0;
+ double scale = ((double) PANGO_SCALE);
+
+ java_extents = (*env)->NewDoubleArray (env, glyphs->num_glyphs * NUM_GLYPH_METRICS);
+ java_codes = (*env)->NewIntArray (env, glyphs->num_glyphs);
+ native_extents = (*env)->GetDoubleArrayElements (env, java_extents, NULL);
+ native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
+
+ for (j = 0; j < glyphs->num_glyphs; ++j)
+ {
+ PangoRectangle ink;
+ PangoRectangle logical;
+ PangoGlyphGeometry *geom = &glyphs->glyphs[j].geometry;
+
+ pango_font_get_glyph_extents (pfont->font,
+ glyphs->glyphs[j].glyph,
+ &ink, &logical);
+
+ native_codes[j] = glyphs->glyphs[j].glyph;
+
+ native_extents[ GLYPH_LOG_X(j) ] = (logical.x) / scale;
+ native_extents[ GLYPH_LOG_Y(j) ] = (- logical.y) / scale;
+ native_extents[ GLYPH_LOG_WIDTH(j) ] = (logical.width) / scale;
+ native_extents[ GLYPH_LOG_HEIGHT(j) ] = (logical.height) / scale;
+
+ native_extents[ GLYPH_INK_X(j) ] = (ink.x) / scale;
+ native_extents[ GLYPH_INK_Y(j) ] = (- ink.y) / scale;
+ native_extents[ GLYPH_INK_WIDTH(j) ] = (ink.width) / scale;
+ native_extents[ GLYPH_INK_HEIGHT(j) ] = (ink.height) / scale;
+
+ native_extents[ GLYPH_POS_X(j) ] = (x + geom->x_offset) / scale;
+ native_extents[ GLYPH_POS_Y(j) ] = ( - geom->y_offset) / scale;
+
+ x += geom->width;
+ }
+ (*env)->ReleaseDoubleArrayElements (env, java_extents, native_extents, 0);
+ (*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0);
+ }
+
+ pango_glyph_string_free (glyphs);
+ }
+
+ (*env)->ReleaseStringUTFChars (env, chars, str);
+
+ for (i = g_list_first (items); i != NULL; i = g_list_next (i))
+ g_free (i->data);
+
+ g_list_free (items);
+
+ gdk_threads_leave ();
+
+ return (*env)->NewObject (env,
+ glyphVector_class,
+ glyphVector_ctor,
+ java_extents, java_codes,
+ font, fontRenderContext);
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics
+ (JNIEnv *env, jobject java_font, jdoubleArray java_metrics)
+{
+ struct peerfont *pfont = NULL;
+ jdouble *native_metrics = NULL;
+ PangoFontMetrics *pango_metrics;
+
+ gdk_threads_enter();
+
+ pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, java_font);
+ g_assert (pfont != NULL);
+
+ pango_metrics
+ = pango_context_get_metrics (pfont->ctx, pfont->desc,
+ gtk_get_default_language ());
+
+ native_metrics
+ = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
+
+ g_assert (native_metrics != NULL);
+
+ native_metrics[FONT_METRICS_ASCENT]
+ = PANGO_PIXELS (pango_font_metrics_get_ascent (pango_metrics));
+
+ native_metrics[FONT_METRICS_MAX_ASCENT]
+ = native_metrics[FONT_METRICS_ASCENT];
+
+ native_metrics[FONT_METRICS_DESCENT]
+ = PANGO_PIXELS (pango_font_metrics_get_descent (pango_metrics));
+
+ if (native_metrics[FONT_METRICS_DESCENT] < 0)
+ native_metrics[FONT_METRICS_DESCENT]
+ = - native_metrics[FONT_METRICS_DESCENT];
+
+ native_metrics[FONT_METRICS_MAX_DESCENT]
+ = native_metrics[FONT_METRICS_DESCENT];
+
+ native_metrics[FONT_METRICS_MAX_ADVANCE]
+ = PANGO_PIXELS (pango_font_metrics_get_approximate_char_width
+ (pango_metrics));
+
+ (*env)->ReleaseDoubleArrayElements (env,
+ java_metrics,
+ native_metrics, 0);
+
+ pango_font_metrics_unref (pango_metrics);
+
+ gdk_threads_leave();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics
+ (JNIEnv *env, jobject java_font, jstring str, jdoubleArray java_metrics)
+{
+ struct peerfont *pfont = NULL;
+ const char *cstr = NULL;
+ jdouble *native_metrics = NULL;
+ PangoRectangle log;
+
+ gdk_threads_enter();
+
+ pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, java_font);
+ g_assert (pfont != NULL);
+
+ cstr = (*env)->GetStringUTFChars (env, str, NULL);
+ g_assert(cstr != NULL);
+
+ pango_layout_set_text (pfont->layout, cstr, -1);
+ pango_layout_get_extents (pfont->layout, NULL, &log);
+
+ (*env)->ReleaseStringUTFChars (env, str, cstr);
+ pango_layout_set_text (pfont->layout, "", -1);
+
+ native_metrics = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
+ g_assert (native_metrics != NULL);
+
+ native_metrics[TEXT_METRICS_X_BEARING]
+ = PANGO_PIXELS( ((double)log.x) );
+
+ native_metrics[TEXT_METRICS_Y_BEARING]
+ = PANGO_PIXELS( ((double)log.y) );
+
+ native_metrics[TEXT_METRICS_WIDTH]
+ = PANGO_PIXELS( ((double)log.width) );
+
+ native_metrics[TEXT_METRICS_HEIGHT]
+ = PANGO_PIXELS( ((double)log.height) );
+
+ native_metrics[TEXT_METRICS_X_ADVANCE]
+ = PANGO_PIXELS( ((double) (log.x + log.width)) );
+
+ native_metrics[TEXT_METRICS_Y_ADVANCE]
+ = PANGO_PIXELS( ((double) (log.y + log.height)) );
+
+ (*env)->ReleaseDoubleArrayElements (env, java_metrics, native_metrics, 0);
+
+ gdk_threads_leave();
+}
+
+
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont
(JNIEnv *env, jobject self, jstring family_name_str, jint style_int, jint size, jboolean useGraphics2D)
@@ -142,7 +353,6 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont
pango_font_description_set_family (pfont->desc, family_name);
(*env)->ReleaseStringUTFChars(env, family_name_str, family_name);
- pango_font_description_set_size (pfont->desc, size * dpi_conversion_factor);
if (style & java_awt_font_BOLD)
pango_font_description_set_weight (pfont->desc, PANGO_WEIGHT_BOLD);
@@ -152,6 +362,7 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont
if (useGraphics2D)
{
+ pango_font_description_set_size (pfont->desc, size * PANGO_SCALE);
if (pfont->ctx == NULL)
{
ft2_map = PANGO_FT2_FONT_MAP(pango_ft2_font_map_for_display ());
@@ -160,6 +371,9 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont
}
else
{
+ /* GDK uses a slightly different DPI setting. */
+ pango_font_description_set_size (pfont->desc,
+ size * dpi_conversion_factor);
if (pfont->ctx == NULL)
pfont->ctx = gdk_pango_context_get();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
deleted file mode 100644
index df720971957..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
+++ /dev/null
@@ -1,696 +0,0 @@
-/* gdkglyphvector.c
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-
- This file is part of GNU Classpath.
-
- GNU Classpath is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU Classpath is distributed in the hope that it will be useful, but
- WITHOUT 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
- along with GNU Classpath; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA.
-
- Linking this library statically or dynamically with other modules is
- making a combined work based on this library. Thus, the terms and
- conditions of the GNU General Public License cover the whole
- combination.
-
- As a special exception, the copyright holders of this library give you
- permission to link this library with independent modules to produce an
- executable, regardless of the license terms of these independent
- modules, and to copy and distribute the resulting executable under
- terms of your choice, provided that you also meet, for each linked
- independent module, the terms and conditions of the license of that
- module. An independent module is a module which is not derived from
- or based on this library. If you modify this library, you may extend
- this exception to your version of the library, but you are not
- obligated to do so. If you do not wish to do so, delete this
- exception statement from your version. */
-
-#include "gdkfont.h"
-#include "gnu_java_awt_peer_gtk_GdkGlyphVector.h"
-
-struct state_table *native_glyphvector_state_table;
-
-typedef struct {
- double x;
- double y;
- double width;
- double height;
-} rect_t;
-
-#define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 64.0))
-#define DOUBLE_FROM_26_6(t) ((double)(t) / 64.0)
-#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0))
-#define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0)
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initStaticState
- (JNIEnv *env, jclass clazz)
-{
- NSA_GV_INIT (env, clazz);
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initState
- (JNIEnv *env, jobject self, jobject font, jobject ctx __attribute__ ((unused)))
-{
- struct glyphvec *vec = NULL;
- struct peerfont *pfont = NULL;
-
- gdk_threads_enter ();
- g_assert (font != NULL);
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, font);
- g_assert (pfont != NULL);
- g_assert (pfont->ctx != NULL);
- g_assert (pfont->desc != NULL);
-
- g_assert (self != NULL);
- vec = (struct glyphvec *) g_malloc0 (sizeof (struct glyphvec));
- g_assert (vec != NULL);
-
- vec->desc = pango_font_describe (pfont->font);
- g_assert (vec->desc != NULL);
-
- vec->font = pfont->font;
- g_object_ref (vec->font);
-
- vec->ctx = pfont->ctx;
- g_object_ref (vec->ctx);
-
- NSA_SET_GV_PTR (env, self, vec);
- gdk_threads_leave ();
-}
-
-static void free_glyphitems (GList *list)
-{
- GList *i = NULL;
- PangoGlyphItem *gi = NULL;
-
- for (i = g_list_first (list); i != NULL; i = g_list_next (i))
- {
- g_assert (i->data != NULL);
- gi = (PangoGlyphItem *)i->data;
-
- if (gi->glyphs != NULL)
- pango_glyph_string_free (gi->glyphs);
-
- if (gi->item != NULL)
- g_free (gi->item);
- }
- g_list_free (list);
-}
-
-static void seek_glyphstring_idx (GList *list, int idx,
- int *nidx,
- PangoGlyphString **gs,
- PangoFont **fnt)
-{
- GList *i = NULL;
- PangoGlyphItem *gi = NULL;
- int begin = 0;
-
- g_assert (list != NULL);
- g_assert (gs != NULL);
- g_assert (nidx != NULL);
-
-
- for (i = g_list_first (list); i != NULL; i = g_list_next (i))
- {
- g_assert (i->data != NULL);
- gi = (PangoGlyphItem *)i->data;
-
- g_assert (gi->glyphs != NULL);
-
- if (begin <= idx && idx < begin + gi->glyphs->num_glyphs)
- {
- *gs = gi->glyphs;
- *nidx = idx - begin;
- if (fnt && gi->item)
- *fnt = gi->item->analysis.font;
- return;
- }
- else
- {
- begin += gi->glyphs->num_glyphs;
- }
- }
- *gs = NULL;
- *nidx = -1;
-}
-
-static void seek_glyph_idx (GList *list, int idx,
- PangoGlyphInfo **g,
- PangoFont **fnt)
-{
- PangoGlyphString *gs = NULL;
- int nidx = -1;
-
- g_assert (list != NULL);
- g_assert (g != NULL);
-
- seek_glyphstring_idx (list, idx, &nidx, &gs, fnt);
-
- g_assert (gs != NULL);
- g_assert (nidx != -1);
- g_assert (nidx < gs->num_glyphs);
- g_assert (gs->glyphs != NULL);
-
- *g = gs->glyphs + nidx;
-}
-
-static void union_rects (rect_t *r1,
- const rect_t *r2)
-{
- rect_t r;
-
- g_assert (r1 != NULL);
- g_assert (r2 != NULL);
-
- /*
- x is the left edge of the rect,
- y is the top edge of the rect
- */
-
-#ifndef min
-#define min(x,y) ((x) < (y) ? (x) : (y))
-#endif
-
-#ifndef max
-#define max(x,y) ((x) < (y) ? (y) : (x))
-#endif
-
- r.x = min(r1->x, r2->x);
-
- r.y = min(r1->y, r2->y);
-
- r.width = max(r1->x + r1->width,
- r2->x + r2->width) - r.x;
-
- r.height = max(r1->y + r1->height,
- r2->y + r2->height) - r.y;
-
- *r1 = r;
-}
-
-static jdoubleArray rect_to_array (JNIEnv *env, const rect_t *r)
-{
- /* We often return rectangles as arrays : { x, y, w, h } */
- jdoubleArray ret;
- double *rp = NULL;
- g_assert (r != NULL);
- ret = (*env)->NewDoubleArray (env, 4);
- rp = (*env)->GetDoubleArrayElements (env, ret, NULL);
- g_assert (rp != NULL);
- rp[0] = r->x;
- /* freetype and pango's view of space is upside down from java2d's */
- rp[1] = r->y * -1;
- rp[2] = r->width;
- rp[3] = r->height;
- (*env)->ReleaseDoubleArrayElements (env, ret, rp, 0);
- return ret;
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_dispose
- (JNIEnv *env, jobject self)
-{
- struct glyphvec *vec = NULL;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_DEL_GV_PTR (env, self);
- g_assert (vec != NULL);
-
- if (vec->glyphitems != NULL)
- {
- free_glyphitems (vec->glyphitems);
- vec->glyphitems = NULL;
- }
-
- if (vec->desc != NULL)
- pango_font_description_free (vec->desc);
-
- if (vec->ctx != NULL)
- g_object_unref (vec->ctx);
-
- g_free (vec);
- gdk_threads_leave ();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setChars
- (JNIEnv *env, jobject self, jstring chars)
-{
- struct glyphvec *vec = NULL;
- gchar *str = NULL;
- GList *items = NULL, *item = NULL;
- PangoGlyphItem *gi;
- PangoAttrList *attrs = NULL;
- gint len = 0;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
- g_assert (vec->desc != NULL);
- g_assert (vec->ctx != NULL);
-
- len = (*gdk_env)->GetStringUTFLength (env, chars);
- str = (gchar *)(*env)->GetStringUTFChars (env, chars, NULL);
- g_assert (str != NULL);
-
- /* step 1: set our FontFescription in the context, then "itemize" the
- text */
-
- attrs = pango_attr_list_new ();
- g_assert (attrs != NULL);
-
- pango_context_set_font_description (vec->ctx, vec->desc);
-
- if (vec->glyphitems != NULL)
- items = pango_itemize (vec->ctx, str, 0, len, attrs, NULL);
- if (items != NULL)
- {
-
- /*
- step 2: for each item:
- - shape the item into a glyphstring
- - store the (item, glyphstring) pair in the vec->glyphitems list
- */
-
- if (vec->glyphitems != NULL)
- {
- free_glyphitems (vec->glyphitems);
- vec->glyphitems = NULL;
- }
-
- for (item = g_list_first (items);
- item != NULL;
- item = g_list_next (item))
- {
- g_assert (item->data != NULL);
-
- gi = NULL;
- gi = g_malloc0 (sizeof(PangoGlyphItem));
- g_assert (gi != NULL);
-
- gi->item = (PangoItem *)item->data;
- gi->glyphs = pango_glyph_string_new ();
- g_assert (gi->glyphs != NULL);
-
- if (gi->glyphs->num_glyphs > 0)
- {
- pango_shape (str + gi->item->offset,
- gi->item->length,
- &(gi->item->analysis),
- gi->glyphs);
-
- vec->glyphitems = g_list_append (vec->glyphitems, gi);
- }
- }
-
- /*
- ownership of each item has been transferred to glyphitems,
- but the list should be freed.
- */
-
- g_list_free (items);
- }
-
- pango_attr_list_unref (attrs);
-
- (*env)->ReleaseStringUTFChars (env, chars, str);
- gdk_threads_leave ();
-}
-
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setGlyphCodes
- (JNIEnv *env, jobject self, jintArray codes __attribute__ ((unused)))
-{
- struct glyphvec *vec = NULL;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
-
- /*
- FIXME: setting glyph codes doesn't seem particularly plausible at the
- moment.
- */
-
- gdk_threads_leave ();
-
-}
-
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphCode
- (JNIEnv *env, jobject self, jint idx)
-{
- struct glyphvec *vec = NULL;
- PangoGlyphInfo *gi = NULL;
- jint ret = 0;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
- g_assert (vec->glyphitems != NULL);
-
- seek_glyph_idx (vec->glyphitems, idx, &gi, NULL);
- g_assert (gi != NULL);
- ret = gi->glyph;
- gdk_threads_leave ();
-
- return (jint)(ret);
-}
-
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_numGlyphs
- (JNIEnv *env, jobject self)
-{
- GList *i = NULL;
- PangoGlyphItem *gi = NULL;
- struct glyphvec *vec = NULL;
- jint count = 0;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
-
- for (i = g_list_first (vec->glyphitems); i != NULL; i = g_list_next (i))
- {
- g_assert (i->data != NULL);
- gi = (PangoGlyphItem *)i->data;
- g_assert (gi->glyphs != NULL);
- count += gi->glyphs->num_glyphs;
- }
- gdk_threads_leave ();
-
- return count;
-}
-
-
-JNIEXPORT jint JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphCharIndex
-(JNIEnv *env __attribute__ ((unused)), jobject self __attribute__ ((unused)), jint idx)
-{
- /*
- FIXME: this is not correct, rather it assumes a (broken) 1:1
- glyph:char model. it can be implemented in terms of bytes (also
- broken) using pango's current interface, or perhaps in terms of
- characters if some better byte->character conversion operator is
- found. for the time being we leave it broken.
- */
- return idx;
-}
-
-static void
-assume_pointsize_and_identity_transform(double pointsize,
- FT_Face face)
-{
- FT_Matrix mat;
- mat.xx = DOUBLE_TO_16_16(1);
- mat.xy = DOUBLE_TO_16_16(0);
- mat.yx = DOUBLE_TO_16_16(0);
- mat.yy = DOUBLE_TO_16_16(1);
- FT_Set_Transform(face, &mat, NULL);
- FT_Set_Char_Size( face,
- DOUBLE_TO_26_6 (pointsize),
- DOUBLE_TO_26_6 (pointsize),
- 0, 0);
-}
-
-JNIEXPORT jdoubleArray JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allInkExtents
- (JNIEnv *env, jobject self)
-{
- struct glyphvec *vec = NULL;
- int j;
- GList *i;
- PangoGlyphItem *gi = NULL;
- rect_t rect = {0,0,0,0};
- rect_t tmp;
- jdoubleArray ret;
- double x = 0, y = 0;
- double pointsize;
- FT_Face face;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
- if (vec->glyphitems != NULL)
- {
- pointsize = pango_font_description_get_size (vec->desc);
- pointsize /= (double) PANGO_SCALE;
-
- for (i = g_list_first (vec->glyphitems); i != NULL; i = g_list_next (i))
- {
- g_assert (i->data != NULL);
- gi = (PangoGlyphItem *)i->data;
- g_assert (gi->glyphs != NULL);
-
- face = pango_ft2_font_get_face (gi->item->analysis.font);
- assume_pointsize_and_identity_transform (pointsize, face);
-
- for (j = 0; j < gi->glyphs->num_glyphs; ++j)
- {
- FT_Load_Glyph (face,
- gi->glyphs->glyphs[j].glyph,
- FT_LOAD_DEFAULT);
- /* FIXME: this needs to change for vertical layouts */
- tmp.x = x + DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingX);
- tmp.y = y + DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingY);
- tmp.width = DOUBLE_FROM_26_6 (face->glyph->metrics.width);
- tmp.height = DOUBLE_FROM_26_6 (face->glyph->metrics.height);
- union_rects (&rect, &tmp);
- x += DOUBLE_FROM_26_6 (face->glyph->advance.x);
- y += DOUBLE_FROM_26_6 (face->glyph->advance.y);
- }
- }
- }
-
- ret = rect_to_array (env, &rect);
- gdk_threads_leave ();
- return ret;
-}
-
-
-JNIEXPORT jdoubleArray JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allLogicalExtents
- (JNIEnv *env, jobject self)
-{
- struct glyphvec *vec = NULL;
- int j;
- GList *i;
- PangoGlyphItem *gi = NULL;
- rect_t rect = {0,0,0,0};
- rect_t tmp;
- jdoubleArray ret;
- double x = 0, y = 0;
- double pointsize;
- FT_Face face;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
- g_assert (vec->glyphitems != NULL);
-
- pointsize = pango_font_description_get_size (vec->desc);
- pointsize /= (double) PANGO_SCALE;
-
- for (i = g_list_first (vec->glyphitems); i != NULL; i = g_list_next (i))
- {
- g_assert (i->data != NULL);
- gi = (PangoGlyphItem *)i->data;
- g_assert (gi->glyphs != NULL);
-
- face = pango_ft2_font_get_face (gi->item->analysis.font);
- assume_pointsize_and_identity_transform (pointsize, face);
-
- for (j = 0; j < gi->glyphs->num_glyphs; ++j)
- {
- FT_Load_Glyph (face, gi->glyphs->glyphs[j].glyph, FT_LOAD_DEFAULT);
-
- /* FIXME: also, this is probably not the correct set of metrics;
- the "logical bounds" are some fancy combination of hori
- advance and height such that it's good for inverting as a
- highlight. revisit. */
-
- tmp.x = x;
- tmp.y = y;
- tmp.width = DOUBLE_FROM_26_6 (face->glyph->advance.x);
- tmp.height = DOUBLE_FROM_26_6 (face->glyph->advance.y);
- union_rects (&rect, &tmp);
- x += DOUBLE_FROM_26_6 (face->glyph->advance.x);
- y += DOUBLE_FROM_26_6 (face->glyph->advance.y);
- }
- }
-
- ret = rect_to_array (env, &rect);
- gdk_threads_leave ();
- return ret;
-}
-
-
-JNIEXPORT jdoubleArray JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphLogicalExtents
- (JNIEnv *env, jobject self, jint idx)
-{
- struct glyphvec *vec = NULL;
- rect_t rect = {0,0,0,0};
- PangoGlyphInfo *gi = NULL;
- PangoFont *font = NULL;
- jdoubleArray ret;
- double pointsize;
- FT_Face face;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
- g_assert (vec->glyphitems != NULL);
-
- seek_glyph_idx (vec->glyphitems, idx, &gi, &font);
- g_assert (gi != NULL);
- g_assert (font != NULL);
-
- pointsize = pango_font_description_get_size (vec->desc);
- pointsize /= (double) PANGO_SCALE;
- face = pango_ft2_font_get_face (font);
-
- assume_pointsize_and_identity_transform (pointsize, face);
-
- FT_Load_Glyph (face, gi->glyph, FT_LOAD_DEFAULT);
-
- /* FIXME: this is probably not the correct set of metrics;
- the "logical bounds" are some fancy combination of hori
- advance and height such that it's good for inverting as a
- highlight. revisit. */
-
- rect.x = 0;
- rect.y = 0;
- rect.width = DOUBLE_FROM_26_6 (face->glyph->advance.x);
- rect.height = DOUBLE_FROM_26_6 (face->glyph->advance.y);
-
- ret = rect_to_array (env, &rect);
- gdk_threads_leave ();
- return ret;
-}
-
-
-JNIEXPORT jdoubleArray JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphInkExtents
- (JNIEnv *env, jobject self, jint idx)
-{
- struct glyphvec *vec = NULL;
- rect_t rect = {0,0,0,0};
- PangoGlyphInfo *gi = NULL;
- PangoFont *font = NULL;
- jdoubleArray ret;
- double pointsize;
- FT_Face face;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
- g_assert (vec->glyphitems != NULL);
-
- seek_glyph_idx (vec->glyphitems, idx, &gi, &font);
- g_assert (gi != NULL);
- g_assert (font != NULL);
-
- pointsize = pango_font_description_get_size (vec->desc);
- pointsize /= (double) PANGO_SCALE;
- face = pango_ft2_font_get_face (font);
-
- assume_pointsize_and_identity_transform (pointsize, face);
-
- FT_Load_Glyph (face, gi->glyph, FT_LOAD_DEFAULT);
- /* FIXME: this needs to change for vertical layouts */
- rect.x = DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingX);
- rect.y = DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingY);
- rect.width = DOUBLE_FROM_26_6 (face->glyph->metrics.width);
- rect.height = DOUBLE_FROM_26_6 (face->glyph->metrics.height);
-
- ret = rect_to_array (env, &rect);
- gdk_threads_leave ();
- return ret;
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphIsHorizontal
-(JNIEnv *env, jobject self, jint idx __attribute__ ((unused)))
-{
- struct glyphvec *vec = NULL;
- PangoDirection dir;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- g_assert (vec != NULL);
- g_assert (vec->desc != NULL);
- g_assert (vec->ctx != NULL);
-
- /*
- FIXME: this is an approximation; it's not clear to me whether
- glyphs themselves are horizontal or vertical so much as the
- writing system or writing context. pango thinks it's a context
- issue, so we use that for now.
- */
-
- dir = pango_context_get_base_dir (vec->ctx);
-
- gdk_threads_leave ();
-
- return 1;
- /* FIXME: Pango doesn't seem to have decided how it will deal
- with vertical text. for the time being we inherit this limitation.
- ((dir == PANGO_DIRECTION_LTR) ||
- (dir == PANGO_DIRECTION_RTL));
- */
-}
-
-
-JNIEXPORT jboolean JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGlyphVector_isEqual
- (JNIEnv *env, jobject self, jobject other)
-{
- struct glyphvec *vec1 = NULL, *vec2 = NULL;
- jboolean eq = 0;
-
- gdk_threads_enter ();
- g_assert (self != NULL);
- vec1 = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
- vec2 = (struct glyphvec *)NSA_GET_GV_PTR (env, other);
- g_assert (vec1 != NULL);
- g_assert (vec2 != NULL);
-
- /* FIXME: is there some more advantageous definition of equality for
- glyph vectors? */
- eq = (vec1 == vec2);
-
- gdk_threads_leave ();
- return eq;
-}
-
-
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
index a91eea16c9f..99b1511264c 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
@@ -133,13 +133,17 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals
(JNIEnv *env, jobject obj, jobject peer)
{
void *ptr;
+ jobject *gref;
+
+ NSA_SET_GLOBAL_REF (env, obj);
+ gref = NSA_GET_GLOBAL_REF (env, obj);
ptr = NSA_GET_PTR (env, peer);
gdk_threads_enter ();
g_signal_connect_after (G_OBJECT (ptr), "realize",
- G_CALLBACK (realize_cb), obj);
+ G_CALLBACK (realize_cb), *gref);
gdk_threads_leave ();
}
@@ -438,6 +442,12 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics_clearRect
g = (struct graphics *) NSA_GET_PTR (env, obj);
gdk_threads_enter ();
+
+ if (!g)
+ {
+ gdk_threads_leave ();
+ return;
+ }
if (GDK_IS_WINDOW (g->drawable))
{
w.widget = &widget;
@@ -455,6 +465,8 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics_clearRect
x + g->x_offset, y + g->y_offset, width, height);
gdk_gc_set_foreground (g->gc, &(saved.foreground));
}
+
+ gdk_flush ();
gdk_threads_leave ();
}
@@ -672,7 +684,9 @@ static void realize_cb (GtkWidget *widget __attribute__ ((unused)),
{
gdk_threads_leave ();
- (*gdk_env)->CallVoidMethod (gdk_env, peer, initComponentGraphicsID);
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer, initComponentGraphicsID);
+
+ NSA_DEL_GLOBAL_REF (gdk_env(), peer);
gdk_threads_enter ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
index 90b6aa14901..e6535b46324 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
@@ -1,5 +1,5 @@
/* gnu_java_awt_peer_gtk_GdkGraphics2d.c
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,7 +45,8 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gdk-pixdata.h>
-#include <cairo.h>
+#include <cairo-ft.h>
+#include <cairo-xlib.h>
#include <stdio.h>
#include <stdlib.h>
@@ -175,7 +176,6 @@ x_server_has_render_extension (void)
return (int) XRenderQueryExtension (GDK_DISPLAY (), &ev, &err);
}
-
static void
init_graphics2d_as_pixbuf (struct graphics2d *gr)
{
@@ -196,13 +196,14 @@ init_graphics2d_as_pixbuf (struct graphics2d *gr)
g_assert (gdk_pixbuf_get_bits_per_sample (gr->drawbuf) == bits_per_sample);
g_assert (gdk_pixbuf_get_n_channels (gr->drawbuf) == total_channels);
- gr->surface = cairo_surface_create_for_image (gdk_pixbuf_get_pixels (gr->drawbuf),
+ gr->surface = cairo_surface_create_for_image ((char *) gdk_pixbuf_get_pixels (gr->drawbuf),
CAIRO_FORMAT_ARGB32,
gdk_pixbuf_get_width (gr->drawbuf),
gdk_pixbuf_get_height (gr->drawbuf),
gdk_pixbuf_get_rowstride (gr->drawbuf));
g_assert (gr->surface != NULL);
g_assert (gr->cr != NULL);
+ gr->mode = MODE_DRAWABLE_NO_RENDER;
cairo_set_target_surface (gr->cr, gr->surface);
}
@@ -232,60 +233,99 @@ init_graphics2d_as_renderable (struct graphics2d *gr)
DefaultColormap (dpy, DefaultScreen (dpy)));
g_assert (gr->surface != NULL);
g_assert (gr->cr != NULL);
+ gr->mode = MODE_DRAWABLE_WITH_RENDER;
cairo_set_target_surface (gr->cr, gr->surface);
}
static void
-begin_drawing_operation (struct graphics2d * gr)
+begin_drawing_operation (JNIEnv *env, struct graphics2d * gr)
{
g_assert(cairo_status (gr->cr) == CAIRO_STATUS_SUCCESS);
- if (gr->drawbuf)
+
+ switch (gr->mode)
{
+ case MODE_DRAWABLE_WITH_RENDER:
+ break;
- gint drawable_width, drawable_height;
- gint pixbuf_width, pixbuf_height;
- gint width, height;
-
- gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
- pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
- pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
- width = min (drawable_width, pixbuf_width);
- height = min (drawable_height, pixbuf_height);
-
- gdk_pixbuf_get_from_drawable (gr->drawbuf, /* destination pixbuf */
- gr->drawable,
- NULL, /* colormap */
- 0, 0, 0, 0,
- width, height);
-
- if (gr->debug) printf ("copied (%d, %d) pixels from GDK drawable to pixbuf\n",
- width, height);
+ case MODE_DRAWABLE_NO_RENDER:
+ {
+
+ gint drawable_width, drawable_height;
+ gint pixbuf_width, pixbuf_height;
+ gint width, height;
+
+ gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
+ pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
+ pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
+ width = min (drawable_width, pixbuf_width);
+ height = min (drawable_height, pixbuf_height);
+
+ gdk_pixbuf_get_from_drawable (gr->drawbuf, /* destination pixbuf */
+ gr->drawable,
+ NULL, /* colormap */
+ 0, 0, 0, 0,
+ width, height);
+
+ if (gr->debug) printf ("copied (%d, %d) pixels from GDK drawable to pixbuf\n",
+ width, height);
+ }
+ break;
+
+ case MODE_JAVA_ARRAY:
+ gr->javabuf = (*env)->GetIntArrayElements (env, gr->jarray, &gr->isCopy);
+ gr->surface = cairo_surface_create_for_image ((char *) gr->javabuf,
+ CAIRO_FORMAT_ARGB32,
+ gr->width,
+ gr->height,
+ gr->width * 4);
+ g_assert(gr->surface != NULL);
+ g_assert(gr->cr != NULL);
+ cairo_set_target_surface (gr->cr, gr->surface);
+ break;
}
}
static void
-end_drawing_operation (struct graphics2d * gr)
+end_drawing_operation (JNIEnv *env, struct graphics2d * gr)
{
g_assert(cairo_status (gr->cr) == CAIRO_STATUS_SUCCESS);
- if (gr->drawbuf)
- {
- gint drawable_width, drawable_height;
- gint pixbuf_width, pixbuf_height;
- gint width, height;
+
+ switch (gr->mode)
+ {
+ case MODE_DRAWABLE_WITH_RENDER:
+ break;
+
+ case MODE_DRAWABLE_NO_RENDER:
+ {
+
+ gint drawable_width, drawable_height;
+ gint pixbuf_width, pixbuf_height;
+ gint width, height;
+
+ gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
+ pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
+ pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
+ width = min (drawable_width, pixbuf_width);
+ height = min (drawable_height, pixbuf_height);
+
+ gdk_draw_pixbuf (gr->drawable, NULL, gr->drawbuf,
+ 0, 0, 0, 0,
+ width, height,
+ GDK_RGB_DITHER_NORMAL, 0, 0);
+
+ if (gr->debug) printf ("copied (%d, %d) pixels from pixbuf to GDK drawable\n",
+ width, height);
+ }
+ break;
- gdk_drawable_get_size (gr->drawable, &drawable_width, &drawable_height);
- pixbuf_width = gdk_pixbuf_get_width (gr->drawbuf);
- pixbuf_height = gdk_pixbuf_get_height (gr->drawbuf);
- width = min (drawable_width, pixbuf_width);
- height = min (drawable_height, pixbuf_height);
-
- gdk_draw_pixbuf (gr->drawable, NULL, gr->drawbuf,
- 0, 0, 0, 0,
- width, height,
- GDK_RGB_DITHER_NORMAL, 0, 0);
-
- if (gr->debug) printf ("copied (%d, %d) pixels from pixbuf to GDK drawable\n",
- width, height);
+ case MODE_JAVA_ARRAY:
+ /*
+ * FIXME: Perhaps this should use the isCopy flag to try to avoid
+ * tearing down the cairo surface.
+ */
+ cairo_surface_destroy (gr->surface);
+ gr->surface = NULL;
+ (*env)->ReleaseIntArrayElements (env, gr->jarray, gr->javabuf, JNI_COMMIT);
}
}
@@ -317,11 +357,11 @@ check_for_debug (struct graphics2d *gr)
}
static void
-realize_cb (GtkWidget *widget, jobject peer)
+realize_cb (GtkWidget *widget __attribute__ ((unused)), jobject peer)
{
gdk_threads_leave ();
- (*gdk_env)->CallVoidMethod (gdk_env, peer, initComponentGraphics2DID);
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer, initComponentGraphics2DID);
gdk_threads_enter ();
}
@@ -342,18 +382,29 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_copyState
if (g_old->debug) printf ("copying state from existing graphics2d\n");
- g->drawable = g_old->drawable;
g->debug = g_old->debug;
+ g->mode = g_old->mode;
- g_object_ref (g->drawable);
+ if (g_old->mode == MODE_JAVA_ARRAY)
+ {
+ g->width = g_old->width;
+ g->height = g_old->height;
+ g->jarray = (*env)->NewGlobalRef(env, g_old->jarray);
+ }
+ else
+ {
+ g->drawable = g_old->drawable;
+
+ g_object_ref (g->drawable);
- g->cr = cairo_create();
- g_assert (g->cr != NULL);
+ g->cr = cairo_create();
+ g_assert (g->cr != NULL);
- if (x_server_has_render_extension ())
- init_graphics2d_as_renderable (g);
- else
- init_graphics2d_as_pixbuf (g);
+ if (x_server_has_render_extension ())
+ init_graphics2d_as_renderable (g);
+ else
+ init_graphics2d_as_pixbuf (g);
+ }
cairo_surface_set_filter (g->surface, CAIRO_FILTER_FAST);
@@ -363,6 +414,37 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_copyState
JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState___3III
+(JNIEnv *env, jobject obj, jintArray jarr, jint width, jint height)
+{
+ struct graphics2d *gr;
+
+ gdk_threads_enter();
+ gr = (struct graphics2d *) malloc (sizeof (struct graphics2d));
+ g_assert (gr != NULL);
+ memset (gr, 0, sizeof(struct graphics2d));
+
+ check_for_debug (gr);
+
+ if (gr->debug) printf ("constructing java-backed image of size (%d,%d)\n",
+ width, height);
+
+ gr->cr = cairo_create();
+ g_assert (gr->cr != NULL);
+
+ gr->width = width;
+ gr->height = height;
+ gr->jarray = (*env)->NewGlobalRef(env, jarr);
+ gr->mode = MODE_JAVA_ARRAY;
+
+ if (gr->debug) printf ("constructed java-backed image of size (%d,%d)\n",
+ width, height);
+
+ NSA_SET_G2D_PTR (env, obj, gr);
+ gdk_threads_leave();
+}
+
+JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkGraphics2D_initState__II
(JNIEnv *env, jobject obj, jint width, jint height)
{
@@ -414,7 +496,7 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable
if (src->debug) printf ("copying from offscreen drawable\n");
- begin_drawing_operation(dst);
+ begin_drawing_operation(env, dst);
/* gdk_flush(); */
@@ -439,7 +521,7 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable
gdk_flush();
- end_drawing_operation(dst);
+ end_drawing_operation(env, dst);
if (src->debug) printf ("copied %d x %d pixels from offscreen drawable\n", width, height);
gdk_threads_leave();
@@ -531,6 +613,9 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_dispose
if (gr->pattern_pixels)
free (gr->pattern_pixels);
+ if (gr->mode == MODE_JAVA_ARRAY)
+ (*env)->DeleteGlobalRef(env, gr->jarray);
+
if (gr->debug) printf ("disposed of graphics2d\n");
free (gr);
@@ -734,7 +819,7 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_drawPixels
g_assert (native_matrix != NULL);
g_assert ((*env)->GetArrayLength (env, java_matrix) == 6);
- begin_drawing_operation (gr);
+ begin_drawing_operation (env, gr);
{
cairo_matrix_t *mat = NULL;
@@ -748,13 +833,12 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_drawPixels
native_matrix[4], native_matrix[5]);
cairo_surface_set_matrix (surf, mat);
cairo_surface_set_filter (surf, cairo_surface_get_filter(gr->surface));
-
cairo_show_surface (gr->cr, surf, w, h);
cairo_matrix_destroy (mat);
cairo_surface_destroy (surf);
}
- end_drawing_operation (gr);
+ end_drawing_operation (env, gr);
(*env)->ReleaseIntArrayElements (env, java_pixels, native_pixels, 0);
(*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0);
@@ -762,65 +846,6 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_drawPixels
gdk_threads_leave();
}
-JNIEXPORT jintArray JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_getImagePixels
- (JNIEnv *env, jobject obj)
-{
- struct graphics2d *gr = NULL;
- jintArray java_pixels;
- jint* native_pixels;
- GdkPixbuf *buf = NULL;
- gint width, height;
- gint bits_per_sample = 8;
- gboolean has_alpha = TRUE;
- gint total_channels = 4;
- jint i;
-
- gdk_threads_enter();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return NULL; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
-
- if (gr->debug) printf ("getImagePixels\n");
-
- gdk_drawable_get_size (gr->drawable, &width, &height);
-
- buf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, has_alpha,
- bits_per_sample,
- width, height);
- g_assert (buf != NULL);
- g_assert (gdk_pixbuf_get_bits_per_sample (buf) == bits_per_sample);
- g_assert (gdk_pixbuf_get_n_channels (buf) == total_channels);
-
-
- /* copy pixels from drawable to pixbuf */
-
- gdk_pixbuf_get_from_drawable (buf, gr->drawable,
- NULL,
- 0, 0, 0, 0,
- width, height);
-
- native_pixels= gdk_pixbuf_get_pixels (buf);
-
-#ifndef WORDS_BIGENDIAN
- /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */
- for (i=0; i<width * height; i++)
- {
- native_pixels[i] = SWAPU32 ((unsigned)native_pixels[i]);
- }
-#endif
-
- java_pixels = (*env) -> NewIntArray (env, width * height);
-
- (*env)->SetIntArrayRegion(env, java_pixels,
- (jsize)0, (jsize) width*height,
- (jint*) native_pixels);
-
- gdk_threads_leave();
- return java_pixels;
-}
-
/* passthrough methods to cairo */
JNIEXPORT void JNICALL
@@ -917,13 +942,13 @@ install_font_peer(cairo_t *cr,
if (debug) printf ("install_font_peer made new cairo font for '%s' at %f\n",
face->family_name,
(pango_font_description_get_size (pfont->desc) /
- (double)PANGO_SCALE) * (96.0 / 72.0));
+ (double)PANGO_SCALE));
cairo_set_font (cr, ft);
cairo_font_destroy (ft);
cairo_scale_font (cr,
(pango_font_description_get_size (pfont->desc) /
- (double)PANGO_SCALE) * (96.0 / 72.0));
+ (double)PANGO_SCALE));
ft = cairo_current_font (cr);
pfont->graphics_resource = ft;
}
@@ -935,24 +960,10 @@ install_font_peer(cairo_t *cr,
}
}
-static cairo_t *metrics_cairo = NULL;
-static cairo_surface_t *metrics_surface = NULL;
-
-static void
-ensure_metrics_cairo()
-{
- if (metrics_cairo == NULL)
- {
- metrics_cairo = cairo_create ();
- metrics_surface = cairo_image_surface_create (CAIRO_FORMAT_A8, 1, 1);
- cairo_set_target_surface (metrics_cairo, metrics_surface);
- }
-}
-
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkGraphics2D_releasePeerGraphicsResource
- (JNIEnv *env, jclass clazz, jobject java_font)
+ (JNIEnv *env, jclass clazz __attribute__ ((unused)), jobject java_font)
{
struct peerfont *pfont = NULL;
@@ -969,80 +980,9 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_releasePeerGraphicsResource
gdk_threads_leave();
}
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_getPeerTextMetrics
- (JNIEnv *env, jclass clazz, jobject java_font, jstring str, jdoubleArray java_metrics)
-{
- struct peerfont *pfont = NULL;
- const char *cstr = NULL;
- jdouble *native_metrics = NULL;
- cairo_text_extents_t extents;
-
- g_assert(java_font != NULL);
- gdk_threads_enter();
-
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, java_font);
- g_assert (pfont != NULL);
-
- ensure_metrics_cairo();
- install_font_peer (metrics_cairo, pfont, 0);
-
- cstr = (*env)->GetStringUTFChars (env, str, NULL);
- g_assert(cstr != NULL);
- cairo_text_extents (metrics_cairo, cstr, &extents);
-
- native_metrics = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
- g_assert (native_metrics != NULL);
-
- native_metrics[TEXT_METRICS_X_BEARING] = extents.x_bearing;
- native_metrics[TEXT_METRICS_Y_BEARING] = extents.y_bearing;
- native_metrics[TEXT_METRICS_WIDTH] = extents.width;
- native_metrics[TEXT_METRICS_HEIGHT] = extents.height;
- native_metrics[TEXT_METRICS_X_ADVANCE] = extents.x_advance;
- native_metrics[TEXT_METRICS_Y_ADVANCE] = extents.y_advance;
-
- (*env)->ReleaseStringUTFChars (env, str, cstr);
- (*env)->ReleaseDoubleArrayElements (env, java_metrics, native_metrics, 0);
- gdk_threads_leave();
-}
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_getPeerFontMetrics
- (JNIEnv *env, jclass clazz, jobject java_font, jdoubleArray java_metrics)
-{
- struct peerfont *pfont = NULL;
- jdouble *native_metrics = NULL;
- cairo_font_extents_t extents;
-
- g_assert(java_font != NULL);
-
- gdk_threads_enter();
-
- pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, java_font);
- g_assert (pfont != NULL);
-
- ensure_metrics_cairo();
- install_font_peer (metrics_cairo, pfont, 0);
-
- cairo_current_font_extents (metrics_cairo, &extents);
-
- native_metrics = (*env)->GetDoubleArrayElements (env, java_metrics, NULL);
- g_assert (native_metrics != NULL);
-
- native_metrics[FONT_METRICS_ASCENT] = extents.ascent;
- native_metrics[FONT_METRICS_MAX_ASCENT] = extents.ascent;
- native_metrics[FONT_METRICS_DESCENT] = extents.descent;
- if (native_metrics[FONT_METRICS_DESCENT] < 0)
- native_metrics[FONT_METRICS_DESCENT] = - native_metrics[FONT_METRICS_DESCENT];
- native_metrics[FONT_METRICS_MAX_DESCENT] = native_metrics[FONT_METRICS_DESCENT];
- native_metrics[FONT_METRICS_MAX_ADVANCE] = extents.max_x_advance;
-
- (*env)->ReleaseDoubleArrayElements (env, java_metrics, native_metrics, 0);
- gdk_threads_leave();
-}
-
static void
-paint_glyph_run(struct graphics2d *gr,
+paint_glyph_run(JNIEnv *env,
+ struct graphics2d *gr,
cairo_glyph_t **glyphs,
gint *n_glyphs,
PangoLayoutRun *run)
@@ -1090,134 +1030,71 @@ paint_glyph_run(struct graphics2d *gr,
}
if (gr->debug) printf("\n");
- begin_drawing_operation (gr);
+ begin_drawing_operation (env, gr);
cairo_show_glyphs (gr->cr, *glyphs, run->glyphs->num_glyphs);
- end_drawing_operation (gr);
+ end_drawing_operation (env, gr);
}
}
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawString
- (JNIEnv *env, jobject obj, jobject font, jstring str, float x, float y)
-{
- struct graphics2d *gr = NULL;
- const char *cstr = NULL;
- struct peerfont *pfont = NULL;
-
- /*
- cairo_glyph_t *glyphs = NULL;
- gint n_glyphs = 0;
- PangoLayoutRun *run = NULL;
- PangoLayoutIter *iter = NULL;
- */
-
- g_assert(obj != NULL);
- g_assert(font != NULL);
- g_assert(str != NULL);
-
- gdk_threads_enter ();
- if (peer_is_disposed(env, obj)) { gdk_threads_leave(); return; }
-
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert(gr != NULL);
-
- pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, font);
- g_assert (pfont != NULL);
-
- cstr = (*env)->GetStringUTFChars (env, str, NULL);
- g_assert(cstr != NULL);
-
- if (gr->debug) printf ("painting string '%s' at (%f,%f)\n", cstr, x, y);
-
- /* For now we let cairo do the glyph conversion; eventually this
- * ought to be unified with pango, but it is impossible to get
- * pango and cairo to agree on metrics at the moment, so we either
- * have to use "all cairo" metrics (the string-based APIs) or
- * "all pango" metrics (the glyph-vector based APIs).
- */
-
- install_font_peer (gr->cr, pfont, gr->debug);
- cairo_move_to (gr->cr, x, y);
- cairo_show_text (gr->cr, cstr);
-
- /*
-
- pango_layout_set_text (gr->pango_layout, cstr, -1);
-
- iter = pango_layout_get_iter (gr->pango_layout);
- g_assert(iter != NULL);
-
- cairo_translate (gr->cr, x, y);
-
- do
- {
- run = pango_layout_iter_get_run (iter);
- if (run != NULL)
- paint_glyph_run (gr, &glyphs, &n_glyphs, run);
- }
- while (pango_layout_iter_next_run (iter));
-
- if (glyphs != NULL)
- g_free (glyphs);
-
- cairo_translate (gr->cr, -x, -y);
-
- pango_layout_iter_free (iter);
-
- */
-
- gdk_threads_leave ();
-
- (*env)->ReleaseStringUTFChars (env, str, cstr);
-}
-
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGdkGlyphVector
- (JNIEnv *env, jobject self, jobject font, jobject java_vec, jfloat x, jfloat y)
+Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGlyphVector
+ (JNIEnv *env, jobject self,
+ jobject font,
+ jfloat x, jfloat y, jint n,
+ jintArray java_codes,
+ jfloatArray java_positions)
{
struct graphics2d *gr = NULL;
struct peerfont *pfont = NULL;
- struct glyphvec *gv = NULL;
- PangoLayoutRun *run = NULL;
cairo_glyph_t *glyphs = NULL;
- gint n_glyphs = 0;
+ int *native_codes;
+ float *native_positions;
+ jint i = 0;
g_assert (self != NULL);
- g_assert (java_vec != NULL);
+ g_assert (java_codes != NULL);
+ g_assert (java_positions != NULL);
gdk_threads_enter ();
if (peer_is_disposed(env, self)) { gdk_threads_leave(); return; }
gr = (struct graphics2d *)NSA_GET_G2D_PTR (env, self);
- gv = (struct glyphvec *)NSA_GET_GV_PTR (env, java_vec);
- pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, font);
-
g_assert (gr != NULL);
- g_assert (gv != NULL);
+
+ pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, font);
g_assert (pfont != NULL);
- if (gr->debug) printf ("painting pango glyph vector\n");
+ install_font_peer(gr->cr, pfont, gr->debug);
- install_font_peer (gr->cr, pfont, gr->debug);
- cairo_translate (gr->cr, x, y);
+ glyphs = malloc( sizeof(cairo_glyph_t) * n);
+ g_assert (glyphs != NULL);
- /* nb. PangoLayoutRun is a typedef for PangoGlyphItem. */
- run = (PangoLayoutRun *) gv->glyphitems;
- if (run != NULL)
- paint_glyph_run (gr, &glyphs, &n_glyphs, run);
+ native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
+ native_positions = (*env)->GetFloatArrayElements (env, java_positions, NULL);
+
+ for (i = 0; i < n; ++i)
+ {
+ glyphs[i].index = native_codes[i];
+ glyphs[i].x = x + native_positions[ 2*i ];
+ glyphs[i].y = y + native_positions[ 2*i + 1];
+ }
- if (glyphs != NULL)
- g_free (glyphs);
+ (*env)->ReleaseFloatArrayElements (env, java_positions, native_positions, 0);
+ (*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0);
+
+ begin_drawing_operation (env, gr);
+ cairo_show_glyphs (gr->cr, glyphs, n);
+ end_drawing_operation (env, gr);
- cairo_translate (gr->cr, -x, -y);
gdk_threads_leave ();
+ free(glyphs);
}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGdkTextLayout
- (JNIEnv *env, jobject self, jobject font, jobject java_layout, jfloat x, jfloat y)
+ (JNIEnv *env, jobject self, jobject java_layout, jfloat x, jfloat y)
{
/*
* FIXME: Some day we expect either cairo or pango will know how to make
@@ -1225,7 +1102,6 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGdkTextLayout
*/
struct graphics2d *gr = NULL;
- struct peerfont *pfont = NULL;
struct textlayout *tl = NULL;
PangoLayoutIter *i = NULL;
PangoLayoutRun *run = NULL;
@@ -1237,12 +1113,10 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGdkTextLayout
gr = (struct graphics2d *)NSA_GET_G2D_PTR (env, self);
tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, java_layout);
- pfont = (struct peerfont *) NSA_GET_FONT_PTR (env, font);
g_assert (gr != NULL);
g_assert (tl != NULL);
g_assert (tl->pango_layout != NULL);
- g_assert (pfont != NULL);
if (gr->debug) printf ("painting pango layout\n");
@@ -1252,14 +1126,13 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGdkTextLayout
i = pango_layout_get_iter (tl->pango_layout);
g_assert (i != NULL);
- install_font_peer (gr->cr, pfont, gr->debug);
cairo_translate (gr->cr, x, y);
do
{
run = pango_layout_iter_get_run (i);
if (run != NULL)
- paint_glyph_run (gr, &glyphs, &n_glyphs, run);
+ paint_glyph_run (env, gr, &glyphs, &n_glyphs, run);
}
while (pango_layout_iter_next_run (i));
@@ -1671,9 +1544,9 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoStroke
gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
g_assert (gr != NULL);
if (gr->debug) printf ("cairo_stroke\n");
- begin_drawing_operation (gr);
+ begin_drawing_operation (env, gr);
cairo_stroke (gr->cr);
- end_drawing_operation (gr);
+ end_drawing_operation (env, gr);
gdk_threads_leave();
}
@@ -1689,9 +1562,9 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoFill
gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
g_assert (gr != NULL);
if (gr->debug) printf ("cairo_fill\n");
- begin_drawing_operation (gr);
+ begin_drawing_operation (env, gr);
cairo_fill (gr->cr);
- end_drawing_operation (gr);
+ end_drawing_operation (env, gr);
gdk_threads_leave();
}
@@ -1707,10 +1580,10 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoClip
gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
if (gr == NULL) { gdk_threads_leave (); return; }
if (gr->debug) printf ("cairo_clip\n");
- begin_drawing_operation (gr);
+ begin_drawing_operation (env, gr);
cairo_init_clip (gr->cr);
cairo_clip (gr->cr);
- end_drawing_operation (gr);
+ end_drawing_operation (env, gr);
gdk_threads_leave();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
index 3cb3bd25b56..0727999df19 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
@@ -60,6 +60,8 @@ static JavaVM *vm;
static jmethodID areaPreparedID;
static jmethodID areaUpdatedID;
+static jmethodID dataOutputWriteID;
+static jmethodID registerFormatID;
static void
area_prepared (GdkPixbufLoader *loader,
@@ -193,10 +195,72 @@ Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_initState
NSA_SET_PB_PTR (env, obj, loader);
}
+static void
+query_formats (JNIEnv *env, jclass clazz)
+{
+ jobject jformat;
+ GSList *formats, *f;
+ GdkPixbufFormat *format;
+ char **ch, *name;
+
+ jclass formatClass;
+ jmethodID addExtensionID;
+ jmethodID addMimeTypeID;
+
+ formatClass = (*env)->FindClass
+ (env, "gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec");
+
+ g_assert(formatClass != NULL);
+
+ addExtensionID = (*env)->GetMethodID (env, formatClass,
+ "addExtension",
+ "(Ljava/lang/String;)V");
+
+ addMimeTypeID = (*env)->GetMethodID (env, formatClass,
+ "addMimeType",
+ "(Ljava/lang/String;)V");
+
+ formats = gdk_pixbuf_get_formats ();
+
+ for (f = formats; f; f = f->next)
+ {
+ format = (GdkPixbufFormat *) f->data;
+ name = gdk_pixbuf_format_get_name(format);
+
+ jformat = (*env)->CallStaticObjectMethod
+ (env, clazz, registerFormatID,
+ (*env)->NewStringUTF(env, name),
+ (jboolean) gdk_pixbuf_format_is_writable(format));
+
+ g_assert(jformat != NULL);
+
+ ch = gdk_pixbuf_format_get_extensions(format);
+ while (*ch)
+ {
+ (*env)->CallVoidMethod (env, jformat, addExtensionID,
+ (*env)->NewStringUTF(env, *ch));
+ ++ch;
+ }
+
+ ch = gdk_pixbuf_format_get_mime_types(format);
+ while (*ch)
+ {
+ (*env)->CallVoidMethod (env, jformat, addMimeTypeID,
+ (*env)->NewStringUTF(env, *ch));
+ ++ch;
+ }
+ }
+
+ g_slist_free(formats);
+}
+
+
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_initStaticState
(JNIEnv *env, jclass clazz)
{
+ jclass dataOutputClass;
+
(*env)->GetJavaVM(env, &vm);
areaPreparedID = (*env)->GetMethodID (env, clazz,
@@ -206,6 +270,20 @@ Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_initStaticState
areaUpdatedID = (*env)->GetMethodID (env, clazz,
"areaUpdated",
"(IIII[II)V");
+
+ registerFormatID = (*env)->GetStaticMethodID
+ (env, clazz,
+ "registerFormat",
+ "(Ljava/lang/String;Z)"
+ "Lgnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec;");
+
+
+ dataOutputClass = (*env)->FindClass(env, "java/io/DataOutput");
+ dataOutputWriteID = (*env)->GetMethodID (env, dataOutputClass,
+ "write", "([B)V");
+
+ query_formats (env, clazz);
+
NSA_PB_INIT (env, clazz);
}
@@ -226,6 +304,115 @@ Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_finish
gdk_threads_leave ();
}
+struct stream_save_request
+{
+ JNIEnv *env;
+ jobject *stream;
+};
+
+static gboolean
+save_to_stream(const gchar *buf,
+ gsize count,
+ GError **error __attribute__((unused)),
+ gpointer data)
+{
+ struct stream_save_request *ssr = (struct stream_save_request *)data;
+
+ jbyteArray jbuf;
+ jbyte *cbuf;
+
+ gdk_threads_leave ();
+ jbuf = (*(ssr->env))->NewByteArray ((ssr->env), count);
+ cbuf = (*(ssr->env))->GetByteArrayElements ((ssr->env), jbuf, NULL);
+ memcpy (cbuf, buf, count);
+ (*(ssr->env))->ReleaseByteArrayElements ((ssr->env), jbuf, cbuf, 0);
+ (*(ssr->env))->CallVoidMethod ((ssr->env), *(ssr->stream),
+ dataOutputWriteID, jbuf);
+ gdk_threads_enter ();
+ return TRUE;
+}
+
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_streamImage
+(JNIEnv *env, jclass clazz __attribute__((unused)),
+ jintArray jarr, jstring jenctype, jint width, jint height,
+ jboolean hasAlpha, jobject stream)
+{
+ GdkPixbuf* pixbuf;
+ jint *ints;
+ guchar a, r, g, b, *pix, *p;
+ GError *err = NULL;
+ const char *enctype;
+ int i;
+
+ struct stream_save_request ssr;
+ ssr.stream = &stream;
+ ssr.env = env;
+
+ ints = (*env)->GetIntArrayElements (env, jarr, NULL);
+ pix = g_malloc(width * height * (hasAlpha ? 4 : 3));
+
+ enctype = (*env)->GetStringUTFChars (env, jenctype, NULL);
+ g_assert(enctype != NULL);
+
+ g_assert (pix != NULL);
+ g_assert (ints != NULL);
+
+ p = pix;
+ for (i = 0; i < width*height; ++i)
+ {
+ /*
+ * Java encodes pixels as integers in a predictable arithmetic order:
+ * 0xAARRGGBB. Since these are jints, JNI has already byte-swapped
+ * them for us if necessary, so they're in "our" endianness, whatever
+ * that is. It uses 4 bytes per pixel whether or not there's an alpha
+ * channel.
+ */
+
+ a = 0xff & (ints[i] >> 24);
+ r = 0xff & (ints[i] >> 16);
+ g = 0xff & (ints[i] >> 8);
+ b = 0xff & ints[i];
+
+ /*
+ * GDK-pixbuf has a very different storage model:
+ *
+ * - A different alpha order (alpha after colors).
+ * - A different packing model (no alpha -> 3-bytes-per-pixel).
+ * - A different "RGB" order (host memory order, not endian-neutral).
+ */
+
+ *p++ = r;
+ *p++ = g;
+ *p++ = b;
+ if (hasAlpha)
+ *p++ = a;
+ }
+
+ gdk_threads_enter ();
+ pixbuf = gdk_pixbuf_new_from_data (pix,
+ GDK_COLORSPACE_RGB,
+ (gboolean) hasAlpha,
+ 8, width, height,
+ width * (hasAlpha ? 4 : 3), /* rowstride */
+ NULL, NULL);
+ g_assert (pixbuf != NULL);
+
+ g_assert(gdk_pixbuf_save_to_callback (pixbuf,
+ &save_to_stream,
+ &ssr,
+ enctype,
+ &err, NULL));
+
+ g_object_unref (pixbuf);
+
+ gdk_threads_leave ();
+ g_free(pix);
+
+ (*env)->ReleaseStringUTFChars (env, jenctype, enctype);
+ (*env)->ReleaseIntArrayElements (env, jarr, ints, 0);
+}
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_pumpBytes
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
index 1cb43349536..94e98bf965a 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
@@ -315,10 +315,12 @@ focus_in_cb (GtkWidget *widget __attribute((unused)),
GdkEventFocus *event __attribute((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postFocusEventID,
AWT_FOCUS_GAINED,
JNI_FALSE);
+ gdk_threads_enter ();
return FALSE;
}
@@ -327,21 +329,27 @@ focus_out_cb (GtkWidget *widget __attribute((unused)),
GdkEventFocus *event __attribute((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postFocusEventID,
AWT_FOCUS_LOST,
JNI_FALSE);
+ gdk_threads_enter ();
return FALSE;
}
static void
block_expose_events_cb (GtkWidget *widget, jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
beginNativeRepaintID);
+ gdk_threads_enter ();
gdk_window_process_updates (widget->window, TRUE);
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
endNativeRepaintID);
+ gdk_threads_enter ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
index 3b58c05d7ea..6c854eff855 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
@@ -208,7 +208,7 @@ Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_gtkButtonSetLabel
static void
item_toggled (GtkToggleButton *item, jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postItemEventID,
peer,
item->active ?
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
index 94c9c3d0c2d..b4e64e62d02 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
@@ -39,22 +39,24 @@ exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkChoicePeer.h"
-static void selection_changed (GtkComboBox *combobox, gpointer data);
+static void selection_changed (GtkComboBox *combobox, jobject peer);
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create
(JNIEnv *env, jobject obj)
{
GtkWidget *combobox;
+ jobject *gref;
NSA_SET_GLOBAL_REF (env, obj);
+ gref = NSA_GET_GLOBAL_REF (env, obj);
gdk_threads_enter ();
combobox = gtk_combo_box_new_text ();
g_signal_connect (combobox, "changed",
- G_CALLBACK (selection_changed), obj);
+ G_CALLBACK (selection_changed), *gref);
gdk_threads_leave ();
@@ -175,7 +177,7 @@ Java_gnu_java_awt_peer_gtk_GtkChoicePeer_nativeGetSelected
return index;
}
-void selection_changed (GtkComboBox *combobox, jobject peer)
+static void selection_changed (GtkComboBox *combobox, jobject peer)
{
jstring label;
GtkTreeModel *model;
@@ -195,8 +197,8 @@ void selection_changed (GtkComboBox *combobox, jobject peer)
gdk_threads_leave ();
- label = (*gdk_env)->NewStringUTF (gdk_env, selected);
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ label = (*gdk_env())->NewStringUTF (gdk_env(), selected);
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
choicePostItemEventID,
label,
(jint) AWT_ITEM_SELECTED);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
index 986244ee2f0..e05185790b3 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
@@ -110,15 +110,15 @@ selection_received (GtkWidget *widget __attribute__((unused)),
if (selection_data->length < 0
|| selection_data->type != GDK_SELECTION_TYPE_STRING)
{
- (*gdk_env)->CallVoidMethod (gdk_env, cb_obj, stringSelectionReceivedID,
- NULL);
+ (*gdk_env())->CallVoidMethod (gdk_env(), cb_obj, stringSelectionReceivedID,
+ NULL);
}
else
{
char *str = (char *) selection_data->data;
- (*gdk_env)->CallVoidMethod (gdk_env, cb_obj, stringSelectionReceivedID,
- (*gdk_env)->NewStringUTF (gdk_env, str));
+ (*gdk_env())->CallVoidMethod (gdk_env(), cb_obj, stringSelectionReceivedID,
+ (*gdk_env())->NewStringUTF (gdk_env(), str));
}
return;
@@ -135,7 +135,7 @@ selection_get (GtkWidget *widget __attribute__((unused)),
const char *utf;
jsize utflen;
- jstr = (*gdk_env)->CallObjectMethod (gdk_env, cb_obj,
+ jstr = (*gdk_env())->CallObjectMethod (gdk_env(), cb_obj,
stringSelectionHandlerID);
if (!jstr)
@@ -145,13 +145,13 @@ selection_get (GtkWidget *widget __attribute__((unused)),
return;
}
- utflen = (*gdk_env)->GetStringUTFLength (gdk_env, jstr);
- utf = (*gdk_env)->GetStringUTFChars (gdk_env, jstr, NULL);
+ utflen = (*gdk_env())->GetStringUTFLength (gdk_env(), jstr);
+ utf = (*gdk_env())->GetStringUTFChars (gdk_env(), jstr, NULL);
gtk_selection_data_set (selection_data, GDK_TARGET_STRING, 8,
(const unsigned char*)utf, utflen);
- (*gdk_env)->ReleaseStringUTFChars (gdk_env, jstr, utf);
+ (*gdk_env())->ReleaseStringUTFChars (gdk_env(), jstr, utf);
}
JNIEXPORT void JNICALL
@@ -177,7 +177,7 @@ gint
selection_clear (GtkWidget *widget __attribute__((unused)),
GdkEventSelection *event __attribute__((unused)))
{
- (*gdk_env)->CallVoidMethod (gdk_env, cb_obj, selectionClearID);
+ (*gdk_env())->CallVoidMethod (gdk_env(), cb_obj, selectionClearID);
return TRUE;
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
index 3aebe77755d..4cd3f16574f 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
@@ -60,7 +60,7 @@ static gboolean focus_out_cb (GtkWidget *widget,
#ifdef __GNUC__
__inline
#endif
-static guint
+guint
awt_keycode_to_keysym (jint keyCode, jint keyLocation)
{
/* GDK_A through GDK_Z */
@@ -1054,10 +1054,12 @@ focus_in_cb (GtkWidget *widget __attribute((unused)),
GdkEventFocus *event __attribute((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postFocusEventID,
AWT_FOCUS_GAINED,
JNI_FALSE);
+ gdk_threads_enter ();
return FALSE;
}
@@ -1066,9 +1068,11 @@ focus_out_cb (GtkWidget *widget __attribute((unused)),
GdkEventFocus *event __attribute((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postFocusEventID,
AWT_FOCUS_LOST,
JNI_FALSE);
+ gdk_threads_enter ();
return FALSE;
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
index 65f64e04eea..8d3dda93ad8 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
@@ -58,11 +58,11 @@ button_to_awt_mods (int button)
switch (button)
{
case 1:
- return AWT_BUTTON1_DOWN_MASK;
+ return AWT_BUTTON1_MASK;
case 2:
- return AWT_BUTTON2_DOWN_MASK;
+ return AWT_BUTTON2_MASK;
case 3:
- return AWT_BUTTON3_DOWN_MASK;
+ return AWT_BUTTON3_MASK;
}
return 0;
@@ -883,7 +883,8 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
switch (event->type)
{
case GDK_BUTTON_PRESS:
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postMouseEventID,
AWT_MOUSE_PRESSED,
(jlong)event->button.time,
@@ -894,13 +895,15 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
click_count,
(event->button.button == 3) ? JNI_TRUE :
JNI_FALSE);
+ gdk_threads_enter ();
hasBeenDragged = FALSE;
break;
case GDK_BUTTON_RELEASE:
{
int width, height;
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postMouseEventID,
AWT_MOUSE_RELEASED,
(jlong)event->button.time,
@@ -910,6 +913,7 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
(jint)event->button.y,
click_count,
JNI_FALSE);
+ gdk_threads_enter ();
/* Generate an AWT click event only if the release occured in the
window it was pressed in, and the mouse has not been dragged since
@@ -921,7 +925,8 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
&& event->button.x <= width
&& event->button.y <= height)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postMouseEventID,
AWT_MOUSE_CLICKED,
(jlong)event->button.time,
@@ -931,6 +936,7 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
(jint)event->button.y,
click_count,
JNI_FALSE);
+ gdk_threads_enter ();
}
}
break;
@@ -941,7 +947,8 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
| GDK_BUTTON4_MASK
| GDK_BUTTON5_MASK))
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postMouseEventID,
AWT_MOUSE_DRAGGED,
(jlong)event->motion.time,
@@ -950,44 +957,58 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
(jint)event->motion.y,
0,
JNI_FALSE);
+ gdk_threads_enter ();
hasBeenDragged = TRUE;
}
else
- (*gdk_env)->CallVoidMethod (gdk_env, peer, postMouseEventID,
- AWT_MOUSE_MOVED,
- (jlong)event->motion.time,
- state_to_awt_mods (event->motion.state),
- (jint)event->motion.x,
- (jint)event->motion.y,
- 0,
- JNI_FALSE);
+ {
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
+ AWT_MOUSE_MOVED,
+ (jlong)event->motion.time,
+ state_to_awt_mods (event->motion.state),
+ (jint)event->motion.x,
+ (jint)event->motion.y,
+ 0,
+ JNI_FALSE);
+ gdk_threads_enter ();
+ }
+
break;
case GDK_ENTER_NOTIFY:
/* We are not interested in enter events that are due to
grab/ungrab and not to actually crossing boundaries */
if (event->crossing.mode == GDK_CROSSING_NORMAL)
- (*gdk_env)->CallVoidMethod (gdk_env, peer, postMouseEventID,
- AWT_MOUSE_ENTERED,
- (jlong)event->crossing.time,
- state_to_awt_mods_with_button_states (event->crossing.state),
- (jint)event->crossing.x,
- (jint)event->crossing.y,
- 0,
- JNI_FALSE);
+ {
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
+ AWT_MOUSE_ENTERED,
+ (jlong)event->crossing.time,
+ state_to_awt_mods_with_button_states (event->crossing.state),
+ (jint)event->crossing.x,
+ (jint)event->crossing.y,
+ 0,
+ JNI_FALSE);
+ gdk_threads_enter ();
+ }
break;
case GDK_LEAVE_NOTIFY:
/* We are not interested in leave events that are due to
grab/ungrab and not to actually crossing boundaries */
if (event->crossing.mode == GDK_CROSSING_NORMAL)
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
- postMouseEventID,
- AWT_MOUSE_EXITED,
- (jlong)event->crossing.time,
- state_to_awt_mods_with_button_states (event->crossing.state),
- (jint)event->crossing.x,
- (jint)event->crossing.y,
- 0,
- JNI_FALSE);
+ {
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+ postMouseEventID,
+ AWT_MOUSE_EXITED,
+ (jlong)event->crossing.time,
+ state_to_awt_mods_with_button_states (event->crossing.state),
+ (jint)event->crossing.x,
+ (jint)event->crossing.y,
+ 0,
+ JNI_FALSE);
+ gdk_threads_enter ();
+ }
break;
case GDK_CONFIGURE:
{
@@ -1001,7 +1022,7 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
returns. */
gdk_threads_leave ();
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postConfigureEventID,
(jint) event->configure.x,
(jint) event->configure.y,
@@ -1012,20 +1033,24 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
}
break;
case GDK_EXPOSE:
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postExposeEventID,
(jint)event->expose.area.x,
(jint)event->expose.area.y,
(jint)event->expose.area.width,
(jint)event->expose.area.height);
+ gdk_threads_enter ();
break;
case GDK_FOCUS_CHANGE:
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postFocusEventID,
(jint) (event->focus_change.in) ?
AWT_FOCUS_GAINED : AWT_FOCUS_LOST,
JNI_FALSE);
+ gdk_threads_enter ();
break;
case GDK_KEY_PRESS:
if (GTK_IS_WINDOW (widget))
@@ -1033,7 +1058,8 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
/* GdkEventKey *keyevent = (GdkEventKey *) event; */
/* g_printerr ("key press event: sent: %d time: %d state: %d keyval: %d length: %d string: %s hardware_keycode: %d group: %d\n", keyevent->send_event, keyevent->time, keyevent->state, keyevent->keyval, keyevent->length, keyevent->string, keyevent->hardware_keycode, keyevent->group); */
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postKeyEventID,
(jint) AWT_KEY_PRESSED,
(jlong) event->key.time,
@@ -1041,6 +1067,7 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
keysym_to_awt_keycode (event),
keyevent_to_awt_keychar (event),
keysym_to_awt_keylocation (event));
+ gdk_threads_enter ();
/* FIXME: generation of key typed events needs to be moved
to GtkComponentPeer.postKeyEvent. If the key in a key
press event is not an "action" key
@@ -1054,7 +1081,8 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
case GDK_KEY_RELEASE:
if (GTK_IS_WINDOW (widget))
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postKeyEventID,
(jint) AWT_KEY_RELEASED,
(jlong) event->key.time,
@@ -1062,6 +1090,7 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
keysym_to_awt_keycode (event),
keyevent_to_awt_keychar (event),
keysym_to_awt_keylocation (event));
+ gdk_threads_enter ();
return TRUE;
}
else
@@ -1135,13 +1164,13 @@ void connect_awt_hook_cb (GtkWidget *widget __attribute__((unused)),
{
void *ptr;
- ptr = NSA_GET_PTR (gdk_env, peer);
+ ptr = NSA_GET_PTR (gdk_env(), peer);
- connect_awt_hook (gdk_env, peer, 1, GTK_WIDGET (ptr)->window);
+ connect_awt_hook (gdk_env(), peer, 1, GTK_WIDGET (ptr)->window);
gdk_threads_leave ();
- (*gdk_env)->CallVoidMethod (gdk_env, peer, setCursorID);
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer, setCursorID);
gdk_threads_enter ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
index 3a2e41f21a7..791916174ed 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
@@ -41,8 +41,8 @@ exception statement from your version. */
#include "gnu_java_awt_peer_gtk_GtkFileDialogPeer.h"
static void handle_response (GtkDialog *dialog,
- gint responseId,
- jobject peer_obj);
+ gint responseId,
+ jobject peer_obj);
/*
* Make a new file selection dialog
@@ -62,15 +62,17 @@ Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create
gdk_threads_enter ();
- widget = gtk_file_chooser_dialog_new("",
- GTK_WINDOW(parentp),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
-
- /* GtkFileChooser doesn't show hidden files by default. */
- g_object_set(GTK_FILE_CHOOSER(widget), "show_hidden", TRUE);
+ /* FIXME: we should be using the default gnome-vfs backend but it is
+ not currently thread-safe. See:
+ http://bugzilla.gnome.org/show_bug.cgi?id=166852 */
+ widget = gtk_file_chooser_dialog_new_with_backend
+ ("Open File",
+ GTK_WINDOW(parentp),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ "gtk+",
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL);
/* GtkFileSelect is not modal by default */
gtk_window_set_modal (GTK_WINDOW (widget), TRUE);
@@ -97,7 +99,7 @@ Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_connectSignals
g_signal_connect (G_OBJECT (GTK_DIALOG (ptr)),
"response",
GTK_SIGNAL_FUNC (handle_response), *gref);
-
+
gdk_threads_leave ();
/* Connect the superclass signals. */
@@ -112,7 +114,7 @@ Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeGetDirectory
const char *str;
ptr = NSA_GET_PTR (env, obj);
-
+
gdk_threads_enter ();
str = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER(ptr));
@@ -135,14 +137,14 @@ static gboolean filenameFilterCallback (const GtkFileFilterInfo *filter_info,
jstring *filename;
gboolean accepted;
- cx = (*gdk_env)->GetObjectClass (gdk_env, (jobject) obj);
- id = (*gdk_env)->GetMethodID (gdk_env, cx, "filenameFilterCallback",
+ cx = (*gdk_env())->GetObjectClass (gdk_env(), (jobject) obj);
+ id = (*gdk_env())->GetMethodID (gdk_env(), cx, "filenameFilterCallback",
"(Ljava/lang/String;)Z");
- filename = (*gdk_env)->NewStringUTF(gdk_env, filter_info->filename);
-
+ filename = (*gdk_env())->NewStringUTF(gdk_env(), filter_info->filename);
+
gdk_threads_leave();
- accepted = (*gdk_env)->CallBooleanMethod(gdk_env, obj, id, filename);
+ accepted = (*gdk_env())->CallBooleanMethod(gdk_env(), obj, id, filename);
gdk_threads_enter();
return accepted;
@@ -166,8 +168,8 @@ Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFilenameFilter
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(ptr), filter);
gdk_threads_leave ();
- }
-
+}
+
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetDirectory
(JNIEnv *env, jobject obj, jstring directory)
@@ -196,7 +198,7 @@ Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFile
ptr = NSA_GET_PTR (env, obj);
str = (*env)->GetStringUTFChars (env, filename, 0);
-
+
gdk_threads_enter ();
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (ptr), str);
gdk_threads_leave ();
@@ -207,7 +209,7 @@ Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_nativeSetFile
static void
handle_response (GtkDialog *dialog __attribute__((unused)),
gint responseId,
- jobject peer_obj)
+ jobject peer_obj)
{
static int isDisposeIDSet = 0;
static int isIDSet = 0;
@@ -221,51 +223,51 @@ handle_response (GtkDialog *dialog __attribute__((unused)),
/* We only need this for the case when the user closed the window,
or clicked ok or cancel. */
if (responseId != GTK_RESPONSE_DELETE_EVENT
- && responseId != GTK_RESPONSE_OK
+ && responseId != GTK_RESPONSE_ACCEPT
&& responseId != GTK_RESPONSE_CANCEL)
return;
-
- ptr = NSA_GET_PTR (gdk_env, peer_obj);
-
+
+ ptr = NSA_GET_PTR (gdk_env(), peer_obj);
+
if (responseId == GTK_RESPONSE_DELETE_EVENT)
{
if (!isDisposeIDSet)
- {
- jclass cx = (*gdk_env)->GetObjectClass (gdk_env, peer_obj);
- disposeID = (*gdk_env)->GetMethodID (gdk_env, cx, "gtkDisposeFileDialog", "()V");
+ {
+ jclass cx = (*gdk_env())->GetObjectClass (gdk_env(), peer_obj);
+ disposeID = (*gdk_env())->GetMethodID (gdk_env(), cx, "gtkDisposeFileDialog", "()V");
isDisposeIDSet = 1;
- }
-
- gdk_threads_leave ();
+ }
+ gdk_threads_leave ();
+
/* We can dispose of the dialog now (and unblock show) */
- (*gdk_env)->CallVoidMethod (gdk_env, peer_obj, disposeID);
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj, disposeID);
- gdk_threads_enter ();
+ gdk_threads_enter ();
return;
-}
+ }
- if (responseId == GTK_RESPONSE_OK) {
+ if (responseId == GTK_RESPONSE_ACCEPT) {
fileName = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (GTK_WIDGET (ptr)));
- str_fileName = (*gdk_env)->NewStringUTF (gdk_env, fileName);
+ str_fileName = (*gdk_env())->NewStringUTF (gdk_env(), fileName);
}
-
+
if (!isIDSet)
{
- jclass cx = (*gdk_env)->GetObjectClass (gdk_env, peer_obj);
- hideID = (*gdk_env)->GetMethodID (gdk_env, cx, "gtkHideFileDialog", "()V");
- gtkSetFilenameID = (*gdk_env)->GetMethodID (gdk_env, cx,
+ jclass cx = (*gdk_env())->GetObjectClass (gdk_env(), peer_obj);
+ hideID = (*gdk_env())->GetMethodID (gdk_env(), cx, "gtkHideFileDialog", "()V");
+ gtkSetFilenameID = (*gdk_env())->GetMethodID (gdk_env(), cx,
"gtkSetFilename", "(Ljava/lang/String;)V");
isIDSet = 1;
}
gdk_threads_leave ();
-
+
/* Set the Java object field 'file' with this value. */
- (*gdk_env)->CallVoidMethod (gdk_env, peer_obj, gtkSetFilenameID, str_fileName);
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj, gtkSetFilenameID, str_fileName);
/* We can hide the dialog now (and unblock show) */
- (*gdk_env)->CallVoidMethod (gdk_env, peer_obj, hideID);
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj, hideID);
gdk_threads_enter ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
index 5c48832f9be..52da40cae5d 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFramePeer.c
@@ -177,3 +177,47 @@ Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImageFromDecoder
gdk_threads_leave ();
}
+
+static void
+free_pixbuf_data (guchar *pixels, gpointer data __attribute__((unused)))
+{
+ free(pixels);
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_nativeSetIconImageFromData
+ (JNIEnv *env, jobject obj, jintArray pixelArray, jint width, jint height)
+{
+ void *ptr;
+ GdkPixbuf *pixbuf;
+ jint *pixels;
+ int pixels_length, i;
+ guchar *data;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ pixels = (*env)->GetIntArrayElements (env, pixelArray, 0);
+ pixels_length = (*env)->GetArrayLength (env, pixelArray);
+
+ data = malloc (sizeof (guchar) * pixels_length);
+ for (i = 0; i < pixels_length; i++)
+ data[i] = (guchar) pixels[i];
+
+ gdk_threads_enter ();
+
+ pixbuf = gdk_pixbuf_new_from_data (data,
+ GDK_COLORSPACE_RGB,
+ TRUE,
+ 8,
+ width,
+ height,
+ width*4,
+ free_pixbuf_data,
+ NULL);
+
+ gtk_window_set_icon (GTK_WINDOW (ptr), pixbuf);
+
+ gdk_threads_leave ();
+
+ (*env)->ReleaseIntArrayElements(env, pixelArray, pixels, 0);
+}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
index 8eebce98082..49ccffcf660 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c
@@ -45,9 +45,7 @@ Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose
{
void *ptr;
- /* Remove entries from state tables */
- NSA_DEL_GLOBAL_REF (env, obj);
- ptr = NSA_DEL_PTR (env, obj);
+ ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
@@ -56,6 +54,17 @@ Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose
gtk_widget_destroy (GTK_WIDGET (ptr));
gdk_threads_leave ();
+
+ /* Remove entries from state tables */
+ NSA_DEL_GLOBAL_REF (env, obj);
+ NSA_DEL_PTR (env, obj);
+
+ /*
+ * Wake up the main thread, to make sure it re-checks the window
+ * destruction condition.
+ */
+
+ g_main_context_wakeup (NULL);
}
JNIEXPORT void JNICALL
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
index 575f3c9a596..468be06c157 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
@@ -1,5 +1,5 @@
-/* gtklistpeer.c -- Native implementation of GtkListPeer
- Copyright (C) 1998, 1999, 2004 Free Software Foundation, Inc.
+/* GtkListPeer.c -- implements GtkListPeer's native methods
+ Copyright (C) 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -498,12 +498,12 @@ item_highlighted (GtkTreeSelection *selection __attribute__((unused)),
row = indices ? indices[0] : -1;
if (!path_currently_selected)
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postListItemEventID,
row,
(jint) AWT_ITEM_SELECTED);
else
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postListItemEventID,
row,
(jint) AWT_ITEM_DESELECTED);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
deleted file mode 100644
index 8a2a8105d0a..00000000000
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/* gtkmainthread.c -- Native implementation of GtkMainThread
- Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT 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
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-#include "gtkpeer.h"
-#include "gnu_java_awt_peer_gtk_GtkMainThread.h"
-#include "gthread-jni.h"
-
-#ifdef JVM_SUN
- struct state_table *native_state_table;
- struct state_table *native_global_ref_table;
-#endif
-
-jmethodID setBoundsCallbackID;
-
-jmethodID postActionEventID;
-jmethodID postMenuActionEventID;
-jmethodID postMouseEventID;
-jmethodID postConfigureEventID;
-jmethodID postExposeEventID;
-jmethodID postKeyEventID;
-jmethodID postFocusEventID;
-jmethodID postAdjustmentEventID;
-jmethodID postItemEventID;
-jmethodID choicePostItemEventID;
-jmethodID postListItemEventID;
-jmethodID postTextEventID;
-jmethodID postWindowEventID;
-
-jmethodID beginNativeRepaintID;
-jmethodID endNativeRepaintID;
-
-jmethodID initComponentGraphicsID;
-jmethodID initComponentGraphics2DID;
-jmethodID setCursorID;
-
-JNIEnv *gdk_env;
-
-GtkWindowGroup *global_gtk_window_group;
-
-static void init_glib_threads(JNIEnv *, jint);
-
-double dpi_conversion_factor;
-
-static void init_dpi_conversion_factor (void);
-static void dpi_changed_cb (GtkSettings *settings,
- GParamSpec *pspec);
-
-/*
- * Call gtk_init. It is very important that this happen before any other
- * gtk calls.
- *
- * The portableNativeSync argument may have the values:
- * 1 if the Java property gnu.classpath.awt.gtk.portable.native.sync
- * is set to "true".
- * 0 if it is set to "false"
- * -1 if unset.
- */
-
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz,
- jint portableNativeSync)
-{
- int argc = 1;
- char **argv;
- char *homedir, *rcpath = NULL;
- jclass gtkcomponentpeer, gtkchoicepeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer,
- gtkmenuitempeer, gtktextcomponentpeer, window, gdkgraphics, gdkgraphics2d;
-
- NSA_INIT (env, clazz);
- gdk_env = env;
-
- /* GTK requires a program's argc and argv variables, and requires that they
- be valid. Set it up. */
- argv = (char **) g_malloc (sizeof (char *) * 2);
- argv[0] = (char *) g_malloc(1);
-#if 1
- strcpy(argv[0], "");
-#else /* The following is a more efficient alternative, but less intuitively
- * expresses what we are trying to do. This code is only run once, so
- * I'm going for intuitive. */
- argv[0][0] = '\0';
-#endif
- argv[1] = NULL;
-
- init_glib_threads(env, portableNativeSync);
-
- /* From GDK 2.0 onwards we have to explicitly call gdk_threads_init */
- gdk_threads_init();
-
- gtk_init (&argc, &argv);
-
- gdk_rgb_init ();
- gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
- gtk_widget_set_default_visual (gdk_rgb_get_visual ());
-
- /* Make sure queued calls don't get sent to GTK/GDK while
- we're shutting down. */
- atexit (gdk_threads_enter);
-
- gdk_event_handler_set ((GdkEventFunc)awt_event_handler, NULL, NULL);
-
- if ((homedir = getenv ("HOME")))
- {
- rcpath = (char *) g_malloc (strlen (homedir) + strlen (RC_FILE) + 2);
- sprintf (rcpath, "%s/%s", homedir, RC_FILE);
- }
-
- gtk_rc_parse ((rcpath) ? rcpath : RC_FILE);
-
- g_free (rcpath);
- g_free (argv[0]);
- g_free (argv);
-
- /* setup cached IDs for posting GTK events to Java */
-
- window = (*env)->FindClass (env, "java/awt/Window");
-
- gtkcomponentpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkComponentPeer");
- gtkchoicepeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkChoicePeer");
- gtkwindowpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkWindowPeer");
- gtkscrollbarpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkScrollbarPeer");
- gtklistpeer = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GtkListPeer");
- gtkmenuitempeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkMenuItemPeer");
- gtktextcomponentpeer = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GtkTextComponentPeer");
- gdkgraphics = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GdkGraphics");
- gdkgraphics2d = (*env)->FindClass (env,
- "gnu/java/awt/peer/gtk/GdkGraphics2D");
- setBoundsCallbackID = (*env)->GetMethodID (env, window,
- "setBoundsCallback",
- "(IIII)V");
-
- postMenuActionEventID = (*env)->GetMethodID (env, gtkmenuitempeer,
- "postMenuActionEvent",
- "()V");
- postMouseEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postMouseEvent", "(IJIIIIZ)V");
- setCursorID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "setCursor", "()V");
- beginNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "beginNativeRepaint", "()V");
-
- endNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "endNativeRepaint", "()V");
-
- postConfigureEventID = (*env)->GetMethodID (env, gtkwindowpeer,
- "postConfigureEvent", "(IIII)V");
- postWindowEventID = (*env)->GetMethodID (env, gtkwindowpeer,
- "postWindowEvent",
- "(ILjava/awt/Window;I)V");
- postExposeEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postExposeEvent", "(IIII)V");
- postKeyEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postKeyEvent", "(IJIICI)V");
- postFocusEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postFocusEvent", "(IZ)V");
- postAdjustmentEventID = (*env)->GetMethodID (env, gtkscrollbarpeer,
- "postAdjustmentEvent",
- "(II)V");
- postItemEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
- "postItemEvent",
- "(Ljava/lang/Object;I)V");
- choicePostItemEventID = (*env)->GetMethodID (env, gtkchoicepeer,
- "choicePostItemEvent",
- "(Ljava/lang/String;I)V");
- postListItemEventID = (*env)->GetMethodID (env, gtklistpeer,
- "postItemEvent",
- "(II)V");
- postTextEventID = (*env)->GetMethodID (env, gtktextcomponentpeer,
- "postTextEvent",
- "()V");
- initComponentGraphicsID = (*env)->GetMethodID (env, gdkgraphics,
- "initComponentGraphics",
- "()V");
- initComponentGraphics2DID = (*env)->GetMethodID (env, gdkgraphics2d,
- "initComponentGraphics2D",
- "()V");
- global_gtk_window_group = gtk_window_group_new ();
-
- init_dpi_conversion_factor ();
-}
-
-
-/** Initialize GLIB's threads properly, based on the value of the
- gnu.classpath.awt.gtk.portable.native.sync Java system property. If
- that's unset, use the PORTABLE_NATIVE_SYNC config.h macro. (TODO:
- In some release following 0.10, that config.h macro will go away.)
- */
-static void
-init_glib_threads(JNIEnv *env, jint portableNativeSync)
-{
- if (portableNativeSync < 0)
- {
-#ifdef PORTABLE_NATIVE_SYNC /* Default value, if not set by the Java system
- property */
- portableNativeSync = 1;
-#else
- portableNativeSync = 0;
-#endif
- }
-
- (*env)->GetJavaVM( env, &the_vm );
- if (portableNativeSync)
- g_thread_init ( &portable_native_sync_jni_functions );
- else
- g_thread_init ( NULL );
-
- /* Debugging progress message; uncomment if needed: */
- /* printf("called gthread init\n"); */
-}
-
-
-
-/*
- * Run gtk_main and block.
- */
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkMain
- (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
-{
- gdk_threads_enter ();
- gtk_main ();
- gdk_threads_leave ();
-}
-
-/* This is a big hack, needed until this pango bug is resolved:
- http://bugzilla.gnome.org/show_bug.cgi?id=119081.
- See: http://mail.gnome.org/archives/gtk-i18n-list/2003-August/msg00001.html
- for details. */
-static void
-init_dpi_conversion_factor ()
-{
- GtkSettings *settings = gtk_settings_get_default ();
- GObjectClass *klass;
-
- klass = G_OBJECT_CLASS (GTK_SETTINGS_GET_CLASS (settings));
- if (g_object_class_find_property (klass, "gtk-xft-dpi"))
- {
- int int_dpi;
- g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
- /* If int_dpi == -1 gtk-xft-dpi returns the default value. So we
- have to do approximate calculation here. */
- if (int_dpi < 0)
- dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
- else
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
-
- g_signal_connect (settings, "notify::gtk-xft-dpi",
- G_CALLBACK (dpi_changed_cb), NULL);
- }
- else
- /* Approximate. */
- dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
-}
-
-static void
-dpi_changed_cb (GtkSettings *settings,
- GParamSpec *pspec __attribute__((unused)))
-{
- int int_dpi;
- g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
- if (int_dpi < 0)
- dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
- else
- dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
index 4d68fce7053..1fe18f9f064 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
@@ -165,6 +165,6 @@ Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_setLabel
static void
item_activate (GtkMenuItem *item __attribute__((unused)), jobject peer_obj)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer_obj,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer_obj,
postMenuActionEventID);
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
index 4f834460f95..790c90109ae 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
@@ -160,6 +160,6 @@ post_change_event (GtkRange *range, jobject peer)
{
GtkAdjustment *adj;
adj = gtk_range_get_adjustment (range);
- (*gdk_env)->CallVoidMethod (gdk_env, peer, postAdjustmentEventID,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer, postAdjustmentEventID,
AWT_ADJUSTMENT_TRACK, (jint) adj->value);
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
index 771f2b81d75..6eb06e073f0 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
@@ -492,5 +492,7 @@ static void
textcomponent_changed_cb (GtkEditable *editable __attribute__((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer, postTextEventID);
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer, postTextEventID);
+ gdk_threads_enter ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
index 6234b29c913..8cb9e2f5d68 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
@@ -38,9 +38,375 @@ exception statement from your version. */
#include "gtkpeer.h"
#include "gnu_java_awt_peer_gtk_GtkToolkit.h"
+#include "gthread-jni.h"
+
+#include <sys/time.h>
+
+#ifdef JVM_SUN
+ struct state_table *native_state_table;
+ struct state_table *native_global_ref_table;
+#endif
+
+jmethodID setBoundsCallbackID;
+
+jmethodID postActionEventID;
+jmethodID postMenuActionEventID;
+jmethodID postMouseEventID;
+jmethodID postConfigureEventID;
+jmethodID postExposeEventID;
+jmethodID postKeyEventID;
+jmethodID postFocusEventID;
+jmethodID postAdjustmentEventID;
+jmethodID postItemEventID;
+jmethodID choicePostItemEventID;
+jmethodID postListItemEventID;
+jmethodID postTextEventID;
+jmethodID postWindowEventID;
+jmethodID postInsetsChangedEventID;
+jmethodID windowGetWidthID;
+jmethodID windowGetHeightID;
+
+jmethodID beginNativeRepaintID;
+jmethodID endNativeRepaintID;
+
+jmethodID initComponentGraphicsID;
+jmethodID initComponentGraphics2DID;
+jmethodID setCursorID;
+
+JavaVM *java_vm;
+
+union env_union
+{
+ void *void_env;
+ JNIEnv *jni_env;
+};
+
+JNIEnv *
+gdk_env()
+{
+ union env_union tmp;
+ g_assert((*java_vm)->GetEnv(java_vm, &tmp.void_env, JNI_VERSION_1_2) == JNI_OK);
+ return tmp.jni_env;
+}
+
+
+GtkWindowGroup *global_gtk_window_group;
+
+static void init_glib_threads(JNIEnv *, jint);
+
+double dpi_conversion_factor;
+
+static void init_dpi_conversion_factor (void);
+static void dpi_changed_cb (GtkSettings *settings,
+ GParamSpec *pspec);
+
+/*
+ * Call gtk_init. It is very important that this happen before any other
+ * gtk calls.
+ *
+ * The portableNativeSync argument may have the values:
+ * 1 if the Java property gnu.classpath.awt.gtk.portable.native.sync
+ * is set to "true".
+ * 0 if it is set to "false"
+ * -1 if unset.
+ */
+
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit (JNIEnv *env,
+ jclass clazz __attribute__((unused)),
+ jint portableNativeSync)
+{
+ int argc = 1;
+ char **argv;
+ char *homedir, *rcpath = NULL;
+
+ jclass gtkgenericpeer, gtkcomponentpeer, gtkchoicepeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer,
+ gtkmenuitempeer, gtktextcomponentpeer, window, gdkgraphics, gdkgraphics2d;
+
+ gtkgenericpeer = (*env)->FindClass(env, "gnu/java/awt/peer/gtk/GtkGenericPeer");
+
+ NSA_INIT (env, gtkgenericpeer);
+
+ g_assert((*env)->GetJavaVM(env, &java_vm) == 0);
+
+ /* GTK requires a program's argc and argv variables, and requires that they
+ be valid. Set it up. */
+ argv = (char **) g_malloc (sizeof (char *) * 2);
+ argv[0] = (char *) g_malloc(1);
+#if 1
+ strcpy(argv[0], "");
+#else /* The following is a more efficient alternative, but less intuitively
+ * expresses what we are trying to do. This code is only run once, so
+ * I'm going for intuitive. */
+ argv[0][0] = '\0';
+#endif
+ argv[1] = NULL;
+
+ init_glib_threads(env, portableNativeSync);
+
+ /* From GDK 2.0 onwards we have to explicitly call gdk_threads_init */
+ gdk_threads_init();
+
+ gtk_init (&argc, &argv);
+
+ gdk_rgb_init ();
+ gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
+ gtk_widget_set_default_visual (gdk_rgb_get_visual ());
+
+ /* Make sure queued calls don't get sent to GTK/GDK while
+ we're shutting down. */
+ atexit (gdk_threads_enter);
+
+ gdk_event_handler_set ((GdkEventFunc)awt_event_handler, NULL, NULL);
+
+ if ((homedir = getenv ("HOME")))
+ {
+ rcpath = (char *) g_malloc (strlen (homedir) + strlen (RC_FILE) + 2);
+ sprintf (rcpath, "%s/%s", homedir, RC_FILE);
+ }
+
+ gtk_rc_parse ((rcpath) ? rcpath : RC_FILE);
+
+ g_free (rcpath);
+ g_free (argv[0]);
+ g_free (argv);
+
+ /* setup cached IDs for posting GTK events to Java */
+
+ window = (*env)->FindClass (env, "java/awt/Window");
+
+ gtkcomponentpeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkComponentPeer");
+ gtkchoicepeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkChoicePeer");
+ gtkwindowpeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkWindowPeer");
+ gtkscrollbarpeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkScrollbarPeer");
+ gtklistpeer = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GtkListPeer");
+ gtkmenuitempeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkMenuItemPeer");
+ gtktextcomponentpeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkTextComponentPeer");
+ gdkgraphics = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GdkGraphics");
+ gdkgraphics2d = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GdkGraphics2D");
+ setBoundsCallbackID = (*env)->GetMethodID (env, window,
+ "setBoundsCallback",
+ "(IIII)V");
+
+ postMenuActionEventID = (*env)->GetMethodID (env, gtkmenuitempeer,
+ "postMenuActionEvent",
+ "()V");
+ postMouseEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "postMouseEvent", "(IJIIIIZ)V");
+ setCursorID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "setCursor", "()V");
+ beginNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "beginNativeRepaint", "()V");
+
+ endNativeRepaintID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "endNativeRepaint", "()V");
+
+ postConfigureEventID = (*env)->GetMethodID (env, gtkwindowpeer,
+ "postConfigureEvent", "(IIII)V");
+ postWindowEventID = (*env)->GetMethodID (env, gtkwindowpeer,
+ "postWindowEvent",
+ "(ILjava/awt/Window;I)V");
+ postInsetsChangedEventID = (*env)->GetMethodID (env, gtkwindowpeer,
+ "postInsetsChangedEvent",
+ "(IIII)V");
+ windowGetWidthID = (*env)->GetMethodID (env, gtkwindowpeer,
+ "getWidth", "()I");
+ windowGetHeightID = (*env)->GetMethodID (env, gtkwindowpeer,
+ "getHeight", "()I");
+
+ postExposeEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "postExposeEvent", "(IIII)V");
+ postKeyEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "postKeyEvent", "(IJIICI)V");
+ postFocusEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "postFocusEvent", "(IZ)V");
+ postAdjustmentEventID = (*env)->GetMethodID (env, gtkscrollbarpeer,
+ "postAdjustmentEvent",
+ "(II)V");
+ postItemEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
+ "postItemEvent",
+ "(Ljava/lang/Object;I)V");
+ choicePostItemEventID = (*env)->GetMethodID (env, gtkchoicepeer,
+ "choicePostItemEvent",
+ "(Ljava/lang/String;I)V");
+ postListItemEventID = (*env)->GetMethodID (env, gtklistpeer,
+ "postItemEvent",
+ "(II)V");
+ postTextEventID = (*env)->GetMethodID (env, gtktextcomponentpeer,
+ "postTextEvent",
+ "()V");
+ initComponentGraphicsID = (*env)->GetMethodID (env, gdkgraphics,
+ "initComponentGraphics",
+ "()V");
+ initComponentGraphics2DID = (*env)->GetMethodID (env, gdkgraphics2d,
+ "initComponentGraphics2D",
+ "()V");
+ global_gtk_window_group = gtk_window_group_new ();
+
+ init_dpi_conversion_factor ();
+}
+
+
+/** Initialize GLIB's threads properly, based on the value of the
+ gnu.classpath.awt.gtk.portable.native.sync Java system property. If
+ that's unset, use the PORTABLE_NATIVE_SYNC config.h macro. (TODO:
+ In some release following 0.10, that config.h macro will go away.)
+ */
+static void
+init_glib_threads(JNIEnv *env, jint portableNativeSync)
+{
+ if (portableNativeSync < 0)
+ {
+#ifdef PORTABLE_NATIVE_SYNC /* Default value, if not set by the Java system
+ property */
+ portableNativeSync = 1;
+#else
+ portableNativeSync = 0;
+#endif
+ }
+
+ (*env)->GetJavaVM( env, &the_vm );
+ if (portableNativeSync)
+ g_thread_init ( &portable_native_sync_jni_functions );
+ else
+ g_thread_init ( NULL );
+
+ /* Debugging progress message; uncomment if needed: */
+ /* printf("called gthread init\n"); */
+}
+
+
+/* This is a big hack, needed until this pango bug is resolved:
+ http://bugzilla.gnome.org/show_bug.cgi?id=119081.
+ See: http://mail.gnome.org/archives/gtk-i18n-list/2003-August/msg00001.html
+ for details. */
+static void
+init_dpi_conversion_factor ()
+{
+ GtkSettings *settings = gtk_settings_get_default ();
+ GObjectClass *klass;
+
+ klass = G_OBJECT_CLASS (GTK_SETTINGS_GET_CLASS (settings));
+ if (g_object_class_find_property (klass, "gtk-xft-dpi"))
+ {
+ int int_dpi;
+ g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
+ /* If int_dpi == -1 gtk-xft-dpi returns the default value. So we
+ have to do approximate calculation here. */
+ if (int_dpi < 0)
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
+ else
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+
+ g_signal_connect (settings, "notify::gtk-xft-dpi",
+ G_CALLBACK (dpi_changed_cb), NULL);
+ }
+ else
+ /* Approximate. */
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
+}
+
+static void
+dpi_changed_cb (GtkSettings *settings,
+ GParamSpec *pspec __attribute__((unused)))
+{
+ int int_dpi;
+ g_object_get (settings, "gtk-xft-dpi", &int_dpi, NULL);
+ if (int_dpi < 0)
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / 96.;
+ else
+ dpi_conversion_factor = PANGO_SCALE * 72.0 / (int_dpi / PANGO_SCALE);
+}
+
+static int
+within_human_latency_tolerance(struct timeval *init)
+{
+ struct timeval curr;
+ unsigned long milliseconds_elapsed;
+
+ gettimeofday(&curr, NULL);
+
+ milliseconds_elapsed = (((curr.tv_sec * 1000) + (curr.tv_usec / 1000))
+ - ((init->tv_sec * 1000) + (init->tv_usec / 1000)));
+
+ return milliseconds_elapsed < 100;
+}
+
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkToolkit_iterateNativeQueue
+(JNIEnv *env,
+ jobject self __attribute__((unused)),
+ jobject lockedQueue,
+ jboolean block)
+{
+ /* We're holding an EventQueue lock, and we're about to acquire the GDK
+ * lock before dropping the EventQueue lock. This can deadlock if someone
+ * holds the GDK lock and wants to acquire the EventQueue lock; however
+ * all callbacks from GTK happen with the GDK lock released, so this
+ * would only happen in an odd case such as some JNI helper code
+ * acquiring the GDK lock and calling back into
+ * EventQueue.getNextEvent().
+ */
+
+ struct timeval init;
+ gettimeofday(&init, NULL);
+
+ gdk_threads_enter ();
+ (*env)->MonitorExit (env, lockedQueue);
+
+ if (block)
+ {
+
+ /* If we're blocking-when-empty, we want a do .. while loop. */
+ do
+ gtk_main_iteration ();
+ while (within_human_latency_tolerance (&init)
+ && gtk_events_pending ());
+ }
+ else
+ {
+ /* If we're not blocking-when-empty, we want a while loop. */
+ while (within_human_latency_tolerance (&init)
+ && gtk_events_pending ())
+ gtk_main_iteration ();
+ }
+
+ (*env)->MonitorEnter (env, lockedQueue);
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkToolkit_wakeNativeQueue
+ (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
+{
+ g_main_context_wakeup (NULL);
+}
+
+JNIEXPORT jboolean JNICALL
+Java_gnu_java_awt_peer_gtk_GtkToolkit_nativeQueueEmpty
+ (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
+{
+ jboolean empty = FALSE;
+ gdk_threads_enter ();
+ empty = ! gtk_events_pending();
+ gdk_threads_leave ();
+ return empty;
+}
+
static jint gdk_color_to_java_color (GdkColor color);
+
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkToolkit_beep
(JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)))
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
index a8e745ec0f4..b0177c90a47 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
@@ -65,8 +65,8 @@ static void window_active_state_change_cb (GtkWidget *widget,
GParamSpec *pspec,
jobject peer);
static void window_focus_state_change_cb (GtkWidget *widget,
- GParamSpec *pspec,
- jobject peer);
+ GParamSpec *pspec,
+ jobject peer);
static gboolean window_focus_in_cb (GtkWidget * widget,
GdkEventFocus *event,
jobject peer);
@@ -80,6 +80,7 @@ static jint window_get_new_state (GtkWidget *widget);
static gboolean window_property_changed_cb (GtkWidget *widget,
GdkEventProperty *event,
jobject peer);
+static void realize_cb (GtkWidget *widget, jobject peer);
/* Union used for type punning. */
union extents_union
@@ -94,23 +95,14 @@ union atom_list_union
Atom **atom_list;
};
-JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
- (JNIEnv *env, jobject obj, jint type, jboolean decorated,
- jint width, jint height, jobject parent, jintArray jinsets)
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
+ (JNIEnv *env, jobject obj, jint type, jboolean decorated, jobject parent)
{
GtkWidget *window_widget;
GtkWindow *window;
void *window_parent;
GtkWidget *fixed;
- int top = 0;
- int left = 0;
- int bottom = 0;
- int right = 0;
- jint *insets;
-
- insets = (*env)->GetIntArrayElements (env, jinsets, 0);
- insets[0] = insets[1] = insets[2] = insets[3] = 0;
NSA_SET_GLOBAL_REF (env, obj);
@@ -137,31 +129,8 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
gtk_widget_show (fixed);
- if (decorated)
- window_get_frame_extents (window_widget, &top, &left, &bottom, &right);
-
- gtk_window_set_default_size (window,
- MAX (1, width - left - right),
- MAX (1, height - top - bottom));
-
- /* We must set this window's size requisition. Otherwise when a
- resize is queued (when gtk_widget_queue_resize is called) the
- window will snap to its default requisition of 0x0. If we omit
- this call, Frames and Dialogs shrink to degenerate 1x1 windows
- when their resizable property changes. */
- gtk_widget_set_size_request (window_widget,
- MAX (1, width - left - right),
- MAX (1, height - top - bottom));
-
- insets[0] = top;
- insets[1] = left;
- insets[2] = bottom;
- insets[3] = right;
-
gdk_threads_leave ();
- (*env)->ReleaseIntArrayElements (env, jinsets, insets, 0);
-
NSA_SET_PTR (env, obj, window_widget);
}
@@ -278,6 +247,9 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals
G_CALLBACK (window_property_changed_cb), *gref);
g_signal_connect_after (G_OBJECT (ptr), "realize",
+ G_CALLBACK (realize_cb), *gref);
+
+ g_signal_connect_after (G_OBJECT (ptr), "realize",
G_CALLBACK (connect_awt_hook_cb), *gref);
gdk_threads_leave ();
@@ -320,7 +292,7 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBoundsCallback
{
/* Circumvent package-private access to call Window's
setBoundsCallback method. */
- (*gdk_env)->CallVoidMethod (gdk_env, window, setBoundsCallbackID,
+ (*gdk_env())->CallVoidMethod (gdk_env(), window, setBoundsCallbackID,
x, y, width, height);
}
@@ -428,9 +400,7 @@ request_frame_extents (GtkWidget *window)
/* Check if the current window manager supports
_NET_REQUEST_FRAME_EXTENTS. */
- /* FIXME: The window->window != NULL check is a workaround for bug
- http://bugzilla.gnome.org/show_bug.cgi?id=17952. */
- if (gdk_net_wm_supports (request_extents) && window->window != NULL)
+ if (gdk_net_wm_supports (request_extents))
{
GdkDisplay *display = gtk_widget_get_display (window);
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
@@ -483,9 +453,9 @@ property_notify_predicate (Display *xdisplay __attribute__((unused)),
if (event->xany.type == PropertyNotify
&& event->xany.window == *window
&& event->xproperty.atom == extents_atom)
- return True;
+ return True;
else
- return False;
+ return False;
}
static void
@@ -493,10 +463,12 @@ window_delete_cb (GtkWidget *widget __attribute__((unused)),
GdkEvent *event __attribute__((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_CLOSING,
(jobject) NULL, (jint) 0);
+ gdk_threads_enter ();
}
static void
@@ -504,20 +476,24 @@ window_destroy_cb (GtkWidget *widget __attribute__((unused)),
GdkEvent *event __attribute__((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_CLOSED,
(jobject) NULL, (jint) 0);
+ gdk_threads_enter ();
}
static void
window_show_cb (GtkWidget *widget __attribute__((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_OPENED,
(jobject) NULL, (jint) 0);
+ gdk_threads_enter ();
}
static void
@@ -528,47 +504,53 @@ window_active_state_change_cb (GtkWidget *widget __attribute__((unused)),
/* FIXME: not sure if this is needed or not. */
/* Remove the unused attributes if you fix the below. */
#if 0
- if (GTK_WINDOW (widget)->is_active)
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
- postWindowEventID,
- (jint) AWT_WINDOW_GAINED_FOCUS,
- (jobject) NULL, (jint) 0);
- else
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
- postWindowEventID,
- (jint) AWT_WINDOW_DEACTIVATED,
- (jobject) NULL, (jint) 0);
+ gdk_threads_leave ();
+ if (GTK_WINDOW (widget)->is_active)
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+ postWindowEventID,
+ (jint) AWT_WINDOW_GAINED_FOCUS,
+ (jobject) NULL, (jint) 0);
+ else
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+ postWindowEventID,
+ (jint) AWT_WINDOW_DEACTIVATED,
+ (jobject) NULL, (jint) 0);
+ gdk_threads_enter ();
#endif
- }
+}
static void
window_focus_state_change_cb (GtkWidget *widget,
GParamSpec *pspec __attribute__((unused)),
jobject peer)
{
+ gdk_threads_leave ();
if (GTK_WINDOW (widget)->has_toplevel_focus)
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_ACTIVATED,
(jobject) NULL, (jint) 0);
else
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_DEACTIVATED,
- (jobject) NULL, (jint) 0);
- }
+ (jobject) NULL, (jint) 0);
+ gdk_threads_enter ();
+}
static gboolean
window_focus_in_cb (GtkWidget * widget __attribute__((unused)),
GdkEventFocus *event __attribute__((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_GAINED_FOCUS,
(jobject) NULL, (jint) 0);
/* FIXME: somewhere after this is handled, the child window is
getting an expose event. */
+ gdk_threads_enter ();
return FALSE;
}
@@ -577,12 +559,14 @@ window_focus_out_cb (GtkWidget * widget __attribute__((unused)),
GdkEventFocus *event __attribute__((unused)),
jobject peer)
{
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_LOST_FOCUS,
(jobject) NULL, (jint) 0);
/* FIXME: somewhere after this is handled, the child window is
getting an expose event. */
+ gdk_threads_enter ();
return FALSE;
}
@@ -600,18 +584,22 @@ window_window_state_cb (GtkWidget *widget,
if (event->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED)
{
/* We've been iconified. */
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_ICONIFIED,
(jobject) NULL, (jint) 0);
+ gdk_threads_enter ();
}
else
{
/* We've been deiconified. */
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_DEICONIFIED,
(jobject) NULL, (jint) 0);
+ gdk_threads_enter ();
}
}
@@ -624,10 +612,12 @@ window_window_state_cb (GtkWidget *widget,
new_state |= window_get_new_state (widget);
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
postWindowEventID,
(jint) AWT_WINDOW_STATE_CHANGED,
(jobject) NULL, new_state);
+ gdk_threads_enter ();
return TRUE;
}
@@ -680,19 +670,6 @@ window_property_changed_cb (GtkWidget *widget __attribute__((unused)),
unsigned long *extents;
union extents_union gu_ex;
- static int id_set = 0;
- static jmethodID postInsetsChangedEventID;
-
- if (!id_set)
- {
- jclass gtkwindowpeer = (*gdk_env)->FindClass (gdk_env,
- "gnu/java/awt/peer/gtk/GtkWindowPeer");
- postInsetsChangedEventID = (*gdk_env)->GetMethodID (gdk_env,
- gtkwindowpeer,
- "postInsetsChangedEvent",
- "(IIII)V");
- id_set = 1;
- }
gu_ex.extents = &extents;
if (gdk_atom_intern ("_NET_FRAME_EXTENTS", FALSE) == event->atom
&& gdk_property_get (event->window,
@@ -705,12 +682,50 @@ window_property_changed_cb (GtkWidget *widget __attribute__((unused)),
NULL,
NULL,
gu_ex.gu_extents))
- (*gdk_env)->CallVoidMethod (gdk_env, peer,
- postInsetsChangedEventID,
- (jint) extents[2], /* top */
- (jint) extents[0], /* left */
- (jint) extents[3], /* bottom */
- (jint) extents[1]); /* right */
+ {
+ gdk_threads_leave ();
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+ postInsetsChangedEventID,
+ (jint) extents[2], /* top */
+ (jint) extents[0], /* left */
+ (jint) extents[3], /* bottom */
+ (jint) extents[1]); /* right */
+ gdk_threads_enter ();
+ }
+
return FALSE;
}
+
+static void
+realize_cb (GtkWidget *widget, jobject peer)
+{
+ jint top = 0;
+ jint left = 0;
+ jint bottom = 0;
+ jint right = 0;
+ jint width = 0;
+ jint height = 0;
+
+ width = (*gdk_env())->CallIntMethod (gdk_env(), peer, windowGetWidthID);
+ height = (*gdk_env())->CallIntMethod (gdk_env(), peer, windowGetHeightID);
+
+ window_get_frame_extents (widget, &top, &left, &bottom, &right);
+
+ (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+ postInsetsChangedEventID,
+ top, left, bottom, right);
+
+ gtk_window_set_default_size (GTK_WINDOW (widget),
+ MAX (1, width - left - right),
+ MAX (1, height - top - bottom));
+
+ /* set the size like we do in nativeSetBounds */
+ gtk_widget_set_size_request (widget,
+ MAX (1, width - left - right),
+ MAX (1, height - top - bottom));
+
+ gtk_window_resize (GTK_WINDOW (widget),
+ MAX (1, width - left - right),
+ MAX (1, height - top - bottom));
+}
diff --git a/libjava/jni/gtk-peer/gthread-jni.c b/libjava/jni/gtk-peer/gthread-jni.c
index ee79424475c..d66c5a08087 100644
--- a/libjava/jni/gtk-peer/gthread-jni.c
+++ b/libjava/jni/gtk-peer/gthread-jni.c
@@ -223,8 +223,8 @@ exception statement from your version. */
#elif defined HAVE_INTTYPES_H
#include <inttypes.h>
#endif
-#include <stdio.h> /* snprintf */
#include <stdarg.h> /* va_list */
+#include <glib.h>
#include "gthread-jni.h"
#include <assert.h> /* assert() */
@@ -464,7 +464,7 @@ throw (JNIEnv * env, jthrowable cause, const char *message,
if ((buf = malloc (len)))
{
memset (buf, 0, len);
- snprintf (buf, len, fmt, message, file, line);
+ g_snprintf (buf, len, fmt, message, file, line);
jmessage = (*env)->NewStringUTF (env, buf);
free (buf);
}
diff --git a/libjava/jni/gtk-peer/gtkcairopeer.h b/libjava/jni/gtk-peer/gtkcairopeer.h
index b4021f51ed9..85834cadb02 100644
--- a/libjava/jni/gtk-peer/gtkcairopeer.h
+++ b/libjava/jni/gtk-peer/gtkcairopeer.h
@@ -74,6 +74,19 @@ struct graphics2d
cairo_surface_t *pattern_surface;
cairo_pattern_t *pattern;
gboolean debug;
+ enum
+ {
+ MODE_DRAWABLE_WITH_RENDER,
+ MODE_DRAWABLE_NO_RENDER,
+ MODE_JAVA_ARRAY
+ }
+ mode;
+
+ /* Support for MODE_JAVA_ARRAY */
+ jintArray jarray;
+ jint width, height;
+ jint *javabuf;
+ jboolean isCopy;
};
#endif /* __GTKCAIROPEER_H */
diff --git a/libjava/jni/gtk-peer/gtkpeer.h b/libjava/jni/gtk-peer/gtkpeer.h
index e982551288c..02613c4e3c2 100644
--- a/libjava/jni/gtk-peer/gtkpeer.h
+++ b/libjava/jni/gtk-peer/gtkpeer.h
@@ -147,6 +147,10 @@ struct graphics
#define AWT_BUTTON2_DOWN_MASK (1 << 11)
#define AWT_BUTTON3_DOWN_MASK (1 << 12)
+#define AWT_BUTTON1_MASK (1 << 4)
+#define AWT_BUTTON2_MASK (1 << 3)
+#define AWT_BUTTON3_MASK (1 << 2)
+
#define MULTI_CLICK_TIME 250
/* as opposed to a MULTI_PASS_TIME :) */
@@ -460,7 +464,12 @@ extern jmethodID setCursorID;
extern jmethodID syncAttrsID;
extern jclass gdkColor;
extern jmethodID gdkColorID;
-extern JNIEnv *gdk_env;
+
+extern jmethodID postInsetsChangedEventID;
+extern jmethodID windowGetWidthID;
+extern jmethodID windowGetHeightID;
+
+JNIEnv *gdk_env(void);
extern double dpi_conversion_factor;
@@ -480,6 +489,8 @@ void set_parent (GtkWidget *widget, GtkContainer *parent);
jint keyevent_state_to_awt_mods (GdkEvent *event);
+guint awt_keycode_to_keysym (jint keyCode, jint keyLocation);
+
struct item_event_hook_info
{
jobject peer_obj;
diff --git a/libjava/link.cc b/libjava/link.cc
index 3f45ac119a2..a1fa9188930 100644
--- a/libjava/link.cc
+++ b/libjava/link.cc
@@ -131,6 +131,18 @@ _Jv_Linker::find_field_helper (jclass search, _Jv_Utf8Const *name,
return NULL;
}
+bool
+_Jv_Linker::has_field_p (jclass search, _Jv_Utf8Const *field_name)
+{
+ for (int i = 0; i < search->field_count; ++i)
+ {
+ _Jv_Field *field = &search->fields[i];
+ if (_Jv_equalUtf8Consts (field->name, field_name))
+ return true;
+ }
+ return false;
+}
+
// Find a field.
// KLASS is the class that is requesting the field.
// OWNER is the class in which the field should be found.
@@ -665,12 +677,21 @@ _Jv_Linker::generate_itable (jclass klass, _Jv_ifaces *ifaces,
// Format method name for use in error messages.
jstring
-_Jv_GetMethodString (jclass klass, _Jv_Utf8Const *name)
+_Jv_GetMethodString (jclass klass, _Jv_Method *meth,
+ jclass derived)
{
- jstring r = klass->name->toString();
- r = r->concat (JvNewStringUTF ("."));
- r = r->concat (name->toString());
- return r;
+ using namespace java::lang;
+ StringBuffer *buf = new StringBuffer (klass->name->toString());
+ buf->append (jchar ('.'));
+ buf->append (meth->name->toString());
+ buf->append ((jchar) ' ');
+ buf->append (meth->signature->toString());
+ if (derived)
+ {
+ buf->append(JvNewStringLatin1(" in "));
+ buf->append(derived->name->toString());
+ }
+ return buf->toString();
}
void
@@ -679,6 +700,13 @@ _Jv_ThrowNoSuchMethodError ()
throw new java::lang::NoSuchMethodError;
}
+// This is put in empty vtable slots.
+static void
+_Jv_abstractMethodError (void)
+{
+ throw new java::lang::AbstractMethodError();
+}
+
// Each superinterface of a class (i.e. each interface that the class
// directly or indirectly implements) has a corresponding "Partial
// Interface Dispatch Table" whose size is (number of methods + 1) words.
@@ -720,15 +748,15 @@ _Jv_Linker::append_partial_itable (jclass klass, jclass iface,
{
if ((meth->accflags & Modifier::STATIC) != 0)
throw new java::lang::IncompatibleClassChangeError
- (_Jv_GetMethodString (klass, meth->name));
- if ((meth->accflags & Modifier::ABSTRACT) != 0)
- throw new java::lang::AbstractMethodError
- (_Jv_GetMethodString (klass, meth->name));
+ (_Jv_GetMethodString (klass, meth));
if ((meth->accflags & Modifier::PUBLIC) == 0)
throw new java::lang::IllegalAccessError
- (_Jv_GetMethodString (klass, meth->name));
+ (_Jv_GetMethodString (klass, meth));
- itable[pos] = meth->ncode;
+ if ((meth->accflags & Modifier::ABSTRACT) != 0)
+ itable[pos] = (void *) &_Jv_abstractMethodError;
+ else
+ itable[pos] = meth->ncode;
}
else
{
@@ -1092,13 +1120,6 @@ _Jv_Linker::link_exception_table (jclass self)
self->catch_classes->classname = (_Jv_Utf8Const *)-1;
}
-// This is put in empty vtable slots.
-static void
-_Jv_abstractMethodError (void)
-{
- throw new java::lang::AbstractMethodError();
-}
-
// Set itable method indexes for members of interface IFACE.
void
_Jv_Linker::layout_interface_methods (jclass iface)
@@ -1161,9 +1182,9 @@ _Jv_Linker::layout_vtable_methods (jclass klass)
using namespace java::lang;
StringBuffer *sb = new StringBuffer();
sb->append(JvNewStringLatin1("method "));
- sb->append(_Jv_GetMethodString(klass, meth->name));
+ sb->append(_Jv_GetMethodString(klass, meth));
sb->append(JvNewStringLatin1(" overrides final method "));
- sb->append(_Jv_GetMethodString(declarer, super_meth->name));
+ sb->append(_Jv_GetMethodString(declarer, super_meth));
throw new VerifyError(sb->toString());
}
}
@@ -1190,6 +1211,8 @@ _Jv_Linker::set_vtable_entries (jclass klass, _Jv_VTable *vtable)
if (meth->index == (_Jv_ushort) -1)
continue;
if ((meth->accflags & Modifier::ABSTRACT))
+ // FIXME: it might be nice to have a libffi trampoline here,
+ // so we could pass in the method name and other information.
vtable->set_method(meth->index, (void *) &_Jv_abstractMethodError);
else
vtable->set_method(meth->index, meth->ncode);
@@ -1238,33 +1261,9 @@ _Jv_Linker::make_vtable (jclass klass)
// override an old one.
set_vtable_entries (klass, vtable);
- // It is an error to have an abstract method in a concrete class.
- if (! (klass->accflags & Modifier::ABSTRACT))
- {
- for (int i = 0; i < klass->vtable_method_count; ++i)
- if (vtable->get_method(i) == (void *) &_Jv_abstractMethodError)
- {
- using namespace java::lang;
- while (klass != NULL)
- {
- for (int j = 0; j < klass->method_count; ++j)
- {
- if (klass->methods[j].index == i)
- {
- StringBuffer *buf = new StringBuffer ();
- buf->append (_Jv_NewStringUtf8Const (klass->methods[j].name));
- buf->append ((jchar) ' ');
- buf->append (_Jv_NewStringUtf8Const (klass->methods[j].signature));
- throw new AbstractMethodError (buf->toString ());
- }
- }
- klass = klass->getSuperclass ();
- }
- // Couldn't find the name, which is weird.
- // But we still must throw the error.
- throw new AbstractMethodError ();
- }
- }
+ // Note that we don't check for abstract methods here. We used to,
+ // but there is a JVMS clarification that indicates that a check
+ // here would be too eager. And, a simple test case confirms this.
}
// Lay out the class, allocating space for static fields and computing
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc
index 0643c1a5c7b..91da25cf38d 100644
--- a/libjava/posix-threads.cc
+++ b/libjava/posix-threads.cc
@@ -281,6 +281,17 @@ handle_intr (int)
// Do nothing.
}
+static void
+block_sigchld()
+{
+ sigset_t mask;
+ sigemptyset (&mask);
+ sigaddset (&mask, SIGCHLD);
+ int c = pthread_sigmask (SIG_BLOCK, &mask, NULL);
+ if (c != 0)
+ JvFail (strerror (c));
+}
+
void
_Jv_InitThreads (void)
{
@@ -296,6 +307,10 @@ _Jv_InitThreads (void)
sigemptyset (&act.sa_mask);
act.sa_flags = 0;
sigaction (INTR, &act, NULL);
+
+ // Block SIGCHLD here to ensure that any non-Java threads inherit the new
+ // signal mask.
+ block_sigchld();
}
_Jv_Thread_t *
@@ -333,17 +348,6 @@ _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio)
#endif
}
-static void
-block_sigchld()
-{
- sigset_t mask;
- sigemptyset (&mask);
- sigaddset (&mask, SIGCHLD);
- int c = pthread_sigmask (SIG_BLOCK, &mask, NULL);
- if (c != 0)
- throw new java::lang::InternalError (JvNewStringUTF (strerror (c)));
-}
-
void
_Jv_ThreadRegister (_Jv_Thread_t *data)
{
diff --git a/libjava/prims.cc b/libjava/prims.cc
index c3c07d9f5e5..cf0fed10dd4 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -80,10 +80,9 @@ static java::lang::OutOfMemoryError *no_memory;
// functions are changed to take a size_t argument instead of jint.
#define MAX_OBJECT_SIZE ((1<<31) - 1)
-static const char *no_properties[] = { NULL };
-
// Properties set at compile time.
-const char **_Jv_Compiler_Properties = no_properties;
+const char **_Jv_Compiler_Properties = NULL;
+int _Jv_Properties_Count = 0;
// The JAR file to add to the beginning of java.class.path.
const char *_Jv_Jar_Class_Path;
@@ -909,18 +908,185 @@ namespace gcj
bool runtimeInitialized = false;
}
+static jint
+parse_verbose_args (char* option_string,
+ bool ignore_unrecognized)
+{
+ size_t len = sizeof ("-verbose");
+
+ if (strlen (option_string) < len)
+ return -1;
+
+ if (option_string[len] == ':'
+ && option_string[len + 1] != '\0')
+ {
+ char* verbose_args = option_string + len + 1;
+ size_t last = 0;
+
+ do
+ {
+ if (! strncmp (verbose_args,
+ "gc", (last = sizeof ("gc")) - 1)
+ && (verbose_args[last] == '\0'
+ || verbose_args[last] == ','))
+ {
+ // FIXME: we should add functions to boehm-gc that
+ // toggle GC_print_stats, GC_PRINT_ADDRESS_MAP and
+ // GC_print_back_height.
+
+ }
+ else if (! strncmp (verbose_args,
+ "class",
+ (last = sizeof ("class")) - 1)
+ && (verbose_args[last] == '\0'
+ || verbose_args[last] == ','))
+ {
+ gcj::verbose_class_flag = true;
+ }
+ else if (! strncmp (verbose_args, "jni",
+ (last = sizeof ("jni")) - 1)
+ && (verbose_args[last] == '\0'
+ || verbose_args[last] == ','))
+ {
+ // FIXME: enable JNI messages.
+ }
+ else if (ignore_unrecognized
+ && verbose_args[0] == 'X')
+ {
+ // ignore unrecognized non-standard verbose option
+ last = 0;
+ while (verbose_args[last] != '\0'
+ && verbose_args[last++] != ',');
+ }
+
+ if (strlen (verbose_args) >= last)
+ {
+ if (verbose_args[last] == ',')
+ {
+ if (verbose_args[last + 1] == '\0')
+ // trailing comma
+ return -1;
+ else
+ {
+ verbose_args = verbose_args + last + 1;
+ last = 0;
+ }
+ }
+ // here verbose_args[last] is either '\0' or
+ // the first character in the next verbose
+ // argument.
+ }
+ else
+ // partial option
+ return -1;
+
+ // verbose_args[last] will be '\0' here if we're
+ // done.
+ }
+ while (verbose_args[last] != '\0');
+ }
+ else if (option_string[len] == 'g'
+ && option_string[len + 1] == 'c'
+ && option_string[len + 2] == '\0')
+ {
+ // FIXME: we should add functions to boehm-gc that
+ // toggle GC_print_stats, GC_PRINT_ADDRESS_MAP and
+ // GC_print_back_height.
+ return 0;
+ }
+ else if (option_string[len] == '\0')
+ {
+ gcj::verbose_class_flag = true;
+ return 0;
+ }
+ else
+ {
+ // unrecognized option beginning with -verbose
+ return -1;
+ }
+ return 0;
+}
+
+static jint
+parse_init_args (JvVMInitArgs* vm_args)
+{
+ // if _Jv_Compiler_Properties is non-NULL then it needs to be
+ // re-allocated dynamically.
+ if (_Jv_Compiler_Properties)
+ {
+ const char** props = _Jv_Compiler_Properties;
+ _Jv_Compiler_Properties = NULL;
+
+ for (int i = 0; props[i]; i++)
+ {
+ _Jv_Compiler_Properties = (const char**) _Jv_Realloc
+ (_Jv_Compiler_Properties,
+ (_Jv_Properties_Count + 1) * sizeof (const char*));
+ _Jv_Compiler_Properties[_Jv_Properties_Count++] = props[i];
+ }
+ }
+
+ if (vm_args == NULL)
+ return 0;
+
+ for (int i = 0; i < vm_args->nOptions; ++i)
+ {
+ char* option_string = vm_args->options[i].optionString;
+ if (! strcmp (option_string, "vfprintf")
+ || ! strcmp (option_string, "exit")
+ || ! strcmp (option_string, "abort"))
+ {
+ // FIXME: we are required to recognize these, but for
+ // now we don't handle them in any way.
+ continue;
+ }
+ else if (! strncmp (option_string,
+ "-verbose", sizeof ("-verbose") - 1))
+ {
+ jint result = parse_verbose_args (option_string,
+ vm_args->ignoreUnrecognized);
+ if (result < 0)
+ return result;
+ }
+ else if (! strncmp (option_string, "-D", 2))
+ {
+ _Jv_Compiler_Properties = (const char**) _Jv_Realloc
+ (_Jv_Compiler_Properties,
+ (_Jv_Properties_Count + 1) * sizeof (char*));
+
+ _Jv_Compiler_Properties[_Jv_Properties_Count++] =
+ strdup (option_string + 2);
+
+ continue;
+ }
+ else if (vm_args->ignoreUnrecognized)
+ {
+ if (option_string[0] == '_'
+ || ! strncmp (option_string, "-X", 2))
+ continue;
+ }
+ }
+ return 0;
+}
+
jint
-_Jv_CreateJavaVM (void* /*vm_args*/)
+_Jv_CreateJavaVM (JvVMInitArgs* vm_args)
{
using namespace gcj;
-
+
if (runtimeInitialized)
return -1;
runtimeInitialized = true;
+ jint result = parse_init_args (vm_args);
+ if (result < 0)
+ return -1;
+
PROCESS_GCJ_PROPERTIES;
+ /* Threads must be initialized before the GC, so that it inherits the
+ signal mask. */
_Jv_InitThreads ();
_Jv_InitGC ();
_Jv_InitializeSyncMutex ();
@@ -1014,7 +1180,12 @@ _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv,
// is initialized.
if (is_jar)
_Jv_Jar_Class_Path = strdup (name);
- _Jv_CreateJavaVM (NULL);
+
+ if (_Jv_CreateJavaVM (NULL) < 0)
+ {
+ fprintf (stderr, "libgcj: couldn't create virtual machine\n");
+ exit (1);
+ }
// Get the Runtime here. We want to initialize it before searching
// for `main'; that way it will be set up if `main' is a JNI method.
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index cbd90ca28cb..d736b8690d6 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -181,6 +181,85 @@ proc gcj_jni_test_one {file} {
return 1
}
+# Compile a single C file and produce a binary. OPTIONS is a list of
+# options to pass to the compiler. Returns 0 on failure, 1 on
+# success.
+proc gcj_jni_invocation_compile_c_to_binary {file {options {}}} {
+ global srcdir
+ global host_triplet
+ verbose "options: $options"
+ set options_cxx $options
+ set options ""
+
+ set filename [file tail $file]
+ set name [file rootname $filename]
+
+ # Find jni.h.
+ lappend options "additional_flags=-I$srcdir/../include"
+
+ # Append C++ options
+ lappend options "additional_flags=$options_cxx"
+
+ set x [libjava_prune_warnings \
+ [target_compile $file $name executable $options]]
+ if {$x != ""} {
+ verbose "target_compile failed: $x" 2
+ fail "$filename compilation"
+ return 0
+ }
+
+ pass "$filename compilation"
+ return 1
+}
+
+# Do all the work for a single invocation API test. Return 0 on
+# failure.
+proc gcj_jni_invocation_test_one {file} {
+ global runtests
+ global host_triplet
+ global INTERPRETER
+
+ # The base name. We use it for several purposes.
+ set main [file rootname [file tail $file]]
+ if {! [runtest_file_p $runtests $main]} {
+ # Simply skip it.
+ return 1
+ }
+
+ if {! [bytecompile_file $file [pwd]]} {
+ fail "bytecompile $file"
+ # FIXME - should use `untested' on all remaining tests.
+ # But that is hard.
+ return 0
+ }
+ pass "bytecompile $file"
+
+ set cfile [file rootname $file].c
+ set cxxflags "-lgcj"
+
+ if {! [gcj_jni_invocation_compile_c_to_binary $cfile $cxxflags]} {
+ # FIXME
+ return 0
+ }
+
+ set resultfile [file rootname $file].out
+
+ if {! [gcj_invoke $main $resultfile ""]} {
+ # FIXME
+ return 0
+ }
+
+ # We purposely ignore errors here; we still want to run the other
+ # appropriate tests.
+ set errname [file rootname [file tail $file]]
+
+ # When we succeed we remove all our clutter.
+ eval gcj_cleanup [glob -nocomplain -- ${main}.*] \
+ [list $main]
+
+ return 1
+}
+
# Run the JNI tests.
proc gcj_jni_run {} {
global srcdir subdir
@@ -193,6 +272,13 @@ proc gcj_jni_run {} {
foreach x $srcfiles {
gcj_jni_test_one $x
}
+
+ # Run JNI invocation API tests
+ catch { lsort [glob -nocomplain ${srcdir}/${subdir}/invocation/*.java] } srcfiles
+
+ foreach x $srcfiles {
+ gcj_jni_invocation_test_one $x
+ }
} else {
verbose "JNI tests not run in cross-compilation environment"
}
diff --git a/libjava/testsuite/libjava.mauve/xfails b/libjava/testsuite/libjava.mauve/xfails
index 37981bee552..e259e563e11 100644
--- a/libjava/testsuite/libjava.mauve/xfails
+++ b/libjava/testsuite/libjava.mauve/xfails
@@ -1,5 +1,64 @@
-FAIL: gnu.testlet.java.io.BufferedByteOutputStream.interrupt: single-byte writes (number 3)
-FAIL: gnu.testlet.java.io.BufferedByteOutputStream.interrupt: single-byte writes (number 4)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Adding a method to a class (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Adding a field to a class (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Adding a method to an interface (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Deleting a method from a class (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Deleting a field from a class (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Reordering fields of a class (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Reordering methods of a class (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Moving a method upward in the class hierarchy (number 1)
+FAIL: gnu.testlet.BinaryCompatibility.BinaryCompatibilityTest: Inserting a new class in the type hierarchy (number 1)
+FAIL: gnu.testlet.java.awt.AWTKeyStroke.getAWTKeyStroke: (String) (number 2)
+FAIL: gnu.testlet.java.awt.AWTKeyStroke.getAWTKeyStroke: (String) (number 3)
+FAIL: gnu.testlet.java.awt.AWTKeyStroke.getAWTKeyStroke: (String) (number 4)
+FAIL: gnu.testlet.java.awt.AWTKeyStroke.getAWTKeyStroke: uncaught exception at "(String)" number 6: java.lang.NullPointerException
+FAIL: gnu.testlet.java.awt.Robot.constructors: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.createScreenCapture: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.getPixelColor: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.keyPress: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.keyRelease: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.mouseMove: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.mousePress: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.mouseRelease: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.Robot.mouseWheel: uncaught exception: java.lang.Error: not implemented
+FAIL: gnu.testlet.java.awt.geom.Arc2D.getEndPoint (number 1)
+FAIL: gnu.testlet.java.awt.geom.Arc2D.getPathIterator (number 8)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.constructors: (int, int, int, int[]) (number 8)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.constructors: (int, int, int, int, int[]) (number 8)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.createSubsetSampleModel (number 7)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.equals (number 1)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.equals (number 2)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.equals (number 5)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.equals (number 7)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.equals (number 9)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.equals (number 11)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.equals (number 13)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.getDataElements: uncaught exception at "(int, int, Object, DataBuffer(Byte))" number 5: java.lang.ArrayStoreException
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.hashCode (number 1)
+FAIL: gnu.testlet.java.awt.image.SinglePixelPackedSampleModel.hashCode (number 2)
+FAIL: Link for gnu.testlet.java.beans.Beans.instantiate_1
+FAIL: gnu.testlet.java.beans.Introspector.getBeanInfo2: MATCH_EXPECTED_METHOD_COUNT (number 1)
+FAIL: gnu.testlet.java.beans.Introspector.getBeanInfo2: EXPECTED_METHOD_AVAILABLE: setSomeStaticValue (number 1)
+FAIL: gnu.testlet.java.beans.Introspector.getBeanInfo2: EXPECTED_METHOD_AVAILABLE: getSomeStaticValue (number 1)
+FAIL: gnu.testlet.java.beans.PropertyDescriptor.constructorTest2: new PropertyDescriptor(prop5) (check bindings) (number 3)
+FAIL: gnu.testlet.java.beans.PropertyDescriptor.constructorTest2: new PropertyDescriptor(prop5) (check bindings) (number 5)
+FAIL: gnu.testlet.java.beans.PropertyDescriptor.constructorTest2: new PropertyDescriptor(prop6) (check bindings) (number 3)
+FAIL: gnu.testlet.java.beans.PropertyDescriptor.constructorTest2: new PropertyDescriptor(prop6) (check bindings) (number 5)
+FAIL: gnu.testlet.java.io.File.jdk11: getCanonicalPath () (number 1)
+FAIL: gnu.testlet.java.io.File.security: createTempFile(2-args) - unexpected exception (number 1)
+FAIL: gnu.testlet.java.io.File.security: File.listRoots() (number 1)
+FAIL: gnu.testlet.java.io.File.security: file.renameTo - unexpected exception (number 1)
+FAIL: gnu.testlet.java.io.File.security: dir.deleteOnExit() - unexpected exception (number 1)
+FAIL: gnu.testlet.java.io.ObjectInputOutput.Deserializable: Wrong exception (number 1)
+FAIL: gnu.testlet.java.io.ObjectInputOutput.Deserializable: Was expecting an InvalidClassException (number 1)
+FAIL: gnu.testlet.java.io.ObjectInputOutput.ExtTest (number 2)
+FAIL: gnu.testlet.java.io.ObjectInputOutput.InputTest: gnu.testlet.java.io.ObjectInputOutput.Test$GetPutField (number 1)
+FAIL: gnu.testlet.java.io.ObjectInputOutput.OutputTest: Serializable: test(str=null, x=0) (number 2)
+FAIL: Link for gnu.testlet.java.io.ObjectInputStream.registerValidation
+FAIL: gnu.testlet.java.io.OutputStreamWriter.jdk11: OutputStreamWriter(writer, encoding) (number 1)
+FAIL: gnu.testlet.java.io.OutputStreamWriter.jdk11: OutputStreamWriter(writer, encoding) // alias (number 1)
+FAIL: gnu.testlet.java.io.PrintWriter.checkError (number 3)
+FAIL: gnu.testlet.java.io.PrintWriter.jdk11: checkError() after close() (number 1)
+FAIL: gnu.testlet.java.io.RandomAccessFile.setLength (number 14)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Four Byte Range Error (0) (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Four Byte Range Error (1) (number 1)
FAIL: gnu.testlet.java.io.Utf8Encoding.mojo: Five Bytes (0) (number 1)
@@ -13,8 +72,7 @@ FAIL: gnu.testlet.java.lang.Character.classify12 (number 1)
FAIL: gnu.testlet.java.lang.Character.getType (number 11)
FAIL: gnu.testlet.java.lang.Character.getType (number 20)
FAIL: gnu.testlet.java.lang.Character.getType (number 22)
-FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 1 (number 1)
-FAIL: gnu.testlet.java.lang.Class.ClassTest: Error: test_getClassLoader failed - 2 (number 1)
+FAIL: gnu.testlet.java.lang.Class.init (number 14)
FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 2)
FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 3)
FAIL: gnu.testlet.java.lang.Class.reflect2: getClasses (number 5)
@@ -24,20 +82,524 @@ FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaringClass (number 5)
FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 1)
FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 2)
FAIL: gnu.testlet.java.lang.Class.reflect2: getDeclaredClasses (number 3)
+FAIL: gnu.testlet.java.lang.ClassLoader.redefine: normal loading (number 1)
+FAIL: gnu.testlet.java.lang.Double.parseDouble (number 16)
+FAIL: gnu.testlet.java.lang.Double.parseDouble (number 19)
+FAIL: gnu.testlet.java.lang.Double.valueOf (number 16)
+FAIL: gnu.testlet.java.lang.Double.valueOf (number 19)
+FAIL: gnu.testlet.java.lang.Float.parseFloat (number 16)
+FAIL: gnu.testlet.java.lang.Float.parseFloat (number 19)
+FAIL: gnu.testlet.java.lang.Float.valueOf (number 16)
+FAIL: gnu.testlet.java.lang.Float.valueOf (number 19)
+FAIL: gnu.testlet.java.lang.Math.MathTest: Error : test_pow failed - 9 (number 1)
FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UTF-16") (number 1)
FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeBig") (number 1)
FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeBigUnmarked") (number 1)
FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeLittle") (number 1)
-FAIL: gnu.testlet.java.lang.String.getBytes13: String.getBytes("UnicodeLittleUnmarked") (number 1)
FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("ISO8859_15") (number 1)
-FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16BE") (number 1)
-FAIL: gnu.testlet.java.lang.String.getBytes14: String.getBytes("UTF-16LE") (number 1)
-FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: patterns (number 2)
-FAIL: gnu.testlet.java.text.SimpleDateFormat.getAndSet2DigitYearStart: get2DigitYearStart() initial (number 1)
-FAIL: gnu.testlet.java.text.DateFormatSymbols.Test: invalid locale (number 1)
-FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_Basics - 2 should not have raised Throwable here (number 1)
-FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_getHeaderField - 2 4 header field wrong (number 1)
-FAIL: gnu.testlet.java.net.URL.URLTest: openStream (number 1)
-FAIL: gnu.testlet.java.net.URL.URLTest: Error in test_toString - 5 exception should not be thrown here (number 1)
+FAIL: gnu.testlet.java.lang.Thread.contextClassLoader: null is a valid contextClassLoader (number 1)
+FAIL: gnu.testlet.java.lang.Thread.contextClassLoader: New thread inherits null classloader (number 1)
+FAIL: gnu.testlet.java.lang.Thread.contextClassLoader: run with null classloader (number 1)
+FAIL: gnu.testlet.java.lang.Thread.daemon: Can change daemon state on an exitted Thread (number 1)
+FAIL: gnu.testlet.java.lang.Thread.daemon: Daemon status changed when set on an exitted Thread (number 1)
+FAIL: gnu.testlet.java.lang.Thread.security10: Thread.enumerate(Thread[]) (number 1)
+FAIL: gnu.testlet.java.lang.Thread.stop: Unexpected exception during test() (number 1)
+FAIL: gnu.testlet.java.net.DatagramPacket.DatagramPacketOffset: DatagramPacket Offset Test byte[]='Hello Worl..........Hello World 12345' should be='Hello WorlHello WorlHello World 12345' (number 1)
+FAIL: gnu.testlet.java.net.InetAddress.isSiteLocalAddress (number 5)
+FAIL: gnu.testlet.java.net.InetAddress.isSiteLocalAddress (number 6)
+FAIL: gnu.testlet.java.net.InetAddress.isSiteLocalAddress (number 9)
+FAIL: gnu.testlet.java.net.InetAddress.isSiteLocalAddress (number 10)
FAIL: gnu.testlet.java.net.MulticastSocket.MulticastSocketTest: joinGroup() twice. (number 1)
+FAIL: Compile gnu/testlet/java/net/ServerSocket/ServerSocketTest.lo for gnu.testlet.java.net.ServerSocket.ServerSocketTest
+FAIL: gnu.testlet.java.net.Socket.SocketTest: Error : test_Basics failed - 7 exception should not have been thrown. (number 1)
+FAIL: gnu.testlet.java.net.URI.URITest: g:h (number 4)
+FAIL: gnu.testlet.java.net.URI.URITest: g:h (number 9)
+FAIL: gnu.testlet.java.net.URI.URITest: unexpected exception (number 1)
+FAIL: gnu.testlet.java.net.URI.URITest: ?y (number 4)
+FAIL: gnu.testlet.java.net.URI.URITest: ?y (number 9)
+FAIL: gnu.testlet.java.net.URI.URITest: #s (number 4)
+FAIL: gnu.testlet.java.net.URI.URITest: #s (number 9)
+FAIL: gnu.testlet.java.net.URI.URITest: #s (number 11)
+FAIL: gnu.testlet.java.net.URI.URITest: #s (number 14)
+FAIL: gnu.testlet.java.net.URI.URITest: jrmi://localhost:2000 (number 4)
+FAIL: gnu.testlet.java.net.URI.URITest: jrmi://localhost:2000 (number 9)
+FAIL: gnu.testlet.java.net.URL.URLTest: Error in test_toString - 5 exception should not be thrown here (number 1)
+FAIL: gnu.testlet.java.net.URL.URLTest: contextResolution (number 5)
+FAIL: gnu.testlet.java.net.URL.URLTest: contextResolution (number 6)
+FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_getHeaderField - 2 4 header field wrong (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.Allocating: mark: mark not invalidated (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.Allocating: mark: mark not invalidated (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.Allocating: mark: mark not invalidated (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.Allocating: mark: mark not invalidated (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.ByteBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.CharBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.CharBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.CharBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.DoubleBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.DoubleBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.DoubleBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.FloatBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.FloatBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.FloatBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.IntBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.IntBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.IntBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.LongBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.LongBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.LongBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.ShortBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.ShortBuffer.compact: position after compact() (number 1)
+FAIL: gnu.testlet.java.nio.ShortBuffer.compact: limit after compact() (number 1)
+FAIL: gnu.testlet.java.nio.channels.FileChannel.copyIO: Unexpected result: source=abcdefghijklmnopqrstuvwxyz, result=aababcabcdabcdeabcdefabcdef (number 1)
+FAIL: gnu.testlet.java.nio.channels.FileChannel.manyopen: Unexpected exception at nr 339: java.io.IOException: Too many open files (number 1)
+FAIL: gnu.testlet.java.nio.charset.Charset.encode: Wrong limit in byte buffer (number 1)
+FAIL: gnu.testlet.java.nio.charset.Charset.encode: uncaught exception at "Wrong limit in char buffer" number 2: java.lang.IllegalStateException
+FAIL: gnu.testlet.java.text.DateFormatSymbols.setAmPmStrings (number 1)
+FAIL: gnu.testlet.java.text.DateFormatSymbols.setEras (number 1)
+FAIL: gnu.testlet.java.text.DateFormatSymbols.setMonths (number 1)
+FAIL: gnu.testlet.java.text.DateFormatSymbols.setShortMonths (number 1)
+FAIL: gnu.testlet.java.text.DateFormatSymbols.setShortWeekdays (number 1)
+FAIL: gnu.testlet.java.text.DateFormatSymbols.setWeekdays (number 1)
+FAIL: gnu.testlet.java.text.DateFormatSymbols.setZoneStrings (number 1)
+FAIL: gnu.testlet.java.text.DecimalFormat.equals (number 1)
+FAIL: gnu.testlet.java.text.DecimalFormat.equals (number 2)
+FAIL: gnu.testlet.java.text.DecimalFormat.formatExp: pattern ##.###E0 (number 2)
+FAIL: gnu.testlet.java.text.DecimalFormatSymbols.getCurrency (number 1)
+FAIL: gnu.testlet.java.text.MessageFormat.format14: number (number 2)
+FAIL: gnu.testlet.java.text.MessageFormat.format14: number (number 4)
+FAIL: gnu.testlet.java.text.MessageFormat.format14: date (number 3)
+FAIL: gnu.testlet.java.text.MessageFormat.format14: time (number 3)
+FAIL: gnu.testlet.java.text.MessageFormat.format14: choice (number 1)
+FAIL: gnu.testlet.java.text.NumberFormat.UK: Double-based fraction formatting with integer number format (0.333). (number 1)
+FAIL: gnu.testlet.java.text.NumberFormat.UK: Double-based fraction formatting with integer number format (123,456.789). (number 1)
+FAIL: gnu.testlet.java.text.NumberFormat.UK: Long-based integer formatting with currency number format ($30.00). (number 1)
+FAIL: gnu.testlet.java.text.NumberFormat.UK: Double-based integer formatting with currency number format ($30.00). (number 1)
+FAIL: gnu.testlet.java.text.NumberFormat.UK: Double-based fraction formatting with currency number format ($0.333). (number 1)
+FAIL: gnu.testlet.java.text.NumberFormat.UK: Double-based fraction formatting with currency number format ($123,456.789). (number 1)
+FAIL: gnu.testlet.java.text.NumberFormat.UK: Long-based integer formatting with percentile number format (30%). (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.Cloning: Cloned symbols (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.Cloning: Cloned 2 digit year start date (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.Localization: uncaught exception at "Non-localized pattern comes back as is with toPattern()." number 2: java.lang.StringIndexOutOfBoundsException: String index out of range: 18
+FAIL: gnu.testlet.java.text.SimpleDateFormat.applyLocalizedPattern (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.applyLocalizedPattern (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.applyPattern (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.constructors: SimpleDateFormat(String) (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.constructors: SimpleDateFormat(String, DateFormatSymbols) (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.constructors: SimpleDateFormat(String, DateFormatSymbols) (number 5)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.constructors: SimpleDateFormat(String, Locale) (number 3)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.getDateFormatSymbols (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.getDateFormatSymbols (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: parse pattern MMMM yyyy (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: parse pattern MMMM yyyy (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.lang.NullPointerException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: parse pattern EEEE MMMM yyyy (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: parse pattern EEE MMM (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.text.ParseException: (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.parse: java.lang.NullPointerException: (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.regress: DST timezone (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.setDateFormatSymbols (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.setDateFormatSymbols (number 2)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.setDateFormatSymbols (number 3)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.toLocalizedPattern (number 1)
+FAIL: gnu.testlet.java.text.SimpleDateFormat.toLocalizedPattern (number 2)
+FAIL: gnu.testlet.java.util.Calendar.set: Simple tests (number 2)
+FAIL: gnu.testlet.java.util.Calendar.set: setting only some fields (number 3)
+FAIL: gnu.testlet.java.util.Calendar.set: setting only some fields (number 4)
+FAIL: gnu.testlet.java.util.Calendar.set: setting only some fields (number 5)
+FAIL: gnu.testlet.java.util.Calendar.set: setting only some fields (number 6)
+FAIL: gnu.testlet.java.util.Calendar.set: setting only some fields (number 7)
+FAIL: gnu.testlet.java.util.Calendar.set: test setting conflicting values of different fields (number 2)
+FAIL: gnu.testlet.java.util.Calendar.set: test setting conflicting values of different fields (number 3)
+FAIL: gnu.testlet.java.util.Calendar.set: test setting conflicting values of different fields (number 4)
+FAIL: gnu.testlet.java.util.Calendar.set: test setting conflicting values of different fields (number 5)
+FAIL: gnu.testlet.java.util.Calendar.set: Normalization (number 2)
+FAIL: gnu.testlet.java.util.Calendar.set: Normalization (number 3)
+FAIL: gnu.testlet.java.util.Currency.Constructors: uncaught exception: java.lang.IllegalArgumentException: The currency code, null, is not supported.
+FAIL: gnu.testlet.java.util.Currency.France: Euro ISO 4217 currency code retrieval check (FRF). (number 1)
+FAIL: gnu.testlet.java.util.Currency.France: Euro currency symbol retrieval check (F). (number 1)
+FAIL: gnu.testlet.java.util.Currency.France: Euro ISO 4217 currency code retrieval check (FRF). (number 1)
+FAIL: gnu.testlet.java.util.Currency.Germany: Euro ISO 4217 currency code retrieval check (DEM). (number 1)
+FAIL: gnu.testlet.java.util.Currency.Germany: Euro currency symbol retrieval check (DM). (number 1)
+FAIL: gnu.testlet.java.util.Currency.Germany: Euro ISO 4217 currency code retrieval check (DEM). (number 1)
+FAIL: gnu.testlet.java.util.Currency.Italy: Euro ISO 4217 currency code retrieval check (ITL). (number 1)
+FAIL: gnu.testlet.java.util.Currency.Italy: Euro currency symbol retrieval check (L.). (number 1)
+FAIL: gnu.testlet.java.util.Currency.Italy: Euro currency fraction digits retrieval check (0). (number 1)
+FAIL: gnu.testlet.java.util.Currency.Italy: Euro ISO 4217 currency code retrieval check (ITL). (number 1)
+FAIL: gnu.testlet.java.util.Currency.ReferenceEquality: uncaught exception at "Reference equality for currencies (UK) check." number 2: java.lang.IllegalArgumentException: The currency code, GBP, is not supported.
+FAIL: gnu.testlet.java.util.Currency.US: Non local currency symbol retrieval check (CAD). (number 1)
+FAIL: gnu.testlet.java.util.Currency.getInstance (number 1)
+FAIL: gnu.testlet.java.util.Currency.getInstance (number 3)
+FAIL: gnu.testlet.java.util.Currency.getInstance (number 4)
+FAIL: gnu.testlet.java.util.Currency.getInstance (number 5)
+FAIL: gnu.testlet.java.util.Date.getTimezoneOffset: getTimezoneOffset for zone: GMT (number 1)
+FAIL: gnu.testlet.java.util.Date.getTimezoneOffset: getTimezoneOffset for zone: GMT (number 2)
+FAIL: gnu.testlet.java.util.Date.getTimezoneOffset: getTimezoneOffset for zone: Europe/London (number 2)
+FAIL: gnu.testlet.java.util.Date.range (number 6)
+FAIL: gnu.testlet.java.util.Date.range (number 7)
+FAIL: gnu.testlet.java.util.Date.range (number 8)
+FAIL: gnu.testlet.java.util.Date.range (number 9)
+FAIL: gnu.testlet.java.util.Date.range (number 10)
+FAIL: gnu.testlet.java.util.GregorianCalendar.conversion: uncaught exception at "Testing setTimeInMillis(281474976710656) i = 48" number 3: java.lang.IllegalArgumentException: month out of range
+FAIL: gnu.testlet.java.util.GregorianCalendar.getMinimalDaysInFirstWeek (number 1)
+FAIL: gnu.testlet.java.util.GregorianCalendar.getMinimalDaysInFirstWeek (number 2)
+FAIL: gnu.testlet.java.util.GregorianCalendar.getMinimum (number 2)
+FAIL: gnu.testlet.java.util.GregorianCalendar.getMinimum (number 3)
+FAIL: gnu.testlet.java.util.GregorianCalendar.getMinimum (number 4)
FAIL: gnu.testlet.java.util.SimpleTimeZone.check12 (number 22)
+FAIL: gnu.testlet.java.util.SimpleTimeZone.check12 (number 23)
+FAIL: gnu.testlet.java.util.SimpleTimeZone.equals (number 21)
+FAIL: gnu.testlet.java.util.SimpleTimeZone.getDSTSavings (number 2)
+FAIL: gnu.testlet.java.util.SimpleTimeZone.hasSameRules (number 19)
+FAIL: gnu.testlet.java.util.Timer.taskException: still able to schedule tasks (number 1)
+FAIL: gnu.testlet.java.util.logging.Logger.getLogger (number 9)
+FAIL: gnu.testlet.java.util.logging.Logger.securityChecks: Logger.getAnonymousLogger() (number 7)
+FAIL: gnu.testlet.java.util.logging.Logger.securityChecks: Logger.getAnonymousLogger(null) (number 7)
+FAIL: gnu.testlet.java.util.logging.XMLFormatter.formatMessage (number 2)
+FAIL: gnu.testlet.java.util.logging.XMLFormatter.formatMessage (number 3)
+FAIL: gnu.testlet.java.util.logging.XMLFormatter.formatMessage (number 4)
+FAIL: gnu.testlet.java.util.logging.XMLFormatter.formatMessage (number 5)
+FAIL: gnu.testlet.java.util.logging.XMLFormatter.formatMessage (number 6)
+FAIL: gnu.testlet.java.util.zip.ZipFile.DirEntryTest: getEntry("dir/") (number 2)
+FAIL: gnu.testlet.java.util.zip.ZipFile.newZipFile: non-zipfile gets rejected (number 1)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.add: add(int, Object) (number 5)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.add: add(int, Object) (number 9)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.add: add(int, Object) (number 13)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.add: add(int, Object) (number 18)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 3)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 4)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 7)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 8)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 11)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 12)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 15)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.addElement: addElement(Object) (number 16)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.clear: clear() (number 4)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.clear: clear() (number 6)
+FAIL: Link for gnu.testlet.javax.swing.DefaultListModel.removeAllElements
+FAIL: gnu.testlet.javax.swing.DefaultListModel.setSize: setSize(int) (number 6)
+FAIL: gnu.testlet.javax.swing.DefaultListModel.setSize: uncaught exception at "setSize(int)" number 10: java.lang.NullPointerException
+FAIL: Link for gnu.testlet.javax.swing.JComboBox.MutableTest1
+FAIL: Link for gnu.testlet.javax.swing.JComboBox.MutableTest2
+FAIL: Link for gnu.testlet.javax.swing.JComboBox.SimpleSelectionTest
+FAIL: gnu.testlet.javax.swing.UIDefaults.remove: put with null gave NullPointerException (number 1)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.add: uncaught exception: java.lang.NullPointerException
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.breadthFirstEnumeration: uncaught exception: java.lang.NullPointerException
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.constructors: userObject (number 1)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 2)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 3)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 4)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 5)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 7)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 8)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 9)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 10)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 11)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.getNextPreviousNode (number 12)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.pathFromAncestorEnumeration: rejects invalid arguments (number 1)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.pathFromAncestorEnumeration: rejects invalid arguments (null) (number 1)
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.pathFromAncestorEnumeration: uncaught exception at "rejects invalid arguments (null)" number 2: java.lang.NullPointerException
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.postorderEnumeration: uncaught exception: java.lang.NullPointerException
+FAIL: gnu.testlet.javax.swing.tree.DefaultMutableTreeNode.preorderEnumeration: uncaught exception: java.lang.NullPointerException
+FAIL: gnu.testlet.locales.LocaleTest: Locale de_DE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale de_DE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale de_DE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT de_DE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT de_DE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM de_DE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM de_DE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG de_DE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: de_DE (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: de_DE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: de_DE (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_BE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_BE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_BE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 5)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 11)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 12)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 16)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 17)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 20)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 23)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 24)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fr_BE (number 25)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fr_BE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fr_BE (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: BEF (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_IE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_IE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_IE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 4)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 5)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 11)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 12)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 16)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 17)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 19)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 20)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 23)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 24)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_IE (number 25)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: en_IE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: en_IE (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: IEP (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_FR (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_FR (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_FR (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fr_FR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fr_FR (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: FRF (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale es_ES (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale es_ES (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale es_ES (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: es_ES (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: es_ES (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: es_ES (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: ESP (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale pt_PT (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale pt_PT (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale pt_PT (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: pt_PT (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: pt_PT (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: PTE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale it_IT (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale it_IT (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale it_IT (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: it_IT (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: it_IT (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: it_IT (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: ITL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale nl_NL (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale nl_NL (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale nl_NL (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT nl_NL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT nl_NL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM nl_NL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM nl_NL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG nl_NL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 5)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 11)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 12)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 16)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 17)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 20)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 23)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 24)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: nl_NL (number 25)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: nl_NL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: nl_NL (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: NLG (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_LU (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_LU (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fr_LU (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fr_LU (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fr_LU (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: LUF (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_GB (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_GB (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_GB (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM en_GB (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_GB (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: en_GB (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: GBP (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_US (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_US (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale en_US (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT en_US (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT en_US (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM en_US (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM en_US (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG en_US (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_US (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_US (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_US (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: en_US (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: en_US (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: USD (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fi_FI (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fi_FI (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale fi_FI (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 5)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 11)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 12)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 16)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 17)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 20)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 23)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 24)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: fi_FI (number 25)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fi_FI (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: fi_FI (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: FIM (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale tr_TR (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale tr_TR (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale tr_TR (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 4)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 5)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 11)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 12)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 16)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 17)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 19)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 20)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 23)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 24)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: tr_TR (number 25)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: tr_TR (number 2)
+FAIL: gnu.testlet.locales.LocaleTest: Currencies locale: tr_TR (number 3)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: TRL (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: Locale et_EE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: Locale et_EE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: Locale et_EE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.SHORT et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.MEDIUM et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.LONG et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: DateFormat.DEFAULT == DateFormat.MEDIUM et_EE (number 1)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 6)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 7)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 8)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 9)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 10)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 14)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 15)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 21)
+FAIL: gnu.testlet.locales.LocaleTest: numberformats locale: et_EE (number 22)
+FAIL: gnu.testlet.locales.LocaleTest: Currency code not supported: EEK (number 1)
diff --git a/libjava/verify.cc b/libjava/verify.cc
index 988b5aab67e..141f27af797 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1,6 +1,6 @@
// verify.cc - verify bytecode
-/* Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation
This file is part of libgcj.
@@ -578,9 +578,11 @@ private:
//
// First, when constructing a new object, it is the PC of the
// `new' instruction which created the object. We use the special
- // value UNINIT to mean that this is uninitialized, and the
- // special value SELF for the case where the current method is
- // itself the <init> method.
+ // value UNINIT to mean that this is uninitialized. The special
+ // value SELF is used for the case where the current method is
+ // itself the <init> method. the special value EITHER is used
+ // when we may optionally allow either an uninitialized or
+ // initialized reference to match.
//
// Second, when the key is return_address_type, this holds the PC
// of the instruction following the `jsr'.
@@ -588,6 +590,7 @@ private:
static const int UNINIT = -2;
static const int SELF = -1;
+ static const int EITHER = -3;
// Basic constructor.
type ()
@@ -734,23 +737,51 @@ private:
if (k.klass == NULL)
verifier->verify_fail ("programmer error in type::compatible");
- // An initialized type and an uninitialized type are not
- // compatible.
- if (isinitialized () != k.isinitialized ())
- return false;
-
- // Two uninitialized objects are compatible if either:
- // * The PCs are identical, or
- // * One PC is UNINIT.
- if (! isinitialized ())
+ // Handle the special 'EITHER' case, which is only used in a
+ // special case of 'putfield'. Note that we only need to handle
+ // this on the LHS of a check.
+ if (! isinitialized () && pc == EITHER)
{
- if (pc != k.pc && pc != UNINIT && k.pc != UNINIT)
+ // If the RHS is uninitialized, it must be an uninitialized
+ // 'this'.
+ if (! k.isinitialized () && k.pc != SELF)
return false;
}
+ else if (isinitialized () != k.isinitialized ())
+ {
+ // An initialized type and an uninitialized type are not
+ // otherwise compatible.
+ return false;
+ }
+ else
+ {
+ // Two uninitialized objects are compatible if either:
+ // * The PCs are identical, or
+ // * One PC is UNINIT.
+ if (! isinitialized ())
+ {
+ if (pc != k.pc && pc != UNINIT && k.pc != UNINIT)
+ return false;
+ }
+ }
return klass->compatible(k.klass, verifier);
}
+ bool equals (const type &other, _Jv_BytecodeVerifier *vfy)
+ {
+ // Only works for reference types.
+ if ((key != reference_type
+ && key != uninitialized_reference_type)
+ || (other.key != reference_type
+ && other.key != uninitialized_reference_type))
+ return false;
+ // Only for single-valued types.
+ if (klass->ref_next || other.klass->ref_next)
+ return false;
+ return klass->equals (other.klass, vfy);
+ }
+
bool isvoid () const
{
return key == void_type;
@@ -1963,7 +1994,9 @@ private:
}
// Return field's type, compute class' type if requested.
- type check_field_constant (int index, type *class_type = NULL)
+ // If PUTFIELD is true, use the special 'putfield' semantics.
+ type check_field_constant (int index, type *class_type = NULL,
+ bool putfield = false)
{
_Jv_Utf8Const *name, *field_type;
type ct = handle_field_or_method (index,
@@ -1971,9 +2004,29 @@ private:
&name, &field_type);
if (class_type)
*class_type = ct;
+ type result;
if (field_type->first() == '[' || field_type->first() == 'L')
- return type (field_type, this);
- return get_type_val_for_signature (field_type->first());
+ result = type (field_type, this);
+ else
+ result = get_type_val_for_signature (field_type->first());
+
+ // We have an obscure special case here: we can use `putfield' on
+ // a field declared in this class, even if `this' has not yet been
+ // initialized.
+ if (putfield
+ && ! current_state->this_type.isinitialized ()
+ && current_state->this_type.pc == type::SELF
+ && current_state->this_type.equals (ct, this)
+ // We don't look at the signature, figuring that if it is
+ // wrong we will fail during linking. FIXME?
+ && _Jv_Linker::has_field_p (current_class, name))
+ // Note that we don't actually know whether we're going to match
+ // against 'this' or some other object of the same type. So,
+ // here we set things up so that it doesn't matter. This relies
+ // on knowing what our caller is up to.
+ class_type->set_uninitialized (type::EITHER, this);
+
+ return result;
}
type check_method_constant (int index, bool is_interface,
@@ -2783,15 +2836,8 @@ private:
case op_putfield:
{
type klass;
- type field = check_field_constant (get_ushort (), &klass);
+ type field = check_field_constant (get_ushort (), &klass, true);
pop_type (field);
-
- // We have an obscure special case here: we can use
- // `putfield' on a field declared in this class, even if
- // `this' has not yet been initialized.
- if (! current_state->this_type.isinitialized ()
- && current_state->this_type.pc == type::SELF)
- klass.set_uninitialized (type::SELF, this);
pop_type (klass);
}
break;
diff --git a/libmudflap/ChangeLog b/libmudflap/ChangeLog
index 086966f4330..3dad0437233 100644
--- a/libmudflap/ChangeLog
+++ b/libmudflap/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-13 Frank Ch. Eigler <fche@redhat.com>
+
+ PR mudflap/19319
+ * testsuite/libmudflap.c++/pass55-frag.c: New test.
+
2005-01-05 Richard Henderson <rth@redhat.com>
* testsuite/libmudflap.c/pass32-frag.c: Fix typo.
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 15e94051159..3982be6402d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,337 @@
+2005-02-25 Paolo Carlini <pcarlini@suse.de>
+
+ * include/tr1/type_traits: Add the trivial is_union and is_class;
+ add the __is_union_or_class extension.
+ (is_enum, is_empty): Use the latter.
+ * include/tr1/type_traits_fwd.h: Add __is_union_or_class.
+ * testsuite/testsuite_tr1.h: Add UnionType; trivial formatting
+ fixes.
+ * testsuite/tr1/4_metaprogramming/composite_type_traits/
+ is_union_or_class/is_union_or_class.cc: New.
+ * testsuite/tr1/4_metaprogramming/composite_type_traits/
+ is_union_or_class/typedefs.cc: Likewise.
+
+2005-02-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/tr1/6_containers/unordered/instantiate/hash.cc: Guard
+ wchar_t use with _GLIBCXX_USE_WCHAR_T.
+
+2005-02-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/std/std_complex.h: _GLIBCXX_USE_C99_COMPLEX_MATH to
+ _GLIBCXX_USE_C99_COMPLEX.
+ * acinclude.m4: Same.
+ * acconfig.h: Same.
+ * configure: Regenerate.
+ * config.h.in: Same.
+
+2005-02-24 Paolo Carlini <pcarlini@suse.de>
+
+ * include/tr1/functional (mem_fn): Avoid _T, badname on
+ Darwin.
+
+2005-02-23 Douglas Gregor <doug.gregor@gmail.com>
+
+ * include/tr1/functional (function): New class template.
+ (mem_fn): New function template.
+ Implementations of TR1 function and mem_fn facilities.
+ * include/tr1/functional_iterate.h: Implementations of TR1
+ function and mem_fn facilities.
+ * testsuite/tr1/3_function_objects/function/1.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/2.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/3.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/4.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/5.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/6.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/7.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/8.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/9.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/mem_fn.cc: New test of
+ std::tr1::mem_fn.
+
+2005-02-23 Paolo Carlini <pcarlini@suse.de>
+
+ * include/tr1/type_traits: Implement is_convertible.
+ * testsuite/tr1/4_metaprogramming/relationships_between_types/
+ is_convertible/is_convertible.cc: New.
+ * testsuite/tr1/4_metaprogramming/relationships_between_types/
+ is_convertible/typedefs.cc: Likewise.
+ * testsuite/testsuite_tr1.h: Add class DerivedType.
+
+ * include/tr1/type_traits (is_function): Don't mistake references
+ to function types for function types.
+ * testsuite/tr1/4_metaprogramming/primary_type_categories/
+ is_function/is_function.cc: Add testcase.
+
+2005-02-22 Benjamin Kosnik <bkoz@redhat.com>
+
+ * scripts/check_performance: Tweaks.
+
+ * testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc: Name
+ output file with extension that clean rules can find.
+
+2005-02-22 Richard Henderson <rth@redhat.com>
+
+ PR libstdc++/20091
+ * libsupc++/eh_catch.cc (__cxa_begin_catch): Don't special case
+ decrement of uncaughtExceptions for rethrow.
+
+2005-02-22 Paolo Carlini <pcarlini@suse.de>
+
+ * include/tr1/functional: Fix License to GPL with exception.
+ * include/tr1/hashtable: Likewise.
+ * include/tr1/tuple: Likewise.
+ * include/tr1/type_traits: Likewise.
+ * include/tr1/type_traits_fwd.h: Likewise.
+ * include/tr1/unordered_map: Likewise.
+ * include/tr1/unordered_set: Likewise.
+ * include/tr1/utility: Likewise.
+
+2005-02-22 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/
+ auto_ptr_neg.cc: Add missing dg-do compile directive.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/
+ auto_ptr_rvalue_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/
+ shared_ptr_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/
+ auto_ptr_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/
+ reset_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/
+ swap_neg.cc: Likewise.
+
+2005-02-22 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * include/Makefile.am, include/Makefile.in: Fix accidental extra
+ change from previous commit.
+
+2005-02-21 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * include/tr1/memory: New file.
+ * include/Makefile.am, include/Makefile.in: Add new TR1 header.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared2.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared3.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/shared.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/still_shared.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/assign.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr_rvalue_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/shared_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/shared_ptr_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/comparison/cmp.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/auto_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/auto_ptr_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/copy.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/default.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/pointer.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/weak_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/weak_ptr_expired.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/dest/dest.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/misc/io.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/misc/swap.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/reset.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/reset_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/swap.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/swap_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/bool_conv.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/get.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/unique.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/use_count.cc: New test.
+
+2005-02-21 Paolo Carlini <pcarlini@suse.de>
+
+ * include/tr1/type_traits (is_member_function_pointer):
+ Remove ugly workaround for c++/19076.
+
+2005-02-21 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/basic_string.tcc (_Rep::_M_destroy): Don't
+ check for this == &_S_empty_rep, it's always false, here.
+
+2005-02-19 Matt Austern <austern@gmail.com>
+
+ * include/tr1/functional (tr1_hashtable_define_trivial_hash): Make
+ hash<T>::operator() a const member function for T a fundamental type
+ * include/tr1/hashtable (extract1st::operator()): Declare const.
+ (hash_code_base): Declare all member functions const
+ (hashtable::find): fix call to this->bucket_count()
+ (hashtable::count): Likewise.
+ (hashtable::equal_range): m_incr_bucket applies to iterator, not node.
+ * testsuite/tr1/6_containers/unordered/find/set1.cc: New test.
+ * testsuite/tr1/6_containers/unordered/find/map1.cc: New test.
+ * testsuite/tr1/6_containers/unordered/find/multimap1.cc: New test.
+ * testsuite/tr1/6_containers/unordered/find/multiset1.cc: New test.
+
+2005-02-19 Hans-Peter Nilsson <hp@axis.com>
+
+ PR libstdc++/20071
+ * include/tr1/functional (hash<std::wstring>): Wrap in #ifdef
+ _GLIBCXX_USE_WCHAR_T.
+
+2005-02-18 Richard Henderson <rth@redhat.com>
+
+ PR libstdc++/10606
+ * config/linker-map.gnu (CXXABI_1.3.1): Add __cxa_get_exception_ptr.
+ * libsupc++/eh_alloc.cc (__cxa_allocate_exception): Increment
+ uncaughtExceptions here instead of ...
+ * libsupc++/eh_throw.cc (__cxa_throw) ... here.
+ (__cxa_rethrow): Increment uncaughtExceptions here instead of ...
+ * libsupc++/eh_catch.cc (__cxa_end_catch): ... here.
+ (__cxa_get_exception_ptr): New.
+ * libsupc++/unwind-cxx.h (__cxa_get_exception_ptr): Declare.
+
+2005-02-18 Matt Austern <austern@apple.com>
+
+ * testsuite/tr1/6_containers/unordered/insert/array_syntax.cc: Fix
+ test case to use assignment instead of ==
+ * testsuite/tr1/6_containers/unordered/insert/map_range.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multimap_range.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multiset_range.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/set_range.cc: New test.
+
+2005-02-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * testsuite/thread/pthread1.cc: Do not invoke pthread_setconcurrency
+ on Solaris 2.6 and below.
+ * testsuite/thread/pthread2.cc: Likewise.
+ * testsuite/thread/pthread3.cc: Likewise.
+ * testsuite/thread/pthread4.cc: Likewise.
+ * testsuite/thread/pthread5.cc: Likewise.
+ * testsuite/thread/pthread6.cc: Likewise.
+ * testsuite/thread/pthread7-rope.cc: Likewise.
+
+2005-02-17 Matt Austern <austern@apple.com>
+
+ * include/tr1/functional (hash): New function object.
+ * include/tr1/hashtable: New file.
+ * include/tr1/unordered_set: New file.
+ * include/tr1/unordered_map: New file.
+ * include/Makefile.am: Add three new TR1 headers.
+ * include/Makefile.in: Likewise.
+ * testsuite/tr1/6_containers/unordered/insert/array_syntax.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/map_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multimap_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multiset_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/set_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/hash.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/map.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/multimap.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/multiset.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/set.cc: New test.
+
+2005-02-16 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/23_containers/set/modifiers/16728.cc:
+ Remove redundant include <testsuite_performance.h>.
+
+2005-02-16 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/19829
+ * testsuite/21_strings/basic_string/find/char/3.cc: Fix the test
+ at line #66 to not access str_lit01 beyond its end.
+ * testsuite/21_strings/basic_string/find/wchar_t/3.cc: Likewise.
+
+2005-02-15 Paolo Carlini <pcarlini@suse.de>
+ Jon Grimm <jgrimm2@us.ibm.com>
+
+ PR libstdc++/19955
+ * include/bits/locale_facets.h (ctype<char>::_M_narrow_init()):
+ Fix the logic setting _M_narrow_ok: first check whether the
+ transformation is trivial with a dflt == 0, then deal with the
+ special case of zero.
+ * testsuite/22_locale/ctype/narrow/char/19955.cc: New.
+
+ * include/bits/locale_facets.h (ctype<char>::_M_widen_init()):
+ Tweak consistently to use memcmp; minor formatting fixes.
+
+2005-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR libstdc++/19946
+ * testsuite/demangle/abi_examples/01.cc (main): Adjust for 2005-02-13
+ demangler change.
+ * testsuite/demangle/abi_examples/02.cc (main): Likewise.
+
+2005-02-13 Richard Guenther <rguenth@gcc.gnu.org>
+ Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/11706
+ * include/c_std/std_cmath.h (pow): Use __builtin_powi[lf]
+ for integer overloads.
+
+ * testsuite/26_numerics/cmath/powi.cc: New.
+
+2005-02-11 Janis Johnson <janis187@us.ibm.com>
+
+ * testsuite/26_numerics/complex/13450.cc: Fix XFAIL selector.
+ * testsuite/26_numerics/complex/complex_value.cc: Ditto.
+ * testsuite/26_numerics/complex/pow.cc: Ditto.
+
+ * testsuite/lib/libstdc++.exp: Load target-supports-dg.exp.
+ * testsuite/26_numerics/complex/13450.cc: XFAIL for broken_cplxf_arg.
+ * testsuite/26_numerics/complex/complex_value.cc: Ditto.
+ * testsuite/26_numerics/complex/pow.cc: Ditto.
+
+2005-02-09 Mike Stump <mrs@apple.com>
+
+ * libsupc++/del_op.cc: Don't include cstdlib when !_GLIBCXX_HOSTED.
+
+2005-02-09 Janis Johnson <janis187@us.ibm.com>
+
+ * testsuite/ext/array_allocator/2.cc: XFAIL for powerpc*-*-linux*.
+
+2005-02-08 Mark Mitchell <mark@codesourcery.com>
+
+ * config/linker-map.gnu (GLIBCXX_3.4): Add _ZNSdC* and _ZNSdD*.
+
+2005-02-07 Loren J. Rittle <ljrittle@acm.org>
+
+ * testsuite/27_io/basic_istream/getline/wchar_t/5.cc: Make buf static.
+ * testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc: Make ref and
+ src static.
+
2005-02-02 Brad Spencer <spencer@infointeractive.com>
* debug.html: Fix broken tags.
diff --git a/libstdc++-v3/acconfig.h b/libstdc++-v3/acconfig.h
index f1b821630ba..51d588430a3 100644
--- a/libstdc++-v3/acconfig.h
+++ b/libstdc++-v3/acconfig.h
@@ -20,7 +20,7 @@
#undef _GLIBCXX_USE_C99_MATH
// Define if C99 complex math functions should be used in std::complex.
-#undef _GLIBCXX_USE_C99_COMPLEX_MATH
+#undef _GLIBCXX_USE_C99_COMPLEX
// Define if code specialized for wchar_t should be used.
#undef _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index f18b7d90b53..4ef88ad4d55 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -983,7 +983,7 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
AC_MSG_RESULT($ac_c99_complex)
if test x"$ac_c99_complex" = x"yes"; then
- AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX_MATH)
+ AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX)
fi
# Check for the existence in <stdio.h> of vscanf, et. al.
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index fdcc07cb2a2..76d32d1630f 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -21,7 +21,7 @@
#undef _GLIBCXX_USE_C99_MATH
// Define if C99 complex math functions should be used in std::complex.
-#undef _GLIBCXX_USE_C99_COMPLEX_MATH
+#undef _GLIBCXX_USE_C99_COMPLEX
// Define if code specialized for wchar_t should be used.
#undef _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu
index 51f1b91500f..d7d291485b6 100644
--- a/libstdc++-v3/config/linker-map.gnu
+++ b/libstdc++-v3/config/linker-map.gnu
@@ -102,6 +102,10 @@ GLIBCXX_3.4 {
# operator delete[](void*, std::nothrow_t const&)
_ZdaPvRKSt9nothrow_t;
+ # std::basic_iostream constructors, destructors
+ _ZNSdC*;
+ _ZNSdD*;
+
# std::locale destructors
_ZNSt6localeD*;
@@ -406,3 +410,9 @@ CXXABI_1.3 {
local:
*;
};
+
+CXXABI_1.3.1 {
+
+ __cxa_get_exception_ptr;
+
+} CXXABI_1.3;
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 2d5016a374a..4b59bfe6916 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -8633,7 +8633,7 @@ echo "${ECHO_T}$ac_c99_complex" >&6
if test x"$ac_c99_complex" = x"yes"; then
cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_COMPLEX_MATH 1
+#define _GLIBCXX_USE_C99_COMPLEX 1
_ACEOF
fi
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 3fa1dd65e77..24da787ece4 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -229,10 +229,15 @@ tr1_builddir = ./tr1
tr1_headers = \
${tr1_srcdir}/array \
${tr1_srcdir}/functional \
+ ${tr1_srcdir}/functional_iterate.h \
+ ${tr1_srcdir}/memory \
${tr1_srcdir}/tuple \
${tr1_srcdir}/utility \
${tr1_srcdir}/type_traits \
- ${tr1_srcdir}/type_traits_fwd.h
+ ${tr1_srcdir}/type_traits_fwd.h \
+ ${tr1_srcdir}/hashtable \
+ ${tr1_srcdir}/unordered_set \
+ ${tr1_srcdir}/unordered_map
# This is the common subset of files that all three "C" header models use.
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index d56d35aab7f..b7d8a2acef6 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -445,10 +445,15 @@ tr1_builddir = ./tr1
tr1_headers = \
${tr1_srcdir}/array \
${tr1_srcdir}/functional \
+ ${tr1_srcdir}/functional_iterate.h \
+ ${tr1_srcdir}/memory \
${tr1_srcdir}/tuple \
${tr1_srcdir}/utility \
${tr1_srcdir}/type_traits \
- ${tr1_srcdir}/type_traits_fwd.h
+ ${tr1_srcdir}/type_traits_fwd.h \
+ ${tr1_srcdir}/hashtable \
+ ${tr1_srcdir}/unordered_set \
+ ${tr1_srcdir}/unordered_map
# This is the common subset of files that all three "C" header models use.
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 3bdce0f090a..41db0dff438 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -1,6 +1,6 @@
// Components for manipulating sequences of characters -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -425,10 +425,6 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_M_destroy(const _Alloc& __a) throw ()
{
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
- if (this == &_S_empty_rep())
- return;
-#endif
const size_type __size = sizeof(_Rep_base) +
(this->_M_capacity + 1) * sizeof(_CharT);
_Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size);
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index bf06d23e8fe..0fc2f216b01 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -35,7 +35,7 @@
#include <bits/os_defines.h>
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCXX__ 20050203
+#define __GLIBCXX__ 20050226
// Allow use of "export template." This is currently not a feature
// that g++ supports.
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index 922ee21084a..152170eb0a6 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -690,7 +690,7 @@ namespace std
mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
mutable char _M_narrow_ok; // 0 uninitialized, 1 init,
- // 2 non-consecutive
+ // 2 memcpy can't be used
public:
/// The facet id for ctype<char>
@@ -865,7 +865,8 @@ namespace std
char_type
widen(char __c) const
{
- if (_M_widen_ok) return _M_widen[static_cast<unsigned char>(__c)];
+ if (_M_widen_ok)
+ return _M_widen[static_cast<unsigned char>(__c)];
this->_M_widen_init();
return this->do_widen(__c);
}
@@ -896,7 +897,8 @@ namespace std
memcpy(__to, __lo, __hi - __lo);
return __hi;
}
- if (!_M_widen_ok) _M_widen_init();
+ if (!_M_widen_ok)
+ _M_widen_init();
return this->do_widen(__lo, __hi, __to);
}
@@ -924,7 +926,8 @@ namespace std
if (_M_narrow[static_cast<unsigned char>(__c)])
return _M_narrow[static_cast<unsigned char>(__c)];
const char __t = do_narrow(__c, __dfault);
- if (__t != __dfault) _M_narrow[static_cast<unsigned char>(__c)] = __t;
+ if (__t != __dfault)
+ _M_narrow[static_cast<unsigned char>(__c)] = __t;
return __t;
}
@@ -954,7 +957,7 @@ namespace std
narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char *__to) const
{
- if (__builtin_expect(_M_narrow_ok == 1,true))
+ if (__builtin_expect(_M_narrow_ok == 1, true))
{
memcpy(__to, __lo, __hi - __lo);
return __hi;
@@ -1161,17 +1164,13 @@ namespace std
_M_widen_ok = 1;
// Set _M_widen_ok to 2 if memcpy can't be used.
- for (size_t __j = 0; __j < sizeof(_M_widen); ++__j)
- if (__tmp[__j] != _M_widen[__j])
- {
- _M_widen_ok = 2;
- break;
- }
+ if (memcmp(__tmp, _M_widen, sizeof(_M_widen)))
+ _M_widen_ok = 2;
}
// Fill in the narrowing cache and flag whether all values are
- // valid or not. _M_narrow_ok is set to 1 if the whole table is
- // narrowed, 2 if only some values could be narrowed.
+ // valid or not. _M_narrow_ok is set to 2 if memcpy can't
+ // be used.
void _M_narrow_init() const
{
char __tmp[sizeof(_M_narrow)];
@@ -1179,21 +1178,18 @@ namespace std
__tmp[__i] = __i;
do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
- // Check if any default values were created. Do this by
- // renarrowing with a different default value and comparing.
- bool __consecutive = true;
- for (size_t __j = 0; __j < sizeof(_M_narrow); ++__j)
- if (!_M_narrow[__j])
- {
- char __c;
- do_narrow(__tmp + __j, __tmp + __j + 1, 1, &__c);
- if (__c == 1)
- {
- __consecutive = false;
- break;
- }
- }
- _M_narrow_ok = __consecutive ? 1 : 2;
+ _M_narrow_ok = 1;
+ if (memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
+ _M_narrow_ok = 2;
+ else
+ {
+ // Deal with the special case of zero: renarrow with a
+ // different default and compare.
+ char __c;
+ do_narrow(__tmp, __tmp + 1, 1, &__c);
+ if (__c == 1)
+ _M_narrow_ok = 2;
+ }
}
};
diff --git a/libstdc++-v3/include/c_std/std_cmath.h b/libstdc++-v3/include/c_std/std_cmath.h
index 5aefe0ff8ac..1dd6c732ab1 100644
--- a/libstdc++-v3/include/c_std/std_cmath.h
+++ b/libstdc++-v3/include/c_std/std_cmath.h
@@ -350,15 +350,15 @@ namespace std
inline double
pow(double __x, int __i)
- { return __pow_helper(__x, __i); }
+ { return __builtin_powi(__x, __i); }
inline float
pow(float __x, int __n)
- { return __pow_helper(__x, __n); }
+ { return __builtin_powif(__x, __n); }
inline long double
pow(long double __x, int __n)
- { return __pow_helper(__x, __n); }
+ { return __builtin_powil(__x, __n); }
using ::sin;
diff --git a/libstdc++-v3/include/std/std_complex.h b/libstdc++-v3/include/std/std_complex.h
index 1a5c6a0a259..fb8122cfcad 100644
--- a/libstdc++-v3/include/std/std_complex.h
+++ b/libstdc++-v3/include/std/std_complex.h
@@ -561,7 +561,7 @@ namespace std
return __s * sqrt(__x * __x + __y * __y);
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline float
__complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
@@ -588,7 +588,7 @@ namespace std
__complex_arg(const complex<_Tp>& __z)
{ return atan2(__z.imag(), __z.real()); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline float
__complex_arg(__complex__ float __z) { return __builtin_cargf(__z); }
@@ -666,7 +666,7 @@ namespace std
return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); }
@@ -696,7 +696,7 @@ namespace std
return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); }
@@ -722,7 +722,7 @@ namespace std
__complex_exp(const complex<_Tp>& __z)
{ return std::polar(exp(__z.real()), __z.imag()); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); }
@@ -782,7 +782,7 @@ namespace std
return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_sin(__complex__ float __z) { return __builtin_csinf(__z); }
@@ -812,7 +812,7 @@ namespace std
return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
@@ -856,7 +856,7 @@ namespace std
}
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); }
@@ -883,7 +883,7 @@ namespace std
__complex_tan(const complex<_Tp>& __z)
{ return std::sin(__z) / std::cos(__z); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); }
@@ -911,7 +911,7 @@ namespace std
__complex_tanh(const complex<_Tp>& __z)
{ return std::sinh(__z) / std::cosh(__z); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); }
@@ -956,7 +956,7 @@ namespace std
__complex_pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_pow(__complex__ float __x, __complex__ float __y)
{ return __builtin_cpowf(__x, __y); }
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional
index 1e897e2b3c7..1a958c35391 100644
--- a/libstdc++-v3/include/tr1/functional
+++ b/libstdc++-v3/include/tr1/functional
@@ -1,6 +1,6 @@
// TR1 functional header -*- C++ -*-
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 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
@@ -18,14 +18,28 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-/** @file
- * This is a TR1 C++ Library header.
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file 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 General Public License.
+
+/** @file
+ * This is a TR1 C++ Library header.
*/
#ifndef _TR1_FUNCTIONAL
#define _TR1_FUNCTIONAL 1
#include "../functional"
+#include <typeinfo>
+#include <tr1/type_traits>
+#include "../bits/cpp_type_traits.h"
+#include <string> // for std::tr1::hash
+#include <cstdlib> // for std::abort
namespace std
{
@@ -39,32 +53,32 @@ namespace tr1
typedef _Tp type;
explicit reference_wrapper(_Tp& __indata): _M_data(&__indata)
{ }
-
+
reference_wrapper(const reference_wrapper<_Tp>& __inref):
_M_data(__inref._M_data)
{ }
- reference_wrapper&
+ reference_wrapper&
operator=(const reference_wrapper<_Tp>& __inref)
{
- _M_data = __inref._M_data;
- return *this;
+ _M_data = __inref._M_data;
+ return *this;
}
-
+
operator _Tp&() const
{ return this->get(); }
-
+
_Tp&
get() const
{ return *_M_data; }
};
-
+
// Denotes a reference should be taken to a variable.
template<typename _Tp>
reference_wrapper<_Tp>
ref(_Tp& __t)
{ return reference_wrapper<_Tp>(__t); }
-
+
// Denotes a const reference should be taken to a variable.
template<typename _Tp>
reference_wrapper<const _Tp>
@@ -78,8 +92,1041 @@ namespace tr1
template<typename _Tp>
reference_wrapper<const _Tp> cref(reference_wrapper<_Tp> __t)
{ return cref(__t.get()); }
+
+ template<typename _MemberPointer>
+ class _Mem_fn;
+
+ template<typename _Tp, bool>
+ struct _Mem_fn_const_or_non
+ {
+ typedef const _Tp& type;
+ };
+
+ template<typename _Tp>
+ struct _Mem_fn_const_or_non<_Tp, false>
+ {
+ typedef _Tp& type;
+ };
+
+ template<typename _Res, typename _Class>
+ class _Mem_fn<_Res _Class::*>
+ {
+ // This bit of genius is due to Peter Dimov, improved slightly by
+ // Douglas Gregor.
+ template<typename _Tp>
+ _Res&
+ _M_call(_Tp& __object, _Class *) const
+ { return __object.*__pm; }
+
+ template<typename _Tp, typename _Up>
+ _Res&
+ _M_call(_Tp& __object, _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template<typename _Tp, typename _Up>
+ const _Res&
+ _M_call(_Tp& __object, const _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template<typename _Tp>
+ const _Res&
+ _M_call(_Tp& __object, const _Class *) const
+ { return __object.*__pm; }
+
+ template<typename _Tp>
+ const _Res&
+ _M_call(_Tp& __ptr, const volatile void*) const
+ { return (*__ptr).*__pm; }
+
+ template<typename _Tp> static _Tp& __get_ref();
+
+ template<typename _Tp>
+ static __sfinae_types::__one __check_const(_Tp&, _Class*);
+ template<typename _Tp, typename _Up>
+ static __sfinae_types::__one __check_const(_Tp&, _Up * const *);
+ template<typename _Tp, typename _Up>
+ static __sfinae_types::__two __check_const(_Tp&, const _Up * const *);
+ template<typename _Tp>
+ static __sfinae_types::__two __check_const(_Tp&, const _Class*);
+ template<typename _Tp>
+ static __sfinae_types::__two __check_const(_Tp&, const volatile void*);
+
+ template<typename _Tp>
+ struct _Result_type
+ : _Mem_fn_const_or_non<
+ _Res,
+ (sizeof(__sfinae_types::__two)
+ == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))>
+ { };
+
+ public:
+ explicit _Mem_fn(_Res _Class::*__pm) : __pm(__pm) { }
+
+ // Handle objects
+ _Res& operator()(_Class& __object) const
+ { return __object.*__pm; }
+
+ const _Res& operator()(const _Class& __object) const
+ { return __object.*__pm; }
+
+ // Handle pointers
+ _Res& operator()(_Class* __object) const
+ { return __object->*__pm; }
+
+ const _Res&
+ operator()(const _Class* __object) const
+ { return __object->*__pm; }
+
+ // Handle smart pointers and derived
+ template<typename _Tp>
+ typename _Result_type<_Tp>::type
+ operator()(_Tp& __unknown) const
+ { return _M_call(__unknown, &__unknown); }
+
+ private:
+ _Res _Class::*__pm;
+ };
+
+ /**
+ * @brief Returns a function object that forwards to the member
+ * pointer @a pm.
+ */
+ template<typename _Tp, typename _Class>
+ inline _Mem_fn<_Tp _Class::*>
+ mem_fn(_Tp _Class::* __pm)
+ {
+ return _Mem_fn<_Tp _Class::*>(__pm);
+ }
+
+ /**
+ * @brief Exception class thrown when class template function's
+ * operator() is called with an empty target.
+ *
+ */
+ class bad_function_call : public std::exception { };
+
+ /**
+ * @if maint
+ * The integral constant expression 0 can be converted into a
+ * pointer to this type. It is used by the function template to
+ * accept NULL pointers.
+ * @endif
+ */
+ struct _M_clear_type;
+
+ /**
+ * @if maint
+ * Trait identifying "location-invariant" types, meaning that the
+ * address of the object (or any of its members) will not escape.
+ * Also implies a trivial copy constructor and assignment operator.
+ * @endif
+ */
+ template<typename _Tp>
+ struct __is_location_invariant
+ : integral_constant<bool,
+ (is_pointer<_Tp>::value
+ || is_member_pointer<_Tp>::value)>
+ {
+ };
+
+ class _Undefined_class;
+
+ union _Nocopy_types
+ {
+ void* _M_object;
+ const void* _M_const_object;
+ void (*_M_function_pointer)();
+ void (_Undefined_class::*_M_member_pointer)();
+ };
+
+ union _Any_data {
+ void* _M_access() { return &_M_pod_data[0]; }
+ const void* _M_access() const { return &_M_pod_data[0]; }
+
+ template<typename _Tp> _Tp& _M_access()
+ { return *static_cast<_Tp*>(_M_access()); }
+
+ template<typename _Tp> const _Tp& _M_access() const
+ { return *static_cast<const _Tp*>(_M_access()); }
+
+ _Nocopy_types _M_unused;
+ char _M_pod_data[sizeof(_Nocopy_types)];
+ };
+
+ enum _Manager_operation
+ {
+ __get_type_info,
+ __get_functor_ptr,
+ __clone_functor,
+ __destroy_functor
+ };
+
+ /* Simple type wrapper that helps avoid annoying const problems
+ when casting between void pointers and pointers-to-pointers. */
+ template<typename _Tp>
+ struct _Simple_type_wrapper
+ {
+ _Simple_type_wrapper(_Tp __value) : __value(__value) { }
+
+ _Tp __value;
+ };
+
+ template<typename _Tp>
+ struct __is_location_invariant<_Simple_type_wrapper<_Tp> >
+ : __is_location_invariant<_Tp>
+ {
+ };
+
+ // Converts a reference to a function object into a callable
+ // function object.
+ template<typename _Functor>
+ inline _Functor& __callable_functor(_Functor& __f) { return __f; }
+
+ template<typename _Member, typename _Class>
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* &__p)
+ { return mem_fn(__p); }
+
+ template<typename _Member, typename _Class>
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* const &__p)
+ { return mem_fn(__p); }
+
+ template<typename _Signature, typename _Functor>
+ class _Function_handler;
+
+ template<typename _Signature>
+ class function;
+
+
+ /**
+ * @if maint
+ * Base class of all polymorphic function object wrappers.
+ * @endif
+ */
+ class _Function_base
+ {
+ public:
+ static const std::size_t _M_max_size = sizeof(_Nocopy_types);
+ static const std::size_t _M_max_align = __alignof__(_Nocopy_types);
+
+ template<typename _Functor>
+ class _Base_manager
+ {
+ protected:
+ static const bool __stored_locally =
+ (__is_location_invariant<_Functor>::value
+ && sizeof(_Functor) <= _M_max_size
+ && __alignof__(_Functor) <= _M_max_align
+ && (_M_max_align % __alignof__(_Functor) == 0));
+ typedef integral_constant<bool, __stored_locally> _Local_storage;
+
+ // Retrieve a pointer to the function object
+ static _Functor* _M_get_pointer(const _Any_data& __source)
+ {
+ const _Functor* __ptr =
+ __stored_locally? &__source._M_access<_Functor>()
+ /* have stored a pointer */ : __source._M_access<_Functor*>();
+ return const_cast<_Functor*>(__ptr);
+ }
+
+ // Clone a location-invariant function object that fits within
+ // an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, true_type)
+ {
+ new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
+ }
+
+ // Clone a function object that is not location-invariant or
+ // that cannot fit into an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, false_type)
+ {
+ __dest._M_access<_Functor*>() =
+ new _Functor(*__source._M_access<_Functor*>());
+ }
+
+ // Destroying a location-invariant object may still require
+ // destruction.
+ static void
+ _M_destroy(_Any_data& __victim, true_type)
+ {
+ __victim._M_access<_Functor>().~_Functor();
+ }
+
+ // Destroying an object located on the heap.
+ static void
+ _M_destroy(_Any_data& __victim, false_type)
+ {
+ delete __victim._M_access<_Functor*>();
+ }
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op) {
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = _M_get_pointer(__source);
+ break;
+
+ case __clone_functor:
+ _M_clone(__dest, __source, _Local_storage());
+ break;
+
+ case __destroy_functor:
+ _M_destroy(__dest, _Local_storage());
+ break;
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f)
+ {
+ _M_init_functor(__functor, __f, _Local_storage());
+ }
+
+ template<typename _Signature>
+ static bool
+ _M_not_empty_function(const function<_Signature>& __f)
+ {
+ return __f;
+ }
+
+ template<typename _Tp>
+ static bool
+ _M_not_empty_function(const _Tp*& __fp)
+ {
+ return __fp;
+ }
+
+ template<typename _Class, typename _Tp>
+ static bool
+ _M_not_empty_function(_Tp _Class::* const& __mp)
+ {
+ return __mp;
+ }
+
+ template<typename _Tp>
+ static bool
+ _M_not_empty_function(const _Tp&)
+ {
+ return true;
+ }
+
+ private:
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, true_type)
+ {
+ new (__functor._M_access()) _Functor(__f);
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, false_type)
+ {
+ __functor._M_access<_Functor*>() = new _Functor(__f);
+ }
+ };
+
+ template<typename _Functor>
+ class _Ref_manager : public _Base_manager<_Functor*>
+ {
+ typedef _Function_base::_Base_manager<_Functor*> _Base;
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op) {
+ case __get_type_info:
+ __dest._M_access<const type_info*>() = &typeid(_Functor);
+ break;
+
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
+ return is_const<_Functor>::value;
+ break;
+
+ default:
+ _Base::_M_manager(__dest, __source, __op);
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, reference_wrapper<_Functor> __f)
+ {
+ // TBD: Use address_of function instead
+ _Base::_M_init_functor(__functor, &__f.get());
+ }
+ };
+
+ _Function_base() : _M_manager(0) { }
+
+ ~_Function_base()
+ {
+ if (_M_manager)
+ {
+ _M_manager(_M_functor, _M_functor, __destroy_functor);
+ }
+ }
+
+
+ bool _M_empty() const { return !_M_manager; }
+
+ typedef bool (*_Manager_type)(_Any_data&, const _Any_data&,
+ _Manager_operation);
+
+ _Any_data _M_functor;
+ _Manager_type _M_manager;
+ };
+
+#define _GLIBCXX_NUM_ARGS 0
+#define _GLIBCXX_COMMA
+#define _GLIBCXX_TEMPLATE_PARAMS
+#define _GLIBCXX_TEMPLATE_ARGS
+#define _GLIBCXX_PARAMS
+#define _GLIBCXX_ARGS
+#define _GLIBCXX_COMMA_SHIFTED
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#define _GLIBCXX_PARAMS_SHIFTED
+#define _GLIBCXX_ARGS_SHIFTED
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 1
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1
+#define _GLIBCXX_TEMPLATE_ARGS _T1
+#define _GLIBCXX_PARAMS _T1 __a1
+#define _GLIBCXX_ARGS __a1
+#define _GLIBCXX_COMMA_SHIFTED
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#define _GLIBCXX_PARAMS_SHIFTED
+#define _GLIBCXX_ARGS_SHIFTED
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 2
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2
+#define _GLIBCXX_ARGS __a1, __a2
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1
+#define _GLIBCXX_ARGS_SHIFTED __a1
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 3
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3
+#define _GLIBCXX_ARGS __a1, __a2, __a3
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 4
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 5
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 6
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 7
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 8
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 9
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 10
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 11
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 12
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 13
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 14
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 15
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 16
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 17
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 18
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 19
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18, typename _T19
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18, _T19
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18, _T19 __a19
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18, __a19
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+#define _GLIBCXX_NUM_ARGS 20
+#define _GLIBCXX_COMMA ,
+#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18, typename _T19, typename _T20
+#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18, _T19, _T20
+#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18, _T19 __a19, _T20 __a20
+#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18, __a19, __a20
+#define _GLIBCXX_COMMA_SHIFTED ,
+#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18, typename _T19
+#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18, _T19
+#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18, _T19 __a19
+#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18, __a19
+#include <tr1/functional_iterate.h>
+#undef _GLIBCXX_ARGS_SHIFTED
+#undef _GLIBCXX_PARAMS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED
+#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED
+#undef _GLIBCXX_COMMA_SHIFTED
+#undef _GLIBCXX_ARGS
+#undef _GLIBCXX_PARAMS
+#undef _GLIBCXX_TEMPLATE_ARGS
+#undef _GLIBCXX_TEMPLATE_PARAMS
+#undef _GLIBCXX_COMMA
+#undef _GLIBCXX_NUM_ARGS
+
+ // [3.7.2.7] null pointer comparisons
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c true if the wrapper has no target, @c false otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline bool
+ operator==(const function<_Signature>& __f, _M_clear_type*)
+ {
+ return !__f;
+ }
+
+ /**
+ * @overload
+ */
+ template<typename _Signature>
+ inline bool
+ operator==(_M_clear_type*, const function<_Signature>& __f)
+ {
+ return !__f;
+ }
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c false if the wrapper has no target, @c true otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline bool
+ operator!=(const function<_Signature>& __f, _M_clear_type*)
+ {
+ return __f;
+ }
+
+ /**
+ * @overload
+ */
+ template<typename _Signature>
+ inline bool
+ operator!=(_M_clear_type*, const function<_Signature>& __f)
+ {
+ return __f;
+ }
+
+ // [3.7.2.8] specialized algorithms
+
+ /**
+ * @brief Swap the targets of two polymorphic function object wrappers.
+ *
+ * This function will not throw an exception.
+ */
+ template<typename _Signature>
+ inline void
+ swap(function<_Signature>& __x, function<_Signature>& __y)
+ {
+ __x.swap(__y);
+ }
+
+
+// Definition of default hash function std::tr1::hash<>. The types for
+// which std::tr1::hash<T> is defined is in clause 6.3.3. of the PDTR.
+
+ template <typename T> struct hash;
+
+ #define tr1_hashtable_define_trivial_hash(T) \
+ template <> struct hash<T> { \
+ std::size_t operator()(T val) const { return static_cast<std::size_t>(val); } \
+ } \
+
+ tr1_hashtable_define_trivial_hash(bool);
+ tr1_hashtable_define_trivial_hash(char);
+ tr1_hashtable_define_trivial_hash(signed char);
+ tr1_hashtable_define_trivial_hash(unsigned char);
+ tr1_hashtable_define_trivial_hash(wchar_t);
+ tr1_hashtable_define_trivial_hash(short);
+ tr1_hashtable_define_trivial_hash(int);
+ tr1_hashtable_define_trivial_hash(long);
+ tr1_hashtable_define_trivial_hash(unsigned short);
+ tr1_hashtable_define_trivial_hash(unsigned int);
+ tr1_hashtable_define_trivial_hash(unsigned long);
+
+ tr1_hashtable_define_trivial_hash(float);
+ tr1_hashtable_define_trivial_hash(double);
+ tr1_hashtable_define_trivial_hash(long double);
+
+ #undef tr1_hashtable_define_trivial_hash
+
+ template <typename T>
+ struct hash<T*> {
+ std::size_t operator()(T* p) const {
+ return reinterpret_cast<std::size_t>(p);
+ }
+ };
+
+ // ??? We can probably find a better hash function than this (i.e. one
+ // that vectorizes better and that produces a more uniform distribution).
+
+ // XXX String hash probably shouldn't be an inline member function,
+ // since it's nontrivial. Once we have the framework for TR1 .cc
+ // files, this should go in one.
+
+ template <>
+ struct hash<std::string>
+ {
+ std::size_t operator()(const std::string& s) const
+ {
+ std::size_t result = 0;
+ for (std::string::const_iterator i = s.begin(); i != s.end(); ++i)
+ result = (result * 131) + *i;
+ return result;
+ }
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template <>
+ struct hash<std::wstring>
+ {
+ std::size_t operator()(const std::wstring& s) const
+ {
+ std::size_t result = 0;
+ for (std::wstring::const_iterator i = s.begin(); i != s.end(); ++i)
+ result = (result * 131) + *i;
+ return result;
+ }
+ };
+#endif
+
}
}
#endif
-
diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple
index 928c75f88cf..b3fed8ad6d6 100644
--- a/libstdc++-v3/include/tr1/tuple
+++ b/libstdc++-v3/include/tr1/tuple
@@ -1,6 +1,6 @@
// class template tuple -*- C++ -*-
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 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
@@ -18,6 +18,15 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file 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 General Public License.
+
/** @file
* This is a TR1 C++ Library header.
*/
diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits
index 12609dd41b4..240542151e4 100644
--- a/libstdc++-v3/include/tr1/type_traits
+++ b/libstdc++-v3/include/tr1/type_traits
@@ -18,6 +18,15 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file 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 General Public License.
+
/** @file
* This is a TR1 C++ Library header.
*/
@@ -151,262 +160,31 @@ namespace tr1
_DEFINE_SPEC(2, is_member_object_pointer, _Tp _Cp::*,
!is_function<_Tp>::value)
- // Due to c++/19076, for the time being we cannot use the correct, neat
- // implementation :-(
- //
- // template<typename>
- // struct is_member_function_pointer
- // : public false_type { };
- // _DEFINE_SPEC(2, is_member_function_pointer, _Tp _Cp::*,
- // is_function<_Tp>::value)
- //
- // Temporary workaround for member functions with up to 15 arguments:
template<typename>
- struct __is_mfp_helper
- { static const bool __value = false; };
-
- template<typename _Rt, typename _Cp>
- struct __is_mfp_helper<_Rt (_Cp::*) ()>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp>
- struct __is_mfp_helper<_Rt (_Cp::*) (...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11,
- typename _A12>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11, _A12)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11,
- typename _A12>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11, _A12, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11,
- typename _A12, typename _A13>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11, _A12,
- _A13)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11,
- typename _A12, typename _A13>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11, _A12,
- _A13, ...)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11,
- typename _A12, typename _A13, typename _A14>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11, _A12,
- _A13, _A14)>
- { static const bool __value = true; };
-
- template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
- typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
- typename _A8, typename _A9, typename _A10, typename _A11,
- typename _A12, typename _A13, typename _A14>
- struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
- _A7, _A8, _A9, _A10, _A11, _A12,
- _A13, _A14, ...)>
- { static const bool __value = true; };
+ struct is_member_function_pointer
+ : public false_type { };
+ _DEFINE_SPEC(2, is_member_function_pointer, _Tp _Cp::*,
+ is_function<_Tp>::value)
template<typename _Tp>
- struct is_member_function_pointer
- : public integral_constant<bool, (__is_mfp_helper<typename
- remove_cv<_Tp>::type>::__value)>
+ struct is_enum
+ : public integral_constant<bool, !(is_fundamental<_Tp>::value
+ || is_array<_Tp>::value
+ || is_pointer<_Tp>::value
+ || is_reference<_Tp>::value
+ || is_member_pointer<_Tp>::value
+ || is_function<_Tp>::value
+ || __is_union_or_class<_Tp>::value)>
{ };
- template<typename _Tp, bool = (is_fundamental<_Tp>::value
- || is_array<_Tp>::value
- || is_pointer<_Tp>::value
- || is_reference<_Tp>::value
- || is_member_pointer<_Tp>::value
- || is_function<_Tp>::value)>
- struct __is_enum_helper
- : public __sfinae_types
- {
- private:
- static __one __test(bool);
- static __one __test(char);
- static __one __test(signed char);
- static __one __test(unsigned char);
-#ifdef _GLIBCXX_USE_WCHAR_T
- static __one __test(wchar_t);
-#endif
- static __one __test(short);
- static __one __test(unsigned short);
- static __one __test(int);
- static __one __test(unsigned int);
- static __one __test(long);
- static __one __test(unsigned long);
- static __one __test(long long);
- static __one __test(unsigned long long);
- static __two __test(...);
-
- struct __convert
- { operator _Tp() const; };
-
- public:
- static const bool __value = sizeof(__test(__convert())) == 1;
- };
-
- template<typename _Tp>
- struct __is_enum_helper<_Tp, true>
- { static const bool __value = false; };
+ template<typename>
+ struct is_union { };
- template<typename _Tp>
- struct is_enum
- : public integral_constant<bool, __is_enum_helper<_Tp>::__value> { };
+ template<typename>
+ struct is_class { };
- template<typename _Tp, bool = is_void<_Tp>::value>
+ template<typename _Tp, bool = (is_void<_Tp>::value
+ || is_reference<_Tp>::value)>
struct __is_function_helper
{
static const bool __value = (__conv_helper<typename
@@ -461,6 +239,26 @@ namespace tr1
(is_member_object_pointer<_Tp>::value
|| is_member_function_pointer<_Tp>::value)>
{ };
+
+ template<typename _Tp>
+ struct __is_union_or_class_helper
+ : public __sfinae_types
+ {
+ private:
+ template<typename _Up>
+ static __one __test(int _Up::*);
+ template<typename>
+ static __two __test(...);
+
+ public:
+ static const bool __value = sizeof(__test<_Tp>(0)) == 1;
+ };
+
+ // Extension.
+ template<typename _Tp>
+ struct __is_union_or_class
+ : public integral_constant<bool, __is_union_or_class_helper<_Tp>::__value>
+ { };
/// @brief type properties [4.5.3].
template<typename>
@@ -486,26 +284,21 @@ namespace tr1
remove_all_extents<_Tp>::type>::value)>
{ };
- template<typename>
- struct __is_empty_helper_1
- { };
-
- template<typename _Tp>
- struct __is_empty_helper_2
- : public _Tp { };
-
- // Unfortunately, without compiler support we cannot tell union from
- // class types, and is_empty doesn't work at all with the former.
- template<typename _Tp, bool = (is_fundamental<_Tp>::value
- || is_array<_Tp>::value
- || is_pointer<_Tp>::value
- || is_reference<_Tp>::value
- || is_member_pointer<_Tp>::value
- || is_enum<_Tp>::value
- || is_function<_Tp>::value)>
+ // N.B. Without compiler support we cannot tell union from class types,
+ // and is_empty doesn't work at all with the former.
+ template<typename _Tp, bool = !__is_union_or_class<_Tp>::value>
struct __is_empty_helper
- { static const bool __value = (sizeof(__is_empty_helper_1<_Tp>)
- == sizeof(__is_empty_helper_2<_Tp>)); };
+ {
+ private:
+ template<typename>
+ struct __ebo_1 { };
+ template<typename _Up>
+ struct __ebo_2
+ : public _Up { };
+
+ public:
+ static const bool __value = sizeof(__ebo_1<_Tp>) == sizeof(__ebo_2<_Tp>);
+ };
template<typename _Tp>
struct __is_empty_helper<_Tp, true>
@@ -638,6 +431,39 @@ namespace tr1
struct is_same<_Tp, _Tp>
: public true_type { };
+ template<typename _Tp>
+ struct __is_int_or_cref
+ {
+ typedef typename remove_reference<_Tp>::type __rr_Tp;
+ static const bool __value = (is_integral<_Tp>::value
+ || (is_integral<__rr_Tp>::value
+ && is_const<__rr_Tp>::value
+ && !is_volatile<__rr_Tp>::value));
+ };
+
+ template<typename _From, typename _To,
+ bool = (is_function<_To>::value || is_array<_To>::value
+ // This special case is here only to avoid warnings.
+ || (is_floating_point<typename
+ remove_reference<_From>::type>::value
+ && __is_int_or_cref<_To>::__value))>
+ struct __is_convertible_helper
+ {
+ // "An imaginary lvalue of type From...".
+ static const bool __value = (__conv_helper<typename
+ add_reference<_From>::type, _To>::__value);
+ };
+
+ template<typename _From, typename _To>
+ struct __is_convertible_helper<_From, _To, true>
+ { static const bool __value = __is_int_or_cref<_To>::__value; };
+
+ template<typename _From, typename _To>
+ struct is_convertible
+ : public integral_constant<bool,
+ __is_convertible_helper<_From, _To>::__value>
+ { };
+
/// @brief const-volatile modifications [4.7.1].
template<typename _Tp>
struct remove_const
diff --git a/libstdc++-v3/include/tr1/type_traits_fwd.h b/libstdc++-v3/include/tr1/type_traits_fwd.h
index 46beade5819..2d25d9b4c14 100644
--- a/libstdc++-v3/include/tr1/type_traits_fwd.h
+++ b/libstdc++-v3/include/tr1/type_traits_fwd.h
@@ -18,6 +18,15 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file 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 General Public License.
+
/** @file type_traits_fwd.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
@@ -94,6 +103,10 @@ namespace tr1
template<typename _Tp>
struct is_member_pointer;
+
+ // Extension.
+ template<typename _Tp>
+ struct __is_union_or_class;
/// @brief type properties [4.5.3].
template<typename _Tp>
diff --git a/libstdc++-v3/include/tr1/utility b/libstdc++-v3/include/tr1/utility
index 6a74dfaf4d8..645edb6592f 100644
--- a/libstdc++-v3/include/tr1/utility
+++ b/libstdc++-v3/include/tr1/utility
@@ -18,6 +18,15 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file 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 General Public License.
+
/** @file
* This is a TR1 C++ Library header.
*/
diff --git a/libstdc++-v3/libsupc++/del_op.cc b/libstdc++-v3/libsupc++/del_op.cc
index d76e888e755..8f0b3f85b43 100644
--- a/libstdc++-v3/libsupc++/del_op.cc
+++ b/libstdc++-v3/libsupc++/del_op.cc
@@ -29,8 +29,10 @@
// the GNU General Public License.
#include "new"
-#include <cstdlib>
#include <bits/c++config.h>
+#if _GLIBCXX_HOSTED
+#include <cstdlib>
+#endif
#if _GLIBCXX_HOSTED
using std::free;
diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc
index 4728bcbf380..3b7319ea235 100644
--- a/libstdc++-v3/libsupc++/eh_alloc.cc
+++ b/libstdc++-v3/libsupc++/eh_alloc.cc
@@ -147,6 +147,12 @@ __cxxabiv1::__cxa_allocate_exception(std::size_t thrown_size) throw()
std::terminate ();
}
+ // We have an uncaught exception as soon as we allocate memory. This
+ // yields uncaught_exception() true during the copy-constructor that
+ // initializes the exception object. See Issue 475.
+ __cxa_eh_globals *globals = __cxa_get_globals ();
+ globals->uncaughtExceptions += 1;
+
memset (ret, 0, sizeof (__cxa_exception));
return (void *)((char *)ret + sizeof (__cxa_exception));
diff --git a/libstdc++-v3/libsupc++/eh_catch.cc b/libstdc++-v3/libsupc++/eh_catch.cc
index bdcbd7e085c..ba4b7d75f48 100644
--- a/libstdc++-v3/libsupc++/eh_catch.cc
+++ b/libstdc++-v3/libsupc++/eh_catch.cc
@@ -33,6 +33,15 @@
using namespace __cxxabiv1;
+extern "C" void *
+__cxxabiv1::__cxa_get_exception_ptr(void *exc_obj_in) throw()
+{
+ _Unwind_Exception *exceptionObject
+ = reinterpret_cast <_Unwind_Exception *>(exc_obj_in);
+ __cxa_exception *header = __get_exception_header_from_ue (exceptionObject);
+
+ return header->adjustedPtr;
+}
extern "C" void *
__cxxabiv1::__cxa_begin_catch (void *exc_obj_in) throw()
@@ -61,15 +70,14 @@ __cxxabiv1::__cxa_begin_catch (void *exc_obj_in) throw()
}
int count = header->handlerCount;
+ // Count is less than zero if this exception was rethrown from an
+ // immediately enclosing region.
if (count < 0)
- // This exception was rethrown from an immediately enclosing region.
count = -count + 1;
else
- {
- count += 1;
- globals->uncaughtExceptions -= 1;
- }
+ count += 1;
header->handlerCount = count;
+ globals->uncaughtExceptions -= 1;
if (header != prev)
{
@@ -107,10 +115,7 @@ __cxxabiv1::__cxa_end_catch ()
// This exception was rethrown. Decrement the (inverted) catch
// count and remove it from the chain when it reaches zero.
if (++count == 0)
- {
- globals->uncaughtExceptions += 1;
- globals->caughtExceptions = header->nextException;
- }
+ globals->caughtExceptions = header->nextException;
}
else if (--count == 0)
{
diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
index b02efdad6dc..0807c5e1df7 100644
--- a/libstdc++-v3/libsupc++/eh_throw.cc
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -66,9 +66,6 @@ __cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
header->unwindHeader.exception_class = __gxx_exception_class;
header->unwindHeader.exception_cleanup = __gxx_exception_cleanup;
- __cxa_eh_globals *globals = __cxa_get_globals ();
- globals->uncaughtExceptions += 1;
-
#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
_Unwind_SjLj_RaiseException (&header->unwindHeader);
#else
@@ -86,6 +83,8 @@ __cxxabiv1::__cxa_rethrow ()
__cxa_eh_globals *globals = __cxa_get_globals ();
__cxa_exception *header = globals->caughtExceptions;
+ globals->uncaughtExceptions += 1;
+
// Watch for luser rethrowing with no active exception.
if (header)
{
diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h
index 67ea5cc2110..e79dd83628e 100644
--- a/libstdc++-v3/libsupc++/unwind-cxx.h
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -107,6 +107,7 @@ extern "C" void __cxa_throw (void *thrown_exception,
__attribute__((noreturn));
// Used to implement exception handlers.
+extern "C" void *__cxa_get_exception_ptr (void *) throw();
extern "C" void *__cxa_begin_catch (void *) throw();
extern "C" void __cxa_end_catch ();
extern "C" void __cxa_rethrow () __attribute__((noreturn));
diff --git a/libstdc++-v3/scripts/check_performance b/libstdc++-v3/scripts/check_performance
index b395fcb14e0..f5d2351d837 100755
--- a/libstdc++-v3/scripts/check_performance
+++ b/libstdc++-v3/scripts/check_performance
@@ -32,42 +32,50 @@ SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc \
-Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
ST_FLAG="-static"
LINK=$SH_FLAG
-CXX="$COMPILER $INCLUDES $PCH_FLAGS $FLAGS -DNOTHREAD $LINK"
-CXX_THREAD="$COMPILER $INCLUDES $PCH_FLAGS $FLAGS $THREAD_FLAG $LINK"
-
-
+CXX="$COMPILER $INCLUDES $PCH_FLAGS $FLAGS $LINK"
TESTS_FILE="testsuite_files_performance"
for NAME in `cat $TESTS_FILE`
do
RUN=true
+
+ # TEST_S == single thread
+ # TEST_B == do both single and multi-thread
+ # TEST_T == multi-thread
for CYCLE in `sed -n 's,.*\(TEST_[SB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
do
RUN=false
echo $NAME $CYCLE
FILE_NAME="`basename $NAME`"
- EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
- $CXX -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
- ./$EXE_NAME
- echo ""
+ FILE_NAME="`echo $FILE_NAME | sed 's/.cc//g'`"
+ EXE_NAME="`echo $FILE_NAME-$CYCLE.exe`"
+ $CXX -DNOTHREAD -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
+ if [ -f $EXE_NAME ]; then
+ ./$EXE_NAME
+ fi
done
+
for CYCLE in `sed -n 's,.*\(TEST_[TB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
do
RUN=false
- echo $NAME $CYCLE THREAD
+ echo $NAME $CYCLE thread
FILE_NAME="`basename $NAME`"
- EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
- $CXX_THREAD -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
- ./$EXE_NAME
- echo ""
+ FILE_NAME="`echo $FILE_NAME | sed 's/.cc//g'`"
+ EXE_NAME="`echo $FILE_NAME-$CYCLE.exe`"
+ $CXX $THREAD_FLAG -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
+ if [ -f $EXE_NAME ]; then
+ ./$EXE_NAME
+ fi
done
+
if $RUN; then
echo $NAME
FILE_NAME="`basename $NAME`"
EXE_NAME="`echo $FILE_NAME | sed 's/cc$/exe/'`"
$CXX $SRC_DIR/testsuite/$NAME -o $EXE_NAME
- ./$EXE_NAME
- echo ""
+ if [ -f $EXE_NAME ]; then
+ ./$EXE_NAME
+ fi
fi
done
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc
index 24b73333744..b8643e08c3f 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc
@@ -1,6 +1,6 @@
// 2003-05-04 Paolo Carlini <pcarlini@unitus.it>
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2005 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,7 +63,7 @@ bool test03(void)
// size_type find_first_not_of(const char* s, size_type pos, size_type n) const;
csz01 = str01.find_first_not_of(str_lit01, 0, 0);
VERIFY( csz01 == 0 );
- csz01 = str01.find_first_not_of(str_lit01, 0, 10);
+ csz01 = str01.find_first_not_of(str_lit01, 0, 8);
VERIFY( csz01 == 8 );
csz01 = str01.find_first_not_of(str_lit01, 10, 0);
VERIFY( csz01 == 10 );
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc
index 6964e013f30..dd27c438063 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc
@@ -1,6 +1,6 @@
// 2003-05-04 Paolo Carlini <pcarlini@unitus.it>
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2005 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,7 +63,7 @@ bool test03(void)
// size_type find_first_not_of(const char* s, size_type pos, size_type n) const;
csz01 = str01.find_first_not_of(str_lit01, 0, 0);
VERIFY( csz01 == 0 );
- csz01 = str01.find_first_not_of(str_lit01, 0, 10);
+ csz01 = str01.find_first_not_of(str_lit01, 0, 8);
VERIFY( csz01 == 8 );
csz01 = str01.find_first_not_of(str_lit01, 10, 0);
VERIFY( csz01 == 10 );
diff --git a/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc b/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc
index 69487473f3d..79486191766 100644
--- a/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 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
@@ -33,7 +33,6 @@
#include <set>
#include <sstream>
-#include <testsuite_performance.h>
using namespace std;
diff --git a/libstdc++-v3/testsuite/26_numerics/complex/13450.cc b/libstdc++-v3/testsuite/26_numerics/complex/13450.cc
index 50f4bad3b93..774dcea06bc 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex/13450.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex/13450.cc
@@ -1,3 +1,5 @@
+// { dg-do run { xfail broken_cplxf_arg } }
+
// Copyright (C) 2004 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
diff --git a/libstdc++-v3/testsuite/26_numerics/complex/complex_value.cc b/libstdc++-v3/testsuite/26_numerics/complex/complex_value.cc
index 03f26284092..17b9c0bfae3 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex/complex_value.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex/complex_value.cc
@@ -1,3 +1,4 @@
+// { dg-do run { xfail broken_cplxf_arg } }
// { dg-options "-O0" }
// 2000-11-20
// Benjamin Kosnik bkoz@redhat.com
diff --git a/libstdc++-v3/testsuite/26_numerics/complex/pow.cc b/libstdc++-v3/testsuite/26_numerics/complex/pow.cc
index 393b7a4e4f2..d0b8e901f8c 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex/pow.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex/pow.cc
@@ -1,3 +1,4 @@
+// { dg-do run { xfail broken_cplxf_arg } }
// PR libstdc++/10689
// Origin: Daniel.Levine@jhuaph.edu
// { dg-options "-mieee" { target alpha*-*-* } }
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc b/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc
index 999befe2082..f83ce050bad 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc
@@ -44,7 +44,7 @@ check(wistream& stream, const wstring& str, unsigned nchunks, wchar_t delim)
{
bool test __attribute__((unused)) = true;
- wchar_t buf[1000000];
+ static wchar_t buf[1000000];
wstring::size_type index = 0, index_new = 0;
unsigned n = 0;
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc
index 626d45c9f35..978ae203cd8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc
@@ -33,8 +33,8 @@ test03(void)
typedef wios::pos_type pos_type;
- const char* TEST_IN = "wostream_inserter_other_in";
- const char* TEST_OUT = "wostream_inserter_other_out";
+ const char* TEST_IN = "wostream_inserter_other_in.txt";
+ const char* TEST_OUT = "wostream_inserter_other_out.txt";
pos_type i_read, i_wrote, rs, ws;
double tf_size = BUFSIZ * 2.5;
ofstream testfile(TEST_IN);
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc
index e0eb8ded4cf..ad78df24b07 100644
--- a/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc
@@ -30,10 +30,10 @@ void test01()
const unsigned max_size = 1 << 18;
- wchar_t ref[max_size];
+ static wchar_t ref[max_size];
wmemset(ref, L'\0', max_size);
- wchar_t src[max_size * 2];
+ static wchar_t src[max_size * 2];
wmemset(src, L'\1', max_size * 2);
for (unsigned i = 128; i <= max_size; i *= 2)
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/01.cc b/libstdc++-v3/testsuite/demangle/abi_examples/01.cc
index e7c41e7b966..3e26eb9a659 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/01.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/01.cc
@@ -1,6 +1,6 @@
// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2005 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
@@ -31,7 +31,9 @@ int main()
// extern "C" function
// extern "C" float f(void) { };
// T f
- verify_demangle("f", "error code = -2: invalid mangled name");
+ // f is ambiguous between "C" external name and internal built-in type
+ // name. The ambiguity is resolved to the built-in type name.
+ verify_demangle("f", "float");
return 0;
}
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/02.cc b/libstdc++-v3/testsuite/demangle/abi_examples/02.cc
index bbae9381e7d..094b777f45f 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/02.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/02.cc
@@ -1,6 +1,6 @@
// 2003-02-26 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2005 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
@@ -31,7 +31,9 @@ int main()
// or variable "f"
// int f;
// B f
- verify_demangle("f", "error code = -2: invalid mangled name");
+ // f is ambiguous between variable external name and internal built-in type
+ // name. The ambiguity is resolved to the built-in type name.
+ verify_demangle("f", "float");
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/array_allocator/2.cc b/libstdc++-v3/testsuite/ext/array_allocator/2.cc
index 74b2bc9a802..f580ea250b7 100644
--- a/libstdc++-v3/testsuite/ext/array_allocator/2.cc
+++ b/libstdc++-v3/testsuite/ext/array_allocator/2.cc
@@ -1,3 +1,6 @@
+// Expected execution error for PR19495.
+// { dg-do run { xfail powerpc*-*-linux* } }
+
// Copyright (C) 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index d2996855584..0ac4196b7c3 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -47,6 +47,7 @@ load_lib dg.exp
load_lib libgloss.exp
# compiler routines, then ours
load_gcc_lib target-supports.exp
+load_gcc_lib target-supports-dg.exp
load_lib prune.exp
load_lib dg-options.exp
load_gcc_lib target-libpath.exp
diff --git a/libstdc++-v3/testsuite/testsuite_tr1.h b/libstdc++-v3/testsuite/testsuite_tr1.h
index 74a187666fd..3e9fafc434c 100644
--- a/libstdc++-v3/testsuite/testsuite_tr1.h
+++ b/libstdc++-v3/testsuite/testsuite_tr1.h
@@ -32,10 +32,10 @@
#define _GLIBCXX_TESTSUITE_TR1_H
namespace __gnu_test
-{
+{
// For tr1/type_traits.
template<template<typename> class Category,
- typename Type>
+ typename Type>
bool
test_category(bool value)
{
@@ -52,7 +52,7 @@ namespace __gnu_test
}
template<template<typename> class Property,
- typename Type>
+ typename Type>
bool
test_property(typename Property<Type>::value_type value)
{
@@ -63,7 +63,7 @@ namespace __gnu_test
}
template<template<typename> class Property,
- typename Type>
+ typename Type>
bool
test_copy_property(bool value)
{
@@ -80,7 +80,7 @@ namespace __gnu_test
}
template<template<typename> class Property,
- typename Type>
+ typename Type>
bool
test_assign_property(bool value)
{
@@ -97,7 +97,7 @@ namespace __gnu_test
}
template<template<typename, typename> class Relationship,
- typename Type1, typename Type2>
+ typename Type1, typename Type2>
bool
test_relationship(bool value)
{
@@ -113,6 +113,8 @@ namespace __gnu_test
typedef volatile ClassType vClassType;
typedef const volatile ClassType cvClassType;
+ class DerivedType : public ClassType { };
+
enum EnumType { };
struct ConvType
@@ -120,7 +122,70 @@ namespace __gnu_test
class AbstractClass
{ virtual void rotate(int) = 0; };
+
+ union UnionType { };
+
+
+ int truncate_float(float x) { return (int)x; }
+ long truncate_double(double x) { return (long)x; }
+
+ struct do_truncate_float_t
+ {
+ do_truncate_float_t()
+ {
+ ++live_objects;
+ }
+
+ do_truncate_float_t(const do_truncate_float_t&)
+ {
+ ++live_objects;
+ }
+
+ ~do_truncate_float_t()
+ {
+ --live_objects;
+ }
+
+ int operator()(float x) { return (int)x; }
+
+ static int live_objects;
+ };
+
+ int do_truncate_float_t::live_objects = 0;
+
+ struct do_truncate_double_t
+ {
+ do_truncate_double_t()
+ {
+ ++live_objects;
+ }
+
+ do_truncate_double_t(const do_truncate_double_t&)
+ {
+ ++live_objects;
+ }
+
+ ~do_truncate_double_t()
+ {
+ --live_objects;
+ }
+
+ long operator()(double x) { return (long)x; }
+
+ static int live_objects;
+ };
+
+ int do_truncate_double_t::live_objects = 0;
+ struct X
+ {
+ int bar;
+
+ int foo() { return 1; }
+ int foo_c() const { return 2; }
+ int foo_v() volatile { return 3; }
+ int foo_cv() const volatile { return 4; }
+ };
}; // namespace __gnu_test
#endif // _GLIBCXX_TESTSUITE_TR1_H
diff --git a/libstdc++-v3/testsuite/thread/pthread1.cc b/libstdc++-v3/testsuite/thread/pthread1.cc
index 26d198a755e..f83e20595af 100644
--- a/libstdc++-v3/testsuite/thread/pthread1.cc
+++ b/libstdc++-v3/testsuite/thread/pthread1.cc
@@ -111,7 +111,7 @@ main ()
task_queue* tq[thread_pairs];
-#if defined(__sun) && defined(__svr4__)
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
pthread_setconcurrency (thread_pairs * 2);
#endif
diff --git a/libstdc++-v3/testsuite/thread/pthread2.cc b/libstdc++-v3/testsuite/thread/pthread2.cc
index 7a0efd067a2..84485165cd2 100644
--- a/libstdc++-v3/testsuite/thread/pthread2.cc
+++ b/libstdc++-v3/testsuite/thread/pthread2.cc
@@ -48,7 +48,7 @@ main()
{
pthread_t tid[max_thread_count];
-#if defined(__sun) && defined(__svr4__)
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
pthread_setconcurrency (max_thread_count);
#endif
diff --git a/libstdc++-v3/testsuite/thread/pthread3.cc b/libstdc++-v3/testsuite/thread/pthread3.cc
index 4696fb76cdc..23f4e04e180 100644
--- a/libstdc++-v3/testsuite/thread/pthread3.cc
+++ b/libstdc++-v3/testsuite/thread/pthread3.cc
@@ -45,7 +45,7 @@ main()
{
pthread_t tid[max_thread_count];
-#if defined(__sun) && defined(__svr4__)
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
pthread_setconcurrency (max_thread_count);
#endif
diff --git a/libstdc++-v3/testsuite/thread/pthread4.cc b/libstdc++-v3/testsuite/thread/pthread4.cc
index a9ec9b84e38..b58445fb68e 100644
--- a/libstdc++-v3/testsuite/thread/pthread4.cc
+++ b/libstdc++-v3/testsuite/thread/pthread4.cc
@@ -98,7 +98,7 @@ template class __gnu_cxx::__mt_alloc<std::_List_node<std::string> >;
int
main (void)
{
-#if defined(__sun) && defined(__svr4__)
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
pthread_setconcurrency (2);
#endif
diff --git a/libstdc++-v3/testsuite/thread/pthread5.cc b/libstdc++-v3/testsuite/thread/pthread5.cc
index 93f03a22761..30086d4584d 100644
--- a/libstdc++-v3/testsuite/thread/pthread5.cc
+++ b/libstdc++-v3/testsuite/thread/pthread5.cc
@@ -100,7 +100,7 @@ main ()
int ids[NTHREADS];
void* status;
-#if defined(__sun) && defined(__svr4__)
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
pthread_setconcurrency (NTHREADS);
#endif
diff --git a/libstdc++-v3/testsuite/thread/pthread6.cc b/libstdc++-v3/testsuite/thread/pthread6.cc
index ba8c341c3f8..44b2b897146 100644
--- a/libstdc++-v3/testsuite/thread/pthread6.cc
+++ b/libstdc++-v3/testsuite/thread/pthread6.cc
@@ -80,7 +80,7 @@ main (void)
{
pthread_t tid[max_thread_count];
-#if defined(__sun) && defined(__svr4__)
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
pthread_setconcurrency (max_thread_count);
#endif
diff --git a/libstdc++-v3/testsuite/thread/pthread7-rope.cc b/libstdc++-v3/testsuite/thread/pthread7-rope.cc
index 307973c202d..3f5a338d086 100644
--- a/libstdc++-v3/testsuite/thread/pthread7-rope.cc
+++ b/libstdc++-v3/testsuite/thread/pthread7-rope.cc
@@ -68,7 +68,7 @@ main()
pthread_t tid[max_thread_count];
-#if defined(__sun) && defined(__svr4__)
+#if defined(__sun) && defined(__svr4__) && _XOPEN_VERSION >= 500
pthread_setconcurrency (max_thread_count);
#endif
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc
index 4bbda75280b..1c8d64dca4d 100644
--- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc
+++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc
@@ -41,6 +41,7 @@ void test01()
VERIFY( (test_category<is_function, const void>(false)) );
VERIFY( (test_category<is_function, AbstractClass>(false)) );
+ VERIFY( (test_category<is_function, int(&)(int)>(false)) );
// Sanity check.
VERIFY( (test_category<is_function, ClassType>(false)) );
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index c09946e05ef..1f6924173bb 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-25 Mark Mitchell <mark@codesourcery.com>
+
+ * crontab: Adjust for 4.0 branch.
+
2004-12-30 Sebastian Pop <pop@cri.ensmp.fr>
* update_version (ADD_BRANCHES): Replace lno-branch with
diff --git a/maintainer-scripts/crontab b/maintainer-scripts/crontab
index 6c9650c642c..bb2b1b64589 100644
--- a/maintainer-scripts/crontab
+++ b/maintainer-scripts/crontab
@@ -3,4 +3,5 @@
55 0 * * * sh /home/gccadmin/scripts/update_web_docs_libstdcxx
32 22 * * 3 sh /home/gccadmin/scripts/gcc_release -s 3.3:gcc-3_3-branch -l -d /sourceware/snapshot-tmp/gcc all
32 22 * * 5 sh /home/gccadmin/scripts/gcc_release -s 3.4:gcc-3_4-branch -l -d /sourceware/snapshot-tmp/gcc all
-43 17 * * 7 sh /home/gccadmin/scripts/gcc_release -s 4.0:HEAD -l -d /sourceware/snapshot-tmp/gcc all
+32 22 * * 6 sh /home/gccadmin/scripts/gcc_release -s 4.0:gcc-4_0-branch -l -d /sourceware/snapshot-tmp/gcc all
+43 17 * * 7 sh /home/gccadmin/scripts/gcc_release -s 4.1:HEAD -l -d /sourceware/snapshot-tmp/gcc all