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 | 4e42790c43f8d1ff94f39e96f1222d7e7e1c1f2b (patch) | |
tree | 0512c4bfda33e30d4f255f4555e0e2cf6b67ff3f | |
parent | d7c6174f8503d4d584f06c99dbf1ab94250ce473 (diff) | |
download | bcm5719-llvm-4e42790c43f8d1ff94f39e96f1222d7e7e1c1f2b.tar.gz bcm5719-llvm-4e42790c43f8d1ff94f39e96f1222d7e7e1c1f2b.zip |
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
llvm-svn: 34958
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 7a0bc23f32d..981ef107a5e 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/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(); |