On 10/30/2013 06:14 AM, Eric Botcazou wrote:
+/* Return whether DECL, a method of a C++ TYPE, is trivial, that is to say + doesn't do anything for the objects of TYPE. */ + +static bool +is_trivial_method (const_tree decl, const_tree type) +{ + if (cpp_check (decl, IS_CONSTRUCTOR) && !TYPE_NEEDS_CONSTRUCTING (type)) + return true;
This will tell you whether decl is a constructor for a type with some non-trivial constructor, but not whether decl itself is non-trivial.
I think a good way to check for any non-trivial methods would be to check trivial_type_p in the front end and then see if there are any !DECL_ARTIFICIAL decls in TYPE_METHODS.
Jason