clean up whitespace and cut long lines

master
Damien Doligez 2016-02-16 13:23:31 +01:00
parent 2a3e2176eb
commit ee8f71101b
284 changed files with 12307 additions and 12081 deletions

36
.gitattributes vendored
View File

@ -9,16 +9,22 @@ boot/ocamldep binary
*.png binary *.png binary
*.tfm binary *.tfm binary
.gitattributes ocaml-typo=missing-header # No header for text files (would be too obtrusive).
.gitignore ocaml-typo=missing-header *.md ocaml-typo=missing-header
.merlin ocaml-typo=missing-header README* ocaml-typo=missing-header
.ocp-indent ocaml-typo=missing-header *.adoc ocaml-typo=missing-header,long-line,unused-prop
Changes ocaml-typo=non-ascii,missing-header
CONTRIBUTING.md ocaml-typo=missing-header /.gitattributes ocaml-typo=missing-header
INSTALL ocaml-typo=missing-header /.gitignore ocaml-typo=missing-header
LICENSE ocaml-typo=non-printing,missing-header /.merlin ocaml-typo=missing-header
/Changes ocaml-typo=non-ascii,missing-header
/INSTALL ocaml-typo=missing-header
/LICENSE ocaml-typo=non-printing,missing-header
/appveyor.yml ocaml-typo=long-line,very-long-line
asmcomp/*/emit.mlp ocaml-typo=tab,long-line,unused-prop asmcomp/*/emit.mlp ocaml-typo=tab,long-line,unused-prop
asmcomp/power/NOTES.md ocaml-typo=missing-header,long-line
asmrun/i386.S ocaml-typo=long-line asmrun/i386.S ocaml-typo=long-line
@ -27,10 +33,11 @@ config/gnu ocaml-typo=prune
emacs/*.el ocaml-typo=long-line,unused-prop emacs/*.el ocaml-typo=long-line,unused-prop
emacs/COPYING ocaml-typo=tab,non-printing,missing-header emacs/COPYING ocaml-typo=tab,non-printing,missing-header
emacs/ocamltags.in ocaml-typo=non-printing emacs/ocamltags.in ocaml-typo=non-printing
emacs/README* ocaml-typo=missing-header
experimental ocaml-typo=prune experimental ocaml-typo=prune
manual ocaml-typo=prune
ocamlbuild/* ocaml-typo=long-line ocamlbuild/* ocaml-typo=long-line
ocamlbuild/AUTHORS ocaml-typo=missing-header ocamlbuild/AUTHORS ocaml-typo=missing-header
ocamlbuild/ChangeLog ocaml-typo=tab,missing-header ocamlbuild/ChangeLog ocaml-typo=tab,missing-header
@ -43,6 +50,17 @@ otherlibs/win32unix/readlink.c ocaml-typo=long-line
otherlibs/win32unix/stat.c ocaml-typo=long-line otherlibs/win32unix/stat.c ocaml-typo=long-line
otherlibs/win32unix/symlink.c ocaml-typo=long-line otherlibs/win32unix/symlink.c ocaml-typo=long-line
stdlib/sharpbang ocaml-typo=white-at-eol,missing-lf
# FIXME remove headers in testsuite and remove unused-prop in next line:
testsuite/** ocaml-typo=missing-header,unused-prop
testsuite/tests/lib-bigarray-2/bigarrf.f ocaml-typo=missing-header,tab
testsuite/tests/misc-unsafe/almabench.ml ocaml-typo=missing-header,long-line
tools/magic ocaml-typo=missing-header
yacc/*.[ch] ocaml-typo=long-line,very-long-line,unused-prop
# Line-ending specifications, for Windows interoperability # Line-ending specifications, for Windows interoperability
*.sh text eol=lf *.sh text eol=lf
*.sh.in text eol=lf *.sh.in text eol=lf

2
.gitignore vendored
View File

@ -274,6 +274,8 @@
/testsuite/tests/unboxed-primitive-args/main.ml /testsuite/tests/unboxed-primitive-args/main.ml
/testsuite/tests/unboxed-primitive-args/stubs.c /testsuite/tests/unboxed-primitive-args/stubs.c
/testsuite/tests/unwind/unwind_test
/testsuite/tests/warnings/w55.opt.opt_result /testsuite/tests/warnings/w55.opt.opt_result
/testsuite/tests/warnings/w58.opt.opt_result /testsuite/tests/warnings/w58.opt.opt_result

4
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "flexdll"] [submodule "flexdll"]
path = flexdll path = flexdll
url = https://github.com/alainfrisch/flexdll.git url = https://github.com/alainfrisch/flexdll.git

View File

@ -234,9 +234,9 @@ or:
make opt > log.opt 2>&1 # in sh make opt > log.opt 2>&1 # in sh
make opt >& log.opt # in csh make opt >& log.opt # in csh
5. anchor:step-5[] Compile fast versions of the OCaml compilers, by compiling them 5. anchor:step-5[] Compile fast versions of the OCaml compilers, by
with the native-code compiler (you have only compiled them to bytecode compiling them with the native-code compiler (you have only compiled
so far). Just do: them to bytecode so far). Just do:
make opt.opt make opt.opt
+ +

View File

@ -367,7 +367,8 @@ partialclean::
rm -f compilerlibs/ocamlopttoplevel.cmxa rm -f compilerlibs/ocamlopttoplevel.cmxa
ocamlnat: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \ ocamlnat: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
otherlibs/dynlink/dynlink.cmxa compilerlibs/ocamlopttoplevel.cmxa $(OPTTOPLEVELSTART:.cmo=.cmx) otherlibs/dynlink/dynlink.cmxa compilerlibs/ocamlopttoplevel.cmxa \
$(OPTTOPLEVELSTART:.cmo=.cmx)
$(CAMLOPT) $(LINKFLAGS) -linkall -o ocamlnat \ $(CAMLOPT) $(LINKFLAGS) -linkall -o ocamlnat \
otherlibs/dynlink/dynlink.cmxa compilerlibs/ocamlcommon.cmxa \ otherlibs/dynlink/dynlink.cmxa compilerlibs/ocamlcommon.cmxa \
compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamlopttoplevel.cmxa \ compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamlopttoplevel.cmxa \
@ -480,7 +481,8 @@ ocamlopt.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
partialclean:: partialclean::
rm -f ocamlopt.opt rm -f ocamlopt.opt
$(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(MIDDLE_END:.cmo=.cmx) $(ASMCOMP:.cmo=.cmx): ocamlopt $(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(MIDDLE_END:.cmo=.cmx) \
$(ASMCOMP:.cmo=.cmx): ocamlopt
# The numeric opcodes # The numeric opcodes
@ -747,7 +749,8 @@ clean::
$(CAMLOPT) $(COMPFLAGS) -c $< $(CAMLOPT) $(COMPFLAGS) -c $<
partialclean:: partialclean::
for d in utils parsing typing bytecomp asmcomp middle_end middle_end/base_types driver toplevel tools; \ for d in utils parsing typing bytecomp asmcomp middle_end \
middle_end/base_types driver toplevel tools; \
do rm -f $$d/*.cm[ioxt] $$d/*.cmti $$d/*.annot $$d/*.[so] $$d/*~; done do rm -f $$d/*.cm[ioxt] $$d/*.cmti $$d/*.annot $$d/*.[so] $$d/*~; done
rm -f *~ rm -f *~

View File

@ -16,48 +16,55 @@ include Makefile.shared
# For users who don't read the INSTALL file # For users who don't read the INSTALL file
defaultentry: defaultentry:
@echo "Please refer to the installation instructions in file README.win32.adoc." @echo "Please refer to the instructions in file README.win32.adoc."
FLEXDLL_SUBMODULE_PRESENT:=$(wildcard flexdll/Makefile) FLEXDLL_SUBMODULE_PRESENT:=$(wildcard flexdll/Makefile)
BOOT_FLEXLINK_CMD=$(if $(FLEXDLL_SUBMODULE_PRESENT),FLEXLINK_CMD="../boot/ocamlrun ../flexdll/flexlink.exe") ifeq "$(FLEXDLL_SUBMODULE_PRESENT)" ""
CAMLOPT:=$(if $(FLEXDLL_SUBMODULE_PRESENT),OCAML_FLEXLINK="boot/ocamlrun flexdll/flexlink.exe") $(CAMLOPT) BOOT_FLEXLINK_CMD=
else
BOOT_FLEXLINK_CMD=FLEXLINK_CMD="../boot/ocamlrun ../flexdll/flexlink.exe"
CAMLOPT:=OCAML_FLEXLINK="boot/ocamlrun flexdll/flexlink.exe" $(CAMLOPT)
endif
# FlexDLL sources missing error messages # FlexDLL sources missing error messages
# Different git mechanism displayed depending on whether this source tree came # Different git mechanism displayed depending on whether this source tree came
# from a git clone or a source tarball. # from a git clone or a source tarball.
# Displayed in all cases flexdll/Makefile:
flexdll-common-err: @echo In order to bootstrap FlexDLL, you need to place the sources in
@echo In order to bootstrap FlexDLL, you need to place the sources in flexdll @echo flexdll.
@echo This can either be done by downloading a source tarball from @echo This can either be done by downloading a source tarball from
@echo \ http://alain.frisch.fr/flexdll.html @echo \ http://alain.frisch.fr/flexdll.html
@if [ -d .git ]; then \
flexdll/Makefile: $(if $(wildcard flexdll/Makefile),,$(if $(wildcard .git),flexdll-common-err,flexdll-repo)) echo or by checking out the flexdll submodule with; \
@echo or by checking out the flexdll submodule with echo \ git submodule update --init; \
@echo \ git submodule update --init else \
@false echo or by cloning the git repository; \
echo \ git clone https://github.com/alainfrisch/flexdll.git; \
flexdll-repo: flexdll-common-err fi
@echo or by cloning the git repository
@echo \ git clone https://github.com/alainfrisch/flexdll.git
@echo
@false @false
# Bootstrapping FlexDLL - leaves a bytecode image of flexlink.exe in flexdll/ # Bootstrapping FlexDLL - leaves a bytecode image of flexlink.exe in flexdll/
flexdll: flexdll/Makefile flexdll: flexdll/Makefile
cd byterun ; $(MAKEREC) BOOTSTRAPPING_FLEXLINK=yes ocamlrun$(EXE) cd byterun && $(MAKEREC) BOOTSTRAPPING_FLEXLINK=yes ocamlrun$(EXE)
cp byterun/ocamlrun.exe boot/ocamlrun.exe cp byterun/ocamlrun.exe boot/ocamlrun.exe
cd stdlib ; $(MAKEREC) COMPILER=../boot/ocamlc stdlib.cma std_exit.cmo cd stdlib && $(MAKEREC) COMPILER=../boot/ocamlc stdlib.cma std_exit.cmo
cd stdlib ; cp stdlib.cma std_exit.cmo *.cmi ../boot cd stdlib && cp stdlib.cma std_exit.cmo *.cmi ../boot
cd flexdll ; $(MAKECMD) MSVC_DETECT=0 TOOLCHAIN=$(TOOLCHAIN) TOOLPREF=$(TOOLPREF) CHAINS=$(FLEXDLL_CHAIN) NATDYNLINK=false OCAMLOPT="../boot/ocamlrun ../boot/ocamlc -I ../boot" flexlink.exe support cd flexdll && \
cd byterun ; $(MAKEREC) clean $(MAKECMD) MSVC_DETECT=0 TOOLCHAIN=$(TOOLCHAIN) TOOLPREF=$(TOOLPREF) \
CHAINS=$(FLEXDLL_CHAIN) NATDYNLINK=false \
OCAMLOPT="../boot/ocamlrun ../boot/ocamlc -I ../boot" \
flexlink.exe support
cd byterun && $(MAKEREC) clean
$(MAKEREC) partialclean $(MAKEREC) partialclean
flexlink.opt: flexlink.opt:
cd flexdll ; \ cd flexdll && \
mv flexlink.exe flexlink ; \ mv flexlink.exe flexlink && \
$(MAKECMD) OCAML_FLEXLINK="../boot/ocamlrun ./flexlink" MSVC_DETECT=0 TOOLCHAIN=$(TOOLCHAIN) TOOLPREF=$(TOOLPREF) OCAMLOPT="../ocamlopt.opt -I ../stdlib" flexlink.exe ; \ $(MAKECMD) OCAML_FLEXLINK="../boot/ocamlrun ./flexlink" MSVC_DETECT=0 \
mv flexlink.exe flexlink.opt ; \ TOOLCHAIN=$(TOOLCHAIN) TOOLPREF=$(TOOLPREF) \
OCAMLOPT="../ocamlopt.opt -I ../stdlib" flexlink.exe && \
mv flexlink.exe flexlink.opt && \
mv flexlink flexlink.exe mv flexlink flexlink.exe
# Recompile the system using the bootstrap compiler # Recompile the system using the bootstrap compiler
@ -229,28 +236,36 @@ installbyt:
install-flexdll: install-flexdll:
# The $(if ...) installs the correct .manifest file for MSVC and MSVC64 # The $(if ...) installs the correct .manifest file for MSVC and MSVC64
# (GNU make doesn't have ifeq as a function, hence slightly convoluted use of filter-out) # (GNU make doesn't have ifeq as a function, hence slightly convoluted use of
cp flexdll/flexlink.exe $(if $(filter-out mingw,$(TOOLCHAIN)),flexdll/default$(filter-out _i386,_$(ARCH)).manifest) $(INSTALL_BINDIR)/ # filter-out)
cp flexdll/flexlink.exe \
$(if $(filter-out mingw,$(TOOLCHAIN)),\
flexdll/default$(filter-out _i386,_$(ARCH)).manifest) \
$(INSTALL_BINDIR)/
cp flexdll/flexdll_*.$(O) $(INSTALL_LIBDIR) cp flexdll/flexdll_*.$(O) $(INSTALL_LIBDIR)
# Installation of the native-code compiler # Installation of the native-code compiler
installopt: installopt:
cd asmrun ; $(MAKEREC) install cd asmrun && $(MAKEREC) install
cp ocamlopt "$(INSTALL_BINDIR)/ocamlopt.exe" cp ocamlopt "$(INSTALL_BINDIR)/ocamlopt.exe"
cd stdlib ; $(MAKEREC) installopt cd stdlib && $(MAKEREC) installopt
cp middle_end/*.cmi middle_end/*.cmt middle_end/*.cmti \ cp middle_end/*.cmi middle_end/*.cmt middle_end/*.cmti \
"$(INSTALL_COMPLIBDIR)" "$(INSTALL_COMPLIBDIR)"
cp middle_end/base_types/*.cmi middle_end/base_types/*.cmt \ cp middle_end/base_types/*.cmi middle_end/base_types/*.cmt \
middle_end/base_types/*.cmti "$(INSTALL_COMPLIBDIR)" middle_end/base_types/*.cmti "$(INSTALL_COMPLIBDIR)"
cp asmcomp/*.cmi asmcomp/*.cmt asmcomp/*.cmti "$(INSTALL_COMPLIBDIR)" cp asmcomp/*.cmi asmcomp/*.cmt asmcomp/*.cmti "$(INSTALL_COMPLIBDIR)"
cp compilerlibs/ocamloptcomp.cma $(OPTSTART) "$(INSTALL_COMPLIBDIR)" cp compilerlibs/ocamloptcomp.cma $(OPTSTART) "$(INSTALL_COMPLIBDIR)"
if test -n "$(WITH_OCAMLDOC)"; then (cd ocamldoc; $(MAKEREC) installopt); fi if test -n "$(WITH_OCAMLDOC)"; then \
(cd ocamldoc && $(MAKEREC) installopt); \
fi
for i in $(OTHERLIBRARIES); do \ for i in $(OTHERLIBRARIES); do \
$(MAKEREC) -C otherlibs/$$i installopt || exit $$?; \ $(MAKEREC) -C otherlibs/$$i installopt || exit $$?; \
done done
if test -f ocamlopt.opt ; then $(MAKEREC) installoptopt; fi if test -f ocamlopt.opt ; then $(MAKEREC) installoptopt; fi
cd tools; $(MAKEREC) installopt cd tools; $(MAKEREC) installopt
if test -f ocamlopt.opt -a -f flexdll/flexlink.opt ; then cp -f flexdll/flexlink.opt $(INSTALL_BINDIR)/flexlink.exe ; fi if test -f ocamlopt.opt -a -f flexdll/flexlink.opt ; then \
cp -f flexdll/flexlink.opt $(INSTALL_BINDIR)/flexlink.exe ; \
fi
installoptopt: installoptopt:
cp ocamlc.opt "$(INSTALL_BINDIR)/ocamlc.opt$(EXE)" cp ocamlc.opt "$(INSTALL_BINDIR)/ocamlc.opt$(EXE)"
@ -441,7 +456,8 @@ ocamlopt.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
partialclean:: partialclean::
rm -f ocamlopt.opt rm -f ocamlopt.opt
$(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(MIDDLE_END:.cmo=.cmx) $(ASMCOMP:.cmo=.cmx): ocamlopt $(COMMON:.cmo=.cmx) $(BYTECOMP:.cmo=.cmx) $(MIDDLE_END:.cmo=.cmx) \
$(ASMCOMP:.cmo=.cmx): ocamlopt
# The numeric opcodes # The numeric opcodes

View File

@ -19,8 +19,8 @@ include stdlib/StdlibModules
CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot
CAMLOPT=$(CAMLRUN) ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink CAMLOPT=$(CAMLRUN) ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink
COMPFLAGS=-strict-sequence -principal -w +33..39+48+50 -warn-error A -bin-annot \ COMPFLAGS=-strict-sequence -principal -w +33..39+48+50 -warn-error A \
-safe-string -strict-formats $(INCLUDES) -bin-annot -safe-string -strict-formats $(INCLUDES)
LINKFLAGS= LINKFLAGS=
YACCFLAGS=-v YACCFLAGS=-v
@ -234,4 +234,3 @@ partialclean::
alldepend:: alldepend::
cd tools; $(MAKEREC) depend cd tools; $(MAKEREC) depend

View File

@ -60,7 +60,7 @@ renaming of standard library functions.
config/:: autoconfiguration stuff config/:: autoconfiguration stuff
debugger/:: source-level replay debugger debugger/:: source-level replay debugger
driver/:: driver code for the compilers driver/:: driver code for the compilers
emacs/:: OCaml editing mode and debugger interface for GNU Emacs emacs/:: editing mode and debugger interface for GNU Emacs
lex/:: lexer generator lex/:: lexer generator
maccaml/:: the Macintosh GUI maccaml/:: the Macintosh GUI
ocamldoc/:: documentation generator ocamldoc/:: documentation generator

View File

@ -87,15 +87,16 @@ for Windows.
You will need the following software components to perform the recompilation: You will need the following software components to perform the recompilation:
- Windows NT, 2000, XP, Vista, or 7 (32 or 64 bits). - Windows NT, 2000, XP, Vista, or 7 (32 or 64 bits).
- Items <<tps1,[1]>> and <<tps2,[2]>> from the list of recommended software above. - Items <<tps1,[1]>> and <<tps2,[2]>> from the list of recommended software
above.
- The Cygwin port of GNU tools, available from http://www.cygwin.com/ - The Cygwin port of GNU tools, available from http://www.cygwin.com/
Install at least the following packages (and their dependencies): Install at least the following packages (and their dependencies):
diffutils, dos2unix, gcc-core, make, ncurses. diffutils, dos2unix, gcc-core, make, ncurses.
First, you need to set up your cygwin environment for using the MS First, you need to set up your cygwin environment for using the MS
tools. The following assumes that you have installed <<tps1,[1]>>, <<tps2,[2]>>, and [3] tools. The following assumes that you have installed <<tps1,[1]>>,
in their default directories. If this is not the case, you will need <<tps2,[2]>>, and [3] in their default directories. If this is not
to adjust the paths accordingly. the case, you will need to adjust the paths accordingly.
. Open a Windows Command Prompt and enter the following command: . Open a Windows Command Prompt and enter the following command:
@ -408,14 +409,15 @@ for Windows.
You will need the following software components to perform the recompilation: You will need the following software components to perform the recompilation:
- Windows XP 64, Windows Server 64, or Windows 7 64. - Windows XP 64, Windows Server 64, or Windows 7 64.
- Items <<tps-native1,[1]>> and <<tps-native2,[2]>> from the list of recommended software above. - Items <<tps-native1,[1]>> and <<tps-native2,[2]>> from the list of
recommended software above.
- The Cygwin port of GNU tools, available from http://www.cygwin.com/ - The Cygwin port of GNU tools, available from http://www.cygwin.com/
Install at least the following packages: diffutils, make, ncurses. Install at least the following packages: diffutils, make, ncurses.
First, you need to set up your cygwin environment for using the MS First, you need to set up your cygwin environment for using the MS
tools. The following assumes that you have installed <<tps-native1,[1]>> and <<tps-native2,[2]>> tools. The following assumes that you have installed <<tps-native1,[1]>>
in their default directories. If this is not the case, you will need and <<tps-native2,[2]>> in their default directories. If this is not
to adjust the paths accordingly. the case, you will need to adjust the paths accordingly.
. Open a Windows Command Prompt and enter the following commands: . Open a Windows Command Prompt and enter the following commands:

View File

@ -19,4 +19,3 @@ Debian architecture name: `amd64`
_OS X ABI Function Call Guide: x86-64 Function Calling Conventions_ _OS X ABI Function Call Guide: x86-64 Function Calling Conventions_
* Windows 64 application binary interface: * Windows 64 application binary interface:
_x64 Software Conventions_ from MSDN _x64 Software Conventions_ from MSDN

View File

@ -18,4 +18,3 @@ Debian architecture names: `armel` and `armhf`.
_ARM Architecture Reference Manual, ARMv8_, restricted to the AArch32 subset. _ARM Architecture Reference Manual, ARMv8_, restricted to the AArch32 subset.
* Application binary interface: * Application binary interface:
_Procedure Call Standard for the ARM Architecture_ _Procedure Call Standard for the ARM Architecture_

View File

@ -20,8 +20,3 @@ Debian architecture name: `i386`
Intel386 Architecture Processor Supplement_ Intel386 Architecture Processor Supplement_
* MacOS X application binary interface: * MacOS X application binary interface:
_OS X ABI Function Call Guide: IA-32 Function Calling Conventions_ _OS X ABI Function Call Guide: IA-32 Function Calling Conventions_

View File

@ -12,7 +12,7 @@ No longer supported: AIX and MacOS X.
* Instruction set architecture: * Instruction set architecture:
_PowerPC User Instruction Set Architecture_, _PowerPC User Instruction Set Architecture_,
book 1 of _PowerPC Architecture Book_ book 1 of _PowerPC Architecture Book_
(http://www.ibm.com/developerworks/systems/library/es-archguide-v2.html). (http://www.ibm.com/developerworks/systems/library/es-archguide-v2.html).
* ELF ABI 32 bits: * ELF ABI 32 bits:
_System V Application Binary Interface, PowerPC Processor Supplement_ _System V Application Binary Interface, PowerPC Processor Supplement_
* ELF ABI 64 bits version 1: * ELF ABI 64 bits version 1:
@ -24,4 +24,3 @@ No longer supported: AIX and MacOS X.
(http://openpowerfoundation.org/technical/technical-resources/technical-specifications/) (http://openpowerfoundation.org/technical/technical-resources/technical-specifications/)
* _The PowerPC Compiler Writer's Guide_, Warthman Associates, 1996. * _The PowerPC Compiler Writer's Guide_, Warthman Associates, 1996.
(PDF available from various sources on the Web.) (PDF available from various sources on the Web.)

View File

@ -14,6 +14,3 @@ running Linux (Debian architecture: `s390x`).
* ELF ABI: * ELF ABI:
_zSeries ELF Application Binary Interface Supplement_ _zSeries ELF Application Binary Interface Supplement_
(http://refspecs.linuxfoundation.org/ELF/zSeries/index.html) (http://refspecs.linuxfoundation.org/ELF/zSeries/index.html)

View File

@ -15,7 +15,3 @@ Status of this port: nearly abandoned
* ELF application binary interface: * ELF application binary interface:
_System V Application Binary Interface, _System V Application Binary Interface,
SPARC Processor Supplement_ SPARC Processor Supplement_

View File

@ -189,7 +189,8 @@
#define PUSH_CALLEE_SAVE_REGS \ #define PUSH_CALLEE_SAVE_REGS \
pushq %rbx; CFI_ADJUST (8); CFI_OFFSET(rbx, -16); \ pushq %rbx; CFI_ADJUST (8); CFI_OFFSET(rbx, -16); \
pushq %rbp; CFI_ADJUST (8); CFI_OFFSET(rbp, -24); /* Allows debugger to walk the stack */ \ pushq %rbp; CFI_ADJUST (8); CFI_OFFSET(rbp, -24); \
/* Allows debugger to walk the stack */ \
pushq %rsi; CFI_ADJUST (8); CFI_OFFSET(rsi, -32); \ pushq %rsi; CFI_ADJUST (8); CFI_OFFSET(rsi, -32); \
pushq %rdi; CFI_ADJUST (8); CFI_OFFSET(rdi, -40); \ pushq %rdi; CFI_ADJUST (8); CFI_OFFSET(rdi, -40); \
pushq %r12; CFI_ADJUST (8); CFI_OFFSET(r12, -48); \ pushq %r12; CFI_ADJUST (8); CFI_OFFSET(r12, -48); \

