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