Re: [cxx-conversion] Change uses of htab_t in gcc/config to hash_table.

2013-01-06 Thread Lawrence Crowl
p;arg); >> >> which is not as friendly. > > Agreed. Agreed. The current structure was handy in the conversion process. Now that the conversion is done, we could change the order. >> David >> >> >> On Tue, Dec 18, 2012 at 8:02 PM, Lawrence Crowl

Re: [PATCH 1/2] [asan] Allow creating/deleting hash table entries with new/delete

2013-01-28 Thread Lawrence Crowl
t; + > +/* Remove with delete. */ > + > +template > +inline void > +typed_delete_remove ::remove (Type *p) > +{ > + delete p; > +} > > /* Helpful type for a no-op remove. */ > > -- > 1.7.11.7 > > > > -- > Dodji > -- Lawrence Crowl

[cxx-conversion] Add Record Builder Class

2013-02-12 Thread Lawrence Crowl
{ +public: + record_builder (bool is_union = false); + void add_field (tree ident, tree type, + source_location loc = UNKNOWN_LOCATION); + void add_field (const char *ident, tree type, + source_location loc = UNKNOWN_LOCATION); + void layout (); + void layout (tree align_type); + void tag_name (tree ident); + void tag_name (const char *ident); + void decl_name (tree ident, source_location loc = UNKNOWN_LOCATION); + void decl_name (const char *ident, source_location loc = UNKNOWN_LOCATION); + tree as_tree (); +private: + tree building_; + tree last_field_; +}; // class record_builder + + #endif /* GCC_TREE_H */ -- Lawrence Crowl

Re: [cxx-conversion] Add Record Builder Class

