#include <stdint.h>#include <stdlib.h>#include <dirent.h>#include <fstream>#include <iostream>#include <sstream>#include <string>#include <libsherpa/UExcept.hxx>#include <libsherpa/CVector.hxx>#include <libsherpa/avl.hxx>#include <assert.h>#include "AST.hxx"#include "Type.hxx"#include "TvPrinter.hxx"#include "backend.hxx"#include "inter-pass.hxx"#include "Symtab.hxx"#include "Unify.hxx"#include "Special.hxx"Go to the source code of this file.
Defines | |
| #define | SHAPDEBUG if(0) |
| #define | HOISTALL false |
| #define | CLOSEALL false |
| #define | NULL_MODE 0x0u |
| #define | LOCAL_MODE 0x2u |
| #define | USE_MODE 0x3u |
| #define | TYPE_MODE 0x4u |
Functions | |
| static void | markRecBound (AST *ast) |
| static void | clearusedef (AST *ast) |
| Mark all defining occurrences that are closed over so that we can later rewrite them. | |
| static void | findusedef (AST *topAst, AST *ast, const int mode, CVector< AST * > *boundVars, CVector< AST * > *freeVars) |
| Mark all defining occurrences that are closed over so that we can later rewrite them. | |
| AST * | cl_rewrite_captured_idents (AST *ast, AST *clenvName) |
| AST * | cl_convert_ast (AST *ast, CVector< AST * > *outAsts, bool shouldHoist) |
| void | cl_convert (UocInfo *uoc) |
| static void | collectHeapifiedArgs (AST *ast, CVector< AST * > *capturedArgs) |
| AST * | cl_heapify (AST *ast) |
| #define CLOSEALL false |
| #define HOISTALL false |
| #define LOCAL_MODE 0x2u |
| #define NULL_MODE 0x0u |
Definition at line 69 of file stale/Clconv.cxx.
Referenced by cl_convert_ast(), findusedef(), and resolve().
| #define SHAPDEBUG if(0) |
Definition at line 60 of file stale/Clconv.cxx.
Referenced by cl_convert_ast(), cl_heapify(), and findusedef().
| #define TYPE_MODE 0x4u |
| #define USE_MODE 0x3u |
Definition at line 71 of file stale/Clconv.cxx.
Referenced by UocInfo::DoResolve(), UocInfo::DoTypeCheck(), findusedef(), InferInstance(), InferObject(), InferStruct(), InferTypeClass(), InferUnion(), ProcessLetExprs(), resolve(), typeEqInfer(), and typeInfer().
| void cl_convert | ( | UocInfo * | uoc | ) |
Definition at line 732 of file stale/Clconv.cxx.
References child(), AST::children, cl_convert_ast(), and uoc.
Definition at line 546 of file stale/Clconv.cxx.
References AST::addChild(), argVec, assert(), astType, AST::astType, at_apply, at_constraints, at_declares, at_define, at_defstruct, at_field, at_fields, at_ident, at_identPattern, at_lambda, at_tvlist, at_typeapp, AST::child(), AST::children, cl_convert_ast(), cl_rewrite_captured_idents(), CLOSEALL, findusedef(), AST::fqn, AST::genSym(), TvPrinter::getAllTvarStrings(), HOISTALL, ID_IS_GLOBAL, id_value, FQName::ident, AST::identType, AST::loc, NULL_MODE, AST::PrettyPrint(), AST::s, SHAPDEBUG, AST::symbolDef, AST::symType, tvlist, and AST::Use().
Definition at line 783 of file stale/Clconv.cxx.
References AST::addChild(), assert(), AST::astType, at_constraints, at_deref, at_dup, at_ident, at_identPattern, at_lambda, at_let, at_letbinding, at_letbindings, AST::child(), AST::children, cl_heapify(), collectHeapifiedArgs(), AST::fqn, ID_IS_CAPTURED, ID_IS_CLOSED, ID_NEEDS_HEAPIFY, FQName::ident, AST::loc, AST::s, and SHAPDEBUG.
Definition at line 517 of file stale/Clconv.cxx.
References AST::addChild(), AST::astType, at_ident, at_select, AST::children, cl_rewrite_captured_idents(), ID_IS_CLOSED, and AST::loc.
| static void clearusedef | ( | AST * | ast | ) | [static] |
Mark all defining occurrences that are closed over so that we can later rewrite them.
Definition at line 88 of file stale/Clconv.cxx.
References AST::children, clearusedef(), ID_IS_CAPTURED, ID_IS_CLOSED, and ID_NEEDS_HEAPIFY.
Definition at line 751 of file stale/Clconv.cxx.
References assert(), AST::astType, at_ident, AST::child(), AST::children, ID_IS_CAPTURED, and ID_NEEDS_HEAPIFY.
Referenced by cl_heapify().
| static void findusedef | ( | AST * | topAst, | |
| AST * | ast, | |||
| const int | mode, | |||
| CVector< AST * > * | boundVars, | |||
| CVector< AST * > * | freeVars | |||
| ) | [static] |
Mark all defining occurrences that are closed over so that we can later rewrite them.
Definition at line 101 of file stale/Clconv.cxx.
References agt_category, agt_CompilationUnit, agt_definition, agt_eform, agt_expr, agt_fielditem, agt_if_definition, agt_literal, agt_ow, agt_qtype, agt_tc_definition, agt_tvar, agt_type, agt_type_definition, agt_value_definition, agt_var, assert(), AST::astType, at_and, at_AnyGroup, at_apply, at_argVec, at_array, at_array_nth, at_arrayType, at_begin, at_boolLiteral, at_charLiteral, at_cond, at_cond_leg, at_cond_legs, at_constraints, at_constructor, at_constructors, at_container, 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_dup, at_exceptionType, at_field, at_fields, at_fill, at_floatLiteral, at_fn, at_fnargVec, at_frameBindings, at_ident, at_identList, at_identPattern, at_if, at_ifident, at_import, at_interface, at_intLiteral, at_lambda, at_let, at_letbinding, at_letbindings, at_letrec, at_letStar, at_localFrame, at_method_decl, at_method_decls, at_module, at_mutableType, at_Null, at_opaqueCat, at_or, at_otherwise, at_primaryType, at_provide, at_qualType, at_select, at_setbang, at_stringLiteral, at_struct_apply, at_suspend, at_tcapp, at_tcdecls, at_throw, at_tvlist, at_tyfn, at_typeapp, at_ucon_apply, at_unit, at_usesel, at_vector, at_vector_nth, at_vectorType, AST::children, findusedef(), AST::fqn, ID_IS_CAPTURED, ID_IS_CLOSED, ID_NEEDS_HEAPIFY, lbs, LOCAL_MODE, markRecBound(), NULL_MODE, SHAPDEBUG, AST::symbolDef, TYPE_MODE, and USE_MODE.
| static void markRecBound | ( | AST * | ast | ) | [static] |
Definition at line 75 of file stale/Clconv.cxx.
References AST::astType, at_ident, and AST::children.
Referenced by findusedef().
1.4.7