From: Tuukka Lehtonen Date: Fri, 2 Jun 2017 09:29:50 +0000 (+0300) Subject: Merge "Removed print" X-Git-Tag: v1.31.0~344 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=5170c2970a46bb3d1d0d3e68fc88269fbe1647b0;hp=55ecc2608480948bf13a593cf7002067d0741157 Merge "Removed print" --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java index 9c7c77470..cc883c0ea 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java @@ -17,6 +17,7 @@ import org.simantics.scl.compiler.constants.ThisConstant; import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext; import org.simantics.scl.compiler.elaboration.expressions.Expression; import org.simantics.scl.compiler.elaboration.macros.StandardMacroRule; +import org.simantics.scl.compiler.elaboration.modules.DerivedProperty; import org.simantics.scl.compiler.elaboration.modules.InlineProperty; import org.simantics.scl.compiler.elaboration.modules.MethodImplementation; import org.simantics.scl.compiler.elaboration.modules.PrivateProperty; @@ -124,13 +125,18 @@ public class CodeGeneration { decomposed.typeParameters, decomposed.returnType, decomposed.parameterTypes));*/ + boolean isDerived = false; for(SCLValueProperty prop : value.getProperties()) { if(prop instanceof InlineProperty) { InlineProperty inlineProperty = (InlineProperty)prop; constant.setInlineArity(inlineProperty.arity, inlineProperty.phaseMask); } else if(prop == PrivateProperty.INSTANCE) - constant.setPrivate(true); + constant.setPrivate(!isDerived); + else if(prop == DerivedProperty.INSTANCE) { + constant.setPrivate(false); + isDerived = true; + } } } // This is quite hackish optimization that can be possibly removed when diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java index 1cba44207..7887ed717 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java @@ -39,6 +39,7 @@ import org.simantics.scl.compiler.elaboration.fundeps.Fundep; import org.simantics.scl.compiler.elaboration.java.JavaMethodDeclaration; import org.simantics.scl.compiler.elaboration.macros.StandardMacroRule; import org.simantics.scl.compiler.elaboration.modules.DeprecatedProperty; +import org.simantics.scl.compiler.elaboration.modules.DerivedProperty; import org.simantics.scl.compiler.elaboration.modules.InlineProperty; import org.simantics.scl.compiler.elaboration.modules.MethodImplementation; import org.simantics.scl.compiler.elaboration.modules.PrivateProperty; @@ -587,6 +588,7 @@ public class Elaboration { String fullName = instancePrefix + valueName; long loc = valueDefs.getDefinition(valueName).get(0).location; valueDefinitionsAst.addFrom(valueDefs, valueName, fullName); + valueDefinitionsAst.setDerived(fullName); /*valueDefinitionsAst.addAnnotation(fullName, new DAnnotationAst(new EVar("@private"), Collections.emptyList()));*/ TypeClassMethod method = typeClass.methods.get(valueName); @@ -1144,6 +1146,8 @@ public class Elaboration { value.definitionLocation = location; if(module.addValue(value)) errorLog.log(location, "Value " + name + " is already defined."); + if(valueDefinitionsAst.isDerived(name)) + value.addProperty(DerivedProperty.INSTANCE); } for(DValueTypeAst valueTypeAst : typeAnnotationsAst) for(EVar name : valueTypeAst.names) { diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java new file mode 100644 index 000000000..b4872904d --- /dev/null +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java @@ -0,0 +1,5 @@ +package org.simantics.scl.compiler.elaboration.modules; + +public enum DerivedProperty implements SCLValueProperty { + INSTANCE; +} diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java index a38191501..b9b0269e9 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java @@ -6,19 +6,9 @@ public class MethodImplementation { public final Name name; public final boolean isDefault; - private SCLValue value; public MethodImplementation(Name name, boolean isDefault) { this.name = name; this.isDefault = isDefault; } - - public SCLValue getValue() { - return value; - } - - public void setValue(SCLValue value) { - this.value = value; - } - } diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java index d0e81402d..a0d570222 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java @@ -12,12 +12,14 @@ import org.simantics.scl.compiler.internal.parsing.declarations.DValueAst; import gnu.trove.impl.Constants; import gnu.trove.map.hash.THashMap; import gnu.trove.map.hash.TObjectLongHashMap; +import gnu.trove.set.hash.THashSet; public class ValueRepository { THashMap> values = new THashMap>(); THashMap> annotations = new THashMap>(); + THashSet derived = new THashSet(); TObjectLongHashMap locations = new TObjectLongHashMap(Constants.DEFAULT_CAPACITY, Constants.DEFAULT_LOAD_FACTOR, Locations.NO_LOCATION); @@ -85,4 +87,12 @@ public class ValueRepository { public long getLocation(String name) { return locations.get(name); } + + public boolean isDerived(String name) { + return derived.contains(name); + } + + public void setDerived(String name) { + derived.add(name); + } } diff --git a/bundles/org.simantics.scl.runtime/scl/Iterator.scl b/bundles/org.simantics.scl.runtime/scl/Iterator.scl index be7fb90e0..19e51a0d5 100644 --- a/bundles/org.simantics.scl.runtime/scl/Iterator.scl +++ b/bundles/org.simantics.scl.runtime/scl/Iterator.scl @@ -27,6 +27,19 @@ iterB f it = loop () else False else True +@inline +filter :: (a -> Boolean) -> T a -> () +filter f it = loop () + where + loop _ = + if hasNext it + then do + if f (next it) + then () + else remove it + loop () + else () + @inline mapFirst :: (a -> Maybe b) -> T a -> Maybe b mapFirst f it = loop () diff --git a/bundles/org.simantics.scl.runtime/scl/MSet.scl b/bundles/org.simantics.scl.runtime/scl/MSet.scl index 9f543101f..3e280d6b5 100644 --- a/bundles/org.simantics.scl.runtime/scl/MSet.scl +++ b/bundles/org.simantics.scl.runtime/scl/MSet.scl @@ -80,3 +80,6 @@ concatMap f s = result all :: (a -> Boolean) -> T a -> Boolean all f s = Iterator.iterB f (iterator s) + +filterInPlace :: (a -> Boolean) -> T a -> () +filterInPlace p s = Iterator.filter p (iterator s) diff --git a/features/org.simantics.sdk.feature/feature.xml b/features/org.simantics.sdk.feature/feature.xml index 603c6834c..c5bc965b5 100644 --- a/features/org.simantics.sdk.feature/feature.xml +++ b/features/org.simantics.sdk.feature/feature.xml @@ -13,7 +13,7 @@ diff --git a/releng/doc/release.html b/releng/doc/release.html index 6f0fd9753..df0f9d70f 100644 --- a/releng/doc/release.html +++ b/releng/doc/release.html @@ -396,15 +396,39 @@ the version numbers in target name and org.simantics.sdk.feature.group
  • -

    Edit version number of `org.simantics.sdk` feature in `features/org.simantics.sdk.feature/feature.xml` to `x.y.z[.w]`.

    -
    
    -<feature
    +

    Edit version number of org.simantics.sdk feature in features/org.simantics.sdk.feature/feature.xml to x.y.z[.w].

    +
    <feature
           id="org.simantics.sdk"
           label="Simantics SDK"
           version="x.y.z"
           provider-name="VTT Technical Research Centre of Finland">
     
    -

    Now commit and push the changes to the release branch.

    +

    An example of these changes can be seen in gitweb.

    +
  • +
  • +

    Ensure that Redmine has a release engineering issue for the branched release, such as Simantics 1.30.0 release engineering. Make a copy of the previous release issue to create the new one. Include link to original issue while copying.

    +
  • +
  • +

    Commit the changes made

    +
     git commit -a
    +
    +

    with the commit message

    +
     Configured release/x.y.z[.w] branch for SDK builds.
    +
    + refs #xxxx
    +
    +

    where #xxxx is the number of the x.y.z[.w] release engineering issue and push them to remote

    +
     git push origin release/x.y.z[.w]
    +
    +
  • +
  • +

    If you are branching from master, bump the revision of master right now to start the next release cycle in master. +An example of these changes can be seen in gitweb.

    +

    Commit the changes with the following commit message

    +
    Bumped master target and org.simantics.sdk feature versions to x.y.z[.w].
    +refs #yyyy
    +
    +

    where #yyyy is the number of the next release's release engineering issue.

  • Initialize release branch distribution web site

    @@ -481,7 +505,7 @@ is to back up the mysql database backing the wiki. Should the wiki be required at a later time for some reason, we'll put the documentation up then in a separate Mediawiki installation.

      -
    1. Dump documentation wiki databases using [dump-wikis.sh](./dump-wikis.sh) script.
    2. +
    3. Dump documentation wiki databases using dump-wikis.sh script.
    4. Put the generated backup x.y.z.tar.gz at /var/backup/simantics-releases/x.y.z/wiki/

    Compile change log entry

    diff --git a/releng/doc/release.md b/releng/doc/release.md index 6d55c144d..b16736e80 100644 --- a/releng/doc/release.md +++ b/releng/doc/release.md @@ -120,6 +120,34 @@ With service releases, branch from an existing `release/*` branch instead. provider-name="VTT Technical Research Centre of Finland"> ~~~ + An example of these changes can be seen in [gitweb](https://www.simantics.org:8088/r/gitweb?p=simantics/platform.git;a=commit;h=bab5c9bd68277c76dc5c20bc7a60a9896cbd1540). + +4. Ensure that Redmine has a release engineering issue for the branched release, such as [Simantics 1.30.0 release engineering](https://www.simantics.org/redmine/issues/7263). Make a copy of the previous release issue to create the new one. Include link to original issue while copying. + +5. Commit the changes made + + git commit -a + + with the commit message + + Configured release/x.y.z[.w] branch for SDK builds. + + refs #xxxx + + where `#xxxx` is the number of the x.y.z[.w] release engineering issue and push them to remote + + git push origin release/x.y.z[.w] + +6. If you are branching from `master`, bump the revision of master right now to start the next release cycle in master. + An example of these changes can be seen in [gitweb](https://www.simantics.org:8088/r/gitweb?p=simantics/platform.git;a=commitdiff;h=ae93c9930c6345c32219e6845b9e72e9d9d2d28c). + + Commit the changes with the following commit message + + Bumped master target and org.simantics.sdk feature versions to x.y.z[.w]. + refs #yyyy + + where `#yyyy` is the number of the next release's release engineering issue. + ### Initialize release branch distribution web site * Run [SDK/Deploy External Components to Web](https://www.simantics.org/jenkins/job/SDK/job/Deploy%20External%20Components%20to%20Web/) build with parameters: diff --git a/releng/org.simantics.sdk.build.targetdefinition/simantics.target b/releng/org.simantics.sdk.build.targetdefinition/simantics.target index 7b97949a6..faad6d455 100644 --- a/releng/org.simantics.sdk.build.targetdefinition/simantics.target +++ b/releng/org.simantics.sdk.build.targetdefinition/simantics.target @@ -1,10 +1,10 @@ - + - - + + diff --git a/releng/org.simantics.sdk.repository/pom.xml b/releng/org.simantics.sdk.repository/pom.xml index b3d1dc628..a72cb5e12 100644 --- a/releng/org.simantics.sdk.repository/pom.xml +++ b/releng/org.simantics.sdk.repository/pom.xml @@ -2,7 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.simantics.sdk.repository - 1.29.0-SNAPSHOT + 1.30.0-SNAPSHOT eclipse-repository diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java index f50056e8d..5bd0c85d7 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java @@ -138,6 +138,7 @@ public class ModuleRegressionTests extends TestBase { @Test public void LocalDefinitions4() { test(); } @Test public void LocalDefinitions5() { test(); } @Test public void Logger() { test(); } + @Test public void LP() { test(); } @Test public void Macros1() { test(); } @Test public void Macros2() { test(); } @Test public void Macros4() { test(); } @@ -221,6 +222,7 @@ public class ModuleRegressionTests extends TestBase { @Test public void SinConst1() { test(); } @Test public void Sort() { test(); } @Test public void Sort2() { test(); } + @Test public void SpecConstr1() { test(); } @Test public void SSATypingBug() { test(); } @Test public void StreamFusion() { test(); } @Test public void StringEscape() { test(); } diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java index 612a3ab1e..ede9d008b 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java @@ -13,16 +13,13 @@ public class UnimplementedTests extends TestBase { @Test public void FunctionalDependencies2() { test(); } @Test public void InlineLoop() { test(); } @Test public void InstanceTypeVariables() { test(); } - @Test public void LP() { test(); } @Test public void Macros3() { test(); } @Test public void MissingTypeParameter() { test(); } @Test(timeout=100L) public void RecursiveValues() { test(); } @Test public void Set1() { test(); } @Test public void Signals() { test(); } - @Test public void SpecConstr1() { test(); } @Test public void StackTrace() { test(); } - @Test public void StringInterpolation2() { test(); } @Test public void Timing() { test(); } }