Compilation without optimization

Thanks for the reply.

I wish to compile without optimizations ( the option being turned off ) but still generate bytecode file.

Options -S , -c removes optimizations but I also need .bc file to experiment and use further.

How should I do it?

Thanks
-TS

Thanks for the reply.

I wish to compile without optimizations ( the option being turned off ) but still generate bytecode file.

Options -S , -c removes optimizations but I also need .bc file to experiment and use further.

Passing "-Wa,-disable-opt -Wl,-disable-opt" will disable *all* cleanup and optimizations done at the llvm level, leaving you with the truly horrible code that you desire :).

-Chris

Thanks !!

But if i generate a .bc file like this and then run my pass over it like this :

opt -load /home/llvm-cvs/llvm/Debug/lib/LLVMHello.so -hello <helloprog.bc> class_prog.bc

Will the new .bc file (class_prog.bc) be also without optimizations ?opt also does some optimizations.Can I control them ?

Thanks
Tanu

Thanks !!
But if i generate a .bc file like this and then run my pass over it like this :

opt -load /home/llvm-cvs/llvm/Debug/lib/LLVMHello.so -hello <helloprog.bc> class_prog.bc

Will the new .bc file (class_prog.bc) be also without optimizations ?opt also does some optimizations.Can I control them ?

Opt is the universal modular optimizer. It does exactly what you tell it to and nothing more. In particular if you tell it to run just your pass, that is all it does.

-Chris