View File

@ -93,7 +93,9 @@ alloc_limit .req r11
/* Support for profiling with gprof */ /* Support for profiling with gprof */
#if defined(PROFILING) && (defined(SYS_linux_eabihf) || defined(SYS_linux_eabi) || defined(SYS_netbsd)) #if defined(PROFILING) && (defined(SYS_linux_eabihf) \
|| defined(SYS_linux_eabi) \
|| defined(SYS_netbsd))
#define PROFILE \ #define PROFILE \
push {lr}; CFI_ADJUST(4); \ push {lr}; CFI_ADJUST(4); \
bl __gnu_mcount_nc; CFI_ADJUST(-4) bl __gnu_mcount_nc; CFI_ADJUST(-4)

View File

@ -36,14 +36,14 @@ caml_system__code_begin:
caml_call_gc: caml_call_gc:
/* Set up stack frame */ /* Set up stack frame */
#define FRAMESIZE (16*8 + 16*8) #define FRAMESIZE (16*8 + 16*8)
lay %r15, -FRAMESIZE(%r15) lay %r15, -FRAMESIZE(%r15)
/* Record return address into OCaml code */ /* Record return address into OCaml code */
Storeglobal(%r14, caml_last_return_address) Storeglobal(%r14, caml_last_return_address)
/* Record lowest stack address */ /* Record lowest stack address */
lay %r0, FRAMESIZE(%r15) lay %r0, FRAMESIZE(%r15)
Storeglobal(%r0, caml_bottom_of_stack) Storeglobal(%r0, caml_bottom_of_stack)
/* Record pointer to register array */ /* Record pointer to register array */
lay %r0, (8*16)(%r15) lay %r0, (8*16)(%r15)
Storeglobal(%r0, caml_gc_regs) Storeglobal(%r0, caml_gc_regs)
/* Save current allocation pointer for debugging purposes */ /* Save current allocation pointer for debugging purposes */
Storeglobal(%r11, caml_young_ptr) Storeglobal(%r11, caml_young_ptr)
@ -51,7 +51,7 @@ caml_call_gc:
Storeglobal(%r13, caml_exception_pointer) Storeglobal(%r13, caml_exception_pointer)
/* Save all registers used by the code generator */ /* Save all registers used by the code generator */
stmg %r2,%r9, (8*16)(%r15) stmg %r2,%r9, (8*16)(%r15)
stg %r12, (8*16 + 8*8)(%r15) stg %r12, (8*16 + 8*8)(%r15)
std %f0, 0(%r15) std %f0, 0(%r15)
std %f1, 8(%r15) std %f1, 8(%r15)
std %f2, 16(%r15) std %f2, 16(%r15)
@ -78,7 +78,7 @@ caml_call_gc:
Loadglobal(%r10, caml_young_limit) Loadglobal(%r10, caml_young_limit)
/* Restore all regs used by the code generator */ /* Restore all regs used by the code generator */
lmg %r2,%r9, (8*16)(%r15) lmg %r2,%r9, (8*16)(%r15)
lg %r12, (8*16 + 8*8)(%r15) lg %r12, (8*16 + 8*8)(%r15)
ld %f0, 0(%r15) ld %f0, 0(%r15)
ld %f1, 8(%r15) ld %f1, 8(%r15)
ld %f2, 16(%r15) ld %f2, 16(%r15)
@ -98,7 +98,7 @@ caml_call_gc:
/* Return to caller */ /* Return to caller */
Loadglobal(%r1, caml_last_return_address) Loadglobal(%r1, caml_last_return_address)
/* Deallocate stack frame */ /* Deallocate stack frame */
lay %r15, FRAMESIZE(%r15) lay %r15, FRAMESIZE(%r15)
/* Return */ /* Return */
br %r1 br %r1
@ -109,7 +109,7 @@ caml_call_gc:
caml_c_call: caml_c_call:
Storeglobal(%r15, caml_bottom_of_stack) Storeglobal(%r15, caml_bottom_of_stack)
/* Save return address */ /* Save return address */
ldgr %f15, %r14 ldgr %f15, %r14
/* Get ready to call C function (address in r7) */ /* Get ready to call C function (address in r7) */
/* Record lowest stack address and return address */ /* Record lowest stack address and return address */
Storeglobal(%r14, caml_last_return_address) Storeglobal(%r14, caml_last_return_address)
@ -119,7 +119,7 @@ caml_c_call:
/* Call the function */ /* Call the function */
basr %r14, %r7 basr %r14, %r7
/* restore return address */ /* restore return address */
lgdr %r14,%f15 lgdr %r14,%f15
/* Reload allocation pointer and allocation limit*/ /* Reload allocation pointer and allocation limit*/
Loadglobal(%r11, caml_young_ptr) Loadglobal(%r11, caml_young_ptr)
Loadglobal(%r10, caml_young_limit) Loadglobal(%r10, caml_young_limit)
@ -135,21 +135,21 @@ caml_c_call:
.type caml_raise_exn, @function .type caml_raise_exn, @function
caml_raise_exn: caml_raise_exn:
Loadglobal32(%r0, caml_backtrace_active) Loadglobal32(%r0, caml_backtrace_active)
cgfi %r0, 0 cgfi %r0, 0
jne .L110 jne .L110
.L111: .L111:
/* Pop trap frame */ /* Pop trap frame */
lg %r1, 0(%r13) lg %r1, 0(%r13)
lgr %r15, %r13 lgr %r15, %r13
lg %r13, 8(13) lg %r13, 8(13)
agfi %r15, 16 agfi %r15, 16
/* Branch to handler */ /* Branch to handler */
br %r1 br %r1
.L110: .L110:
lgfi %r0, 0 lgfi %r0, 0
Storeglobal32(%r0, caml_backtrace_pos) Storeglobal32(%r0, caml_backtrace_pos)
.L114: .L114:
ldgr %f15, %r2 /* preserve exn bucket in callee-save reg */ ldgr %f15, %r2 /* preserve exn bucket in callee-save reg */
/* arg1: exception bucket, already in r3 */ /* arg1: exception bucket, already in r3 */
lgr %r3,%r14 /* arg2: PC of raise */ lgr %r3,%r14 /* arg2: PC of raise */
lgr %r4, %r15 /* arg3: SP of raise */ lgr %r4, %r15 /* arg3: SP of raise */
@ -157,14 +157,14 @@ caml_raise_exn:
agfi %r15, -160 /* reserve stack space for C call */ agfi %r15, -160 /* reserve stack space for C call */
brasl %r14, caml_stash_backtrace@PLT brasl %r14, caml_stash_backtrace@PLT
agfi %r15, 160 agfi %r15, 160
lgdr %r2,%f15 /* restore exn bucket */ lgdr %r2,%f15 /* restore exn bucket */
j .L111 /* raise the exn */ j .L111 /* raise the exn */
.globl caml_reraise_exn .globl caml_reraise_exn
.type caml_reraise_exn, @function .type caml_reraise_exn, @function
caml_reraise_exn: caml_reraise_exn:
Loadglobal32(%r0, caml_backtrace_active) Loadglobal32(%r0, caml_backtrace_active)
cgfi %r0, 0 cgfi %r0, 0
jne .L114 jne .L114
/* Pop trap frame */ /* Pop trap frame */
lg %r1, 0(%r13) lg %r1, 0(%r13)
@ -180,7 +180,7 @@ caml_reraise_exn:
.type caml_raise_exception, @function .type caml_raise_exception, @function
caml_raise_exception: caml_raise_exception:
Loadglobal32(0, caml_backtrace_active) Loadglobal32(0, caml_backtrace_active)
cgfi %r0, 0 cgfi %r0, 0
jne .L112 jne .L112
.L113: .L113:
/* Reload OCaml global registers */ /* Reload OCaml global registers */
@ -191,13 +191,13 @@ caml_raise_exception:
lgfi %r0, 0 lgfi %r0, 0
Storeglobal(%r0, caml_last_return_address) Storeglobal(%r0, caml_last_return_address)
/* Pop trap frame */ /* Pop trap frame */
lg %r1, 0(%r15) lg %r1, 0(%r15)
lg %r13, 8(%r15) lg %r13, 8(%r15)
agfi %r15, 16 agfi %r15, 16
/* Branch to handler */ /* Branch to handler */
br %r1; br %r1;
.L112: .L112:
ldgr %f15,%r2 /* preserve exn bucket in callee-save reg */ ldgr %f15,%r2 /* preserve exn bucket in callee-save reg */
/* arg1: exception bucket, already in r2 */ /* arg1: exception bucket, already in r2 */
Loadglobal(%r3, caml_last_return_address) /* arg2: PC of raise */ Loadglobal(%r3, caml_last_return_address) /* arg2: PC of raise */
Loadglobal(%r4, caml_bottom_of_stack) /* arg3: SP of raise */ Loadglobal(%r4, caml_bottom_of_stack) /* arg3: SP of raise */
@ -206,7 +206,7 @@ caml_raise_exception:
lay %r15, -160(%r15) lay %r15, -160(%r15)
brasl %r14, caml_stash_backtrace@PLT brasl %r14, caml_stash_backtrace@PLT
lay %r15, 160(%r15) lay %r15, 160(%r15)
lgdr %r2,%f15 /* restore exn bucket */ /* restore exn bucket */ lgdr %r2,%f15 /* restore exn bucket */
j .L113 /* raise the exn */ j .L113 /* raise the exn */
/* Start the OCaml program */ /* Start the OCaml program */
@ -219,7 +219,7 @@ caml_start_program:
/* Code shared between caml_start_program and caml_callback */ /* Code shared between caml_start_program and caml_callback */
.L102: .L102:
/* Allocate stack frame */ /* Allocate stack frame */
lay %r15, -144(%r15) lay %r15, -144(%r15)
/* Save all callee-save registers + return address */ /* Save all callee-save registers + return address */
/* GPR 6..14 at sp + 0 ... sp + 64 /* GPR 6..14 at sp + 0 ... sp + 64
FPR 10..15 at sp + 72 ... sp + 128 */ FPR 10..15 at sp + 72 ... sp + 128 */
@ -245,7 +245,7 @@ caml_start_program:
brasl %r14, .L103 brasl %r14, .L103
j .L104 j .L104
.L103: .L103:
lay %r15, -16(%r15) lay %r15, -16(%r15)
stg %r14, 0(%r15) stg %r14, 0(%r15)
Loadglobal(%r1, caml_exception_pointer) Loadglobal(%r1, caml_exception_pointer)
stg %r1, 8(%r15) stg %r1, 8(%r15)
@ -260,7 +260,7 @@ caml_start_program:
/* Pop the trap frame, restoring caml_exception_pointer */ /* Pop the trap frame, restoring caml_exception_pointer */
lg %r0, 8(%r15) lg %r0, 8(%r15)
Storeglobal(%r0, caml_exception_pointer) Storeglobal(%r0, caml_exception_pointer)
la %r15, 16(%r15) la %r15, 16(%r15)
/* Pop the callback link, restoring the global variables */ /* Pop the callback link, restoring the global variables */
.L106: .L106:
lg %r5, 0(%r15) lg %r5, 0(%r15)
@ -269,12 +269,12 @@ caml_start_program:
Storeglobal(%r5, caml_bottom_of_stack) Storeglobal(%r5, caml_bottom_of_stack)
Storeglobal(%r6, caml_last_return_address) Storeglobal(%r6, caml_last_return_address)
Storeglobal(%r1, caml_gc_regs) Storeglobal(%r1, caml_gc_regs)
la %r15, 32(%r15) la %r15, 32(%r15)
/* Update allocation pointer */ /* Update allocation pointer */
Storeglobal(%r11, caml_young_ptr) Storeglobal(%r11, caml_young_ptr)
/* Restore registers */ /* Restore registers */
lmg %r6,%r14, 0(%r15) lmg %r6,%r14, 0(%r15)
ld %f8, 72(%r15) ld %f8, 72(%r15)
ld %f9, 80(%r15) ld %f9, 80(%r15)
@ -286,8 +286,8 @@ caml_start_program:
ld %f15, 128(%r15) ld %f15, 128(%r15)
/* Return */ /* Return */
lay %r15, 144(%r15) lay %r15, 144(%r15)
br %r14 br %r14
/* The trap handler: */ /* The trap handler: */
.L104: .L104:
@ -330,12 +330,12 @@ caml_callback3_exn:
Addrglobal(%r0, caml_apply3) Addrglobal(%r0, caml_apply3)
j .L102 j .L102
.globl caml_ml_array_bound_error .globl caml_ml_array_bound_error
.type caml_ml_array_bound_error, @function .type caml_ml_array_bound_error, @function
caml_ml_array_bound_error: caml_ml_array_bound_error:
lay %r15, -160(%r15) /* Reserve stack space for C call */ lay %r15, -160(%r15) /* Reserve stack space for C call */
larl %r7, caml_array_bound_error larl %r7, caml_array_bound_error
j caml_c_call j caml_c_call
.globl caml_system__code_end .globl caml_system__code_end
caml_system__code_end: caml_system__code_end:
@ -350,7 +350,7 @@ caml_system__frametable:
.quad .L105 /* return address into callback */ .quad .L105 /* return address into callback */
.short -1 /* negative size count => use callback link */ .short -1 /* negative size count => use callback link */
.short 0 /* no roots here */ .short 0 /* no roots here */
.align 8 .align 8
/* Mark stack as non-executable */ /* Mark stack as non-executable */
.section .note.GNU-stack,"",%progbits .section .note.GNU-stack,"",%progbits

View File

