LLVM API Documentation
00001 //===- AlphaJITInfo.h - Alpha impl. of the JIT interface ----*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by the LLVM research group and is distributed under 00006 // the University of Illinois Open Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file contains the Alpha implementation of the TargetJITInfo class. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef ALPHA_JITINFO_H 00015 #define ALPHA_JITINFO_H 00016 00017 #include "llvm/Target/TargetJITInfo.h" 00018 #include "llvm/GlobalValue.h" 00019 #include <string> 00020 #include <map> 00021 00022 namespace llvm { 00023 class TargetMachine; 00024 00025 class AlphaJITInfo : public TargetJITInfo { 00026 protected: 00027 TargetMachine &TM; 00028 public: 00029 AlphaJITInfo(TargetMachine &tm) : TM(tm) 00030 { useGOT = true; } 00031 00032 /// addPassesToJITCompile - Add passes to the specified pass manager to 00033 /// implement a fast dynamic compiler for this target. Return true if this 00034 /// is not supported for this target. 00035 /// 00036 virtual void addPassesToJITCompile(FunctionPassManager &PM); 00037 00038 virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE); 00039 virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); 00040 virtual void relocate(void *Function, MachineRelocation *MR, 00041 unsigned NumRelocs, unsigned char* GOTBase); 00042 00043 /// replaceMachineCodeForFunction - Make it so that calling the function 00044 /// whose machine code is at OLD turns into a call to NEW, perhaps by 00045 /// overwriting OLD with a branch to NEW. This is used for self-modifying 00046 /// code. 00047 /// 00048 virtual void replaceMachineCodeForFunction(void *Old, void *New); 00049 00050 private: 00051 static const unsigned GOToffset = 4096; 00052 00053 }; 00054 } 00055 00056 #endif