28#include <clang/AST/Expr.h>
29#include <clang/AST/RecursiveASTVisitor.h>
47 clang::AccessSpecifier access_specifier);
49 clang::ObjCIvarDecl::AccessControl access_specifier);
59std::string
get_tag_name(
const clang::TagDecl &declaration);
73 auto qualified_name = declaration.getQualifiedNameAsString();
77 if constexpr (std::is_base_of_v<clang::TagDecl, T>) {
83 return ns.to_string();
86 return qualified_name;
104 const clang::TemplateDecl &declaration);
106std::string to_string(
107 const clang::TemplateArgumentLoc &argLoc,
const clang::ASTContext &context);
109std::string to_string(
const clang::QualType &type,
const clang::ASTContext &ctx,
110 bool try_canonical =
true);
112std::string to_string(
const clang::RecordType &type,
113 const clang::ASTContext &ctx,
bool try_canonical =
true);
115std::string to_string(
116 const clang::TemplateArgument &arg,
const clang::ASTContext *ctx =
nullptr);
118std::string to_string(
const clang::Expr *expr);
120std::string to_string(
const clang::ValueDecl *val);
122std::string to_string(
const clang::Stmt *stmt);
124std::string to_string(
const clang::FunctionTemplateDecl *decl);
126std::string to_string(
const clang::TypeConstraint *tc);
128std::string to_string(
const clang::TemplateName &templ);
138 clang::SourceRange range,
const clang::SourceManager &sm);
148 clang::SourceRange range,
const clang::SourceManager &sm);
159std::tuple<unsigned int, unsigned int, std::string>
175bool is_subexpr_of(
const clang::Stmt *parent_stmt,
const clang::Stmt *sub_stmt);
188template <>
eid_t to_id(
const std::string &full_name);
190eid_t to_id(
const clang::QualType &type,
const clang::ASTContext &ctx);
192template <>
eid_t to_id(
const clang::NamespaceDecl &declaration);
194template <>
eid_t to_id(
const clang::CXXRecordDecl &declaration);
196template <>
eid_t to_id(
const clang::RecordDecl &declaration);
198template <>
eid_t to_id(
const clang::ObjCCategoryDecl &type);
200template <>
eid_t to_id(
const clang::ObjCInterfaceDecl &type);
202template <>
eid_t to_id(
const clang::ObjCProtocolDecl &type);
204template <>
eid_t to_id(
const clang::EnumDecl &declaration);
206template <>
eid_t to_id(
const clang::TagDecl &declaration);
208template <>
eid_t to_id(
const clang::EnumType &type);
210template <>
eid_t to_id(
const clang::TemplateSpecializationType &type);
212template <>
eid_t to_id(
const std::filesystem::path &type);
221std::pair<common::model::namespace_, std::string>
split_ns(
222 const std::string &full_name);
233 const std::string ¶ms,
234 const std::function<std::string(
const std::string &)> &ns_resolve,
238 const std::string &t);
240template <
typename T,
typename P,
typename F>
243 if (pointer ==
nullptr)
246 if (
const auto *dyn_cast_value = clang::dyn_cast<T>(pointer);
248 std::forward<F>(func)(dyn_cast_value);
253 unsigned &line,
unsigned &column);
274 clang::SourceManager &sm, clang::WhileStmt *stmt);
277 clang::SourceManager &sm, clang::CXXForRangeStmt *stmt);
284 clang::SourceManager &sm, clang::ConditionalOperator *stmt);
299std::pair<clang::QualType, std::deque<common::model::context>>
311 const clang::ASTContext &context,
const clang::Stmt *stmt);
314 const clang::ASTContext &context,
const clang::Decl *decl);
317 const clang::ASTContext &context,
const clang::SourceRange &source_range);
320 const clang::SourceLocation &location,
322 std::filesystem::path tu_path,
323 std::filesystem::path relative_to_path_ = {});
339bool is_struct(
const clang::NamedDecl *decl);
348bool has_attr(
const clang::FunctionDecl *decl, clang::attr::Kind function_attr);
357std::optional<size_t>
get_array_size(
const clang::ArrayType &type);