Refactored cx utils to clang_utils

This commit is contained in:
Bartek Kryza
2023-01-25 22:42:49 +01:00
parent 9a7d66f93f
commit 21e7c3d3a0
11 changed files with 129 additions and 188 deletions

View File

@@ -18,7 +18,6 @@
#include "translation_unit_visitor.h"
#include "common/clang_utils.h"
#include "cx/util.h"
#include <clang/Basic/FileManager.h>
#include <clang/Lex/Preprocessor.h>
@@ -1358,9 +1357,8 @@ void translation_unit_visitor::process_template_specialization_argument(
declaration_text.find(cls->getNameAsString()) +
cls->getNameAsString().size() + 1);
auto template_params =
cx::util::parse_unexposed_template_params(
declaration_text, [](const auto &t) { return t; });
auto template_params = common::parse_unexposed_template_params(
declaration_text, [](const auto &t) { return t; });
if (template_params.size() > argument_index)
type_name = template_params[argument_index].to_string(
@@ -1404,9 +1402,8 @@ void translation_unit_visitor::process_template_specialization_argument(
declaration_text.find(cls->getNameAsString()) +
cls->getNameAsString().size() + 1);
auto template_params =
cx::util::parse_unexposed_template_params(
declaration_text, [](const auto &t) { return t; });
auto template_params = common::parse_unexposed_template_params(
declaration_text, [](const auto &t) { return t; });
if (template_params.size() > argument_index)
type_name = template_params[argument_index].to_string(
@@ -1472,7 +1469,7 @@ void translation_unit_visitor::
process_unexposed_template_specialization_parameters(
const std::string &type_name, template_parameter &tp, class_ &c)
{
auto template_params = cx::util::parse_unexposed_template_params(
auto template_params = common::parse_unexposed_template_params(
type_name, [](const std::string &t) { return t; });
found_relationships_t relationships;
@@ -2211,7 +2208,7 @@ void translation_unit_visitor::process_field(
[&d = diagram()](const std::string &full_name) {
if (full_name.empty())
return false;
auto [ns, name] = cx::util::split_ns(full_name);
auto [ns, name] = common::split_ns(full_name);
return d.should_include(ns, name);
});
}