From fd66e74445f50426aa8a137b0a9cfa6d088b953c Mon Sep 17 00:00:00 2001 From: rtk0c Date: Fri, 24 Jun 2022 17:34:56 -0700 Subject: Changeset: 75 Add feature to delete entries from the database that belong to currently processed files --- source/20-codegen-compiler/CodegenDecl.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/20-codegen-compiler/CodegenDecl.hpp') 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 baseClasses; std::vector 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; -- cgit v1.2.3-70-g09d2