Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 LLVM 中的指令打印到字符串而不是屏幕上。我I->print( errs() )用来打印到屏幕上。我怎样才能把指令放在一个字符串中?
I->print( errs() )
像这样,
std::string str; llvm::raw_string_ostream rso(str); I->print(rso);