<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 31, 2014 at 12:37 AM, Frederico Araujo <span dir="ltr"><<a href="mailto:araujof@gmail.com" target="_blank">araujof@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I found the problem! <br><br>I forgot to update my make file to link against the ARCMigrate library. </div>
I realized that after adding -I$(LLVM_SRC_PATH)/tools/clang/lib/ARCMigrate to my CLANG_INCLUDES, I also had to add -lclangARCMigrate to my CLANG_LIBS, which solved the problem. <br>
</div><div>I wonder why Transforms.h isn't included in clang's tools build directory?<br></div></div></div></blockquote><div><br></div><div>I didn't even know the transforms stuff has such nice reusable functions. Generally, I'd say "arcmigrate" is the wrong layer of abstraction for those functions. We might want to put them next to clang's Lexer.</div>
<div><br></div><div>Generally, so far everybody has just rolled their own version of the findSemiAfterLocation function, which is admittedly very unfortunate.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>So, in conclusion, answering my first question, the following code can be used to find the location just after the semicolon:<br>
<div style="margin-left:40px"><br><i>SourceLocation SemiLoc = clang::arcmt::trans::findSemiAfterLocation(D->getLocEnd(), D->getASTContext());</i> </div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div style="margin-left:40px"><br><br></div>Regards,<br></div>Fred<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jul 30, 2014 at 5:18 PM, Frederico Araujo <span dir="ltr"><<a href="mailto:araujof@gmail.com" target="_blank">araujof@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div>Dear list,<br><br></div>I'm implementing a small source-to-source rewriter using clang tooling and AST matchers. <br></div>I'd like to ask if there is a way to use clang's API to find the source location after a semicolon of a matched declaration statement?<br>
<br></div>Looking in the documentation, I found the "<i>findLocationAfterSemi</i>" function which seems to be exactly what I want. However, I'm not being able to use it. Searching my llvm sources, I see its corresponding header file Transforms.h in <llvm_src_dir>/tools/clang/lib/ARCMigrate/ but not inside any sub-directory inside the directory I compiled clang (using cmake).<br>
<br></div><div>The function I mentioned can be found here: <br><a href="http://clang.llvm.org/doxygen/Transforms_8h.html" target="_blank">http://clang.llvm.org/doxygen/Transforms_8h.html</a><br></div><div><br></div>Any help will be much appreciated! <br>
<br></div>Thanks,<br>Fred<br></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<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>