Functions within file context

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Functions within file context

manavender reddy
Hi

I am new to clang. I want to write  a program to print all the function in a C file. I am having a problem, its also printing some functions which are included in header files. But i only want to print 
functions which are defined in a given file. Is there any way to find this ? 


Thanks
Manavender

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Functions within file context

Eli Friedman
On Thu, Aug 12, 2010 at 5:50 PM, manavender reddy
<[hidden email]> wrote:
> Hi
> I am new to clang. I want to write  a program to print all the function in a
> C file. I am having a problem, its also printing some functions which are
> included in header files. But i only want to print
> functions which are defined in a given file. Is there any way to find this
> ?

Try SourceManager::isFromMainFile().

-Eli

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev