aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-17 00:14:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-17 00:14:44 +0000
commite4a5743d87bb5b389c4505c51714364062704a7b (patch)
treea3f4ba652e428588f779eaa975050e4e748136ff /lib/ExecutionEngine
parente443525f3558100cec35da589c11bd78c86774d1 (diff)
downloadexternal_llvm-e4a5743d87bb5b389c4505c51714364062704a7b.zip
external_llvm-e4a5743d87bb5b389c4505c51714364062704a7b.tar.gz
external_llvm-e4a5743d87bb5b389c4505c51714364062704a7b.tar.bz2
Some platforms may need malloc.h for alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 12ca9cd..c931081 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -33,6 +33,10 @@
#include <map>
#include <cmath>
#include <cstring>
+// Some platforms may need malloc.h for alloca.
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
#ifdef HAVE_FFI_CALL
#ifdef HAVE_FFI_H
@@ -269,7 +273,7 @@ GenericValue Interpreter::callExternalFunction(Function *F,
} else {
RawFn = RF->second;
}
-
+
FunctionsLock->release();
GenericValue Result;
@@ -334,7 +338,7 @@ GenericValue lle_X_sprintf(const FunctionType *FT,
// printf should return # chars printed. This is completely incorrect, but
// close enough for now.
- GenericValue GV;
+ GenericValue GV;
GV.IntVal = APInt(32, strlen(FmtStr));
while (1) {
switch (*FmtStr) {
@@ -566,4 +570,3 @@ void Interpreter::initializeExternalFunctions() {
FuncNames["lle_X_scanf"] = lle_X_scanf;
FuncNames["lle_X_fprintf"] = lle_X_fprintf;
}
-