aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 537ca56e02..6427bf32e8 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -274,6 +274,10 @@ void *JIT::getPointerToFunctionOrStub(Function *F) {
if (void *Addr = getPointerToGlobalIfAvailable(F))
return Addr;
+ // Get a stub if the target supports it
+ if (void *Addr = TJI.emitFunctionStub(F, *MCE))
+ return Addr;
+
// Otherwise, if the target doesn't support it, just codegen the function.
return getPointerToFunction(F);
}