summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-04-01 06:01:08 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-04-01 06:01:08 +0000
commit034247130e04fa360da7a8395a882d123ffb08b5 (patch)
tree1140c601b15eb8a2b19590fcf236d656027af394 /clang
parentdcb7a352946aa8c772a1b0f3cb674ac65f3cc5fb (diff)
downloadbcm5719-llvm-034247130e04fa360da7a8395a882d123ffb08b5.tar.gz
bcm5719-llvm-034247130e04fa360da7a8395a882d123ffb08b5.zip
Update docs.
llvm-svn: 68191
Diffstat (limited to 'clang')
-rw-r--r--clang/docs/AnalyzerRegions.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/docs/AnalyzerRegions.txt b/clang/docs/AnalyzerRegions.txt
index 1e496813ab9..62f23e4618c 100644
--- a/clang/docs/AnalyzerRegions.txt
+++ b/clang/docs/AnalyzerRegions.txt
@@ -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.
OpenPOWER on IntegriCloud