Skip to content

Commit 0ef57d9

Browse files
committed
Annotate all purposely unused declarations
1 parent cae48e1 commit 0ef57d9

File tree

15 files changed

+51
-18
lines changed

15 files changed

+51
-18
lines changed

lkql_jit/language/src/main/java/com/adacore/lkql_jit/built_ins/functions/DocumentBuiltins.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ public class DocumentBuiltins {
2020
public static final String NAME = "document_builtins";
2121

2222
@CompilerDirectives.TruffleBoundary
23-
public static String documentBuiltinsImpl(MaterializedFrame frame, FunCall call) {
23+
public static String documentBuiltinsImpl(
24+
@SuppressWarnings("unused") MaterializedFrame frame,
25+
@SuppressWarnings("unused") FunCall call) {
2426
var sw = new StringWriter();
2527
try (TextWriter writer = new TextWriter(sw)) {
2628
writer.write("Standard library\n");

lkql_jit/language/src/main/java/com/adacore/lkql_jit/built_ins/values/LKQLFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public static class Execute {
148148
/** Execute the function with the cached strategy. */
149149
@Specialization(guards = "function.getCallTarget() == directCallNode.getCallTarget()")
150150
protected static Object doCached(
151-
final LKQLFunction function,
151+
@SuppressWarnings("unused") final LKQLFunction function,
152152
final Object[] arguments,
153153
@Cached("create(function.getCallTarget())") DirectCallNode directCallNode) {
154154
return directCallNode.call(arguments);

lkql_jit/language/src/main/java/com/adacore/lkql_jit/built_ins/values/LKQLProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public boolean isExecutable() {
141141

142142
/** Placeholder function for the Truffle DSL. */
143143
@ExportMessage
144-
public Object execute(Object[] arguments)
144+
public Object execute(@SuppressWarnings("unused") Object[] arguments)
145145
throws UnsupportedTypeException, ArityException, UnsupportedMessageException {
146146
// TODO (issue #143): implement this method to execute the property as a simple function
147147
return null;

lkql_jit/language/src/main/java/com/adacore/lkql_jit/built_ins/values/LKQLSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public boolean isExecutable() {
118118

119119
/** Placeholder function for the Truffle DSL. */
120120
@ExportMessage
121-
public Object execute(Object[] arguments)
121+
public Object execute(@SuppressWarnings("unused") Object[] arguments)
122122
throws UnsupportedTypeException, ArityException, UnsupportedMessageException {
123123
// TODO (issue #143): implement this method to execute the selector as a simple function
124124
// returning a selector list

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/dispatchers/ListComprehensionDispatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public abstract class ListComprehensionDispatcher extends Node {
4040
*/
4141
@Specialization(guards = "rootNode.getRealCallTarget() == directCallNode.getCallTarget()")
4242
protected static Object executeCached(
43-
ListComprehensionRootNode rootNode,
43+
@SuppressWarnings("unused") ListComprehensionRootNode rootNode,
4444
Object[] arguments,
4545
@Cached("create(rootNode.getRealCallTarget())") DirectCallNode directCallNode) {
4646
return directCallNode.call(arguments);

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/dispatchers/SelectorDispatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public abstract LKQLRecValue executeDispatch(
3636
*/
3737
@Specialization(guards = "rootNode.getRealCallTarget() == directCallNode.getCallTarget()")
3838
protected static LKQLRecValue executeCached(
39-
SelectorRootNode rootNode,
39+
@SuppressWarnings("unused") SelectorRootNode rootNode,
4040
Cell[] closure,
4141
LKQLDepthValue node,
4242
@Cached("create(rootNode.getRealCallTarget())") DirectCallNode directCallNode) {

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/expressions/Expr.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ protected Expr(SourceSection location) {
4747
* @return The result of the node execution as unit.
4848
* @throws UnexpectedResultException If the node cannot be evaluated as a unit value.
4949
*/
50+
@SuppressWarnings("unused")
5051
public LKQLUnit executeUnit(VirtualFrame frame) throws UnexpectedResultException {
5152
return LKQLTypeSystemGen.expectLKQLUnit(executeGeneric(frame));
5253
}
@@ -58,6 +59,7 @@ public LKQLUnit executeUnit(VirtualFrame frame) throws UnexpectedResultException
5859
* @return The result of the node execution as nullish.
5960
* @throws UnexpectedResultException If the node cannot be evaluated as a nullish value.
6061
*/
62+
@SuppressWarnings("unused")
6163
public Nullish executeNullish(VirtualFrame frame) throws UnexpectedResultException {
6264
return LKQLTypeSystemGen.expectNullish(executeGeneric(frame));
6365
}
@@ -69,6 +71,7 @@ public Nullish executeNullish(VirtualFrame frame) throws UnexpectedResultExcepti
6971
* @return The result of the node execution as a boolean.
7072
* @throws UnexpectedResultException If the node cannot be evaluated as a boolean.
7173
*/
74+
@SuppressWarnings("unused")
7275
public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultException {
7376
return LKQLTypeSystemGen.expectBoolean(executeGeneric(frame));
7477
}
@@ -80,6 +83,7 @@ public boolean executeBoolean(VirtualFrame frame) throws UnexpectedResultExcepti
8083
* @return The result of the node execution as a long.
8184
* @throws UnexpectedResultException If the node cannot be evaluated as a long.
8285
*/
86+
@SuppressWarnings("unused")
8387
public long executeLong(VirtualFrame frame) throws UnexpectedResultException {
8488
return LKQLTypeSystemGen.expectLong(executeGeneric(frame));
8589
}
@@ -91,6 +95,7 @@ public long executeLong(VirtualFrame frame) throws UnexpectedResultException {
9195
* @return The result of the node execution as a big integer.
9296
* @throws UnexpectedResultException If the node cannot be evaluated as a big integer.
9397
*/
98+
@SuppressWarnings("unused")
9499
public BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultException {
95100
return LKQLTypeSystemGen.expectBigInteger(executeGeneric(frame));
96101
}
@@ -102,6 +107,7 @@ public BigInteger executeBigInteger(VirtualFrame frame) throws UnexpectedResultE
102107
* @return The result of the node execution as a string.
103108
* @throws UnexpectedResultException If the node cannot be evaluated as a string.
104109
*/
110+
@SuppressWarnings("unused")
105111
public String executeString(VirtualFrame frame) throws UnexpectedResultException {
106112
return LKQLTypeSystemGen.expectString(executeGeneric(frame));
107113
}
@@ -113,6 +119,7 @@ public String executeString(VirtualFrame frame) throws UnexpectedResultException
113119
* @return The result of the node execution as a function value.
114120
* @throws UnexpectedResultException If the node cannot be evaluated as a function.
115121
*/
122+
@SuppressWarnings("unused")
116123
public LKQLFunction executeFunction(VirtualFrame frame) throws UnexpectedResultException {
117124
return LKQLTypeSystemGen.expectLKQLFunction(executeGeneric(frame));
118125
}
@@ -124,6 +131,7 @@ public LKQLFunction executeFunction(VirtualFrame frame) throws UnexpectedResultE
124131
* @return The result of the node execution as a property reference value.
125132
* @throws UnexpectedResultException If the node cannot be evaluated as a property reference.
126133
*/
134+
@SuppressWarnings("unused")
127135
public LKQLProperty executeProperty(VirtualFrame frame) throws UnexpectedResultException {
128136
return LKQLTypeSystemGen.expectLKQLProperty(executeGeneric(frame));
129137
}
@@ -135,6 +143,7 @@ public LKQLProperty executeProperty(VirtualFrame frame) throws UnexpectedResultE
135143
* @return The result of the node execution as a selector value.
136144
* @throws UnexpectedResultException If the node cannot be evaluated as a selector.
137145
*/
146+
@SuppressWarnings("unused")
138147
public LKQLSelector executeSelector(VirtualFrame frame) throws UnexpectedResultException {
139148
return LKQLTypeSystemGen.expectLKQLSelector(executeGeneric(frame));
140149
}
@@ -146,6 +155,7 @@ public LKQLSelector executeSelector(VirtualFrame frame) throws UnexpectedResultE
146155
* @return The result of the node execution as a tuple value.
147156
* @throws UnexpectedResultException If the node cannot be evaluated as a tuple.
148157
*/
158+
@SuppressWarnings("unused")
149159
public LKQLTuple executeTuple(VirtualFrame frame) throws UnexpectedResultException {
150160
return LKQLTypeSystemGen.expectLKQLTuple(executeGeneric(frame));
151161
}
@@ -157,6 +167,7 @@ public LKQLTuple executeTuple(VirtualFrame frame) throws UnexpectedResultExcepti
157167
* @return The result of the node execution as a list value.
158168
* @throws UnexpectedResultException If the node cannot be evaluated as a list.
159169
*/
170+
@SuppressWarnings("unused")
160171
public LKQLList executeList(VirtualFrame frame) throws UnexpectedResultException {
161172
return LKQLTypeSystemGen.expectLKQLList(executeGeneric(frame));
162173
}
@@ -168,6 +179,7 @@ public LKQLList executeList(VirtualFrame frame) throws UnexpectedResultException
168179
* @return The result of the node execution as a lazy list value.
169180
* @throws UnexpectedResultException If the node cannot be evaluated as a lazy list.
170181
*/
182+
@SuppressWarnings("unused")
171183
public LKQLLazyList executeLazyList(VirtualFrame frame) throws UnexpectedResultException {
172184
return LKQLTypeSystemGen.expectLKQLLazyList(executeGeneric(frame));
173185
}
@@ -179,6 +191,7 @@ public LKQLLazyList executeLazyList(VirtualFrame frame) throws UnexpectedResultE
179191
* @return The result of the node execution as an indexable value.
180192
* @throws UnexpectedResultException If the node cannot be evaluated as an indexable.
181193
*/
194+
@SuppressWarnings("unused")
182195
public Indexable executeIndexable(VirtualFrame frame) throws UnexpectedResultException {
183196
return LKQLTypeSystemGen.expectIndexable(executeGeneric(frame));
184197
}
@@ -190,6 +203,7 @@ public Indexable executeIndexable(VirtualFrame frame) throws UnexpectedResultExc
190203
* @return The result of the node execution as an iterable value.
191204
* @throws UnexpectedResultException If the node cannot be evaluated as an iterable.
192205
*/
206+
@SuppressWarnings("unused")
193207
public Iterable executeIterable(VirtualFrame frame) throws UnexpectedResultException {
194208
return LKQLTypeSystemGen.expectIterable(executeGeneric(frame));
195209
}
@@ -201,6 +215,7 @@ public Iterable executeIterable(VirtualFrame frame) throws UnexpectedResultExcep
201215
* @return The result of the node execution as an object value.
202216
* @throws UnexpectedResultException If the node cannot be evaluated as an object.
203217
*/
218+
@SuppressWarnings("unused")
204219
public LKQLObject executeObject(VirtualFrame frame) throws UnexpectedResultException {
205220
return LKQLTypeSystemGen.expectLKQLObject(executeGeneric(frame));
206221
}
@@ -212,6 +227,7 @@ public LKQLObject executeObject(VirtualFrame frame) throws UnexpectedResultExcep
212227
* @return The result of the node execution as a namespace value.
213228
* @throws UnexpectedResultException If the node cannot be evaluated as a namespace.
214229
*/
230+
@SuppressWarnings("unused")
215231
public LKQLNamespace executeNamespace(VirtualFrame frame) throws UnexpectedResultException {
216232
return LKQLTypeSystemGen.expectLKQLNamespace(executeGeneric(frame));
217233
}
@@ -223,6 +239,7 @@ public LKQLNamespace executeNamespace(VirtualFrame frame) throws UnexpectedResul
223239
* @return The result of the node execution as a lkql value.
224240
* @throws UnexpectedResultException If the node cannot be evaluated as a lkql value.
225241
*/
242+
@SuppressWarnings("unused")
226243
public LKQLValue executeValue(VirtualFrame frame) throws UnexpectedResultException {
227244
return LKQLTypeSystemGen.expectLKQLValue(executeGeneric(frame));
228245
}
@@ -234,6 +251,7 @@ public LKQLValue executeValue(VirtualFrame frame) throws UnexpectedResultExcepti
234251
* @return The result of the node execution as an ada node.
235252
* @throws UnexpectedResultException If the node cannot be evaluated as an ada node.
236253
*/
254+
@SuppressWarnings("unused")
237255
public Libadalang.AdaNode executeNode(VirtualFrame frame) throws UnexpectedResultException {
238256
return LKQLTypeSystemGen.expectAdaNode(executeGeneric(frame));
239257
}

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/expressions/dot/DotAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected Object onNamespace(
126126
},
127127
limit = "1")
128128
protected Object onNodeCached(
129-
Libadalang.AdaNode receiver,
129+
@SuppressWarnings("unused") Libadalang.AdaNode receiver,
130130
@Cached("create(member.getName(), receiver)") LKQLProperty property,
131131
@Cached("property.isField()") boolean isField) {
132132
// If the method is a field

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/expressions/dot/SafeDotAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected SafeDotAccess(SourceSection location, Identifier member) {
7474
},
7575
limit = "1")
7676
protected Object onNodeCached(
77-
Libadalang.AdaNode receiver,
77+
@SuppressWarnings("unused") Libadalang.AdaNode receiver,
7878
@Cached("create(member.getName(), receiver)") LKQLProperty property,
7979
@Cached("property.isField()") boolean isField) {
8080
// If the method is a field

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/patterns/BoolPattern.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ protected BoolPattern(SourceSection location, boolean toMatch) {
2121
}
2222

2323
@Specialization
24-
public boolean onBool(VirtualFrame frame, boolean val) {
24+
public boolean onBool(@SuppressWarnings("unused") VirtualFrame frame, boolean val) {
2525
return val == toMatch;
2626
}
2727

2828
@Fallback
29-
public boolean onOther(VirtualFrame frame, Object other) {
29+
public boolean onOther(
30+
@SuppressWarnings("unused") VirtualFrame frame,
31+
@SuppressWarnings("unused") Object other) {
3032
return false;
3133
}
3234

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/patterns/IntegerPattern.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ public IntegerPattern(SourceSection loc, long toMatch) {
2020
}
2121

2222
@Specialization
23-
public boolean onInt(VirtualFrame frame, long val) {
23+
public boolean onInt(@SuppressWarnings("unused") VirtualFrame frame, long val) {
2424
return val == toMatch;
2525
}
2626

2727
@Fallback
28-
public boolean onOther(VirtualFrame frame, Object other) {
28+
public boolean onOther(
29+
@SuppressWarnings("unused") VirtualFrame frame,
30+
@SuppressWarnings("unused") Object other) {
2931
return false;
3032
}
3133

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/patterns/ListPattern.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ else if (!pattern.executeValue(frame, list.get(i))) {
5151
}
5252

5353
@Fallback
54-
public boolean onOther(VirtualFrame frame, Object other) {
54+
public boolean onOther(
55+
@SuppressWarnings("unused") VirtualFrame frame,
56+
@SuppressWarnings("unused") Object other) {
5557
return false;
5658
}
5759

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/patterns/ObjectPattern.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ public boolean onObject(
100100
}
101101

102102
@Fallback
103-
public boolean onOther(VirtualFrame frame, Object other) {
103+
public boolean onOther(
104+
@SuppressWarnings("unused") VirtualFrame frame,
105+
@SuppressWarnings("unused") Object other) {
104106
return false;
105107
}
106108
}

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/patterns/RegexPattern.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,20 @@ public RegexPattern(SourceSection location, String regex) {
3939
}
4040

4141
@Specialization
42-
public boolean onAdaNode(VirtualFrame frame, Libadalang.AdaNode node) {
42+
public boolean onAdaNode(
43+
@SuppressWarnings("unused") VirtualFrame frame, Libadalang.AdaNode node) {
4344
return node != LKQLNull.INSTANCE && this.pattern.contains(node.getText());
4445
}
4546

4647
@Specialization
47-
public boolean onString(VirtualFrame frame, String value) {
48+
public boolean onString(@SuppressWarnings("unused") VirtualFrame frame, String value) {
4849
return pattern.contains(value);
4950
}
5051

5152
@Fallback
52-
public boolean onOther(VirtualFrame frame, Object other) {
53+
public boolean onOther(
54+
@SuppressWarnings("unused") VirtualFrame frame,
55+
@SuppressWarnings("unused") Object other) {
5356
return false;
5457
}
5558

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/patterns/TuplePattern.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public boolean onTuple(VirtualFrame frame, LKQLTuple tuple) {
3838
}
3939

4040
@Fallback
41-
public boolean onOther(VirtualFrame frame, Object other) {
41+
public boolean onOther(
42+
@SuppressWarnings("unused") VirtualFrame frame,
43+
@SuppressWarnings("unused") Object other) {
4244
return false;
4345
}
4446

0 commit comments

Comments
 (0)