[cfe-dev] How do I get the EndLoc for a function prototype?

scott constable via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 3 10:59:43 PDT 2016


Hi All,

This seems really simple, but I just can't get it to work. Suppose I'm
running a libtool over the following code:

int foo(int);

int foo(int i) {
  return ++i;
}

When I intercept the first foo FunctionDecl (the prototype) with a
RecursiveASTVisitor and I get the SourceRange, I would expect it to be

int foo(int);
^begin      ^end

int foo(int i) {
  return ++i;
}

But instead I get

int foo(int);
^begin

int foo(int i) {
  return ++i;
}
^end

Any advice would be much appreciated.

Thanks in advance,

Scott Constable
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160803/ce19b3ae/attachment.html>


More information about the cfe-dev mailing list