]> granicus.if.org Git - clang/commitdiff
Pull determination of the super region for a VarRegion into a single getVarRegion...
authorTed Kremenek <kremenek@apple.com>
Mon, 27 Oct 2008 21:01:26 +0000 (21:01 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 27 Oct 2008 21:01:26 +0000 (21:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58272 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/MemRegion.h
lib/Analysis/MemRegion.cpp

index ffbef1b122d26390cd1a6f8750cdb768d1570f40..82f0e9189602c65be25d7423d448b57de6a31d36 100644 (file)
@@ -430,14 +430,8 @@ public:
   StringRegion* getStringRegion(const StringLiteral* Str);
 
   /// getVarRegion - Retrieve or create the memory region associated with
-  ///  a specified VarDecl.  'superRegion' corresponds to the containing
-  ///  memory region, and 'off' is the offset within the containing region.
-  VarRegion* getVarRegion(const VarDecl* vd, const MemRegion* superRegion);
-  
-  VarRegion* getVarRegion(const VarDecl* vd) {
-    return getVarRegion(vd, vd->hasLocalStorage() ? getStackRegion() 
-                        : getGlobalsRegion());
-  }
+  ///  a specified VarDecl.
+  VarRegion* getVarRegion(const VarDecl* vd);
   
   ElementRegion* getElementRegion(SVal Idx, const MemRegion* superRegion);
 
index 8a7be0d56481835ef17345e3460fcd9184af275f..27ecffdc06ea70f8550cc0b88654a62b7cbfa2e0 100644 (file)
@@ -189,8 +189,11 @@ StringRegion* MemRegionManager::getStringRegion(const StringLiteral* Str) {
   return R;
 }
 
-VarRegion* MemRegionManager::getVarRegion(const VarDecl* d,
-                                          const MemRegion* superRegion) {
+VarRegion* MemRegionManager::getVarRegion(const VarDecl* d) {
+  
+  const MemRegion* superRegion = d->hasLocalStorage() ? getStackRegion() 
+                                 : getGlobalsRegion();
+  
   llvm::FoldingSetNodeID ID;
   DeclRegion::ProfileRegion(ID, d, superRegion, MemRegion::VarRegionKind);