summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MLKLLVMCompiler.mm16
1 files changed, 15 insertions, 1 deletions
diff --git a/MLKLLVMCompiler.mm b/MLKLLVMCompiler.mm
index 729db50..81a2361 100644
--- a/MLKLLVMCompiler.mm
+++ b/MLKLLVMCompiler.mm
@@ -335,9 +335,23 @@ static Constant
Type::Int32Ty,
PointerTy,
NULL);
-
+
builder.CreateCall (function, createGlobalStringPtr ([message UTF8String]));
}
+
++(void) insertPointerTrace:(Value *)pointerValue
+{
+ Constant *function =
+ module->getOrInsertFunction ("printf",
+ Type::Int32Ty,
+ PointerTy,
+ PointerTy,
+ NULL);
+
+ builder.CreateCall2 (function,
+ createGlobalStringPtr ("%p\n"),
+ builder.CreateBitCast (pointerValue, PointerTy));
+}
@end