diff options
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r-- | src/llvm.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp index cc4bf47..28d6f36 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -62,6 +62,7 @@ struct LLVMEngine : public Engine { void eraseFn(CEnv& cenv, CFunc f); CVal compileCall(CEnv& cenv, CFunc f, const ATuple* funcT, const vector<CVal>& args); + CVal compileCast(CEnv& cenv, CVal v, const AST* t); CVal compileCons(CEnv& cenv, const ATuple* type, CVal rtti, const vector<CVal>& fields); CVal compileDot(CEnv& cenv, CVal tup, int32_t index); CVal compileGlobalSet(CEnv& cenv, const string& s, CVal v, const AST* t); @@ -207,6 +208,12 @@ LLVMEngine::compileCall(CEnv& cenv, CFunc f, const ATuple* funcT, const vector<C } CVal +LLVMEngine::compileCast(CEnv& cenv, CVal v, const AST* t) +{ + return builder.CreateBitCast(llVal(v), llType(t), "cast"); +} + +CVal LLVMEngine::compileCons(CEnv& cenv, const ATuple* type, CVal rtti, const vector<CVal>& fields) { // Find size of memory required |