mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 17:28:30 +08:00
Emit DW_TAG_lexical_scope to surround foreach.
llvm-svn: 123802
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "CGDebugInfo.h"
|
||||
#include "CGObjCRuntime.h"
|
||||
#include "CodeGenFunction.h"
|
||||
#include "CodeGenModule.h"
|
||||
@@ -612,6 +613,12 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
|
||||
return;
|
||||
}
|
||||
|
||||
CGDebugInfo *DI = getDebugInfo();
|
||||
if (DI) {
|
||||
DI->setLocation(S.getSourceRange().getBegin());
|
||||
DI->EmitRegionStart(Builder);
|
||||
}
|
||||
|
||||
JumpDest LoopEnd = getJumpDestInCurrentScope("forcoll.end");
|
||||
JumpDest AfterBody = getJumpDestInCurrentScope("forcoll.next");
|
||||
|
||||
@@ -842,6 +849,11 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
|
||||
EmitStoreThroughLValue(RValue::get(null), elementLValue, elementType);
|
||||
}
|
||||
|
||||
if (DI) {
|
||||
DI->setLocation(S.getSourceRange().getEnd());
|
||||
DI->EmitRegionEnd(Builder);
|
||||
}
|
||||
|
||||
EmitBlock(LoopEnd.getBlock());
|
||||
}
|
||||
|
||||
|
||||
13
clang/test/CodeGenObjC/debug-info-foreach.m
Normal file
13
clang/test/CodeGenObjC/debug-info-foreach.m
Normal file
@@ -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
|
||||
|
||||
@class NSArray;
|
||||
|
||||
void f(NSArray *a) {
|
||||
id keys;
|
||||
for (id thisKey in keys) {
|
||||
}
|
||||
for (id thisKey in keys) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user