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

2012-05-30 Thread Lawrence Crowl
On 5/29/12, Michael Matz m...@suse.de wrote: On Sun, 27 May 2012, Gabriel Dos Reis wrote: people actually working on it and used to that style. We don't want to have a mixture of several different styles in the compiler. I (and I expect many others) don't want anyone working around

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

2012-05-30 Thread Tom Tromey
Lawrence == Lawrence Crowl cr...@google.com writes: Lawrence On 5/24/12, Gabriel Dos Reis g...@integrable-solutions.net wrote: On May 24, 2012 Lawrence Crowl cr...@google.com wrote: Add a type-safe hash table, typed_htab. Uses of this table replace uses of libiberty's htab_t. The benefits

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

2012-05-29 Thread Eric Botcazou
My main concern is that the precise collector we have in place now requires substantial care to use. It is supported by a tool that does not really understand C, let alone C++. We avoid the problems when annotations are unnecessary. We can do that in one of two ways, either by upgrading

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

2012-05-29 Thread Richard Guenther
On Fri, May 25, 2012 at 8:43 PM, Mike Stump mikest...@comcast.net 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++

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

2012-05-29 Thread Mike Stump
On May 25, 2012, at 2:42 PM, Lawrence Crowl wrote: On 5/24/12, Jakub Jelinek ja...@redhat.com wrote: You haven't looked at the most important problem of that approach - code bloat. Are you claiming that the size of the binary is more important than run-time performance, type safety, and

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

2012-05-29 Thread Mike Stump
On May 26, 2012, at 11:25 PM, Gabriel Dos Reis wrote: how do I want the codebase to look like in 10, 15, 20, 25 years. Gee, if the next 25 look just like the last 25, it will look very similar to what it looks like today. :-)

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

2012-05-29 Thread Lawrence Crowl
On 5/24/12, Gabriel Dos Reis g...@integrable-solutions.net wrote: On May 24, 2012 Lawrence Crowl cr...@google.com 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

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

2012-05-29 Thread Lawrence Crowl
On 5/28/12, Eric Botcazou ebotca...@adacore.com wrote: My main concern is that the precise collector we have in place now requires substantial care to use. It is supported by a tool that does not really understand C, let alone C++. We avoid the problems when annotations are unnecessary.

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

2012-05-29 Thread Lawrence Crowl
On 5/29/12, Richard Guenther richard.guent...@gmail.com wrote: On May 25, 2012 Mike Stump mikest...@comcast.net 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-29 Thread Michael Matz
Hi, On Sun, 27 May 2012, Gabriel Dos Reis wrote: people actually working on it and used to that style.  We don't want to have a mixture of several different styles in the compiler.  I (and I expect many others) don't want anyone working around the latter by going over the whole source

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

2012-05-28 Thread Jakub Jelinek
On Fri, May 25, 2012 at 02:42:39PM -0700, Lawrence Crowl wrote: On 5/24/12, Jakub Jelinek ja...@redhat.com 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

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

2012-05-28 Thread Jakub Jelinek
On Fri, May 25, 2012 at 05:43:20PM -0500, Gabriel Dos Reis wrote: On Fri, May 25, 2012 at 4:52 PM, Lawrence Crowl cr...@google.com wrote: Personally, I would rather see if we can take advantage of C++ features to reduce garbage and then use the Boehm collector. There is too much manual

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

2012-05-28 Thread Vladimir Makarov
On 05/25/2012 01:10 PM, Paweł Sikora wrote: On Friday 25 of May 2012 11:50:13 Gabriel Dos Reis wrote: On Fri, May 25, 2012 at 11:44 AM, Paweł Sikorapl...@agmk.net wrote: so, why you just don't use the hash table implementation from libstdc++? we have agreed on C++03 as a bootstrap compiler.

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

2012-05-28 Thread Lawrence Crowl
On 5/28/12, Jakub Jelinek ja...@redhat.com wrote: On Fri, May 25, 2012 at 02:42:39PM -0700, Lawrence Crowl wrote: On 5/24/12, Jakub Jelinek ja...@redhat.com 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

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

