class IsObjCTypeParamDependentTypeVisitor

Declaration

class IsObjCTypeParamDependentTypeVisitor : public RecursiveASTVisitor { /* full declaration omitted */ };

Description

A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each node. This class performs three distinct tasks: 1. traverse the AST (i.e. go to each node); 2. at a given node, walk up the class hierarchy, starting from the node's dynamic type, until the top-most class (e.g. Stmt, Decl, or Type) is reached. 3. given a (node, class) combination, where 'class' is some base class of the dynamic type of 'node', call a user-overridable function to actually visit the node. These tasks are done by three groups of methods, respectively: 1. TraverseDecl(Decl *x) does task #1. It is the entry point for traversing an AST rooted at x. This method simply dispatches (i.e. forwards) to TraverseFoo(Foo *x) where Foo is the dynamic type of *x, which calls WalkUpFromFoo(x) and then recursively visits the child nodes of x. TraverseStmt(Stmt *x) and TraverseType(QualType x) work similarly. 2. WalkUpFromFoo(Foo *x) does task #2. It does not try to visit any child node of x. Instead, it first calls WalkUpFromBar(x) where Bar is the direct parent class of Foo (unless Foo has no parent), and then calls VisitFoo(x) (see the next list item). 3. VisitFoo(Foo *x) does task #3. These three method groups are tiered (Traverse* > WalkUpFrom* > Visit*). A method (e.g. Traverse*) may call methods from the same tier (e.g. other Traverse*) or one tier lower (e.g. WalkUpFrom*). It may not call methods from a higher tier. Note that since WalkUpFromFoo() calls WalkUpFromBar() (where Bar is Foo's super class) before calling VisitFoo(), the result is that the Visit*() methods for a given node are called in the top-down order (e.g. for a node of type NamespaceDecl, the order will be VisitDecl(), VisitNamedDecl(), and then VisitNamespaceDecl()). This scheme guarantees that all Visit*() calls for the same AST node are grouped together. In other words, Visit*() methods for different nodes are never interleaved. Clients of this visitor should subclass the visitor (providing themselves as the template argument, using the curiously recurring template pattern) and override any of the Traverse*, WalkUpFrom*, and Visit* methods for declarations, types, statements, expressions, or other AST nodes where the visitor should customize behavior. Most users only need to override Visit*. Advanced users may override Traverse* and WalkUpFrom* to implement custom traversal strategies. Returning false from one of these overridden functions will abort the entire traversal. By default, this visitor tries to visit every part of the explicit source code exactly once. The default policy towards templates is to descend into the 'pattern' class or function body, not any explicit or implicit instantiations. Explicit specializations are still visited, and the patterns of partial specializations are visited separately. This behavior can be changed by overriding shouldVisitTemplateInstantiations() in the derived class to return true, in which case all known implicit and explicit instantiations will be visited at the same time as the pattern from which they were produced. By default, this visitor preorder traverses the AST. If postorder traversal is needed, the \c shouldTraversePostOrder method needs to be overridden to return \c true.

Declared at: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:713

Inherits from: RecursiveASTVisitor

Member Variables

public bool Result

Method Overview

Methods

IsObjCTypeParamDependentTypeVisitor()

Declared at: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:716

bool VisitObjCTypeParamType(
    const clang::ObjCTypeParamType* Type)

Declared at: clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:717

Parameters

const clang::ObjCTypeParamType* Type