Files
ldc/gen/nested.h
David Nadlinger d4eafe53e0 Removed obsolete nested context styles.
NChybrid was the only one that didn't instantly trigger a "not
implemented" assertion on any code using nested function for a long
time, and removing the cruft greatly improves code readability
(maintainability is a moot point anyway given its current state).
2012-09-07 03:51:33 +02:00

31 lines
1014 B
C

#ifndef LDC_GEN_NESTED_H
#define LDC_GEN_NESTED_H
#include "declaration.h"
#include "mtype.h"
#include "gen/dvalue.h"
#include "gen/llvm.h"
///////////////////////////////////////////////////////////
// Nested variable and context helpers
///////////////////////////////////////////////////////////
/// Creates the context value for a nested function.
void DtoCreateNestedContext(FuncDeclaration* fd);
/// Resolves the nested context for classes and structs with arbitrary nesting.
#if DMDV2
void DtoResolveNestedContext(Loc loc, AggregateDeclaration *decl, LLValue *value);
#else
void DtoResolveNestedContext(Loc loc, ClassDeclaration *decl, LLValue *value);
#endif
/// Gets the context value for a call to a nested function or creating a nested
/// class or struct with arbitrary nesting.
llvm::Value* DtoNestedContext(Loc loc, Dsymbol* sym);
/// Gets the DValue of a nested variable with arbitrary nesting.
DValue* DtoNestedVariable(Loc loc, Type* astype, VarDeclaration* vd, bool byref = false);
#endif