2012-05-27 Thread Gabriel Dos Reis
On Sat, May 26, 2012 at 10:21 PM, Michael Matz m...@suse.de wrote: Hi, On Fri, 25 May 2012, NightStrike wrote: This point of yours should be stressed.  Using writing standards of one language to develop in another language is a fundamentally bad idea.  C and C++ kind of look the same, but

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

2012-05-27 Thread Miles Bader
Gabriel Dos Reis g...@integrable-solutions.net writes: if this coding standard is going to be adopted as a GNU coding convention, then you have to be flexible and allow yourself to see beyond the past written in C. You have to ask yourself: how do I want the codebase to look like in 10, 15,

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

2012-05-26 Thread Michael Matz
Hi, On Fri, 25 May 2012, NightStrike wrote: This point of yours should be stressed. Using writing standards of one language to develop in another language is a fundamentally bad idea. C and C++ kind of look the same, but they are not: http://www.research.att.com/~bs/bs_faq.html#C-slash

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

2012-05-25 Thread Jakub Jelinek
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, and improved performance. You haven't looked at the most important

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 1:25 AM, Jakub Jelinek ja...@redhat.com wrote: Static functions are also not acceptable as template arguments, so this patch externalizes the functions.  To avoid potential name conflicts, the function names have been prefixed. Ugh.  I guess the C++ way around this

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

2012-05-25 Thread Gabriel Dos Reis
On Thu, May 24, 2012 at 4:55 PM, Diego Novillo dnovi...@google.com wrote: On 12-05-24 17:52 , Lawrence Crowl wrote: That said, I'll let y'all decide how much to put in any one piece. I favour the approach we are taking now.  Each patch to cxx-conversion is a small incremental step. When

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

