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
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));
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))
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));
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))