aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-01 17:36:08 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-03-01 17:36:08 -0500
commit26128396f3abaaba725642220b1fd34e281c8939 (patch)
tree17ab3f606a0c781d92e9113a3c5a79fc0574121c /src/analyze.cpp
parente8dad624419cee8e106185e478969d4a3ca44f0a (diff)
downloadzig-26128396f3abaaba725642220b1fd34e281c8939.tar.gz
zig-26128396f3abaaba725642220b1fd34e281c8939.zip
gen-h: use the bare type names for now
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);
+}