transform_mjit_header.rb: accept having attribute

between a type of return value and function identifier. Like:

```
rb_control_frame_t *
__attribute__ ((__fastcall__)) rb_vm_opt_struct_aref(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp)
{
    ...
}
```

[Bug #14949]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-07-31 11:18:59 +00:00
Родитель 8bcf27527c
Коммит d3f57771e0
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -10,7 +10,11 @@ PROGRAM = File.basename($0, ".*")
module MJITHeader
ATTR_VALUE_REGEXP = /[^()]|\([^()]*\)/
ATTR_REGEXP = /__attribute__\s*\(\(#{ATTR_VALUE_REGEXP}*\)\)/
FUNC_HEADER_REGEXP = /\A(\s*#{ATTR_REGEXP})*[^\[{(]*\((#{ATTR_REGEXP}|[^()])*\)(\s*#{ATTR_REGEXP})*\s*/
# Example:
# VALUE foo(int bar)
# VALUE __attribute__ ((foo)) bar(int baz)
# __attribute__ ((foo)) VALUE bar(int baz)
FUNC_HEADER_REGEXP = /\A((\s*#{ATTR_REGEXP})|[^\[{(])*\((#{ATTR_REGEXP}|[^()])*\)(\s*#{ATTR_REGEXP})*\s*/
TARGET_NAME_REGEXP = /\A(rb|ruby|vm|insn|attr)_/
# Predefined macros for compilers which are already supported by MJIT.