2013-02-13 Thread Lawrence Crowl
On 2/13/13, Diego Novillo wrote: > On Tue, Feb 12, 2013 at 2:47 PM, Lawrence Crowl wrote: >> @@ -182,24 +163,9 @@ default_emutls_var_init (tree to, tree d >> static tree >> get_emutls_object_type (void) >> { >> - tree type, type_name, field; >> - &g

Re: [cxx-conversion] Add Record Builder Class

2013-02-13 Thread Lawrence Crowl
On 2/13/13, Diego Novillo wrote: > Thanks. The patch is OK for the branch. You can address Nathan's > review after he's back and gets a chance to look at it. > > Let me know when the patch is in. I've got another merge in process. Committed. -- Lawrence Crowl

Re: [cxx-conversion] Add Record Builder Class

2013-02-14 Thread Lawrence Crowl
On 2/14/13, Richard Biener wrote: > On Tue, Feb 12, 2013 at 8:47 PM, Lawrence Crowl wrote: > > Add class record_builder to ease construction of records and unions. Use > > it > > in some appropriate places. > > tree > > -default_emutls_var_fields (tree

[pph] Refactor Vectors and Chains (issue5263051)

2011-10-16 Thread Lawrence Crowl
now causes an ICE to surface, which will be addressed later. Tested on x64. Index: gcc/testsuite/ChangeLog.pph 2011-10-16 Lawrence Crowl * g++.dg/pph/x4tmplfuncinln.cc: Change failure to ICE. * g++.dg/pph/x4tmplfuncninl.cc: Likewise. * g++.dg/pph/z4tmplfuncinln.cc

[pph] Function Merging (issue5278047)

2011-10-16 Thread Lawrence Crowl
x64. 2011-10-16 Lawrence Crowl Index: gcc/testsuite/ChangeLog.pph * g++.dg/pph/c4inline.cc: Change to ICE in cgraph. * g++.dg/pph/x1keyed.cc: Likewise. * g++.dg/pph/x1keyno.cc: Likewise. * g++.dg/pph/x4keyed.cc: Likewise. * g++.dg/pph/x4keyex.cc

Re: [pph] Make libcpp symbol validation a warning (issue5235061)

2011-10-21 Thread Lawrence Crowl
ious comment, but I don't see how > this assert could trigger in the current code. If it did trigger > something was definitely wrong as it asserts the offseted > included_from is referring to an entry that is actually in the > line_table... > >> lm->start_location += pph_loc_offset; I'm wondering if we shouldn't just whitelist the problematic cases that we know about in the system/standard headers. It seems that all others we could reasonably complain to the maintainers of the code. -- Lawrence Crowl

[pph] Various Merging Fixes (issue5330048)

2011-10-28 Thread Lawrence Crowl
contents are streamed in. Change the call sites to uniformly use a postorder traversal for tracing. This makes in and out traces directly comparable. Bootstrapped on x64. Index: gcc/cp/ChangeLog.pph 2011-10-28 Lawrence Crowl * pph.c (pph_dump_tree_name): Remove dead code. Dump

[pph] Merge static_decls. (issue5335042)

2011-11-01 Thread Lawrence Crowl
Add merging of static_decls in bindings. Due to the current structure, this change is currently only effective at namespace scope. Consequently, there are no changes to test status. We may need to make all bindings merged by default. Index: gcc/cp/ChangeLog.pph 2011-11-01 Lawrence Crowl

[pph] Partial namespace merging. (issue5341047)

2011-11-07 Thread Lawrence Crowl
. Tested on x64. Index: gcc/testsuite/ChangeLog.pph 2011-11-07 Lawrence Crowl * lib/dg-pph.exp (dg-pph-pos): Recognize bogus errors. * g++.dg/pph/x0namespace2.h: New. * g++.dg/pph/x4namespace.cc: New. Index: gcc/cp/ChangeLog.pph 2011-11-07 Lawrence Crowl

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-07 Thread Lawrence Crowl
On 8/7/12, Richard Guenther wrote: > On Tue, Aug 7, 2012 at 2:35 AM, Lawrence Crowl wrote: > > Convert double_int from a struct with function into a class with > > operators and methods. > > > > This patch adds the methods and operators. In general functions of > &

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-07 Thread Lawrence Crowl
On 8/7/12, Mike Stump wrote: > On Aug 6, 2012, at 5:35 PM, Lawrence Crowl wrote: >> Convert double_int from a struct with function into a class with >> operators and methods. > > We have a wide_int class that replaces this class. :-( Really? Where? I don't see neithe

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
On 8/7/12, Mike Stump wrote: > On Aug 7, 2012, at 11:42 AM, Lawrence Crowl wrote: > > On 8/7/12, Mike Stump wrote: > > > On Aug 6, 2012, at 5:35 PM, Lawrence Crowl wrote: > > > > Convert double_int from a struct with function into a class > > > > with op

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
On 8/7/12, Richard Henderson wrote: > On 08/06/2012 05:35 PM, Lawrence Crowl wrote: > > +inline double_int & > > +double_int::operator ++ () > > +{ > > + *this + double_int_one; > > + return *this; > > +} > > + > > +inline double_in

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
On 8/7/12, Mike Stump wrote: > On Aug 7, 2012, at 11:38 AM, Lawrence Crowl wrote: > > Hm. There seems to be significant opinion that there should not be any > > implicit conversions. I am okay with operations as above, but would like > > to hear the opinions of others. >

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
On 8/8/12, Richard Guenther wrote: > On Aug 7, 2012 Lawrence Crowl wrote: > > We should probably think about naming conventions for mutating > > operations, as I expect we will want them eventually. > > Right. In the end I would prefer explicit constructors. I don't

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
On 8/8/12, Richard Guenther wrote: > On Aug 7, 2012 Lawrence Crowl wrote: > > On 8/7/12, Richard Guenther wrote: > > > For most parts overloads that take an (unsigned) HOST_WIDE_INT > > > argument would be nice, as well as the ability to say dbl + 1. > > >

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
ng and unsigned long). > > Or use template magic to force promotion to HOST_WIDE_INT for > integer types smaller than HOST_WIDE_INT... I did not get to the structure I had accidentally. However, with the prior suggestion to preserve exact semantics to existing calls, it is all moot because we cannot have overloading. We can test whether the code is making double_ints with cross-sign ints by adding undefined overloads. I think we should do that and make all such crossings explicit. However, I want to wait for a separate patch. -- Lawrence Crowl

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
; #endif #ifdef COPYCON type (const type &from) : field1 (from.field1), field2 (from.field2) { } #endif #ifdef DESTRUCT ~type () { field1 = 0; field2 = 0; } #endif type method (type); long int field1; long int field2; }; extern type global; void callee (type arg); void function_caller () { type local (global); callee (local); callee (global); } void method_caller (type arg1, type arg2) { type var1 (global); type var2 = arg2; arg1.method (arg2); var1.method (var2); } -- Lawrence Crowl

Re: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)

2012-08-08 Thread Lawrence Crowl
, > e.g. in unions. Which brings up a critical point that double_int is used in trees, which are in a union, and so double_int must be a POD until trees are no longer unions. -- Lawrence Crowl

[cxx-conversion] Avoid overloaded double_int 'constructor'. (issue6441127)

2012-08-09 Thread Lawrence Crowl
Convert overloaded double_int::make to non-overloaded from_signed and from_unsigned. This change is intended to preserve the exact semantics of the existing expressions using shwi_to_double_int and uhwi_to_double_int. Tested on x86_64. Index: gcc/ChangeLog 2012-08-09 Lawrence Crowl

Re: [cxx-conversion] Support garbage-collected C++ templates

2012-08-10 Thread Lawrence Crowl
engtype modifications is direct support for non-polymorphic single-inheritance class hierarchies that are discriminated by tags. -- Lawrence Crowl

Re: Merge C++ conversion into trunk (5/6 - double_int rewrite)

2012-08-13 Thread Lawrence Crowl
. I believe you are not opposing overloading operator+ on > double_int. You are objecting to its implementation being defined > as a member function. That is you would be perfectly fine with > operator+ defined as a free function, e.g. not a member function. In the absence of symmetric overloading, the code is slightly cleaner with operators as member functions. It is easy to change should we need symmetric overloads because, for the most part, the change would have no effect on client code. -- Lawrence Crowl

Re: Merge C++ conversion into trunk (5/6 - double_int rewrite)

2012-08-13 Thread Lawrence Crowl
ns about the coding > conventions. > > > 2012-08-12 Lawrence Crowl > > > > * hash-table.h > > (typedef double_int): Change to struct (POD). > > (double_int::make): New overloads for int to double-int conversion. > > Isn't that double_int::fr

Re: Merge C++ conversion into trunk (5/6 - double_int rewrite)

2012-08-13 Thread Lawrence Crowl
lts in more concise code. Third, it results in potentially faster code. I think we should be able to use those operators. When I run through changing call sites, I really want to change the sites to the final form, not do two passes. -- Lawrence Crowl

Re: Merge C++ conversion into trunk (5/6 - double_int rewrite)

2012-08-13 Thread Lawrence Crowl
On 8/13/12, Richard Henderson wrote: > On 08/13/2012 01:22 PM, Lawrence Crowl wrote: >>> > yes, it is just as confusing and a bug as >>> > >>> > 2.3 + 1; >>> > >>> > is in plain C. >> Yes, it is a bug. It's a bit disturbi

Re: [patch] timevar TLC

2012-08-14 Thread Lawrence Crowl
truct def { int x; char name[LIMIT+1]; }; struct def var[] = { { 3, "hello" }, { 4, "name is much too too long for a reasonable name" }, }; % gcc -c limitstring.c -Werror cc1: warnings being treated as errors limitstring.c:10: error: initializer-string for array of chars is too long limitstring.c:10: error: (near initialization for 'timevars[1].name') But of course the variable definition would look more like #define DEFTIMEVAR(identifier__, name__) \ { , name__, ... }, struct def var[] = { #include "timevar.def" }; -- Lawrence Crowl

Re: Merge C++ conversion into trunk (4/6 - hash table rewrite)

2012-08-15 Thread Lawrence Crowl
n particular, I prefer to avoid steps that might cause very poor matching of lines in the diff. Others may choose differently. Together we will learn where the tradeoffs lie. More in a later response. -- Lawrence Crowl

Re: Merge C++ conversion into trunk (4/6 - hash table rewrite)

2012-08-15 Thread Lawrence Crowl
sed to revert some of the globalizations of hash/compare fns. Your conversion is a better abstraction, and something I'd wanted to get to eventually, so I support your conversion. BTW, the conding conventions say to put member function definitions out of line. -- Lawrence Crowl

Re: Merge C++ conversion into trunk (4/6 - hash table rewrite)

2012-08-15 Thread Lawrence Crowl
is scoped anyway... I do not much like _t names either. -- Lawrence Crowl

Re: Merge C++ conversion into trunk (4/6 - hash table rewrite)

2012-08-16 Thread Lawrence Crowl
On 8/16/12, Richard Guenther wrote: > On Wed, 15 Aug 2012, Lawrence Crowl wrote: > > On 8/15/12, Richard Henderson wrote: > > > On 2012-08-15 07:29, Richard Guenther wrote: > > > > + typedef typename Element::Element_t Element_t; > > > > > &g

Re: Merge C++ conversion into trunk (0/6 - Overview)

2012-08-20 Thread Lawrence Crowl
;t splice in the wrong report? -- Lawrence Crowl

Re: Change double_int calls to new interface.

2012-09-05 Thread Lawrence Crowl
On 9/5/12, Richard Guenther wrote: > On Tue, 4 Sep 2012, Lawrence Crowl wrote: >> Modify gcc/*.[hc] double_int call sites to use the new interface. >> This change entailed adding a few new methods to double_int. >> >> Other changes will happen in separate patches.

Re: Change double_int calls to new interface.

2012-09-05 Thread Lawrence Crowl
On 9/5/12, Marc Glisse wrote: > On Wed, 5 Sep 2012, Lawrence Crowl wrote: >> On 9/5/12, Richard Guenther wrote: >>> The tmin.cmp (tmax, uns) > 0 kind of things look odd - definitely >>> methods like tmin.gt (tmax, uns) would be nice to have. Or even >>>

Re: Change double_int calls to new interface.

2012-09-11 Thread Lawrence Crowl
cific information on the condition that generates the error? -- Lawrence Crowl

Re: Backtrace library [1/3]

2012-09-11 Thread Lawrence Crowl
by different threads? That parameter could then be modeled as 'this' parameter, addressing Gaby's suggesting. -- Lawrence Crowl

Re: Backtrace library [1/3]

2012-09-12 Thread Lawrence Crowl
On 9/12/12, Ian Lance Taylor wrote: > On Sep 11, 2012 Lawrence Crowl wrote: > > On 9/11/12, Ian Lance Taylor wrote: > > > This patch is the interface to and configury of libbacktrace. > > > I've separated these out as the parts of libbacktrace that > > >

Re: Change double_int calls to new interface.

2012-09-12 Thread Lawrence Crowl
On 9/12/12, Mark Kettenis wrote: >> Date: Tue, 11 Sep 2012 17:03:39 -0700 >> From: Ian Lance Taylor >> >> On Tue, Sep 11, 2012 at 3:12 PM, Lawrence Crowl >> wrote: >> > On 9/11/12, Andreas Schwab wrote: >> >> Mark Kettenis writes: >>

Re: Use conditional casting with symtab_node

2012-09-18 Thread Lawrence Crowl
7;s like this, use the existing && idiom instead. The language syntax would bind the conditional into the intializer, as in if (varpool_node *vnode = (node->try_variable () && vnode->finalized)) varpool_analyze_node (vnode); which does not type-match. So, if you want the type saftey and performance, the cascade is really unavoidable. -- Lawrence Crowl

Re: Use conditional casting with symtab_node

2012-09-18 Thread Lawrence Crowl
On 9/18/12, Richard Guenther wrote: > On Sep 18, 2012 Lawrence Crowl wrote: > > * cgraph.h (varpool_node): Rename to varpool_node_for_tree. > > Sure it should be varpool_node_for_decl, if any. > Or varpool_node_from_decl (grep for what is more common) Grep says _for_decl wins

Re: Use conditional casting with symtab_node

2012-09-19 Thread Lawrence Crowl
scope of the variable to the if statement, which prevents its unintended use later. It acts like a type switch. Why do you think cascading ifs is a bad idea? -- Lawrence Crowl

Re: Use conditional casting with symtab_node

2012-09-19 Thread Lawrence Crowl
an be shorter. That is, we can write 'function' instead of 'cgraph_node *'. -- Lawrence Crowl

Re: Use conditional casting with symtab_node

2012-09-19 Thread Lawrence Crowl
On 9/19/12, Gabriel Dos Reis wrote: > On Wed, Sep 19, 2012 at 1:39 PM, Lawrence Crowl wrote: >> On 9/19/12, Gabriel Dos Reis wrote: >>> On Sep 19, 2012 Richard Guenther wrote: >>> > Indeed. Btw, can we not provide a specialization for >>> > dynamic_ca

Re: Use conditional casting with symtab_node

2012-09-20 Thread Lawrence Crowl
On 9/20/12, Michael Matz wrote: > On Wed, 19 Sep 2012, Lawrence Crowl wrote: > > On 9/19/12, Eric Botcazou wrote: > > > > The language syntax would bind the conditional into the > > > > intializer, as in > > > > > >

Re: Use conditional casting with symtab_node

2012-09-20 Thread Lawrence Crowl
On 9/20/12, Gabriel Dos Reis wrote: > On Sep 20, 2012 Lawrence Crowl wrote: > > > > Why do you think cascading ifs is a bad idea? > > > > > > Precedent. Confusion in case of dangling else (requiring > > > more {}, and hence even more indentation).

Re: Use conditional casting with symtab_node

2012-09-21 Thread Lawrence Crowl
kay for trunk? Index: gcc/ChangeLog 2012-09-18 Lawrence Crowl vnode) { - prevailing->vnode = varpool_node (prevailing->decl); + prevailing->vnode = varpool_node_for_tree (prevailing->decl); prevailing->vnode->alias = true;

Re: Merge C++ conversion into trunk (4/6 - hash table rewrite)

2012-09-25 Thread Lawrence Crowl
ent_type. How about elemtype? Any objections to me changing it to that? -- Lawrence Crowl

Re: Merge C++ conversion into trunk (4/6 - hash table rewrite)

2012-09-26 Thread Lawrence Crowl
On 9/26/12, Michael Matz wrote: > On Tue, 25 Sep 2012, Lawrence Crowl wrote: > > On 8/15/12, Richard Henderson wrote: > > > On 2012-08-15 07:29, Richard Guenther wrote: > > > > typedef typename Element::Element_t Element_t; > > > > > > Can we use s

Re: Merge C++ conversion into trunk (4/6 - hash table rewrite)

2012-09-27 Thread Lawrence Crowl
On 9/27/12, Michael Matz wrote: > On Wed, 26 Sep 2012, Lawrence Crowl wrote: > > > A lower-case type name indicates to me a non-changing type, > > > i.e. nothing that depends on a template. In C we only had > > > such types so we used lower-case names everywhere.

Re: [wwwdocs] Update coding conventions for C++

2012-06-18 Thread Lawrence Crowl
nts, +so the type insecurity of printf is moot, +but the clarity in layout persists. +For quick debugging output, <iostream> requires less work. + + +Formatting Conventions + +Names + + +Naming data members with a trailing underscore +highlights the extra overhead of access to fields over local variables. +Think of the trailing underscore +like you would Pascal's postfix ^ dereference operator. + + + +When using the above convention, +the constructor parameter names +and getter member function names +can use the more concise non-underscore form. + + + + -- Lawrence Crowl

Re: Make timevar phases mutually exclusive. (issue6302064)

2012-06-18 Thread Lawrence Crowl
etup. I had to make a slight adjustment here. LTO runs as a front-end, and the parse timers are automatically started for the front ends. But LTO is not parsing. Rather than change every front end to handle those timers, I turned the timers off and then back on again within LTO. Committed. -- Lawrence Crowl

Re: [wwwdocs] Make codingconventions.html pass W3 validator.

2012-06-21 Thread Lawrence Crowl
should detect mirrors that have gone away, are persistently down, or are very out of date (the last being easy to do for those carrying snapshots, harder for those with releases only). DJ Delorie <mailto:d...@redhat.com";>d...@redhat.com> has some scripts to do this al

Re: [wwwdocs] Update coding conventions for C++

2012-06-25 Thread Lawrence Crowl
f that section. > > > + > > > +Indent protection labels by one space. > > > + > > > + > > > + > > > +Indent class members by two spaces. > > Do all the listed indentation rules correspond to what a > will do by default when editing C++ code in GNU Emacs? If not, > we have conflicting notions of GNU C++ indentation conventions. I have no idea. I don't use emacs. The two-space rule for members comes from the wiki. The one-space rule for protection labels is common practice. If folks want something else, changes are fine with me. I have also made a few other edits requested offline by Benjamin Kosnik. -- Lawrence Crowl

Re: [wwwdocs] Update coding conventions for C++

2012-06-25 Thread Lawrence Crowl
On 6/25/12, Lawrence Crowl wrote: > On 6/25/12, Joseph S. Myers wrote: >> On Mon, 25 Jun 2012, Diego Novillo wrote: >> > [ Added doc maintainers in CC ] >> > >> > While I'm not particularly interested in the details of the >> > coding conve

Re: [wwwdocs] Update coding conventions for C++

2012-06-25 Thread Lawrence Crowl
write into the conventions whatever concensus arises. Of course, I have no objection to an occasional inline cleanup. That is, build with -Werror and adjusting inlines that have, through the course of time, become larger than is useful. -- Lawrence Crowl

Re: [wwwdocs] Update coding conventions for C++

2012-06-26 Thread Lawrence Crowl
On 6/25/12, Alexandre Oliva wrote: > On Jun 25, 2012, Lawrence Crowl wrote: >> +These conventions will change over time, >> +but changing them requires that a convincing rationale. > > s/that// > >> +Complex heirarchies are to be avoided. > > s/heir/hier/ Both fixed. -- Lawrence Crowl

Re: [wwwdocs] Update coding conventions for C++

2012-06-26 Thread Lawrence Crowl
On 6/26/12, Martin Jambor wrote: > On Mon, Jun 25, 2012 at 03:26:01PM -0700, Lawrence Crowl wrote: > > > I have no idea. I don't use emacs. The two-space rule for > > > members comes from the wiki. The one-space rule for protection > > > labels is common prac

Re: [wwwdocs] Update coding conventions for C++

2012-06-26 Thread Lawrence Crowl
On 6/26/12, Jason Merrill wrote: > On 06/25/2012 06:26 PM, Lawrence Crowl wrote: > > +orgcc_unreachable. If the checks are expensive or the > > +compiler can reasonably carry on after the error, they may be > > +conditioned on--enable-checking. > > by using gcc_check

Re: [wwwdocs] Update coding conventions for C++

2012-06-27 Thread Lawrence Crowl
for case labels. > | > | Richard. > > I think we reached total agreement :-) I have changed the convention to not indent the protection label. -- Lawrence Crowl

Re: [wwwdocs] Update coding conventions for C++

2012-06-27 Thread Lawrence Crowl
On 6/27/12, Chiheng Xu wrote: > On Jun 19, 2012, Lawrence Crowl wrote: > > Function prototypes for extern functions should only occur in > > header files. Functions should be ordered within source files to > > minimize the number of function prototypes, by defining them

Re: [wwwdocs] Update coding conventions for C++

2012-06-27 Thread Lawrence Crowl
On 6/27/12, Martin Jambor wrote: > On Tue, Jun 26, 2012 at 11:06:15AM -0700, Lawrence Crowl wrote: > > On 6/26/12, Martin Jambor wrote: > > > On Mon, Jun 25, 2012 at 03:26:01PM -0700, Lawrence Crowl wrote: > > > > +but think twice before using it in code > &g

Re: [wwwdocs] Update coding conventions for C++

2012-06-28 Thread Lawrence Crowl
On 6/27/12, Lawrence Crowl wrote: > ..., does anyone object to removing the permission to use C++ > streams? Having heard no objection, I removed the permission. The following patch is the current state of the changes. Since the discussion appears to have died down, can I commit this

Re: [wwwdocs] Update coding conventions for C++

2012-06-29 Thread Lawrence Crowl
Resend, as I replied to a message that didn't have the usual suspects on the cc line. On 6/27/12, Lawrence Crowl wrote: > ..., does anyone object to removing the permission to use C++ > streams? Having heard no objection, I removed the permission. The following patch is the curre

Re: [wwwdocs] Update coding conventions for C++

2012-07-03 Thread Lawrence Crowl
On 7/1/12, Gabriel Dos Reis wrote: > On Fri, Jun 29, 2012 at 1:17 PM, Lawrence Crowl wrote: >> Resend, as I replied to a message that didn't have the usual suspects >> on the cc line. >> >> On 6/27/12, Lawrence Crowl wrote: >>> ..., does anyone o

Re: [wwwdocs] Update coding conventions for C++

2012-07-03 Thread Lawrence Crowl
On 7/1/12, Jason Merrill wrote: > On 06/29/2012 02:17 PM, Lawrence Crowl wrote: > > +RTTI anddynamic_cast > > + > > + > > +Run-time type information (RTTI) is permitted > > +when certain non-default--enable-checking options are > > enabled, > > +so

Re: [wwwdocs] Update coding conventions for C++

2012-07-09 Thread Lawrence Crowl
On 7/4/12, Jason Merrill wrote: > On 07/03/2012 04:37 PM, Lawrence Crowl wrote: >> On 7/1/12, Jason Merrill wrote: >>> As discussed, I would say that RTTI is currently not permitted >>> but could be added later. >> >> But isn't "could be added lat

Re: [wwwdocs] Update coding conventions for C++

2012-07-16 Thread Lawrence Crowl
On 7/10/12, Gabriel Dos Reis wrote: > Jason Merrill writes: > > | On 07/09/2012 06:00 PM, Lawrence Crowl wrote: > | > Done. New patch attached, but note that the tags have been > | > stripped from the patch to avoid mailer problems. > | > | Thanks. If nobody els

[cxx-conversion] Update hash-table to new coding conventions. (issue6430066)

2012-07-23 Thread Lawrence Crowl
-20 Lawrence Crowl * hash-table.h (xcallocator::control_alloc): Move definition out of class. (xcallocator::data_alloc): Likewise. (xcallocator::control_free): Likewise. (xcallocator::data_free): Likewise. (struct hash_table): Use class keyword

[cxx-conversion] Update hash-table to new coding conventions. (Part 2) (issue6435049)

2012-07-23 Thread Lawrence Crowl
Change new C++ code to follow the new C++ coding conventions. This patch is part two, which changes the spacing for the bodies of methods formerly defined in-class. The two-part approach makes diffs sensible. Index: gcc/ChangeLog.cxx-conversion 2012-07-23 Lawrence Crowl * hash

Turn check macros into functions. (issue6188088)

2012-05-15 Thread Lawrence Crowl
ter solution to the stepping behavior is a new gdb command. See http://sourceware.org/bugzilla/show_bug.cgi?id=12940.) Tested on x86-64. Index: gcc/ChangeLog.cxx-conversion 2012-05-15 Lawrence Crowl * tree.h (tree_check): New. (TREE_CHECK): Use inline function above inste

Re: Turn check macros into functions. (issue6188088)

2012-05-16 Thread Lawrence Crowl
template version, the other using the straight > > inline functions with const_tree parameters and CONST_CAST_TREE > > in return values. > > That's of course not exactly the same. The checking fns should > be able to unconditionally use const_tree anyway. The two versions are inline templates functions versus macros. I expect the non-template version would be roughly the same size as the template version. -- Lawrence Crowl

Re: Turn check macros into functions. (issue6188088)

2012-05-16 Thread Lawrence Crowl
On 5/16/12, Tom Tromey wrote: >>>>>> "Lawrence" == Lawrence Crowl writes: > > Lawrence> The effect is that it now possible to get useful responses > Lawrence> to gdb command like > Lawrence> (gdb) print DECL_FUNCTION_CODE (decl) > > D

Re: Turn check macros into functions. (issue6188088)

2012-05-17 Thread Lawrence Crowl
On 5/17/12, Tom Tromey wrote: > > "Lawrence" == Lawrence Crowl writes: > > Tom> Doesn't this mean that if you have checking enabled, and you use > Tom> the wrong macro on some tree, cc1 will crash? That seems like > Tom> a distinct minus to me. > &g

Re: Turn check macros into functions. (issue6188088)

2012-05-18 Thread Lawrence Crowl
On 5/17/12, Mike Stump wrote: > On May 17, 2012, at 2:41 PM, Lawrence Crowl wrote: >>> Reusing the compiler for this seems like the only way to go. >>> But, we did look at using g++ to parse C++ expressions from gdb, >>> and it was too slow :-(. We'

Re: Turn check macros into functions. (issue6188088)

2012-05-18 Thread Lawrence Crowl
, so we likely want to keep them as inline functions. With the inline functions, if the compiler is doing no inlining, we should still get near to that 3% reduction in binary size. -- Lawrence Crowl

Re: [cxx-conversion] Convert vec.[ch] to C++ [1/3] (issue6233044)

2012-05-23 Thread Lawrence Crowl
On 5/23/12, Diego Novillo wrote: > OK for cxx-conversion branch? LGTM. -- Lawrence Crowl

Re: [cxx-conversion] Convert vec.[ch] to C++ [2/3] (issue6236043)

2012-05-23 Thread Lawrence Crowl
On 5/23/12, Diego Novillo wrote: > Part 2 of the VEC C++ conversion. This patch implements the gengtype > changes. LGTM. -- Lawrence Crowl

Re: [cxx-conversion] Convert vec.[ch] to C++ [3/3] (issue6236044)

2012-05-23 Thread Lawrence Crowl
On 5/23/12, Diego Novillo wrote: > Part 3 of the VEC C++ conversion. This patch implements all the > client code changes needed by the API changes made by the first patch. LGTM. -- Lawrence Crowl

Re: Turn check macros into functions. (issue6188088)

2012-05-23 Thread Lawrence Crowl
On 5/21/12, Mike Stump wrote: > On May 18, 2012, at 7:48 PM, Lawrence Crowl wrote: >> On 5/17/12, Mike Stump wrote: >>> On May 17, 2012, at 2:41 PM, Lawrence Crowl wrote: >>>>> Reusing the compiler for this seems like the only way to go. >>>&

Re: Turn check macros into functions. (issue6188088)

2012-05-23 Thread Lawrence Crowl
> Alexander> same issue arises when calling debug_* functions in cc1 from > Alexander> the debugger. > > Yeah, why didn't I remember that? I think it should suffice. > Thanks for the reminder. Should I add that to my patch to gdbinit.in? -- Lawrence Crowl

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-24 Thread Lawrence Crowl
On 5/24/12, Gabriel Dos Reis wrote: > On May 24, 2012 Lawrence Crowl wrote: > > Add a type-safe hash table, typed_htab. Uses of this table > > replace uses of libiberty's htab_t. The benefits include less > > boiler-plate code, full type safety, and improved performan

Re: [cxx-conversion] Convert vec.[ch] to C++ [1/3] (issue6233044)

2012-05-24 Thread Lawrence Crowl
identifier. For everything else, it emits the type >>>directly. So, the functions emitted in gt-*.h files have proper >>>template type references. >> >> Well, that part is of course what needs to change. I don't think we want >> gengtype to work like this for templates as this does not scale. > > Well, certainly, but that was outside the scope of this one patch. I'm > trying to make small incremental steps. > >>> 2- Change VEC_index into operator[]. >>> >>> 3- Change VEC_replace(...) to assignments using operator[]. >> >> I think these should not be done for now - they merely add syntactic >> sugar, no? > > It makes the code more compact, readable and easier to write. > I can certainly wait until the branch has been merged to make > all these changes. It's going to affect a boatload of call sites. How about picking a one or two files to show the effect, but leave the bulk of the call site changes to later changes directly on trunk? -- Lawrence Crowl

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-25 Thread Lawrence Crowl
me. I'll do that ASAP. -- Lawrence Crowl

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-25 Thread Lawrence Crowl
ge in substance. We would simultaneously have to show benefit on two axes, which is a predictor of trouble. So, instead we chose to take a more incremental approach, exploiting C++ with the existing algorithms and requiring mostly mechanical changes in client code. Both the hash table and vector patches take that approach. -- Lawrence Crowl

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-25 Thread Lawrence Crowl
pecification of an out-of-line member function is going to be long, so a single-line specification is likely to overflow often. Whatever we chose, it should be reasonably extended to multiple lines. -- Lawrence Crowl

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-25 Thread Lawrence Crowl
rm that is consistent with the actual grammar of the language: int *p = *foo(3); Here there is no implication that foo binds more closely to either the * or the (, so the form is consistent with the grammar. We can go further and have the spacing reinforce the grammar, but lines will get longer. -- Lawrence Crowl

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-25 Thread Lawrence Crowl
On 5/24/12, Jakub Jelinek wrote: > On Thu, May 24, 2012 at 09:43:42AM -0700, Lawrence Crowl wrote: > > Add a type-safe hash table, typed_htab. Uses of this table > > replace uses of libiberty's htab_t. The benefits include less > > boiler-plate code, full type safety

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-25 Thread Lawrence Crowl
On 5/25/12, Mike Stump wrote: > On May 25, 2012, at 10:50 AM, Lawrence Crowl wrote: > > Diego and I looked long and hard at this issue. It all came > > down to a sequence of problems. First, libstdc++ isn't rigged > > for GTY, > > If portability to other C++ comp

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-28 Thread Lawrence Crowl
On 5/28/12, Jakub Jelinek wrote: > On Fri, May 25, 2012 at 02:42:39PM -0700, Lawrence Crowl wrote: > > On 5/24/12, Jakub Jelinek wrote: > > > On Thu, May 24, 2012 at 09:43:42AM -0700, Lawrence Crowl wrote: > > > > Add a type-safe hash table, typed_htab. Uses of t

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-28 Thread Lawrence Crowl
On 5/28/12, Jakub Jelinek wrote: > On Fri, May 25, 2012 at 05:43:20PM -0500, Gabriel Dos Reis wrote: > > On May 25, 2012 Lawrence Crowl wrote: > > > Personally, I would rather see if we can take advantage of C++ > > > features to reduce garbage and then use the Boeh

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-29 Thread Lawrence Crowl
On 5/24/12, Gabriel Dos Reis wrote: > On May 24, 2012 Lawrence Crowl wrote: > > Add a type-safe hash table, typed_htab. Uses of this table > > replace uses of libiberty's htab_t. The benefits include less > > boiler-plate code, full type safety, and improved performan

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-29 Thread Lawrence Crowl
of our customers. Having said that, let me be clear. There is no proposal as yet to change anything about garbage collection in gcc other than upgrade it as we need. (See Diego's vec patch.) We are just having a friendly philosophical discussion. :-) -- Lawrence Crowl

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-29 Thread Lawrence Crowl
On 5/29/12, Richard Guenther wrote: > On May 25, 2012 Mike Stump wrote: > > On May 25, 2012, at 10:50 AM, Lawrence Crowl wrote: > > > Diego and I looked long and hard at this issue. It all came > > > down to a sequence of problems. First, libstdc++ isn't

Re: [cxx-conversion] New Hash Table (issue6244048)

2012-05-30 Thread Lawrence Crowl
n work. Any construction work is always going to have a few "pardon the inconvenience" signs. If there is anything we can do to reduce that, but still make progress, please let us know. -- Lawrence Crowl

[cxx-conversion] Change check functions from templates to overloads. (issue6256075)

2012-05-30 Thread Lawrence Crowl
Change the check functions from templates to overloads. Add "set unwindonsignal on" to gdbinit.in to gracefully handle aborts in functions used from gdb. Tested on x86-64. Index: gcc/ChangeLog.cxx-conversion 2012-05-30 Lawrence Crowl * tree.h (tree_check): Change from t

[wwwdocs] Make codingconventions.html pass W3 validator.

2012-06-04 Thread Lawrence Crowl
diff -u -r1.66 codingconventions.html --- codingconventions.html 19 Feb 2012 00:45:34 - 1.66 +++ codingconventions.html 4 Jun 2012 22:39:15 - @@ -1,6 +1,9 @@ +http://www.w3.org/TR/html4/strict.dtd";> + GCC Coding Conventions -- Lawrence Crowl

Re: [wwwdocs] Make codingconventions.html pass W3 validator.

2012-06-05 Thread Lawrence Crowl
On 6/5/12, Gerald Pfeifer wrote: > On Mon, 4 Jun 2012, Lawrence Crowl wrote: > > The following source change enables coddingconventions.html to > > pass the HTML validator at validator.w3.org. > > the web pages will be preprocessed before the are put on the server > (th

Make timevar phases mutually exclusive. (issue6302064)

2012-06-11 Thread Lawrence Crowl
. Reading files now uses TV_PHASE_STREAM_IN. Writing files now uses TV_PHASE_STREAM_OUT. The remaining phase is TV_PHASE_OPT_GEN (formerly TV_PHASE_CGRAPH). Tested on x86_64. Okay for trunk? Index: gcc/ChangeLog 2012-06-11 Lawrence Crowl * timevar.def (TV_PHASE_GENERATE): Rename to

<    1   2   3   4   >