diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-11 17:06:35 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-11 17:06:35 +0000 |
commit | 199c3d6cd16aebbb9c7f0d42af9d922c9628bf70 (patch) | |
tree | 6cd559c088b3da1861835639e05db09d5bb16f08 /lib/Analysis/Store.cpp | |
parent | e27d87ff27b26e5886cf6472271d3b5e18ec3d87 (diff) |
Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.
Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/Store.cpp')
-rw-r--r-- | lib/Analysis/Store.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Analysis/Store.cpp b/lib/Analysis/Store.cpp index fd44a80baa..1724a9250c 100644 --- a/lib/Analysis/Store.cpp +++ b/lib/Analysis/Store.cpp @@ -13,6 +13,7 @@ #include "clang/Analysis/PathSensitive/Store.h" #include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/AST/CharUnits.h" using namespace clang; @@ -138,9 +139,9 @@ const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy) if (!baseR) return NULL; - int64_t off = rawOff.getByteOffset(); + CharUnits off = CharUnits::fromQuantity(rawOff.getByteOffset()); - if (off == 0) { + if (off.isZero()) { // Edge case: we are at 0 bytes off the beginning of baseR. We // check to see if type we are casting to is the same as the base // region. If so, just return the base region. @@ -168,7 +169,7 @@ const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy) // We can only compute sizeof(PointeeTy) if it is a complete type. if (IsCompleteType(Ctx, PointeeTy)) { // Compute the size in **bytes**. - int64_t pointeeTySize = (int64_t) (Ctx.getTypeSize(PointeeTy) / 8); + CharUnits pointeeTySize = Ctx.getTypeSizeInChars(PointeeTy); // Is the offset a multiple of the size? If so, we can layer the // ElementRegion (with elementType == PointeeTy) directly on top of @@ -182,7 +183,7 @@ const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy) if (!newSuperR) { // Create an intermediate ElementRegion to represent the raw byte. // This will be the super region of the final ElementRegion. - newSuperR = MakeElementRegion(baseR, Ctx.CharTy, off); + newSuperR = MakeElementRegion(baseR, Ctx.CharTy, off.getQuantity()); } return MakeElementRegion(newSuperR, PointeeTy, newIndex); |