/// versa.
CLASS_DECL_ONLY_DEF_CHANGE_CATEGORY = 1 << 11,
+ /// A diff node in this category is a function parameter type which
+ /// top cv-qualifiers change.
+ FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY = 1 << 12,
+
/// A special enumerator that is the logical 'or' all the
/// enumerators above.
///
| VIRTUAL_MEMBER_CHANGE_CATEGORY
| REDUNDANT_CATEGORY
| CLASS_DECL_ONLY_DEF_CHANGE_CATEGORY
-};
+ | FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY
+}; // enum diff_category
diff_category
operator|(diff_category c1, diff_category c2);
// -*- Mode: C++ -*-
//
-// Copyright (C) 2013-2016 Red Hat, Inc.
+// Copyright (C) 2013-2017 Red Hat, Inc.
//
// This file is part of the GNU Application Binary Interface Generic
// Analysis and Instrumentation Library (libabigail). This library is
return false;
}
+/// Test if an @ref fn_parm_diff node has a top cv qualifier change on
+/// the type of the function parameter.
+///
+/// @param diff the diff node to consider. It should be a @ref
+/// fn_parm_diff, otherwise the function returns 'false' directly.
+///
+/// @return true iff @p diff is a @ref fn_parm_diff node that has a
+/// top cv qualifier change on the type of the function parameter.
+static bool
+has_fn_parm_type_cv_qual_change(const diff* diff)
+{
+ // is diff a "function parameter diff node?
+ const fn_parm_diff* parm_diff = is_fn_parm_diff(diff);
+
+ if (!parm_diff || !parm_diff->has_changes())
+ // diff either carries no change or is not a function parameter
+ // diff node. So bail out.
+ return false;
+
+ function_decl::parameter_sptr first_parm = parm_diff->first_parameter();
+ function_decl::parameter_sptr second_parm = parm_diff->second_parameter();
+
+ type_base_sptr first_parm_type = first_parm->get_type();
+ type_base_sptr second_parm_type = second_parm->get_type();
+
+ if (!is_qualified_type(first_parm_type)
+ && !is_qualified_type(second_parm_type))
+ // None of the parameter types is qualified.
+ return false;
+
+ qualified_type_def::CV cv_quals_1 = qualified_type_def::CV_NONE;
+ qualified_type_def::CV cv_quals_2 = qualified_type_def::CV_NONE;
+ type_base_sptr peeled_type_1 = first_parm_type;
+ type_base_sptr peeled_type_2 = second_parm_type;
+
+ if (qualified_type_def_sptr qtype1 = is_qualified_type(first_parm_type))
+ {
+ cv_quals_1 = qtype1->get_cv_quals();
+ peeled_type_1 = peel_qualified_type(qtype1);
+ }
+
+ if (qualified_type_def_sptr qtype2 = is_qualified_type(second_parm_type))
+ {
+ cv_quals_2 = qtype2->get_cv_quals();
+ peeled_type_2 = peel_qualified_type(qtype2);
+ }
+
+ if (peeled_type_1
+ && peeled_type_2
+ && get_type_name(peeled_type_1) == get_type_name(peeled_type_2)
+ && cv_quals_1 != cv_quals_2)
+ // The top-level CV qualifiers of the function type are different
+ // and the un-qualified variant (peeled) of said function types
+ // are equal. This means the only change the function types have
+ // are about top-level CV qualifiers.
+ return true;
+
+ return false;
+
+}
+
/// Detect if the changes carried by a given diff node are deemed
/// harmless and do categorize the diff node accordingly.
///
if (function_name_changed_but_not_symbol(d))
category |= HARMLESS_SYMBOL_ALIAS_CHANGE_CATEORY;
+ if (has_fn_parm_type_cv_qual_change(d))
+ category |= FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY;
+
if (category)
{
d->add_to_local_and_inherited_categories(category);
| abigail::comparison::STATIC_DATA_MEMBER_CHANGE_CATEGORY
| abigail::comparison::HARMLESS_ENUM_CHANGE_CATEGORY
| abigail::comparison::HARMLESS_SYMBOL_ALIAS_CHANGE_CATEORY
- | abigail::comparison::CLASS_DECL_ONLY_DEF_CHANGE_CATEGORY);
+ | abigail::comparison::CLASS_DECL_ONLY_DEF_CHANGE_CATEGORY
+ | abigail::comparison::FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY);
}
/// Getter of a bitmap made of the set of change categories that are
emitted_a_category |= true;
}
+ if (c & FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY)
+ {
+ if (emitted_a_category)
+ o << "|";
+ o << "FN_PARM_TYPE_TOP_CV_CHANGE_CATEGORY";
+ emitted_a_category |= true;
+ }
+
+
if (c & SUPPRESSED_CATEGORY)
{
if (emitted_a_category)
test-diff-filter/test39-v0 \
test-diff-filter/test39-v1 \
test-diff-filter/test39-report-0.txt \
+test-diff-filter/libtest40-v0.so \
+test-diff-filter/libtest40-v1.so \
+test-diff-filter/test40-report-0.txt \
+test-diff-filter/test40-v0.cc \
+test-diff-filter/test40-v1.cc \
\
test-diff-suppr/test0-type-suppr-v0.cc \
test-diff-suppr/test0-type-suppr-v1.cc \
-Functions changes summary: 82 Removed, 7 Changed (13 filtered out), 1081 Added functions
+Functions changes summary: 82 Removed, 5 Changed (15 filtered out), 1081 Added functions
Variables changes summary: 47 Removed, 1 Changed, 11 Added variables
Function symbols changes summary: 7 Removed, 76 Added function symbols not referenced by debug info
Variable symbols changes summary: 0 Removed, 0 Added variable symbol not referenced by debug info
[A] 'method void std::vector<const VarTable::Entry*, std::allocator<const VarTable::Entry*> >::vector<Iterator, void>(Iterator, Iterator, const std::vector<const VarTable::Entry*, std::allocator<const VarTable::Entry*> >::allocator_type&)'
[A] 'method std::vector<const VarTable::Entry*, std::allocator<const VarTable::Entry*> >::~vector(int)'
-7 functions with some indirect sub-type change:
-
- [C]'function int ORSLRelease(const int, const int* restrict, const ORSLBusySet* restrict, const restrict ORSLTag)' has some indirect sub-type changes:
- parameter 2 of type 'const int* restrict' changed:
- entity changed from 'const int* restrict' to 'const int*'
- type size hasn't changed
- parameter 3 of type 'const ORSLBusySet* restrict' changed:
- entity changed from 'const ORSLBusySet* restrict' to 'const ORSLBusySet*'
- type size hasn't changed
- parameter 4 of type 'const restrict ORSLTag' changed:
- 'const restrict ORSLTag' changed to 'const ORSLTag'
-
- [C]'function int ORSLReservePartial(const ORSLPartialGranularity, const int, const int* restrict, ORSLBusySet* restrict, const restrict ORSLTag)' has some indirect sub-type changes:
- parameter 3 of type 'const int* restrict' changed:
- entity changed from 'const int* restrict' to 'const int*'
- type size hasn't changed
- parameter 4 of type 'ORSLBusySet* restrict' changed:
- entity changed from 'ORSLBusySet* restrict' to 'ORSLBusySet*'
- type size hasn't changed
- parameter 5 of type 'const restrict ORSLTag' changed:
- 'const restrict ORSLTag' changed to 'const ORSLTag'
+5 functions with some indirect sub-type change:
[C]'method void OffloadDescriptor::report_coi_error(error_types, COIRESULT)' has some indirect sub-type changes:
parameter 1 of type 'typedef error_types' has sub-type changes:
-Functions changes summary: 82 Removed, 7 Changed (13 filtered out), 1081 Added functions
+Functions changes summary: 82 Removed, 5 Changed (15 filtered out), 1081 Added functions
Variables changes summary: 47 Removed, 1 Changed, 11 Added variables
Function symbols changes summary: 7 Removed, 76 Added function symbols not referenced by debug info
Variable symbols changes summary: 0 Removed, 0 Added variable symbol not referenced by debug info
[A] 'method void std::vector<const VarTable::Entry*, std::allocator<const VarTable::Entry*> >::vector<Iterator, void>(Iterator, Iterator, const std::vector<const VarTable::Entry*, std::allocator<const VarTable::Entry*> >::allocator_type&)'
[A] 'method std::vector<const VarTable::Entry*, std::allocator<const VarTable::Entry*> >::~vector(int)'
-7 functions with some indirect sub-type change:
-
- [C]'function int ORSLRelease(const int, const int* restrict, const ORSLBusySet* restrict, const restrict ORSLTag)' at orsl-lite.c:327:1 has some indirect sub-type changes:
- parameter 2 of type 'const int* restrict' changed:
- entity changed from 'const int* restrict' to 'const int*'
- type size hasn't changed
- parameter 3 of type 'const ORSLBusySet* restrict' changed:
- entity changed from 'const ORSLBusySet* restrict' to 'const ORSLBusySet*'
- type size hasn't changed
- parameter 4 of type 'const restrict ORSLTag' changed:
- 'const restrict ORSLTag' changed to 'const ORSLTag'
-
- [C]'function int ORSLReservePartial(const ORSLPartialGranularity, const int, const int* restrict, ORSLBusySet* restrict, const restrict ORSLTag)' at orsl-lite.c:290:1 has some indirect sub-type changes:
- parameter 3 of type 'const int* restrict' changed:
- entity changed from 'const int* restrict' to 'const int*'
- type size hasn't changed
- parameter 4 of type 'ORSLBusySet* restrict' changed:
- entity changed from 'ORSLBusySet* restrict' to 'ORSLBusySet*'
- type size hasn't changed
- parameter 5 of type 'const restrict ORSLTag' changed:
- 'const restrict ORSLTag' changed to 'const ORSLTag'
+5 functions with some indirect sub-type change:
[C]'method void OffloadDescriptor::report_coi_error(error_types, COIRESULT)' at offload_host.h:206:1 has some indirect sub-type changes:
parameter 1 of type 'typedef error_types' has sub-type changes:
-Functions changes summary: 82 Removed, 7 Changed (13 filtered out), 0 Added functions (1081 filtered out)
+Functions changes summary: 82 Removed, 5 Changed (15 filtered out), 0 Added functions (1081 filtered out)
Variables changes summary: 47 Removed, 1 Changed, 0 Added variables (11 filtered out)
Function symbols changes summary: 7 Removed, 0 Added (76 filtered out) function symbols not referenced by debug info
Variable symbols changes summary: 0 Removed, 0 Added variable symbol not referenced by debug info
'function void std::__unguarded_linear_insert<VarList::BufEntry*, __gnu_cxx::__ops::_Val_comp_iter<bool (*)(const VarList::BufEntry&, const VarList::BufEntry&)> >(VarList::BufEntry*, __gnu_cxx::__ops::_Val_comp_iter<bool (*)(const VarList::BufEntry&, const VarList::BufEntry&)>)'
'function void write_message(FILE*, int, __va_list_tag*)'
-7 functions with some indirect sub-type change:
-
- [C]'function int ORSLRelease(const int, const int* restrict, const ORSLBusySet* restrict, const restrict ORSLTag)' has some indirect sub-type changes:
- parameter 2 of type 'const int* restrict' changed:
- entity changed from 'const int* restrict' to 'const int*'
- type size hasn't changed
- parameter 3 of type 'const ORSLBusySet* restrict' changed:
- entity changed from 'const ORSLBusySet* restrict' to 'const ORSLBusySet*'
- type size hasn't changed
- parameter 4 of type 'const restrict ORSLTag' changed:
- 'const restrict ORSLTag' changed to 'const ORSLTag'
-
- [C]'function int ORSLReservePartial(const ORSLPartialGranularity, const int, const int* restrict, ORSLBusySet* restrict, const restrict ORSLTag)' has some indirect sub-type changes:
- parameter 3 of type 'const int* restrict' changed:
- entity changed from 'const int* restrict' to 'const int*'
- type size hasn't changed
- parameter 4 of type 'ORSLBusySet* restrict' changed:
- entity changed from 'ORSLBusySet* restrict' to 'ORSLBusySet*'
- type size hasn't changed
- parameter 5 of type 'const restrict ORSLTag' changed:
- 'const restrict ORSLTag' changed to 'const ORSLTag'
+5 functions with some indirect sub-type change:
[C]'method void OffloadDescriptor::report_coi_error(error_types, COIRESULT)' has some indirect sub-type changes:
parameter 1 of type 'typedef error_types' has sub-type changes:
-Functions changes summary: 82 Removed, 7 Changed (13 filtered out), 0 Added functions (1081 filtered out)
+Functions changes summary: 82 Removed, 5 Changed (15 filtered out), 0 Added functions (1081 filtered out)
Variables changes summary: 0 Removed (47 filtered out), 1 Changed, 0 Added variables (11 filtered out)
Function symbols changes summary: 7 Removed, 0 Added (76 filtered out) function symbols not referenced by debug info
Variable symbols changes summary: 0 Removed, 0 Added variable symbol not referenced by debug info
--- /dev/null
+Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
--- /dev/null
+// compile with:
+// g++ -g -shared -fPIC -o libtest40-v0.so test40-v0.cc
+
+struct S
+{
+ int m;
+};
+
+void
+foo(const S, int c, const bool b)
+{
+ int d = c + b;
+}
+
+
+void
+bar()
+{
+ S s;
+ foo(s, 0, false);
+}
--- /dev/null
+// compile with:
+// g++ -g -shared -fPIC -o libtest40-v1.so test40-v1.cc
+
+struct S
+{
+ int m;
+};
+
+void
+foo(const S, int c, bool b)
+{
+ int d = c + b;
+}
+
+void
+bar()
+{
+ S s;
+ foo(s, 0, false);
+}
"data/test-diff-filter/test39/test39-report-0.txt",
"output/test-diff-filter/test39/test39-report-0.txt",
},
+ {
+ "data/test-diff-filter/libtest40-v0.so",
+ "data/test-diff-filter/libtest40-v1.so",
+ "--no-default-suppression --no-linkage-name",
+ "data/test-diff-filter/test40-report-0.txt",
+ "output/test-diff-filter/test40-report-0.txt",
+ },
// This should be the last entry
{NULL, NULL, NULL, NULL, NULL}
};