aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 03:30:36 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 03:58:36 +0000
commita84128bbc1b69ab5b763d2c607b6f9f1c667802b (patch)
tree00c22ab29f2345f86f81c3654b78c711cceb4478 /include
parent3582c493e26f18bcb62111e10980d5c841962362 (diff)
refactor(codegen): make importCType private and reuse registerType's entry
importCType is only called from TypeSystem's own methods. declareUserType now sets IsClass through the entry registerType returns instead of looking the name up again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include')
-rw-r--r--include/cps/TypeSystem.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/cps/TypeSystem.h b/include/cps/TypeSystem.h
index 69283bc..5f9af63 100644
--- a/include/cps/TypeSystem.h
+++ b/include/cps/TypeSystem.h
@@ -123,9 +123,10 @@ class TypeSystem {
std::function<bool(const std::string &)> Visible;
std::function<const TypeInfo *(const std::string &)> ResolveMiss;
void registerBuiltins();
- const TypeInfo *registerType(const std::string &TypeName,
- llvm::Type *LLVMType,
- TypeKind Kind);
+ TypeInfo *registerType(const std::string &TypeName,
+ llvm::Type *LLVMType,
+ TypeKind Kind);
+ const TypeInfo *importCType(const std::string &Expression, std::string &Err);
public:
explicit TypeSystem(llvm::LLVMContext &Ctx);
@@ -151,7 +152,6 @@ public:
std::string &Err);
bool defineCAlias(const std::string &Name, const std::string &Expression,
std::string &Err);
- const TypeInfo *importCType(const std::string &Expression, std::string &Err);
bool sameType(const std::string &Left, const std::string &Right) const;
const TypeInfo *promoteCScalar(const TypeInfo *Info) const;
const TypeInfo *commonCScalar(const TypeInfo *Left, const TypeInfo *Right) const;