[前][次][番号順一覧][スレッド一覧]

ruby-changes:51924

From: k0kubun <ko1@a...>
Date: Tue, 31 Jul 2018 20:19:05 +0900 (JST)
Subject: [ruby-changes:51924] k0kubun:r64138 (trunk): transform_mjit_header.rb: accept having attribute

k0kubun	2018-07-31 20:18:59 +0900 (Tue, 31 Jul 2018)

  New Revision: 64138

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64138

  Log:
    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]

  Modified files:
    trunk/tool/transform_mjit_header.rb
Index: tool/transform_mjit_header.rb
===================================================================
--- tool/transform_mjit_header.rb	(revision 64137)
+++ tool/transform_mjit_header.rb	(revision 64138)
@@ -10,7 +10,11 @@ PROGRAM = File.basename($0, ".*") https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L10
 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.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]