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 2/2] replace several uses of the anon namespace with GCC_FINAL


On 08/10/2015 06:05 AM, tbsaunde+gcc@tbsaunde.org wrote:
From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

Hi,

In many places gcc puts classes in the anon namespace so the compiler can tell
they do not get inheritted from to enable better devirtualization.  However
debugging code in the anon namespace can be a pain, and the same thing can be
accomplished more directly by marking the classes as final.  When bootstrapping
stage 3 should always be built in C++14 mode now, and of course will always be
newer than gcc 4.7, so these classes will always be marked as final there.
AIUI cross compilers are supposed to be built with recent gcc, which I would
tend to think implies newer than 4.7, so they should also be built with these
classes marked as final.  I believe that means in all important cases this works just as well as the anon namespace.

bootstrapped + regtested on x86_64-linux-gnu, ok?

Trev


gcc/ChangeLog:

2015-08-10  Trevor Saunders  <tbsaunde@tbsaunde.org>

	* compare-elim.c, dce.c, dse.c, gimple-ssa-isolate-paths.c,
	gimple-ssa-strength-reduction.c, graphite.c, init-regs.c,
	ipa-pure-const.c, ipa-visibility.c, ipa.c, mode-switching.c,
	omp-low.c, reorg.c, sanopt.c, trans-mem.c, tree-eh.c,
	tree-if-conv.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
	tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-sink.c, tree-ssanames.c, tree-stdarg.c, tree-tailcall.c,
	tree-vect-generic.c, tree.c, ubsan.c, var-tracking.c,
	vtable-verify.c, web.c: Use GCC_FINAL instead of the anonymous
namespace.
OK.
jeff


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