File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 23
23
#include " Support/Debug.h"
24
24
#include " Support/Statistic.h"
25
25
#include " Config/alloca.h"
26
-
27
- namespace llvm {
26
+ using namespace llvm ;
28
27
29
28
namespace {
30
29
Statistic<>
@@ -54,6 +53,12 @@ namespace {
54
53
JITResolver *TheJITResolver;
55
54
}
56
55
56
+ void *X86TargetMachine::getJITStubForFunction (Function *F,
57
+ MachineCodeEmitter &MCE) {
58
+ if (TheJITResolver == 0 )
59
+ TheJITResolver = new JITResolver (MCE);
60
+ return (void *)TheJITResolver->getLazyResolver (F);
61
+ }
57
62
58
63
// / addFunctionReference - This method is called when we need to emit the
59
64
// / address of a function that has not yet been emitted, so we don't know the
@@ -591,5 +596,3 @@ void Emitter::emitInstruction(MachineInstr &MI) {
591
596
break ;
592
597
}
593
598
}
594
-
595
- } // End llvm namespace
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ class X86TargetMachine : public TargetMachine {
55
55
virtual bool addPassesToEmitAssembly (PassManager &PM, std::ostream &Out);
56
56
57
57
virtual void replaceMachineCodeForFunction (void *Old, void *New);
58
+
59
+ // / getJITStubForFunction - Create or return a stub for the specified
60
+ // / function. This stub acts just like the specified function, except that it
61
+ // / allows the "address" of the function to be taken without having to
62
+ // / generate code for it.
63
+ virtual void *getJITStubForFunction (Function *F, MachineCodeEmitter &MCE);
58
64
};
59
65
60
66
} // End llvm namespace
You can’t perform that action at this time.
0 commit comments