Example #1
0
static bool
jit_langhook_init (void)
{
    gcc_assert (gcc::jit::active_playback_ctxt);
    JIT_LOG_SCOPE (gcc::jit::active_playback_ctxt->get_logger ());

    static bool registered_root_tab = false;
    if (!registered_root_tab)
    {
        ggc_register_root_tab (jit_root_tab);
        registered_root_tab = true;
    }

    build_common_tree_nodes (false, false);

    /* I don't know why this has to be done explicitly.  */
    void_list_node = build_tree_list (NULL_TREE, void_type_node);

    build_common_builtin_nodes ();

    /* The default precision for floating point numbers.  This is used
       for floating point constants with abstract type.  This may
       eventually be controllable by a command line option.  */
    mpfr_set_default_prec (256);

    return true;
}
Example #2
0
result::
result(logger *logger, void *dso_handle, tempdir *tempdir_) :
  log_user (logger),
  m_dso_handle (dso_handle),
  m_tempdir (tempdir_)
{
  JIT_LOG_SCOPE (get_logger ());
}
Example #3
0
result::~result()
{
  JIT_LOG_SCOPE (get_logger ());

  dlclose (m_dso_handle);

  /* Responsibility for cleaning up the tempdir (including "fake.so" within
     the filesystem) might have been handed to us by the playback::context,
     so that the cleanup can be delayed (see PR jit/64206).

     If so, clean it up now.  */
  delete m_tempdir;
}
Example #4
0
void *
result::
get_global (const char *name)
{
  JIT_LOG_SCOPE (get_logger ());

  void *global;
  const char *error;

  /* Clear any existing error.  */
  dlerror ();

  global = dlsym (m_dso_handle, name);

  if ((error = dlerror()) != NULL)  {
    fprintf(stderr, "%s\n", error);
  }

  return global;
}
Example #5
0
void *
result::
get_code (const char *funcname)
{
  JIT_LOG_SCOPE (get_logger ());

  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;
}