[LLVMdev] How to differentiate between external and internal calls in llc?

Artjom Kochtchi artjom.kochtchi at googlemail.com
Sun Sep 6 03:51:51 PDT 2009

I have a MachineFunctionPass plugged into llc during
LLVMTargetMachine::addPreRegAlloc. In this Pass I need to extend calls (i.
e. CALL32m, CALL32r) iff they call function within the program.

CALL32m has, I think, ten different possibilities for the four operands
giving the target address. At the moment I have excluded calls that give the
displacement as GlobalAddress or JumpTableIndex (although I am not sure
whether this is actually right or whether I exclude to many calls this way).

But there appear to be CALL32r instructions that also call locations outside
the program.

Is there any way to determine the location of the call target more
precisely? I tried

for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(), SE =
BB->succ_end(); SI != SE; ++SI) {
	MachineBasicBlock *SBB = *SI;
	if (SBB->getParent()->getFunction()->isDeclaration())
		skip = true;

but it seems not to do what I intended.
View this message in context: http://www.nabble.com/How-to-differentiate-between-external-and-internal-calls-in-llc--tp25316545p25316545.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090906/469a974b/attachment.html>

More information about the llvm-dev mailing list