From 1e1bbbf51144d68dcef7d1abf8dab0f3ade3fb1a Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 2 Sep 2008 10:22:24 +0200 Subject: LLVM compiler: Access closure variables through the closure data pointer. --- MLKLexicalContext-MLKLLVMCompilation.mm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'MLKLexicalContext-MLKLLVMCompilation.mm') diff --git a/MLKLexicalContext-MLKLLVMCompilation.mm b/MLKLexicalContext-MLKLLVMCompilation.mm index e670151..4285d1e 100644 --- a/MLKLexicalContext-MLKLLVMCompilation.mm +++ b/MLKLexicalContext-MLKLLVMCompilation.mm @@ -44,7 +44,7 @@ id MLKDummyUseLLVMLexicalContext = nil; -(BOOL) variableHeapAllocationForSymbol:(id)name; { - id flag = [self deepPropertyForVariable:name + id flag = [self propertyForVariable:name key:@"LLVM.heap-flag"]; if (flag) @@ -85,11 +85,18 @@ id MLKDummyUseLLVMLexicalContext = nil; -(Value *) bindingValueForSymbol:(id)name { - return (Value *) [[self deepPropertyForVariable:name + return (Value *) [[self propertyForVariable:name key:@"LLVM.variable-binding"] pointerValue]; } +-(void) locallySetBindingValue:(Value *)value forSymbol:(id)name +{ + [self addShallowProperty:[NSValue valueWithPointer:value] + forVariable:name + key:@"LLVM.variable-binding"]; +} + -(void) setBindingValue:(Value *)value forSymbol:(id)name { [self setDeepProperty:[NSValue valueWithPointer:value] @@ -99,7 +106,7 @@ id MLKDummyUseLLVMLexicalContext = nil; -(Value *) valueValueForSymbol:(id)name { - return (Value *) [[self deepPropertyForVariable:name + return (Value *) [[self propertyForVariable:name key:@"LLVM.variable-value"] pointerValue]; } -- cgit v1.2.3