<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>FYI: There's also an example plugin that adds a pragma handler:</p>
<p>  <a href="https://github.com/llvm/llvm-project/blob/master/clang/examples/AnnotateFunctions/AnnotateFunctions.cpp">
https://github.com/llvm/llvm-project/blob/master/clang/examples/AnnotateFunctions/AnnotateFunctions.cpp</a></p>
<p> -Hal<br>
</p>
<div class="moz-cite-prefix">On 1/3/20 9:44 AM, Marcos Horro Varela via cfe-dev wrote:<br>
</div>
<blockquote type="cite" cite="mid:A61E266C-E8F7-4B91-A998-F84B6C37E6E4@getmailspring.com">
<div>That is exactly what I was looking for.</div>
<div>Thank you so much.</div>
<br>
<div>Regards,</div>
<br>
<div><signature id="initial">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="vertical-align:top"><br>
</td>
<td>
<div>H.</div>
<div style="font-size:0.9em;border-top:1px solid
                    gray;min-width:250px;max-width:300px;margin-top:4px;padding-top:4px">
<div>
<div><a href="https://link.getmailspring.com/link/A61E266C-E8F7-4B91-A998-F84B6C37E6E4@getmailspring.com/0?redirect=http%3A%2F%2Fgac.udc.es%2F~horro&recipient=Y2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%3D%3D" moz-do-not-send="true">http://gac.udc.es/~horro</a></div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</signature></div>
<div class="gmail_quote_attribution">On Jan 3 2020, at 8:21 am, Michael Kruse <a class="moz-txt-link-rfc2396E" href="mailto:llvm@meinersbur.de">
<llvm@meinersbur.de></a> wrote:</div>
<blockquote>
<div>
<div>You can create your own executable that creates a CompilerInstance and</div>
<div>adds pragma handles to it.</div>
<br>
<div>Example shown here:</div>
<div><a class="moz-txt-link-freetext" href="https://github.com/Meinersbur/pet/blob/master/pet.cc#L1139">https://github.com/Meinersbur/pet/blob/master/pet.cc#L1139</a></div>
<br>
<div>Michael</div>
<br>
<br>
<div>Am So., 29. Dez. 2019 um 00:32 Uhr schrieb Marcos Horro Varela via</div>
<div>cfe-dev <a class="moz-txt-link-rfc2396E" href="mailto:cfe-dev@lists.llvm.org">
<cfe-dev@lists.llvm.org></a>:</div>
<blockquote><br>
<div>Hello,</div>
<br>
<div>I have been reading some articles [1, 2] regarding how to implement handlers for custom pragmas. Nonetheless, in those posts Clang source code has to be modified. I am developing an Clang tool out-of-tree, so I do not want to make a custom version of Clang.
 I was just wondering if it is possible to build a custom handler for pragmas out-of-tree or if I have to tackle another approach maybe using annotations (?) or any other workaround? Basically I want to use pragmas for indicating loops of interest for the tool
 in C/C++ code.</div>
<div>Thanks!</div>
<br>
<div>Regards,</div>
<br>
<div>[1] <a class="moz-txt-link-freetext" href="https://blog.quarkslab.com/implementing-a-custom-directive-handler-in-clang.html">
https://blog.quarkslab.com/implementing-a-custom-directive-handler-in-clang.html</a></div>
<div>[2] <a class="moz-txt-link-freetext" href="https://git.scc.kit.edu/CES/clang-custom-pragma">
https://git.scc.kit.edu/CES/clang-custom-pragma</a></div>
<br>
<div>H.</div>
<div><a class="moz-txt-link-freetext" href="http://gac.udc.es/~horro">http://gac.udc.es/~horro</a></div>
<div>_______________________________________________</div>
<div>cfe-dev mailing list</div>
<div><a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a></div>
<div><a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a></div>
</blockquote>
</div>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>