Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert llvm IR to c code?

Tags:

llvm

Is there any way to convert the llvm IR to c code and keep its semantics? For example, can we compile the c code first to llvm IR and then compile it back to another piece of c code. I don't expect that these two files will be the same. But they need to have the same functionality. Thanks

like image 558
Zhongshu Avatar asked Dec 19 '11 15:12

Zhongshu


1 Answers

You can use the C backend, with llc -march=c

like image 181
SK-logic Avatar answered Nov 11 '22 11:11

SK-logic