Commit Graph

13 Commits

Author SHA1 Message Date
John McCall
f7e73ccc48 Delay the formal accesses associated with inout-to-pointer and
array-to-pointer argument conversions until just before the call.

rdar://31781386
2017-04-25 03:54:49 -04:00
John McCall
e44f37fd8d Thread an enforcement kind through a few places. NFC. 2017-04-05 01:25:35 -04:00
John McCall
305c94fc5b Pare down the Initialization interface and allow implementations
to insert code before performing an in-place initialization.

Intended to be NFC, but some of the clients needed more rewriting
than others.
2017-03-31 18:55:09 -04:00
Michael Gottesman
89496492b2 [silgen] Fix a variable lifetime scoping issue.
rdar://31145255
2017-03-20 10:16:29 -07:00
Michael Gottesman
2e80412f5c [silgen] Move the creation of the allocation for foreignErrors when creating the result plan, so it is created early before we create any potential argument scopes.
rdar://30955427
2017-03-18 16:25:34 -07:00
Michael Gottesman
8723301205 [silgen] Move implementation of emitForeignErrorArgument into ResultPlan. 2017-03-18 16:06:58 -07:00
Michael Gottesman
a5747c4dbc [silgen] Create a ForiegnErrorInitiliazation plan as a first step towards eliminating special handling of foreign error parameters. 2017-03-18 15:57:46 -07:00
Michael Gottesman
f4f41337e3 [gardening] Change some CalleeTypeInfo '&' parameters to be 'const &' parameters. NFC. 2017-03-18 14:40:50 -07:00
Michael Gottesman
53eab13be8 [silgen] Move foreignErrorPreparation code in ResultPlanBuilder into a new buildTopLevelResult method.
I am going to be cleaning up some of the code here so that I can move the
creation of a temporary needed for foreign error handling earlier and move the
handling of the error parameter in general into ResultPlanBuilder.

Otherwise, the temporary is cleaned up when I pop a soon to be committed patch
that creates scopes around call sites.

rdar://30955427
2017-03-17 19:03:33 -07:00
Michael Gottesman
213ddd753f [silgen] Compute the ResultPlan outside of SILGenApply so that we can untangle indirect result/normal argument lifetime scopes.
rdar://30955427
2017-03-14 00:39:53 -07:00
Michael Gottesman
b0522635d4 [silgen] Instead of computing the indirect result addrs as we build/store it. Just generate it dynamically.
This is being done in preparation for moving ResultPlan /out of/
SILGenFunction::apply.

rdar://30955427
2017-03-14 00:39:48 -07:00
Michael Gottesman
6769f78460 [silgen] Standardize field names in ResultPlan.{cpp,h} to match SILGen norms of camelCase instead of CamelCase. 2017-03-13 19:29:05 -07:00
Michael Gottesman
8521601215 [silgen] Move ResultPlan from SILGenApply.cpp -> ResultPlan.{h,cpp}
ResultPlan and related constructs have already been written in a type erased
fashion. This commit takes advantage of this by moving the details of the code
to ResultPlan.{cpp,h}.

This slims down SILGenApply.cpp in a NFC way and ensures that other code in
SILGenApply can not depend on the details of ResultPlan. Also it is my hope that
this can become the beginning of the merging of the ResultPlan from SILGenApply
and from SILGenPoly. We should only have 1 way in SILGen to build applies and
create apply results.

rdar://29791263
2017-03-13 10:32:33 -07:00