This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Rewrite check_global_declarations() generically


On 04/28/2015 09:01 PM, Aldy Hernandez wrote:

The approach looks good to me.

-  analyze_functions ();
+  analyze_functions (true);

In the C++ front end at least we comment anonymous boolean arguments, i.e.

 analyze_functions (/*first_time*/true);

Let's do that here, too.  Similarly for the calls to referred_to_p (false).

+      /* ?? Why are we looking at TREE_USED?  Shouldn't the call to
+	 referred_to_p above be enough?  Apparently not, because the
+	 `__unused__' attribute is not being considered for
+	 referred_to_p.  */

Seems like you answered your question.  :)

+      /* Global ctors and dtors are called by the runtime.  */
+      && (TREE_CODE (decl) != FUNCTION_DECL
+	  || (!DECL_STATIC_CONSTRUCTOR (decl)
+	      && !DECL_STATIC_DESTRUCTOR (decl)))

Maybe check snode->needed_p instead?

Jason



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]