comparison gen/llvmhelpers.h @ 1207:83d3b25c2213

Isolate all knowledge of what a function's nested context looks like in a single place. No functional change.
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 12 Apr 2009 13:08:24 +0200
parents 8baf611f0009
children 9014d7f0433f
comparison
equal deleted inserted replaced
1206:a5bfed1f6775 1207:83d3b25c2213
1 #ifndef LDC_GEN_LLVMHELPERS_H 1 #ifndef LDC_GEN_LLVMHELPERS_H
2 #define LDC_GEN_LLVMHELPERS_H 2 #define LDC_GEN_LLVMHELPERS_H
3 3
4 #include "gen/llvm.h" 4 #include "gen/llvm.h"
5 #include "gen/dvalue.h"
6
5 #include "statement.h" 7 #include "statement.h"
8 #include "mtype.h"
6 9
7 // this is used for tracking try-finally, synchronized and volatile scopes 10 // this is used for tracking try-finally, synchronized and volatile scopes
8 struct EnclosingHandler 11 struct EnclosingHandler
9 { 12 {
10 virtual void emitCode(IRState* p) = 0; 13 virtual void emitCode(IRState* p) = 0;
61 64
62 /// Enters a monitor lock. 65 /// Enters a monitor lock.
63 void DtoEnterMonitor(LLValue* v); 66 void DtoEnterMonitor(LLValue* v);
64 /// Leaves a monitor lock. 67 /// Leaves a monitor lock.
65 void DtoLeaveMonitor(LLValue* v); 68 void DtoLeaveMonitor(LLValue* v);
66
67 // nested variable and context helpers
68
69 /// Gets the context value for a call to a nested function or newing a nested
70 /// class with arbitrary nesting.
71 LLValue* DtoNestedContext(Loc loc, Dsymbol* sym);
72
73 /// Gets the DValue of a nested variable with arbitrary nesting.
74 DValue* DtoNestedVariable(Loc loc, Type* astype, VarDeclaration* vd);
75 69
76 // basic operations 70 // basic operations
77 void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs); 71 void DtoAssign(Loc& loc, DValue* lhs, DValue* rhs);
78 72
79 /// Create a null DValue. 73 /// Create a null DValue.