| 1 |
From 29c787ab0c653fddcaa2d76c2f05927241ceedd5 Mon Sep 17 00:00:00 2001 |
| 2 |
From: yangfl <[email protected]> |
| 3 |
Date: Sat, 6 Sep 2025 23:14:18 +0800 |
| 4 |
Subject: [PATCH 7/7] true and false are keywords |
| 5 |
|
| 6 |
--- |
| 7 |
cc/ccom/trees.c | 46 +++++++++++++++++++++++----------------------- |
| 8 |
cc/cxxcom/trees.c | 46 +++++++++++++++++++++++----------------------- |
| 9 |
2 files changed, 46 insertions(+), 46 deletions(-) |
| 10 |
|
| 11 |
diff --git a/cc/ccom/trees.c b/cc/ccom/trees.c |
| 12 |
index 777bd268..a00225e7 100644 |
| 13 |
--- a/cc/ccom/trees.c |
| 14 |
+++ b/cc/ccom/trees.c |
| 15 |
@@ -2115,7 +2115,7 @@ fixbranch(P1ND *p, int label) |
| 16 |
* Write out logical expressions as branches. |
| 17 |
*/ |
| 18 |
static void |
| 19 |
-andorbr(P1ND *p, int true, int false) |
| 20 |
+andorbr(P1ND *p, int true_, int false_) |
| 21 |
{ |
| 22 |
P1ND *q; |
| 23 |
int o, lab; |
| 24 |
@@ -2158,20 +2158,20 @@ andorbr(P1ND *p, int true, int false) |
| 25 |
case LT: |
| 26 |
case GE: |
| 27 |
case GT: |
| 28 |
-calc: if (true < 0) { |
| 29 |
+calc: if (true_ < 0) { |
| 30 |
p->n_op = p1negrel[p->n_op - EQ]; |
| 31 |
p->n_ap = attr_add(p->n_ap, |
| 32 |
attr_new(ATTR_FP_SWAPPED, 3)); |
| 33 |
p->n_ap->aa[0].iarg = 1; |
| 34 |
- true = false; |
| 35 |
- false = -1; |
| 36 |
+ true_ = false_; |
| 37 |
+ false_ = -1; |
| 38 |
} |
| 39 |
|
| 40 |
rmcops(p->n_left); |
| 41 |
rmcops(p->n_right); |
| 42 |
- fixbranch(p, true); |
| 43 |
- if (false >= 0) |
| 44 |
- branch(false); |
| 45 |
+ fixbranch(p, true_); |
| 46 |
+ if (false_ >= 0) |
| 47 |
+ branch(false_); |
| 48 |
break; |
| 49 |
|
| 50 |
case ULE: |
| 51 |
@@ -2185,9 +2185,9 @@ calc: if (true < 0) { |
| 52 |
case ULT: |
| 53 |
/* Already true/false by definition */ |
| 54 |
if (nncon(p->n_right) && glval(p->n_right) == 0) { |
| 55 |
- if (true < 0) { |
| 56 |
+ if (true_ < 0) { |
| 57 |
o = o == ULT ? UGE : ULT; |
| 58 |
- true = false; |
| 59 |
+ true_ = false_; |
| 60 |
} |
| 61 |
rmcops(p->n_left); |
| 62 |
ecode(p->n_left); |
| 63 |
@@ -2195,45 +2195,45 @@ calc: if (true < 0) { |
| 64 |
ecode(p->n_right); |
| 65 |
p1nfree(p); |
| 66 |
if (o == UGE) /* true */ |
| 67 |
- branch(true); |
| 68 |
+ branch(true_); |
| 69 |
break; |
| 70 |
} |
| 71 |
goto calc; |
| 72 |
|
| 73 |
case ANDAND: |
| 74 |
- lab = false<0 ? getlab() : false ; |
| 75 |
+ lab = false_<0 ? getlab() : false_ ; |
| 76 |
andorbr(p->n_left, -1, lab); |
| 77 |
comops(p->n_right); |
| 78 |
- andorbr(p->n_right, true, false); |
| 79 |
- if (false < 0) |
| 80 |
+ andorbr(p->n_right, true_, false_); |
| 81 |
+ if (false_ < 0) |
| 82 |
plabel( lab); |
| 83 |
p1nfree(p); |
| 84 |
break; |
| 85 |
|
| 86 |
case OROR: |
| 87 |
- lab = true<0 ? getlab() : true; |
| 88 |
+ lab = true_<0 ? getlab() : true_; |
| 89 |
andorbr(p->n_left, lab, -1); |
| 90 |
comops(p->n_right); |
| 91 |
- andorbr(p->n_right, true, false); |
| 92 |
- if (true < 0) |
| 93 |
+ andorbr(p->n_right, true_, false_); |
| 94 |
+ if (true_ < 0) |
| 95 |
plabel( lab); |
| 96 |
p1nfree(p); |
| 97 |
break; |
| 98 |
|
| 99 |
case NOT: |
| 100 |
- andorbr(p->n_left, false, true); |
| 101 |
+ andorbr(p->n_left, false_, true_); |
| 102 |
p1nfree(p); |
| 103 |
break; |
| 104 |
|
| 105 |
default: |
| 106 |
rmcops(p); |
| 107 |
- if (true >= 0) |
| 108 |
- fixbranch(p, true); |
| 109 |
- if (false >= 0) { |
| 110 |
- if (true >= 0) |
| 111 |
- branch(false); |
| 112 |
+ if (true_ >= 0) |
| 113 |
+ fixbranch(p, true_); |
| 114 |
+ if (false_ >= 0) { |
| 115 |
+ if (true_ >= 0) |
| 116 |
+ branch(false_); |
| 117 |
else |
| 118 |
- fixbranch(buildtree(EQ, p, bcon(0)), false); |
| 119 |
+ fixbranch(buildtree(EQ, p, bcon(0)), false_); |
| 120 |
} |
| 121 |
} |
| 122 |
} |
| 123 |
diff --git a/cc/cxxcom/trees.c b/cc/cxxcom/trees.c |
| 124 |
index 8b95aa4d..713a041b 100644 |
| 125 |
--- a/cc/cxxcom/trees.c |
| 126 |
+++ b/cc/cxxcom/trees.c |
| 127 |
@@ -2024,7 +2024,7 @@ fixbranch(NODE *p, int label) |
| 128 |
* Write out logical expressions as branches. |
| 129 |
*/ |
| 130 |
static void |
| 131 |
-andorbr(NODE *p, int true, int false) |
| 132 |
+andorbr(NODE *p, int true_, int false_) |
| 133 |
{ |
| 134 |
NODE *q; |
| 135 |
int o, lab; |
| 136 |
@@ -2067,17 +2067,17 @@ andorbr(NODE *p, int true, int false) |
| 137 |
case LT: |
| 138 |
case GE: |
| 139 |
case GT: |
| 140 |
-calc: if (true < 0) { |
| 141 |
+calc: if (true_ < 0) { |
| 142 |
p->n_op = negrel[p->n_op - EQ]; |
| 143 |
- true = false; |
| 144 |
- false = -1; |
| 145 |
+ true_ = false_; |
| 146 |
+ false_ = -1; |
| 147 |
} |
| 148 |
|
| 149 |
rmcops(p->n_left); |
| 150 |
rmcops(p->n_right); |
| 151 |
- fixbranch(p, true); |
| 152 |
- if (false >= 0) |
| 153 |
- branch(false); |
| 154 |
+ fixbranch(p, true_); |
| 155 |
+ if (false_ >= 0) |
| 156 |
+ branch(false_); |
| 157 |
break; |
| 158 |
|
| 159 |
case ULE: |
| 160 |
@@ -2091,9 +2091,9 @@ calc: if (true < 0) { |
| 161 |
case ULT: |
| 162 |
/* Already true/false by definition */ |
| 163 |
if (nncon(p->n_right) && glval(p->n_right) == 0) { |
| 164 |
- if (true < 0) { |
| 165 |
+ if (true_ < 0) { |
| 166 |
o = o == ULT ? UGE : ULT; |
| 167 |
- true = false; |
| 168 |
+ true_ = false_; |
| 169 |
} |
| 170 |
rmcops(p->n_left); |
| 171 |
ecode(p->n_left); |
| 172 |
@@ -2101,45 +2101,45 @@ calc: if (true < 0) { |
| 173 |
ecode(p->n_right); |
| 174 |
nfree(p); |
| 175 |
if (o == UGE) /* true */ |
| 176 |
- branch(true); |
| 177 |
+ branch(true_); |
| 178 |
break; |
| 179 |
} |
| 180 |
goto calc; |
| 181 |
|
| 182 |
case ANDAND: |
| 183 |
- lab = false<0 ? getlab() : false ; |
| 184 |
+ lab = false_<0 ? getlab() : false_ ; |
| 185 |
andorbr(p->n_left, -1, lab); |
| 186 |
comops(p->n_right); |
| 187 |
- andorbr(p->n_right, true, false); |
| 188 |
- if (false < 0) |
| 189 |
+ andorbr(p->n_right, true_, false_); |
| 190 |
+ if (false_ < 0) |
| 191 |
plabel( lab); |
| 192 |
nfree(p); |
| 193 |
break; |
| 194 |
|
| 195 |
case OROR: |
| 196 |
- lab = true<0 ? getlab() : true; |
| 197 |
+ lab = true_<0 ? getlab() : true_; |
| 198 |
andorbr(p->n_left, lab, -1); |
| 199 |
comops(p->n_right); |
| 200 |
- andorbr(p->n_right, true, false); |
| 201 |
- if (true < 0) |
| 202 |
+ andorbr(p->n_right, true_, false_); |
| 203 |
+ if (true_ < 0) |
| 204 |
plabel( lab); |
| 205 |
nfree(p); |
| 206 |
break; |
| 207 |
|
| 208 |
case NOT: |
| 209 |
- andorbr(p->n_left, false, true); |
| 210 |
+ andorbr(p->n_left, false_, true_); |
| 211 |
nfree(p); |
| 212 |
break; |
| 213 |
|
| 214 |
default: |
| 215 |
rmcops(p); |
| 216 |
- if (true >= 0) |
| 217 |
- fixbranch(p, true); |
| 218 |
- if (false >= 0) { |
| 219 |
- if (true >= 0) |
| 220 |
- branch(false); |
| 221 |
+ if (true_ >= 0) |
| 222 |
+ fixbranch(p, true_); |
| 223 |
+ if (false_ >= 0) { |
| 224 |
+ if (true_ >= 0) |
| 225 |
+ branch(false_); |
| 226 |
else |
| 227 |
- fixbranch(buildtree(EQ, p, bcon(0)), false); |
| 228 |
+ fixbranch(buildtree(EQ, p, bcon(0)), false_); |
| 229 |
} |
| 230 |
} |
| 231 |
} |
| 232 |
-- |
| 233 |
2.50.1 |
| 234 |
|