Skip to content

Commit

Permalink
rm: removing unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
G0nzal0zz committed Jan 16, 2025
1 parent 3898ebf commit d2a8f43
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/Codegen/ExprGen/Variable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,12 @@ generateVar (AT.Var loc name type') = do
Just ptr -> do
let varTy = TD.typeOf ptr
expectedType = ET.toLLVM type'
-- If the variable type matches the expected type, return the pointer directly.
if varTy == expectedType
then return ptr
else case varTy of
T.PointerType (T.FunctionType {}) _ -> return ptr
T.PointerType _ _ -> I.load ptr 0
_ -> return ptr

-- Handle unsupported expressions with an error.
generateVar expr =
E.throwError $ CC.CodegenError (SU.getLoc expr) $ CC.UnsupportedDefinition expr

Expand Down

0 comments on commit d2a8f43

Please # to comment.