diff options
author | Mike Pall <mike> | 2011-01-19 00:40:03 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2011-01-19 00:40:03 +0100 |
commit | 925050fe3ffae269f77757679270432dbad7f010 (patch) | |
tree | b332535f323ca99d7ee9d5b99c73f15de09ea43b /src/lj_ir.h | |
parent | 685dfc317270642fbf2a686799ca2b31ea42e0de (diff) | |
download | luajit-925050fe3ffae269f77757679270432dbad7f010.tar.gz luajit-925050fe3ffae269f77757679270432dbad7f010.tar.bz2 luajit-925050fe3ffae269f77757679270432dbad7f010.zip |
Differentiate between IR_KPTR and IR_KKPTR.
IR_KPTR holds a const pointer to possibly non-const content.
IR_KKPTR holds a const pointer to definitely const content.
Note that only content known by the VM to be const qualifies.
Content tagged as const by users (e.g. const char *) doesn't.
Diffstat (limited to 'src/lj_ir.h')
-rw-r--r-- | src/lj_ir.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lj_ir.h b/src/lj_ir.h index 11ecdf27..d3104017 100644 --- a/src/lj_ir.h +++ b/src/lj_ir.h | |||
@@ -42,6 +42,7 @@ | |||
42 | _(KINT, N , cst, ___) \ | 42 | _(KINT, N , cst, ___) \ |
43 | _(KGC, N , cst, ___) \ | 43 | _(KGC, N , cst, ___) \ |
44 | _(KPTR, N , cst, ___) \ | 44 | _(KPTR, N , cst, ___) \ |
45 | _(KKPTR, N , cst, ___) \ | ||
45 | _(KNULL, N , cst, ___) \ | 46 | _(KNULL, N , cst, ___) \ |
46 | _(KNUM, N , cst, ___) \ | 47 | _(KNUM, N , cst, ___) \ |
47 | _(KINT64, N , cst, ___) \ | 48 | _(KINT64, N , cst, ___) \ |
@@ -566,7 +567,8 @@ typedef union IRIns { | |||
566 | #define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) | 567 | #define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) |
567 | #define ir_k64(ir) \ | 568 | #define ir_k64(ir) \ |
568 | check_exp((ir)->o == IR_KNUM || (ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) | 569 | check_exp((ir)->o == IR_KNUM || (ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) |
569 | #define ir_kptr(ir) check_exp((ir)->o == IR_KPTR, mref((ir)->ptr, void)) | 570 | #define ir_kptr(ir) \ |
571 | check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, mref((ir)->ptr, void)) | ||
570 | 572 | ||
571 | LJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W); | 573 | LJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W); |
572 | 574 | ||