@ -145,7 +145,9 @@ int caml_set_signal_action(int signo, int action)
/* Machine- and OS-dependent handling of bound check trap */ /* Machine- and OS-dependent handling of bound check trap */
#if defined(TARGET_power) || defined(TARGET_s390x) || (defined(TARGET_sparc) && defined(SYS_solaris)) #if defined(TARGET_power) \
|| defined(TARGET_s390x) \
|| (defined(TARGET_sparc) && defined(SYS_solaris))
DECLARE_SIGNAL_HANDLER(trap_handler) DECLARE_SIGNAL_HANDLER(trap_handler)
{ {
#if defined(SYS_solaris) #if defined(SYS_solaris)

View File

@ -647,7 +647,7 @@ let rec comp_expr env exp sz cont =
(Kmakeblock(List.length args, 0) :: (Kmakeblock(List.length args, 0) ::
Kccall("caml_make_array", 1) :: cont) Kccall("caml_make_array", 1) :: cont)
end end
| Lprim (Pduparray (kind, mutability), [Lprim (Pmakearray (kind', _), args)]) -> | Lprim (Pduparray (kind, mutability), [Lprim (Pmakearray (kind',_),args)]) ->
assert (kind = kind'); assert (kind = kind');
comp_expr env (Lprim (Pmakearray (kind, mutability), args)) sz cont comp_expr env (Lprim (Pmakearray (kind, mutability), args)) sz cont
| Lprim (Pduparray _, [arg]) -> | Lprim (Pduparray _, [arg]) ->

View File

@ -525,7 +525,8 @@ let subst_lambda s lam =
begin try Ident.find_same id s with Not_found -> l end begin try Ident.find_same id s with Not_found -> l end
| Lconst sc as l -> l | Lconst sc as l -> l
| Lapply ap -> | Lapply ap ->
Lapply{ap with ap_func = subst ap.ap_func; ap_args = List.map subst ap.ap_args} Lapply{ap with ap_func = subst ap.ap_func;
ap_args = List.map subst ap.ap_args}
| Lfunction{kind; params; body; attr} -> | Lfunction{kind; params; body; attr} ->
Lfunction{kind; params; body = subst body; attr} Lfunction{kind; params; body = subst body; attr}
| Llet(str, id, arg, body) -> Llet(str, id, subst arg, subst body) | Llet(str, id, arg, body) -> Llet(str, id, subst arg, subst body)

View File

@ -2980,7 +2980,8 @@ let rec map_return f = function
| Lsequence (l1, l2) -> Lsequence (l1, map_return f l2) | Lsequence (l1, l2) -> Lsequence (l1, map_return f l2)
| Levent (l, ev) -> Levent (map_return f l, ev) | Levent (l, ev) -> Levent (map_return f l, ev)
| Ltrywith (l1, id, l2) -> Ltrywith (map_return f l1, id, map_return f l2) | Ltrywith (l1, id, l2) -> Ltrywith (map_return f l1, id, map_return f l2)
| Lstaticcatch (l1, b, l2) -> Lstaticcatch (map_return f l1, b, map_return f l2) | Lstaticcatch (l1, b, l2) ->
Lstaticcatch (map_return f l1, b, map_return f l2)
| Lstaticraise _ | Lprim(Praise _, _) as l -> l | Lstaticraise _ | Lprim(Praise _, _) as l -> l
| l -> f l | l -> f l

View File

@ -355,7 +355,8 @@ let simplify_lets lam =
| Lapply{ap_func = Lfunction{kind = Curried; params; body}; ap_args = args} | Lapply{ap_func = Lfunction{kind = Curried; params; body}; ap_args = args}
when optimize && List.length params = List.length args -> when optimize && List.length params = List.length args ->
count bv (beta_reduce params body args) count bv (beta_reduce params body args)
| Lapply{ap_func = Lfunction{kind = Tupled; params; body}; ap_args = [Lprim(Pmakeblock _, args)]} | Lapply{ap_func = Lfunction{kind = Tupled; params; body};
ap_args = [Lprim(Pmakeblock _, args)]}
when optimize && List.length params = List.length args -> when optimize && List.length params = List.length args ->
count bv (beta_reduce params body args) count bv (beta_reduce params body args)
| Lapply{ap_func = l1; ap_args = ll} -> | Lapply{ap_func = l1; ap_args = ll} ->
@ -447,10 +448,12 @@ let simplify_lets lam =
| Lapply{ap_func = Lfunction{kind = Curried; params; body}; ap_args = args} | Lapply{ap_func = Lfunction{kind = Curried; params; body}; ap_args = args}
when optimize && List.length params = List.length args -> when optimize && List.length params = List.length args ->
simplif (beta_reduce params body args) simplif (beta_reduce params body args)
| Lapply{ap_func = Lfunction{kind = Tupled; params; body}; ap_args = [Lprim(Pmakeblock _, args)]} | Lapply{ap_func = Lfunction{kind = Tupled; params; body};
ap_args = [Lprim(Pmakeblock _, args)]}
when optimize && List.length params = List.length args -> when optimize && List.length params = List.length args ->
simplif (beta_reduce params body args) simplif (beta_reduce params body args)
| Lapply ap -> Lapply {ap with ap_func = simplif ap.ap_func; ap_args = List.map simplif ap.ap_args} | Lapply ap -> Lapply {ap with ap_func = simplif ap.ap_func;
ap_args = List.map simplif ap.ap_args}
| Lfunction{kind; params; body = l; attr} -> | Lfunction{kind; params; body = l; attr} ->
begin match simplif l with begin match simplif l with
Lfunction{kind=Curried; params=params'; body; attr} Lfunction{kind=Curried; params=params'; body; attr}

View File

@ -29,7 +29,9 @@ let lfunction params body =
| Lfunction {kind = Curried; params = params'; body = body'; attr} -> | Lfunction {kind = Curried; params = params'; body = body'; attr} ->
Lfunction {kind = Curried; params = params @ params'; body = body'; attr} Lfunction {kind = Curried; params = params @ params'; body = body'; attr}
| _ -> | _ ->
Lfunction {kind = Curried; params; body; attr = default_function_attribute} Lfunction {kind = Curried; params;
body;
attr = default_function_attribute}
let lapply ap = let lapply ap =
match ap.ap_func with match ap.ap_func with
@ -601,7 +603,8 @@ open M
obj_init: creation function (unit -> obj) obj_init: creation function (unit -> obj)
class_init: inheritance function (table -> env_init) class_init: inheritance function (table -> env_init)
(one by source code) (one by source code)
env_init: parameterisation by the local environment (env -> params -> obj_init) env_init: parameterisation by the local environment
(env -> params -> obj_init)
(one for each combination of inherited class_init ) (one for each combination of inherited class_init )
env: environnement local env: environnement local
If ids=0 (immediate object), then only env_init is conserved. If ids=0 (immediate object), then only env_init is conserved.

View File

@ -874,11 +874,12 @@ and transl_exp0 e =
because [caml_modify] might be called upon them (e.g. from because [caml_modify] might be called upon them (e.g. from
code operating on polymorphic arrays, or functions such as code operating on polymorphic arrays, or functions such as
[caml_array_blit]. [caml_array_blit].
To avoid having different Lambda code for bytecode/Closure vs. To avoid having different Lambda code for
Flambda, we always generate [Pduparray] here, and deal with it in bytecode/Closure vs. Flambda, we always generate
[Bytegen] (or in the case of Closure, in [Cmmgen], which already [Pduparray] here, and deal with it in [Bytegen] (or in
has to handle [Pduparray Pmakearray Pfloatarray] in the case where the case of Closure, in [Cmmgen], which already has to
the array turned out to be inconstant). handle [Pduparray Pmakearray Pfloatarray] in the case
where the array turned out to be inconstant).
When not [Pfloatarray], the exception propagates to the handler When not [Pfloatarray], the exception propagates to the handler
below. *) below. *)
let imm_array = Lprim (Pmakearray (kind, Immutable), ll) in let imm_array = Lprim (Pmakearray (kind, Immutable), ll) in
@ -891,7 +892,7 @@ and transl_exp0 e =
| Pfloatarray -> | Pfloatarray ->
Lconst(Const_float_array(List.map extract_float cl)) Lconst(Const_float_array(List.map extract_float cl))
| Pgenarray -> | Pgenarray ->
raise Not_constant (* can this really happen? *) raise Not_constant (* can this really happen? *)
in in
Lprim (Pduparray (kind, Mutable), [imm_array]) Lprim (Pduparray (kind, Mutable), [imm_array])
end end
@ -1122,7 +1123,10 @@ and transl_apply ?(should_be_tailcall=false) ?(inlined = Default_inline)
| [] -> | [] ->
lapply lam (List.rev_map fst args) lapply lam (List.rev_map fst args)
in in
(build_apply lam [] (List.map (fun (l, x) -> may_map transl_exp x, Btype.is_optional l) sargs) : Lambda.lambda) (build_apply lam [] (List.map (fun (l, x) ->
may_map transl_exp x, Btype.is_optional l)
sargs)
: Lambda.lambda)
and transl_function loc untuplify_fn repr partial cases = and transl_function loc untuplify_fn repr partial cases =
match cases with match cases with

View File

@ -98,7 +98,8 @@ let rec apply_coercion strict restr arg =
(Lapply{ap_should_be_tailcall=false; (Lapply{ap_should_be_tailcall=false;
ap_loc=Location.none; ap_loc=Location.none;
ap_func=Lvar id; ap_func=Lvar id;
ap_args=[apply_coercion Alias cc_arg (Lvar param)]; ap_args=[apply_coercion Alias cc_arg
(Lvar param)];
ap_inlined=Default_inline; ap_inlined=Default_inline;
ap_specialised=Default_specialise})}) ap_specialised=Default_specialise})})
| Tcoerce_primitive { pc_loc; pc_desc; pc_env; pc_type; } -> | Tcoerce_primitive { pc_loc; pc_desc; pc_env; pc_type; } ->
@ -383,7 +384,8 @@ let rec transl_module cc rootpath mexp =
specialise = Default_specialise; specialise = Default_specialise;
is_a_functor = true }; is_a_functor = true };
body = Llet(Alias, param, body = Llet(Alias, param,
apply_coercion Alias ccarg (Lvar param'), apply_coercion Alias ccarg
(Lvar param'),
transl_module ccres bodypath body)} transl_module ccres bodypath body)}
| _ -> | _ ->
fatal_error "Translmod.transl_module") fatal_error "Translmod.transl_module")
@ -493,7 +495,8 @@ and transl_structure fields cc rootpath final_env = function
transl_module Tcoerce_none (field_path rootpath id) mb.mb_expr transl_module Tcoerce_none (field_path rootpath id) mb.mb_expr
in in
let module_body = let module_body =
Translattribute.add_inline_attribute module_body mb.mb_loc mb.mb_attributes Translattribute.add_inline_attribute module_body mb.mb_loc
mb.mb_attributes
in in
Llet(pure_module mb.mb_expr, id, Llet(pure_module mb.mb_expr, id,
module_body, module_body,
@ -527,7 +530,9 @@ and transl_structure fields cc rootpath final_env = function
[] -> [] ->
transl_structure newfields cc rootpath final_env rem transl_structure newfields cc rootpath final_env rem
| id :: ids -> | id :: ids ->
let body, size = rebind_idents (pos + 1) (id :: newfields) ids in let body, size =
rebind_idents (pos + 1) (id :: newfields) ids
in
Llet(Alias, id, Lprim(Pfield pos, [Lvar mid]), body), size Llet(Alias, id, Lprim(Pfield pos, [Lvar mid]), body), size
in in
let body, size = rebind_idents 0 fields ids in let body, size = rebind_idents 0 fields ids in
@ -650,7 +655,9 @@ let rec more_idents = function
| Tstr_class_type cl_list -> more_idents rem | Tstr_class_type cl_list -> more_idents rem
| Tstr_include _ -> more_idents rem | Tstr_include _ -> more_idents rem
| Tstr_module {mb_expr={mod_desc = Tmod_structure str}} | Tstr_module {mb_expr={mod_desc = Tmod_structure str}}
| Tstr_module{mb_expr={mod_desc = Tmod_constraint ({mod_desc = Tmod_structure str}, _, _, _)}} -> | Tstr_module{mb_expr={mod_desc =
Tmod_constraint ({mod_desc = Tmod_structure str},
_, _, _)}} ->
all_idents str.str_items @ more_idents rem all_idents str.str_items @ more_idents rem
| Tstr_module _ -> more_idents rem | Tstr_module _ -> more_idents rem
| Tstr_attribute _ -> more_idents rem | Tstr_attribute _ -> more_idents rem
@ -678,7 +685,10 @@ and all_idents = function
| Tstr_include incl -> | Tstr_include incl ->
bound_value_identifiers incl.incl_type @ all_idents rem bound_value_identifiers incl.incl_type @ all_idents rem
| Tstr_module {mb_id;mb_expr={mod_desc = Tmod_structure str}} | Tstr_module {mb_id;mb_expr={mod_desc = Tmod_structure str}}
| Tstr_module{mb_id; mb_expr={mod_desc = Tmod_constraint ({mod_desc = Tmod_structure str}, _, _, _)}} -> | Tstr_module{mb_id;
mb_expr={mod_desc =
Tmod_constraint ({mod_desc = Tmod_structure str},
_, _, _)}} ->
mb_id :: all_idents str.str_items @ all_idents rem mb_id :: all_idents str.str_items @ all_idents rem
| Tstr_module mb -> mb.mb_id :: all_idents rem | Tstr_module mb -> mb.mb_id :: all_idents rem
| Tstr_attribute _ -> all_idents rem | Tstr_attribute _ -> all_idents rem
@ -725,9 +735,12 @@ let transl_store_structure glob map prims str =
| Tstr_type(_, decls) -> | Tstr_type(_, decls) ->
transl_store rootpath subst rem transl_store rootpath subst rem
| Tstr_typext(tyext) -> | Tstr_typext(tyext) ->
let ids = List.map (fun ext -> ext.ext_id) tyext.tyext_constructors in let ids =
List.map (fun ext -> ext.ext_id) tyext.tyext_constructors
in
let lam = let lam =
transl_type_extension item.str_env rootpath tyext (store_idents ids) transl_type_extension item.str_env rootpath tyext
(store_idents ids)
in in
Lsequence(subst_lambda subst lam, Lsequence(subst_lambda subst lam,
transl_store rootpath (add_idents false ids subst) rem) transl_store rootpath (add_idents false ids subst) rem)
@ -742,7 +755,9 @@ let transl_store_structure glob map prims str =
mb_attributes} -> mb_attributes} ->
List.iter (Translattribute.check_attribute_on_module mexp) List.iter (Translattribute.check_attribute_on_module mexp)
mb_attributes; mb_attributes;
let lam = transl_store (field_path rootpath id) subst str.str_items in let lam =
transl_store (field_path rootpath id) subst str.str_items
in
(* Careful: see next case *) (* Careful: see next case *)
let subst = !transl_store_subst in let subst = !transl_store_subst in
Lsequence(lam, Lsequence(lam,
@ -752,8 +767,9 @@ let transl_store_structure glob map prims str =
List.map (fun id -> Lvar id) List.map (fun id -> Lvar id)
(defined_idents str.str_items))), (defined_idents str.str_items))),
Lsequence(store_ident id, Lsequence(store_ident id,
transl_store rootpath (add_ident true id subst) transl_store rootpath
rem))) (add_ident true id subst)
rem)))
| Tstr_module{ | Tstr_module{
mb_id=id; mb_id=id;
mb_expr= { mb_expr= {
@ -762,10 +778,13 @@ let transl_store_structure glob map prims str =
(Tcoerce_structure (map, _) as _cc))}; (Tcoerce_structure (map, _) as _cc))};
mb_attributes mb_attributes
} -> } ->
(* Format.printf "coerc id %s: %a@." (Ident.unique_name id) Includemod.print_coercion cc; *) (* Format.printf "coerc id %s: %a@." (Ident.unique_name id)
Includemod.print_coercion cc; *)
List.iter (Translattribute.check_attribute_on_module mexp) List.iter (Translattribute.check_attribute_on_module mexp)
mb_attributes; mb_attributes;
let lam = transl_store (field_path rootpath id) subst str.str_items in let lam =
transl_store (field_path rootpath id) subst str.str_items
in
(* Careful: see next case *) (* Careful: see next case *)
let subst = !transl_store_subst in let subst = !transl_store_subst in
let ids = Array.of_list (defined_idents str.str_items) in let ids = Array.of_list (defined_idents str.str_items) in
@ -781,8 +800,9 @@ let transl_store_structure glob map prims str =
(Lprim(Pmakeblock(0, Immutable), (Lprim(Pmakeblock(0, Immutable),
List.map field map)), List.map field map)),
Lsequence(store_ident id, Lsequence(store_ident id,
transl_store rootpath (add_ident true id subst) transl_store rootpath
rem))) (add_ident true id subst)
rem)))
| Tstr_module{mb_id=id; mb_expr=modl; mb_loc; mb_attributes} -> | Tstr_module{mb_id=id; mb_expr=modl; mb_loc; mb_attributes} ->
let lam = let lam =
Translattribute.add_inline_attribute Translattribute.add_inline_attribute
@ -955,7 +975,8 @@ let toplevel_name id =
let toploop_getvalue id = let toploop_getvalue id =
Lapply{ap_should_be_tailcall=false; Lapply{ap_should_be_tailcall=false;
ap_loc=Location.none; ap_loc=Location.none;
ap_func=Lprim(Pfield toploop_getvalue_pos, [Lprim(Pgetglobal toploop_ident, [])]); ap_func=Lprim(Pfield toploop_getvalue_pos,
[Lprim(Pgetglobal toploop_ident, [])]);
ap_args=[Lconst(Const_base(Const_string (toplevel_name id, None)))]; ap_args=[Lconst(Const_base(Const_string (toplevel_name id, None)))];
ap_inlined=Default_inline; ap_inlined=Default_inline;
ap_specialised=Default_specialise} ap_specialised=Default_specialise}
@ -963,8 +984,10 @@ let toploop_getvalue id =
let toploop_setvalue id lam = let toploop_setvalue id lam =
Lapply{ap_should_be_tailcall=false; Lapply{ap_should_be_tailcall=false;
ap_loc=Location.none; ap_loc=Location.none;
ap_func=Lprim(Pfield toploop_setvalue_pos, [Lprim(Pgetglobal toploop_ident, [])]); ap_func=Lprim(Pfield toploop_setvalue_pos,
ap_args=[Lconst(Const_base(Const_string (toplevel_name id, None))); lam]; [Lprim(Pgetglobal toploop_ident, [])]);
ap_args=[Lconst(Const_base(Const_string (toplevel_name id, None)));
lam];
ap_inlined=Default_inline; ap_inlined=Default_inline;
ap_specialised=Default_specialise} ap_specialised=Default_specialise}

View File

@ -26,4 +26,3 @@ val array_kind : Typedtree.expression -> Lambda.array_kind
val array_pattern_kind : Typedtree.pattern -> Lambda.array_kind val array_pattern_kind : Typedtree.pattern -> Lambda.array_kind
val bigarray_type_kind_and_layout : val bigarray_type_kind_and_layout :
Env.t -> Types.type_expr -> Lambda.bigarray_kind * Lambda.bigarray_layout Env.t -> Types.type_expr -> Lambda.bigarray_kind * Lambda.bigarray_layout

View File

