Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/CGExprCXX.cpp
Show First 20 Lines • Show All 603 Lines • ▼ Show 20 Lines | if (E->requiresZeroInitialization() && !Dest.isZeroed()) { | ||||
} | } | ||||
} | } | ||||
// If this is a call to a trivial default constructor, do nothing. | // If this is a call to a trivial default constructor, do nothing. | ||||
if (CD->isTrivial() && CD->isDefaultConstructor()) | if (CD->isTrivial() && CD->isDefaultConstructor()) | ||||
return; | return; | ||||
// Elide the constructor if we're constructing from a temporary. | // Elide the constructor if we're constructing from a temporary. | ||||
// The temporary check is required because Sema sets this on NRVO | |||||
// returns. | |||||
if (getLangOpts().ElideConstructors && E->isElidable()) { | if (getLangOpts().ElideConstructors && E->isElidable()) { | ||||
assert(getContext().hasSameUnqualifiedType(E->getType(), | const Expr *SrcObj = E->getArg(0); | ||||
E->getArg(0)->getType())); | assert(SrcObj->isTemporaryObject(getContext(), CD->getParent())); | ||||
if (E->getArg(0)->isTemporaryObject(getContext(), CD->getParent())) { | assert( | ||||
EmitAggExpr(E->getArg(0), Dest); | getContext().hasSameUnqualifiedType(E->getType(), SrcObj->getType())); | ||||
EmitAggExpr(SrcObj, Dest); | |||||
return; | return; | ||||
dim: `s/simples/simplest/`
| |||||
} | } | ||||
} | |||||
if (const ArrayType *arrayType | if (const ArrayType *arrayType | ||||
= getContext().getAsArrayType(E->getType())) { | = getContext().getAsArrayType(E->getType())) { | ||||
EmitCXXAggrConstructorCall(CD, arrayType, Dest.getAddress(), E, | EmitCXXAggrConstructorCall(CD, arrayType, Dest.getAddress(), E, | ||||
Dest.isSanitizerChecked()); | Dest.isSanitizerChecked()); | ||||
} else { | } else { | ||||
CXXCtorType Type = Ctor_Complete; | CXXCtorType Type = Ctor_Complete; | ||||
bool ForVirtualBase = false; | bool ForVirtualBase = false; | ||||
▲ Show 20 Lines • Show All 1,693 Lines • Show Last 20 Lines |
s/simples/simplest/