llvm.org GIT mirror llvm / a20bb26
Merging r229343 and r229351: ------------------------------------------------------------------------ r229343 | lhames | 2015-02-15 15:22:43 -0800 (Sun, 15 Feb 2015) | 6 lines [ExecutionEngine] Fix dependence issue by moving RTDyldMemoryManager into RuntimeDyld. This should fix http://llvm.org/PR22593. ------------------------------------------------------------------------ r229351 | chapuni | 2015-02-15 18:13:30 -0800 (Sun, 15 Feb 2015) | 1 line [CMake] Add RuntimeDyld to libdeps corresponding to r229343. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@229553 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 4 years ago
9 changed file(s) with 300 addition(s) and 296 deletion(s). Raw diff Collapse all Expand all
33 ExecutionEngine
44 InstCombine
55 MC
6 RuntimeDyld
67 ScalarOpts
78 Support
89 native
33 ExecutionEngine.cpp
44 ExecutionEngineBindings.cpp
55 GDBRegistrationListener.cpp
6 RTDyldMemoryManager.cpp
76 TargetSelect.cpp
87 )
98
2121 type = Library
2222 name = ExecutionEngine
2323 parent = Libraries
24 required_libraries = Core MC Object Support
24 required_libraries = Core MC Object Support RuntimeDyld
+0
-294
lib/ExecutionEngine/RTDyldMemoryManager.cpp less more
None //===-- RTDyldMemoryManager.cpp - Memory manager for MC-JIT -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implementation of the runtime dynamic memory manager base class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "llvm/Config/config.h"
14 #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
15 #include "llvm/Support/Compiler.h"
16 #include "llvm/Support/DynamicLibrary.h"
17 #include "llvm/Support/ErrorHandling.h"
18 #include
19
20 #ifdef __linux__
21 // These includes used by RTDyldMemoryManager::getPointerToNamedFunction()
22 // for Glibc trickery. See comments in this function for more information.
23 #ifdef HAVE_SYS_STAT_H
24 #include
25 #endif
26 #include
27 #include
28 #endif
29
30 namespace llvm {
31
32 RTDyldMemoryManager::~RTDyldMemoryManager() {}
33
34 // Determine whether we can register EH tables.
35 #if (defined(__GNUC__) && !defined(__ARM_EABI__) && !defined(__ia64__) && \
36 !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__))
37 #define HAVE_EHTABLE_SUPPORT 1
38 #else
39 #define HAVE_EHTABLE_SUPPORT 0
40 #endif
41
42 #if HAVE_EHTABLE_SUPPORT
43 extern "C" void __register_frame(void*);
44 extern "C" void __deregister_frame(void*);
45 #else
46 // The building compiler does not have __(de)register_frame but
47 // it may be found at runtime in a dynamically-loaded library.
48 // For example, this happens when building LLVM with Visual C++
49 // but using the MingW runtime.
50 void __register_frame(void *p) {
51 static bool Searched = false;
52 static void *rf = 0;
53
54 if (!Searched) {
55 Searched = true;
56 rf = llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(
57 "__register_frame");
58 }
59 if (rf)
60 ((void (*)(void *))rf)(p);
61 }
62
63 void __deregister_frame(void *p) {
64 static bool Searched = false;
65 static void *df = 0;
66
67 if (!Searched) {
68 Searched = true;
69 df = llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(
70 "__deregister_frame");
71 }
72 if (df)
73 ((void (*)(void *))df)(p);
74 }
75 #endif
76
77 #ifdef __APPLE__
78
79 static const char *processFDE(const char *Entry, bool isDeregister) {
80 const char *P = Entry;
81 uint32_t Length = *((const uint32_t *)P);
82 P += 4;
83 uint32_t Offset = *((const uint32_t *)P);
84 if (Offset != 0) {
85 if (isDeregister)
86 __deregister_frame(const_cast(Entry));
87 else
88 __register_frame(const_cast(Entry));
89 }
90 return P + Length;
91 }
92
93 // This implementation handles frame registration for local targets.
94 // Memory managers for remote targets should re-implement this function
95 // and use the LoadAddr parameter.
96 void RTDyldMemoryManager::registerEHFrames(uint8_t *Addr,
97 uint64_t LoadAddr,
98 size_t Size) {
99 // On OS X OS X __register_frame takes a single FDE as an argument.
100 // See http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-April/061768.html
101 const char *P = (const char *)Addr;
102 const char *End = P + Size;
103 do {
104 P = processFDE(P, false);
105 } while(P != End);
106 }
107
108 void RTDyldMemoryManager::deregisterEHFrames(uint8_t *Addr,
109 uint64_t LoadAddr,
110 size_t Size) {
111 const char *P = (const char *)Addr;
112 const char *End = P + Size;
113 do {
114 P = processFDE(P, true);
115 } while(P != End);
116 }
117
118 #else
119
120 void RTDyldMemoryManager::registerEHFrames(uint8_t *Addr,
121 uint64_t LoadAddr,
122 size_t Size) {
123 // On Linux __register_frame takes a single argument:
124 // a pointer to the start of the .eh_frame section.
125
126 // How can it find the end? Because crtendS.o is linked
127 // in and it has an .eh_frame section with four zero chars.
128 __register_frame(Addr);
129 }
130
131 void RTDyldMemoryManager::deregisterEHFrames(uint8_t *Addr,
132 uint64_t LoadAddr,
133 size_t Size) {
134 __deregister_frame(Addr);
135 }
136
137 #endif
138
139 static int jit_noop() {
140 return 0;
141 }
142
143 // ARM math functions are statically linked on Android from libgcc.a, but not
144 // available at runtime for dynamic linking. On Linux these are usually placed
145 // in libgcc_s.so so can be found by normal dynamic lookup.
146 #if defined(__BIONIC__) && defined(__arm__)
147 // List of functions which are statically linked on Android and can be generated
148 // by LLVM. This is done as a nested macro which is used once to declare the
149 // imported functions with ARM_MATH_DECL and once to compare them to the
150 // user-requested symbol in getSymbolAddress with ARM_MATH_CHECK. The test
151 // assumes that all functions start with __aeabi_ and getSymbolAddress must be
152 // modified if that changes.
153 #define ARM_MATH_IMPORTS(PP) \
154 PP(__aeabi_d2f) \
155 PP(__aeabi_d2iz) \
156 PP(__aeabi_d2lz) \
157 PP(__aeabi_d2uiz) \
158 PP(__aeabi_d2ulz) \
159 PP(__aeabi_dadd) \
160 PP(__aeabi_dcmpeq) \
161 PP(__aeabi_dcmpge) \
162 PP(__aeabi_dcmpgt) \
163 PP(__aeabi_dcmple) \
164 PP(__aeabi_dcmplt) \
165 PP(__aeabi_dcmpun) \
166 PP(__aeabi_ddiv) \
167 PP(__aeabi_dmul) \
168 PP(__aeabi_dsub) \
169 PP(__aeabi_f2d) \
170 PP(__aeabi_f2iz) \
171 PP(__aeabi_f2lz) \
172 PP(__aeabi_f2uiz) \
173 PP(__aeabi_f2ulz) \
174 PP(__aeabi_fadd) \
175 PP(__aeabi_fcmpeq) \
176 PP(__aeabi_fcmpge) \
177 PP(__aeabi_fcmpgt) \
178 PP(__aeabi_fcmple) \
179 PP(__aeabi_fcmplt) \
180 PP(__aeabi_fcmpun) \
181 PP(__aeabi_fdiv) \
182 PP(__aeabi_fmul) \
183 PP(__aeabi_fsub) \
184 PP(__aeabi_i2d) \
185 PP(__aeabi_i2f) \
186 PP(__aeabi_idiv) \
187 PP(__aeabi_idivmod) \
188 PP(__aeabi_l2d) \
189 PP(__aeabi_l2f) \
190 PP(__aeabi_lasr) \
191 PP(__aeabi_ldivmod) \
192 PP(__aeabi_llsl) \
193 PP(__aeabi_llsr) \
194 PP(__aeabi_lmul) \
195 PP(__aeabi_ui2d) \
196 PP(__aeabi_ui2f) \
197 PP(__aeabi_uidiv) \
198 PP(__aeabi_uidivmod) \
199 PP(__aeabi_ul2d) \
200 PP(__aeabi_ul2f) \
201 PP(__aeabi_uldivmod)
202
203 // Declare statically linked math functions on ARM. The function declarations
204 // here do not have the correct prototypes for each function in
205 // ARM_MATH_IMPORTS, but it doesn't matter because only the symbol addresses are
206 // needed. In particular the __aeabi_*divmod functions do not have calling
207 // conventions which match any C prototype.
208 #define ARM_MATH_DECL(name) extern "C" void name();
209 ARM_MATH_IMPORTS(ARM_MATH_DECL)
210 #undef ARM_MATH_DECL
211 #endif
212
213 #if defined(__linux__) && defined(__GLIBC__) && \
214 (defined(__i386__) || defined(__x86_64__))
215 extern "C" LLVM_ATTRIBUTE_WEAK void __morestack();
216 #endif
217
218 uint64_t
219 RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) {
220 // This implementation assumes that the host program is the target.
221 // Clients generating code for a remote target should implement their own
222 // memory manager.
223 #if defined(__linux__) && defined(__GLIBC__)
224 //===--------------------------------------------------------------------===//
225 // Function stubs that are invoked instead of certain library calls
226 //
227 // Force the following functions to be linked in to anything that uses the
228 // JIT. This is a hack designed to work around the all-too-clever Glibc
229 // strategy of making these functions work differently when inlined vs. when
230 // not inlined, and hiding their real definitions in a separate archive file
231 // that the dynamic linker can't see. For more info, search for
232 // 'libc_nonshared.a' on Google, or read http://llvm.org/PR274.
233 if (Name == "stat") return (uint64_t)&stat;
234 if (Name == "fstat") return (uint64_t)&fstat;
235 if (Name == "lstat") return (uint64_t)&lstat;
236 if (Name == "stat64") return (uint64_t)&stat64;
237 if (Name == "fstat64") return (uint64_t)&fstat64;
238 if (Name == "lstat64") return (uint64_t)&lstat64;
239 if (Name == "atexit") return (uint64_t)&atexit;
240 if (Name == "mknod") return (uint64_t)&mknod;
241
242 #if defined(__i386__) || defined(__x86_64__)
243 // __morestack lives in libgcc, a static library.
244 if (&__morestack && Name == "__morestack")
245 return (uint64_t)&__morestack;
246 #endif
247 #endif // __linux__ && __GLIBC__
248
249 // See ARM_MATH_IMPORTS definition for explanation
250 #if defined(__BIONIC__) && defined(__arm__)
251 if (Name.compare(0, 8, "__aeabi_") == 0) {
252 // Check if the user has requested any of the functions listed in
253 // ARM_MATH_IMPORTS, and if so redirect to the statically linked symbol.
254 #define ARM_MATH_CHECK(fn) if (Name == #fn) return (uint64_t)&fn;
255 ARM_MATH_IMPORTS(ARM_MATH_CHECK)
256 #undef ARM_MATH_CHECK
257 }
258 #endif
259
260 // We should not invoke parent's ctors/dtors from generated main()!
261 // On Mingw and Cygwin, the symbol __main is resolved to
262 // callee's(eg. tools/lli) one, to invoke wrong duplicated ctors
263 // (and register wrong callee's dtors with atexit(3)).
264 // We expect ExecutionEngine::runStaticConstructorsDestructors()
265 // is called before ExecutionEngine::runFunctionAsMain() is called.
266 if (Name == "__main") return (uint64_t)&jit_noop;
267
268 // Try to demangle Name before looking it up in the process, otherwise symbol
269 // '_' (if present) will shadow '', and there will be no way to
270 // refer to the latter.
271
272 const char *NameStr = Name.c_str();
273
274 if (NameStr[0] == '_')
275 if (void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr + 1))
276 return (uint64_t)Ptr;
277
278 // If we Name did not require demangling, or we failed to find the demangled
279 // name, try again without demangling.
280 return (uint64_t)sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);
281 }
282
283 void *RTDyldMemoryManager::getPointerToNamedFunction(const std::string &Name,
284 bool AbortOnFailure) {
285 uint64_t Addr = getSymbolAddress(Name);
286
287 if (!Addr && AbortOnFailure)
288 report_fatal_error("Program used external function '" + Name +
289 "' which could not be resolved!");
290 return (void*)Addr;
291 }
292
293 } // namespace llvm
0 add_llvm_library(LLVMRuntimeDyld
1 RTDyldMemoryManager.cpp
12 RuntimeDyld.cpp
23 RuntimeDyldChecker.cpp
34 RuntimeDyldELF.cpp
0 //===-- RTDyldMemoryManager.cpp - Memory manager for MC-JIT -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implementation of the runtime dynamic memory manager base class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "llvm/Config/config.h"
14 #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
15 #include "llvm/Support/Compiler.h"
16 #include "llvm/Support/DynamicLibrary.h"
17 #include "llvm/Support/ErrorHandling.h"
18 #include
19
20 #ifdef __linux__
21 // These includes used by RTDyldMemoryManager::getPointerToNamedFunction()
22 // for Glibc trickery. See comments in this function for more information.
23 #ifdef HAVE_SYS_STAT_H
24 #include
25 #endif
26 #include
27 #include
28 #endif
29
30 namespace llvm {
31
32 RTDyldMemoryManager::~RTDyldMemoryManager() {}
33
34 // Determine whether we can register EH tables.
35 #if (defined(__GNUC__) && !defined(__ARM_EABI__) && !defined(__ia64__) && \
36 !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__))
37 #define HAVE_EHTABLE_SUPPORT 1
38 #else
39 #define HAVE_EHTABLE_SUPPORT 0
40 #endif
41
42 #if HAVE_EHTABLE_SUPPORT
43 extern "C" void __register_frame(void*);
44 extern "C" void __deregister_frame(void*);
45 #else
46 // The building compiler does not have __(de)register_frame but
47 // it may be found at runtime in a dynamically-loaded library.
48 // For example, this happens when building LLVM with Visual C++
49 // but using the MingW runtime.
50 void __register_frame(void *p) {
51 static bool Searched = false;
52 static void *rf = 0;
53
54 if (!Searched) {
55 Searched = true;
56 rf = llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(
57 "__register_frame");
58 }
59 if (rf)
60 ((void (*)(void *))rf)(p);
61 }
62
63 void __deregister_frame(void *p) {
64 static bool Searched = false;
65 static void *df = 0;
66
67 if (!Searched) {
68 Searched = true;
69 df = llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(
70 "__deregister_frame");
71 }
72 if (df)
73 ((void (*)(void *))df)(p);
74 }
75 #endif
76
77 #ifdef __APPLE__
78
79 static const char *processFDE(const char *Entry, bool isDeregister) {
80 const char *P = Entry;
81 uint32_t Length = *((const uint32_t *)P);
82 P += 4;
83 uint32_t Offset = *((const uint32_t *)P);
84 if (Offset != 0) {
85 if (isDeregister)
86 __deregister_frame(const_cast(Entry));
87 else
88 __register_frame(const_cast(Entry));
89 }
90 return P + Length;
91 }
92
93 // This implementation handles frame registration for local targets.
94 // Memory managers for remote targets should re-implement this function
95 // and use the LoadAddr parameter.
96 void RTDyldMemoryManager::registerEHFrames(uint8_t *Addr,
97 uint64_t LoadAddr,
98 size_t Size) {
99 // On OS X OS X __register_frame takes a single FDE as an argument.
100 // See http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-April/061768.html
101 const char *P = (const char *)Addr;
102 const char *End = P + Size;
103 do {
104 P = processFDE(P, false);
105 } while(P != End);
106 }
107
108 void RTDyldMemoryManager::deregisterEHFrames(uint8_t *Addr,
109 uint64_t LoadAddr,
110 size_t Size) {
111 const char *P = (const char *)Addr;
112 const char *End = P + Size;
113 do {
114 P = processFDE(P, true);
115 } while(P != End);
116 }
117
118 #else
119
120 void RTDyldMemoryManager::registerEHFrames(uint8_t *Addr,
121 uint64_t LoadAddr,
122 size_t Size) {
123 // On Linux __register_frame takes a single argument:
124 // a pointer to the start of the .eh_frame section.
125
126 // How can it find the end? Because crtendS.o is linked
127 // in and it has an .eh_frame section with four zero chars.
128 __register_frame(Addr);
129 }
130
131 void RTDyldMemoryManager::deregisterEHFrames(uint8_t *Addr,
132 uint64_t LoadAddr,
133 size_t Size) {
134 __deregister_frame(Addr);
135 }
136
137 #endif
138
139 static int jit_noop() {
140 return 0;
141 }
142
143 // ARM math functions are statically linked on Android from libgcc.a, but not
144 // available at runtime for dynamic linking. On Linux these are usually placed
145 // in libgcc_s.so so can be found by normal dynamic lookup.
146 #if defined(__BIONIC__) && defined(__arm__)
147 // List of functions which are statically linked on Android and can be generated
148 // by LLVM. This is done as a nested macro which is used once to declare the
149 // imported functions with ARM_MATH_DECL and once to compare them to the
150 // user-requested symbol in getSymbolAddress with ARM_MATH_CHECK. The test
151 // assumes that all functions start with __aeabi_ and getSymbolAddress must be
152 // modified if that changes.
153 #define ARM_MATH_IMPORTS(PP) \
154 PP(__aeabi_d2f) \
155 PP(__aeabi_d2iz) \
156 PP(__aeabi_d2lz) \
157 PP(__aeabi_d2uiz) \
158 PP(__aeabi_d2ulz) \
159 PP(__aeabi_dadd) \
160 PP(__aeabi_dcmpeq) \
161 PP(__aeabi_dcmpge) \
162 PP(__aeabi_dcmpgt) \
163 PP(__aeabi_dcmple) \
164 PP(__aeabi_dcmplt) \
165 PP(__aeabi_dcmpun) \
166 PP(__aeabi_ddiv) \
167 PP(__aeabi_dmul) \
168 PP(__aeabi_dsub) \
169 PP(__aeabi_f2d) \
170 PP(__aeabi_f2iz) \
171 PP(__aeabi_f2lz) \
172 PP(__aeabi_f2uiz) \
173 PP(__aeabi_f2ulz) \
174 PP(__aeabi_fadd) \
175 PP(__aeabi_fcmpeq) \
176 PP(__aeabi_fcmpge) \
177 PP(__aeabi_fcmpgt) \
178 PP(__aeabi_fcmple) \
179 PP(__aeabi_fcmplt) \
180 PP(__aeabi_fcmpun) \
181 PP(__aeabi_fdiv) \
182 PP(__aeabi_fmul) \
183 PP(__aeabi_fsub) \
184 PP(__aeabi_i2d) \
185 PP(__aeabi_i2f) \
186 PP(__aeabi_idiv) \
187 PP(__aeabi_idivmod) \
188 PP(__aeabi_l2d) \
189 PP(__aeabi_l2f) \
190 PP(__aeabi_lasr) \
191 PP(__aeabi_ldivmod) \
192 PP(__aeabi_llsl) \
193 PP(__aeabi_llsr) \
194 PP(__aeabi_lmul) \
195 PP(__aeabi_ui2d) \
196 PP(__aeabi_ui2f) \
197 PP(__aeabi_uidiv) \
198 PP(__aeabi_uidivmod) \
199 PP(__aeabi_ul2d) \
200 PP(__aeabi_ul2f) \
201 PP(__aeabi_uldivmod)
202
203 // Declare statically linked math functions on ARM. The function declarations
204 // here do not have the correct prototypes for each function in
205 // ARM_MATH_IMPORTS, but it doesn't matter because only the symbol addresses are
206 // needed. In particular the __aeabi_*divmod functions do not have calling
207 // conventions which match any C prototype.
208 #define ARM_MATH_DECL(name) extern "C" void name();
209 ARM_MATH_IMPORTS(ARM_MATH_DECL)
210 #undef ARM_MATH_DECL
211 #endif
212
213 #if defined(__linux__) && defined(__GLIBC__) && \
214 (defined(__i386__) || defined(__x86_64__))
215 extern "C" LLVM_ATTRIBUTE_WEAK void __morestack();
216 #endif
217
218 uint64_t
219 RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) {
220 // This implementation assumes that the host program is the target.
221 // Clients generating code for a remote target should implement their own
222 // memory manager.
223 #if defined(__linux__) && defined(__GLIBC__)
224 //===--------------------------------------------------------------------===//
225 // Function stubs that are invoked instead of certain library calls
226 //
227 // Force the following functions to be linked in to anything that uses the
228 // JIT. This is a hack designed to work around the all-too-clever Glibc
229 // strategy of making these functions work differently when inlined vs. when
230 // not inlined, and hiding their real definitions in a separate archive file
231 // that the dynamic linker can't see. For more info, search for
232 // 'libc_nonshared.a' on Google, or read http://llvm.org/PR274.
233 if (Name == "stat") return (uint64_t)&stat;
234 if (Name == "fstat") return (uint64_t)&fstat;
235 if (Name == "lstat") return (uint64_t)&lstat;
236 if (Name == "stat64") return (uint64_t)&stat64;
237 if (Name == "fstat64") return (uint64_t)&fstat64;
238 if (Name == "lstat64") return (uint64_t)&lstat64;
239 if (Name == "atexit") return (uint64_t)&atexit;
240 if (Name == "mknod") return (uint64_t)&mknod;
241
242 #if defined(__i386__) || defined(__x86_64__)
243 // __morestack lives in libgcc, a static library.
244 if (&__morestack && Name == "__morestack")
245 return (uint64_t)&__morestack;
246 #endif
247 #endif // __linux__ && __GLIBC__
248
249 // See ARM_MATH_IMPORTS definition for explanation
250 #if defined(__BIONIC__) && defined(__arm__)
251 if (Name.compare(0, 8, "__aeabi_") == 0) {
252 // Check if the user has requested any of the functions listed in
253 // ARM_MATH_IMPORTS, and if so redirect to the statically linked symbol.
254 #define ARM_MATH_CHECK(fn) if (Name == #fn) return (uint64_t)&fn;
255 ARM_MATH_IMPORTS(ARM_MATH_CHECK)
256 #undef ARM_MATH_CHECK
257 }
258 #endif
259
260 // We should not invoke parent's ctors/dtors from generated main()!
261 // On Mingw and Cygwin, the symbol __main is resolved to
262 // callee's(eg. tools/lli) one, to invoke wrong duplicated ctors
263 // (and register wrong callee's dtors with atexit(3)).
264 // We expect ExecutionEngine::runStaticConstructorsDestructors()
265 // is called before ExecutionEngine::runFunctionAsMain() is called.
266 if (Name == "__main") return (uint64_t)&jit_noop;
267
268 // Try to demangle Name before looking it up in the process, otherwise symbol
269 // '_' (if present) will shadow '', and there will be no way to
270 // refer to the latter.
271
272 const char *NameStr = Name.c_str();
273
274 if (NameStr[0] == '_')
275 if (void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr + 1))
276 return (uint64_t)Ptr;
277
278 // If we Name did not require demangling, or we failed to find the demangled
279 // name, try again without demangling.
280 return (uint64_t)sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);
281 }
282
283 void *RTDyldMemoryManager::getPointerToNamedFunction(const std::string &Name,
284 bool AbortOnFailure) {
285 uint64_t Addr = getSymbolAddress(Name);
286
287 if (!Addr && AbortOnFailure)
288 report_fatal_error("Program used external function '" + Name +
289 "' which could not be resolved!");
290 return (void*)Addr;
291 }
292
293 } // namespace llvm
99 MC
1010 MCJIT
1111 Object
12 RuntimeDyld
1213 SelectionDAG
1314 Support
1415 native
22 ExecutionEngine
33 Interpreter
44 MC
5 RuntimeDyld
56 Support
67 )
78
44 IPO
55 MC
66 MCJIT
7 RuntimeDyld
78 ScalarOpts
89 Support
910 Target