/* Internals of libgccjit: classes for playing back recorded API calls.
- Copyright (C) 2013-2014 Free Software Foundation, Inc.
+ Copyright (C) 2013-2015 Free Software Foundation, Inc.
Contributed by David Malcolm <dmalcolm@redhat.com>.
This file is part of GCC.
namespace playback {
-class context
+class context : public log_user
{
public:
context (::gcc::jit::recording::context *ctxt);
lvalue *
new_global (location *loc,
+ enum gcc_jit_global_kind kind,
type *type,
const char *name);
+ template <typename HOST_TYPE>
rvalue *
- new_rvalue_from_int (type *type,
- int value);
-
- rvalue *
- new_rvalue_from_double (type *type,
- double value);
-
- rvalue *
- new_rvalue_from_ptr (type *type,
- void *value);
+ new_rvalue_from_const (type *type,
+ HOST_TYPE value);
rvalue *
new_string_literal (const char *value);
return m_recording_ctxt->get_bool_option (opt);
}
+ builtins_manager *get_builtins_manager () const
+ {
+ return m_recording_ctxt->get_builtins_manager ();
+ }
+
result *
compile ();
return m_recording_ctxt->errors_occurred ();
}
+ /* For use by jit_langhook_write_globals. */
+ void write_global_decls_1 ();
+ void write_global_decls_2 ();
+
private:
void dump_generated_code ();
void handle_locations ();
+ const char * get_path_c_file () const;
+ const char * get_path_s_file () const;
+ const char * get_path_so_file () const;
+
private:
/* Functions for implementing "compile". */
+ void acquire_mutex ();
+ void release_mutex ();
+
+ void
+ make_fake_args (vec <char *> *argvec,
+ const char *ctxt_progname,
+ vec <recording::requested_dump> *requested_dumps);
+
void
- make_fake_args (auto_vec <const char *> *argvec,
- const char *ctxt_progname);
+ extract_any_requested_dumps
+ (vec <recording::requested_dump> *requested_dumps);
+
+ char *
+ read_dump_file (const char *path);
void
convert_to_dso (const char *ctxt_progname);
+ result *
+ dlopen_built_dso ();
+
private:
::gcc::jit::recording::context *m_recording_ctxt;
- /* Allocated using xmalloc (by xstrdup). */
- char *m_path_template;
-
- /* This either aliases m_path_template, or is NULL. */
- char *m_path_tempdir;
-
- /* The following are allocated using xmalloc. */
- char *m_path_c_file;
- char *m_path_s_file;
- char *m_path_so_file;
+ tempdir *m_tempdir;
auto_vec<function *> m_functions;
+ auto_vec<tree> m_globals;
tree m_char_array_type_node;
tree m_const_char_ptr;