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 #include "llvm/CodeGen/JITCodeEmitter.h"
00019 
00020 namespace llvm {
00021   class PPCTargetMachine;
00022 
00023   class PPCJITInfo : public TargetJITInfo {
00024   protected:
00025     PPCTargetMachine &TM;
00026     bool is64Bit;
00027   public:
00028     PPCJITInfo(PPCTargetMachine &tm, bool tmIs64Bit) : TM(tm) {
00029       useGOT = 0;
00030       is64Bit = tmIs64Bit;
00031     }
00032 
00033     virtual void *emitFunctionStub(const Function* F, void *Fn,
00034                                    JITCodeEmitter &JCE);
00035     virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
00036     virtual void relocate(void *Function, MachineRelocation *MR,
00037                           unsigned NumRelocs, unsigned char* GOTBase);
00038     
00039     /// replaceMachineCodeForFunction - Make it so that calling the function
00040     /// whose machine code is at OLD turns into a call to NEW, perhaps by
00041     /// overwriting OLD with a branch to NEW.  This is used for self-modifying
00042     /// code.
00043     ///
00044     virtual void replaceMachineCodeForFunction(void *Old, void *New);
00045   };
00046 }
00047 
00048 #endif