<div dir="ltr"><br><div>Hi Tim,<br></div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I think this is usually done via anonymous globals. For example if you<br>
use Clang to compile this:<br>
.<br>.<br>
.<br>
So you'll create a new global i8 array that gets initialized to your<br>
StringRef's data and then pass a pointer to its first element into<br>
your instrumentation function.<br></blockquote><div><br></div><div><br></div><div>Sorry to reply late. It worked perfectly fine. For the sake of completeness, this is what I did:</div><div><br></div><div>   Value* var_name = builder.CreateGlobalStringPtr(po->getName()); // builder is an IRBuilder instance</div><div><br></div><div>Above created the following IR:</div><div><br></div><div>@0 = private unnamed_addr constant [2 x i8] c"a\00"<br></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</div></div>