[qfcc] Make opcode and statement type names available

This commit is contained in:
Bill Currie 2020-03-17 22:46:23 +09:00
parent 77806f4b1b
commit 34c9ec51bb
2 changed files with 18 additions and 1 deletions

View file

@ -119,6 +119,9 @@ struct expr_s;
struct type_s;
struct dstring_s;
extern const char *op_type_names[];
extern const char *st_type_names[];
const char *optype_str (op_type_e type) __attribute__((const));
operand_t *nil_operand (struct type_s *type, struct expr_s *expr);

View file

@ -60,7 +60,7 @@
#include "value.h"
#include "qc-parse.h"
static const char *op_type_names[] = {
const char *op_type_names[] = {
"op_def",
"op_value",
"op_label",
@ -69,6 +69,20 @@ static const char *op_type_names[] = {
"op_nil",
};
const char *st_type_names[] = {
"st_none",
"st_expr",
"st_assign",
"st_ptrassign",
"st_move",
"st_ptrmove",
"st_memset",
"st_ptrmemset",
"st_state",
"st_func",
"st_flow",
};
const char *
optype_str (op_type_e type)
{