1 //==- SparcJITInfo.h - Sparc Implementation of the JIT Interface -*- 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 contains the declaration of the SparcJITInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef SPARCJITINFO_H
15 #define SPARCJITINFO_H
17 #include "llvm/CodeGen/MachineConstantPool.h"
18 #include "llvm/CodeGen/MachineFunction.h"
19 #include "llvm/Target/TargetJITInfo.h"
22 class SparcTargetMachine;
24 class SparcJITInfo : public TargetJITInfo {
29 explicit SparcJITInfo()
32 /// replaceMachineCodeForFunction - Make it so that calling the function
33 /// whose machine code is at OLD turns into a call to NEW, perhaps by
34 /// overwriting OLD with a branch to NEW. This is used for self-modifying
37 virtual void replaceMachineCodeForFunction(void *Old, void *New);
39 // getStubLayout - Returns the size and alignment of the largest call stub
41 virtual StubLayout getStubLayout();
44 /// emitFunctionStub - Use the specified JITCodeEmitter object to emit a
45 /// small native function that simply calls the function at the specified
47 virtual void *emitFunctionStub(const Function *F, void *Fn,
50 /// getLazyResolverFunction - Expose the lazy resolver to the JIT.
51 virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn);
53 /// relocate - Before the JIT can run a block of code that has been emitted,
54 /// it must rewrite the code to contain the actual addresses of any
55 /// referenced global symbols.
56 virtual void relocate(void *Function, MachineRelocation *MR,
57 unsigned NumRelocs, unsigned char *GOTBase);
59 /// Initialize - Initialize internal stage for the function being JITted.
60 void Initialize(const MachineFunction &MF, bool isPIC) {