Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 1 | //===-- PowerPCTargetMachine.cpp - Define TargetMachine for PowerPC -------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include "PowerPCTargetMachine.h" |
| 14 | #include "PowerPC.h" |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 15 | #include "llvm/Module.h" |
| 16 | #include "llvm/PassManager.h" |
Misha Brukman | 8c9f520 | 2004-06-21 18:30:31 +0000 | [diff] [blame] | 17 | #include "llvm/CodeGen/IntrinsicLowering.h" |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 18 | #include "llvm/CodeGen/MachineFunction.h" |
| 19 | #include "llvm/CodeGen/Passes.h" |
Chris Lattner | 68905bb | 2004-07-11 04:17:58 +0000 | [diff] [blame] | 20 | #include "llvm/Target/TargetOptions.h" |
Chris Lattner | d36c970 | 2004-07-11 02:48:49 +0000 | [diff] [blame] | 21 | #include "llvm/Target/TargetMachineRegistry.h" |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 22 | #include "llvm/Transforms/Scalar.h" |
Chris Lattner | d36c970 | 2004-07-11 02:48:49 +0000 | [diff] [blame] | 23 | #include <iostream> |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 24 | using namespace llvm; |
| 25 | |
Misha Brukman | 0145881 | 2004-08-11 00:11:25 +0000 | [diff] [blame^] | 26 | PowerPCTargetMachine::PowerPCTargetMachine(const std::string &name, |
| 27 | IntrinsicLowering *IL, |
| 28 | const TargetData &TD, |
| 29 | const TargetFrameInfo &TFI, |
| 30 | const PowerPCJITInfo &TJI) |
| 31 | : TargetMachine(name, IL, TD), FrameInfo(TFI), JITInfo(TJI) {} |
Chris Lattner | d36c970 | 2004-07-11 02:48:49 +0000 | [diff] [blame] | 32 | |
Misha Brukman | 01eca8d | 2004-07-12 23:36:12 +0000 | [diff] [blame] | 33 | unsigned PowerPCTargetMachine::getJITMatchQuality() { |
| 34 | #if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER) |
| 35 | return 10; |
| 36 | #else |
| 37 | return 0; |
| 38 | #endif |
| 39 | } |
Misha Brukman | 01eca8d | 2004-07-12 23:36:12 +0000 | [diff] [blame] | 40 | |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 41 | void PowerPCJITInfo::addPassesToJITCompile(FunctionPassManager &PM) { |
Misha Brukman | 0145881 | 2004-08-11 00:11:25 +0000 | [diff] [blame^] | 42 | assert(0 && "Cannot execute PowerPCJITInfo::addPassesToJITCompile()"); |
| 43 | } |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 44 | |
Misha Brukman | 0145881 | 2004-08-11 00:11:25 +0000 | [diff] [blame^] | 45 | void PowerPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) { |
| 46 | assert(0 && "Cannot execute PowerPCJITInfo::replaceMachineCodeForFunction()"); |
| 47 | } |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 48 | |
Misha Brukman | 0145881 | 2004-08-11 00:11:25 +0000 | [diff] [blame^] | 49 | void *PowerPCJITInfo::getJITStubForFunction(Function *F, |
| 50 | MachineCodeEmitter &MCE) { |
| 51 | assert(0 && "Cannot execute PowerPCJITInfo::getJITStubForFunction()"); |
| 52 | return 0; |
Misha Brukman | 5dfe3a9 | 2004-06-21 16:55:25 +0000 | [diff] [blame] | 53 | } |