class AdLint::Ld::FunctionMap

Attributes

composing_fpaths[R]

Public Class Methods

new() click to toggle source
# File lib/adlint/ld/object.rb, line 267
def initialize
  @def_index = Hash.new { |hash, key| hash[key] = Set.new }
  @dcl_index = Hash.new { |hash, key| hash[key] = Set.new }
  @composing_fpaths = Set.new
end

Public Instance Methods

add_function(fun) click to toggle source
# File lib/adlint/ld/object.rb, line 275
def add_function(fun)
  @def_index[fun.name].add(fun)
  @composing_fpaths.add(fun.location.fpath)
end
add_function_declaration(fun_dcl) click to toggle source
# File lib/adlint/ld/object.rb, line 280
def add_function_declaration(fun_dcl)
  @dcl_index[fun_dcl.name].add(fun_dcl)
  @composing_fpaths.add(fun_dcl.location.fpath)
end
all_function_declarations() click to toggle source
# File lib/adlint/ld/object.rb, line 289
def all_function_declarations
  @dcl_index.values.reduce(Set.new) { |all, dcls| all + dcls }.to_a
end
all_functions() click to toggle source
# File lib/adlint/ld/object.rb, line 285
def all_functions
  @def_index.values.reduce(Set.new) { |all, funs| all + funs }.to_a
end
lookup_function_declarations(fun_name) click to toggle source
# File lib/adlint/ld/object.rb, line 297
def lookup_function_declarations(fun_name)
  @dcl_index[fun_name].to_a
end
lookup_functions(fun_name) click to toggle source
# File lib/adlint/ld/object.rb, line 293
def lookup_functions(fun_name)
  @def_index[fun_name].to_a
end