Do not try to emit nested functions with unanalyzed parents.

GitHub: Fixes #497.
This commit is contained in:
David Nadlinger
2013-10-13 21:37:53 +02:00
parent 07eec1840e
commit 265d3ee069
5 changed files with 35 additions and 18 deletions

View File

@@ -24,23 +24,6 @@ namespace cl = llvm::cl;
// NESTED VARIABLE HELPERS
////////////////////////////////////////////////////////////////////////////////////////*/
static FuncDeclaration* getParentFunc(Dsymbol* sym, bool stopOnStatic) {
if (!sym)
return NULL;
Dsymbol* parent = sym->parent;
assert(parent);
while (parent && !parent->isFuncDeclaration()) {
if (stopOnStatic) {
Declaration* decl = sym->isDeclaration();
if (decl && decl->isStatic())
return NULL;
}
parent = parent->parent;
}
return (parent ? parent->isFuncDeclaration() : NULL);
}
static void storeVariable(VarDeclaration *vd, LLValue *dst)
{
LLValue *value = vd->ir.irLocal->value;