initCg :: DynFlags -> Module -> (CgEnv, CgState)
initCg dflags mod =
  (CgEnv   { cgModule           = mod
           , cgQClassName       = className
           , cgDynFlags         = dflags
           , cgSequel           = Return
           , cgSelfLoop         = Nothing },
   CgState { cgBindings         = emptyVarEnv
           , cgCode             = mempty
           , cgAccessFlags      = [Public, Super]
           , cgMethodDefs       = []
           , cgFieldDefs        = []
           , cgClassInitCode    = mempty
           , cgClassName        = className
           , cgCompiledClosures = []
           , cgSuperClassName   = Nothing
           , cgNextLocal        = 0
           , cgNextLabel        = 0 })
  where className = moduleJavaClass mod
initCg :: DynFlags -> Module -> (CgEnv, CgState)
initCg dflags mod =
  (CgEnv   { cgModule           = mod
           , cgQClassName       = className
           , cgDynFlags         = dflags
           , cgSequel           = Return
           , cgSelfLoop         = Nothing },
   CgState { cgBindings         = emptyVarEnv
           , cgCode             = mempty
           , cgAccessFlags      = [Public, Super]
           , cgMethodDefs       = []
           , cgFieldDefs        = []
           , cgClassInitCode    = mempty
           , cgClassName        = className
           , cgCompiledClosures = []
           , cgSuperClassName   = Nothing
           , cgNextLocal        = 0
           , cgNextLabel        = 0 })
  where className = moduleJavaClass mod
initCg dflags mod =
  (CgEnv   { cgModule           = mod
           , cgQClassName       = className
           , cgDynFlags         = dflags
           , cgSequel           = Return
           , cgSelfLoop         = Nothing },
   CgState { cgBindings         = emptyVarEnv
           , cgCode             = mempty
           , cgAccessFlags      = [Public, Super]
           , cgMethodDefs       = []
           , cgFieldDefs        = []
           , cgClassInitCode    = mempty
           , cgClassName        = className
           , cgCompiledClosures = []
           , cgSuperClassName   = Nothing
           , cgNextLocal        = 0
           , cgNextLabel        = 0 })
  where className = moduleJavaClass mod