Skip to content

Commit

Permalink
More of persistance for metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Nov 9, 2023
1 parent b05ec17 commit 4a5809a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@

import java.io.IOException;
import org.enso.compiler.core.Persistance;
import org.enso.compiler.pass.resolve.DocumentationComments;
import org.enso.compiler.pass.resolve.IgnoredBindings;
import org.enso.compiler.pass.resolve.ModuleAnnotations;
import org.enso.compiler.pass.resolve.TypeSignatures;
import org.enso.interpreter.dsl.Persistable;
import org.openide.util.lookup.ServiceProvider;

@Persistable(clazz = CachePreferenceAnalysis.WeightInfo.class, id = 1111)
@Persistable(clazz = DataflowAnalysis.DependencyInfo.class, id = 1112)
@Persistable(clazz = DataflowAnalysis.DependencyMapping.class, id = 1113)
@Persistable(clazz = GatherDiagnostics.DiagnosticsMeta.class, id = 1114)
@Persistable(clazz = DocumentationComments.Doc.class, id = 1115)
@Persistable(clazz = AliasAnalysis$Info$Occurrence.class, id = 1116)
@Persistable(clazz = TypeSignatures.Signature.class, id = 1117)
@Persistable(clazz = ModuleAnnotations.Annotations.class, id = 1118)
@Persistable(clazz = AliasAnalysis.Graph.class, id = 1119)
@Persistable(clazz = AliasAnalysis$Info$Scope$Root.class, id = 1120)
public final class PassPersistance {
private PassPersistance() {}

Expand All @@ -32,4 +42,25 @@ protected IgnoredBindings.State readObject(Input in)
: org.enso.compiler.pass.resolve.IgnoredBindings$State$NotIgnored$.MODULE$;
}
}

@ServiceProvider(service = Persistance.class)
public static final class PersistTail extends Persistance<TailCall.TailPosition> {
public PersistTail() {
super(TailCall.TailPosition.class, true, 1102);
}

@Override
protected void writeObject(TailCall.TailPosition obj, Output out) throws IOException {
out.writeBoolean(obj.isTail());
}

@Override
protected TailCall.TailPosition readObject(Input in)
throws IOException, ClassNotFoundException {
var b = in.readBoolean();
return b
? org.enso.compiler.pass.analyse.TailCall$TailPosition$Tail$.MODULE$
: org.enso.compiler.pass.analyse.TailCall$TailPosition$NotTail$.MODULE$;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ public record Metadata(
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$Union.class, id=33017)
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$Intersect.class, id=33018)
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$AllowedResolution.class, id=33019)
@Persistable(clazz=org.enso.compiler.data.BindingsMap$SymbolRestriction$All$.class, id=33020)
@Persistable(clazz=BindingsMap.Resolution.class, id=33021)
@ServiceProvider(service = Persistance.class)
public static final class PersistBindingsMap extends Persistance<BindingsMap> {
public PersistBindingsMap() {
Expand Down

0 comments on commit 4a5809a

Please sign in to comment.