Class: AdLint::Cc1::ExtendedBigIntType

Inherits:
IntegerType show all
Defined in:
lib/adlint/cc1/type.rb

Instance Attribute Summary

Attributes inherited from ScalarDataType

#bit_alignment, #bit_size

Attributes inherited from Type

#declarations, #name, #type_table

Instance Method Summary collapse

Methods inherited from IntegerType

#argument_promoted_type, #brief_image, #compatible?, #explicitly_signed?, #floating?, #image, #integer?, #location, #max, #min, #signed?

Methods inherited from ScalarDataType

#_arithmetic_type_with_array, #_arithmetic_type_with_bitfield, #_arithmetic_type_with_char, #_arithmetic_type_with_double, #_arithmetic_type_with_enum, #_arithmetic_type_with_extended_big_int, #_arithmetic_type_with_float, #_arithmetic_type_with_function, #_arithmetic_type_with_int, #_arithmetic_type_with_long, #_arithmetic_type_with_long_double, #_arithmetic_type_with_long_int, #_arithmetic_type_with_long_long, #_arithmetic_type_with_long_long_int, #_arithmetic_type_with_pointer, #_arithmetic_type_with_short, #_arithmetic_type_with_short_int, #_arithmetic_type_with_signed, #_arithmetic_type_with_signed_char, #_arithmetic_type_with_signed_int, #_arithmetic_type_with_signed_long, #_arithmetic_type_with_signed_long_int, #_arithmetic_type_with_signed_long_long, #_arithmetic_type_with_signed_long_long_int, #_arithmetic_type_with_signed_short, #_arithmetic_type_with_signed_short_int, #_arithmetic_type_with_struct, #_arithmetic_type_with_undeclared, #_arithmetic_type_with_union, #_arithmetic_type_with_unresolved, #_arithmetic_type_with_unsigned, #_arithmetic_type_with_unsigned_char, #_arithmetic_type_with_unsigned_int, #_arithmetic_type_with_unsigned_long, #_arithmetic_type_with_unsigned_long_int, #_arithmetic_type_with_unsigned_long_long, #_arithmetic_type_with_unsigned_long_long_int, #_arithmetic_type_with_unsigned_short, #_arithmetic_type_with_unsigned_short_int, #_arithmetic_type_with_void, #arbitrary_value, #argument_promoted_type, #array?, #base_type, #brief_image, #coerce_array_value, #coerce_composite_value, #coerce_scalar_value, #coercible?, #compatible?, #const?, #explicitly_signed?, #floating?, #function?, #have_va_list?, #image, #impl_length, #integer?, #length, #location, #max, #member_named, #members, #min, #nil_value, #parameter_types, #parameter_value, #qualified?, #real_type, #restrict?, #return_type, #return_value, #scalar?, #signed?, #struct?, #undeclared?, #undefined_value, #union?, #unqualify, #unresolved?, #user?, #void?, #volatile?, #zero_value

Methods included from UsualArithmeticTypeConversion

#do_usual_arithmetic_type_conversion

Methods inherited from Type

#==, #_arithmetic_type_with_array, #_arithmetic_type_with_bitfield, #_arithmetic_type_with_char, #_arithmetic_type_with_double, #_arithmetic_type_with_enum, #_arithmetic_type_with_extended_big_int, #_arithmetic_type_with_float, #_arithmetic_type_with_function, #_arithmetic_type_with_int, #_arithmetic_type_with_long, #_arithmetic_type_with_long_double, #_arithmetic_type_with_long_int, #_arithmetic_type_with_long_long, #_arithmetic_type_with_long_long_int, #_arithmetic_type_with_pointer, #_arithmetic_type_with_short, #_arithmetic_type_with_short_int, #_arithmetic_type_with_signed, #_arithmetic_type_with_signed_char, #_arithmetic_type_with_signed_int, #_arithmetic_type_with_signed_long, #_arithmetic_type_with_signed_long_int, #_arithmetic_type_with_signed_long_long, #_arithmetic_type_with_signed_long_long_int, #_arithmetic_type_with_signed_short, #_arithmetic_type_with_signed_short_int, #_arithmetic_type_with_struct, #_arithmetic_type_with_undeclared, #_arithmetic_type_with_union, #_arithmetic_type_with_unresolved, #_arithmetic_type_with_unsigned, #_arithmetic_type_with_unsigned_char, #_arithmetic_type_with_unsigned_int, #_arithmetic_type_with_unsigned_long, #_arithmetic_type_with_unsigned_long_int, #_arithmetic_type_with_unsigned_long_long, #_arithmetic_type_with_unsigned_long_long_int, #_arithmetic_type_with_unsigned_short, #_arithmetic_type_with_unsigned_short_int, #_arithmetic_type_with_void, #aligned_bit_size, #aligned_byte_size, #arbitrary_value, #argument_promoted_type, #array?, #base_type, #bit_alignment, #bit_size, #brief_image, #byte_alignment, #byte_size, #coerce_array_value, #coerce_composite_value, #coerce_scalar_value, #coercible?, #compatible?, #composite?, #const?, #convertible?, #explicitly_signed?, #floating?, #function?, #have_va_list?, #image, #impl_length, #inspect, #integer?, #length, #length=, #location, #max, #member_named, #members, #min, #more_cv_qualified?, #nil_value, #parameter?, #parameter_types, #parameter_value, #qualified?, #real_type, #restrict?, #return_type, #return_value, #same_as?, #scalar?, #signed?, #struct?, #undeclared?, #undefined_value, #union?, #unqualify, #unresolved?, #unsigned?, #user?, #void?, #volatile?, #zero_value

