class HasNameMatcher

Declaration

class HasNameMatcher : public SingleNodeMatcherInterface { /* full declaration omitted */ };

Description

Matches named declarations with a specific name. See \c hasName() and \c hasAnyName() in ASTMatchers.h for details.

Declared at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:944

Inherits from: SingleNodeMatcherInterface

Member Variables

private bool UseUnqualifiedMatch
private std::vector<std::string> Names

Method Overview

Methods

HasNameMatcher(std::vector<std::string> Names)

Declared at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:946

Parameters

std::vector<std::string> Names

bool matchesNode(
    const clang::NamedDecl& Node) const

Description

Returns true if the matcher matches the provided node. A subclass must implement this instead of Matches().

Declared at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:948

Parameters

const clang::NamedDecl& Node

bool matchesNodeFullFast(
    const clang::NamedDecl& Node) const

Description

Full match routine Fast implementation for the simple case of a named declaration at namespace or RecordDecl scope. It is slower than matchesNodeUnqualified, but faster than matchesNodeFullSlow.

Declared at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:963

Parameters

const clang::NamedDecl& Node

bool matchesNodeFullSlow(
    const clang::NamedDecl& Node) const

Description

Full match routine It generates the fully qualified name of the declaration (which is expensive) before trying to match. It is slower but simple and works on all cases.

Declared at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:970

Parameters

const clang::NamedDecl& Node

bool matchesNodeUnqualified(
    const clang::NamedDecl& Node) const

Description

Unqualified match routine. It is much faster than the full match, but it only works for unqualified matches.

Declared at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:955

Parameters

const clang::NamedDecl& Node