Skip to content

Commit 1ccc74b

Browse files
committed
Pre/Post Inc/Dec
1 parent 0ce86c4 commit 1ccc74b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3015,6 +3015,7 @@ class OMPLastprivateConditionalUpdateRAII {
30153015
llvm::Value *
30163016
ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
30173017
bool isInc, bool isPre) {
3018+
ApplyAtomGroup Grp(CGF.getDebugInfo());
30183019
OMPLastprivateConditionalUpdateRAII OMPRegion(CGF, E);
30193020
QualType type = E->getSubExpr()->getType();
30203021
llvm::PHINode *atomicPHI = nullptr;

clang/test/DebugInfo/KeyInstructions/assign-scalar.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ void fun() {
2424
// CHECK: %add = add i64 %1, 50, !dbg [[G4R2:!.*]]
2525
// CHECK: store i64 %add, ptr @g{{.*}}, !dbg [[G4R1:!.*]]
2626
g += 50;
27+
28+
// Pre/Post Inc/Dec.
29+
// CHECK: %2 = load i64, ptr @g
30+
// CHECK: %inc = add i64 %2, 1, !dbg [[G5R2:!.*]]
31+
// CHECK: store i64 %inc, ptr @g{{.*}}, !dbg [[G5R1:!.*]]
32+
++g;
33+
// CHECK: %3 = load i64, ptr @g
34+
// CHECK: %dec = add i64 %3, -1, !dbg [[G6R2:!.*]]
35+
// CHECK: store i64 %dec, ptr @g{{.*}}, !dbg [[G6R1:!.*]]
36+
g--;
2737
}
2838

2939
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
@@ -32,3 +42,7 @@ void fun() {
3242
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
3343
// CHECK: [[G4R2]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 2)
3444
// CHECK: [[G4R1]] = !DILocation({{.*}}, atomGroup: 4, atomRank: 1)
45+
// CHECK: [[G5R2]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 2)
46+
// CHECK: [[G5R1]] = !DILocation({{.*}}, atomGroup: 5, atomRank: 1)
47+
// CHECK: [[G6R2]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 2)
48+
// CHECK: [[G6R1]] = !DILocation({{.*}}, atomGroup: 6, atomRank: 1)

0 commit comments

Comments
 (0)