<div dir="ltr">Yes. I checked that file, but I wasn't sure whether that is right one to look at. <div>What is *.td extension btw? When I google it, it says this is for Windows Debug Simulator. </div><div>Why clang use this extension, which is limited to Windows environment?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 7:00 PM, Vedant Kumar <span dir="ltr"><<a href="mailto:vsk@apple.com" target="_blank">vsk@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That file is generated by the clang-tblgen tool:<br>
<br>
COMMAND = cd /Users/vk/Desktop/llvm/DA-<wbr>NoModules/tools/clang/include/<wbr>clang/Sema && /Users/vk/Desktop/llvm/DA-<wbr>NoModules/bin/clang-tblgen -gen-clang-attr-parsed-attr-<wbr>list -I /Users/vk/Desktop/llvm/tools/<wbr>clang/include/clang/Sema/../..<wbr>/ -I /Users/vk/Desktop/llvm/tools/<wbr>clang/include/clang/Sema -I /Users/vk/Desktop/llvm/lib/<wbr>Target -I /Users/vk/Desktop/llvm/include /Users/vk/Desktop/llvm/tools/<wbr>clang/include/clang/Sema/../<wbr>Basic/Attr.td -o /Users/vk/Desktop/llvm/DA-<wbr>NoModules/tools/clang/include/<wbr>clang/Sema/AttrParsedAttrList.<wbr>inc.tmp<br>
<br>
Try looking include/clang/Basic/Attr.td?<br>
<br>
best,<br>
vedant<br>
<div><div class="h5"><br>
> On Oct 25, 2016, at 2:54 PM, Sunghyun Park via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi, all.<br>
> I want to give programmer ability to tell LLVM that certain region of code is expected to get specialized optimization.<br>
> So, I'm trying to make custom pragma to mark certain region of code and pass this information to LLVM, in the similar way that '#pragma clang loop unroll_count(N)' works.<br>
><br>
> By tracking the framework of loop unroll pragma, I found out it works in the way below.<br>
> (1) Detect pragma at lexer, parser.<br>
> (2) Create AttributeList and push it into AST.<br>
> (3) Once AST is built, consume AST and generate LLVM IR at CodeGeneration<br>
> (4) If attribute for loop unroll is found, put tag on LLVM IR with Meta data which indicates whether to unroll loop.<br>
><br>
> Now I can detect my own pragma and figured it out how to create and tag custom metadata.<br>
> The problem is that creating custom AttributeList is somewhat hard to follow.<br>
><br>
> As far as I know, the attribute for loop unroll pragma gets serviced at ProcessSmtAttrbute Function @ tools/clang/lib/Sema/<wbr>SemaStmtAttr.cpp.<br>
> It contains switch statement like below.<br>
><br>
> ProcessSmtAttrbute @ tools/clang/lib/Sema/<wbr>SemaStmtAttr.cpp<br>
> // A : AttributeList - passed by argument<br>
> switch( A.getKind() ) {<br>
> case AttributeList::<wbr>UnknownAttribute:<br>
> ~<br>
> case AttributeList::AT_FallThrough:<br>
> return ~<br>
> case AttributeList::AT_LoopHint:<br>
> return handleLoopHintAttr( ~ )<br>
> case AttributeList::AT_<wbr>OpenCLUnrollHint:<br>
> ~<br>
> ...<br>
> }<br>
><br>
> As I want to define new attribute, I've tried to find where the definitions for AT_LoopHint, AT_FallThrough are done. This is what I found.<br>
><br>
> class AttributeList @ tools/clang/include/clang/<wbr>Sema/AttributeList.h<br>
><br>
> enum Kind{<br>
> #define PARSED ATTR(NAME) AT_##NAME,<br>
> #include "clang/Sema/<wbr>AttrParsedAttrList.inc"<br>
> #undef PARSED_ATTR<br>
> IgnoredAttribute,<br>
> UnkownAttribute<br>
> };<br>
><br>
> It looks like those are defined at this enum, but there's no such file, "clang/Sema/<wbr>AttrParsedAttrList.inc".<br>
><br>
> Anyone knows how those definitions are defined and how the kind of attributes are decided?<br>
> Thank you for your valuable time!<br>
><br>
> --<br>
> Best, Sung<br>
</div></div>> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Best, Sung<br></div></div></div></div>
</div>