From 8c2b1bd5bd85667a2ea24ec3aa85cbdd97f9ea1c Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 17 Jul 2022 23:09:00 -0700 Subject: Changeset: 85 Work on codegen (a big blob of changes about various things, giving up on writing a clear commit message) - stuff along the lines of cleaning up store process - remove completed TODOs - move code generation out of parser loop - ^^^ also introduce some weird bugs of DeclXxx::name field disappearing -- maybe fixed, maybe didn't, can't reliably reproduce - add infra to mangle (not included in codegen yet, also not tested) - convert SourceFile storage map to node map, ensuring pointer stability (was broken before) - buildsystem asan and UBsan applying to all targest --- source/20-codegen-compiler/CodegenUtils.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/20-codegen-compiler/CodegenUtils.hpp') diff --git a/source/20-codegen-compiler/CodegenUtils.hpp b/source/20-codegen-compiler/CodegenUtils.hpp index be62f1e..2d5b684 100644 --- a/source/20-codegen-compiler/CodegenUtils.hpp +++ b/source/20-codegen-compiler/CodegenUtils.hpp @@ -5,6 +5,7 @@ #include "CodegenOutput.hpp" #include +#include #include // I give up, hopefully nothing overflows this buffer @@ -44,7 +45,10 @@ namespace Utils { bool WriteOutputFile(const CodegenOutput& output, const char* path); +std::string JoinNames(DeclNamespace* ns, std::string_view prefix, std::string_view suffix, std::string_view delimiter); std::string MakeFullName(std::string_view name, DeclNamespace* ns = nullptr); +std::string MakeMangledName(std::string_view name, DeclNamespace* ns = nullptr); + std::vector SplitIdentifier(std::string_view name); std::string MakePascalCase(std::string_view name); -- cgit v1.2.3-70-g09d2