<div dir="ltr"><br><div>Answering my own question, the solution will be:</div><div><br></div><div><div>std::string str;</div><div>llvm::raw_string_ostream rso(str);</div><div>I.print(rso);</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 May 2017 at 08:34, Dipanjan Das <span dir="ltr"><<a href="mailto:mail.dipanjan.das@gmail.com" target="_blank">mail.dipanjan.das@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div>If 'I' is of type llvm::Instruction, we can print out the human-readable form (textual representation) of it by by, errs() << I;<div><br></div><div>I want the assign the exact same representation to a std::string to C type string. How can I do that?<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_2859094170303227356gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</div>