#include <assert.h>#include <stdint.h>#include <stdlib.h>#include <dirent.h>#include <fstream>#include <iostream>#include <sstream>#include <string>#include <set>#include <libsherpa/UExcept.hxx>#include "Options.hxx"#include "UocInfo.hxx"#include "AST.hxx"#include "Type.hxx"#include "TypeInfer.hxx"#include "inter-pass.hxx"Go to the source code of this file.
Typedefs | |
| typedef set< shared_ptr< AST > > | AstSet |
Functions | |
| static void | clearusedef (shared_ptr< AST > ast) |
| Mark all defining occurrences that are closed over so that we can later rewrite them. | |
| static bool | used (shared_ptr< AST > id, shared_ptr< AST > ast) |
| static bool | findusedef (std::ostream &errStream, shared_ptr< AST > topAst, shared_ptr< AST > ast, const int mode, AstSet &boundVars, AstSet &freeVars) |
| Mark all defining occurrences that are closed over so that we can later rewrite them. | |
| shared_ptr< AST > | cl_rewrite_captured_idents (shared_ptr< AST > ast, shared_ptr< AST > clenvName) |
| static shared_ptr< AST > | getClenvUse (shared_ptr< AST > ast, shared_ptr< AST > clenvName, std::vector< std::string > &tvs) |
| static shared_ptr< AST > | cl_convert_ast (shared_ptr< AST > ast, std::vector< shared_ptr< AST > > &outAsts, bool shouldHoist) |
| void | cl_convert (shared_ptr< UocInfo > uoc) |
| shared_ptr< AST > | cl_heapify (shared_ptr< AST > ast) |
Definition at line 61 of file Clconv.cxx.
| void cl_convert | ( | shared_ptr< UocInfo > | uoc | ) |
| static shared_ptr<AST> cl_convert_ast | ( | shared_ptr< AST > | ast, | |
| std::vector< shared_ptr< AST > > & | outAsts, | |||
| bool | shouldHoist | |||
| ) | [static] |
Definition at line 708 of file Clconv.cxx.
References argVec, assert(), at_allocREF, at_begin, at_boxedCat, at_constraints, at_copyREF, at_declares, at_define, at_defstruct, at_field, at_fields, at_ident, at_identPattern, at_lambda, at_letrec, at_mkClosure, at_proclaim, at_recdef, at_struct_apply, at_tvlist, cl_rewrite_captured_idents(), DEBUG, DEF_IS_EXTERNAL, findusedef(), boost::GC_NULL, AST::genSym(), getClenvUse(), ID_IS_CAPTURED, ID_IS_GLOBAL, id_struct, id_tvar, id_value, LAM_NEEDS_TRANS, lbs, TvPrinter::make(), AST::make(), NULL_MODE, PROCLAIM_IS_INTERNAL, tvlist, and used().
Referenced by cl_convert(), and cl_convert_ast().
Definition at line 977 of file Clconv.cxx.
References assert(), at_boxedType, at_constraints, at_deref, at_dup, at_ident, at_identPattern, at_lambda, at_let, at_letbinding, at_letbindings, at_try, at_uswitch, DEBUG, ID_IS_CAPTURED, ID_NEEDS_HEAPIFY, IGNORE, and AST::make().
Referenced by cl_heapify().
Definition at line 634 of file Clconv.cxx.
References at_ident, at_select, ID_IS_CLOSED, and AST::make().
Referenced by cl_convert_ast(), and cl_rewrite_captured_idents().
| static void clearusedef | ( | shared_ptr< AST > | ast | ) | [static] |
Mark all defining occurrences that are closed over so that we can later rewrite them.
Definition at line 68 of file Clconv.cxx.
References ID_IS_CAPTURED, ID_IS_CLOSED, and ID_NEEDS_HEAPIFY.
Referenced by clearusedef().
| static bool findusedef | ( | std::ostream & | errStream, | |
| shared_ptr< AST > | topAst, | |||
| shared_ptr< AST > | ast, | |||
| const int | mode, | |||
| AstSet & | boundVars, | |||
| AstSet & | freeVars | |||
| ) | [static] |
Mark all defining occurrences that are closed over so that we can later rewrite them.
Definition at line 100 of file Clconv.cxx.
References agt_category, agt_CompilationUnit, agt_definition, agt_eform, agt_expr, agt_expr_or_define, agt_fielditem, agt_if_definition, agt_literal, agt_openclosed, agt_ow, agt_qtype, agt_tc_definition, agt_tvar, agt_type, agt_type_definition, agt_ucon, agt_uselhs, agt_value_definition, agt_var, ARG_BYREF, assert(), at_allocREF, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_array_ref_nth, at_arrayRefType, at_arrayType, at_begin, at_bitfieldType, at_bitsizeof, at_boolLiteral, at_boxedCat, at_boxedType, at_byRefType, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_condelse, at_constraints, at_constructor, at_constructors, at_constType, at_container, at_copyREF, at_declare, at_declares, at_declrepr, at_declstruct, at_declunion, at_defexception, at_define, at_definstance, at_defrepr, at_defstruct, at_deftypeclass, at_defunion, at_deref, at_docString, at_dummyType, at_dup, at_exceptionType, at_field, at_fields, at_fieldType, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_fqCtr, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_ifsel, at_import, at_importAs, at_inner_ref, at_interface, at_intLiteral, at_labeledBlock, at_lambda, at_let, at_letbinding, at_letbindings, at_letGather, at_letrec, at_letStar, at_localFrame, at_loop, at_loopbinding, at_loopbindings, at_looptest, at_MakeVector, at_methdecl, at_method_decl, at_method_decls, at_methType, at_mkArrayRef, at_mkClosure, at_module, at_mutableType, at_nth, at_Null, at_object_apply, at_oc_closed, at_oc_open, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_proclaim, at_provide, at_qualType, at_recdef, at_reprctr, at_reprctrs, at_reprrepr, at_return_from, at_sel_ctr, at_select, at_setbang, at_setClosure, at_sizeof, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_tcmethod_binding, at_tcmethods, at_throw, at_try, at_tvlist, at_tyfn, at_typeAnnotation, at_typeapp, at_ucon_apply, at_unboxedCat, at_unboxedType, at_unit, at_unless, at_usesel, at_usw_leg, at_usw_legs, at_uswitch, at_vector, at_vector_nth, at_vectorType, at_when, CHKERR, DEBUG, ID_IS_CAPTURED, ID_IS_CLOSED, ID_NEEDS_HEAPIFY, IGNORE, INNER_REF_NDX, lbs, LOCAL_MODE, Options::noAlloc, NULL_MODE, TYPE_MODE, and USE_MODE.
Referenced by cl_convert_ast(), and findusedef().
| static shared_ptr<AST> getClenvUse | ( | shared_ptr< AST > | ast, | |
| shared_ptr< AST > | clenvName, | |||
| std::vector< std::string > & | tvs | |||
| ) | [static] |
Definition at line 662 of file Clconv.cxx.
References at_ident, at_typeapp, id_tvar, and AST::make().
Referenced by cl_convert_ast().
Definition at line 79 of file Clconv.cxx.
References assert(), and at_ident.
Referenced by cl_convert_ast().
1.4.7