Article View: gnu.gcc.help
Article #50330Static analysis of g++ call flow
From: Jeff Greif
Date: Fri, 08 Oct 1993 14:55
Date: Fri, 08 Oct 1993 14:55
32 lines
2030 bytes
2030 bytes
>>>>> ">" == Richard Stallman <rms@gnu.ai.mit.edu> writes:
>> We are trying to use the output produced/generated from the flow analysis
>> phase of the compile to develop a kind of static call tree of our code.
>> To generate a call tree as a byproduct of compilation is a tempting
>> idea, but it has a fundamental flaw. You can't generate a complete
>> call graph from any kind of output from cc1 (or cc1plus), because they
>> don't know about all the calls that are in the source.
>> For example, if a function contains this:
>> #ifdef vax
>> foo ();
>> #endif
>> and you happen to be on a sun, by the time cc1 is running there is no
>> trace of the fact that a call to foo was present there.
>> If you rely on incomplete data for doing maintenance, bugs will
>> result. When you change the way to call foo, you need to find *all*
>> the calls, not just those that happen to be enabled on the target you
>> are using today.
>> For this reason, I believe cross-referencing ought to be done by
>> parsing the source directly, *without* going through cpp.
If you don't expand the macros you won't find all the calls either.
Also, I don't know anything about cc1plus internals -- will the flow
analysis phase still contain call_insn's for inlined methods?
Jeff
Technical Details
Message-ID:
<9310081453.AA03989@quaestor>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!inference.COM!jmgReferences:
<9310081435.AA24961@mole.gnu.ai.mit.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,b96c32e932f5d2d3 X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-10-08 08:08:58 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!inference.COM!jmg From: jmg@inference.COM (Jeff Greif) Newsgroups: gnu.gcc.help Subject: Static analysis of g++ call flow Date: 8 Oct 1993 10:55:20 -0400 Organization: Inference Corporation Lines: 32 Sender: daemon@cis.ohio-state.edu Distribution: gnu Message-ID: <9310081453.AA03989@quaestor> References: <9310081435.AA24961@mole.gnu.ai.mit.edu>