How can I print a string in LLVM

I want to print an instruction in LLVM for a string instead of a screen. I use I->print( errs() ) to print to the screen. How can I put an instruction in a string instead?

+4
source share
1 answer

Like this,

 std::string str; llvm::raw_string_ostream rso(str); I->print(rso); 
+8
source

Source: https://habr.com/ru/post/1447769/


All Articles