mirror of https://github.com/zachjs/sv2v.git
avoid unnecessary unased-unsized casts in assignments
This commit is contained in:
parent
bf1d9283d7
commit
51f2d2bb33
|
|
@ -117,8 +117,7 @@ convertModuleItemM other = return $ convertModuleItem other
|
|||
convertModuleItem :: ModuleItem -> ModuleItem
|
||||
convertModuleItem =
|
||||
traverseExprs (convertExpr SelfDetermined) .
|
||||
traverseTypes (traverseNestedTypes convertType) .
|
||||
traverseAsgns convertAsgn
|
||||
traverseTypes (traverseNestedTypes convertType)
|
||||
|
||||
literalFor :: Char -> Expr
|
||||
literalFor 'Z' = literalFor 'z'
|
||||
|
|
@ -144,11 +143,6 @@ sizedLiteralFor expr ch =
|
|||
Cast (Right size) (literalFor ch)
|
||||
where size = DimsFn FnBits $ Right expr
|
||||
|
||||
convertAsgn :: (LHS, Expr) -> (LHS, Expr)
|
||||
convertAsgn (lhs, expr) =
|
||||
(lhs, convertExpr context expr)
|
||||
where context = ContextDetermined $ lhsToExpr lhs
|
||||
|
||||
convertExpr :: ExprContext -> Expr -> Expr
|
||||
convertExpr _ (DimsFn fn (Right e)) =
|
||||
DimsFn fn $ Right $ convertExpr SelfDetermined e
|
||||
|
|
|
|||
Loading…
Reference in New Issue