Skip to content

Commit 39133dc

Browse files
committed
Merge branch 'topic/decl_cleanup' into 'master'
Cleanup declarations in LKQL JIT sources Closes #288 See merge request eng/libadalang/langkit-query-language!245
2 parents 49c905f + 0ef57d9 commit 39133dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+54
-474
lines changed

lkql_jit/language/src/main/java/com/adacore/lkql_jit/LKQLContext.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,10 @@ public final class LKQLContext {
143143
@CompilerDirectives.CompilationFinal(dimensions = 1)
144144
private Libadalang.ScenarioVariable[] scenarioVars = null;
145145

146-
private Boolean useAutoProvider = null;
147-
148146
/** The ada files passed through the command line. */
149147
@CompilerDirectives.CompilationFinal(dimensions = 1)
150148
private String[] files = null;
151149

152-
/** The error printing mode. */
153-
@CompilerDirectives.CompilationFinal private String errorMode = null;
154-
155150
/** Whether the checker is in debug mode. */
156151
@CompilerDirectives.CompilationFinal private Boolean checkerDebug = null;
157152

@@ -343,18 +338,6 @@ public boolean isCheckerDebug() {
343338
return this.checkerDebug;
344339
}
345340

346-
/**
347-
* Get the error handling mode.
348-
*
349-
* @return The mode in a string.
350-
*/
351-
public String getErrorMode() {
352-
if (this.errorMode == null) {
353-
this.errorMode = this.env.getOptions().get(LKQLLanguage.errorMode);
354-
}
355-
return this.errorMode;
356-
}
357-
358341
/**
359342
* Get the directories to get the rules from.
360343
*
@@ -395,7 +378,6 @@ private void invalidateOptionCaches() {
395378
this.isVerbose = null;
396379
this.projectFile = null;
397380
this.files = null;
398-
this.errorMode = null;
399381
this.ruleInstances = null;
400382
this.instancesArgsCache = new HashMap<>();
401383
this.ruleDirectories = null;

lkql_jit/language/src/main/java/com/adacore/lkql_jit/built_ins/BuiltInSelectorValue.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

lkql_jit/language/src/main/java/com/adacore/lkql_jit/built_ins/BuiltInsHolder.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import com.adacore.lkql_jit.built_ins.functions.*;
99
import com.adacore.lkql_jit.built_ins.methods.*;
10-
import com.adacore.lkql_jit.built_ins.selectors.*;
1110
import com.adacore.lkql_jit.checker.built_ins.NodeCheckerFunction;
1211
import com.adacore.lkql_jit.checker.built_ins.UnitCheckerFunction;
1312
import com.adacore.lkql_jit.utils.LKQLTypesHelper;

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/selectors/BuiltInSelector.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

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/checker/BaseChecker.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -102,42 +102,10 @@ public String getMessage() {
102102
return message;
103103
}
104104

105-
public String getHelp() {
106-
return help;
107-
}
108-
109105
public boolean isFollowGenericInstantiations() {
110106
return followGenericInstantiations;
111107
}
112108

113-
public String getCategory() {
114-
return category;
115-
}
116-
117-
public String getSubcategory() {
118-
return subcategory;
119-
}
120-
121-
public Remediation getRemediation() {
122-
return remediation;
123-
}
124-
125-
public long getExecutionCost() {
126-
return executionCost;
127-
}
128-
129-
public boolean isParametricExemption() {
130-
return parametricExemption;
131-
}
132-
133-
public String getImpact() {
134-
return impact;
135-
}
136-
137-
public String getTarget() {
138-
return target;
139-
}
140-
141109
// ----- Setters -----
142110

143111
public void setAlias(String alias) {

lkql_jit/language/src/main/java/com/adacore/lkql_jit/exception/LKQLRuntimeException.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@ public static LKQLRuntimeException ignoredExpressionReturn(Node location) {
114114
"Can't ignore the return value of an expr in a block expr", location);
115115
}
116116

117-
/** Create a new exception when a key appears many times in the same object literal. */
118-
public static LKQLRuntimeException multipleSameNameKeys(String key, Node location) {
119-
return LKQLRuntimeException.fromMessage(
120-
"Multiple keys with the same name in the object: \"" + key + "\"", location);
121-
}
122-
123117
// --- Symbol exception
124118

125119
/**

lkql_jit/language/src/main/java/com/adacore/lkql_jit/exception/LangkitException.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ public final class LangkitException extends AbstractTruffleException {
2020

2121
@Serial private static final long serialVersionUID = 1755847711876252095L;
2222

23-
/** Kind of the Langkit exception. */
24-
private final String kind;
25-
2623
/** Message of the exception. */
2724
private final String msg;
2825

@@ -34,22 +31,16 @@ public final class LangkitException extends AbstractTruffleException {
3431
/**
3532
* Create a new Langkit exception.
3633
*
37-
* @param kind The kind of the exception.
3834
* @param msg The message of the exception.
3935
* @param location The location of the exception.
4036
*/
41-
public LangkitException(String kind, String msg, SourceSection location) {
42-
this.kind = kind;
37+
public LangkitException(String msg, SourceSection location) {
4338
this.msg = msg;
4439
this.location = location;
4540
}
4641

4742
// ----- Getters -----
4843

49-
public String getKind() {
50-
return this.kind;
51-
}
52-
5344
public String getMsg() {
5445
return this.msg;
5546
}

lkql_jit/language/src/main/java/com/adacore/lkql_jit/langkit_translator/passes/TranslationPass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private RuntimeException translationError(Liblkqllang.LkqlNode node, String mess
102102

103103
private RuntimeException multipleSameNameKeys(Liblkqllang.LkqlNode node, String key) {
104104
throw translationError(
105-
node, "Multiple keys with the same name in the " + "object: \"" + key + "\"");
105+
node, "Multiple keys with the same name in the object: \"" + key + "\"");
106106
}
107107

108108
/**

lkql_jit/language/src/main/java/com/adacore/lkql_jit/langkit_translator/passes/framing_utils/ScriptFrames.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ public ScriptFrames(
5656
this.current = null;
5757
}
5858

59-
// ----- Getters -----
60-
61-
public AbstractNodeFrame getCurrent() {
62-
return this.current;
63-
}
64-
6559
// ----- Instance methods -----
6660

6761
// --- Frame methods

lkql_jit/language/src/main/java/com/adacore/lkql_jit/langkit_translator/passes/framing_utils/ScriptFramesBuilder.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ public ScriptFramesBuilder() {
3838
this.current = null;
3939
}
4040

41-
// ----- Getters -----
42-
43-
public NodeFrameBuilder getCurrent() {
44-
return this.current;
45-
}
46-
4741
// ----- Instance methods -----
4842

4943
// --- Frame methods
@@ -253,7 +247,6 @@ public ScriptFrames.AbstractNodeFrame build(final ScriptFrames.AbstractNodeFrame
253247
: new ScriptFrames.NodeFrame(this.node, parent);
254248

255249
// Add all bindings to the node frame
256-
final boolean saveNames = this.node instanceof Liblkqllang.TopLevelList;
257250
for (String binding : this.bindings) {
258251
res.addBinding(binding);
259252
}

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/declarations/selector/SelectorArm.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ public SelectorArm(SourceSection location, BasePattern pattern, Expr expr) {
5050
this.expr = expr;
5151
}
5252

53-
// ----- Getters -----
54-
55-
public BasePattern getPattern() {
56-
return pattern;
57-
}
58-
59-
public Expr getExpr() {
60-
return expr;
61-
}
62-
6353
// ----- Execution methods -----
6454

6555
/**

0 commit comments

Comments
 (0)