<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="">Hello all,<div class=""><br class=""></div><div 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.</div><div class=""><br class=""></div><div 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:</div><div class=""><br class=""></div><div class="">int foo(int bar) __attribute__((address(0xdeadbeef)));</div><div class=""><br class=""></div><div class="">Attributes are especially convenient because they are easy to embed in a macro, which could end up looking like:</div><div class=""><br class=""></div><div class="">int foo(int bar) ADDRESS(0xdeadbeef);</div><div class=""><br class=""></div><div 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.</div><div class=""><br class=""></div><div class="">Are there extension points that I can leverage in the Clang static libraries to allow this?<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></body></html>