@ -162,7 +162,7 @@ CAMLexport int caml_flush_partial(struct channel *channel)
CAMLassert (towrite >= 0); CAMLassert (towrite >= 0);
if (towrite > 0) { if (towrite > 0) {
written = caml_write_fd(channel->fd, channel->flags, written = caml_write_fd(channel->fd, channel->flags,
channel->buff, towrite); channel->buff, towrite);
channel->offset += written; channel->offset += written;
if (written < towrite) if (written < towrite)
memmove(channel->buff, channel->buff + written, towrite - written); memmove(channel->buff, channel->buff + written, towrite - written);
@ -207,7 +207,7 @@ CAMLexport int caml_putblock(struct channel *channel, char *p, intnat len)
memmove(channel->curr, p, free); memmove(channel->curr, p, free);
towrite = channel->end - channel->buff; towrite = channel->end - channel->buff;
written = caml_write_fd(channel->fd, channel->flags, written = caml_write_fd(channel->fd, channel->flags,
channel->buff, towrite); channel->buff, towrite);
if (written < towrite) if (written < towrite)
memmove(channel->buff, channel->buff + written, towrite - written); memmove(channel->buff, channel->buff + written, towrite - written);
channel->offset += written; channel->offset += written;
@ -257,7 +257,7 @@ CAMLexport unsigned char caml_refill(struct channel *channel)
int n; int n;
n = caml_read_fd(channel->fd, channel->flags, n = caml_read_fd(channel->fd, channel->flags,
channel->buff, channel->end - channel->buff); channel->buff, channel->end - channel->buff);
if (n == 0) caml_raise_end_of_file(); if (n == 0) caml_raise_end_of_file();
channel->offset += n; channel->offset += n;
channel->max = channel->buff + n; channel->max = channel->buff + n;
@ -295,7 +295,7 @@ CAMLexport int caml_getblock(struct channel *channel, char *p, intnat len)
return avail; return avail;
} else { } else {
nread = caml_read_fd(channel->fd, channel->flags, channel->buff, nread = caml_read_fd(channel->fd, channel->flags, channel->buff,
channel->end - channel->buff); channel->end - channel->buff);
channel->offset += nread; channel->offset += nread;
channel->max = channel->buff + nread; channel->max = channel->buff + nread;
if (n > nread) n = nread; if (n > nread) n = nread;
@ -365,7 +365,7 @@ CAMLexport intnat caml_input_scan_line(struct channel *channel)
} }
/* Fill the buffer as much as possible */ /* Fill the buffer as much as possible */
n = caml_read_fd(channel->fd, channel->flags, n = caml_read_fd(channel->fd, channel->flags,
channel->max, channel->end - channel->max); channel->max, channel->end - channel->max);
if (n == 0) { if (n == 0) {
/* End-of-file encountered. Return the number of characters in the /* End-of-file encountered. Return the number of characters in the
buffer, with negative sign since we haven't encountered buffer, with negative sign since we haven't encountered

View File

@ -131,7 +131,9 @@ MKEXE_BOOT=$(BYTECC) -o $(1) $(2)
### How to build a static library ### How to build a static library
MKLIB=rm -f $(1); $(TOOLPREF)ar rc $(1) $(2); $(RANLIB) $(1) MKLIB=rm -f $(1); $(TOOLPREF)ar rc $(1) $(2); $(RANLIB) $(1)
#ml let mklib out files opts = Printf.sprintf "rm -f %s && %sar rcs %s %s %s" out toolpref opts out files;; #ml let mklib out files opts =
#ml Printf.sprintf "rm -f %s && %sar rcs %s %s %s"
#ml out toolpref opts out files;;
### Canonicalize the name of a system library ### Canonicalize the name of a system library
SYSLIB=-l$(1) SYSLIB=-l$(1)

View File

@ -131,7 +131,9 @@ MKEXE_BOOT=$(BYTECC) -o $(1) $(2)
### How to build a static library ### How to build a static library
MKLIB=rm -f $(1); $(TOOLPREF)ar rc $(1) $(2); $(RANLIB) $(1) MKLIB=rm -f $(1); $(TOOLPREF)ar rc $(1) $(2); $(RANLIB) $(1)
#ml let mklib out files opts = Printf.sprintf "rm -f %s && %sar rcs %s %s %s" out toolpref opts out files;; #ml let mklib out files opts =
#ml Printf.sprintf "rm -f %s && %sar rcs %s %s %s"
#ml out toolpref opts out files;;
### Canonicalize the name of a system library ### Canonicalize the name of a system library
SYSLIB=-l$(1) SYSLIB=-l$(1)

View File

@ -121,12 +121,16 @@ MKEXE=$(FLEXLINK) -exe
MKMAINDLL=$(FLEXLINK) -maindll MKMAINDLL=$(FLEXLINK) -maindll
### Native command to build ocamlrun.exe without flexlink ### Native command to build ocamlrun.exe without flexlink
MERGEMANIFESTEXE=test ! -f $(1).manifest || mt -nologo -outputresource:$(1) -manifest $(1).manifest && rm -f $(1).manifest MERGEMANIFESTEXE=test ! -f $(1).manifest \
MKEXE_BOOT=$(BYTECC) /Fe$(1) $(2) /link /subsystem:console && ($(MERGEMANIFESTEXE)) || mt -nologo -outputresource:$(1) -manifest $(1).manifest \
&& rm -f $(1).manifest
MKEXE_BOOT=$(BYTECC) /Fe$(1) $(2) /link /subsystem:console \
&& ($(MERGEMANIFESTEXE))
### How to build a static library ### How to build a static library
MKLIB=link -lib -nologo -out:$(1) $(2) MKLIB=link -lib -nologo -out:$(1) $(2)
#ml let mklib out files opts = Printf.sprintf "link -lib -nologo -out:%s %s %s" out opts files;; #ml let mklib out files opts =
#ml Printf.sprintf "link -lib -nologo -out:%s %s %s" out opts files;;
MKSHAREDLIBRPATH= MKSHAREDLIBRPATH=
### Canonicalize the name of a system library ### Canonicalize the name of a system library

View File

@ -125,12 +125,17 @@ MKEXE=$(FLEXLINK) -exe
MKMAINDLL=$(FLEXLINK) -maindll MKMAINDLL=$(FLEXLINK) -maindll
### Native command to build ocamlrun.exe without flexlink ### Native command to build ocamlrun.exe without flexlink
MERGEMANIFESTEXE=test ! -f $(1).manifest || mt -nologo -outputresource:$(1) -manifest $(1).manifest && rm -f $(1).manifest MERGEMANIFESTEXE=test ! -f $(1).manifest \
MKEXE_BOOT=$(BYTECC) /Fe$(1) $(2) /link /subsystem:console && ($(MERGEMANIFESTEXE)) || mt -nologo -outputresource:$(1) -manifest $(1).manifest \
&& rm -f $(1).manifest
MKEXE_BOOT=$(BYTECC) /Fe$(1) $(2) /link /subsystem:console \
&& ($(MERGEMANIFESTEXE))
### How to build a static library ### How to build a static library
MKLIB=link -lib -nologo -machine:AMD64 /out:$(1) $(2) MKLIB=link -lib -nologo -machine:AMD64 /out:$(1) $(2)
#ml let mklib out files opts = Printf.sprintf "link -lib -nologo -machine:AMD64 -out:%s %s %s" out opts files;; #ml let mklib out files opts =
#ml Printf.sprintf "link -lib -nologo -machine:AMD64 -out:%s %s %s"
#ml out opts files;;
MKSHAREDLIBRPATH= MKSHAREDLIBRPATH=
### Canonicalize the name of a system library ### Canonicalize the name of a system library

24
configure vendored
View File

@ -321,7 +321,7 @@ case "$ccfamily" in
gcc-[012]-*) gcc-[012]-*)
# Some versions known to miscompile OCaml, e,g, 2.7.2.1, some 2.96. # Some versions known to miscompile OCaml, e,g, 2.7.2.1, some 2.96.
# Plus: C99 support unknown. # Plus: C99 support unknown.
err "This version of GCC is too old. Please use GCC version 4.2 or above.";; err "This version of GCC is too old. Please use GCC version 4.2 or above.";;
gcc-3-*|gcc-4-[01]) gcc-3-*|gcc-4-[01])
# No -fwrapv option before GCC 3.4. # No -fwrapv option before GCC 3.4.
# Known problems with -fwrapv fixed in 4.2 only. # Known problems with -fwrapv fixed in 4.2 only.
@ -841,8 +841,8 @@ case "$target" in
armv6t2*-*-linux-gnueabi) arch=arm; model=armv6t2; system=linux_eabi;; armv6t2*-*-linux-gnueabi) arch=arm; model=armv6t2; system=linux_eabi;;
armv6*-*-linux-gnueabi) arch=arm; model=armv6; system=linux_eabi;; armv6*-*-linux-gnueabi) arch=arm; model=armv6; system=linux_eabi;;
armv6*-*-freebsd*) arch=arm; model=armv6; system=freebsd;; armv6*-*-freebsd*) arch=arm; model=armv6; system=freebsd;;
earmv6*-*-netbsd*) arch=arm; model=armv6; system=netbsd;; earmv6*-*-netbsd*) arch=arm; model=armv6; system=netbsd;;
earmv7*-*-netbsd*) arch=arm; model=armv7; system=netbsd;; earmv7*-*-netbsd*) arch=arm; model=armv7; system=netbsd;;
armv5te*-*-linux-gnueabi) arch=arm; model=armv5te; system=linux_eabi;; armv5te*-*-linux-gnueabi) arch=arm; model=armv5te; system=linux_eabi;;
armv5*-*-linux-gnueabi) arch=arm; model=armv5; system=linux_eabi;; armv5*-*-linux-gnueabi) arch=arm; model=armv5; system=linux_eabi;;
arm*-*-linux-gnueabi) arch=arm; system=linux_eabi;; arm*-*-linux-gnueabi) arch=arm; system=linux_eabi;;
@ -1074,7 +1074,8 @@ if $with_instrumented_runtime; then
fi fi
done done
if ! $with_instrumented_runtime; then if ! $with_instrumented_runtime; then
err "clock_gettime functions not found. Instrumented runtime can't be built." err "clock_gettime functions not found. " \
"Instrumented runtime can't be built."
fi fi
fi fi
@ -1362,7 +1363,10 @@ fi
nargs=none nargs=none
for i in 5 6; do for i in 5 6; do
if sh ./trycompile -DSYS_${system} -DNUM_ARGS=${i} gethostbyname.c; then nargs=$i; break; fi if sh ./trycompile -DSYS_${system} -DNUM_ARGS=${i} gethostbyname.c; then
nargs=$i;
break;
fi
done done
if test $nargs != "none"; then if test $nargs != "none"; then
inf "gethostbyname_r() found (with ${nargs} arguments)." inf "gethostbyname_r() found (with ${nargs} arguments)."
@ -1371,7 +1375,10 @@ fi
nargs=none nargs=none
for i in 7 8; do for i in 7 8; do
if sh ./trycompile -DSYS_${system} -DNUM_ARGS=${i} gethostbyaddr.c; then nargs=$i; break; fi if sh ./trycompile -DSYS_${system} -DNUM_ARGS=${i} gethostbyaddr.c; then
nargs=$i;
break;
fi
done done
if test $nargs != "none"; then if test $nargs != "none"; then
inf "gethostbyaddr_r() found (with ${nargs} arguments)." inf "gethostbyaddr_r() found (with ${nargs} arguments)."
@ -1712,7 +1719,6 @@ if test "$with_frame_pointers" = "true"; then
;; ;;
*) err "Unsupported architecture with frame pointers";; *) err "Unsupported architecture with frame pointers";;
esac esac
fi fi
if $no_naked_pointers; then if $no_naked_pointers; then
@ -1751,8 +1757,8 @@ SYSLIB=-l\$(1)
### How to build a static library ### How to build a static library
MKLIB=${TOOLPREF}ar rc \$(1) \$(2); ${TOOLPREF}ranlib \$(1) MKLIB=${TOOLPREF}ar rc \$(1) \$(2); ${TOOLPREF}ranlib \$(1)
#ml let mklib out files opts = #ml let mklib out files opts =
#ml Printf.sprintf "${TOOLPREF}ar rc %s %s %s; #ml Printf.sprintf "${TOOLPREF}ar rc %s %s %s; ${TOOLPREF}ranlib %s"
#ml ${TOOLPREF}ranlib %s" out opts files out;; #ml out opts files out;;
EOF EOF
echo "ARCH=$arch" >> Makefile echo "ARCH=$arch" >> Makefile
echo "MODEL=$model" >> Makefile echo "MODEL=$model" >> Makefile

View File

@ -17,7 +17,12 @@ CAMLRUN ?= ../boot/ocamlrun
CAMLYACC ?= ../boot/ocamlyacc CAMLYACC ?= ../boot/ocamlyacc
CAMLC=$(CAMLRUN) ../boot/ocamlc -I ../boot CAMLC=$(CAMLRUN) ../boot/ocamlc -I ../boot
CAMLOPT=$(if $(wildcard ../flexdll/Makefile),OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe") $(CAMLRUN) ../ocamlopt -I ../stdlib ifeq "$(wildcard ../flexdll/Makefile)" ""
FLEXLINK_ENV=
else
FLEXLINK_ENV=OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe"
endif
CAMLOPT=$(FLEXLINK_ENV) $(CAMLRUN) ../ocamlopt -I ../stdlib
COMPFLAGS=-warn-error A COMPFLAGS=-warn-error A
LINKFLAGS= LINKFLAGS=
YACCFLAGS=-v YACCFLAGS=-v

View File

@ -1,9 +1,20 @@
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). The present documentation is copyright Institut National de Recherche
en Informatique et en Automatique (INRIA).
The OCaml documentation and user's manual may be reproduced and distributed in whole or in part, subject to the following conditions: The OCaml documentation and user's manual may be reproduced and
distributed in whole or in part, subject to the following conditions:
- The copyright notice above and this permission notice must be preserved complete on all complete or partial copies. - The copyright notice above and this permission notice must be
- Any translation or derivative work of the OCaml documentation and user's manual must be approved by the authors in writing before distribution. preserved complete on all complete or partial copies.
- If you distribute the OCaml documentation and user's manual in part, instructions for obtaining the complete version of this manual must be included, and a means for obtaining a complete version provided.
- Small portions may be reproduced as illustrations for reviews or quotes in other works without this permission notice if proper citation is given.
- Any translation or derivative work of the OCaml documentation and
user's manual must be approved by the authors in writing before
distribution.
- If you distribute the OCaml documentation and user's manual in part,
instructions for obtaining the complete version of this manual must
be included, and a means for obtaining a complete version provided.
- Small portions may be reproduced as illustrations for reviews or
quotes in other works without this permission notice if proper
citation is given.

View File

@ -46,7 +46,7 @@ close(ML);
open(TOPLEVEL, "$camllight 2>&1 < .input.ml |") || open(TOPLEVEL, "$camllight 2>&1 < .input.ml |") ||
die("Cannot start camllight : $!"); die("Cannot start camllight : $!");
<TOPLEVEL>; <TOPLEVEL>; # skip the banner <TOPLEVEL>; <TOPLEVEL>; # skip the banner
$lastread = <TOPLEVEL>; $lastread = <TOPLEVEL>;
$lastread =~ s/^# //; $lastread =~ s/^# //;

View File

@ -18,7 +18,13 @@ CAMLYACC ?= ../boot/ocamlyacc
########################## ##########################
ROOTDIR = .. ROOTDIR = ..
OCAMLC = $(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib OCAMLC = $(CAMLRUN) $(ROOTDIR)/ocamlc -nostdlib -I $(ROOTDIR)/stdlib
OCAMLOPT = $(if $(wildcard $(ROOTDIR)/flexdll/Makefile),OCAML_FLEXLINK="$(ROOTDIR)/boot/ocamlrun $(ROOTDIR)/flexdll/flexlink.exe") $(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib -I $(ROOTDIR)/stdlib ifeq "$(wildcard $(ROOTDIR)/flexdll/Makefile)" ""
FLEXLINK_ENV=
else
FLEXLINK_ENV=OCAML_FLEXLINK="$(ROOTDIR)/boot/ocamlrun $(ROOTDIR)/flexdll/flexlink.exe"
endif
OCAMLOPT = $(FLEXLINK_ENV) $(CAMLRUN) $(ROOTDIR)/ocamlopt -nostdlib \
-I $(ROOTDIR)/stdlib
OCAMLDEP = $(CAMLRUN) $(ROOTDIR)/tools/ocamldep OCAMLDEP = $(CAMLRUN) $(ROOTDIR)/tools/ocamldep
OCAMLLEX = $(CAMLRUN) $(ROOTDIR)/boot/ocamllex OCAMLLEX = $(CAMLRUN) $(ROOTDIR)/boot/ocamllex
OCAMLLIB = $(LIBDIR) OCAMLLIB = $(LIBDIR)

View File

@ -779,9 +779,23 @@ module Analyser =
pos_limit2 pos_limit2
type_decl type_decl
in in
print_DEBUG ("Type "^name.txt^" : "^(match assoc_com with None -> "sans commentaire" | Some c -> Odoc_misc.string_of_info c)); (* DEBUG *) begin
let f_DEBUG (name, c_opt) = print_DEBUG ("constructor/field "^name^": "^(match c_opt with None -> "sans commentaire" | Some c -> Odoc_misc.string_of_info c)) in (* DEBUG *) let comm =
List.iter f_DEBUG name_comment_list; (* DEBUG *) match assoc_com with
(* DEBUG *) | None -> "sans commentaire"
(* DEBUG *) | Some c -> Odoc_misc.string_of_info c
(* DEBUG *) in
(* DEBUG *) print_DEBUG ("Type "^name.txt^" : "^comm);
(* DEBUG *) let f_DEBUG (name, c_opt) =
(* DEBUG *) let comm =
(* DEBUG *) match c_opt with
(* DEBUG *) | None -> "sans commentaire"
(* DEBUG *) | Some c -> Odoc_misc.string_of_info c
(* DEBUG *) in
(* DEBUG *) print_DEBUG ("constructor/field "^name^": "^comm)
(* DEBUG *) in
(* DEBUG *) List.iter f_DEBUG name_comment_list;
(* DEBUG *) end
(* get the information for the type in the signature *) (* get the information for the type in the signature *)
let sig_type_decl = let sig_type_decl =
try Signature_search.search_type table name.txt try Signature_search.search_type table name.txt

View File

@ -15,9 +15,11 @@
include ../Makefile include ../Makefile
export OCAML_FLEXLINK:=$(if $(wildcard $(ROOTDIR)/flexdll/Makefile),$(ROOTDIR)/boot/ocamlrun $(ROOTDIR)/flexdll/flexlink.exe) ifeq "$(wildcard $(ROOTDIR)/flexdll/Makefile" ""
export OCAML_FLEXLINK:=
# The Unix version now works fine under Windows else
export OCAML_FLEXLINK:=$(ROOTDIR)/boot/ocamlrun $(ROOTDIR)/flexdll/flexlink.exe
endif
# Note .. is the current directory (this makefile is included from # Note .. is the current directory (this makefile is included from
# a subdirectory) # a subdirectory)

View File

@ -11,8 +11,6 @@
# # # #
######################################################################### #########################################################################
# $Id$
# Makefile for the "num" (exact rational arithmetic) library # Makefile for the "num" (exact rational arithmetic) library
LIBNAME=nums LIBNAME=nums

View File

@ -11,8 +11,6 @@
# # # #
######################################################################### #########################################################################
# $Id$
# Makefile for the "num" (exact rational arithmetic) library # Makefile for the "num" (exact rational arithmetic) library
LIBNAME=nums LIBNAME=nums

View File

@ -438,9 +438,12 @@ let sys_big_int_of_string_base s ofs len sgn =
if len < 2 then sys_big_int_of_string_aux s ofs len sgn 10 if len < 2 then sys_big_int_of_string_aux s ofs len sgn 10
else else
match (s.[ofs], s.[ofs+1]) with match (s.[ofs], s.[ofs+1]) with
| ('0', 'x') | ('0', 'X') -> sys_big_int_of_string_aux s (ofs+2) (len-2) sgn 16 | ('0', 'x') | ('0', 'X') ->
| ('0', 'o') | ('0', 'O') -> sys_big_int_of_string_aux s (ofs+2) (len-2) sgn 8 sys_big_int_of_string_aux s (ofs+2) (len-2) sgn 16
| ('0', 'b') | ('0', 'B') -> sys_big_int_of_string_aux s (ofs+2) (len-2) sgn 2 | ('0', 'o') | ('0', 'O') ->
sys_big_int_of_string_aux s (ofs+2) (len-2) sgn 8
| ('0', 'b') | ('0', 'B') ->
sys_big_int_of_string_aux s (ofs+2) (len-2) sgn 2
| _ -> sys_big_int_of_string_aux s ofs len sgn 10 | _ -> sys_big_int_of_string_aux s ofs len sgn 10
;; ;;
@ -733,7 +736,8 @@ let two_power_m1_big_int n =
let shift_right_big_int bi n = let shift_right_big_int bi n =
if n < 0 then invalid_arg "shift_right_big_int" if n < 0 then invalid_arg "shift_right_big_int"
else if bi.sign >= 0 then shift_right_towards_zero_big_int bi n else if bi.sign >= 0 then shift_right_towards_zero_big_int bi n
else shift_right_towards_zero_big_int (sub_big_int bi (two_power_m1_big_int n)) n else
shift_right_towards_zero_big_int (sub_big_int bi (two_power_m1_big_int n)) n
(* Extract N bits starting at ofs. (* Extract N bits starting at ofs.
Treats bi in two's complement. Treats bi in two's complement.
@ -875,4 +879,3 @@ let float_of_big_int x =
(* Round to float and apply exponent *) (* Round to float and apply exponent *)
ldexp (round_big_int_to_float top exact) n ldexp (round_big_int_to_float top exact) n
end end

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
#include "bng.h" #include "bng.h"
#include "caml/config.h" #include "caml/config.h"

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
#include <string.h> #include <string.h>
#include "caml/config.h" #include "caml/config.h"

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
/* Code specific to the AMD x86_64 architecture. */ /* Code specific to the AMD x86_64 architecture. */
#define BngAdd2(res,carryout,arg1,arg2) \ #define BngAdd2(res,carryout,arg1,arg2) \

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
/**** Generic operations on digits ****/ /**** Generic operations on digits ****/
/* These macros can be defined in the machine-specific include file. /* These macros can be defined in the machine-specific include file.

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
/* Code specific to the Intel IA32 (x86) architecture. */ /* Code specific to the Intel IA32 (x86) architecture. */
#define BngAdd2(res,carryout,arg1,arg2) \ #define BngAdd2(res,carryout,arg1,arg2) \

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
/* Code specific to the PowerPC architecture. */ /* Code specific to the PowerPC architecture. */
#define BngAdd2(res,carryout,arg1,arg2) \ #define BngAdd2(res,carryout,arg1,arg2) \

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
/* Code specific to the SPARC (V8 and above) architecture. */ /* Code specific to the SPARC (V8 and above) architecture. */
#define BngAdd2(res,carryout,arg1,arg2) \ #define BngAdd2(res,carryout,arg1,arg2) \

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
/* Nats are represented as unstructured blocks with tag Custom_tag. */ /* Nats are represented as unstructured blocks with tag Custom_tag. */
#define Digit_val(nat,pos) (((bng) Data_custom_val(nat))[pos]) #define Digit_val(nat,pos) (((bng) Data_custom_val(nat))[pos])

View File

@ -20,28 +20,44 @@ external set_to_zero_nat: nat -> int -> int -> unit = "set_to_zero_nat"
external blit_nat: nat -> int -> nat -> int -> int -> unit = "blit_nat" external blit_nat: nat -> int -> nat -> int -> int -> unit = "blit_nat"
external set_digit_nat: nat -> int -> int -> unit = "set_digit_nat" external set_digit_nat: nat -> int -> int -> unit = "set_digit_nat"
external nth_digit_nat: nat -> int -> int = "nth_digit_nat" external nth_digit_nat: nat -> int -> int = "nth_digit_nat"
external set_digit_nat_native: nat -> int -> nativeint -> unit = "set_digit_nat_native" external set_digit_nat_native: nat -> int -> nativeint -> unit
= "set_digit_nat_native"
external nth_digit_nat_native: nat -> int -> nativeint = "nth_digit_nat_native" external nth_digit_nat_native: nat -> int -> nativeint = "nth_digit_nat_native"
external num_digits_nat: nat -> int -> int -> int = "num_digits_nat" external num_digits_nat: nat -> int -> int -> int = "num_digits_nat"
external num_leading_zero_bits_in_digit: nat -> int -> int = "num_leading_zero_bits_in_digit" external num_leading_zero_bits_in_digit: nat -> int -> int
= "num_leading_zero_bits_in_digit"
external is_digit_int: nat -> int -> bool = "is_digit_int" external is_digit_int: nat -> int -> bool = "is_digit_int"
external is_digit_zero: nat -> int -> bool = "is_digit_zero" external is_digit_zero: nat -> int -> bool = "is_digit_zero"
external is_digit_normalized: nat -> int -> bool = "is_digit_normalized" external is_digit_normalized: nat -> int -> bool = "is_digit_normalized"
external is_digit_odd: nat -> int -> bool = "is_digit_odd" external is_digit_odd: nat -> int -> bool = "is_digit_odd"
external incr_nat: nat -> int -> int -> int -> int = "incr_nat" external incr_nat: nat -> int -> int -> int -> int = "incr_nat"
external add_nat: nat -> int -> int -> nat -> int -> int -> int -> int = "add_nat" "add_nat_native" external add_nat: nat -> int -> int -> nat -> int -> int -> int -> int
= "add_nat" "add_nat_native"
external complement_nat: nat -> int -> int -> unit = "complement_nat" external complement_nat: nat -> int -> int -> unit = "complement_nat"
external decr_nat: nat -> int -> int -> int -> int = "decr_nat" external decr_nat: nat -> int -> int -> int -> int = "decr_nat"
external sub_nat: nat -> int -> int -> nat -> int -> int -> int -> int = "sub_nat" "sub_nat_native" external sub_nat: nat -> int -> int -> nat -> int -> int -> int -> int
external mult_digit_nat: nat -> int -> int -> nat -> int -> int -> nat -> int -> int = "mult_digit_nat" "mult_digit_nat_native" = "sub_nat" "sub_nat_native"
external mult_nat: nat -> int -> int -> nat -> int -> int -> nat -> int -> int -> int = "mult_nat" "mult_nat_native" external mult_digit_nat:
external square_nat: nat -> int -> int -> nat -> int -> int -> int = "square_nat" "square_nat_native" nat -> int -> int -> nat -> int -> int -> nat -> int -> int
external shift_left_nat: nat -> int -> int -> nat -> int -> int -> unit = "shift_left_nat" "shift_left_nat_native" = "mult_digit_nat" "mult_digit_nat_native"
external div_digit_nat: nat -> int -> nat -> int -> nat -> int -> int -> nat -> int -> unit = "div_digit_nat" "div_digit_nat_native" external mult_nat:
external div_nat: nat -> int -> int -> nat -> int -> int -> unit = "div_nat" "div_nat_native" nat -> int -> int -> nat -> int -> int -> nat -> int -> int -> int
external shift_right_nat: nat -> int -> int -> nat -> int -> int -> unit = "shift_right_nat" "shift_right_nat_native" = "mult_nat" "mult_nat_native"
external compare_digits_nat: nat -> int -> nat -> int -> int = "compare_digits_nat" external square_nat: nat -> int -> int -> nat -> int -> int -> int
external compare_nat: nat -> int -> int -> nat -> int -> int -> int = "compare_nat" "compare_nat_native" = "square_nat" "square_nat_native"
external shift_left_nat: nat -> int -> int -> nat -> int -> int -> unit
= "shift_left_nat" "shift_left_nat_native"
external div_digit_nat:
nat -> int -> nat -> int -> nat -> int -> int -> nat -> int -> unit
= "div_digit_nat" "div_digit_nat_native"
external div_nat: nat -> int -> int -> nat -> int -> int -> unit
= "div_nat" "div_nat_native"
external shift_right_nat: nat -> int -> int -> nat -> int -> int -> unit
= "shift_right_nat" "shift_right_nat_native"
external compare_digits_nat: nat -> int -> nat -> int -> int
= "compare_digits_nat"
external compare_nat: nat -> int -> int -> nat -> int -> int -> int
= "compare_nat" "compare_nat_native"
external land_digit_nat: nat -> int -> nat -> int -> unit = "land_digit_nat" external land_digit_nat: nat -> int -> nat -> int -> unit = "land_digit_nat"
external lor_digit_nat: nat -> int -> nat -> int -> unit = "lor_digit_nat" external lor_digit_nat: nat -> int -> nat -> int -> unit = "lor_digit_nat"
external lxor_digit_nat: nat -> int -> nat -> int -> unit = "lxor_digit_nat" external lxor_digit_nat: nat -> int -> nat -> int -> unit = "lxor_digit_nat"

View File

@ -25,11 +25,13 @@ external blit_nat: nat -> int -> nat -> int -> int -> unit = "blit_nat"
val copy_nat: nat -> int -> int -> nat val copy_nat: nat -> int -> int -> nat
external set_digit_nat: nat -> int -> int -> unit = "set_digit_nat" external set_digit_nat: nat -> int -> int -> unit = "set_digit_nat"
external nth_digit_nat: nat -> int -> int = "nth_digit_nat" external nth_digit_nat: nat -> int -> int = "nth_digit_nat"
external set_digit_nat_native: nat -> int -> nativeint -> unit = "set_digit_nat_native" external set_digit_nat_native: nat -> int -> nativeint -> unit
= "set_digit_nat_native"
external nth_digit_nat_native: nat -> int -> nativeint = "nth_digit_nat_native" external nth_digit_nat_native: nat -> int -> nativeint = "nth_digit_nat_native"
val length_nat : nat -> int val length_nat : nat -> int
external num_digits_nat: nat -> int -> int -> int = "num_digits_nat" external num_digits_nat: nat -> int -> int -> int = "num_digits_nat"
external num_leading_zero_bits_in_digit: nat -> int -> int = "num_leading_zero_bits_in_digit" external num_leading_zero_bits_in_digit: nat -> int -> int
= "num_leading_zero_bits_in_digit"
external is_digit_int: nat -> int -> bool = "is_digit_int" external is_digit_int: nat -> int -> bool = "is_digit_int"
external is_digit_zero: nat -> int -> bool = "is_digit_zero" external is_digit_zero: nat -> int -> bool = "is_digit_zero"
external is_digit_normalized: nat -> int -> bool = "is_digit_normalized" external is_digit_normalized: nat -> int -> bool = "is_digit_normalized"
@ -39,19 +41,33 @@ val is_nat_int: nat -> int -> int -> bool
val int_of_nat: nat -> int val int_of_nat: nat -> int
val nat_of_int: int -> nat val nat_of_int: int -> nat
external incr_nat: nat -> int -> int -> int -> int = "incr_nat" external incr_nat: nat -> int -> int -> int -> int = "incr_nat"
external add_nat: nat -> int -> int -> nat -> int -> int -> int -> int = "add_nat" "add_nat_native" external add_nat: nat -> int -> int -> nat -> int -> int -> int -> int
= "add_nat" "add_nat_native"
external complement_nat: nat -> int -> int -> unit = "complement_nat" external complement_nat: nat -> int -> int -> unit = "complement_nat"
external decr_nat: nat -> int -> int -> int -> int = "decr_nat" external decr_nat: nat -> int -> int -> int -> int = "decr_nat"
external sub_nat: nat -> int -> int -> nat -> int -> int -> int -> int = "sub_nat" "sub_nat_native" external sub_nat: nat -> int -> int -> nat -> int -> int -> int -> int
external mult_digit_nat: nat -> int -> int -> nat -> int -> int -> nat -> int -> int = "mult_digit_nat" "mult_digit_nat_native" = "sub_nat" "sub_nat_native"
external mult_nat: nat -> int -> int -> nat -> int -> int -> nat -> int -> int -> int = "mult_nat" "mult_nat_native" external mult_digit_nat:
external square_nat: nat -> int -> int -> nat -> int -> int -> int = "square_nat" "square_nat_native" nat -> int -> int -> nat -> int -> int -> nat -> int -> int
external shift_left_nat: nat -> int -> int -> nat -> int -> int -> unit = "shift_left_nat" "shift_left_nat_native" = "mult_digit_nat" "mult_digit_nat_native"
external div_digit_nat: nat -> int -> nat -> int -> nat -> int -> int -> nat -> int -> unit = "div_digit_nat" "div_digit_nat_native" external mult_nat:
external div_nat: nat -> int -> int -> nat -> int -> int -> unit = "div_nat" "div_nat_native" nat -> int -> int -> nat -> int -> int -> nat -> int -> int -> int
external shift_right_nat: nat -> int -> int -> nat -> int -> int -> unit = "shift_right_nat" "shift_right_nat_native" = "mult_nat" "mult_nat_native"
external compare_digits_nat: nat -> int -> nat -> int -> int = "compare_digits_nat" external square_nat: nat -> int -> int -> nat -> int -> int -> int
external compare_nat: nat -> int -> int -> nat -> int -> int -> int = "compare_nat" "compare_nat_native" = "square_nat" "square_nat_native"
external shift_left_nat: nat -> int -> int -> nat -> int -> int -> unit
= "shift_left_nat" "shift_left_nat_native"
external div_digit_nat:
nat -> int -> nat -> int -> nat -> int -> int -> nat -> int -> unit
= "div_digit_nat" "div_digit_nat_native"
external div_nat: nat -> int -> int -> nat -> int -> int -> unit
= "div_nat" "div_nat_native"
external shift_right_nat: nat -> int -> int -> nat -> int -> int -> unit
= "shift_right_nat" "shift_right_nat_native"
external compare_digits_nat: nat -> int -> nat -> int -> int
= "compare_digits_nat"
external compare_nat: nat -> int -> int -> nat -> int -> int -> int
= "compare_nat" "compare_nat_native"
val eq_nat : nat -> int -> int -> nat -> int -> int -> bool val eq_nat : nat -> int -> int -> nat -> int -> int -> bool
val le_nat : nat -> int -> int -> nat -> int -> int -> bool val le_nat : nat -> int -> int -> nat -> int -> int -> bool
val lt_nat : nat -> int -> int -> nat -> int -> int -> bool val lt_nat : nat -> int -> int -> nat -> int -> int -> bool

View File

@ -11,8 +11,6 @@
/* */ /* */
/***********************************************************************/ /***********************************************************************/
/* $Id$ */
#include "caml/alloc.h" #include "caml/alloc.h"
#include "caml/config.h" #include "caml/config.h"
#include "caml/custom.h" #include "caml/custom.h"
@ -123,7 +121,8 @@ CAMLprim value is_digit_zero(value nat, value ofs)
CAMLprim value is_digit_normalized(value nat, value ofs) CAMLprim value is_digit_normalized(value nat, value ofs)
{ {
return return
Val_bool(Digit_val(nat, Long_val(ofs)) & ((bngdigit)1 << (BNG_BITS_PER_DIGIT-1))); Val_bool(Digit_val(nat, Long_val(ofs))
& ((bngdigit)1 << (BNG_BITS_PER_DIGIT-1)));
} }
CAMLprim value is_digit_odd(value nat, value ofs) CAMLprim value is_digit_odd(value nat, value ofs)

View File

@ -27,7 +27,11 @@ endif
MKLIB=$(CAMLRUN) ../../tools/ocamlmklib MKLIB=$(CAMLRUN) ../../tools/ocamlmklib
CFLAGS=-I../../byterun $(EXTRACFLAGS) CFLAGS=-I../../byterun $(EXTRACFLAGS)
export OCAML_FLEXLINK:=$(if $(wildcard ../../flexdll/Makefile),../../boot/ocamlrun ../../flexdll/flexlink.exe) ifeq "$(wildcard ../../flexdll/Makefile)" ""
export OCAML_FLEXLINK:=
else
export OCAML_FLEXLINK:=../../boot/ocamlrun ../../flexdll/flexlink.exe
endif
CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo
CMIFILES=$(CAMLOBJS:.cmo=.cmi) CMIFILES=$(CAMLOBJS:.cmo=.cmi)

View File

@ -312,4 +312,3 @@ void caml_unix_check_path(value path, char * cmdname)
{ {
if (! caml_string_is_c_safe(path)) unix_error(ENOENT, cmdname, path); if (! caml_string_is_c_safe(path)) unix_error(ENOENT, cmdname, path);
} }

View File

@ -91,4 +91,3 @@ CAMLprim value unix_utimes(value path, value atime, value mtime)
{ invalid_argument("utimes not implemented"); } { invalid_argument("utimes not implemented"); }
#endif #endif

View File

@ -63,7 +63,8 @@ let check_deprecated loc attrs s =
match deprecated_of_attrs attrs with match deprecated_of_attrs attrs with
| None -> () | None -> ()
| Some "" -> Location.prerr_warning loc (Warnings.Deprecated s) | Some "" -> Location.prerr_warning loc (Warnings.Deprecated s)
| Some txt -> Location.prerr_warning loc (Warnings.Deprecated (s ^ "\n" ^ txt)) | Some txt ->
Location.prerr_warning loc (Warnings.Deprecated (s ^ "\n" ^ txt))
let rec check_deprecated_mutable loc attrs s = let rec check_deprecated_mutable loc attrs s =
match attrs with match attrs with
@ -173,7 +174,8 @@ let with_warning_attribute attrs f =
let warn_on_literal_pattern = let warn_on_literal_pattern =
List.exists List.exists
(function (function
| ({txt="ocaml.warn_on_literal_pattern"|"warn_on_literal_pattern"; _}, _) -> true | ({txt="ocaml.warn_on_literal_pattern"|"warn_on_literal_pattern"; _}, _)
-> true
| _ -> false | _ -> false
) )

View File

@ -28,7 +28,8 @@ val deprecated_of_attrs: Parsetree.attributes -> string option
val deprecated_of_sig: Parsetree.signature -> string option val deprecated_of_sig: Parsetree.signature -> string option
val deprecated_of_str: Parsetree.structure -> string option val deprecated_of_str: Parsetree.structure -> string option
val check_deprecated_mutable: Location.t -> Parsetree.attributes -> string -> unit val check_deprecated_mutable:
Location.t -> Parsetree.attributes -> string -> unit
val error_of_extension: Parsetree.extension -> Location.error val error_of_extension: Parsetree.extension -> Location.error

View File

@ -775,7 +775,8 @@ module_expr:
{ mkmod ~attrs:$3 { mkmod ~attrs:$3
(Pmod_unpack( (Pmod_unpack(
ghexp(Pexp_constraint($4, ghtyp(Ptyp_package $6))))) } ghexp(Pexp_constraint($4, ghtyp(Ptyp_package $6))))) }
| LPAREN VAL attributes expr COLON package_type COLONGREATER package_type RPAREN | LPAREN VAL attributes expr COLON package_type COLONGREATER package_type
RPAREN
{ mkmod ~attrs:$3 { mkmod ~attrs:$3
(Pmod_unpack( (Pmod_unpack(
ghexp(Pexp_coerce($4, Some(ghtyp(Ptyp_package $6)), ghexp(Pexp_coerce($4, Some(ghtyp(Ptyp_package $6)),
@ -864,7 +865,8 @@ module_binding:
; ;
rec_module_bindings: rec_module_bindings:
rec_module_binding { let (b, ext) = $1 in ([b], ext) } rec_module_binding { let (b, ext) = $1 in ([b], ext) }
| rec_module_bindings and_module_binding { let (l, ext) = $1 in ($2 :: l, ext) } | rec_module_bindings and_module_binding
{ let (l, ext) = $1 in ($2 :: l, ext) }
; ;
rec_module_binding: rec_module_binding:
MODULE ext_attributes REC UIDENT module_binding_body post_item_attributes MODULE ext_attributes REC UIDENT module_binding_body post_item_attributes
@ -989,8 +991,10 @@ module_alias:
, ext } , ext }
; ;
rec_module_declarations: rec_module_declarations:
rec_module_declaration { let (body, ext) = $1 in ([body], ext) } rec_module_declaration
| rec_module_declarations and_module_declaration { let (l, ext) = $1 in ($2 :: l, ext) } { let (body, ext) = $1 in ([body], ext) }
| rec_module_declarations and_module_declaration
{ let (l, ext) = $1 in ($2 :: l, ext) }
; ;
rec_module_declaration: rec_module_declaration:
MODULE ext_attributes REC UIDENT COLON module_type post_item_attributes MODULE ext_attributes REC UIDENT COLON module_type post_item_attributes
@ -1009,7 +1013,8 @@ module_type_declaration_body:
| EQUAL module_type { Some $2 } | EQUAL module_type { Some $2 }
; ;
module_type_declaration: module_type_declaration:
MODULE TYPE ext_attributes ident module_type_declaration_body post_item_attributes MODULE TYPE ext_attributes ident module_type_declaration_body
post_item_attributes
{ let (ext, attrs) = $3 in { let (ext, attrs) = $3 in
Mtd.mk (mkrhs $4 4) ?typ:$5 ~attrs:(attrs@$6) Mtd.mk (mkrhs $4 4) ?typ:$5 ~attrs:(attrs@$6)
~loc:(symbol_rloc()) ~docs:(symbol_docs ()) ~loc:(symbol_rloc()) ~docs:(symbol_docs ())
@ -1018,12 +1023,14 @@ module_type_declaration:
/* Class expressions */ /* Class expressions */
class_declarations: class_declarations:
class_declaration { let (body, ext) = $1 in ([body], ext) } class_declaration
| class_declarations and_class_declaration { let (l, ext) = $1 in ($2 :: l, ext) } { let (body, ext) = $1 in ([body], ext) }
| class_declarations and_class_declaration
{ let (l, ext) = $1 in ($2 :: l, ext) }
; ;
class_declaration: class_declaration:
CLASS ext_attributes virtual_flag class_type_parameters LIDENT class_fun_binding CLASS ext_attributes virtual_flag class_type_parameters LIDENT
post_item_attributes class_fun_binding post_item_attributes
{ let (ext, attrs) = $2 in { let (ext, attrs) = $2 in
Ci.mk (mkrhs $5 5) $6 ~virt:$3 ~params:$4 ~attrs:(attrs@$7) Ci.mk (mkrhs $5 5) $6 ~virt:$3 ~params:$4 ~attrs:(attrs@$7)
~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) ~loc:(symbol_rloc ()) ~docs:(symbol_docs ())
@ -1105,7 +1112,8 @@ class_fields:
{ $2 :: (text_cstr 2) @ $1 } { $2 :: (text_cstr 2) @ $1 }
; ;
class_field: class_field:
| INHERIT override_flag attributes class_expr parent_binder post_item_attributes | INHERIT override_flag attributes class_expr parent_binder
post_item_attributes
{ mkcf (Pcf_inherit ($2, $4, $5)) ~attrs:($3@$6) ~docs:(symbol_docs ()) } { mkcf (Pcf_inherit ($2, $4, $5)) ~attrs:($3@$6) ~docs:(symbol_docs ()) }
| VAL attributes value post_item_attributes | VAL attributes value post_item_attributes
{ mkcf (Pcf_val $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) } { mkcf (Pcf_val $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) }
@ -1240,12 +1248,14 @@ constrain_field:
core_type EQUAL core_type { $1, $3 } core_type EQUAL core_type { $1, $3 }
; ;
class_descriptions: class_descriptions:
class_description { let (body, ext) = $1 in ([body],ext) } class_description
| class_descriptions and_class_description { let (l, ext) = $1 in ($2 :: l, ext) } { let (body, ext) = $1 in ([body],ext) }
| class_descriptions and_class_description
{ let (l, ext) = $1 in ($2 :: l, ext) }
; ;
class_description: class_description:
CLASS ext_attributes virtual_flag class_type_parameters LIDENT COLON class_type CLASS ext_attributes virtual_flag class_type_parameters LIDENT COLON
post_item_attributes class_type post_item_attributes
{ let (ext, attrs) = $2 in { let (ext, attrs) = $2 in
Ci.mk (mkrhs $5 5) $7 ~virt:$3 ~params:$4 ~attrs:$8 Ci.mk (mkrhs $5 5) $7 ~virt:$3 ~params:$4 ~attrs:$8
~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) ~loc:(symbol_rloc ()) ~docs:(symbol_docs ())
@ -1259,8 +1269,10 @@ and_class_description:
~text:(symbol_text ()) ~docs:(symbol_docs ()) } ~text:(symbol_text ()) ~docs:(symbol_docs ()) }
; ;
class_type_declarations: class_type_declarations:
class_type_declaration { let (body, ext) = $1 in ([body],ext) } class_type_declaration
| class_type_declarations and_class_type_declaration { let (l, ext) = $1 in ($2 :: l, ext) } { let (body, ext) = $1 in ([body],ext) }
| class_type_declarations and_class_type_declaration
{ let (l, ext) = $1 in ($2 :: l, ext) }
; ;
class_type_declaration: class_type_declaration:
CLASS TYPE ext_attributes virtual_flag class_type_parameters LIDENT EQUAL CLASS TYPE ext_attributes virtual_flag class_type_parameters LIDENT EQUAL
@ -1547,7 +1559,8 @@ simple_expr:
$3 } $3 }
| LPAREN MODULE ext_attributes module_expr COLON error | LPAREN MODULE ext_attributes module_expr COLON error
{ unclosed "(" 1 ")" 6 } { unclosed "(" 1 ")" 6 }
| mod_longident DOT LPAREN MODULE ext_attributes module_expr COLON package_type RPAREN | mod_longident DOT LPAREN MODULE ext_attributes module_expr COLON
package_type RPAREN
{ mkexp(Pexp_open(Fresh, mkrhs $1 1, { mkexp(Pexp_open(Fresh, mkrhs $1 1,
mkexp_attrs (Pexp_constraint (ghexp (Pexp_pack $6), mkexp_attrs (Pexp_constraint (ghexp (Pexp_pack $6),
ghtyp (Ptyp_package $8))) ghtyp (Ptyp_package $8)))
@ -1641,8 +1654,10 @@ match_case:
{ Exp.case $1 (Exp.unreachable ~loc:(rhs_loc 3) ())} { Exp.case $1 (Exp.unreachable ~loc:(rhs_loc 3) ())}
; ;
fun_def: fun_def:
MINUSGREATER seq_expr { $2 } MINUSGREATER seq_expr
| COLON simple_core_type MINUSGREATER seq_expr { mkexp (Pexp_constraint ($4, $2)) } { $2 }
| COLON simple_core_type MINUSGREATER seq_expr
{ mkexp (Pexp_constraint ($4, $2)) }
/* Cf #5939: we used to accept (fun p when e0 -> e) */ /* Cf #5939: we used to accept (fun p when e0 -> e) */
| labeled_simple_pattern fun_def | labeled_simple_pattern fun_def
{ {
@ -1830,8 +1845,8 @@ primitive_declaration_body:
| STRING primitive_declaration_body { fst $1 :: $2 } | STRING primitive_declaration_body { fst $1 :: $2 }
; ;
primitive_declaration: primitive_declaration:
EXTERNAL ext_attributes val_ident COLON core_type EQUAL primitive_declaration_body EXTERNAL ext_attributes val_ident COLON core_type EQUAL
post_item_attributes primitive_declaration_body post_item_attributes
{ let (ext, attrs) = $2 in { let (ext, attrs) = $2 in
Val.mk (mkrhs $3 3) $5 ~prim:$7 ~attrs:(attrs@$8) Val.mk (mkrhs $3 3) $5 ~prim:$7 ~attrs:(attrs@$8)
~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) ~loc:(symbol_rloc ()) ~docs:(symbol_docs ())
@ -1848,8 +1863,8 @@ type_declarations:
; ;
type_declaration: type_declaration:
TYPE ext_attributes nonrec_flag optional_type_parameters LIDENT type_kind constraints TYPE ext_attributes nonrec_flag optional_type_parameters LIDENT
post_item_attributes type_kind constraints post_item_attributes
{ let (kind, priv, manifest) = $6 in { let (kind, priv, manifest) = $6 in
let (ext, attrs) = $2 in let (ext, attrs) = $2 in
let ty = let ty =
@ -1962,8 +1977,8 @@ str_exception_declaration:
, ext } , ext }
; ;
sig_exception_declaration: sig_exception_declaration:
| EXCEPTION ext_attributes constr_ident generalized_constructor_arguments attributes | EXCEPTION ext_attributes constr_ident generalized_constructor_arguments
post_item_attributes attributes post_item_attributes
{ let args, res = $4 in { let args, res = $4 in
let (ext,attrs) = $2 in let (ext,attrs) = $2 in
Te.decl (mkrhs $3 3) ~args ?res ~attrs:($5 @ $6) Te.decl (mkrhs $3 3) ~args ?res ~attrs:($5 @ $6)
@ -2256,17 +2271,17 @@ label:
/* Constants */ /* Constants */
constant: constant:
| INT { let (n, m) = $1 in Pconst_integer (n, m) } | INT { let (n, m) = $1 in Pconst_integer (n, m) }
| CHAR { Pconst_char $1 } | CHAR { Pconst_char $1 }
| STRING { let (s, d) = $1 in Pconst_string (s, d) } | STRING { let (s, d) = $1 in Pconst_string (s, d) }
| FLOAT { let (f, m) = $1 in Pconst_float (f, m) } | FLOAT { let (f, m) = $1 in Pconst_float (f, m) }
; ;
signed_constant: signed_constant:
constant { $1 } constant { $1 }
| MINUS INT { let (n, m) = $2 in Pconst_integer("-" ^ n, m) } | MINUS INT { let (n, m) = $2 in Pconst_integer("-" ^ n, m) }
| MINUS FLOAT { let (f, m) = $2 in Pconst_float("-" ^ f, m) } | MINUS FLOAT { let (f, m) = $2 in Pconst_float("-" ^ f, m) }
| PLUS INT { let (n, m) = $2 in Pconst_integer (n, m) } | PLUS INT { let (n, m) = $2 in Pconst_integer (n, m) }
| PLUS FLOAT { let (f, m) = $2 in Pconst_float(f, m) } | PLUS FLOAT { let (f, m) = $2 in Pconst_float(f, m) }
; ;
/* Identifiers and long identifiers */ /* Identifiers and long identifiers */
@ -2363,7 +2378,8 @@ class_longident:
toplevel_directive: toplevel_directive:
SHARP ident { Ptop_dir($2, Pdir_none) } SHARP ident { Ptop_dir($2, Pdir_none) }
| SHARP ident STRING { Ptop_dir($2, Pdir_string (fst $3)) } | SHARP ident STRING { Ptop_dir($2, Pdir_string (fst $3)) }
| SHARP ident INT { let (n, m) = $3 in Ptop_dir($2, Pdir_int (n ,m)) } | SHARP ident INT { let (n, m) = $3 in
Ptop_dir($2, Pdir_int (n ,m)) }
| SHARP ident val_longident { Ptop_dir($2, Pdir_ident $3) } | SHARP ident val_longident { Ptop_dir($2, Pdir_ident $3) }
| SHARP ident mod_longident { Ptop_dir($2, Pdir_ident $3) } | SHARP ident mod_longident { Ptop_dir($2, Pdir_ident $3) }
| SHARP ident FALSE { Ptop_dir($2, Pdir_bool false) } | SHARP ident FALSE { Ptop_dir($2, Pdir_bool false) }

View File

@ -172,9 +172,11 @@ class printer ()= object(self:'self)
| Pconst_string (i, None) -> pp f "%S" i | Pconst_string (i, None) -> pp f "%S" i
| Pconst_string (i, Some delim) -> pp f "{%s|%s|%s}" delim i delim | Pconst_string (i, Some delim) -> pp f "{%s|%s|%s}" delim i delim
| Pconst_integer (i,None) -> self#paren (i.[0]='-') (fun f -> pp f "%s") f i | Pconst_integer (i,None) -> self#paren (i.[0]='-') (fun f -> pp f "%s") f i
| Pconst_integer (i,Some m) -> self#paren (i.[0]='-') (fun f (i,m) -> pp f "%s%c" i m) f (i,m) | Pconst_integer (i,Some m) ->
self#paren (i.[0]='-') (fun f (i,m) -> pp f "%s%c" i m) f (i,m)
| Pconst_float (i,None) -> self#paren (i.[0]='-') (fun f -> pp f "%s") f i | Pconst_float (i,None) -> self#paren (i.[0]='-') (fun f -> pp f "%s") f i
| Pconst_float (i, Some m) -> self#paren (i.[0]='-') (fun f (i,m) -> pp f "%s%c" i m) f (i,m) | Pconst_float (i, Some m) -> self#paren (i.[0]='-') (fun f (i,m) ->
pp f "%s%c" i m) f (i,m)
(* trailing space*) (* trailing space*)
method mutable_flag f = function method mutable_flag f = function

View File

@ -78,7 +78,8 @@ let iter f a =
for i = 0 to length a - 1 do f(unsafe_get a i) done for i = 0 to length a - 1 do f(unsafe_get a i) done
let iter2 f a b = let iter2 f a b =
if length a <> length b then invalid_arg "Array.iter2: arrays must have the same length" if length a <> length b then
invalid_arg "Array.iter2: arrays must have the same length"
else else
for i = 0 to length a - 1 do f (unsafe_get a i) (unsafe_get b i) done for i = 0 to length a - 1 do f (unsafe_get a i) (unsafe_get b i) done
@ -95,7 +96,9 @@ let map f a =
let map2 f a b = let map2 f a b =
let la = length a in let la = length a in
let lb = length b in let lb = length b in
if la <> lb then invalid_arg "Array.map2: arrays must have the same length" else begin if la <> lb then
invalid_arg "Array.map2: arrays must have the same length"
else begin
if la = 0 then [||] else begin if la = 0 then [||] else begin
let r = create la (f (unsafe_get a 0) (unsafe_get b 0)) in let r = create la (f (unsafe_get a 0) (unsafe_get b 0)) in
for i = 1 to la - 1 do for i = 1 to la - 1 do

View File

@ -555,4 +555,3 @@ val kfscanf :
('a, 'b, 'c, 'd) scanner ('a, 'b, 'c, 'd) scanner
[@@ocaml.deprecated "Use Scanning.from_channel then Scanf.kscanf."] [@@ocaml.deprecated "Use Scanning.from_channel then Scanf.kscanf."]
(** @deprecated [Scanf.kfscanf] is error prone and deprecated since 4.03.0. *) (** @deprecated [Scanf.kfscanf] is error prone and deprecated since 4.03.0. *)

View File

@ -119,7 +119,10 @@ let rec nget_data n s =
;; ;;
let npeek_data n s = let npeek_data n s =
let (al, d, len) = nget_data n s in s.count <- (s.count - len); s.data <- d; al let (al, d, len) = nget_data n s in
s.count <- (s.count - len);
s.data <- d;
al
;; ;;
let npeek n = function let npeek n = function

View File

@ -23,7 +23,8 @@ default:
@echo " all launch all tests" @echo " all launch all tests"
@echo " all-foo launch all tests beginning with foo" @echo " all-foo launch all tests beginning with foo"
@echo " parallel launch all tests using GNU parallel" @echo " parallel launch all tests using GNU parallel"
@echo " parallel-foo launch all tests beginning with foo using GNU parallel" @echo " parallel-foo launch all tests beginning with foo using \
GNU parallel"
@echo " list FILE=f launch the tests listed in f (one per line)" @echo " list FILE=f launch the tests listed in f (one per line)"
@echo " one DIR=p launch the tests located in path p" @echo " one DIR=p launch the tests located in path p"
@echo " promote DIR=p promote the reference files for the tests in p" @echo " promote DIR=p promote the reference files for the tests in p"
@ -31,8 +32,9 @@ default:
@echo " clean delete generated files" @echo " clean delete generated files"
@echo " report print the report for the last execution" @echo " report print the report for the last execution"
@echo @echo
@echo "all*, parallel* and list can automatically re-run failed test directories if" @echo "all*, parallel* and list can automatically re-run failed test"
@echo "MAX_TESTSUITE_DIR_RETRIES permits (default value = $(MAX_TESTSUITE_DIR_RETRIES))" @echo "directories if MAX_TESTSUITE_DIR_RETRIES permits"
@echo "(default value = $(MAX_TESTSUITE_DIR_RETRIES))"
.PHONY: all .PHONY: all
all: lib all: lib
@ -183,7 +185,8 @@ retry-list:
@$(MAKE) $(NO_PRINT) retries @$(MAKE) $(NO_PRINT) retries
retries: retries:
@awk -v retries=1 -v max_retries=$(MAX_TESTSUITE_DIR_RETRIES) -f makefiles/summarize.awk <_log >_retries @awk -v retries=1 -v max_retries=$(MAX_TESTSUITE_DIR_RETRIES) \
-f makefiles/summarize.awk <_log >_retries
@test `cat _retries | wc -l` -eq 0 || $(MAKE) $(NO_PRINT) retry-list @test `cat _retries | wc -l` -eq 0 || $(MAKE) $(NO_PRINT) retry-list
@rm -f _retries @rm -f _retries

View File

@ -43,10 +43,12 @@ include $(TOPDIR)/config/Makefile
ifneq ($(USE_RUNTIME),) ifneq ($(USE_RUNTIME),)
#Check USE_RUNTIME value #Check USE_RUNTIME value
ifeq ($(findstring $(USE_RUNTIME),d i),) ifeq ($(findstring $(USE_RUNTIME),d i),)
$(error If set, USE_RUNTIME must be equal to "d" (debug runtime) or "i" (instrumented runtime)) $(error If set, USE_RUNTIME must be equal to "d" (debug runtime) \
or "i" (instrumented runtime))
endif endif
RUNTIME_VARIANT=-I $(OTOPDIR)/asmrun -I $(OTOPDIR)/byterun -runtime-variant $(USE_RUNTIME) RUNTIME_VARIANT=-I $(OTOPDIR)/asmrun -I $(OTOPDIR)/byterun \
-runtime-variant $(USE_RUNTIME)
export OCAMLRUNPARAM?=v=0 export OCAMLRUNPARAM?=v=0
endif endif
@ -63,9 +65,20 @@ endif
OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml $(OCFLAGS) \ OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml $(OCFLAGS) \
-init $(OTOPDIR)/testsuite/lib/empty -init $(OTOPDIR)/testsuite/lib/empty
FLEXLINK_PREFIX=$(if $(FLEXLINK),$(if $(wildcard $(TOPDIR)/flexdll/Makefile),OCAML_FLEXLINK="$(WINTOPDIR)/boot/ocamlrun $(WINTOPDIR)/flexdll/flexlink.exe" )) ifeq "$(FLEXLINK)" ""
OCAMLC=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/ocamlc $(CUSTOM) $(OCFLAGS) $(RUNTIME_VARIANT) FLEXLINK_PREFIX=
OCAMLOPT=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/ocamlopt $(OCFLAGS) $(RUNTIME_VARIANT) else
ifeq "$(wildcard $(TOPDIR)/flexdll/Makefile)" ""
FLEXLINK_PREFIX=
else
FLEXLINK_PREFIX=OCAML_FLEXLINK="$(WINTOPDIR)/boot/ocamlrun \
$(WINTOPDIR)/flexdll/flexlink.exe"
endif
endif
OCAMLC=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/ocamlc $(CUSTOM) $(OCFLAGS) \
$(RUNTIME_VARIANT)
OCAMLOPT=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/ocamlopt $(OCFLAGS) \
$(RUNTIME_VARIANT)
OCAMLDOC=$(OCAMLRUN) $(OTOPDIR)/ocamldoc/ocamldoc OCAMLDOC=$(OCAMLRUN) $(OTOPDIR)/ocamldoc/ocamldoc
OCAMLLEX=$(OCAMLRUN) $(OTOPDIR)/lex/ocamllex OCAMLLEX=$(OCAMLRUN) $(OTOPDIR)/lex/ocamllex
OCAMLMKLIB=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib \ OCAMLMKLIB=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib \
@ -130,7 +143,9 @@ defaultclean:
@$(ASM) -o $*.o $*.s @$(ASM) -o $*.o $*.s
.cmm.obj: .cmm.obj:
@$(OCAMLRUN) ./codegen $*.cmm | grep -v "_caml_\(young_ptr\|young_limit\|extra_params\|allocN\|raise_exn\|reraise_exn\)" > $*.s @$(OCAMLRUN) ./codegen $*.cmm \
| grep -v "_caml_\(young_ptr\|young_limit\|extra_params\
\|allocN\|raise_exn\|reraise_exn\)" > $*.s
@set -o pipefail ; \ @set -o pipefail ; \
$(ASM) $*.obj $*.s | tail -n +2 $(ASM) $*.obj $*.s | tail -n +2

View File

@ -18,7 +18,7 @@ let f () =
let () = (f [@inlined never]) () let () = (f [@inlined never]) ()
(* Closed functions should be static *) (* Closed functions should be static *)
let closed_function x = x + 1 (* + is a primitive, it cannot be in the closure *) let closed_function x = x + 1 (* + is a primitive, it cannot be in the closure*)
let () = assert(is_in_static_data closed_function) let () = assert(is_in_static_data closed_function)
(* And functions using closed functions *) (* And functions using closed functions *)

View File

@ -210,11 +210,14 @@ expr:
| LPAREN FLOATAREF expr expr RPAREN | LPAREN FLOATAREF expr expr RPAREN
{ Cop(Cload Double_u, [access_array $3 $4 Arch.size_float]) } { Cop(Cload Double_u, [access_array $3 $4 Arch.size_float]) }
| LPAREN ADDRASET expr expr expr RPAREN | LPAREN ADDRASET expr expr expr RPAREN
{ Cop(Cstore (Word_val, Assignment), [access_array $3 $4 Arch.size_addr; $5]) } { Cop(Cstore (Word_val, Assignment),
[access_array $3 $4 Arch.size_addr; $5]) }
| LPAREN INTASET expr expr expr RPAREN | LPAREN INTASET expr expr expr RPAREN
{ Cop(Cstore (Word_int, Assignment), [access_array $3 $4 Arch.size_int; $5]) } { Cop(Cstore (Word_int, Assignment),
[access_array $3 $4 Arch.size_int; $5]) }
| LPAREN FLOATASET expr expr expr RPAREN | LPAREN FLOATASET expr expr expr RPAREN
{ Cop(Cstore (Double_u, Assignment), [access_array $3 $4 Arch.size_float; $5]) } { Cop(Cstore (Double_u, Assignment),
[access_array $3 $4 Arch.size_float; $5]) }
; ;
exprlist: exprlist:
exprlist expr { $2 :: $1 } exprlist expr { $2 :: $1 }

View File

@ -5,15 +5,15 @@
#define CAML_NEGF_MASK caml_negf_mask #define CAML_NEGF_MASK caml_negf_mask
#define CAML_ABSF_MASK caml_absf_mask #define CAML_ABSF_MASK caml_absf_mask
.section ".text" .section ".text"
.globl CALL_GEN_CODE .globl CALL_GEN_CODE
.type CALL_GEN_CODE, @function .type CALL_GEN_CODE, @function
.align ALIGN .align ALIGN
CALL_GEN_CODE: CALL_GEN_CODE:
/* Stack space */ /* Stack space */
lay %r15, -144(%r15) lay %r15, -144(%r15)
/* Save registers */ /* Save registers */
stmg %r6,%r14, 0(%r15) stmg %r6,%r14, 0(%r15)
std %f8, 72(%r15) std %f8, 72(%r15)
std %f9, 80(%r15) std %f9, 80(%r15)
@ -23,14 +23,14 @@ CALL_GEN_CODE:
std %f13, 112(%r15) std %f13, 112(%r15)
std %f14, 120(%r15) std %f14, 120(%r15)
std %f15, 128(%r15) std %f15, 128(%r15)
/* Shuffle args */ /* Shuffle args */
lgr %r1, %r2 lgr %r1, %r2
lgr %r2, %r3 lgr %r2, %r3
lgr %r3, %r4 lgr %r3, %r4
lgr %r4, %r5 lgr %r4, %r5
/* Function call */ /* Function call */
basr %r14, %r1 basr %r14, %r1
/* Restore registers */ /* Restore registers */
lmg %r6,%r14, 0(%r15) lmg %r6,%r14, 0(%r15)
ld %f8, 72(%r15) ld %f8, 72(%r15)
ld %f9, 80(%r15) ld %f9, 80(%r15)
@ -40,23 +40,23 @@ CALL_GEN_CODE:
ld %f13, 112(%r15) ld %f13, 112(%r15)
ld %f14, 120(%r15) ld %f14, 120(%r15)
ld %f15, 128(%r15) ld %f15, 128(%r15)
/* Return */ /* Return */
lay %r15, 144(%r15) lay %r15, 144(%r15)
br %r14 br %r14
.globl CAML_C_CALL .globl CAML_C_CALL
.type CAML_C_CALL, @function .type CAML_C_CALL, @function
.align ALIGN .align ALIGN
CAML_C_CALL: CAML_C_CALL:
br %r7 br %r7
.section ".rodata" .section ".rodata"
.global CAML_NEGF_MASK .global CAML_NEGF_MASK
.align ALIGN .align ALIGN
CAML_NEGF_MASK: CAML_NEGF_MASK:
.quad 0x8000000000000000, 0 .quad 0x8000000000000000, 0
.global CAML_ABSF_MASK .global CAML_ABSF_MASK
.align ALIGN .align ALIGN
CAML_ABSF_MASK: CAML_ABSF_MASK:
.quad 0x7FFFFFFFFFFFFFFF, 0 .quad 0x7FFFFFFFFFFFFFFF, 0

View File

@ -54,10 +54,12 @@ byte:
skip: skip:
@for file in $(ABCDFILES); do \ @for file in $(ABCDFILES); do \
for arg in a b c d ''; do \ for arg in a b c d ''; do \
echo " ... testing '$$file' with ocamlopt and argument '$$arg': => skipped"; \ echo " ... testing '$$file' with ocamlopt and argument '$$arg': \
=> skipped"; \
done; \ done; \
done done
@for file in $(OTHERFILES) $(OTHERFILESNOINLINING) $(OTHERFILESNOINLINING_NATIVE); do \ @for file in $(OTHERFILES) $(OTHERFILESNOINLINING) \
$(OTHERFILESNOINLINING_NATIVE); do \
echo " ... testing '$$file' with ocamlopt: => skipped"; \ echo " ... testing '$$file' with ocamlopt: => skipped"; \
done done

View File

@ -4,7 +4,7 @@
# localhost is used to configure the loopback interface # localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry. # when the system is booting. Do not change this entry.
## ##
127.0.0.1 localhost 127.0.0.1 localhost
255.255.255.255 broadcasthost 255.255.255.255 broadcasthost
::1 localhost ::1 localhost
fe80::1%lo0 localhost fe80::1%lo0 localhost

View File

@ -4,28 +4,32 @@ let sequor b1 b2 =
let b2 = ref b2 in let b2 = ref b2 in
let b1 = !b1 in let b1 = !b1 in
let b2 = !b2 in let b2 = !b2 in
if (if b1 then true else b2 && if b1 then true else b2) then "true" else "false" if (if b1 then true else b2 && if b1 then true else b2)
then "true" else "false"
let sequand b1 b2 = let sequand b1 b2 =
let b1 = ref b1 in let b1 = ref b1 in
let b2 = ref b2 in let b2 = ref b2 in
let b1 = !b1 in let b1 = !b1 in
let b2 = !b2 in let b2 = !b2 in
if (if b1 then b2 else false && if b1 then b2 else false) then "true" else "false" if (if b1 then b2 else false && if b1 then b2 else false)
then "true" else "false"
let sequor' b1 b2 = let sequor' b1 b2 =
let b1 = ref b1 in let b1 = ref b1 in
let b2 = ref b2 in let b2 = ref b2 in
let b1 = !b1 in let b1 = !b1 in
let b2 = !b2 in let b2 = !b2 in
if (if b1 then true else b2 || if b1 then true else b2) then "true" else "false" if (if b1 then true else b2 || if b1 then true else b2)
then "true" else "false"
let sequand' b1 b2 = let sequand' b1 b2 =
let b1 = ref b1 in let b1 = ref b1 in
let b2 = ref b2 in let b2 = ref b2 in
let b1 = !b1 in let b1 = !b1 in
let b2 = !b2 in let b2 = !b2 in
if (if b1 then b2 else false || if b1 then b2 else false) then "true" else "false" if (if b1 then b2 else false || if b1 then b2 else false)
then "true" else "false"
let test b1 b2 = let test b1 b2 =
assert(sequor b1 b2 = if b1 || b2 then "true" else "false"); assert(sequor b1 b2 = if b1 || b2 then "true" else "false");

View File

@ -116,7 +116,8 @@ let () =
(* test generation *) (* test generation *)
(* (*
let values = ["true"; "false"; "true_effect ()"; "false_effect ()"; "unknown_true"; "unknown_false"] let values = ["true"; "false"; "true_effect ()"; "false_effect ()";
"unknown_true"; "unknown_false"]
let ops = ["||"; "&&"] let ops = ["||"; "&&"]
let count = ref 0 let count = ref 0
let f op v1 v2 = let f op v1 v2 =

View File

@ -8,4 +8,3 @@ let f () =
let a = -0. in let a = -0. in
let b = +0. in let b = +0. in
assert(not (a == b)) assert(not (a == b))

View File

@ -21,9 +21,13 @@ type t += C
type t += D of int * string type t += D of int * string
let () = let () =
assert (Obj.extension_constructor M.A == [%extension_constructor M.A]); assert (Obj.extension_constructor M.A
assert (Obj.extension_constructor (M.B 42) == [%extension_constructor M.B]); == [%extension_constructor M.A]);
assert (Obj.extension_constructor C == [%extension_constructor C ]); assert (Obj.extension_constructor (M.B 42)
assert (Obj.extension_constructor (D (42, "")) == [%extension_constructor D ]) == [%extension_constructor M.B]);
assert (Obj.extension_constructor C
== [%extension_constructor C]);
assert (Obj.extension_constructor (D (42, ""))
== [%extension_constructor D])
let () = print_endline "OK" let () = print_endline "OK"

View File

@ -13,7 +13,10 @@
module S = struct module S = struct
include Stack include Stack
let to_list s = let l = ref [] in iter (fun x -> l := x :: !l) s; !l (* from bottom to top *) let to_list s = (* from bottom to top *)
let l = ref [] in
iter (fun x -> l := x :: !l) s;
!l
end end
let does_raise f s = let does_raise f s =

View File

@ -389,11 +389,11 @@ let automated_test() =
test_search_forward r n "ething" test_search_forward r n "ething"
[||]; [||];
start_test "Search for /^ÿ/"; start_test "Search for /^\255/";
let r = Str.regexp "^ÿ" in let r = Str.regexp "^\255" in
let n = 0 in let n = 0 in
test_search_forward r n "ÿ" test_search_forward r n "\255"
[|"ÿ"|]; [|"\255"|];
start_test "Search for /^[0-9]+$/"; start_test "Search for /^[0-9]+$/";
let r = Str.regexp "^[0-9]+$" in let r = Str.regexp "^[0-9]+$" in

View File

@ -67,4 +67,3 @@ let _ =
Thread.delay 0.5; Thread.delay 0.5;
writer client "Client data\n"; writer client "Client data\n";
Thread.join rd Thread.join rd

View File

@ -47,6 +47,3 @@ let _ =
ignore (Thread.create client (addr, "Client #1\n")); ignore (Thread.create client (addr, "Client #1\n"));
Thread.delay 0.5; Thread.delay 0.5;
client (addr, "Client #2\n") client (addr, "Client #2\n")

View File

@ -49,6 +49,3 @@ let _ =
ignore (Thread.create client (addr, "Client #1\n")); ignore (Thread.create client (addr, "Client #1\n"));
Thread.delay 0.5; Thread.delay 0.5;
client (addr, "Client #2\n") client (addr, "Client #2\n")

View File

@ -54,4 +54,3 @@ let _ =
finished := true; finished := true;
List.iter Thread.join [t1; t2; t3; t4; t5]; List.iter Thread.join [t1; t2; t3; t4; t5];
print_string "passed\n" print_string "passed\n"

View File

@ -1,5 +1,7 @@
let int_with_custom_modifier = 1234567890_1234567890_1234567890_1234567890_1234567890z let int_with_custom_modifier =
let float_with_custom_modifier = 1234567890_1234567890_1234567890_1234567890_1234567890.z 1234567890_1234567890_1234567890_1234567890_1234567890z
let float_with_custom_modifier =
1234567890_1234567890_1234567890_1234567890_1234567890.z
let int32 = 1234l let int32 = 1234l
let int64 = 1234L let int64 = 1234L

View File

@ -1,86 +1,86 @@
[ [
structure_item (int_and_float_with_modifier.ml[1,0+0]..[1,0+88]) structure_item (int_and_float_with_modifier.ml[1,0+0]..[2,31+57])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[1,0+4]..[1,0+28]) pattern (int_and_float_with_modifier.ml[1,0+4]..[1,0+28])
Ppat_var "int_with_custom_modifier" (int_and_float_with_modifier.ml[1,0+4]..[1,0+28]) Ppat_var "int_with_custom_modifier" (int_and_float_with_modifier.ml[1,0+4]..[1,0+28])
expression (int_and_float_with_modifier.ml[1,0+33]..[1,0+88]) expression (int_and_float_with_modifier.ml[2,31+2]..[2,31+57])
Pexp_constant PConst_int (1234567890_1234567890_1234567890_1234567890_1234567890,Some z) Pexp_constant PConst_int (1234567890_1234567890_1234567890_1234567890_1234567890,Some z)
] ]
structure_item (int_and_float_with_modifier.ml[2,89+0]..[2,89+89]) structure_item (int_and_float_with_modifier.ml[3,89+0]..[4,122+58])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[2,89+4]..[2,89+30]) pattern (int_and_float_with_modifier.ml[3,89+4]..[3,89+30])
Ppat_var "float_with_custom_modifier" (int_and_float_with_modifier.ml[2,89+4]..[2,89+30]) Ppat_var "float_with_custom_modifier" (int_and_float_with_modifier.ml[3,89+4]..[3,89+30])
expression (int_and_float_with_modifier.ml[2,89+33]..[2,89+89]) expression (int_and_float_with_modifier.ml[4,122+2]..[4,122+58])
Pexp_constant PConst_float (1234567890_1234567890_1234567890_1234567890_1234567890.,Some z) Pexp_constant PConst_float (1234567890_1234567890_1234567890_1234567890_1234567890.,Some z)
] ]
structure_item (int_and_float_with_modifier.ml[4,180+0]..[4,180+21]) structure_item (int_and_float_with_modifier.ml[6,182+0]..[6,182+21])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[4,180+4]..[4,180+9]) pattern (int_and_float_with_modifier.ml[6,182+4]..[6,182+9])
Ppat_var "int32" (int_and_float_with_modifier.ml[4,180+4]..[4,180+9]) Ppat_var "int32" (int_and_float_with_modifier.ml[6,182+4]..[6,182+9])
expression (int_and_float_with_modifier.ml[4,180+16]..[4,180+21]) expression (int_and_float_with_modifier.ml[6,182+16]..[6,182+21])
Pexp_constant PConst_int (1234,Some l) Pexp_constant PConst_int (1234,Some l)
] ]
structure_item (int_and_float_with_modifier.ml[5,202+0]..[5,202+21]) structure_item (int_and_float_with_modifier.ml[7,204+0]..[7,204+21])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[5,202+4]..[5,202+9]) pattern (int_and_float_with_modifier.ml[7,204+4]..[7,204+9])
Ppat_var "int64" (int_and_float_with_modifier.ml[5,202+4]..[5,202+9]) Ppat_var "int64" (int_and_float_with_modifier.ml[7,204+4]..[7,204+9])
expression (int_and_float_with_modifier.ml[5,202+16]..[5,202+21]) expression (int_and_float_with_modifier.ml[7,204+16]..[7,204+21])
Pexp_constant PConst_int (1234,Some L) Pexp_constant PConst_int (1234,Some L)
] ]
structure_item (int_and_float_with_modifier.ml[6,224+0]..[6,224+21]) structure_item (int_and_float_with_modifier.ml[8,226+0]..[8,226+21])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[6,224+4]..[6,224+13]) pattern (int_and_float_with_modifier.ml[8,226+4]..[8,226+13])
Ppat_var "nativeint" (int_and_float_with_modifier.ml[6,224+4]..[6,224+13]) Ppat_var "nativeint" (int_and_float_with_modifier.ml[8,226+4]..[8,226+13])
expression (int_and_float_with_modifier.ml[6,224+16]..[6,224+21]) expression (int_and_float_with_modifier.ml[8,226+16]..[8,226+21])
Pexp_constant PConst_int (1234,Some n) Pexp_constant PConst_int (1234,Some n)
] ]
structure_item (int_and_float_with_modifier.ml[8,247+0]..[8,247+32]) structure_item (int_and_float_with_modifier.ml[10,249+0]..[10,249+32])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[8,247+4]..[8,247+24]) pattern (int_and_float_with_modifier.ml[10,249+4]..[10,249+24])
Ppat_var "hex_without_modifier" (int_and_float_with_modifier.ml[8,247+4]..[8,247+24]) Ppat_var "hex_without_modifier" (int_and_float_with_modifier.ml[10,249+4]..[10,249+24])
expression (int_and_float_with_modifier.ml[8,247+27]..[8,247+32]) expression (int_and_float_with_modifier.ml[10,249+27]..[10,249+32])
Pexp_constant PConst_int (0x32f,None) Pexp_constant PConst_int (0x32f,None)
] ]
structure_item (int_and_float_with_modifier.ml[9,280+0]..[9,280+32]) structure_item (int_and_float_with_modifier.ml[11,282+0]..[11,282+32])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[9,280+4]..[9,280+21]) pattern (int_and_float_with_modifier.ml[11,282+4]..[11,282+21])
Ppat_var "hex_with_modifier" (int_and_float_with_modifier.ml[9,280+4]..[9,280+21]) Ppat_var "hex_with_modifier" (int_and_float_with_modifier.ml[11,282+4]..[11,282+21])
expression (int_and_float_with_modifier.ml[9,280+27]..[9,280+32]) expression (int_and_float_with_modifier.ml[11,282+27]..[11,282+32])
Pexp_constant PConst_int (0x32,Some g) Pexp_constant PConst_int (0x32,Some g)
] ]
structure_item (int_and_float_with_modifier.ml[11,314+0]..[11,314+33]) structure_item (int_and_float_with_modifier.ml[13,316+0]..[13,316+33])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[11,314+4]..[11,314+25]) pattern (int_and_float_with_modifier.ml[13,316+4]..[13,316+25])
Ppat_var "float_without_modifer" (int_and_float_with_modifier.ml[11,314+4]..[11,314+25]) Ppat_var "float_without_modifer" (int_and_float_with_modifier.ml[13,316+4]..[13,316+25])
expression (int_and_float_with_modifier.ml[11,314+28]..[11,314+33]) expression (int_and_float_with_modifier.ml[13,316+28]..[13,316+33])
Pexp_constant PConst_float (1.2e3,None) Pexp_constant PConst_float (1.2e3,None)
] ]
structure_item (int_and_float_with_modifier.ml[12,348+0]..[12,348+32]) structure_item (int_and_float_with_modifier.ml[14,350+0]..[14,350+32])
Pstr_value Nonrec Pstr_value Nonrec
[ [
<def> <def>
pattern (int_and_float_with_modifier.ml[12,348+4]..[12,348+22]) pattern (int_and_float_with_modifier.ml[14,350+4]..[14,350+22])
Ppat_var "float_with_modifer" (int_and_float_with_modifier.ml[12,348+4]..[12,348+22]) Ppat_var "float_with_modifer" (int_and_float_with_modifier.ml[14,350+4]..[14,350+22])
expression (int_and_float_with_modifier.ml[12,348+28]..[12,348+32]) expression (int_and_float_with_modifier.ml[14,350+28]..[14,350+32])
Pexp_constant PConst_float (1.2,Some g) Pexp_constant PConst_float (1.2,Some g)
] ]
] ]
File "int_and_float_with_modifier.ml", line 1, characters 33-88: File "int_and_float_with_modifier.ml", line 2, characters 2-57:
Error: Unknown modifier 'z' for literal 1234567890_1234567890_1234567890_1234567890_1234567890z Error: Unknown modifier 'z' for literal 1234567890_1234567890_1234567890_1234567890_1234567890z

