[cfe-dev] main functions of clang
Hans Wennborg
hans at chromium.org
Mon Dec 12 06:23:20 PST 2011
On Mon, Dec 12, 2011 at 2:03 PM, eyasu getahun <eya.get at gmail.com> wrote:
>
> Hey James,
>
> Thanks for the command line option. But where is the function called? I mean
> in which main method of clang it is called? We know that every function must
> be called at least at one main method/function to be executed. Let me make
> it clear like this way:
>
> int main ()//main method
> {
> S->Printpretty(context);
> }
>
> So, which main method is calling our printpretty() function? Hope now its
> clear for you.
Hi Eyasu,
The best way to find out where a function is called from is to run
Clang in a debugger, set a breakpoint in the function you are asking
about (StmtPrinter::PrintStmt), and look at the stack trace.
- Hans
More information about the cfe-dev
mailing list