Skip to content

Commit b62432f

Browse files
committed
SSA: Remove superfluous boolean.
1 parent 36613e1 commit b62432f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

shared/ssa/codeql/ssa/Ssa.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,18 @@ module Make<LocationSig Location, InputSig<Location> Input> {
123123
* (certain or uncertain) writes.
124124
*/
125125
private newtype TRefKind =
126-
Read(boolean certain) { certain in [false, true] } or
126+
Read() or
127127
Write(boolean certain) { certain in [false, true] }
128128

129129
private class RefKind extends TRefKind {
130130
string toString() {
131-
exists(boolean certain | this = Read(certain) and result = "read (" + certain + ")")
131+
this = Read() and result = "read"
132132
or
133133
exists(boolean certain | this = Write(certain) and result = "write (" + certain + ")")
134134
}
135135

136136
int getOrder() {
137-
this = Read(_) and
137+
this = Read() and
138138
result = 0
139139
or
140140
this = Write(_) and
@@ -146,7 +146,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
146146
* Holds if the `i`th node of basic block `bb` is a reference to `v` of kind `k`.
147147
*/
148148
predicate ref(BasicBlock bb, int i, SourceVariable v, RefKind k) {
149-
exists(boolean certain | variableRead(bb, i, v, certain) | k = Read(certain))
149+
variableRead(bb, i, v, _) and k = Read()
150150
or
151151
exists(boolean certain | variableWrite(bb, i, v, certain) | k = Write(certain))
152152
}
@@ -183,7 +183,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
183183
}
184184

185185
predicate lastRefIsRead(BasicBlock bb, SourceVariable v) {
186-
maxRefRank(bb, v) = refRank(bb, _, v, Read(_))
186+
maxRefRank(bb, v) = refRank(bb, _, v, Read())
187187
}
188188

189189
/**
@@ -213,7 +213,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
213213
*/
214214
predicate liveAtEntry(BasicBlock bb, SourceVariable v) {
215215
// The first read or certain write to `v` inside `bb` is a read
216-
refRank(bb, _, v, Read(_)) = firstReadOrCertainWrite(bb, v)
216+
refRank(bb, _, v, Read()) = firstReadOrCertainWrite(bb, v)
217217
or
218218
// There is no certain write to `v` inside `bb`, but `v` is live at entry
219219
// to a successor basic block of `bb`
@@ -237,7 +237,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
237237
rnk = maxRefRank(bb, v) and
238238
liveAtExit(bb, v)
239239
or
240-
kind = Read(_)
240+
kind = Read()
241241
or
242242
exists(RefKind nextKind |
243243
liveAtRank(bb, _, v, rnk + 1) and

0 commit comments

Comments
 (0)