From: Hannu Niemistö Date: Fri, 2 Jun 2017 13:39:28 +0000 (+0300) Subject: (refs #7250) Merging master, minor CHR bugfixes X-Git-Tag: v1.31.0~339^2~3 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=fad36d463b75c3a9944d875fc627c3533f6da74d;p=simantics%2Fplatform.git (refs #7250) Merging master, minor CHR bugfixes Change-Id: I11c76beee0e73ff78370f72bbfb88fdbdf6c7616 --- fad36d463b75c3a9944d875fc627c3533f6da74d diff --cc bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java index d5f619654,bb5491ad1..bb00f0885 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java @@@ -207,18 -123,16 +207,19 @@@ public class CHRRuleset extends Symbol constraints.remove(0); initConstraint = null; } + } + + private void applyExtensibleDefaults() { for(CHRConstraint constraint : constraints) { - constraint.plans.sort((PrioritizedPlan a, PrioritizedPlan b) -> { - return Integer.compare(a.priority, b.priority); - }); - /*System.out.println(constraint.name); - for(PrioritizedPlan plan : constraint.plans) { - System.out.println(" priority " + plan.priority); - for(PlanOp op : plan.ops) - System.out.println(" " + op); - }*/ + // FIXME Too much indexing!!! + int max = 1 << constraint.parameterTypes.length; + for(int i=0;i 0) + constraint.getOrCreateIndex(cachedContext, 1);*/ } } diff --cc bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java index ab643f9a1,ab643f9a1..b9e8bfbb3 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java @@@ -359,6 -359,6 +359,8 @@@ public final class SSAFunction extends } public void mergeBlocks(SSAFunction function) { ++ if(this == function) ++ throw new InternalCompilerError(); SSABlock block = function.firstBlock; while(block != null) { SSABlock next = block.next; diff --cc bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java index 6d139a4d6,b8b7def59..400cb6e4e --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java @@@ -399,7 -399,7 +399,7 @@@ public class LetApply extends LetStatem tailBlock.setExit(headBlock.getExit()); // Merge blocks -- thisFunction.mergeBlocks(function); ++ thisFunction.mergeBlocks(function); headBlock.setExit(new Jump(function.getFirstBlock().createOccurrence(), parameters)); diff --cc bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/info/SCLInfo.java index 33b5fc7e9,63b2338f4..c37a9421f --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/info/SCLInfo.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/info/SCLInfo.java @@@ -35,7 -33,6 +35,8 @@@ public class SCLInfo "as", "forall", "rule", + "ruleset", ++ "constraint", "extends", "by", "select",