Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaInit.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 5,826 Lines • ▼ Show 20 Lines | if (const ArrayType *DestAT = Context.getAsArrayType(DestType)) { | ||||
// Some kinds of initialization permit an array to be initialized from | // Some kinds of initialization permit an array to be initialized from | ||||
// another array of the same type, and perform elementwise initialization. | // another array of the same type, and perform elementwise initialization. | ||||
if (Initializer && isa<ConstantArrayType>(DestAT) && | if (Initializer && isa<ConstantArrayType>(DestAT) && | ||||
S.Context.hasSameUnqualifiedType(Initializer->getType(), | S.Context.hasSameUnqualifiedType(Initializer->getType(), | ||||
Entity.getType()) && | Entity.getType()) && | ||||
canPerformArrayCopy(Entity)) { | canPerformArrayCopy(Entity)) { | ||||
// If source is a prvalue, use it directly. | // If source is a prvalue, use it directly. | ||||
if (Initializer->getValueKind() == VK_PRValue) { | if (Initializer->isPRValue()) { | ||||
AddArrayInitStep(DestType, /*IsGNUExtension*/false); | AddArrayInitStep(DestType, /*IsGNUExtension*/false); | ||||
return; | return; | ||||
} | } | ||||
// Emit element-at-a-time copy loop. | // Emit element-at-a-time copy loop. | ||||
InitializedEntity Element = | InitializedEntity Element = | ||||
InitializedEntity::InitializeElement(S.Context, 0, Entity); | InitializedEntity::InitializeElement(S.Context, 0, Entity); | ||||
QualType InitEltT = | QualType InitEltT = | ||||
▲ Show 20 Lines • Show All 4,383 Lines • Show Last 20 Lines |