Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 452:30ef3c7bddca
Fixed problems with nested 'this'. Fixes #39 .
Fixed problem with debug info order of intrinsic calls (func.start after declare).
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Sat, 02 Aug 2008 00:50:39 +0200 |
parents | cc40db549aea |
children | 60332cd85308 |
comparison
equal
deleted
inserted
replaced
451:4d9108f1fbf4 | 452:30ef3c7bddca |
---|---|
482 // resolve frame ptr | 482 // resolve frame ptr |
483 FuncDeclaration* func = vd->toParent2()->isFuncDeclaration(); | 483 FuncDeclaration* func = vd->toParent2()->isFuncDeclaration(); |
484 assert(func); | 484 assert(func); |
485 LLValue* ptr = DtoNestedContext(func); | 485 LLValue* ptr = DtoNestedContext(func); |
486 assert(ptr && "nested var, but no context"); | 486 assert(ptr && "nested var, but no context"); |
487 | |
488 // if the nested var is a this pointer it's a class member and not a magic struct | |
489 // so we're done here! | |
490 // this happens since 1.033 for some reason... always correct ? | |
491 if (vd->ident == Id::This) | |
492 { | |
493 return ptr; | |
494 } | |
495 | 487 |
496 // handle a "normal" nested variable | 488 // handle a "normal" nested variable |
497 | 489 |
498 // we must cast here to be sure. nested classes just have a void* | 490 // we must cast here to be sure. nested classes just have a void* |
499 ptr = DtoBitCast(ptr, func->ir.irFunc->nestedVar->getType()); | 491 ptr = DtoBitCast(ptr, func->ir.irFunc->nestedVar->getType()); |