Methods included from StandardTypesAccessor

#char_alignment, #char_as_unsigned_char?, #char_size, #code_ptr_alignment, #code_ptr_size, #data_ptr_alignment, #data_ptr_size, #double_alignment, #double_size, #float_alignment, #float_size, #int_alignment, #int_size, #long_alignment, #long_double_alignment, #long_double_size, #long_long_alignment, #long_long_size, #long_size, #short_alignment, #short_size, #standard_types

Methods included from ArithmeticAccessor

#arithmetic, #logical_right_shift?

Methods included from Visitable

#accept

Constructor Details

#initialize(type_tbl) ⇒ ExtendedBigIntType

Returns a new instance of ExtendedBigIntType.



7080
7081
7082
# File 'lib/adlint/cc1/type.rb', line 7080

def initialize(type_tbl)
  super(type_tbl, "__adlint__extended_bigint_t", 256, 256, true, true)
end

Instance Method Details

#arithmetic_type_with(type) ⇒ Object



7158
7159
7160
# File 'lib/adlint/cc1/type.rb', line 7158

def arithmetic_type_with(type)
  type._arithmetic_type_with_extended_big_int(self)
end

#bitfield?Boolean

Returns:

  • (Boolean)


7108
7109
7110
# File 'lib/adlint/cc1/type.rb', line 7108

def bitfield?
  false
end

#corresponding_signed_typeObject



7162
7163
7164
# File 'lib/adlint/cc1/type.rb', line 7162

def corresponding_signed_type
  self
end

#corresponding_unsigned_typeObject



7166
7167
7168
# File 'lib/adlint/cc1/type.rb', line 7166

def corresponding_unsigned_type
  self
end

#dupObject



7170
7171
7172
# File 'lib/adlint/cc1/type.rb', line 7170

def dup
  ExtendedBigIntType.new(type_table)
end

#enum?Boolean

Returns:

  • (Boolean)


7100
7101
7102
# File 'lib/adlint/cc1/type.rb', line 7100

def enum?
  false
end

#enumeratorsObject



7112
7113
7114
# File 'lib/adlint/cc1/type.rb', line 7112

def enumerators
  []
end

#idObject



7084
7085
7086
# File 'lib/adlint/cc1/type.rb', line 7084

def id
  @id ||= TypeId.new(name)
end

#incomplete?Boolean

Returns:

  • (Boolean)


7092
7093
7094
# File 'lib/adlint/cc1/type.rb', line 7092

def incomplete?
  false
end

#integer_conversion_rankObject



7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
# File 'lib/adlint/cc1/type.rb', line 7116

def integer_conversion_rank
  # NOTE: The ISO C99 standard says;
  #
  # 6.3.1 Arithmetic operands
  # 6.3.1.1 Boolean, characters, and integers
  #
  # 1 Every integer type has an integer conversion rank defined as follows:
  #
  #     -- No two signed integer types shall have the same rank, even if
  #        they have the same representation.
  #     -- The rank of a signed integer type shall be greater than the rank
  #        of any signed integer type with less precision.
  #     -- The rank of long long int shall be greater than the rank of long
  #        int, which shall be greater than the rank of int, which shall be
  #        greater than the rank of short int, which shall be greater than
  #        the rank of signed char.
  #     -- The rank of any unsigned integer type shall equal the rank of
  #        the corresponding signed integer type, if any.
  #     -- The rank of any standard integer type shall be greater than the
  #        rank of any extended integer type with the same width.
  #     -- The rank of char shall equal the rank of signed char and
  #        unsigned char.
  #     -- The rank of _Bool shall be less than the rank of all other
  #        standard integer types.
  #     -- The rank of any enumerated type shall equal the rank of the
  #        compatible integer type.
  #     -- The rank of any extended signed integer type relative to another
  #        extended signed integer type with the same precision is
  #        implementation-defined, but still subject to the other rules for
  #        determining the integer conversion rank.
  #     -- For all integer types T1, T2, and T3, if T1 has greater rank
  #        than T2 and T2 has greater rank than T3, then T1 has greater
  #        rank than T3.
  -2
end

#integer_promoted_typeObject



7152
7153
7154
7155
7156
# File 'lib/adlint/cc1/type.rb', line 7152

def integer_promoted_type
  # NOTE: ExtendedBigIntType is very big integer.
  #       So, it is not compatible with int or unsigned int.
  self
end

#named?Boolean

Returns:

  • (Boolean)


7088
7089
7090
# File 'lib/adlint/cc1/type.rb', line 7088

def named?
  true
end

#pointer?Boolean

Returns:

  • (Boolean)


7096
7097
7098
# File 'lib/adlint/cc1/type.rb', line 7096

def pointer?
  false
end

#standard?Boolean

Returns:

  • (Boolean)


7104
7105
7106
# File 'lib/adlint/cc1/type.rb', line 7104

def standard?
  false
end