21#include "glob/glob.hpp"
106 return "function_template";
110 return "cuda_kernel";
112 return "cuda_device";
212 const std::string &element_type)
const
214 if (
style.count(element_type) == 0)
217 return style.at(element_type);
279 std::string full_name)
const
286 auto matched_in_iteration{
false};
287 for (
const auto &[pattern, replacement] : aliases) {
288 matched_in_iteration =
290 matched_in_iteration;
292 matched = matched_in_iteration;
305 const std::vector<std::string> &compilation_database_files)
const
309 if (!
glob.has_value) {
310 return compilation_database_files;
315 std::vector<std::string> result{};
319 for (
const auto &g :
glob()) {
321 LOG_DBG(
"Searching glob regex {}", g.to_string());
323 std::regex regex_pattern(
324 g.to_string(), std::regex_constants::optimize);
326 std::copy_if(compilation_database_files.begin(),
327 compilation_database_files.end(), std::back_inserter(result),
328 [®ex_pattern](
const auto &tu) {
330 return std::regex_search(tu, m, regex_pattern);
334 std::filesystem::path absolute_glob_path{g.to_string()};
337 if (!absolute_glob_path.has_root_name())
339 if (!absolute_glob_path.is_absolute())
343 LOG_DBG(
"Searching glob path {}", absolute_glob_path.string());
345 auto matches = glob::glob(absolute_glob_path.string(),
true,
false);
347 for (
const auto &match : matches) {
351 result.emplace_back(path.string());
365 const std::filesystem::path &p)
const
371 const std::optional<std::string> &maybe_module)
const
394 const std::string &full_name)
const
398 for (
const auto &[hint_target, hints] :
layout()) {
399 for (
const auto &hint : hints) {
401 const auto &together_others =
402 std::get<std::vector<std::string>>(hint.entity);
404 if ((full_name == hint_target) ||
408 if ((relative_name == hint_target) ||
420 if (
type_aliases().count(
"std::basic_string<char>") == 0U) {
421 type_aliases().insert({
"std::basic_string<char>",
"std::string"});
423 if (
type_aliases().count(
"std::basic_string<char,std::char_traits<"
424 "char>,std::allocator<char>>") == 0U) {
425 type_aliases().insert({
"std::basic_string<char,std::char_traits<"
426 "char>,std::allocator<char>>",
429 if (
type_aliases().count(
"std::basic_string<wchar_t>") == 0U) {
430 type_aliases().insert({
"std::basic_string<wchar_t>",
"std::wstring"});
432 if (
type_aliases().count(
"std::basic_string<char16_t>") == 0U) {
434 {
"std::basic_string<char16_t>",
"std::u16string"});
436 if (
type_aliases().count(
"std::basic_string<char32_t>") == 0U) {
438 {
"std::basic_string<char32_t>",
"std::u32string"});
440 if (
type_aliases().count(
"std::integral_constant<bool,true>") == 0U) {
442 {
"std::integral_constant<bool,true>",
"std::true_type"});
444 if (
type_aliases().count(
"std::integral_constant<bool,false>") == 0U) {
446 {
"std::integral_constant<bool,false>",
"std::false_type"});
448#if LLVM_VERSION_MAJOR >= 16
450 type_aliases().insert({
"std::basic_string",
"std::string"});
487 {
"std::shared_ptr", {relationship_t::kAssociation}});
491 {
"std::weak_ptr", {relationship_t::kAssociation}});