]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/Target/PowerPC/PPC.h
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / lib / Target / PowerPC / PPC.h
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/PPCMCTargetDesc.h"
19 #include <string>
20
21 // GCC #defines PPC on Linux but we use it as our namespace name
22 #undef PPC
23
24 namespace llvm {
25   class PPCTargetMachine;
26   class FunctionPass;
27   class formatted_raw_ostream;
28   class JITCodeEmitter;
29   class Target;
30   class MachineInstr;
31   class AsmPrinter;
32   class MCInst;
33   class MCCodeEmitter;
34   class MCContext;
35   class MCInstrInfo;
36   class MCSubtargetInfo;
37   class TargetMachine;
38   class TargetAsmBackend;
39   
40   FunctionPass *createPPCBranchSelectionPass();
41   FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
42   FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
43                                             JITCodeEmitter &MCE);
44   MCCodeEmitter *createPPCMCCodeEmitter(const MCInstrInfo &MCII,
45                                         const MCSubtargetInfo &STI,
46                                         MCContext &Ctx);
47   TargetAsmBackend *createPPCAsmBackend(const Target &, const std::string &);
48   
49   void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
50                                     AsmPrinter &AP, bool isDarwin);
51   
52   namespace PPCII {
53     
54   /// Target Operand Flag enum.
55   enum TOF {
56     //===------------------------------------------------------------------===//
57     // PPC Specific MachineOperand flags.
58     MO_NO_FLAG,
59     
60     /// MO_DARWIN_STUB - On a symbol operand "FOO", this indicates that the
61     /// reference is actually to the "FOO$stub" symbol.  This is used for calls
62     /// and jumps to external functions on Tiger and earlier.
63     MO_DARWIN_STUB = 1,
64     
65     /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol)
66     MO_LO16 = 4, MO_HA16 = 8,
67
68     /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
69     /// the function's picbase, e.g. lo16(symbol-picbase).
70     MO_PIC_FLAG = 16,
71
72     /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
73     /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
74     MO_NLP_FLAG = 32,
75     
76     /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
77     /// symbol with hidden visibility.  This causes a different kind of
78     /// non-lazy-pointer to be generated.
79     MO_NLP_HIDDEN_FLAG = 64
80   };
81   } // end namespace PPCII
82   
83 } // end namespace llvm;
84
85 #endif