hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
|
#include <cc.H>
Public Types | |
typedef ModulePtr(* | readModuleFileFn) (cc *, const std::string &) |
typedef ModulePtr(* | readModuleFn) (cc *, const std::string &) |
typedef std::pair< std::string, ExprPtr >(* | readExprDefnFn) (cc *, const std::string &) |
typedef ExprPtr(* | readExprFn) (cc *, const std::string &) |
typedef std::vector< unsigned char > | bytes |
Public Member Functions | |
cc () | |
virtual | ~cc () |
ModulePtr | readModuleFile (const std::string &) |
void | setReadModuleFileFn (readModuleFileFn) |
ModulePtr | readModule (const std::string &) |
void | setReadModuleFn (readModuleFn) |
std::pair< std::string, ExprPtr > | readExprDefn (const std::string &) |
void | setReadExprDefnFn (readExprDefnFn) |
ExprPtr | readExpr (const std::string &) |
void | setReadExprFn (readExprFn) |
template<typename RFn , typename ... NamesAndExpr> | |
func< RFn >::type | compileFn (NamesAndExpr ... args) |
ExprPtr | unsweetenExpression (const TEnvPtr &te, const ExprPtr &e) |
ExprPtr | unsweetenExpression (const TEnvPtr &te, const std::string &vname, const ExprPtr &e) |
ExprPtr | unsweetenExpression (const ExprPtr &e) |
ExprPtr | unsweetenExpression (const std::string &vname, const ExprPtr &e) |
ExprPtr | normalize (const ExprPtr &e) |
llvm::IRBuilder * | builder () const |
llvm::Module * | module () const |
void | dumpTypeEnv () const |
void | dumpTypeEnv (str::seq *syms, str::seq *types) const |
std::string | showTypeEnv () const |
const TEnvPtr & | typeEnv () const |
void | forwardDeclare (const std::string &vname, const QualTypePtr &qt) |
bool | hasValueBinding (const std::string &vname) |
void | drainUnqualifyDefs (const Definitions &ds) |
void | define (const std::string &vname, const ExprPtr &e) |
void | define (const std::string &vname, const std::string &expr) |
void | overload (const std::string &, const MonoTypes &) |
void | overload (const std::string &, const MonoTypes &, const ExprPtr &) |
void | overload (const std::string &, const MonoTypes &, const std::string &) |
void | addInstance (const TClassPtr &, const TCInstancePtr &) |
void | dumpModule () |
bytes | machineCodeForExpr (const std::string &expr) |
template<typename T > | |
void | addObj () |
template<typename T > | |
PolyTypePtr | liftType () |
template<typename T > | |
MonoTypePtr | liftMonoType () |
void | bind (const PolyTypePtr &tn, const std::string &vn, void *x) |
template<typename T > | |
void | bind (const std::string &vn, T *x) |
template<typename T , int N> | |
void | bindArr (const std::string &vn, T x[N]) |
template<typename R , typename ... Args> | |
void | bind (const std::string &fn, R(*pfn)(Args...)) |
void | defineTypeAlias (const std::string &name, const str::seq &argNames, const MonoTypePtr &ty) |
bool | isTypeAliasName (const std::string &name) const |
MonoTypePtr | replaceTypeAliases (const MonoTypePtr &ty) const |
PolyTypePtr | opaquePtrPolyType (const std::type_info &ti, unsigned int sz, bool inStruct) |
MonoTypePtr | opaquePtrMonoType (const std::type_info &ti, unsigned int sz, bool inStruct) |
PolyTypePtr | generalize (const MonoTypePtr &mt) const |
MonoTypePtr | defineNamedType (const std::string &name, const str::seq &argNames, const MonoTypePtr &ty) |
bool | isTypeName (const std::string &) const |
MonoTypePtr | namedTypeRepresentation (const std::string &) const |
void * | unsafeCompileFn (const MonoTypePtr &retTy, const str::seq &names, const MonoTypes &argTys, const ExprPtr &exp) |
void * | unsafeCompileFn (const MonoTypePtr &fnTy, const str::seq &names, const ExprPtr &exp) |
void * | unsafeCompileFn (const MonoTypePtr &fnTy, const str::seq &names, const std::string &exp) |
void | releaseMachineCode (void *) |
void | enableModuleInlining (bool f) |
bool | enableModuleInlining () const |
void | buildInterpretedMatches (bool f) |
bool | buildInterpretedMatches () const |
void | requireMatchReachability (bool f) |
bool | requireMatchReachability () const |
void | alwaysLowerPrimMatchTables (bool) |
bool | alwaysLowerPrimMatchTables () const |
void | bindLLFunc (const std::string &, op *) |
void | bindExternFunction (const std::string &fname, const MonoTypePtr &fty, void *fn) |
bool | preludeLoaded () const |
Public Attributes | |
bool | drainingDefs |
LetRec::Bindings | drainDefs |
UnreachableMatchRowsPtr | unreachableMatchRowsPtr |
Private Types | |
typedef std::pair< str::seq, MonoTypePtr > | TTyDef |
typedef std::unordered_map< std::string, TTyDef > | TTyDefs |
Private Member Functions | |
PolyTypePtr | lookupVarType (const std::string &vname) const |
void | definePolyValue (const std::string &vname, const ExprPtr &unsweetExp) |
cc (const cc &) | |
void | operator= (const cc &) |
Private Attributes | |
readModuleFileFn | readModuleFileF |
readModuleFn | readModuleF |
readExprDefnFn | readExprDefnF |
readExprFn | readExprF |
TTyDefs | ttyDefs |
jitcc | jit |
bool | runModInlinePass |
bool | genInterpretedMatch |
bool | checkMatchReachability |
bool | lowerPrimMatchTables |
TEnvPtr | tenv |
TypeAliasMap | typeAliases |
bool | booted |
ObjsPtr | objs |
typedef std::vector<unsigned char> hobbes::cc::bytes |
|
private |
|
private |
hobbes::cc::cc | ( | ) |
|
virtual |
|
private |
void hobbes::cc::addInstance | ( | const TClassPtr & | c, |
const TCInstancePtr & | i | ||
) |
|
inline |
void hobbes::cc::alwaysLowerPrimMatchTables | ( | bool | f | ) |
bool hobbes::cc::alwaysLowerPrimMatchTables | ( | ) | const |
void hobbes::cc::bind | ( | const PolyTypePtr & | tn, |
const std::string & | vn, | ||
void * | x | ||
) |
|
inline |
|
inline |
|
inline |
void hobbes::cc::bindExternFunction | ( | const std::string & | fname, |
const MonoTypePtr & | fty, | ||
void * | fn | ||
) |
void hobbes::cc::bindLLFunc | ( | const std::string & | fname, |
op * | f | ||
) |
llvm::IRBuilder * hobbes::cc::builder | ( | ) | const |
void hobbes::cc::buildInterpretedMatches | ( | bool | f | ) |
bool hobbes::cc::buildInterpretedMatches | ( | ) | const |
|
inline |
void hobbes::cc::define | ( | const std::string & | vname, |
const ExprPtr & | e | ||
) |
void hobbes::cc::define | ( | const std::string & | vname, |
const std::string & | expr | ||
) |
|
virtual |
Implements hobbes::typedb.
|
private |
|
virtual |
Implements hobbes::typedb.
void hobbes::cc::drainUnqualifyDefs | ( | const Definitions & | ds | ) |
void hobbes::cc::dumpModule | ( | ) |
void hobbes::cc::dumpTypeEnv | ( | ) | const |
void hobbes::cc::enableModuleInlining | ( | bool | f | ) |
bool hobbes::cc::enableModuleInlining | ( | ) | const |
void hobbes::cc::forwardDeclare | ( | const std::string & | vname, |
const QualTypePtr & | qt | ||
) |
|
virtual |
Implements hobbes::typedb.
bool hobbes::cc::hasValueBinding | ( | const std::string & | vname | ) |
|
virtual |
Implements hobbes::typedb.
|
virtual |
Implements hobbes::typedb.
|
inline |
|
inline |
|
private |
cc::bytes hobbes::cc::machineCodeForExpr | ( | const std::string & | expr | ) |
llvm::Module * hobbes::cc::module | ( | ) | const |
|
virtual |
Implements hobbes::typedb.
|
virtual |
Implements hobbes::typedb.
|
virtual |
Implements hobbes::typedb.
|
private |
void hobbes::cc::overload | ( | const std::string & | tyclass, |
const MonoTypes & | tys | ||
) |
void hobbes::cc::overload | ( | const std::string & | tyclass, |
const MonoTypes & | tys, | ||
const std::string & | v | ||
) |
bool hobbes::cc::preludeLoaded | ( | ) | const |
ExprPtr hobbes::cc::readExpr | ( | const std::string & | x | ) |
std::pair< std::string, ExprPtr > hobbes::cc::readExprDefn | ( | const std::string & | x | ) |
ModulePtr hobbes::cc::readModule | ( | const std::string & | x | ) |
ModulePtr hobbes::cc::readModuleFile | ( | const std::string & | x | ) |
void hobbes::cc::releaseMachineCode | ( | void * | f | ) |
|
virtual |
Implements hobbes::typedb.
void hobbes::cc::requireMatchReachability | ( | bool | f | ) |
bool hobbes::cc::requireMatchReachability | ( | ) | const |
void hobbes::cc::setReadExprDefnFn | ( | readExprDefnFn | f | ) |
void hobbes::cc::setReadExprFn | ( | readExprFn | f | ) |
void hobbes::cc::setReadModuleFileFn | ( | readModuleFileFn | f | ) |
void hobbes::cc::setReadModuleFn | ( | readModuleFn | f | ) |
std::string hobbes::cc::showTypeEnv | ( | ) | const |
const TEnvPtr & hobbes::cc::typeEnv | ( | ) | const |
void * hobbes::cc::unsafeCompileFn | ( | const MonoTypePtr & | retTy, |
const str::seq & | names, | ||
const MonoTypes & | argTys, | ||
const ExprPtr & | exp | ||
) |
void * hobbes::cc::unsafeCompileFn | ( | const MonoTypePtr & | fnTy, |
const str::seq & | names, | ||
const ExprPtr & | exp | ||
) |
void * hobbes::cc::unsafeCompileFn | ( | const MonoTypePtr & | fnTy, |
const str::seq & | names, | ||
const std::string & | exp | ||
) |
ExprPtr hobbes::cc::unsweetenExpression | ( | const TEnvPtr & | te, |
const std::string & | vname, | ||
const ExprPtr & | e | ||
) |
|
private |
|
private |
LetRec::Bindings hobbes::cc::drainDefs |
bool hobbes::cc::drainingDefs |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
UnreachableMatchRowsPtr hobbes::cc::unreachableMatchRowsPtr |