From 8c28cc5aaeeb3546e4c113734e18285699bf779e Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 1 Oct 2008 10:32:17 +0200 Subject: LLVM compiler: Support FUNCTION. --- MLKLexicalContext-MLKLLVMCompilation.mm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'MLKLexicalContext-MLKLLVMCompilation.mm') diff --git a/MLKLexicalContext-MLKLLVMCompilation.mm b/MLKLexicalContext-MLKLLVMCompilation.mm index 37f03f5..2d525a5 100644 --- a/MLKLexicalContext-MLKLLVMCompilation.mm +++ b/MLKLexicalContext-MLKLLVMCompilation.mm @@ -75,6 +75,15 @@ id MLKDummyUseLLVMLexicalContext = nil; PointerType::get(PointerType::get(PointerType::get(Type::Int8Ty, 0), 0), 0))); } +-(Instruction *) closureDataLengthValueForSymbol:(id)name +{ + // The length cell isn't really a void** but an intptr_t*. + return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty, + (uint64_t)[self closureDataLengthForSymbol:name], + false), + PointerType::get(PointerType::get(Type::Int8Ty, 0), 0))); +} + -(Instruction *) globalBindingValueForSymbol:(id)name { return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty, -- cgit v1.2.3 From 922d23c9daafbda42596086757291ae5af914c68 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 1 Oct 2008 17:25:55 +0200 Subject: Support %FLET on Mac OS X 10.5. --- MLKLexicalContext-MLKLLVMCompilation.mm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'MLKLexicalContext-MLKLLVMCompilation.mm') diff --git a/MLKLexicalContext-MLKLLVMCompilation.mm b/MLKLexicalContext-MLKLLVMCompilation.mm index 2d525a5..b387f62 100644 --- a/MLKLexicalContext-MLKLLVMCompilation.mm +++ b/MLKLexicalContext-MLKLLVMCompilation.mm @@ -120,6 +120,27 @@ id MLKDummyUseLLVMLexicalContext = nil; pointerValue]; } +-(Value *) functionBindingValueForSymbol:(id)name +{ + return (Value *) [[self propertyForVariable:name + key:@"LLVM.function-binding"] + pointerValue]; +} + +-(void) locallySetFunctionBindingValue:(Value *)value forSymbol:(id)name +{ + [self addShallowProperty:[NSValue valueWithPointer:value] + forVariable:name + key:@"LLVM.function-binding"]; +} + +-(void) setFunctionBindingValue:(Value *)value forSymbol:(id)name +{ + [self setDeepProperty:[NSValue valueWithPointer:value] + forVariable:name + key:@"LLVM.function-binding"]; +} + // -(void) setFunctionCellValue:(Value *)cellPtr forSymbol:(id)name // { // [self setDeepProperty:[NSValue valueWithPointer:cellPtr] -- cgit v1.2.3