From e7659fdd3d6edf6037ae0b72a4213bcdc3ff6c54 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 28 Sep 2013 14:31:57 +0200 Subject: [PATCH] JIT: Factorize the declaration and remove some comments Change-Id: I00c8672f8e21854d48239d9568debc9d4ba2cacd --- scilab/modules/jit/includes/JITvisitor.hxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/scilab/modules/jit/includes/JITvisitor.hxx b/scilab/modules/jit/includes/JITvisitor.hxx index 3267a77..56a7cf9 100644 --- a/scilab/modules/jit/includes/JITvisitor.hxx +++ b/scilab/modules/jit/includes/JITvisitor.hxx @@ -361,18 +361,16 @@ public: llvm::Value *pITR = result_get(); llvm::Value *pResult = NULL; + + llvm::Value * tmp = Builder->CreateAlloca(llvm::PointerType::getUnqual(TheModule->getTypeByName("class.types::Double"))); + switch (e.oper_get()) { case OpExp::plus : { - //%5 = call i32 @_Z17AddDoubleToDoublePN5types6DoubleES1_PS1_(%"class.types::Double"* %3, %"class.types::Double"* %4, %"class.types::Double"** %pdbl1) - // pResult = Builder->CreateFAdd(pITL, pITR, "OpExp::plus"); - - llvm::Value * tmp = Builder->CreateAlloca(llvm::PointerType::getUnqual(TheModule->getTypeByName("class.types::Double"))); Builder->CreateCall3(TheModule->getFunction("_Z17AddDoubleToDoublePN5types6DoubleES1_PS1_"), pITR, pITL, tmp); - pResult = Builder->CreateLoad(tmp); break; } case OpExp::minus : @@ -383,13 +381,8 @@ public: case OpExp::times : { - llvm::Value * tmp = Builder->CreateAlloca(llvm::PointerType::getUnqual(TheModule->getTypeByName("class.types::Double"))); - - //printf("%p \n",TheModule->getFunction("_Z17AddDoubleToDoublePN5types6DoubleES1_PS1_")); - Builder->CreateCall3(TheModule->getFunction("_Z22MultiplyDoubleByDoublePN5types6DoubleES1_PS1_"), pITR, pITL, tmp); - pResult = Builder->CreateLoad(tmp); break; } case OpExp::rdivide : @@ -449,6 +442,7 @@ public: break; } } + pResult = Builder->CreateLoad(tmp); if (pResult == NULL) { -- 1.7.9.5