X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FX86%2FX86TargetMachine.cpp;h=7d5e5ce4e96b822f214207d21c2edf1dc395f099;hb=7d25589ee19747720a6cdb045ae442332f90bbcf;hp=4273dafefcf5eb99f4cac448ce7e5172ff60818c;hpb=b4f68ed32ede4cf7d31ce9e516e4074dad0a24ee;p=oota-llvm.git diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 4273dafefcf..7d5e5ce4e96 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -5,7 +5,9 @@ //===----------------------------------------------------------------------===// #include "X86TargetMachine.h" +#include "llvm/Transforms/Scalar.h" #include "llvm/Target/TargetMachineImpls.h" +#include "llvm/CodeGen/MachineFunction.h" #include "llvm/PassManager.h" #include "X86.h" #include @@ -27,13 +29,25 @@ X86TargetMachine::X86TargetMachine() : TargetMachine("X86", 1, 4, 4, 4) { /// not supported for this target. /// bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) { + // For the moment we have decided that malloc and free will be + // taken care of by converting them to calls, using the existing + // LLVM scalar transforms pass to do this. + PM.add(createLowerAllocationsPass()); + PM.add(createSimpleX86InstructionSelector(*this)); // TODO: optional optimizations go here + // Print the instruction selected machine code... + PM.add(createMachineFunctionPrinterPass()); + // Perform register allocation to convert to a concrete x86 representation - //PM.add(createSimpleX86RegisterAllocator(*this)); + PM.add(createSimpleX86RegisterAllocator(*this)); + + // Print the instruction selected machine code... + // PM.add(createMachineFunctionPrinterPass()); + // Print the register-allocated code PM.add(createX86CodePrinterPass(*this, std::cerr)); //PM.add(createEmitX86CodeToMemory(*this));