Added a helper function for SimplifyLibCalls to allow functions annotated with APCS, AAPCS or AAPCS_VFP to be treated like normal C functions if they only have integer and/or pointer arguments and return values, and is not on iOS.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Hi Sam,
Thanks for doing this. The testing in particular is really nice. I have a couple of superficial comments.
Cheers,
James
lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
59 ↗ | (On Diff #70996) | Typo: "compatible" |
59 ↗ | (On Diff #70996) | It'd be nice for the function to encode that it's talking about compatibility with the C calling convention. I understand that that would put a lot of C's in a row though... isCallingConvCCompatible() |
64 ↗ | (On Diff #70996) | I think this would look neater as a switch. |
68 ↗ | (On Diff #70996) | Please add a comment as to why. |
78 ↗ | (On Diff #70996) | param -> Param |
79 ↗ | (On Diff #70996) | This could simply be: if (!P->isPointerTy() && !P->isIntegerTy()) return false; |
Comment Actions
LGTM with one change.
lib/Transforms/Utils/SimplifyLibCalls.cpp | ||
---|---|---|
86 ↗ | (On Diff #71012) | Just change this to default: return false; so we don't end up with "enumeration value not covered in switch" warnings. |