Move genCfunc to cxxfrontend (#20992)

This commit is contained in:
Dennis 2025-03-16 23:40:49 +01:00 committed by GitHub
parent d5e6f49098
commit 57a60e575c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 7 deletions

View file

@ -276,6 +276,19 @@ bool fill(StructDeclaration sd, Loc loc,
return dmd.expressionsem.fill(sd, loc, elements, ctorinit); return dmd.expressionsem.fill(sd, loc, elements, ctorinit);
} }
/***********************************************************
* func.d
*/
FuncDeclaration genCfunc(Parameters* fparams, Type treturn, const(char)* name, StorageClass stc = STC.none)
{
return FuncDeclaration.genCfunc(fparams, treturn, name, cast(STC) stc);
}
FuncDeclaration genCfunc(Parameters* fparams, Type treturn, Identifier id, StorageClass stc = STC.none)
{
return FuncDeclaration.genCfunc(fparams, treturn, id, cast(STC) stc);
}
/*********************************************************** /***********************************************************
* funcsem.d * funcsem.d
*/ */

View file

@ -726,13 +726,13 @@ public:
bool hasNestedFrameRefs(); bool hasNestedFrameRefs();
ParameterList getParameterList(); ParameterList getParameterList();
static FuncDeclaration *genCfunc(Parameters *args, Type *treturn, const char *name, StorageClass stc=0);
static FuncDeclaration *genCfunc(Parameters *args, Type *treturn, Identifier *id, StorageClass stc=0);
virtual FuncDeclaration *toAliasFunc() { return this; } virtual FuncDeclaration *toAliasFunc() { return this; }
void accept(Visitor *v) override { v->visit(this); } void accept(Visitor *v) override { v->visit(this); }
}; };
FuncDeclaration *genCfunc(Parameters *args, Type *treturn, const char *name, StorageClass stc=0);
FuncDeclaration *genCfunc(Parameters *args, Type *treturn, Identifier *id, StorageClass stc=0);
class FuncAliasDeclaration final : public FuncDeclaration class FuncAliasDeclaration final : public FuncDeclaration
{ {
public: public:

View file

@ -4052,8 +4052,6 @@ public:
bool needsClosure(); bool needsClosure();
bool hasNestedFrameRefs(); bool hasNestedFrameRefs();
ParameterList getParameterList(); ParameterList getParameterList();
static FuncDeclaration* genCfunc(Array<Parameter* >* fparams, Type* treturn, const char* name, STC stc = (STC)0LLU);
static FuncDeclaration* genCfunc(Array<Parameter* >* fparams, Type* treturn, Identifier* id, STC stc = (STC)0LLU);
virtual FuncDeclaration* toAliasFunc(); virtual FuncDeclaration* toAliasFunc();
void accept(Visitor* v) override; void accept(Visitor* v) override;
}; };

View file

@ -1006,12 +1006,12 @@ extern (C++) class FuncDeclaration : Declaration
/********************************** /**********************************
* Generate a FuncDeclaration for a runtime library function. * Generate a FuncDeclaration for a runtime library function.
*/ */
static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, const(char)* name, STC stc = STC.none) extern(D) static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, const(char)* name, STC stc = STC.none)
{ {
return genCfunc(fparams, treturn, Identifier.idPool(name[0 .. strlen(name)]), stc); return genCfunc(fparams, treturn, Identifier.idPool(name[0 .. strlen(name)]), stc);
} }
static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, Identifier id, STC stc = STC.none) extern(D) static FuncDeclaration genCfunc(Parameters* fparams, Type treturn, Identifier id, STC stc = STC.none)
{ {
FuncDeclaration fd; FuncDeclaration fd;
TypeFunction tf; TypeFunction tf;