summaryrefslogtreecommitdiff
path: root/MLKLLVMCompiler.mm
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-23 18:49:20 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-23 18:49:20 +0200
commit8d9be8bd39dc08996c1e8de8d8f7517913287dc7 (patch)
treee4091c8d73f39d2b10b00b7192f397d30c8d511f /MLKLLVMCompiler.mm
parent06dc9f9bec349df6f3dffed0a9b5d1a4b16c8b27 (diff)
LLVM compiler: Add support for function inlining.
Diffstat (limited to 'MLKLLVMCompiler.mm')
-rw-r--r--MLKLLVMCompiler.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm
index 898ece2..f2d1d6e 100644
--- a/MLKLLVMCompiler.mm
+++ b/MLKLLVMCompiler.mm
@@ -40,6 +40,7 @@
#include <llvm/Target/TargetData.h>
#include <llvm/Transforms/Scalar.h>
#include <llvm/Transforms/IPO.h>
+#include <llvm/Transforms/Utils/Cloning.h> // InlineFunction
#include <llvm/Transforms/Utils/UnifyFunctionExitNodes.h>
#include <llvm/Value.h>
@@ -520,6 +521,14 @@ static Constant
args.end(),
[MLKPrintToString(_head) UTF8String]);
+ // XXX
+ if (NO && [_context functionInline:_head])
+ {
+ InlineFunction (call);
+ }
+
+ //[_compiler insertTrace:[NSString stringWithFormat:@"%@ done.", MLKPrintToString(_head)]];
+
return call;
}
@end