<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 17 jan 2012, at 14:57, Tobias Grosser wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 01/17/2012 11:49 AM, Pieter Custers wrote:<br><blockquote type="cite">Hi all,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I am using LLVM w/ Clang as front end. I use Clang to transform a C-file into LLVM-IR. Now I'm wondering if I can establish a relation between the SCoPs in this IR and the C-code. In other words, I want the line-number in the C-code of this SCoP (e.g. a loop nest) in LLVM-IR.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Is this possible, and if so, how do I obtain this?<br></blockquote><br>Hi Pieter,<br><br>it is not supported out of the box, but you may try to use the debugging information to get this information. However, keep in mind,<br>that debugging information is best afford and may not be available in all cases. If you really need accurate feedback based on C-code a source analysis tool like pet[1] may better fit your needs. pet uses clang and isl to extract a polyhedral model directly from the source code.<br></div></blockquote><div><blockquote type="cite"><br></blockquote><blockquote type="cite">Tobi<br></blockquote></div><blockquote type="cite"><div><br>[1] <a href="http://repo.or.cz/w/pet.git">http://repo.or.cz/w/pet.git</a></div></blockquote><div><br></div><div>I see now two possibilities:</div><div><br></div><div>1) pet would be okay to use, but then I loose the ability to transform loops in a canonical form (now I use a LLVM pass for that). Right?</div><div><br></div><div>2) I am looking to use CLang APIs in a C-program to construct the AST and try 'Mapping between cursors and source code' [2].</div><div><br></div><div>Cheers, Pieter</div><div><br></div><div>[2] <a href="http://clang.llvm.org/doxygen/group__CINDEX__CURSOR__SOURCE.html">http://clang.llvm.org/doxygen/group__CINDEX__CURSOR__SOURCE.html</a></div></div></body></html>