From: Manuel Klimek Date: Thu, 25 Jul 2013 06:05:50 +0000 (+0000) Subject: Fix incorrect documentation generation for type matchers. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c4b2e42c5af83dc2138ecceab7f492fe9d6c555;p=clang Fix incorrect documentation generation for type matchers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187104 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index 3640736d53..f127455fe6 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -955,295 +955,11 @@ whileStmt() -Matcher<TypeLoc>arrayTypeLocMatcher<ArrayTypeLoc>... -
Matches all kinds of arrays.
-
-Given
-  int a[] = { 2, 3 };
-  int b[4];
-  void f() { int c[a[0]]; }
-arrayType()
-  matches "int a[]", "int b[4]" and "int c[a[0]]";
-
- - -Matcher<TypeLoc>atomicTypeLocMatcher<AtomicTypeLoc>... -
Matches atomic types.
-
-Given
-  _Atomic(int) i;
-atomicType()
-  matches "_Atomic(int) i"
-
- - -Matcher<TypeLoc>autoTypeLocMatcher<AutoTypeLoc>... -
Matches types nodes representing C++11 auto types.
-
-Given:
-  auto n = 4;
-  int v[] = { 2, 3 }
-  for (auto i : v) { }
-autoType()
-  matches "auto n" and "auto i"
-
- - -Matcher<TypeLoc>blockPointerTypeLocMatcher<BlockPointerTypeLoc>... -
Matches block pointer types, i.e. types syntactically represented as
-"void (^)(int)".
-
-The pointee is always required to be a FunctionType.
-
- - -Matcher<TypeLoc>builtinTypeLocMatcher<BuiltinTypeLoc>... -
Matches builtin Types.
-
-Given
-  struct A {};
-  A a;
-  int b;
-  float c;
-  bool d;
-builtinType()
-  matches "int b", "float c" and "bool d"
-
- - -Matcher<TypeLoc>complexTypeLocMatcher<ComplexTypeLoc>... -
Matches C99 complex types.
-
-Given
-  _Complex float f;
-complexType()
-  matches "_Complex float f"
-
- - -Matcher<TypeLoc>constantArrayTypeLocMatcher<ConstantArrayTypeLoc>... -
Matches C arrays with a specified constant size.
-
-Given
-  void() {
-    int a[2];
-    int b[] = { 2, 3 };
-    int c[b[0]];
-  }
-constantArrayType()
-  matches "int a[2]"
-
- - -Matcher<TypeLoc>dependentSizedArrayTypeLocMatcher<DependentSizedArrayTypeLoc>... -
Matches C++ arrays whose size is a value-dependent expression.
-
-Given
-  template<typename T, int Size>
-  class array {
-    T data[Size];
-  };
-dependentSizedArrayType
-  matches "T data[Size]"
-
- - -Matcher<TypeLoc>elaboratedTypeLocMatcher<ElaboratedTypeLoc>... -
Matches types specified with an elaborated type keyword or with a
-qualified name.
-
-Given
-  namespace N {
-    namespace M {
-      class D {};
-    }
-  }
-  class C {};
-
-  class C c;
-  N::M::D d;
-
-elaboratedType() matches the type of the variable declarations of both
-c and d.
-
- - -Matcher<TypeLoc>functionTypeLocMatcher<FunctionTypeLoc>... -
Matches FunctionType nodes.
-
-Given
-  int (*f)(int);
-  void g();
-functionType()
-  matches "int (*f)(int)" and the type of "g".
-
- - -Matcher<TypeLoc>incompleteArrayTypeLocMatcher<IncompleteArrayTypeLoc>... -
Matches C arrays with unspecified size.
-
-Given
-  int a[] = { 2, 3 };
-  int b[42];
-  void f(int c[]) { int d[a[0]]; };
-incompleteArrayType()
-  matches "int a[]" and "int c[]"
-
- - -Matcher<TypeLoc>lValueReferenceTypeLocMatcher<LValueReferenceTypeLoc>... -
Matches lvalue reference types.
-
-Given:
-  int *a;
-  int &b = *a;
-  int &&c = 1;
-  auto &d = b;
-  auto &&e = c;
-  auto &&f = 2;
-  int g = 5;
-
-lValueReferenceType() matches the types of b, d, and e. e is
-matched since the type is deduced as int& by reference collapsing rules.
-
- - -Matcher<TypeLoc>memberPointerTypeLocMatcher<MemberPointerTypeLoc>... -
Matches member pointer types.
-Given
-  struct A { int i; }
-  A::* ptr = A::i;
-memberPointerType()
-  matches "A::* ptr"
-
- - -Matcher<TypeLoc>parenTypeLocMatcher<ParenTypeLoc>... -
Matches ParenType nodes.
-
-Given
-  int (*ptr_to_array)[4];
-  int *array_of_ptrs[4];
-
-varDecl(hasType(pointsTo(parenType()))) matches ptr_to_array but not
-array_of_ptrs.
-
- - -Matcher<TypeLoc>pointerTypeLocMatcher<PointerTypeLoc>... -
Matches pointer types.
-
-Given
-  int *a;
-  int &b = *a;
-  int c = 5;
-pointerType()
-  matches "int *a"
-
- - -Matcher<TypeLoc>rValueReferenceTypeLocMatcher<RValueReferenceTypeLoc>... -
Matches rvalue reference types.
-
-Given:
-  int *a;
-  int &b = *a;
-  int &&c = 1;
-  auto &d = b;
-  auto &&e = c;
-  auto &&f = 2;
-  int g = 5;
-
-rValueReferenceType() matches the types of c and f. e is not
-matched as it is deduced to int& by reference collapsing rules.
-
- - -Matcher<TypeLoc>recordTypeLocMatcher<RecordTypeLoc>... -
Matches record types (e.g. structs, classes).
-
-Given
-  class C {};
-  struct S {};
-
-  C c;
-  S s;
-
-recordType() matches the type of the variable declarations of both c
-and s.
-
- - -Matcher<TypeLoc>referenceTypeLocMatcher<ReferenceTypeLoc>... -
Matches both lvalue and rvalue reference types.
-
-Given
-  int *a;
-  int &b = *a;
-  int &&c = 1;
-  auto &d = b;
-  auto &&e = c;
-  auto &&f = 2;
-  int g = 5;
-
-referenceType() matches the types of b, c, d, e, and f.
-
- - -Matcher<TypeLoc>templateSpecializationTypeLocMatcher<TemplateSpecializationTypeLoc>... -
Matches template specialization types.
-
-Given
-  template <typename T>
-  class C { };
-
-  template class C<int>;  A
-  C<char> var;            B
-
-templateSpecializationType() matches the type of the explicit
-instantiation in A and the type of the variable declaration in B.
-
- - Matcher<TypeLoc>typeLocMatcher<TypeLoc>...
Matches TypeLocs in the clang AST.
 
