13#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H
14#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H
19#include "clang/AST/Decl.h"
20#include "clang/AST/DeclObjC.h"
21#include "clang/AST/NestedNameSpecifier.h"
22#include "clang/AST/TypeLoc.h"
23#include "clang/Basic/SourceLocation.h"
24#include "clang/Lex/MacroInfo.h"
25#include "llvm/ADT/StringRef.h"
46SourceLocation
nameLocation(
const clang::Decl &D,
const SourceManager &SM);
59 const UsingDirectiveDecl &D);
64std::string
printName(
const ASTContext &Ctx,
const NamedDecl &ND);
97 const SourceManager &SM);
132 ArrayRef<Inclusion> MainFileIncludes,
133 ArrayRef<const Decl *> TopLevelDecls);
137std::string
printType(
const QualType QT,
const DeclContext &CurContext,
138 llvm::StringRef Placeholder =
"");
183std::vector<const Attr *>
getAttributes(
const DynTypedNode &);
200 const DeclContext *DestContext,
201 SourceLocation InsertionPoint,
202 const NamedDecl *ND);
216 const DeclContext *DestContext,
218 llvm::ArrayRef<std::string> VisibleNamespaces);
245llvm::SmallVector<const ParmVarDecl *>
const FunctionDecl * Decl
SmallVector< const ParmVarDecl * > resolveForwardingParameters(const FunctionDecl *D, unsigned MaxDepth)
Recursively resolves the parameters of a FunctionDecl that forwards its parameters to another functio...
std::string printTemplateSpecializationArgs(const NamedDecl &ND)
Prints template arguments of a decl as written in the source code, including enclosing '<' and '>',...
std::string printObjCMethod(const ObjCMethodDecl &Method)
Print the Objective-C method name, including the full container name, e.g.
SymbolID getSymbolID(const Decl *D)
Gets the symbol ID for a declaration. Returned SymbolID might be null.
std::string printType(const QualType QT, const DeclContext &CurContext, const llvm::StringRef Placeholder)
Returns a QualType as string.
std::string printName(const ASTContext &Ctx, const NamedDecl &ND)
Prints unqualified name of the decl for the purpose of displaying it to the user.
std::string printObjCContainer(const ObjCContainerDecl &C)
Print the Objective-C container name including categories, e.g. MyClass,.
std::string getQualification(ASTContext &Context, const DeclContext *DestContext, SourceLocation InsertionPoint, const NamedDecl *ND)
Gets the nested name specifier necessary for spelling ND in DestContext, at InsertionPoint.
bool isExplicitTemplateSpecialization(const NamedDecl *D)
Indicates if D is an explicit template specialization, e.g.
NamedDecl * getOnlyInstantiation(NamedDecl *TemplatedDecl)
SourceLocation nameLocation(const clang::Decl &D, const SourceManager &SM)
Find the source location of the identifier for D.
NestedNameSpecifierLoc getQualifierLoc(const NamedDecl &ND)
Returns a nested name specifier loc of ND if it was present in the source, e.g.
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.
bool isExpandedFromParameterPack(const ParmVarDecl *D)
Checks whether D is instantiated from a function parameter pack whose type is a bare type parameter p...
bool hasUnstableLinkage(const Decl *D)
Whether we must avoid computing linkage for D during code completion.
std::string printUsingNamespaceName(const ASTContext &Ctx, const UsingDirectiveDecl &D)
Returns the name of the namespace inside the 'using namespace' directive, as written in the code.
bool hasReservedName(const Decl &D)
Returns true if this is a NamedDecl with a reserved name.
std::vector< const Attr * > getAttributes(const DynTypedNode &N)
Return attributes attached directly to a node.
QualType declaredType(const TypeDecl *D)
bool isImplementationDetail(const Decl *D)
Returns true if the declaration is considered implementation detail based on heuristics.
const ObjCImplDecl * getCorrespondingObjCImpl(const ObjCContainerDecl *D)
Return the corresponding implementation/definition for the given ObjC container if it has one,...
bool isImplicitTemplateInstantiation(const NamedDecl *D)
Indicates if D is a template instantiation implicitly generated by the compiler, e....
bool hasReservedScope(const DeclContext &DC)
Returns true if this scope would be written with a reserved name.
std::string printQualifiedName(const NamedDecl &ND)
Returns the qualified name of ND.
TemplateTypeParmTypeLoc getContainedAutoParamType(TypeLoc TL)
bool isDeeplyNested(const Decl *D, unsigned MaxDepth)
Checks whether D is more than MaxDepth away from translation unit scope.
std::string printNamespaceScope(const DeclContext &DC)
Returns the first enclosing namespace scope starting from DC.
std::optional< QualType > getDeducedType(ASTContext &ASTCtx, SourceLocation Loc)
Retrieves the deduced type at a given location (auto, decltype).
std::array< uint8_t, 20 > SymbolID
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//