summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-11-07 02:35:33 +0000
committerJordan Rose <jordan_rose@apple.com>2012-11-07 02:35:33 +0000
commita1046ece32659527bd6f0351c32c0eef797f5f59 (patch)
tree2f16ae748edc467be607dc806057194d00acc0ca
parentf684db65f87541c6d888d319799d457819ff4c95 (diff)
downloadbcm5719-llvm-a1046ece32659527bd6f0351c32c0eef797f5f59.tar.gz
bcm5719-llvm-a1046ece32659527bd6f0351c32c0eef797f5f59.zip
[analyzer] Add some examples for the common REGISTER_*_WITH_PROGRAMSTATEs.
No functionality change (doc comments only). llvm-svn: 167523
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index da7e6de7357..4558cd9c948 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -22,7 +22,14 @@ namespace clang {
namespace ento {
/// Declares an immutable map of type \p NameTy, suitable for placement into
- /// the ProgramState.
+ /// the ProgramState. This is implementing using llvm::ImmutableMap.
+ ///
+ /// \code
+ /// State = State->set<Name>(K, V);
+ /// const Value *V = State->get<Name>(K); // Returns NULL if not in the map.
+ /// State = State->remove<Name>(K);
+ /// NameTy Map = State->get<Name>();
+ /// \endcode
///
/// The macro should not be used inside namespaces, or for traits that must
/// be accessible from more than one translation unit.
@@ -30,8 +37,15 @@ namespace ento {
REGISTER_TRAIT_WITH_PROGRAMSTATE(Name, \
CLANG_ENTO_PROGRAMSTATE_MAP(Key, Value))
- /// Declares an immutable list of type \p NameTy, suitable for placement into
- /// the ProgramState.
+ /// Declares an immutable set of type \p NameTy, suitable for placement into
+ /// the ProgramState. This is implementing using llvm::ImmutableSet.
+ ///
+ /// \code
+ /// State = State->add<Name>(E);
+ /// State = State->remove<Name>(E);
+ /// bool Present = State->contains<Name>(E);
+ /// NameTy Set = State->get<Name>();
+ /// \endcode
///
/// The macro should not be used inside namespaces, or for traits that must
/// be accessible from more than one translation unit.
@@ -39,7 +53,13 @@ namespace ento {
REGISTER_TRAIT_WITH_PROGRAMSTATE(Name, llvm::ImmutableSet<Elem>)
/// Declares an immutable list of type \p NameTy, suitable for placement into
- /// the ProgramState.
+ /// the ProgramState. This is implementing using llvm::ImmutableList.
+ ///
+ /// \code
+ /// State = State->add<Name>(E); // Adds to the /end/ of the list.
+ /// bool Present = State->contains<Name>(E);
+ /// NameTy List = State->get<Name>();
+ /// \endcode
///
/// The macro should not be used inside namespaces, or for traits that must
/// be accessible from more than one translation unit.
OpenPOWER on IntegriCloud