- more preparations to compile functions:
* Allow PFunction to work without a VMFunction being attached. * The Variant for a function must store the prototype itself instead of relying on the VMFunction it points to. Otherwise it would not be possible to reference a prototype during compilation of the function because it does not exist yet. * Give the variant a list of the function's argument's names, because these are also needed to compile the function. * create an anonymous function symbol when the function gets registered to the builder. At this point we have all the needed information to set it up correctly, but later this is no longer the case. This is the most convenient info to have here because it contains everything that's needed to compile the function in the proper context, so it has to be present when starting compilation. * added some preparations to implement special handling for weapons and custom inventory items, which can run action functions in another actor's context. This part is not active yet but the basics are present in SetImplicitArgs.
This commit is contained in:
parent
2cb5839c11
commit
32a3f57a54
13 changed files with 91 additions and 69 deletions
|
|
@ -3883,7 +3883,7 @@ FxVMFunctionCall::~FxVMFunctionCall()
|
|||
PPrototype *FxVMFunctionCall::ReturnProto()
|
||||
{
|
||||
EmitTail = true;
|
||||
return Function->Variants[0].Implementation->Proto;
|
||||
return Function->Variants[0].Proto;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -3916,7 +3916,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
|||
{
|
||||
CHECKRESOLVED();
|
||||
bool failed = false;
|
||||
auto proto = Function->Variants[0].Implementation->Proto;
|
||||
auto proto = Function->Variants[0].Proto;
|
||||
auto argtypes = proto->ArgumentTypes;
|
||||
|
||||
int implicit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue