aboutsummaryrefslogtreecommitdiff
path: root/source/20-codegen-compiler/CodegenDecl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/20-codegen-compiler/CodegenDecl.hpp')
-rw-r--r--source/20-codegen-compiler/CodegenDecl.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/20-codegen-compiler/CodegenDecl.hpp b/source/20-codegen-compiler/CodegenDecl.hpp
index eacd254..e645323 100644
--- a/source/20-codegen-compiler/CodegenDecl.hpp
+++ b/source/20-codegen-compiler/CodegenDecl.hpp
@@ -23,7 +23,7 @@ struct DeclNamespace {
DeclNamespace* container = nullptr;
std::string name;
- std::string_view fullname; // View into storage map key
+ const std::string* fullname = nullptr; // View into storage map key
};
struct DeclStruct;
@@ -52,12 +52,14 @@ struct DeclStruct {
std::vector<DeclMemberFunction> generatedFunctions;
std::string name;
mutable std::string mangledName;
- std::string_view fullname;
+ const std::string* fullname = nullptr; // View into storage map key
// Scanned generation options
bool generating : 1 = false;
bool generatingInheritanceHiearchy : 1 = false;
+ const std::string& GetName() const { return name; }
+ const std::string& GetFullName() const { return *fullname; }
const std::string& GetMangledName() const;
};
@@ -97,7 +99,7 @@ struct DeclEnum {
DeclNamespace* container = nullptr;
std::string name;
mutable std::string mangledName;
- std::string_view fullname;
+ const std::string* fullname = nullptr; // View into storage map key
std::vector<DeclEnumElement> elements;
EnumUnderlyingType underlyingType;
// Start with invalid value, calculate on demand
@@ -114,7 +116,7 @@ struct DeclEnum {
bool generateExcludeUseHeuristics : 1 = false;
const std::string& GetName() const { return name; }
- std::string_view GetFullName() const { return fullname; }
+ const std::string& GetFullName() const { return *fullname; }
const std::string& GetMangledName() const;
std::string_view GetUnderlyingTypeName() const;
@@ -134,7 +136,7 @@ struct DeclFunction {
// Things like extern, static, etc. that gets written before the function return type
std::string prefix;
std::string name;
- std::string_view fullname;
+ const std::string* fullname = nullptr; // View into storage map key
std::string returnType;
std::vector<DeclFunctionArgument> arguments;
std::string body;