From ad05662ae05336aa5db20f9d34d5c1d5bba9d6c2 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 23 Aug 2008 16:34:08 +0200 Subject: Make compilers pluggable at runtime. --- MLKRoot.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'MLKRoot.m') diff --git a/MLKRoot.m b/MLKRoot.m index 0db7483..361ce16 100644 --- a/MLKRoot.m +++ b/MLKRoot.m @@ -32,6 +32,7 @@ #import "MLKSingleFloat.h" #import "MLKDoubleFloat.h" #import "NSObject-MLKPrinting.h" +#import "globals.h" #import "runtime-compatibility.h" #import "util.h" @@ -708,17 +709,19 @@ as provided by method %@ of object %@", with:nil]]); } -#ifdef USE_LLVM +(NSArray *) compile:(NSArray *)args { + if (!MLKDefaultCompiler) + [NSException raise:@"MLKNotImplementedException" + format:@"It seems as though there is no compiler here."]; + //NSLog (@"Compiling lambda form."); - id thing = [MLKLLVMCompiler compile:denullify([args objectAtIndex:0]) - inContext:[MLKLexicalContext globalContext]]; + id thing = [MLKDefaultCompiler compile:denullify([args objectAtIndex:0]) + inContext:[MLKLexicalContext globalContext]]; //NSLog (@"Compilation done."); //NSLog (@"Compiled: %@", thing); RETURN_VALUE (thing); } -#endif +(NSArray *) fset:(NSArray *)args { -- cgit v1.2.3