Skip to content

Commit

Permalink
crucible-llvm: Use Lift instead of dataToExpQ (#829)
Browse files Browse the repository at this point in the history
This avoids splicing in TH expressions worth horribly bloated strings, as
observed in #672. While I was at it, I went ahead and replaced each use of
`dataToExpQ` with `lift` to avoid this sort of issue in the future.

Fixes #672.
  • Loading branch information
RyanGlScott authored Sep 7, 2021
1 parent e5d7499 commit c96a404
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crucible-llvm/src/Lang/Crucible/LLVM/QQ.hs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ liftQQType tp =
QQIntVar nm -> [| L.PrimType (L.Integer (fromInteger (intValue $(varE (mkName nm)) ))) |]
QQSizeT -> varE 'IC.llvmSizeT
QQSSizeT -> varE 'IC.llvmSSizeT
QQAlias nm -> [| L.Alias $(dataToExpQ (const Nothing) nm) |]
QQPrim pt -> [| L.PrimType $(dataToExpQ (const Nothing) pt) |]
QQAlias nm -> [| L.Alias nm |]
QQPrim pt -> [| L.PrimType pt |]
QQPtrTo t -> [| L.PtrTo $(liftQQType t) |]
QQArray n t -> [| L.Array n $(liftQQType t) |]
QQVector n t -> [| L.Vector n $(liftQQType t) |]
Expand All @@ -251,7 +251,7 @@ liftQQDecl (QQDeclare ret nm args varargs) =
|]
where
f (Left v) = varE (mkName v)
f (Right sym) = dataToExpQ (const Nothing) sym
f (Right sym) = lift sym

liftKnownNat :: Integral a => a -> Q Exp
liftKnownNat n = [| knownNat @ $(litT (numTyLit (toInteger n))) |]
Expand Down
2 changes: 1 addition & 1 deletion dependencies/llvm-pretty

0 comments on commit c96a404

Please sign in to comment.