<div dir="ltr">Actually i tried it but this approach has 2 problems:<div><br></div><div>1. I can't always be sure that there will be a previous declaration.</div><div>2. When i try to receive the end location of the previous entity, i get a location which is 2 or 3 offsets prior to the actual location. I think this is a bug in GetLocEnd.<br>

<br><div class="gmail_quote">On Tue, Nov 2, 2010 at 6:14 PM, jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Can't you do this by adding code *after* the previous declaration entity?<br>
<br>
- Fariborz<br>
<div><div></div><div class="h5"><br>
On Nov 2, 2010, at 7:54 AM, Nimrod Partush wrote:<br>
<br>
> Hi,<br>
><br>
> I want to add code just before a certain function deceleration.<br>
><br>
> I do this by visiting the FunctionDecl and using it's start location for InsertTextBefore.<br>
><br>
> The problem is that GetLocStart returns the location of the Function's name and not the entire prototype i.e. if i have this function:<br>
><br>
> static int f() {<br>
> }<br>
><br>
> i will get the location of "f" and not the location of "static".<br>
><br>
> Help?<br>
><br>
> Thanks.<br>
</div></div>> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</blockquote></div><br></div></div>