]> granicus.if.org Git - clang/commitdiff
Update docs.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 1 Apr 2009 06:01:08 +0000 (06:01 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 1 Apr 2009 06:01:08 +0000 (06:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68191 91177308-0d34-0410-b5e6-96231b3b80d8

docs/AnalyzerRegions.txt

index 1e496813ab981bee35379e552a400d1edaa40182..62f23e4618c18361b50c825c86b741ef2138f7d1 100644 (file)
@@ -146,6 +146,25 @@ Pointer Casts
   
   For toll-free bridging casts, we return the original region.
 
+  We can set up a lattice for pointer types, with the most general type 'void*'
+  at the top. The lattice enforces a partial order among types.
+
+  Every MemRegion has a root position in the type lattice. For example, the
+  pointee region of 'void *p' has its root position at the top of the lattice.
+  VarRegion of 'int x' has its root position at the 'int type' node.
+
+  TypedViewRegion is used to move the region down or up in the lattice. Moving
+  down in the lattice adds a TypedViewRegion. Moving up in the lattice removes a
+  TypedViewRegion.
+
+  Do we want to allow moving up beyond the root position? This happens when:
+    int x;
+    void *p = &x;
+  
+  The region of 'x' has its root position at 'int*' node. the cast to void*
+  moves that region up to the 'void*' node. I propose to not allow such casts,
+  and assign the region of 'x' for 'p'.
+
 Region Bindings
 
   The following region kinds are boundable: VarRegion, CompoundLiteralRegion,
@@ -158,9 +177,20 @@ Region Bindings
   To canonicalize a region, we get the canonical types for all TypedViewRegions
   along the way up to the root region, and make new TypedViewRegions with those
   canonical types.
+
+  For ObjC and C++, perhaps another canonicalization rule should be added: for
+  FieldRegion, the least derived class that has the field is used as the type
+  of the super region of the FieldRegion.
   
   All bindings and retrievings are done on the canonicalized regions.
   
   Canonicalization is transparent outside the region store manager, and more
   specifically, unaware outside the Bind() and Retrieve() method. We don't need
   to consider region canonicalization when doing pointer cast.
+
+Constraint Manager
+
+  The constraint manager reasons about the abstract location of memory
+  objects. We can have different views on a region, but none of these views
+  changes the location of that object. Thus we should get the same abstract
+  location for those regions.