r189908 - Documentation fix: remove advice to use cast/dyn_cast on TypeLocs, updating
James Dennett
jdennett at google.com
Tue Sep 3 19:47:23 PDT 2013
Author: jdennett
Date: Tue Sep 3 21:47:23 2013
New Revision: 189908
URL: http://llvm.org/viewvc/llvm-project?rev=189908&view=rev
Log:
Documentation fix: remove advice to use cast/dyn_cast on TypeLocs, updating
it to refer to castAs/getAs.
The original change to remove the (broken) cast/dyn_cast support from TypeLoc
was in r175462. (Thanks to David Blaikie for the reference.)
Modified:
cfe/trunk/include/clang/AST/TypeLoc.h
Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=189908&r1=189907&r2=189908&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Tue Sep 3 21:47:23 2013
@@ -6,9 +6,10 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-//
-// This file defines the TypeLoc interface and subclasses.
-//
+///
+/// \file
+/// \brief Defines the clang::TypeLoc interface and its subclasses.
+///
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_AST_TYPELOC_H
@@ -34,8 +35,8 @@ namespace clang {
/// \brief Base wrapper for a particular "section" of type source info.
///
-/// A client should use the TypeLoc subclasses through cast/dyn_cast in order to
-/// get at the actual information.
+/// A client should use the TypeLoc subclasses through castAs()/getAs()
+/// in order to get at the actual information.
class TypeLoc {
protected:
// The correctness of this relies on the property that, for Type *Ty,
@@ -46,6 +47,8 @@ protected:
public:
/// \brief Convert to the specified TypeLoc type, asserting that this TypeLoc
/// is of the desired type.
+ ///
+ /// \pre T::isKind(*this)
template<typename T>
T castAs() const {
assert(T::isKind(*this));
More information about the cfe-commits
mailing list