[llvm-dev] Conversion of const llvm::MCExpr * to string

Florian Hahn via llvm-dev
Thu, 05 Oct 2017 11:34:43 -0000

Hi,

On 05/10/2017 02:05, hameeza ahmed via llvm-dev wrote:
> I need the expression in string. How can i convert llvm::MCExpr * to
string?
>

Using MCExpr::print [1] with raw_string_ostream [2] should do what you
want to do.

Cheers,
Florian



[1]
http://llvm.org/doxygen/classllvm_1_1MCExpr.html#ae3067756d9df7843be2d25cedab37da4

[2] http://llvm.org/doxygen/classllvm_1_1raw__string__ostream.html