Class: AdLint::Cc1::NamedFunction

Inherits:
Function show all
Includes:
Nameable
Defined in:
lib/adlint/cc1/object.rb

Instance Attribute Summary

Attributes included from Nameable

#name

Attributes inherited from TypedObject

#type

Attributes inherited from Object

#declarations_and_definitions

Attributes included from Bindable

#binding

Instance Method Summary collapse

Methods included from Nameable

#named?

Methods inherited from Function

#builtin?, #explicit?, #function?, #implicit?, #name, #named?, #temporary?, #variable?

Methods inherited from TypedObject

#to_pointer, #to_pointer_value, #to_value, #to_variable

Methods inherited from Object

#declared_as_auto?, #declared_as_extern?, #declared_as_register?, #declared_as_static?, #function?, #named?, #storage_class_specifiers, #temporary?, #variable?

Methods included from Bindable

#be_alias_to, #bind_to

Constructor Details

#initialize(dcl_or_def, type, name) ⇒ NamedFunction

Returns a new instance of NamedFunction.



1026
1027
1028
1029
# File 'lib/adlint/cc1/object.rb', line 1026

def initialize(dcl_or_def, type, name)
  super(dcl_or_def, type)
  self.name = name
end

Instance Method Details

#callObject



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/adlint/cc1/object.rb', line 1035

def call(*)
  case name
  when "exit", "_exit", "abort"
    BreakEvent.of_return.throw
  when "longjmp", "siglongjmp"
    BreakEvent.of_return.throw
  else
    super
  end
end

#designated_by_lvalue?Boolean

Returns:

  • (Boolean)


1031
1032
1033
# File 'lib/adlint/cc1/object.rb', line 1031

def designated_by_lvalue?
  true
end

#signatureObject



1046
1047
1048
# File 'lib/adlint/cc1/object.rb', line 1046

def signature
  FunctionSignature.new(name, type)
end