diff gen/functions.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 56265fa07c7d
children 283d113d4753
line wrap: on
line diff
--- a/gen/functions.cpp	Fri Aug 01 21:56:13 2008 +0200
+++ b/gen/functions.cpp	Sat Aug 02 00:50:39 2008 +0200
@@ -559,6 +559,9 @@
     llvm::Instruction* allocaPoint = new llvm::AllocaInst(LLType::Int32Ty, "alloca point", beginbb);
     gIR->func()->allocapoint = allocaPoint;
 
+    // debug info - after all allocas, but before any llvm.dbg.declare etc
+    if (global.params.symdebug) DtoDwarfFuncStart(fd);
+
     // need result variable? (not nested)
     if (fd->vresult && !fd->vresult->nestedref) {
         Logger::println("non-nested vresult value");
@@ -625,9 +628,6 @@
         }
     }
 
-    // debug info
-    if (global.params.symdebug) DtoDwarfFuncStart(fd);
-
     LLValue* parentNested = NULL;
     if (FuncDeclaration* fd2 = fd->toParent2()->isFuncDeclaration()) {
         if (!fd->isStatic()) // huh?