|
Revision 1207:83d3b25c2213, 0.8 kB
(checked in by Frits van Bommel <fvbommel wxs.nl>, 3 years ago)
|
Isolate all knowledge of what a function's nested context looks like in a
single place. No functional change.
|
| Line | |
|---|
| 1 |
#ifndef LDC_GEN_NESTED_H |
|---|
| 2 |
#define LDC_GEN_NESTED_H |
|---|
| 3 |
|
|---|
| 4 |
#include "declaration.h" |
|---|
| 5 |
#include "mtype.h" |
|---|
| 6 |
#include "gen/dvalue.h" |
|---|
| 7 |
|
|---|
| 8 |
/////////////////////////////////////////////////////////// |
|---|
| 9 |
// Nested variable and context helpers |
|---|
| 10 |
/////////////////////////////////////////////////////////// |
|---|
| 11 |
|
|---|
| 12 |
/// Creates the context value for a nested function. |
|---|
| 13 |
void DtoCreateNestedContext(FuncDeclaration* fd); |
|---|
| 14 |
|
|---|
| 15 |
/// Allocate space for variable accessed from nested function. |
|---|
| 16 |
void DtoNestedInit(VarDeclaration* vd); |
|---|
| 17 |
|
|---|
| 18 |
/// Gets the context value for a call to a nested function or newing a nested |
|---|
| 19 |
/// class with arbitrary nesting. |
|---|
| 20 |
llvm::Value* DtoNestedContext(Loc loc, Dsymbol* sym); |
|---|
| 21 |
|
|---|
| 22 |
/// Gets the DValue of a nested variable with arbitrary nesting. |
|---|
| 23 |
DValue* DtoNestedVariable(Loc loc, Type* astype, VarDeclaration* vd); |
|---|
| 24 |
|
|---|
| 25 |
#endif |
|---|