summaryrefslogtreecommitdiff
path: root/MLKLexicalContext.m
diff options
context:
space:
mode:
authorMatthias Benkard <mulk@minimulk.mst-plus>2008-10-01 10:32:17 +0200
committerMatthias Benkard <mulk@minimulk.mst-plus>2008-10-01 10:32:17 +0200
commit8c28cc5aaeeb3546e4c113734e18285699bf779e (patch)
tree61a9c97aa9e4c70314daed2f8d17b4f2bd36b39f /MLKLexicalContext.m
parentf3cc34c256ed93e09541d1019e00e45012075920 (diff)
LLVM compiler: Support FUNCTION.
Diffstat (limited to 'MLKLexicalContext.m')
-rw-r--r--MLKLexicalContext.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/MLKLexicalContext.m b/MLKLexicalContext.m
index acb5b4e..0afc66b 100644
--- a/MLKLexicalContext.m
+++ b/MLKLexicalContext.m
@@ -297,6 +297,12 @@ static MLKLexicalContext *global_context;
|| [self contextForVariable:name] == [MLKLexicalContext globalContext]);
}
+-(BOOL) functionIsGlobal:(id)name
+{
+ return (![self contextForFunction:name]
+ || [self contextForFunction:name] == [MLKLexicalContext globalContext]);
+}
+
-(BOOL) functionIsInline:(MLKSymbol *)symbol
{
if ([_functions containsObject:symbol])
@@ -455,6 +461,26 @@ static MLKLexicalContext *global_context;
}
}
+-(intptr_t *) closureDataLengthForSymbol:(id)name
+{
+ id prop = [self propertyForFunction:name
+ key:@"LEXCTX.closure-data-length"];
+
+ if (!prop)
+ {
+ intptr_t *cell = malloc (sizeof(intptr_t));
+ prop = [NSValue valueWithPointer:cell];
+ [self setDeepProperty:prop
+ forFunction:name
+ key:@"LEXCTX.closure-data-length"];
+ return cell;
+ }
+ else
+ {
+ return (intptr_t*)[prop pointerValue];
+ }
+}
+
-(id) bindingForSymbol:(id)name
{
id prop = [self propertyForVariable:name