@@ -685,11 +685,17 @@ bool ByteCodeExprGen<Emitter>::VisitComplexBinOp(const BinaryOperator *E) {
685
685
if (!this ->emitSetLocal (PT_Ptr, ResultOffset, E))
686
686
return false ;
687
687
}
688
+ QualType LHSType = LHS->getType ();
689
+ if (const auto *AT = LHSType->getAs <AtomicType>())
690
+ LHSType = AT->getValueType ();
691
+ QualType RHSType = RHS->getType ();
692
+ if (const auto *AT = RHSType->getAs <AtomicType>())
693
+ RHSType = AT->getValueType ();
688
694
689
695
// Evaluate LHS and save value to LHSOffset.
690
696
bool LHSIsComplex;
691
697
unsigned LHSOffset;
692
- if (LHS-> getType () ->isAnyComplexType ()) {
698
+ if (LHSType ->isAnyComplexType ()) {
693
699
LHSIsComplex = true ;
694
700
LHSOffset = this ->allocateLocalPrimitive (LHS, PT_Ptr, true , false );
695
701
if (!this ->visit (LHS))
@@ -698,7 +704,7 @@ bool ByteCodeExprGen<Emitter>::VisitComplexBinOp(const BinaryOperator *E) {
698
704
return false ;
699
705
} else {
700
706
LHSIsComplex = false ;
701
- PrimType LHST = classifyPrim (LHS-> getType () );
707
+ PrimType LHST = classifyPrim (LHSType );
702
708
LHSOffset = this ->allocateLocalPrimitive (LHS, LHST, true , false );
703
709
if (!this ->visit (LHS))
704
710
return false ;
@@ -709,7 +715,7 @@ bool ByteCodeExprGen<Emitter>::VisitComplexBinOp(const BinaryOperator *E) {
709
715
// Same with RHS.
710
716
bool RHSIsComplex;
711
717
unsigned RHSOffset;
712
- if (RHS-> getType () ->isAnyComplexType ()) {
718
+ if (RHSType ->isAnyComplexType ()) {
713
719
RHSIsComplex = true ;
714
720
RHSOffset = this ->allocateLocalPrimitive (RHS, PT_Ptr, true , false );
715
721
if (!this ->visit (RHS))
@@ -718,7 +724,7 @@ bool ByteCodeExprGen<Emitter>::VisitComplexBinOp(const BinaryOperator *E) {
718
724
return false ;
719
725
} else {
720
726
RHSIsComplex = false ;
721
- PrimType RHST = classifyPrim (RHS-> getType () );
727
+ PrimType RHST = classifyPrim (RHSType );
722
728
RHSOffset = this ->allocateLocalPrimitive (RHS, RHST, true , false );
723
729
if (!this ->visit (RHS))
724
730
return false ;
0 commit comments