aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-03-03 11:16:48 +0000
committergingerBill <bill@gingerbill.org>2018-03-03 11:16:48 +0000
commit9274f29ca950a1f6b91506b56a291fce0b534f64 (patch)
treeb9a8b563fc23492e23921258b3f0150adb041082 /src/ir_print.cpp
parent08c87e57f878130fd10d8845115070e8bce2a588 (diff)
`deprecated` attribute for procedure declarations
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 632d9c0e1..814ae5a7f 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -548,17 +548,17 @@ void ir_print_exact_value(irFileBuffer *f, irModule *m, ExactValue value, Type *
break;
case ExactValue_String: {
String str = value.value_string;
- if (str.len == 0) {
+ Type *t = core_type(type);
+ if (str.len == 0 && !is_type_cstring(t)) {
ir_write_str_lit(f, "zeroinitializer");
break;
}
- Type *t = core_type(type);
if (!is_type_string(type)) {
GB_ASSERT(is_type_array(type));
ir_write_str_lit(f, "c\"");
ir_print_escape_string(f, str, false, false);
ir_write_str_lit(f, "\\00\"");
- } else if (t == t_cstring) {
+ } else if (is_type_cstring(t)) {
// HACK NOTE(bill): This is a hack but it works because strings are created at the very end
// of the .ll file
irValue *str_array = ir_add_global_string_array(m, str);