class AdLint::Cc1::FloatType

Public Class Methods

new(type_tbl) click to toggle source
Calls superclass method AdLint::Cc1::ScalarDataType::new
# File lib/adlint/cc1/type.rb, line 5381
def initialize(type_tbl)
  # FIXME: StandardTypesAccessor is not ready until @type_table is
  #        initialized.
  @type_table = type_tbl
  super(type_tbl, "float", float_size, float_alignment)
end

Public Instance Methods

argument_promoted_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 5396
def argument_promoted_type
  # NOTE: The ISO C99 standard says;
  #
  # 6.5.2.2 Function calls
  #
  # 6 If the expression that denotes the called function has a type that
  #   does not include a prototype, the integer promotions are performed on
  #   each argument, and arguments that have type float are promoted to
  #   double.  These are called the default argument promotions.  If the
  #   number of arguments does not equal the number of parameters, the
  #   behavior is undefined.  If the function is defined with a type that
  #   includes a prototype, and either the prototype ends with an ellipsis
  #   (, ...) or the types of the arguments after promotion are not
  #   compatible with the types of the parameters, the behavior is
  #   undefined.  If the function is defined with a type that does not
  #   include a prototype, and the types of the arguments after promotion
  #   are not compatible with those of the parameters after promotion, the
  #   behavior is undefined, except for the following cases:
  #
  #     -- one promoted type is a signed integer type, the other promoted
  #        type is the corresponding unsigned integer type, and the value
  #        is representable in both types;
  #     -- both types are pointers to qualified or unqualified versions of
  #        a character type or void.
  double_t
end
arithmetic_type_with(type) click to toggle source
# File lib/adlint/cc1/type.rb, line 5423
def arithmetic_type_with(type)
  type._arithmetic_type_with_float(self)
end
id() click to toggle source
# File lib/adlint/cc1/type.rb, line 5388
def id
  @id ||= FloatTypeId.new
end
named?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5392
def named?
  true
end

Private Instance Methods

exponent_bit_size() click to toggle source
# File lib/adlint/cc1/type.rb, line 5433
def exponent_bit_size
  # TODO: Bit size of the exponent part of `float' should be configurable.
  8
end
fraction_bit_size() click to toggle source
# File lib/adlint/cc1/type.rb, line 5428
def fraction_bit_size
  # TODO: Bit size of the fraction part of `float' should be configurable.
  23
end