diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 03:30:36 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 03:58:36 +0000 |
| commit | a84128bbc1b69ab5b763d2c607b6f9f1c667802b (patch) | |
| tree | 00c22ab29f2345f86f81c3654b78c711cceb4478 /lib/CodeGen | |
| parent | 3582c493e26f18bcb62111e10980d5c841962362 (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 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/TypeSystem.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/TypeSystem.cc b/lib/CodeGen/TypeSystem.cc index 7763d35..a84200b 100644 --- a/lib/CodeGen/TypeSystem.cc +++ b/lib/CodeGen/TypeSystem.cc @@ -111,9 +111,9 @@ const TypeInfo *TypeSystem::resolve(const std::string &TypeName) const { return &It->second; } -const TypeInfo *TypeSystem::registerType(const std::string &TypeName, - Type *LLVMType, - TypeKind Kind) { +TypeInfo *TypeSystem::registerType(const std::string &TypeName, + Type *LLVMType, + TypeKind Kind) { TypeInfo Info; Info.Name = TypeName; Info.LLVMType = LLVMType; @@ -150,8 +150,7 @@ bool TypeSystem::declareUserType(const std::string &Name, TypeKind Kind, std::st return false; } - registerType(Name, LLVMType, Kind); - Types.find(Name)->second.IsClass = IsClass; + registerType(Name, LLVMType, Kind)->IsClass = IsClass; return true; } |
