Skip to content

Commit 89d7847

Browse files
committed
[KeyInstr][Clang] Agg copy atom
1 parent 7a9070b commit 89d7847

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

clang/lib/CodeGen/CGExprAgg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,7 @@ static bool isBlockVarRef(const Expr *E) {
13321332
}
13331333

13341334
void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
1335+
ApplyAtomGroup Grp(CGF.getDebugInfo());
13351336
// For an assignment to work, the value on the right has
13361337
// to be compatible with the value on the left.
13371338
assert(CGF.getContext().hasSameUnqualifiedType(E->getLHS()->getType(),

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3035,6 +3035,7 @@ class CodeGenFunction : public CodeGenTypeCache {
30353035

30363036
/// Emit an aggregate assignment.
30373037
void EmitAggregateAssign(LValue Dest, LValue Src, QualType EltTy) {
3038+
ApplyAtomGroup Grp(getDebugInfo());
30383039
bool IsVolatile = hasVolatileMember(EltTy);
30393040
EmitAggregateCopy(Dest, Src, EltTy, AggValueSlot::MayOverlap, IsVolatile);
30403041
}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
// RUN: %clang -gkey-instructions -x c++ %s -gmlt -S -emit-llvm -o - \
2+
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
13

2-
// RUN: %clang -gkey-instructions %s -gmlt -S -emit-llvm -o - \
4+
// RUN: %clang -gkey-instructions -x c %s -gmlt -S -emit-llvm -o - \
35
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
46

57
typedef struct { int a, b, c; } Struct;
68
void fun(Struct a) {
7-
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G1R1:!.*]]
9+
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G1R1:!.*]]
810
Struct b = a;
11+
12+
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G2R1:!.*]]
13+
b = a;
914
}
1015

1116
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
12-
17+
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)

0 commit comments

Comments
 (0)