Skip to content

Commit c0c9623

Browse files
committed
continue
1 parent 0af9ceb commit c0c9623

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

clang/lib/CodeGen/CGCleanup.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,7 @@ void CodeGenFunction::EmitBranchThroughCleanup(JumpDest Dest) {
11181118

11191119
// Create the branch.
11201120
llvm::BranchInst *BI = Builder.CreateBr(Dest.getBlock());
1121+
addInstToCurrentSourceAtom(BI, nullptr);
11211122

11221123
// Calculate the innermost active normal cleanup.
11231124
EHScopeStack::stable_iterator

clang/lib/CodeGen/CGStmt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,7 @@ void CodeGenFunction::EmitContinueStmt(const ContinueStmt &S) {
17271727
if (HaveInsertPoint())
17281728
EmitStopPoint(&S);
17291729

1730+
ApplyAtomGroup Grp(getDebugInfo());
17301731
EmitBranchThroughCleanup(BreakContinueStack.back().ContinueBlock);
17311732
}
17321733

clang/test/DebugInfo/KeyInstructions/for.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ void d() {
9393
}
9494
}
9595

96+
void e() {
97+
// - Check the `continue` keyword gets an atom group.
98+
// CHECK: entry:
99+
// CHECK-NEXT: br label %for.cond
100+
101+
// CHECK: for.cond:
102+
// CHECK: br label %for.cond, !dbg [[eG1R1:!.*]], !llvm.loop
103+
for ( ; ; )
104+
{
105+
continue;
106+
}
107+
}
108+
96109
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
97110
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
98111
// CHECK: [[G3R1]] = !DILocation({{.*}}, atomGroup: 3, atomRank: 1)
@@ -116,3 +129,5 @@ void d() {
116129
// CHECK: [[cG2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
117130

118131
// CHECK: [[dG1R1]] = !DILocation(line: 91, column: 3, scope: ![[#]], atomGroup: 1, atomRank: 1)
132+
133+
// CHECK: [[eG1R1]] = !DILocation(line: 105, column: 5, scope: ![[#]], atomGroup: 1, atomRank: 1)

0 commit comments

Comments
 (0)