Class: Rubycc::Front::AST::BuiltinConstantP

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

Overview

"__builtin_constant_p ( expr )": gcc's compile-time-constant test, typed int. expr is the (unevaluated) operand and token the builtin keyword. The whole expression folds to 1 when expr reduces to a compile-time constant and 0 otherwise — including when it references a variable or a function call, which is not an error here (unlike an ordinary constant expression) but simply yields 0. expr is never evaluated, so it produces no code and no side effects.

Instance Attribute Summary collapse

Instance Attribute Details

#exprObject (readonly)

Returns the value of attribute expr

Returns:

  • (Object)

    the current value of expr



395
396
397
# File 'lib/rubycc/front/ast.rb', line 395

def expr
  @expr
end

#tokenObject (readonly)

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



395
396
397
# File 'lib/rubycc/front/ast.rb', line 395

def token
  @token
end