How can I print to a string in LLVM

后端 未结 1 1645
鱼传尺愫
鱼传尺愫 2021-01-02 20:24

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

1条回答
  •  醉酒成梦
    2021-01-02 20:41

    Like this,

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

    0 讨论(0)
提交回复
热议问题