From: Gabriel Corona Date: Tue, 21 Jul 2015 13:02:00 +0000 (+0200) Subject: [mc] Remove MC_dwarf_register_variable() X-Git-Tag: v3_12~438^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bfb24344a810f8b14415083483fea1b65ff01eb7?hp=a63448829151bb5a1815542f34b5233778ba52a4 [mc] Remove MC_dwarf_register_variable() --- diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index e242a7f1e5..cd1f9d1755 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -21,12 +21,6 @@ #include "mc_object_info.h" #include "mc_private.h" -static void MC_register_variable( - mc_object_info_t info, mc_frame_t frame, std::unique_ptr variable); -static void MC_dwarf_register_variable( - mc_object_info_t info, mc_frame_t frame, - std::unique_ptr variable); - XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dwarf, mc, "DWARF processing"); /** \brief The default DW_TAG_lower_bound for a given DW_AT_language. @@ -455,6 +449,10 @@ static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit) // ***** Variable +/** Sort the variable by name and address. + * + * We could use boost::container::flat_set instead. + */ static bool MC_compare_variable( simgrid::mc::Variable const& a, simgrid::mc::Variable const& b) { @@ -822,8 +820,17 @@ static void MC_dwarf_handle_variable_die(mc_object_info_t info, Dwarf_Die * die, Dwarf_Die * unit, mc_frame_t frame, const char *ns) { - MC_dwarf_register_variable(info, frame, - MC_die_to_variable(info, die, unit, frame, ns)); + std::unique_ptr variable = + MC_die_to_variable(info, die, unit, frame, ns); + if (!variable) + return; + // Those arrays are sorted later: + else if (variable->global) + info->global_variables.push_back(std::move(*variable)); + else if (frame != nullptr) + frame->variables.push_back(std::move(*variable)); + else + xbt_die("No frame for this local variable"); } static void MC_dwarf_handle_scope_die(mc_object_info_t info, Dwarf_Die * die, @@ -1164,21 +1171,6 @@ std::shared_ptr MC_find_object_info( /*************************************************************************/ -void MC_dwarf_register_variable( - mc_object_info_t info, mc_frame_t frame, - std::unique_ptr variable) -{ - if (!variable) - return; - // Those arrays are sorted later: - else if (variable->global) - info->global_variables.push_back(std::move(*variable)); - else if (frame != nullptr) - frame->variables.push_back(std::move(*variable)); - else - xbt_die("No frame for this local variable"); -} - void MC_post_process_object_info(mc_process_t process, mc_object_info_t info) { for (auto& i : info->types) {