Skip to content

Commit d0e3d02

Browse files
committed
Merge remote-tracking branch 'origin/master' into genericsTake2
2 parents df329e5 + 75f73f1 commit d0e3d02

8 files changed

Lines changed: 16 additions & 9 deletions

File tree

src/main/java/com/laytonsmith/core/asm/AsmCompiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public static IRData getIR(IRBuilder builder, ParseTree node, Environment env) t
554554
if(fb instanceof LLVMFunction f) {
555555
builder.functionsUsed.add(f);
556556
return f.buildIR(builder, node.getTarget(), env,
557-
node.getChildren().toArray(new ParseTree[node.getChildren().size()]));
557+
null, node.getChildren().toArray(new ParseTree[node.getChildren().size()]));
558558
} else {
559559
throw new Error("Unexpected function type");
560560
}

src/main/java/com/laytonsmith/core/asm/LLVMFunction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,13 @@ public int compareTo(Function o) {
247247
* @param builder The ongoing builder. Functions should append to this as needed.
248248
* @param t The code target this node comes from.
249249
* @param env The Environment
250+
* @param parameters Generic parameters passed to this function call.
250251
* @param nodes The children passed to this function, could be empty array.
251252
* @return Information on the returned value, including things like type (if known) and how to reference the
252253
* output value.
253254
* @throws com.laytonsmith.core.exceptions.ConfigCompileException If there is a compilation error.
254255
*/
255-
public abstract IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes) throws ConfigCompileException;
256+
public abstract IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters parameters, ParseTree... nodes) throws ConfigCompileException;
256257

