aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 69dbf333c6..089f72483f 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -6852,3 +6852,19 @@ void emit_error_notes_for_ref_stack(CodeGen *g, ErrorMsg *msg) {
}
}
}
+
+Buf *type_bare_name(ZigType *type_entry) {
+ if (is_container(type_entry)) {
+ return get_container_scope(type_entry)->bare_name;
+ } else if (type_entry->id == ZigTypeIdOpaque) {
+ return type_entry->data.opaque.bare_name;
+ } else {
+ return &type_entry->name;
+ }
+}
+
+// TODO this will have to be more clever, probably using the full name
+// and replacing '.' with '_' or something like that
+Buf *type_h_name(ZigType *t) {
+ return type_bare_name(t);
+}