mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-14 15:56:32 +00:00
[KeyInstr][Clang] Agg copy atom
This commit is contained in:
parent
c1ec75f22a
commit
77f91f53a7
@ -1332,6 +1332,7 @@ static bool isBlockVarRef(const Expr *E) {
|
||||
}
|
||||
|
||||
void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
|
||||
ApplyAtomGroup Grp(CGF.getDebugInfo());
|
||||
// For an assignment to work, the value on the right has
|
||||
// to be compatible with the value on the left.
|
||||
assert(CGF.getContext().hasSameUnqualifiedType(E->getLHS()->getType(),
|
||||
|
@ -3042,6 +3042,7 @@ public:
|
||||
|
||||
/// Emit an aggregate assignment.
|
||||
void EmitAggregateAssign(LValue Dest, LValue Src, QualType EltTy) {
|
||||
ApplyAtomGroup Grp(getDebugInfo());
|
||||
bool IsVolatile = hasVolatileMember(EltTy);
|
||||
EmitAggregateCopy(Dest, Src, EltTy, AggValueSlot::MayOverlap, IsVolatile);
|
||||
}
|
||||
|
@ -1,12 +1,17 @@
|
||||
// RUN: %clang -gkey-instructions -x c++ %s -gmlt -S -emit-llvm -o - \
|
||||
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
|
||||
|
||||
// RUN: %clang -gkey-instructions %s -gmlt -S -emit-llvm -o - \
|
||||
// RUN: %clang -gkey-instructions -x c %s -gmlt -S -emit-llvm -o - \
|
||||
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
|
||||
|
||||
typedef struct { int a, b, c; } Struct;
|
||||
void fun(Struct a) {
|
||||
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G1R1:!.*]]
|
||||
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G1R1:!.*]]
|
||||
Struct b = a;
|
||||
|
||||
// CHECK: call void @llvm.memcpy{{.*}}, !dbg [[G2R1:!.*]]
|
||||
b = a;
|
||||
}
|
||||
|
||||
// CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)
|
||||
|
||||
// CHECK: [[G2R1]] = !DILocation({{.*}}, atomGroup: 2, atomRank: 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user