Merge remote-tracking branch 'origin/master' into jit 76/17276/1
Antoine ELIAS [Thu, 1 Oct 2015 10:14:21 +0000 (12:14 +0200)]
Conflicts:
scilab/configure
scilab/configure.ac
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/javasci/Makefile.in

Change-Id: Iccbf285918bdeadd8d48baceb8d0e372bd41ab3b

96 files changed:
1  2 
scilab/Makefile.am
scilab/Makefile.in
scilab/configure.ac
scilab/contrib/Makefile.in
scilab/desktop/Makefile.in
scilab/desktop/images/icons/Makefile.in
scilab/modules/Makefile.in
scilab/modules/action_binding/Makefile.in
scilab/modules/api_scilab/Makefile.in
scilab/modules/arnoldi/Makefile.in
scilab/modules/ast/Makefile.am
scilab/modules/ast/Makefile.in
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/includes/jit/JITVisitor.hxx
scilab/modules/ast/includes/jit/blocks/ShortcutEval.hxx
scilab/modules/ast/includes/types/internal.hxx
scilab/modules/ast/src/cpp/ast/prettyprintvisitor.cpp
scilab/modules/ast/src/cpp/types/internal.cpp
scilab/modules/atoms/Makefile.in
scilab/modules/boolean/Makefile.in
scilab/modules/cacsd/Makefile.in
scilab/modules/call_scilab/Makefile.in
scilab/modules/commons/Makefile.in
scilab/modules/compatibility_functions/Makefile.in
scilab/modules/completion/Makefile.in
scilab/modules/console/Makefile.in
scilab/modules/core/Makefile.in
scilab/modules/core/includes/machine.h.in
scilab/modules/data_structures/Makefile.in
scilab/modules/demo_tools/Makefile.in
scilab/modules/development_tools/Makefile.in
scilab/modules/development_tools/src/fake/Makefile.in
scilab/modules/differential_equations/Makefile.in
scilab/modules/dynamic_link/Makefile.in
scilab/modules/elementary_functions/Makefile.in
scilab/modules/external_objects/Makefile.in
scilab/modules/external_objects_java/Makefile.in
scilab/modules/fftw/Makefile.in
scilab/modules/fileio/Makefile.in
scilab/modules/functions/Makefile.in
scilab/modules/functions/sci_gateway/cpp/sci_execstr.cpp
scilab/modules/functions/sci_gateway/cpp/sci_jit.cpp
scilab/modules/functions/sci_gateway/cpp/sci_testAnalysis.cpp
scilab/modules/functions_manager/Makefile.in
scilab/modules/genetic_algorithms/Makefile.in
scilab/modules/graph/Makefile.in
scilab/modules/graphic_export/Makefile.in
scilab/modules/graphic_objects/Makefile.in
scilab/modules/graphics/Makefile.in
scilab/modules/gui/Makefile.in
scilab/modules/hdf5/Makefile.in
scilab/modules/helptools/Makefile.in
scilab/modules/history_browser/Makefile.in
scilab/modules/history_manager/Makefile.in
scilab/modules/integer/Makefile.in
scilab/modules/interpolation/Makefile.in
scilab/modules/io/Makefile.in
scilab/modules/jvm/Makefile.in
scilab/modules/linear_algebra/Makefile.in
scilab/modules/localization/Makefile.in
scilab/modules/m2sci/Makefile.in
scilab/modules/matio/Makefile.in
scilab/modules/mexlib/Makefile.in
scilab/modules/modules_manager/Makefile.in
scilab/modules/mpi/Makefile.in
scilab/modules/optimization/Makefile.in
scilab/modules/output_stream/Makefile.in
scilab/modules/overloading/Makefile.in
scilab/modules/parallel/Makefile.in
scilab/modules/parameters/Makefile.in
scilab/modules/polynomials/Makefile.in
scilab/modules/prebuildjava/Makefile.in
scilab/modules/preferences/Makefile.in
scilab/modules/randlib/Makefile.in
scilab/modules/renderer/Makefile.in
scilab/modules/scicos/Makefile.in
scilab/modules/scicos_blocks/Makefile.in
scilab/modules/scinotes/Makefile.in
scilab/modules/signal_processing/Makefile.in
scilab/modules/simulated_annealing/Makefile.in
scilab/modules/sound/Makefile.in
scilab/modules/sparse/Makefile.in
scilab/modules/special_functions/Makefile.in
scilab/modules/spreadsheet/Makefile.in
scilab/modules/statistics/Makefile.in
scilab/modules/string/Makefile.in
scilab/modules/tclsci/Makefile.in
scilab/modules/threads/Makefile.in
scilab/modules/time/Makefile.in
scilab/modules/types/Makefile.in
scilab/modules/ui_data/Makefile.in
scilab/modules/umfpack/Makefile.in
scilab/modules/windows_tools/Makefile.in
scilab/modules/xcos/Makefile.in
scilab/modules/xml/Makefile.in

Simple merge
Simple merge
@@@ -2380,14 -2377,11 +2383,19 @@@ echo "  GIWS generation disabled
  fi
  
  echo ""
 +echo "LLVM configuration:"
 +echo "  LLVM_VERSION ....... = $LLVM_VERSION"
 +echo "  LLVM_CONFIG_BIN .... = $LLVM_CONFIG_BIN"
 +echo "  LLVM_INCLUDE ....... = $LLVM_INCLUDE"
 +echo "  LLVM_CPPFLAGS ...... = $LLVM_CPPFLAGS"
 +echo "  LLVM_LDFLAGS ....... = $LLVM_LDFLAGS"
 +echo "  LLVM_LIBS .......... = $LLVM_LIBS"
 +
+ echo "Valgrind configuration:"
+ echo "  VALGRIND_CFLAGS .... = $VALGRIND_CFLAGS"
+ echo "  VALGRIND_LIBS ...... = $VALGRIND_LIBS"
+ echo ""
  echo ""
  echo "Libtool config:"
  echo "  objext .............. = $objext"
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
      <ClInclude Include="includes\exps\tableintselectexp.hxx">
        <Filter>Header Files\exps</Filter>
      </ClInclude>
 +    <ClInclude Include="includes\jit\BaseFunctions.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\BaseFunctionsAgain.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\BaseFunctionsMacros.h">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\BaseFunctionsMacros2.h">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\BaseFunctionsMacros3.h">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\Cast.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\Disassembler.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\funs_interf.h">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITArrayof.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITArrayofs.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITScalar.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITScalars.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITScilabVal.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITVal.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\JITVisitor.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\MemoryManager.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\ScilabJITEventListener.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\ScilabJITTraits.hxx">
 +      <Filter>Header Files\jit</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\addition.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\and.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\binary.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\binary_functors.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\elem_functions.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\equal.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\exponentiation.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\functors.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\greater_or_eq.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\greater_than.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\ldivision.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\lower_or_eq.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\lower_than.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\not_equal.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\or.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\product.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\rdivision.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\subtraction.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\tools.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\base\vectorization.hxx">
 +      <Filter>Header Files\jit\base</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\blocks\ShortcutEval.hxx">
 +      <Filter>Header Files\jit\blocks</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\FunCallInitializer.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\FunctionSignature.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITAbs.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITAngle.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITBinOp.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITBinOpCall.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITCall.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITCall1.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITCeil.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITConj.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITFloor.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITGatewayCall.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITImag.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITImult.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITLog.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITOptimizedCall1.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITReal.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITRound.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITShortcutBinOpCall.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITSign.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITSize.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITSize1.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITSqrt.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITUnaryOpCall.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITZeros.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
 +    <ClInclude Include="includes\jit\calls\JITTicToc.hxx">
 +      <Filter>Header Files\jit\calls</Filter>
 +    </ClInclude>
+     <ClInclude Include="includes\ast\breakpoint.hxx">
+       <Filter>Header Files\ast</Filter>
+     </ClInclude>
+     <ClInclude Include="includes\ast\consoledebugger.hxx">
+       <Filter>Header Files\ast</Filter>
+     </ClInclude>
+     <ClInclude Include="includes\ast\debuggervisitor.hxx">
+       <Filter>Header Files\ast</Filter>
+     </ClInclude>
+     <ClInclude Include="includes\ast\debugmanager.hxx">
+       <Filter>Header Files\ast</Filter>
+     </ClInclude>
+     <ClInclude Include="includes\ast\abstractdebugger.hxx">
+       <Filter>Header Files\ast</Filter>
+     </ClInclude>
+     <ClInclude Include="includes\ast\prettyprintvisitor.hxx">
+       <Filter>Header Files\ast</Filter>
+     </ClInclude>
    </ItemGroup>
    <ItemGroup>
-     <ClCompile Include="src\cpp\ast\debugvisitor.cpp">
-       <Filter>Source Files\ast</Filter>
-     </ClCompile>
      <ClCompile Include="src\cpp\ast\expHistory.cpp">
        <Filter>Source Files\ast</Filter>
      </ClCompile>
      <ClCompile Include="src\cpp\analysis\VisitVarDec.cpp">
        <Filter>Source Files\analysis</Filter>
      </ClCompile>
 +    <ClCompile Include="src\cpp\jit\BaseFunctions1.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\BaseFunctions2.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\FunctionSignature.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\jit_windows.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITAbs.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITAddition.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITAngle.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITBinOpCall.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITBreakContinueExps.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITCall.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITCallExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITCeil.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITComparisons.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITComplexVal.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITConj.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITEquality.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITFloor.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITForExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITIfExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITImag.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITImult.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITIntSelectExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITLog.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITMultiplication.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITNegation.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITNotEquality.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITOpExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITOpposite.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITOptimizedCall1.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITPower.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITRDivision.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITReal.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITRound.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITSelectExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITShortcutBinOpCall.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITShortcutOps.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITSign.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITSize.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITSqrt.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITSubtraction.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITUnaryOpCall.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITVisitor.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITWhileExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITZeros.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\MemoryManager.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\ScilabJITEventListener.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\ShortcutEval.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITMemfillExp.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
 +    <ClCompile Include="src\cpp\jit\JITTicToc.cpp">
 +      <Filter>Source Files\jit</Filter>
 +    </ClCompile>
+     <ClCompile Include="src\cpp\ast\consoledebugger.cpp">
+       <Filter>Source Files\ast</Filter>
+     </ClCompile>
+     <ClCompile Include="src\cpp\ast\debuggervisitor.cpp">
+       <Filter>Source Files\ast</Filter>
+     </ClCompile>
+     <ClCompile Include="src\cpp\ast\debugmanager.cpp">
+       <Filter>Source Files\ast</Filter>
+     </ClCompile>
+     <ClCompile Include="src\cpp\ast\prettyprintvisitor.cpp">
+       <Filter>Source Files\ast</Filter>
+     </ClCompile>
    </ItemGroup>
  </Project>
index 366d915,0000000..d4967df
mode 100644,000000..100644
--- /dev/null
@@@ -1,755 -1,0 +1,760 @@@
 +/*
 + *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 + *  Copyright (C) 2014 - Scilab Enterprises - Calixte DENIZET
 + *
 + *  This file must be used under the terms of the CeCILL.
 + *  This source file is licensed as described in the file COPYING, which
 + *  you should have received as part of this distribution.  The terms
 + *  are also available at
 + *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 + *
 + */
 +
 +#ifndef __JIT_VISITOR_HXX__
 +#define __JIT_VISITOR_HXX__
 +
 +#include <complex>
 +#include <map>
 +#include <memory>
 +#include <queue>
 +#include <stack>
 +#include <unordered_map>
 +#include <unordered_set>
 +#include <vector>
 +
 +//#include "llvm/IR/Verifier.h"
 +#include "llvm/ExecutionEngine/GenericValue.h"
 +#include "llvm/ExecutionEngine/Interpreter.h"
 +#include "llvm/ExecutionEngine/MCJIT.h"
 +#include "llvm/IR/Constants.h"
 +#include "llvm/IR/DataLayout.h"
 +#include "llvm/IR/DerivedTypes.h"
 +#include "llvm/IR/Instructions.h"
 +#include "llvm/IR/LLVMContext.h"
 +#include "llvm/IR/IRBuilder.h"
 +#include "llvm/IR/Module.h"
 +#include "llvm/Support/TargetSelect.h"
 +#include "llvm/Target/TargetMachine.h"
 +#include "llvm/Target/TargetOptions.h"
 +#include "llvm/Support/TargetRegistry.h"
 +//#include "llvm/Support/raw_ostream.h"
 +
 +#include "llvm/IR/LegacyPassManager.h"
 +
 +#include "llvm/Analysis/Passes.h"
 +#include "llvm/Transforms/Scalar.h"
 +#include "llvm/Transforms/Vectorize.h"
 +
 +#include "llvm/ADT/Triple.h"
 +#include "llvm/Support/Host.h"
 +
 +#include "visitor.hxx"
 +#include "allexp.hxx"
 +#include "allvar.hxx"
 +#include "AnalysisVisitor.hxx"
 +
 +#include "calls/JITBinOpCall.hxx"
 +#include "calls/JITUnaryOpCall.hxx"
 +#include "calls/JITShortcutBinOpCall.hxx"
 +
 +#include "dynlib_ast.h"
 +
 +namespace jit
 +{
 +
 +#if defined(LLVM_VERSION_MAJOR) && LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7
 +typedef llvm::legacy::FunctionPassManager LLVM_FunctionPassManager;
 +#else
 +typedef llvm::FunctionPassManager LLVM_FunctionPassManager;
 +#endif
 +
 +class JITScilabVal;
 +typedef std::shared_ptr<JITScilabVal> JITScilabPtr;
 +
 +class EXTERN_AST JITVisitor : public ast::ConstVisitor, public analysis::FBlockEmittedListener
 +{
 +
 +    struct OutContainer
 +    {
 +        union Value
 +        {
 +            int8_t i8;
 +            int16_t i16;
 +            int32_t i32;
 +            int64_t i64;
 +            uint8_t ui8;
 +            uint16_t ui16;
 +            uint32_t ui32;
 +            uint64_t ui64;
 +            double dbl;
 +            int32_t boolean;
 +            double cpx[2];
 +            void * ptr;
 +        };
 +
 +        analysis::TIType::Type type;
 +        Value data;
 +        uint64_t rows;
 +        uint64_t cols;
 +        uint64_t refcount;
 +
 +        OutContainer(const analysis::TIType::Type _type) : type(_type) { }
 +    };
 +
 +    typedef std::map<symbol::Symbol, JITScilabPtr> JITSymbolMap;
 +
 +    static const bool __init__;
 +
 +    const analysis::AnalysisVisitor & analysis;
 +
 +    std::string err;
 +    llvm::LLVMContext & context;
 +    llvm::Module * module;
 +    llvm::TargetMachine * target;
 +    llvm::ExecutionEngine * engine;
 +    llvm::legacy::PassManager MPM;
 +    llvm::legacy::FunctionPassManager FPM;
 +    llvm::Function * function;
 +    llvm::IRBuilder<> builder;
 +    llvm::Type * uintptrType;
 +    llvm::Type * dblTy;
 +    llvm::Type * int8Ty;
 +    llvm::Type * int16Ty;
 +    llvm::Type * int32Ty;
 +    llvm::Type * int64Ty;
 +    llvm::Type * int1Ty;
 +    llvm::Type * voidTy;
 +    llvm::Type * dblPtrTy;
 +    llvm::Type * int8PtrTy;
 +    llvm::Type * int16PtrTy;
 +    llvm::Type * int32PtrTy;
 +    llvm::Type * int64PtrTy;
 +    llvm::Type * int1PtrTy;
 +    llvm::BasicBlock * entryBlock;
 +    llvm::BasicBlock * mainBlock;
 +    llvm::BasicBlock * returnBlock;
 +    llvm::BasicBlock * errorBlock;
 +
 +    JITScilabPtr _result;
 +    JITScilabPtr cpx_rvalue;
 +    std::vector<JITScilabPtr> multipleLHS;
 +    JITSymbolMap variables;
 +    std::vector<JITScilabPtr> temps;
 +    std::unordered_map<std::string, llvm::GlobalVariable *> globals;
 +    std::stack<std::pair<llvm::BasicBlock * , llvm::BasicBlock *>> blocks;
 +    std::queue<analysis::FunctionBlock *> fblocks;
 +    std::unordered_map<std::string, analysis::FunctionBlock *> mapNameFBlock;
 +    std::unordered_map<std::string, llvm::Value *> specialVars;
 +
 +public:
 +
 +    JITAddition addition;
 +    JITSubtraction subtraction;
 +    JITOpposite opposite;
 +    JITMultiplication multiplication;
 +    JITRDivision rdivision;
 +    JITPower power;
 +    JITEquality equality;
 +    JITNotEquality not_equality;
 +    JITLowerThan lower_than;
 +    JITGreaterThan greater_than;
 +    JITLowerOrEq lower_or_eq;
 +    JITGreaterOrEq greater_or_eq;
 +    JITNegation negation;
 +    JITShortcutEq shortcut_eq;
 +    JITShortcutNe shortcut_ne;
 +    JITShortcutLt shortcut_lt;
 +    JITShortcutGt shortcut_gt;
 +    JITShortcutLe shortcut_le;
 +    JITShortcutGe shortcut_ge;
 +
 +    JITVisitor(const analysis::AnalysisVisitor & _analysis);
 +    virtual ~JITVisitor();
 +
++    JITVisitor* clone()
++    {
++        return new JITVisitor(analysis);
++    }
++
 +    void run();
 +
 +    void dump() const;
 +
 +    template<typename T>
 +    inline llvm::Type * getTy() const
 +    {
 +        if (std::is_const<T>::value)
 +        {
 +            return getTy<typename std::remove_const<T>::type>();
 +        }
 +        else if (std::is_pointer<T>::value && std::is_pointer<typename std::remove_pointer<T>::type>::value)
 +        {
 +            return llvm::PointerType::getUnqual(getTy<typename std::remove_pointer<T>::type>());
 +        }
 +
 +        return nullptr;
 +    }
 +
 +    inline llvm::Type * getTy(const analysis::TIType & ty, const unsigned char level = 0) const
 +    {
 +        llvm::Type * lty;
 +
 +        switch (ty.type)
 +        {
 +            case analysis::TIType::BOOLEAN:
 +                lty = int32Ty;
 +                break;
 +            case analysis::TIType::DOUBLE:
 +                lty = dblTy;
 +                break;
 +            case analysis::TIType::INT16:
 +                lty = int16Ty;
 +                break;
 +            case analysis::TIType::INT32:
 +                lty = int32Ty;
 +                break;
 +            case analysis::TIType::INT64:
 +                lty = int64Ty;
 +                break;
 +            case analysis::TIType::INT8:
 +                lty = int8Ty;
 +                break;
 +            case analysis::TIType::UINT16:
 +                lty = int16Ty;
 +                break;
 +            case analysis::TIType::UINT32:
 +                lty = int32Ty;
 +                break;
 +            case analysis::TIType::UINT64:
 +                lty = int64Ty;
 +                break;
 +            case analysis::TIType::UINT8:
 +                lty = int8Ty;
 +                break;
 +            default:
 +                lty = voidTy;
 +        }
 +
 +        for (unsigned char i = 0; i < level; ++i)
 +        {
 +            lty = llvm::PointerType::getUnqual(lty);
 +        }
 +
 +        return lty;
 +    }
 +
 +    inline unsigned int getTySizeInBytes(const llvm::Type * ty) const
 +    {
 +        return ty->isPointerTy() ? sizeof(void *) : (ty->getPrimitiveSizeInBits() / 8);
 +    }
 +
 +    inline unsigned int getTySizeInBytes(const llvm::Value * v) const
 +    {
 +        return getTySizeInBytes(v->getType());
 +    }
 +
 +    template<typename T>
 +    inline unsigned int getTySizeInBytes() const
 +    {
 +        return getTy<T>()->isPointerTy() ? sizeof(void *) : (getTy<T>()->getPrimitiveSizeInBits() / 8);
 +    }
 +
 +    inline llvm::LLVMContext & getContext()
 +    {
 +        return context;
 +    }
 +
 +    inline llvm::Module & getModule()
 +    {
 +        return *module;
 +    }
 +
 +    inline llvm::IRBuilder<> & getBuilder()
 +    {
 +        return builder;
 +    }
 +
 +    inline llvm::Function & getFunction()
 +    {
 +        return *function;
 +    }
 +
 +    inline llvm::Type * getPtrTy()
 +    {
 +        return uintptrType;
 +    }
 +
 +    inline llvm::Value * getPointer(void * const ptr)
 +    {
 +        llvm::Value * v = llvm::ConstantInt::get(uintptrType, reinterpret_cast<uintptr_t>(ptr));
 +        v = builder.CreateIntToPtr(v, llvm::PointerType::getInt8PtrTy(context));
 +
 +        return v;
 +    }
 +
 +    inline llvm::Value * getPointer(void * const ptr, llvm::Type * const type)
 +    {
 +        llvm::Value * v = llvm::ConstantInt::get(uintptrType, reinterpret_cast<uintptr_t>(ptr));
 +        v = builder.CreateIntToPtr(v, type);
 +
 +        return v;
 +    }
 +
 +    template<typename T>
 +    inline llvm::Value * getValue(const T val, const bool allocated = false, const std::string & name = "")
 +    {
 +        if (allocated)
 +        {
 +            return getAlloca<T>(val, name);
 +        }
 +        else
 +        {
 +            return getConstant<T>(val, name);
 +        }
 +    }
 +
 +    inline llvm::Value * getValue(llvm::Value * val, const bool allocated = false, const std::string & name = "")
 +    {
 +        if (allocated)
 +        {
 +            return getAlloca(val, name);
 +        }
 +        else
 +        {
 +            return val;
 +        }
 +    }
 +
 +    inline llvm::Value * getBool(const bool b)
 +    {
 +        return b ? llvm::ConstantInt::getTrue(context) : llvm::ConstantInt::getFalse(context);
 +    }
 +
 +
 +    template<typename T, bool isPtr> struct __getConstant;
 +    template<typename T> struct __getConstant<T, true>
 +    {
 +        inline static llvm::Value * get(JITVisitor * jit, const T val, const std::string & name = "")
 +        {
 +            return jit->getPointer((void *)val, jit->getTy<T>());
 +        }
 +    };
 +
 +    template<typename T> struct __getConstant<T, false>
 +    {
 +        inline static llvm::Value * get(JITVisitor * jit, const T val, const std::string & name = "")
 +        {
 +            return llvm::ConstantInt::get(jit->getTy<T>(), uint64_t(val), !std::is_unsigned<T>::value);
 +        }
 +    };
 +
 +    template<typename T>
 +    inline llvm::Value * getConstant(const T val, const std::string & name = "")
 +    {
 +        return __getConstant<T, std::is_pointer<T>::value>::get(this, val, name);
 +    }
 +
 +    template<typename T>
 +    inline llvm::Value * getAlloca(const T val, const std::string & name = "")
 +    {
 +        llvm::AllocaInst * alloca = builder.CreateAlloca(getTy<T>(), nullptr, name);
 +        alloca->setAlignment(sizeof(T));
 +        builder.CreateAlignedStore(getConstant<T>(val), alloca, sizeof(T));
 +
 +        return alloca;
 +    }
 +
 +    template<typename T>
 +    inline llvm::Value * getAlloca(const std::string & name = "")
 +    {
 +        llvm::AllocaInst * alloca = builder.CreateAlloca(getTy<T>(), nullptr, name);
 +        alloca->setAlignment(sizeof(T));
 +
 +        return alloca;
 +    }
 +
 +    inline llvm::Value * getAlloca(llvm::Value * val, llvm::Type * type, int type_size, const std::string & name = "")
 +    {
 +        llvm::AllocaInst * alloca = builder.CreateAlloca(type, nullptr, name);
 +        alloca->setAlignment(type_size);
 +        builder.CreateAlignedStore(val, alloca, type_size);
 +
 +        return alloca;
 +    }
 +
 +    inline llvm::Value * getAlloca(llvm::Value * val, const std::string & name = "")
 +    {
 +        return getAlloca(val, val->getType(), getTySizeInBytes(val->getType()), name);
 +    }
 +
 +    inline JITScilabPtr & getResult()
 +    {
 +        return  _result;
 +    }
 +
 +    inline void setResult(JITScilabPtr & val)
 +    {
 +        _result = val;
 +    }
 +
 +    inline void setResult(JITScilabPtr && val)
 +    {
 +        _result = val;
 +    }
 +
 +    inline JITScilabPtr & getTemp(const int32_t id)
 +    {
 +        if (id >= 0 && id < temps.size())
 +        {
 +            return temps[id];
 +        }
 +        else
 +        {
 +            assert(false && " Bad temp id...");
 +        }
 +    }
 +
 +    inline void addGlobal(const std::string & name, llvm::GlobalVariable * gv)
 +    {
 +        globals.emplace(name, gv);
 +    }
 +
 +    inline llvm::GlobalVariable * getGlobal(const std::string & name)
 +    {
 +        auto i = globals.find(name);
 +        if (i == globals.end())
 +        {
 +            return nullptr;
 +        }
 +        return i->second;
 +    }
 +
 +    inline llvm::Value * getSpecialVar(const std::string & name) const
 +    {
 +        auto i = specialVars.find(name);
 +        if (i != specialVars.end())
 +        {
 +            return i->second;
 +        }
 +        return nullptr;
 +    }
 +
 +    inline void addSpecialVar(const std::string & name, llvm::Value * val)
 +    {
 +        specialVars.emplace(name, val);
 +    }
 +
 +    inline llvm::BasicBlock * getEntryBlock()
 +    {
 +        return entryBlock;
 +    }
 +
 +    void makeCall(const std::wstring & name, const std::vector<types::InternalType *> & in, std::vector<types::InternalType *> & out);
 +
 +    JITScilabPtr getScalar(llvm::Value * const value, const analysis::TIType::Type ty, const bool alloc = false, const std::string & name = "");
 +    JITScilabPtr getScalar(llvm::Value * const re, llvm::Value * const im, const analysis::TIType::Type ty, const bool alloc = false, const std::string & name = "");
 +    JITScilabPtr & getCpxRValue();
 +    JITScilabPtr getScalar(const analysis::TIType::Type ty, const bool isAnInt, const std::string & name);
 +    JITScilabPtr getScalar(const analysis::TypeLocal & ty, const std::string & name);
 +    JITScilabPtr getMatrix(llvm::Value * const value, llvm::Value * const rows, llvm::Value * const cols, llvm::Value * const refCount, const analysis::TIType::Type ty, const bool alloc, const std::string & name);
 +    JITScilabPtr getMatrix(const analysis::TIType::Type ty, const std::string & name, const bool init = false);
 +    JITScilabPtr getMatrix(const analysis::TypeLocal & ty, const std::string & name, const bool init = false);
 +
 +    llvm::FunctionType * getFunctionType(const analysis::TIType & out, const std::vector<const analysis::TIType *> & types);
 +
 +private:
 +
 +    inline std::vector<JITScilabPtr> & getLHSContainer()
 +    {
 +        return multipleLHS;
 +    }
 +
 +    inline void callThrow(const char * msg)
 +    {
 +        /*llvm::Value * _msg = builder.CreateGlobalStringPtr(llvm::StringRef(msg));
 +          llvm::Value * v = llvm::ConstantInt::get(uintptrType, reinterpret_cast<uintptr_t>(&jit::jit_throw));
 +          v = builder.CreateIntToPtr(v, getLLVMPtrFuncTy<void, char *>(context));
 +          builder.CreateCall(v, _msg);*/
 +    }
 +
 +    template<typename T, typename U>
 +    inline void makeArg(std::vector<llvm::Value *> & args, types::GenericType * pGT)
 +    {
 +        T * x = (T *)static_cast<U *>(pGT)->get();
 +        int64_t r = static_cast<U *>(pGT)->getRows();
 +        int64_t c = static_cast<U *>(pGT)->getCols();
 +        int64_t refc = static_cast<U *>(pGT)->getRef();
 +        args.emplace_back(getValue(x));
 +        args.emplace_back(getValue(r));
 +        args.emplace_back(getValue(c));
 +        args.emplace_back(getValue(refc));
 +    }
 +
 +    void visit(ast::CallExp & e, const unsigned int lhs);
 +    void visit(const ast::CallExp & e);
 +
 +    void visit(const ast::SimpleVar & e);
 +    void visit(const ast::DollarVar & e);
 +    void visit(const ast::ColonVar & e);
 +    void visit(const ast::ArrayListVar & e);
 +    void visit(const ast::DoubleExp & e);
 +    void visit(const ast::BoolExp & e);
 +    void visit(const ast::StringExp & e);
 +    void visit(const ast::NilExp & e);
 +    void visit(const ast::CellCallExp & e);
 +    void visit(const ast::OpExp & e);
 +    void visit(const ast::LogicalOpExp & e);
 +    void visit(const ast::AssignExp & e);
 +    void visit(const ast::IfExp & e);
 +    void visit(const ast::WhileExp & e);
 +    void visit(const ast::ForExp & e);
 +    void visit(const ast::BreakExp & e);
 +    void visit(const ast::ContinueExp & e);
 +    void visit(const ast::TryCatchExp & e);
 +    void visit(const ast::SelectExp & e);
 +    void visit(const ast::IntSelectExp & e);
 +    void visit(const ast::SmallIntSelectExp & e);
 +    void visit(const ast::TableIntSelectExp & e);
 +    void visit(const ast::MapIntSelectExp & e);
 +    void visit(const ast::CaseExp & e);
 +    void visit(const ast::ReturnExp & e);
 +    void visit(const ast::FieldExp & e);
 +    void visit(const ast::NotExp & e);
 +    void visit(const ast::TransposeExp & e);
 +    void visit(const ast::MatrixExp & e);
 +    void visit(const ast::MatrixLineExp & e);
 +    void visit(const ast::CellExp & e);
 +    void visit(const ast::SeqExp & e);
 +    void visit(const ast::ArrayListExp & e);
 +    void visit(const ast::AssignListExp & e);
 +    void visit(const ast::VarDec & e);
 +    void visit(const ast::FunctionDec & e);
 +    void visit(const ast::ListExp & e);
 +    void visit(const ast::MemfillExp & e);
 +
 +    void visit(const ast::OptimizedExp & e) { }
 +    void visit(const ast::DAXPYExp & e) { }
 +    void visit(const ast::StringSelectExp & e) { }
 +    void visit(const ast::CommentExp & e) { }
 +
 +    void action(analysis::FunctionBlock & fblock);
 +    llvm::Type * getType(const analysis::TIType::Type ty, const bool scalar);
 +    llvm::Value * getPtrFromIndex(const ast::CallExp & ce);
 +    void runOptimizationPasses();
 +    void compileModule();
 +    void cloneSyms(const ast::Exp & e);
 +    void makeSwitch(const ast::IntSelectExp & e, const std::map<int64_t, ast::Exp *> & map);
 +    void CreateBr(llvm::BasicBlock * bb);
 +    void closeEntryBlock();
 +    void initPassManagers();
 +
 +    static bool InitializeLLVM();
 +    static llvm::Type * getPtrAsIntTy(llvm::Module & module, llvm::LLVMContext & ctxt);
 +    static llvm::ExecutionEngine * InitializeEngine(llvm::Module * module, llvm::TargetMachine ** target);
 +
 +};
 +
 +template<>
 +inline llvm::Value * JITVisitor::getConstant<double>(const double val, const std::string & name)
 +{
 +    return llvm::ConstantFP::get(context, llvm::APFloat(val));
 +}
 +
 +template<>
 +inline llvm::Value * JITVisitor::getConstant<std::complex<double>>(const std::complex<double> val, const std::string & name)
 +{
 +    llvm::Constant * re = llvm::ConstantFP::get(context, llvm::APFloat(val.real()));
 +    llvm::Constant * im = llvm::ConstantFP::get(context, llvm::APFloat(val.imag()));
 +    llvm::Constant * arr[] = { re, im };
 +    return llvm::ConstantVector::get(llvm::ArrayRef<llvm::Constant *>(arr));
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<double>() const
 +{
 +    return dblTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<bool>() const
 +{
 +    return int1Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int8_t>() const
 +{
 +    return int8Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int16_t>() const
 +{
 +    return int16Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int32_t>() const
 +{
 +    return int32Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int64_t>() const
 +{
 +    return int64Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint8_t>() const
 +{
 +    return int8Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint16_t>() const
 +{
 +    return int16Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint32_t>() const
 +{
 +    return int32Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint64_t>() const
 +{
 +    return int64Ty;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<void>() const
 +{
 +    return voidTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<double *>() const
 +{
 +    return dblPtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<bool *>() const
 +{
 +    return int1PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int8_t *>() const
 +{
 +    return int8PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int16_t *>() const
 +{
 +    return int16PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int32_t *>() const
 +{
 +    return int32PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<int64_t *>() const
 +{
 +    return int64PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint8_t *>() const
 +{
 +    return int8PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint16_t *>() const
 +{
 +    return int16PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint32_t *>() const
 +{
 +    return int32PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<uint64_t *>() const
 +{
 +    return int64PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const double *>() const
 +{
 +    return dblPtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const bool *>() const
 +{
 +    return int1PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const int8_t *>() const
 +{
 +    return int8PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const int16_t *>() const
 +{
 +    return int16PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const int32_t *>() const
 +{
 +    return int32PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const int64_t *>() const
 +{
 +    return int64PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const uint8_t *>() const
 +{
 +    return int8PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const uint16_t *>() const
 +{
 +    return int16PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const uint32_t *>() const
 +{
 +    return int32PtrTy;
 +}
 +
 +template<>
 +inline llvm::Type * JITVisitor::getTy<const uint64_t *>() const
 +{
 +    return int64PtrTy;
 +}
 +
 +} // namespace jit
 +
 +#endif // __JIT_VISITOR_HXX__
index 9daa336,0000000..2cdaabd
mode 100644,000000..100644
--- /dev/null
@@@ -1,241 -1,0 +1,246 @@@
 +/*
 + *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 + *  Copyright (C) 2015 - Scilab Enterprises - Calixte DENIZET
 + *
 + *  This file must be used under the terms of the CeCILL.
 + *  This source file is licensed as described in the file COPYING, which
 + *  you should have received as part of this distribution.  The terms
 + *  are also available at
 + *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 + *
 + */
 +
 +#ifndef __SHORTCUT_EVAL_HXX__
 +#define __SHORTCUT_EVAL_HXX__
 +
 +#include "JITVisitor.hxx"
 +
 +namespace jit
 +{
 +    /**
 +     * The goal of this class is to generate IR for a shortcut evaluation of conditions in 'if'
 +     * or 'while' blocks.
 +     * For example if we have something like:
 +     *   if ((A & B) | (C | D)) then P else Q end
 +     * then we should have something like:
 +     * 
 +     * i1 t = test A
 +     * br t L2, L1
 +     * L2:
 +     *   i1 t = test B
 +     *   br t P, L1
 +     * L1:
 +     *   i1 t = test C
 +     *   br t P, L3
 +     * L3:
 +     *   i1 t = test D
 +     *   br t P, Q
 +     * P:
 +     *   ...
 +     * Q:
 +     *   ...
 +     *
 +     * To improve performance, we could test A in using a shortcut evaluation, for example:
 +     *   if (A == 0) then ...
 +     * it is not required to create a boolean matrix containing all the a_{ij} == 0 and make a 'and' on its elements,
 +     * we can just break the loop when a a_{ij} != 0.
 +     */
 +    class ShortcutEval : public ast::ConstVisitor, public analysis::Chrono
 +    {
 +
 +        JITVisitor & jit;
 +        llvm::BasicBlock * trueBlock;
 +        llvm::BasicBlock * falseBlock;
 +      JITScilabPtr _result;
 +
 +    public:
 +
 +        ShortcutEval(JITVisitor & _jit, llvm::BasicBlock * t, llvm::BasicBlock * f) : jit(_jit), trueBlock(t), falseBlock(f) { }
 +
++        ShortcutEval* clone()
++        {
++            return new ShortcutEval(jit, trueBlock, falseBlock);
++        }
++
 +      inline JITScilabPtr & getResult()
 +        {
 +            return  _result;
 +        }
 +
 +    private:
 +
 +        inline void setResult(JITScilabPtr & val)
 +        {
 +            _result = val;
 +        }
 +
 +        inline void setResult(JITScilabPtr && val)
 +        {
 +            _result = val;
 +        }
 +
 +        inline void setBlocks(llvm::BasicBlock * t, llvm::BasicBlock * f)
 +            {
 +                trueBlock = t;
 +                falseBlock = f;
 +            }
 +
 +        inline llvm::BasicBlock * getTrue()
 +            {
 +                return trueBlock;
 +            }
 +
 +        inline llvm::BasicBlock * getFalse()
 +            {
 +                return falseBlock;
 +            }
 +
 +    public:
 +
 +        void visit(const ast::SimpleVar & e);
 +        void visit(const ast::NotExp & e);
 +        void visit(const ast::TransposeExp & e);
 +        void visit(const ast::MatrixExp & e);
 +        void visit(const ast::CellExp & e);
 +        void visit(const ast::CallExp & e);
 +        void visit(const ast::OpExp & e);
 +        void visit(const ast::LogicalOpExp & e);
 +        void visit(const ast::DoubleExp & e);
 +        void visit(const ast::BoolExp & e);
 +
 +      void visit(const ast::ListExp & e)
 +          {
 +          }
 +
 +        void visit(const ast::IfExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::DollarVar & e)
 +            {
 +            }
 +
 +        void visit(const ast::ColonVar & e)
 +            {
 +            }
 +
 +        void visit(const ast::ArrayListVar & e)
 +            {
 +            }
 +
 +        void visit(const ast::StringExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::CommentExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::NilExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::CellCallExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::AssignExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::WhileExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::ForExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::BreakExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::ContinueExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::TryCatchExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::SelectExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::CaseExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::ReturnExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::FieldExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::MatrixLineExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::SeqExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::ArrayListExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::AssignListExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::VarDec & e)
 +            {
 +            }
 +
 +        void visit(const ast::FunctionDec & e)
 +            {
 +            }
 +
 +        void visit(const ast::OptimizedExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::MemfillExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::DAXPYExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::IntSelectExp & e)
 +            {
 +            }
 +
 +        void visit(const ast::StringSelectExp & e)
 +            {
 +            }
 +
 +    private:
 +
 +      JITScilabPtr toBool(JITScilabPtr & L, const analysis::TIType & Ltype);
 +      llvm::Value * toBoolS(JITScilabPtr & L, const analysis::TIType & Ltype);
 +      llvm::Value * toBoolM(JITScilabPtr & L, const analysis::TIType & Ltype);
 +
 +      inline void defaultVisit(const ast::Exp & e)
 +          {
 +              e.accept(jit);
 +              setResult(toBool(getResult(), e.getDecorator().getResult().getType()));
 +          }
 +    };
 +
 +} // namespace analysis
 +
 +#endif // __SHORTCUT_EVAL_HXX__
@@@ -222,9 -222,10 +222,9 @@@ void PrettyPrintVisitor::print(const Te
      {
          *ostr << L' ' << cdeco << deco << NORMAL;
      }
 -    *ostr << std::endl;
  }
  
- void DebugVisitor::print(const TermColor& c, const std::wstring & str, const Exp & e)
+ void PrettyPrintVisitor::print(const TermColor& c, const std::wstring & str, const Exp & e)
  {
      std::wstring expType;
      expType = e.getTypeString();
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -195,7 -191,7 +191,7 @@@ types::Function::ReturnValue sci_execst
      {
          //analysis::AnalysisVisitor analysis;
          //pExp->accept(analysis);
--        //ast::DebugVisitor debugMe;
++        //ast::PrettyPrintVisitor debugMe;
          //pExp->accept(debugMe);
      }
  
index 37c7d71,0000000..49362dc
mode 100644,000000..100644
--- /dev/null
@@@ -1,97 -1,0 +1,96 @@@
 +/*
 +* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 +* Copyright (C) 2006 - INRIA - Antoine ELIAS
 +*
 +* This file must be used under the terms of the CeCILL.
 +* This source file is licensed as described in the file COPYING, which
 +* you should have received as part of this distribution.  The terms
 +* are also available at
 +* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 +*
 +*/
 +
 +#include <string.h>
 +
 +#include "AnalysisVisitor.hxx"
 +#include "JITVisitor.hxx"
 +
 +#include "parser.hxx"
 +#include "functions_gw.hxx"
 +#include "execvisitor.hxx"
- #include "mutevisitor.hxx"
- #include "debugvisitor.hxx"
++#include "prettyprintvisitor.hxx"
 +#include "printvisitor.hxx"
 +#include "visitor_common.hxx"
 +#include "scilabWrite.hxx"
 +#include "scilabexception.hxx"
 +#include "configvariable.hxx"
 +#include "context.hxx"
 +
 +#include <iostream>
 +#include <fstream>
 +#include <string>
 +
 +extern "C"
 +{
 +#include "Scierror.h"
 +#include "localization.h"
 +}
 +
 +/*--------------------------------------------------------------------------*/
 +types::Function::ReturnValue sci_jit(types::typed_list &in, int _iRetCount, types::typed_list &out)
 +{
 +    if (in.size() == 0)
 +    {
 +        Scierror(999, _("%s: Wrong number of input arguments: at least %d expected.\n"), "testJIT", 1);
 +        return types::Function::Error;
 +    }
 +
 +    // check that arguments are a string
 +    unsigned int i = 1;
 +    Location loc;
 +    ast::exps_t * args = new ast::exps_t();
 +    args->reserve(in.size() - 1);
 +    for (const auto arg : in)
 +    {
 +        if (!arg->isString() || arg->getAs<types::String>()->getSize() != 1)
 +        {
 +            Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), "testJIT", i);
 +            return types::Function::Error;
 +        }
 +        if (i > 1)
 +        {
 +            symbol::Symbol sym(arg->getAs<types::String>()->get(0));
 +            args->emplace_back(new ast::SimpleVar(loc, sym));
 +        }
 +        ++i;
 +    }
 +
 +    std::vector<types::InternalType *> _out;
 +    std::vector<types::InternalType *> _in;
 +    _in.reserve(args->size());
 +    for (ast::Exp * arg : *args)
 +    {
 +      types::InternalType * pIT = symbol::Context::getInstance()->get(static_cast<ast::SimpleVar *>(arg)->getSymbol());
 +      _in.push_back(pIT);
 +    }
 +
 +    const std::wstring name = in[0]->getAs<types::String>()->get(0);
 +    symbol::Symbol sym(name);
 +    ast::SimpleVar * var = new ast::SimpleVar(loc, sym);
 +    ast::CallExp ce(loc, *var, *args);
 +    
 +    analysis::AnalysisVisitor analysis;
 +    jit::JITVisitor jit(analysis);
 +
 +    analysis.registerFBlockEmittedListener(&jit);
 +
 +    ce.accept(analysis);
 +
 +    jit.makeCall(name, _in, _out);
 +    for (auto pIT : _out)
 +    {
 +      out.push_back(pIT);
 +    }
 +
 +    return types::Function::OK;
 +}
@@@ -100,7 -96,7 +96,7 @@@ types::Function::ReturnValue sci_testAn
      }
      out.push_back(pOut);
  
--    //ast::DebugVisitor debugMe;
++    //ast::PrettyPrintVisitor debugMe;
      //pExp->accept(debugMe);
  
      //ast::PrintVisitor printMe(std::wcout);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge