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: [trunk][patch] Don't print warnings in mangle_decl


Diego Novillo wrote:

>> What I think should happen is that we should do FE reachability
>> analysis, then toss out everything unreachable, then mangle what's left,
>> then pass things on to the ME.
>>
>> That may mean that we're not going to have "instantiated from here"
>> tracebacks.  But, I think that's OK.

> I agree.  I was assuming the FE was already doing this.  But if it
> isn't, I wonder how difficult this would be to implement.  How big an
> effort do you think this would be to implement?  I could look into it
> but I'll likely need some pointers.

The FE is doing a little bit of this.  I think functions that are never
called *at all* are not presented to the ME.  But, I don't think we're
building a call graph and pruning things not reachable from functions
that will appear in the object file.  Unless someone snuck that in there
when I wasn't looking.

I think the best way to do it would be to keep track of what functions
are referenced from with the function that's being defined, so that you
don't have to do any tree walks.  If function f "talks about" function
"g", but "g" in the reachable-from-f set.  Then, keep a list of
non-inline functions with external linkage.  Then, do the obvious graph
walk in cp_write_global_declarations, calling expand_or_defer_fn on
everything.

-- 
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]