12 #include "clang/AST/AST.h"
13 #include "clang/AST/ASTContext.h"
14 #include "llvm/Support/Path.h"
21 const auto fileName = [&]() -> std::string_view {
22 if(llvm::sys::path::is_separator(loc.file_name()[0])) {
23 return llvm::sys::path::filename(loc.file_name());
26 return loc.file_name();
30 "/* INSIGHTS-TODO: "sv, fileName,
":"sv, loc.line(),
" stmt: "sv, name,
kwSpaceCCommentEnd);
36 const std::string_view name = [&]() {
37 if(stmt and stmt->getStmtClassName()) {
40 return stmt->getStmtClassName();
43 Error(
"arg urg: class name is empty\n");
48 ToDo(name, outputFormatHelper, loc);
54 const std::string_view name = [&]() {
55 if(stmt and stmt->getDeclKindName()) {
57 return stmt->getDeclKindName();
60 Error(
"decl urg: class name is empty\n");
65 ToDo(name, outputFormatHelper, loc);
69 void ToDo(
const class TemplateArgument& stmt,
class OutputFormatHelper& outputFormatHelper, std::source_location loc)
71 const std::string_view name{
StrCat(
"tmplArgKind: ", stmt.getKind())};
73 ToDo(name, outputFormatHelper, loc);
constexpr std::string_view kwSpaceCCommentEnd
static void ToDo(std::string_view name, OutputFormatHelper &outputFormatHelper, std::source_location loc)
void Error(const char *fmt, const auto &... args)
Log an error.
void Dump([[maybe_unused]] const auto *stmt)
std::string StrCat(const auto &... args)