我想将 LLVM 中的指令打印到字符串而不是屏幕上。我使用 I->print( errs() )
打印到屏幕。我怎样才能将指令放入字符串中?
最佳答案
像这样,
std::string str;
llvm::raw_string_ostream rso(str);
I->print(rso);
关于c++ - 我如何打印到 LLVM 中的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13515844/