language-c-0.9.2: Analysis and generation of C code
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.C.Analysis.TypeCheck

Synopsis

Documentation

pType :: Type -> String Source #

typeErrorOnLeft :: MonadCError m => NodeInfo -> Either String a -> m a Source #

typeError :: MonadCError m => NodeInfo -> String -> m a Source #

notFound :: Ident -> Either String a Source #

checkScalar :: Type -> Either String () Source #

checkIntegral :: Type -> Either String () Source #

constType :: (MonadCError m, MonadName m) => CConst -> m Type Source #

Determine the type of a constant.

compatible :: Type -> Type -> Either String () Source #

Determine whether two types are compatible.

compositeType :: Type -> Type -> Either String Type Source #

Determine the composite type of two compatible types.

sizeEqual :: CExpr -> CExpr -> Bool Source #

castCompatible :: Type -> Type -> Either String () Source #

assignCompatible :: CAssignOp -> Type -> Type -> Either String () Source #

Determine whether two types are compatible in an assignment expression.

binopType :: CBinaryOp -> Type -> Type -> Either String Type Source #

Determine the type of a binary operation.

conditionalType :: Type -> Type -> Either String Type Source #

Determine the type of a conditional expression.

derefType :: Type -> Either String Type Source #

varAddrType :: IdentDecl -> Either String Type Source #

fieldType :: (MonadCError m, MonadSymtab m) => NodeInfo -> Ident -> Type -> m Type Source #

Get the type of field m of type t

tagMembers :: (MonadCError m, MonadSymtab m) => NodeInfo -> TagDef -> m [(Ident, Type)] Source #

Get all members of a struct, union, or enum, with their types. Collapse fields of anonymous members.

expandAnonymous :: (MonadCError m, MonadSymtab m) => NodeInfo -> (VarName, Type) -> m [(Ident, Type)] Source #

Expand an anonymous composite type into a list of member names and their associated types.