[cfe-commits] r123313 - /cfe/trunk/lib/StaticAnalyzer/README.txt

Zhongxing Xu xuzhongxing at gmail.com
Tue Jan 11 23:20:03 PST 2011


Author: zhongxingxu
Date: Wed Jan 12 01:20:03 2011
New Revision: 123313

URL: http://llvm.org/viewvc/llvm-project?rev=123313&view=rev
Log:
Add some documentation for C++ static analyzer.

Modified:
    cfe/trunk/lib/StaticAnalyzer/README.txt

Modified: cfe/trunk/lib/StaticAnalyzer/README.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/README.txt?rev=123313&r1=123312&r2=123313&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/README.txt (original)
+++ cfe/trunk/lib/StaticAnalyzer/README.txt Wed Jan 12 01:20:03 2011
@@ -67,6 +67,28 @@
 providing it an ExplodedNode which is the last node in the path that
 triggered the problem.
 
+= Notes about C++ =
+
+Since now constructors are seen before the variable that is constructed 
+in the CFG, we create a temporary object as the destination region that 
+is constructed into. See ExprEngine::VisitCXXConstructExpr().
+
+In ExprEngine::processCallExit(), we always bind the object region to the
+evaluated CXXConstructExpr. Then in VisitDeclStmt(), we compute the
+corresponding lazy compound value if the variable is not a reference, and
+bind the variable region to the lazy compound value. If the variable
+is a reference, just use the object region as the initilizer value.
+
+Before entering a C++ method (or ctor/dtor), the 'this' region is bound
+to the object region. In ctors, we synthesize 'this' region with  
+CXXRecordDecl*, which means we do not use type qualifiers. In methods, we
+synthesize 'this' region with CXXMethodDecl*, which has getThisType() 
+taking type qualifiers into account. It does not matter we use qualified
+'this' region in one method and unqualified 'this' region in another
+method, because we only need to ensure the 'this' region is consistent 
+when we synthesize it and create it directly from CXXThisExpr in a single
+method call.
+
 = Working on the Analyzer =
 
 If you are interested in bringing up support for C++ expressions, the





More information about the cfe-commits mailing list