aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/TypeLoc.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-21 00:26:14 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-21 00:26:14 +0000
commit464011827c5f9047caaba7e245556d66a65a15b6 (patch)
tree68202617cc556b044cfbc5182ea066a9fd1bfa10 /include/clang/AST/TypeLoc.h
parent90a7820de7685cec75fcd47e98f0f9623c0f0477 (diff)
Doxycomment SVal's getAs/castAs.
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
Diffstat (limited to 'include/clang/AST/TypeLoc.h')
-rw-r--r--include/clang/AST/TypeLoc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h
index d58b79af01..147643c1e5 100644
--- a/include/clang/AST/TypeLoc.h
+++ b/include/clang/AST/TypeLoc.h
@@ -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))