-Matcher<TypeLoc>typedefTypeLocMatcher<TypedefTypeLoc>... -
Matches typedef types.
-
-Given
-  typedef int X;
-typedefType()
-  matches "typedef int X"
-
- - -Matcher<TypeLoc>unaryTransformTypeLocMatcher<UnaryTransformTypeLoc>... -
Matches types nodes representing unary type transformations.
-
-Given:
-  typedef __underlying_type(T) type;
-unaryTransformType()
-  matches "__underlying_type(T)"
-
- - -Matcher<TypeLoc>variableArrayTypeLocMatcher<VariableArrayTypeLoc>... -
Matches C arrays with a specified size that is not an
-integer-constant-expression.
-
-Given
-  void f() {
-    int a[] = { 2, 3 }
-    int b[42];
-    int c[a[0]];
-variableArrayType()
-  matches "int c[a[0]]"
-
- - Matcher<Type>arrayTypeMatcher<ArrayType>...
Matches all kinds of arrays.
 
diff --git a/docs/tools/dump_ast_matchers.py b/docs/tools/dump_ast_matchers.py
index bbf48c7646..08a7d961ff 100644
--- a/docs/tools/dump_ast_matchers.py
+++ b/docs/tools/dump_ast_matchers.py
@@ -154,8 +154,10 @@ def act_on_decl(declaration, comment, allowed_types):
       inner, name = m.groups()
       add_matcher('Type', name, 'Matcher<%s>...' % inner,
                   comment, is_dyncast=True)
-      add_matcher('TypeLoc', '%sLoc' % name, 'Matcher<%sLoc>...' % inner,
-                  comment, is_dyncast=True)
+      # FIXME: re-enable once we have implemented casting on the TypeLoc
+      # hierarchy.
+      # add_matcher('TypeLoc', '%sLoc' % name, 'Matcher<%sLoc>...' % inner,
+      #             comment, is_dyncast=True)
       return
 
     m = re.match(""".*AST_TYPE(LOC)?_TRAVERSE_MATCHER\(