summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
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
commitc7012fa1e872bf305f9a8d3a15acdefa9b330eba (patch)
treead9ce3f79fcb46f9950fee83544b89e0bb2a15d0 /llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
parent6f8f276ce436aa0caa881c85191c9274d53df37b (diff)
downloadbcm5719-llvm-c7012fa1e872bf305f9a8d3a15acdefa9b330eba.tar.gz
bcm5719-llvm-c7012fa1e872bf305f9a8d3a15acdefa9b330eba.zip
Some platforms may need malloc.h for alloca.
llvm-svn: 82100
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 12ca9cd1d34..c931081ff68 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/llvm/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;
}
-
OpenPOWER on IntegriCloud