Removed unused code
This commit is contained in:
@@ -24,7 +24,6 @@
|
|||||||
#include "common/generators/plantuml/generator.h"
|
#include "common/generators/plantuml/generator.h"
|
||||||
#include "common/model/relationship.h"
|
#include "common/model/relationship.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/compilation_database.h"
|
|
||||||
#include "util/util.h"
|
#include "util/util.h"
|
||||||
|
|
||||||
#include <cppast/cpp_entity_index.hpp>
|
#include <cppast/cpp_entity_index.hpp>
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "translation_unit_visitor.h"
|
#include "translation_unit_visitor.h"
|
||||||
|
|
||||||
|
#include "cx/util.h"
|
||||||
|
|
||||||
#include <cppast/cpp_alias_template.hpp>
|
#include <cppast/cpp_alias_template.hpp>
|
||||||
#include <cppast/cpp_array_type.hpp>
|
#include <cppast/cpp_array_type.hpp>
|
||||||
#include <cppast/cpp_class_template.hpp>
|
#include <cppast/cpp_class_template.hpp>
|
||||||
@@ -789,7 +791,7 @@ void translation_unit_visitor::process_field(
|
|||||||
auto tr_declaration = cppast::to_string(tr);
|
auto tr_declaration = cppast::to_string(tr);
|
||||||
|
|
||||||
LOG_DBG("Processing field {} with unreferenced type of kind {}", mv.name(),
|
LOG_DBG("Processing field {} with unreferenced type of kind {}", mv.name(),
|
||||||
cx::to_string(tr.kind()));
|
cppast::to_string(tr.kind()));
|
||||||
|
|
||||||
if (tr.kind() == cppast::cpp_type_kind::builtin_t) {
|
if (tr.kind() == cppast::cpp_type_kind::builtin_t) {
|
||||||
LOG_DBG("Builtin type found for field: {}", m.name());
|
LOG_DBG("Builtin type found for field: {}", m.name());
|
||||||
@@ -1323,7 +1325,7 @@ bool translation_unit_visitor::find_relationships(const cppast::cpp_type &t_,
|
|||||||
cx::util::full_name(cppast::remove_cv(t_), ctx.entity_index(), false);
|
cx::util::full_name(cppast::remove_cv(t_), ctx.entity_index(), false);
|
||||||
|
|
||||||
LOG_DBG("Finding relationships for type {}, {}, {}", cppast::to_string(t_),
|
LOG_DBG("Finding relationships for type {}, {}, {}", cppast::to_string(t_),
|
||||||
cx::to_string(t_.kind()), fn);
|
cppast::to_string(t_.kind()), fn);
|
||||||
|
|
||||||
relationship_t relationship_type = relationship_hint;
|
relationship_t relationship_type = relationship_hint;
|
||||||
const auto &t = cppast::remove_cv(cx::util::unreferenced(t_));
|
const auto &t = cppast::remove_cv(cx::util::unreferenced(t_));
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#include "class_diagram/model/diagram.h"
|
#include "class_diagram/model/diagram.h"
|
||||||
#include "class_diagram/visitor/translation_unit_context.h"
|
#include "class_diagram/visitor/translation_unit_context.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/cursor.h"
|
|
||||||
|
|
||||||
#include <clang-c/CXCompilationDatabase.h>
|
#include <clang-c/CXCompilationDatabase.h>
|
||||||
#include <clang-c/Index.h>
|
#include <clang-c/Index.h>
|
||||||
|
|||||||
@@ -32,54 +32,6 @@ namespace clanguml {
|
|||||||
namespace cx {
|
namespace cx {
|
||||||
namespace util {
|
namespace util {
|
||||||
|
|
||||||
std::string to_string(CXString &&cxs)
|
|
||||||
{
|
|
||||||
std::string r{clang_getCString(cxs)};
|
|
||||||
clang_disposeString(cxs);
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string to_string(cppast::cpp_type_kind t)
|
|
||||||
{
|
|
||||||
using namespace cppast;
|
|
||||||
switch (t) {
|
|
||||||
case cpp_type_kind::builtin_t:
|
|
||||||
return "builtin";
|
|
||||||
case cpp_type_kind::user_defined_t:
|
|
||||||
return "user_defined";
|
|
||||||
case cpp_type_kind::auto_t:
|
|
||||||
return "auto";
|
|
||||||
case cpp_type_kind::decltype_t:
|
|
||||||
return "decltype";
|
|
||||||
case cpp_type_kind::decltype_auto_t:
|
|
||||||
return "decltype_auto";
|
|
||||||
case cpp_type_kind::cv_qualified_t:
|
|
||||||
return "cv_qualified";
|
|
||||||
case cpp_type_kind::pointer_t:
|
|
||||||
return "pointer";
|
|
||||||
case cpp_type_kind::reference_t:
|
|
||||||
return "reference";
|
|
||||||
case cpp_type_kind::array_t:
|
|
||||||
return "array";
|
|
||||||
case cpp_type_kind::function_t:
|
|
||||||
return "function";
|
|
||||||
case cpp_type_kind::member_function_t:
|
|
||||||
return "member_function";
|
|
||||||
case cpp_type_kind::member_object_t:
|
|
||||||
return "member_object";
|
|
||||||
case cpp_type_kind::template_parameter_t:
|
|
||||||
return "template_parameter";
|
|
||||||
case cpp_type_kind::template_instantiation_t:
|
|
||||||
return "template_instantiation";
|
|
||||||
case cpp_type_kind::dependent_t:
|
|
||||||
return "dependent";
|
|
||||||
case cpp_type_kind::unexposed_t:
|
|
||||||
return "unexposed";
|
|
||||||
default:
|
|
||||||
return "invalid";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string full_name(
|
std::string full_name(
|
||||||
const common::model::namespace_ ¤t_ns, const cppast::cpp_entity &e)
|
const common::model::namespace_ ¤t_ns, const cppast::cpp_entity &e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,20 +31,6 @@ namespace clanguml {
|
|||||||
namespace cx {
|
namespace cx {
|
||||||
namespace util {
|
namespace util {
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Convert CXString to std::string
|
|
||||||
*
|
|
||||||
* This function creates a new std::string from a CXString
|
|
||||||
* and releases the CXString.
|
|
||||||
*
|
|
||||||
* @param cxs libclang string instance
|
|
||||||
*
|
|
||||||
* @return std::string instance
|
|
||||||
*/
|
|
||||||
std::string to_string(CXString &&cxs);
|
|
||||||
|
|
||||||
std::string to_string(cppast::cpp_type_kind t);
|
|
||||||
|
|
||||||
std::string full_name(
|
std::string full_name(
|
||||||
const common::model::namespace_ ¤t_ns, const cppast::cpp_entity &e);
|
const common::model::namespace_ ¤t_ns, const cppast::cpp_entity &e);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include "common/model/relationship.h"
|
#include "common/model/relationship.h"
|
||||||
#include "common/model/source_file.h"
|
#include "common/model/source_file.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/compilation_database.h"
|
|
||||||
#include "include_diagram/model/diagram.h"
|
#include "include_diagram/model/diagram.h"
|
||||||
#include "include_diagram/visitor/translation_unit_visitor.h"
|
#include "include_diagram/visitor/translation_unit_visitor.h"
|
||||||
#include "util/util.h"
|
#include "util/util.h"
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#include "common/model/enums.h"
|
#include "common/model/enums.h"
|
||||||
#include "common/model/package.h"
|
#include "common/model/package.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/cursor.h"
|
|
||||||
#include "include_diagram/model/diagram.h"
|
#include "include_diagram/model/diagram.h"
|
||||||
#include "include_diagram/visitor/translation_unit_context.h"
|
#include "include_diagram/visitor/translation_unit_context.h"
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include "class_diagram/generators/plantuml/class_diagram_generator.h"
|
#include "class_diagram/generators/plantuml/class_diagram_generator.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/compilation_database.h"
|
|
||||||
#include "include_diagram/generators/plantuml/include_diagram_generator.h"
|
#include "include_diagram/generators/plantuml/include_diagram_generator.h"
|
||||||
#include "package_diagram/generators/plantuml/package_diagram_generator.h"
|
#include "package_diagram/generators/plantuml/package_diagram_generator.h"
|
||||||
#include "sequence_diagram/generators/plantuml/sequence_diagram_generator.h"
|
#include "sequence_diagram/generators/plantuml/sequence_diagram_generator.h"
|
||||||
@@ -38,7 +37,6 @@
|
|||||||
|
|
||||||
using namespace clanguml;
|
using namespace clanguml;
|
||||||
using config::config;
|
using config::config;
|
||||||
using cx::compilation_database;
|
|
||||||
|
|
||||||
void print_diagrams_list(const clanguml::config::config &cfg);
|
void print_diagrams_list(const clanguml::config::config &cfg);
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
#include "common/model/package.h"
|
#include "common/model/package.h"
|
||||||
#include "common/model/relationship.h"
|
#include "common/model/relationship.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/compilation_database.h"
|
|
||||||
#include "package_diagram/model/diagram.h"
|
#include "package_diagram/model/diagram.h"
|
||||||
#include "package_diagram/visitor/translation_unit_visitor.h"
|
#include "package_diagram/visitor/translation_unit_visitor.h"
|
||||||
#include "util/util.h"
|
#include "util/util.h"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "translation_unit_visitor.h"
|
#include "translation_unit_visitor.h"
|
||||||
|
|
||||||
#include "common/model/namespace.h"
|
#include "common/model/namespace.h"
|
||||||
|
#include "cx/util.h"
|
||||||
|
|
||||||
#include <cppast/cpp_alias_template.hpp>
|
#include <cppast/cpp_alias_template.hpp>
|
||||||
#include <cppast/cpp_array_type.hpp>
|
#include <cppast/cpp_array_type.hpp>
|
||||||
@@ -412,7 +413,7 @@ bool translation_unit_visitor::find_relationships(const cppast::cpp_type &t_,
|
|||||||
const auto fn_ns = cx::util::ns(cppast::remove_cv(t_), ctx.entity_index());
|
const auto fn_ns = cx::util::ns(cppast::remove_cv(t_), ctx.entity_index());
|
||||||
|
|
||||||
LOG_DBG("Finding relationships for type {}, {}, {}", cppast::to_string(t_),
|
LOG_DBG("Finding relationships for type {}, {}, {}", cppast::to_string(t_),
|
||||||
cx::to_string(t_.kind()), fn);
|
cppast::to_string(t_.kind()), fn);
|
||||||
|
|
||||||
relationship_t relationship_type = relationship_hint;
|
relationship_t relationship_type = relationship_hint;
|
||||||
const auto &t = cppast::remove_cv(cx::util::unreferenced(t_));
|
const auto &t = cppast::remove_cv(cx::util::unreferenced(t_));
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/cursor.h"
|
|
||||||
#include "package_diagram/model/diagram.h"
|
#include "package_diagram/model/diagram.h"
|
||||||
#include "package_diagram/visitor/translation_unit_context.h"
|
#include "package_diagram/visitor/translation_unit_context.h"
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include "common/generators/plantuml/generator.h"
|
#include "common/generators/plantuml/generator.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/compilation_database.h"
|
|
||||||
#include "sequence_diagram/model/diagram.h"
|
#include "sequence_diagram/model/diagram.h"
|
||||||
#include "sequence_diagram/visitor/translation_unit_visitor.h"
|
#include "sequence_diagram/visitor/translation_unit_visitor.h"
|
||||||
#include "util/util.h"
|
#include "util/util.h"
|
||||||
|
|||||||
@@ -62,14 +62,4 @@ const cppast::cpp_entity_index &translation_unit_context::entity_index() const
|
|||||||
return entity_index_;
|
return entity_index_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void translation_unit_context::set_current_method(cx::cursor method)
|
|
||||||
{
|
|
||||||
current_method_ = method;
|
|
||||||
}
|
|
||||||
|
|
||||||
cx::cursor &translation_unit_context::current_method()
|
|
||||||
{
|
|
||||||
return current_method_;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/cursor.h"
|
|
||||||
#include "sequence_diagram/model/diagram.h"
|
#include "sequence_diagram/model/diagram.h"
|
||||||
|
|
||||||
#include <cppast/cpp_entity_index.hpp>
|
#include <cppast/cpp_entity_index.hpp>
|
||||||
@@ -47,10 +46,6 @@ public:
|
|||||||
|
|
||||||
clanguml::sequence_diagram::model::diagram &diagram();
|
clanguml::sequence_diagram::model::diagram &diagram();
|
||||||
|
|
||||||
void set_current_method(cx::cursor method);
|
|
||||||
|
|
||||||
cx::cursor ¤t_method();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Reference to the cppast entity index
|
// Reference to the cppast entity index
|
||||||
cppast::cpp_entity_index &entity_index_;
|
cppast::cpp_entity_index &entity_index_;
|
||||||
@@ -58,7 +53,6 @@ private:
|
|||||||
const clanguml::config::sequence_diagram &config_;
|
const clanguml::config::sequence_diagram &config_;
|
||||||
|
|
||||||
std::vector<std::string> namespace_;
|
std::vector<std::string> namespace_;
|
||||||
cx::cursor current_method_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "translation_unit_visitor.h"
|
#include "translation_unit_visitor.h"
|
||||||
|
|
||||||
#include "common/model/namespace.h"
|
#include "common/model/namespace.h"
|
||||||
|
#include "cx/util.h"
|
||||||
#include "translation_unit_context.h"
|
#include "translation_unit_context.h"
|
||||||
|
|
||||||
#include <cppast/cpp_function.hpp>
|
#include <cppast/cpp_function.hpp>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/cursor.h"
|
|
||||||
#include "sequence_diagram/model/diagram.h"
|
#include "sequence_diagram/model/diagram.h"
|
||||||
#include "sequence_diagram/visitor/translation_unit_context.h"
|
#include "sequence_diagram/visitor/translation_unit_context.h"
|
||||||
|
|
||||||
|
|||||||
@@ -40,17 +40,6 @@ load_config(const std::string &test_name)
|
|||||||
return std::make_pair(std::move(config), std::move(db));
|
return std::make_pair(std::move(config), std::move(db));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<clanguml::config::config, compilation_database> load_config2(
|
|
||||||
const std::string &test_name)
|
|
||||||
{
|
|
||||||
auto config = clanguml::config::load(test_name + "/.clang-uml");
|
|
||||||
|
|
||||||
auto db = clanguml::cx::compilation_database::from_directory(
|
|
||||||
config.compilation_database_dir());
|
|
||||||
|
|
||||||
return std::make_pair(std::move(config), std::move(db));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<clanguml::sequence_diagram::model::diagram>
|
std::unique_ptr<clanguml::sequence_diagram::model::diagram>
|
||||||
generate_sequence_diagram(cppast::libclang_compilation_database &db,
|
generate_sequence_diagram(cppast::libclang_compilation_database &db,
|
||||||
std::shared_ptr<clanguml::config::diagram> diagram)
|
std::shared_ptr<clanguml::config::diagram> diagram)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "class_diagram/model/diagram.h"
|
#include "class_diagram/model/diagram.h"
|
||||||
#include "class_diagram/visitor/translation_unit_visitor.h"
|
#include "class_diagram/visitor/translation_unit_visitor.h"
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
#include "cx/compilation_database.h"
|
#include "cx/util.h"
|
||||||
#include "include_diagram/generators/plantuml/include_diagram_generator.h"
|
#include "include_diagram/generators/plantuml/include_diagram_generator.h"
|
||||||
#include "include_diagram/visitor/translation_unit_visitor.h"
|
#include "include_diagram/visitor/translation_unit_visitor.h"
|
||||||
#include "package_diagram/generators/plantuml/package_diagram_generator.h"
|
#include "package_diagram/generators/plantuml/package_diagram_generator.h"
|
||||||
@@ -47,21 +47,10 @@ using Catch::Matchers::EndsWith;
|
|||||||
using Catch::Matchers::Equals;
|
using Catch::Matchers::Equals;
|
||||||
using Catch::Matchers::StartsWith;
|
using Catch::Matchers::StartsWith;
|
||||||
using Catch::Matchers::VectorContains;
|
using Catch::Matchers::VectorContains;
|
||||||
using clanguml::cx::compilation_database;
|
|
||||||
using namespace clanguml::util;
|
using namespace clanguml::util;
|
||||||
|
|
||||||
std::pair<clanguml::config::config, cppast::libclang_compilation_database>
|
std::pair<clanguml::config::config, cppast::libclang_compilation_database>
|
||||||
load_config(const std::string &test_name);
|
load_config(const std::string &test_name);
|
||||||
std::pair<clanguml::config::config, compilation_database> load_config2(
|
|
||||||
const std::string &test_name);
|
|
||||||
|
|
||||||
clanguml::sequence_diagram::model::diagram generate_sequence_diagram(
|
|
||||||
compilation_database &db,
|
|
||||||
std::shared_ptr<clanguml::config::diagram> diagram);
|
|
||||||
|
|
||||||
clanguml::class_diagram::model::diagram generate_class_diagram(
|
|
||||||
compilation_database &db,
|
|
||||||
std::shared_ptr<clanguml::config::diagram> diagram);
|
|
||||||
|
|
||||||
std::string generate_sequence_puml(
|
std::string generate_sequence_puml(
|
||||||
std::shared_ptr<clanguml::config::diagram> config,
|
std::shared_ptr<clanguml::config::diagram> config,
|
||||||
|
|||||||
Reference in New Issue
Block a user