aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/FlatStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-08-03 04:52:05 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-08-03 04:52:05 +0000
commite888233f6b115d3b0dd73bcb5f35e93794408542 (patch)
treed74fe0616c2ba88a5b4c1799f16b268bae85d913 /lib/Checker/FlatStore.cpp
parent5ce946291c2c23ed71b112b2ba13acf11807e319 (diff)
Pull the region offset computation logic into a single method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/FlatStore.cpp')
-rw-r--r--lib/Checker/FlatStore.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Checker/FlatStore.cpp b/lib/Checker/FlatStore.cpp
index 51c537ecfa..e1683e5009 100644
--- a/lib/Checker/FlatStore.cpp
+++ b/lib/Checker/FlatStore.cpp
@@ -192,14 +192,13 @@ FlatStoreManager::RegionToInterval(const MemRegion *R) {
case MemRegion::ElementRegionKind:
case MemRegion::FieldRegionKind: {
- const TypedRegion *TR = cast<TypedRegion>(R);
- RegionOffset Offset = TR->getAsOffset();
- // We cannot compute offset for all ElementRegions, for example, elements
+ RegionOffset Offset = R->getAsOffset();
+ // We cannot compute offset for all regions, for example, elements
// with symbolic offsets.
if (!Offset.getRegion())
return RegionInterval(0, 0, 0);
uint64_t Start = Offset.getOffset();
- uint64_t Size = Ctx.getTypeSize(TR->getValueType(Ctx));
+ uint64_t Size = Ctx.getTypeSize(cast<TypedRegion>(R)->getValueType(Ctx));
return RegionInterval(Offset.getRegion(), Start, Start+Size);
}