Hi all,
I have some functions definition to be used in another place.
I want to generate LLVM IR without any dead-code elimination, or the output will contains nothing.
Did anyone know how to achive that without any change of source code?
If not this way, which source file should I modify?
Thank you.
Hi all,
I have some functions definition to be used in another place.
If the function is not declared as "static", then clang must already
assume it can be used externally, and can't eliminate the code (even if
optimizing up to O3).
Unless you perform LTO, -internalize, or other such whole program
transformations, the code should be emitted.
The linker might still eliminate the function if no function from a
.o/.a is needed.
I want to generate LLVM IR without any dead-code elimination, or the
output will contains nothing.
-O0 should work, but obviously won't have any other optimization.
Did anyone know how to achive that without any change of source code?
If not this way, which source file should I modify?
__attribute__((used)) if you use the function from assembly and compiler
can't see its used.
Best regards,
--Edwin
Thanks. It works. Just move `static’ out.
Thank you very much.
2011/1/17 Török Edwin <edwintorok@gmail.com>