Code Generator

Hello,

Using... clang -O2 -S -c foo.c ... I get assembly code for an x86 architecture.

However, where is the assembly code generator? how I can modify it to generate a different prologue and epilogue? There is a gencode and an emitcode functions?

I just need a guide how to start.

Thanks in advance,

Using... clang -O2 -S -c foo.c ... I get assembly code for an x86
architecture. However, where is the assembly code generator?

clang itself generates just LLVM IR and then uses LLVM for all the
stuff like optimization, codegeneration, etc.

I just need a guide how to start.

http://llvm.org/docs/ contains some (small) amount of useful
information. In your case - you need to modify emitPrologue() and
emitEpilogue() methods of the X86RegisterInfo class.