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, objc] maintenance, make Obj{C,C++} LTO-friendly.



On 3 Jul 2010, at 18:48, Mike Stump wrote:


On Jul 2, 2010, at 12:19 PM, IainS wrote:
In fact, it is a general step forward in that I have identified the reason that 'blanket' application of DECL_PRESERVE_P was required and got rid of that.

If you get it wrong, things just disappear from the file... I didn't audit it to make sure all your assumptions are correct. So, first, is there any data that should not be preserved that uses finish_var_decl? I didn't think there was? If not, I'd rather keep finish_var_decl as is.

lto will not work with finish_var_decl as it is.
see PR 43038 (although, as I see it this is not a problem to ObjC - since the version I posted produces the requisite connectivity and meta-data).


The only reason that we needed a "blanket" DECL_PRESERVE_P was that the variables we started were never finished - and thus were disconnected from the root data structures (Symtab &c).

-  expr = add_objc_string (get_identifier (""), class_names);
+  expr = add_objc_string (get_identifier ("N/A"), class_names);

the NULL string causes the Symtab to jump between sections when other data are all zero.
But that can be cured with explicit section decls.


Please leave this as "". I don't see a good reason to change it.

well .. one thing or the other ... (I have no colors to nail to a mast here).


UOBJC_SYMBOLS_decl = start_var_decl (objc_symtab_template, "_OBJC_SYMBOLS");
+ TREE_CONSTANT (UOBJC_SYMBOLS_decl) = 1;
+ if (flag_next_runtime)
+ {
+ tree sect = my_build_string (16, "__OBJC,__symbols");
+ DECL_SECTION_NAME (UOBJC_SYMBOLS_decl) = sect;
+ }


? This is overly darwin specific, and yet, this file isn't a darwin file. This shouldn't be necessary, as machopic_select_section should already select the right section based upon the name:

NeXT is darwin-specific - we should not need objc-specific stuff in the backend to try and guess the section based on the variable names.


It is my intention to separate the runtimes - so that we can hookize the interface to make it easier to add ABI V2.
I don't see it as any more Darwin-specific than NeXT is itself (although, of course, there's nothing to stop someone porting the NeXCT runtime to linux, for example). However, in the latter event I suspect they'd have to port the use of these sections too - since my understanding is that the runtime uses them.


-  /* Mark the decl to avoid "defined but not used" warning.  */
-  TREE_USED (var) = 1;

You didn't explain why one can get rid of this. I think it is still applicable?

well, we don't get the warning - because the decls that we *are* using are now output - and are linked back to the root meta-data that are DECL_PRESERVE_P'd


thanks for the review,
I guess one more pass needed :-)
Iain.




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