[cfe-commits] r103408 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenObjC/blocks-ivar-debug.m
Devang Patel
dpatel at apple.com
Mon May 10 10:24:59 PDT 2010
Author: dpatel
Date: Mon May 10 12:24:58 2010
New Revision: 103408
URL: http://llvm.org/viewvc/llvm-project?rev=103408&view=rev
Log:
If variable location is invalid then use current location.
This fixes radar 7959934.
Added:
cfe/trunk/test/CodeGenObjC/blocks-ivar-debug.m
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=103408&r1=103407&r2=103408&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon May 10 12:24:58 2010
@@ -1536,7 +1536,9 @@
if (!PLoc.isInvalid())
Line = PLoc.getLine();
else
- Unit = llvm::DIFile();
+ // If variable location is invalid, use current location to find
+ // corresponding file info.
+ Unit = getOrCreateFile(CurLoc);
CharUnits offset = CGF->BlockDecls[VD];
llvm::SmallVector<llvm::Value *, 9> addr;
Added: cfe/trunk/test/CodeGenObjC/blocks-ivar-debug.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/blocks-ivar-debug.m?rev=103408&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/blocks-ivar-debug.m (added)
+++ cfe/trunk/test/CodeGenObjC/blocks-ivar-debug.m Mon May 10 12:24:58 2010
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -g %s -fblocks -S -o /dev/null
+// Radar 7959934
+
+ at interface NSObject {
+ struct objc_object *isa;
+}
+ at end
+ at interface Foo : NSObject {
+ int _prop;
+}
+ at end
+
+ at implementation Foo
+- (int)doSomething {
+ int (^blk)(void) = ^{ return _prop; };
+ return blk();
+}
+
+ at end
+
More information about the cfe-commits
mailing list