27#include <clang/AST/Expr.h>
28#include <clang/AST/RecursiveASTVisitor.h>
46 clang::AccessSpecifier access_specifier);
57std::string
get_tag_name(
const clang::TagDecl &declaration);
71 auto qualified_name = declaration.getQualifiedNameAsString();
75 if constexpr (std::is_base_of_v<clang::TagDecl, T>) {
81 return ns.to_string();
84 return qualified_name;
102 const clang::TemplateDecl &declaration);
104std::string
to_string(
const clang::QualType &type,
const clang::ASTContext &ctx,
105 bool try_canonical =
true);
107std::string
to_string(
const clang::RecordType &type,
108 const clang::ASTContext &ctx,
bool try_canonical =
true);
111 const clang::TemplateArgument &arg,
const clang::ASTContext *ctx =
nullptr);
113std::string
to_string(
const clang::Expr *expr);
115std::string
to_string(
const clang::ValueDecl *val);
117std::string
to_string(
const clang::Stmt *stmt);
119std::string
to_string(
const clang::FunctionTemplateDecl *decl);
121std::string
to_string(
const clang::TypeConstraint *tc);
123std::string
to_string(
const clang::TemplateName &templ);
133 clang::SourceRange range,
const clang::SourceManager &sm);
143 clang::SourceRange range,
const clang::SourceManager &sm);
154std::tuple<unsigned int, unsigned int, std::string>
170bool is_subexpr_of(
const clang::Stmt *parent_stmt,
const clang::Stmt *sub_stmt);
183template <>
eid_t to_id(
const std::string &full_name);
185eid_t to_id(
const clang::QualType &type,
const clang::ASTContext &ctx);
187template <>
eid_t to_id(
const clang::NamespaceDecl &declaration);
189template <>
eid_t to_id(
const clang::CXXRecordDecl &declaration);
191template <>
eid_t to_id(
const clang::RecordDecl &declaration);
193template <>
eid_t to_id(
const clang::EnumDecl &declaration);
195template <>
eid_t to_id(
const clang::TagDecl &declaration);
197template <>
eid_t to_id(
const clang::EnumType &type);
199template <>
eid_t to_id(
const clang::TemplateSpecializationType &type);
201template <>
eid_t to_id(
const std::filesystem::path &type);
210std::pair<common::model::namespace_, std::string>
split_ns(
211 const std::string &full_name);
222 const std::string ¶ms,
223 const std::function<std::string(
const std::string &)> &ns_resolve,
227 const std::string &t);
229template <
typename T,
typename P,
typename F>
232 if (pointer ==
nullptr)
235 if (
const auto *dyn_cast_value = clang::dyn_cast<T>(pointer);
237 std::forward<F>(func)(dyn_cast_value);
242 unsigned &line,
unsigned &column);
263 clang::SourceManager &sm, clang::WhileStmt *stmt);
266 clang::SourceManager &sm, clang::CXXForRangeStmt *stmt);
273 clang::SourceManager &sm, clang::ConditionalOperator *stmt);
288std::pair<clang::QualType, std::deque<common::model::context>>
300 const clang::ASTContext &context,
const clang::Stmt *stmt);
303 const clang::ASTContext &context,
const clang::Decl *decl);
306 const clang::ASTContext &context,
const clang::SourceRange &source_range);
322bool is_struct(
const clang::NamedDecl *decl);
331bool has_attr(
const clang::FunctionDecl *decl, clang::attr::Kind function_attr);
340std::optional<size_t>
get_array_size(
const clang::ArrayType &type);