#include "Support/Debug.h"
#include "Support/Statistic.h"
#include "Config/alloca.h"
-
-namespace llvm {
+using namespace llvm;
namespace {
Statistic<>
JITResolver *TheJITResolver;
}
+void *X86TargetMachine::getJITStubForFunction(Function *F,
+ MachineCodeEmitter &MCE) {
+ if (TheJITResolver == 0)
+ TheJITResolver = new JITResolver(MCE);
+ return (void*)TheJITResolver->getLazyResolver(F);
+}
/// addFunctionReference - This method is called when we need to emit the
/// address of a function that has not yet been emitted, so we don't know the
break;
}
}
-
-} // End llvm namespace
virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out);
virtual void replaceMachineCodeForFunction (void *Old, void *New);
+
+ /// getJITStubForFunction - Create or return a stub for the specified
+ /// function. This stub acts just like the specified function, except that it
+ /// allows the "address" of the function to be taken without having to
+ /// generate code for it.
+ virtual void *getJITStubForFunction(Function *F, MachineCodeEmitter &MCE);
};
} // End llvm namespace