diff options
Diffstat (limited to 'source/20-codegen-compiler/CodegenDecl.hpp')
-rw-r--r-- | source/20-codegen-compiler/CodegenDecl.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/20-codegen-compiler/CodegenDecl.hpp b/source/20-codegen-compiler/CodegenDecl.hpp index 739dbe4..00fc18e 100644 --- a/source/20-codegen-compiler/CodegenDecl.hpp +++ b/source/20-codegen-compiler/CodegenDecl.hpp @@ -5,7 +5,16 @@ // TODO replace std::string name with std::string_view into the token storage? +struct SourceFile { + std::string_view filename; // View into storage map key + bool header = false; + /// Whether this file is being reprocessed in this invocation of codegen.exe or not. + bool reprocessing = false; +}; + struct DeclNamespace { + // NOTE: namespace doesn't have a source file field, because the same namespace can be "reopened" in multipled files + DeclNamespace* container = nullptr; std::string name; std::string_view fullname; // View into storage map key @@ -26,6 +35,7 @@ struct DeclMemberFunction { // Structs or classes struct DeclStruct { + SourceFile* sourceFile = nullptr; DeclNamespace* container = nullptr; std::vector<const DeclStruct*> baseClasses; std::vector<DeclMemberVariable> memberVariables; @@ -72,6 +82,7 @@ struct DeclEnumElement { }; struct DeclEnum { + SourceFile* sourceFile = nullptr; DeclNamespace* container = nullptr; std::string name; std::string_view fullname; @@ -101,6 +112,7 @@ struct DeclFunctionArgument { }; struct DeclFunction { + SourceFile* sourceFile = nullptr; DeclNamespace* container = nullptr; // Things like extern, static, etc. that gets written before the function return type std::string prefix; |