summaryrefslogtreecommitdiff
path: root/MLKRoot.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-23 16:34:08 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-23 16:34:08 +0200
commitad05662ae05336aa5db20f9d34d5c1d5bba9d6c2 (patch)
tree14c0f6321acb8532a3a3d92a957404dfa1f66ee8 /MLKRoot.m
parent13dc1ca7ca1d785313517b9f8d78e63414cb43df (diff)
Make compilers pluggable at runtime.
Diffstat (limited to 'MLKRoot.m')
-rw-r--r--MLKRoot.m11
1 files changed, 7 insertions, 4 deletions
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
{