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.



1017
1018
1019
1020
# File 'lib/adlint/cc1/object.rb', line 1017

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

Instance Method Details

#callObject



1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
# File 'lib/adlint/cc1/object.rb', line 1026

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)


1022
1023
1024
# File 'lib/adlint/cc1/object.rb', line 1022

def designated_by_lvalue?
  true
end

#signatureObject



1037
1038
1039
# File 'lib/adlint/cc1/object.rb', line 1037

def signature
  FunctionSignature.new(name, type)
end