+2014-12-01 David Malcolm <dmalcolm@redhat.com>
+
+ * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
+ * jit-playback.c: Include new header jit-result.h.
+ (gcc::jit::result::result): Move to new file jit-result.c.
+ (gcc::jit::result::~result): Likewise.
+ (gcc::jit::playback::result): Likewise.
+ * jit-recording.h (class gcc::jit::result): Move to new
+ header jit-result.h.
+ * jit-result.c: New file, to contain...
+ (gcc::jit::result::result): Move here from jit-playback.c,
+ removing erroneous "playback" namespace from comment.
+ (gcc::jit::result::~result): Likewise.
+ (gcc::jit::playback::result): Likewise.
+ * jit-result.h: New file, to contain...
+ (class gcc::jit::result): Move from jit-recording.h.
+ * libgccjit.c: Include jit-result.h.
+ (gcc_jit_result_get_code): Update comment to reflect move
+ of implementation.
+ (gcc_jit_result_release): Likewise.
+
2014-12-01 David Malcolm <dmalcolm@redhat.com>
PR jit/63854
jit/libgccjit.o \
jit/jit-recording.o \
jit/jit-playback.o \
+ jit/jit-result.o \
jit/jit-builtins.o
# Use strict warnings for this front end.
#include "jit-common.h"
#include "jit-playback.h"
+#include "jit-result.h"
/* gcc::jit::playback::context::build_cast uses the convert.h API,
fmt, ap);
}
-/* Constructor for gcc::jit::playback::result. */
-
-result::
-result(void *dso_handle)
- : m_dso_handle(dso_handle)
-{
-}
-
-/* gcc::jit::playback::result's destructor.
-
- Called implicitly by gcc_jit_result_release. */
-
-result::~result()
-{
- dlclose (m_dso_handle);
-}
-
-/* Attempt to locate the given function by name within the
- playback::result, using dlsym.
-
- Implements the post-error-checking part of
- gcc_jit_result_get_code. */
-
-void *
-result::
-get_code (const char *funcname)
-{
- void *code;
- const char *error;
-
- /* Clear any existing error. */
- dlerror ();
-
- code = dlsym (m_dso_handle, funcname);
-
- if ((error = dlerror()) != NULL) {
- fprintf(stderr, "%s\n", error);
- }
-
- return code;
-}
-
/* Dealing with the linemap API. */
/* Construct a playback::location for a recording::location, if it
} // namespace gcc::jit::recording
-/* The result of JIT-compilation. */
-class result
-{
-public:
- result(void *dso_handle);
-
- virtual ~result();
-
- void *
- get_code (const char *funcname);
-
-private:
- void *m_dso_handle;
-};
-
} // namespace gcc::jit
} // namespace gcc
--- /dev/null
+/* Internals of libgccjit: implementation of gcc_jit_result
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
+ Contributed by David Malcolm <dmalcolm@redhat.com>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "jit-result.h"
+
+namespace gcc {
+namespace jit {
+
+/* Constructor for gcc::jit::result. */
+
+result::
+result(void *dso_handle)
+ : m_dso_handle(dso_handle)
+{
+}
+
+/* gcc::jit::result's destructor.
+
+ Called implicitly by gcc_jit_result_release. */
+
+result::~result()
+{
+ dlclose (m_dso_handle);
+}
+
+/* Attempt to locate the given function by name within the
+ playback::result, using dlsym.
+
+ Implements the post-error-checking part of
+ gcc_jit_result_get_code. */
+
+void *
+result::
+get_code (const char *funcname)
+{
+ void *code;
+ const char *error;
+
+ /* Clear any existing error. */
+ dlerror ();
+
+ code = dlsym (m_dso_handle, funcname);
+
+ if ((error = dlerror()) != NULL) {
+ fprintf(stderr, "%s\n", error);
+ }
+
+ return code;
+}
+
+} // namespace gcc::jit
+
+} // namespace gcc
--- /dev/null
+/* Internals of libgccjit: implementation of gcc_jit_result
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
+ Contributed by David Malcolm <dmalcolm@redhat.com>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef JIT_RESULT_H
+#define JIT_RESULT_H
+
+namespace gcc {
+
+namespace jit {
+
+/* The result of JIT-compilation. */
+class result
+{
+public:
+ result(void *dso_handle);
+
+ virtual ~result();
+
+ void *
+ get_code (const char *funcname);
+
+private:
+ void *m_dso_handle;
+};
+
+} // namespace gcc::jit
+
+} // namespace gcc
+
+#endif /* JIT_RESULT_H */
#include "libgccjit.h"
#include "jit-common.h"
#include "jit-recording.h"
+#include "jit-result.h"
/* The opaque types used by the public API are actually subclasses
of the gcc::jit::recording classes. */
/* Public entrypoint. See description in libgccjit.h.
After error-checking, the real work is done by the
- gcc::jit::playback::result::get_code method in
- jit-playback.c. */
+ gcc::jit::result::get_code method in jit-result.c. */
void *
gcc_jit_result_get_code (gcc_jit_result *result,
/* Public entrypoint. See description in libgccjit.h.
After error-checking, this is essentially a wrapper around the
- destructor for gcc::jit::playback::result in jit-playback.c. */
+ destructor for gcc::jit::result in jit-result.c. */
void
gcc_jit_result_release (gcc_jit_result *result)