@@ -178,6 +178,11 @@ Options
In the emitted ABI representation, do not show file, line or column
where ABI artifacts are defined.
+ * ``--no-parameter-names``
+
+ In the emitted ABI representation, do not show names of function
+ parameters, just the types.
+
* ``--named-type-ids``
Without this option ids used to reference types in the XML file
@@ -68,6 +68,9 @@ set_short_locs(write_context& ctxt, bool flag);
void
set_named_type_ids(write_context& ctxt, bool flag);
+void
+set_write_parameter_names(write_context& ctxt, bool flag);
+
/// A convenience generic function to set common options (usually used
/// by Libabigail tools) from a generic options carrying-object, into
/// a given @ref write_context.
@@ -86,6 +89,7 @@ set_common_options(write_context& ctxt, const OPTS& opts)
set_write_architecture(ctxt, opts.write_architecture);
set_write_corpus_path(ctxt, opts.write_corpus_path);
set_write_comp_dir(ctxt, opts.write_comp_dir);
+ set_write_parameter_names(ctxt, opts.write_parameter_names);
set_short_locs(ctxt, opts.short_locs);
set_named_type_ids(ctxt, opts.named_type_ids);
}
@@ -221,6 +221,7 @@ class write_context
bool m_write_architecture;
bool m_write_corpus_path;
bool m_write_comp_dir;
+ bool m_write_parameter_names;
bool m_short_locs;
bool m_named_type_ids;
mutable type_ptr_map m_type_id_map;
@@ -257,6 +258,7 @@ public:
m_write_architecture(true),
m_write_corpus_path(true),
m_write_comp_dir(true),
+ m_write_parameter_names(true),
m_short_locs(false),
m_named_type_ids(false)
{}
@@ -370,6 +372,20 @@ public:
set_named_type_ids(bool f)
{m_named_type_ids = f;}
+ /// Getter of the parameter-names option.
+ ///
+ /// @return true iff parameter names shall be emitted
+ bool
+ get_write_parameter_names() const
+ {return m_write_parameter_names;}
+
+ /// Setter of the parameter-names option
+ ///
+ /// @param f the new value of the flag.
+ void
+ set_write_parameter_names(bool f)
+ {m_write_parameter_names = f;}
+
/// Getter of the "show-locs" option.
///
/// When this option is true then the XML writer emits location
@@ -2112,6 +2128,18 @@ void
set_named_type_ids(write_context& ctxt, bool flag)
{ctxt.set_named_type_ids(flag);}
+/// Set the 'parameter-names' flag.
+///
+/// When this flag is set then the XML writer will emit the names of
+/// function parameters.
+///
+/// @param ctxt the context to set this flag on to.
+///
+/// @param flag the new value of the 'parameter-names' flag.
+void
+set_write_parameter_names(write_context& ctxt, bool flag)
+{ctxt.set_write_parameter_names(flag);}
+
/// Serialize the canonical types of a given scope.
///
/// @param scope the scope to consider.
@@ -3225,7 +3253,7 @@ write_function_decl(const function_decl_sptr& decl, write_context& ctxt,
<< "'";
ctxt.record_type_as_referenced(parm_type);
- if (!(*pi)->get_name().empty())
+ if (ctxt.get_write_parameter_names() && !(*pi)->get_name().empty())
o << " name='" << (*pi)->get_name() << "'";
}
write_is_artificial(*pi, o);
@@ -99,6 +99,7 @@ struct options
bool write_architecture;
bool write_corpus_path;
bool write_comp_dir;
+ bool write_parameter_names;
bool short_locs;
bool load_all_types;
bool linux_kernel_mode;
@@ -120,6 +121,7 @@ struct options
write_architecture(true),
write_corpus_path(true),
write_comp_dir(true),
+ write_parameter_names(true),
short_locs(false),
load_all_types(),
linux_kernel_mode(true),
@@ -168,6 +170,7 @@ display_usage(const string& prog_name, ostream& out)
<< " --drop-undefined-syms drop undefined symbols from representation\n"
<< " --named_type-ids use id attributes based on type names in XML file\n"
<< " --no-comp-dir-path do not show compilation path information\n"
+ << " --no-parameter-names do not show names of function parameters\n"
<< " --check-alternate-debug-info <elf-path> check alternate debug info "
"of <elf-path>\n"
<< " --check-alternate-debug-info-base-name <elf-path> check alternate "
@@ -288,6 +291,8 @@ parse_command_line(int argc, char* argv[], options& opts)
opts.short_locs = true;
else if (!strcmp(argv[i], "--no-comp-dir-path"))
opts.write_comp_dir = false;
+ else if (!strcmp(argv[i], "--no-parameter-names"))
+ opts.write_parameter_names = false;
else if (!strcmp(argv[i], "--check-alternate-debug-info")
|| !strcmp(argv[i], "--check-alternate-debug-info-base-name"))
{