]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Move the dynlib and C++ name mangling routines into a separate
authorRhys Weatherley <rweather@southern-storm.com.au>
Sat, 8 May 2004 01:36:41 +0000 (01:36 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Sat, 8 May 2004 01:36:41 +0000 (01:36 +0000)
"jitdynamic" library, which will handle all of the cross-language
naming and dynamic invocation logic.

13 files changed:
ChangeLog
Makefile.am
configure.in
doc/Makefile.am
doc/libjit.texi
include/jit/Makefile.am
include/jit/jit-dynamic.h [new file with mode: 0644]
include/jit/jit-util.h
jit/Makefile.am
jitdynamic/.cvsignore [new file with mode: 0644]
jitdynamic/Makefile.am [new file with mode: 0644]
jitdynamic/jit-cpp-mangle.c [moved from jit/jit-mangle.c with 99% similarity]
jitdynamic/jit-dynlib.c [moved from jit/jit-dynlib.c with 98% similarity]

index 11976bdd2f61183f79c8fdd2ef5d6196eb881d2c..30210d7fb8727c1143256b09663fd273f68d8deb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        they aren't used in libjit, and front ends will normally have
        their own functions for this purpose.
 
+       * Makefile.am, configure.in, doc/Makefile.am, doc/libjit.texi,
+       include/jit/Makefile.am, include/jit/jit-dynamic.h,
+       include/jit/jit-util.h, jit/Makefile.am, jit/jit-dynlib.c,
+       jit/jit-mangle.c, jitdynamic/.cvsignore, jitdynamic/Makefile.am,
+       jitdynamic/jit-cpp-mangle.c, jitdynamic/jit-dynlib.c:
+       move the dynlib and C++ name mangling routines into a separate
+       "jitdynamic" library, which will handle all of the cross-language
+       naming and dynamic invocation logic.
+
 2004-05-07  Rhys Weatherley  <rweather@southern-storm.com.au>
 
        * dpas/dpas-function.c, dpas/dpas-internal.h, dpas/dpas-main.c,
index 5e82876d558eeca71a4b404bfe6c1a16463caeb6..bdd5ba58906979000de9c4b93be57a119234c039 100644 (file)
@@ -1,2 +1,2 @@
 
-SUBDIRS = include tools jit jitplus dpas tutorial doc
+SUBDIRS = include tools jit jitdynamic jitplus dpas tutorial doc
index 637b65429f420bbd73e97666c9a04463dc346ae7..3b582e958a330b352632c5586e84a309a2b64901 100644 (file)
@@ -370,6 +370,7 @@ include/jit/Makefile
 include/jit/jit-defs.h
 tools/Makefile
 jit/Makefile
+jitdynamic/Makefile
 jitplus/Makefile
 dpas/Makefile
 tutorial/Makefile
index f536ef6bf40062aa6638bd42dc468426fab69465..475edb6ba77d08544e2addd321b38be478d728de 100644 (file)
@@ -15,7 +15,7 @@ libjit_TEXINFOS = \
        $(srcdir)/libjitext-init.texi \
        $(srcdir)/libjitext-insn.texi \
        $(srcdir)/libjitext-intrinsic.texi \
-       $(srcdir)/libjitext-mangle.texi \
+       $(srcdir)/libjitext-cpp-mangle.texi \
        $(srcdir)/libjitext-memory.texi \
        $(srcdir)/libjitext-meta.texi \
        $(srcdir)/libjitext-reg-alloc.texi \
@@ -40,7 +40,7 @@ $(srcdir)/libjitext-block.texi: $(top_srcdir)/jit/jit-block.c
 $(srcdir)/libjitext-context.texi: $(top_srcdir)/jit/jit-context.c
        $(SHELL) $(srcdir)/extract-docs.sh $< >$@
 
-$(srcdir)/libjitext-dynlib.texi: $(top_srcdir)/jit/jit-dynlib.c
+$(srcdir)/libjitext-dynlib.texi: $(top_srcdir)/jitdynamic/jit-dynlib.c
        $(SHELL) $(srcdir)/extract-docs.sh $< >$@
 
 $(srcdir)/libjitext-elf-read.texi: $(top_srcdir)/jit/jit-elf-read.c
@@ -61,7 +61,7 @@ $(srcdir)/libjitext-insn.texi: $(top_srcdir)/jit/jit-insn.c
 $(srcdir)/libjitext-intrinsic.texi: $(top_srcdir)/jit/jit-intrinsic.c
        $(SHELL) $(srcdir)/extract-docs.sh $< >$@
 
-$(srcdir)/libjitext-mangle.texi: $(top_srcdir)/jit/jit-mangle.c
+$(srcdir)/libjitext-cpp-mangle.texi: $(top_srcdir)/jitdynamic/jit-cpp-mangle.c
        $(SHELL) $(srcdir)/extract-docs.sh $< >$@
 
 $(srcdir)/libjitext-memory.texi: $(top_srcdir)/jit/jit-memory.c
index 47d7db5d32e646b17cc26e03152ea730de0dd328..b84043734d8bf3106d9e89618b8e258550ea19e0 100644 (file)
@@ -1003,7 +1003,7 @@ that it itself uses internally, but which may also be useful to front ends.
 @include libjitext-apply.texi
 @include libjitext-walk.texi
 @include libjitext-dynlib.texi
-@include libjitext-mangle.texi
+@include libjitext-cpp-mangle.texi
 
 @c -----------------------------------------------------------------------
 
index b6e1a80d376b60912f743ef1dcc8eac61d5d2ec9..6993c73486c984ed77ecf025d4cce5abdeae48a1 100644 (file)
@@ -7,6 +7,7 @@ libjitinclude_HEADERS = jit.h \
                                                jit-context.h \
                                                jit-defs.h \
                                                jit-dump.h \
+                                               jit-dynamic.h \
                                                jit-elf.h \
                                                jit-except.h \
                                                jit-function.h \
diff --git a/include/jit/jit-dynamic.h b/include/jit/jit-dynamic.h
new file mode 100644 (file)
index 0000000..65c9bc6
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * jit-dynamic.h - Managing dynamic libraries and cross-language invocation.
+ *
+ * Copyright (C) 2004  Southern Storm Software, Pty Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef        _JIT_DYNAMIC_H
+#define        _JIT_DYNAMIC_H
+
+#include <jit/jit-common.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Dynamic library routines.
+ */
+typedef void *jit_dynlib_handle_t;
+jit_dynlib_handle_t jit_dynlib_open(const char *name) JIT_NOTHROW;
+void jit_dynlib_close(jit_dynlib_handle_t handle) JIT_NOTHROW;
+void *jit_dynlib_get_symbol
+       (jit_dynlib_handle_t handle, const char *symbol) JIT_NOTHROW;
+const char *jit_dynlib_get_suffix(void) JIT_NOTHROW;
+void jit_dynlib_set_debug(int flag) JIT_NOTHROW;
+
+/*
+ * C++ name mangling definitions.
+ */
+#define        JIT_MANGLE_PUBLIC                       0x0001
+#define        JIT_MANGLE_PROTECTED            0x0002
+#define        JIT_MANGLE_PRIVATE                      0x0003
+#define        JIT_MANGLE_STATIC                       0x0008
+#define        JIT_MANGLE_VIRTUAL                      0x0010
+#define        JIT_MANGLE_CONST                        0x0020
+#define        JIT_MANGLE_EXPLICIT_THIS        0x0040
+#define        JIT_MANGLE_IS_CTOR                      0x0080
+#define        JIT_MANGLE_IS_DTOR                      0x0100
+#define        JIT_MANGLE_BASE                         0x0200
+char *jit_mangle_global_function
+       (const char *name, jit_type_t signature, int form) JIT_NOTHROW;
+char *jit_mangle_member_function
+       (const char *class_name, const char *name,
+        jit_type_t signature, int form, int flags) JIT_NOTHROW;
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* _JIT_DYNAMIC_H */
index 3c8894e0012bac5e64a90c6b27b9032f3e69adc2..7ee93b75a405fc644483164138e6cf3f600527af 100644 (file)
@@ -71,36 +71,6 @@ int jit_sprintf(char *str, const char *format, ...) JIT_NOTHROW;
 int jit_snprintf
        (char *str, unsigned int len, const char *format, ...) JIT_NOTHROW;
 
-/*
- * Dynamic library routines.
- */
-typedef void *jit_dynlib_handle_t;
-jit_dynlib_handle_t jit_dynlib_open(const char *name) JIT_NOTHROW;
-void jit_dynlib_close(jit_dynlib_handle_t handle) JIT_NOTHROW;
-void *jit_dynlib_get_symbol
-       (jit_dynlib_handle_t handle, const char *symbol) JIT_NOTHROW;
-const char *jit_dynlib_get_suffix(void) JIT_NOTHROW;
-void jit_dynlib_set_debug(int flag) JIT_NOTHROW;
-
-/*
- * C++ name mangling definitions.
- */
-#define        JIT_MANGLE_PUBLIC                       0x0001
-#define        JIT_MANGLE_PROTECTED            0x0002
-#define        JIT_MANGLE_PRIVATE                      0x0003
-#define        JIT_MANGLE_STATIC                       0x0008
-#define        JIT_MANGLE_VIRTUAL                      0x0010
-#define        JIT_MANGLE_CONST                        0x0020
-#define        JIT_MANGLE_EXPLICIT_THIS        0x0040
-#define        JIT_MANGLE_IS_CTOR                      0x0080
-#define        JIT_MANGLE_IS_DTOR                      0x0100
-#define        JIT_MANGLE_BASE                         0x0200
-char *jit_mangle_global_function
-       (const char *name, jit_type_t signature, int form) JIT_NOTHROW;
-char *jit_mangle_member_function
-       (const char *class_name, const char *name,
-        jit_type_t signature, int form, int flags) JIT_NOTHROW;
-
 #ifdef __cplusplus
 };
 #endif
