[cfe-commits] r70928 - /cfe/branches/Apple/Dib/lib/CodeGen/CGStmt.cpp

Mike Stump mrs at apple.com
Mon May 4 15:32:28 PDT 2009


Author: mrs
Date: Mon May  4 17:32:28 2009
New Revision: 70928

URL: http://llvm.org/viewvc/llvm-project?rev=70928&view=rev
Log:
Merge in 70889:

"Fix" a problem with debug info in the presence of always_inline
function calls.  For a program like this:

#include <stdio.h>
static __inline__ __attribute__((always_inline)) 
int bar(int x) { return 4; }
int main() { 
  int X = bar(4);
  printf("%d\n", X);
}

clang was not outputing any debug info for the body of main().  This is
because the backend is getting confused by the region_start/end that clang
is emitting for block scopes.  For now, just disable these (matching llvm-gcc),
this stuff is in progress of rework anyway.

Modified:
    cfe/branches/Apple/Dib/lib/CodeGen/CGStmt.cpp

Modified: cfe/branches/Apple/Dib/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/CodeGen/CGStmt.cpp?rev=70928&r1=70927&r2=70928&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/branches/Apple/Dib/lib/CodeGen/CGStmt.cpp Mon May  4 17:32:28 2009
@@ -126,7 +126,10 @@
   if (DI) {
     EnsureInsertPoint();
     DI->setLocation(S.getLBracLoc());
-    DI->EmitRegionStart(CurFn, Builder);
+    // FIXME: The llvm backend is currently not ready to deal with region_end
+    // for block scoping.  In the presence of always_inline functions it gets so
+    // confused that it doesn't emit any debug info.  Just disable this for now.
+    //DI->EmitRegionStart(CurFn, Builder);
   }
 
   // Keep track of the current cleanup stack depth.
@@ -141,7 +144,11 @@
   if (DI) {
     EnsureInsertPoint();
     DI->setLocation(S.getRBracLoc());
-    DI->EmitRegionEnd(CurFn, Builder);
+    
+    // FIXME: The llvm backend is currently not ready to deal with region_end
+    // for block scoping.  In the presence of always_inline functions it gets so
+    // confused that it doesn't emit any debug info.  Just disable this for now.
+    //DI->EmitRegionEnd(CurFn, Builder);
   }
 
   RValue RV;





More information about the cfe-commits mailing list