3 #include <llvm/IR/Module.h> 4 #include <llvm/IR/IRBuilder.h> 5 #include <llvm/IR/Value.h> 6 #include <llvm/IR/LLVMContext.h> 7 #include <unordered_map> 33 std::unique_ptr<llvm::Module>
M;
47 std::unordered_map<std::string, llvm::Value*>
symbols;
Object * Obj
Object pointer.
std::unique_ptr< llvm::Module > M
The current module.
llvm::IRBuilder B
The IR builder, always set to the current insert point.
std::unordered_map< std::string, llvm::Value * > symbols
Symbols within this compilation context.
llvm::Value * lookupSymbolAddr(const std::string &str)
Returns the address of the specified symbol.
std::unordered_map< std::string, Obj * > SymbolTable
A symbol table stores the address of each allocation.
llvm::FunctionType * getClosureType(int bound, int args)
Get the type of a closure invoke function, for a closure with the specified number of instance variab...
Object *(* ClosureInvoke)(Closure *,...)
A compiled closure invoke function.
llvm::Type * ObjIntTy
The type of an integer the same size as an object pointer.
llvm::Type * SelTy
The type used for selectors.
llvm::Function * F
The function being compiled.
llvm::PointerType * ObjPtrTy
The type of a pointer to a MysoreScript object.
llvm::LLVMContext C
The LLVM context.
llvm::FunctionType * getMethodType(int ivars, int args)
Get the type of a method with the specified number of arguments, for an object with the specified num...
MysoreScript::ClosureInvoke compile()
At the end of compilation, generate code and return a function pointer.
Context(Interpreter::SymbolTable &g)
Construct a context, given a global symbol table from the interpreter.