Skip to content

Commit

Permalink
Merge branch 'release/2.2.1' into releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam C. Foltzer committed Mar 25, 2015
2 parents 7deef9c + 6cb0da9 commit 300ed3c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ifneq (,${PREFIX})
PREFIX_ARG := --prefix=$(call adjust-path,${PREFIX_ABS})
DESTDIR_ARG := --destdir=${PKG}
CONFIGURE_ARGS := -f-relocatable -f-self-contained \
--docdir=$(call adjust-path,${PREFIX_SHARE}/${PREFIX_DOC})
--docdir=$(call adjust-path,${PREFIX}/${PREFIX_SHARE}/${PREFIX_DOC})
else
# This is kind of weird: 1. Prefix argument must be absolute; Cabal
# doesn't yet fully support relocatable packages. 2. We have to
Expand Down Expand Up @@ -183,6 +183,8 @@ ${PKG}: ${CRYPTOL_EXE} \
# cleanup unwanted files
# don't want to bundle the cryptol library in the binary distribution
rm -rf ${PKG_PREFIX}/lib; rm -rf ${PKG_PREFIX}/*windows-ghc*
# don't ship haddock
rm -rf ${PKG_DOC}/html

.PHONY: install
install: ${PKG}
Expand Down
6 changes: 3 additions & 3 deletions cryptol.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: cryptol
Version: 2.2.0
Version: 2.2.1
Synopsis: Cryptol: The Language of Cryptography
Description: Cryptol is a domain-specific language for specifying cryptographic algorithms. A Cryptol implementation of an algorithm resembles its mathematical specification more closely than an implementation in a general purpose language. For more, see <http://www.cryptol.net/>.
License: BSD3
Expand All @@ -23,7 +23,7 @@ source-repository head
source-repository this
type: git
location: https://github.com/GaloisInc/cryptol.git
tag: v2.2.0
tag: v2.2.1

flag static
default: False
Expand All @@ -40,7 +40,7 @@ flag self-contained
library
Default-language:
Haskell98
Build-depends: base >= 4.6,
Build-depends: base >= 4.6 && < 5,
array >= 0.4,
async >= 2.0,
containers >= 0.5,
Expand Down
17 changes: 8 additions & 9 deletions src/Cryptol/Transform/Specialize.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ specializeExpr expr =
ESel e s -> ESel <$> specializeExpr e <*> pure s
EIf e1 e2 e3 -> EIf <$> specializeExpr e1 <*> specializeExpr e2 <*> specializeExpr e3
EComp t e mss -> EComp t <$> specializeExpr e <*> traverse (traverse specializeMatch) mss
-- ^ Bindings within list comprehensions always have monomorphic types.
-- Bindings within list comprehensions always have monomorphic types.
EVar {} -> specializeConst expr
ETAbs t e -> do
cache <- getSpecCache
setSpecCache Map.empty
e' <- specializeExpr e
setSpecCache cache
return (ETAbs t e')
-- ^ We need to make sure that after processing `e`, no
-- specialized decls mentioning type variable `t` escape outside
-- the `ETAbs`. To avoid this, we reset to an empty SpecCache
-- while we run `specializeExpr e`, and restore it afterward: this
-- We need to make sure that after processing `e`, no specialized
-- decls mentioning type variable `t` escape outside the
-- `ETAbs`. To avoid this, we reset to an empty SpecCache while we
-- run `specializeExpr e`, and restore it afterward: this
-- effectively prevents the specializer from registering any type
-- instantiations involving `t` for any decls bound outside the
-- scope of `t`.
Expand Down Expand Up @@ -121,7 +121,7 @@ withDeclGroups :: [DeclGroup] -> SpecM a
withDeclGroups dgs action = do
let decls = concatMap groupDecls dgs
let newCache = Map.fromList [ (dName d, (d, emptyTM)) | d <- decls ]
-- | We assume that the names bound in dgs are disjoint from the other names in scope.
-- We assume that the names bound in dgs are disjoint from the other names in scope.
modifySpecCache (Map.union newCache)
result <- action
-- Then reassemble the DeclGroups.
Expand All @@ -137,10 +137,10 @@ withDeclGroups dgs action = do
else return [Recursive ds']
splitDeclGroup (NonRecursive d) = map NonRecursive <$> splitDecl d
dgs' <- concat <$> traverse splitDeclGroup dgs
-- | Get updated map of only the local entries we added.
-- Get updated map of only the local entries we added.
newCache' <- flip Map.intersection newCache <$> getSpecCache
let nameTable = fmap (fmap fst . snd) newCache'
-- | Remove local definitions from the cache.
-- Remove local definitions from the cache.
modifySpecCache (flip Map.difference newCache)
return (result, dgs', nameTable)

Expand Down Expand Up @@ -342,4 +342,3 @@ allPublicQNames =

traverseSnd :: Functor f => (b -> f c) -> (a, b) -> f (a, c)
traverseSnd f (x, y) = (,) x <$> f y

0 comments on commit 300ed3c

Please sign in to comment.