]> granicus.if.org Git - clang/commitdiff
Doxycomment SVal's getAs/castAs.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 21 Feb 2013 00:26:14 +0000 (00:26 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 21 Feb 2013 00:26:14 +0000 (00:26 +0000)
Also document TypeLoc's operations similarly, since it's a good idea.

Post-commit CR feedback from Anna Zaks regarding r175594.

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

include/clang/AST/TypeLoc.h
include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h

index d58b79af0122768585e913cb9eb46a80f93b6332..147643c1e561ae8e99bf293b85792fc6788203db 100644 (file)
@@ -44,6 +44,8 @@ protected:
   void *Data;
 
 public:
+  /// \brief Convert to the specified TypeLoc type, asserting that this TypeLoc
+  /// is of the desired type.
   template<typename T>
   T castAs() const {
     assert(T::isType(this));
@@ -52,6 +54,9 @@ public:
     tl = *this;
     return t;
   }
+
+  /// \brief Convert to the specified TypeLoc type, returning a null TypeLoc if
+  /// this TypeLoc is not of the desired type.
   template<typename T>
   T getAs() const {
     if (!T::isType(this))
index 2391d49c7324966c3d69c07b60186a9db4d10d85..0e0108c2d53f91095d5a1c50164a8e998dcc0692 100644 (file)
@@ -69,6 +69,8 @@ protected:
 public:
   explicit SVal() : Data(0), Kind(0) {}
 
+  /// \brief Convert to the specified SVal type, asserting that this SVal is of
+  /// the desired type.
   template<typename T>
   T castAs() const {
     assert(T::isKind(*this));
@@ -78,6 +80,8 @@ public:
     return t;
   }
 
+  /// \brief Convert to the specified SVal type, returning None if this SVal is
+  /// not of the desired type.
   template<typename T>
   Optional<T> getAs() const {
     if (!T::isKind(*this))