Skip to content

Commit 84a14ff

Browse files
committed
shuffle code, works for cpp
1 parent 124588d commit 84a14ff

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

clang/lib/CodeGen/CGExprComplex.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,15 +364,19 @@ class ComplexExprEmitter
364364

365365
// Compound assignments.
366366
ComplexPairTy VisitBinAddAssign(const CompoundAssignOperator *E) {
367+
ApplyAtomGroup Grp(CGF.getDebugInfo());
367368
return EmitCompoundAssign(E, &ComplexExprEmitter::EmitBinAdd);
368369
}
369370
ComplexPairTy VisitBinSubAssign(const CompoundAssignOperator *E) {
371+
ApplyAtomGroup Grp(CGF.getDebugInfo());
370372
return EmitCompoundAssign(E, &ComplexExprEmitter::EmitBinSub);
371373
}
372374
ComplexPairTy VisitBinMulAssign(const CompoundAssignOperator *E) {
375+
ApplyAtomGroup Grp(CGF.getDebugInfo());
373376
return EmitCompoundAssign(E, &ComplexExprEmitter::EmitBinMul);
374377
}
375378
ComplexPairTy VisitBinDivAssign(const CompoundAssignOperator *E) {
379+
ApplyAtomGroup Grp(CGF.getDebugInfo());
376380
return EmitCompoundAssign(E, &ComplexExprEmitter::EmitBinDiv);
377381
}
378382

@@ -1213,7 +1217,6 @@ LValue ComplexExprEmitter::
12131217
EmitCompoundAssignLValue(const CompoundAssignOperator *E,
12141218
ComplexPairTy (ComplexExprEmitter::*Func)(const BinOpInfo&),
12151219
RValue &Val) {
1216-
ApplyAtomGroup Grp(CGF.getDebugInfo());
12171220
TestAndClearIgnoreReal();
12181221
TestAndClearIgnoreImag();
12191222
QualType LHSTy = E->getLHS()->getType();
@@ -1361,8 +1364,8 @@ LValue ComplexExprEmitter::EmitBinAssignLValue(const BinaryOperator *E,
13611364
}
13621365

13631366
ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) {
1364-
ApplyAtomGroup Grp(CGF.getDebugInfo());
13651367
ComplexPairTy Val;
1368+
ApplyAtomGroup Grp(CGF.getDebugInfo());
13661369
LValue LV = EmitBinAssignLValue(E, Val);
13671370

13681371
// The result of an assignment in C is the assigned r-value.
@@ -1538,6 +1541,7 @@ static CompoundFunc getComplexOp(BinaryOperatorKind Op) {
15381541

15391542
LValue CodeGenFunction::
15401543
EmitComplexCompoundAssignmentLValue(const CompoundAssignOperator *E) {
1544+
ApplyAtomGroup Grp(getDebugInfo());
15411545
CompoundFunc Op = getComplexOp(E->getOpcode());
15421546
RValue Val;
15431547
return ComplexExprEmitter(*this).EmitCompoundAssignLValue(E, Op, Val);

clang/test/DebugInfo/KeyInstructions/complex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clang_cc1 -gkey-instructions -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \
22
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
33

4-
// RUN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - \
5-
// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank --check-prefixes=CHECK,CHECK-C
4+
// UN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - \
5+
// UN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank --check-prefixes=CHECK,CHECK-C
66

77
_Complex float ci;
88
float f;

0 commit comments

Comments
 (0)