diff options
| author | Dan Gohman <gohman@apple.com> | 2009-04-01 18:45:54 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-04-01 18:45:54 +0000 |
| commit | d06cad6dacf2217ce7a88eebf5b0c164b3fbdd41 (patch) | |
| tree | faf864647d57a6d0f3e6e16f199b0559be489e5f /lib/ExecutionEngine | |
| parent | 37c934b0124b43e08e58eb222521c0f188ec9c53 (diff) | |
| download | external_llvm-d06cad6dacf2217ce7a88eebf5b0c164b3fbdd41.zip external_llvm-d06cad6dacf2217ce7a88eebf5b0c164b3fbdd41.tar.gz external_llvm-d06cad6dacf2217ce7a88eebf5b0c164b3fbdd41.tar.bz2 | |
Use CHAR_BIT instead of hard-coding 8 in several places where it
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
| -rw-r--r-- | lib/ExecutionEngine/Interpreter/Execution.cpp | 4 | ||||
| -rw-r--r-- | lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index f103609..a79bcc2 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -1092,10 +1092,10 @@ GenericValue Interpreter::executeBitCastInst(Value *SrcVal, const Type *DstTy, Dest.PointerVal = Src.PointerVal; } else if (DstTy->isInteger()) { if (SrcTy == Type::FloatTy) { - Dest.IntVal.zext(sizeof(Src.FloatVal) * 8); + Dest.IntVal.zext(sizeof(Src.FloatVal) * CHAR_BIT); Dest.IntVal.floatToBits(Src.FloatVal); } else if (SrcTy == Type::DoubleTy) { - Dest.IntVal.zext(sizeof(Src.DoubleVal) * 8); + Dest.IntVal.zext(sizeof(Src.DoubleVal) * CHAR_BIT); Dest.IntVal.doubleToBits(Src.DoubleVal); } else if (SrcTy->isInteger()) { Dest.IntVal = Src.IntVal; diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp index b2bf852..2819b6d 100644 --- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp +++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp @@ -18,6 +18,7 @@ #include <map> #include <vector> #include <cassert> +#include <climits> #include <cstdio> #include <cstdlib> #include <cstring> @@ -48,7 +49,7 @@ namespace { /// BlockSize - This is the size in bytes of this memory block, /// including this header. - uintptr_t BlockSize : (sizeof(intptr_t)*8 - 2); + uintptr_t BlockSize : (sizeof(intptr_t)*CHAR_BIT - 2); /// getBlockAfter - Return the memory block immediately after this one. |
