[cfe-dev] CLANG Function Def... How to get Entire SourceRange

Suhas suhaslimaye at gmail.com
Mon Apr 9 02:58:29 PDT 2012


I have 2 function prototypes

extern  void  myTestFunc(double a, int c);
extern "C" void  myFunc2(int a, int c);

When i tried to get entire sourceRange for both,  with FunctionDecl object ,
as
FunctionDecl *FD;
sourceLocation sBegin = FD->getLocStart();
sourceLocation sEnd = FD->getLocEnd();
sourceRange.setBegin(sBegin);
sourceRange.setEnd(sEnd);

The sourceRange for 1st is getting as :
extern  void  myTestFunc(double a, int c)

where as for second
void  myFunc2(int a, int c)

Issue, is I want to get entire sourceRange for second. i.e
extern "C" void  myFunc2(int a, int c)


So, how to get entire SourceRange?


Suhas Limaye.
Pune.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120409/8da7db0b/attachment.html>


More information about the cfe-dev mailing list