aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2012-10-12 13:45:35 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2012-10-12 14:25:06 +0200
commit84223345dc8286d733b08443d9a25d456e9a15ae (patch)
treead3854fda5e23e0bcb7f2f26e0cba14fed81a89e /main.cpp
parent54e5b42950c91ef0da46d6ab1f826afd9dad5276 (diff)
Fix LLVM build
Change-Id: I7ae00a5e90087182d9f7d939db0a036c120e3b9b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/main.cpp b/main.cpp
index c40e1d0ebb..c173f47f21 100644
--- a/main.cpp
+++ b/main.cpp
@@ -39,6 +39,25 @@
**
****************************************************************************/
+#ifndef QMLJS_NO_LLVM
+// These includes have to come first, because WTF/Platform.h defines some macros
+// with very unfriendly names that collide with class fields in LLVM.
+# include <llvm/PassManager.h>
+# include <llvm/Analysis/Passes.h>
+# include <llvm/Transforms/Scalar.h>
+# include <llvm/Transforms/IPO.h>
+# include <llvm/Assembly/PrintModulePass.h>
+# include <llvm/Support/raw_ostream.h>
+# include <llvm/Support/FormattedStream.h>
+# include <llvm/Support/Host.h>
+# include <llvm/Support/TargetRegistry.h>
+# include <llvm/Support/TargetSelect.h>
+# include <llvm/Target/TargetMachine.h>
+# include <llvm/Target/TargetData.h>
+
+# include "qv4isel_llvm_p.h"
+#endif
+
#include "qmljs_objects.h"
#include "qv4codegen_p.h"
#include "qv4isel_masm_p.h"
@@ -56,23 +75,6 @@
#include <sys/mman.h>
#include <iostream>
-#ifndef QMLJS_NO_LLVM
-# include "qv4isel_llvm_p.h"
-
-# include <llvm/PassManager.h>
-# include <llvm/Analysis/Passes.h>
-# include <llvm/Transforms/Scalar.h>
-# include <llvm/Transforms/IPO.h>
-# include <llvm/Assembly/PrintModulePass.h>
-# include <llvm/Support/raw_ostream.h>
-# include <llvm/Support/FormattedStream.h>
-# include <llvm/Support/Host.h>
-# include <llvm/Support/TargetRegistry.h>
-# include <llvm/Support/TargetSelect.h>
-# include <llvm/Target/TargetMachine.h>
-# include <llvm/Target/TargetData.h>
-#endif
-
static inline bool protect(const void *addr, size_t size)
{
size_t pageSize = sysconf(_SC_PAGESIZE);