| 586 | //----------------------------------------------------------------------------- |
| 587 | |
| 588 | static CallExpr* CallConstructor(QualType ctorType, |
| 589 | DeclRefExpr* lhsDeclRef, |
| 590 | Expr* lhsMemberExpr, |
| 591 | ArrayRef<Expr*> callParams, |
| 592 | DoCast doCast, |
| 593 | AsReference asReference) |
| 594 | { |
| 595 | if(nullptr == lhsMemberExpr) { |
| 596 | lhsMemberExpr = lhsDeclRef; |
| 597 | } |
| 598 | |
| 599 | auto* callCtor = |
| 600 | CreateFunctionDecl(StrCat("Constructor_"sv, GetName(ctorType)), {{kwInternalThis, lhsDeclRef->getType()}}); |
| 601 | |
| 602 | SmallVector<Expr*, 8> modCallParams{}; |
| 603 | |
| 604 | if(DoCast::Yes == doCast) { |
| 605 | modCallParams.push_back(StaticCast(lhsDeclRef->getType(), lhsDeclRef, false)); |
| 606 | |
| 607 | } else { |
| 608 | if(AsReference::Yes == asReference) { |
| 609 | modCallParams.push_back(Ref(lhsMemberExpr)); |
| 610 | } else { |
| 611 | modCallParams.push_back(lhsMemberExpr); |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | modCallParams.append(callParams.begin(), callParams.end()); |
| 616 | |
| 617 | return Call(callCtor, modCallParams); |
| 618 | } |
| 619 | //----------------------------------------------------------------------------- |
| 620 | |
| 621 | CallExpr* CallConstructor(QualType ctorType, |
no test coverage detected