LLVM API Documentation

PPCJITInfo.h

Go to the documentation of this file.
00001 //===- PPCJITInfo.h - PowerPC impl. of the JIT interface --------*- 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 contains the PowerPC implementation of the TargetJITInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef POWERPC_JITINFO_H
00015 #define POWERPC_JITINFO_H
00016 
00017 #include "llvm/Target/TargetJITInfo.h"
00018 
00019 namespace llvm {
00020   class PPCTargetMachine;
00021 
00022   class PPCJITInfo : public TargetJITInfo {
00023   protected:
00024     PPCTargetMachine &TM;
00025     bool is64Bit;
00026   public:
00027     PPCJITInfo(PPCTargetMachine &tm, bool tmIs64Bit) : TM(tm) {
00028       useGOT = 0;
00029       is64Bit = tmIs64Bit;
00030     }
00031 
00032     virtual void *emitFunctionStub(const Function* F, void *Fn,
00033                                    MachineCodeEmitter &MCE);
00034     virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
00035     virtual void relocate(void *Function, MachineRelocation *MR,
00036                           unsigned NumRelocs, unsigned char* GOTBase);
00037     
00038     /// replaceMachineCodeForFunction - Make it so that calling the function
00039     /// whose machine code is at OLD turns into a call to NEW, perhaps by
00040     /// overwriting OLD with a branch to NEW.  This is used for self-modifying
00041     /// code.
00042     ///
00043     virtual void replaceMachineCodeForFunction(void *Old, void *New);
00044   };
00045 }
00046 
00047 #endif