@@ -1123,14 +1123,13 @@ unsigned StringLiteral::mapCharByteWidth(TargetInfo const &Target,
11231123
11241124StringLiteral::StringLiteral (const ASTContext &Ctx, StringRef Str,
11251125 StringLiteralKind Kind, bool Pascal, QualType Ty,
1126- const SourceLocation *Loc,
1127- unsigned NumConcatenated)
1126+ ArrayRef<SourceLocation> Locs)
11281127 : Expr(StringLiteralClass, Ty, VK_LValue, OK_Ordinary) {
11291128
11301129 unsigned Length = Str.size ();
11311130
11321131 StringLiteralBits.Kind = llvm::to_underlying (Kind);
1133- StringLiteralBits.NumConcatenated = NumConcatenated ;
1132+ StringLiteralBits.NumConcatenated = Locs. size () ;
11341133
11351134 if (Kind != StringLiteralKind::Unevaluated) {
11361135 assert (Ctx.getAsConstantArrayType (Ty) &&
@@ -1169,11 +1168,10 @@ StringLiteral::StringLiteral(const ASTContext &Ctx, StringRef Str,
11691168
11701169 // Initialize the trailing array of SourceLocation.
11711170 // This is safe since SourceLocation is POD-like.
1172- std::memcpy (getTrailingObjects<SourceLocation>(), Loc,
1173- NumConcatenated * sizeof (SourceLocation));
1171+ llvm::copy (Locs, getTrailingObjects<SourceLocation>());
11741172
11751173 // Initialize the trailing array of char holding the string data.
1176- std::memcpy ( getTrailingObjects<char >(), Str. data (), Str. size ());
1174+ llvm::copy (Str, getTrailingObjects<char >());
11771175
11781176 setDependence (ExprDependence::None);
11791177}
@@ -1188,13 +1186,12 @@ StringLiteral::StringLiteral(EmptyShell Empty, unsigned NumConcatenated,
11881186
11891187StringLiteral *StringLiteral::Create (const ASTContext &Ctx, StringRef Str,
11901188 StringLiteralKind Kind, bool Pascal,
1191- QualType Ty, const SourceLocation *Loc,
1192- unsigned NumConcatenated ) {
1189+ QualType Ty,
1190+ ArrayRef<SourceLocation> Locs ) {
11931191 void *Mem = Ctx.Allocate (totalSizeToAlloc<unsigned , SourceLocation, char >(
1194- 1 , NumConcatenated , Str.size ()),
1192+ 1 , Locs. size () , Str.size ()),
11951193 alignof (StringLiteral));
1196- return new (Mem)
1197- StringLiteral (Ctx, Str, Kind, Pascal, Ty, Loc, NumConcatenated);
1194+ return new (Mem) StringLiteral (Ctx, Str, Kind, Pascal, Ty, Locs);
11981195}
11991196
12001197StringLiteral *StringLiteral::CreateEmpty (const ASTContext &Ctx,
@@ -4406,7 +4403,7 @@ void ShuffleVectorExpr::setExprs(const ASTContext &C, ArrayRef<Expr *> Exprs) {
44064403
44074404 this ->ShuffleVectorExprBits .NumExprs = Exprs.size ();
44084405 SubExprs = new (C) Stmt *[ShuffleVectorExprBits.NumExprs ];
4409- memcpy (SubExprs, Exprs. data (), sizeof (Expr *) * Exprs. size () );
4406+ llvm::copy ( Exprs, SubExprs );
44104407}
44114408
44124409GenericSelectionExpr::GenericSelectionExpr (
0 commit comments