[LLVMdev] Docs question: legality of inspecting other functions in a function pass

Duncan Sands baldrick at free.fr
Fri Jul 5 23:45:53 PDT 2013

Hi Stephen,

On 05/07/13 17:14, Stephen Lin wrote:
>> both dragonegg and clang (AFAIK) run some function passes on each function
>> in turn as they are turned into LLVM IR.  If such a function pass tried to
>> inspect other functions then they won't be able to see all function bodies
>> because they haven't all been output yet.  And which functions do have
>> bodies
>> available to be inspected depends on the order in which clang decides to
>> output functions, so the results of running the pass would depend on that
>> order.
>> Ciao, Duncan.
> OK, so to be clear, the docs are incomplete and need to be updated?
> Just trying to get explicit confirmation before I patch this...

in my opinion function passes should not be inspecting the bodies of other
functions.  I'm happy to review a doc patch that says this.

Ciao, Duncan.

More information about the llvm-dev mailing list