Go to the documentation of this file.
13 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H_
14 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H_
17 #include "clang/AST/Decl.h"
18 #include "clang/AST/NestedNameSpecifier.h"
19 #include "clang/Basic/SourceLocation.h"
20 #include "clang/Lex/MacroInfo.h"
21 #include "llvm/ADT/DenseSet.h"
22 #include "llvm/ADT/StringRef.h"
54 const UsingDirectiveDecl &D);
59 std::string
printName(
const ASTContext &
Ctx,
const NamedDecl &ND);
77 llvm::Optional<SymbolID>
getSymbolID(
const llvm::StringRef MacroName,
79 const SourceManager &SM);
83 std::string
printType(
const QualType QT,
const DeclContext &CurContext);
130 const DeclContext *DestContext,
132 const NamedDecl *ND);
146 const DeclContext *DestContext,
148 llvm::ArrayRef<std::string> VisibleNamespaces);
168 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H_
bool hasUnstableLinkage(const Decl *D)
Whether we must avoid computing linkage for D during code completion.
QualType declaredType(const TypeDecl *D)
bool isImplicitTemplateInstantiation(const NamedDecl *D)
Indicates if D is a template instantiation implicitly generated by the compiler, e....
NestedNameSpecifierLoc getQualifierLoc(const NamedDecl &ND)
Returns a nested name specifier loc of ND if it was present in the source, e.g.
std::string printNamespaceScope(const DeclContext &DC)
Returns the first enclosing namespace scope starting from DC.
SourceLocation nameLocation(const clang::Decl &D, const SourceManager &SM)
Find the source location of the identifier for D.
llvm::Optional< QualType > getDeducedType(ASTContext &ASTCtx, SourceLocation Loc)
Retrieves the deduced type at a given location (auto, decltype).
std::string printName(const ASTContext &Ctx, const NamedDecl &ND)
Prints unqualified name of the decl for the purpose of displaying it to the user.
const FunctionDecl * Decl
std::string printQualifiedName(const NamedDecl &ND)
Returns the qualified name of ND.
std::string printTemplateSpecializationArgs(const NamedDecl &ND)
Prints template arguments of a decl as written in the source code, including enclosing '<' and '>',...
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.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
bool isExplicitTemplateSpecialization(const NamedDecl *D)
Indicates if D is an explicit template specialization, e.g.
llvm::Optional< SymbolID > getSymbolID(const Decl *D)
Gets the symbol ID for a declaration, if possible.
SourceLocation Loc
'#' location in the include directive
bool isImplementationDetail(const Decl *D)
Returns true if the declaration is considered implementation detail based on heuristics.
std::string printType(const QualType QT, const DeclContext &CurContext)
Returns a QualType as string.
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.