Theres a direct way todo this? How can I avoid writing a AST file? When I run<br><br>clang -cc1 -load ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so -plugin print-fns test_file.c<br>or<br>clang -cc1 -load ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so -plugin print-fns test_file.c -S -emit-llvm <br>
<br>I don't get any output, just my own printouts.<br><br><div class="gmail_quote">On Tue, Sep 13, 2011 at 7:23 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Sep 13, 2011, at 4:20 PM, Mark Brown wrote:<br>
> My plugin now adds AnnotateAttr objects directly to VarDecls, and writes out the AST file. This AST file is compiled to clang, with the -S -emit-llvm options, and there is nothing about these AnnotateAttr in there. I can tell they are being add because they print to the screen before hand, but there are no traces in the IR file.<br>

><br>
> I was expecting to see my string or atleast a reference to @llvm.var.annotation.<br>
><br>
> Am I missing something?<br>
<br>
</div>That should work.  It's possible that the attributes are not being<br>
serialized or deserialized properly;  I would check whether it works<br>
when you don't round-trip through an AST file.<br>
<font color="#888888"><br>
John.<br>
</font></blockquote></div><br>