diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-06 05:03:16 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-06 05:03:16 +0000 |
commit | 415c1f7438619434d74b76223674228779930ae3 (patch) | |
tree | a7b5cf0558b9869e94e482971f7008c3c07bb4dd /lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 2471ae46df8f59a69cc152230f3f39d2e68525c5 (diff) |
1. Make StoreValueToMemory a little more efficient by not requiring caller
to make a copy of the GenericValue.
2. Fix a copy & paste bug in StoreValueToMemory where 64-bit values were
truncated to 32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 7a0bc23f32..981ef107a5 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -410,7 +410,7 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) { /// It is not a pointer to a GenericValue containing the address at which to /// store Val. /// -void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr, +void ExecutionEngine::StoreValueToMemory(const GenericValue &Val, GenericValue *Ptr, const Type *Ty) { switch (Ty->getTypeID()) { case Type::IntegerTyID: { @@ -423,7 +423,7 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr, } else if (BitWidth <= 32) { *((uint32_t*)Ptr) = uint32_t(Val.IntVal.getZExtValue()); } else if (BitWidth <= 64) { - *((uint64_t*)Ptr) = uint32_t(Val.IntVal.getZExtValue()); + *((uint64_t*)Ptr) = uint64_t(Val.IntVal.getZExtValue()); } else { uint64_t *Dest = (uint64_t*)Ptr; const uint64_t *Src = Val.IntVal.getRawData(); |