<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks Eli! That does solve my problem.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Le 31 oct. 2016 à 12:31:25, Friedman, Eli <<a href="mailto:efriedma@codeaurora.org" class="">efriedma@codeaurora.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class="">On 10/29/2016 11:23 AM, Félix Cloutier via cfe-dev wrote:<br class=""><blockquote type="cite" class="">Hello all,<br class=""><br class="">I'm working on a project that parses C headers with the Clang static libraries for binary program analysis purposes. I consume the AST and do not rely on codegen.<br class=""><br class="">I would love to be able to add some additional metadata to functions: specifically, the expected address of the function in the binary program. For instance:<br class=""><br class="">int foo(int bar) __attribute__((address(0xdeadbeef)));<br class=""><br class="">Attributes are especially convenient because they are easy to embed in a macro, which could end up looking like:<br class=""><br class="">int foo(int bar) ADDRESS(0xdeadbeef);<br class=""><br class="">Since this is an open-source project maintained by me only, I would prefer to not fork Clang, and just allow people to build my program with their distributions' stock Clang packages. Sadly, this apparently means that I can't use attributes for this purpose, because the valid attribute list appears to be hard-coded into Clang, and there doesn't seem to be any attribute that I can co-opt for this purpose.<br class=""><br class="">Are there extension points that I can leverage in the Clang static libraries to allow this?<br class=""></blockquote><br class="">The "annotate" attribute (`void f() __attribute((annotate("asdf"))) {}`) takes an arbitrary string, and has no semantic effect.<br class=""><br class="">-Eli<br class=""><br class="">-- <br class="">Employee of Qualcomm Innovation Center, Inc.<br class="">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br class=""><br class=""></div></div></blockquote></div><br class=""></body></html>