diff --git a/example/ex1/ex1.cpp b/example/ex1/ex1.cpp index f5eb1d1d..cc642dcb 100644 --- a/example/ex1/ex1.cpp +++ b/example/ex1/ex1.cpp @@ -56,18 +56,18 @@ int main() { using xo::scope; using xo::jit::MachPipeline; - using xo::ast::make_constant; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; - using xo::ast::make_apply; - using xo::ast::make_var; - using xo::ast::make_lambda; + using xo::scm::make_constant; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; + using xo::scm::make_apply; + using xo::scm::make_var; + using xo::scm::make_lambda; using xo::reflect::Reflect; using xo::xtag; using std::cerr; using std::endl; - //using xo::ast::make_constant; + //using xo::scm::make_constant; static llvm::ExitOnError llvm_exit_on_err; diff --git a/example/ex2_jit/ex2_jit.cpp b/example/ex2_jit/ex2_jit.cpp index dc948afb..b0f32643 100644 --- a/example/ex2_jit/ex2_jit.cpp +++ b/example/ex2_jit/ex2_jit.cpp @@ -47,18 +47,18 @@ main() { using xo::scope; using xo::jit::MachPipeline; using xo::jit::activation_record; - using xo::ast::make_constant; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; - using xo::ast::make_apply; - using xo::ast::make_var; - using xo::ast::make_lambda; + using xo::scm::make_constant; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; + using xo::scm::make_apply; + using xo::scm::make_var; + using xo::scm::make_lambda; using xo::reflect::Reflect; using xo::xtag; using std::cerr; using std::endl; - //using xo::ast::make_constant; + //using xo::scm::make_constant; static llvm::ExitOnError llvm_exit_on_err; diff --git a/include/xo/jit/MachPipeline.hpp b/include/xo/jit/MachPipeline.hpp index 9839ebe3..829bd646 100644 --- a/include/xo/jit/MachPipeline.hpp +++ b/include/xo/jit/MachPipeline.hpp @@ -56,13 +56,13 @@ namespace xo { **/ class MachPipeline : public ref::Refcount { public: - using Expression = xo::ast::Expression; - using Lambda = xo::ast::Lambda; - using GlobalEnv = xo::ast::GlobalEnv; + using Expression = xo::scm::Expression; + using Lambda = xo::scm::Lambda; + using GlobalEnv = xo::scm::GlobalEnv; using TypeDescr = xo::reflect::TypeDescr; using ExecutionSession = llvm::orc::ExecutionSession; using DataLayout = llvm::DataLayout; - //using ConstantInterface = xo::ast::ConstantInterface; + //using ConstantInterface = xo::scm::ConstantInterface; public: /* tracking KaleidoscopeJIT::Create() here.. */ @@ -109,8 +109,8 @@ namespace xo { * @c llvm::Type instances are *immortal* (llvm interns them into opaque global lookup tables) **/ llvm::Type * codegen_type(TypeDescr td); - llvm::Value * codegen_constant(bp expr); - llvm::Function * codegen_primitive(bp expr); + llvm::Value * codegen_constant(bp expr); + llvm::Function * codegen_primitive(bp expr); /** like @ref codegen_primitive , but create wrapper function that accepts (and discards) * environment pointer as first argument. @@ -118,7 +118,7 @@ namespace xo { * Implementation consists of tail call to natural primitive, that skips the unused * environment pointer **/ - llvm::Function * codegen_primitive_wrapper(bp expr, + llvm::Function * codegen_primitive_wrapper(bp expr, llvm::IRBuilder<> & ir_builder); /** Generate closure for invoking a primitive function. @@ -126,17 +126,17 @@ namespace xo { * to support function-pointer-like behavior for a target function * that may resolve to primitive-or-lambda at runtime **/ - llvm::Value * codegen_primitive_closure(bp expr, + llvm::Value * codegen_primitive_closure(bp expr, llvm::IRBuilder<> & ir_builder); - llvm::Value * codegen_apply(bp expr, + llvm::Value * codegen_apply(bp expr, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); /* NOTE: codegen_lambda() needs to be reentrant too. * for example can have a lambda in apply position. */ - llvm::Function * codegen_lambda_decl(bp expr); - llvm::Function * codegen_lambda_defn(bp expr, llvm::IRBuilder<> & ir_builder); + llvm::Function * codegen_lambda_decl(bp expr); + llvm::Function * codegen_lambda_defn(bp expr, llvm::IRBuilder<> & ir_builder); /** Generate closure for invoking a lambda (user-defined function). * See @ref MachPipeline::codegen_apply for invocation * Same ABI as @ref MachPipeline::codegen_primitive_closure @@ -147,13 +147,13 @@ namespace xo { * @ref MachPipeline::codegen_toplevel and friends are responsible for * assembling and propagating this. **/ - llvm::Value * codegen_lambda_closure(bp lambda, + llvm::Value * codegen_lambda_closure(bp lambda, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); - llvm::Value * codegen_variable(bp var, + llvm::Value * codegen_variable(bp var, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); - llvm::Value * codegen_ifexpr(bp ifexpr, + llvm::Value * codegen_ifexpr(bp ifexpr, llvm::Value * envptr, llvm::IRBuilder<> & ir_builder); diff --git a/include/xo/jit/activation_record.hpp b/include/xo/jit/activation_record.hpp index ff59e9bf..ae834986 100644 --- a/include/xo/jit/activation_record.hpp +++ b/include/xo/jit/activation_record.hpp @@ -17,7 +17,7 @@ namespace xo { namespace jit { - /** analagous to xo::ast::binding_path, + /** analagous to xo::scm::binding_path, * but with locations renumbered to include only vars that belong to an explict runtime * environment object; in other words we exclude vars with stack-only storage **/ @@ -119,7 +119,7 @@ namespace xo { **/ class activation_record { public: - using Lambda = xo::ast::Lambda; + using Lambda = xo::scm::Lambda; using TypeDescr = xo::reflect::TypeDescr; public: diff --git a/include/xo/jit/type2llvm.hpp b/include/xo/jit/type2llvm.hpp index f0efc87f..7801309f 100644 --- a/include/xo/jit/type2llvm.hpp +++ b/include/xo/jit/type2llvm.hpp @@ -20,8 +20,8 @@ namespace xo { **/ struct type2llvm { public: - using FunctionInterface = xo::ast::FunctionInterface; - using Lambda = xo::ast::Lambda; + using FunctionInterface = xo::scm::FunctionInterface; + using Lambda = xo::scm::Lambda; using TypeDescr = xo::reflect::TypeDescr; public: diff --git a/src/jit/MachPipeline.cpp b/src/jit/MachPipeline.cpp index 85fcc7e6..462ed4a4 100644 --- a/src/jit/MachPipeline.cpp +++ b/src/jit/MachPipeline.cpp @@ -7,17 +7,17 @@ #include namespace xo { - using xo::ast::exprtype; - using xo::ast::Expression; - using xo::ast::ConstantInterface; - //using xo::ast::FunctionInterface; - using xo::ast::PrimitiveInterface; - using xo::ast::Lambda; - using xo::ast::Variable; - using xo::ast::Apply; - using xo::ast::IfExpr; - using xo::ast::GlobalEnv; - using xo::ast::llvmintrinsic; + using xo::scm::exprtype; + using xo::scm::Expression; + using xo::scm::ConstantInterface; + //using xo::scm::FunctionInterface; + using xo::scm::PrimitiveInterface; + using xo::scm::Lambda; + using xo::scm::Variable; + using xo::scm::Apply; + using xo::scm::IfExpr; + using xo::scm::GlobalEnv; + using xo::scm::llvmintrinsic; using xo::reflect::Reflect; using xo::reflect::StructMember; using xo::reflect::TypeDescr; @@ -369,7 +369,7 @@ namespace xo { } /*codegen_primitive_wrapper*/ llvm::Value * - MachPipeline::codegen_primitive_closure(bp expr, + MachPipeline::codegen_primitive_closure(bp expr, llvm::IRBuilder<> & ir_builder) { constexpr bool c_debug_flag = true; @@ -435,7 +435,7 @@ namespace xo { /* we don't need any special checking here. * already know (from xo-level checking) that pointer has the right type. * - * Specifically, xo::ast::Apply::make() requires the expression in function position + * Specifically, xo::scm::Apply::make() requires the expression in function position * have suitable function type. * * Now: we have an llvm::Value (fn_value) representing the pointer. @@ -1026,7 +1026,7 @@ namespace xo { */ /* WIP. STRATEGY: - * - xo::ast::ClosureExpr (an expression that generates a closure) + * - xo::scm::ClosureExpr (an expression that generates a closure) * closure = {lambda, env} * * - pass 1: diff --git a/src/jit/MachPipeline.new.cpp b/src/jit/MachPipeline.new.cpp index c4faff4a..7a03e4a0 100644 --- a/src/jit/MachPipeline.new.cpp +++ b/src/jit/MachPipeline.new.cpp @@ -4,16 +4,16 @@ #include namespace xo { - using xo::ast::exprtype; - using xo::ast::Expression; - using xo::ast::ConstantInterface; - //using xo::ast::FunctionInterface; - using xo::ast::PrimitiveInterface; - using xo::ast::Lambda; - using xo::ast::Variable; - using xo::ast::Apply; - using xo::ast::IfExpr; - using xo::ast::llvmintrinsic; + using xo::scm::exprtype; + using xo::scm::Expression; + using xo::scm::ConstantInterface; + //using xo::scm::FunctionInterface; + using xo::scm::PrimitiveInterface; + using xo::scm::Lambda; + using xo::scm::Variable; + using xo::scm::Apply; + using xo::scm::IfExpr; + using xo::scm::llvmintrinsic; using xo::reflect::Reflect; using xo::reflect::StructMember; using xo::reflect::TypeDescr; @@ -465,7 +465,7 @@ namespace xo { /* we don't need any special checking here. * already know (from xo-level checking) that pointer has the right type. * - * Specifically, xo::ast::Apply::make() requires the expression in function position + * Specifically, xo::scm::Apply::make() requires the expression in function position * have suitable function type. * * Now: we have an llvm::Value (fn_value) representing the pointer. diff --git a/src/jit/MachPipeline.orig.cpp b/src/jit/MachPipeline.orig.cpp index 69cf0d02..786ca581 100644 --- a/src/jit/MachPipeline.orig.cpp +++ b/src/jit/MachPipeline.orig.cpp @@ -4,16 +4,16 @@ #include namespace xo { - using xo::ast::exprtype; - using xo::ast::Expression; - using xo::ast::ConstantInterface; - //using xo::ast::FunctionInterface; - using xo::ast::PrimitiveInterface; - using xo::ast::Lambda; - using xo::ast::Variable; - using xo::ast::Apply; - using xo::ast::IfExpr; - using xo::ast::llvmintrinsic; + using xo::scm::exprtype; + using xo::scm::Expression; + using xo::scm::ConstantInterface; + //using xo::scm::FunctionInterface; + using xo::scm::PrimitiveInterface; + using xo::scm::Lambda; + using xo::scm::Variable; + using xo::scm::Apply; + using xo::scm::IfExpr; + using xo::scm::llvmintrinsic; using xo::reflect::Reflect; using xo::reflect::StructMember; using xo::reflect::TypeDescr; @@ -465,7 +465,7 @@ namespace xo { /* we don't need any special checking here. * already know (from xo-level checking) that pointer has the right type. * - * Specifically, xo::ast::Apply::make() requires the expression in function position + * Specifically, xo::scm::Apply::make() requires the expression in function position * have suitable function type. * * Now: we have an llvm::Value (fn_value) representing the pointer. diff --git a/utest/MachPipeline.test.cpp b/utest/MachPipeline.test.cpp index 5cf81227..f615427a 100644 --- a/utest/MachPipeline.test.cpp +++ b/utest/MachPipeline.test.cpp @@ -10,13 +10,13 @@ namespace xo { using xo::jit::MachPipeline; - using xo::ast::make_apply; - using xo::ast::make_var; - using xo::ast::make_primitive; - using xo::ast::llvmintrinsic; - using xo::ast::Expression; - using xo::ast::Lambda; - using xo::ast::exprtype; + using xo::scm::make_apply; + using xo::scm::make_var; + using xo::scm::make_primitive; + using xo::scm::llvmintrinsic; + using xo::scm::Expression; + using xo::scm::Lambda; + using xo::scm::exprtype; using xo::reflect::Reflect; using xo::reflect::reflect_struct; using xo::ref::brw;