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: [lto] PATCH: Add support for referencing types from function bodies


Andrew Pinski wrote:
On Mon, 2006-09-04 at 18:55 +0000, Joseph S. Myers wrote:
You could add a bit on VAR_DECLs which says to apply -fmerge-all-constants semantics to that VAR_DECL. (And then -fmerge-all-constants might apply that bit to all constant variables.)

Then why have CONST_DECLs in the first place? I don't see why the front-ends would need a CONST_DECL either. Yes for enums you cannot take the address of their name, then why not make CONST_DECLs local to the C/C++ front-ends instead?

From a code-generation point of view, it would be fine for CONST_DECLs to be local to front ends. It's also fine for them to be in the middle end, if they're useful in the same way to several front ends, just as we provide other utility routines in the middle end,


Front ends do need CONST_DECLs, or something like them, because they have to map the names the user types to something. CONST_DECLs are what you put in the symbol table to associate a name with a value. At present, they are also used for generating debugging information -- which is essentially a mechanism for passing the symbol table to the debugger.

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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