index 128cbf768fe8535ccb3cee26d73dc294c6a53f22..a3a08dcd7ad27c9c82a640d9c7cba62e097ae9b3 100644 (file)
@@ -13,7 +13,6 @@ libjit_a_SOURCES = \
                jit-cache.c \
                jit-context.c \
                jit-dump.c \
-               jit-dynlib.c \
                jit-elf-defs.h \
                jit-elf-read.c \
                jit-elf-write.c \
@@ -28,7 +27,6 @@ libjit_a_SOURCES = \
                jit-interp.cpp \
                jit-intrinsic.c \
                jit-live.c \
-               jit-mangle.c \
                jit-memory.c \
                jit-memory.h \
                jit-meta.c \
diff --git a/jitdynamic/.cvsignore b/jitdynamic/.cvsignore
new file mode 100644 (file)
index 0000000..051d1bd
--- /dev/null
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+.deps
diff --git a/jitdynamic/Makefile.am b/jitdynamic/Makefile.am
new file mode 100644 (file)
index 0000000..5ceb183
--- /dev/null
@@ -0,0 +1,9 @@
+
+lib_LIBRARIES = libjitdynamic.a
+
+libjitdynamic_a_SOURCES = \
+               jit-dynlib.c \
+               jit-cpp-mangle.c
+
+AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \
+                       -I. -I$(srcdir) -I$(top_srcdir)/jit -I$(top_builddir)/jit
similarity index 99%
rename from jit/jit-mangle.c
rename to jitdynamic/jit-cpp-mangle.c
index 83e839e7869a88ae038d5e364f9ef6bc9bc8ac41..ee028e579438eeff0cec06d79c6e16529ffcdd9d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * jit-mangle.c - Perform C++ name mangling.
+ * jit-cpp-mangle.c - Perform C++ name mangling.
  *
  * Copyright (C) 2004  Southern Storm Software, Pty Ltd.
  *
@@ -18,6 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <jit/jit-dynamic.h>
 #include "jit-internal.h"
 #include <config.h>
 #include <stdio.h>
similarity index 98%
rename from jit/jit-dynlib.c
rename to jitdynamic/jit-dynlib.c
index b0ea6d412a79488eed7357a51d29f01db0205743..95a6f67ba579dd047861371ae86683b0f43dc468 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <jit/jit-dynamic.h>
+#include <jit/jit-util.h>
 #include <stdio.h>
-#include "jit-internal.h"
+#include <config.h>
 #ifdef JIT_WIN32_PLATFORM
        #include <windows.h>
        #ifndef JIT_WIN32_NATIVE
@@ -43,6 +45,9 @@ libraries.  They should be used in place of the traditional
 @code{dlopen}, @code{dlclose}, and @code{dlsym} functions, which
 are not portable across operating systems.
 
+You must include @code{<jit/jit-dynamic.h>} to use these routines,
+and then link with @code{-ljitdynamic -ljit}.
+
 @deftypefun jit_dynlib_handle_t jit_dynlib_open ({const char *} name)
 Opens the dynamic library called @code{name}, returning a handle for it.
 @end deftypefun