]> granicus.if.org Git - clang/commitdiff
[analyzer] Clean up a few doc comments for ProgramState and CallEvent.
authorJordan Rose <jordan_rose@apple.com>
Thu, 7 Mar 2013 01:23:14 +0000 (01:23 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 7 Mar 2013 01:23:14 +0000 (01:23 +0000)
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176600 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
lib/StaticAnalyzer/Core/CallEvent.cpp

index 6336a8b387c0a540edb9f647f4842a4242f9804b..1c676686185085aa9b80a6718d11bf715f5f43c8 100644 (file)
@@ -336,7 +336,9 @@ public:
   /// of some kind.
   static bool isCallStmt(const Stmt *S);
 
-  /// \brief Returns the result type of a function, method declaration.
+  /// \brief Returns the result type of a function or method declaration.
+  ///
+  /// This will return a null QualType if the result type cannot be determined.
   static QualType getDeclaredResultType(const Decl *D);
 
   // Iterator access to formal parameters and their types.
index 798090735bebc8e3ee39c3c747a9d436be6a4968..39e7429344c8ec0b32d3dffdd793f7b14b366274 100644 (file)
@@ -170,12 +170,19 @@ public:
   // If no new state is feasible, NULL is returned.
   //
 
+  /// Assumes that the value of \p cond is zero (if \p assumption is "false")
+  /// or non-zero (if \p assumption is "true").
+  ///
+  /// This returns a new state with the added constraint on \p cond.
+  /// If no new state is feasible, NULL is returned.
   ProgramStateRef assume(DefinedOrUnknownSVal cond, bool assumption) const;
 
-  /// This method assumes both "true" and "false" for 'cond', and
-  /// returns both corresponding states.  It's shorthand for doing
-  /// 'assume' twice.
-  std::pair<ProgramStateRef , ProgramStateRef >
+  /// Assumes both "true" and "false" for \p cond, and returns both
+  /// corresponding states (respectively).
+  ///
+  /// This is more efficient than calling assume() twice. Note that one (but not
+  /// both) of the returned states may be NULL.
+  std::pair<ProgramStateRef, ProgramStateRef>
   assume(DefinedOrUnknownSVal cond) const;
 
   ProgramStateRef assumeInBound(DefinedOrUnknownSVal idx,
index 933df48988462f7dbd2f33876abddb21a2b71166..c482978ca29b65c54efae2bfc29a12fd29f45ecb 100644 (file)
@@ -271,7 +271,6 @@ bool CallEvent::isCallStmt(const Stmt *S) {
                           || isa<CXXNewExpr>(S);
 }
 
-/// \brief Returns the result type, adjusted for references.
 QualType CallEvent::getDeclaredResultType(const Decl *D) {
   assert(D);
   if (const FunctionDecl* FD = dyn_cast<FunctionDecl>(D))