View File

@ -14,4 +14,3 @@ let _ =
let a = [| 0.0; -. 0.0 |] in let a = [| 0.0; -. 0.0 |] in
Printf.printf "%Lx %Lx\n" Printf.printf "%Lx %Lx\n"
(Int64.bits_of_float a.(0)) (Int64.bits_of_float a.(1)) (Int64.bits_of_float a.(0)) (Int64.bits_of_float a.(1))

View File

@ -52,7 +52,9 @@ run:
echo " => unexpected error"; \ echo " => unexpected error"; \
fi; \ fi; \
fn=`basename $$f bytecode`native; \ fn=`basename $$f bytecode`native; \
if $(BYTECODE_ONLY) || [ ! -f "$${fn}$(EXE)" ] ; then echo " ... testing '$$fn': => skipped" ; else \ if $(BYTECODE_ONLY) || [ ! -f "$${fn}$(EXE)" ] ; then \
echo " ... testing '$$fn': => skipped" ; \
else \
printf " ... testing '$$fn':"; \ printf " ... testing '$$fn':"; \
if [ $$ul -eq 1 ] ; then \ if [ $$ul -eq 1 ] ; then \
./$${fn}$(EXE) >$$fn.result 2>&1 || true; \ ./$${fn}$(EXE) >$$fn.result 2>&1 || true; \

