[llvm-dev] Compiling LLVM to LLVM IR

Mackenzie Moore via llvm-dev llvm-dev at lists.llvm.org
Sat Jul 29 01:32:22 PDT 2017


Hello everyone,

I'm trying to compile LLVM and Clang into LLVM IR with debug info. I know that clang++ -g2 -S -emit-llvm <filename> does this, but I'm unfamiliar with CMake.

I tried changing CMAKE_CXX_FLAGS in CMakeCache.txt to "clang++ -g2 -S -emit-llvm," "-g2 -S -emit-llvm," and "-emit-llvm," but everything I tried resulted in a failed build, and/or .o files that didn't look like LLVM IR files when I opened them up. Where is the right place to pass these flags in?

Thanks,
Mackenzie


More information about the llvm-dev mailing list