Class: Rubycc::Front::AST::BuiltinAtomic

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

Overview

One of gcc's _atomic* builtins. kind names the operation — :load, :store, :exchange, :compare_exchange, :fetch_add, :fetch_sub, :add_fetch, :sub_fetch, :or_fetch or :fence — and args holds the argument expressions exactly as written, including the trailing memory-order argument(s) and __atomic_compare_exchange_n's weak flag. The parser checks only the argument count here; the operand types (and the 4-or-8-byte width restriction) are the generator's to diagnose, since they need the resolved types. token is the builtin keyword.

The memory-order arguments are carried through but never inspected: every operation is lowered at the strongest order (see IR::Generator#gen_builtin_atomic), which is why they need no constant folding here.

Instance Attribute Summary collapse

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



432
433
434
# File 'lib/rubycc/front/ast.rb', line 432

def args
  @args
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



432
433
434
# File 'lib/rubycc/front/ast.rb', line 432

def kind
  @kind
end

#tokenObject (readonly)

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



432
433
434
# File 'lib/rubycc/front/ast.rb', line 432

def token
  @token
end