1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00

Deconstify parameter to getPointerToFunction().

Run passes on single function (hey, just-in-time compilation!)
 instead of the entire module that contains it.

llvm-svn: 7819
This commit is contained in:
Brian Gaeke 2003-08-13 18:16:34 +00:00
parent f162b11e38
commit a6ca67ed4a

View File

@ -39,7 +39,7 @@ void VM::setupPassManager() {
/// getPointerToFunction - This method is used to get the address of the /// getPointerToFunction - This method is used to get the address of the
/// specified function, compiling it if neccesary. /// specified function, compiling it if neccesary.
/// ///
void *VM::getPointerToFunction(const Function *F) { void *VM::getPointerToFunction(Function *F) {
void *&Addr = GlobalAddress[F]; // Function already code gen'd void *&Addr = GlobalAddress[F]; // Function already code gen'd
if (Addr) return Addr; if (Addr) return Addr;
@ -49,11 +49,9 @@ void *VM::getPointerToFunction(const Function *F) {
static bool isAlreadyCodeGenerating = false; static bool isAlreadyCodeGenerating = false;
assert(!isAlreadyCodeGenerating && "ERROR: RECURSIVE COMPILATION DETECTED!"); assert(!isAlreadyCodeGenerating && "ERROR: RECURSIVE COMPILATION DETECTED!");
// FIXME: JIT all of the functions in the module. Eventually this will JIT // JIT the function
// functions on demand. This has the effect of populating all of the
// non-external functions into the GlobalAddress table.
isAlreadyCodeGenerating = true; isAlreadyCodeGenerating = true;
PM.run(getModule()); PM.run(*F);
isAlreadyCodeGenerating = false; isAlreadyCodeGenerating = false;
assert(Addr && "Code generation didn't add function to GlobalAddress table!"); assert(Addr && "Code generation didn't add function to GlobalAddress table!");