[LLVMdev] How do you determine whether a function is definedexternally to a module ?

Aaron Gray angray at beeb.net
Sun Jul 3 15:40:13 PDT 2005


> Something like this should work:
>
> for (Module::iterator F = M->begin(), E = M->end(); F != E; ++F)
>   if (F->isExternal())
>     ... Function* F is external! ...

This is not working. For some reason there is a BasicBlock present on 
undefined functions !

I am compiling the examples from llvm/test/feature, about 28 out of 34 
assemble fine. Just cannot seem to get the externals listed, been trying for 
several hours :(

> If you take a look at the PowerPC asm printer, it has to do some special 
> things for external functions as well, it might give you some ideas.

I will have a look at this then.

Aaron




More information about the llvm-dev mailing list