]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/jit/ChangeLog
unwind-arm-common.h: Revert previous commit.
[thirdparty/gcc.git] / gcc / jit / ChangeLog
CommitLineData
7c8db13e
DM
12015-01-08 David Malcolm <dmalcolm@redhat.com>
2
3 * libgccjit.h (struct gcc_jit_context): Rewrite the descriptive
4 comment.
5
303e1d56
DM
62015-01-08 David Malcolm <dmalcolm@redhat.com>
7
8 * docs/topics/contexts.rst (Error-handling): Document new
9 entrypoint gcc_jit_context_get_last_error.
10 * docs/_build/texinfo/libgccjit.texi: Regenerate.
11 * jit-recording.c (gcc::jit::recording::context::context):
12 Initialize new fields "m_last_error_str" and
13 "m_owns_last_error_str".
14 (gcc::jit::recording::context::~context): Clean up
15 m_last_error_str, if needed.
16 (gcc::jit::recording::context::add_error_va): Update
17 m_last_error_str and m_owns_last_error_str, freeing the old
18 value if appropriate.
19 (gcc::jit::recording::context::get_last_error): New function.
20 * jit-recording.h (gcc::jit::recording::context::get_last_error):
21 New function.
22 (gcc::jit::recording::context): New fields m_last_error_str and
23 m_owns_last_error_str.
24 * libgccjit.c (gcc_jit_context_get_last_error): New function.
25 * libgccjit.h (gcc_jit_context_get_last_error): New declaration.
26 * libgccjit.map (gcc_jit_context_get_last_error): New function.
27
eb4c16eb
DM
282015-01-08 David Malcolm <dmalcolm@redhat.com>
29
30 * Make-lang.in (jit_OBJS): Add jit/jit-logging.o.
31 * docs/internals/index.rst (Overview of code structure): Mention
32 gcc_jit_context_set_logfile, and embed the example logfile.
33 * docs/internals/test-hello-world.exe.log.txt: New file: example
34 of a logfile.
35 * docs/topics/contexts.rst (Debugging): Add documentation
36 for gcc_jit_context_set_logfile.
37 * docs/_build/texinfo/libgccjit.texi: Regenerate.
38 * dummy-frontend.c: Include "jit-logging.h".
39 (jit_langhook_init): Assert that there is an active playback
40 context. If it has a logger, log entry/exit to this function.
41 (jit_langhook_write_globals): Likewise.
42 * jit-common.h (gcc::jit::logger): New forward declaration.
43 * jit-logging.c: New file.
44 * jit-logging.h: New file.
45 * jit-playback.c: Include "jit-logging.h".
46 (gcc::jit::playback::context::context): Initialize the log_user
47 base class from the recording context's logger (if any). Use
48 JIT_LOG_SCOPE to log entry/exit from the function body.
49 (gcc::jit::playback::context::~context): Use JIT_LOG_SCOPE to
50 log entry/exit from the function body.
51 (gcc::jit::playback::build_stmt_list): Likewise.
52 (gcc::jit::playback::function::postprocess): Likewise.
53 (gcc::jit::playback::context::compile): Likewise. Log the
54 entry/exit to toplev::main and toplev::finalize. Log the
55 fake argv passed to toplev::main.
56 (gcc::jit::playback::context::acquire_mutex): Use JIT_LOG_SCOPE to
57 log entry/exit from the function body.
58 (gcc::jit::playback::context::release_mutex): Likewise.
59 (gcc::jit::playback::context::make_fake_args): Likewise.
60 (gcc::jit::playback::context::extract_any_requested_dumps):
61 Likewise.
62 (gcc::jit::playback::context::convert_to_dso): Likewise. Also,
63 log the arguments that the driver is invoked with.
64 (gcc::jit::playback::context::dlopen_built_dso): Likewise. Pass
65 the logger to the result object.
66 (gcc::jit::playback::context::replay): Use JIT_LOG_SCOPE to
67 log entry/exit from the function body.
68 (gcc::jit::playback::context::dump_generated_code): Likewise.
69 (gcc::jit::playback::context::handle_locations): Likewise.
70 * jit-playback.h (gcc::jit::playback::context): Make this be
71 a subclass of gcc::jit::log_user.
72 * jit-recording.c: Include "jit-logging.h".
73 (gcc::jit::recording::context::context: Initialize the logger to
74 NULL for root contexts, or to the parent's logger for child
75 contexts.
76 (gcc::jit::recording::context::~context): Use JIT_LOG_SCOPE to
77 log entry/exit from the function body.
78 (gcc::jit::recording::context::replay_into): Likewise.
79 (gcc::jit::recording::context::disassociate_from_playback):
80 Likewise.
81 (gcc::jit::recording::context::compile): Likewise.
82 (recording::context::add_error_va): Likewise. Also, log the
83 error.
84 (gcc::jit::recording::context::validate): Use JIT_LOG_SCOPE to
85 log entry/exit from the function body.
86 * jit-recording.h: Include "jit-logging.h".
87 (gcc::jit::recording::context): Make this be a subclass of
88 gcc::jit::log_user.
89 * jit-result.c: Include "jit-common.h" and "jit-logging.h".
90 (gcc::jit::result::result): Add logger param, recording it.
91 Use JIT_LOG_SCOPE to log entry/exit from the function body.
92 (gcc::jit::result::~result(): Use JIT_LOG_SCOPE to
93 log entry/exit from the function body.
94 (gcc::jit::result::get_code): Likewise.
95 * jit-result.h (gcc::jit::result): Make this be a subclass of
96 gcc::jit::log_user.
97 (gcc::jit::result::result): Add logger parameter.
98 * libgccjit++.h (gccjit::context::set_logfile): New function.
99 * libgccjit.c: Include "jit-logging.h".
100 (gcc_jit_context_acquire): Log the context.
101 (gcc_jit_context_release): Use JIT_LOG_FUNC to
102 log entry/exit from the function body, and log the context.
103 (gcc_jit_context_new_child_context): Likewise, logging both
104 contexts.
105 (gcc_jit_context_new_location): Use JIT_LOG_FUNC to
106 log entry/exit from the function body.
107 (gcc_jit_context_get_type): Likewise.
108 (gcc_jit_context_get_int_type): Likewise.
109 (gcc_jit_context_new_array_type): Likewise.
110 (gcc_jit_context_new_field): Likewise.
111 (gcc_jit_context_new_struct_type): Likewise.
112 (gcc_jit_context_new_opaque_struct): Likewise.
113 (gcc_jit_struct_set_fields): Likewise.
114 (gcc_jit_context_new_union_type): Likewise.
115 (gcc_jit_context_new_function_ptr_type): Likewise.
116 (gcc_jit_context_new_param): Likewise.
117 (gcc_jit_context_new_function): Likewise.
118 (gcc_jit_context_get_builtin_function): Likewise.
119 (gcc_jit_function_get_param): Likewise.
120 (gcc_jit_function_dump_to_dot): Likewise.
121 (gcc_jit_function_new_block): Likewise.
122 (gcc_jit_context_new_global): Likewise.
123 (gcc_jit_context_new_rvalue_from_int): Likewise.
124 (gcc_jit_context_zero): Likewise.
125 (gcc_jit_context_one): Likewise.
126 (gcc_jit_context_new_rvalue_from_double): Likewise.
127 (gcc_jit_context_new_rvalue_from_ptr): Likewise.
128 (gcc_jit_context_null): Likewise.
129 (gcc_jit_context_new_string_literal): Likewise.
130 (gcc_jit_context_new_unary_op): Likewise.
131 (gcc_jit_context_new_binary_op): Likewise.
132 (gcc_jit_context_new_comparison): Likewise.
133 (gcc_jit_context_new_call): Likewise.
134 (gcc_jit_context_new_call_through_ptr): Likewise.
135 (gcc_jit_context_new_cast): Likewise.
136 (gcc_jit_context_new_array_access): Likewise.
137 (gcc_jit_lvalue_access_field): Likewise.
138 (gcc_jit_rvalue_access_field): Likewise.
139 (gcc_jit_rvalue_dereference_field): Likewise.
140 (gcc_jit_rvalue_dereference): Likewise.
141 (gcc_jit_lvalue_get_address): Likewise.
142 (gcc_jit_function_new_local): Likewise.
143 (gcc_jit_block_add_eval): Likewise.
144 (gcc_jit_block_add_assignment): Likewise.
145 (gcc_jit_block_add_assignment_op): Likewise.
146 (gcc_jit_block_end_with_conditional): Likewise.
147 (gcc_jit_block_add_comment): Likewise.
148 (gcc_jit_block_end_with_jump): Likewise.
149 (gcc_jit_block_end_with_return): Likewise.
150 (gcc_jit_block_end_with_void_return): Likewise.
151 (gcc_jit_context_set_str_option): Likewise.
152 (gcc_jit_context_set_int_option): Likewise.
153 (gcc_jit_context_set_bool_option): Likewise.
154 (gcc_jit_context_enable_dump): Likewise.
155 (gcc_jit_context_compile): Likewise. Also log the context,
156 and the result.
157 (gcc_jit_context_dump_to_file): Likewise.
158 (gcc_jit_context_set_logfile): New function.
159 (gcc_jit_context_get_first_error): Use JIT_LOG_FUNC to
160 log entry/exit from the function body.
161 (gcc_jit_result_get_code): Likewise. Also log the fnname)
162 and the ptr to be returned.
163 (gcc_jit_result_release): Likewise. Also log the result.
164 * libgccjit.h: Include <stdio.h>, since we need FILE *.
165 (gcc_jit_context_set_logfile): New declaration.
166 * libgccjit.map (gcc_jit_context_set_logfile): New.
167
c211cd23
DM
1682015-01-07 David Malcolm <dmalcolm@redhat.com>
169
170 * jit-recording.h (gcc::jit::recording::type::is_void): New
171 virtual function.
172 (gcc::jit::recording::memento_of_get_type::is_void): New
173 function, overriding default implementation.
174 * libgccjit.c (gcc_jit_rvalue_dereference): Verify that
175 the underlying type is not "void".
176
18146f45
DM
1772015-01-07 David Malcolm <dmalcolm@redhat.com>
178
179 * docs/topics/expressions.rst (Unary Operations): Add
180 GCC_JIT_UNARY_OP_ABS.
181 * jit-playback.c (gcc::jit::playback::context::new_unary_op):
182 Likewise.
183 * jit-recording.c (unary_op_strings): Likewise.
184 * libgccjit.c (gcc_jit_context_new_unary_op): Update checking
185 of "op" to reflect addition of GCC_JIT_UNARY_OP_ABS.
186 * libgccjit.h (enum gcc_jit_unary_op): Add GCC_JIT_UNARY_OP_ABS.
187 * docs/_build/texinfo/libgccjit.texi: Regenerate.
188
11af98ff
DM
1892015-01-07 David Malcolm <dmalcolm@redhat.com>
190
191 * jit-recording.h (gcc::jit::recording::memento_of_get_type): Fix
192 typo in comment.
193
433d16df
DM
1942015-01-07 David Malcolm <dmalcolm@redhat.com>
195
196 * TODO.rst (Test suite): Remove item about running C++ testcases.
197 * docs/internals/index.rst (Working on the JIT library): Add
198 "c++" to the enabled languages in the suggested "configure"
199 invocation, and add a description of why this is necessary.
200 * docs/_build/texinfo/libgccjit.texi: Regenerate.
201
50bb6c8e
DM
2022015-01-07 David Malcolm <dmalcolm@redhat.com>
203
204 * docs/internals/index.rst: Update to reflect that built
205 testcases are now test-foo.c.exe, rather than test-foo.exe.
206 * docs/_build/texinfo/libgccjit.texi: Regenerate.
207
1e3b6a3d
JJ
2082015-01-05 Jakub Jelinek <jakub@redhat.com>
209
210 Update copyright years.
211
e8af59bc
DM
2122014-12-19 David Malcolm <dmalcolm@redhat.com>
213
214 * jit-playback.c (gcc::jit::playback::context::build_cast): In
215 case BOOLEAN_TYPE, don't assume that the source expression is
216 of type "int".
217
5afd44e3
DM
2182014-12-19 David Malcolm <dmalcolm@redhat.com>
219
220 * jit-recording.c (gcc::jit::recording::context::context): When
221 copying string options from a parent context, take a copy of the
222 underlying buffers, rather than simply copying the pointer.
223
1f0858d7
DM
2242014-12-19 David Malcolm <dmalcolm@redhat.com>
225
226 * jit-recording.c (gcc::jit::recording::context::set_str_option):
227 Handle NULL.
228
35291c7d
DM
2292014-12-11 David Malcolm <dmalcolm@redhat.com>
230
231 * docs/cp/topics/contexts.rst (gccjit::context::set_str_option):
232 Document new function.
233 * docs/_build/texinfo/libgccjit.texi: Regenerate.
234
7b31ff5e
DM
2352014-12-10 Ulrich Drepper <drepper@gmail.com>
236
237 Minor interface cleanups of libgccjit
238 * jit-playback.c (convert_to_dso): Use auto_vec instead
239 of automatic array to build up command line.
240 * jit-recording.c (recording::context::set_str_option):
241 Make copy of the string.
242 (recording::context::~context): Free string options.
243 * jit-recording.h (recording::context): Adjust type
244 of m_str_options member.
245 * libgccjit.h: Adjust comment about
246 gcc_jit_context_set_str_option parameter being used after
247 the call.
248 Update comment now that all interfaces are copy strings
249 if necessary.
250 * libgccjit++.h (gccjit::context): Add set_str_option
251 member function.
252
29df5715
DM
2532014-12-10 David Malcolm <dmalcolm@redhat.com>
254
255 * docs/cp/index.rst: New file.
256 * docs/cp/intro/index.rst: New file.
257 * docs/cp/intro/tutorial01.rst: New file.
258 * docs/cp/intro/tutorial02.rst: New file.
259 * docs/cp/intro/tutorial03.rst: New file.
260 * docs/cp/intro/tutorial04.rst: New file.
261 * docs/cp/topics/contexts.rst: New file.
262 * docs/cp/topics/expressions.rst: New file.
263 * docs/cp/topics/functions.rst: New file.
264 * docs/cp/topics/index.rst: New file.
265 * docs/cp/topics/locations.rst: New file.
266 * docs/cp/topics/objects.rst: New file.
267 * docs/cp/topics/results.rst: New file.
268 * docs/cp/topics/types.rst: New file.
269 * docs/examples/tut01-hello-world.cc: New file.
270 * docs/examples/tut02-square.c: Fix missing newline in output.
271 * docs/examples/tut02-square.cc: New file.
272 * docs/examples/tut03-sum-of-squares.cc: New file.
273 * docs/examples/tut04-toyvm/toyvm.cc: New file.
274 * docs/index.rst: Move summary to above the table of contents.
275 Add text about the C vs C++ APIs.
276 * docs/topics/contexts.rst: Fix a typo.
277
278 * docs/_build/texinfo/libgccjit.texi: Regenerate.
279 * docs/_build/texinfo/factorial1.png: New file.
280 * docs/_build/texinfo/sum-of-squares1.png: New file.
281
5cd614ce
DM
2822014-12-09 David Malcolm <dmalcolm@redhat.com>
283
284 * docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile): Move
285 logic for determine "funcname" to new function...
286 (get_function_name): ...here, adding logic to skip any leading
287 path from the filename.
288 (toyvm_function_parse): Use the filename for fn_filename, rather
289 than "name", so that the debugger can locate the source .toy
290 file.
291 (toyvm_function_parse): Don't fclose a NULL FILE *.
292
2712de78
DM
2932014-12-09 David Malcolm <dmalcolm@redhat.com>
294
295 PR jit/63854
296 * docs/internals/index.rst (Running under valgrind): New
297 subsection.
298 (docs/_build/texinfo/libgccjit.texi): Regenerate.
299
d1e5f2c7
DM
3002014-12-09 David Malcolm <dmalcolm@redhat.com>
301
302 PR jit/64206
303 * Make-lang.in (jit_OBJS): Add jit/jit-tempdir.o.
304 * jit-common.h (gcc::jit::tempdir): New forward decl.
305 * jit-playback.c: Include jit-tempdir.h.
306 (gcc::jit::playback::context::context): Initialize m_tempdir.
307 (gcc::jit::playback::context::~context): Move tempdir
308 cleanup to new file jit-tempdir.c
309 (make_tempdir_path_template): Move to new file jit-tempdir.c.
310 (gcc::jit::playback::context::compile): Move tempdir creation
311 to new tempdir object in new file jit-tempdir.c.
312 (gcc::jit::playback::context::make_fake_args): Get path from
313 tempdir object rather than from member data.
314 (gcc::jit::playback::context::convert_to_dso): Likewise.
315 (gcc::jit::playback::context::dlopen_built_dso): Likewise.
316 (gcc::jit::playback::context::dump_generated_code): Likewise.
317 (gcc::jit::playback::context::get_path_c_file): New function.
318 (gcc::jit::playback::context::get_path_s_file): New function.
319 (gcc::jit::playback::context::get_path_so_file): New function.
320 * jit-playback.h (gcc::jit::playback::context::get_path_c_file):
321 New function.
322 (gcc::jit::playback::context::get_path_s_file): New function.
323 (gcc::jit::playback::context::get_path_so_file): New function.
324 (gcc::jit::playback::context): Move fields "m_path_template",
325 "m_path_tempdir", "m_path_c_file", "m_path_s_file",
326 "m_path_so_file" to new jit::tempdir class; add field "m_tempdir".
327 * jit-tempdir.c: New file.
328 * jit-tempdir.h: New file.
329
38771e4e
DM
3302014-12-09 David Malcolm <dmalcolm@redhat.com>
331
332 * jit-playback.c (gcc::jit::playback::context::compile): Acquire the
333 mutex here, immediately before using toplev, and release it here, on
334 each exit path after acquisition.
335 (jit_mutex): Move this variable here, from jit-recording.c.
336 (gcc::jit::playback::context::acquire_mutex): New function, based on
337 code in jit-recording.c.
338 (gcc::jit::playback::context::release_mutex): Likewise.
339 * jit-playback.h (gcc::jit::playback::context::acquire_mutex): New
340 function.
341 (gcc::jit::playback::context::release_mutex): New function.
342 * jit-recording.c (jit_mutex): Move this variable to jit-playback.c.
343 (gcc::jit::recording::context::compile): Move mutex-handling from
344 here into jit-playback.c's gcc::jit::playback::context::compile.
345 * notes.txt: Update to show the new locations of ACQUIRE_MUTEX
346 and RELEASE_MUTEX.
347
38f4f641
DM
3482014-12-09 David Malcolm <dmalcolm@redhat.com>
349
350 * jit-playback.c (gcc::jit::playback::context::compile): Move the
351 dlopen code into...
352 (gcc::jit::playback::context::dlopen_built_dso): ...this new
353 function.
354 * jit-playback.h (gcc::jit::playback::context::dlopen_built_dso):
355 New function.
356
82e0c914
DM
3572014-12-09 David Malcolm <dmalcolm@redhat.com>
358
359 PR jit/64166
360 * docs/topics/contexts.rst (Debugging): Add description of
361 gcc_jit_context_enable_dump.
362 * docs/_build/texinfo/libgccjit.texi: Regenerate.
363 * jit-playback.c: Include context.h.
364 (class auto_argvec): New class.
365 (auto_argvec::~auto_argvec): New function.
366 (gcc::jit::playback::context::compile): Convert fake_args to be
367 an auto_argvec, so that it can contain dynamically-allocated
368 strings. Construct a vec of all requested dumps, and pass it to
369 make_fake_args. Extract requested dumps between the calls to
370 toplev::main and toplev::finalize.
371 (gcc::jit::playback::context::make_fake_args): Convert param
372 "argvec" to be a vec <char *>, and gain a "requested_dumps"
373 param. Convert to dynamically-allocated arg strings by converting
374 ADD_ARG to take a copy of the arg, and add ADD_ARG_TAKE_OWNERSHIP
375 for args that are already a copy. Add args for all requested dumps.
376 (gcc::jit::playback::context::extract_any_requested_dumps): New
377 function.
378 (gcc::jit::playback::context::read_dump_file): New function.
379 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
380 Convert param "argvec" to be a vec <char *>, and gain a
381 "requested_dumps" param.
382 (gcc::jit::playback::context::extract_any_requested_dumps): New
383 function.
384 (gcc::jit::playback::context::read_dump_file): New function.
385 * jit-recording.c (gcc::jit::recording::context::enable_dump): New
386 function.
387 (gcc::jit::recording::context::get_all_requested_dumps): New
388 function.
389 * jit-recording.h (gcc::jit::recording::requested_dump): New
390 struct.
391 (gcc::jit::recording::context::enable_dump): New function.
392 (gcc::jit::recording::context::get_all_requested_dumps): New
393 function.
394 (gcc::jit::recording::context::m_requested_dumps): New field.
395 * libgccjit.c (gcc_jit_context_enable_dump): New API entrypoint.
396 * libgccjit.h (gcc_jit_context_enable_dump): New API entrypoint.
397 * libgccjit.map (gcc_jit_context_enable_dump): New API entrypoint.
398
53b730ff
DM
3992014-12-08 David Malcolm <dmalcolm@redhat.com>
400
401 * libgccjit++.h: Indent the forward declarations of the classes to
402 show the inheritance hierarchy.
403
0f379445
DM
4042014-12-08 David Malcolm <dmalcolm@redhat.com>
405
406 * notes.txt: Show the beginning and ending of
407 recording::context::compile vs playback::context::compile. Show
408 the creation and unlinking of the tempdir. Show toplev::finalize.
409 Move "RELEASE MUTEX" to the correct location. Show
410 gcc_jit_result_release, and indicate where the
411 dlopen/dlsym/dlclose occur.
412
81ba15f1
DM
4132014-12-01 David Malcolm <dmalcolm@redhat.com>
414
415 * docs/examples/tut02-square.c (main): Release the context
416 earlier, to show that this is possible. Update error-handling
417 to avoid a double-release of the context, and to avoid
418 releasing a NULL result.
419 * docs/intro/tutorial02.rst: Discuss gcc_jit_context_release.
420 * docs/topics/functions.rst (GCC_JIT_FUNCTION_EXPORTED): Emphasize
421 * docs/topics/results.rst (gcc_jit_result): Mention that this
422 controls the lifetimes of machine code functions.
423 (gcc_jit_result_get_code): Spell out the requirements for this
424 to succeed, and the lifetime of the result.
425 (gcc_jit_result_release): Mention that this invalidates any code
426 that was obtained from the result.
427 * docs/_build/texinfo/libgccjit.texi: Regenerate.
428
e250f0dc
DM
4292014-12-01 David Malcolm <dmalcolm@redhat.com>
430
431 PR jit/64018
432 * docs/intro/tutorial02.rst: Spell out lifetime of generated code.
433 Add description of error-handling, taken in part from...
434 * docs/topics/contexts.rst (Error-handling): Expand, and move some
435 content to tutorial02.rst.
436 * docs/_build/texinfo/libgccjit.texi: Regenerate.
437
eeafb319
DM
4382014-12-01 David Malcolm <dmalcolm@redhat.com>
439
440 PR jit/64020
441 * docs/topics/types.rst (Standard types) Add new enum values to
442 the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT,
443 GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
444 Widen the left-hand column so that
445 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit.
446 * docs/_build/texinfo/libgccjit.texi: Regenerate.
447
448 * jit-builtins.c: Include stringpool.h and jit-playback.h.
449 Move everything out of the gcc::jit::recording namespace into
450 just gcc::jit.
451 (struct builtin_data): Add fields "fnclass", "attr", and
452 "implicit_p".
453 (DEF_BUILTIN): Update macro so populate the new fields.
454 (builtins_manager::builtins_manager): Update for move out of
455 recording namespace. Initialize the m_attributes array.
456 (builtins_manager::get_builtin_function): Likewise.
457 (builtins_manager::get_builtin_function_by_id): New function.
458 (builtins_manager::make_builtin_function): Update for move out of
459 recording namespace. Add fix for PR jit/64020 by detecting
460 specific builtin ids and having them ensure that builtins for
461 other ids are created as necessary.
462 (builtins_manager::get_type): Update for move out of recording
463 namespace.
464 (builtins_manager::make_type): Likewise. Add some missing
465 #undefs.
466 (builtins_manager::make_primitive_type): Update for move out of
467 recording namespace. Implement the three BT_COMPLEX_ cases and
468 BT_DOUBLE_PTR.
469 (builtins_manager::make_fn_type): Update for move out of recording
470 namespace.
471 (builtins_manager::make_ptr_type): Likewise.
472 (builtins_manager::finish_playback): New function.
473 (builtins_manager::get_class): New function.
474 (builtins_manager::implicit_p): New function.
475 (builtins_manager::get_attrs_tree): Two new functions.
476 (builtins_manager::make_attrs_tree): New function.
477
478 * jit-builtins.h: Move everything out of the gcc::jit::recording
479 namespace into just gcc::jit.
480 (enum built_in_attribute): New.
481 (builtins_manager::builtins_manager): Update decl for namespace
482 change.
483 (builtins_manager::get_builtin_function): Likewise.
484 (builtins_manager::get_class): New.
485 (builtins_manager::implicit_p): New.
486 (builtins_manager::get_attrs_tree): Two new functions.
487 (builtins_manager::make_attrs_tree): New function.
488 (builtins_manager::finish_playback): New.
489 (builtins_manager::get_builtin_function_by_id): New.
490 (builtins_manager::make_builtin_function): Update decl for
491 namespace change.
492 (builtins_manager::get_type): Likewise.
493 (builtins_manager::make_type): Likewise.
494 (builtins_manager::make_primitive_type): Likewise.
495 (builtins_manager::make_fn_type): Likewise.
496 (builtins_manager::make_ptr_type): Likewise.
497 (builtins_manager): Likewise for fields. Add new field
498 "m_attributes".
499
500 * jit-common.h (NUM_GCC_JIT_TYPES): Update.
501 (builtins_manager): Update forward decl to reflect namespace
502 change.
503
504 * jit-playback.c: Include attribs.h and jit-builtins.h.
505 (gcc::jit::playback::context::get_tree_node_for_type): Add cases
506 for the new COMPLEX_ types.
507 (gcc::jit::playback::context::new_function): If creating a
508 builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl,
509 and call set_builtin_decl.
510 (gcc::jit::playback::context::replay): If we have a
511 builtins_manager, call its finish_playback method when we're done.
512
513 * jit-playback.h:
514 (gcc::jit::playback::context::get_builtins_manager): New function.
515
516 * jit-recording.c
517 (gcc::jit::recording::context::get_builtins_manager): New function.
518 (gcc::jit::recording::get_builtin_function): Use
519 get_builtins_manager, in case we're a child context.
520 (gcc::jit::recording::memento_of_get_type::dereference): Add the
521 COMPLEX_ types.
522 (gcc::jit::recording::memento_of_get_type::is_int): Likewise.
523 (gcc::jit::recording::memento_of_get_type::is_float): Likewise.
524 (gcc::jit::recording::memento_of_get_type::is_bool): Likewise.
525 (get_type_strings): Likewise.
526
527 * jit-recording.h
528 (gcc::jit::recording::context::get_builtins_manager): New.
529
530 * libgccjit.h (enum gcc_jit_types): Add
531 GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE,
532 GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE.
533
23844fd7
DM
5342014-12-01 David Malcolm <dmalcolm@redhat.com>
535
536 * jit-builtins.c
537 (gcc::jit::recording::builtins_manager::get_builtin_function):
538 Check for NULL return from make_builtin_function.
539 (gcc::jit::recording::builtins_manager::make_builtin_function):
540 Check for NULL return from get_type.
541
c6760a13
DM
5422014-12-01 David Malcolm <dmalcolm@redhat.com>
543
544 * jit-playback.c (gcc::jit::playback::context::compile): Move DSO
545 creation code into...
546 (gcc::jit::playback::context::convert_to_dso): New function.
547 * jit-playback.h (gcc::jit::playback::context::convert_to_dso):
548 New function.
549
8f50ee3c
DM
5502014-12-01 David Malcolm <dmalcolm@redhat.com>
551
552 * jit-playback.c (gcc::jit::playback::context::compile): Use an
553 auto_vec<const char *> rather than a const char *[20] for the
554 top-level argv, and move the logic to build it to...
555 (gcc::jit::playback::context::make_fake_args): New function.
556 * jit-playback.h (gcc::jit::playback::context::make_fake_args):
557 New function.
558
56dea35f
DM
5592014-12-01 David Malcolm <dmalcolm@redhat.com>
560
561 * Make-lang.in (jit_OBJS): Add jit/jit-result.o.
562 * jit-playback.c: Include new header jit-result.h.
563 (gcc::jit::result::result): Move to new file jit-result.c.
564 (gcc::jit::result::~result): Likewise.
565 (gcc::jit::playback::result): Likewise.
566 * jit-recording.h (class gcc::jit::result): Move to new
567 header jit-result.h.
568 * jit-result.c: New file, to contain...
569 (gcc::jit::result::result): Move here from jit-playback.c,
570 removing erroneous "playback" namespace from comment.
571 (gcc::jit::result::~result): Likewise.
572 (gcc::jit::playback::result): Likewise.
573 * jit-result.h: New file, to contain...
574 (class gcc::jit::result): Move from jit-recording.h.
575 * libgccjit.c: Include jit-result.h.
576 (gcc_jit_result_get_code): Update comment to reflect move
577 of implementation.
578 (gcc_jit_result_release): Likewise.
579
52b9468f
DM
5802014-12-01 David Malcolm <dmalcolm@redhat.com>
581
582 PR jit/63854
583 * docs/examples/tut04-toyvm/toyvm.c
584 (toyvm_compiled_function): New typedef.
585 (toyvm_compiled_func) Rename to...
586 (toyvm_compiled_code) ...this.
587 (struct toyvm_compiled_function): New struct.
588 (toyvm_function_compile): Return a toyvm_compiled_function *
589 rather than a toyvm_compiled_func, so that the caller can fully
590 clean things up. Free "funcname".
591 (test_script): Update for change to toyvm_function_compile.
592 Clean up the toyvm_compiled_function.
593 (main): Likewise.
594 (docs/intro/tutorial04.rst): Update to reflect the above changes,
595 and to better spell out the lifetime of the compiled code.
596
c8d19a69
DM
5972014-12-01 David Malcolm <dmalcolm@redhat.com>
598
599 PR jit/63854
600 * jit-builtins.c
601 (gcc::jit::recording::builtins_manager::make_fn_type): Call the
602 context's new_function_type method, rather than directly creating
603 a function_type instance.
604 * jit-recording.c
605 (gcc::jit::recording::context::new_function_type): New method,
606 adapted from part of...
607 (gcc::jit::recording::context::new_function_ptr_type): ...this.
608 Update to call new_function_type.
609 * jit-recording.h
610 (gcc::jit::recording::context::new_function_type): New method.
611
c985705a
DM
6122014-12-01 David Malcolm <dmalcolm@redhat.com>
613
614 PR jit/63969
615 * jit-playback.c: Ensure that ctxt_progname is non-NULL.
616
b957b2e0
DM
6172014-11-19 David Malcolm <dmalcolm@redhat.com>
618
619 PR jit/63854
620 * jit-playback.c (gcc::jit::playback::compound_type::set_fields):
621 Convert param from const vec<playback::field *> & to
622 const auto_vec<playback::field *> *.
623 (gcc::jit::playback::context::new_function_type): Convert param
624 "param_types" from vec<type *> * to const auto_vec<type *> *.
625 (gcc::jit::playback::context::new_function): Convert param
626 "params" from vec<param *> * to const auto_vec<param *> *.
627 (gcc::jit::playback::context::build_call): Convert param "args"
628 from vec<rvalue *> to const auto_vec<rvalue *> *.
629 (gcc::jit::playback::context::new_call): Likewise.
630 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
631 (wrapper_finalizer): New function.
632 (gcc::jit::playback::wrapper::operator new): Call the finalizer
633 variant of ggc_internal_cleared_alloc, supplying
634 wrapper_finalizer.
635 (gcc::jit::playback::function::finalizer): New.
636 (gcc::jit::playback::block::finalizer): New.
637 (gcc::jit::playback::source_file::finalizer): New.
638 (gcc::jit::playback::source_line::finalizer): New.
639
640 * jit-playback.h
641 (gcc::jit::playback::context::new_function_type): Convert param
642 "param_types" from vec<type *> * to const auto_vec<type *> *.
643 (gcc::jit::playback::context::new_function): Convert param
644 "params" from vec<param *> * to const auto_vec<param *> *.
645 (gcc::jit::playback::context::new_call): Convert param
646 "args" from vec<rvalue *> to const auto_vec<rvalue *> *.
647 (gcc::jit::playback::context::new_call_through_ptr): Likewise.
648 (gcc::jit::playback::context::build_call): Likewise.
649 (gcc::jit::playback::context): Convert fields "m_functions",
650 "m_source_files", "m_cached_locations" from vec to auto_vec.
651 (gcc::jit::playback::wrapper::finalizer): New virtual function.
652 (gcc::jit::playback::compound_type::set_fields): Convert param fro
653 const vec<playback::field *> & to
654 const auto_vec<playback::field *> *.
655 (gcc::jit::playback::function::finalizer): New.
656 (gcc::jit::playback::block::finalizer): New.
657 (gcc::jit::playback::source_file::finalizer): New.
658 (gcc::jit::playback::source_line::finalizer): New.
659
660 * jit-recording.c
661 (gcc::jit::recording::function_type::replay_into): Convert local
662 from a vec into an auto_vec.
663 (gcc::jit::recording::fields::replay_into): Likewise.
664 (gcc::jit::recording::function::replay_into): Likewise.
665 (gcc::jit::recording::call::replay_into): Likewise.
666 (gcc::jit::recording::call_through_ptr::replay_into): Likewise.
667
668 * jit-recording.h (gcc::jit::recording::context): Convert fields
669 "m_mementos", "m_compound_types", "m_functions" from vec<> to
670 auto_vec <>.
671 (gcc::jit::recording::function_type::get_param_types): Convert
672 return type from vec<type *> to const vec<type *> &.
673 (gcc::jit::recording::function_type): Convert field
674 "m_param_types" from a vec<> to an auto_vec<>.
675 (gcc::jit::recording::fields): Likewise for field "m_fields".
676 (gcc::jit::recording::function::get_params): Convert return type
677 from vec <param *> to const vec<param *> &.
678 (gcc::jit::recording::function): Convert fields "m_params",
679 "m_locals", "m_blocks" from vec<> to auto_vec<>.
680 (gcc::jit::recording::block): Likewise for field "m_statements".
681 vec<> to auto_vec<>.
682 (gcc::jit::recording::call): Likewise for field "m_args".
683 (gcc::jit::recording::call_through_ptr): Likewise.
684
79cafc7a
DM
6852014-11-19 David Malcolm <dmalcolm@redhat.com>
686
687 PR jit/63854
688 * jit-recording.c (recording::function::validate): Convert
689 "worklist" from vec<> to autovec<> to fix a leak.
690
35485da9
DM
6912014-11-11 David Malcolm <dmalcolm@redhat.com>
692
693 * ChangeLog.jit: New.
694 * ChangeLog: New.
695 * Make-lang.in: New.
696 * TODO.rst: New.
697 * config-lang.in: New.
698 * docs/Makefile: New.
699 * docs/_build/texinfo/Makefile: New.
700 * docs/_build/texinfo/factorial.png: New.
701 * docs/_build/texinfo/libgccjit.texi: New.
702 * docs/_build/texinfo/sum-of-squares.png: New.
703 * docs/conf.py: New.
704 * docs/examples/tut01-hello-world.c: New.
705 * docs/examples/tut02-square.c: New.
706 * docs/examples/tut03-sum-of-squares.c: New.
707 * docs/examples/tut04-toyvm/Makefile: New.
708 * docs/examples/tut04-toyvm/factorial.toy: New.
709 * docs/examples/tut04-toyvm/fibonacci.toy: New.
710 * docs/examples/tut04-toyvm/toyvm.c: New.
711 * docs/index.rst: New.
712 * docs/internals/index.rst: New.
713 * docs/intro/factorial.png: New.
714 * docs/intro/index.rst: New.
715 * docs/intro/sum-of-squares.png: New.
716 * docs/intro/tutorial01.rst: New.
717 * docs/intro/tutorial02.rst: New.
718 * docs/intro/tutorial03.rst: New.
719 * docs/intro/tutorial04.rst: New.
720 * docs/topics/contexts.rst: New.
721 * docs/topics/expressions.rst: New.
722 * docs/topics/functions.rst: New.
723 * docs/topics/index.rst: New.
724 * docs/topics/locations.rst: New.
725 * docs/topics/objects.rst: New.
726 * docs/topics/results.rst: New.
727 * docs/topics/types.rst: New.
728 * dummy-frontend.c: New.
729 * jit-builtins.c: New.
730 * jit-builtins.h: New.
731 * jit-common.h: New.
732 * jit-playback.c: New.
733 * jit-playback.h: New.
734 * jit-recording.c: New.
735 * jit-recording.h: New.
736 * libgccjit++.h: New.
737 * libgccjit.c: New.
738 * libgccjit.h: New.
739 * libgccjit.map: New.
740 * notes.txt: New.
741
7422013-07-26 David Malcolm <dmalcolm@redhat.com>
743
744 * Initial creation
745
1e3b6a3d 746Copyright (C) 2013-2015 Free Software Foundation, Inc.
35485da9
DM
747
748Copying and distribution of this file, with or without modification,
749are permitted in any medium without royalty provided the copyright
750notice and this notice are preserved.