Unify.cxx File Reference

#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <dirent.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <libsherpa/UExcept.hxx>
#include "Options.hxx"
#include "UocInfo.hxx"
#include "AST.hxx"
#include "Type.hxx"
#include "TypeInfer.hxx"
#include "TypeScheme.hxx"
#include "TypeMut.hxx"
#include "Typeclass.hxx"
#include "inter-pass.hxx"
#include "Unify.hxx"
#include "WorkList.hxx"

Go to the source code of this file.

Functions

static bool typeError (std::ostream &errStream, const LexLoc &errLoc, shared_ptr< Type > t1, shared_ptr< Type > t2)
bool unifyPrim (std::ostream &errStream, shared_ptr< Trail > trail, const LexLoc &errLoc, shared_ptr< Type > tau, const std::string ptype)
static bool Unify (std::ostream &errStream, shared_ptr< Trail > trail, const LexLoc &errLoc, shared_ptr< Type > ft, shared_ptr< Type > st, UnifyFlags uflags)
static bool UnifyDecl (std::ostream &errStream, shared_ptr< Trail > trail, const LexLoc &errLoc, shared_ptr< Type > t1, shared_ptr< Type > t2, UnifyFlags uflags)
static bool UnifyStructUnion (std::ostream &errStream, shared_ptr< Trail > trail, const LexLoc &errLoc, shared_ptr< Type > t1, shared_ptr< Type > t2, UnifyFlags uflags)
static bool UnifyFnArgs (std::ostream &errStream, shared_ptr< Trail > trail, const LexLoc &errLoc, shared_ptr< Type > errt1, shared_ptr< Type > errt2, shared_ptr< Type > t1, shared_ptr< Type > t2, UnifyFlags uflags)
static bool PropagateMutability (std::ostream &errStream, shared_ptr< Trail > trail, const LexLoc &errLoc, shared_ptr< Type > t)
bool acyclic (std::ostream &errStream, const LexLoc &errLoc, shared_ptr< Type > typ, WorkList< shared_ptr< Type > > &worklist, DoneList< shared_ptr< Type > > &donelist, bool inref=false)
bool unify (std::ostream &errStream, shared_ptr< Trail > trail, const LexLoc &errLoc, shared_ptr< Type > ft, shared_ptr< Type > st, UnifyFlags uflags)


Function Documentation

bool acyclic ( std::ostream &  errStream,
const LexLoc errLoc,
shared_ptr< Type typ,
WorkList< shared_ptr< Type > > &  worklist,
DoneList< shared_ptr< Type > > &  donelist,
bool  inref = false 
)

Definition at line 787 of file Unify.cxx.

References assert(), sherpa::LexLoc::asString(), CHKERR, fatal(), boost::GC_NULL, and PO_NO_TRAVERSE.

Referenced by unify().

static bool PropagateMutability ( std::ostream &  errStream,
shared_ptr< Trail trail,
const LexLoc errLoc,
shared_ptr< Type t 
) [static]

Definition at line 242 of file Unify.cxx.

References sherpa::LexLoc::asString(), and CHKERR.

Referenced by Unify().

static bool typeError ( std::ostream &  errStream,
const LexLoc errLoc,
shared_ptr< Type t1,
shared_ptr< Type t2 
) [static]

Definition at line 65 of file Unify.cxx.

References sherpa::LexLoc::asString(), and boost::GC_NULL.

bool unify ( std::ostream &  errStream,
shared_ptr< Trail trail,
const LexLoc errLoc,
shared_ptr< Type ft,
shared_ptr< Type st,
UnifyFlags  uflags 
)

Definition at line 857 of file Unify.cxx.

References acyclic(), CHKERR, and Unify().

Referenced by Type::SetTvarsToUnit(), UnifyLetBinds(), and unifyPrim().

static bool Unify ( std::ostream &  errStream,
shared_ptr< Trail trail,
const LexLoc errLoc,
shared_ptr< Type ft,
shared_ptr< Type st,
UnifyFlags  uflags 
) [static]

Definition at line 261 of file Unify.cxx.

References assert(), sherpa::LexLoc::asString(), CHKERR, DEBUG, Options::debugTvP, Type::make(), Mutable(), newTvar(), PropagateMutability(), TY_RIGID, typeError(), UFLG_UN_IGN_RIGIDITY, UFLG_UNIFY_STRICT, UFLG_UNIFY_STRICT_TVAR, UNIFY, UnifyFnArgs(), and UnifyStructUnion().

Referenced by unify(), UnifyDecl(), UnifyFnArgs(), and UnifyStructUnion().

static bool UnifyDecl ( std::ostream &  errStream,
shared_ptr< Trail trail,
const LexLoc errLoc,
shared_ptr< Type t1,
shared_ptr< Type t2,
UnifyFlags  uflags 
) [static]

Definition at line 102 of file Unify.cxx.

References assert(), CHKERR, DEBUG, Options::debugTvP, typeError(), Unify(), and UNIFY.

Referenced by UnifyStructUnion().

static bool UnifyFnArgs ( std::ostream &  errStream,
shared_ptr< Trail trail,
const LexLoc errLoc,
shared_ptr< Type errt1,
shared_ptr< Type errt2,
shared_ptr< Type t1,
shared_ptr< Type t2,
UnifyFlags  uflags 
) [static]

Definition at line 199 of file Unify.cxx.

References assert(), CHKERR, COMP_BYREF, COMP_MAYBE_BYREF, typeError(), and Unify().

Referenced by Unify().

bool unifyPrim ( std::ostream &  errStream,
shared_ptr< Trail trail,
const LexLoc errLoc,
shared_ptr< Type tau,
const std::string  ptype 
)

Definition at line 82 of file Unify.cxx.

References CHKERR, Type::LookupTypeTag(), Type::make(), UFLG_NO_FLAGS, and unify().

Referenced by typeInfer().

static bool UnifyStructUnion ( std::ostream &  errStream,
shared_ptr< Trail trail,
const LexLoc errLoc,
shared_ptr< Type t1,
shared_ptr< Type t2,
UnifyFlags  uflags 
) [static]

Definition at line 132 of file Unify.cxx.

References assert(), CHKERR, DEBUG, Options::debugTvP, typeError(), Unify(), UNIFY, and UnifyDecl().

Referenced by Unify().


Generated on Thu May 17 23:59:16 2012 for BitC Compiler by  doxygen 1.4.7