From 003f6a14b05bb16fa6f950dc193a8cbd62e0836d Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 2 Jul 2021 01:05:15 -0700 Subject: qbe: Mark static const data as such --- qbe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qbe.c b/qbe.c index 12e2f37..44742c0 100644 --- a/qbe.c +++ b/qbe.c @@ -935,14 +935,14 @@ funcexpr(struct func *f, struct expr *e) static void zero(struct func *func, struct value *addr, int align, uint64_t offset, uint64_t end) { - enum instkind store[] = { + static const enum instkind store[] = { [1] = ISTOREB, [2] = ISTOREH, [4] = ISTOREW, [8] = ISTOREL, }; - struct value *tmp; static struct value z = {.kind = VALUE_INTCONST}; + struct value *tmp; int a = 1; while (offset < end) { @@ -1034,7 +1034,7 @@ funcswitch(struct func *f, struct value *v, struct switchcases *c, struct block static void emitvalue(struct value *v) { - static char sigil[] = { + static const char sigil[] = { [VALUE_TEMP] = '%', [VALUE_GLOBAL] = '$', [VALUE_TYPE] = ':', -- cgit v1.2.3