Skip to content

Commit ef13a99

Browse files
authored
[SYCL] Use auto & in loop to avoid unnecessary copies (#15098)
Switched from `auto` to `auto &` in the loop to prevent copying of `TemplateArgument` objects, optimizing performance in clang::​SYCLIntegrationHeader::​emit(llvm::​raw_ostream &).
1 parent 5f3ada1 commit ef13a99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6326,7 +6326,7 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
63266326
ArrayRef<TemplateArgument> A = TAL->asArray();
63276327
bool FirstParam = true;
63286328
O << "<";
6329-
for (auto X : A) {
6329+
for (const auto &X : A) {
63306330
if (FirstParam)
63316331
FirstParam = false;
63326332
else

0 commit comments

Comments
 (0)