[cfe-dev] Pinpointing VarDecl Location

Uri Mann umann at symantec.com
Fri Jul 25 09:04:19 PDT 2014


Hello All;

Given:
void f() {
  int a, b, c;
}

I'm wondering if there's a way to find the SourceLocation and/or SourceRange of a, b and c?
Using VarDecl::getSourceRange(), VarDecl::getStartLoc(), etc I get the same values for all instance between the type (int) and the ;.

Using the Lexer::LexFromRawLexer() is tedious and error prone. Any suggestions?

Thanks in advance.
-Uri

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140725/ca68c62d/attachment.html>


More information about the cfe-dev mailing list