<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi George,<br>
<br>
I was having a similar problem with source locations and macros, but
I was doing source-to-source transformations. I don't know if it
will help you, but I first expanded all the macros using a
RewriteMacrosAction, and that gave me valid SourceLocations to
rewrite to.<br>
<br>
Regards,<br>
Sam<br>
<br>
<div class="moz-cite-prefix">On 13/08/13 19:12, George Kastrinis
wrote:<br>
</div>
<blockquote
cite="mid:CADp3N42APXE+h+twG_vbC+uiZC24M1bxcdGuV9TnCohQi6fjvA@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>We are working on a Clang plugin, and we wan to have a way
to uniquely identify every declaration in a C++ program. We
tried using the following.</div>
<div>(presumed location start, presumed location end, spelling
location start, spelling location end, declaration kind)</div>
<div><br>
</div>
<div>But we still have a problem.</div>
<div><br>
</div>
<div>For example,
in /usr/include/x86_64-linux-gnu/bits/cmathcalls.h, line 101 a
macro called _MATHCALL is used. If you look at
/usr/include/complex.h, line 65 where the macro is defined,
you will see that the macro uses other macros inside and
create two functions (e.g. cpowf and __cpowf)</div>
<div><br>
</div>
I tried using spelling locations, presumed locations,
SourceManager::getExpansionLoc on the spelling location. All
give the same locations for cpowf and __cpowf.
<div><br>
</div>
<div>Is there any way to achieve what I try to do here?</div>
<div><br>
</div>
<div>Thanks for your time<br>
<div>
<div><br>
</div>
-- <br>
<div dir="ltr"><br>
George Kastrinis<br>
<a moz-do-not-send="true" href="http://gkastrinis.info/"
target="_blank">http://gkastrinis.info/</a><br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>