class AdLint::Cc1::ArrayType

Constants

MAX_LENGTH

NOTE: To avoid huge array allocation in interpreting phase.

Attributes

base_type[R]
length[RW]

NOTE: Length of the array type may be deducted by the size of the

initializer in interpret phase.

Public Class Methods

new(type_tbl, base_type, len = nil) click to toggle source
Calls superclass method AdLint::Cc1::Type::new
# File lib/adlint/cc1/type.rb, line 5528
def initialize(type_tbl, base_type, len = nil)
  super(type_tbl, create_name(base_type, len))
  @base_type = base_type
  @length = len
end

Public Instance Methods

_arithmetic_type_with_array(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6067
def _arithmetic_type_with_array(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  lhs_type # NOTREACHED
end
_arithmetic_type_with_bitfield(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6047
def _arithmetic_type_with_bitfield(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with BitfieldType and ArrayType
  #       makes integer-promoted type of BitfieldType.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_char(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5851
def _arithmetic_type_with_char(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `char' and ArrayType
  #       makes integer-promoted type of `char'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_double(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6034
def _arithmetic_type_with_double(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `double' and ArrayType makes `double'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_enum(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6054
def _arithmetic_type_with_enum(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with EnumType and ArrayType makes EnumType.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6082
def _arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with ExtendedBigIntType and ArrayType
  #       makes ExtendedBigIntType.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_float(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6028
def _arithmetic_type_with_float(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `float' and ArrayType makes `float'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_function(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5847
def _arithmetic_type_with_function(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end
_arithmetic_type_with_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5914
def _arithmetic_type_with_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `int' and ArrayType makes `int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_long(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5946
def _arithmetic_type_with_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `long' and ArrayType makes `long'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_long_double(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6040
def _arithmetic_type_with_long_double(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `long double' and ArrayType
  #       makes `long double'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_long_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5966
def _arithmetic_type_with_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `long int' and ArrayType makes `long int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_long_long(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5986
def _arithmetic_type_with_long_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `long long' and ArrayType makes
  #       `long long'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_long_long_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6007
def _arithmetic_type_with_long_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `long long int' and ArrayType
  #       makes `long long int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_pointer(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6060
def _arithmetic_type_with_pointer(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with PointerType and ArrayType makes
  #       PointerType.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_short(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5872
def _arithmetic_type_with_short(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `short' and ArrayType
  #       makes integer-promoted type of `short'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_short_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5893
def _arithmetic_type_with_short_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `short int' and ArrayType
  #       makes integer-promoted type of `short int'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_signed(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5920
def _arithmetic_type_with_signed(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed' and ArrayType makes `signed'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_signed_char(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5858
def _arithmetic_type_with_signed_char(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed char' and ArrayType
  #       makes integer-promoted type of `signed char'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_signed_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5926
def _arithmetic_type_with_signed_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed int' and ArrayType
  #       makes `signed int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_signed_long(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5952
def _arithmetic_type_with_signed_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed long' and ArrayType
  #       makes `signed long'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5972
def _arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed long int' and ArrayType
  #       makes `signed long int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5993
def _arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed long long' and ArrayType
  #       makes `signed long long'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6014
def _arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed long long int' and ArrayType
  #       makes `signed long long int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_signed_short(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5879
def _arithmetic_type_with_signed_short(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed short' and ArrayType
  #       makes integer-promoted type of `signed short'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5900
def _arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `signed short int' and ArrayType
  #       makes integer-promoted type of `signed short int'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_struct(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6072
def _arithmetic_type_with_struct(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  lhs_type # NOTREACHED
end
_arithmetic_type_with_undeclared(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5835
def _arithmetic_type_with_undeclared(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end
_arithmetic_type_with_union(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6077
def _arithmetic_type_with_union(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  lhs_type # NOTREACHED
end
_arithmetic_type_with_unresolved(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5839
def _arithmetic_type_with_unresolved(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end
_arithmetic_type_with_unsigned(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5933
def _arithmetic_type_with_unsigned(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned' and ArrayType makes `unsigned'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5865
def _arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned char' and ArrayType
  #       makes integer-promoted type of `unsigned char'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5939
def _arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned int' and ArrayType
  #       makes `unsigned int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5959
def _arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned long' and ArrayType
  #       makes `unsigned long'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5979
def _arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned long int' and ArrayType
  #       makes `unsigned long int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6000
def _arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned long long' and ArrayType
  #       makes `unsigned long long'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 6021
def _arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned long long int' and ArrayType
  #       makes `unsigned long long int'.
  lhs_type # NOTREACHED
end
_arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5886
def _arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned short' and ArrayType
  #       makes integer-promoted type of `unsigned short'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5907
def _arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  # NOTE: Binary operation with `unsigned short int' and ArrayType
  #       makes integer-promoted type of `unsigned short int'.
  lhs_type.integer_promoted_type # NOTREACHED
end
_arithmetic_type_with_void(lhs_type, rhs_type = self) click to toggle source
# File lib/adlint/cc1/type.rb, line 5843
def _arithmetic_type_with_void(lhs_type, rhs_type = self)
  rhs_type.arithmetic_type_with(lhs_type)
end
aligned_bit_size() click to toggle source
# File lib/adlint/cc1/type.rb, line 5576
def aligned_bit_size
  @length ? @base_type.aligned_bit_size * @length : 0
end
arbitrary_value() click to toggle source
# File lib/adlint/cc1/type.rb, line 5761
def arbitrary_value
  ArrayValue.new(impl_length.times.map { @base_type.arbitrary_value })
end
argument_promoted_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 5826
def argument_promoted_type
  self # NOTREACHED
end
arithmetic_type_with(type) click to toggle source
# File lib/adlint/cc1/type.rb, line 5830
def arithmetic_type_with(type)
  # NOTE: An arithmetic operation with ArrayType must not be executed!
  type._arithmetic_type_with_array(self) # NOTREACHED
end
array?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5649
def array?
  true
end
bit_alignment() click to toggle source
# File lib/adlint/cc1/type.rb, line 5572
def bit_alignment
  aligned_bit_size
end
bit_size() click to toggle source
# File lib/adlint/cc1/type.rb, line 5568
def bit_size
  @length ? @base_type.bit_size * @length : 0
end
bitfield?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5709
def bitfield?
  false
end
brief_image() click to toggle source
# File lib/adlint/cc1/type.rb, line 5556
def brief_image
  create_brief_image(@base_type, @length)
end
coerce_array_value(val) click to toggle source
# File lib/adlint/cc1/type.rb, line 5782
def coerce_array_value(val)
  # NOTE: The ISO C99 standard says;
  #
  # 6.7.8 Initialization
  #
  # Semantics
  #
  # 10 If an object that has automatic storage duration is not initialized
  #    explicitly, its value is indeterminate.  If an object that has
  #    static storage duration is not initialized explicitly, then:
  #
  #    -- if it has pointer type, it is initialized to a null pointer;
  #    -- if it has arithmetic type, it is initialized to (positive or
  #       unsigned) zero;
  #    -- if it is an aggregate, every member is initialized (recursively)
  #       according to these rules;
  #    -- if it is a union, the first named member is initialized
  #       (recursively) according to these rules.
  #
  # 21 If there are fewer initializers in a brace-enclosed list than there
  #    are elements or members of an aggregate, or fewer characters in a
  #    string literal used to initialize an array of known size that there
  #    are elements in the array, the remainder of the aggregate shall be
  #    initialized implicitly the same as objects that have static storage
  #    duration.
  vals = ([@base_type] * impl_length).zip(val.values).map { |type, v|
    v ? v.coerce_to(type) : type.arbitrary_value
  }
  ArrayValue.new(vals)
end
coerce_composite_value(val) click to toggle source
# File lib/adlint/cc1/type.rb, line 5813
def coerce_composite_value(val)
  # NOTE: Cannot coerce composite value into array in C language.
  undefined_value # NOTREACHED
end
coerce_scalar_value(val) click to toggle source
# File lib/adlint/cc1/type.rb, line 5777
def coerce_scalar_value(val)
  # NOTE: Cannot coerce scalar value into array in C language.
  undefined_value # NOTREACHED
end
coercible?(to_type) click to toggle source
# File lib/adlint/cc1/type.rb, line 5597
def coercible?(to_type)
  to_type.array? && @base_type.coercible?(to_type.base_type)
end
compatible?(to_type) click to toggle source
# File lib/adlint/cc1/type.rb, line 5592
def compatible?(to_type)
  to_type.array? &&
    @length == to_type.length && @base_type.compatible?(to_type.base_type)
end
const?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5697
def const?
  @base_type.const?
end
convertible?(to_type) click to toggle source
# File lib/adlint/cc1/type.rb, line 5601
def convertible?(to_type)
  lhs_unqualified = self.real_type.unqualify
  rhs_unqualified = to_type.real_type.unqualify

  if rhs_unqualified.pointer? || rhs_unqualified.array?
    lhs_base = lhs_unqualified.base_type
    rhs_base = rhs_unqualified.base_type

    unless lhs_base.more_cv_qualified?(rhs_base)
      rhs_base.void? || lhs_base.convertible?(rhs_base)
    else
      false
    end
  else
    false
  end
end
corresponding_signed_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 6089
def corresponding_signed_type
  self # NOTREACHED
end
corresponding_unsigned_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 6093
def corresponding_unsigned_type
  self # NOTREACHED
end
dup() click to toggle source
# File lib/adlint/cc1/type.rb, line 6097
def dup
  ArrayType.new(type_table, @base_type.dup, @length)
end
enum?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5673
def enum?
  false
end
enumerators() click to toggle source
# File lib/adlint/cc1/type.rb, line 5733
def enumerators
  []
end
explicitly_signed?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5717
def explicitly_signed?
  false
end
floating?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5645
def floating?
  false
end
function?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5669
def function?
  false
end
have_va_list?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5721
def have_va_list?
  false
end
id() click to toggle source
# File lib/adlint/cc1/type.rb, line 5545
def id
  # NOTE: ID of the array type cannot be cached.
  #       Length of the variable length array will be deducted in the
  #       interpret phase.
  ArrayTypeId.new(@base_type, @length)
end
image() click to toggle source
# File lib/adlint/cc1/type.rb, line 5552
def image
  create_image(@base_type, @length)
end
impl_length() click to toggle source
# File lib/adlint/cc1/type.rb, line 5540
def impl_length
  # NOTE: Implementation defined length of this array.
  @length ? [[0, @length].max, MAX_LENGTH].min : 0
end
incomplete?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5588
def incomplete?
  @base_type.incomplete? || @length.nil?
end
integer?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5641
def integer?
  false
end
integer_conversion_rank() click to toggle source
# File lib/adlint/cc1/type.rb, line 5818
def integer_conversion_rank
  0 # NOTREACHED
end
integer_promoted_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 5822
def integer_promoted_type
  self # NOTREACHED
end
location() click to toggle source
# File lib/adlint/cc1/type.rb, line 5560
def location
  nil
end
max() click to toggle source
# File lib/adlint/cc1/type.rb, line 5749
def max
  0
end
member_named(name) click to toggle source
# File lib/adlint/cc1/type.rb, line 5741
def member_named(name)
  nil
end
members() click to toggle source
# File lib/adlint/cc1/type.rb, line 5737
def members
  []
end
min() click to toggle source
# File lib/adlint/cc1/type.rb, line 5745
def min
  0
end
named?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5564
def named?
  true
end
nil_value() click to toggle source
# File lib/adlint/cc1/type.rb, line 5753
def nil_value
  ArrayValue.new(impl_length.times.map { @base_type.nil_value })
end
parameter_types() click to toggle source
# File lib/adlint/cc1/type.rb, line 5729
def parameter_types
  []
end
parameter_value() click to toggle source
# File lib/adlint/cc1/type.rb, line 5769
def parameter_value
  ArrayValue.new(impl_length.times.map { @base_type.parameter_value })
end
pointer?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5661
def pointer?
  false
end
qualified?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5665
def qualified?
  false
end
real_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 5580
def real_type
  type_table.array_type(@base_type.real_type, @length)
end
restrict?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5705
def restrict?
  @base_type.restrict?
end
return_type() click to toggle source
# File lib/adlint/cc1/type.rb, line 5725
def return_type
  nil
end
return_value() click to toggle source
# File lib/adlint/cc1/type.rb, line 5773
def return_value
  ArrayValue.new(impl_length.times.map { @base_type.return_value })
end
same_as?(type) click to toggle source
# File lib/adlint/cc1/type.rb, line 5619
def same_as?(type)
  lhs_unqualified = self.real_type.unqualify
  rhs_unqualified = type.real_type.unqualify

  case
  when rhs_unqualified.array?
    if lhs_unqualified.length
      lhs_unqualified.length == rhs_unqualified.length
    else
      lhs_unqualified.base_type.same_as?(rhs_unqualified.base_type)
    end
  when rhs_unqualified.pointer?
    lhs_unqualified.base_type.same_as?(rhs_unqualified.base_type)
  else
    false
  end
end
scalar?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5637
def scalar?
  false
end
signed?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5713
def signed?
  false
end
standard?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5685
def standard?
  false
end
struct?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5653
def struct?
  false
end
undeclared?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5689
def undeclared?
  @base_type.undeclared?
end
undefined_value() click to toggle source
# File lib/adlint/cc1/type.rb, line 5765
def undefined_value
  ArrayValue.new(impl_length.times.map { @base_type.undefined_value })
end
union?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5657
def union?
  false
end
unqualify() click to toggle source
# File lib/adlint/cc1/type.rb, line 5584
def unqualify
  self
end
unresolved?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5693
def unresolved?
  @base_type.unresolved?
end
user?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5677
def user?
  false
end
void?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5681
def void?
  false
end
volatile?() click to toggle source
# File lib/adlint/cc1/type.rb, line 5701
def volatile?
  @base_type.volatile?
end
zero_value() click to toggle source
# File lib/adlint/cc1/type.rb, line 5757
def zero_value
  ArrayValue.new(impl_length.times.map { @base_type.zero_value })
end

Private Instance Methods

create_brief_image(base_type, len) click to toggle source
# File lib/adlint/cc1/type.rb, line 6110
def create_brief_image(base_type, len)
  "(#{base_type.brief_image})[#{len ? len : ""}]"
end
create_image(base_type, len) click to toggle source
# File lib/adlint/cc1/type.rb, line 6106
def create_image(base_type, len)
  "(#{base_type.image})[#{len ? len : ""}]"
end
create_name(base_type, len) click to toggle source
# File lib/adlint/cc1/type.rb, line 6102
def create_name(base_type, len)
  "(#{base_type.name})[#{len ? len : ""}]"
end