2020-05-05 18:00:59 +09:00
|
|
|
// -*- c -*-
|
|
|
|
// DO NOT MODIFY THIS FILE DIRECTLY.
|
|
|
|
// auto-generated file by tool/generic_erb.rb
|
|
|
|
// with template/builtin_binary.inc.tmpl
|
2023-11-09 13:40:55 +09:00
|
|
|
% unless ARGV.include?('--cross=yes')
|
2020-05-10 17:26:28 +09:00
|
|
|
% ary = RubyVM.enum_for(:each_builtin).to_a
|
2020-05-05 18:00:59 +09:00
|
|
|
% ary.each{|feature, iseq|
|
2025-04-06 12:24:23 +09:00
|
|
|
% bin = iseq.to_binary
|
2020-05-05 18:00:59 +09:00
|
|
|
|
2025-04-06 12:24:23 +09:00
|
|
|
static const union {
|
|
|
|
unsigned char binary[<%= bin.bytesize %>];
|
|
|
|
uint32_t align_as_ibf_header;
|
|
|
|
} <%= feature %>_builtin = {
|
|
|
|
.binary = {
|
|
|
|
% bin \
|
2020-05-05 18:00:59 +09:00
|
|
|
% . each_byte \
|
|
|
|
% . each_slice(12) {|a|
|
2025-04-06 12:24:23 +09:00
|
|
|
<%= a.map{ '0x%02x,' % _1 }.join(' ') %>
|
2020-05-05 18:00:59 +09:00
|
|
|
% }
|
2025-04-06 12:24:23 +09:00
|
|
|
}
|
2020-05-05 18:00:59 +09:00
|
|
|
};
|
|
|
|
% }
|
|
|
|
|
2023-03-08 12:16:05 +09:00
|
|
|
#define BUILTIN_BIN(feature) \
|
2025-04-06 12:24:23 +09:00
|
|
|
{ #feature, feature ## _builtin.binary, sizeof(feature ## _builtin.binary), }
|
2020-05-05 18:00:59 +09:00
|
|
|
static const struct builtin_binary builtin_binary[] = {
|
|
|
|
% ary.each{|feature, |
|
2023-03-08 12:16:05 +09:00
|
|
|
BUILTIN_BIN(<%= feature %>),
|
2020-05-05 18:00:59 +09:00
|
|
|
% }
|
2023-03-08 12:16:05 +09:00
|
|
|
{ NULL, },/* sentinel */
|
2020-05-05 18:00:59 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
#define BUILTIN_BINARY_SIZE <%= ary.size %>
|
|
|
|
STATIC_ASSERT(n_builtin, numberof(builtin_binary) == BUILTIN_BINARY_SIZE + 1);
|
|
|
|
% end
|