22#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FINDTARGET_H
23#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FINDTARGET_H
25#include "clang/AST/ASTContext.h"
26#include "clang/AST/ASTTypeTraits.h"
27#include "clang/AST/NestedNameSpecifier.h"
28#include "clang/AST/Stmt.h"
29#include "clang/Basic/SourceLocation.h"
30#include "llvm/ADT/SmallVector.h"
31#include "llvm/Support/raw_ostream.h"
37class HeuristicResolver;
82llvm::SmallVector<const NamedDecl *, 1>
83targetDecl(
const DynTypedNode &, DeclRelationSet Mask,
84 const HeuristicResolver *Resolver);
90llvm::SmallVector<std::pair<const NamedDecl *, DeclRelationSet>, 1>
138 llvm::SmallVector<const NamedDecl *, 1>
Targets;
167llvm::SmallVector<const NamedDecl *, 1>
182 explicit operator bool()
const {
return S.any(); }
202 return (S & Other.S) == Other.S;
215llvm::raw_ostream &
operator<<(llvm::raw_ostream &, DeclRelationSet);
const FunctionDecl * Decl
CompiledFragmentImpl & Out
llvm::raw_string_ostream OS
DeclRelationSet & operator&=(DeclRelationSet Other)
DeclRelationSet()=default
friend DeclRelationSet operator~(DeclRelationSet R)
friend DeclRelationSet operator|(DeclRelationSet L, DeclRelationSet R)
friend bool operator==(DeclRelationSet L, DeclRelationSet R)
friend llvm::raw_ostream & operator<<(llvm::raw_ostream &, DeclRelationSet)
DeclRelationSet(DeclRelation R)
DeclRelationSet & operator|=(DeclRelationSet Other)
bool contains(DeclRelationSet Other) const
friend DeclRelationSet operator&(DeclRelationSet L, DeclRelationSet R)
llvm::SmallVector< std::pair< const NamedDecl *, DeclRelationSet >, 1 > allTargetDecls(const DynTypedNode &N, const HeuristicResolver *Resolver)
Similar to targetDecl(), however instead of applying a filter, all possible decls are returned along ...
llvm::SmallVector< const NamedDecl *, 1 > explicitReferenceTargets(DynTypedNode N, DeclRelationSet Mask, const HeuristicResolver *Resolver)
Find declarations explicitly referenced in the source code defined by N.
DeclRelationSet operator&(DeclRelation L, DeclRelation R)
void findExplicitReferences(const Stmt *S, llvm::function_ref< void(ReferenceLoc)> Out, const HeuristicResolver *Resolver)
Recursively traverse S and report all references explicitly written in the code.
DeclRelationSet operator~(DeclRelation R)
llvm::SmallVector< const NamedDecl *, 1 > targetDecl(const DynTypedNode &N, DeclRelationSet Mask, const HeuristicResolver *Resolver)
targetDecl() finds the declaration referred to by an AST node.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
DeclRelationSet operator|(DeclRelation L, DeclRelation R)
@ Underlying
This is the underlying declaration for a renaming-alias, decltype etc.
@ TemplatePattern
This is the pattern the template specialization was instantiated from.
@ TemplateInstantiation
This is the template instantiation that was referred to.
@ Alias
This declaration is an alias that was referred to.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Information about a reference written in the source code, independent of the actual AST node that thi...
NestedNameSpecifierLoc Qualifier
Contains qualifier written in the code, if any, e.g. 'ns::' for 'ns::foo'.
bool IsDecl
True if the reference is a declaration or definition;.
SourceLocation NameLoc
Start location of the last name part, i.e. 'foo' in 'ns::foo<int>'.
llvm::SmallVector< const NamedDecl *, 1 > Targets
A list of targets referenced by this name.