diff options
author | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-09-28 17:26:35 +0200 |
---|---|---|
committer | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-09-28 17:26:35 +0200 |
commit | ef2536760d6e144f7d903f9f488d3350c2bd2221 (patch) | |
tree | a5413ed01d984573992c8793cd76928eb934a805 | |
parent | 095213f5a96bdb8b1c5a3233f62bb4a6674d4257 (diff) |
LLVM compiler: Add various disabled debugging statements.
-rw-r--r-- | MLKCompiledClosure.m | 1 | ||||
-rw-r--r-- | MLKLLVMCompiler.h | 1 | ||||
-rw-r--r-- | MLKLLVMCompiler.mm | 11 |
3 files changed, 11 insertions, 2 deletions
diff --git a/MLKCompiledClosure.m b/MLKCompiledClosure.m index 32caf74..9227008 100644 --- a/MLKCompiledClosure.m +++ b/MLKCompiledClosure.m @@ -93,6 +93,7 @@ // } ffi_call (&cif, FFI_FN (_code), &return_value, (void**)argv); +// return_value = ((id (*)(void *, ...))_code) (_data, argpointers[0], argpointers[1], MLKEndOfArgumentsMarker); // FIXME: multiple values return [NSArray arrayWithObject:nullify((id)return_value)]; diff --git a/MLKLLVMCompiler.h b/MLKLLVMCompiler.h index cdcda0d..44f1b33 100644 --- a/MLKLLVMCompiler.h +++ b/MLKLLVMCompiler.h @@ -77,6 +77,7 @@ using namespace llvm; +(Value *) insertClassLookup:(NSString *)className; +(void) insertTrace:(NSString *)message; ++(void) insertPointerTrace:(Value *)value; #endif @end diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm index b3a47d3..39741ff 100644 --- a/MLKLLVMCompiler.mm +++ b/MLKLLVMCompiler.mm @@ -164,7 +164,7 @@ static Constant //module->dump(); //NSLog (@"%p", fn); - [pool release]; + LRELEASE (pool); //NSLog (@"Code compiled."); #if 1 @@ -537,6 +537,9 @@ static Constant closureDataCell = builder.Insert ([_context closureDataPointerValueForSymbol:_head]); closureDataPtr = builder.CreateLoad (closureDataCell); + //[_compiler insertTrace:[NSString stringWithFormat:@"Call: %@", MLKPrintToString(_head)]]; + //[_compiler insertPointerTrace:functionPtr]; + args.push_back (closureDataPtr); NSEnumerator *e = [_argumentForms objectEnumerator]; @@ -556,7 +559,11 @@ static Constant PointerTy); args.push_back (endmarker); - //[_compiler insertTrace:[NSString stringWithFormat:@"Function call: %@.", MLKPrintToString(_head)]]; + // If the pointer output here is different from the one above, + // there's some stack smashing going on. + //[_compiler insertTrace:[NSString stringWithFormat:@"Now calling: %@.", MLKPrintToString(_head)]]; + //[_compiler insertPointerTrace:functionPtr]; + CallInst *call = builder.CreateCall (functionPtr, args.begin(), args.end(), |