aboutsummaryrefslogtreecommitdiff
path: root/source/20-codegen-compiler/CodegenModel.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-07-18 10:24:01 -0700
committerrtk0c <[email protected]>2022-07-18 10:24:01 -0700
commit4067db383fb17d0580ebdc41e6354a84898e8343 (patch)
treee7f36bbd1992ea14916e7387dfcdd050807e23e1 /source/20-codegen-compiler/CodegenModel.cpp
parenta78bffc3a8ca4dfe6ca985223e38d28608184c52 (diff)
Changeset: 87 Make codegen use mangled names, convert `std::string_view fullname` to `const std::string* fullname` to indicate the reference nature better
Diffstat (limited to 'source/20-codegen-compiler/CodegenModel.cpp')
-rw-r--r--source/20-codegen-compiler/CodegenModel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/20-codegen-compiler/CodegenModel.cpp b/source/20-codegen-compiler/CodegenModel.cpp
index be41e68..da7a5cc 100644
--- a/source/20-codegen-compiler/CodegenModel.cpp
+++ b/source/20-codegen-compiler/CodegenModel.cpp
@@ -447,7 +447,7 @@ CodegenRuntimeModel::~CodegenRuntimeModel() {
auto& key = iter->first; \
auto& val = iter->second; \
auto& declRef = std::get<DeclType>(val.v); \
- declRef.fullname = key; \
+ declRef.fullname = &key; \
return &declRef
DeclEnum* CodegenRuntimeModel::AddEnum(std::string fullname, DeclEnum decl) {
@@ -496,7 +496,7 @@ DeclNamespace* CodegenRuntimeModel::AddNamespace(DeclNamespace ns) {
auto [iter, success] = m->namespaces.try_emplace(std::move(path), std::move(ns));
auto& nsRef = iter->second;
if (success) {
- nsRef.fullname = iter->first;
+ nsRef.fullname = &iter->first;
}
return &nsRef;
}