22 #ifndef LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_FINDTARGET_H 23 #define LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_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/Optional.h" 31 #include "llvm/ADT/STLExtras.h" 32 #include "llvm/ADT/SmallPtrSet.h" 33 #include "llvm/ADT/SmallVector.h" 34 #include "llvm/Support/raw_ostream.h" 43 class DeclRelationSet;
83 llvm::SmallVector<const NamedDecl *, 1>
84 targetDecl(const ast_type_traits::DynTypedNode &, DeclRelationSet Mask);
90 llvm::SmallVector<std::pair<const NamedDecl *, DeclRelationSet>, 1>
131 llvm::SmallVector<const NamedDecl *, 1>
Targets;
157 llvm::SmallVector<const NamedDecl *, 1>
172 explicit operator bool()
const {
return S.any(); }
207 #endif // LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_FINDTARGET_H
const FunctionDecl * Decl
friend bool operator==(DeclRelationSet L, DeclRelationSet R)
Information about a reference written in the source code, independent of the actual AST node that thi...
llvm::SmallVector< std::pair< const NamedDecl *, DeclRelationSet >, 1 > allTargetDecls(const ast_type_traits::DynTypedNode &N)
Similar to targetDecl(), however instead of applying a filter, all possible decls are returned along ...
DeclRelationSet operator~(DeclRelation R)
This is the pattern the template specialization was instantiated from.
DeclRelationSet(DeclRelation R)
This declaration is an alias that was referred to.
DeclRelationSet operator &(DeclRelation L, DeclRelation R)
DeclRelationSet operator|(DeclRelation L, DeclRelation R)
SourceLocation NameLoc
Start location of the last name part, i.e. 'foo' in 'ns::foo<int>'.
llvm::SmallVector< const NamedDecl *, 1 > explicitReferenceTargets(DynTypedNode N, DeclRelationSet Mask)
This is the template instantiation that was referred to.
llvm::SmallVector< const NamedDecl *, 1 > Targets
A list of targets referenced by this name.
llvm::SmallVector< const NamedDecl *, 1 > targetDecl(const ast_type_traits::DynTypedNode &N, DeclRelationSet Mask)
targetDecl() finds the declaration referred to by an AST node.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
void findExplicitReferences(const Stmt *S, llvm::function_ref< void(ReferenceLoc)> Out)
Recursively traverse S and report all references explicitly written in the code.
This is the underlying declaration for an alias, decltype etc.
friend DeclRelationSet operator~(DeclRelationSet R)
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
NestedNameSpecifierLoc Qualifier
Contains qualifier written in the code, if any, e.g. 'ns::' for 'ns::foo'.
DeclRelationSet & operator|=(DeclRelationSet Other)
friend DeclRelationSet operator|(DeclRelationSet L, DeclRelationSet R)