Page MenuHomePhabricator

Expose TailCallKind via the LLVM C API
ClosedPublic

Authored by etaoins on Aug 10 2019, 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.Aug 10 2019, 10:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2019, 10:23 PM
CodaFi accepted this revision.Aug 10 2019, 10:52 PM
This revision is now accepted and ready to land.Aug 10 2019, 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.Aug 15 2019, 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");