2014-11-11 22:55:52 +01:00
|
|
|
# Linker script for libgccjit.so
|
2017-01-01 13:07:43 +01:00
|
|
|
# Copyright (C) 2013-2017 Free Software Foundation, Inc.
|
2014-11-11 22:55:52 +01:00
|
|
|
# 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/>. */
|
2015-06-30 21:27:19 +02:00
|
|
|
|
|
|
|
# The initial release of the library.
|
|
|
|
LIBGCCJIT_ABI_0
|
2014-11-11 22:55:52 +01:00
|
|
|
{
|
|
|
|
global:
|
|
|
|
# Keep this list sorted alphabetically:
|
|
|
|
gcc_jit_block_add_assignment;
|
|
|
|
gcc_jit_block_add_assignment_op;
|
|
|
|
gcc_jit_block_add_comment;
|
|
|
|
gcc_jit_block_add_eval;
|
|
|
|
gcc_jit_block_as_object;
|
|
|
|
gcc_jit_block_end_with_conditional;
|
|
|
|
gcc_jit_block_end_with_jump;
|
|
|
|
gcc_jit_block_end_with_return;
|
|
|
|
gcc_jit_block_end_with_void_return;
|
|
|
|
gcc_jit_block_get_function;
|
|
|
|
gcc_jit_context_acquire;
|
|
|
|
gcc_jit_context_compile;
|
2015-01-20 02:32:48 +01:00
|
|
|
gcc_jit_context_compile_to_file;
|
2014-11-11 22:55:52 +01:00
|
|
|
gcc_jit_context_dump_to_file;
|
2015-01-13 23:14:46 +01:00
|
|
|
gcc_jit_context_dump_reproducer_to_file;
|
2014-12-09 16:35:39 +01:00
|
|
|
gcc_jit_context_enable_dump;
|
2014-11-11 22:55:52 +01:00
|
|
|
gcc_jit_context_get_builtin_function;
|
|
|
|
gcc_jit_context_get_first_error;
|
2015-01-08 22:52:35 +01:00
|
|
|
gcc_jit_context_get_last_error;
|
2014-11-11 22:55:52 +01:00
|
|
|
gcc_jit_context_get_type;
|
|
|
|
gcc_jit_context_get_int_type;
|
|
|
|
gcc_jit_context_new_array_access;
|
|
|
|
gcc_jit_context_new_array_type;
|
|
|
|
gcc_jit_context_new_binary_op;
|
|
|
|
gcc_jit_context_new_call;
|
|
|
|
gcc_jit_context_new_call_through_ptr;
|
|
|
|
gcc_jit_context_new_cast;
|
|
|
|
gcc_jit_context_new_child_context;
|
|
|
|
gcc_jit_context_new_comparison;
|
|
|
|
gcc_jit_context_new_field;
|
|
|
|
gcc_jit_context_new_function;
|
|
|
|
gcc_jit_context_new_function_ptr_type;
|
|
|
|
gcc_jit_context_new_global;
|
|
|
|
gcc_jit_context_new_location;
|
|
|
|
gcc_jit_context_new_opaque_struct;
|
|
|
|
gcc_jit_context_new_param;
|
|
|
|
gcc_jit_context_new_rvalue_from_double;
|
|
|
|
gcc_jit_context_new_rvalue_from_int;
|
2015-01-09 21:10:11 +01:00
|
|
|
gcc_jit_context_new_rvalue_from_long;
|
2014-11-11 22:55:52 +01:00
|
|
|
gcc_jit_context_new_rvalue_from_ptr;
|
|
|
|
gcc_jit_context_new_string_literal;
|
|
|
|
gcc_jit_context_new_struct_type;
|
|
|
|
gcc_jit_context_new_unary_op;
|
|
|
|
gcc_jit_context_new_union_type;
|
|
|
|
gcc_jit_context_null;
|
|
|
|
gcc_jit_context_one;
|
|
|
|
gcc_jit_context_release;
|
|
|
|
gcc_jit_context_set_bool_option;
|
|
|
|
gcc_jit_context_set_int_option;
|
New jit API entrypoint: gcc_jit_context_set_logfile
gcc/jit/ChangeLog:
* Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
* docs/internals/index.rst (Overview of code structure): Mention
gcc_jit_context_set_logfile, and embed the example logfile.
* docs/internals/test-hello-world.exe.log.txt: New file: example
of a logfile.
* docs/topics/contexts.rst (Debugging): Add documentation
for gcc_jit_context_set_logfile.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
* dummy-frontend.c: Include "jit-logging.h".
(jit_langhook_init): Assert that there is an active playback
context. If it has a logger, log entry/exit to this function.
(jit_langhook_write_globals): Likewise.
* jit-common.h (gcc::jit::logger): New forward declaration.
* jit-logging.c: New file.
* jit-logging.h: New file.
* jit-playback.c: Include "jit-logging.h".
(gcc::jit::playback::context::context): Initialize the log_user
base class from the recording context's logger (if any). Use
JIT_LOG_SCOPE to log entry/exit from the function body.
(gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
log entry/exit from the function body.
(gcc::jit::playback::build_stmt_list): Likewise.
(gcc::jit::playback::function::postprocess): Likewise.
(gcc::jit::playback::context::compile): Likewise. Log the
entry/exit to toplev::main and toplev::finalize. Log the
fake argv passed to toplev::main.
(gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
log entry/exit from the function body.
(gcc::jit::playback::context::release_mutex): Likewise.
(gcc::jit::playback::context::make_fake_args): Likewise.
(gcc::jit::playback::context::extract_any_requested_dumps):
Likewise.
(gcc::jit::playback::context::convert_to_dso): Likewise. Also,
log the arguments that the driver is invoked with.
(gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
the logger to the result object.
(gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
log entry/exit from the function body.
(gcc::jit::playback::context::dump_generated_code): Likewise.
(gcc::jit::playback::context::handle_locations): Likewise.
* jit-playback.h (gcc::jit::playback::context): Make this be
a subclass of gcc::jit::log_user.
* jit-recording.c: Include "jit-logging.h".
(gcc::jit::recording::context::context: Initialize the logger to
NULL for root contexts, or to the parent's logger for child
contexts.
(gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
log entry/exit from the function body.
(gcc::jit::recording::context::replay_into): Likewise.
(gcc::jit::recording::context::disassociate_from_playback):
Likewise.
(gcc::jit::recording::context::compile): Likewise.
(recording::context::add_error_va): Likewise. Also, log the
error.
(gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
log entry/exit from the function body.
* jit-recording.h: Include "jit-logging.h".
(gcc::jit::recording::context): Make this be a subclass of
gcc::jit::log_user.
* jit-result.c: Include "jit-common.h" and "jit-logging.h".
(gcc::jit::result::result): Add logger param, recording it.
Use JIT_LOG_SCOPE to log entry/exit from the function body.
(gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
log entry/exit from the function body.
(gcc::jit::result::get_code): Likewise.
* jit-result.h (gcc::jit::result): Make this be a subclass of
gcc::jit::log_user.
(gcc::jit::result::result): Add logger parameter.
* libgccjit++.h (gccjit::context::set_logfile): New function.
* libgccjit.c: Include "jit-logging.h".
(gcc_jit_context_acquire): Log the context.
(gcc_jit_context_release): Use JIT_LOG_FUNC to
log entry/exit from the function body, and log the context.
(gcc_jit_context_new_child_context): Likewise, logging both
contexts.
(gcc_jit_context_new_location): Use JIT_LOG_FUNC to
log entry/exit from the function body.
(gcc_jit_context_get_type): Likewise.
(gcc_jit_context_get_int_type): Likewise.
(gcc_jit_context_new_array_type): Likewise.
(gcc_jit_context_new_field): Likewise.
(gcc_jit_context_new_struct_type): Likewise.
(gcc_jit_context_new_opaque_struct): Likewise.
(gcc_jit_struct_set_fields): Likewise.
(gcc_jit_context_new_union_type): Likewise.
(gcc_jit_context_new_function_ptr_type): Likewise.
(gcc_jit_context_new_param): Likewise.
(gcc_jit_context_new_function): Likewise.
(gcc_jit_context_get_builtin_function): Likewise.
(gcc_jit_function_get_param): Likewise.
(gcc_jit_function_dump_to_dot): Likewise.
(gcc_jit_function_new_block): Likewise.
(gcc_jit_context_new_global): Likewise.
(gcc_jit_context_new_rvalue_from_int): Likewise.
(gcc_jit_context_zero): Likewise.
(gcc_jit_context_one): Likewise.
(gcc_jit_context_new_rvalue_from_double): Likewise.
(gcc_jit_context_new_rvalue_from_ptr): Likewise.
(gcc_jit_context_null): Likewise.
(gcc_jit_context_new_string_literal): Likewise.
(gcc_jit_context_new_unary_op): Likewise.
(gcc_jit_context_new_binary_op): Likewise.
(gcc_jit_context_new_comparison): Likewise.
(gcc_jit_context_new_call): Likewise.
(gcc_jit_context_new_call_through_ptr): Likewise.
(gcc_jit_context_new_cast): Likewise.
(gcc_jit_context_new_array_access): Likewise.
(gcc_jit_lvalue_access_field): Likewise.
(gcc_jit_rvalue_access_field): Likewise.
(gcc_jit_rvalue_dereference_field): Likewise.
(gcc_jit_rvalue_dereference): Likewise.
(gcc_jit_lvalue_get_address): Likewise.
(gcc_jit_function_new_local): Likewise.
(gcc_jit_block_add_eval): Likewise.
(gcc_jit_block_add_assignment): Likewise.
(gcc_jit_block_add_assignment_op): Likewise.
(gcc_jit_block_end_with_conditional): Likewise.
(gcc_jit_block_add_comment): Likewise.
(gcc_jit_block_end_with_jump): Likewise.
(gcc_jit_block_end_with_return): Likewise.
(gcc_jit_block_end_with_void_return): Likewise.
(gcc_jit_context_set_str_option): Likewise.
(gcc_jit_context_set_int_option): Likewise.
(gcc_jit_context_set_bool_option): Likewise.
(gcc_jit_context_enable_dump): Likewise.
(gcc_jit_context_compile): Likewise. Also log the context,
and the result.
(gcc_jit_context_dump_to_file): Likewise.
(gcc_jit_context_set_logfile): New function.
(gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
log entry/exit from the function body.
(gcc_jit_result_get_code): Likewise. Also log the fnname)
and the ptr to be returned.
(gcc_jit_result_release): Likewise. Also log the result.
* libgccjit.h: Include <stdio.h>, since we need FILE *.
(gcc_jit_context_set_logfile): New declaration.
* libgccjit.map (gcc_jit_context_set_logfile): New.
gcc/testsuite/ChangeLog:
* jit.dg/harness.h (set_up_logging): New function.
(test_jit): Fail if gcc_jit_context_acquire fails. Call
set_up_logging on the context, so that every testcase is
logged to a particular file.
* jit.dg/test-nested-contexts.c (main): Open a logfile,
and call gcc_jit_context_set_logfile on the top-level context.
From-SVN: r219357
2015-01-08 20:41:07 +01:00
|
|
|
gcc_jit_context_set_logfile;
|
2014-11-11 22:55:52 +01:00
|
|
|
gcc_jit_context_set_str_option;
|
|
|
|
gcc_jit_context_zero;
|
|
|
|
gcc_jit_field_as_object;
|
|
|
|
gcc_jit_function_as_object;
|
|
|
|
gcc_jit_function_dump_to_dot;
|
|
|
|
gcc_jit_function_get_param;
|
|
|
|
gcc_jit_function_new_block;
|
|
|
|
gcc_jit_function_new_local;
|
|
|
|
gcc_jit_location_as_object;
|
|
|
|
gcc_jit_lvalue_as_object;
|
|
|
|
gcc_jit_lvalue_as_rvalue;
|
|
|
|
gcc_jit_lvalue_access_field;
|
|
|
|
gcc_jit_lvalue_get_address;
|
|
|
|
gcc_jit_object_get_context;
|
|
|
|
gcc_jit_object_get_debug_string;
|
|
|
|
gcc_jit_param_as_lvalue;
|
|
|
|
gcc_jit_param_as_object;
|
|
|
|
gcc_jit_param_as_rvalue;
|
|
|
|
gcc_jit_result_get_code;
|
2015-01-12 18:14:02 +01:00
|
|
|
gcc_jit_result_get_global;
|
2014-11-11 22:55:52 +01:00
|
|
|
gcc_jit_result_release;
|
|
|
|
gcc_jit_rvalue_access_field;
|
|
|
|
gcc_jit_rvalue_as_object;
|
|
|
|
gcc_jit_rvalue_dereference;
|
|
|
|
gcc_jit_rvalue_dereference_field;
|
|
|
|
gcc_jit_rvalue_get_type;
|
|
|
|
gcc_jit_struct_as_type;
|
|
|
|
gcc_jit_struct_set_fields;
|
|
|
|
gcc_jit_type_as_object;
|
|
|
|
gcc_jit_type_get_const;
|
|
|
|
gcc_jit_type_get_pointer;
|
|
|
|
gcc_jit_type_get_volatile;
|
|
|
|
|
|
|
|
local: *;
|
2015-06-30 21:27:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# Add support for adding arbitrary command-line options (PR jit/66628).
|
|
|
|
LIBGCCJIT_ABI_1 {
|
|
|
|
global:
|
|
|
|
gcc_jit_context_add_command_line_option;
|
|
|
|
} LIBGCCJIT_ABI_0;
|
2015-06-30 21:38:12 +02:00
|
|
|
|
|
|
|
# Add support for disabling the check for unreachable blocks (PR jit/66546).
|
|
|
|
LIBGCCJIT_ABI_2 {
|
|
|
|
global:
|
|
|
|
gcc_jit_context_set_bool_allow_unreachable_blocks;
|
|
|
|
} LIBGCCJIT_ABI_1;
|
2015-06-30 22:39:50 +02:00
|
|
|
|
|
|
|
# Add support for switch statements.
|
|
|
|
LIBGCCJIT_ABI_3 {
|
|
|
|
global:
|
|
|
|
gcc_jit_block_end_with_switch;
|
|
|
|
gcc_jit_case_as_object;
|
|
|
|
gcc_jit_context_new_case;
|
|
|
|
} LIBGCCJIT_ABI_2;
|
2015-08-03 22:14:21 +02:00
|
|
|
|
|
|
|
# Add timing API.
|
|
|
|
LIBGCCJIT_ABI_4 {
|
|
|
|
global:
|
|
|
|
gcc_jit_context_get_timer;
|
|
|
|
gcc_jit_context_set_timer;
|
|
|
|
gcc_jit_timer_new;
|
|
|
|
gcc_jit_timer_release;
|
|
|
|
gcc_jit_timer_push;
|
|
|
|
gcc_jit_timer_pop;
|
|
|
|
gcc_jit_timer_print;
|
|
|
|
};
|
2015-08-25 22:25:05 +02:00
|
|
|
|
|
|
|
LIBGCCJIT_ABI_5 {
|
|
|
|
global:
|
|
|
|
gcc_jit_context_set_bool_use_external_driver;
|
|
|
|
} LIBGCCJIT_ABI_4;
|
2016-05-20 21:12:49 +02:00
|
|
|
|
|
|
|
LIBGCCJIT_ABI_6 {
|
|
|
|
global:
|
|
|
|
gcc_jit_rvalue_set_bool_require_tail_call;
|
|
|
|
} LIBGCCJIT_ABI_5;
|