]> sourceware.org Git - libabigail.git/commitdiff
Add a --no-architecture option to abidiff
authorDodji Seketeli <dodji@redhat.com>
Sat, 29 Aug 2015 10:59:13 +0000 (12:59 +0200)
committerDodji Seketeli <dodji@redhat.com>
Sat, 29 Aug 2015 14:23:15 +0000 (16:23 +0200)
This new option omits architectures when comparing ABIs.

* tools/abidiff.cc (options::no_arch): New data member.
(options::options): Initialize it.
(display_usage): Display a help string for the new options.
(parse_command_line): Parse the new options.
(main): If --no-architecture is provided, set the corpus
architecture to "".
* doc/manuals/abidiff.rst: Document the new options.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
doc/manuals/abidiff.rst
tools/abidiff.cc

index 1b7d3479d21d24efe0d9467c318f1e6a4c90bf0b..99f5fa9d5b6d76f624e02b3f6885b89789ec6e15 100644 (file)
@@ -198,6 +198,10 @@ Options
     redundant change is a change that has been displayed elsewhere in
     the report.  This option is switched on by default.
 
+  * ``--no-architecture``
+
+    Do not take architecture in account when comparing ABIs.
+
   *  ``--dump-diff-tree``
 
     After the diff report, emit a textual representation of the diff
index 3a7f7cd60fb34e5fb18e9a084ee39fc49d69bfb8..c78a1dc851e7423d4aff3576257fce606b01c77f 100644 (file)
@@ -63,6 +63,7 @@ struct options
   vector<string>       drop_var_regex_patterns;
   vector<string>       keep_fn_regex_patterns;
   vector<string>       keep_var_regex_patterns;
+  bool                 no_arch;
   bool                 show_stats_only;
   bool                 show_symtabs;
   bool                 show_deleted_fns;
@@ -84,22 +85,23 @@ struct options
   shared_ptr<char>     di_root_path2;
 
   options()
-    : display_usage(false),
-      missing_operand(false),
-      show_stats_only(false),
-      show_symtabs(false),
-      show_deleted_fns(false),
-      show_changed_fns(false),
-      show_added_fns(false),
+    : display_usage(),
+      missing_operand(),
+      no_arch(),
+      show_stats_only(),
+      show_symtabs(),
+      show_deleted_fns(),
+      show_changed_fns(),
+      show_added_fns(),
       show_all_fns(true),
-      show_deleted_vars(false),
-      show_changed_vars(false),
-      show_added_vars(false),
+      show_deleted_vars(),
+      show_changed_vars(),
+      show_added_vars(),
       show_all_vars(true),
       show_linkage_names(true),
       show_harmful_changes(true),
-      show_harmless_changes(false),
-      show_redundant_changes(false),
+      show_harmless_changes(),
+      show_redundant_changes(),
       show_symbols_not_referenced_by_debug_info(true),
       dump_diff_tree(),
       show_stats()
@@ -116,6 +118,7 @@ display_usage(const string& prog_name, ostream& out)
       << " --help|-h  display this message\n "
       << " --stat  only display the diff stats\n"
       << " --symtabs  only display the symbol tables of the corpora\n"
+      << " --no-architecture  do not take architecture in account\n"
       << " --deleted-fns  display deleted public functions\n"
       << " --changed-fns  display changed public functions\n"
       << " --added-fns  display added public functions\n"
@@ -212,6 +215,8 @@ parse_command_line(int argc, char* argv[], options& opts)
          opts.display_usage = true;
          return true;
        }
+      else if (!strcmp(argv[i], "--no-architecture"))
+       opts.no_arch = true;
       else if (!strcmp(argv[i], "--deleted-fns"))
        {
          opts.show_deleted_fns = true;
@@ -668,6 +673,14 @@ main(int argc, char* argv[])
          return abigail::tools_utils::ABIDIFF_ERROR;
        }
 
+      if (opts.no_arch)
+       {
+         if (c1)
+           c1->set_architecture_name("");
+         if (c2)
+           c2->set_architecture_name("");
+       }
+
       if (t1)
        {
          translation_unit_diff_sptr diff = compute_diff(t1, t2);
This page took 0.056418 seconds and 5 git commands to generate.