LLVM API Documentation

PPCMachOWriterInfo.h

Go to the documentation of this file.
00001 //===-- PPCMachOWriterInfo.h - Mach-O Writer Info for PowerPC ---*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements Mach-O writer information for the PowerPC backend.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef PPC_MACHO_WRITER_INFO_H
00015 #define PPC_MACHO_WRITER_INFO_H
00016 
00017 #include "llvm/Target/TargetMachOWriterInfo.h"
00018 
00019 namespace llvm {
00020 
00021   // Forward declarations
00022   class MachineRelocation;
00023   class OutputBuffer;
00024   class PPCTargetMachine;
00025 
00026   class PPCMachOWriterInfo : public TargetMachOWriterInfo {
00027   public:
00028     PPCMachOWriterInfo(const PPCTargetMachine &TM);
00029     virtual ~PPCMachOWriterInfo();
00030 
00031     virtual unsigned GetTargetRelocation(MachineRelocation &MR,
00032                                          unsigned FromIdx,
00033                                          unsigned ToAddr,
00034                                          unsigned ToIdx,
00035                                          OutputBuffer &RelocOut,
00036                                          OutputBuffer &SecOut,
00037                                          bool Scattered, bool Extern) const;
00038 
00039     // Constants for the relocation r_type field.
00040     // See <mach-o/ppc/reloc.h>
00041     enum {
00042       PPC_RELOC_VANILLA, // generic relocation
00043       PPC_RELOC_PAIR,    // the second relocation entry of a pair
00044       PPC_RELOC_BR14,    // 14 bit branch displacement to word address
00045       PPC_RELOC_BR24,    // 24 bit branch displacement to word address
00046       PPC_RELOC_HI16,    // a PAIR follows with the low 16 bits
00047       PPC_RELOC_LO16,    // a PAIR follows with the high 16 bits
00048       PPC_RELOC_HA16,    // a PAIR follows, which is sign extended to 32b
00049       PPC_RELOC_LO14     // LO16 with low 2 bits implicitly zero
00050     };
00051   };
00052 
00053 } // end llvm namespace
00054 
00055 #endif // PPC_MACHO_WRITER_INFO_H