Page MenuHomePhabricator

Expose TailCallKind via the LLVM C API
ClosedPublic

Authored by etaoins on Sat, Aug 10, 10:23 PM.

Details

Summary

This exposes CallInst's tail call kind via new LLVMGetTailCallKind and LLVMSetTailCallKind functions. The motivation for this is to be able to see musttail for languages that require mandatory tail calls for correctness. Today only the weaker LLVMSetTail is exposed and there is no way to set GuaranteedTailCallOpt via the C API.

Diff Detail

Repository
rL LLVM

Event Timeline

etaoins created this revision.Sat, Aug 10, 10:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptSat, Aug 10, 10:23 PM
CodaFi accepted this revision.Sat, Aug 10, 10:52 PM
This revision is now accepted and ready to land.Sat, Aug 10, 10:52 PM

Thanks for the quick review! I don't have commit access so it'd be great if someone could land this for me.

This revision was automatically updated to reflect the committed changes.

This test seems to be failing pretty much everywhere. Can you please have a look or should we revert it?

Y’all can revert it. I’ll resubmit the patch with updated tests tomorrow.

Y’all can revert it. I’ll resubmit the patch with updated tests tomorrow.

Will do. Thanks!

Jim added a subscriber: Jim.Thu, Aug 15, 12:05 AM
Jim added inline comments.
llvm/trunk/lib/IR/Core.cpp
2848

This switch should have default case. You can add that look like.

default: 
  llvm_unreachable("Unexpected TailCallKind");