Skip to content

Commit

Permalink
Move more semantic functions from func.d to funcsem.d and typesem.d (#…
Browse files Browse the repository at this point in the history
…16552)


---------

Co-authored-by: Alex Muscar <alex@muscar.eu>
  • Loading branch information
muscar and Alex Muscar authored Jun 2, 2024
1 parent 07bc5b9 commit 0330991
Show file tree
Hide file tree
Showing 6 changed files with 371 additions and 369 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dmd/cxxfrontend.d
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ bool functionSemantic3(FuncDeclaration fd)
return dmd.funcsem.functionSemantic3(fd);
}

MATCH leastAsSpecialized(FuncDeclaration f, FuncDeclaration g, Identifiers* names)
MATCH leastAsSpecialized(FuncDeclaration fd, FuncDeclaration g, Identifiers* names)
{
import dmd.funcsem;
return dmd.funcsem.leastAsSpecialized(f, g, names);
return dmd.funcsem.leastAsSpecialized(fd, g, names);
}

/***********************************************************
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace dmd
bool functionSemantic(FuncDeclaration* fd);
bool functionSemantic3(FuncDeclaration* fd);
MATCH leastAsSpecialized(FuncDeclaration *f, FuncDeclaration *g, Identifiers *names);
PURE isPure(FuncDeclaration *f);
}

//enum STC : ulong from astenums.d:
Expand Down Expand Up @@ -719,7 +720,6 @@ class FuncDeclaration : public Declaration
bool isCodeseg() const override final;
bool isOverloadable() const override final;
bool isAbstract() override final;
PURE isPure();
bool isSafe();
bool isTrusted();
bool isNogc();
Expand Down
17 changes: 8 additions & 9 deletions compiler/src/dmd/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -3621,14 +3621,6 @@ struct ObjcFuncDeclaration final
{}
};

enum class PURE : uint8_t
{
impure = 0u,
fwdref = 1u,
weak = 2u,
const_ = 3u,
};

enum class VarArg : uint8_t
{
none = 0u,
Expand Down Expand Up @@ -3798,7 +3790,6 @@ class FuncDeclaration : public Declaration
bool isOverloadable() const final override;
bool isAbstract() final override;
void initInferAttributes();
PURE isPure();
bool isSafe();
bool isTrusted();
bool isNogc();
Expand Down Expand Up @@ -4365,6 +4356,14 @@ enum class TRUST : uint8_t
safe = 3u,
};

enum class PURE : uint8_t
{
impure = 0u,
fwdref = 1u,
weak = 2u,
const_ = 3u,
};

class TypeFunction final : public TypeNext
{
public:
Expand Down
Loading

0 comments on commit 0330991

Please sign in to comment.