public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ API: Vector arguments / error detection
@ 2022-01-30 15:35 Marc Nieper-Wißkirchen
  2022-01-31 14:49 ` David Malcolm
  0 siblings, 1 reply; 7+ messages in thread
From: Marc Nieper-Wißkirchen @ 2022-01-30 15:35 UTC (permalink / raw)
  To: Marc Nieper-Wißkirchen via Jit

This is about two unrelated issues regarding the C++ API:

(1) At the moment, a lot of API functions like new_function take non-const
referenced to vectors, e.g. std::vector <param> &params;

Can we change this into const references?  This way, one can write

auto param1 = ctxt.new_param (...);
auto param2 = ctxt.new_param (...);
auto func = new_function (..., {param1, param2}, ...);

instead of the more complicated and less convenient

auto param1 = ...;
auto param2 = ...;
auto params = std::vector {param1, param2};
auto func = new_function (..., params, ...);

(2) When using gccjit::context::compile_to_file, how can I check whether
the compilation succeeded without errors or not? In libgccjit++.h no error
is checked and no exception thrown.

Thanks,

Marc

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-01 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-30 15:35 C++ API: Vector arguments / error detection Marc Nieper-Wißkirchen
2022-01-31 14:49 ` David Malcolm
2022-01-31 15:08   ` Marc Nieper-Wißkirchen
2022-01-31 15:19     ` David Malcolm
2022-01-31 15:32       ` Marc Nieper-Wißkirchen
2022-01-31 15:39         ` Marc Nieper-Wißkirchen
2022-02-01 14:41           ` Marc Nieper-Wißkirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).