diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-13 13:40:57 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-13 13:40:57 +0000 |
| commit | f5a2541ed3faf9a942b867e2d54577352153afce (patch) | |
| tree | d5f737fdb8d77dc67d46cc12f8603c7df6a168c7 /lib/CodeGen/Designator.cc | |
| parent | 5b08d59dba28b99cf991c02e837297fbfdb190c9 (diff) | |
Refactor record fields to preserve visibility and share parsing
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/Designator.cc')
| -rw-r--r-- | lib/CodeGen/Designator.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc index ad0cc49..640ca0b 100644 --- a/lib/CodeGen/Designator.cc +++ b/lib/CodeGen/Designator.cc @@ -58,10 +58,7 @@ void CodeGen::runTypePrePass(const std::vector<std::unique_ptr<StmtAST>> &Statem } else if (auto *P = dynamic_cast<PointerTypeDeclAST*>(S.get())) { Ok = Types->definePointer(P->getName(), P->getPointeeTypeName(), Err); } else if (auto *R = dynamic_cast<RecordTypeDeclAST*>(S.get())) { - std::vector<std::pair<std::string, std::string>> Fields; - for (const RecordFieldDecl &F : R->getFields()) - Fields.emplace_back(F.Name, F.TypeName); - Ok = Types->defineRecord(R->getName(), Fields, Err); + Ok = Types->defineRecord(R->getName(), R->getFields(), Err); } if (!Ok) reportError("%s", Err.c_str()); } |
