[llvm-branch-commits] [cfe-branch] r124411 - in /cfe/branches/Apple/sill: lib/CodeGen/CGObjC.cpp test/CodeGenObjC/debug-info-foreach.m
Daniel Dunbar
daniel at zuster.org
Thu Jan 27 12:09:06 PST 2011
Author: ddunbar
Date: Thu Jan 27 14:09:06 2011
New Revision: 124411
URL: http://llvm.org/viewvc/llvm-project?rev=124411&view=rev
Log:
Merge r123802:
--
Author: Devang Patel <dpatel at apple.com>
Date: Wed Jan 19 01:36:36 2011 +0000
Emit DW_TAG_lexical_scope to surround foreach.
*** MANUAL MERGE ***
Added:
cfe/branches/Apple/sill/test/CodeGenObjC/debug-info-foreach.m
Modified:
cfe/branches/Apple/sill/lib/CodeGen/CGObjC.cpp
Modified: cfe/branches/Apple/sill/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/sill/lib/CodeGen/CGObjC.cpp?rev=124411&r1=124410&r2=124411&view=diff
==============================================================================
--- cfe/branches/Apple/sill/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/branches/Apple/sill/lib/CodeGen/CGObjC.cpp Thu Jan 27 14:09:06 2011
@@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
+#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
@@ -783,6 +784,12 @@
llvm::ConstantInt::get(UnsignedLongLTy, 1));
Builder.CreateStore(Counter, CounterPtr);
+ CGDebugInfo *DI = getDebugInfo();
+ if (DI) {
+ DI->setLocation(S.getSourceRange().getBegin());
+ DI->EmitRegionStart(Builder);
+ }
+
JumpDest LoopEnd = getJumpDestInCurrentScope("loopend");
JumpDest AfterBody = getJumpDestInCurrentScope("afterbody");
@@ -828,6 +835,11 @@
LV.getAddress());
}
+ if (DI) {
+ DI->setLocation(S.getSourceRange().getEnd());
+ DI->EmitRegionEnd(Builder);
+ }
+
EmitBlock(LoopEnd.getBlock());
}
Added: cfe/branches/Apple/sill/test/CodeGenObjC/debug-info-foreach.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/sill/test/CodeGenObjC/debug-info-foreach.m?rev=124411&view=auto
==============================================================================
--- cfe/branches/Apple/sill/test/CodeGenObjC/debug-info-foreach.m (added)
+++ cfe/branches/Apple/sill/test/CodeGenObjC/debug-info-foreach.m Thu Jan 27 14:09:06 2011
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-default-synthesize-properties -emit-llvm -g %s -o %t
+// RUN: grep DW_TAG_lexical_block %t | count 5
+// rdar://8757124
+
+ at class NSArray;
+
+void f(NSArray *a) {
+ id keys;
+ for (id thisKey in keys) {
+ }
+ for (id thisKey in keys) {
+ }
+}
More information about the llvm-branch-commits
mailing list