diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 10:34:37 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 10:34:37 +0000 |
| commit | e572d278a44d286c8713d0ee4af9c72a3d1ca73c (patch) | |
| tree | 2fd37a936d1d96869776b2fd4577a121eee974c2 /include/cps/CodeGen.h | |
| parent | 377a1fd2eadd2a70cd27f13e2fee6e96c8706a51 (diff) | |
feat(classes): overload methods and NEW constructors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/CodeGen.h')
| -rw-r--r-- | include/cps/CodeGen.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 463c613..04bf25c 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -43,9 +43,12 @@ class CodeGen { void importSymbols(); void runGlobalPrePass(const SourceUnit &Unit, int Phase); IdentifierMap<SymbolInfo> Symbols; - IdentifierMap<IdentifierMap<FunctionDefAST*>> ClassMethods; + IdentifierMap<IdentifierMap<std::vector<FunctionDefAST*>>> ClassMethods; std::string CurrentClass; - const PrototypeAST *findMethod(const std::string &Class, const std::string &Name) const; + const std::vector<FunctionDefAST *> *findMethod(const std::string &Class, const std::string &Name) const; + bool isRegisteredMethod(const std::string &Class, const PrototypeAST *Method) const; + const FuncSig *resolveMethod(const std::string &Class, const std::string &Name, + const std::vector<std::unique_ptr<ExprAST>> &Args); llvm::Value *emitMemberCall(MemberCallExprAST *Call); llvm::Value *emitMethodCall(const std::string &Class, llvm::Value *Receiver, const std::string &Name, |
