Hi,

Finding the name and position of a function/method is easy:

DeclarationNameInfo dni = fd -> getNameInfo();
SourceRange dniSr = dni.getSourceRange(); // dniSr is position and length of 
name in source file
std::string name = dni.getName().getAsString(); // name of function/method


But how can I get this information for variables? Both the name and
sourcerange.
I looked in getQualifier +Loc of DeclaratorDecl but they're always
missing it seems?



Folkert van Heusden

-- 
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to