1 //===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file contains the entry points for global functions defined in the LLVM 11 // PowerPC back-end. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef LLVM_TARGET_POWERPC_H 16 #define LLVM_TARGET_POWERPC_H 17 18 #include "MCTargetDesc/PPCBaseInfo.h" 19 #include "MCTargetDesc/PPCMCTargetDesc.h" 20 #include <string> 21 22 // GCC #defines PPC on Linux but we use it as our namespace name 23 #undef PPC 24 25 namespace llvm { 26 class PPCTargetMachine; 27 class FunctionPass; 28 class JITCodeEmitter; 29 class MachineInstr; 30 class AsmPrinter; 31 class MCInst; 32 33 FunctionPass *createPPCBranchSelectionPass(); 34 FunctionPass *createPPCISelDag(PPCTargetMachine &TM); 35 FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM, 36 JITCodeEmitter &MCE); 37 void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, 38 AsmPrinter &AP, bool isDarwin); 39 40 namespace PPCII { 41 42 /// Target Operand Flag enum. 43 enum TOF { 44 //===------------------------------------------------------------------===// 45 // PPC Specific MachineOperand flags. 46 MO_NO_FLAG, 47 48 /// MO_DARWIN_STUB - On a symbol operand "FOO", this indicates that the 49 /// reference is actually to the "FOO$stub" symbol. This is used for calls 50 /// and jumps to external functions on Tiger and earlier. 51 MO_DARWIN_STUB = 1, 52 53 /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol) 54 MO_LO16 = 4, MO_HA16 = 8, 55 56 /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to 57 /// the function's picbase, e.g. lo16(symbol-picbase). 58 MO_PIC_FLAG = 16, 59 60 /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to 61 /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase). 62 MO_NLP_FLAG = 32, 63 64 /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a 65 /// symbol with hidden visibility. This causes a different kind of 66 /// non-lazy-pointer to be generated. 67 MO_NLP_HIDDEN_FLAG = 64 68 }; 69 } // end namespace PPCII 70 71 } // end namespace llvm; 72 73 #endif 74