257258
@Override
258259
public final boolean useSpecialExec() {

src/main/java/com/laytonsmith/core/functions/MatrixHandling.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.laytonsmith.core.constructs.CString;
1919
import com.laytonsmith.core.constructs.CVoid;
2020
import com.laytonsmith.core.constructs.Target;
21+
import com.laytonsmith.core.constructs.generics.GenericParameters;
2122
import com.laytonsmith.core.environments.Environment;
2223
import com.laytonsmith.core.exceptions.CRE.CRECastException;
2324
import com.laytonsmith.core.exceptions.CRE.CREIllegalArgumentException;

src/main/java/com/laytonsmith/core/functions/asm/Cmdline.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.laytonsmith.core.asm.LLVMVersion;
1616
import com.laytonsmith.core.compiler.CompilerEnvironment;
1717
import com.laytonsmith.core.constructs.Target;
18+
import com.laytonsmith.core.constructs.generics.GenericParameters;
1819
import com.laytonsmith.core.environments.Environment;
1920
import com.laytonsmith.core.exceptions.CRE.CREThrowable;
2021
import com.laytonsmith.core.exceptions.ConfigCompileException;
@@ -30,7 +31,7 @@ public class Cmdline {
3031
public static class exit extends LLVMFunction {
3132

3233
@Override
33-
public IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes) throws ConfigCompileException {
34+
public IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters generics, ParseTree... nodes) throws ConfigCompileException {
3435
OSUtils.OS os = env.getEnv(CompilerEnvironment.class).getTargetOS();
3536
LLVMEnvironment llvmenv = env.getEnv(LLVMEnvironment.class);
3637
String code = "i32 0";
@@ -72,7 +73,7 @@ public Version since() {
7273
public static class sys_out extends LLVMFunction {
7374

7475
@Override
75-
public IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes) throws ConfigCompileException {
76+
public IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters generics, ParseTree... nodes) throws ConfigCompileException {
7677
OSUtils.OS os = env.getEnv(CompilerEnvironment.class).getTargetOS();
7778
LLVMEnvironment llvmenv = env.getEnv(LLVMEnvironment.class);
7879
List<String> lines = new ArrayList<>();

src/main/java/com/laytonsmith/core/functions/asm/Compiler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.laytonsmith.core.asm.LLVMFunction;
1212
import com.laytonsmith.core.asm.LLVMVersion;
1313
import com.laytonsmith.core.constructs.Target;
14+
import com.laytonsmith.core.constructs.generics.GenericParameters;
1415
import com.laytonsmith.core.environments.Environment;
1516
import com.laytonsmith.core.exceptions.CRE.CREThrowable;
1617
import com.laytonsmith.core.exceptions.ConfigCompileException;
@@ -23,7 +24,7 @@ public class Compiler {
2324
public static class __statements__ extends LLVMFunction {
2425

2526
@Override
26-
public IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes) throws ConfigCompileException {
27+
public IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters generics, ParseTree... nodes) throws ConfigCompileException {
2728
for(ParseTree node : nodes) {
2829
AsmCompiler.getIR(builder, node, env);
2930
}
@@ -56,7 +57,7 @@ public Version since() {
5657
public static class dyn extends LLVMFunction {
5758

5859
@Override
59-
public IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes) throws ConfigCompileException {
60+
public IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters generics, ParseTree... nodes) throws ConfigCompileException {
6061
IRData data = AsmCompiler.getIR(builder, nodes[0], env);
6162
LLVMEnvironment llvmenv = env.getEnv(LLVMEnvironment.class);
6263
int alloca = llvmenv.getNewLocalVariableReference(data.getResultType());

src/main/java/com/laytonsmith/core/functions/asm/DataHandling.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.laytonsmith.core.constructs.IVariable;
1616
import com.laytonsmith.core.constructs.LeftHandSideType;
1717
import com.laytonsmith.core.constructs.Target;
18+
import com.laytonsmith.core.constructs.generics.GenericParameters;
1819
import com.laytonsmith.core.environments.Environment;
1920
import com.laytonsmith.core.exceptions.CRE.CRECastException;
2021
import com.laytonsmith.core.exceptions.CRE.CREThrowable;
@@ -29,7 +30,7 @@ public class DataHandling {
2930
public static class assign extends LLVMFunction {
3031

3132
@Override
32-
public IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes) throws ConfigCompileException {
33+
public IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters generics, ParseTree... nodes) throws ConfigCompileException {
3334
LLVMEnvironment llvmenv = env.getEnv(LLVMEnvironment.class);
3435
int offset;
3536
LeftHandSideType type;

src/main/java/com/laytonsmith/core/functions/asm/Math.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.laytonsmith.core.asm.LLVMVersion;
1616
import com.laytonsmith.core.compiler.CompilerEnvironment;
1717
import com.laytonsmith.core.constructs.Target;
18+
import com.laytonsmith.core.constructs.generics.GenericParameters;
1819
import com.laytonsmith.core.environments.Environment;
1920
import com.laytonsmith.core.exceptions.CRE.CREThrowable;
2021
import com.laytonsmith.core.exceptions.ConfigCompileException;
@@ -43,7 +44,7 @@ public void addStartupCode(IRBuilder builder, Environment startupEnv, Target t)
4344
}
4445

4546
@Override
46-
public IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes) throws ConfigCompileException {
47+
public IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters generics, ParseTree... nodes) throws ConfigCompileException {
4748
LLVMEnvironment llvmenv = env.getEnv(LLVMEnvironment.class);
4849
CompilerEnvironment cEnv = env.getEnv(CompilerEnvironment.class);
4950
llvmenv.addGlobalDeclaration(AsmCommonLibTemplates.RAND, env);

src/main/java/com/laytonsmith/core/functions/asm/Meta.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.laytonsmith.core.asm.LLVMFunction;
1111
import com.laytonsmith.core.asm.LLVMVersion;
1212
import com.laytonsmith.core.constructs.Target;
13+
import com.laytonsmith.core.constructs.generics.GenericParameters;
1314
import com.laytonsmith.core.environments.Environment;
1415
import com.laytonsmith.core.exceptions.CRE.CREThrowable;
1516
import com.laytonsmith.core.exceptions.ConfigCompileException;
@@ -22,7 +23,7 @@ public class Meta {
2223
public static class noop extends LLVMFunction {
2324

2425
@Override
25-
public IRData buildIR(IRBuilder builder, Target t, Environment env, ParseTree... nodes)
26+
public IRData buildIR(IRBuilder builder, Target t, Environment env, GenericParameters generics, ParseTree... nodes)
2627
throws ConfigCompileException {
2728
builder.appendLine(t, "add i1 0, 0 ; noop()");
2829
return IRDataBuilder.asVoid();

0 commit comments

Comments
 (0)