GC plugin: Not add (postcall) safe point after tail-call

Hi all,

I have implemented a GC plugin and i want to exclude Tail-call instructions from being considered as Safe Points. For that reason I have overwritten the “findCustomSafePoints” function with something like that:

bool ErlangGC::findCustomSafePoints(GCFunctionInfo &FI, MachineFunction &MF) {
for (MachineFunction::iterator BBI = MF.begin(),
BBE = MF.end(); BBI != BBE; ++BBI)
for (MachineBasicBlock::iterator MI = BBI->begin(),
ME = BBI->end(); MI != ME; ++MI)
if (MI->getDesc().isCall() && !isTailCall(MI))
VisitCallPoint(FI, MI);

return false;

using Nicolas’ patch 1 and his code in VMkit as a template 2.

My problem is that I am not sure how i should define the “isTailCall” function in order to be target-independent. Any advice is welcome!

Thank you in advance,