View File

@ -49,4 +49,6 @@ let set_open_poly (r:[< `Bar | `Foo | `Baz > `Foo `Bar] ref) y = r := y ;;
let set_open_poly (r:[>`Foo of int] ref) y = r := y ;; let set_open_poly (r:[>`Foo of int] ref) y = r := y ;;
let set_open_poly (r:[<`Foo of int] ref) y = r := y ;; let set_open_poly (r:[<`Foo of int] ref) y = r := y ;;
let set_open_poly (r:[`Foo of int] ref) y = r := y ;; let set_open_poly (r:[`Foo of int] ref) y = r := y ;;
let set_open_poly (r:[< `Bar | `Foo of float | `Baz > `Foo `Bar] ref) y = r := y ;; let set_open_poly (r:[< `Bar | `Foo of float | `Baz > `Foo `Bar] ref) y =
r := y
;;

View File

@ -15,4 +15,3 @@ let f : type env a. (env, a) typ -> (env, a) typ -> int = fun ta tb ->
| _ -> . (* error *) | _ -> . (* error *)
;; ;;
(* let x = f Tint (Tvar Zero) ;; *) (* let x = f Tint (Tvar Zero) ;; *)

View File

@ -5,4 +5,3 @@ type t = [ 'A_name | `Hi ];;
let f (x:'id_arg) = x;; let f (x:'id_arg) = x;;
let f (x:'Id_arg) = x;; let f (x:'Id_arg) = x;;

View File

@ -108,7 +108,8 @@ let ambiguous__in_depth = function
let not_ambiguous__several_orpats = function let not_ambiguous__several_orpats = function
| `A ((`B (x, Some _, _) | `B (x, _, Some _)), | `A ((`B (x, Some _, _) | `B (x, _, Some _)),
(`C (y, Some _, _) | `C (y, _, Some _)), (`C (y, Some _, _) | `C (y, _, Some _)),
(`D1 (_, z, Some _, _) | `D2 (_, z, _, Some _))) when x < y && x < z -> () (`D1 (_, z, Some _, _) | `D2 (_, z, _, Some _))) when x < y && x < z ->
()
| _ -> () | _ -> ()
;; ;;

