14#include "clang/AST/DeclObjC.h"
22 AST.tuPath(),
AST.getLangOpts(),
23 AST.getIncludeStructure().MainFileIncludes,
AST.getLocalTopLevelDecls());
24 const SourceManager &SM =
AST.getSourceManager();
28 for (const NamedDecl *ND : Ref.Targets) {
29 if (!isInsideMainFile(Ref.NameLoc, SM))
31 SymbolID ID = getSymbolID(ND);
34 unsigned &SymbolCount = Signals.ReferencedSymbols[ID];
39 if (const auto *NSD = dyn_cast<NamespaceDecl>(ND->getDeclContext())) {
40 if (NSD->isAnonymousNamespace())
42 std::string NS = printNamespaceScope(*NSD);
44 Signals.RelatedNamespaces[NS]++;
48 AST.getHeuristicResolver());
Stores and provides access to parsed AST.
Records an event whose duration is the lifetime of the Span object.
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.
Symbol::IncludeDirective preferredIncludeDirective(llvm::StringRef FileName, const LangOptions &LangOpts, ArrayRef< Inclusion > MainFileIncludes, ArrayRef< const Decl * > TopLevelDecls)
Infer the include directive to use for the given FileName.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Signals derived from a valid AST of a file.
static ASTSignals derive(const ParsedAST &AST)
Symbol::IncludeDirective InsertionDirective
Preferred preprocessor directive to use for inclusions by the file.
Represents a symbol occurrence in the source file.
Information about a reference written in the source code, independent of the actual AST node that thi...