2012-05-25 Thread Michael Matz
Hi, On Fri, 25 May 2012, Jakub Jelinek wrote: + /* Return the current size of this hash table. */ + + size_t size() + { +return htab-size; + } (and various other places) - formatting is wrong, missing space between (. And it doesn't start at the first column, and type

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 7:17 AM, Michael Matz m...@suse.de wrote: Hi, On Fri, 25 May 2012, Jakub Jelinek wrote: +  /* Return the current size of this hash table.  */ + +  size_t size() +  { +    return htab-size; +  } (and various other places) - formatting is wrong, missing

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

2012-05-25 Thread Michael Matz
Hi, On Fri, 25 May 2012, Gabriel Dos Reis wrote: (and various other places) - formatting is wrong, missing space between (. And it doesn't start at the first column, and type isn't on a separate line.  I realize that this is a member method, hence indenting and C GNU coding

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

2012-05-25 Thread Steven Bosscher
On Fri, May 25, 2012 at 3:51 PM, Michael Matz m...@suse.de wrote: Hi, On Fri, 25 May 2012, Gabriel Dos Reis wrote: (and various other places) - formatting is wrong, missing space between (. And it doesn't start at the first column, and type isn't on a separate line.  I realize that

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

2012-05-25 Thread Jakub Jelinek
On Fri, May 25, 2012 at 03:51:25PM +0200, Michael Matz wrote: On Fri, 25 May 2012, Gabriel Dos Reis wrote: That's one of my fears, namely that those used to the libstdc++ style impose that on the compiler source base. Because IMHO the libstdc++ style isn't very appealing. Seconded.

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

2012-05-25 Thread Michael Matz
Hi, On Fri, 25 May 2012, Steven Bosscher wrote: Note also the almost 2 decades of C++ style practice in our libstdc++ implementation. That's one of my fears, namely that those used to the libstdc++ style impose that on the compiler source base.  Because IMHO the libstdc++ style

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

2012-05-25 Thread Diego Novillo
On 12-05-25 09:56 , Jakub Jelinek wrote: On Fri, May 25, 2012 at 03:51:25PM +0200, Michael Matz wrote: On Fri, 25 May 2012, Gabriel Dos Reis wrote: That's one of my fears, namely that those used to the libstdc++ style impose that on the compiler source base. Because IMHO the libstdc++ style

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 8:57 AM, Michael Matz m...@suse.de wrote: Hi, On Fri, 25 May 2012, Steven Bosscher wrote: Note also the almost 2 decades of C++ style practice in our libstdc++ implementation. That's one of my fears, namely that those used to the libstdc++ style impose that on

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 9:15 AM, Diego Novillo dnovi...@google.com wrote: I don't care how ugly coding conventions look.  I've dealt with many and they all have their ugly spots.  I mostly care about consistency. Agreed that consistency is very important. (At at single time in a week, I deal

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

2012-05-25 Thread Jakub Jelinek
On Fri, May 25, 2012 at 10:15:54AM -0400, Diego Novillo wrote: Lawrence, Ian and Gaby have been working on the proposed coding guidelines for C++ (http://gcc.gnu.org/wiki/CppConventions). That page is quite inconsistent. E.g. it first talks about retaining space before ( (which I really hope

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

2012-05-25 Thread Joseph S. Myers
On Fri, 25 May 2012, Diego Novillo wrote: I don't care how ugly coding conventions look. I've dealt with many and they all have their ugly spots. I mostly care about consistency. I don't think we should deviate much from the established GNU standards (which are hideous, btw). Mostly

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

2012-05-25 Thread Bernd Schmidt
On 05/25/2012 04:15 PM, Diego Novillo wrote: On 12-05-25 09:56 , Jakub Jelinek wrote: On Fri, May 25, 2012 at 03:51:25PM +0200, Michael Matz wrote: On Fri, 25 May 2012, Gabriel Dos Reis wrote: That's one of my fears, namely that those used to the libstdc++ style impose that on the compiler

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

2012-05-25 Thread Paolo Carlini
Hi, On Fri, May 25, 2012 at 7:17 AM, Michael Matz m...@suse.de wrote: Hi, On Fri, 25 May 2012, Jakub Jelinek wrote: + /* Return the current size of this hash table. */ + + size_t size() + { +return htab-size; + } (and various other places) - formatting is wrong, missing

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

2012-05-25 Thread Michael Matz
Hi, On Fri, 25 May 2012, Diego Novillo wrote: That's one of my fears, namely that those used to the libstdc++ style impose that on the compiler source base. Because IMHO the libstdc++ style isn't very appealing. Seconded. I don't care how ugly coding conventions look. Perhaps

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

2012-05-25 Thread Diego Novillo
On 12-05-25 11:06 , Michael Matz wrote: Hi, On Fri, 25 May 2012, Diego Novillo wrote: That's one of my fears, namely that those used to the libstdc++ style impose that on the compiler source base. Because IMHO the libstdc++ style isn't very appealing. Seconded. I don't care how ugly

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

2012-05-25 Thread NightStrike
On Fri, May 25, 2012 at 11:07 AM, Diego Novillo dnovi...@google.com wrote: On 12-05-25 11:06 , Michael Matz wrote: Hi, On Fri, 25 May 2012, Diego Novillo wrote: That's one of my fears, namely that those used to the libstdc++ style impose that on the compiler source base.  Because IMHO the

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 9:33 AM, Paolo Carlini pcarl...@gmail.com wrote: Hi, On Fri, May 25, 2012 at 7:17 AM, Michael Matz m...@suse.de wrote: Hi, On Fri, 25 May 2012, Jakub Jelinek wrote: +  /* Return the current size of this hash table.  */ + +  size_t size() +  { +    return

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 11:44 AM, Paweł Sikora pl...@agmk.net wrote: so, why you just don't use the hash table implementation from libstdc++? we have agreed on C++03 as a bootstrap compiler. There is unfortunately no hash table in C++03. The page about not defining a new template was just

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

2012-05-25 Thread NightStrike
On Fri, May 25, 2012 at 12:50 PM, Gabriel Dos Reis g...@integrable-solutions.net wrote: On Fri, May 25, 2012 at 11:44 AM, Paweł Sikora pl...@agmk.net wrote: so, why you just don't use the hash table implementation from libstdc++? we have agreed on C++03 as a bootstrap compiler. There is

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

2012-05-25 Thread Paweł Sikora
On Friday 25 of May 2012 11:50:13 Gabriel Dos Reis wrote: On Fri, May 25, 2012 at 11:44 AM, Paweł Sikora pl...@agmk.net wrote: so, why you just don't use the hash table implementation from libstdc++? we have agreed on C++03 as a bootstrap compiler. There is unfortunately no hash table in

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

2012-05-25 Thread Lawrence Crowl
On 5/25/12, Diego Novillo dnovi...@google.com wrote: Lawrence, Ian and Gaby have been working on the proposed coding guidelines for C++ (http://gcc.gnu.org/wiki/CppConventions). Lawrence, have you had a chance to update them with your latest edits? Not yet; they're on the desk in front of me.

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

2012-05-25 Thread Lawrence Crowl
On 5/25/12, Paweł Sikora pl...@agmk.net wrote: On Friday 25 of May 2012 10:15:54 Diego Novillo wrote: Lawrence, Ian and Gaby have been working on the proposed coding guidelines for C++ (http://gcc.gnu.org/wiki/CppConventions). on this page we can read: The following features of the C++

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

2012-05-25 Thread Mike Stump
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++ compilers wasn't a concern, we could extend out g++ to make supporting GTY

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

2012-05-25 Thread Mike Stump
On May 25, 2012, at 7:29 AM, Bernd Schmidt wrote: Can emacs handle the indentation rules automatically? I hope that any style picked, will have a no local mods required for emacs as the corner stone. One thing I hate about .md files, is they don't (last I checked) fulfill this requirement.

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

2012-05-25 Thread Lawrence Crowl
On 5/25/12, Michael Matz m...@suse.de wrote: On Fri, 25 May 2012, Jakub Jelinek wrote: + /* Return the current size of this hash table. */ + + size_t size() + { +return htab-size; + } (and various other places) - formatting is wrong, missing space between (. Yes,

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

2012-05-25 Thread Lawrence Crowl
On 5/25/12, Jakub Jelinek ja...@redhat.com wrote: On Fri, May 25, 2012 at 10:15:54AM -0400, Diego Novillo wrote: Lawrence, Ian and Gaby have been working on the proposed coding guidelines for C++ (http://gcc.gnu.org/wiki/CppConventions). That page is quite inconsistent. E.g. it first talks

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

2012-05-25 Thread Lawrence Crowl
On 5/24/12, Jakub Jelinek ja...@redhat.com 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, and improved

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

2012-05-25 Thread Lawrence Crowl
On 5/25/12, Mike Stump mikest...@comcast.net 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++ compilers wasn't a

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 4:16 PM, Lawrence Crowl cr...@google.com wrote: On 5/25/12, Jakub Jelinek ja...@redhat.com wrote: On Fri, May 25, 2012 at 10:15:54AM -0400, Diego Novillo wrote: Lawrence, Ian and Gaby have been working on the proposed coding guidelines for C++

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

2012-05-25 Thread Gabriel Dos Reis
On Fri, May 25, 2012 at 4:52 PM, Lawrence Crowl cr...@google.com wrote: Personally, I would rather see if we can take advantage of C++ features to reduce garbage and then use the Boehm collector. There is too much manual management with GTY, and I'd rather the compiler leverage mainstream

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

2012-05-25 Thread NightStrike
On Fri, May 25, 2012 at 12:42 PM, Gabriel Dos Reis g...@integrable-solutions.net wrote: with the current implementation language.  Consequently, I think we should retain the binding suggested by the C++ standard. I realize that the existing GNU C convention says the opposite -- but then it is

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

2012-05-25 Thread Miles Bader
NightStrike nightstr...@gmail.com writes: You wouldn't use the GNU C Coding conventions to write in tcl, and you shouldn't use them to write in C++. You should just create the GNU C++ Coding Standards new, and not base them off of the former. ... r, just use some common sense, and change

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

2012-05-24 Thread Lawrence Crowl
On 5/24/12, Gabriel Dos Reis g...@integrable-solutions.net wrote: On May 24, 2012 Lawrence Crowl cr...@google.com 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

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

2012-05-24 Thread Diego Novillo
On 12-05-24 17:52 , Lawrence Crowl wrote: That said, I'll let y'all decide how much to put in any one piece. I favour the approach we are taking now. Each patch to cxx-conversion is a small incremental step. When we merge into trunk we'll merge the final product of each change, of