Class: Rubycc::Front::AST::BuiltinSync

Inherits:
Data
  • Object
show all
Defined in:
lib/rubycc/front/ast.rb

Overview

One of gcc's legacy _sync* builtins. kind names the operation — :fetch_add, :fetch_sub, :add_fetch, :sub_fetch, :or_fetch, :exchange, :release, :fence, :bool_compare_and_swap or :val_compare_and_swap — and args holds the argument expressions exactly as written. As with BuiltinAtomic the parser checks only the argument count; the operand types and the width restriction need resolved types and belong to the generator. token is the builtin keyword.

This is a node of its own rather than a flag on BuiltinAtomic because the two families' argument layouts differ: the _sync* forms are full barriers by definition and so carry no memory-order argument at all, while the compare-and-swap pair takes its expected value directly instead of through a pointer. Sharing a node would invite lowering code written for one layout to read the other's arguments by index.

Instance Attribute Summary collapse

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



448
449
450
# File 'lib/rubycc/front/ast.rb', line 448

def args
  @args
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



448
449
450
# File 'lib/rubycc/front/ast.rb', line 448

def kind
  @kind
end

#tokenObject (readonly)

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



448
449
450
# File 'lib/rubycc/front/ast.rb', line 448

def token
  @token
end