From 6f09928d5bb71f91b85a95388766bbee7c0754ea Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Thu, 7 Mar 2013 01:23:14 +0000 Subject: [PATCH] [analyzer] Clean up a few doc comments for ProgramState and CallEvent. No functionality change. llvm-svn: 176600 --- .../clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h | 4 +++- .../StaticAnalyzer/Core/PathSensitive/ProgramState.h | 15 +++++++++++---- clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 1 - 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h index 6336a8b..1c67668 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h @@ -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. diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h index 7980907..39e7429 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h @@ -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 + /// 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 assume(DefinedOrUnknownSVal cond) const; ProgramStateRef assumeInBound(DefinedOrUnknownSVal idx, diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp index 933df48..c482978 100644 --- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -271,7 +271,6 @@ bool CallEvent::isCallStmt(const Stmt *S) { || isa(S); } -/// \brief Returns the result type, adjusted for references. QualType CallEvent::getDeclaredResultType(const Decl *D) { assert(D); if (const FunctionDecl* FD = dyn_cast(D)) -- 2.7.4