Class: AdLint::Cc1::FunctionType
- Inherits:
-
Type
- Object
- Type
- AdLint::Cc1::FunctionType
show all
- Defined in:
- lib/adlint/cc1/type.rb
Instance Attribute Summary collapse
Attributes inherited from Type
#name, #type_table
Instance Method Summary
collapse
-
#==(rhs_type) ⇒ Object
-
#_arithmetic_type_with_array(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_bitfield(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_char(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_double(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_enum(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_float(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_function(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_double(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_long_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_pointer(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_short(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_short_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_char(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_short(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_struct(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_undeclared(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_union(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unresolved(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self) ⇒ Object
-
#_arithmetic_type_with_void(lhs_type, rhs_type = self) ⇒ Object
-
#arbitrary_value ⇒ Object
-
#argument_promoted_type ⇒ Object
-
#arithmetic_type_with(type) ⇒ Object
-
#array? ⇒ Boolean
-
#base_type ⇒ Object
-
#bit_alignment ⇒ Object
-
#bit_size ⇒ Object
-
#bitfield? ⇒ Boolean
-
#brief_image ⇒ Object
-
#coerce_array_value(val) ⇒ Object
-
#coerce_composite_value(val) ⇒ Object
-
#coerce_scalar_value(val) ⇒ Object
-
#coercible?(to_type) ⇒ Boolean
-
#compatible?(to_type) ⇒ Boolean
-
#const? ⇒ Boolean
-
#corresponding_signed_type ⇒ Object
-
#corresponding_unsigned_type ⇒ Object
-
#declarations ⇒ Object
-
#dup ⇒ Object
-
#enum? ⇒ Boolean
-
#enumerators ⇒ Object
-
#explicitly_signed? ⇒ Boolean
-
#floating? ⇒ Boolean
-
#function? ⇒ Boolean
-
#have_va_list? ⇒ Boolean
-
#id ⇒ Object
-
#image ⇒ Object
-
#impl_length ⇒ Object
-
#incomplete? ⇒ Boolean
-
#initialize(type_tbl, ret_type, param_types, have_va_list = false) ⇒ FunctionType
constructor
A new instance of FunctionType.
-
#integer? ⇒ Boolean
-
#integer_conversion_rank ⇒ Object
-
#integer_promoted_type ⇒ Object
-
#length ⇒ Object
-
#location ⇒ Object
-
#max ⇒ Object
-
#member_named(name) ⇒ Object
-
#members ⇒ Object
-
#min ⇒ Object
-
#named? ⇒ Boolean
-
#nil_value ⇒ Object
-
#parameter_value ⇒ Object
-
#pointer? ⇒ Boolean
-
#qualified? ⇒ Boolean
-
#real_type ⇒ Object
-
#restrict? ⇒ Boolean
-
#return_value ⇒ Object
-
#scalar? ⇒ Boolean
-
#signed? ⇒ Boolean
-
#standard? ⇒ Boolean
-
#struct? ⇒ Boolean
-
#undeclared? ⇒ Boolean
-
#undefined_value ⇒ Object
-
#union? ⇒ Boolean
-
#unqualify ⇒ Object
-
#unresolved? ⇒ Boolean
-
#user? ⇒ Boolean
-
#void? ⇒ Boolean
-
#volatile? ⇒ Boolean
-
#zero_value ⇒ Object
Methods inherited from Type
#aligned_bit_size, #aligned_byte_size, #byte_alignment, #byte_size, #composite?, #convertible?, #inspect, #length=, #more_cv_qualified?, #parameter?, #same_as?, #unsigned?
#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
#arithmetic, #logical_right_shift?
Methods included from Visitable
#accept
Constructor Details
#initialize(type_tbl, ret_type, param_types, have_va_list = false) ⇒ FunctionType
Returns a new instance of FunctionType.
2421
2422
2423
2424
2425
2426
|
# File 'lib/adlint/cc1/type.rb', line 2421
def initialize(type_tbl, ret_type, param_types, have_va_list = false)
super(type_tbl, create_name(ret_type, param_types, have_va_list))
@return_type = ret_type
@parameter_types = param_types
@have_va_list = have_va_list
end
|
Instance Attribute Details
#parameter_types ⇒ Object
Returns the value of attribute parameter_types.
2429
2430
2431
|
# File 'lib/adlint/cc1/type.rb', line 2429
def parameter_types
@parameter_types
end
|
#return_type ⇒ Object
Returns the value of attribute return_type.
2428
2429
2430
|
# File 'lib/adlint/cc1/type.rb', line 2428
def return_type
@return_type
end
|
Instance Method Details
#==(rhs_type) ⇒ Object
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
|
# File 'lib/adlint/cc1/type.rb', line 2936
def ==(rhs_type)
case rhs_type
when FunctionType
if parameter_types.empty? || rhs_type.parameter_types.empty?
return_type == rhs_type.return_type
else
return_type == rhs_type.return_type &&
parameter_types == rhs_type.parameter_types &&
have_va_list? == rhs_type.have_va_list?
end
else
false
end
end
|
#_arithmetic_type_with_array(lhs_type, rhs_type = self) ⇒ Object
2906
2907
2908
2909
|
# File 'lib/adlint/cc1/type.rb', line 2906
def _arithmetic_type_with_array(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_bitfield(lhs_type, rhs_type = self) ⇒ Object
2886
2887
2888
2889
2890
2891
|
# File 'lib/adlint/cc1/type.rb', line 2886
def _arithmetic_type_with_bitfield(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_char(lhs_type, rhs_type = self) ⇒ Object
2688
2689
2690
2691
2692
2693
|
# File 'lib/adlint/cc1/type.rb', line 2688
def _arithmetic_type_with_char(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_double(lhs_type, rhs_type = self) ⇒ Object
2873
2874
2875
2876
2877
|
# File 'lib/adlint/cc1/type.rb', line 2873
def _arithmetic_type_with_double(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_enum(lhs_type, rhs_type = self) ⇒ Object
2893
2894
2895
2896
2897
|
# File 'lib/adlint/cc1/type.rb', line 2893
def _arithmetic_type_with_enum(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self) ⇒ Object
2921
2922
2923
2924
2925
2926
|
# File 'lib/adlint/cc1/type.rb', line 2921
def _arithmetic_type_with_extended_big_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_float(lhs_type, rhs_type = self) ⇒ Object
2867
2868
2869
2870
2871
|
# File 'lib/adlint/cc1/type.rb', line 2867
def _arithmetic_type_with_float(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_function(lhs_type, rhs_type = self) ⇒ Object
2683
2684
2685
2686
|
# File 'lib/adlint/cc1/type.rb', line 2683
def _arithmetic_type_with_function(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_int(lhs_type, rhs_type = self) ⇒ Object
2751
2752
2753
2754
2755
|
# File 'lib/adlint/cc1/type.rb', line 2751
def _arithmetic_type_with_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_long(lhs_type, rhs_type = self) ⇒ Object
2784
2785
2786
2787
2788
|
# File 'lib/adlint/cc1/type.rb', line 2784
def _arithmetic_type_with_long(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_long_double(lhs_type, rhs_type = self) ⇒ Object
2879
2880
2881
2882
2883
2884
|
# File 'lib/adlint/cc1/type.rb', line 2879
def _arithmetic_type_with_long_double(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_long_int(lhs_type, rhs_type = self) ⇒ Object
2804
2805
2806
2807
2808
2809
|
# File 'lib/adlint/cc1/type.rb', line 2804
def _arithmetic_type_with_long_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_long_long(lhs_type, rhs_type = self) ⇒ Object
2825
2826
2827
2828
2829
2830
|
# File 'lib/adlint/cc1/type.rb', line 2825
def _arithmetic_type_with_long_long(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_long_long_int(lhs_type, rhs_type = self) ⇒ Object
2846
2847
2848
2849
2850
2851
|
# File 'lib/adlint/cc1/type.rb', line 2846
def _arithmetic_type_with_long_long_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_pointer(lhs_type, rhs_type = self) ⇒ Object
2899
2900
2901
2902
2903
2904
|
# File 'lib/adlint/cc1/type.rb', line 2899
def _arithmetic_type_with_pointer(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_short(lhs_type, rhs_type = self) ⇒ Object
2709
2710
2711
2712
2713
2714
|
# File 'lib/adlint/cc1/type.rb', line 2709
def _arithmetic_type_with_short(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_short_int(lhs_type, rhs_type = self) ⇒ Object
2730
2731
2732
2733
2734
2735
|
# File 'lib/adlint/cc1/type.rb', line 2730
def _arithmetic_type_with_short_int(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_signed(lhs_type, rhs_type = self) ⇒ Object
2757
2758
2759
2760
2761
|
# File 'lib/adlint/cc1/type.rb', line 2757
def _arithmetic_type_with_signed(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_signed_char(lhs_type, rhs_type = self) ⇒ Object
2695
2696
2697
2698
2699
2700
|
# File 'lib/adlint/cc1/type.rb', line 2695
def _arithmetic_type_with_signed_char(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_signed_int(lhs_type, rhs_type = self) ⇒ Object
2763
2764
2765
2766
2767
2768
|
# File 'lib/adlint/cc1/type.rb', line 2763
def _arithmetic_type_with_signed_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_signed_long(lhs_type, rhs_type = self) ⇒ Object
2790
2791
2792
2793
2794
2795
|
# File 'lib/adlint/cc1/type.rb', line 2790
def _arithmetic_type_with_signed_long(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self) ⇒ Object
2811
2812
2813
2814
2815
2816
|
# File 'lib/adlint/cc1/type.rb', line 2811
def _arithmetic_type_with_signed_long_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self) ⇒ Object
2832
2833
2834
2835
2836
2837
|
# File 'lib/adlint/cc1/type.rb', line 2832
def _arithmetic_type_with_signed_long_long(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self) ⇒ Object
2853
2854
2855
2856
2857
2858
|
# File 'lib/adlint/cc1/type.rb', line 2853
def _arithmetic_type_with_signed_long_long_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_signed_short(lhs_type, rhs_type = self) ⇒ Object
2716
2717
2718
2719
2720
2721
|
# File 'lib/adlint/cc1/type.rb', line 2716
def _arithmetic_type_with_signed_short(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self) ⇒ Object
2737
2738
2739
2740
2741
2742
|
# File 'lib/adlint/cc1/type.rb', line 2737
def _arithmetic_type_with_signed_short_int(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_struct(lhs_type, rhs_type = self) ⇒ Object
2911
2912
2913
2914
|
# File 'lib/adlint/cc1/type.rb', line 2911
def _arithmetic_type_with_struct(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_undeclared(lhs_type, rhs_type = self) ⇒ Object
2671
2672
2673
|
# File 'lib/adlint/cc1/type.rb', line 2671
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) ⇒ Object
2916
2917
2918
2919
|
# File 'lib/adlint/cc1/type.rb', line 2916
def _arithmetic_type_with_union(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_unresolved(lhs_type, rhs_type = self) ⇒ Object
2675
2676
2677
|
# File 'lib/adlint/cc1/type.rb', line 2675
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) ⇒ Object
2770
2771
2772
2773
2774
2775
|
# File 'lib/adlint/cc1/type.rb', line 2770
def _arithmetic_type_with_unsigned(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self) ⇒ Object
2702
2703
2704
2705
2706
2707
|
# File 'lib/adlint/cc1/type.rb', line 2702
def _arithmetic_type_with_unsigned_char(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self) ⇒ Object
2777
2778
2779
2780
2781
2782
|
# File 'lib/adlint/cc1/type.rb', line 2777
def _arithmetic_type_with_unsigned_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self) ⇒ Object
2797
2798
2799
2800
2801
2802
|
# File 'lib/adlint/cc1/type.rb', line 2797
def _arithmetic_type_with_unsigned_long(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self) ⇒ Object
2818
2819
2820
2821
2822
2823
|
# File 'lib/adlint/cc1/type.rb', line 2818
def _arithmetic_type_with_unsigned_long_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self) ⇒ Object
2839
2840
2841
2842
2843
2844
|
# File 'lib/adlint/cc1/type.rb', line 2839
def _arithmetic_type_with_unsigned_long_long(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self) ⇒ Object
2860
2861
2862
2863
2864
2865
|
# File 'lib/adlint/cc1/type.rb', line 2860
def _arithmetic_type_with_unsigned_long_long_int(lhs_type, rhs_type = self)
lhs_type end
|
#_arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self) ⇒ Object
2723
2724
2725
2726
2727
2728
|
# File 'lib/adlint/cc1/type.rb', line 2723
def _arithmetic_type_with_unsigned_short(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self) ⇒ Object
2744
2745
2746
2747
2748
2749
|
# File 'lib/adlint/cc1/type.rb', line 2744
def _arithmetic_type_with_unsigned_short_int(lhs_type, rhs_type = self)
lhs_type.integer_promoted_type end
|
#_arithmetic_type_with_void(lhs_type, rhs_type = self) ⇒ Object
2679
2680
2681
|
# File 'lib/adlint/cc1/type.rb', line 2679
def _arithmetic_type_with_void(lhs_type, rhs_type = self)
rhs_type.arithmetic_type_with(lhs_type)
end
|
#arbitrary_value ⇒ Object
2626
2627
2628
|
# File 'lib/adlint/cc1/type.rb', line 2626
def arbitrary_value
ScalarValue.of_nil(logical_right_shift?) end
|
2662
2663
2664
|
# File 'lib/adlint/cc1/type.rb', line 2662
def argument_promoted_type
self end
|
#arithmetic_type_with(type) ⇒ Object
2666
2667
2668
2669
|
# File 'lib/adlint/cc1/type.rb', line 2666
def arithmetic_type_with(type)
type._arithmetic_type_with_function(self)
end
|
#array? ⇒ Boolean
2513
2514
2515
|
# File 'lib/adlint/cc1/type.rb', line 2513
def array?
false
end
|
#base_type ⇒ Object
2471
2472
2473
|
# File 'lib/adlint/cc1/type.rb', line 2471
def base_type
nil
end
|
#bit_alignment ⇒ Object
2461
2462
2463
|
# File 'lib/adlint/cc1/type.rb', line 2461
def bit_alignment
0
end
|
2457
2458
2459
|
# File 'lib/adlint/cc1/type.rb', line 2457
def bit_size
0
end
|
#bitfield? ⇒ Boolean
2574
2575
2576
|
# File 'lib/adlint/cc1/type.rb', line 2574
def bitfield?
false
end
|
#brief_image ⇒ Object
2444
2445
2446
2447
|
# File 'lib/adlint/cc1/type.rb', line 2444
def brief_image
@brief_image ||=
create_brief_image(@return_type, @parameter_types, @have_va_list)
end
|
#coerce_array_value(val) ⇒ Object
2646
2647
2648
|
# File 'lib/adlint/cc1/type.rb', line 2646
def coerce_array_value(val)
ScalarValue.of_nil(logical_right_shift?) end
|
#coerce_composite_value(val) ⇒ Object
2650
2651
2652
|
# File 'lib/adlint/cc1/type.rb', line 2650
def coerce_composite_value(val)
ScalarValue.of_nil(logical_right_shift?) end
|
#coerce_scalar_value(val) ⇒ Object
2642
2643
2644
|
# File 'lib/adlint/cc1/type.rb', line 2642
def coerce_scalar_value(val)
ScalarValue.of_nil(logical_right_shift?) end
|
#coercible?(to_type) ⇒ Boolean
2497
2498
2499
|
# File 'lib/adlint/cc1/type.rb', line 2497
def coercible?(to_type)
false
end
|
#compatible?(to_type) ⇒ Boolean
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
|
# File 'lib/adlint/cc1/type.rb', line 2485
def compatible?(to_type)
return false unless to_type.function?
lhs_params = @parameter_types
rhs_params = to_type.parameter_types
@return_type.compatible?(to_type.return_type) &&
lhs_params.size == rhs_params.size &&
lhs_params.zip(rhs_params).all? { |lhs, rhs| lhs.compatible?(rhs) } &&
@have_va_list == to_type.have_va_list?
end
|
#const? ⇒ Boolean
2562
2563
2564
|
# File 'lib/adlint/cc1/type.rb', line 2562
def const?
false
end
|
#corresponding_signed_type ⇒ Object
2928
2929
2930
|
# File 'lib/adlint/cc1/type.rb', line 2928
def corresponding_signed_type
self end
|
#corresponding_unsigned_type ⇒ Object
2932
2933
2934
|
# File 'lib/adlint/cc1/type.rb', line 2932
def corresponding_unsigned_type
self end
|
#declarations ⇒ Object
2431
2432
2433
2434
|
# File 'lib/adlint/cc1/type.rb', line 2431
def declarations
@return_type.declarations +
@parameter_types.reduce([]) { |dcls, type| dcls + type.declarations }
end
|
2951
2952
2953
2954
|
# File 'lib/adlint/cc1/type.rb', line 2951
def dup
FunctionType.new(type_table, @return_type.dup,
@parameter_types.map { |t| t.dup }, @have_va_list)
end
|
#enum? ⇒ Boolean
2537
2538
2539
|
# File 'lib/adlint/cc1/type.rb', line 2537
def enum?
false
end
|
#enumerators ⇒ Object
2590
2591
2592
|
# File 'lib/adlint/cc1/type.rb', line 2590
def enumerators
[]
end
|
#explicitly_signed? ⇒ Boolean
2582
2583
2584
|
# File 'lib/adlint/cc1/type.rb', line 2582
def explicitly_signed?
false
end
|
#floating? ⇒ Boolean
2509
2510
2511
|
# File 'lib/adlint/cc1/type.rb', line 2509
def floating?
false
end
|
#function? ⇒ Boolean
2533
2534
2535
|
# File 'lib/adlint/cc1/type.rb', line 2533
def function?
true
end
|
#have_va_list? ⇒ Boolean
2586
2587
2588
|
# File 'lib/adlint/cc1/type.rb', line 2586
def have_va_list?
@have_va_list
end
|
2436
2437
2438
|
# File 'lib/adlint/cc1/type.rb', line 2436
def id
@id ||= FunctionTypeId.new(@return_type, @parameter_types, @have_va_list)
end
|
2440
2441
2442
|
# File 'lib/adlint/cc1/type.rb', line 2440
def image
@image ||= create_image(@return_type, @parameter_types, @have_va_list)
end
|
#impl_length ⇒ Object
2598
2599
2600
|
# File 'lib/adlint/cc1/type.rb', line 2598
def impl_length
0
end
|
#incomplete? ⇒ Boolean
2479
2480
2481
2482
2483
|
# File 'lib/adlint/cc1/type.rb', line 2479
def incomplete?
@return_type.incomplete? && !@return_type.void? or
@parameter_types.empty? ||
@parameter_types.any? { |type| type.incomplete? && !type.void? }
end
|
#integer? ⇒ Boolean
2505
2506
2507
|
# File 'lib/adlint/cc1/type.rb', line 2505
def integer?
false
end
|
#integer_conversion_rank ⇒ Object
2654
2655
2656
|
# File 'lib/adlint/cc1/type.rb', line 2654
def integer_conversion_rank
0 end
|
2658
2659
2660
|
# File 'lib/adlint/cc1/type.rb', line 2658
def integer_promoted_type
self end
|
2594
2595
2596
|
# File 'lib/adlint/cc1/type.rb', line 2594
def length
0
end
|
2449
2450
2451
|
# File 'lib/adlint/cc1/type.rb', line 2449
def location
nil
end
|
2614
2615
2616
|
# File 'lib/adlint/cc1/type.rb', line 2614
def max
0
end
|
#member_named(name) ⇒ Object
2606
2607
2608
|
# File 'lib/adlint/cc1/type.rb', line 2606
def member_named(name)
nil
end
|
2602
2603
2604
|
# File 'lib/adlint/cc1/type.rb', line 2602
def members
[]
end
|
2610
2611
2612
|
# File 'lib/adlint/cc1/type.rb', line 2610
def min
0
end
|
#named? ⇒ Boolean
2453
2454
2455
|
# File 'lib/adlint/cc1/type.rb', line 2453
def named?
true
end
|
#nil_value ⇒ Object
2618
2619
2620
|
# File 'lib/adlint/cc1/type.rb', line 2618
def nil_value
ScalarValue.of_nil(logical_right_shift?) end
|
#parameter_value ⇒ Object
2634
2635
2636
|
# File 'lib/adlint/cc1/type.rb', line 2634
def parameter_value
ScalarValue.of_nil(logical_right_shift?) end
|
#pointer? ⇒ Boolean
2525
2526
2527
|
# File 'lib/adlint/cc1/type.rb', line 2525
def pointer?
false
end
|
#qualified? ⇒ Boolean
2529
2530
2531
|
# File 'lib/adlint/cc1/type.rb', line 2529
def qualified?
false
end
|
#real_type ⇒ Object
2465
2466
2467
2468
2469
|
# File 'lib/adlint/cc1/type.rb', line 2465
def real_type
type_table.function_type(@return_type.real_type,
@parameter_types.map { |type| type.real_type },
@have_va_list)
end
|
#restrict? ⇒ Boolean
2570
2571
2572
|
# File 'lib/adlint/cc1/type.rb', line 2570
def restrict?
false
end
|
#return_value ⇒ Object
2638
2639
2640
|
# File 'lib/adlint/cc1/type.rb', line 2638
def return_value
ScalarValue.of_nil(logical_right_shift?) end
|
#scalar? ⇒ Boolean
2501
2502
2503
|
# File 'lib/adlint/cc1/type.rb', line 2501
def scalar?
false
end
|
#signed? ⇒ Boolean
2578
2579
2580
|
# File 'lib/adlint/cc1/type.rb', line 2578
def signed?
false
end
|
#standard? ⇒ Boolean
2549
2550
2551
|
# File 'lib/adlint/cc1/type.rb', line 2549
def standard?
false
end
|
#struct? ⇒ Boolean
2517
2518
2519
|
# File 'lib/adlint/cc1/type.rb', line 2517
def struct?
false
end
|
#undeclared? ⇒ Boolean
2553
2554
2555
|
# File 'lib/adlint/cc1/type.rb', line 2553
def undeclared?
false
end
|
#undefined_value ⇒ Object
2630
2631
2632
|
# File 'lib/adlint/cc1/type.rb', line 2630
def undefined_value
ScalarValue.of_nil(logical_right_shift?) end
|
#union? ⇒ Boolean
2521
2522
2523
|
# File 'lib/adlint/cc1/type.rb', line 2521
def union?
false
end
|
#unqualify ⇒ Object
2475
2476
2477
|
# File 'lib/adlint/cc1/type.rb', line 2475
def unqualify
self
end
|
#unresolved? ⇒ Boolean
2557
2558
2559
2560
|
# File 'lib/adlint/cc1/type.rb', line 2557
def unresolved?
@return_type.unresolved? ||
@parameter_types.any? { |type| type.unresolved? }
end
|
#user? ⇒ Boolean
2541
2542
2543
|
# File 'lib/adlint/cc1/type.rb', line 2541
def user?
false
end
|
#void? ⇒ Boolean
2545
2546
2547
|
# File 'lib/adlint/cc1/type.rb', line 2545
def void?
false
end
|
#volatile? ⇒ Boolean
2566
2567
2568
|
# File 'lib/adlint/cc1/type.rb', line 2566
def volatile?
false
end
|
#zero_value ⇒ Object
2622
2623
2624
|
# File 'lib/adlint/cc1/type.rb', line 2622
def zero_value
ScalarValue.of_nil(logical_right_shift?) end
|