aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-07-02 01:05:15 -0700
committerMichael Forney <mforney@mforney.org>2021-07-02 01:05:15 -0700
commit003f6a14b05bb16fa6f950dc193a8cbd62e0836d (patch)
tree0a5d7aded9ad0a26ea839d57d8c9b83971e469f5 /qbe.c
parenteb8232463e3b1b758ff9f8a1cfb89bca2f655db4 (diff)
qbe: Mark static const data as such
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c6
1 files 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] = ':',