diff options
Diffstat (limited to 'source/20-codegen-compiler/CodegenDecl.hpp')
-rw-r--r-- | source/20-codegen-compiler/CodegenDecl.hpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/20-codegen-compiler/CodegenDecl.hpp b/source/20-codegen-compiler/CodegenDecl.hpp index d99f79c..eacd254 100644 --- a/source/20-codegen-compiler/CodegenDecl.hpp +++ b/source/20-codegen-compiler/CodegenDecl.hpp @@ -1,12 +1,18 @@ #pragma once +#include "CodegenOutput.hpp" + #include <string> #include <vector> // TODO replace std::string name with std::string_view into the token storage? struct SourceFile { - std::string_view filename; // View into storage map key + std::string filename; + CodegenOutput preHeaderOutput; + CodegenOutput postHeaderOutput; + CodegenOutput postSourceOutput; + CodegenOutput tuOutput; // "tu" = Translation Unit, produces a separately compiled .cpp file bool header = false; /// Whether this file is being reprocessed in this invocation of codegen.exe or not. bool reprocessing = false; @@ -27,6 +33,8 @@ struct DeclMemberVariable { std::string type; std::string getterName; std::string setterName; + bool isGetterGenerated = false; + bool isSetterGenerated = false; }; struct DeclMemberFunction { DeclStruct* containerStruct = nullptr; @@ -43,11 +51,14 @@ struct DeclStruct { std::vector<DeclMemberFunction> memberFunctions; std::vector<DeclMemberFunction> generatedFunctions; std::string name; + mutable std::string mangledName; std::string_view fullname; // Scanned generation options bool generating : 1 = false; bool generatingInheritanceHiearchy : 1 = false; + + const std::string& GetMangledName() const; }; enum EnumUnderlyingType { @@ -85,6 +96,7 @@ struct DeclEnum { SourceFile* sourceFile = nullptr; DeclNamespace* container = nullptr; std::string name; + mutable std::string mangledName; std::string_view fullname; std::vector<DeclEnumElement> elements; EnumUnderlyingType underlyingType; @@ -101,6 +113,10 @@ struct DeclEnum { // NOTE: see GenerateForEnum() for the exact heuristics bool generateExcludeUseHeuristics : 1 = false; + const std::string& GetName() const { return name; } + std::string_view GetFullName() const { return fullname; } + const std::string& GetMangledName() const; + std::string_view GetUnderlyingTypeName() const; EnumValuePattern CalcPattern() const; |