문제

Is there anyway to emit the llvm-ir bytecode from inside my pass, into a file? I want the same format that I am getting by using the opt tool, so I can pass this file to the opt later.

도움이 되었습니까?

해결책

To print a module in the textual representation (which opt can parse just file) to stdout, use Module::dump(). To save it to a file, use Module::print (and just pass null as the 2nd argument). To dump it to a bitcode file, use llvm::WriteBitcodeToFile.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top