aboutsummaryrefslogtreecommitdiff
path: root/source/20-codegen-compiler/CodegenDecl.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-06-24 17:34:56 -0700
committerrtk0c <[email protected]>2022-06-24 17:34:56 -0700
commitfd66e74445f50426aa8a137b0a9cfa6d088b953c (patch)
tree6e5d2557f567a7e11a7cc83612af482f27481a3a /source/20-codegen-compiler/CodegenDecl.hpp
parent4386c02d61b37c0d5c508895df2f028b8ea2057c (diff)
Changeset: 75 Add feature to delete entries from the database that belong to currently processed files
Diffstat (limited to 'source/20-codegen-compiler/CodegenDecl.hpp')
-rw-r--r--source/20-codegen-compiler/CodegenDecl.hpp12
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;