Skip to content

Commit 538dffd

Browse files
committed
Add new getJITStubForFunction method, which may optionally be implemented by
targets for better performance. llvm-svn: 10429
1 parent fa41ea3 commit 538dffd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

llvm/include/llvm/Target/TargetMachine.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,21 @@ class TargetMachine {
111111

112112
/// replaceMachineCodeForFunction - Make it so that calling the
113113
/// function whose machine code is at OLD turns into a call to NEW,
114-
/// perhaps by overwriting OLD with a branch to NEW. FIXME: this is
115-
/// JIT-specific.
114+
/// perhaps by overwriting OLD with a branch to NEW.
115+
///
116+
/// FIXME: this is JIT-specific.
116117
///
117118
virtual void replaceMachineCodeForFunction (void *Old, void *New) {
118119
assert (0 && "Current target cannot replace machine code for functions");
119120
}
121+
122+
/// getJITStubForFunction - Create or return a stub for the specified
123+
/// function. This stub acts just like the specified function, except that it
124+
/// allows the "address" of the function to be taken without having to
125+
/// generate code for it.
126+
virtual void *getJITStubForFunction(Function *F, MachineCodeEmitter &MCE) {
127+
return 0;
128+
}
120129
};
121130

122131
} // End llvm namespace

0 commit comments

Comments
 (0)