Fixed release build
This commit is contained in:
@@ -250,6 +250,7 @@ void generator::generate_relationships(
|
|||||||
|
|
||||||
std::stringstream all_relations_str;
|
std::stringstream all_relations_str;
|
||||||
std::set<std::string> unique_relations;
|
std::set<std::string> unique_relations;
|
||||||
|
|
||||||
for (const auto &r : c.relationships()) {
|
for (const auto &r : c.relationships()) {
|
||||||
if (!m_model.should_include(r.type()))
|
if (!m_model.should_include(r.type()))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public:
|
|||||||
class_member(common::model::access_t access, const std::string &name,
|
class_member(common::model::access_t access, const std::string &name,
|
||||||
const std::string &type);
|
const std::string &type);
|
||||||
|
|
||||||
|
virtual ~class_member() = default;
|
||||||
|
|
||||||
bool is_relationship() const;
|
bool is_relationship() const;
|
||||||
void is_relationship(bool is_relationship);
|
void is_relationship(bool is_relationship);
|
||||||
|
|
||||||
|
|||||||
@@ -139,8 +139,9 @@ bool diagram::add_class(std::unique_ptr<class_> &&c)
|
|||||||
|
|
||||||
const auto &el = get_element<class_>(name_and_ns).value();
|
const auto &el = get_element<class_>(name_and_ns).value();
|
||||||
|
|
||||||
assert(el.name() == name);
|
if ((el.name() != name) || !(el.get_relative_namespace() == ns))
|
||||||
assert(el.get_relative_namespace() == ns);
|
throw std::runtime_error(
|
||||||
|
"Invalid element stored in the diagram tree");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void translation_unit_visitor::operator()(const cppast::cpp_entity &file)
|
|||||||
|
|
||||||
auto &cls = static_cast<const cppast::cpp_class &>(e);
|
auto &cls = static_cast<const cppast::cpp_class &>(e);
|
||||||
if (cppast::get_definition(ctx.entity_index(), cls)) {
|
if (cppast::get_definition(ctx.entity_index(), cls)) {
|
||||||
auto &clsdef = static_cast<const cppast::cpp_class &>(
|
const auto &clsdef = static_cast<const cppast::cpp_class &>(
|
||||||
cppast::get_definition(ctx.entity_index(), cls)
|
cppast::get_definition(ctx.entity_index(), cls)
|
||||||
.value());
|
.value());
|
||||||
if (&cls != &clsdef) {
|
if (&cls != &clsdef) {
|
||||||
@@ -862,7 +862,7 @@ void translation_unit_visitor::process_field(
|
|||||||
if (m.skip())
|
if (m.skip())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto &tr = cx::util::unreferenced(cppast::remove_cv(mv.type()));
|
const auto &tr = cx::util::unreferenced(cppast::remove_cv(mv.type()));
|
||||||
|
|
||||||
auto tr_declaration = cppast::to_string(tr);
|
auto tr_declaration = cppast::to_string(tr);
|
||||||
|
|
||||||
@@ -995,7 +995,8 @@ void translation_unit_visitor::process_method(
|
|||||||
if (m.skip())
|
if (m.skip())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (auto ¶m : mf.parameters())
|
const auto params = mf.parameters();
|
||||||
|
for (auto ¶m : params)
|
||||||
process_function_parameter(param, m, c);
|
process_function_parameter(param, m, c);
|
||||||
|
|
||||||
LOG_DBG("Adding method: {}", m.name());
|
LOG_DBG("Adding method: {}", m.name());
|
||||||
@@ -1040,11 +1041,13 @@ void translation_unit_visitor::process_template_method(
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
std::set<std::string> template_parameter_names;
|
std::set<std::string> template_parameter_names;
|
||||||
for (const auto &template_parameter : mf.parameters()) {
|
const auto template_params = mf.parameters();
|
||||||
|
for (const auto &template_parameter : template_params) {
|
||||||
template_parameter_names.emplace(template_parameter.name());
|
template_parameter_names.emplace(template_parameter.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto ¶m : mf.function().parameters())
|
const auto params = mf.function().parameters();
|
||||||
|
for (auto ¶m : params)
|
||||||
process_function_parameter(param, m, c, template_parameter_names);
|
process_function_parameter(param, m, c, template_parameter_names);
|
||||||
|
|
||||||
LOG_DBG("Adding template method: {}", m.name());
|
LOG_DBG("Adding template method: {}", m.name());
|
||||||
@@ -1229,6 +1232,9 @@ void translation_unit_visitor::
|
|||||||
auto &template_instantiation_type =
|
auto &template_instantiation_type =
|
||||||
static_cast<const cppast::cpp_template_instantiation_type &>(t);
|
static_cast<const cppast::cpp_template_instantiation_type &>(t);
|
||||||
|
|
||||||
|
const auto &full_name =
|
||||||
|
cx::util::full_name(cppast::remove_cv(t), ctx.entity_index(), false);
|
||||||
|
|
||||||
if (template_instantiation_type.primary_template()
|
if (template_instantiation_type.primary_template()
|
||||||
.get(ctx.entity_index())
|
.get(ctx.entity_index())
|
||||||
.size()) {
|
.size()) {
|
||||||
@@ -1241,8 +1247,8 @@ void translation_unit_visitor::
|
|||||||
LOG_DBG("Processing template method argument exposed "
|
LOG_DBG("Processing template method argument exposed "
|
||||||
"parameters...");
|
"parameters...");
|
||||||
|
|
||||||
for (const auto &template_argument :
|
const auto targs = template_instantiation_type.arguments();
|
||||||
template_instantiation_type.arguments().value()) {
|
for (const auto &template_argument : targs.value()) {
|
||||||
if (!template_argument.type().has_value())
|
if (!template_argument.type().has_value())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1272,18 +1278,18 @@ void translation_unit_visitor::
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (template_is_not_instantiation) {
|
if (template_is_not_instantiation) {
|
||||||
|
relationship rr{relationship_t::kDependency, full_name};
|
||||||
|
|
||||||
LOG_DBG("Template is not an instantiation - "
|
LOG_DBG("Template is not an instantiation - "
|
||||||
"only adding reference to template {}",
|
"only adding reference to template {}",
|
||||||
cx::util::full_name(
|
full_name);
|
||||||
cppast::remove_cv(t), ctx.entity_index(), false));
|
|
||||||
relationship rr{relationship_t::kDependency,
|
|
||||||
cx::util::full_name(
|
|
||||||
cppast::remove_cv(t), ctx.entity_index(), false)};
|
|
||||||
LOG_DBG("Adding field template dependency relationship "
|
LOG_DBG("Adding field template dependency relationship "
|
||||||
"{} {} {} "
|
"{} {} {} "
|
||||||
": {}",
|
": {}",
|
||||||
rr.destination(), common::model::to_string(rr.type()),
|
rr.destination(), common::model::to_string(rr.type()),
|
||||||
c.full_name(), rr.label());
|
c.full_name(), rr.label());
|
||||||
|
|
||||||
c.add_relationship(std::move(rr));
|
c.add_relationship(std::move(rr));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1483,8 +1489,6 @@ bool translation_unit_visitor::find_relationships_in_template_instantiation(
|
|||||||
assert(tinst.arguments().has_value());
|
assert(tinst.arguments().has_value());
|
||||||
assert(tinst.arguments().value().size() > 0u);
|
assert(tinst.arguments().value().size() > 0u);
|
||||||
|
|
||||||
[[maybe_unused]] const auto args_count = tinst.arguments().value().size();
|
|
||||||
|
|
||||||
const auto args = tinst.arguments().value();
|
const auto args = tinst.arguments().value();
|
||||||
|
|
||||||
const auto [ns, base_name] = cx::util::split_ns(fn);
|
const auto [ns, base_name] = cx::util::split_ns(fn);
|
||||||
@@ -1542,7 +1546,8 @@ bool translation_unit_visitor::find_relationships_in_user_defined_type(
|
|||||||
const std::string &fn, relationship_t &relationship_type,
|
const std::string &fn, relationship_t &relationship_type,
|
||||||
const cppast::cpp_type &t) const
|
const cppast::cpp_type &t) const
|
||||||
{
|
{
|
||||||
bool found;
|
bool found{false};
|
||||||
|
|
||||||
LOG_DBG("Finding relationships in user defined type: {} | {}",
|
LOG_DBG("Finding relationships in user defined type: {} | {}",
|
||||||
cppast::to_string(t_), cppast::to_string(t_.canonical()));
|
cppast::to_string(t_), cppast::to_string(t_.canonical()));
|
||||||
|
|
||||||
@@ -1715,7 +1720,8 @@ std::unique_ptr<class_> translation_unit_visitor::build_template_instantiation(
|
|||||||
// to the variadic tuple
|
// to the variadic tuple
|
||||||
auto has_variadic_params = false;
|
auto has_variadic_params = false;
|
||||||
|
|
||||||
for (const auto &targ : t.arguments().value()) {
|
const auto targs = t.arguments().value();
|
||||||
|
for (const auto &targ : targs) {
|
||||||
template_parameter ct;
|
template_parameter ct;
|
||||||
if (targ.type()) {
|
if (targ.type()) {
|
||||||
build_template_instantiation_process_type_argument(
|
build_template_instantiation_process_type_argument(
|
||||||
@@ -1821,14 +1827,16 @@ void translation_unit_visitor::
|
|||||||
build_template_instantiation_process_expression_argument(
|
build_template_instantiation_process_expression_argument(
|
||||||
const cppast::cpp_template_argument &targ, template_parameter &ct) const
|
const cppast::cpp_template_argument &targ, template_parameter &ct) const
|
||||||
{
|
{
|
||||||
const auto &exp = targ.expression().value();
|
const auto exp = targ.expression();
|
||||||
if (exp.kind() == cppast::cpp_expression_kind::literal_t)
|
if (exp.value().kind() == cppast::cpp_expression_kind::literal_t)
|
||||||
ct.set_type(
|
ct.set_type(
|
||||||
static_cast<const cppast::cpp_literal_expression &>(exp).value());
|
static_cast<const cppast::cpp_literal_expression &>(exp.value())
|
||||||
else if (exp.kind() == cppast::cpp_expression_kind::unexposed_t)
|
.value());
|
||||||
ct.set_type(static_cast<const cppast::cpp_unexposed_expression &>(exp)
|
else if (exp.value().kind() == cppast::cpp_expression_kind::unexposed_t)
|
||||||
.expression()
|
ct.set_type(
|
||||||
.as_string());
|
static_cast<const cppast::cpp_unexposed_expression &>(exp.value())
|
||||||
|
.expression()
|
||||||
|
.as_string());
|
||||||
|
|
||||||
LOG_DBG("Template argument is an expression {}", ct.name());
|
LOG_DBG("Template argument is an expression {}", ct.name());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ std::string to_string(relationship_t r)
|
|||||||
return "alias";
|
return "alias";
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +63,7 @@ std::string to_string(access_t a)
|
|||||||
return "private";
|
return "private";
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +76,7 @@ std::string to_string(message_t r)
|
|||||||
return "return";
|
return "return";
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +93,7 @@ std::string to_string(const diagram_t t)
|
|||||||
return "include";
|
return "include";
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ std::string to_string(const hint_t t)
|
|||||||
return "right";
|
return "right";
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ bool translation_unit_visitor::find_relationships(const cppast::cpp_type &t_,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (t.kind() == cppast::cpp_type_kind::template_instantiation_t) {
|
else if (t.kind() == cppast::cpp_type_kind::template_instantiation_t) {
|
||||||
auto &tinst =
|
const auto &tinst =
|
||||||
static_cast<const cppast::cpp_template_instantiation_type &>(t);
|
static_cast<const cppast::cpp_template_instantiation_type &>(t);
|
||||||
|
|
||||||
if (!tinst.arguments_exposed()) {
|
if (!tinst.arguments_exposed()) {
|
||||||
@@ -443,7 +443,7 @@ bool translation_unit_visitor::find_relationships(const cppast::cpp_type &t_,
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto &args = tinst.arguments().value();
|
const auto args = tinst.arguments().value();
|
||||||
|
|
||||||
// Try to match common containers
|
// Try to match common containers
|
||||||
// TODO: Refactor to a separate class with configurable
|
// TODO: Refactor to a separate class with configurable
|
||||||
|
|||||||
2
thirdparty/glob/glob.hpp
vendored
2
thirdparty/glob/glob.hpp
vendored
@@ -267,7 +267,7 @@ static inline std::vector<fs::path> rlistdir(
|
|||||||
// This helper function recursively yields relative pathnames inside a literal
|
// This helper function recursively yields relative pathnames inside a literal
|
||||||
// directory.
|
// directory.
|
||||||
static inline std::vector<fs::path> glob2(
|
static inline std::vector<fs::path> glob2(
|
||||||
const fs::path &dirname, const std::string &pattern, bool dironly)
|
const fs::path &dirname, [[maybe_unused]] const std::string &pattern, bool dironly)
|
||||||
{
|
{
|
||||||
// std::cout << "In glob2\n";
|
// std::cout << "In glob2\n";
|
||||||
std::vector<fs::path> result;
|
std::vector<fs::path> result;
|
||||||
|
|||||||
Reference in New Issue
Block a user