*.o
Makefile
+Makefile.*
src/tools/v4
udis86_itab.*
*.pyc
--- /dev/null
+LLVM_CONFIG=llvm-config
+# Pick up the qmake variable or environment variable for LLVM_INSTALL_DIR. If either was set, change the LLVM_CONFIG to use that.
+isEmpty(LLVM_INSTALL_DIR):LLVM_INSTALL_DIR=$$(LLVM_INSTALL_DIR)
+!isEmpty(LLVM_INSTALL_DIR):LLVM_CONFIG=$$LLVM_INSTALL_DIR/bin/llvm-config
+exists ($${LLVM_CONFIG}) {
+ CONFIG += llvm-libs
+ message("Found LLVM in $$LLVM_INSTALL_DIR")
+}
+
+llvm-libs {
+ win32 {
+ LLVM_INCLUDEPATH = $$LLVM_INSTALL_DIR/include
+# TODO: check if the next line is needed somehow for the llvm_runtime target.
+ LLVM_LIBS += -ladvapi32 -lshell32
+ }
+
+ unix {
+ LLVM_INCLUDEPATH = $$system($$LLVM_CONFIG --includedir)
+ LLVM_LIBDIR = $$system($$LLVM_CONFIG --libdir)
+ }
+
+ LLVM_DEFINES += __STDC_LIMIT_MACROS __STDC_CONSTANT_MACROS
+}
-
+include(llvm_installation.pri)
include(../3rdparty/masm/masm-defs.pri)
!llvm: DEFINES += QMLJS_NO_LLVM
CONFIG += internal_module
-LLVM_CONFIG=llvm-config
+include(v4.pri)
OBJECTS_DIR=.obj
#win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000 #TODO ??!
-
-# Pick up the qmake variable or environment variable for LLVM_INSTALL_DIR. If either was set, change the LLVM_CONFIG to use that.
-isEmpty(LLVM_INSTALL_DIR):LLVM_INSTALL_DIR=$$(LLVM_INSTALL_DIR)
-!isEmpty(LLVM_INSTALL_DIR):LLVM_CONFIG=$$LLVM_INSTALL_DIR/bin/llvm-config
-
!macx-clang*:LIBS += -rdynamic
SOURCES += \
qv4objectiterator.h \
qv4regexp.h
-llvm {
+llvm-libs {
SOURCES += \
qv4isel_llvm.cpp
LLVM_RUNTIME_BC = $$PWD/llvm_runtime.bc
DEFINES += LLVM_RUNTIME="\"\\\"$$LLVM_RUNTIME_BC\\\"\""
+DEFINES += QMLJS_WITH_LLVM
INCLUDEPATH += \
$$system($$LLVM_CONFIG --includedir)
GEN_LLVM_RUNTIME_FLAGS -= -pedantic
gen_llvm_runtime.target = llvm_runtime
-gen_llvm_runtime.commands = clang -O2 -emit-llvm -c $(INCPATH) $$GEN_LLVM_RUNTIME_FLAGS -DQMLJS_LLVM_RUNTIME llvm_runtime.cpp -o $$LLVM_RUNTIME_BC
-
+gen_llvm_runtime.commands = clang -O2 -emit-llvm -c -I$$PWD -I$$PWD/../3rdparty/masm $$join(QT.core.includes, " -I", "-I") $$GEN_LLVM_RUNTIME_FLAGS -DQMLJS_LLVM_RUNTIME llvm_runtime.cpp -o $$LLVM_RUNTIME_BC
}
# Use SSE2 floating point math on 32 bit instead of the default
include(moth/moth.pri)
include(../3rdparty/masm/masm.pri)
include(../3rdparty/double-conversion/double-conversion.pri)
-include(v4.pri)
**
****************************************************************************/
-#ifndef QMLJS_NO_LLVM
+#ifdef QMLJS_WITH_LLVM
# include "private/qv4_llvm_p.h"
-#endif
+#endif // QMLJS_WITH_LLVM
#include "private/debugging.h"
#include "private/qv4object.h"
}
}
-#ifndef QMLJS_NO_LLVM
+#ifdef QMLJS_WITH_LLVM
int executeLLVMCode(void *codePtr)
{
using namespace QQmlJS;
return EXIT_SUCCESS;
}
-
-#endif
+#endif // QMLJS_WITH_LLVM
int main(int argc, char *argv[])
use_llvm_jit
} mode = use_masm;
-#ifndef QMLJS_NO_LLVM
+#ifdef QMLJS_WITH_LLVM
QQmlJS::LLVMOutputType fileType = QQmlJS::LLVMOutputObject;
-#endif // QMLJS_NO_LLVM
+#endif // QMLJS_WITH_LLVM
bool enableDebugging = false;
if (!args.isEmpty()) {
args.removeFirst();
}
-#ifndef QMLJS_NO_LLVM
+#ifdef QMLJS_WITH_LLVM
if (args.first() == QLatin1String("--compile")) {
mode = use_llvm_compiler;
args.removeFirst();
mode = use_llvm_jit;
args.removeFirst();
}
-#endif // QMLJS_NO_LLVM
+#endif // QMLJS_WITH_LLVM
if (args.first() == QLatin1String("--help")) {
std::cerr << "Usage: v4 [|--debug|-d] [|--jit|--interpret|--compile|--aot|--llvm-jit] file..." << std::endl;
return EXIT_SUCCESS;
}
switch (mode) {
-#ifdef QMLJS_NO_LLVM
- case use_llvm_compiler:
- case use_llvm_runtime:
- case use_llvm_jit:
- std::cerr << "LLVM backend was not built, compiler is unavailable." << std::endl;
- return EXIT_FAILURE;
-#else // QMLJS_NO_LLVM
+#ifdef QMLJS_WITH_LLVM
case use_llvm_jit:
return compileFiles(args, QQmlJS::LLVMOutputJit);
case use_llvm_compiler:
return compileFiles(args, fileType);
case use_llvm_runtime:
return evaluateCompiledCode(args);
-#endif // QMLJS_NO_LLVM
+#else // !QMLJS_WITH_LLVM
+ case use_llvm_compiler:
+ case use_llvm_runtime:
+ case use_llvm_jit:
+ std::cerr << "LLVM backend was not built, compiler is unavailable." << std::endl;
+ return EXIT_FAILURE;
+#endif // QMLJS_WITH_LLVM
case use_masm:
case use_moth: {
QScopedPointer<QQmlJS::EvalISelFactory> iSelFactory;
include(../../src/v4/v4.pri)
+llvm-libs {
+ DEFINES += QMLJS_WITH_LLVM
+}
load(qt_tool)