[cfe-dev] a question about the location of "define"

Rambo hunanlwm at sina.cn
Sat Oct 19 22:04:38 PDT 2013


Hi,
   There is a sample program as follows:
#include<stdio.h>
#define *(1)*uchar char
void retrans(int *p,*(2)*uchar *q)
{

}
int main()
{
  int a=1;
  char b='c';
  retrans(&a,&b);
  return 0;
}
Now,I want to get the location about (2) with followed codes and I get
location of (1) actually.
for (FunctionDecl::param_iterator b = f->param_begin(), e = f->param_end();
b != e; ++b)
    if(ParmVarDecl *Body3=dyn_cast<ParmVarDecl>(*b))
          SourceLocation begin=Body3->getLocStart();
How I obtain the location (2)?thank you very much!

Rambo



--
View this message in context: http://clang-developers.42468.n3.nabble.com/a-question-about-the-location-of-define-tp4035225.html
Sent from the Clang Developers mailing list archive at Nabble.com.




More information about the cfe-dev mailing list