-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c958642
commit 7c87e3f
Showing
8 changed files
with
83 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
package vct.col.serialize | ||
|
||
import vct.col.ast.{serialize => ser} | ||
import vct.col.origin.Origin | ||
import vct.col.origin._ | ||
|
||
import scala.annotation.unused | ||
|
||
object SerializeOrigin { | ||
def deserialize(@unused origin: ser.Origin): Origin = | ||
Origin(Nil) | ||
Origin(origin.content.map(_.content).map { | ||
case ser.OriginContent.Content.SourceName(name) => SourceName(name.name) | ||
case ser.OriginContent.Content.PreferredName(name) => PreferredName(name.preferredName) | ||
}) | ||
|
||
def serialize(@unused origin: Origin): ser.Origin = | ||
ser.Origin(Nil) | ||
ser.Origin(origin.originContents.flatMap { | ||
case SourceName(name) => Seq(ser.OriginContent.Content.SourceName(ser.SourceName(name))) | ||
case PreferredName(preferredName) => Seq(ser.OriginContent.Content.PreferredName(ser.PreferredName(preferredName))) | ||
case _ => Nil | ||
}.map(ser.OriginContent(_))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package vct.cache | ||
|
||
import com.typesafe.scalalogging.LazyLogging | ||
import hre.cache.Cache | ||
import vct.main.BuildInfo | ||
|
||
import java.nio.file.Path | ||
|
||
case object Caches extends LazyLogging { | ||
// Val's, so that multiple VerCors runs in one JVM (e.g. tests) benefit from a shared cache even when the cache is | ||
// variate. | ||
lazy val getLibraryCache: Path = getDirectory(BuildInfo.currentCommit).resolve("library") | ||
|
||
lazy val getCarbonDirectory: Path = getViperDirectory(BuildInfo.carbonCommit).resolve("carbon").resolve("verified") | ||
lazy val getSiliconDirectory: Path = getViperDirectory(BuildInfo.siliconCommit).resolve("silicon").resolve("verified") | ||
|
||
private def getDirectory(keys: String*): Path = { | ||
val variate = BuildInfo.gitHasChanges != "false" | ||
|
||
if(variate) { | ||
logger.warn("Caching is enabled, but results will be discarded, since there were uncommitted changes at compilation time.") | ||
} | ||
|
||
Cache.getDirectory(variate, keys) | ||
} | ||
|
||
private def getViperDirectory(backendCommit: String): Path = | ||
getDirectory( | ||
BuildInfo.currentCommit, | ||
BuildInfo.silverCommit, | ||
backendCommit, | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters