fix windows compilation and move windows pragma in a dedicaced file 60/15260/1
Antoine ELIAS [Mon, 22 Sep 2014 09:36:11 +0000 (11:36 +0200)]
Change-Id: I3c888e64d8e1dbf522fce5c4915c898c3b8de305

scilab/modules/ast/ast.vcxproj
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/includes/analysis/AnalysisVisitor.hxx
scilab/modules/ast/src/cpp/jit/JITVisitor.cpp
scilab/modules/ast/src/cpp/jit/jit_windows.cpp [new file with mode: 0644]

index 728e9c9..458a415 100644 (file)
@@ -458,6 +458,7 @@ lib /DEF:"$(ProjectDir)fileio_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
     <ClCompile Include="src\cpp\jit\JITValues.cpp" />
     <ClCompile Include="src\cpp\jit\JITVisitor.cpp" />
     <ClCompile Include="src\cpp\jit\jit_operations.cpp" />
+    <ClCompile Include="src\cpp\jit\jit_windows.cpp" />
     <ClCompile Include="src\cpp\operations\interface_addition.cpp" />
     <ClCompile Include="src\cpp\operations\operations.cpp" />
     <ClCompile Include="src\cpp\operations\types_addition.cpp" />
index d052d64..beb71bb 100644 (file)
     <ClCompile Include="src\cpp\operations\types_or.cpp">
       <Filter>Source Files\operations</Filter>
     </ClCompile>
+    <ClCompile Include="src\cpp\jit\jit_windows.cpp">
+      <Filter>Source Files\jit</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
index bdbfac6..4ba6ad1 100644 (file)
@@ -109,7 +109,7 @@ public:
 
     double get_duration() const
     {
-        return (double)std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count() * 1e-9d;
+        return (double)std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count() * 1e-9;
     }
 
 private:
index 50bb6e6..92a0773 100644 (file)
 #include "JITVisitor.hxx"
 #include "jit_operations.hxx"
 
-#ifdef _MSC_VER
-
-//#pragma comment(lib, ".lib")
-#pragma comment(lib, "LLVMLinker.lib")
-#pragma comment(lib, "LLVMNVPTXCodeGen.lib")
-#pragma comment(lib, "LLVMNVPTXDesc.lib")
-#pragma comment(lib, "LLVMNVPTXInfo.lib")
-#pragma comment(lib, "LLVMObjCARCOpts.lib")
-#pragma comment(lib, "LLVMObject.lib")
-#pragma comment(lib, "LLVMOption.lib")
-#pragma comment(lib, "LLVMPowerPCAsmParser.lib")
-#pragma comment(lib, "LLVMPowerPCAsmPrinter.lib")
-#pragma comment(lib, "LLVMPowerPCCodeGen.lib")
-#pragma comment(lib, "LLVMPowerPCDesc.lib")
-#pragma comment(lib, "LLVMPowerPCInfo.lib")
-#pragma comment(lib, "LLVMR600AsmPrinter.lib")
-#pragma comment(lib, "LLVMR600CodeGen.lib")
-#pragma comment(lib, "LLVMR600Desc.lib")
-#pragma comment(lib, "LLVMR600Info.lib")
-#pragma comment(lib, "LLVMRuntimeDyld.lib")
-#pragma comment(lib, "LLVMScalarOpts.lib")
-#pragma comment(lib, "LLVMSelectionDAG.lib")
-#pragma comment(lib, "LLVMSparcCodeGen.lib")
-#pragma comment(lib, "LLVMSparcDesc.lib")
-#pragma comment(lib, "LLVMSparcInfo.lib")
-#pragma comment(lib, "LLVMSupport.lib")
-#pragma comment(lib, "LLVMSystemZAsmParser.lib")
-#pragma comment(lib, "LLVMSystemZAsmPrinter.lib")
-#pragma comment(lib, "LLVMSystemZCodeGen.lib")
-#pragma comment(lib, "LLVMSystemZDesc.lib")
-#pragma comment(lib, "LLVMSystemZDisassembler.lib")
-#pragma comment(lib, "LLVMSystemZInfo.lib")
-#pragma comment(lib, "LLVMTableGen.lib")
-#pragma comment(lib, "LLVMTarget.lib")
-#pragma comment(lib, "LLVMTransformUtils.lib")
-#pragma comment(lib, "LLVMVectorize.lib")
-#pragma comment(lib, "LLVMX86AsmParser.lib")
-#pragma comment(lib, "LLVMX86AsmPrinter.lib")
-#pragma comment(lib, "LLVMX86CodeGen.lib")
-#pragma comment(lib, "LLVMX86Desc.lib")
-#pragma comment(lib, "LLVMX86Disassembler.lib")
-#pragma comment(lib, "LLVMX86Info.lib")
-#pragma comment(lib, "LLVMX86Utils.lib")
-#pragma comment(lib, "LLVMXCoreAsmPrinter.lib")
-#pragma comment(lib, "LLVMXCoreCodeGen.lib")
-#pragma comment(lib, "LLVMXCoreDesc.lib")
-#pragma comment(lib, "LLVMXCoreDisassembler.lib")
-#pragma comment(lib, "LLVMXCoreInfo.lib")
-#pragma comment(lib, "LLVMipa.lib")
-#pragma comment(lib, "LLVMipo.lib")
-#pragma comment(lib, "LTO.lib")
-#pragma comment(lib, "gtest.lib")
-#pragma comment(lib, "gtest_main.lib")
-#pragma comment(lib, "LLVMAArch64AsmParser.lib")
-#pragma comment(lib, "LLVMAArch64AsmPrinter.lib")
-#pragma comment(lib, "LLVMAArch64CodeGen.lib")
-#pragma comment(lib, "LLVMAArch64Desc.lib")
-#pragma comment(lib, "LLVMAArch64Disassembler.lib")
-#pragma comment(lib, "LLVMAArch64Info.lib")
-#pragma comment(lib, "LLVMAArch64Utils.lib")
-#pragma comment(lib, "LLVMARMAsmParser.lib")
-#pragma comment(lib, "LLVMARMAsmPrinter.lib")
-#pragma comment(lib, "LLVMARMCodeGen.lib")
-#pragma comment(lib, "LLVMARMDesc.lib")
-#pragma comment(lib, "LLVMARMDisassembler.lib")
-#pragma comment(lib, "LLVMARMInfo.lib")
-#pragma comment(lib, "LLVMAnalysis.lib")
-#pragma comment(lib, "LLVMAsmParser.lib")
-#pragma comment(lib, "LLVMAsmPrinter.lib")
-#pragma comment(lib, "LLVMBitReader.lib")
-#pragma comment(lib, "LLVMBitWriter.lib")
-#pragma comment(lib, "LLVMCodeGen.lib")
-#pragma comment(lib, "LLVMCore.lib")
-#pragma comment(lib, "LLVMCppBackendCodeGen.lib")
-#pragma comment(lib, "LLVMCppBackendInfo.lib")
-#pragma comment(lib, "LLVMDebugInfo.lib")
-#pragma comment(lib, "LLVMExecutionEngine.lib")
-#pragma comment(lib, "LLVMHexagonAsmPrinter.lib")
-#pragma comment(lib, "LLVMHexagonCodeGen.lib")
-#pragma comment(lib, "LLVMHexagonDesc.lib")
-#pragma comment(lib, "LLVMHexagonInfo.lib")
-#pragma comment(lib, "LLVMIRReader.lib")
-#pragma comment(lib, "LLVMInstCombine.lib")
-#pragma comment(lib, "LLVMInstrumentation.lib")
-#pragma comment(lib, "LLVMInterpreter.lib")
-#pragma comment(lib, "LLVMJIT.lib")
-#pragma comment(lib, "LLVMLTO.lib")
-#pragma comment(lib, "LLVMLinker.lib")
-#pragma comment(lib, "LLVMMC.lib")
-#pragma comment(lib, "LLVMMCDisassembler.lib")
-#pragma comment(lib, "LLVMMCJIT.lib")
-#pragma comment(lib, "LLVMMCParser.lib")
-#pragma comment(lib, "LLVMMSP430AsmPrinter.lib")
-#pragma comment(lib, "LLVMMSP430CodeGen.lib")
-#pragma comment(lib, "LLVMMSP430Desc.lib")
-#pragma comment(lib, "LLVMMSP430Info.lib")
-#pragma comment(lib, "LLVMMipsAsmParser.lib")
-#pragma comment(lib, "LLVMMipsAsmPrinter.lib")
-#pragma comment(lib, "LLVMMipsCodeGen.lib")
-#pragma comment(lib, "LLVMMipsDesc.lib")
-#pragma comment(lib, "LLVMMipsDisassembler.lib")
-#pragma comment(lib, "LLVMMipsInfo.lib")
-#pragma comment(lib, "LLVMNVPTXAsmPrinter.lib")
-
-#endif
-
 namespace jit
 {
 const bool JITVisitor::__init__ = InitializeLLVM();
diff --git a/scilab/modules/ast/src/cpp/jit/jit_windows.cpp b/scilab/modules/ast/src/cpp/jit/jit_windows.cpp
new file mode 100644 (file)
index 0000000..97ca3b0
--- /dev/null
@@ -0,0 +1,102 @@
+#ifdef _MSC_VER
+#pragma comment(lib, "LLVMLinker.lib")
+#pragma comment(lib, "LLVMNVPTXCodeGen.lib")
+#pragma comment(lib, "LLVMNVPTXDesc.lib")
+#pragma comment(lib, "LLVMNVPTXInfo.lib")
+#pragma comment(lib, "LLVMObjCARCOpts.lib")
+#pragma comment(lib, "LLVMObject.lib")
+#pragma comment(lib, "LLVMOption.lib")
+#pragma comment(lib, "LLVMPowerPCAsmParser.lib")
+#pragma comment(lib, "LLVMPowerPCAsmPrinter.lib")
+#pragma comment(lib, "LLVMPowerPCCodeGen.lib")
+#pragma comment(lib, "LLVMPowerPCDesc.lib")
+#pragma comment(lib, "LLVMPowerPCInfo.lib")
+#pragma comment(lib, "LLVMR600AsmPrinter.lib")
+#pragma comment(lib, "LLVMR600CodeGen.lib")
+#pragma comment(lib, "LLVMR600Desc.lib")
+#pragma comment(lib, "LLVMR600Info.lib")
+#pragma comment(lib, "LLVMRuntimeDyld.lib")
+#pragma comment(lib, "LLVMScalarOpts.lib")
+#pragma comment(lib, "LLVMSelectionDAG.lib")
+#pragma comment(lib, "LLVMSparcCodeGen.lib")
+#pragma comment(lib, "LLVMSparcDesc.lib")
+#pragma comment(lib, "LLVMSparcInfo.lib")
+#pragma comment(lib, "LLVMSupport.lib")
+#pragma comment(lib, "LLVMSystemZAsmParser.lib")
+#pragma comment(lib, "LLVMSystemZAsmPrinter.lib")
+#pragma comment(lib, "LLVMSystemZCodeGen.lib")
+#pragma comment(lib, "LLVMSystemZDesc.lib")
+#pragma comment(lib, "LLVMSystemZDisassembler.lib")
+#pragma comment(lib, "LLVMSystemZInfo.lib")
+#pragma comment(lib, "LLVMTableGen.lib")
+#pragma comment(lib, "LLVMTarget.lib")
+#pragma comment(lib, "LLVMTransformUtils.lib")
+#pragma comment(lib, "LLVMVectorize.lib")
+#pragma comment(lib, "LLVMX86AsmParser.lib")
+#pragma comment(lib, "LLVMX86AsmPrinter.lib")
+#pragma comment(lib, "LLVMX86CodeGen.lib")
+#pragma comment(lib, "LLVMX86Desc.lib")
+#pragma comment(lib, "LLVMX86Disassembler.lib")
+#pragma comment(lib, "LLVMX86Info.lib")
+#pragma comment(lib, "LLVMX86Utils.lib")
+#pragma comment(lib, "LLVMXCoreAsmPrinter.lib")
+#pragma comment(lib, "LLVMXCoreCodeGen.lib")
+#pragma comment(lib, "LLVMXCoreDesc.lib")
+#pragma comment(lib, "LLVMXCoreDisassembler.lib")
+#pragma comment(lib, "LLVMXCoreInfo.lib")
+#pragma comment(lib, "LLVMipa.lib")
+#pragma comment(lib, "LLVMipo.lib")
+#pragma comment(lib, "LTO.lib")
+#pragma comment(lib, "gtest.lib")
+#pragma comment(lib, "gtest_main.lib")
+#pragma comment(lib, "LLVMAArch64AsmParser.lib")
+#pragma comment(lib, "LLVMAArch64AsmPrinter.lib")
+#pragma comment(lib, "LLVMAArch64CodeGen.lib")
+#pragma comment(lib, "LLVMAArch64Desc.lib")
+#pragma comment(lib, "LLVMAArch64Disassembler.lib")
+#pragma comment(lib, "LLVMAArch64Info.lib")
+#pragma comment(lib, "LLVMAArch64Utils.lib")
+#pragma comment(lib, "LLVMARMAsmParser.lib")
+#pragma comment(lib, "LLVMARMAsmPrinter.lib")
+#pragma comment(lib, "LLVMARMCodeGen.lib")
+#pragma comment(lib, "LLVMARMDesc.lib")
+#pragma comment(lib, "LLVMARMDisassembler.lib")
+#pragma comment(lib, "LLVMARMInfo.lib")
+#pragma comment(lib, "LLVMAnalysis.lib")
+#pragma comment(lib, "LLVMAsmParser.lib")
+#pragma comment(lib, "LLVMAsmPrinter.lib")
+#pragma comment(lib, "LLVMBitReader.lib")
+#pragma comment(lib, "LLVMBitWriter.lib")
+#pragma comment(lib, "LLVMCodeGen.lib")
+#pragma comment(lib, "LLVMCore.lib")
+#pragma comment(lib, "LLVMCppBackendCodeGen.lib")
+#pragma comment(lib, "LLVMCppBackendInfo.lib")
+#pragma comment(lib, "LLVMDebugInfo.lib")
+#pragma comment(lib, "LLVMExecutionEngine.lib")
+#pragma comment(lib, "LLVMHexagonAsmPrinter.lib")
+#pragma comment(lib, "LLVMHexagonCodeGen.lib")
+#pragma comment(lib, "LLVMHexagonDesc.lib")
+#pragma comment(lib, "LLVMHexagonInfo.lib")
+#pragma comment(lib, "LLVMIRReader.lib")
+#pragma comment(lib, "LLVMInstCombine.lib")
+#pragma comment(lib, "LLVMInstrumentation.lib")
+#pragma comment(lib, "LLVMInterpreter.lib")
+#pragma comment(lib, "LLVMJIT.lib")
+#pragma comment(lib, "LLVMLTO.lib")
+#pragma comment(lib, "LLVMMC.lib")
+#pragma comment(lib, "LLVMMCDisassembler.lib")
+#pragma comment(lib, "LLVMMCJIT.lib")
+#pragma comment(lib, "LLVMMCParser.lib")
+#pragma comment(lib, "LLVMMSP430AsmPrinter.lib")
+#pragma comment(lib, "LLVMMSP430CodeGen.lib")
+#pragma comment(lib, "LLVMMSP430Desc.lib")
+#pragma comment(lib, "LLVMMSP430Info.lib")
+#pragma comment(lib, "LLVMMipsAsmParser.lib")
+#pragma comment(lib, "LLVMMipsAsmPrinter.lib")
+#pragma comment(lib, "LLVMMipsCodeGen.lib")
+#pragma comment(lib, "LLVMMipsDesc.lib")
+#pragma comment(lib, "LLVMMipsDisassembler.lib")
+#pragma comment(lib, "LLVMMipsInfo.lib")
+#pragma comment(lib, "LLVMNVPTXAsmPrinter.lib")
+
+#endif