1 //===-- PPCMachOWriterInfo.h - Mach-O Writer Info for PowerPC ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements Mach-O writer information for the PowerPC backend.
12 //===----------------------------------------------------------------------===//
14 #ifndef PPC_MACHO_WRITER_INFO_H
15 #define PPC_MACHO_WRITER_INFO_H
17 #include "llvm/Target/TargetMachOWriterInfo.h"
21 // Forward declarations
22 class MachineRelocation
;
24 class PPCTargetMachine
;
26 class PPCMachOWriterInfo
: public TargetMachOWriterInfo
{
28 PPCMachOWriterInfo(const PPCTargetMachine
&TM
);
29 virtual ~PPCMachOWriterInfo();
31 virtual unsigned GetTargetRelocation(MachineRelocation
&MR
,
35 OutputBuffer
&RelocOut
,
37 bool Scattered
, bool Extern
) const;
39 // Constants for the relocation r_type field.
40 // See <mach-o/ppc/reloc.h>
42 PPC_RELOC_VANILLA
, // generic relocation
43 PPC_RELOC_PAIR
, // the second relocation entry of a pair
44 PPC_RELOC_BR14
, // 14 bit branch displacement to word address
45 PPC_RELOC_BR24
, // 24 bit branch displacement to word address
46 PPC_RELOC_HI16
, // a PAIR follows with the low 16 bits
47 PPC_RELOC_LO16
, // a PAIR follows with the high 16 bits
48 PPC_RELOC_HA16
, // a PAIR follows, which is sign extended to 32b
49 PPC_RELOC_LO14
// LO16 with low 2 bits implicitly zero
53 } // end llvm namespace
55 #endif // PPC_MACHO_WRITER_INFO_H