summaryrefslogtreecommitdiff
path: root/MLKLexicalContext-MLKLLVMCompilation.mm
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-18 11:38:56 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-18 11:41:15 +0200
commit4447563e79bb32bbda14641733049fe544392917 (patch)
treed1d4cdd5498b988817d386a855887b403896eb6f /MLKLexicalContext-MLKLLVMCompilation.mm
parent60993a5e474244a3f4f623bb81d5191f2ec50993 (diff)
LLVM compiler: Implement dynamic variable access.
Diffstat (limited to 'MLKLexicalContext-MLKLLVMCompilation.mm')
-rw-r--r--MLKLexicalContext-MLKLLVMCompilation.mm12
1 files changed, 8 insertions, 4 deletions
diff --git a/MLKLexicalContext-MLKLLVMCompilation.mm b/MLKLexicalContext-MLKLLVMCompilation.mm
index 744351a..22d211d 100644
--- a/MLKLexicalContext-MLKLLVMCompilation.mm
+++ b/MLKLexicalContext-MLKLLVMCompilation.mm
@@ -45,7 +45,11 @@ using namespace std;
id flag = [self deepPropertyForVariable:name
key:@"LLVM.heap-flag"];
- return (flag && [flag boolValue]);
+ if (flag)
+ return [flag boolValue];
+ else
+ return (![self contextForVariable:name]
+ || [self contextForVariable:name] == [MLKLexicalContext globalContext]);
}
-(Instruction *) functionCellValueForSymbol:(id)name
@@ -70,12 +74,12 @@ using namespace std;
PointerType::get(PointerType::get(Type::Int8Ty, 0), 0)));
}
--(Value *) bindingValueForSymbol:(id)name
+-(Instruction *) bindingCellValueForSymbol:(id)name
{
return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty,
- (uint64_t)[self bindingForSymbol:name],
+ (uint64_t)[self bindingCellForSymbol:name],
false),
- PointerType::get(Type::Int8Ty, 0)));
+ PointerType::get(PointerType::get(Type::Int8Ty, 0), 0)));
}
-(Value *) valueValueForSymbol:(id)name