start improving constants support
This commit is contained in:
parent
837c46ca81
commit
92be2fdd17
3 changed files with 83 additions and 9 deletions
14
lisc/lisc.h
14
lisc/lisc.h
|
@ -1,5 +1,5 @@
|
|||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -13,6 +13,7 @@ typedef struct Ins Ins;
|
|||
typedef struct Phi Phi;
|
||||
typedef struct Blk Blk;
|
||||
typedef struct Sym Sym;
|
||||
typedef struct Const Const;
|
||||
typedef struct Fn Fn;
|
||||
|
||||
enum {
|
||||
|
@ -158,9 +159,20 @@ struct Sym {
|
|||
int hint;
|
||||
};
|
||||
|
||||
struct Const {
|
||||
enum {
|
||||
CUndef,
|
||||
CNum,
|
||||
CAddr,
|
||||
} type;
|
||||
char label[NString];
|
||||
int64_t val;
|
||||
};
|
||||
|
||||
struct Fn {
|
||||
Blk *start;
|
||||
Sym *sym;
|
||||
Const *cst;
|
||||
int ntmp;
|
||||
int nblk;
|
||||
Blk **rpo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue