Aaron Gray
2005-Jul-03 22:05 UTC
[LLVMdev] How do you determine whether a function is defined externally to a module ?
How do you determine whether a function is defined externally ? Basically I want a list of external functions but cannot seem to get one. e.g. I want to create the following list for a module EXTERN _printf : NEAR EXTERN _malloc : NEAR EXTERN _an_external_fn : NEAR I have tried all the obvious permutations but cannot seem to get only the extrnally defined symbols. Help, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050703/1047572a/attachment.html>
Aaron Gray
2005-Jul-03 22:40 UTC
[LLVMdev] How do you determine whether a function is definedexternally to a module ?
> 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
Chris Lattner
2005-Jul-03 23:04 UTC
[LLVMdev] How do you determine whether a function is defined externally to a module ?
On Sun, 3 Jul 2005, Aaron Gray wrote:> How do you determine whether a function is defined externally ? > Basically I want a list of external functions but cannot seem to get one. > > e.g. I want to create the following list for a module > > EXTERN _printf : NEAR > EXTERN _malloc : NEAR > EXTERN _an_external_fn : NEAR > > I have tried all the obvious permutations but cannot seem to get only the extrnally defined symbols.Something like this should work: for (Module::iterator F = M->begin(), E = M->end(); F != E; ++F) if (F->isExternal()) ... Function* F is external! ... 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. -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
Apparently Analagous Threads
- [LLVMdev] How do you determine whether a function is definedexternally to a module ?
- [LLVMdev] How do you determine whether a function isdefinedexternally to a module ?
- [LLVMdev] How do you determine whether a functionisdefinedexternally to a module ?
- [LLVMdev] How do you determine whether a function is defined externally to a module ?
- [LLVMdev] How do you determine whether a function is defined externally to a module ?