Page MenuHomePhabricator

[opaque pointer types] Pass function types for runtime function calls.

Authored by jyknight on Feb 3 2019, 3:06 PM.



Emit{Nounwind,}RuntimeCall{,OrInvoke} have been modified to take a
FunctionCallee as an argument, and CreateRuntimeFunction has been
modified to return a FunctionCallee. All callers have been updated.

Additionally, CreateBuiltinFunction is removed, as it was redundant
with CreateRuntimeFunction after some previous changes.

Diff Detail

rC Clang

Event Timeline

jyknight created this revision.Feb 3 2019, 3:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2019, 3:06 PM
dblaikie added inline comments.Feb 4 2019, 1:22 PM
1028–1030 ↗(On Diff #184982)

This code looks like it implies that the 'if' is never hit? (since cast doesn't propagate null (it asserts/fails/UB on null)) - should this be cast_or_null instead? Or "if(!CGM.getObjCRuntime().getPropertyGetFunction())" ?)

(there are a few similar instances later on)

jyknight marked an inline comment as done.Feb 4 2019, 6:45 PM
jyknight added inline comments.
1028–1030 ↗(On Diff #184982)

Indeed, good catch! I don't know if that actually happens, but this code also didn't even need these casts.

Removed the casts, both simplifying the code, and fixing that potential issue.

jyknight updated this revision to Diff 185215.Feb 4 2019, 6:47 PM

Address comment.

dblaikie accepted this revision.Feb 4 2019, 7:17 PM

Great - thanks!

This revision is now accepted and ready to land.Feb 4 2019, 7:17 PM
This revision was automatically updated to reflect the committed changes.