diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-03-01 17:36:08 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-03-01 17:36:08 -0500 |
| commit | 26128396f3abaaba725642220b1fd34e281c8939 (patch) | |
| tree | 17ab3f606a0c781d92e9113a3c5a79fc0574121c /src/analyze.cpp | |
| parent | e8dad624419cee8e106185e478969d4a3ca44f0a (diff) | |
| download | zig-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.cpp | 16 |
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); +} |
