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/DeclObjC.h"
19 #include "clang/AST/NestedNameSpecifier.h"
20 #include "clang/AST/TypeLoc.h"
21 #include "clang/Basic/SourceLocation.h"
22 #include "clang/Lex/MacroInfo.h"
23 #include "llvm/ADT/StringRef.h"
56 const UsingDirectiveDecl &
D);
61 std::string
printName(
const ASTContext &
Ctx,
const NamedDecl &ND);
94 const SourceManager &SM);
98 std::string
printType(
const QualType QT,
const DeclContext &CurContext,
99 llvm::StringRef Placeholder =
"");
144 std::vector<const Attr *>
getAttributes(
const DynTypedNode &);
161 const DeclContext *DestContext,
162 SourceLocation InsertionPoint,
163 const NamedDecl *ND);
177 const DeclContext *DestContext,
179 llvm::ArrayRef<std::string> VisibleNamespaces);
205 #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 printObjCMethod(const ObjCMethodDecl &Method)
Print the Objective-C method name, including the full container name, 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 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.
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 '>',...
NamedDecl * getOnlyInstantiation(NamedDecl *TemplatedDecl)
bool hasReservedScope(const DeclContext &DC)
Returns true if this scope would be written with a reserved name.
std::array< uint8_t, 20 > SymbolID
TemplateTypeParmTypeLoc getContainedAutoParamType(TypeLoc TL)
SymbolID getSymbolID(const Decl *D)
Gets the symbol ID for a declaration. Returned SymbolID might be null.
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 isDeeplyNested(const Decl *D, unsigned MaxDepth)
Checks whether D is more than MaxDepth away from translation unit scope.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
bool isExplicitTemplateSpecialization(const NamedDecl *D)
Indicates if D is an explicit template specialization, e.g.
bool hasReservedName(const Decl &D)
Returns true if this is a NamedDecl with a reserved name.
bool isImplementationDetail(const Decl *D)
Returns true if the declaration is considered implementation detail based on heuristics.
std::string printObjCContainer(const ObjCContainerDecl &C)
Print the Objective-C container name including categories, e.g. MyClass,.
std::vector< const Attr * > getAttributes(const DynTypedNode &N)
Return attributes attached directly to a node.
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.