summaryrefslogtreecommitdiffstats
path: root/recipes-core/llvm/llvm2.8
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/llvm/llvm2.8')
-rw-r--r--recipes-core/llvm/llvm2.8/0019-issue6065.patch20
-rw-r--r--recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch113
-rw-r--r--recipes-core/llvm/llvm2.8/add-unistd.patch12
-rw-r--r--recipes-core/llvm/llvm2.8/llvm-mc_disable.patch12
4 files changed, 0 insertions, 157 deletions
diff --git a/recipes-core/llvm/llvm2.8/0019-issue6065.patch b/recipes-core/llvm/llvm2.8/0019-issue6065.patch
deleted file mode 100644
index a7f7bbe..0000000
--- a/recipes-core/llvm/llvm2.8/0019-issue6065.patch
+++ /dev/null
@@ -1,20 +0,0 @@
1---
2 ARMJITInfo.cpp | 6 ++++++
3 1 file changed, 6 insertions(+)
4
5--- a/lib/Target/ARM/ARMJITInfo.cpp
6+++ b/lib/Target/ARM/ARMJITInfo.cpp
7@@ -99,7 +99,13 @@
8 // The above twiddling of the saved return addresses allows us to
9 // deallocate everything, including the LR the stub saved, all in one
10 // pop instruction.
11+#ifndef __thumb__
12 "ldmia sp!, {r0, r1, r2, r3, lr, pc}\n"
13+#else
14+ // thumb dont allow lr and pc to be poped in the same instruction.
15+ "pop {r0, r1, r2, r3, lr}\n"
16+ "pop {pc}\n"
17+#endif
18 );
19 #else // Not an ARM host
20 void ARMCompilationCallback() {
diff --git a/recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch b/recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch
deleted file mode 100644
index ee5cbaf..0000000
--- a/recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch
+++ /dev/null
@@ -1,113 +0,0 @@
1Index: llvm-2.8/lib/ExecutionEngine/JIT/JIT.cpp
2===================================================================
3--- llvm-2.8.orig/lib/ExecutionEngine/JIT/JIT.cpp 2010-08-17 18:19:18.000000000 +0200
4+++ llvm-2.8/lib/ExecutionEngine/JIT/JIT.cpp 2011-12-19 21:16:21.884288536 +0100
5@@ -252,7 +252,12 @@
6 MutexGuard guard(Lock);
7 JITs.erase(jit);
8 }
9- void *getPointerToNamedFunction(const char *Name) const {
10+ bool empty() {
11+ MutexGuard guard(Lock);
12+ return JITs.empty();
13+ }
14+ void *getPointerToNamedFunction(const char *Name,
15+ bool AbortOnFailure = true) const {
16 MutexGuard guard(Lock);
17 assert(JITs.size() != 0 && "No Jit registered");
18 //search function in every instance of JIT
19@@ -264,7 +269,19 @@
20 }
21 // The function is not available : fallback on the first created (will
22 // search in symbol of the current program/library)
23- return (*JITs.begin())->getPointerToNamedFunction(Name);
24+ return (*JITs.begin())->getPointerToNamedFunction(Name, AbortOnFailure);
25+ }
26+ void *getPointerToGlobalIfAvailable(GlobalValue *V) const {
27+ MutexGuard guard(Lock);
28+ assert(JITs.size() != 0 && "No Jit registered");
29+ //search function in every instance of JIT
30+ for (SmallPtrSet<JIT*, 1>::const_iterator Jit = JITs.begin(),
31+ end = JITs.end();
32+ Jit != end; ++Jit) {
33+ if (void *Ptr = (*Jit)->getPointerToGlobalIfAvailable(V))
34+ return Ptr;
35+ }
36+ return 0;
37 }
38 };
39 ManagedStatic<JitPool> AllJits;
40@@ -280,6 +297,22 @@
41 }
42 }
43
44+extern "C" {
45+ // getPointerToNamedFunctionOrNull - same as the above, but returns
46+ // NULL instead of aborting if the function cannot be found.
47+ void *getPointerToNamedFunctionOrNull(const char *Name) {
48+ return !AllJits->empty() ? AllJits->getPointerToNamedFunction(Name, false) : 0;
49+ }
50+}
51+
52+extern "C" {
53+ // getPointerToGlobalIfAvailable - same as the above, but for global
54+ // variables, and only for those that have been codegened already.
55+ void *getPointerToGlobalIfAvailable(GlobalValue *V) {
56+ return !AllJits->empty() ? AllJits->getPointerToGlobalIfAvailable(V) : 0;
57+ }
58+}
59+
60 JIT::JIT(Module *M, TargetMachine &tm, TargetJITInfo &tji,
61 JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, bool GVsWithCode)
62 : ExecutionEngine(M), TM(tm), TJI(tji), AllocateGVsWithCode(GVsWithCode),
63Index: llvm-2.8/lib/Target/ARM/ARMISelLowering.cpp
64===================================================================
65--- llvm-2.8.orig/lib/Target/ARM/ARMISelLowering.cpp 2010-09-03 03:35:08.000000000 +0200
66+++ llvm-2.8/lib/Target/ARM/ARMISelLowering.cpp 2011-12-19 21:16:21.884288536 +0100
67@@ -1119,6 +1119,9 @@
68 }
69 }
70
71+extern "C" void *getPointerToNamedFunctionOrNull(const char *Name);
72+extern "C" void *getPointerToGlobalIfAvailable(GlobalValue *Value);
73+
74 /// LowerCall - Lowering a call into a callseq_start <-
75 /// ARMISD:CALL <- callseq_end chain. Also add input and output parameter
76 /// nodes.
77@@ -1272,6 +1275,26 @@
78 InFlag =SDValue();
79 }
80
81+ EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
82+
83+ // XXX Work around for http://llvm.org/bugs/show_bug.cgi?id=5201
84+ // and http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=399
85+ // for Shark.
86+ //
87+ // If the callee is an ExternalSymbol node, and the symbol can be
88+ // resolved to a function pointer, then insert that pointer as a
89+ // constant. This causes the next block of code to fall into the
90+ // block that emits an indirect call. This works around
91+ //
92+ // This works for Shark because the only kinds of call that Shark
93+ // makes that do not already fall into the indirect call block are
94+ // calls to pre-existing external functions.
95+ if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee)) {
96+ void *FuncPtr = getPointerToNamedFunctionOrNull(S->getSymbol());
97+ if (FuncPtr)
98+ Callee = DAG.getConstant((uint64_t) FuncPtr, PtrVT);
99+ }
100+
101 // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
102 // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
103 // node so that legalize doesn't hack it.
104Index: llvm-2.8/tools/llc/CMakeLists.txt
105===================================================================
106--- llvm-2.8.orig/tools/llc/CMakeLists.txt 2009-09-03 00:45:31.000000000 +0200
107+++ llvm-2.8/tools/llc/CMakeLists.txt 2011-12-19 21:16:21.884288536 +0100
108@@ -1,4 +1,4 @@
109-set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} bitreader asmparser)
110+set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} jit bitreader asmparser)
111
112 add_llvm_tool(llc
113 llc.cpp
diff --git a/recipes-core/llvm/llvm2.8/add-unistd.patch b/recipes-core/llvm/llvm2.8/add-unistd.patch
deleted file mode 100644
index 1c51b30..0000000
--- a/recipes-core/llvm/llvm2.8/add-unistd.patch
+++ /dev/null
@@ -1,12 +0,0 @@
1Index: llvm-2.8/lib/ExecutionEngine/JIT/Intercept.cpp
2===================================================================
3--- llvm-2.8.orig/lib/ExecutionEngine/JIT/Intercept.cpp 2012-05-14 18:31:21.008318473 +0200
4+++ llvm-2.8/lib/ExecutionEngine/JIT/Intercept.cpp 2012-05-14 18:32:53.523734850 +0200
5@@ -19,6 +19,7 @@
6 #include "llvm/Support/ErrorHandling.h"
7 #include "llvm/System/DynamicLibrary.h"
8 #include "llvm/Config/config.h"
9+#include <unistd.h>
10 using namespace llvm;
11
12 // AtExitHandlers - List of functions to call when the program exits,
diff --git a/recipes-core/llvm/llvm2.8/llvm-mc_disable.patch b/recipes-core/llvm/llvm2.8/llvm-mc_disable.patch
deleted file mode 100644
index fddc674..0000000
--- a/recipes-core/llvm/llvm2.8/llvm-mc_disable.patch
+++ /dev/null
@@ -1,12 +0,0 @@
1Index: llvm-2.8/tools/CMakeLists.txt
2===================================================================
3--- llvm-2.8.orig/tools/CMakeLists.txt 2010-08-24 11:16:51.000000000 +0200
4+++ llvm-2.8/tools/CMakeLists.txt 2011-12-21 16:47:47.718508763 +0100
5@@ -14,7 +14,6 @@
6 add_subdirectory(opt)
7 add_subdirectory(llvm-as)
8 add_subdirectory(llvm-dis)
9-add_subdirectory(llvm-mc)
10
11 add_subdirectory(llc)
12 add_subdirectory(llvm-ranlib)