[llvm-dev] Functions accessible from a function

Alex Denisov via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 20 23:21:52 PDT 2017


Hello everybody,

I am trying to do some static analysis, e.g. find which other functions accessible from a function.
Current naive implementation goes over each instruction and whether it is a call site or not.
It works great so far, but there are some cases where it doesn’t work. For example:

  declare no_source(function: f) // uses f internally
  define foo() { ... }
  define bar() { ... }

  define buzz() {
    call foo()
    call no_source(&bar)
    ret
  }

In this case, my implementation catches 'foo' but not 'bar.'
There are must be less trivial but also detectable cases.

Can anybody give a hint or advice on how to do such kind of analysis?

Cheers,
Alex.
-- 
AlexDenisov
Software Engineer, https://lowlevelbits.org



More information about the llvm-dev mailing list