clang-tools 20.0.0git
Namespaces | Typedefs | Functions
XRefs.cpp File Reference
#include "XRefs.h"
#include "AST.h"
#include "FindSymbols.h"
#include "FindTarget.h"
#include "Headers.h"
#include "HeuristicResolver.h"
#include "IncludeCleaner.h"
#include "ParsedAST.h"
#include "Protocol.h"
#include "Quality.h"
#include "Selection.h"
#include "SourceCode.h"
#include "URI.h"
#include "clang-include-cleaner/Analysis.h"
#include "clang-include-cleaner/Types.h"
#include "index/Index.h"
#include "index/Merge.h"
#include "index/Relation.h"
#include "index/SymbolCollector.h"
#include "index/SymbolID.h"
#include "index/SymbolLocation.h"
#include "support/Logger.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Attrs.inc"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/Type.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TokenKinds.h"
#include "clang/Index/IndexDataConsumer.h"
#include "clang/Index/IndexSymbol.h"
#include "clang/Index/IndexingAction.h"
#include "clang/Index/IndexingOptions.h"
#include "clang/Index/USRGeneration.h"
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Syntax/Tokens.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::clangd
 FIXME: Skip testing on windows temporarily due to the different escaping code mode.
 

Typedefs

using clang::clangd::RecursionProtectionSet = llvm::SmallSet< const CXXRecordDecl *, 4 >
 

Functions

std::vector< LocatedSymbol > clang::clangd::locateSymbolTextually (const SpelledWord &Word, ParsedAST &AST, const SymbolIndex *Index, llvm::StringRef MainFilePath, ASTNodeKind NodeKind)
 
const syntax::Token * clang::clangd::findNearbyIdentifier (const SpelledWord &Word, const syntax::TokenBuffer &TB)
 
std::vector< LocatedSymbol > clang::clangd::locateSymbolAt (ParsedAST &AST, Position Pos, const SymbolIndex *Index=nullptr)
 Get definition of symbol at a specified Pos.
 
std::vector< DocumentLink > clang::clangd::getDocumentLinks (ParsedAST &AST)
 Get all document links.
 
std::vector< DocumentHighlight > clang::clangd::findDocumentHighlights (ParsedAST &AST, Position Pos)
 Returns highlights for all usages of a symbol at Pos.
 
std::vector< LocatedSymbol > clang::clangd::findImplementations (ParsedAST &AST, Position Pos, const SymbolIndex *Index)
 Returns implementations at a specified Pos:
 
ReferencesResult clang::clangd::findReferences (ParsedAST &AST, Position Pos, uint32_t Limit, const SymbolIndex *Index=nullptr, bool AddContext=false)
 Returns references of the symbol at a specified Pos.
 
std::vector< SymbolDetails > clang::clangd::getSymbolInfo (ParsedAST &AST, Position Pos)
 Get info about symbols at Pos.
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, const LocatedSymbol &S)
 
llvm::raw_ostream & clang::clangd::operator<< (llvm::raw_ostream &OS, const ReferencesResult::Reference &R)
 
template<typename HierarchyItem >
static std::optional< HierarchyItem > clang::clangd::declToHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath)
 
static std::optional< TypeHierarchyItem > clang::clangd::declToTypeHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath)
 
static std::optional< CallHierarchyItem > clang::clangd::declToCallHierarchyItem (const NamedDecl &ND, llvm::StringRef TUPath)
 
template<typename HierarchyItem >
static std::optional< HierarchyItem > clang::clangd::symbolToHierarchyItem (const Symbol &S, PathRef TUPath)
 
static std::optional< TypeHierarchyItem > clang::clangd::symbolToTypeHierarchyItem (const Symbol &S, PathRef TUPath)
 
static std::optional< CallHierarchyItem > clang::clangd::symbolToCallHierarchyItem (const Symbol &S, PathRef TUPath)
 
static void clang::clangd::fillSubTypes (const SymbolID &ID, std::vector< TypeHierarchyItem > &SubTypes, const SymbolIndex *Index, int Levels, PathRef TUPath)
 
static void clang::clangd::fillSuperTypes (const CXXRecordDecl &CXXRD, llvm::StringRef TUPath, TypeHierarchyItem &Item, RecursionProtectionSet &RPSet)
 
std::vector< const CXXRecordDecl * > clang::clangd::findRecordTypeAt (ParsedAST &AST, Position Pos)
 Find the record types referenced at Pos.
 
static QualType clang::clangd::typeForNode (const SelectionTree::Node *N)
 
static void clang::clangd::unwrapFindType (QualType T, const HeuristicResolver *H, llvm::SmallVector< QualType > &Out)
 
static llvm::SmallVector< QualType > clang::clangd::unwrapFindType (QualType T, const HeuristicResolver *H)
 
std::vector< LocatedSymbol > clang::clangd::findType (ParsedAST &AST, Position Pos, const SymbolIndex *Index)
 Returns symbols for types referenced at Pos.
 
std::vector< const CXXRecordDecl * > clang::clangd::typeParents (const CXXRecordDecl *CXXRD)
 Given a record type declaration, find its base (parent) types.
 
std::vector< TypeHierarchyItem > clang::clangd::getTypeHierarchy (ParsedAST &AST, Position Pos, int Resolve, TypeHierarchyDirection Direction, const SymbolIndex *Index=nullptr, PathRef TUPath=PathRef{})
 Get type hierarchy information at Pos.
 
std::optional< std::vector< TypeHierarchyItem > > clang::clangd::superTypes (const TypeHierarchyItem &Item, const SymbolIndex *Index)
 Returns direct parents of a TypeHierarchyItem using SymbolIDs stored inside the item.
 
std::vector< TypeHierarchyItem > clang::clangd::subTypes (const TypeHierarchyItem &Item, const SymbolIndex *Index)
 Returns direct children of a TypeHierarchyItem.
 
void clang::clangd::resolveTypeHierarchy (TypeHierarchyItem &Item, int ResolveLevels, TypeHierarchyDirection Direction, const SymbolIndex *Index)
 
std::vector< CallHierarchyItem > clang::clangd::prepareCallHierarchy (ParsedAST &AST, Position Pos, PathRef TUPath)
 Get call hierarchy information at Pos.
 
std::vector< CallHierarchyIncomingCall > clang::clangd::incomingCalls (const CallHierarchyItem &Item, const SymbolIndex *Index)
 
std::vector< CallHierarchyOutgoingCall > clang::clangd::outgoingCalls (const CallHierarchyItem &Item, const SymbolIndex *Index)
 
llvm::DenseSet< const Decl * > clang::clangd::getNonLocalDeclRefs (ParsedAST &AST, const FunctionDecl *FD)
 Returns all decls that are referenced in the FD except local symbols.
 

Variable Documentation

◆ Container

const Decl* Container

Definition at line 861 of file XRefs.cpp.

◆ Role

index::SymbolRoleSet Role

Definition at line 860 of file XRefs.cpp.

◆ SpelledTok

syntax::Token SpelledTok

Definition at line 859 of file XRefs.cpp.

Referenced by clang::clangd::locateMacroAt().