@@ -2134,79 +2134,6 @@ RValue CIRGenFunction::emitCXXMemberCallExpr(const CXXMemberCallExpr *ce,
21342134 ce, md, returnValue, hasQualifier, qualifier, isArrow, base);
21352135}
21362136
2137- void CIRGenFunction::emitCXXConstructExpr (const CXXConstructExpr *e,
2138- AggValueSlot dest) {
2139- assert (!dest.isIgnored () && " Must have a destination!" );
2140- const CXXConstructorDecl *cd = e->getConstructor ();
2141-
2142- // If we require zero initialization before (or instead of) calling the
2143- // constructor, as can be the case with a non-user-provided default
2144- // constructor, emit the zero initialization now, unless destination is
2145- // already zeroed.
2146- if (e->requiresZeroInitialization () && !dest.isZeroed ()) {
2147- switch (e->getConstructionKind ()) {
2148- case CXXConstructionKind::Delegating:
2149- case CXXConstructionKind::Complete:
2150- emitNullInitialization (getLoc (e->getSourceRange ()), dest.getAddress (),
2151- e->getType ());
2152- break ;
2153- case CXXConstructionKind::VirtualBase:
2154- case CXXConstructionKind::NonVirtualBase:
2155- cgm.errorNYI (e->getSourceRange (),
2156- " emitCXXConstructExpr: base requires initialization" );
2157- break ;
2158- }
2159- }
2160-
2161- // If this is a call to a trivial default constructor, do nothing.
2162- if (cd->isTrivial () && cd->isDefaultConstructor ())
2163- return ;
2164-
2165- // Elide the constructor if we're constructing from a temporary
2166- if (getLangOpts ().ElideConstructors && e->isElidable ()) {
2167- // FIXME: This only handles the simplest case, where the source object is
2168- // passed directly as the first argument to the constructor. This
2169- // should also handle stepping through implicit casts and conversion
2170- // sequences which involve two steps, with a conversion operator
2171- // follwed by a converting constructor.
2172- const Expr *srcObj = e->getArg (0 );
2173- assert (srcObj->isTemporaryObject (getContext (), cd->getParent ()));
2174- assert (
2175- getContext ().hasSameUnqualifiedType (e->getType (), srcObj->getType ()));
2176- emitAggExpr (srcObj, dest);
2177- return ;
2178- }
2179-
2180- if (const ArrayType *arrayType = getContext ().getAsArrayType (e->getType ())) {
2181- assert (!cir::MissingFeatures::sanitizers ());
2182- emitCXXAggrConstructorCall (cd, arrayType, dest.getAddress (), e, false );
2183- } else {
2184-
2185- clang::CXXCtorType type = Ctor_Complete;
2186- bool forVirtualBase = false ;
2187- bool delegating = false ;
2188-
2189- switch (e->getConstructionKind ()) {
2190- case CXXConstructionKind::Complete:
2191- type = Ctor_Complete;
2192- break ;
2193- case CXXConstructionKind::Delegating:
2194- // We should be emitting a constructor; GlobalDecl will assert this
2195- type = curGD.getCtorType ();
2196- delegating = true ;
2197- break ;
2198- case CXXConstructionKind::VirtualBase:
2199- forVirtualBase = true ;
2200- [[fallthrough]];
2201- case CXXConstructionKind::NonVirtualBase:
2202- type = Ctor_Base;
2203- break ;
2204- }
2205-
2206- emitCXXConstructorCall (cd, type, forVirtualBase, delegating, dest, e);
2207- }
2208- }
2209-
22102137RValue CIRGenFunction::emitReferenceBindingToExpr (const Expr *e) {
22112138 // Emit the expression as an lvalue.
22122139 LValue lv = emitLValue (e);
0 commit comments