Add support for AllocaRegion extent with GDM.

One design problem that is emerging is the signed-ness problem during static
analysis. Many unsigned value have to be converted into signed value because
it partipates in operations with signed values. 

On the other hand, we cannot blindly make all values occuring in static analysis
signed, because we do have cases where unsignedness is required, for example,
integer overflow detection.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59957 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index cb1acea..ea88e70 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1291,6 +1291,13 @@
             MemRegionManager& RM = getStateManager().getRegionManager();
             const MemRegion* R =
               RM.getAllocaRegion(CE, Builder->getCurrentBlockCount());
+
+            // Set the extent of the region in bytes. This enables us to use the
+            // SVal of the argument directly. If we save the extent in bits, we
+            // cannot represent values like symbol*8.
+            SVal Extent = GetSVal(St, *(CE->arg_begin()));
+            St = getStoreManager().setExtent(St, R, Extent);
+
             MakeNode(Dst, CE, *DI, BindExpr(St, CE, loc::MemRegionVal(R)));
             continue;            
           }