Compare commits

..
Author SHA1 Message Date
nobody b5e0d7eaf3 This commit was manufactured by cvs2svn to create tag
'MARTIN_PLAYGROUND_TAG'.

svn path=/tags/MARTIN_PLAYGROUND_TAG/mcs/; revision=24558
2004-03-25 02:42:47 +00:00
671 changed files with 32815 additions and 142340 deletions

No files matched your search

+7 -11
View File
@@ -1,26 +1,22 @@
Makefile
Makefile.in
_tmpinst
aclocal.m4
autom4te.cache
config.cache
config.guess
config.h
config.h.in
config.h.in
config.log
config.status
config.sub
configure
libtool
ltconfig
ltmain.sh
mint.pc
ltconfig
Makefile
Makefile.in
mono-*.tar.gz
mono.pc
mono.spec
semantic.cache
stamp-h
stamp-h.in
mono.pc
mono.spec
autom4te.cache
mint.pc
stamp-h1
tmpinst-dir.stamp
+1 -852
View File
@@ -1,855 +1,3 @@
2004-11-08 Jonathan Pryor <[email protected]>
* configure.in: Add new function/header/type checks for use by
MonoPosixHelper (the support directory).
* support/Makefile.am: Add sys-sendfile.c to the build.
* support/dirent.c, support/fcntl.c, support/unistd.c: Remove compile-time
checks for -64 apis (pread64, etc.), as they're superfluous. GLibc
#defines the functions to the appropriate -64 counterpart when necessary,
and Darwin is intrinsically large-file-aware, so manual checking on my
part is redundant and unnecessary.
* support/grp.c: Add checks for non-portable functions getgrnam_r,
getgrgid_r.
* support/pwd.c: Add checks for non-portable functions getpwnam_r,
getpwuid_r.
* support/map.c: Remove <poll.h> include. Building on Tigar (Mac OS X 10.4
beta) breaks when both <poll.h> and <sys/poll.h> are included, so only use
<sys/poll.h>.
* support/mph.h: Clean up macro handling for type overflow checking.
2004-11-08 Raja R Harinath <[email protected]>
* configure.in (mcs_topdir, mcs_topdir_from_srcdir): New 'subst'ed
variables. Used to support both an in-tree mcs/ and a sibling
mcs/ directory.
* Makefile.am (mcs_topdir): Remove.
(dist-hook): Distribute mcs/ as a subdirectory.
* runtime/Makefile.am ($(monoone_DATA) $(monotwo_DATA) $(monobins_DATA)):
Use mcs_topdir and mcs_topdir_from_srcdir.
* runtime/net_1_1/Makefile.am (mscorlib.dll $(gac_assemblies) $(mdb_files)):
Likewise.
(all-local): Depend on $(mdb_files) too.
* runtime/net_2_0/Makefile.am: Likewise.
2004-11-05 Zoltan Varga <[email protected]>
* runtime/net_2_0/Makefile.am (install-data-local):
* runtime/net_1_1/Makefile.am (install-data-local): Applied patch
from Götz Waschk ([email protected]). Make this work
with DESTDIR.
2004-11-05 Jonathan Pryor <[email protected]>
* support/.cvsignore: Ignore generated files.
* support/Makefile.am: Add new INCLUDE directives (for glib headers),
source; bump library version (so we don't clobber previous versions of
libMonoPosixHelper.so).
* support/dirent.c: New file; <dirent.h> wrapper functions;
BSD portability fixes.
* support/errno.c: New file; <errno.h> wrapper functions
* support/fcntl.c: New file; <fcntl.h> wrapper functions;
BSD portability fixes.
* support/grp.c: New file; <grp.h> wrapper functions;
BSD portability fixes.
* support/map.c: Updated macro mapping functions (more enums mapped, more
error checking, etc.).
* support/map.h: Updated macro mapping functions
* support/old-map.c: Previous map.c implementation, for backward compatibility
Remove spurious warning about redefining _GNU_SOURCE.
* support/old-map.h: Previous map.h implementation, for backward compatibility
* support/mph.h: New file; Utility types, macros;
BSD portability fixes.
* support/pwd.c: New file; <pwd.h> wrapper functions;
BSD portability fixes.
* support/stdio.c: New file; <stdio.h> wrapper functions
* support/stdlib.c: New file; <stdlib.h> wrapper functions
* support/sys-mman.c: New file; <sys/mman.h> wrapper functions
* support/sys-mount.c: New file; <sys/mount.h> wrapper functions;
BSD portability fixes.
* support/sys-sendfile.c: New file; <sys/sendfile.h> wrapper functions;
BSD portability fixes.
* support/sys-stat.c: New file; <sys/stat.h> wrapper functions
* support/sys-wait.c: New file; <sys/wait.h> wrapper functions
* support/time.c: New file; <time.h> wrapper functions;
BSD portability fixes.
* support/unistd.c: New file; <unistd.h> wrapper functions;
BSD portability fixes.
2004-10-31 Zoltan Varga <[email protected]>
* configure.in: Fix up --with-jit=no so it actually works. Fixes
#61320.
2004-10-29 Gonzalo Paniagua Javier <[email protected]>
* man/mono.1: documented MONO_THREADS_PER_CPU.
2004-10-29 Zoltan Varga <[email protected]>
* configure.in: Add INCLUDED_LIBGC automake conditional.
2004-10-24 Jonathan Pryor <[email protected]>
* man/mono.1: Add documentation for the MONO_TRACE environment variable.
2004-10-14 Joe Shaw <[email protected]>
* man/mono.1: Fix the syntax of the M: trace syntax
2004-10-10 Zoltan Varga <[email protected]>
* configure.in: Add some checks for cygwin weirdness.
2004-10-08 Zoltan Varga <[email protected]>
* support/Makefile.am (libMonoPosixHelper_la_SOURCES): Do not build
zlib_macros if zlib.h is not found.
* configure.in: Add check for zlib.h.
2004-09-28 Neale Ferguson <[email protected]>
* mini-s390.c: Fix AND_IMM/OR_IMM/DIV_IMM/REM_IMM
2004-09-28 Raja R Harinath <[email protected]>
* Makefile.am ($(tmpinst)/bin/pedump): New.
(mcs-do-run-test-profiles): Depend on it.
2004-09-27 Raja R Harinath <[email protected]>
* Makefile.am (mono-do-testjit): New target, unused for now. Runs
the mono testsuite in tests/.
(tmpinst-dir): Create etc/mono/2.0.
($(tmpinst)/bin/ilasm, $(tmpinst)/etc/mono/2.0/machine.config): New.
2004-09-21 Neale Ferguson <[email protected]>
* configure.in: Cater for S/390 on Linux
2004-09-21 <[email protected]>
* configure.in: Link with ole32 on windows.
2004-09-20 Jackson Harper <[email protected]>
* support/map.c/h: Add poll events map functions. Use values
instead of names for defines.
2004-09-17 Martin Baulig <[email protected]>
* Makefile.am (mcs-do-compiler-tests): Reverted Raja's latest
change in this target.
2004-09-14 Raja R Harinath <[email protected]>
* Makefile.am (mcs-do-full-build): Pass NO_SIGN_ASSEMBLIES=yes to
reduce the number of passes. We will get the assemblies signed in
the 'populate-runtime-subdir' phase.
(mcs-do-run-test-profiles): Rename from mcs-do-run-tests. Use
'test-profiles' to test all profiles.
(mcs-do-compiler-tests): Use 'compiler-tests' target in mcs/.
(bootstrap-check): Update.
* runtime/Makefile.am ($(monoone_DATA) $(monotwo_DATA) $(monobins_DATA)):
Simplify.
2004-09-10 Zoltan Varga <[email protected]>
* Makefile.am (populate-runtime-subdir): Avoid -path argument to find
since it is not supported on solaris.
2004-09-03 Martin Baulig <[email protected]>
* Makefile.am (bootstrap-world): New target.
2004-09-02 Martin Baulig <[email protected]>
* runtime/net_1_1/Makefile.am (install-data-local): Install
mscorlib.dll.mdb into $(corlibdir).
* runtime/net_2_0/Makefile.am: Likewise.
2004-08-30 Zoltan Varga <[email protected]>
* scripts/mcs.in: Remove obsolete comment.
2004-08-27 Lluis Sanchez Gual <[email protected]>
* data/net_1_1/DefaultWsdlHelpGenerator.aspx: Little fix.
* data/net_2_0/DefaultWsdlHelpGenerator.aspx: Added information about
basic profile compliance.
* data/net_2_0/machine.config: Use 2.0 assembly versions.
2004-08-26 Raja R Harinath <[email protected]>
* Makefile.am (mcs-do-run-test): Depend on '$(tmpinst)/bin/mbas'.
($(tmpinst)/bin/mbas): Create temporary wrapper file, so that the
testcases pick the built 'mbas.exe'.
2004-08-17 Zoltan Varga <[email protected]>
* mono/os/gc_wrapper.h: Only use thread local alloc if using the included libgc, since the
stock one has broken headers.
* configure.in (PLATFORM_WIN32): Make the included libgc the default on windows.
2004-08-17 Dick Porter <[email protected]>
* configure.in: Correct intl library for FreeBSD and OpenBSD.
Fixes bug 62884, patch by Tom McLaughlin ([email protected]).
2004-08-16 Zoltan Varga <[email protected]>
* configure.in: Set new automake variable LIBGC_STATIC_LIBS.
2004-08-14 Zoltan Varga <[email protected]>
* configure.in (HAVE_KW_THREAD): Pass USE_COMPILER_TLS to libgc if
__thread works.
2004-08-11 Zoltan Varga <[email protected]>
* configure.in: Fix __thread test.
2004-08-07 Zoltan Varga <[email protected]>
* configure.in: Add proper checks for the 'undefined reference to '__tls_get_addr' problem.
2004-08-06 Geoff Norton <[email protected]>
* configure.in: Add a kqueue check
2004-08-03 Neale Ferguson <[email protected]>
* configure.in: Enable S/390 64-bit JIT.
2004-07-31 Zoltan Varga <[email protected]>
* configure.in: Enable AMD64 JIT.
2004-07-30 Martin Baulig <[email protected]>
* Makefile.am: The symbol writer is now called
Mono.CompilerServices.SymbolWriter.dll.
2004-07-30 Raja R Harinath <[email protected]>
* runtime/Makefile.am (monoone_DATA): Add mcs.exe.config.
(gmcs_exe): Add gmcs.exe.config.
($(monoone_DATA) $(monotwo_DATA) ...): Add location of the .config
files too.
2004-07-29 Lluis Sanchez Gual <[email protected]>
* Makefile.am: Copy machine.config in the correct _tmpinst subdirectory.
2004-07-28 Lluis Sanchez Gual <[email protected]>
* configure.in: Added data/net_1_1 and data/net_2_0 to the build.
* data/Makefile.am: Removed installation of machine.config and
DefaultWsdlHelpGenerator.aspx. Those now are in a version-specific
directory.
* data/net_1_1/Makefile.am, data/net_2_0/Makefile.am: new makefiles for
installing 1.1 and 2.0 makefiles.
* runtime/net_1_1/Makefile.am, runtime/net_2_0/Makefile.am: Install mscorlib
at the correct version specific directory.
2004-07-27 John Merryweather Cooper <[email protected]>
* configure.in: Disable __thread test (TLS) for FreeBSD as
it succeeds on FreeBSD 5.x when it should fail. Fix pthread
library detection for FreeBSD 4.x since pthread is embedded
in libc_r on this platform. Fix some typos in my host
regexes for freebsd.
2004-07-23 Dick Porter <[email protected]>
* configure.in: Changes for FreeBSD thread support by John
Merryweather Cooper <[email protected]>.
2004-07-15 Jackson Harper <[email protected]>
* man/gacutil.1: MONO_GAC_PREFIX not MONO_GAC_PATH
2004-07-12 Massimiliano Mantione <[email protected]>
* docs/abc-removal.txt: Updated documentation for ABC removal.
2004-07-12 Massimiliano Mantione <[email protected]>
* mono/mini/abcremoval.c: Rewritten most of ABC removal.
* mono/mini/abcremoval.h: Rewritten most of ABC removal.
* mono/mini/build_relations_propagation_table.pl: Deleted (unneeded after the rewrite).
* mono/mini/propagated_relations_table.def: Deleted (unneeded after the rewrite).
2004-07-03 Zoltan Varga <[email protected]>
* configure.in: Add --with-tls option to replace the misnamed
--with-nptl option.
2004-07-02 Raja R Harinath <[email protected]>
* Makefile.am (mcs-do-basic-build, mcs-do-short-build):
Pass NO_SIGN_ASSEMBLY=yes to sub-make.
($(tmpinst)/bin/mono) [PLATFORM_WIN32]: Make it work.
2004-07-02 Zoltan Varga <[email protected]>
* man/mono.1: Added 'aot' to trace options.
2004-06-30 Zoltan Varga <[email protected]>
* configure.in: Fix trunc check + add SPARC64 defines.
2004-06-29 Jackson Harper <[email protected]>
* man/gacutil.1: Update man with new command line options.
2004-06-29 Raja R Harinath <[email protected]>
Atsushi Enomoto <[email protected]>
* runtime/net_1_1/Makefile.am (GAC_ROOT_DIR): Renamed from GAC_DIR.
(GAC_DIR): New define that doesn't include $(DESTDIR).
(install-data-local,uninstall-local): Use them. Use in-tree mono
runtime, not the installed one.
2004-06-29 Raja R Harinath <[email protected]>
* runtime/Makefile.am (gmcs_exe): New. Set only if not W32.
(monotwo_DATA): Use it.
From Atsushi Enomoto.
2004-06-24 Raja R Harinath <[email protected]>
* runtime/net_2_0/Makefile.am (gac_assemblies_list): Put back
ICSharpCode.SharpZipLib, not that it has a different version.
2004-06-24 Raja R Harinath <[email protected]>
* Makefile.am (MCS_DIRS, MCS_FILES): Add back Mono.CSharp.Debugger.
(tmpinst-dir-contents, $(tmpinst)/bin/mono.bat): Remove mono.bat
in W32. Use 'mono' and 'mcs' in W32 too.
(bootstrap) [PLATFORM_WIN32]: Back to single stage bootstrap.
* runtime/net_2_0/Makefile.am (gac_assemblies_list): Don't mention
nunit.*, IBM.Data.DB2, ICSharpCode.SharpZipLib.
Fix for #60443, the GAC .DLL-Hell.
2004-06-22 Raja R Harinath <[email protected]>
* Makefile.am (bootstrap) [PLATFORM_WIN32]: Make two-stage.
2004-06-18 Jackson Harper <[email protected]>
* man/mono.1: Add MONO_LOG_LEVEL and MONO_LOG_MASK. Add
instructions on setting multiple mask values.
Fri Jun 18 19:39:09 CEST 2004 Paolo Molaro <[email protected]>
* Makefile.am: process data before runtime, so the config file is
installed and gacutil has a chance to work (finding symlink).
2004-06-18 Raja R Harinath <[email protected]>
* runtime/Makefile.am ($(monoone_DATA) $(monotwo_DATA) $(monobins_DATA)):
Test if files exist in the mcs/ tree before creating symlinks.
Remove symlinks before creating them again.
* runtime/net_1_1/Makefile.am (mscorlib.dll $(gac_assemblies)): Likewise.
* runtime/net_2_0/Makefile.am (mscorlib.dll $(gac_assemblies)): Likewise.
2004-06-18 Raja R Harinath <[email protected]>
* scripts/Makefile.am (REWRITE): New. Common rewriting 'sed' command.
(bin_SCRIPTS): Unify all the script generating rules into one.
2004-06-16 Raja R Harinath <[email protected]>
* Makefile.am (bootstrap) [PLATFORM_WIN32]: Open code. Don't
build and populate net_2_0 profile.
(populate-runtime-subdir): Make into subroutine that takes list of
profiles to populate.
(faststrap): Update.
(MCS_DIRS, MCS_FILES, MONO_CSHARP_DEBUGGER_DIR, MONO_CSHARP_DEBUGGER_FILE):
Avoid automake conditional/+= problems.
(populate-runtime-subdir): Rewrite sanity check.
2004-06-16 Raja R Harinath <[email protected]>
Include prototype completely-untested 'make bootstrap' support for W32.
* Makefile.am (bootstrap): Define to fasterstrap for W32.
(MCS_DIRS, MCS_FILES): Don't refer to Mono.CSharp.Debugger in W32.
(tmpinst-dir): Change sub-make invoke to ...
(tmpinst-dir-contents): ... this. Build 'mono.bat' in W32 instead
of 'mono' and 'mcs'.
($(tmpinst)/bin/mono.bat): New.
2004-06-15 Dick Porter <[email protected]>
* configure.in: Check for struct ip_mreqn and struct ip_mreq on
windows too. Fixes bug 55040.
Mon Jun 14 18:38:34 CEST 2004 Paolo Molaro <[email protected]>
* configure.in: better explain that --with-nptl is not related to
NPTL, but to __thread support. Set sigaltstack support to off by
default.
2004-06-12 Raja R Harinath <[email protected]>
* Makefile.am (populate-runtime-subdir): Add _tmpinst directory
to the PATH.
2004-06-11 Jackson Harper <[email protected]>
* runtime/net_2_0/Makefile.am:
* runtime/net_1_1/Makefile.am: Remove signing patches
2004-06-11 Jackson Harper <[email protected]>
* man/mono.1: Add documentation for MONO_GAC_PREFIX.
* runtime/net_2_0/Makefile.am:
* runtime/net_1_1/Makefile.am: Sign assemblies before
installing. Do not sign ziplib, npgsql, or nunit assemblies. Sign mscorlib.
2004-06-11 Raja R Harinath <[email protected]>
* Makefile.am (populate-runtime-subdir): New target. Does a
controlled "make install" in the 'mcs/' directory to populate the
'runtime' directory.
(fasterstrap): Use it.
2004-06-10 Raja R Harinath <[email protected]>
* runtime/Makefile.am ($(monoone_DATA),$(monotwo_DATA),$(monobins_DATA)):
Don't copy from prefix. Use $(LN_S) to point to the mcs/ tree.
* runtime/net_1_1/Makefile.am (mscorlib.dll,$(gac_assemblies)):
Use $(LN_S) to point to the mcs/ tree, rather than copying.
* runtime/net_2_0/Makefile.am (mscorlib.dll,$(gac_assemblies)): Likewise.
2004-06-10 Raja R Harinath <[email protected]>
Support the new assembly signing setup in mcs/.
* Makefile.am (mcs-do-basic-build): Pass 'USE_BOOT_COMPILE' to sub-makes.
($(tmpinst)/etc/mono/machine.config): New target.
(tmpinst-dir.stamp): Remove and rewrite into ...
($(tmpinst)/bin/mcs): ... this and ...
($(tmpinst)/bin/mono): ... this. Update to use the in-tree machine.config.
(tmpinst-dir): Rewrite to invoke above $(tmpinst)/... targets directly.
* configure.in (AC_PROG_LN_S): New check to define $(LN_S).
Thu Jun 3 14:39:17 CEST 2004 Paolo Molaro <[email protected]>
* configure.in: libc setting for NetBSD (patch from [email protected]).
2004-06-01 Raja R Harinath <[email protected]>
* Makefile.am (bootstrap,faststrap,fasterstrap): Refactor.
Fix 'faststrap' to be corlib-version-change-safe.
(one-stage-strap,two-stage-strap,three-stage-strap): Remove.
(monolite-bootstrap): Update.
2004-05-31 Gonzalo Paniagua Javier <[email protected]>
* configure.in: fixlets for windows.
2004-05-29 Zoltan Varga <[email protected]>
* configure.in: export CC instead of passing it to libgc/configure.
2004-05-28 Duncan Mak <[email protected]>
* runtime/Makefile.am:
* scripts/Makefile.am: Include mono-find-provides and
mono-find-requires.
* scripts/mono-find-provides.in:
* scripts/mono-find-requires.in: New wrapper scripts.
2004-05-27 Zoltan Varga <[email protected]>
* configure.in: Pass CC to libgc configure.
2004-05-27 Gert Driesen ([email protected])
* monowiz.win32.nsi: normalized line-endings to unix (LF)
2004-05-27 Gert Driesen ([email protected])
* monowiz.win32.nsi: do not include mono subdirectory in
MonoConfigDir registry key, to match batch files
2004-05-26 Gonzalo Paniagua Javier <[email protected]>
* data/DefaultWsdlHelpGenerator.aspx: fixed querystring attribute
values. Now they are URlEncoded.
* data/browscap.ini.gz: updated.
2004-05-26 Raja R Harinath <[email protected]>
* Makefile.am (mcs-do-basic-build): No need to set MCS here.
* runtime/net_1_1/Makefile.am (gac_assemblies_list): Update to
reflect new names for nunit.util and nunit.framework. Add
nunit.core.
* runtime/net_2_0/Makefile.am (gac_assemblies_list): Likewise.
2004-05-25 Ben Maurer <[email protected]>
* config.h.in: remove
2004-05-25 18:30 CET Patrik Torstensson <[email protected]>
* configure.in: Check for trunc instead of truncl (HAVE_TRUNC)
2004-05-21 Gonzalo Paniagua Javier <[email protected]>
* Makefile.am:
* monowiz.win32.nsi: improved windows installer script.
2004-05-21 Raja R Harinath <[email protected]>
* README: Update to include instructions for the various new
bootstrap-like targets.
2004-05-20 Raja R Harinath <[email protected]>
* Makefile.am (get-monolite-latest, monolite-bootstrap):
New bootstrap targets to build from monolite.
Based on idea from Jaroslaw Kowalski <[email protected]>.
2004-05-20 Raja R Harinath <[email protected]>
* configure.in (AC_OUTPUT): Add tools/Makefile and
tools/locale-builder/Makefile.
* Makefile.am (SUBDIRS): Remove tools.
(DIST_SUBDIRS): Add 'tools'.
(bootstrap): Rewrite so that we get two new targets.
(faststrap): New two-stage build.
(fasterstrap): New one-stage build.
2004-05-19 Jackson Harper <[email protected]>
* tools/
* tools/Makefile.am: Add tools directory
* tools/locale-builder: Add the locale-builder tool, this tool is
not built by default as it is only needed by people that wish to
moidify culture data.
* Makefile.am: Add tools to build
Wed May 19 13:22:19 EDT 2004 Paolo Molaro <[email protected]>
* configure.in: make MacOSX default to use the included libgc.
2004-05-18 Zoltan Varga <[email protected]>
* configure.in: Get rid of -DMONO_USE_EXC_TABLES.
2004-05-19 Raja R Harinath <[email protected]>
* configure.in: Use proper autoconf idiom to pass additional
arguments to libgc/configure.
(PLATFORM_WIN32, NEED_LINK_UNLINK): Use three-argument AC_DEFINE.
* acconfig.h: Update to reflect changes.
2004-05-17 Raja R Harinath <[email protected]>
* Makefile.am (tmpinst-dir): Creates _tmpinst tree if
necessary. Move body ...
(tmpinst-dir.stamp): ... here.
(stage3): Don't remove _tmpinst tree.
(bootstrap-clean, bootstrap-check): New rules. They run the
corresponding rules in the mcs/ tree.
2004-05-14 Raja R Harinath <[email protected]>
* Makefile.am: Revert unlogged unexplained changes.
(stage3): Make 'all-profiles' since the mono source tarball
carries all the net_2_0 preview dlls.
2004-05-11 Jackson Harper <[email protected]>
* runtime/net_1_1/Makefile.am:
* runtime/net_2_0/Makefile.am: cscompmgd.dll is lowercase now.
2004-05-10 Raja R Harinath <[email protected]>
* Makefile.am (tmpinst-dir): Always add $tmpinst/lib to MONO_PATH.
Fix quoting of commands.
2004-05-08 Gonzalo Paniagua Javier <[email protected]>
* monowiz.win32.nsi: some changes i made to build the 0.91 win32 setup
file.
2004-05-07 Bernie Solomon <[email protected]>
* man/mono.1: mention MONO_EGD_SOCKET
2004-05-07 Raja R Harinath <[email protected]>
Goodbye 'fullbuild', hello 'bootstrap'.
* Makefile.am (bootstrap): New target for building from CVS. New
improved version of 'fullbuild' -- does not install any files.
(fullbuild): Obsolete target. Bootstraps and installs tree.
(mcs-tree-safe-build,xinstall-runtime,mcs-rest,remove-binaries):
Removed.
(stage1,stage1-mcs,stage1-mono,stage2,stage3)
(tmpinst-dir,tmpinst-runtime): New targets used to implement a
two-stage bootstrap.
2004-05-05 Gonzalo Paniagua Javier <[email protected]>
* configure.in: scandir check is no longer needed.
2004-05-05 Bernie Solomon <[email protected]>
* configure.in: set LIBC on HPUX
2004-05-05 Zoltan Varga <[email protected]>
* configure.in: Detect JNI headers in GNU classpath sources as well.
2004-05-05 Raja R Harinath <[email protected]>
* runtime/net_2_0/Makefile.am (install-data-local, uninstall-local):
Only disable this if INSTALL_2_0 is disabled.
2004-05-05 Gonzalo Paniagua Javier <[email protected]>
* data/DefaultWsdlHelpGenerator.aspx: add any cookie in the request to
the request we do for the actual web service.
2004-05-04 Gonzalo Paniagua Javier <[email protected]>
* configure.in: check for SIGEV_THREAD being defined before checking
for AIO support. Fixes compilation under FreeBSD.
2004-05-04 Raja R Harinath <[email protected]>
* runtime/net_1_1/Makefile.am (mono_runtime): Use USE_JIT, not
JIT_SUPPORTED.
(install-data-local, uninstall-data-local): Run runtime with
libtool.
* runtime/net_2_0/Makefile.am: Likewise.
Report from Urs C Muff <[email protected]>.
2004-05-03 Jackson Harper <[email protected]>
* man/gacutil.1: Basic man page for gacutil. This doesn't include
the new non-standard options yet.
2004-05-03 Gonzalo Paniagua Javier <[email protected]>
* data/machine.config: added version and publickeytoken.
2004-05-01 Duncan Mak <[email protected]>
* runtime/net_1_1/Makefile.am:
* runtime/net_2_0/Makefile.am (gac_assemblies_list): Add NUnit
dlls here.
(non_gac_assemblies): Removed, every thing is migrated over to gac_assemblies.
(EXTRA_DIST): Include only gac_assemblies.
(dist_assemblies_DATA): It's referring to $(non_gac_assemblies)
and that is no gone now. So remove as well.
($(non_gac_assemblies)): Bye bye.
2004-05-01 Duncan Mak <[email protected]>
* runtime/net_1_1/Makefile.am (gac_assemblies_list): Add
System.Web.Services. Someone accidentally took the line out.
2004-04-30 Jackson Harper <[email protected]>
* runtime/net_1_1/Makefile.am:
* runtime/net_2_0/Makefile.am: These assemblies are signed now.
2004-04-30 Raja R Harinath <[email protected]>
* runtime/net_1_1/Makefile.am (gac_assemblies_list): Remove .dll
suffix.
(gac_assemblies, non_gac_assemblies, corlibdir, dist_corlib_DATA):
New variables. Use Automake idioms.
(dist-hook): Remove.
(install-local, uninstall-local): Use mscorlib.dll from current
tree when running gacutil.
(mono_runtime): New variable. Points to either JIT compiler or
interpreter.
Report from Bernie Solomon <[email protected]>
* runtime/net_2_0/Makefile.am: Likewise.
* runtime/Makefile.am (dist_monobins_DATA): Rename from
monobins_DATA.
(EXTRA_DIST): Remove.
* Makefile.am (fullbuild): Update to changes.
2004-04-30 Jackson Harper <[email protected]>
* runtime/net_2_0/Makefile.am:
* runtime/net_1_1/Makefile.am: /lib/mono/gac. Dont forget the mono.
2004-04-30 Duncan Mak <[email protected]>
* runtime/Makefile.am ($(monobins_DATA)): Add sn.exe and sn.
2004-04-29 Duncan Mak <[email protected]>
* scripts/gmcs.in: New file.
* scripts/Makefile.am (EXTRA_DIST, bin_SCRIPTS, CLEANFILES): Add
gmcs script.
2004-04-29 Jackson Harper <[email protected]>
* runtime/net_2_0/Makefile.am: install 2.0 corlib to its own
special little place.
2004-04-29 Zoltan Varga <[email protected]>
* acconfig.h configure.in: Add check for scandir.
2004-04-29 Raja R Harinath <[email protected]>
* runtime/Makefile.am (monobins_DATA): Add gacutil.exe.
(SUBDIRS): Build here before building subdirs.
* runtime/net_1_1/Makefile.am (all-local): Copy
$(gac_assemblies_list) here.
(install-data-local): Install dll from $(srcdir).
(gacutil): Pick from current tree.
* runtime/net_2_0/Makefile.am: Likewise.
* Makefile.am (fullbuild): Update to changes in tree layout.
* runtime/net_1_1/Makefile.am (install-data-local): Allow empty
$(gac_assemblies_list).
($(gac_assemblies_list)): Pick libraries from 'class/lib/default',
not 'class/lib/net_1_1'.
2004-04-28 Jackson Harper <[email protected]>
* runtime/net_1_1/Makefile.am: Grab libs from proper directory, do
not assume gacutil is installed.
* runtime/net_2_0/Makefile.am: Do not assume gacutil is installed.
2004-04-28 Jackson Harper <[email protected]>
* configure.in: Add new Makefile.amS
* runtime/Makefile.am: libs are now in profile dependant
directories.
* runtime/net_1_1/Makefile.am: Install and Uninstall the .net 1.1
libs to the GAC.
* runtime/net_2_0/Makefile.am: Install and Uninstall the .net 2.0
libs to the GAC.
* data/Makefile.am: cleanup browscap.ini
2004-04-28 Bernie Solomon <[email protected]>
* configure.in: reword message re EGD support
now it is there
2004-04-28 Gonzalo Paniagua Javier <[email protected]>
* config.h.in:
* configure.in: added check for sys/aio.h. Also check the field name
in 'union sigval'.
2004-04-28 Jackson Harper <[email protected]>
* scripts/Makefile.am:
* scripts/gacutil.in: Add a gacutil script
2004-04-26 Jackson Harper <[email protected]>
* Makefile.am: Grab libraries from lib/default now.
* runtime/Makefile.am: Grab libraries from lib/default now.
2004-04-26 Bernie Solomon <[email protected]>
* configure.in: move setting of NO_VERSION_SCRIPT
until after checking for GNU ld
2004-04-22 Urs C Muff <[email protected]>
move .net assemblies from $prefix/bin/*.exe to $prefix/lib/*.exe on
windows/cygwin refactor .nsi to simply maintenance on script/batch
generation
* runtime/Makefile.am
* script/Makefile.am
* monowiz.win32.nsi
2004-04-14 Raja R Harinath <[email protected]>
* runtime/Makefile.am ($(assemblies_DATA)): Copy file into
$(srcdir). Clean up output.
($(monobins_DATA)): Likewise.
* Makefile.am (mcs-tree-safe-build): Fix typo.
2004-04-13 Sebastien Pouliot <[email protected]>
* configure.in: Added rules to check for getgrgid_r, getgrnam_r,
getpwnam_r, getpwuid_r, getresuid and setresuid.
2004-04-13 Raja R Harinath <[email protected]>
Allow 'make fullbuild' to work on non-srcdir build.
* Makefile.am (mcs_topdir): New variable.
(mcs-tree-safe-build,mcs-rest,remove-binaries): Work in non-srcdir
build.
(xinstall-runtime): Likewise. Use $(libgc_dir) directly, don't
grep for 'libgc'.
(fullbuild): Make ordering dependencies explicit.
2004-04-12 Sachin Kumar <[email protected]>
* Makefile.am: Added 'web' in SUBDIRS
2004-04-07 Gonzalo Paniagua Javier <[email protected]>
* configure.in: don't try-run the tests for nptl and/or sigaltstack
if they are disabled in the command line.
2004-04-05 Jackson Harper <[email protected]>
* man/ilasm.1: Show /output instead of /out as the switch for
specifying output file names.
2004-04-05 Zoltan Varga <[email protected]>
* configure.in: Check for pthread_getattr_np and pthread_attr_get_np.
2004-04-02 Gonzalo Paniagua Javier <[email protected]>
* config.h.in: added HAVE_GETPWUID_R
* configure.in: check for getpwuid_r.
2004-03-23 Zoltan Varga <[email protected]>
* configure.in: Fix GNU ld check.
2004-03-22 Zoltan Varga <[email protected]>
* configure.in: Use amd64 instead of x86-64 as directory name. Fixes
#55840.
* configure.in: Disable -version-script if not using GNU ld. Fixes
#55910.
* configure.in: Speedup successful sigaltstack test.
* configure.in: don't try-run the tests for nptl and/or sigaltstack
if they are disabled in the command line.
2004-04-05 Jackson Harper <[email protected]>
* man/ilasm.1: Show /output instead of /out as the switch for
specifying output file names.
2004-04-05 Zoltan Varga <[email protected]>
* configure.in: Check for pthread_getattr_np and pthread_attr_get_np.
2004-04-02 Gonzalo Paniagua Javier <[email protected]>
* config.h.in: added HAVE_GETPWUID_R
* configure.in: check for getpwuid_r.
2004-03-23 Zoltan Varga <[email protected]>
* configure.in: Fix GNU ld check.
@@ -1409,6 +557,7 @@ Thu Jul 31 16:19:07 CEST 2003 Paolo Molaro <[email protected]>
* man/sqlsharp.1: changed pass= to password= for the
PostgreSql provider.
>>>>>>> 1.166
2003-03-31 Gonzalo Paniagua Javier <[email protected]>
* data/machine.config: added SessionStateModule to httpModules section.
+25 -216
View File
@@ -1,19 +1,11 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I .
SUBDIRS = $(libgc_dir) mono $(ikvm_jni_dir) docs data runtime scripts man samples support web
SUBDIRS = @libgc_dir@ mono web docs runtime scripts man data samples support
# Keep in sync with SUBDIRS
## 'tools' is not normally built
DIST_SUBDIRS = libgc mono ikvm-jni docs data runtime scripts man samples support web tools
# EXTRA_SUBDIRS = libgc
EXTRA_DIST= mono.pc.in mono.spec.in mint.pc.in
# Distribute the 'mcs' tree too
dist-hook:
test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
pkgconfigdir = $(libdir)/pkgconfig
if JIT_SUPPORTED
pkgconfig_DATA= mono.pc mint.pc
@@ -23,220 +15,31 @@ endif
DISTCLEANFILES= mono.pc mint.pc
#
# The following targets are used to compile and install
# The following target is used to compile and install
# mono and mcs without running into the out-of-sync
# problems by doing the compilation in the right order.
#
.PHONY: bootstrap faststrap fasterstrap bootstrap-clean bootstrap-check get-monolite-latest monolite-bootstrap
.PHONY: tmpinst-dir tmpinst-mcs-basic-build tmpinst-mcs-short-build tmpinst-mcs-full-build tmpinst-monolite
.PHONY: mono-do-runtime-only mcs-do-basic-build mcs-do-short-build mcs-do-full-build mcs-do-clean-profiles mcs-do-run-test
.PHONY: populate-runtime-subdir
fullbuild: remove-binaries mcs-tree-safe-build xinstall-runtime mcs-rest install
if USE_JIT
mono_runtime = mono/mini/mono
else
mono_runtime = mono/interpreter/mint
endif
mcs-tree-safe-build:
(cd ../mcs/jay; $(MAKE))
(cd ../mcs/mcs; $(MAKE) MCS=mcs BOOTSTRAP_MCS=mcs)
(cd ../mcs/class/corlib; $(MAKE) MCS=mcs BOOTSTRAP_MCS=mcs)
cp ../mcs/class/lib/mscorlib.dll runtime
cp ../mcs/mcs/mcs.exe runtime
# Minimal set of directories to build, and files used to run the 'mcs' compiler
MCS_BASIC_DIRS = jay mcs class/corlib class/System
MCS_BASIC_FILES = \
$(mcs_topdir)/mcs/mcs.exe \
$(mcs_topdir)/class/lib/default/mscorlib.dll \
$(mcs_topdir)/class/lib/default/System.dll
xinstall-runtime:
if echo $(SUBDIRS) | grep "libgc " > /dev/null; then (cd libgc; $(MAKE) && $(MAKE) install); fi
(cd mono; $(MAKE) && $(MAKE) install)
(cd runtime; $(MAKE) install assemblies_DATA=mscorlib.dll monobins_DATA=mcs.exe)
# Set of directories and files the 'mcs' compiler can use
## We build class/System twice to resolve the cyclic dependency of class/System.XML
MCS_DIRS = $(MCS_BASIC_DIRS) class/System.XML class/System class/Mono.CSharp.Debugger
MCS_FILES = $(MCS_BASIC_FILES) \
$(mcs_topdir)/class/lib/default/System.Xml.dll \
$(mcs_topdir)/class/lib/default/Mono.CompilerServices.SymbolWriter.dll
mcs-rest:
(cd ../mcs/class; $(MAKE))
tmpinst = _tmpinst
remove-binaries:
rm ../mcs/class/lib/mscorlib.dll ../mcs/mcs/mcs.exe runtime/*dll runtime/*.exe > /dev/null 2>&1; echo
if PLATFORM_WIN32
populate_profiles = default:net_1_1
# bootstraps using the .NET C# compiler
bootstrap: tmpinst-dir mono-do-runtime-only
$(MAKE) fasterstrap
else
populate_profiles = default:net_1_1 net_2_0:net_2_0
bootstrap: tmpinst-mcs-basic-build mono-do-runtime-only
$(MAKE) tmpinst-mcs-short-build
$(MAKE) fasterstrap
endif
faststrap: tmpinst-mcs-short-build
$(MAKE) mono-do-runtime-only
$(MAKE) fasterstrap
fasterstrap: tmpinst-mcs-full-build
$(MAKE) populate-runtime-subdir
$(MAKE)
bootstrap-clean: clean mcs-do-clean-profiles
bootstrap-check: check mcs-do-run-test-profiles #mono-do-testjit
mono-do-testjit: $(tmpinst)/bin/ilasm
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
cd mono/tests && $(MAKE) test
# building with monolite
get-monolite-latest:
wget -O $(srcdir)/../monolite-latest.tar.gz http://www.go-mono.com/daily/monolite-latest.tar.gz
monolite-bootstrap: tmpinst-monolite mono-do-runtime-only
rm -f $(MCS_FILES)
$(MAKE) tmpinst-mcs-short-build
$(MAKE) fasterstrap
compiler-tests:
$(MAKE) mcs-do-clean-profiles
$(MAKE) bootstrap
$(MAKE) mcs-do-compiler-tests
bootstrap-world: compiler-tests
$(MAKE) install
# internal targets
tmpinst-mcs-basic-build: mcs-do-basic-build tmpinst-dir
mv -f $(MCS_BASIC_FILES) $(tmpinst)/lib
tmpinst-mcs-short-build: mcs-do-short-build tmpinst-dir
mv -f $(MCS_FILES) $(tmpinst)/lib
tmpinst-mcs-full-build: mcs-do-full-build tmpinst-dir
cp -f $(MCS_FILES) $(tmpinst)/lib
tmpinst-monolite: tmpinst-dir
-rm -f $(tmpinst)/lib/mcs.exe $(tmpinst)/lib/*.dll
-rm -fr $(tmpinst)/monolite-*
srcdir=`cd $(srcdir) && pwd` && cd $(tmpinst) && ( gzip -d -c $$srcdir/../monolite-latest.tar.gz | tar xf - )
mv -f $(tmpinst)/monolite-*/mcs.exe $(tmpinst)/monolite-*/*.dll $(tmpinst)/lib
rm -fr $(tmpinst)/monolite-*
# Build enough of 'mono' to run the stage1 mcs.exe
mono-do-runtime-only: $(CONFIG_HEADER)
for dir in $(libgc_dir) mono data; do \
(cd $$dir && $(MAKE)) || exit 1 ; \
done
mcs-do-basic-build:
rm -f $(MCS_FILES)
for dir in $(MCS_BASIC_DIRS); do \
(cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes USE_BOOT_COMPILE=yes BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB") || exit 1 ; \
done
mcs-do-short-build:
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH; export PATH ; \
for dir in $(MCS_DIRS); do \
(cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes) || exit 1 ; \
done
mcs-do-full-build:
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
cd $(mcs_topdir) && $(MAKE) NO_SIGN_ASSEMBLY=yes all-profiles
mcs-do-clean-profiles:
cd $(mcs_topdir) && $(MAKE) clean-profiles
mcs-do-run-test-profiles: tmpinst-dir $(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm $(tmpinst)/bin/pedump
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
cd $(mcs_topdir) && $(MAKE) run-test-profiles
mcs-do-compiler-tests:
tmpinst=`cd $(tmpinst) && pwd` ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
cd $(mcs_topdir) && $(MAKE) compiler-tests
populate-runtime-subdir:
test -n '$(populate_profiles)'
@srcdir=`cd $(srcdir) && pwd`; tmpinst=`pwd`/$(tmpinst) ; \
PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
for profile in $(populate_profiles); do \
( set fnord `echo $$profile | sed 's,:, ,g'` && \
echo "cd $(mcs_topdir) && $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install" && \
cd $(mcs_topdir) && \
$(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install ) || exit 1 ; \
done
find $(tmpinst)/prefix -type f -name '*jay*' -exec rm -f '{}' ';'
for i in `find $(tmpinst)/prefix -type d -name '*jay*' -print`; do rm -f $$i/*; done
test -z "`find $(tmpinst)/prefix -type f -print`"
rm -rf $(tmpinst)/prefix
tmpinst-dir:
mkdir -p $(tmpinst) $(tmpinst)/bin $(tmpinst)/lib $(tmpinst)/etc/mono/1.0 $(tmpinst)/etc/mono/2.0
$(MAKE) tmpinst-dir-contents
tmpinst-dir-contents: $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/etc/mono/1.0/machine.config $(tmpinst)/etc/mono/2.0/machine.config
if PLATFORM_WIN32
$(tmpinst)/bin/mono: $(srcdir)/Makefile.am
echo '#! /bin/sh' > $@
echo 'builddir="'`pwd`'"; win_builddir="'`cygpath -w -a .`'"' >> $@
echo 'tmpinst="$$win_builddir\\$(tmpinst)"' >> $@
echo 'if test -z "$$MONO_PATH" ; then MONO_PATH="$$tmpinst\\lib"; else MONO_PATH="$${MONO_PATH};$$tmpinst\\lib" ; fi' >> $@
echo 'MONO_CFG_DIR="$$tmpinst\\etc"' >> $@
echo 'export MONO_PATH MONO_CFG_DIR' >> $@
echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime).exe" "$$@"' >> $@
chmod +x $@
else
$(tmpinst)/bin/mono: $(srcdir)/Makefile.am
echo '#! /bin/sh' > $@
echo 'builddir="'`pwd`'"; tmpinst=$$builddir/$(tmpinst)' >> $@
echo 'if test -z "$$MONO_PATH" ; then MONO_PATH=$$tmpinst/lib; else MONO_PATH=$${MONO_PATH}:$$tmpinst/lib ; fi' >> $@
echo 'MONO_CFG_DIR=$$tmpinst/etc' >> $@
echo 'export MONO_PATH MONO_CFG_DIR' >> $@
echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime)" --config "$$builddir/data/config" "$$@"' >> $@
chmod +x $@
endif
$(tmpinst)/bin/pedump: $(srcdir)/Makefile.am
(b=`pwd`; echo '#! /bin/sh'; echo 'exec "'"$$b/libtool"'" --mode=execute "'"$$b/mono/metadata/pedump"'" "$$@"') > $@
chmod +x $@
$(tmpinst)/bin/mcs: $(srcdir)/Makefile.am
(t=`cd $(tmpinst) && pwd`; echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$t/lib/mcs.exe"'" "$$@"') > $@
chmod +x $@
# Used only by 'bootstrap-check' -- so, can safely use runtime/.
$(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm: $(srcdir)/Makefile.am
t=`cd $(tmpinst) && pwd`; r=`cd $(srcdir)/runtime && pwd`; \
( echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$r/$(@F).exe"'" "$$@"' ) > $@
chmod +x $@
$(tmpinst)/etc/mono/1.0/machine.config: $(srcdir)/data/net_1_1/machine.config
rm -f $@
srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono/1.0 && $(LN_S) $$srcdir/data/net_1_1/machine.config machine.config
$(tmpinst)/etc/mono/2.0/machine.config: $(srcdir)/data/net_2_0/machine.config
rm -f $@
srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono/2.0 && $(LN_S) $$srcdir/data/net_2_0/machine.config machine.config
# Obsolete target -- don't use.
.PHONY: fullbuild
fullbuild: bootstrap
$(MAKE) install
echo "*** 'fullbuild' is an obsolete target. Use 'make bootstrap && make install'."
exit 1
win32getdeps:
wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
@@ -255,4 +58,10 @@ win32getdeps:
unzip -n -d / nsis4cygwin.zip
win32setup:
makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
cp /usr/lib/libglib-2.0-0.dll @prefix@/lib
cp /usr/lib/iconv.dll @prefix@/lib
cp /usr/lib/libgmodule-2.0-0.dll @prefix@/lib
cp /usr/lib/libgobject-2.0-0.dll @prefix@/lib
cp /usr/lib/libgthread-2.0-0.dll @prefix@/lib
cp /usr/lib/libintl-1.dll @prefix@/lib
makensis /DMILESTONE=@VERSION@ /DSOURCE_INSTALL_DIR=`cygpath -a -w @prefix@`\\* monowiz.win32.nsi
+14 -92
View File
@@ -59,31 +59,14 @@ This is Mono.
tar xzf mcs-XXXX.tar.gz
tar xzf mono-XXXX.tar.gz
mv mono-XXX mono
mv mcs-XXX mcs
cd mono
cd mono-XXXX
./autogen.sh --prefix=/usr/local
make bootstrap
make fullbuild
c. Building the software from CVS
---------------------------------
If you are building the software from CVS, make sure that you
have up-to-date mcs and mono sources:
cvs co mono mcs
Then, go into the mono directory, and configure:
cd mono
./autogen.sh --prefix=/usr/local
Depending on whether you have an existing Mono installation or
not, you can try the following:
i. If you have an existing Mono installation
-----------------------------------------
c. Upgrade from CVS
-------------------
If you are upgrading from CVS you will need an existing Mono installation.
First verify that you have a working installation:
echo 'class X { static void Main () { System.Console.Write("OK");}}' > x.cs
@@ -96,86 +79,25 @@ This is Mono.
mono x.exe
If you get the output `OK' and no errors, and you have mono
version 0.31 or later, continue. Otherwise, you can try option
(ii) below.
If you get the output `OK' and no errors, you are ready to start your CVS upgrade.
You are ready to start your CVS upgrade. Compile with
First, make sure that you have up-to-date mcs and mono sources:
make bootstrap
cvs co mono mcs
This will automatically go into the mcs/ tree and build the
binaries there, and copy them into the appropriate
sub-directories of mono/runtime/.
Then, go into the mono directory, and configure:
Now, go to step (iii) below.
cd mono
./autogen.sh --prefix=/usr/local
ii. If you don't have a working Mono installation
---------------------------------------------
Then compile using the special target `fullbuild':
If you don't have a working Mono installation, an obvious choice
is to install the latest released packages of 'mono' for your
distribution and go back to step (i).
make fullbuild
You can also try a slightly more risky approach that should work
almost all the time.
This works by first getting the latest version of the 'monolite'
distribution, which contains just enough to run the 'mcs'
compiler. You do this by
make get-monolite-latest
This should place a monolite-latest.tar.gz in the parent
directory of the 'mono' source tree. You can then run:
make monolite-bootstrap
This will automatically gunzip and untar the tarball, place the
files appropriately, and then complete the bootstrap.
iii. Testing and Installation
------------------------
You can run the mono and mcs testsuites with the command:
make -k bootstrap-check
Expect to find several testsuite failures, especially in the
mcs/ tree. As a sanity check, you can compare the failures you
got with
http://go-mono.com/tests/displayTestResults.php
You can now install it:
make install
This step will compile and install at the same time.
Failure to follow these steps will result in a broken installation.
iv. Other useful "bootstrap"-like facilities
----------------------------------------
If you have a CVS snapshot that you keep updating periodically,
and/or do your development in, you may try using a couple of
specialty make targets that may be slightly faster than a
"make bootstrap".
You can try a two-stage bootstrap with:
make faststrap
This assumes that you have already run a "make bootstrap" on the
tree before.
If you want to avoid waiting even for that, you can try the
riskier one-stage build:
make fasterstrap
This should be attempted only if you're sure that the sources of
the mcs compiler itself and the sources of the libraries used by
it have not been changed.
2. Using Mono
=============
+2 -1
View File
@@ -10,6 +10,7 @@
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
#undef USE_MONO_MUTEX
#undef HAVE_LARGE_FILE_SUPPORT
#undef PLATFORM_WIN32
#undef HAVE_NEW_ICONV
#undef NAME_DEV_RANDOM
#undef HAVE_CRYPT_RNG
@@ -20,6 +21,7 @@
#undef HAVE_TM_GMTOFF
#undef MONO_SIZEOF_SUNPATH
#undef MONO_ZERO_ARRAY_LENGTH
#undef NEED_LINK_UNLINK
#undef PTHREAD_POINTER_ID
#undef HAVE_GC_H
#undef HAVE_GC_GCJ_MALLOC
@@ -33,5 +35,4 @@
#undef HAVE_SOCKLEN_T
#undef HAVE_TRUNCL
#undef HAVE_AINTL
#undef HAVE_SCANDIR
#undef HAVE_WORKING_SIGALTSTACK
+159
View File
@@ -0,0 +1,159 @@
/* config.h.in. Generated from configure.in by autoheader. */
#undef HAVE_INET_PTON
#undef HAVE_INET_ATON
#undef HAVE_MSG_NOSIGNAL
#undef HAVE_SOL_IP
#undef HAVE_SOL_TCP
#undef HAVE_SOL_IPV6
#undef HAVE_IP_PKTINFO
#undef HAVE_STRUCT_IP_MREQN
#undef HAVE_STRUCT_IP_MREQ
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
#undef USE_MONO_MUTEX
#undef HAVE_LARGE_FILE_SUPPORT
#undef PLATFORM_WIN32
#undef HAVE_NEW_ICONV
#undef NAME_DEV_RANDOM
#undef HAVE_CRYPT_RNG
#undef HAVE_BOEHM_GC
#undef USE_INCLUDED_LIBGC
#undef DISABLE_SHARED_HANDLES
#undef HAVE_TIMEZONE
#undef HAVE_TM_GMTOFF
#undef MONO_SIZEOF_SUNPATH
#undef MONO_ZERO_ARRAY_LENGTH
#undef NEED_LINK_UNLINK
#undef PTHREAD_POINTER_ID
#undef HAVE_GC_H
#undef HAVE_GC_GCJ_MALLOC
#undef HAVE_GC_ENABLE
#undef WITH_BUNDLE
#undef HAVE_GETHOSTBYNAME2_R
#undef HAVE_ICU
#undef HAVE_KW_THREAD
#undef HAVE_SIGNBIT
#undef USE_MACH_SEMA
#undef HAVE_SOCKLEN_T
#undef HAVE_TRUNCL
#undef HAVE_AINTL
#undef HAVE_WORKING_SIGALTSTACK
/* Define to 1 if you have the <aio.h> header file. */
#undef HAVE_AIO_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <elf.h> header file. */
#undef HAVE_ELF_H
/* Define to 1 if you have the `finite' function. */
#undef HAVE_FINITE
/* Define to 1 if you have the <gc/gc.h> header file. */
#undef HAVE_GC_GC_H
/* Define to 1 if you have the <gc.h> header file. */
#undef HAVE_GC_H
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
/* Define to 1 if you have the `inet_pton' function. */
#undef HAVE_INET_PTON
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `isfinite' function. */
#undef HAVE_ISFINITE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the `poll' function. */
#undef HAVE_POLL
/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have the `pthread_mutex_timedlock' function. */
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
/* Define to 1 if you have the <semaphore.h> header file. */
#undef HAVE_SEMAPHORE_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
/* Define to 1 if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H
/* Define to 1 if you have the `truncl' function. */
#undef HAVE_TRUNCL
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
#undef HAVE_VALGRIND_MEMCHECK_H
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of a `void *', as computed by sizeof. */
#undef SIZEOF_VOID_P
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
+169 -561
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -2,3 +2,4 @@ Makefile.in
Makefile
config
.cvsignore
browscap.ini
@@ -61,9 +61,6 @@ void Page_Load(object sender, EventArgs e)
Service service = desc.Services[0];
WebServiceName = service.Name;
if (desc.Bindings.Count == 0)
return;
DefaultBinding = desc.Bindings[0].Name;
WebServiceDescription = service.Documentation;
ServiceProtocols = FindServiceProtocols (null);
@@ -316,7 +313,7 @@ string GetTestResult ()
{
if (fill) {
if (qs != "") qs += "&";
qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
qs += Request.QueryString.GetKey(n) + "=" + Request.QueryString [n];
}
if (Request.QueryString.GetKey(n) == "ext") fill = true;
}
@@ -338,17 +335,6 @@ string GetTestResult ()
try
{
WebRequest req = WebRequest.Create (location + "/" + CurrentOperationName + "?" + qs);
HttpCookieCollection cookies = Request.Cookies;
int last = cookies.Count;
if (last > 0) {
CookieContainer container = new CookieContainer ();
for (int i = 0; i < last; i++) {
HttpCookie hcookie = cookies [i];
Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
container.Add (cookie);
}
((HttpWebRequest) req).CookieContainer = container;
}
WebResponse resp = req.GetResponse();
StreamReader sr = new StreamReader (resp.GetResponseStream());
string s = sr.ReadToEnd ();
@@ -940,23 +926,15 @@ public class HtmlSampleGenerator: SampleGenerator
}
// Serialize headers
bool writtenHeader = false;
foreach (object ob in msgbin.Extensions)
{
SoapHeaderBinding hb = ob as SoapHeaderBinding;
if (hb == null) continue;
if (!writtenHeader) {
xtw.WriteStartElement ("soap", "Header", SoapEnvelopeNamespace);
writtenHeader = true;
}
xtw.WriteStartElement ("soap", "Header", SoapEnvelopeNamespace);
WriteHeader (xtw, hb);
}
if (writtenHeader)
xtw.WriteEndElement ();
}
// Serialize body
xtw.WriteStartElement ("soap", "Body", SoapEnvelopeNamespace);
@@ -1604,9 +1582,7 @@ function clearForm ()
<p class="label">Web Service Overview</p>
<%#WebServiceDescription%>
<%} if (DefaultBinding == null) {%>
This service does not contain any public web method.
<%} else if (CurrentPage == "op") {%>
<%} if (CurrentPage == "op") {%>
<!--
**********************************************************
@@ -1734,7 +1710,9 @@ This service does not contain any public web method.
<% } %>
<% } %>
<%} else if (CurrentPage == "proxy") {%>
<%}%>
<% if (CurrentPage == "proxy") {%>
<!--
**********************************************************
Client Proxy
@@ -1755,7 +1733,9 @@ This service does not contain any public web method.
<div class="codePanel">
<div class="code-<%#CurrentLanguage%>"><%#GetProxyCode ()%></div>
</div>
<%} else if (CurrentPage == "wsdl") {%>
<%}%>
<% if (CurrentPage == "wsdl") {%>
<!--
**********************************************************
Service description
+8 -3
View File
@@ -1,10 +1,15 @@
SUBDIRS = net_1_1 net_2_0
monodir = $(sysconfdir)/mono
EXTRA_DIST = config.in \
browscap.ini
machine.config \
DefaultWsdlHelpGenerator.aspx \
browscap.ini.gz
mono_DATA = config \
machine.config \
DefaultWsdlHelpGenerator.aspx \
browscap.ini
browscap.ini: browscap.ini.gz
gunzip -c $^ > $@
-12301
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
+11 -1
View File
@@ -1,10 +1,20 @@
<configuration>
<dllmap dll="cygwin1.dll" target="@LIBC@" />
<dllmap dll="libc" target="@LIBC@" />
<dllmap dll="libintl" target="@INTL@" />
<dllmap dll="libxslt.dll" target="libxslt@libsuffix@" />
<dllmap dll="libmySQL.dll" target="libmysqlclient@libsuffix@" />
<dllmap dll="odbc32.dll" target="libodbc@libsuffix@" />
<dllmap dll="libglib-2.0-0.dll" target="libglib-2.0@libsuffix@" />
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0@libsuffix@" />
<dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0@libsuffix@" />
<dllmap dll="libpango-1.0-0.dll" target="libpango-1.0@libsuffix@" />
<dllmap dll="libatk-1.0-0.dll" target="libatk-1.0@libsuffix@" />
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0@libsuffix@" />
<dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0@libsuffix@" />
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0@libsuffix@" />
<dllmap dll="libglade-2.0-0.dll" target="libglade-2.0@libsuffix@" />
<dllmap dll="oci" target="clntsh" />
<dllmap dll="gtkhtml-3.0" target="libgtkhtml-3.0@libsuffix@" />
<dllmap dll="db2cli" target="libdb2_36@libsuffix@"/>
<dllmap dll="gstreamer" target="libgstreamer-0.6@libsuffix@" />
</configuration>
+196
View File
@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System" />
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System" />
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSectionHandler, System" allowLocation="false"/>
<sectionGroup name="system.web">
<section name="httpHandlers"
type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web" />
<section name="httpModules"
type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web" />
<section name="machineKey"
type="System.Web.Configuration.MachineKeyConfigHandler, System.Web" />
<section name="authentication"
type="System.Web.Configuration.AuthenticationConfigHandler, System.Web" />
<section name="authorization"
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web" />
<section name="globalization"
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web" />
<section name="sessionState"
type="System.Web.SessionState.SessionStateSectionHandler, System.Web" />
<section name="trace"
type="System.Web.Configuration.TraceConfigurationHandler, System.Web" />
<section name="webServices"
type="System.Web.Services.Configuration.WebServicesConfigurationSectionHandler, System.Web.Services" />
<section name="webControls"
type="System.Web.Configuration.WebControlsSectionHandler, System.Web" />
<section name="compilation"
type="System.Web.Configuration.CompilationConfigurationHandler, System.Web" />
<section name="httpRuntime"
type="System.Web.Configuration.HttpRuntimeConfigurationHandler, System.Web" />
<section name="customErrors"
type="System.Web.Configuration.CustomErrorsConfigHandler, System.Web" />
<section name="pages"
type="System.Web.Configuration.PagesConfigurationHandler, System.Web" />
</sectionGroup>
<sectionGroup name="system.net">
<section name="settings"
type="System.Net.Configuration.NetConfigurationHandler, System" />
<section name="connectionManagement"
type="System.Net.Configuration.ConnectionManagementHandler, System" />
<section name="authenticationModules"
type="System.Net.Configuration.NetAuthenticationModuleHandler, System" />
<section name="defaultProxy"
type="System.Net.Configuration.DefaultProxyHandler, System" />
<section name="webRequestModules"
type="System.Net.Configuration.WebRequestModuleHandler, System" />
</sectionGroup>
<section name="system.drawing" type="System.Configuration.NameValueSectionHandler" />
</configSections>
<system.net>
<connectionManagement>
<add address="*" maxconnection="2" />
</connectionManagement>
<authenticationModules>
<add type="System.Net.BasicClient" />
<add type="System.Net.DigestClient" />
<add type="System.Net.NtlmClient" />
</authenticationModules>
<defaultProxy>
<proxy />
<!-- bypassonlocal and proxyaddress are ok -->
<!-- usessystemdefault is not supported -->
</defaultProxy>
<webRequestModules>
<add prefix="http" type="System.Net.HttpRequestCreator, System" />
<add prefix="https" type="System.Net.HttpRequestCreator, System" />
<add prefix="file" type="System.Net.FileWebRequestCreator, System" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.web>
<httpHandlers>
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web" />
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web" />
<add verb="*" path="*.asmx" validate="false"
type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services" />
<add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web" />
<add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web" />
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web" />
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web" />
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web" />
<add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web" />
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting" validate="false" />
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting" validate="false" />
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web" />
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web" />
</httpHandlers>
<httpModules>
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web" />
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web" />
<add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web" />
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule, System.Web" />
</httpModules>
<authentication mode="Forms">
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
<credentials passwordFormat="Clear">
<!--<user name="gonzalo" password="gonz"/>-->
</credentials>
</forms>
</authentication>
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
<globalization requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="utf-8"/>
<!--
culture="en-US"
uiculture="en-US" />
-->
<sessionState mode="InProc" />
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
</webServices>
<webControls clientScriptsLocation="/web_scripts" />
<compilation debug="false" defaultLanguage="c#">
<compilers>
<compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
type="Microsoft.CSharp.CSharpCodeProvider, System" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
warningLevel="1" compilerOptions=""
type="Microsoft.VisualBasic.VBCodeProvider, System" />
</compilers>
<assemblies>
<!--<add assembly="mscorlib" /> -->
<add assembly="System" />
<add assembly="System.Xml" />
<add assembly="System.Data" />
<add assembly="System.Web" />
<add assembly="System.Web.Services" />
<add assembly="System.Drawing" />
<add assembly="*" /> <!-- Add assemblies in bin directory -->
</assemblies>
</compilation>
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100" />
<pages buffer="true"
enableSessionState="true"
autoEventWireup="true"
validateRequest="true" />
</system.web>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http client" displayName="http client (delay loaded)" delayLoadAsClientChannel="true" />
<channel ref="tcp client" displayName="tcp client (delay loaded)" delayLoadAsClientChannel="true" />
</channels>
</application>
<channels>
<channel id="http" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting" />
<channel id="http client" type="System.Runtime.Remoting.Channels.Http.HttpClientChannel, System.Runtime.Remoting" />
<channel id="http server" type="System.Runtime.Remoting.Channels.Http.HttpServerChannel, System.Runtime.Remoting" />
<channel id="tcp" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting" />
<channel id="tcp client" type="System.Runtime.Remoting.Channels.Tcp.TcpClientChannel, System.Runtime.Remoting" />
<channel id="tcp server" type="System.Runtime.Remoting.Channels.Tcp.TcpServerChannel, System.Runtime.Remoting" />
</channels>
<channelSinkProviders>
<clientProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapClientFormatterSinkProvider, System.Runtime.Remoting" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting" />
</clientProviders>
<serverProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider, System.Runtime.Remoting" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider, System.Runtime.Remoting" />
<provider id="wsdl" type="System.Runtime.Remoting.MetadataServices.SdlChannelSinkProvider, System.Runtime.Remoting" />
</serverProviders>
</channelSinkProviders>
</system.runtime.remoting>
<appSettings>
<!--<add key="yourkey" value="your value" /> -->
<!--<remove key="a key defined higher in the hierarchy" /> -->
<!--<clear/> Removes all defined settings -->
</appSettings>
<system.diagnostics>
<trace autoflush="false" indentsize="4" />
</system.diagnostics>
<system.drawing>
</system.drawing>
</configuration>
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-8
View File
@@ -1,8 +0,0 @@
monodir = $(sysconfdir)/mono/1.0
EXTRA_DIST = machine.config \
DefaultWsdlHelpGenerator.aspx
mono_DATA = machine.config \
DefaultWsdlHelpGenerator.aspx
-216
View File
@@ -1,216 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<sectionGroup name="system.web">
<section name="httpHandlers"
type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpModules"
type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="machineKey"
type="System.Web.Configuration.MachineKeyConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="authentication"
type="System.Web.Configuration.AuthenticationConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="authorization"
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="globalization"
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="sessionState"
type="System.Web.SessionState.SessionStateSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="trace"
type="System.Web.Configuration.TraceConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="webServices"
type="System.Web.Services.Configuration.WebServicesConfigurationSectionHandler, System.Web.Services, Version=1.0.5000.0 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="webControls"
type="System.Web.Configuration.WebControlsSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="compilation"
type="System.Web.Configuration.CompilationConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpRuntime"
type="System.Web.Configuration.HttpRuntimeConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="customErrors"
type="System.Web.Configuration.CustomErrorsConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="pages"
type="System.Web.Configuration.PagesConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral" />
<section name="clientTarget"
type="System.Web.Configuration.ClientTargetSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral" />
</sectionGroup>
<sectionGroup name="system.net">
<section name="settings"
type="System.Net.Configuration.NetConfigurationHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="connectionManagement"
type="System.Net.Configuration.ConnectionManagementHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="authenticationModules"
type="System.Net.Configuration.NetAuthenticationModuleHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="defaultProxy"
type="System.Net.Configuration.DefaultProxyHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webRequestModules"
type="System.Net.Configuration.WebRequestModuleHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<system.net>
<connectionManagement>
<add address="*" maxconnection="2" />
</connectionManagement>
<authenticationModules>
<add type="System.Net.BasicClient, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add type="System.Net.DigestClient, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add type="System.Net.NtlmClient, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</authenticationModules>
<defaultProxy>
<proxy />
<!-- bypassonlocal and proxyaddress are ok -->
<!-- usessystemdefault is not supported -->
</defaultProxy>
<webRequestModules>
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.web>
<httpHandlers>
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpHandlers>
<httpModules>
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpModules>
<authentication mode="Forms">
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
<credentials passwordFormat="Clear">
<!--<user name="gonzalo" password="gonz"/>-->
</credentials>
</forms>
</authentication>
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
<globalization requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="utf-8"/>
<!--
culture="en-US"
uiculture="en-US" />
-->
<sessionState mode="InProc" />
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
</webServices>
<webControls clientScriptsLocation="/web_scripts" />
<compilation debug="false" defaultLanguage="c#">
<compilers>
<compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
warningLevel="1" compilerOptions=""
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilers>
<assemblies>
<!--<add assembly="mscorlib" /> -->
<add assembly="System" />
<add assembly="System.Xml" />
<add assembly="System.Data" />
<add assembly="System.Web" />
<add assembly="System.Web.Services" />
<add assembly="System.Drawing" />
<add assembly="*" /> <!-- Add assemblies in bin directory -->
</assemblies>
</compilation>
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100" />
<pages buffer="true"
enableSessionState="true"
autoEventWireup="true"
validateRequest="true" />
<clientTarget>
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
<add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
<add alias="downlevel" userAgent="Unknown" />
</clientTarget>
</system.web>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http client" displayName="http client (delay loaded)" delayLoadAsClientChannel="true" />
<channel ref="tcp client" displayName="tcp client (delay loaded)" delayLoadAsClientChannel="true" />
</channels>
</application>
<channels>
<channel id="http" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="http client" type="System.Runtime.Remoting.Channels.Http.HttpClientChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="http server" type="System.Runtime.Remoting.Channels.Http.HttpServerChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp client" type="System.Runtime.Remoting.Channels.Tcp.TcpClientChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp server" type="System.Runtime.Remoting.Channels.Tcp.TcpServerChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</channels>
<channelSinkProviders>
<clientProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapClientFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</clientProviders>
<serverProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<provider id="wsdl" type="System.Runtime.Remoting.MetadataServices.SdlChannelSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</serverProviders>
</channelSinkProviders>
</system.runtime.remoting>
<appSettings>
<!--<add key="yourkey" value="your value" /> -->
<!--<remove key="a key defined higher in the hierarchy" /> -->
<!--<clear/> Removes all defined settings -->
</appSettings>
<system.diagnostics>
<trace autoflush="false" indentsize="4" />
</system.diagnostics>
<system.drawing>
</system.drawing>
<strongNames>
<pubTokenMapping>
<!-- ECMA key -->
<map Token="b77a5c561934e089" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Microsoft (final) key -->
<map Token="b03f5f7f11d50a3a" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Microsoft (Web Service Enhancement) key -->
<map Token="31bf3856ad364e35" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- IBM (DB2 Data Provider) key -->
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
</pubTokenMapping>
</strongNames>
</configuration>
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
File diff suppressed because it is too large. Load diff
-8
View File
@@ -1,8 +0,0 @@
monodir = $(sysconfdir)/mono/2.0
EXTRA_DIST = machine.config \
DefaultWsdlHelpGenerator.aspx
mono_DATA = machine.config \
DefaultWsdlHelpGenerator.aspx
-216
View File
@@ -1,216 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="system.runtime.remoting" type="System.Configuration.IgnoreSectionHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
<sectionGroup name="system.web">
<section name="httpHandlers"
type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpModules"
type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="machineKey"
type="System.Web.Configuration.MachineKeyConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="authentication"
type="System.Web.Configuration.AuthenticationConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="authorization"
type="System.Web.Configuration.AuthorizationConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="globalization"
type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="sessionState"
type="System.Web.SessionState.SessionStateSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="trace"
type="System.Web.Configuration.TraceConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="webServices"
type="System.Web.Services.Configuration.WebServicesConfigurationSectionHandler, System.Web.Services, Version=2.0.3600.0 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="webControls"
type="System.Web.Configuration.WebControlsSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="compilation"
type="System.Web.Configuration.CompilationConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="httpRuntime"
type="System.Web.Configuration.HttpRuntimeConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="customErrors"
type="System.Web.Configuration.CustomErrorsConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="pages"
type="System.Web.Configuration.PagesConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral" />
<section name="clientTarget"
type="System.Web.Configuration.ClientTargetSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral" />
</sectionGroup>
<sectionGroup name="system.net">
<section name="settings"
type="System.Net.Configuration.NetConfigurationHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="connectionManagement"
type="System.Net.Configuration.ConnectionManagementHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="authenticationModules"
type="System.Net.Configuration.NetAuthenticationModuleHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="defaultProxy"
type="System.Net.Configuration.DefaultProxyHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="webRequestModules"
type="System.Net.Configuration.WebRequestModuleHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
<section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<system.net>
<connectionManagement>
<add address="*" maxconnection="2" />
</connectionManagement>
<authenticationModules>
<add type="System.Net.BasicClient, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add type="System.Net.DigestClient, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add type="System.Net.NtlmClient, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</authenticationModules>
<defaultProxy>
<proxy />
<!-- bypassonlocal and proxyaddress are ok -->
<!-- usessystemdefault is not supported -->
</defaultProxy>
<webRequestModules>
<add prefix="http" type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="https" type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</webRequestModules>
<settings>
<ipv6 enabled="false"/>
</settings>
</system.net>
<system.web>
<httpHandlers>
<add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
<add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpHandlers>
<httpModules>
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpModules>
<authentication mode="Forms">
<forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
<credentials passwordFormat="Clear">
<!--<user name="gonzalo" password="gonz"/>-->
</credentials>
</forms>
</authentication>
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
<globalization requestEncoding="utf-8"
responseEncoding="utf-8"
fileEncoding="utf-8"/>
<!--
culture="en-US"
uiculture="en-US" />
-->
<sessionState mode="InProc" />
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
</webServices>
<webControls clientScriptsLocation="/web_scripts" />
<compilation debug="false" defaultLanguage="c#">
<compilers>
<compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
warningLevel="1" compilerOptions=""
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</compilers>
<assemblies>
<!--<add assembly="mscorlib" /> -->
<add assembly="System" />
<add assembly="System.Xml" />
<add assembly="System.Data" />
<add assembly="System.Web" />
<add assembly="System.Web.Services" />
<add assembly="System.Drawing" />
<add assembly="*" /> <!-- Add assemblies in bin directory -->
</assemblies>
</compilation>
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100" />
<pages buffer="true"
enableSessionState="true"
autoEventWireup="true"
validateRequest="true" />
<clientTarget>
<add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
<add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
<add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
<add alias="downlevel" userAgent="Unknown" />
</clientTarget>
</system.web>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http client" displayName="http client (delay loaded)" delayLoadAsClientChannel="true" />
<channel ref="tcp client" displayName="tcp client (delay loaded)" delayLoadAsClientChannel="true" />
</channels>
</application>
<channels>
<channel id="http" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="http client" type="System.Runtime.Remoting.Channels.Http.HttpClientChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="http server" type="System.Runtime.Remoting.Channels.Http.HttpServerChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp client" type="System.Runtime.Remoting.Channels.Tcp.TcpClientChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<channel id="tcp server" type="System.Runtime.Remoting.Channels.Tcp.TcpServerChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</channels>
<channelSinkProviders>
<clientProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</clientProviders>
<serverProviders>
<formatter id="soap" type="System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<provider id="wsdl" type="System.Runtime.Remoting.MetadataServices.SdlChannelSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</serverProviders>
</channelSinkProviders>
</system.runtime.remoting>
<appSettings>
<!--<add key="yourkey" value="your value" /> -->
<!--<remove key="a key defined higher in the hierarchy" /> -->
<!--<clear/> Removes all defined settings -->
</appSettings>
<system.diagnostics>
<trace autoflush="false" indentsize="4" />
</system.diagnostics>
<system.drawing>
</system.drawing>
<strongNames>
<pubTokenMapping>
<!-- ECMA key -->
<map Token="b77a5c561934e089" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Microsoft (final) key -->
<map Token="b03f5f7f11d50a3a" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- Microsoft (Web Service Enhancement) key -->
<map Token="31bf3856ad364e35" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
<!-- IBM (DB2 Data Provider) key -->
<map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
</pubTokenMapping>
</strongNames>
</configuration>
-302
View File
@@ -1,302 +0,0 @@
Here "abc" stays for "array bounds check", or "array bound checks", or
some combination of the two...
------------------------------------------------------------------------------
USAGE
Simply use the "abcrem" optimization invoking mono.
To see if bound checks are actually removed, use "mono -v" and grep for
"ARRAY-ACCESS" in the output, there should be a message for each check
that has been removed.
To trace the algorithm execution, use "-v -v -v", and be prepared to be
totally submersed by debugging messages...
------------------------------------------------------------------------------
EFFECTIVENESS
The abc removal code can now always remove bound checks from "clean"
array scans in loops, and generally anyway there are clear conditions that
already state that the index is "safe".
To be clearer, and give an idea of what the algorithm can and cannot do
without describing it in detail... keep in mind that only "redunant" checks
cannot be removed. By "redundant", I mean "already explicitly checked" in
the method code.
Unfortunately, analyzing complex expressions is not so easy (see below for
details), so the capabilities of this "abc remover" are limited.
These are simple guidelines:
- Only expressions of the following kinds are handled:
- constant
- variable [+/- constant]
- Only comparisons between "handled" expressions are understood.
- "switch" statements are not yet handled.
This means that code like this will be handled well:
for (int i = 0; i < a.Length; i++) {
a [i] = .....
}
The "i" variable could be declared out of the "for", the "for" could be a
"while", and maybe even implemented with "goto", the array could be scanned
in reverse order, and everything would still work.
I could have a temporary variable storing the array length, and check on
it inside the loop, and the abc removal would still occurr, like this:
int i = 0;
int l = a.Length;
while ( i < l ) {
a [i] ......
}
or this:
int l = a.Length;
for (int i = l; i > 0; i--) {
a [i] = .....
}
The following two examples would work:
for (int i = 0; i < (a.Length -1); i++) .....
for (int i = 0; i < a.Length; i += 2) .....
But just something like this
int delta = -1;
for (int i = 0; i < (a.Length + delta); i++) .....
or like this
int delta = +2;
for (int i = 0; i < a.Length; i += delta) .....
would not work, the check would stay there, sorry :-(
(unless a combination of cfold, consprop and copyprop is used, too, which
would make the constant value of "delta" explicit).
Just to make you understand how things are tricky... this would work!
int limit = a.Length - 1;
for (int i = 0; i < limit; i++) {
a [i] = .....
}
A detailed explanation of the reason why things are done like this is given
below...
------------------------------------------------------------------------------
THE ALGORITHM
This array bound check removal (abc removal) algorithm is based on
symbolic execution concepts. I handle the removal like an "unreachable
code elimination" (and in fact the optimization could be extended to remove
also other unreachable sections of code, due to branches that "always go the
same way").
In symbolic execution, variables do not have actual (numeric) values, but
instead symbolic expressions (like "a", or "x+y").
Also, branch conditions are handled like symbolic conditions (like "i<k"),
which state relations between variable values.
The SSA representation inside mini is somewhat close to a symbolic
representation of the execution of the compiled method.
Particularly, the representation of variable values is exactly a symbolic
one. It is enough to find all CEE_STIND_* instructions which store to a
local variable, and their second argument is exactly the variable value.
Actually, "cfg->vars [<variable-index>]->def" should contain exactly
those store instructions, and the "get_variable_value_from_ssa_store"
function extracts the variable value from there.
On the other hand, the conditions under which each basic block is
executed are not made fully explicit.
However, it is not difficult to make them so.
Each BB that has more than one exit BB, in practice must end either with
a conditional branch instruction or with a switch instruction.
In the first case, the BB has exactly two exit BBs, and their execution
conditions are easy to get from the condition of the branch (see the
"get_relation_from_branch_instruction" function, and expecially the end of
"analyze_block" in abcremoval.c.
If there is a switch, the jump condition of every exit BB is the equality
of the switch argument with the particular index associated with its case
(but the current implementation does not handle switch statements yet).
These individual conditions are in practice associated to each arc that
connects BBs in the CFG (with the simple case that unconditional branches
have a "TRUE" condition, because they always happen).
So, for each BB, its *proper* entry condition is the union of all the
conditions associated to arcs that enter the BB. The "union" is like a
logical "or", in the sense that either of the condition could be true,
they are not necessarily all true. This means that if I can enter a BB
in two ways, and in one case I know that "x>0", and in the other that
"x==0", actually in the BB I know that "x>=0", which is a weaker
condition (the union of the two).
Also, the *complete* entry condition for a BB is the "intersection" of all
the entry conditions of its dominators. This is true because each dominator
is the only way to reach the BB, so the entry condition of each dominator
must be true if the control flow reached the BB. This translates to the
logical "and" of all the "proper" conditions of the BBs met walking up in the
dominator tree. So, if one says "x>0", and another "x==1", then I know
that "x==1", which is a stronger condition (the intersection of the two).
Note that, if the two conditions were "x>0" and "x==0", then the block would
be unreachable (the intersection is empty), because some branch is impossible.
Another observation is that, inside each BB, every variable is subject to the
complete entry condition of that very same BB, and not the one in which it is
defined (with the "complete entry condition" being the thing I defined before,
sorry if these terms "proper" and "complete" are strange, I found nothing
better).
This happens because the branch conditions are related to the control flow.
I can define "i=a", and if I am in a BB where "a>0", then "i>0", but not
otherwise.
So, intuitively, if the available conditions say "i>=0", and i is used as an
index in an array access, then the lower bound check can be omitted.
If the condition also says "(i>=0)&&(i<array.length)", the abc removal can
occur.
So, a complete solution to the problem of abc removal would be the following:
for each array access, build a system of equations containing:
[1] all the symbolic variable definitions
[2] the complete entry condition of the BB in which the array access occurs
[3] the two "goal functions" ("index >=0" and "index < array.length")
If the system is valid for *each possible* variable value, then the goal
functions are always true, and the abc can be removed.
All this discussion is useful to give a precise specification to the problem
we are trying to solve.
The trouble is that, in the general case, the resulting system of equations
is like a predicate in first order logic, which is semi-decidable, and its
general solution is anyway too complex to be attempted in a JIT compiler
(which should not contain a full fledged theorem prover).
Therefore, we must cut some corner.
By the way, there is also another big problem, which is caused by "recursive"
symbolic definitions. These definition can (and generally do) happen every
time there is a loop. For instance, in the following piece of code
for ( int i = 0; i < array.length; i++ ) {
Console.WriteLine( "array [i] = " + array [i] );
}
one of the definitions of i is a PHI that can be either 0 or "i + 1".
Now, we know that mathematically "i = i + 1" does not make sense, and in
fact symbolic values are not "equations", they are "symbolic definitions".
The actual symbolic value of i is a generic "n", where "n" is the number of
iterations of the loop, but this is terrible to handle (and in more complex
examples the symbolic value of i simply cannot be written, because i is
calculated in an iterative way).
However, the definition "i = i + 1" tells us something about i: it tells us
that i "grows". So (from the PHI definition) we know that i is either 0, or
"grows". This is enough to tell that "i>=0", which is what we want!
It is important to note that recursive definitions can only occurr inside
PHI definitions, because actually a variable cannot be defined *only* in terms
of itself!
At this point, I can explain which corners I want to cut to make the
problem solvable. It will not remove all the abc that could theoretically
be removed, but at least it will work.
The easiest way to cut corners is to only handle expressions which are
"reasonably simple", and ignore the rest.
Keep in mind that ignoring an expression is not harmful in itself.
The algorithm will be simply "less powerful", because it will ignore
conditions that could have caused to the removal of an abc, but will
not remove checks "by mistake" (so the resulting code will be in any case
correct).
The expressions we handle are the following (all of integer type):
- constant
- variable
- variable + constant
- constant + variable
- variable - constant
And, of course, PHI definitions.
Any other expression causes the introduction of an "any" value in the
evaluation, which makes all values that depend from it unknown as well.
We will call these kind of definitions "summarizable" definitions.
In a first attempt, we can consider only branch conditions that have the
simplest possible form (the comparison of two summarizable expressions).
We can also simplify the effect of variable definitions, keeping only
what is relevant to know: their value range with respect to zero and with
respect to the length of the array we are currently handling.
One particular note on PHI functions: they work (obviously) like the logical
"or" of their definitions, and therefore are equivalent to the "logical or"
of the summarization of their definitions.
About recursive definitions (which, believe me, are the worst thing in all
this mess), we handle only "monotonic" ones. That is, we try to understand
if the recursive definition (which, as we said above, must happen because
of a loop) always "grows" or "gets smaller". In all other cases, we decide
we cannot handle it.
One critical thing, once we have defined all these data structures, is how
the evaluation is actually performed.
In a first attempt I coded a "brute force" approach, which for each BB
tried to examine all possible conditions between all variables, filling
a sort of "evaluation matrix". The problem was that the complexity of this
evaluation was quadratic (or worse) on the number of variables, and that
many wariables were examined even if they were not involved in any array
access.
Following the ABCD paper (http://citeseer.ist.psu.edu/bodik00abcd.html),
I rewrote the algorithm in a more "sparse" way.
Now, the main data structure is a graph of relations between variables, and
each attempt to remove a check performs a traversal of the graph, looking
for a path from the index to the array length that satisfies the properties
"index >= 0" and "index < length". If such a path is found, the check is
removed. It is true that in theory *each* traversal has a complexity which
is exponential on the number of variables, but in practice the graph is not
very connected, so the traversal terminates quickly.
Then, the algorithm to optimize one method looks like this:
[1] Preparation:
[1a] Build the SSA representation.
[1b] Prepare the evaluation graph (empty)
[1b] Summarize each varible definition, and put the resulting relations
in the evaluation graph
[2] Analyze each BB, starting from the entry point and following the
dominator tree:
[2a] Summarize its entry condition, and put the resulting relations
in the evaluation graph (this is the reason why the BBs are examined
following the dominator tree, so that conditions are added to the
graph in a "cumulative" way)
[2b] Scan the BB instructions, and for each array access perform step [3]
[2c] Process children BBs following the dominator tree (step [2])
[2d] Remove from the evaluation area the conditions added at step [2a]
(so that backtracking along the tree the area is properly cleared)
[3] Attempt the removal:
[3a] Summarize the index expression, to see if we can handle it; there
are three cases: the index is either a constant, or a variable (with
an optional delta) or cannot be handled (is a "any")
[3b] If the index can be handled, traverse the evaluation area searching
a path from the index variable to the array length (if the index is
a constant, just examine the array length to see if it has some
relation with this constant)
[3c] Use the results of step [3b] to decide if the check is redundant
+1 -14
View File
@@ -69,16 +69,7 @@
not interfere with code in other domains. This is useful if
you want to host different applications in your program.
Now, it is necessary to transfer control to Mono, and setup
the threading infrastructure, you do this like this:
void *user_data = NULL;
mono_runtime_exec_managed_code (domain, main_thread_handler, user_data);
Where your main_thread_handler can load your assembly and execute it:
static void main_thread_handler (gpointer user_data)
Then you can load an assembly containing code into the domain:
MonoAssembly *assembly;
@@ -121,10 +112,6 @@
layer, so in each file where you use pthread.h you should
include the <gc/gc.h> file.
If you can not do this for any reasons, just remember that you
can not store pointers to Mono Objects on the stack, you can
store them safely in the heap, or in global variables though
* Exposing C code to the CIL universe
The Mono runtime provides two mechanisms to expose C code to
-173
View File
@@ -1,173 +0,0 @@
Rules for opening shared files
==============================
File is already open, with share set to none:
Can not open again
File is already open for reading, with read share:
Can open for reading only, share must include read (can have write too)
File is already open for reading, with write share:
Can open for writing only, share must include read (can have write too)
File is already open for reading, with read + write share:
Can open for read, writing or both, share must include read (can have write too)
File is already open for writing, with read share:
Can open for reading only, share must include write (can have read too)
File is already open for writing, with write share:
Can open for writing only, share must include write (can have read too)
File is already open for writing, with read + write share:
Can open for reading, writing or both, share must include write (can have read too)
File is already open for reading + writing, with read share:
Can open for reading only, share must be read + write
File is already open for reading + writing, with write share:
Can open for for writing only, share must be read + write
File is already open for reading + writing, with read + write share:
Can open for read, writing or both, share must be read + write
Executive Summary
-----------------
Second open must have access within first share, must set second share to at least first access
Documenting code
----------------
#include <stdio.h>
#include <windows.h>
int access[] = {
GENERIC_READ,
GENERIC_WRITE,
GENERIC_READ | GENERIC_WRITE
};
char *access_names[] = {
"G_READ",
"G_WRITE",
"G_READ|G_WRITE"
};
int share[] = {
FILE_SHARE_READ,
FILE_SHARE_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE
};
char *share_names[] = {
"SHARE_READ",
"SHARE_WRITE",
"SHARE_READ|SHARE_WRITE"
};
void lockfiles(int access1, int share1, int access2, int share2)
{
HANDLE h1, h2;
BOOL ret;
if (access2 == 0 && share2 == 0) {
printf("\n");
printf("%22.22s\n%22.22s", access_names[access1], share_names[share1]);
}
h1 = CreateFile("lockedfile",
access[access1],
share[share1],
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (h1 == INVALID_HANDLE_VALUE) {
printf("Open1 failed: %d\n", GetLastError());
return;
}
h2 = CreateFile("lockedfile",
access[access2],
share[share2],
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (h2 == INVALID_HANDLE_VALUE) {
printf(" %4.4s", "");
} else {
printf(" %4.4s", "OK");
CloseHandle(h2);
}
CloseHandle(h1);
}
int main(int argc, char **argv)
{
int i, j, k, l;
printf("\t\t\t\t\t\t\tSecond Open\n");
printf("%22.22s G_RE G_RE G_RE G_WR G_WR G_WR G_RW G_RW G_RW\n", "");
printf("%22.22s S_RE S_WR S_RW S_RE S_WR S_RW S_RE S_WR S_RW", "First open --v ");
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
for (k = 0; k < 3; k++) {
for (l = 0; l < 3; l++) {
lockfiles(i, j, k, l);
}
}
}
}
return(0);
}
Code output
-----------
Second Open
G_RE G_RE G_RE G_WR G_WR G_WR G_RW G_RW G_RW
First open --v S_RE S_WR S_RW S_RE S_WR S_RW S_RE S_WR S_RW
G_READ
SHARE_READ OK OK
G_READ
SHARE_WRITE OK OK
G_READ
SHARE_READ|SHARE_WRITE OK OK OK OK OK OK
G_WRITE
SHARE_READ OK OK
G_WRITE
SHARE_WRITE OK OK
G_WRITE
SHARE_READ|SHARE_WRITE OK OK OK OK OK OK
G_READ|G_WRITE
SHARE_READ OK
G_READ|G_WRITE
SHARE_WRITE OK
G_READ|G_WRITE
SHARE_READ|SHARE_WRITE OK OK OK
-96
View File
@@ -1,96 +0,0 @@
Handling GC allocated objects in C
As part of an effort to improve our GC, we need to keep track
precisely of where objects are stored, so we can incrementally move
from the current conservative GC to a more advanced precise and moving GC.
Previously, all global C variables were considered GC roots, but this makes
the GC less efficient and increases the chances false references are found
to GC memory, hence retaining more memory than needed.
We need to tell the GC that some object is supposed to be kept alive
as if it was referenced in a global variable.
For Mono embedders
------------------
In C#, if you say:
class T {
static object o;
}
Any object which is stored in `o' is considered to be alive -- it will
not be collected. `o' is a member of the root set for the GC.
However, in C code, this is not the case. If you have:
static MonoObject* o = NULL;
The object in `o' will *NOT* be scanned.
If you need to store an object in a C variable and prevent it from being
collected, you need to acquire a GC handle for it.
guint32 handle = mono_gchandle_new (my_object, TRUE);
TRUE means the object will be pinned, so it won't move in memory
when we'll use a moving GC. You can access the MonoObject* referenced by
a handle with:
MonoObject* obj = mono_gchandle_get_target (handle);
When you don't need the handle anymore you need to call:
mono_gchandle_free (handle);
Note that if you assign a new object to the C var, you need to get a new
handle, it's not enough to store a new object in the C var.
So code that looked like this:
static MonoObject* o = NULL;
...
o = mono_object_new (...);
/* use o */
...
/* when done to allow the GC to collect o */
o = NULL;
should now be changed to:
static guint32 o_handle;
...
MonoObject *o = mono_object_new (...);
o_handle = mono_gchandle_new (o, TRUE);
/* use o or mono_gchandle_get_target (o_handle) */
...
/* when done to allow the GC to collect o */
mono_gchandle_free (o_handle);
For Mono runtime developers
---------------------------
There are two kinds of static vars used to store pointers to GC memory
that we need to consider:
*) objects
*) other memory chunks allocated with GC_MALLOC().
Objects should be dealt with the GC handle support as detailed above.
Other items should register the static pointer as an area to be considered
part of the root set with the following:
static gpointer my_gc_data = NULL;
...
MONO_GC_REGISTER_ROOT (my_gc_data);
my_gc_data = GC_MALLOC (...);
Note that this registration is not necessary for *LOCAL* variables,
as they are stored on the stack. It is only necessary for global variables,
as they are not a part of the GC's root set.
Once you have done the MONO_GC_REGISTER_ROOT, the variable is just like
a static variable in C#. To keep an object alive, you have the variable reference
the GC memory, to remove the reference, set the variable to NULL.
As we prepare the code for a precise GC, GC_MALLOC () will not be used anymore
in this way in most cases: we'll have a mechanism to specify exactly where
references to GC memory is stored.
+14 -35
View File
@@ -1,15 +1,20 @@
Mono Intermediate Representation Documentation
Operation: OP_ADDCC_IMM
Operation: OP_LOCALLOC
inst_left:
The value
ins->inst_left = *sp;
ins->cil_code = ip;
Add immediate that will set the carry flag.
dreg:
Destination register
inst_imm
Immediate value to add.
sreg1:
Source register to add.
This is the equivalent of alloca() in a C implementation: it
allocates a bunch of bytes on the stack dynamically. Local
variables are allocated statically in the stack instead.
It is implemented by moving the stack pointer according to the
platform ABI: you may need to keep a specific frame register
to address local variables when LOCALLOC is used (the PPC code
does this, for example: ifyou're doing the s390 port I suggest
starting from that)
Operation: OP_CALL_HANDLER.
@@ -47,29 +52,3 @@ Operation: OP_CCASTCLASS
throws an InvalidCastException exception otherwise.
Operation: OP_LOCALLOC
inst_left:
The value
ins->inst_left = *sp;
ins->cil_code = ip;
This is the equivalent of alloca() in a C implementation: it
allocates a bunch of bytes on the stack dynamically. Local
variables are allocated statically in the stack instead.
It is implemented by moving the stack pointer according to the
platform ABI: you may need to keep a specific frame register
to address local variables when LOCALLOC is used (the PPC code
does this, for example: ifyou're doing the s390 port I suggest
starting from that)
Operation: OP_SUBCC_IMM
Substract immediate that will set the borrow flag.
dreg:
Destination register
inst_imm
Immediate value to add.
sreg1:
Source register to add.
+2 -5
View File
@@ -375,8 +375,7 @@
variables to registers. The linear scan pass uses the
information that was previously gathered by the loop nesting
and loop structure computation to favor variables in inner
loops. This process updates the basic block `nesting' field
which is later used during liveness analysis.
loops.
Stack space is then reserved for the local variables and any
temporary variables generated during the various
@@ -490,9 +489,7 @@
operations if possible.
The rest of the code generation is fairly simple: a switch
statement is used to generate code for each of the MonoInsts,
in the mono/mini/mini-ARCH.c files, the method is called
"mono_arch_output_basic_block".
statement is used to generate code for each of the MonoInsts
We always try to allocate code in sequence, instead of just using
malloc. This way we increase spatial locality which gives a massive
-27
View File
@@ -422,30 +422,3 @@
we replace one or more instructions with others that perform
better for the given architecture or CPU.
* 64 bit support tips, by Zoltan Varga ([email protected])
For a 64-bit port of the Mono runtime, you will typically do
the following:
* need to use inssel-long.brg instead of
inssel-long32.brg.
* need to implement lots of new opcodes:
OP_I<OP> is 32 bit op
OP_L<OP> and CEE_<OP> are 64 bit ops
The 64 bit version of an existing port might share the code
with the 32 bit port (for example SPARC/SPARV9), or it might
be separate (x86/AMD64).
That will depend on the similarities of the two instructions
sets/ABIs etc.
The runtime and most parts of the JIT are 64 bit clean
at this point, so the only parts which require changing are
the arch dependent files.
-68
View File
@@ -1,68 +0,0 @@
We need to switch to a new register allocator.
The current one is split in a global and a local register allocator.
The global one can assign only callee-saves registers and happens
on the tree-based internal representation: it assigns local variables
to hardware registers.
The local one happens on the linear representation on a per basic
block basis and assigns hard registers to virtual registers (which
hold temporary values during expression executions) and it deals also
with the platform-specific issues (fixed registers, call conventions).
Moving to a different register will help solve some of the performance
issues introduced by the above split, make the register more easily
portable and solve some of the issues generated by dealing with trees.
The general design ideas are below.
The new allocator should have a global view of all the method, so it can be
able to assign variables also to some of the volatile registers if possible,
even across basic blocks (this would improve performance).
The allocator would be driven by per-arch declarative data, so porting
should be easier: an architecture needs to specify register classes,
call convention and instructions requirements (similar to the gcc code).
The allocator should operate on the linear representation, this way it's
easier and faster to track usages more correctly. We need to assign virtual
registers on a per-method basis instead of per basic block. We can assign
virtual registers to variables, too. Note that since we fix the stack offset
of local vars only after this step (which happens after the burg rules are run),
some of the burg rules that try to optimize the code won't apply anymore:
the peephole code may need to be enhanced to do the optimizations instead.
We need to handle floating point registers in the global allocator, too.
The new allocator also needs to keep track precisely of which registers
contain references or managed pointers to allow us to move to a precise GC.
It may be worth to use a single increasing set of integers for the virtual
registers, with the class of the register stored separately (unless the
current local allocator which keeps interger and fp registers separate).
Since this is a large task, we need to do it in steps as much as possible.
The first is to run the register allocator _after_ the burg rules: this
requires a rewrite of the liveness code, too, to use linear indexes instead
of basic-block/tree number combinations. This can be done by:
*) allocating virtual regs to all the locals that can be register allocated
*) running the burg rules (some may require adjustments): the local virtual
registers are assigned starting from global-virt-regs+1, instead of the current
hardware-regs+1, so we can tell apart global and local virt regs.
*) running the liveness/whatever code is needed to allocate the global registers
*) allocate the rest of the local variables to stack slots
*) continue with the current local allocator
This work could take 2-3 weeks.
The next step is to define the kind of declarative data an architecture needs
and assigning virtual regs to all the registers and making the allocator
assign from the volatile registers, too.
Note that some of the code that is currently emitted in the arch-specific
code, will need to be emitted as instructions that the reg allocator
can inspect: think of a method that returns the first argument which is
received in a register: the current code copies it to either a local slot or
to a global reg in the prolog an copies it back to the return register
int he basic block, but since neither the regallocator nor the peephole code
knows about the prolog code, the first store cannot be optimized away.
The gcc code has some example of how to specify register classes in a
declarative way.
-77
View File
@@ -1,77 +0,0 @@
While the Boehm GC is quite good, we need to move to a
precise, generational GC for better performance and smaller
memory usage (no false-positives memory retentions with big
allocations).
This is a large task, but it can be done in steps.
1) use the GCJ support to mark reference fields in objects, so
scanning the heap is faster. This is mostly done already, needs
checking that it is always used correctly (big objects, arrays).
There are also some data structures we use in the runtime that are
currently untyped that are allocated in the Gc heap and used to
keep references to GC objects. We need to make them typed as to
precisely track GC references or make them non-GC memory,
by using more the GC hnadle support code (MonoGHashTable, MonoDomain,
etc).
2) don't include in the static roots the .bss and .data segments
to save in scanning time and limit false-positives. This is mostly
done already.
3) keep track precisely of stack locations and registers in native
code generation. This basically requires the regalloc rewrite code
first, if we don't want to duplicate much of it. This is the hardest
task of all, since proving it's correctness is very hard. Some tricks,
like having a build that injects GC.Collect() after every few simple
operations may help. We also need to decide if we want to handle safe
points at calls and back jumps only or at every instruction. The latter
case is harder to implement and requires we keep around much more data
(it potentially makes for faster stop-the-world phases).
The first case requires us to be able to advance a thread until it
reaches the next safe point: this can be done with the same techniques
used by a debugger. We already need something like this to handle
safely aborts happening in the middle of a prolog in managed code,
for example, so this could be an additional sub-task that can be done
separately from the GC work.
Note that we can adapt the libgc code to use the info we collect
when scanning the stack in managed methods and still use the conservative
approach for the unmanaged stack, until we have our own collector,
which requires we define a proper icall interface to switch from managed
to unmanaged code (hwo to we handle object references in the icall
implementations, for example).
4) we could make use of the generational capabilities of the
Boehm GC, but not with the current method involving signals which
may create incompatibilities and is not supported on all platforms.
We need to start using write barriers: they will be required anyway
for the generational GC we'll use. When a field holding a reference
is changed in an object (or an item in an array), we mark the card
or page where the field is stored as dirty. Later, when a collection
is run, only objects in pages marked as dirty are scanned for
references instead of the whole heap. This could take a few days to
implement and probably much more time to debug if all the cases were
not catched:-)
5) actually write the new generational and precise collector. There are
several examples out there as open source projects, though the CLR
needs some specific semantics so the code needs to be written from
scratch anyway. Compared to item 3 this is relatively easer and it can
be tested outside of mono, too, until mono is ready to use it.
The important features needed:
*) precise, so there is no false positive memory retention
*) generational to reduce collection times
*) pointer-hopping allocation to reduce alloc time
*) possibly per-thread lock-free allocation
*) handle weakrefs and finalizers with the CLR semantics
Note: some GC engines use a single mmap area, because it makes
handling generations and the implementation much easier, but this also
limits the expension of the heap, so people may need to use a command-line
option to set the max heap size etc. It would be better to have a design
that allows mmapping a few megabytes chunks at a time.
The different tasks can be done in parallel. 1, 2 and 4 can be done in time
for the mono 1.2 release. Parts of 3 and 5 could be done as well.
The complete switch is supposed to happen with the mono 2.0 release.
-16
View File
@@ -1,16 +0,0 @@
<h1>Mono 1.0 Release Notes</h1>
<h2>What does Mono Include</h2>
<h2>Missing functionality</h2>
<p>COM support.
<p>EnterpriseServices are non-existant.
<p>Windows.Forms is only available as a preview, it is not
completed nor stable.
<h3>Assembly: System.Drawing</h3>
<p>System.Drawing.Printing is not supported.
-3
View File
@@ -1,3 +0,0 @@
Makefile.in
Makefile
.deps
-29
View File
@@ -1,29 +0,0 @@
2004-11-07 Zoltan Varga <[email protected]>
* mono-jni.c (GET_SET_ARRAY_ELEMENTS): Fix compilation errors on
gcc 3.3.5.
2004-06-24 David Waite <[email protected]>
* mono-jni.c: change to C90-style comments from C99/C++-style
Fri Jun 18 13:46:05 CEST 2004 Paolo Molaro <[email protected]>
* mono-jni.c: updates for the API cleanups.
2004-05-05 Zoltan Varga <[email protected]>
* mono-jni.c: Implement some missing JNI functions.
2004-04-13 Zoltan Varga <[email protected]>
* mono-jni.c: Use <stdarg.h> instead of <varargs.h>.
2004-04-12 Zoltan Varga <[email protected]>
* mono-jni.c: Fix compilation under gcc 2.95 + fix warnings.
2004-04-07 Zoltan Varga <[email protected]>
* mono-jni.c Makefile.am: New files.
-15
View File
@@ -1,15 +0,0 @@
INCLUDES = \
-I$(top_srcdir) \
$(IKVM_JNI_CFLAGS) \
$(GMODULE_CFLAGS) \
$(GLIB_CFLAGS)
if JIT_SUPPORTED
lib_LTLIBRARIES = libmono-ikvm-jni.la
endif
libmono_ikvm_jni_la_SOURCES = mono-jni.c
libmono_ikvm_jni_la_LIBADD = $(top_builddir)/mono/mini/libmono.la
-1263
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,5 +1,5 @@
man_MANS = mcs.1 mono.1 monostyle.1 mono-config.5 sqlsharp.1 oldmono.1 ilasm.1 \
cert2spc.1 cilc.1 genxs.1 wsdl.1 disco.1 soapsuds.1 makecert.1 \
chktrust.1 setreg.1 sn.1 secutil.1 signcode.1 certmgr.1 monop.1 xsd.1 gacutil.1
chktrust.1 setreg.1 sn.1 secutil.1 signcode.1 certmgr.1 monop.1
EXTRA_DIST = $(man_MANS)
-19
View File
@@ -44,25 +44,6 @@ More details displayed on the console.
.TP
.I "-help", "-h", "-?", "/?"
Display help about this tool.
.SH FILES
.B WARNING: This details the current behavior of Mono and could change between releases.
The only safe way to interact with certificate stores is to use the certmgr
tool. The current releases of Mono keeps all the user certificate stores in
separates directories under
.I ~/.mono/certs/
.TP
For example the trusted root certificates for a user would be kept under
.I ~/.mono/certs/Trust/
.TP
Certificates files are kept in DER (binary) format (extension .cer).
.TP
The filenames either starts with
.I tbp
(thumbprint) or
.I ski
(subject key identifier).
.TP
The rest of the filename is the base64-encoded value (tbp or ski).
.SH AUTHOR
Written by Sebastien Pouliot
.SH COPYRIGHT
+5 -14
View File
@@ -1,9 +1,8 @@
.\"
.\" chktrust manual page.
.\" Copyright 2003 Motus Technologies
.\" Copyright 2004 Novell
.\" Author:
.\" Sebastien Pouliot (sebastien@ximian.com)
.\" Sebastien Pouliot (spouliot@motus.com)
.\"
.TH Mono "chktrust"
.SH NAME
@@ -14,33 +13,25 @@ chktrust \- Check the trust of a PE executable.
.SH DESCRIPTION
Verify if an PE executable (CLR assembly, Win32 EXE or DLL) has a valid
Authenticode(r) signature that can be traced back to a trusted certificate
authority (CA). This means that
.TP
(a) the signature is valid (i.e. file integrity) and,
.TP
(b) the code-signing certificate can be chained back to one of the
certificates in the Trust store.
authority (CA).
.SH OPTIONS
.TP
.I "-q", "-quiet"
Quiet mode. Limited display on console.
Limited display on console.
.TP
.I "-v", "-verbose"
Verbose mode. More details displayed on the console.
More details displayed on the console.
.TP
.I "-help", "-h", "-?", "/?"
Display help about this tool.
.SH KNOWN RESTRICTIONS
chktrust cannot validate Authenticode signatures on CAB files.
.SH AUTHOR
Written by Sebastien Pouliot
.SH COPYRIGHT
Copyright (C) 2003 Motus Technologies.
Copyright (C) 2004 Novell.
Released under BSD license.
.SH MAILING LISTS
Visit http://mail.ximian.com/mailman/mono-list for details.
.SH WEB SITE
Visit: http://www.go-mono.com for details
.SH SEE ALSO
.BR signcode(1), makecert(1), certmgr(1), setreg(1)
.BR signcode(1), makecert(1)
-121
View File
@@ -1,121 +0,0 @@
..\"
.\" gacutil manual page.
.\" (C) 2004 Novell, Inc.
.\" Author:
.\" Miguel de Icaza ([email protected])
.\"
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.TH gacutil "Mono 1.0"
.SH NAME
gacutil \- Global Asssembly Cache management utility.
.SH SYNOPSIS
.PP
.B gacutil [-user] [command] [options]
.SH DESCRIPTION
\fIgacutil\fP is a tool used by developers to install assemblies into
the system Global Assembly Cache (GAC) to become part of the
assemblies that are available for all applications at runtime.
.PP
Notice that they are not directly available to the compiler, the
convention is that assemblies must also be placed in a separate
directory for being accessed to the compiler. This is done with the
-package directive to gacutil.
.PP
The tool allows for installation, removal, and listing of the
contents of the assembly cache.
.PP
The GAC is relative to the Mono installation prefix:
mono_prefix/lib/mono.
.PP
.SH COMMANDS
.I -i <assembly_path> [-check_refs] [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
.Sp
Installs an assembly into the global assembly cache. <assembly_path>
is the name of the file that contains the assembly manifest
.Sp
The -package option can be used to also create a directory in in
prefix/lib/mono with the name NAME, and a symlink is created from
NAME/assembly_name to the assembly on the GAC. This is used so
developers can reference a set of libraries at once.
.Sp
The -root option is used by developers integrating this with automake
tools or packaging tools that require a prefix directory to be
specified. The root represents the "libdir" component of a prefix
(typically prefix/lib).
.Sp
The -gacdir option is used to specify the GACs base directory. Once an
assembly has been installed to a non standard gacdir the MONO_GAC_PREFIX
environment variable must be used to access the assembly.
.Sp
The -check_refs option is used to ensure that the assembly being
installed into the GAC does not reference any non strong named
assemblies. Assemblies being installed to the GAC should not reference
non strong named assemblies, however the is an optional check.
.fi
.PP
.I "-l" [assembly_name] [-root ROOTDIR] [-gacdir GACDIR]
.Sp
Lists the contents of the global assembly cache. When the
<assembly_name> parameter is specified only matching assemblies are
listed.
.PP
.I "-u" <assembly_display_name> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
.Sp
Uninstalls an assembly from the global assembly cache.
<assembly_display_name> is the name of the assembly (partial or
fully qualified) to remove from the global assembly cache. If a
partial name is specified all matching assemblies will be
uninstalled. As opposed to the install option that takes a filename,
this takes as an argument the assembly name, which looks like this:
.nf
MyLibrary.Something, version=1.0.0.0, publicKeyToken=xxxx,culture=neutral
.fi
.Sp
Notice that you can have spaces in the command line, there is no need
to quote them.
.Sp
The removal performs a greedy removal, if you only specifiy one
component like, "MyLibrary.Something", it will remove all versions of
the library.
.Sp
.I "-us" <assembly_path> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
Uninstalls an assembly using the specifed assemblies full name.
<assembly path> is the path to an assembly. The full assembly name
is retrieved from the specified assembly if there is an assembly in
the GAC with a matching name, it is removed. Unlike the -u option this
option takes a file name, like this:
.nf
Example: -us myDll.dll
.fi
.Sp
.I "-ul" <assembly_list_file> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
Uninstalls one or more assemblies from the global assembly cache.
<assembly_list_file> is the path to a test file containing a list of
assembly names on separate lines.
.nf
Example -ul assembly_list.txt
.fi
.nf
assembly_list.txt contents:
assembly1,Version=1.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef
assembly2,Version=2.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef
.fi
.SH FILES
On Unix assemblies are loaded from the installation lib directory. If you set
`prefix' to /usr, the assemblies will be located in /usr/lib. On
Windows, the assemblies are loaded from the directory where mono and
mint live.
.PP
/etc/mono/config, ~/.mono/config
.PP
Mono runtime configuration file. See the mono-config(5) manual page
for more information.
.SH WEB SITE
Visit: http://www.go-mono.com for details
.SH SEE ALSO
.BR mcs(1), mono(1)
+1 -1
View File
@@ -16,7 +16,7 @@ CIL byte code that can be executed by any system that implemented a Common
Language Infrastructure virtual machine.
.SH OPTIONS
.TP
.B \//output:<file_name>
.B \//out:<file_name>
Specify the output file name.
.TP
.B \//exe
+44 -85
View File
@@ -1,16 +1,15 @@
.\"
.\" makecert manual page.
.\" Copyright 2003 Motus Technologies
.\" Copyright 2004 Novell
.\" Author:
.\" Sebastien Pouliot (sebastien@ximian.com)
.\" Sebastien Pouliot (spouliot@motus.com)
.\"
.TH Mono "MakeCert"
.SH NAME
MakeCert \- Create X.509 certificates for test purposes
.SH SYNOPSIS
.PP
.B makecert [options] certificate
.B MakeCert [options] certificate
.SH DESCRIPTION
Create an X.509 certificate using the provided informations. This
is useful for testing Authenticode signatures, SSL and S/MIME
@@ -18,108 +17,68 @@ technologies.
.SH PARAMETERS
.TP
.I "-# num"
Specify the certificate serial number.
Certificate serial number
.TP
.I "-n dn"
Specify the subject Distinguished Name (DN).
Subject Distinguished Name
.TP
.I "-in dn"
Specify the issuer Distinguished Name (DN).
Issuert Distinguished Name
.TP
.I "-r"
Create a self-signed, also called root, certificate.
.TP
.I "-iv pvkfile"
Specify the private key file (.PVK) for the issuer. The private key in the
specified file will be used to sign the new certificate.
.TP
.I "-ic certfile"
Extract the issuer's name from the specified certificate file - i.e. the
subject name of the specified certificate becomes the issuer name of the
new certificate.
.TP
.I "-in name"
Use the issuer's name from the specified parameter.
.TP
.I "-ik container"
Specify the key container name to be used for the issuer.
.TP
.I "-iky [signature | exchange | #]"
Specify the key number to be used in the provider (when used with -ik).
.TP
.I "-ip provider"
Specify the cryptographic provider to be used for the issuer.
.TP
.I "-ir [localmachine | currentuser]"
Specify the provider will search the user or the machine keys containers for
the issuer.
.TP
.I "-iy number"
Specify the provider type to be used for the issuer.
Create a self-signed (root) certificate
.TP
.I "-sv pkvfile"
Specify the private key file (.PVK) for the subject. The public part of the
key will be inserted into the created certificate. If non-existant the
specified file will be created with a new key pair (default to 1024 bits RSA
key pair).
Private key file (.PVK) for the subject (created if missing)
.TP
.I "-sk container"
Specify the key container name to be used for the subject.
.I "-iv pvkfile"
Private key file (.PVK) for the issuer
.TP
.I "-sky [signature | exchange | #]"
Specify the key number to be used in the provider (when used with -sk).
.TP
.I "-sp provider"
Specify the cryptographic provider to be used for the subject.
.TP
.I "-sr [localmachine | currentuser]"
Specify the provider will search the user or the machine keys containers for
the subject.
.TP
.I "-sy number"
Specify the provider type to be used for the issuer.
.TP
.I "-a hash"
Select hash algorithm. Only MD5 and SHA1 algorithms are supported.
.TP
.I "-b date"
The date since when the certificate is valid (notBefore).
.TP
.I "-e date"
The date until when the certificate is valid (notAfter).
.TP
.I "-m number"
Specify the certificate validity period in months. This is added to the
notBefore validity date which can be set with -b or will default to the
current date/time.
.TP
.I "-cy [authority|end]"
Basic constraints. Select Authority or End-Entity certificate. Only Authority
certificates can be used to sign other certificates (-ic). End-Entity can
be used by clients (e.g. Authenticode, S/MIME) or servers (e.g. SSL).
.TP
.I "-h number"
Add a path length restriction to the certificate chain. This is only
applicable for certificates that have BasicConstraint set to Authority (-cy
authority). This is used to limit the chain of certificates than can be
issued under this authority.
.TP
.I "-eku oid[,oid]"
Add some extended key usage OID to the certificate.
.I "-ic certfile"
Extract the issuer's name from the specified certificate
.TP
.I "-?"
Help (display this help message)
.TP
.I "-!"
Extended help (for advanced options)
.SH KNOWN RESTRICTIONS
Compared to the Windows version some options aren't supported (-$, -d, -l,
-nscp, -is, -sc, -ss). Also PVK files with passwords aren't supported.
.TP
.I "-a hash"
Select hash algorithm. Only MD5 and SHA1 are supported.
.TP
.I "-b date"
The date since when the certificate is valid (notBefore).
.TP
.I "-cy [authority|end]"
Basic constraints. Select Authority or End-Entity certificate.
.TP
.I "-e date"
The date until when the certificate is valid (notAfter).
.TP
.I "-eku oid[,oid]"
Add some extended key usage OID to the certificate.
.TP
.I "-h number"
Add a path length restriction to the certificate chain.
.TP
.I "-ic cert"
Take the issuer's name from the specified certificate.
.TP
.I "-in name"
Take the issuer's name from the specified parameter.
.TP
.I "-iv pvkfile"
Sign the certificate using the private key inside the PVK file.
.TP
.I "-m number"
Certificate validity period (in months).
.TP
.I "-sv pvkfile"
Create a new PVK file if non-existant, otherwise use the PVK file as the subject public key.
.SH AUTHOR
Written by Sebastien Pouliot
.SH COPYRIGHT
Copyright (C) 2003 Motus Technologies.
Copyright (C) 2004 Novell.
Released under BSD license.
.SH MAILING LISTS
Visit http://mail.ximian.com/mailman/mono-list for details.
-1
View File
@@ -20,5 +20,4 @@
<manpage name="soapsuds" page="soapsuds.1" />
<manpage name="setreg" page="setreg.1" />
<manpage name="certmgr" page="certmgr.1" />
<manpage name="xsd" page="xsd.1" />
</manpages>
+5 -63
View File
@@ -70,21 +70,6 @@ resource.
.I \-debug-
Do not generate debugging information.
.TP
.I \-delaysign+
Only embed the strongname public key into the assembly. The actual
signing must be done in a later stage using the SN tool. This is useful
to protect the private key during development. Note that delay signing
can only be done using a strongname key file (not a key container). The
option is equivalent to including [assembly: AssemblyDelaySign (true)]
in your source code. Compiler option takes precedence over the
attributes.
.TP
.I \-delaysign-
Default. Strongname (sign) the assembly using the strong name key file
(or container). The option is equivalent to including [assembly:
AssemblyDelaySign (false)] in your source code. Compiler option takes
precedence over the attributes.
.TP
.I \-\-expect-error X L
The compiler will expect the code to generate an error
named `X' in line `L'. This is only used by the test suite.
@@ -93,34 +78,9 @@ named `X' in line `L'. This is only used by the test suite.
This is used for debugging the compiler. This makes the error emission
generate an exception that can be caught by a debugger.
.TP
.I \-keyfile:KEYFILE
Strongname (sign) the output assembly using the key pair present in
the specified strong name key file (snk). A full key pair is required
by default (or when using delaysign-). A file containing only the
public key can be used with delaysign+. The option is equivalent to
including [assembly: AssemblyKeyFile ("KEYFILE")] in your source code.
Compiler option takes precedence over the attributes.
.TP
.I \-keycontainer:CONTAINER
Strongname (sign) the output assembly using the key pair present in
the specified container. Note that delaysign+ is ignored when using
key containers. The option is equivalent to including [assembly:
AssemblyKeyName ("CONTAINER")] in your source code. Compiler option
takes precedence over the attributes.
.TP
.I \-langversion:TEXT
The option specifies the version of the language to use. The feature
set is different in each C# version. This switch can be used to force
the compiler to allow only a subset of the features.
The possible values are:
.nf
Default - Instruct compiler to use the latest version. Equivalent
is to omit the switch.
ISO-1 - Restrict compiler to use only ISO standardized features.
The usage of features such as generics, static classes, anonymous
methods will lead to error.
.I \-\-stacktrace
Generates a stack trace at the time the error is reported, useful for
debugging the compiler.
.TP
.I -lib:PATHLIST
Each path specified in the comma-separated list will direct the
@@ -130,10 +90,6 @@ compiler to look for libraries in that specified path.
Directs the compiler to look for libraries in the specified path.
Multiple paths can be provided by using the option multiple times.
.TP
.I \-main:CLASS
Tells the compiler which CLASS contains the entry point. Useful when
you are compiling several classes with a Main method.
.TP
.I \-nostdlib, -nostdlib+
Use this flag if you want to compile the core library. This makes the
compiler load its internal types from the assembly being compiled.
@@ -152,16 +108,6 @@ Names the output file to be generated.
.I \-\-parse
Used for benchmarking. The compiler will only parse its input files.
.TP
.I \-pkg:package1[,packageN]
The compiler will invoke pkg-config --libs on the set of packages
specified on the command line to obtain libraries and directories to
compile the code.
.PP
This is typically used with third party components, like this:
.nf
$ mcs -pkg:gtk-sharp demo.cs
.fi
.TP
.I -resource:RESOURCE[,ID]
Embeds to the given resource file. The optional ID can be used to
give a different name to the resource. If not specified, the resource
@@ -185,13 +131,9 @@ Does recursive compilation using the specified pattern. In Unix the
shell will perform globbing, so you migth want to use it like this:
.PP
.nf
$ mcs -recurse:'*.cs'
bash$ mcs -recurse:'*.cs'
.fi
.TP
.I \-\-stacktrace
Generates a stack trace at the time the error is reported, useful for
debugging the compiler.
.TP
.I \-target:KIND, \-t:KIND
Used to specify the desired target. The possible values are: exe
(plain executable), winexe (Windows.Forms executable), library
@@ -278,7 +220,7 @@ Please read the accompanying `COPYING' file for details. Alternative
licenses are available from Ximian.
.PP
.SH SEE ALSO
mono(1), mint(1), sn(1)
mono(1), mint(1)
.PP
.SH BUGS
To report bugs in the compiler, you can use `bug-buddy', or you can
+2 -55
View File
@@ -1,9 +1,8 @@
.\"
.\" mono-config configuration page.
.\" mono configuration page.
.\" (C) Ximian, Inc.
.\" Author:
.\" Miguel de Icaza ([email protected])
.\" Paolo Molaro ([email protected])
.\"
.TH Mono "Mono 1.0"
.SH NAME
@@ -13,9 +12,6 @@ The Mono runtime will load configuration data from the
installation prefix /etc/mono/config file, the ~/.mono/config or from
the file pointed by the MONO_CONFIG environment variable.
.PP
For each assembly loaded a config file with the name:
/path/to/the/assembly.exe.config is loaded, too.
.PP
This file controls the behavior of the runtime.
.PP
The file contains an XML-like file with various sections, all of them
@@ -28,37 +24,6 @@ You use the dllmap directive to map shared libraries referenced by
P/Invoke in your assemblies to a different shared library.
.PP
This is typically used to map Windows libraries to Unix library names.
The
.B dllmap
element takes two attributes:
.TP
.I dll
This should be the same string used in the DllImport attribute
.TP
.I target
This should be the name of the library where the function can be found:
this name should be suitable for use with the platform native shared library
loading routines (dlopen etc.), so you may want to check the manpages for that, too.
.SH <dllentry> directive
This directive can be used to map a specific dll/function pair to a different
library and also a different function name. It should appear inside a
.B dllmap
element with only the dll attribute specified.
.PP
The
.B dllentry
element takes 3 attributes:
.TP
.I dll
This is the target library, where the function can be found.
.TP
.I name
This is the name of the fuction as it appears in the metadata: it is the name
of the P/Invoke method.
.TP
.I target
This is the name of the function to lookup instead of the name specified in the
P/Invoke method.
.SH EXAMPLES
The following example maps references to the `cygwin1.dll' shared
library to the `libc.so.6' file.
@@ -67,23 +32,5 @@ library to the `libc.so.6' file.
<dllmap dll="cygwin1.dll" target="libc.so.6"/>
</configuration>
.fi
.PP
This one maps the following C# method:
.nf
[DllImport ("libc")]
static extern void somefunction ();
.fi
to
.B differentfunction
in
.B libdifferent.so.
.nf
<configuration>
<dllmap dll="libc">
<dllentry dll="libdifferent.so" name="somefunction" target="differentfunction" />
</dllmap>
</configuration>
.fi
.SH SEE ALSO
.BR mono(1), monodis(1), mint(1)
.BR mono(1), monodis(1), mint(1)
+25 -105
View File
@@ -46,19 +46,6 @@ This option is used to precompile the CIL code in the specified
assembly to native code. The generated code is stored in a file with
the extension .so. This file will be automatically picked up by the
runtime when the assembly is executed.
.Sp
Ahead-of-Time compilation is most useful if you use it in combination
with the -O=all,-shared flag which enables all of the optimizations in
the code generator to be performed. Some of those optimizations are
not practical for Just-in-Time compilation since they might be very
time consuming.
.Sp
Unlike the .NET Framework, Ahead-of-Time compilation will not generate
domain independent code: it generates the same code that the
Just-in-Time compiler would produce. Since most applications use a
single domain, this is fine. If you want to optimize the generated
code for use in multi-domain applications, consider using the
-O=shared flag.
.Sp
This pre-compiles the methods, but the original assembly is still
required to execute as this one contains the metadata and exception
@@ -210,7 +197,7 @@ And individual methods are referenced with the M: prefix, and the
standar method notation:
.nf
mono --trace=M:System.Console:WriteLine app.exe
mono --trace=M:System.Console.WriteLine app.exe
.fi
As previously noted, various rules can be specified at once:
@@ -232,40 +219,16 @@ Finally, namespaces can be specified using the N: prefix:
mono --trace=N:System.Xml
.fi
.SH DEBUGGING
.PP
If you are interested in debugging P/Invoke problems with your
application, you might want to use:
.nf
$ MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono glue.exe
.fi
.SH SERIALIZATION
Mono's XML serialization engine by default will use a reflection-based
approach to serialize which might be slow for continous processing
(web service applications). The serialization engine will determine
when a class must use a hand-tuned serializer based on a few
parameters and if needed it will produce a customized C# serializer
for your types at runtime. This customized serializer then gets
dynamically loaded into your application.
.PP
You can control this with the MONO_XMLSERIALIZER_THS environment
variable.
.PP
The possible values are `no' to disable the use of a C# customized
serializer, or an integer that is the minimum number of uses before
the runtime will produce a custom serializer (0 will produce a
custom serializer on the first access, 50 will produce a serializer on
the 50th use).
.SH ENVIRONMENT VARIABLES
.TP
.I "GC_DONT_GC"
Turns off the garbage collection in Mono. This should be only used
for debugging purposes
.TP
.I "MONO_ASPNET_NODELETE"
If set to any value, temporary source files generated by ASP.NET support
classes will not be removed. They will be kept in the user's temporary
directory.
.I "MONO_PATH"
Provides a search path to the runtime where to look for library files.
Directories are separated by the platform path separator (colons on unix). Example:
.B /home/username/lib:/usr/local/mono/lib
.TP
.I "MONO_CFG_DIR"
If set, this variable overrides the default system configuration directory
@@ -278,10 +241,8 @@ environment variable.
.TP
.I "MONO_DEBUG"
If set, enables some features of the runtime useful for debugging.
It makes the runtime display the stack traces for all the threads
running and exit when mono is interrupted (Ctrl-C) and print some
additional messages on error conditions. It may not exit cleanly. Use at
your own risk.
Currently it only makes the runtime display the stack traces for all the
threads running and exit. It may not exit cleanly. Use at your own risk.
.TP
.I "MONO_DISABLE_AIO"
If set, tells mono NOT to attempt using native asynchronous I/O services. In
@@ -293,65 +254,18 @@ Windows I/O Emulation layer, and handles (files, events, mutexes,
pipes) will not be shared across processes. Process creation is also
disabled. This option is only available on Unix.
.TP
.I "MONO_EGD_SOCKET"
For platforms that do not otherwise have a way of obtaining random bytes
this can be set to the name of a file system socket on which an egd or
prngd daemon is listening.
.TP
.I "MONO_EXTERNAL_ENCODINGS"
If set, contains a colon-separated list of text encodings to try when
turning externally-generated text (e.g. command-line arguments or
filenames) into Unicode. The encoding names come from the list
provided by iconv, and the special case "default_locale" which refers
to the current locale's default encoding.
.IP
.TP
When reading externally-generated text strings UTF-8 is tried first,
and then this list is tried in order with the first successful
conversion ending the search. When writing external text (e.g. new
filenames or arguments to new processes) the first item in this list
is used, or UTF-8 if the environment variable is not set.
.TP
.I "MONO_GAC_PREFIX"
Provides a prefix the runtime uses to look for Global Assembly Caches.
Directories are separated by the platform path separator (colons on
unix). MONO_GAC_PREFIX should point to the top directory of a prefixed
install. Or to the directory provided in the gacutil /gacdir command. Example:
.B /home/username/.mono:/usr/local/mono/
.TP
.I "MONO_LOG_LEVEL"
If set, the logging level is changed to the set value. Possible values
are "error", "critical", "warning", "message", "info", "debug". The
default value is "error". Messages with a logging level greater then
or equal to the log level will be printed to stdout/stderr.
.PP
Use info to track the dynamic loading of assemblies.
.TP
.I "MONO_LOG_MASK"
If set, the log mask is changed to the set value. Possible values are
"asm" (assembly loader), "type", "dll" (native library loader), "gc"
(garbage collector), "cfg" (config file loader), "aot" (precompiler), "all".
The default value is "all". Changing the mask value allows you to display only
messages for a certain component. You can use multiple masks by comma
separating them. For example to see config file messages and assembly loader
messages set you mask to "asm,cfg".
.TP
.I "MONO_MANAGED_WATCHER"
If set to any value, System.IO.FileSystemWatcher will use the default
managed implementation (slow). If unset, mono will try to use FAM under
Unix systems and native API calls on Windows, falling back to the
managed implementation on error.
.TP
.I "MONO_THREADS_PER_CPU"
Sets the maximum number of threads in the threadpool per CPU. The default is
50 for non-windows systems and 25 for windows.
.TP
.I "MONO_TRACE"
If set, enables the System.Diagnostics.DefaultTraceListener, which will
print the output of the System.Diagnostics Trace and Debug classes.
It can be set to a filename, and to Console.Out or Console.Error to display
output to standard output or standard error, respectively.
See the System.Diagnostics.DefaultTraceListener documentation for more
information.
.TP
.I "MONO_SHARED_DIR"
If set its the directory where the ".wapi" handle state is stored.
@@ -359,18 +273,24 @@ This is the directory where the Windows I/O Emulation layer stores its
shared state data (files, events, mutexes, pipes). By default Mono
will store the ".wapi" directory in the users's home directory.
.TP
.I "MONO_PATH"
Provides a search path to the runtime where to look for library files.
Directories are separated by the platform path separator (colons on unix). Example:
.B /home/username/lib:/usr/local/mono/lib
.I "MONO_UNMANAGED_XSLT"
If set any value, System.Xml.Xsl.XslTransform uses libxslt-based
transformation engine (a.k.a Unmanaged XSLT). Unmanaged XSLT has
long been used for XSLT engine while Managed XSLT engine is so
new and might have some bugs. Basically we recommend Managed XSLT
solution, but if it contains some blocking bugs, then you can also
use traditional libxslt. If you want to use msxsl:script, you have
to select Managed XSLT.
.TP
.I "MONO_XMLSERIALIZER_THS"
Controls the threshold for the XmlSerializer to produce a custom
serializer for a given class instead of using the Reflection-based
interpreter. The possible values are `no' to disable the use of a
custom serializer or a number to indicate when the XmlSerializer
should start serializing. The default value is 50, which means that
the a custom serializer will be produced on the 50th use.
.I "MONO_MANAGED_WATCHER"
If set to any value, System.IO.FileSystemWatcher will use the default
managed implementation (slow). If unset, mono will try to use FAM under
Unix systems and native API calls on Windows, falling back to the
managed implementation on error.
.TP
.I "MONO_CODEDOM_NODELETE"
If set to any value, the C# CodeDom compiler will not remove the temporary
source files generated.
.SH FILES
On Unix assemblies are loaded from the installation lib directory. If you set
`prefix' to /usr, the assemblies will be located in /usr/lib. On
+3 -3
View File
@@ -16,16 +16,16 @@ parameters used in Mono.
.SH OPTIONS
.TP
.I "-q"
Quiet mode. Limited display on console.
Limited display on console.
.TP
.I "-help", "-h", "-?", "/?"
Display help about this tool.
.SH FEATURES
.TP
.I "1"
Trust the test root certificates (both Microsoft and Mono). Depending on the
Trust the test root certificates (both Micrsoft and Mono). Depending on the
value this will add (TRUE) or remove (FALSE) the two self-signed certificates
from the current user Trust store.
from the current user Trust store (~/.mono/certs/Trust/).
.SH AUTHOR
Written by Sebastien Pouliot
.SH COPYRIGHT
+3 -15
View File
@@ -1,9 +1,8 @@
.\"
.\" signcode manual page.
.\" Copyright 2003 Motus Technologies
.\" Copyright 2004 Novell
.\" Author:
.\" Sebastien Pouliot (sebastien@ximian.com)
.\" Sebastien Pouliot (spouliot@motus.com)
.\"
.TH Mono "signcode"
.SH NAME
@@ -14,8 +13,7 @@ signcode \- Digitally sign an PE executable using an X.509 certificate.
.SH DESCRIPTION
Digitally sign an PE executable (CLR assembly, Win32 EXE or DLL) using an
X.509 certificate and it's associated private key. The signature is compatible
with Authenticode(r) and can be validated with chktrust (either on Windows or
on any platform supported by Mono).
with Authenticode(r) and can be validated with chktrust.
.SH OPTIONS
.TP
.I "-spc spcfile"
@@ -50,7 +48,7 @@ had a valid (non-expired) certificate when the PE executable was signed.
.I "-tr #"
Number of retries to get a timestamp for the countersignature.
.TP
.I "-tw #"
.I "-td #"
Delay (in seconds) between the retries to get a timestamp for the countersignature.
.TP
.I "-k name"
@@ -70,20 +68,10 @@ CryptoAPI key location (when not using -v).
.TP
.I "-help", "-h", "-?", "/?"
Display help about this tool.
.SH OTHER CODE SIGNING TECHNOLOGIES
Assemblies are PE files that can also be strongnamed using the sn.exe tool. The
order of code signature is important if a file requires both an Authenticode
and a strongname signature. Strongname must be applied before the Authenticode
signature. Applying a strongname after the Authenticode signature, like
re-signing an assembly (e.g. delay-sign), will invalidate the Authenticode
signature.
.SH KNOWN RESTRICTIONS
signcode cannot generate Authenticode signatures for CAB files.
.SH AUTHOR
Written by Sebastien Pouliot
.SH COPYRIGHT
Copyright (C) 2003 Motus Technologies.
Copyright (C) 2004 Novell.
Released under BSD license.
.SH MAILING LISTS
Visit http://mail.ximian.com/mailman/mono-list for details.
+10 -48
View File
@@ -1,9 +1,8 @@
.\"
.\" sn manual page.
.\" Copyright 2003 Motus Technologies
.\" Copyright 2004 Novell
.\" Author:
.\" Sebastien Pouliot <sebastien@ximian.com>
.\" Sebastien Pouliot (spouliot@motus.com)
.\"
.TH Mono "sn"
.SH NAME
@@ -14,33 +13,24 @@ sn \- Digitally sign/verify/compare strongname on CLR assemblies.
.SH DESCRIPTION
Digitally sign, verify or compare, CLR assemblies using strongnames.
.SH CONFIGURATION OPTIONS
Configuration options are stored in the machine.config configuration file
under /configuration/strongNames.
.TP
.I "-c provider"
Change the default CSP (Crypto Service Provider). Currently not supported
in Mono.
Change the default CSP (Crypto Service Provider).
.TP
.I "-m [y|n]"
Use a machine [y] key container or a user [n] key container. Currently not
supported in Mono.
Use a machine [y] key container or a user [n] key container.
.TP
.I "-Vl"
List the verification options. The list is kept under /configuration/
strongNames/verificationSettings in machine.config.
List the verification options.
.TP
.I "-Vr assembly [userlist]"
Exempt the specified assembly from verification for the specified user list.
Currently not supported by sn, you must edit machine.config manually if you
require this.
.TP
.I "-Vu assembly"
Remove the exemption entry for the specified assembly. Currently not
supported by sn, you must edit machine.config manually if you require this.
Remove the exemption entry for the specified assembly.
.TP
.I "-Vx"
Remove all exemptions entries. Currently not supported by sn, you must edit
machine.config manually if you require this.
Remove all exemptions entries.
.SH CSP RELATED OPTIONS
.TP
.I "-d container"
@@ -72,14 +62,11 @@ Compare if assembly1 and assembly are the same exception for their signature.
This is done by comparing the hash of the metadata of both assembly.
.TP
.I "-k keypair.snk"
Create a new strongname keypair (a 1024 bits RSA keypair) in the specified
file.
Create a new strongname keypair in the specified file.
.TP
.I "-R assembly keypair.snk"
Resign the specified assembly using the specified strongname keypair file
(SNK). You can only sign an assembly with the private key (SNK) that match
the public key inside the assembly (unless it's public key token has been
remapped in machine.config).
(SNK).
.TP
.I "-Rc assembly container"
Resign the specified assembly using the specified strongname container.
@@ -96,10 +83,10 @@ Show the public key from the specified assembly.
.I "-Tp assembly"
Show the public key and the public key token from the specified assembly.
.TP
.I "-v assembly"
.I "-V assembly"
Verify the specified assembly signature.
.TP
.I "-vf assembly"
.I "-Vf assembly"
Verify the specified assembly signature (even if disabled).
.SH HELP OPTIONS
.TP
@@ -117,35 +104,10 @@ Display convertion related help about this tool.
.TP
.I "-h sn", "-? sn"
Display strongname related help about this tool.
.SH CONFIGURATION FILE
.TP
Strongnames configuration is kept in "machine.config" file. Currently two
features can be configured.
.TP
.I "/configuration/strongNames/pubTokenMapping"
This mechanism let Mono remap a public key token, like the ECMA token, to
another public key for verification. This is useful in two scenarios. First
assemblies signed with the "ECMA key" needs to be verified by the "runtime"
key (as the ECMA key isn't a public key). Second, many assemblies are signed
with private keys that Mono can't use (e.g. System.Security.dll assembly).
A new key cannot be used because it should change thr strongname (a new key
pair would have a new public key which would produce a new token). Public
key token remapping is the solution for both problems. Each token must be
configured in a "map" entry similar to this one: <map Token="b77a5c561934e089"
PublicKey="00..." />
.TP
.I "/configuration/strongNames/verificationSettings"
It is often useful during development to use delay signed assemblies.
Normally* the runtime wouldn't allow delay-signed assemblies to be loaded.
This feature allows some delay-signed assemblies (based on their public key
token, optionally assembly name and user name) to be used like they were
fully signed assemblies. [*] Note that Mono 1.0 "runtime" doesn't validate
strongname signatures so this option shouldn't be required in most scenarios.
.SH AUTHOR
Written by Sebastien Pouliot
.SH COPYRIGHT
Copyright (C) 2003 Motus Technologies.
Copyright (C) 2004 Novell.
Released under BSD license.
.SH MAILING LISTS
Visit http://mail.ximian.com/mailman/mono-list for details.
+45 -27
View File
@@ -1,18 +1,18 @@
.TH sqlsharp 1 "21 October 2004"
.TH sqlsharp 1 "10 December 2002"
.SH NAME
sqlsharp \- Mono SQL Query command-line tool
sqlsharp \- Mono SQL# command-line SQL Query tool
.SH SYNOPSIS
.B sqlsharp
[\-f filename] [\-o filename] [\-s]
.SH DESCRIPTION
sqlsharp is a Mono SQL tool used for entering SQL queries
to a database using Mono data providers.
sqlsharp is the Mono SQL# tool used for entering SQL queries
to a database using Mono ADO.NET providers.
.PP
.SH OPTIONS
The following options are supported:
.TP
.I "-f filename"
Output file to load SQL commands from.
Output file to load SQL# commands from.
.TP
.I "-o filename"
Output file to send results.
@@ -21,7 +21,7 @@ Output file to send results.
Silent mode.
.PP
.SH HOW TO USE
The SQL tool accepts commands via its command line interface. Commands
The SQL# tool accepts commands via its command line interface. Commands
begin with a backslash followed by the command name.
.PP
Example:
@@ -344,25 +344,28 @@ ption defaulting to true.
PROVIDER NAME NAMESPACE ASSEMBLY
Oracle Oracle 8i System.Data.OracleClient System.Data.OracleClient
PostgreSql NetPostgreSQL Npgsql Npgsql
MySQL ByteFX MySQL ByteFX.Data.MySqlClient ByteFX.Data
Internal
--------
OleDb OLE DB System.Data.OleDb System.Data
SqlClient MS SQL 7/2000 System.Data.SqlClient System.Data
Odbc ODBC System.Data.Odbc System.Data
External to System.Data
-----------------------
MySql MySQL Mono.Data.MySql Mono.Data.MySql
Sqlite SQL Lite Mono.Data.SqliteClient Mono.Data.SqliteClient
Sybase Sybase Mono.Data.SybaseClient Mono.Data.SybaseClient
OleDb OLE DB System.Data.OleDb System.Data
Tds TDS Generic Mono.Data.TdsClient Mono.Data.TdsClient
MSOdbc MS ODBC Microsoft.Data.Odbc Microsoft.Data.Odbc
Firebird Firebird SQL FirebirdSql.Data.FirebirdSql FirebirdSql.Data.Firebird
PostgreSql M PostgreSQL Mono.Data.PostgreSqlClient Mono.Data.PostgreSqlClient
DB2 IBM DB2 Mono.Data.DB2Client Mono.Data.DB2Client
Oracle Oracle 8i System.Data.OracleClient System.Data.OracleClient
NOTES
External to Mono
----------------
Npgsql maps to PostgreSql above.
MySqlNet maps to MySql above.
Odbc is treated as an external provider for .NET 1.1 and above.
MSODBC is an external provider for compatibility with .NET 1.0
Firebird is not included with Mono.
Npgsql NetPostgreSQL Npgsql Npgsql
MySQLNet ByteFX MySQL ByteFX.Data.MySQL ByteFX.Data
.fi
.SH CONNECTION STRING SAMPLES
@@ -382,6 +385,20 @@ or Mono.Data.TdsClient provider:
Server=DANPC;Database=pubs;User ID=saPassword=
PostgreSQL via Mono.Data.PostgreSqlClient provider:
host=localhost;dbname=test;user=postgres;password=fun2db
or
Server=localhost;Database=test;User ID=postgres;Password=fun2db
MySQL via Mono.Data.MySql provider:
Server=localhost;Database=test;User ID=mysql;Password=
ODBC via System.Data.Odbc provider using
a DSN named "MSSQLDSN" I set up
@@ -410,6 +427,11 @@ Oracle via System.Data.OracleClient
Data Source=testdb;User ID=scott;Password=tiger
IBM DB2 Universal Database via Mono.Data.DB2Client
DSN=sample;User ID=db2admin;Password=mysecret
Npgsql (.NET PostgreSQL) from
http://gborg.postgresql.org/project/npgsql/projdisplay.php
@@ -421,24 +443,20 @@ http://sourceforge.net/projects/mysqlnet/
Server=localhost;Database=test;User ID=mysql;Password=
FirebirdSql via FirebirdSql.Data.Firebird (not included with Mono)
Database=C:\\FIREBIRD\\EXAMPLES\\EMPLOYEE.FDB;User=SYSDBA;Password=masterkey;Dialect=3;Server=localhost
.fi
.SH TRACING SUPPORT
No support for tracing right now.
.SH AUTHORS
The Mono SQL Query Tool was written
The Mono SQL# Tool was written
.nf
by Daniel Morgan <danielmorg[email protected]>
by Daniel Morgan <danmorg@sc.rr.com>
.fi
.PP
.SH LICENSE
The Mono SQL Query Tool is released under the terms of the GNU GPL.
The Mono SQL# Tool is released under the terms of the GNU GPL.
Please read the accompanying `COPYING' file for details. Alternative
licenses are available from Novell or Daniel Morgan.
licenses are available from Ximian or Daniel Morgan.
.SH BUGS
To report bugs in the compiler, you can use `bug-buddy', or you can
file bug reports in our bug tracking system:
@@ -454,7 +472,7 @@ http://mail.ximian.com/mailman/mono-list
.SH WEB SITE
For details, visit:
.nf
http://www.mono-project.com
http://www.go-mono.com
.fi
.PP
.SH SEE ALSO
+5 -12
View File
@@ -1,4 +1,4 @@
\"
.\"
.\" wsdl manual page.
.\" (C) 2003 Novell, Inc.
.\" Author:
@@ -13,13 +13,9 @@ wsdl \- Mono's Web Service Proxy Generator
[options] [path | url]
.SH DESCRIPTION
.I wsdl
is a tool for generating proxy classes that can be used to access to
web services. The tool reads a WSDL document from the provided path
or url, and downloads referenced schemas or other WSDL documents if
needed.
.PP
This tool is used to target the 1.x API, for targetting the 2.x API,
please use the wsdl2 tool.
is a tool for generating proxy classes that can be used to access to web services.
The tool reads a WSDL document from the provided path or url, and downloads
referenced schemas or other WSDL documents if needed.
.PP
.SH OPTIONS
The following options are available:
@@ -33,9 +29,6 @@ Specifies a base URL for the service. The final URL will be constructed by
combining this value with the URL read from the
.I -appsettingurlkey
option, and the
.I "-type:typename, assembly"
Generate a proxy for a compiled web service class. The URL parameter
can be used to providethe location of the service.
.I location
attribute specified in the WSDL document.
.TP
@@ -80,4 +73,4 @@ Lluis Sanchez Gual ([email protected])
wsdl is released under the terms of the GNU GPL.
.PP
.SH SEE ALSO
disco(1), soapsuds(1), mono(1), mcs(1), wsdl2(1)
disco(1), soapsuds(1), mono(1), mcs(1)
-79
View File
@@ -1,79 +0,0 @@
.\"
.\" wsdl manual page.
.\" (C) 2003 Novell, Inc.
.\" Author:
.\" Lluis Sanchez Gual ([email protected])
.\"
.TH wsdl 1
.SH NAME
wsdl \- Mono's Web Service Proxy Generator
.SH SYNOPSIS
.PP
.B wsdl
[options] [path | url]
.SH DESCRIPTION
.I wsdl
is a tool for generating proxy classes that can be used to access to web services.
The tool reads a WSDL document from the provided path or url, and downloads
referenced schemas or other WSDL documents if needed.
.PP
This tool is used to target the 2.x API, for targetting the 1.x API,
please use the wsdl tool.
.PP
.SH OPTIONS
The following options are available:
.TP
.I "-appsettingurlkey:key" "-urlkey:key"
Specifies that the url for the services should be read from the <appsettings> section
of the configuration file, using the provided key.
.TP
.I "-appsettingbaseurl:url", "-baseurl:url"
Specifies a base URL for the service. The final URL will be constructed by
combining this value with the URL read from the
.I -appsettingurlkey
option, and the
.I location
attribute specified in the WSDL document.
.TP
.I "-language:language", "-l"
Language of the code to generate. It can be CS (default) or VB.
.TP
.I "-namespace:name", "-n:name"
The namespace of the generated classes. If none is specified, the default
namespace is used.
.TP
.I "-out:filename", "-o:filename"
The target file for generated code.
.TP
.I "-protocol:protocol", "-p:protocol"
The protocol for which to generate code. It can be Soap (default), HttpGet or
HttpPost.
.TP
.I "-sample:METHOD"
This will display XML request and reply of the sample invocations to
that SOAP message. You can use the -protocol: option to render the
message in different forms.
.TP
.I "-server"
Generate a server skeleton instead of a client proxy.
.TP
.I "-nologo"
Supress the startup logo.
.TP
.I "-u:username", "-user:username"
The user name to use when connecting to the server.
.TP
.I "-p:password", "-password:password"
The password to use when connecting to the server.
.TP
.I "-d:domain", "-domain:domain"
The domain to use when connecting to the server.
.PP
.SH AUTHORS
Lluis Sanchez Gual ([email protected])
.PP
.SH LICENSE
wsdl is released under the terms of the GNU GPL.
.PP
.SH SEE ALSO
disco(1), soapsuds(1), mono(1), mcs(1), wsdl(1)
-73
View File
@@ -1,73 +0,0 @@
.\" xsd manual page.
.\" (C) 2004 Novell, Inc.
.\" Author:
.\" Lluis Sanchez Gual ([email protected])
.\"
.TH "xsd" "1" "" "" ""
.SH "NAME"
xsd \- Mono's utility for generating schema or class files
.SH "SYNOPSIS"
.PP
.B xsd
<schema.xsd> /classes [options]
.PP
.B xsd
<schema.xsd> /dataset [options]
.PP
.B xsd
<assembly>.dll|<assembly>.exe [options]
.PP
.B xsd
<instance.xml> [<instance.xml> ...] [options]
.PP
.SH "DESCRIPTION"
.I xsd
is a tool for intended to complement the XML serialization support of Mono. It can do the following tasks:
.TP
Generate serializable classes
From a given XML schema, generate a class that can be used to read and write xml documents that conform that schema (/classes option).
.TP
Generate typed datasets
From a given XML schema, generate a typed DataSet class that can be used to read and write xml documents that conform that schema (/dataset option).
.TP
Generate XML schemas
From a given assembly and an optional type name, generate an XML schema that can be used to validate the xml documents that can be obtained by serializing objects of that type. If no type is provided, xsd generates a schema for all types in the assembly. When specifying the assembly name do not include the file extension (.dll or .exe). xsd will look for the assembly using the standard assembly loading rules.
.TP
Infer XML schemas
From a given set of XML documents, infer the XML schema that can be used to validate those documents.
.SH "OPTIONS"
The following options are available:
.TP
.I "/element:name" "/e:name"
Specifies the name of the XML schema element for which a class or a dataset has to be generated.
.TP
.TP
.I "/namespace:name" "/n:name"
Specifies the namespace of the XML schema element for which a class or a dataset has to be generated.
.TP
.I "/language:name" "/l:name"
Specifies the programming language to use for the generated code. The only supported languages are CS (C#) and VB (Visual Basic.NET).
.TP
.I "/generator:type,assembly" "/g:type,assembly"
Indicates xsd.exe to use custom CodeDomProvider to generate code. The type name must be full name. Assembly name is a local file name that is going to be loaded. The specified Type must have the default constructor.
.TP
.I "/outputdir:path" "/o:path"
Specifies the directory where to generate the code or schemas.
.TP
.I "/type:name" "/t:name"
Specifies the full name of the type (including namespace) for which to generate the XML schema.
.TP
.I "/help" "/h"
Show usage help.
.PP
.SH "AUTHORS"
Lluis Sanchez Gual ([email protected])
.br
Atsushi Enomoto ([email protected])
.PP
.SH "LICENSE"
xsd is released under the terms of the GNU GPL.
.PP
.SH "SEE ALSO"
disco(1), soapsuds(1), mono(1), mcs(1), wsdl(1)
+2 -4
View File
@@ -1,5 +1,3 @@
*.dll
*.mdb
cs-parser.cs
semantic.cache
y.output
cs-parser.cs
*.dll
+1 -1
View File
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyVersion("1.1.2")]
[assembly: AssemblyVersion("0.31.99")]
[assembly: AssemblyTitle ("Mono C# Compiler")]
[assembly: AssemblyDescription ("Mono C# Compiler with Generics")]
[assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
+293 -4130
View File
File diff suppressed because it is too large. Load diff
-406
View File
@@ -1,406 +0,0 @@
//
// CryptoConvert.cs - Crypto Convertion Routines
//
// Author:
// Sebastien Pouliot <[email protected]>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
// (C) 2004 Novell (http://www.novell.com)
//
using System;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
namespace Mono.Security.Cryptography {
#if INSIDE_CORLIB
internal
#else
public
#endif
sealed class CryptoConvert {
private CryptoConvert ()
{
}
static private int ToInt32LE (byte [] bytes, int offset)
{
return (bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset];
}
static private uint ToUInt32LE (byte [] bytes, int offset)
{
return (uint)((bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset]);
}
static private byte [] GetBytesLE (int val)
{
return new byte [] {
(byte) (val & 0xff),
(byte) ((val >> 8) & 0xff),
(byte) ((val >> 16) & 0xff),
(byte) ((val >> 24) & 0xff)
};
}
static private byte[] Trim (byte[] array)
{
for (int i=0; i < array.Length; i++) {
if (array [i] != 0x00) {
byte[] result = new byte [array.Length - i];
Buffer.BlockCopy (array, i, result, 0, result.Length);
return result;
}
}
return null;
}
// convert the key from PRIVATEKEYBLOB to RSA
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/private_key_blobs.asp
// e.g. SNK files, PVK files
static public RSA FromCapiPrivateKeyBlob (byte[] blob)
{
return FromCapiPrivateKeyBlob (blob, 0);
}
static public RSA FromCapiPrivateKeyBlob (byte[] blob, int offset)
{
if (blob == null)
throw new ArgumentNullException ("blob");
if (offset >= blob.Length)
throw new ArgumentException ("blob is too small.");
try {
if ((blob [offset] != 0x07) || // PRIVATEKEYBLOB (0x07)
(blob [offset+1] != 0x02) || // Version (0x02)
(blob [offset+2] != 0x00) || // Reserved (word)
(blob [offset+3] != 0x00) ||
(ToUInt32LE (blob, offset+8) != 0x32415352)) // DWORD magic = RSA2
throw new CryptographicException ("Invalid blob header");
// ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)
int algId = ToInt32LE (blob, offset+4);
// DWORD bitlen
int bitLen = ToInt32LE (blob, offset+12);
// DWORD public exponent
RSAParameters rsap = new RSAParameters ();
byte[] exp = new byte [4];
Buffer.BlockCopy (blob, offset+16, exp, 0, 4);
Array.Reverse (exp);
rsap.Exponent = Trim (exp);
int pos = offset+20;
// BYTE modulus[rsapubkey.bitlen/8];
int byteLen = (bitLen >> 3);
rsap.Modulus = new byte [byteLen];
Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);
Array.Reverse (rsap.Modulus);
pos += byteLen;
// BYTE prime1[rsapubkey.bitlen/16];
int byteHalfLen = (byteLen >> 1);
rsap.P = new byte [byteHalfLen];
Buffer.BlockCopy (blob, pos, rsap.P, 0, byteHalfLen);
Array.Reverse (rsap.P);
pos += byteHalfLen;
// BYTE prime2[rsapubkey.bitlen/16];
rsap.Q = new byte [byteHalfLen];
Buffer.BlockCopy (blob, pos, rsap.Q, 0, byteHalfLen);
Array.Reverse (rsap.Q);
pos += byteHalfLen;
// BYTE exponent1[rsapubkey.bitlen/16];
rsap.DP = new byte [byteHalfLen];
Buffer.BlockCopy (blob, pos, rsap.DP, 0, byteHalfLen);
Array.Reverse (rsap.DP);
pos += byteHalfLen;
// BYTE exponent2[rsapubkey.bitlen/16];
rsap.DQ = new byte [byteHalfLen];
Buffer.BlockCopy (blob, pos, rsap.DQ, 0, byteHalfLen);
Array.Reverse (rsap.DQ);
pos += byteHalfLen;
// BYTE coefficient[rsapubkey.bitlen/16];
rsap.InverseQ = new byte [byteHalfLen];
Buffer.BlockCopy (blob, pos, rsap.InverseQ, 0, byteHalfLen);
Array.Reverse (rsap.InverseQ);
pos += byteHalfLen;
// ok, this is hackish but CryptoAPI support it so...
// note: only works because CRT is used by default
// http://bugzilla.ximian.com/show_bug.cgi?id=57941
rsap.D = new byte [byteLen]; // must be allocated
if (pos + byteLen + offset <= blob.Length) {
// BYTE privateExponent[rsapubkey.bitlen/8];
Buffer.BlockCopy (blob, pos, rsap.D, 0, byteLen);
Array.Reverse (rsap.D);
}
RSA rsa = (RSA)RSA.Create ();
rsa.ImportParameters (rsap);
return rsa;
}
catch (Exception e) {
throw new CryptographicException ("Invalid blob.", e);
}
}
static public byte[] ToCapiPrivateKeyBlob (RSA rsa)
{
RSAParameters p = rsa.ExportParameters (true);
int keyLength = p.Modulus.Length; // in bytes
byte[] blob = new byte [20 + (keyLength << 2) + (keyLength >> 1)];
blob [0] = 0x07; // Type - PRIVATEKEYBLOB (0x07)
blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02)
// [2], [3] // RESERVED - Always 0
blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)
blob [8] = 0x52; // Magic - RSA2 (ASCII in hex)
blob [9] = 0x53;
blob [10] = 0x41;
blob [11] = 0x32;
byte[] bitlen = GetBytesLE (keyLength << 3);
blob [12] = bitlen [0]; // bitlen
blob [13] = bitlen [1];
blob [14] = bitlen [2];
blob [15] = bitlen [3];
// public exponent (DWORD)
int pos = 16;
int n = p.Exponent.Length;
while (n > 0)
blob [pos++] = p.Exponent [--n];
// modulus
pos = 20;
byte[] part = p.Modulus;
int len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
pos += len;
// private key
part = p.P;
len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
pos += len;
part = p.Q;
len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
pos += len;
part = p.DP;
len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
pos += len;
part = p.DQ;
len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
pos += len;
part = p.InverseQ;
len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
pos += len;
part = p.D;
len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
return blob;
}
static public RSA FromCapiPublicKeyBlob (byte[] blob)
{
return FromCapiPublicKeyBlob (blob, 0);
}
static public RSA FromCapiPublicKeyBlob (byte[] blob, int offset)
{
if (blob == null)
throw new ArgumentNullException ("blob");
if (offset >= blob.Length)
throw new ArgumentException ("blob is too small.");
try {
if ((blob [offset] != 0x06) || // PUBLICKEYBLOB (0x06)
(blob [offset+1] != 0x02) || // Version (0x02)
(blob [offset+2] != 0x00) || // Reserved (word)
(blob [offset+3] != 0x00) ||
(ToUInt32LE (blob, offset+8) != 0x31415352)) // DWORD magic = RSA1
throw new CryptographicException ("Invalid blob header");
// ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)
int algId = ToInt32LE (blob, offset+4);
// DWORD bitlen
int bitLen = ToInt32LE (blob, offset+12);
// DWORD public exponent
RSAParameters rsap = new RSAParameters ();
rsap.Exponent = new byte [3];
rsap.Exponent [0] = blob [offset+18];
rsap.Exponent [1] = blob [offset+17];
rsap.Exponent [2] = blob [offset+16];
int pos = offset+20;
// BYTE modulus[rsapubkey.bitlen/8];
int byteLen = (bitLen >> 3);
rsap.Modulus = new byte [byteLen];
Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);
Array.Reverse (rsap.Modulus);
RSA rsa = (RSA)RSA.Create ();
rsa.ImportParameters (rsap);
return rsa;
}
catch (Exception e) {
throw new CryptographicException ("Invalid blob.", e);
}
}
static public byte[] ToCapiPublicKeyBlob (RSA rsa)
{
RSAParameters p = rsa.ExportParameters (false);
int keyLength = p.Modulus.Length; // in bytes
byte[] blob = new byte [20 + keyLength];
blob [0] = 0x06; // Type - PUBLICKEYBLOB (0x06)
blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02)
// [2], [3] // RESERVED - Always 0
blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)
blob [8] = 0x52; // Magic - RSA1 (ASCII in hex)
blob [9] = 0x53;
blob [10] = 0x41;
blob [11] = 0x31;
byte[] bitlen = GetBytesLE (keyLength << 3);
blob [12] = bitlen [0]; // bitlen
blob [13] = bitlen [1];
blob [14] = bitlen [2];
blob [15] = bitlen [3];
// public exponent (DWORD)
int pos = 16;
int n = p.Exponent.Length;
while (n > 0)
blob [pos++] = p.Exponent [--n];
// modulus
pos = 20;
byte[] part = p.Modulus;
int len = part.Length;
Array.Reverse (part, 0, len);
Buffer.BlockCopy (part, 0, blob, pos, len);
pos += len;
return blob;
}
// PRIVATEKEYBLOB
// PUBLICKEYBLOB
static public RSA FromCapiKeyBlob (byte[] blob)
{
return FromCapiKeyBlob (blob, 0);
}
static public RSA FromCapiKeyBlob (byte[] blob, int offset)
{
if (blob == null)
throw new ArgumentNullException ("blob");
if (offset >= blob.Length)
throw new ArgumentException ("blob is too small.");
switch (blob [offset]) {
case 0x00:
// this could be a public key inside an header
// like "sn -e" would produce
if (blob [offset + 12] == 0x06) {
return FromCapiPublicKeyBlob (blob, offset + 12);
}
break;
case 0x06:
return FromCapiPublicKeyBlob (blob, offset);
case 0x07:
return FromCapiPrivateKeyBlob (blob, offset);
}
throw new CryptographicException ("Unknown blob format.");
}
static public byte[] ToCapiKeyBlob (AsymmetricAlgorithm keypair, bool includePrivateKey)
{
if (keypair == null)
throw new ArgumentNullException ("keypair");
// check between RSA and DSA (and potentially others like DH)
if (keypair is RSA)
return ToCapiKeyBlob ((RSA)keypair, includePrivateKey);
else
return null; // TODO
}
static public byte[] ToCapiKeyBlob (RSA rsa, bool includePrivateKey)
{
if (rsa == null)
throw new ArgumentNullException ("rsa");
RSAParameters p = rsa.ExportParameters (includePrivateKey);
if (includePrivateKey)
return ToCapiPrivateKeyBlob (rsa);
else
return ToCapiPublicKeyBlob (rsa);
}
static public string ToHex (byte[] input)
{
if (input == null)
return null;
StringBuilder sb = new StringBuilder (input.Length * 2);
foreach (byte b in input) {
sb.Append (b.ToString ("X2", CultureInfo.InvariantCulture));
}
return sb.ToString ();
}
static private byte FromHexChar (char c)
{
if ((c >= 'a') && (c <= 'f'))
return (byte) (c - 'a' + 10);
if ((c >= 'A') && (c <= 'F'))
return (byte) (c - 'A' + 10);
if ((c >= '0') && (c <= '9'))
return (byte) (c - '0');
throw new ArgumentException ("invalid hex char");
}
static public byte[] FromHex (string hex)
{
if (hex == null)
return null;
if ((hex.Length & 0x1) == 0x1)
throw new ArgumentException ("Length must be a multiple of 2");
byte[] result = new byte [hex.Length >> 1];
int n = 0;
int i = 0;
while (n < result.Length) {
result [n] = (byte) (FromHexChar (hex [i++]) << 4);
result [n++] += FromHexChar (hex [i++]);
}
return result;
}
}
}
+26 -49
View File
@@ -35,71 +35,42 @@ COMPILER_SOURCES = \
support.cs \
typemanager.cs \
symbolwriter.cs \
tree.cs \
CryptoConvert.cs \
$(topdir)/class/Mono.CSharp.Debugger/MonoSymbolFile.cs \
$(topdir)/class/Mono.CSharp.Debugger/MonoSymbolTable.cs \
$(topdir)/class/Mono.CSharp.Debugger/MonoSymbolWriter.cs
tree.cs
all_sources = $(COMPILER_SOURCES) cs-parser.cs
DISTFILES = \
$(COMPILER_SOURCES) \
compiler.csproj \
compiler.csproj.user \
compiler.doc \
compiler.sln \
cs-parser.jay \
gmcs.exe.config
# compiler.csproj \
# compiler.doc \
# compiler.sln \
# NOTES \
# TODO
#uncomment to enable some debug stuff
#DEBUG_FLAGS=/define:MCS_DEBUG
mcs.exe.config \
NOTES \
TODO
all-local: gmcs.exe
PROGRAM_INSTALL_DIR = $(prefix)/lib/mono/2.0
install-local: gmcs.exe
$(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
$(INSTALL_BIN) gmcs.exe $(DESTDIR)$(PROGRAM_INSTALL_DIR)
$(INSTALL_DATA) gmcs.exe.config $(DESTDIR)$(PROGRAM_INSTALL_DIR)
$(INSTALL_DATA) gmcs.exe.mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
$(INSTALL_BIN) gmcs.exe $(DESTDIR)$(prefix)/bin
uninstall-local:
-rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/gmcs.exe*
-rm -f $(DESTDIR)$(prefix)/bin/mcs.exe
test-local run-test-local:
clean-local:
rm -f *.exe *.pdb cs-parser.cs y.output *.mdb
cd .. && $(MAKE) PROFILE=net_2_0_bootstrap clean
rm -f *.exe *.pdb cs-parser.cs y.output
dist-local: dist-default
bootstrap_libs = mscorlib.dll System.dll System.Xml.dll Mono.CompilerServices.SymbolWriter.dll
bootstrap_libfiles = $(bootstrap_libs:%=$(topdir)/class/lib/net_2_0_bootstrap/%)
$(bootstrap_libfiles): bootstrap-libs
@:
.PHONY: bootstrap-libs
bootstrap-libs:
cd .. && $(MAKE) PROFILE=net_2_0_bootstrap all
gmcs.exe: $(all_sources) $(bootstrap_libfiles)
MONO_PATH="../class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" mono ../mcs/mcs.exe $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $(all_sources)
gmcs2.exe: $(all_sources)
MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time mcs -2 /target:exe /debug /out:$@ $^ $(DEBUG_FLAGS)
gmcs3.exe: $(all_sources)
MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs2.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
gmcs4.exe: $(all_sources)
MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs3.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
gmcs.exe: $(all_sources)
$(BOOT_COMPILE) /target:exe /out:$@ $^
cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
$(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< >$@
# Testing targets
@@ -108,14 +79,20 @@ TIME =
# This used to be called test, but that conflicts with the global
# recursive target.
btest: gmcs2.exe gmcs3.exe gmcs4.exe
ls -l gmcs3.exe gmcs4.exe
btest: mcs2.exe mcs3.exe
ls -l mcs2.exe mcs3.exe
mcs2.exe: gmcs.exe
$(TIME) $(RUNTIME) ./gmcs.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
mcs3.exe: mcs2.exe
$(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
wc:
wc -l $(all_sources)
ctest:
rm -f gmcs3.exe mcs4.exe
-rm mcs2.exe mcs3.exe
make btest USE_MCS_FLAGS=
# we need this because bash tries to use its own crappy timer
@@ -137,8 +114,8 @@ do-corlib:
PROFILER=default
profile : gmcs2.exe
make gmcs3.exe RUNTIME="$(RUNTIME) --profile"
profile : mcs.exe
$(RUNTIME) --profile=$(PROFILER) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources)
response:
echo $(all_sources) > res
-13
View File
@@ -1,13 +0,0 @@
Notes for Martin:
* We merged manually the patch from Sebastien from, this is the
only patch that is not part of the regular mcs/gmcs merger process.
2004-04-08 Sebastien Pouliot <[email protected]>
* codegen.cs: Fix another case where CS1548 must be reported (when
delay-sign isn't specified and no private is available #56564). Fix
loading the ECMA "key" to delay-sign an assembly. Report a CS1548
error when MCS is used on the MS runtime and we need to delay-sign
(which seems unsupported by AssemblyBuilder - see #56621).
-25
View File
@@ -1,25 +0,0 @@
This document lists some important changes between MCS and GMCS.
* Defining Types
There's a fundamental change in how we're defining types in
TypeContainer.DefineType().
In MCS, we resolve a type's parent type and the interface it
implements before actually creating the TypeBuilder. We can easily
detect "recursive" declarations (CS0146) if DefineType() is called
recursively.
This has changed in GMCS since the following type of a recursive
declaration is allowed:
class Foo<T> { }
class Bar<T> : Foo<Bar<T>> { }
To allow this, we must define Bar's TypeBuilder before resolving its
parent classes and call TypeBuilder.SetParent() later.
Last updated September 9th, 2004
Martin Baulig <[email protected]>
+7 -1093
View File
File diff suppressed because it is too large. Load diff
+72 -187
View File
@@ -29,125 +29,19 @@ namespace Mono.CSharp {
/// </remarks>
public interface IAssignMethod {
//
// This is an extra version of Emit. If leave_copy is `true'
// A copy of the expression will be left on the stack at the
// end of the code generated for EmitAssign
// This method will emit the code for the actual assignment
//
void Emit (EmitContext ec, bool leave_copy);
void EmitAssign (EmitContext ec, Expression source);
//
// This method does the assignment
// `source' will be stored into the location specified by `this'
// if `leave_copy' is true, a copy of `source' will be left on the stack
// if `prepare_for_load' is true, when `source' is emitted, there will
// be data on the stack that it can use to compuatate its value. This is
// for expressions like a [f ()] ++, where you can't call `f ()' twice.
// This method is invoked before any code generation takes
// place, and it is a mechanism to inform that the expression
// will be invoked more than once, and that the method should
// use temporary values to avoid having side effects
//
void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load);
/*
For simple assignments, this interface is very simple, EmitAssign is called with source
as the source expression and leave_copy and prepare_for_load false.
For compound assignments it gets complicated.
EmitAssign will be called as before, however, prepare_for_load will be
true. The @source expression will contain an expression
which calls Emit. So, the calls look like:
this.EmitAssign (ec, source, false, true) ->
source.Emit (ec); ->
[...] ->
this.Emit (ec, false); ->
end this.Emit (ec, false); ->
end [...]
end source.Emit (ec);
end this.EmitAssign (ec, source, false, true)
When prepare_for_load is true, EmitAssign emits a `token' on the stack that
Emit will use for its state.
Let's take FieldExpr as an example. assume we are emitting f ().y += 1;
Here is the call tree again. This time, each call is annotated with the IL
it produces:
this.EmitAssign (ec, source, false, true)
call f
dup
Binary.Emit ()
this.Emit (ec, false);
ldfld y
end this.Emit (ec, false);
IntConstant.Emit ()
ldc.i4.1
end IntConstant.Emit
add
end Binary.Emit ()
stfld
end this.EmitAssign (ec, source, false, true)
Observe two things:
1) EmitAssign left a token on the stack. It was the result of f ().
2) This token was used by Emit
leave_copy (in both EmitAssign and Emit) tells the compiler to leave a copy
of the expression at that point in evaluation. This is used for pre/post inc/dec
and for a = x += y. Let's do the above example with leave_copy true in EmitAssign
this.EmitAssign (ec, source, true, true)
call f
dup
Binary.Emit ()
this.Emit (ec, false);
ldfld y
end this.Emit (ec, false);
IntConstant.Emit ()
ldc.i4.1
end IntConstant.Emit
add
end Binary.Emit ()
dup
stloc temp
stfld
ldloc temp
end this.EmitAssign (ec, source, true, true)
And with it true in Emit
this.EmitAssign (ec, source, false, true)
call f
dup
Binary.Emit ()
this.Emit (ec, true);
ldfld y
dup
stloc temp
end this.Emit (ec, true);
IntConstant.Emit ()
ldc.i4.1
end IntConstant.Emit
add
end Binary.Emit ()
stfld
ldloc temp
end this.EmitAssign (ec, source, false, true)
Note that these two examples are what happens for ++x and x++, respectively.
*/
// Example: a [ g () ] ++
//
void CacheTemporaries (EmitContext ec);
}
/// <summary>
@@ -161,40 +55,16 @@ namespace Mono.CSharp {
/// The local temporary is used to alter the normal flow of code generation
/// basically it creates a local variable, and its emit instruction generates
/// code to access this value, return its address or save its value.
///
/// If `is_address' is true, then the value that we store is the address to the
/// real value, and not the value itself.
///
/// This is needed for a value type, because otherwise you just end up making a
/// copy of the value on the stack and modifying it. You really need a pointer
/// to the origional value so that you can modify it in that location. This
/// Does not happen with a class because a class is a pointer -- so you always
/// get the indirection.
///
/// The `is_address' stuff is really just a hack. We need to come up with a better
/// way to handle it.
/// </remarks>
public class LocalTemporary : Expression, IMemoryLocation {
LocalBuilder builder;
bool is_address;
public LocalTemporary (EmitContext ec, Type t) : this (ec, t, false) {}
public LocalTemporary (EmitContext ec, Type t, bool is_address)
public LocalTemporary (EmitContext ec, Type t)
{
type = t;
eclass = ExprClass.Value;
loc = Location.Null;
builder = ec.GetTemporaryLocal (is_address ? TypeManager.GetReferenceType (t): t);
this.is_address = is_address;
}
public LocalTemporary (LocalBuilder b, Type t)
{
type = t;
eclass = ExprClass.Value;
loc = Location.Null;
builder = b;
builder = ec.GetTemporaryLocal (t);
}
public void Release (EmitContext ec)
@@ -203,6 +73,14 @@ namespace Mono.CSharp {
builder = null;
}
public LocalTemporary (LocalBuilder b, Type t)
{
type = t;
eclass = ExprClass.Value;
loc = Location.Null;
builder = b;
}
public override Expression DoResolve (EmitContext ec)
{
return this;
@@ -210,39 +88,17 @@ namespace Mono.CSharp {
public override void Emit (EmitContext ec)
{
ILGenerator ig = ec.ig;
ig.Emit (OpCodes.Ldloc, builder);
// we need to copy from the pointer
if (is_address)
LoadFromPtr (ig, type);
ec.ig.Emit (OpCodes.Ldloc, builder);
}
// NB: if you have `is_address' on the stack there must
// be a managed pointer. Otherwise, it is the type from
// the ctor.
public void Store (EmitContext ec)
{
ILGenerator ig = ec.ig;
ig.Emit (OpCodes.Stloc, builder);
ec.ig.Emit (OpCodes.Stloc, builder);
}
public void AddressOf (EmitContext ec, AddressOp mode)
{
// if is_address, than this is just the address anyways,
// so we just return this.
ILGenerator ig = ec.ig;
if (is_address)
ig.Emit (OpCodes.Ldloc, builder);
else
ig.Emit (OpCodes.Ldloca, builder);
}
public bool PointsToAddress {
get {
return is_address;
}
ec.ig.Emit (OpCodes.Ldloca, builder);
}
}
@@ -385,6 +241,16 @@ namespace Mono.CSharp {
}
}
}
if (source is New && target_type.IsValueType &&
(target.eclass != ExprClass.IndexerAccess) && (target.eclass != ExprClass.PropertyAccess)){
New n = (New) source;
if (n.SetValueTypeVariable (target))
return n;
else
return null;
}
if (!(target is IAssignMethod) && (target.eclass != ExprClass.EventAccess)) {
Report.Error (131, loc,
@@ -394,29 +260,17 @@ namespace Mono.CSharp {
}
if ((source.eclass == ExprClass.Type) && (source is TypeExpr)) {
source.Error_UnexpectedKind ("variable or value", loc);
source.Error_UnexpectedKind ("variable or value");
return null;
} else if ((RootContext.Version == LanguageVersion.ISO_1) &&
(source is MethodGroupExpr)){
} else if (!RootContext.V2 && (source is MethodGroupExpr)){
((MethodGroupExpr) source).ReportUsageError ();
return null;
}
if (target_type == source_type){
if (source is New && target_type.IsValueType &&
(target.eclass != ExprClass.IndexerAccess) && (target.eclass != ExprClass.PropertyAccess)){
New n = (New) source;
if (n.SetValueTypeVariable (target))
return n;
else
return null;
}
if (target_type == source_type)
return this;
}
//
// If this assignemnt/operator was part of a compound binary
// operator, then we allow an explicit conversion, as detailed
@@ -443,7 +297,7 @@ namespace Mono.CSharp {
// 2. and the original right side is implicitly convertible to
// the type of target
//
if (Convert.ImplicitStandardConversionExists (ec, a.original_source, target_type))
if (Convert.ImplicitStandardConversionExists (a.original_source, target_type))
return this;
//
@@ -502,7 +356,7 @@ namespace Mono.CSharp {
}
Expression temp_source = (temp != null) ? temp : source;
((IAssignMethod) target).EmitAssign (ec, temp_source, false, false);
((IAssignMethod) target).EmitAssign (ec, temp_source);
return temp_source;
}
@@ -524,8 +378,20 @@ namespace Mono.CSharp {
((EventExpr) target).EmitAddOrRemove (ec, source);
return;
}
bool use_temporaries = false;
//
// FIXME! We need a way to "probe" if the process can
// just use `dup' to propagate the result
//
IAssignMethod am = (IAssignMethod) target;
if (this is CompoundAssign)
am.CacheTemporaries (ec);
if (!is_statement)
use_temporaries = true;
Expression temp_source;
if (embedded != null) {
@@ -538,8 +404,27 @@ namespace Mono.CSharp {
}
} else
temp_source = source;
am.EmitAssign (ec, temp_source, !is_statement, this is CompoundAssign);
if (use_temporaries){
//
// Doing this for every path is too expensive
// I wonder if we can work around this and have a less
// expensive path
//
LocalTemporary tempo;
tempo = new LocalTemporary (ec, source.Type);
temp_source.Emit (ec);
tempo.Store (ec);
am.EmitAssign (ec, tempo);
if (!is_statement)
tempo.Emit (ec);
tempo.Release (ec);
} else {
am.EmitAssign (ec, temp_source);
}
if (embedded != null) {
if (temp != null)
+1218 -1591
View File
File diff suppressed because it is too large. Load diff
-29
View File
@@ -128,9 +128,6 @@ namespace Mono.CSharp {
if (other is SByteConstant || other is ShortConstant || ic != null){
left = left.ToLong (loc);
right = right.ToLong (loc);
} else {
left = left.ToUInt (loc);
right = left.ToUInt (loc);
}
return;
@@ -970,19 +967,6 @@ namespace Mono.CSharp {
((BoolConstant) right).Value);
}
if (left is NullLiteral){
if (right is NullLiteral)
return new BoolConstant (true);
else if (right is StringConstant)
return new BoolConstant (
((StringConstant) right).Value == null);
} else if (right is NullLiteral){
if (left is NullLiteral)
return new BoolConstant (true);
else if (left is StringConstant)
return new BoolConstant (
((StringConstant) left).Value == null);
}
if (left is StringConstant && right is StringConstant){
return new BoolConstant (
((StringConstant) left).Value ==
@@ -1024,19 +1008,6 @@ namespace Mono.CSharp {
((BoolConstant) left).Value !=
((BoolConstant) right).Value);
}
if (left is NullLiteral){
if (right is NullLiteral)
return new BoolConstant (false);
else if (right is StringConstant)
return new BoolConstant (
((StringConstant) right).Value != null);
} else if (right is NullLiteral){
if (left is NullLiteral)
return new BoolConstant (false);
else if (left is StringConstant)
return new BoolConstant (
((StringConstant) left).Value != null);
}
if (left is StringConstant && right is StringConstant){
return new BoolConstant (
((StringConstant) left).Value !=
+2378 -4365
View File
File diff suppressed because it is too large. Load diff
+126 -628
View File
File diff suppressed because it is too large. Load diff
+59 -63
View File
@@ -24,12 +24,12 @@ namespace Mono.CSharp {
using System.Reflection.Emit;
using System.Collections;
public class Const : FieldMember {
public class Const : FieldBase {
public Expression Expr;
EmitContext const_ec;
bool resolved = false;
object ConstantValue = null;
Type type;
bool in_transit = false;
@@ -40,13 +40,12 @@ namespace Mono.CSharp {
Modifiers.INTERNAL |
Modifiers.PRIVATE;
public Const (TypeContainer parent, Expression constant_type, string name,
Expression expr, int mod_flags, Attributes attrs, Location loc)
: base (parent, constant_type, mod_flags, AllowedModifiers,
public Const (Expression constant_type, string name, Expression expr,
int mod_flags, Attributes attrs, Location loc)
: base (constant_type, mod_flags, AllowedModifiers,
new MemberName (name), null, attrs, loc)
{
Expr = expr;
ModFlags |= Modifiers.STATIC;
}
public FieldAttributes FieldAttr {
@@ -71,25 +70,42 @@ namespace Mono.CSharp {
/// <summary>
/// Defines the constant in the @parent
/// </summary>
public override bool Define ()
public override bool Define (TypeContainer parent)
{
if (!base.Define ())
type = parent.ResolveType (Type, false, Location);
if (type == null)
return false;
const_ec = new EmitContext (Parent, Location, null, MemberType, ModFlags);
Type ttype = MemberType;
const_ec = new EmitContext (parent, Location, null, type, ModFlags);
Type ttype = type;
while (ttype.IsArray)
ttype = TypeManager.GetElementType (ttype);
if (!TypeManager.IsBuiltinType (ttype) && (!ttype.IsSubclassOf (TypeManager.enum_type)) && !(Expr is NullLiteral)) {
if (!TypeManager.IsBuiltinType (ttype) &&
(!ttype.IsSubclassOf (TypeManager.enum_type))) {
Report.Error (
-3, Location,
"Constant type is not valid (only system types are allowed)");
return false;
}
FieldBuilder = Parent.TypeBuilder.DefineField (Name, MemberType, FieldAttr);
Type ptype = parent.TypeBuilder.BaseType;
if (ptype != null) {
MemberList list = TypeContainer.FindMembers (
ptype, MemberTypes.Field, BindingFlags.Public,
System.Type.FilterName, Name);
if (list.Count == 0)
if ((ModFlags & Modifiers.NEW) != 0)
WarningNotHiding (parent);
} else if ((ModFlags & Modifiers.NEW) != 0)
WarningNotHiding (parent);
FieldBuilder = parent.TypeBuilder.DefineField (Name, type, FieldAttr);
TypeManager.RegisterConstant (FieldBuilder, this);
@@ -102,16 +118,13 @@ namespace Mono.CSharp {
//
public static Constant ChangeType (Location loc, Constant expr, Type type)
{
if (type == TypeManager.object_type)
return expr;
bool fail;
// from the null type to any reference-type.
if (expr is NullLiteral && !type.IsValueType && !TypeManager.IsEnumType (type))
return NullLiteral.Null;
if (!Convert.ImplicitStandardConversionExists (Convert.ConstantEC, expr, type)){
if (!Convert.ImplicitStandardConversionExists (expr, type)){
Convert.Error_CannotImplicitConversion (loc, expr.Type, type);
return null;
}
@@ -165,19 +178,16 @@ namespace Mono.CSharp {
/// Looks up the value of a constant field. Defines it if it hasn't
/// already been. Similar to LookupEnumValue in spirit.
/// </summary>
public bool LookupConstantValue (out object value)
public object LookupConstantValue ()
{
if (resolved) {
value = ConstantValue;
return true;
}
if (ConstantValue != null)
return ConstantValue;
if (in_transit) {
Report.Error (110, Location,
"The evaluation of the constant value for `" +
Name + "' involves a circular definition.");
value = null;
return false;
return null;
}
in_transit = true;
@@ -186,11 +196,9 @@ namespace Mono.CSharp {
//
// We might have cleared Expr ourselves in a recursive definition
//
if (Expr == null){
value = null;
return false;
}
if (Expr == null)
return null;
Expr = Expr.Resolve (const_ec);
in_transit = false;
@@ -198,53 +206,48 @@ namespace Mono.CSharp {
if (Expr == null) {
if (errors == Report.Errors)
Report.Error (150, Location, "A constant value is expected");
value = null;
return false;
return null;
}
Expression real_expr = Expr;
Constant ce = Expr as Constant;
if (ce == null){
UnCheckedExpr un_expr = Expr as UnCheckedExpr;
CheckedExpr ch_expr = Expr as CheckedExpr;
EmptyCast ec_expr = Expr as EmptyCast;
if ((un_expr != null) && (un_expr.Expr is Constant))
Expr = un_expr.Expr;
else if ((ch_expr != null) && (ch_expr.Expr is Constant))
Expr = ch_expr.Expr;
else if ((ec_expr != null) && (ec_expr.Child is Constant))
Expr = ec_expr.Child;
else if (Expr is ArrayCreation){
Report.Error (133, Location, "Arrays can not be constant");
else if (Expr is ArrayCreation) {
ArrayCreation ac = (ArrayCreation) Expr;
Expr = ac.TurnIntoConstant ();
if (Expr == null){
Report.Error (150, Location, "A constant value is expected");
return null;
}
} else {
if (errors == Report.Errors)
Report.Error (150, Location, "A constant value is expected");
value = null;
return false;
return null;
}
ce = Expr as Constant;
}
if (MemberType != real_expr.Type) {
ce = ChangeType (Location, ce, MemberType);
if (ce == null){
value = null;
return false;
}
if (type != ce.Type) {
ce = ChangeType (Location, ce, type);
if (ce == null)
return null;
Expr = ce;
}
ConstantValue = ce.GetValue ();
if (MemberType.IsEnum){
if (type.IsEnum){
//
// This sadly does not work for our user-defined enumerations types ;-(
//
try {
ConstantValue = System.Enum.ToObject (
MemberType, ConstantValue);
type, ConstantValue);
} catch (ArgumentException){
Report.Error (
-16, Location,
@@ -256,27 +259,20 @@ namespace Mono.CSharp {
FieldBuilder.SetConstant (ConstantValue);
if (!TypeManager.RegisterFieldValue (FieldBuilder, ConstantValue))
throw new Exception ("Cannot register const value");
return null;
value = ConstantValue;
resolved = true;
return true;
return ConstantValue;
}
/// <summary>
/// Emits the field value by evaluating the expression
/// </summary>
public override void Emit ()
public void Emit (TypeContainer parent)
{
object value;
LookupConstantValue (out value);
if (OptAttributes != null) {
OptAttributes.Emit (const_ec, this);
}
base.Emit ();
LookupConstantValue ();
return;
}
}
}
+1 -140
View File
@@ -146,18 +146,6 @@ namespace Mono.CSharp {
{
return null;
}
public abstract bool IsNegative {
get;
}
//
// Returns true iff 1) the stack type of this is one of Object,
// int32, int64 and 2) this == 0 or this == null.
//
public virtual bool IsZeroInteger {
get { return false; }
}
}
public class BoolConstant : Constant {
@@ -189,16 +177,6 @@ namespace Mono.CSharp {
else
ec.ig.Emit (OpCodes.Ldc_I4_0);
}
public override bool IsNegative {
get {
return false;
}
}
public override bool IsZeroInteger {
get { return Value == false; }
}
}
public class ByteConstant : Constant {
@@ -255,16 +233,6 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
public override bool IsNegative {
get {
return false;
}
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
}
public class CharConstant : Constant {
@@ -350,16 +318,6 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
public override bool IsNegative {
get {
return false;
}
}
public override bool IsZeroInteger {
get { return Value == '\0'; }
}
}
public class SByteConstant : Constant {
@@ -419,16 +377,6 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
public override bool IsNegative {
get {
return Value < 0;
}
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
}
public class ShortConstant : Constant {
@@ -485,16 +433,6 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
public override bool IsNegative {
get {
return Value < 0;
}
}
}
public class UShortConstant : Constant {
@@ -551,16 +489,6 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
public override bool IsNegative {
get {
return false;
}
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
}
public class IntConstant : Constant {
@@ -675,16 +603,6 @@ namespace Mono.CSharp {
{
return this;
}
public override bool IsNegative {
get {
return Value < 0;
}
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
}
public class UIntConstant : Constant {
@@ -741,16 +659,6 @@ namespace Mono.CSharp {
{
return null;
}
public override bool IsNegative {
get {
return false;
}
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
}
public class LongConstant : Constant {
@@ -822,16 +730,6 @@ namespace Mono.CSharp {
{
return null;
}
public override bool IsNegative {
get {
return Value < 0;
}
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
}
public class ULongConstant : Constant {
@@ -890,16 +788,6 @@ namespace Mono.CSharp {
{
return null;
}
public override bool IsNegative {
get {
return false;
}
}
public override bool IsZeroInteger {
get { return Value == 0; }
}
}
public class FloatConstant : Constant {
@@ -951,12 +839,6 @@ namespace Mono.CSharp {
{
return null;
}
public override bool IsNegative {
get {
return Value < 0;
}
}
}
public class DoubleConstant : Constant {
@@ -1013,12 +895,6 @@ namespace Mono.CSharp {
{
return null;
}
public override bool IsNegative {
get {
return Value < 0;
}
}
}
public class DecimalConstant : Constant {
@@ -1064,12 +940,6 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Newobj, TypeManager.void_decimal_ctor_five_args);
}
public override bool IsNegative {
get {
return Value < 0;
}
}
}
public class StringConstant : Constant {
@@ -1095,16 +965,7 @@ namespace Mono.CSharp {
public override void Emit (EmitContext ec)
{
if (Value == null)
ec.ig.Emit (OpCodes.Ldnull);
else
ec.ig.Emit (OpCodes.Ldstr, Value);
}
public override bool IsNegative {
get {
return false;
}
ec.ig.Emit (OpCodes.Ldstr, Value);
}
}
+181 -376
View File
@@ -19,122 +19,15 @@ namespace Mono.CSharp {
// A container class for all the conversion operations
//
public class Convert {
//
// This is used to prettify the code: a null argument is allowed
// for ImplicitStandardConversion as long as it is known that
// no anonymous method will play a role.
//
// FIXME: renamed from `const' to `static' to allow bootstraping from older
// versions of the compiler that could not cope with this construct.
//
public static EmitContext ConstantEC = null;
static void Error_CannotConvertType (Location loc, Type source, Type target)
static public void Error_CannotConvertType (Location loc, Type source, Type target)
{
Report.Error (30, loc, "Cannot convert type '" +
TypeManager.CSharpName (source) + "' to '" +
TypeManager.CSharpName (target) + "'");
}
static Expression TypeParameter_to_Null (Expression expr, Type target_type,
Location loc)
{
if (!TypeParameter_to_Null (target_type)) {
Report.Error (403, loc, "Cannot convert null to the type " +
"parameter `{0}' becaues it could be a value " +
"type. Consider using `default ({0})' instead.",
target_type);
return null;
}
return new NullCast (expr, target_type);
}
static bool TypeParameter_to_Null (Type target_type)
{
if ((target_type.BaseType == null) ||
(target_type.BaseType == TypeManager.value_type) ||
target_type.BaseType.IsValueType)
return false;
return true;
}
static Type TypeParam_EffectiveBaseType (EmitContext ec, Type t)
{
GenericConstraints gc = TypeManager.GetTypeParameterConstraints (t);
if (gc == null)
return TypeManager.object_type;
return TypeParam_EffectiveBaseType (ec, gc);
}
static Type TypeParam_EffectiveBaseType (EmitContext ec, GenericConstraints gc)
{
ArrayList list = new ArrayList ();
list.Add (gc.EffectiveBaseClass);
foreach (Type t in gc.InterfaceConstraints) {
if (!t.IsGenericParameter)
continue;
GenericConstraints new_gc = TypeManager.GetTypeParameterConstraints (t);
if (new_gc != null)
list.Add (TypeParam_EffectiveBaseType (ec, new_gc));
}
return FindMostEncompassedType (ec, list);
}
static Expression TypeParameterConversion (Expression expr, bool is_reference, Type target_type)
{
if (is_reference)
return new EmptyCast (expr, target_type);
else
return new BoxedCast (expr, target_type);
}
static Expression ImplicitTypeParameterConversion (EmitContext ec, Expression expr,
Type target_type)
{
Type expr_type = expr.Type;
GenericConstraints gc = TypeManager.GetTypeParameterConstraints (expr_type);
if (gc == null) {
if (target_type == TypeManager.object_type)
return new BoxedCast (expr);
return null;
}
// We're converting from a type parameter which is known to be a reference type.
bool is_reference = gc.IsReferenceType;
Type base_type = TypeParam_EffectiveBaseType (ec, gc);
if (TypeManager.IsSubclassOf (base_type, target_type))
return TypeParameterConversion (expr, is_reference, target_type);
if (target_type.IsInterface) {
if (TypeManager.ImplementsInterface (base_type, target_type))
return TypeParameterConversion (expr, is_reference, target_type);
foreach (Type t in gc.InterfaceConstraints) {
if (TypeManager.IsSubclassOf (t, target_type))
return TypeParameterConversion (expr, is_reference, target_type);
}
}
foreach (Type t in gc.InterfaceConstraints) {
if (!t.IsGenericParameter)
continue;
if (TypeManager.IsSubclassOf (t, target_type))
return TypeParameterConversion (expr, is_reference, target_type);
}
return null;
}
static EmptyExpression MyEmptyExpr;
static public Expression ImplicitReferenceConversion (EmitContext ec, Expression expr, Type target_type)
static public Expression ImplicitReferenceConversion (Expression expr, Type target_type)
{
Type expr_type = expr.Type;
@@ -147,9 +40,6 @@ namespace Mono.CSharp {
if (expr_type == TypeManager.void_type)
return null;
if (expr_type.IsGenericParameter)
return ImplicitTypeParameterConversion (ec, expr, target_type);
//
// notice that it is possible to write "ValueType v = 1", the ValueType here
// is an abstract class, and not really a value type, so we apply the same rules.
@@ -163,112 +53,105 @@ namespace Mono.CSharp {
if (TypeManager.IsValueType (expr_type))
return new BoxedCast (expr);
if (expr_type.IsClass || expr_type.IsInterface || expr_type == TypeManager.enum_type){
if (target_type == TypeManager.anonymous_method_type)
return null;
if (expr_type.IsClass || expr_type.IsInterface || expr_type == TypeManager.enum_type)
return new EmptyCast (expr, target_type);
}
return null;
} else if (target_type == TypeManager.value_type) {
if (TypeManager.IsValueType (expr_type))
return new BoxedCast (expr);
if (expr is NullLiteral)
return new NullCast (expr, target_type);
return null;
} else if (TypeManager.IsSubclassOf (expr_type, target_type)) {
} else if (expr_type.IsSubclassOf (target_type)) {
//
// Special case: enumeration to System.Enum.
// System.Enum is not a value type, it is a class, so we need
// a boxing conversion
//
if (expr_type.IsEnum || expr_type.IsGenericParameter)
if (expr_type.IsEnum)
return new BoxedCast (expr);
return new EmptyCast (expr, target_type);
}
} else {
// This code is kind of mirrored inside ImplicitStandardConversionExists
// with the small distinction that we only probe there
//
// Always ensure that the code here and there is in sync
// This code is kind of mirrored inside ImplicitStandardConversionExists
// with the small distinction that we only probe there
//
// Always ensure that the code here and there is in sync
// from the null type to any reference-type.
if (expr is NullLiteral){
if (target_type.IsPointer)
return NullPointer.Null;
// from the null type to any reference-type.
if (expr is NullLiteral){
if (target_type.IsPointer)
return NullPointer.Null;
if (!target_type.IsValueType)
return new NullCast (expr, target_type);
}
// from any class-type S to any interface-type T.
if (target_type.IsInterface) {
if (target_type != TypeManager.iconvertible_type &&
expr_type.IsValueType && (expr is Constant) &&
!(expr is IntLiteral || expr is BoolLiteral ||
expr is FloatLiteral || expr is DoubleLiteral ||
expr is LongLiteral || expr is CharLiteral ||
expr is StringLiteral || expr is DecimalLiteral ||
expr is UIntLiteral || expr is ULongLiteral)) {
return null;
if (!target_type.IsValueType)
return new NullCast (expr, target_type);
}
if (TypeManager.ImplementsInterface (expr_type, target_type)){
if (expr_type.IsGenericParameter || TypeManager.IsValueType (expr_type))
return new BoxedCast (expr, target_type);
else
return new EmptyCast (expr, target_type);
}
}
// from any interface type S to interface-type T.
if (expr_type.IsInterface && target_type.IsInterface) {
if (TypeManager.ImplementsInterface (expr_type, target_type))
return new EmptyCast (expr, target_type);
else
return null;
}
// from an array-type S to an array-type of type T
if (expr_type.IsArray && target_type.IsArray) {
if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
Type expr_element_type = TypeManager.GetElementType (expr_type);
if (MyEmptyExpr == null)
MyEmptyExpr = new EmptyExpression ();
MyEmptyExpr.SetType (expr_element_type);
Type target_element_type = TypeManager.GetElementType (target_type);
if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
if (ImplicitStandardConversionExists (ConstantEC, MyEmptyExpr,
target_element_type))
// from any class-type S to any interface-type T.
if (target_type.IsInterface) {
if (TypeManager.ImplementsInterface (expr_type, target_type)){
if (expr_type.IsClass)
return new EmptyCast (expr, target_type);
else if (TypeManager.IsValueType (expr_type) ||
TypeManager.IsEnumType (expr_type))
return new BoxedCast (expr, target_type);
else
return new EmptyCast (expr, target_type);
}
}
// from any interface type S to interface-type T.
if (expr_type.IsInterface && target_type.IsInterface) {
if (TypeManager.ImplementsInterface (expr_type, target_type))
return new EmptyCast (expr, target_type);
else
return null;
}
}
// from an array-type to System.Array
if (expr_type.IsArray && target_type == TypeManager.array_type)
return new EmptyCast (expr, target_type);
// from an array-type S to an array-type of type T
if (expr_type.IsArray && target_type.IsArray) {
if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
Type expr_element_type = TypeManager.GetElementType (expr_type);
if (MyEmptyExpr == null)
MyEmptyExpr = new EmptyExpression ();
MyEmptyExpr.SetType (expr_element_type);
Type target_element_type = TypeManager.GetElementType (target_type);
if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
if (ImplicitStandardConversionExists (MyEmptyExpr,
target_element_type))
return new EmptyCast (expr, target_type);
}
}
// from any delegate type to System.Delegate
if ((expr_type == TypeManager.delegate_type || TypeManager.IsDelegateType (expr_type)) &&
target_type == TypeManager.delegate_type)
return new EmptyCast (expr, target_type);
// from any array-type or delegate type into System.ICloneable.
if (expr_type.IsArray ||
expr_type == TypeManager.delegate_type || TypeManager.IsDelegateType (expr_type))
if (target_type == TypeManager.icloneable_type)
// from an array-type to System.Array
if (expr_type.IsArray && target_type == TypeManager.array_type)
return new EmptyCast (expr, target_type);
// from any delegate type to System.Delegate
if ((expr_type == TypeManager.delegate_type ||
expr_type.IsSubclassOf (TypeManager.delegate_type)) &&
target_type == TypeManager.delegate_type)
return new EmptyCast (expr, target_type);
// from any array-type or delegate type into System.ICloneable.
if (expr_type.IsArray ||
expr_type == TypeManager.delegate_type ||
expr_type.IsSubclassOf (TypeManager.delegate_type))
if (target_type == TypeManager.icloneable_type)
return new EmptyCast (expr, target_type);
// from a generic type definition to a generic instance.
if (TypeManager.IsEqual (expr_type, target_type))
return new EmptyCast (expr, target_type);
// from a generic type definition to a generic instance.
if (TypeManager.IsEqualGenericType (expr_type, target_type))
return new EmptyCast (expr, target_type);
return null;
}
return null;
}
@@ -276,83 +159,80 @@ namespace Mono.CSharp {
// Tests whether an implicit reference conversion exists between expr_type
// and target_type
//
public static bool ImplicitReferenceConversionExists (EmitContext ec, Expression expr, Type target_type)
public static bool ImplicitReferenceConversionExists (Expression expr, Type target_type)
{
Type expr_type = expr.Type;
if (expr_type.IsGenericParameter)
return ImplicitTypeParameterConversion (ec, expr, target_type) != null;
//
// This is the boxed case.
//
if (target_type == TypeManager.object_type) {
if (expr_type.IsClass || TypeManager.IsValueType (expr_type) ||
expr_type.IsInterface || expr_type == TypeManager.enum_type)
if (target_type != TypeManager.anonymous_method_type)
return true;
return false;
} else if (TypeManager.IsSubclassOf (expr_type, target_type))
} else if (expr_type.IsSubclassOf (target_type))
return true;
// Please remember that all code below actually comes
// from ImplicitReferenceConversion so make sure code remains in sync
else {
// Please remember that all code below actually comes
// from ImplicitReferenceConversion so make sure code remains in sync
// from any class-type S to any interface-type T.
if (target_type.IsInterface) {
if (TypeManager.ImplementsInterface (expr_type, target_type))
return true;
}
// from any interface type S to interface-type T.
if (expr_type.IsInterface && target_type.IsInterface)
if (TypeManager.ImplementsInterface (expr_type, target_type))
return true;
// from an array-type S to an array-type of type T
if (expr_type.IsArray && target_type.IsArray) {
if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
Type expr_element_type = expr_type.GetElementType ();
if (MyEmptyExpr == null)
MyEmptyExpr = new EmptyExpression ();
MyEmptyExpr.SetType (expr_element_type);
Type target_element_type = TypeManager.GetElementType (target_type);
if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
if (ImplicitStandardConversionExists (ConstantEC, MyEmptyExpr,
target_element_type))
return true;
// from any class-type S to any interface-type T.
if (target_type.IsInterface) {
if (TypeManager.ImplementsInterface (expr_type, target_type))
return true;
}
}
// from an array-type to System.Array
if (expr_type.IsArray && (target_type == TypeManager.array_type))
return true;
// from any interface type S to interface-type T.
if (expr_type.IsInterface && target_type.IsInterface)
if (TypeManager.ImplementsInterface (expr_type, target_type))
return true;
// from any delegate type to System.Delegate
if ((expr_type == TypeManager.delegate_type || TypeManager.IsDelegateType (expr_type)) &&
target_type == TypeManager.delegate_type)
if (target_type.IsAssignableFrom (expr_type))
// from an array-type S to an array-type of type T
if (expr_type.IsArray && target_type.IsArray) {
if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
Type expr_element_type = expr_type.GetElementType ();
if (MyEmptyExpr == null)
MyEmptyExpr = new EmptyExpression ();
MyEmptyExpr.SetType (expr_element_type);
Type target_element_type = TypeManager.GetElementType (target_type);
if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
if (ImplicitStandardConversionExists (MyEmptyExpr,
target_element_type))
return true;
}
}
// from an array-type to System.Array
if (expr_type.IsArray && (target_type == TypeManager.array_type))
return true;
// from any delegate type to System.Delegate
if ((expr_type == TypeManager.delegate_type ||
expr_type.IsSubclassOf (TypeManager.delegate_type)) &&
target_type == TypeManager.delegate_type)
if (target_type.IsAssignableFrom (expr_type))
return true;
// from any array-type or delegate type into System.ICloneable.
if (expr_type.IsArray ||
expr_type == TypeManager.delegate_type || TypeManager.IsDelegateType (expr_type))
if (target_type == TypeManager.icloneable_type)
return true;
// from any array-type or delegate type into System.ICloneable.
if (expr_type.IsArray ||
expr_type == TypeManager.delegate_type ||
expr_type.IsSubclassOf (TypeManager.delegate_type))
if (target_type == TypeManager.icloneable_type)
return true;
// from the null type to any reference-type.
if (expr is NullLiteral && !target_type.IsValueType && !TypeManager.IsEnumType (target_type))
return true;
// from a generic type definition to a generic instance.
if (TypeManager.IsEqual (expr_type, target_type))
return true;
// from the null type to any reference-type.
if (expr is NullLiteral && !target_type.IsValueType &&
!TypeManager.IsEnumType (target_type))
return true;
// from a generic type definition to a generic instance.
if (TypeManager.IsEqualGenericType (expr_type, target_type))
return true;
}
return false;
}
@@ -371,6 +251,7 @@ namespace Mono.CSharp {
// Attempt to do the implicit constant expression conversions
if (expr is Constant){
if (expr is IntConstant){
Expression e;
@@ -385,7 +266,7 @@ namespace Mono.CSharp {
// we just inline it
//
long v = ((LongConstant) expr).Value;
if (v >= 0)
if (v > 0)
return new ULongConstant ((ulong) v);
}
}
@@ -529,10 +410,7 @@ namespace Mono.CSharp {
/// </summary>
public static bool ImplicitConversionExists (EmitContext ec, Expression expr, Type target_type)
{
if ((expr is NullLiteral) && target_type.IsGenericParameter)
return TypeParameter_to_Null (target_type);
if (ImplicitStandardConversionExists (ec, expr, target_type))
if (ImplicitStandardConversionExists (expr, target_type))
return true;
Expression dummy = ImplicitUserConversion (ec, expr, target_type, Location.Null);
@@ -553,10 +431,8 @@ namespace Mono.CSharp {
/// <summary>
/// Determines if a standard implicit conversion exists from
/// expr_type to target_type
///
/// ec should point to a real EmitContext if expr.Type is TypeManager.anonymous_method_type.
/// </summary>
public static bool ImplicitStandardConversionExists (EmitContext ec, Expression expr, Type target_type)
public static bool ImplicitStandardConversionExists (Expression expr, Type target_type)
{
Type expr_type = expr.Type;
@@ -674,7 +550,7 @@ namespace Mono.CSharp {
return true;
}
if (ImplicitReferenceConversionExists (ec, expr, target_type))
if (ImplicitReferenceConversionExists (expr, target_type))
return true;
//
@@ -735,18 +611,6 @@ namespace Mono.CSharp {
if (target_type == TypeManager.void_ptr_type && expr_type.IsPointer)
return true;
if (expr_type == TypeManager.anonymous_method_type){
if (!TypeManager.IsDelegateType (target_type))
return false;
AnonymousMethod am = (AnonymousMethod) expr;
int errors = Report.Errors;
Expression conv = am.Compatible (ec, target_type, true);
if (conv != null)
return true;
}
return false;
}
@@ -761,7 +625,7 @@ namespace Mono.CSharp {
/// Finds "most encompassed type" according to the spec (13.4.2)
/// amongst the methods in the MethodGroupExpr
/// </summary>
static Type FindMostEncompassedType (EmitContext ec, ArrayList types)
static Type FindMostEncompassedType (ArrayList types)
{
Type best = null;
@@ -776,7 +640,7 @@ namespace Mono.CSharp {
continue;
}
if (ImplicitStandardConversionExists (ec, priv_fmet_param, best))
if (ImplicitStandardConversionExists (priv_fmet_param, best))
best = t;
}
@@ -794,7 +658,7 @@ namespace Mono.CSharp {
/// Finds "most encompassing type" according to the spec (13.4.2)
/// amongst the types in the given set
/// </summary>
static Type FindMostEncompassingType (EmitContext ec, ArrayList types)
static Type FindMostEncompassingType (ArrayList types)
{
Type best = null;
@@ -809,7 +673,7 @@ namespace Mono.CSharp {
continue;
}
if (ImplicitStandardConversionExists (ec, priv_fmee_ret, t))
if (ImplicitStandardConversionExists (priv_fmee_ret, t))
best = t;
}
@@ -826,8 +690,8 @@ namespace Mono.CSharp {
/// by making use of FindMostEncomp* methods. Applies the correct rules separately
/// for explicit and implicit conversion operators.
/// </summary>
static public Type FindMostSpecificSource (EmitContext ec, MethodGroupExpr me,
Expression source, bool apply_explicit_conv_rules,
static public Type FindMostSpecificSource (MethodGroupExpr me, Expression source,
bool apply_explicit_conv_rules,
Location loc)
{
ArrayList src_types_set = new ArrayList ();
@@ -856,17 +720,17 @@ namespace Mono.CSharp {
// or encompassed by S to a type encompassing or encompassed by T
//
priv_fms_expr.SetType (param_type);
if (ImplicitStandardConversionExists (ec, priv_fms_expr, source_type))
if (ImplicitStandardConversionExists (priv_fms_expr, source_type))
src_types_set.Add (param_type);
else {
if (ImplicitStandardConversionExists (ec, source, param_type))
if (ImplicitStandardConversionExists (source, param_type))
src_types_set.Add (param_type);
}
} else {
//
// Only if S is encompassed by param_type
//
if (ImplicitStandardConversionExists (ec, source, param_type))
if (ImplicitStandardConversionExists (source, param_type))
src_types_set.Add (param_type);
}
}
@@ -878,21 +742,21 @@ namespace Mono.CSharp {
ArrayList candidate_set = new ArrayList ();
foreach (Type param_type in src_types_set){
if (ImplicitStandardConversionExists (ec, source, param_type))
if (ImplicitStandardConversionExists (source, param_type))
candidate_set.Add (param_type);
}
if (candidate_set.Count != 0)
return FindMostEncompassedType (ec, candidate_set);
return FindMostEncompassedType (candidate_set);
}
//
// Final case
//
if (apply_explicit_conv_rules)
return FindMostEncompassingType (ec, src_types_set);
return FindMostEncompassingType (src_types_set);
else
return FindMostEncompassedType (ec, src_types_set);
return FindMostEncompassedType (src_types_set);
}
//
@@ -903,8 +767,8 @@ namespace Mono.CSharp {
/// <summary>
/// Finds the most specific target Tx according to section 13.4.4
/// </summary>
static public Type FindMostSpecificTarget (EmitContext ec, MethodGroupExpr me,
Type target, bool apply_explicit_conv_rules,
static public Type FindMostSpecificTarget (MethodGroupExpr me, Type target,
bool apply_explicit_conv_rules,
Location loc)
{
ArrayList tgt_types_set = new ArrayList ();
@@ -932,11 +796,11 @@ namespace Mono.CSharp {
// or encompassed by S to a type encompassing or encompassed by T
//
priv_fms_expr.SetType (ret_type);
if (ImplicitStandardConversionExists (ec, priv_fms_expr, target))
if (ImplicitStandardConversionExists (priv_fms_expr, target))
tgt_types_set.Add (ret_type);
else {
priv_fms_expr.SetType (target);
if (ImplicitStandardConversionExists (ec, priv_fms_expr, ret_type))
if (ImplicitStandardConversionExists (priv_fms_expr, ret_type))
tgt_types_set.Add (ret_type);
}
} else {
@@ -944,7 +808,7 @@ namespace Mono.CSharp {
// Only if T is encompassed by param_type
//
priv_fms_expr.SetType (ret_type);
if (ImplicitStandardConversionExists (ec, priv_fms_expr, target))
if (ImplicitStandardConversionExists (priv_fms_expr, target))
tgt_types_set.Add (ret_type);
}
}
@@ -958,21 +822,21 @@ namespace Mono.CSharp {
foreach (Type ret_type in tgt_types_set){
priv_fmt_expr.SetType (ret_type);
if (ImplicitStandardConversionExists (ec, priv_fmt_expr, target))
if (ImplicitStandardConversionExists (priv_fmt_expr, target))
candidate_set.Add (ret_type);
}
if (candidate_set.Count != 0)
return FindMostEncompassingType (ec, candidate_set);
return FindMostEncompassingType (candidate_set);
}
//
// Okay, final case !
//
if (apply_explicit_conv_rules)
return FindMostEncompassedType (ec, tgt_types_set);
return FindMostEncompassedType (tgt_types_set);
else
return FindMostEncompassingType (ec, tgt_types_set);
return FindMostEncompassingType (tgt_types_set);
}
/// <summary>
@@ -993,8 +857,6 @@ namespace Mono.CSharp {
return UserDefinedConversion (ec, source, target, loc, true);
}
static DoubleHash explicit_conv = new DoubleHash (100);
static DoubleHash implicit_conv = new DoubleHash (100);
/// <summary>
/// Computes the MethodGroup for the user-defined conversion
/// operators from source_type to target_type. `look_for_explicit'
@@ -1012,9 +874,6 @@ namespace Mono.CSharp {
op_name = "op_Implicit";
MethodGroupExpr union3;
object r;
if ((look_for_explicit ? explicit_conv : implicit_conv).Lookup (source_type, target_type, out r))
return (MethodGroupExpr) r;
mg1 = Expression.MethodLookup (ec, source_type, op_name, loc);
if (source_type.BaseType != null)
@@ -1064,9 +923,7 @@ namespace Mono.CSharp {
union4 = Invocation.MakeUnionSet (union5, union6, loc);
}
MethodGroupExpr ret = Invocation.MakeUnionSet (union3, union4, loc);
(look_for_explicit ? explicit_conv : implicit_conv).Insert (source_type, target_type, ret);
return ret;
return Invocation.MakeUnionSet (union3, union4, loc);
}
/// <summary>
@@ -1086,11 +943,11 @@ namespace Mono.CSharp {
Type most_specific_source, most_specific_target;
most_specific_source = FindMostSpecificSource (ec, union, source, look_for_explicit, loc);
most_specific_source = FindMostSpecificSource (union, source, look_for_explicit, loc);
if (most_specific_source == null)
return null;
most_specific_target = FindMostSpecificTarget (ec, union, target, look_for_explicit, loc);
most_specific_target = FindMostSpecificTarget (union, target, look_for_explicit, loc);
if (most_specific_target == null)
return null;
@@ -1179,22 +1036,16 @@ namespace Mono.CSharp {
Type expr_type = expr.Type;
Expression e;
if ((expr is NullLiteral) && target_type.IsGenericParameter)
return TypeParameter_to_Null (expr, target_type, loc);
if (expr.eclass == ExprClass.MethodGroup){
if (!TypeManager.IsDelegateType (target_type)){
Report.Error (428, loc,
String.Format (
"Cannot convert method group to `{0}', since it is not a delegate",
TypeManager.CSharpName (target_type)));
return null;
}
//
// Only allow anonymous method conversions on post ISO_1
//
if (RootContext.Version != LanguageVersion.ISO_1){
MethodGroupExpr mg = expr as MethodGroupExpr;
if (mg != null)
return ImplicitDelegateCreation.Create (ec, mg, target_type, loc);
}
return ImplicitDelegateCreation.Create (ec, (MethodGroupExpr) expr, target_type, loc);
}
if (expr_type.Equals (target_type) && !(expr is NullLiteral))
@@ -1204,7 +1055,7 @@ namespace Mono.CSharp {
if (e != null)
return e;
e = ImplicitReferenceConversion (ec, expr, target_type);
e = ImplicitReferenceConversion (expr, target_type);
if (e != null)
return e;
@@ -1241,30 +1092,6 @@ namespace Mono.CSharp {
}
}
if (expr_type == TypeManager.anonymous_method_type){
if (!TypeManager.IsDelegateType (target_type)){
Report.Error (1660, loc,
"Cannot convert anonymous method to `{0}', since it is not a delegate",
TypeManager.CSharpName (target_type));
return null;
}
AnonymousMethod am = (AnonymousMethod) expr;
int errors = Report.Errors;
Expression conv = am.Compatible (ec, target_type, false);
if (conv != null)
return conv;
//
// We return something instead of null, to avoid
// the duplicate error, since am.Compatible would have
// reported that already
//
if (errors != Report.Errors)
return new EmptyCast (expr, target_type);
}
return null;
}
@@ -1325,10 +1152,11 @@ namespace Mono.CSharp {
static public void Error_CannotImplicitConversion (Location loc, Type source, Type target)
{
Report.Error (29, loc, "Cannot convert implicitly from {0} to `{1}'",
source == TypeManager.anonymous_method_type ?
"anonymous method" : "`" + TypeManager.CSharpName (source) + "'",
TypeManager.CSharpName (target));
string msg = "Cannot convert implicitly from `"+
TypeManager.CSharpName (source) + "' to `" +
TypeManager.CSharpName (target) + "'";
Report.Error (29, loc, msg);
}
/// <summary>
@@ -1341,10 +1169,7 @@ namespace Mono.CSharp {
{
Expression e;
int errors = Report.Errors;
e = ImplicitConversion (ec, source, target_type, loc);
if (Report.Errors > errors)
return null;
if (e != null)
return e;
@@ -1383,7 +1208,7 @@ namespace Mono.CSharp {
if (TypeManager.IsEnumType (real_target_type))
real_target_type = TypeManager.EnumToUnderlying (real_target_type);
if (ImplicitStandardConversionExists (ec, expr, real_target_type)){
if (ImplicitStandardConversionExists (expr, real_target_type)){
Expression ce = ImplicitConversionStandard (ec, expr, real_target_type, loc);
if (real_target_type != target_type)
@@ -1588,18 +1413,11 @@ namespace Mono.CSharp {
/// </summary>
public static bool ExplicitReferenceConversionExists (Type source_type, Type target_type)
{
bool target_is_type_param = target_type.IsGenericParameter;
bool target_is_value_type = target_type.IsValueType;
if (source_type == target_type)
return true;
//
// From object to a generic parameter
//
if (source_type == TypeManager.object_type && target_is_type_param)
return true;
//
// From object to any reference type
//
@@ -1609,14 +1427,14 @@ namespace Mono.CSharp {
//
// From any class S to any class-type T, provided S is a base class of T
//
if (TypeManager.IsSubclassOf (target_type, source_type))
if (target_type.IsSubclassOf (source_type))
return true;
//
// From any interface type S to any interface T provided S is not derived from T
//
if (source_type.IsInterface && target_type.IsInterface){
if (!TypeManager.IsSubclassOf (target_type, source_type))
if (!target_type.IsSubclassOf (source_type))
return true;
}
@@ -1668,7 +1486,7 @@ namespace Mono.CSharp {
// From System delegate to any delegate-type
//
if (source_type == TypeManager.delegate_type &&
TypeManager.IsDelegateType (target_type))
target_type.IsSubclassOf (TypeManager.delegate_type))
return true;
//
@@ -1688,15 +1506,8 @@ namespace Mono.CSharp {
static Expression ExplicitReferenceConversion (Expression source, Type target_type)
{
Type source_type = source.Type;
bool target_is_type_param = target_type.IsGenericParameter;
bool target_is_value_type = target_type.IsValueType;
//
// From object to a generic parameter
//
if (source_type == TypeManager.object_type && target_is_type_param)
return new UnboxCast (source, target_type);
//
// From object to any reference type
//
@@ -1714,7 +1525,7 @@ namespace Mono.CSharp {
//
// From any class S to any class-type T, provided S is a base class of T
//
if (TypeManager.IsSubclassOf (target_type, source_type))
if (target_type.IsSubclassOf (source_type))
return new ClassCast (source, target_type);
//
@@ -1726,7 +1537,7 @@ namespace Mono.CSharp {
else
return new ClassCast (source, target_type);
}
//
// From any class type S to any interface T, provides S is not sealed
// and provided S does not implement T.
@@ -1785,7 +1596,7 @@ namespace Mono.CSharp {
// From System delegate to any delegate-type
//
if (source_type == TypeManager.delegate_type &&
TypeManager.IsDelegateType (target_type))
target_type.IsSubclassOf (TypeManager.delegate_type))
return new ClassCast (source, target_type);
//
@@ -1804,7 +1615,7 @@ namespace Mono.CSharp {
/// type is expr.Type to `target_type'.
/// </summary>
static public Expression ExplicitConversion (EmitContext ec, Expression expr,
Type target_type, Location loc)
Type target_type, Location loc)
{
Type expr_type = expr.Type;
Type original_expr_type = expr_type;
@@ -1831,10 +1642,7 @@ namespace Mono.CSharp {
expr_type = expr.Type;
}
int errors = Report.Errors;
Expression ne = ImplicitConversionStandard (ec, expr, target_type, loc);
if (Report.Errors > errors)
return null;
if (ne != null)
return ne;
@@ -1939,12 +1747,9 @@ namespace Mono.CSharp {
/// Same as ExplicitConversion, only it doesn't include user defined conversions
/// </summary>
static public Expression ExplicitConversionStandard (EmitContext ec, Expression expr,
Type target_type, Location l)
Type target_type, Location l)
{
int errors = Report.Errors;
Expression ne = ImplicitConversionStandard (ec, expr, target_type, l);
if (Report.Errors > errors)
return null;
if (ne != null)
return ne;
+474 -625
View File
File diff suppressed because it is too large. Load diff
+21 -180
View File
@@ -41,7 +41,6 @@ namespace Mono.CSharp
bool handle_remove_add = false;
bool handle_assembly = false;
bool handle_constraints = false;
bool handle_typeof = false;
//
// Whether tokens have been seen on this line
@@ -144,16 +143,6 @@ namespace Mono.CSharp
handle_constraints = value;
}
}
public bool TypeOfParsing {
get {
return handle_typeof;
}
set {
handle_typeof = value;
}
}
//
// Class variables
@@ -229,7 +218,6 @@ namespace Mono.CSharp
{
keywords = new CharArrayHashtable [64];
AddKeyword ("__arglist", Token.ARGLIST);
AddKeyword ("abstract", Token.ABSTRACT);
AddKeyword ("as", Token.AS);
AddKeyword ("add", Token.ADD);
@@ -313,7 +301,6 @@ namespace Mono.CSharp
AddKeyword ("volatile", Token.VOLATILE);
AddKeyword ("where", Token.WHERE);
AddKeyword ("while", Token.WHILE);
AddKeyword ("partial", Token.PARTIAL);
}
//
@@ -352,7 +339,6 @@ namespace Mono.CSharp
return -1;
if (handle_constraints == false && res == Token.WHERE)
return -1;
return res;
}
@@ -398,46 +384,15 @@ namespace Mono.CSharp
identifiers = null;
}
static bool is_identifier_start_character (char c)
bool is_identifier_start_character (char c)
{
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || Char.IsLetter (c);
}
static bool is_identifier_part_character (char c)
bool is_identifier_part_character (char c)
{
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || (c >= '0' && c <= '9') || Char.IsLetter (c);
}
public static bool IsValidIdentifier (string s)
{
if (s == null || s.Length == 0)
return false;
if (!is_identifier_start_character (s [0]))
return false;
for (int i = 1; i < s.Length; i ++)
if (! is_identifier_part_character (s [i]))
return false;
return true;
}
bool parse_generic_dimension (out int dimension)
{
dimension = 1;
again:
int the_token = token ();
if (the_token == Token.OP_GENERICS_GT)
return true;
else if (the_token == Token.COMMA) {
dimension++;
goto again;
}
return false;
}
bool parse_less_than ()
{
@@ -471,20 +426,12 @@ namespace Mono.CSharp
if (the_token == Token.OP_GENERICS_GT)
return true;
else if ((the_token == Token.COMMA) || (the_token == Token.DOT))
else if (the_token == Token.COMMA)
goto start;
else if (the_token == Token.OP_GENERICS_LT) {
if (!parse_less_than ())
return false;
goto again;
} else if (the_token == Token.OPEN_BRACKET) {
rank_specifiers:
the_token = token ();
if (the_token == Token.CLOSE_BRACKET)
goto again;
else if (the_token == Token.COMMA)
goto rank_specifiers;
return false;
}
return false;
@@ -549,19 +496,8 @@ namespace Mono.CSharp
if (parsing_generic_less_than++ > 0)
return Token.OP_GENERICS_LT;
int old = reader.Position;
if (handle_typeof) {
int dimension;
if (parse_generic_dimension (out dimension)) {
val = dimension;
return Token.GENERIC_DIMENSION;
}
reader.Position = old;
putback_char = -1;
}
// Save current position and parse next token.
old = reader.Position;
int old = reader.Position;
bool is_generic_lt = parse_less_than ();
reader.Position = old;
putback_char = -1;
@@ -799,12 +735,15 @@ namespace Mono.CSharp
break;
case 'l':
if (!is_unsigned && (RootContext.WarningLevel >= 4)){
if (!is_unsigned){
//
// if we have not seen anything in between
// report this error
//
Report.Warning (78, Location, "The 'l' suffix is easily confused with the digit '1' (use 'L' for clarity)");
Report.Warning (
78, Location,
"the 'l' suffix is easily confused with digit `1'," +
" use 'L' for clarity");
}
goto case 'L';
@@ -887,11 +826,6 @@ namespace Mono.CSharp
val = 0ul;
return Token.LITERAL_INTEGER;
}
catch (FormatException) {
Report.Error (1013, Location, "Invalid number");
val = 0ul;
return Token.LITERAL_INTEGER;
}
}
int adjust_real (int t)
@@ -1270,13 +1204,8 @@ namespace Mono.CSharp
;
while ((c != -1) && (c != '\n') && (c != ' ') && (c != '\t') && (c != '\r')){
if (is_identifier_part_character ((char) c)){
static_cmd_arg.Append ((char) c);
c = getChar ();
} else {
putback (c);
break;
}
static_cmd_arg.Append ((char) c);
c = getChar ();
}
cmd = static_cmd_arg.ToString ();
@@ -1398,60 +1327,6 @@ namespace Mono.CSharp
}
}
/// <summary>
/// Handles #pragma directive
/// </summary>
void PreProcessPragma (string arg)
{
const string disable = "warning disable";
const string restore = "warning restore";
if (arg == disable) {
Report.RegisterWarningRegion (Location).WarningDisable (line);
return;
}
if (arg == restore) {
Report.RegisterWarningRegion (Location).WarningEnable (line);
return;
}
if (arg.StartsWith (disable)) {
int[] codes = ParseNumbers (arg.Substring (disable.Length));
foreach (int code in codes) {
if (code != 0)
Report.RegisterWarningRegion (Location).WarningDisable (Location, code);
}
return;
}
if (arg.StartsWith (restore)) {
int[] codes = ParseNumbers (arg.Substring (restore.Length));
foreach (int code in codes) {
Report.RegisterWarningRegion (Location).WarningEnable (Location, code);
}
return;
}
return;
}
int[] ParseNumbers (string text)
{
string[] string_array = text.Split (',');
int[] values = new int [string_array.Length];
int index = 0;
foreach (string string_code in string_array) {
try {
values[index++] = int.Parse (string_code, System.Globalization.CultureInfo.InvariantCulture);
}
catch (FormatException) {
Report.Warning (1692, Location, "Invalid number");
}
}
return values;
}
bool eval_val (string s)
{
if (s == "true")
@@ -1655,20 +1530,16 @@ namespace Mono.CSharp
//
switch (cmd){
case "pragma":
if (RootContext.Version == LanguageVersion.ISO_1) {
Report.FeatureIsNotStandardized (Location, "#pragma");
return caller_is_taking;
}
PreProcessPragma (arg);
return caller_is_taking;
if (RootContext.V2)
return true;
break;
case "line":
if (!PreProcessLine (arg))
Report.Error (
1576, Location,
"Argument to #line directive is missing or invalid");
return caller_is_taking;
return true;
case "region":
region_directive = true;
@@ -1828,7 +1699,7 @@ namespace Mono.CSharp
return true;
case "warning":
Report.Warning (1030, Location, "#warning: '{0}'", arg);
Report.Warning (1030, Location, "#warning: '" + arg + "'");
return true;
}
@@ -1875,36 +1746,6 @@ namespace Mono.CSharp
return Token.EOF;
}
private int consume_identifier (int s)
{
int res = consume_identifier (s, false);
if (res == Token.PARTIAL) {
// Save current position and parse next token.
int old = reader.Position;
int old_putback = putback_char;
putback_char = -1;
int next_token = token ();
bool ok = (next_token == Token.CLASS) ||
(next_token == Token.STRUCT) ||
(next_token == Token.INTERFACE);
reader.Position = old;
putback_char = old_putback;
if (ok)
return res;
else {
val = "partial";
return Token.IDENTIFIER;
}
}
return res;
}
private int consume_identifier (int s, bool quoted)
{
int pos = 1;
@@ -1932,9 +1773,9 @@ namespace Mono.CSharp
// Optimization: avoids doing the keyword lookup
// on uppercase letters and _
//
if (!quoted && (s >= 'a' || s == '_')){
if (s >= 'a'){
int keyword = GetKeyword (id_builder, pos);
if (keyword != -1)
if (keyword != -1 && !quoted)
return keyword;
}
@@ -2101,7 +1942,7 @@ namespace Mono.CSharp
if (is_identifier_start_character ((char)c)){
tokens_seen = true;
return consume_identifier (c);
return consume_identifier (c, false);
}
is_punct_label:
@@ -2195,9 +2036,9 @@ namespace Mono.CSharp
if (ifstack != null && ifstack.Count >= 1) {
int state = (int) ifstack.Pop ();
if ((state & REGION) != 0)
Report.Error (1038, Location, "#endregion directive expected");
Report.Error (1038, "#endregion directive expected");
else
Report.Error (1027, Location, "#endif directive expected");
Report.Error (1027, "#endif directive expected");
}
}
+353 -794
View File
File diff suppressed because it is too large. Load diff
+912 -1013
View File
File diff suppressed because it is too large. Load diff
+29 -194
View File
@@ -14,7 +14,6 @@ namespace Mono.CSharp
using System.Reflection;
using System.Reflection.Emit;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Globalization;
@@ -104,7 +103,7 @@ namespace Mono.CSharp
// Whether the user has specified a different encoder manually
//
static bool using_default_encoder = true;
public static void ShowTime (string msg)
{
if (!timestamps)
@@ -186,60 +185,46 @@ namespace Mono.CSharp
}
}
static void OtherFlags ()
{
Console.WriteLine (
"Other flags in the compiler\n" +
" --fatal Makes errors fatal\n" +
" --parse Only parses the source file\n" +
" --stacktrace Shows stack trace at error location\n" +
" --timestamp Displays time stamps of various compiler events\n" +
" -2 Enables experimental C# features\n" +
" -v Verbose parsing (for debugging the parser)\n" +
" --mcs-debug X Sets MCS debugging level to X\n");
}
static void Usage ()
{
Console.WriteLine (
"Mono C# compiler, (C) 2001 - 2003 Ximian, Inc.\n" +
"mcs [options] source-files\n" +
" --about About the Mono C# compiler\n" +
" -addmodule:MODULE Adds the module to the generated assembly\n" +
" -checked[+|-] Set default context to checked\n" +
" -codepage:ID Sets code page to the one in ID\n" +
" (number, `utf8' or `reset')\n" +
" -clscheck[+|-] Disables CLS Compliance verifications" + Environment.NewLine +
" -define:S1[;S2] Defines one or more symbols (short: /d:)\n" +
" -debug[+|-] Generate debugging information\n" +
" -delaysign[+|-] Only insert the public key into the assembly (no signing)\n" +
" -debug[+-] Generate debugging information\n" +
" -doc:FILE XML Documentation file to generate\n" +
" -g Generate debugging information\n" +
" -keycontainer:NAME The key pair container used to strongname the assembly\n" +
" -keyfile:FILE The strongname key file used to strongname the assembly\n" +
" -langversion:TEXT Specifies language version modes: ISO-1 or Default" + Environment.NewLine +
" --fatal Makes errors fatal\n" +
" -lib:PATH1,PATH2 Adds the paths to the assembly link path\n" +
" -main:class Specified the class that contains the entry point\n" +
" -noconfig[+|-] Disables implicit references to assemblies\n" +
" -nostdlib[+|-] Does not load core libraries\n" +
" -nowarn:W1[,W2] Disables one or more warnings\n" +
" -out:FNAME Specifies output file\n" +
" -pkg:P1[,Pn] References packages P1..Pn\n" +
" --parse Only parses the source file\n" +
" --expect-error X Expect that error X will be encountered\n" +
" -recurse:SPEC Recursively compiles the files in SPEC ([dir]/file)\n" +
" -reference:ASS References the specified assembly (-r:ASS)\n" +
" --stacktrace Shows stack trace at error location\n" +
" -target:KIND Specifies the target (KIND is one of: exe, winexe,\n" +
" library, module), (short: /t:)\n" +
" --timestamp Displays time stamps of various compiler events\n" +
" -unsafe[+|-] Allows unsafe code\n" +
" -warnaserror[+|-] Treat warnings as errors\n" +
" -warn:LEVEL Sets warning level (the highest is 4, the default is 2)\n" +
" -help2 Show other help flags\n" +
" -v Verbose parsing (for debugging the parser)\n" +
" -2 Enables experimental C# features\n" +
"\n" +
"Resources:\n" +
" -linkresource:FILE[,ID] Links FILE as a resource\n" +
" -resource:FILE[,ID] Embed FILE as a resource\n" +
" -win32res:FILE Specifies Win32 resource file (.res)\n" +
" -win32icon:FILE Use this icon for the output\n" +
" --mcs-debug X Sets MCS debugging level to X\n" +
" @file Read response file for more options\n\n" +
"Options can be of the form -option or /option");
}
@@ -258,7 +243,7 @@ namespace Mono.CSharp
"For more information on Mono, visit the project Web site\n" +
" http://www.go-mono.com\n\n" +
"The compiler was written by Miguel de Icaza, Ravi Pratap, Martin Baulig and Marek Safar");
"The compiler was written by Miguel de Icaza, Ravi Pratap and Martin Baulig");
Environment.Exit (0);
}
@@ -266,7 +251,7 @@ namespace Mono.CSharp
public static int Main (string[] args)
{
RootContext.Version = LanguageVersion.Default;
RootContext.V2 = true;
bool ok = MainDriver (args);
if (ok && Report.Errors == 0) {
@@ -295,15 +280,12 @@ namespace Mono.CSharp
string total_log = "";
try {
char[] path_chars = { '/', '\\' };
char[] path_chars = { '/', '\\', '.' };
if (assembly.IndexOfAny (path_chars) != -1) {
a = Assembly.LoadFrom (assembly);
} else {
string ass = assembly;
if (ass.EndsWith (".dll"))
ass = assembly.Substring (0, assembly.Length - 4);
a = Assembly.Load (ass);
a = Assembly.Load (assembly);
}
TypeManager.AddAssembly (a);
@@ -638,7 +620,7 @@ namespace Mono.CSharp
static void SetupV2 ()
{
RootContext.Version = LanguageVersion.Default;
RootContext.V2 = true;
defines.Add ("__V2__");
}
@@ -994,72 +976,21 @@ namespace Mono.CSharp
resources.Add (value);
return true;
case "/pkg": {
string packages;
if (value == ""){
Usage ();
Environment.Exit (1);
}
packages = String.Join (" ", value.Split (new Char [] { ';', ',', '\n', '\r'}));
ProcessStartInfo pi = new ProcessStartInfo ();
pi.FileName = "pkg-config";
pi.RedirectStandardOutput = true;
pi.UseShellExecute = false;
pi.Arguments = "--libs " + packages;
Process p = null;
try {
p = Process.Start (pi);
} catch (Exception e) {
Report.Error (-27, "Couldn't run pkg-config: " + e.Message);
Environment.Exit (1);
}
if (p.StandardOutput == null){
Report.Warning (-27, "Specified package did not return any information");
return true;
}
string pkgout = p.StandardOutput.ReadToEnd ();
p.WaitForExit ();
if (p.ExitCode != 0) {
Report.Error (-27, "Error running pkg-config. Check the above output.");
Environment.Exit (1);
}
if (pkgout != null){
string [] xargs = pkgout.Trim (new Char [] {' ', '\n', '\r', '\t'}).
Split (new Char [] { ' ', '\t'});
args = AddArgs (args, xargs);
}
p.Close ();
return true;
}
case "/res":
case "/resource":
if (value == ""){
Report.Error (5, "-resource requires an argument");
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
if (embedded_resources == null)
embedded_resources = new ArrayList ();
if (embedded_resources.Contains (value)) {
Report.Error (1508, String.Format ("The resource identifier '{0}' has already been used in this assembly.", value));
}
else if (value.IndexOf (',') != -1 && embedded_resources.Contains (value.Split (',')[1])) {
Report.Error (1508, String.Format ("The resource identifier '{0}' has already been used in this assembly.", value));
}
else {
embedded_resources.Add (value);
}
return true;
case "/recurse":
if (value == ""){
Report.Error (5, "-recurse requires an argument");
Report.Error (5, "/recurse requires an argument");
Environment.Exit (1);
}
CompileFiles (value, true);
@@ -1068,7 +999,7 @@ namespace Mono.CSharp
case "/r":
case "/reference": {
if (value == ""){
Report.Error (5, "-reference requires an argument");
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
@@ -1129,10 +1060,6 @@ namespace Mono.CSharp
link_paths.Add (dir);
return true;
}
case "/debug-":
want_debugging_support = false;
return true;
case "/debug":
case "/debug+":
@@ -1148,14 +1075,6 @@ namespace Mono.CSharp
RootContext.Checked = false;
return true;
case "/clscheck":
case "/clscheck+":
return true;
case "/clscheck-":
RootContext.VerifyClsCompliance = false;
return true;
case "/unsafe":
case "/unsafe+":
RootContext.Unsafe = true;
@@ -1212,11 +1131,6 @@ namespace Mono.CSharp
load_default_config = false;
return true;
case "/help2":
OtherFlags ();
Environment.Exit(0);
return true;
case "/help":
case "/?":
Usage ();
@@ -1244,47 +1158,11 @@ namespace Mono.CSharp
case "/fullpaths":
return true;
case "/keyfile":
if (value == String.Empty) {
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
RootContext.StrongNameKeyFile = value;
return true;
case "/keycontainer":
if (value == String.Empty) {
Report.Error (5, arg + " requires an argument");
Environment.Exit (1);
}
RootContext.StrongNameKeyContainer = value;
return true;
case "/delaysign+":
RootContext.StrongNameDelaySign = true;
return true;
case "/delaysign-":
RootContext.StrongNameDelaySign = false;
return true;
case "/v2":
case "/2":
Console.WriteLine ("The compiler option -2 is obsolete. Please use /langversion instead");
SetupV2 ();
return true;
case "/langversion":
switch (value.ToLower (CultureInfo.InvariantCulture)) {
case "iso-1":
RootContext.Version = LanguageVersion.ISO_1;
return true;
case "default":
SetupV2 ();
return true;
}
Report.Error (1617, "Invalid option '{0}' for /langversion; must be ISO-1 or Default", value);
Environment.Exit (1);
return false;
case "/codepage":
int cp = -1;
@@ -1316,17 +1194,6 @@ namespace Mono.CSharp
return false;
}
static string [] AddArgs (string [] args, string [] extra_args)
{
string [] new_args;
new_args = new string [extra_args.Length + args.Length];
args.CopyTo (new_args, 0);
extra_args.CopyTo (new_args, args.Length);
return new_args;
}
/// <summary>
/// Parses the arguments, and drives the compilation
/// process.
@@ -1342,7 +1209,7 @@ namespace Mono.CSharp
int i;
bool parsing_options = true;
Console.WriteLine ("ALPHA SOFTWARE: Mono C# Compiler {0} for Generics",
Console.WriteLine ("Mono C# Compiler {0} for Generics",
Assembly.GetExecutingAssembly ().GetName ().Version.ToString ());
try {
encoding = Encoding.GetEncoding (28591);
@@ -1365,13 +1232,12 @@ namespace Mono.CSharp
// path.
//
for (i = 0; i < args.Length; i++){
int argc = args.Length;
for (i = 0; i < argc; i++){
string arg = args [i];
if (arg == "")
continue;
if (arg.StartsWith ("@")){
string [] extra_args;
string [] new_args, extra_args;
string response_file = arg.Substring (1);
if (response_file_list == null)
@@ -1393,7 +1259,11 @@ namespace Mono.CSharp
return false;
}
args = AddArgs (args, extra_args);
new_args = new string [extra_args.Length + argc];
args.CopyTo (new_args, 0);
extra_args.CopyTo (new_args, argc);
args = new_args;
argc = new_args.Length;
continue;
}
@@ -1473,7 +1343,6 @@ namespace Mono.CSharp
if (timestamps)
ShowTime ("Loading references");
link_paths.Add (GetSystemDir ());
link_paths.Add (Directory.GetCurrentDirectory ());
LoadReferences ();
if (timestamps)
@@ -1504,8 +1373,7 @@ namespace Mono.CSharp
Environment.Exit (1);
}
MethodInfo set_method = module_only.GetSetMethod (true);
set_method.Invoke (CodeGen.Assembly.Builder, BindingFlags.Default, null, new object[]{true}, null);
module_only.SetValue (CodeGen.Assembly.Builder, true, null);
}
TypeManager.AddModule (CodeGen.Module.Builder);
@@ -1566,15 +1434,6 @@ namespace Mono.CSharp
return false;
}
if (RootContext.VerifyClsCompliance) {
CodeGen.Assembly.ResolveClsCompliance ();
if (CodeGen.Assembly.IsClsCompliant) {
AttributeTester.VerifyModulesClsCompliance ();
TypeManager.LoadAllImportedTypes ();
AttributeTester.VerifyTopLevelNameClsCompliance ();
}
}
//
// The code generator
//
@@ -1610,19 +1469,6 @@ namespace Mono.CSharp
MethodInfo ep = RootContext.EntryPoint;
if (ep == null) {
if (RootContext.MainClass != null) {
object main_cont = RootContext.Tree.Decls [RootContext.MainClass];
if (main_cont == null) {
Report.Error (1555, output_file, "Could not find '{0}' specified for Main method", RootContext.MainClass);
return false;
}
if (!(main_cont is ClassOrStruct)) {
Report.Error (1556, output_file, "'{0}' specified for Main method must be a valid class or struct", RootContext.MainClass);
return false;
}
}
if (Report.Errors == 0)
Report.Error (5001, "Program " + output_file +
" does not have an entry point defined");
@@ -1675,7 +1521,7 @@ namespace Mono.CSharp
margs [1] = spec.Substring (0, cp);
} else {
margs [1] = spec;
margs [0] = Path.GetFileName (spec);
margs [0] = spec.Replace ('/','.').Replace ('\\', '.');
}
if (File.Exists ((string) margs [1]))
@@ -1722,19 +1568,8 @@ namespace Mono.CSharp
Timer.ShowTimers ();
if (Report.ExpectedError != 0){
if (Report.Errors == 0) {
Console.WriteLine ("Failed to report expected error " + Report.ExpectedError + ".\n" +
"No other errors reported.");
Environment.Exit (2);
} else {
Console.WriteLine ("Failed to report expected error " + Report.ExpectedError + ".\n" +
"However, other errors were reported.");
Console.WriteLine("Failed to report expected error " + Report.ExpectedError);
Environment.Exit (1);
}
return false;
}
+321 -733
View File
File diff suppressed because it is too large. Load diff
+49 -179
View File
@@ -13,95 +13,9 @@ using System;
using System.Collections;
using System.Reflection;
using System.Reflection.Emit;
using System.Globalization;
namespace Mono.CSharp {
class EnumMember: MemberCore {
static string[] attribute_targets = new string [] { "field" };
Enum parent_enum;
public FieldBuilder builder;
internal readonly Expression Type;
public EnumMember (Enum parent_enum, Expression expr, string name,
Location loc, Attributes attrs):
base (null, new MemberName (name), attrs, loc)
{
this.parent_enum = parent_enum;
this.ModFlags = parent_enum.ModFlags;
this.Type = expr;
}
public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
{
if (a.Type == TypeManager.marshal_as_attr_type) {
UnmanagedMarshal marshal = a.GetMarshal (this);
if (marshal != null) {
builder.SetMarshal (marshal);
}
return;
}
if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
a.Error_InvalidSecurityParent ();
return;
}
builder.SetCustomAttribute (cb);
}
public override AttributeTargets AttributeTargets {
get {
return AttributeTargets.Field;
}
}
public void DefineMember (TypeBuilder tb)
{
FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
| FieldAttributes.Literal;
builder = tb.DefineField (Name, tb, attr);
}
public override bool Define ()
{
throw new NotImplementedException ();
}
public void Emit (EmitContext ec)
{
if (OptAttributes != null)
OptAttributes.Emit (ec, this);
Emit ();
}
public override string GetSignatureForError()
{
return String.Concat (parent_enum.GetSignatureForError (), '.', base.GetSignatureForError ());
}
public override string[] ValidAttributeTargets {
get {
return attribute_targets;
}
}
protected override bool VerifyClsCompliance(DeclSpace ds)
{
// Because parent is TypeContainer and we have only DeclSpace parent.
// Parameter replacing is required
return base.VerifyClsCompliance (parent_enum);
}
// There is no base type
protected override void VerifyObsoleteAttribute()
{
}
}
/// <summary>
/// Enumeration container
/// </summary>
@@ -113,6 +27,7 @@ namespace Mono.CSharp {
public Type UnderlyingType;
Hashtable member_to_location;
Hashtable member_to_attributes;
//
// This is for members that have been defined
@@ -133,8 +48,8 @@ namespace Mono.CSharp {
Modifiers.INTERNAL |
Modifiers.PRIVATE;
public Enum (NamespaceEntry ns, TypeContainer parent, Expression type,
int mod_flags, MemberName name, Attributes attrs, Location l)
public Enum (NamespaceEntry ns, TypeContainer parent, Expression type, int mod_flags,
string name, Attributes attrs, Location l)
: base (ns, parent, name, attrs, l)
{
this.BaseType = type;
@@ -152,21 +67,28 @@ namespace Mono.CSharp {
/// Adds @name to the enumeration space, with @expr
/// being its definition.
/// </summary>
public void AddEnumMember (string name, Expression expr, Location loc, Attributes opt_attrs)
public AdditionResult AddEnumMember (string name, Expression expr, Location loc,
Attributes opt_attrs)
{
if (defined_names.Contains (name))
return AdditionResult.NameExists;
if (name == "value__") {
Report.Error (76, loc, "An item in an enumeration can't have an identifier `value__'");
return;
return AdditionResult.Error;
}
EnumMember em = new EnumMember (this, expr, name, loc, opt_attrs);
if (!AddToContainer (em, false, name, ""))
return;
DefineName (name, expr);
// TODO: can be almost deleted
ordered_enums.Add (name);
member_to_location.Add (name, loc);
if (member_to_attributes == null)
member_to_attributes = new Hashtable ();
member_to_attributes.Add (name, opt_attrs);
return AdditionResult.Success;
}
//
@@ -210,13 +132,6 @@ namespace Mono.CSharp {
attr |= TypeAttributes.Class | TypeAttributes.Sealed;
if (!(BaseType is TypeLookupExpression)) {
Report.Error (1008, Location,
"Type byte, sbyte, short, ushort, int, uint, " +
"long, or ulong expected (got: `{0}')", BaseType);
return null;
}
UnderlyingType = ResolveType (BaseType, false, Location);
if (UnderlyingType != TypeManager.int32_type &&
@@ -226,9 +141,10 @@ namespace Mono.CSharp {
UnderlyingType != TypeManager.short_type &&
UnderlyingType != TypeManager.ushort_type &&
UnderlyingType != TypeManager.byte_type &&
UnderlyingType != TypeManager.char_type &&
UnderlyingType != TypeManager.sbyte_type) {
Report.Error (1008, Location,
"Type byte, sbyte, short, ushort, int, uint, " +
"Type byte, sbyte, short, char, ushort, int, uint, " +
"long, or ulong expected (got: " +
TypeManager.CSharpName (UnderlyingType) + ")");
return null;
@@ -585,8 +501,10 @@ namespace Mono.CSharp {
}
}
EnumMember em = (EnumMember) defined_names [name];
em.DefineMember (TypeBuilder);
FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
| FieldAttributes.Literal;
FieldBuilder fb = TypeBuilder.DefineField (name, TypeBuilder, attr);
bool fail;
default_value = TypeManager.ChangeType (default_value, UnderlyingType, out fail);
@@ -595,13 +513,18 @@ namespace Mono.CSharp {
return null;
}
em.builder.SetConstant (default_value);
field_builders.Add (em.builder);
fb.SetConstant (default_value);
field_builders.Add (fb);
member_to_value [name] = default_value;
if (!TypeManager.RegisterFieldValue (em.builder, default_value))
if (!TypeManager.RegisterFieldValue (fb, default_value))
return null;
//
// Now apply attributes
//
Attribute.ApplyAttributes (ec, fb, fb, (Attributes) member_to_attributes [name]);
return default_value;
}
@@ -610,19 +533,24 @@ namespace Mono.CSharp {
return true;
}
public override bool Define ()
public override bool Define (TypeContainer parent)
{
//
// If there was an error during DefineEnum, return
//
if (TypeBuilder == null)
return false;
EmitContext ec = new EmitContext (this, this, Location, null,
UnderlyingType, ModFlags, false);
ec = new EmitContext (this, this, Location, null, UnderlyingType, ModFlags, false);
object default_value = 0;
FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
| FieldAttributes.Literal;
foreach (string name in ordered_enums) {
//
// Have we already been defined, thanks to some cross-referencing ?
@@ -643,10 +571,8 @@ namespace Mono.CSharp {
return false;
}
EnumMember em = (EnumMember) defined_names [name];
em.DefineMember (TypeBuilder);
FieldBuilder fb = em.builder;
FieldBuilder fb = TypeBuilder.DefineField (
name, TypeBuilder, attr);
if (default_value == null) {
Report.Error (543, loc, "Enumerator value for '" + name + "' is too large to " +
@@ -667,66 +593,21 @@ namespace Mono.CSharp {
if (!TypeManager.RegisterFieldValue (fb, default_value))
return false;
//
// Apply attributes on the enum member
//
Attribute.ApplyAttributes (ec, fb, fb, (Attributes) member_to_attributes [name]);
}
default_value = GetNextDefaultValue (default_value);
}
return true;
}
public override void Emit ()
{
if (OptAttributes != null) {
OptAttributes.Emit (ec, this);
}
foreach (EnumMember em in defined_names.Values) {
em.Emit (ec);
}
base.Emit ();
}
void VerifyClsName ()
{
Hashtable ht = new Hashtable ();
foreach (string name in ordered_enums) {
string locase = name.ToLower (System.Globalization.CultureInfo.InvariantCulture);
if (!ht.Contains (locase)) {
ht.Add (locase, defined_names [name]);
continue;
}
MemberCore conflict = (MemberCore)ht [locase];
Report.SymbolRelatedToPreviousError (conflict);
conflict = GetDefinition (name);
Report.Error (3005, conflict.Location, "Identifier '{0}' differing only in case is not CLS-compliant", conflict.GetSignatureForError ());
}
}
protected override bool VerifyClsCompliance (DeclSpace ds)
{
if (!base.VerifyClsCompliance (ds))
return false;
VerifyClsName ();
if (!AttributeTester.IsClsCompliant (UnderlyingType)) {
Report.Error (3009, Location, "'{0}': base type '{1}' is not CLS-compliant", GetSignatureForError (), TypeManager.CSharpName (UnderlyingType));
}
Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes);
return true;
}
/// <summary>
/// Returns full enum name.
/// </summary>
string GetEnumeratorName (string valueName)
{
return String.Concat (Name, ".", valueName);
}
//
// IMemberFinder
//
@@ -765,19 +646,8 @@ namespace Mono.CSharp {
// indexer
public Expression this [string name] {
get {
return ((EnumMember) defined_names [name]).Type;
return (Expression) defined_names [name];
}
}
public override AttributeTargets AttributeTargets {
get {
return AttributeTargets.Enum;
}
}
protected override void VerifyObsoleteAttribute()
{
// UnderlyingType is never obsolete
}
}
}
+1130 -1834
View File
File diff suppressed because it is too large. Load diff
+64 -243
View File
@@ -79,7 +79,7 @@ namespace Mono.CSharp
public sealed class Reachability
{
FlowReturns returns, breaks, throws, barrier;
FlowReturns returns, breaks, throws, barrier, reachable;
public FlowReturns Returns {
get { return returns; }
@@ -93,6 +93,10 @@ namespace Mono.CSharp
public FlowReturns Barrier {
get { return barrier; }
}
public FlowReturns Reachable {
get { return reachable; }
}
public Reachability (FlowReturns returns, FlowReturns breaks,
FlowReturns throws, FlowReturns barrier)
{
@@ -100,11 +104,15 @@ namespace Mono.CSharp
this.breaks = breaks;
this.throws = throws;
this.barrier = barrier;
update ();
}
public Reachability Clone ()
{
return new Reachability (returns, breaks, throws, barrier);
Reachability cloned = new Reachability (returns, breaks, throws, barrier);
cloned.reachable = reachable;
return cloned;
}
// <summary>
@@ -223,12 +231,7 @@ namespace Mono.CSharp
a.throws = AndFlowReturns (a.throws, b.throws);
a.barrier = AndFlowReturns (a.barrier, b.barrier);
if (a_unreachable && b_unreachable)
a.barrier = FlowReturns.Always;
else if (a_unreachable || b_unreachable)
a.barrier = FlowReturns.Sometimes;
else
a.barrier = FlowReturns.Never;
a.reachable = AndFlowReturns (a.reachable, b.reachable);
}
public void Or (Reachability b)
@@ -237,6 +240,8 @@ namespace Mono.CSharp
breaks = OrFlowReturns (breaks, b.breaks);
throws = OrFlowReturns (throws, b.throws);
barrier = OrFlowReturns (barrier, b.barrier);
update ();
}
public static Reachability Never ()
@@ -246,21 +251,16 @@ namespace Mono.CSharp
FlowReturns.Never, FlowReturns.Never);
}
public FlowReturns Reachable {
get {
if ((returns == FlowReturns.Always) ||
(breaks == FlowReturns.Always) ||
(throws == FlowReturns.Always) ||
(barrier == FlowReturns.Always))
return FlowReturns.Never;
else if ((returns == FlowReturns.Never) &&
(breaks == FlowReturns.Never) &&
(throws == FlowReturns.Never) &&
(barrier == FlowReturns.Never))
return FlowReturns.Always;
void update ()
{
if ((returns == FlowReturns.Always) || (breaks == FlowReturns.Always) ||
(throws == FlowReturns.Always) || (barrier == FlowReturns.Always))
reachable = FlowReturns.Never;
else if ((returns == FlowReturns.Never) && (breaks == FlowReturns.Never) &&
(throws == FlowReturns.Never) && (barrier == FlowReturns.Never))
reachable = FlowReturns.Always;
else
return FlowReturns.Sometimes;
}
reachable = FlowReturns.Sometimes;
}
public bool AlwaysBreaks {
@@ -296,47 +296,43 @@ namespace Mono.CSharp
}
public bool IsUnreachable {
get { return Reachable == FlowReturns.Never; }
get { return reachable == FlowReturns.Never; }
}
public void SetReturns ()
{
returns = FlowReturns.Always;
update ();
}
public void SetReturnsSometimes ()
{
returns = FlowReturns.Sometimes;
update ();
}
public void SetBreaks ()
{
breaks = FlowReturns.Always;
update ();
}
public void ResetBreaks ()
{
breaks = FlowReturns.Never;
update ();
}
public void SetThrows ()
{
throws = FlowReturns.Always;
}
public void SetThrowsSometimes ()
{
throws = FlowReturns.Sometimes;
update ();
}
public void SetBarrier ()
{
barrier = FlowReturns.Always;
}
public void ResetBarrier ()
{
barrier = FlowReturns.Never;
update ();
}
static string ShortName (FlowReturns returns)
@@ -356,7 +352,7 @@ namespace Mono.CSharp
return String.Format ("[{0}:{1}:{2}:{3}:{4}]",
ShortName (returns), ShortName (breaks),
ShortName (throws), ShortName (barrier),
ShortName (Reachable));
ShortName (reachable));
}
}
@@ -364,7 +360,7 @@ namespace Mono.CSharp
{
switch (type) {
case BranchingType.Exception:
throw new InvalidOperationException ();
return new FlowBranchingException (parent, block, loc);
case BranchingType.Switch:
return new FlowBranchingBlock (parent, type, SiblingType.SwitchSection, block, loc);
@@ -375,9 +371,6 @@ namespace Mono.CSharp
case BranchingType.Block:
return new FlowBranchingBlock (parent, type, SiblingType.Block, block, loc);
case BranchingType.Loop:
return new FlowBranchingLoop (parent, block, loc);
default:
return new FlowBranchingBlock (parent, type, SiblingType.Conditional, block, loc);
}
@@ -432,11 +425,6 @@ namespace Mono.CSharp
// </summary>
public readonly Location Location;
// <summary>
// This is only valid for SwitchSection, Try, Catch and Finally.
// </summary>
public readonly Block Block;
// <summary>
// If this is true, then the usage vector has been modified and must be
// merged when we're done with this branching.
@@ -477,12 +465,9 @@ namespace Mono.CSharp
//
// Normally, you should not use any of these constructors.
//
public UsageVector (SiblingType type, UsageVector parent,
Block block, Location loc,
int num_params, int num_locals)
public UsageVector (SiblingType type, UsageVector parent, Location loc, int num_params, int num_locals)
{
this.Type = type;
this.Block = block;
this.Location = loc;
this.InheritsFrom = parent;
this.CountParameters = num_params;
@@ -509,19 +494,15 @@ namespace Mono.CSharp
id = ++next_id;
}
public UsageVector (SiblingType type, UsageVector parent,
Block block, Location loc)
: this (type, parent, block, loc,
parent.CountParameters, parent.CountLocals)
public UsageVector (SiblingType type, UsageVector parent, Location loc)
: this (type, parent, loc, parent.CountParameters, parent.CountLocals)
{ }
public UsageVector (MyBitVector parameters, MyBitVector locals,
Reachability reachability, Block block,
Location loc)
Reachability reachability, Location loc)
{
this.Type = SiblingType.Block;
this.Location = loc;
this.Block = block;
this.reachability = reachability;
this.parameters = parameters;
@@ -535,9 +516,7 @@ namespace Mono.CSharp
// </summary>
public UsageVector Clone ()
{
UsageVector retval = new UsageVector (
Type, null, Block, Location,
CountParameters, CountLocals);
UsageVector retval = new UsageVector (Type, null, Location, CountParameters, CountLocals);
if (retval.locals != null)
retval.locals = locals.Clone ();
@@ -552,7 +531,7 @@ namespace Mono.CSharp
public bool IsAssigned (VariableInfo var)
{
if (!var.IsParameter && Reachability.IsUnreachable)
if (!var.IsParameter && Reachability.AlwaysBreaks)
return true;
return var.IsAssigned (var.IsParameter ? parameters : locals);
@@ -560,7 +539,7 @@ namespace Mono.CSharp
public void SetAssigned (VariableInfo var)
{
if (!var.IsParameter && Reachability.IsUnreachable)
if (!var.IsParameter && Reachability.AlwaysBreaks)
return;
IsDirty = true;
@@ -569,7 +548,7 @@ namespace Mono.CSharp
public bool IsFieldAssigned (VariableInfo var, string name)
{
if (!var.IsParameter && Reachability.IsUnreachable)
if (!var.IsParameter && Reachability.AlwaysBreaks)
return true;
return var.IsFieldAssigned (var.IsParameter ? parameters : locals, name);
@@ -577,7 +556,7 @@ namespace Mono.CSharp
public void SetFieldAssigned (VariableInfo var, string name)
{
if (!var.IsParameter && Reachability.IsUnreachable)
if (!var.IsParameter && Reachability.AlwaysBreaks)
return;
IsDirty = true;
@@ -629,7 +608,7 @@ namespace Mono.CSharp
{
UsageVector result = branching.Merge ();
Report.Debug (2, " MERGING CHILD", this, branching, IsDirty,
Report.Debug (2, " MERGING CHILD", this, IsDirty,
result.ParameterVector, result.LocalVector,
result.Reachability, reachability, Type);
@@ -655,17 +634,9 @@ namespace Mono.CSharp
// We're either finite or we may leave the loop.
new_r.SetReturnsSometimes ();
}
if (new_r.Throws == FlowReturns.Always) {
// We're either finite or we may leave the loop.
new_r.SetThrowsSometimes ();
}
}
} else if (branching.Type == BranchingType.Switch) {
if (new_r.MayBreak || new_r.MayReturn)
new_r.ResetBarrier ();
} else if (branching.Type == BranchingType.Switch)
new_r.ResetBreaks ();
}
//
// We've now either reached the point after the branching or we will
@@ -743,21 +714,18 @@ namespace Mono.CSharp
// 8 Console.WriteLine (a);
//
// </summary>
public void MergeJumpOrigins (UsageVector o_vectors)
public void MergeJumpOrigins (ICollection origin_vectors)
{
Report.Debug (1, " MERGING JUMP ORIGINS", this);
reachability = Reachability.Never ();
if (o_vectors == null) {
reachability.SetBarrier ();
if (origin_vectors == null)
return;
}
bool first = true;
for (UsageVector vector = o_vectors; vector != null;
vector = vector.Next) {
foreach (UsageVector vector in origin_vectors) {
Report.Debug (1, " MERGING JUMP ORIGIN", vector);
if (first) {
@@ -802,37 +770,6 @@ namespace Mono.CSharp
Report.Debug (1, " MERGING FINALLY ORIGIN DONE", this);
}
public void MergeBreakOrigins (UsageVector o_vectors)
{
Report.Debug (1, " MERGING BREAK ORIGINS", this);
if (o_vectors == null)
return;
bool first = true;
for (UsageVector vector = o_vectors; vector != null;
vector = vector.Next) {
Report.Debug (1, " MERGING BREAK ORIGIN", vector);
if (first) {
if (locals != null && vector.Locals != null)
locals.Or (vector.locals);
if (parameters != null)
parameters.Or (vector.parameters);
first = false;
} else {
if (locals != null && vector.Locals != null)
locals.And (vector.locals);
if (parameters != null)
parameters.And (vector.parameters);
}
}
Report.Debug (1, " MERGING BREAK ORIGINS DONE", this);
}
public void CheckOutParameters (FlowBranching branching)
{
if (parameters != null)
@@ -956,14 +893,13 @@ namespace Mono.CSharp
local_map = Block.LocalMap;
UsageVector parent_vector = parent != null ? parent.CurrentUsageVector : null;
vector = new UsageVector (
stype, parent_vector, Block, loc,
param_map.Length, local_map.Length);
vector = new UsageVector (stype, parent_vector, loc, param_map.Length, local_map.Length);
} else {
param_map = Parent.param_map;
local_map = Parent.local_map;
vector = new UsageVector (
stype, Parent.CurrentUsageVector, null, loc);
vector = new UsageVector (stype, Parent.CurrentUsageVector, loc);
}
AddSibling (vector);
@@ -976,34 +912,16 @@ namespace Mono.CSharp
// <summary>
// Creates a sibling of the current usage vector.
// </summary>
public virtual void CreateSibling (Block block, SiblingType type)
public virtual void CreateSibling (SiblingType type)
{
UsageVector vector = new UsageVector (
type, Parent.CurrentUsageVector, block, Location);
AddSibling (vector);
AddSibling (new UsageVector (type, Parent.CurrentUsageVector, Location));
Report.Debug (1, " CREATED SIBLING", CurrentUsageVector);
}
public void CreateSibling ()
{
CreateSibling (null, SiblingType.Conditional);
}
protected abstract void AddSibling (UsageVector uv);
public virtual LabeledStatement LookupLabel (string name, Location loc)
{
if (Parent != null)
return Parent.LookupLabel (name, loc);
Report.Error (
159, loc,
"No such label `" + name + "' in this scope");
return null;
}
public abstract void Label (UsageVector origin_vectors);
public abstract void Label (ArrayList origin_vectors);
// <summary>
// Check whether all `out' parameters have been assigned.
@@ -1021,7 +939,7 @@ namespace Mono.CSharp
Report.Error (177, loc, "The out parameter `" +
var.Name + "' must be " +
"assigned before control leaves the current method.");
"assigned before control leave the current method.");
}
}
@@ -1112,8 +1030,7 @@ namespace Mono.CSharp
Report.Debug (2, " MERGING SIBLINGS DONE", parameters, locals,
reachability, Infinite);
return new UsageVector (
parameters, locals, reachability, null, Location);
return new UsageVector (parameters, locals, reachability, Location);
}
protected abstract UsageVector Merge ();
@@ -1135,15 +1052,13 @@ namespace Mono.CSharp
throw new NotSupportedException ();
UsageVector vector = new UsageVector (
SiblingType.Conditional, null, Block, Location,
param_map.Length, local_map.Length);
SiblingType.Conditional, null, Location, param_map.Length, local_map.Length);
UsageVector result = vector.MergeChild (this);
Report.Debug (4, "MERGE TOP BLOCK", Location, vector, result.Reachability);
if ((vector.Reachability.Throws != FlowReturns.Always) &&
(vector.Reachability.Barrier != FlowReturns.Always))
if (vector.Reachability.Throws != FlowReturns.Always)
CheckOutParameters (vector.Parameters, Location);
return result.Reachability;
@@ -1228,20 +1143,6 @@ namespace Mono.CSharp
throw new NotSupportedException ();
}
public virtual void AddBreakVector (UsageVector vector)
{
if (Parent != null)
Parent.AddBreakVector (vector);
else if ((Block == null) || !Block.IsDestructor)
throw new NotSupportedException ();
}
public virtual void StealFinallyClauses (ref ArrayList list)
{
if (Parent != null)
Parent.StealFinallyClauses (ref list);
}
public bool IsAssigned (VariableInfo vi)
{
return CurrentUsageVector.IsAssigned (vi);
@@ -1315,24 +1216,12 @@ namespace Mono.CSharp
sibling_list = sibling;
}
public override LabeledStatement LookupLabel (string name, Location loc)
{
if (Block == null)
return base.LookupLabel (name, loc);
LabeledStatement s = Block.LookupLabel (name);
if (s != null)
return s;
return base.LookupLabel (name, loc);
}
public override void Label (UsageVector origin_vectors)
public override void Label (ArrayList origin_vectors)
{
if (!CurrentUsageVector.Reachability.IsUnreachable) {
UsageVector vector = CurrentUsageVector.Clone ();
vector.Next = origin_vectors;
origin_vectors = vector;
if (origin_vectors == null)
origin_vectors = new ArrayList (1);
origin_vectors.Add (CurrentUsageVector.Clone ());
}
CurrentUsageVector.MergeJumpOrigins (origin_vectors);
@@ -1344,49 +1233,17 @@ namespace Mono.CSharp
}
}
public class FlowBranchingLoop : FlowBranchingBlock
{
UsageVector break_origins;
public FlowBranchingLoop (FlowBranching parent, Block block, Location loc)
: base (parent, BranchingType.Loop, SiblingType.Conditional, block, loc)
{ }
public override void AddBreakVector (UsageVector vector)
{
vector = vector.Clone ();
vector.Next = break_origins;
break_origins = vector;
}
protected override UsageVector Merge ()
{
UsageVector vector = base.Merge ();
vector.MergeBreakOrigins (break_origins);
return vector;
}
}
public class FlowBranchingException : FlowBranching
{
ExceptionStatement stmt;
UsageVector current_vector;
UsageVector catch_vectors;
UsageVector finally_vector;
UsageVector finally_origins;
bool emit_finally;
bool in_try;
public FlowBranchingException (FlowBranching parent,
ExceptionStatement stmt)
: base (parent, BranchingType.Exception, SiblingType.Try,
null, stmt.loc)
{
this.stmt = stmt;
this.emit_finally = true;
}
public FlowBranchingException (FlowBranching parent, Block block, Location loc)
: base (parent, BranchingType.Exception, SiblingType.Try, block, loc)
{ }
protected override void AddSibling (UsageVector sibling)
{
@@ -1439,39 +1296,7 @@ namespace Mono.CSharp
finally_origins = vector;
}
public override void StealFinallyClauses (ref ArrayList list)
{
if (list == null)
list = new ArrayList ();
list.Add (stmt);
emit_finally = false;
base.StealFinallyClauses (ref list);
}
public bool EmitFinally {
get { return emit_finally; }
}
public override LabeledStatement LookupLabel (string name, Location loc)
{
if (current_vector.Block == null)
return base.LookupLabel (name, loc);
LabeledStatement s = current_vector.Block.LookupLabel (name);
if (s != null)
return s;
if (finally_vector != null) {
Report.Error (
157, loc, "Control can not leave the body " +
"of the finally block");
return null;
}
return base.LookupLabel (name, loc);
}
public override void Label (UsageVector origin_vectors)
public override void Label (ArrayList origin_vectors)
{
CurrentUsageVector.MergeJumpOrigins (origin_vectors);
}
@@ -1698,10 +1523,6 @@ namespace Mono.CSharp
Fields = new FieldInfo [Count];
public_fields.CopyTo (Fields, 0);
non_public_fields.CopyTo (Fields, CountPublic);
} else if (type is GenericTypeParameterBuilder) {
CountPublic = CountNonPublic = Count = 0;
Fields = new FieldInfo [0];
} else {
FieldInfo[] public_fields = type.GetFields (
BindingFlags.Instance|BindingFlags.Public);
+256 -909
View File
File diff suppressed because it is too large. Load diff
+59
View File
@@ -0,0 +1,59 @@
//
// GenericParser.cs: The Base Parser for the Mono compilers
//
// Author: A Rafael D Teixeira ([email protected])
//
// Licensed under the terms of the GNU GPL
//
// Copyright (C) 2001 Ximian, Inc.
//
using System;
using System.Text;
namespace Mono.Languages
{
using System.Collections;
/// <summary>
/// Base class to support multiple Jay generated parsers
/// </summary>
public abstract class GenericParser
{
// Name of the file we are parsing
public string name;
// Input stream to parse from.
public System.IO.Stream input;
public virtual string[] extensions()
{
string [] list = { ".cs" };
return list;
}
public GenericParser()
{
//
// DO NOTHING: Derived classes should do their iniatilization here duties
//
}
protected bool yacc_verbose_flag = false;
public bool yacc_verbose
{
set
{
yacc_verbose_flag = value;
}
get
{
return yacc_verbose_flag;
}
}
}
}
-14
View File
@@ -1,14 +0,0 @@
<configuration>
<startup>
<supportedRuntime version="v2.0.40607"/>
</startup>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="compilerLogListener" type="System.Diagnostics.TextWriterTraceListener,System"
initializeData="mcs.log" />
<remove type="System.Diagnostics.DefaultTraceListener,System"/>
</listeners>
</trace>
</system.diagnostics>
</configuration>
+1231
View File
File diff suppressed because it is too large. Load diff
+481 -759
View File
File diff suppressed because it is too large. Load diff
+1 -28
View File
@@ -22,18 +22,6 @@ using System;
using System.Reflection;
using System.Reflection.Emit;
//
// I put System.Null just so we do not have to special case it on
// TypeManager.CSharpName
//
namespace System {
//
// Represents the Null Type, just used as a placeholder for the type in NullLiteral
//
public class Null {
}
}
namespace Mono.CSharp {
public class NullLiteral : Constant {
@@ -61,7 +49,7 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
type = typeof (System.Null);
type = TypeManager.object_type;
return this;
}
@@ -69,16 +57,6 @@ namespace Mono.CSharp {
{
ec.ig.Emit (OpCodes.Ldnull);
}
public override bool IsNegative {
get {
return false;
}
}
public override bool IsZeroInteger {
get { return true; }
}
}
//
@@ -92,11 +70,6 @@ namespace Mono.CSharp {
Null = new NullPointer ();
}
private NullPointer ()
{
type = TypeManager.object_type;
}
public override void Emit (EmitContext ec)
{
ILGenerator ig = ec.ig;
+16 -22
View File
@@ -10,7 +10,7 @@
using System;
using System.IO;
using System.Collections;
using Mono.CompilerServices.SymbolWriter;
using System.Diagnostics.SymbolStore;
namespace Mono.CSharp {
/// <summary>
@@ -20,11 +20,11 @@ namespace Mono.CSharp {
/// This is intentionally a class and not a struct since we need
/// to pass this by reference.
/// </remarks>
public sealed class SourceFile : ISourceFile {
public sealed class SourceFile {
public readonly string Name;
public readonly string Path;
public readonly int Index;
public SourceFileEntry SourceFileEntry;
public ISymbolDocumentWriter SymbolDocument;
public bool HasLineDirective;
public SourceFile (string name, string path, int index)
@@ -33,16 +33,6 @@ namespace Mono.CSharp {
this.Name = name;
this.Path = path;
}
SourceFileEntry ISourceFile.Entry {
get { return SourceFileEntry; }
}
public override string ToString ()
{
return String.Format ("SourceFile ({0}:{1}:{2}:{3})",
Name, Path, Index, SourceFileEntry);
}
}
/// <summary>
@@ -84,8 +74,10 @@ namespace Mono.CSharp {
string path = Path.GetFullPath (name);
if (source_files.Contains (path)){
Report.Warning (2002, name, "Source file '{0}' specified multiple times");
return;
Report.Error (
1516,
"Source file `" + name + "' specified multiple times");
Environment.Exit (1);
}
source_files.Add (path, ++source_count);
@@ -128,7 +120,7 @@ namespace Mono.CSharp {
// </remarks>
static public SourceFile LookupFile (string name)
{
string path = name == "" ? "" : Path.GetFullPath (name);
string path = Path.GetFullPath (name);
if (!source_files.Contains (path)) {
if (source_count >= (1 << source_bits))
@@ -150,14 +142,15 @@ namespace Mono.CSharp {
}
// <remarks>
// If we're compiling with debugging support, this is called between parsing
// and code generation to register all the source files with the
// symbol writer.
// If we're compiling with debugging support, this is called between parsing and
// code generation to register all the source files with the symbol writer. //
// </remarks>
static public void DefineSymbolDocuments (SymbolWriter symwriter)
{
foreach (SourceFile file in source_list) {
file.SourceFileEntry = symwriter.DefineDocument (file.Path);
if (file.HasLineDirective)
continue;
file.SymbolDocument = symwriter.DefineDocument (file.Path);
}
}
@@ -220,12 +213,13 @@ namespace Mono.CSharp {
// to the location's source file.
//
// If we don't have a symbol writer, this property is always null.
public SourceFile SourceFile {
public ISymbolDocumentWriter SymbolDocument {
get {
int index = token & source_mask;
if (index == 0)
return null;
return (SourceFile) source_list [index - 1];
SourceFile file = (SourceFile) source_list [index - 1];
return file.SymbolDocument;
}
}
}
-3
View File
@@ -1,7 +1,4 @@
<configuration>
<startup>
<supportedRuntime version="v1.1.4322"/>
</startup>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
+2 -4
View File
@@ -69,8 +69,6 @@ namespace Mono.CSharp {
s = "extern"; break;
case Modifiers.VOLATILE:
s = "volatile"; break;
case Modifiers.UNSAFE:
s = "unsafe"; break;
}
return s;
@@ -113,7 +111,7 @@ namespace Mono.CSharp {
// If we do not have static constructors, static methods
// can be invoked without initializing the type.
if (!caller.UserDefinedStaticConstructor &&
(caller.Kind != Kind.Interface))
!(caller is Interface))
t |= TypeAttributes.BeforeFieldInit;
return t;
@@ -200,7 +198,7 @@ namespace Mono.CSharp {
if ((mod & Modifiers.UNSAFE) != 0){
if (!RootContext.Unsafe){
Report.Error (227, l,
"Unsafe code requires the -unsafe command " +
"Unsafe code requires the --unsafe command " +
"line option to be specified");
}
}
+54 -100
View File
@@ -14,7 +14,7 @@ namespace Mono.CSharp {
/// <summary>
/// Keeps track of the namespaces defined in the C# code.
/// </summary>
public class Namespace : IAlias {
public class Namespace {
static ArrayList all_namespaces = new ArrayList ();
static Hashtable namespaces_map = new Hashtable ();
@@ -88,9 +88,9 @@ namespace Mono.CSharp {
return Root.GetNamespace (name, create);
}
public IAlias Lookup (DeclSpace ds, string name, Location loc)
public object Lookup (DeclSpace ds, string name)
{
IAlias o = Lookup (name);
object o = Lookup (name);
Type t;
DeclSpace tdecl = o as DeclSpace;
@@ -98,7 +98,7 @@ namespace Mono.CSharp {
t = tdecl.DefineType ();
if ((ds == null) || ds.CheckAccessLevel (t))
return new TypeExpression (t, loc);
return t;
}
Namespace ns = GetNamespace (name, false);
@@ -109,7 +109,7 @@ namespace Mono.CSharp {
if ((t == null) || ((ds != null) && !ds.CheckAccessLevel (t)))
return null;
return new TypeExpression (t, loc);
return t;
}
public void AddNamespaceEntry (NamespaceEntry entry)
@@ -117,14 +117,14 @@ namespace Mono.CSharp {
entries.Add (entry);
}
public void DefineName (string name, IAlias o)
public void DefineName (string name, object o)
{
defined_names.Add (name, o);
}
public IAlias Lookup (string name)
public object Lookup (string name)
{
return (IAlias) defined_names [name];
return defined_names [name];
}
static public ArrayList UserDefinedNamespaces {
@@ -179,16 +179,6 @@ namespace Mono.CSharp {
else
return String.Format ("Namespace ({0})", Name);
}
bool IAlias.IsType {
get { return false; }
}
TypeExpr IAlias.Type {
get {
throw new InvalidOperationException ();
}
}
}
public class NamespaceEntry
@@ -241,11 +231,11 @@ namespace Mono.CSharp {
public class AliasEntry {
public readonly string Name;
public readonly MemberName Alias;
public readonly Expression Alias;
public readonly NamespaceEntry NamespaceEntry;
public readonly Location Location;
public AliasEntry (NamespaceEntry entry, string name, MemberName alias, Location loc)
public AliasEntry (NamespaceEntry entry, string name, Expression alias, Location loc)
{
Name = name;
Alias = alias;
@@ -253,43 +243,28 @@ namespace Mono.CSharp {
Location = loc;
}
IAlias resolved;
object resolved;
public IAlias Resolve ()
public object Resolve ()
{
if (resolved != null)
return resolved;
NamespaceEntry curr_ns = NamespaceEntry;
//
// GENERICS: Cope with the expression and not with the string
// this will fail with `using A = Stack<int>'
//
string alias = Alias.GetTypeName ();
// According to section 16.3.1, the namespace-or-type-name is resolved
// as if the immediately containing namespace body has no using-directives.
resolved = NamespaceEntry.Lookup (
null, alias, Alias.CountTypeArguments, true, Location);
NamespaceEntry curr_ns = NamespaceEntry.Parent;
string alias = Alias.ToString ();
while ((curr_ns != null) && (resolved == null)) {
resolved = curr_ns.Lookup (
null, alias, Alias.CountTypeArguments,
false, Location);
resolved = curr_ns.Lookup (null, alias, Location);
if (resolved == null)
curr_ns = curr_ns.Parent;
}
if (resolved == null)
return null;
if (resolved.IsType)
resolved = new TypeAliasExpression (
resolved.Type, Alias.TypeArguments, Location);
return resolved;
}
}
@@ -344,7 +319,7 @@ namespace Mono.CSharp {
}
}
public void DefineName (string name, IAlias o)
public void DefineName (string name, object o)
{
ns.DefineName (name, o);
}
@@ -365,11 +340,11 @@ namespace Mono.CSharp {
if (using_clauses == null)
using_clauses = new ArrayList ();
foreach (UsingEntry old_entry in using_clauses) {
if (old_entry.Name == ns) {
if (RootContext.WarningLevel >= 3)
Report.Warning (105, loc, "The using directive for '{0}' appeared previously in this namespace", ns);
return;
foreach (UsingEntry old_entry in using_clauses){
if (old_entry.Name == ns){
Report.Warning (105, loc, "The using directive for '" + ns +
"' appeared previously in this namespace");
return;
}
}
@@ -377,23 +352,18 @@ namespace Mono.CSharp {
using_clauses.Add (ue);
}
public void UsingAlias (string name, MemberName alias, Location loc)
public void UsingAlias (string alias, Expression namespace_or_type, Location loc)
{
if (DeclarationFound){
Report.Error (1529, loc, "A using clause must precede all other namespace elements");
return;
}
if (aliases == null)
aliases = new Hashtable ();
if (aliases.Contains (name)){
Report.Error (1537, loc, "The using alias `" + name +
if (aliases.Contains (alias)){
Report.Error (1537, loc, "The using alias `" + alias +
"' appeared previously in this namespace");
return;
}
aliases [name] = new AliasEntry (this, name, alias, loc);
aliases [alias] = new AliasEntry (this, alias, namespace_or_type, loc);
}
protected AliasEntry GetAliasEntry (string alias)
@@ -408,20 +378,25 @@ namespace Mono.CSharp {
return entry;
}
public IAlias LookupAlias (string alias)
public string LookupAlias (string alias)
{
AliasEntry entry = GetAliasEntry (alias);
if (entry == null)
return null;
return entry.Resolve ();
object resolved = entry.Resolve ();
if (resolved == null)
return null;
else if (resolved is Namespace)
return ((Namespace) resolved).Name;
else
return ((Type) resolved).FullName;
}
public IAlias Lookup (DeclSpace ds, string name, int num_type_params,
bool ignore_using, Location loc)
public object Lookup (DeclSpace ds, string name, Location loc)
{
IAlias o;
object o;
Namespace ns;
//
@@ -432,55 +407,47 @@ namespace Mono.CSharp {
string first = name.Substring (0, pos);
string last = name.Substring (pos + 1);
o = Lookup (ds, first, 0, ignore_using, loc);
o = Lookup (ds, first, loc);
if (o == null)
return null;
ns = o as Namespace;
if (ns != null) {
o = ns.Lookup (ds, last, loc);
return o;
}
if (ns != null)
return ns.Lookup (ds, last);
Type nested = TypeManager.LookupType (o.Name + "." + last);
Type nested = TypeManager.LookupType ((((Type) o).Name + "." + last));
if ((nested == null) || ((ds != null) && !ds.CheckAccessLevel (nested)))
return null;
return new TypeExpression (nested, loc);
return nested;
}
//
// Check whether it's a namespace.
//
o = NS.Lookup (ds, name, loc);
o = NS.Lookup (ds, name);
if (o != null)
return o;
if (ignore_using)
return null;
//
// Check aliases.
//
AliasEntry entry = GetAliasEntry (name);
if (entry != null) {
IAlias alias = entry.Resolve ();
if (alias != null)
return alias;
o = entry.Resolve ();
if (o != null)
return o;
}
if (name.IndexOf ('.') > 0)
return null;
//
// Check using entries.
//
IAlias t = null, match = null;
Type t = null, match = null;
foreach (Namespace using_ns in GetUsingTable ()) {
match = using_ns.Lookup (ds, name, loc);
if ((match != null) && match.IsType){
match = using_ns.Lookup (ds, name) as Type;
if (match != null){
if (t != null) {
DeclSpace.Error_AmbiguousTypeReference (loc, name, t.Name, match.Name);
DeclSpace.Error_AmbiguousTypeReference (loc, name, t, match);
return null;
} else {
t = match;
@@ -533,11 +500,7 @@ namespace Mono.CSharp {
}
int parent_id = parent != null ? parent.symfile_id : 0;
if (file.SourceFileEntry == null)
return;
symfile_id = symwriter.DefineNamespace (
ns.Name, file.SourceFileEntry, using_list, parent_id);
symfile_id = symwriter.DefineNamespace (ns.Name, file, using_list, parent_id);
}
public int SymbolFileID {
@@ -602,10 +565,6 @@ namespace Mono.CSharp {
/// </summary>
public void VerifyUsing ()
{
TypeContainer dummy = new RootTypes ();
EmitContext ec = new EmitContext (
dummy, Location.Null, null, null, 0, false);
if (using_clauses != null){
foreach (UsingEntry ue in using_clauses){
if (ue.Resolve () != null)
@@ -617,17 +576,12 @@ namespace Mono.CSharp {
if (aliases != null){
foreach (DictionaryEntry de in aliases){
AliasEntry entry = (AliasEntry) de.Value;
IAlias alias = entry.Resolve ();
if (alias != null) {
if (alias.IsType)
alias.Type.ResolveType (ec);
AliasEntry alias = (AliasEntry) de.Value;
if (alias.Resolve () != null)
continue;
}
error246 (entry.Location, entry.Alias.GetPartialName ());
error246 (alias.Location, alias.Alias.ToString ());
}
}
}
+74 -285
View File
@@ -16,116 +16,11 @@ using System.Collections;
namespace Mono.CSharp {
/// <summary>
/// Abstract Base class for parameters of a method.
/// </summary>
public abstract class ParameterBase : Attributable {
protected ParameterBuilder builder;
public ParameterBase (Attributes attrs)
: base (attrs)
{
}
public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
if (a.Type == TypeManager.marshal_as_attr_type) {
UnmanagedMarshal marshal = a.GetMarshal (this);
if (marshal != null) {
builder.SetMarshal (marshal);
}
return;
}
if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
a.Error_InvalidSecurityParent ();
return;
}
builder.SetCustomAttribute (cb);
}
public override bool IsClsCompliaceRequired(DeclSpace ds)
{
return false;
}
}
/// <summary>
/// Class for applying custom attributes on the return type
/// </summary>
public class ReturnParameter: ParameterBase {
public ReturnParameter (MethodBuilder mb, Location location):
base (null)
{
try {
builder = mb.DefineParameter (0, ParameterAttributes.None, "");
}
catch (ArgumentOutOfRangeException) {
Report.Warning (-28, location, "The Microsoft .NET Runtime 1.x does not permit setting custom attributes on the return type");
}
}
public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
{
// This occurs after Warning -28
if (builder == null)
return;
base.ApplyAttributeBuilder (a, cb);
}
public override AttributeTargets AttributeTargets {
get {
return AttributeTargets.ReturnValue;
}
}
/// <summary>
/// Is never called
/// </summary>
public override string[] ValidAttributeTargets {
get {
return null;
}
}
}
/// <summary>
/// Class for applying custom attributes on the implicit parameter type
/// of the 'set' method in properties, and the 'add' and 'remove' methods in events.
/// </summary>
public class ImplicitParameter: ParameterBase {
public ImplicitParameter (MethodBuilder mb):
base (null)
{
builder = mb.DefineParameter (1, ParameterAttributes.None, "");
}
public override AttributeTargets AttributeTargets {
get {
return AttributeTargets.Parameter;
}
}
/// <summary>
/// Is never called
/// </summary>
public override string[] ValidAttributeTargets {
get {
return null;
}
}
}
/// <summary>
/// Represents a single method parameter
/// </summary>
//TODO: Add location member to this or base class for better error location and all methods simplification.
public class Parameter : ParameterBase {
public class Parameter {
[Flags]
public enum Modifier : byte {
NONE = 0,
@@ -133,69 +28,35 @@ namespace Mono.CSharp {
OUT = 2,
PARAMS = 4,
// This is a flag which says that it's either REF or OUT.
ISBYREF = 8,
ARGLIST = 16
ISBYREF = 8
}
static string[] attribute_targets = new string [] { "param" };
public Expression TypeName;
public readonly Expression TypeName;
public readonly Modifier ModFlags;
public Attributes OptAttributes;
public readonly string Name;
GenericConstraints constraints;
Type parameter_type;
public Parameter (Expression type, string name, Modifier mod, Attributes attrs)
: base (attrs)
{
Name = name;
ModFlags = mod;
TypeName = type;
}
public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
if (a.Type == TypeManager.param_array_type) {
Report.Error (674, a.Location, "Do not use 'System.ParamArrayAttribute'. Use the 'params' keyword instead");
return;
}
base.ApplyAttributeBuilder (a, cb);
OptAttributes = attrs;
}
// <summary>
// Resolve is used in method definitions
// </summary>
public bool Resolve (EmitContext ec, Location l)
public bool Resolve (DeclSpace ds, Location l)
{
TypeExpr texpr = TypeName.ResolveAsTypeTerminal (ec, false);
if (texpr == null)
return false;
TypeParameterExpr tparam = texpr as TypeParameterExpr;
if (tparam != null)
constraints = tparam.TypeParameter.Constraints;
parameter_type = texpr.ResolveType (ec);
if (parameter_type.IsAbstract && parameter_type.IsSealed) {
Report.Error (721, l, "'{0}': static types cannot be used as parameters", GetSignatureForError ());
return false;
}
parameter_type = ds.ResolveType (TypeName, false, l);
if (parameter_type == TypeManager.void_type){
Report.Error (1536, l, "`void' parameter is not permitted");
return false;
}
if ((ModFlags & Parameter.Modifier.ISBYREF) != 0){
if (parameter_type == TypeManager.typed_reference_type ||
parameter_type == TypeManager.arg_iterator_type){
Report.Error (1601, l,
"out or ref parameter can not be of type TypedReference or ArgIterator");
return false;
}
}
return parameter_type != null;
}
@@ -212,12 +73,6 @@ namespace Mono.CSharp {
return parameter_type;
}
}
public GenericConstraints GenericConstraints {
get {
return constraints;
}
}
public ParameterAttributes Attributes {
get {
@@ -237,71 +92,19 @@ namespace Mono.CSharp {
}
}
public override AttributeTargets AttributeTargets {
get {
return AttributeTargets.Parameter;
}
}
/// <summary>
/// Returns the signature for this parameter evaluating it on the
/// @tc context
/// </summary>
public string GetSignature (EmitContext ec, Location loc)
public string GetSignature (DeclSpace ds, Location loc)
{
if (parameter_type == null){
if (!Resolve (ec, loc))
if (!Resolve (ds, loc))
return null;
}
return ExternalType ().FullName;
}
public string GetSignatureForError ()
{
string typeName;
if (parameter_type != null)
typeName = TypeManager.CSharpName (parameter_type);
else if (TypeName.Type != null)
typeName = TypeManager.CSharpName (TypeName.Type);
else
typeName = TypeName.ToString ();
switch (ModFlags & unchecked (~Modifier.ISBYREF)) {
case Modifier.OUT:
return "out " + typeName;
case Modifier.PARAMS:
return "params " + typeName;
case Modifier.REF:
return "ref " + typeName;
}
return typeName;
}
public void DefineParameter (EmitContext ec, MethodBuilder mb, ConstructorBuilder cb, int index, Location loc)
{
ParameterAttributes par_attr = Attributes;
if (mb == null)
builder = cb.DefineParameter (index, par_attr, Name);
else
builder = mb.DefineParameter (index, par_attr, Name);
if (OptAttributes != null) {
OptAttributes.Emit (ec, this);
if (par_attr == ParameterAttributes.Out){
if (OptAttributes.Contains (TypeManager.in_attribute_type, ec))
Report.Error (36, loc, "Can not use [In] attribute on out parameter");
}
}
}
public override string[] ValidAttributeTargets {
get {
return attribute_targets;
}
}
}
/// <summary>
@@ -310,7 +113,6 @@ namespace Mono.CSharp {
public class Parameters {
public Parameter [] FixedParameters;
public readonly Parameter ArrayParameter;
public readonly bool HasArglist;
string signature;
Type [] types;
Location loc;
@@ -324,13 +126,6 @@ namespace Mono.CSharp {
loc = l;
}
public Parameters (Parameter [] fixed_parameters, bool has_arglist, Location l)
{
FixedParameters = fixed_parameters;
HasArglist = has_arglist;
loc = l;
}
/// <summary>
/// This is used to reuse a set of empty parameters, because they
/// are common
@@ -350,14 +145,14 @@ namespace Mono.CSharp {
}
}
public void ComputeSignature (EmitContext ec)
public void ComputeSignature (DeclSpace ds)
{
signature = "";
if (FixedParameters != null){
for (int i = 0; i < FixedParameters.Length; i++){
Parameter par = FixedParameters [i];
signature += par.GetSignature (ec, loc);
signature += par.GetSignature (ds, loc);
}
}
//
@@ -382,9 +177,9 @@ namespace Mono.CSharp {
count = FixedParameters.Length;
string array_par_name = ArrayParameter != null ? ArrayParameter.Name : null;
for (i = 0; i < count; i++){
string base_name = FixedParameters [i].Name;
for (j = i + 1; j < count; j++){
if (base_name != FixedParameters [j].Name)
continue;
@@ -402,13 +197,13 @@ namespace Mono.CSharp {
/// <summary>
/// Returns the signature of the Parameters evaluated in
/// the @ec EmitContext
/// the @tc environment
/// </summary>
public string GetSignature (EmitContext ec)
public string GetSignature (DeclSpace ds)
{
if (signature == null){
VerifyArgs ();
ComputeSignature (ec);
ComputeSignature (ds);
}
return signature;
@@ -442,14 +237,7 @@ namespace Mono.CSharp {
return null;
}
public Parameter GetParameterByName (string name)
{
int idx;
return GetParameterByName (name, out idx);
}
bool ComputeParameterTypes (EmitContext ec)
bool ComputeParameterTypes (DeclSpace ds)
{
int extra = (ArrayParameter != null) ? 1 : 0;
int i = 0;
@@ -472,7 +260,7 @@ namespace Mono.CSharp {
foreach (Parameter p in FixedParameters){
Type t = null;
if (p.Resolve (ec, loc))
if (p.Resolve (ds, loc))
t = p.ExternalType ();
else
failed = true;
@@ -483,7 +271,7 @@ namespace Mono.CSharp {
}
if (extra > 0){
if (ArrayParameter.Resolve (ec, loc))
if (ArrayParameter.Resolve (ds, loc))
types [i] = ArrayParameter.ExternalType ();
else
failed = true;
@@ -501,13 +289,55 @@ namespace Mono.CSharp {
// This variant is used by Delegates, because they need to
// resolve/define names, instead of the plain LookupType
//
public bool ComputeAndDefineParameterTypes (EmitContext ec)
public bool ComputeAndDefineParameterTypes (DeclSpace ds)
{
bool old_type_resolving = ec.ResolvingTypeTree;
ec.ResolvingTypeTree = true;
bool retval = ComputeParameterTypes (ec);
ec.ResolvingTypeTree = old_type_resolving;
return retval;
int extra = (ArrayParameter != null) ? 1 : 0;
int i = 0;
int pc;
if (FixedParameters == null)
pc = extra;
else
pc = extra + FixedParameters.Length;
types = new Type [pc];
if (!VerifyArgs ()){
FixedParameters = null;
return false;
}
bool ok_flag = true;
if (FixedParameters != null){
foreach (Parameter p in FixedParameters){
Type t = null;
if (p.Resolve (ds, loc))
t = p.ExternalType ();
else
ok_flag = false;
types [i] = t;
i++;
}
}
if (extra > 0){
if (ArrayParameter.Resolve (ds, loc))
types [i] = ArrayParameter.ExternalType ();
else
ok_flag = false;
}
//
// invalidate the cached types
//
if (!ok_flag){
types = null;
}
return ok_flag;
}
/// <summary>
@@ -515,7 +345,7 @@ namespace Mono.CSharp {
/// </summary>
static Type [] no_types = new Type [0];
public Type [] GetParameterInfo (EmitContext ec)
public Type [] GetParameterInfo (DeclSpace ds)
{
if (types != null)
return types;
@@ -523,7 +353,7 @@ namespace Mono.CSharp {
if (FixedParameters == null && ArrayParameter == null)
return no_types;
if (ComputeParameterTypes (ec) == false){
if (ComputeParameterTypes (ds) == false){
types = null;
return null;
}
@@ -538,7 +368,7 @@ namespace Mono.CSharp {
/// Note that the returned type will not contain any dereference in this
/// case (ie, you get "int" for a ref int instead of "int&"
/// </summary>
public Type GetParameterInfo (EmitContext ec, int idx, out Parameter.Modifier mod)
public Type GetParameterInfo (DeclSpace ds, int idx, out Parameter.Modifier mod)
{
mod = Parameter.Modifier.NONE;
@@ -551,7 +381,7 @@ namespace Mono.CSharp {
return null;
if (types == null)
if (ComputeParameterTypes (ec) == false)
if (ComputeParameterTypes (ds) == false)
return null;
//
@@ -575,52 +405,11 @@ namespace Mono.CSharp {
public CallingConventions GetCallingConvention ()
{
if (HasArglist)
return CallingConventions.VarArgs;
else
// For now this is the only correc thing to do
return CallingConventions.Standard;
}
//
// The method's attributes are passed in because we need to extract
// the "return:" attribute from there to apply on the return type
//
public void LabelParameters (EmitContext ec,
MethodBase builder,
Location loc) {
//
// Define each type attribute (in/out/ref) and
// the argument names.
//
int i = 0;
MethodBuilder mb = builder as MethodBuilder;
ConstructorBuilder cb = builder as ConstructorBuilder;
if (FixedParameters != null) {
for (i = 0; i < FixedParameters.Length; i++) {
FixedParameters [i].DefineParameter (ec, mb, cb, i + 1, loc);
}
}
if (ArrayParameter != null){
ParameterBuilder pb;
Parameter array_param = ArrayParameter;
if (mb == null)
pb = cb.DefineParameter (
i + 1, array_param.Attributes,
array_param.Name);
else
pb = mb.DefineParameter (
i + 1, array_param.Attributes,
array_param.Name);
CustomAttributeBuilder a = new CustomAttributeBuilder (
TypeManager.cons_param_array_attribute, new object [0]);
pb.SetCustomAttribute (a);
}
}
}
}
+8 -6
View File
@@ -150,7 +150,7 @@ namespace Mono.CSharp {
Type t = missing.Type;
if (t is TypeBuilder){
TypeContainer iface;
Interface iface;
iface = TypeManager.LookupInterface (t);
@@ -229,7 +229,7 @@ namespace Mono.CSharp {
//
// Completely broken. So we do it ourselves!
//
Type [] impl = TypeManager.GetExplicitInterfaces (type_builder);
TypeExpr [] impl = TypeManager.GetExplicitInterfaces (type_builder);
if (impl == null || impl.Length == 0)
return EmptyMissingInterfacesInfo;
@@ -237,7 +237,7 @@ namespace Mono.CSharp {
MissingInterfacesInfo [] ret = new MissingInterfacesInfo [impl.Length];
for (int i = 0; i < impl.Length; i++)
ret [i] = new MissingInterfacesInfo (impl [i]);
ret [i] = new MissingInterfacesInfo (impl [i].Type);
// we really should not get here because Object doesnt implement any
// interfaces. But it could implement something internal, so we have
@@ -245,9 +245,11 @@ namespace Mono.CSharp {
if (type_builder.BaseType == null)
return ret;
Type [] parent_impls = TypeManager.GetInterfaces (type_builder.BaseType);
TypeExpr [] parent_impls = TypeManager.GetInterfaces (type_builder.BaseType);
foreach (Type t in parent_impls) {
foreach (TypeExpr te in parent_impls) {
Type t = te.Type;
for (int i = 0; i < ret.Length; i ++) {
if (t == ret [i].Type) {
ret [i].Optional = true;
@@ -396,7 +398,7 @@ namespace Mono.CSharp {
int j, top = args.Length;
bool fail = false;
for (j = 0; j < top; j++){
if (!TypeManager.IsEqual (tm.args [i][j], args[j])){
fail = true;
+152 -376
View File
@@ -12,7 +12,6 @@
using System;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Reflection;
@@ -59,152 +58,15 @@ namespace Mono.CSharp {
// Keeps track of the warnings that we are ignoring
//
static Hashtable warning_ignore_table;
static Hashtable warning_regions_table;
/// <summary>
/// List of symbols related to reported error/warning. You have to fill it before error/warning is reported.
/// </summary>
static StringCollection related_symbols = new StringCollection ();
abstract class AbstractMessage {
static void Check (int code)
{
if (code == expected_error) {
Environment.Exit (0);
}
}
public abstract bool IsWarning { get; }
public abstract string MessageType { get; }
public virtual void Print (int code, string location, string text)
{
if (code < 0)
code = 8000-code;
StringBuilder msg = new StringBuilder ();
if (location.Length != 0) {
msg.Append (location);
msg.Append (' ');
}
msg.AppendFormat ("{0} CS{1:0000}: {2}", MessageType, code, text);
Console.WriteLine (msg.ToString ());
foreach (string s in related_symbols) {
Console.WriteLine (String.Concat (s, MessageType, ')'));
}
related_symbols.Clear ();
if (Stacktrace)
Console.WriteLine (FriendlyStackTrace (new StackTrace (true)));
if (Fatal) {
if (!IsWarning || WarningsAreErrors)
throw new Exception (text);
}
Check (code);
}
public virtual void Print (int code, Location location, string text)
{
if (location.Equals (Location.Null)) {
Print (code, "", text);
return;
}
Print (code, String.Format ("{0}({1})", location.Name, location.Row), text);
}
}
sealed class WarningMessage: AbstractMessage {
Location loc = Location.Null;
readonly int Level;
public WarningMessage ():
this (-1) {}
public WarningMessage (int level)
{
Level = level;
}
public override bool IsWarning {
get { return true; }
}
bool IsEnabled (int code)
{
if (RootContext.WarningLevel < Level)
return false;
if (warning_ignore_table != null) {
if (warning_ignore_table.Contains (code)) {
return false;
}
}
if (warning_regions_table == null || loc.Equals (Location.Null))
return true;
WarningRegions regions = (WarningRegions)warning_regions_table [loc.Name];
return regions.IsWarningEnabled (code, loc.Row);
}
public override void Print(int code, string location, string text)
{
if (!IsEnabled (code)) {
related_symbols.Clear ();
return;
}
if (WarningsAreErrors) {
new ErrorMessage ().Print (code, location, text);
return;
}
Warnings++;
base.Print (code, location, text);
}
public override void Print(int code, Location location, string text)
{
loc = location;
base.Print (code, location, text);
}
public override string MessageType {
get {
return "warning";
}
}
}
sealed class ErrorMessage: AbstractMessage {
public override void Print(int code, string location, string text)
{
Errors++;
base.Print (code, location, text);
}
public override bool IsWarning {
get { return false; }
}
public override string MessageType {
get {
return "error";
}
}
}
public static void FeatureIsNotStandardized (Location loc, string feature)
static void Check (int code)
{
Report.Error (1644, loc, "Feature '{0}' cannot be used because it is not part of the standardized ISO C# language specification", feature);
if (code == expected_error){
if (Fatal)
throw new Exception ();
Environment.Exit (0);
}
}
public static string FriendlyStackTrace (Exception e)
@@ -247,127 +109,119 @@ namespace Mono.CSharp {
return sb.ToString ();
}
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// IF YOU ADD A NEW WARNING YOU HAVE TO DUPLICATE ITS ID HERE
public static bool IsValidWarning (int code)
static public void RealError (string msg)
{
int[] all_warnings = new int[] { 28, 67, 78, 105, 108, 109, 114, 192, 168, 169, 183, 184, 219, 251, 612, 618, 626, 628, 642, 649,
659, 660, 661, 672, 1030, 1522, 1616, 1691, 1692, 1901, 2002, 2023, 3012, 3019, 8024, 8028
};
foreach (int i in all_warnings) {
if (i == code)
return true;
Errors++;
Console.WriteLine (msg);
if (Stacktrace)
Console.WriteLine (FriendlyStackTrace (new StackTrace (true)));
if (Fatal)
throw new Exception (msg);
}
static public void Error (int code, Location l, string text)
{
if (code < 0)
code = 8000-code;
string msg = String.Format (
"{0}({1}) error CS{2:0000}: {3}", l.Name, l.Row, code, text);
// "{0}({1}) error CS{2}: {3}", l.Name, l.Row, code, text);
RealError (msg);
Check (code);
}
static public void Warning (int code, Location l, string text)
{
if (code < 0)
code = 8000-code;
if (warning_ignore_table != null){
if (warning_ignore_table.Contains (code))
return;
}
if (WarningsAreErrors)
Error (code, l, text);
else {
string row;
if (Location.IsNull (l))
row = "";
else
row = l.Row.ToString ();
Console.WriteLine (String.Format (
"{0}({1}) warning CS{2:0000}: {3}",
// "{0}({1}) warning CS{2}: {3}",
l.Name, row, code, text));
Warnings++;
Check (code);
if (Stacktrace)
Console.WriteLine (new StackTrace ().ToString ());
}
return false;
}
static public void LocationOfPreviousError (Location loc)
{
Console.WriteLine (String.Format ("{0}({1}) (Location of symbol related to previous error)", loc.Name, loc.Row));
}
static public void RuntimeMissingSupport (Location loc, string feature)
{
Report.Error (-88, loc, "Your .NET Runtime does not support '{0}'. Please use the latest Mono runtime instead.", feature);
}
/// <summary>
/// In most error cases is very useful to have information about symbol that caused the error.
/// Call this method before you call Report.Error when it makes sense.
/// </summary>
static public void SymbolRelatedToPreviousError (Location loc, string symbol)
{
SymbolRelatedToPreviousError (String.Format ("{0}({1})", loc.Name, loc.Row), symbol);
}
static public void SymbolRelatedToPreviousError (MemberInfo mi)
{
TypeContainer temp_ds = TypeManager.LookupGenericTypeContainer (mi.DeclaringType);
if (temp_ds == null) {
SymbolRelatedToPreviousError (mi.DeclaringType.Assembly.Location, TypeManager.GetFullNameSignature (mi));
} else {
MethodBase mb = mi as MethodBase;
if (mb != null) {
while (mb.Mono_IsInflatedMethod)
mb = mb.GetGenericMethodDefinition ();
IMethodData md = TypeManager.GetMethod (mb);
SymbolRelatedToPreviousError (md.Location, md.GetSignatureForError (temp_ds));
return;
}
string name = String.Concat (temp_ds.Name, ".", mi.Name);
MemberCore mc = temp_ds.GetDefinition (name);
SymbolRelatedToPreviousError (mc);
}
}
static public void SymbolRelatedToPreviousError (MemberCore mc)
{
SymbolRelatedToPreviousError (mc.Location, mc.GetSignatureForError ());
}
static public void SymbolRelatedToPreviousError (Type type)
{
DeclSpace temp_ds = TypeManager.LookupDeclSpace (type);
if (temp_ds == null)
SymbolRelatedToPreviousError (type.Assembly.Location, TypeManager.CSharpName (type));
else
SymbolRelatedToPreviousError (temp_ds.Location, TypeManager.CSharpName (type));
}
static void SymbolRelatedToPreviousError (string loc, string symbol)
{
related_symbols.Add (String.Format ("{0}: '{1}' (name of symbol related to previous ", loc, symbol));
}
public static WarningRegions RegisterWarningRegion (Location location)
{
if (warning_regions_table == null)
warning_regions_table = new Hashtable ();
WarningRegions regions = (WarningRegions)warning_regions_table [location.Name];
if (regions == null) {
regions = new WarningRegions ();
warning_regions_table.Add (location.Name, regions);
}
return regions;
}
static public void Warning (int code, int level, Location loc, string format, params object[] args)
{
WarningMessage w = new WarningMessage (level);
w.Print (code, loc, String.Format (format, args));
}
static public void Warning (int code, Location loc, string format, params object[] args)
{
WarningMessage w = new WarningMessage ();
w.Print (code, loc, String.Format (format, args));
}
static public void Warning (int code, string format, params object[] args)
{
Warning (code, Location.Null, String.Format (format, args));
}
/// <summary>
/// Did you test your WarningLevel, that you use this method
/// </summary>
static public void Warning (int code, string text)
{
Warning (code, Location.Null, text);
}
static public void Error (int code, string format, params object[] args)
static public void Warning (int code, int level, string text)
{
Error (code, Location.Null, String.Format (format, args));
if (RootContext.WarningLevel >= level)
Warning (code, Location.Null, text);
}
static public void Warning (int code, int level, Location l, string text)
{
if (RootContext.WarningLevel >= level)
Warning (code, l, text);
}
static public void Error (int code, string text)
{
if (code < 0)
code = 8000-code;
string msg = String.Format ("error CS{0:0000}: {1}", code, text);
// string msg = String.Format ("error CS{0}: {1}", code, text);
RealError (msg);
Check (code);
}
static public void Error (int code, Location loc, string format, params object[] args)
{
ErrorMessage e = new ErrorMessage ();
e.Print (code, loc, String.Format (format, args));
Error (code, loc, String.Format (format, args));
}
static public void Error (int code, string format, params object[] args)
{
Error (code, String.Format (format, args));
}
static public void Warning (int code, Location loc, string format, params object[] args)
{
Warning (code, loc, String.Format (format, args));
}
static public void Warning (int code, string format, params object[] args)
{
Warning (code, String.Format (format, args));
}
static public void Message (Message m)
{
if (m is ErrorMessage)
Error (m.code, m.text);
else
Warning (m.code, m.text);
}
static public void SetIgnoreWarning (int code)
@@ -378,14 +232,14 @@ namespace Mono.CSharp {
warning_ignore_table [code] = true;
}
static public int ExpectedError {
set {
expected_error = value;
}
get {
return expected_error;
}
}
static public int ExpectedError {
set {
expected_error = value;
}
get {
return expected_error;
}
}
public static int DebugFlags = 0;
@@ -416,6 +270,8 @@ namespace Mono.CSharp {
sb.Append ("null");
else if (arg is ICollection)
sb.Append (PrintCollection ((ICollection) arg));
else if (arg is IntPtr)
sb.Append (String.Format ("IntPtr(0x{0:x})", ((IntPtr) arg).ToInt32 ()));
else
sb.Append (arg);
}
@@ -445,6 +301,38 @@ namespace Mono.CSharp {
}
}
public class Message {
public int code;
public string text;
public Message (int code, string text)
{
this.code = code;
this.text = text;
}
}
public class WarningMessage : Message {
public WarningMessage (int code, string text) : base (code, text)
{
}
}
public class ErrorMessage : Message {
public ErrorMessage (int code, string text) : base (code, text)
{
}
//
// For compatibility reasons with old code.
//
public static void report_error (string error)
{
Console.Write ("ERROR: ");
Console.WriteLine (error);
}
}
public enum TimerType {
FindMembers = 0,
TcFindMembers = 1,
@@ -541,121 +429,9 @@ namespace Mono.CSharp {
: base (message)
{
}
}
/// <summary>
/// Handles #pragma warning
/// </summary>
public class WarningRegions {
abstract class PragmaCmd
{
public int Line;
protected PragmaCmd (int line)
{
Line = line;
}
public abstract bool IsEnabled (int code, bool previous);
}
class Disable: PragmaCmd
{
int code;
public Disable (int line, int code)
: base (line)
{
this.code = code;
}
public override bool IsEnabled (int code, bool previous)
{
return this.code == code ? false : previous;
}
}
class DisableAll: PragmaCmd
{
public DisableAll (int line)
: base (line) {}
public override bool IsEnabled(int code, bool previous)
{
return false;
}
}
class Enable: PragmaCmd
{
int code;
public Enable (int line, int code)
: base (line)
{
this.code = code;
}
public override bool IsEnabled(int code, bool previous)
{
return this.code == code ? true : previous;
}
}
class EnableAll: PragmaCmd
{
public EnableAll (int line)
: base (line) {}
public override bool IsEnabled(int code, bool previous)
{
return true;
}
}
ArrayList regions = new ArrayList ();
public void WarningDisable (int line)
{
regions.Add (new DisableAll (line));
}
public void WarningDisable (Location location, int code)
{
if (CheckWarningCode (code, location))
regions.Add (new Disable (location.Row, code));
}
public void WarningEnable (int line)
{
regions.Add (new EnableAll (line));
}
public void WarningEnable (Location location, int code)
{
if (CheckWarningCode (code, location))
regions.Add (new Enable (location.Row, code));
}
public bool IsWarningEnabled (int code, int src_line)
{
bool result = true;
foreach (PragmaCmd pragma in regions) {
if (src_line < pragma.Line)
break;
result = pragma.IsEnabled (code, result);
}
return result;
}
bool CheckWarningCode (int code, Location loc)
{
if (Report.IsValidWarning (code))
return true;
Report.Warning (1691, 1, loc, "'{0}' is not a valid warning number", code);
return false;
}
public InternalErrorException (string format, params object[] args)
: this (String.Format (format, args))
{ }
}
}
+93 -87
View File
@@ -16,12 +16,6 @@ using System.Diagnostics;
namespace Mono.CSharp {
public enum LanguageVersion
{
Default = 0,
ISO_1 = 1
}
public class RootContext {
//
@@ -52,6 +46,7 @@ namespace Mono.CSharp {
// override).
//
static ArrayList type_container_resolve_order;
static ArrayList interface_resolve_order;
static ArrayList attribute_types;
//
@@ -67,24 +62,17 @@ namespace Mono.CSharp {
public static Target Target = Target.Exe;
public static string TargetExt = ".exe";
public static bool VerifyClsCompliance = true;
public static LanguageVersion Version = LanguageVersion.Default;
//
// We keep strongname related info here because
// it's also used as complier options from CSC 8.x
// If set, enable C# version 2 features
//
public static string StrongNameKeyFile;
public static string StrongNameKeyContainer;
public static bool StrongNameDelaySign = false;
public static bool V2 = true;
//
// Constructor
//
static RootContext ()
{
tree = new Tree ();
interface_resolve_order = new ArrayList ();
type_container_resolve_order = new ArrayList ();
}
@@ -102,6 +90,11 @@ namespace Mono.CSharp {
static public string MainClass;
public static void RegisterOrder (Interface iface)
{
interface_resolve_order.Add (iface);
}
public static void RegisterOrder (TypeContainer tc)
{
type_container_resolve_order.Add (tc);
@@ -269,7 +262,7 @@ namespace Mono.CSharp {
object o = root.GetDefinition (name);
if (o == null){
Report.Error (518, "The predefined type `" + name + "' is not defined");
Environment.Exit (1);
Environment.Exit (0);
}
if (!(o is Delegate)){
@@ -306,13 +299,7 @@ namespace Mono.CSharp {
"System.Runtime.Serialization.ISerializable",
"System.Reflection.IReflect",
"System.Reflection.ICustomAttributeProvider",
//
// Generic types
//
"System.Collections.Generic.IEnumerator`1",
"System.Collections.Generic.IEnumerable`1"
"System.Reflection.ICustomAttributeProvider"
};
foreach (string iname in interfaces_first_stage)
@@ -342,11 +329,8 @@ namespace Mono.CSharp {
"System.Char", "System.Boolean",
"System.Decimal", "System.Void",
"System.RuntimeFieldHandle",
"System.RuntimeArgumentHandle",
"System.RuntimeTypeHandle",
"System.IntPtr",
"System.TypedReference",
"System.ArgIterator"
"System.IntPtr"
};
foreach (string cname in structs_second_stage)
@@ -359,7 +343,6 @@ namespace Mono.CSharp {
"System.Reflection.MemberInfo",
"System.Type",
"System.Exception",
"System.Activator",
//
// These are not really important in the order, but they
@@ -373,21 +356,14 @@ namespace Mono.CSharp {
"System.Runtime.InteropServices.DllImportAttribute",
"System.Runtime.CompilerServices.MethodImplAttribute",
"System.Runtime.InteropServices.MarshalAsAttribute",
"System.Runtime.CompilerServices.NewConstraintAttribute",
"System.Diagnostics.ConditionalAttribute",
"System.ObsoleteAttribute",
"System.ParamArrayAttribute",
"System.CLSCompliantAttribute",
"System.Security.UnverifiableCodeAttribute",
"System.Security.Permissions.SecurityAttribute",
"System.Runtime.CompilerServices.IndexerNameAttribute",
"System.Runtime.InteropServices.InAttribute",
"System.Runtime.InteropServices.StructLayoutAttribute",
"System.Runtime.InteropServices.FieldOffsetAttribute",
"System.InvalidOperationException",
"System.NotSupportedException",
"System.MarshalByRefObject",
"System.Security.CodeAccessPermission"
"System.InvalidOperationException"
};
// We must store them here before calling BootstrapCorlib_ResolveDelegate.
@@ -425,6 +401,9 @@ namespace Mono.CSharp {
foreach (TypeContainer tc in attribute_types)
tc.CloseType ();
foreach (Interface iface in interface_resolve_order)
iface.CloseType ();
//
// We do this in two passes, first we close the structs,
// then the classes, because it seems the code needs it this
@@ -432,13 +411,13 @@ namespace Mono.CSharp {
// make sure that we define the structs in order as well.
//
foreach (TypeContainer tc in type_container_resolve_order){
if (tc.Kind == Kind.Struct && tc.Parent == tree.Types){
if (tc is Struct && tc.Parent == tree.Types){
tc.CloseType ();
}
}
foreach (TypeContainer tc in type_container_resolve_order){
if (!(tc.Kind == Kind.Struct && tc.Parent == tree.Types))
if (!(tc is Struct && tc.Parent == tree.Types))
tc.CloseType ();
}
@@ -456,9 +435,10 @@ namespace Mono.CSharp {
}
attribute_types = null;
interface_resolve_order = null;
type_container_resolve_order = null;
helper_classes = null;
//tree = null;
tree = null;
TypeManager.CleanUp ();
}
@@ -488,29 +468,33 @@ namespace Mono.CSharp {
return ns.Substring (0, i);
}
static TypeExpr NamespaceLookup (DeclSpace ds, string name,
int num_type_args, Location loc)
static Type NamespaceLookup (DeclSpace ds, string name,
int num_type_args, Location loc)
{
//
// Try in the current namespace and all its implicit parents
//
for (NamespaceEntry ns = ds.NamespaceEntry; ns != null; ns = ns.ImplicitParent) {
IAlias result = ns.Lookup (ds, name, num_type_args, false, loc);
object result = ns.Lookup (ds, name, loc);
if (result == null)
continue;
if (!result.IsType)
return null;
Type t = result as Type;
if (t != null) {
if (TypeManager.CheckGeneric (t, num_type_args))
return t;
else
continue;
}
return result.Type;
return null;
}
return null;
}
static public TypeExpr LookupType (DeclSpace ds, string name, bool silent,
Location loc)
static public Type LookupType (DeclSpace ds, string name, bool silent,
Location loc)
{
return LookupType (ds, name, silent, 0, loc);
}
@@ -523,13 +507,13 @@ namespace Mono.CSharp {
//
// Come to think of it, this should be a DeclSpace
//
static public TypeExpr LookupType (DeclSpace ds, string name, bool silent,
int num_type_params, Location loc)
static public Type LookupType (DeclSpace ds, string name, bool silent,
int num_type_params, Location loc)
{
TypeExpr t;
Type t;
if (ds.Cache.Contains (name)){
t = (TypeExpr) ds.Cache [name];
t = (Type) ds.Cache [name];
if (t != null)
return t;
} else {
@@ -545,10 +529,8 @@ namespace Mono.CSharp {
//
// nested class
//
Type type = TypeManager.LookupType (current_type.FullName + "." + name);
if (type != null){
type = ds.ResolveNestedType (type, loc);
t = new TypeExpression (type, loc);
t = TypeManager.LookupType (current_type.FullName + "." + name);
if (t != null){
ds.Cache [name] = t;
return t;
}
@@ -576,11 +558,25 @@ namespace Mono.CSharp {
// This is the silent version of LookupType, you can use this
// to `probe' for a type
// </summary>
static public TypeExpr LookupType (TypeContainer tc, string name, Location loc)
static public Type LookupType (TypeContainer tc, string name, Location loc)
{
return LookupType (tc, name, true, loc);
}
static public bool IsNamespace (string name)
{
Namespace ns;
if (tree.Namespaces != null){
ns = (Namespace) tree.Namespaces [name];
if (ns != null)
return true;
}
return false;
}
static void Report1530 (Location loc)
{
Report.Error (1530, loc, "Keyword new not allowed for namespace elements");
@@ -591,7 +587,7 @@ namespace Mono.CSharp {
DeclSpace ds = (DeclSpace) root.GetDefinition (name);
ds.DefineMembers (root);
ds.Define ();
ds.Define (root);
}
static public void BootCorlib_PopulateCoreTypes ()
@@ -616,6 +612,15 @@ namespace Mono.CSharp {
if (attribute_types != null)
foreach (TypeContainer tc in attribute_types)
tc.DefineMembers (root);
if (interface_resolve_order != null){
foreach (Interface iface in interface_resolve_order)
if ((iface.ModFlags & Modifiers.NEW) == 0)
iface.DefineMembers (root);
else
Report1530 (iface.Location);
}
if (type_container_resolve_order != null){
if (RootContext.StdLib){
@@ -652,15 +657,6 @@ namespace Mono.CSharp {
else
Report1530 (en.Location);
}
//
// Check for cycles in the struct layout
//
if (type_container_resolve_order != null){
Hashtable seen = new Hashtable ();
foreach (TypeContainer tc in type_container_resolve_order)
TypeManager.CheckStructCycles (tc, seen);
}
}
//
@@ -682,7 +678,14 @@ namespace Mono.CSharp {
if (attribute_types != null)
foreach (TypeContainer tc in attribute_types)
tc.Define ();
tc.Define (root);
if (interface_resolve_order != null){
foreach (Interface iface in interface_resolve_order)
if ((iface.ModFlags & Modifiers.NEW) == 0)
iface.Define (root);
}
if (type_container_resolve_order != null){
foreach (TypeContainer tc in type_container_resolve_order) {
@@ -695,7 +698,7 @@ namespace Mono.CSharp {
continue;
if ((tc.ModFlags & Modifiers.NEW) == 0)
tc.Define ();
tc.Define (root);
}
}
@@ -703,40 +706,43 @@ namespace Mono.CSharp {
if (delegates != null){
foreach (Delegate d in delegates)
if ((d.ModFlags & Modifiers.NEW) == 0)
d.Define ();
d.Define (root);
}
ArrayList enums = root.Enums;
if (enums != null){
foreach (Enum en in enums)
if ((en.ModFlags & Modifiers.NEW) == 0)
en.Define ();
en.Define (root);
}
}
static public void EmitCode ()
{
//
// Because of the strange way in which we do things, global
// attributes must be processed first.
//
CodeGen.Assembly.Emit ();
CodeGen.Module.Emit ();
if (attribute_types != null)
foreach (TypeContainer tc in attribute_types)
tc.EmitType ();
CodeGen.Assembly.Emit (Tree.Types);
CodeGen.Module.Emit (Tree.Types);
if (Tree.Types.Enums != null) {
foreach (Enum e in Tree.Types.Enums)
e.Emit ();
}
tc.Emit ();
if (interface_resolve_order != null){
foreach (Interface iface in interface_resolve_order)
iface.Emit ();
}
if (type_container_resolve_order != null) {
foreach (TypeContainer tc in type_container_resolve_order)
tc.EmitType ();
tc.EmitConstants ();
foreach (TypeContainer tc in type_container_resolve_order)
tc.Emit ();
}
if (Tree.Types.Delegates != null) {
foreach (Delegate d in Tree.Types.Delegates)
d.Emit ();
}
//
// Run any hooks after all the types have been defined.
// This is used to create nested auxiliary classes for example
+392 -960
View File
File diff suppressed because it is too large. Load diff
+50 -170
View File
@@ -20,7 +20,6 @@ namespace Mono.CSharp {
public interface ParameterData {
Type ParameterType (int pos);
GenericConstraints GenericConstraints (int pos);
bool HasArrayParameter { get; }
int Count { get; }
string ParameterName (int pos);
@@ -30,43 +29,33 @@ namespace Mono.CSharp {
public class ReflectionParameters : ParameterData {
ParameterInfo [] pi;
Type[] type_params;
bool last_arg_is_params = false;
bool is_varargs = false;
ParameterData gpd;
public ReflectionParameters (MethodBase mb)
public ReflectionParameters (MethodBase method)
{
object [] attrs;
ParameterInfo [] pi = mb.GetParameters ();
is_varargs = (mb.CallingConvention & CallingConventions.VarArgs) != 0;
this.pi = pi;
this.pi = method.GetParameters ();
int count = pi.Length-1;
if (count < 0)
return;
if (mb.Mono_IsInflatedMethod) {
MethodInfo generic = mb.GetGenericMethodDefinition ();
gpd = Invocation.GetParameterData (generic);
if (method.HasGenericParameters) {
MethodInfo generic = method.GetGenericMethodDefinition ();
ParameterData gpd = Invocation.GetParameterData (generic);
last_arg_is_params = gpd.HasArrayParameter;
return;
} else {
attrs = pi [count].GetCustomAttributes (TypeManager.param_array_type, true);
if (attrs == null)
return;
if (attrs.Length == 0)
return;
last_arg_is_params = true;
}
if (mb.IsGenericMethodDefinition)
type_params = mb.GetGenericArguments ();
attrs = pi [count].GetCustomAttributes (TypeManager.param_array_type, true);
if (attrs == null)
return;
if (attrs.Length == 0)
return;
last_arg_is_params = true;
}
public bool HasArrayParameter {
@@ -77,8 +66,6 @@ namespace Mono.CSharp {
{
if (last_arg_is_params && pos >= pi.Length - 1)
return pi [pi.Length - 1].ParameterType;
else if (is_varargs && pos >= pi.Length)
return TypeManager.runtime_argument_handle_type;
else {
Type t = pi [pos].ParameterType;
@@ -86,32 +73,16 @@ namespace Mono.CSharp {
}
}
public GenericConstraints GenericConstraints (int pos)
{
if (gpd != null)
return gpd.GenericConstraints (pos);
if (type_params == null)
return null;
return new ReflectionConstraints (type_params [pos]);
}
public string ParameterName (int pos)
{
if (last_arg_is_params && pos >= pi.Length - 1)
return pi [pi.Length - 1].Name;
else if (is_varargs && pos >= pi.Length)
return "__arglist";
else
return pi [pos].Name;
}
public string ParameterDesc (int pos)
{
if (is_varargs && pos >= pi.Length)
return "";
StringBuilder sb = new StringBuilder ();
if (pi [pos].IsIn)
@@ -139,14 +110,10 @@ namespace Mono.CSharp {
{
int len = pi.Length;
if (last_arg_is_params && pos >= pi.Length - 1)
return Parameter.Modifier.PARAMS;
else if (is_varargs && pos >= pi.Length)
return Parameter.Modifier.ARGLIST;
if (pos >= len - 1)
if (last_arg_is_params)
return Parameter.Modifier.PARAMS;
if (gpd != null)
return gpd.ParameterModifier (pos);
Type t = pi [pos].ParameterType;
if (t.IsByRef){
if ((pi [pos].Attributes & ParameterAttributes.Out) != 0)
@@ -160,42 +127,34 @@ namespace Mono.CSharp {
public int Count {
get {
return is_varargs ? pi.Length + 1 : pi.Length;
return pi.Length;
}
}
}
public class InternalParameters : ParameterData {
Type [] param_types;
bool has_varargs;
int count;
public readonly Parameters Parameters;
public readonly TypeParameter[] TypeParameters;
public InternalParameters (Type [] param_types, Parameters parameters)
{
this.param_types = param_types;
this.Parameters = parameters;
has_varargs = parameters.HasArglist;
if (param_types == null)
count = 0;
else
count = param_types.Length;
}
public InternalParameters (Type [] param_types, Parameters parameters,
TypeParameter [] type_params)
: this (param_types, parameters)
public InternalParameters (DeclSpace ds, Parameters parameters)
: this (parameters.GetParameterInfo (ds), parameters)
{
this.TypeParameters = type_params;
}
public int Count {
get {
return has_varargs ? count + 1 : count;
if (param_types == null)
return 0;
return param_types.Length;
}
}
@@ -217,36 +176,20 @@ namespace Mono.CSharp {
public Type ParameterType (int pos)
{
if (has_varargs && pos >= count)
return TypeManager.runtime_argument_handle_type;
if (param_types == null)
return null;
return GetParameter (pos).ExternalType ();
}
public GenericConstraints GenericConstraints (int pos)
{
if (TypeParameters == null)
return null;
return TypeParameters [pos].Constraints;
}
public string ParameterName (int pos)
{
if (has_varargs && pos >= count)
return "__arglist";
return GetParameter (pos).Name;
}
public string ParameterDesc (int pos)
{
if (has_varargs && pos >= count)
return "__arglist";
string tmp = String.Empty;
Parameter p = GetParameter (pos);
@@ -268,9 +211,6 @@ namespace Mono.CSharp {
public Parameter.Modifier ParameterModifier (int pos)
{
if (has_varargs && pos >= count)
return Parameter.Modifier.ARGLIST;
Parameter.Modifier mod = GetParameter (pos).ModFlags;
if ((mod & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0)
@@ -281,49 +221,6 @@ namespace Mono.CSharp {
}
public class ReflectionConstraints : GenericConstraints
{
GenericParameterAttributes attrs;
Type base_type;
Type class_constraint;
Type[] iface_constraints;
public ReflectionConstraints (Type t)
{
Type[] constraints = t.GetGenericParameterConstraints ();
if ((constraints.Length > 0) && !constraints [0].IsInterface) {
class_constraint = constraints [0];
iface_constraints = new Type [constraints.Length - 1];
Array.Copy (constraints, 1, iface_constraints, 0, constraints.Length - 1);
} else
iface_constraints = constraints;
attrs = t.GenericParameterAttributes;
if (HasValueTypeConstraint)
base_type = TypeManager.value_type;
else if (class_constraint != null)
base_type = class_constraint;
else
base_type = TypeManager.object_type;
}
public override GenericParameterAttributes Attributes {
get { return attrs; }
}
public override Type ClassConstraint {
get { return class_constraint; }
}
public override Type EffectiveBaseClass {
get { return base_type; }
}
public override Type[] InterfaceConstraints {
get { return iface_constraints; }
}
}
class PtrHashtable : Hashtable {
sealed class PtrComparer : IComparer {
private PtrComparer () {}
@@ -388,6 +285,29 @@ namespace Mono.CSharp {
}
}
//
// Compares member infos based on their name and
// also allows one argument to be a string
//
class MemberInfoCompare : IComparer {
public int Compare (object a, object b)
{
if (a == null || b == null){
Console.WriteLine ("Invalid information passed");
throw new Exception ();
}
if (a is string)
return String.Compare ((string) a, ((MemberInfo)b).Name, false, CultureInfo.InvariantCulture);
if (b is string)
return String.Compare (((MemberInfo)a).Name, (string) b, false, CultureInfo.InvariantCulture);
return String.Compare (((MemberInfo)a).Name, ((MemberInfo)b).Name, false, CultureInfo.InvariantCulture);
}
}
struct Pair {
public object First;
public object Second;
@@ -408,42 +328,6 @@ namespace Mono.CSharp {
{
this.reader = reader;
this.buffer = new char [DefaultCacheSize];
// Compute the preamble size
// Let the StreamWriter autodetect the encoder
reader.Peek ();
reader.BaseStream.Position = 0;
Encoding enc = reader.CurrentEncoding;
// First of all, get at least a char
byte[] auxb = new byte [50];
int num_bytes = 0;
int num_chars = 0;
int br = 0;
do {
br = reader.BaseStream.Read (auxb, num_bytes, auxb.Length - num_bytes);
num_bytes += br;
num_chars = enc.GetCharCount (auxb, 0, num_bytes);
}
while (num_chars == 0 && br > 0);
if (num_chars != 0)
{
// Now, check which bytes at the beginning have no effect in the
// char count
int p = 0;
while (enc.GetCharCount (auxb, p, num_bytes-p) >= num_chars)
p++;
preamble_size = p - 1;
reader.BaseStream.Position = 0;
reader.DiscardBufferedData ();
buffer_start = preamble_size;
}
}
public SeekableStreamReader (Stream stream, Encoding encoding, bool detect_encoding_from_bytemarks)
@@ -459,7 +343,6 @@ namespace Mono.CSharp {
int buffer_size; // in bytes
int char_count; // count buffer[] valid characters
int pos; // index into buffer[]
int preamble_size;
/// <remarks>
/// The difference to the StreamReader's BaseStream.Position is that this one is reliable; ie. it
@@ -482,9 +365,6 @@ namespace Mono.CSharp {
return;
}
if (value == 0) // Skip preamble
value = preamble_size;
// Ok, now we need to seek.
reader.DiscardBufferedData ();
+41 -43
View File
@@ -11,77 +11,75 @@ using System;
using System.Collections;
using System.Reflection;
using System.Reflection.Emit;
using Mono.CompilerServices.SymbolWriter;
using System.Diagnostics.SymbolStore;
namespace Mono.CSharp {
public class SymbolWriter : MonoSymbolWriter {
delegate int GetILOffsetFunc (ILGenerator ig);
delegate Guid GetGuidFunc (ModuleBuilder mb);
public class SymbolWriter {
ISymbolWriter symwriter;
MethodInfo define_namespace;
MethodInfo open_method;
GetILOffsetFunc get_il_offset_func;
GetGuidFunc get_guid_func;
ModuleBuilder module_builder;
protected SymbolWriter (ModuleBuilder module_builder, string filename)
: base (filename)
protected SymbolWriter (ISymbolWriter symwriter)
{
this.module_builder = module_builder;
this.symwriter = symwriter;
}
bool Initialize ()
{
MethodInfo mi = typeof (ILGenerator).GetMethod (
"Mono_GetCurrentOffset",
BindingFlags.Static | BindingFlags.NonPublic);
if (mi == null)
Type type = symwriter.GetType ();
define_namespace = type.GetMethod ("DefineNamespace", new Type[] {
typeof (string), typeof (ISymbolDocumentWriter),
typeof (string []), typeof (int) });
if (define_namespace == null)
return false;
get_il_offset_func = (GetILOffsetFunc) System.Delegate.CreateDelegate (
typeof (GetILOffsetFunc), mi);
mi = typeof (ModuleBuilder).GetMethod (
"Mono_GetGuid",
BindingFlags.Static | BindingFlags.NonPublic);
if (mi == null)
open_method = type.GetMethod ("OpenMethod", new Type[] {
typeof (ISymbolDocumentWriter), typeof (int), typeof (int),
typeof (int), typeof (int), typeof (MethodBase), typeof (int) });
if (open_method == null)
return false;
get_guid_func = (GetGuidFunc) System.Delegate.CreateDelegate (
typeof (GetGuidFunc), mi);
Location.DefineSymbolDocuments (this);
Namespace.DefineNamespaces (this);
return true;
}
public void DefineLocalVariable (string name, LocalBuilder builder)
public ISymbolDocumentWriter DefineDocument (string path)
{
SignatureHelper sighelper = SignatureHelper.GetLocalVarSigHelper (
module_builder);
sighelper.AddArgument (builder.LocalType);
byte[] signature = sighelper.GetSignature ();
DefineLocalVariable (name, signature);
return symwriter.DefineDocument (
path, SymLanguageType.CSharp, SymLanguageVendor.Microsoft,
SymDocumentType.Text);
}
public void MarkSequencePoint (ILGenerator ig, int row, int column)
public int DefineNamespace (string name, SourceFile file, string[] using_list, int parent)
{
int offset = get_il_offset_func (ig);
MarkSequencePoint (offset, row, column);
if (file.SymbolDocument == null)
return 0;
return (int) define_namespace.Invoke (symwriter, new object[] {
name, file.SymbolDocument, using_list, parent });
}
public void WriteSymbolFile ()
public void OpenMethod (TypeContainer parent, MethodBase method, Location start, Location end)
{
Guid guid = get_guid_func (module_builder);
WriteSymbolFile (guid);
int ns_id = parent.NamespaceEntry.SymbolFileID;
open_method.Invoke (symwriter, new object[] {
start.SymbolDocument, start.Row, 0, end.Row, 0, method, ns_id });
}
public static SymbolWriter GetSymbolWriter (ModuleBuilder module,
string filename)
public void CloseMethod ()
{
SymbolWriter writer = new SymbolWriter (module, filename);
symwriter.CloseMethod ();
}
public static SymbolWriter GetSymbolWriter (ModuleBuilder module)
{
ISymbolWriter symwriter = module.GetSymWriter ();
if (symwriter == null)
return null;
SymbolWriter writer = new SymbolWriter (symwriter);
if (!writer.Initialize ())
return null;
+34 -33
View File
@@ -33,6 +33,11 @@ namespace Mono.CSharp
public class Tree {
TypeContainer root_types;
// <summary>
// Keeps track of namespaces defined in the source code
// </summary>
Hashtable namespaces;
// <summary>
// Keeps track of all the types definied (classes, structs, ifaces, enums)
// </summary>
@@ -40,35 +45,23 @@ namespace Mono.CSharp
public Tree ()
{
root_types = new RootTypes ();
root_types = new TypeContainer ();
decls = new Hashtable ();
namespaces = new Hashtable ();
}
DoubleHash decl_ns_name = new DoubleHash ();
public void RecordDecl (string name, DeclSpace ds)
{
DeclSpace other = (DeclSpace) decls [name];
if (other != null){
PartialContainer other_pc = other as PartialContainer;
if ((ds is TypeContainer) && (other_pc != null)) {
Report.Error (
260, ds.Location, "Missing partial modifier " +
"on declaration of type `{0}'; another " +
"partial implementation of this type exists",
name);
Report.LocationOfPreviousError (other.Location);
return;
}
Report.SymbolRelatedToPreviousError (
other.Location, other.GetSignatureForError ());
if (decls.Contains (name)){
Report.Error (
101, ds.Location,
"There is already a definition for `" + name + "'");
DeclSpace other = (DeclSpace) decls [name];
Report.Error (0,
other.Location, "(Location of symbol related to previous error)");
return;
}
@@ -92,6 +85,26 @@ namespace Mono.CSharp
return (DeclSpace) res;
}
public NamespaceEntry RecordNamespace (NamespaceEntry parent, SourceFile file, string name, Location loc)
{
NamespaceEntry ns = new NamespaceEntry (parent, file, name, loc);
if (namespaces.Contains (file)){
Hashtable ns_ns = (Hashtable) namespaces [file];
if (ns_ns.Contains (ns.FullName))
return (NamespaceEntry) ns_ns [ns.FullName];
ns_ns.Add (ns.FullName, ns);
} else {
Hashtable new_table = new Hashtable ();
namespaces [file] = new_table;
new_table.Add (ns.FullName, ns);
}
return ns;
}
//
// FIXME: Why are we using Types?
//
@@ -106,23 +119,11 @@ namespace Mono.CSharp
return decls;
}
}
}
public class RootTypes : TypeContainer
{
public RootTypes ()
: base (null, null, MemberName.Null, null, Kind.Root,
new Location (-1))
{ }
public override void Register ()
{
throw new InvalidOperationException ();
public Hashtable Namespaces {
get {
return namespaces;
}
public override PendingImplementation GetPendingImplementations ()
{
throw new InvalidOperationException ();
}
}
}
+453 -795
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -5,7 +5,7 @@ Release: 1
License: LGPL
Group: System Environment/Base
# the original file is in .gz format but I want to save a few bytes
Source0: http://go-mono.com/archive/mono-@VERSION@.tar.gz
Source0: http://go-mono.com/archive/mono-0.14.tar.gz
URL: http://go-mono.com/
BuildRoot: %{_tmppath}/%{name}-root
Requires: /sbin/ldconfig, libxml2, libxslt
-76
View File
@@ -1,79 +1,3 @@
2004-08-30 Zoltan Varga <[email protected]>
* amd64/amd64-codegen.h (amd64_imul_reg_membase_size): Fix REX
generation.
2004-08-29 Zoltan Varga <[email protected]>
* amd64/amd64-codegen.h: More SSE work.
* amd64/amd64-codegen.h: Add SSE2 instructions.
2004-08-21 Zoltan Varga <[email protected]>
* amd64/amd64-codegen.h (X86_IS_BYTE_REG): Redefine X86_IS_BYTE_REG
since under amd64, all 16 registers have a low part.
2004-08-16 Zoltan Varga <[email protected]>
* x86/x86-codegen.h: Add macros for accessing the mod/rm byte.
2004-07-30 Zoltan Varga <[email protected]>
* amd64/amd64-codegen.h: Ongoing JIT work.
2004-07-29 Ben Maurer <[email protected]>
* x86/x86-codegen.h: Add opcodes for cmp BYTE PTR [eax], imm
2004-07-28 Zoltan Varga <[email protected]>
* amd64/amd64-codegen.h: Ongoing JIT work.
2004-07-24 Zoltan Varga <[email protected]>
* amd64/amd64-codegen.h: Ongoing JIT work.
2004-07-23 Zoltan Varga <[email protected]>
* amd64/amd64-codegen.h: Ongoing JIT work.
2004-07-23 zovarga <[email protected]>
* amd64/amd64-codegen.h: Ongoing JIT work.
2004-06-30 Zoltan Varga <[email protected]>
* sparc/sparc-codegen.h: Add SPARC64 support.
2004-05-07 Bernie Solomon <[email protected]>
* ppc/ppc-codegen.h: remove GCC-ism in ppc_emit32
2004-04-29 Bernie Solomon <[email protected]>
* ppc/tramp.c: use sizeof (stackval), fix
delegate tramp frame layout for Apple
2004-04-26 David Waite <[email protected]>
* unknown.c: modify to have content for defined platforms (to
avoid ISO C warning)
2004-03-29 Bernie Solomon <[email protected]>
* amd64/tramp.c:
* arm/tramp.c:
* hppa/tramp.c:
* ppc/tramp.c:
* s390/tramp.c:
* sparc/tramp.c:
* x86/tramp.c:
remove child from MonoInvocation as it isn't used.
* hppa/hppa-codegen.h:
fix displacements in FP instrs
2004-03-23 Bernie Solomon <[email protected]>
* hppa/hppa-codegen.h: created
+1 -1
View File
@@ -1,5 +1,5 @@
SUBDIRS = $(arch_target)
DIST_SUBDIRS = x86 ppc sparc arm s390 s390x alpha hppa amd64
DIST_SUBDIRS = x86 ppc sparc arm s390 alpha hppa amd64
INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
-3
View File
@@ -1,3 +0,0 @@
Makefile.in
Makefile
.deps
Loaded 100 of 671 files, more files were not shown because too many files have changed in this diff. Show more