diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-23 22:49:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-23 22:49:13 +0000 |
commit | 9f3ff92ca81fbceaa8ba805893f64f2a39f525d7 (patch) | |
tree | 7ac89e85c988987f2cff799617b3b8fcffae5f75 /lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 74382b7c699120fbec5cb5603c9cf4212eb37f06 (diff) |
remove use of alloca.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 9fbee9cb79..19d7ce375e 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -19,9 +19,9 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/Config/alloca.h" #include "llvm/ExecutionEngine/GenericValue.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MutexGuard.h" @@ -859,9 +859,11 @@ void ExecutionEngine::LoadValueFromMemory(GenericValue &Result, // Host and target are different endian - reverse copy the stored // bytes into a buffer, and load from that. uint8_t *Src = (uint8_t*)Ptr; - uint8_t *Buf = (uint8_t*)alloca(LoadBytes); - std::reverse_copy(Src, Src + LoadBytes, Buf); - Ptr = (GenericValue*)Buf; + + SmallVector<uint8_t, 20> Buf; + Buf.resize(LoadBytes+1); + std::reverse_copy(Src, Src + LoadBytes, Buf.data()); + Ptr = (GenericValue*)Buf.data(); } switch (Ty->getTypeID()) { |