View File

@ -57,7 +57,7 @@ val ambiguous__x_y_z : [> `B of 'a * 'a option * 'a option ] -> unit = <fun>
Warning 57: Ambiguous guarded pattern, variable x may match different or-pattern arguments Warning 57: Ambiguous guarded pattern, variable x may match different or-pattern arguments
val ambiguous__in_depth : val ambiguous__in_depth :
[> `A of [> `B of bool option * bool option ] ] -> unit = <fun> [> `A of [> `B of bool option * bool option ] ] -> unit = <fun>
# val not_ambiguous__several_orpats : # val not_ambiguous__several_orpats :
[> `A of [> `A of
[> `B of 'a * 'b option * 'c option ] * [> `B of 'a * 'b option * 'c option ] *
[> `C of 'a * 'd option * 'e option ] * [> `C of 'a * 'd option * 'e option ] *

View File

@ -15,7 +15,8 @@ unwind_test:
@$(OCAMLOPT) -c driver.ml @$(OCAMLOPT) -c driver.ml
@$(OCAMLOPT) -c mylib.ml @$(OCAMLOPT) -c mylib.ml
@$(OCAMLOPT) -c stack_walker.c @$(OCAMLOPT) -c stack_walker.c
@$(OCAMLOPT) -cclib -Wl,-keep_dwarf_unwind -o unwind_test mylib.cmx driver.cmx stack_walker.o @$(OCAMLOPT) -cclib -Wl,-keep_dwarf_unwind -o unwind_test mylib.cmx \
driver.cmx stack_walker.o
clean: clean:
@rm -f *.cm* *.o unwind_test @rm -f *.cm* *.o unwind_test

View File

@ -4,7 +4,9 @@ let foo1 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 =
let foo2 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 = let foo2 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 =
f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 f x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
external func_with_10_params: int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit = "ml_func_with_10_params_bytecode" "ml_func_with_10_params_native" external func_with_10_params:
int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit
= "ml_func_with_10_params_bytecode" "ml_func_with_10_params_native"
let bar x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 = let bar x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 =
func_with_10_params x1 x2 x3 x4 x5 x6 x7 x8 x9 x10; func_with_10_params x1 x2 x3 x4 x5 x6 x7 x8 x9 x10;

View File

@ -1,6 +1,10 @@
val foo1: ('a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit) -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit val foo1: ('a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit)
-> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit
val foo2: ('a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit) -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit val foo2: ('a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit)
-> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> 'a -> unit
val bar: int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit val bar:
val baz: int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit
val baz:
int -> int -> int -> int -> int -> int -> int -> int -> int -> int -> unit

View File

@ -5,8 +5,9 @@
#include <caml/mlvalues.h> #include <caml/mlvalues.h>
#include <libunwind.h> #include <libunwind.h>
value ml_func_with_10_params_native(value x1, value x2, value x3, value x4, value x5, value ml_func_with_10_params_native(value x1, value x2, value x3, value x4,
value x6, value x7, value x8, value x9, value x10) { value x5, value x6, value x7, value x8,
value x9, value x10) {
return Val_unit; return Val_unit;
} }
@ -30,7 +31,8 @@ void perform_stack_walk() {
{ {
char procname[256]; char procname[256];
unw_word_t ip_offset; // IP - start_of_proc unw_word_t ip_offset; // IP - start_of_proc
int result = unw_get_proc_name(&cursor, procname, sizeof(procname), &ip_offset); int result = unw_get_proc_name(&cursor, procname, sizeof(procname),
&ip_offset);
if (result != 0) error(); if (result != 0) error();
if (strcmp(procname, "main") == 0) if (strcmp(procname, "main") == 0)
reached_main = 1; reached_main = 1;

View File

@ -1,12 +1,12 @@
File "w55.opt.ml", line 4, characters 10-26: File "w55.opt_backend.ml", line 4, characters 10-26:
Warning 55: Inlining impossible in this context: Function information unavailable Warning 55: Cannot inline: Function information unavailable
File "w55.opt.ml", line 8, characters 10-27: File "w55.opt_backend.ml", line 8, characters 10-27:
Warning 55: Inlining impossible in this context: Unknown function Warning 55: Cannot inline: Unknown function
File "w55.opt.ml", line 12, characters 10-26: File "w55.opt_backend.ml", line 12, characters 10-26:
Warning 55: Inlining impossible in this context: Partial application Warning 55: Cannot inline: Partial application
File "w55.opt.ml", line 18, characters 12-30: File "w55.opt_backend.ml", line 18, characters 12-30:
Warning 55: Inlining impossible in this context: Over-application Warning 55: Cannot inline: Over-application
File "w55.opt.ml", line 18, characters 12-30: File "w55.opt_backend.ml", line 18, characters 12-30:
Warning 55: Inlining impossible in this context: Function information unavailable Warning 55: Cannot inline: Function information unavailable
File "w55.opt.ml", line 21, characters 10-26: File "w55.opt_backend.ml", line 21, characters 10-26:
Warning 55: Inlining impossible in this context: Function information unavailable Warning 55: Cannot inline: Function information unavailable

View File

@ -1,6 +1,6 @@
File "w55.opt_backend.ml", line 12, characters 10-26: File "w55.opt_backend.ml", line 12, characters 10-26:
Warning 55: Inlining impossible in this context: [@inlined] attributes may not be used on partial applications Warning 55: Cannot inline: [@inlined] attributes may not be used on partial applications
File "w55.opt_backend.ml", line 8, characters 10-27: File "w55.opt_backend.ml", line 8, characters 10-27:
Warning 55: Inlining impossible in this context: [@inlined] attribute was not used on this function application (the optimizer did not know what function was being applied) Warning 55: Cannot inline: [@inlined] attribute was not used on this function application (the optimizer did not know what function was being applied)
File "w55.opt_backend.ml", line 18, characters 12-30: File "w55.opt_backend.ml", line 18, characters 12-30:
Warning 55: Inlining impossible in this context: [@inlined] attribute was not used on this function application (the optimizer did not know what function was being applied) Warning 55: Cannot inline: [@inlined] attribute was not used on this function application (the optimizer did not know what function was being applied)

View File

@ -12,12 +12,15 @@
include Makefile.shared include Makefile.shared
CAMLOPT:=$(if $(wildcard ../flexdll/Makefile),OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe") $(CAMLOPT) ifneq "$(wildcard ../flexdll/Makefile)"
CAMLOPT:=OCAML_FLEXLINK="../boot/ocamlrun ../flexdll/flexlink.exe" $(CAMLOPT)
endif
# To make custom toplevels # To make custom toplevels
OCAMLMKTOP=ocamlmktop.cmo OCAMLMKTOP=ocamlmktop.cmo
OCAMLMKTOP_IMPORTS=misc.cmo identifiable.cmo numbers.cmo config.cmo arg_helper.cmo clflags.cmo ccomp.cmo OCAMLMKTOP_IMPORTS=misc.cmo identifiable.cmo numbers.cmo config.cmo \
arg_helper.cmo clflags.cmo ccomp.cmo
ocamlmktop: $(OCAMLMKTOP) ocamlmktop: $(OCAMLMKTOP)
$(CAMLC) $(LINKFLAGS) -o ocamlmktop $(OCAMLMKTOP_IMPORTS) $(OCAMLMKTOP) $(CAMLC) $(LINKFLAGS) -o ocamlmktop $(OCAMLMKTOP_IMPORTS) $(OCAMLMKTOP)

View File

@ -39,7 +39,8 @@ CAMLDEP_IMPORTS=timings.cmo misc.cmo config.cmo identifiable.cmo numbers.cmo \
arg_helper.cmo clflags.cmo terminfo.cmo \ arg_helper.cmo clflags.cmo terminfo.cmo \
warnings.cmo location.cmo longident.cmo docstrings.cmo \ warnings.cmo location.cmo longident.cmo docstrings.cmo \
syntaxerr.cmo ast_helper.cmo parser.cmo lexer.cmo parse.cmo \ syntaxerr.cmo ast_helper.cmo parser.cmo lexer.cmo parse.cmo \
ccomp.cmo ast_mapper.cmo ast_iterator.cmo ast_invariants.cmo pparse.cmo compenv.cmo \ ccomp.cmo ast_mapper.cmo ast_iterator.cmo ast_invariants.cmo pparse.cmo \
compenv.cmo \
builtin_attributes.cmo builtin_attributes.cmo
ocamldep: depend.cmi $(CAMLDEP_OBJ) ocamldep: depend.cmi $(CAMLDEP_OBJ)
@ -77,11 +78,13 @@ ocamlprof: $(CSLPROF) profiling.cmo
ocamlcp: ocamlcp.cmo ocamlcp: ocamlcp.cmo
$(CAMLC) $(LINKFLAGS) -o ocamlcp misc.cmo warnings.cmo config.cmo \ $(CAMLC) $(LINKFLAGS) -o ocamlcp misc.cmo warnings.cmo config.cmo \
identifiable.cmo numbers.cmo arg_helper.cmo clflags.cmo main_args.cmo ocamlcp.cmo identifiable.cmo numbers.cmo arg_helper.cmo clflags.cmo \
main_args.cmo ocamlcp.cmo
ocamloptp: ocamloptp.cmo ocamloptp: ocamloptp.cmo
$(CAMLC) $(LINKFLAGS) -o ocamloptp misc.cmo warnings.cmo config.cmo \ $(CAMLC) $(LINKFLAGS) -o ocamloptp misc.cmo warnings.cmo config.cmo \
identifiable.cmo numbers.cmo arg_helper.cmo clflags.cmo main_args.cmo \ identifiable.cmo numbers.cmo arg_helper.cmo clflags.cmo \
main_args.cmo \
ocamloptp.cmo ocamloptp.cmo
opt:: profiling.cmx opt:: profiling.cmx
@ -102,7 +105,8 @@ clean::
# To help building mixed-mode libraries (OCaml + C) # To help building mixed-mode libraries (OCaml + C)
ocamlmklib: ocamlmklibconfig.cmo ocamlmklib.cmo ocamlmklib: ocamlmklibconfig.cmo ocamlmklib.cmo
$(CAMLC) $(LINKFLAGS) -o ocamlmklib ocamlmklibconfig.cmo config.cmo ocamlmklib.cmo $(CAMLC) $(LINKFLAGS) -o ocamlmklib ocamlmklibconfig.cmo config.cmo \
ocamlmklib.cmo
install:: install::
cp ocamlmklib "$(INSTALL_BINDIR)/ocamlmklib$(EXE)" cp ocamlmklib "$(INSTALL_BINDIR)/ocamlmklib$(EXE)"

View File

@ -38,6 +38,7 @@
# - Any file whose name matches one of the following patterns is # - Any file whose name matches one of the following patterns is
# automatically exempt from all rules # automatically exempt from all rules
# *.reference # *.reference
# *.opt_reference
# */reference # */reference
# */.depend* # */.depend*
# - Any file whose name begins with "Makefile" is automatically exempt # - Any file whose name begins with "Makefile" is automatically exempt
@ -149,7 +150,7 @@ IGNORE_DIRS="
case "$f" in case "$f" in
Makefile*|*/Makefile*) rules="tab,$rules";; Makefile*|*/Makefile*) rules="tab,$rules";;
*.mlpack|*.mllib|*.mltop|*.odocl|*.itarget|*.clib) add_hd;; *.mlpack|*.mllib|*.mltop|*.odocl|*.itarget|*.clib) add_hd;;
*.reference|*/reference|*/.depend*) continue;; *.reference|*.opt_reference|*/reference|*/.depend*) continue;;
esac esac
case "$f" in case "$f" in
ocamldoc/*|*/ocamldoc/*) rules="long-line,$rules";; ocamldoc/*|*/ocamldoc/*) rules="long-line,$rules";;
@ -230,11 +231,15 @@ IGNORE_DIRS="
if (!empty_file && match(prev_line, /^$/)){ if (!empty_file && match(prev_line, /^$/)){
err("white-at-eof", "empty line(s) at EOF"); err("white-at-eof", "empty line(s) at EOF");
} }
if (NR >= 10 && !(header_ocaml && header_copyright)){ if (!(header_ocaml && header_copyright)){
NR = 1; if (NR >= 10){
RSTART = 1; NR = 1;
RLENGTH = 0; RSTART = 1;
err("missing-header", "missing copyright header"); RLENGTH = 0;
err("missing-header", "missing copyright header");
}else{
counts["missing-header"] = 1;
}
} }
split(svnrules, r, "[, ]"); split(svnrules, r, "[, ]");
for (i in r){ for (i in r){

View File

@ -82,4 +82,3 @@ let _ =
exit 2 exit 2
end; end;
if cmpbyt Sys.argv.(1) Sys.argv.(2) then exit 0 else exit 2 if cmpbyt Sys.argv.(1) Sys.argv.(2) then exit 0 else exit 2

View File

@ -14,10 +14,12 @@
# Use this script on OCAML_INSTR_FILE files # Use this script on OCAML_INSTR_FILE files
default_curves=major,minor,coll,dispatch
usage () { usage () {
echo 'usage: ocaml-instr-graph file [options]' echo 'usage: ocaml-instr-graph file [options]'
echo ' options:' echo ' options:'
echo ' -d names plot the data for names (default major,minor,coll,dispatch)' echo " -d names plot the data for names (default: $default_curves)"
echo ' -t title set the graph title' echo ' -t title set the graph title'
echo ' -m n clip the values to n (default 1G)' echo ' -m n clip the values to n (default 1G)'
echo ' -rt n set the range for times to 0..n' echo ' -rt n set the range for times to 0..n'
@ -52,7 +54,7 @@ while [[ $# > 0 ]]; do
done done
if [[ "$curves" = , ]]; then if [[ "$curves" = , ]]; then
curves=,major,minor,coll,dispatch, curves=,$default_curves,
fi fi
if ! $titleset; then if ! $titleset; then
@ -98,7 +100,9 @@ awk -v curves="$curves" -v clip=$max -v tmpfile="$tmpfile" -v from=$from \
f=$tmpfile-${curve//\//:} f=$tmpfile-${curve//\//:}
if [ -f $f ]; then if [ -f $f ]; then
case $f in case $f in
*#) printf "\"%s\" using 1:2 axes x1y2 title '%s', " "$f" "$curve";; *#) printf "\"%s\" using 1:2 axes x1y2 title '%s', " "$f" \
"$curve"
;;
*) printf "\"%s\" using 1:2 title '%s', " "$f" "$curve";; *) printf "\"%s\" using 1:2 title '%s', " "$f" "$curve";;
esac esac
fi fi

Some files were not shown because too many files have changed in this diff Show More