Bug 193443 - clang-tidy: Fix unnecessary copy of for loop variables in ANGLE
Summary: clang-tidy: Fix unnecessary copy of for loop variables in ANGLE
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-01-15 05:04 PST by David Kilzer (:ddkilzer)
Modified: 2019-01-15 14:10 PST (History)
7 users (show)

See Also:


Attachments
Patch v1 (4.33 KB, patch)
2019-01-15 05:17 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2019-01-15 05:04:52 PST
Running clang-tidy on ANGLE resulted in these potential performance improvements to prevent object copies in for loops:

Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp:1070:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto block : uniformBlocks)
              ^
         const  &
Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp:1087:19: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
        for (auto var : outputVaryings)
                  ^
             const  &
Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp:1100:19: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
        for (auto var : outputVariables)
                  ^
             const  &

Source/ThirdParty/ANGLE/src/compiler/preprocessor/MacroExpander.cpp:73:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto macro : mExpander->mMacrosToReenable)
              ^
         const  &

Source/ThirdParty/ANGLE/src/libANGLE/Program.cpp:195:15: warning: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy]
    for (auto nameInSet : nameSet)
              ^
         const  &
Comment 1 David Kilzer (:ddkilzer) 2019-01-15 05:17:23 PST
Created attachment 359156 [details]
Patch v1
Comment 2 EWS Watchlist 2019-01-15 05:20:42 PST
Note that there are important steps to take when updating ANGLE. See http://trac.webkit.org/wiki/UpdatingANGLE
Comment 3 WebKit Commit Bot 2019-01-15 13:47:57 PST
Comment on attachment 359156 [details]
Patch v1

Clearing flags on attachment: 359156

Committed r240001: <https://trac.webkit.org/changeset/240001>
Comment 4 WebKit Commit Bot 2019-01-15 13:47:59 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2019-01-15 13:48:38 PST
<rdar://problem/47295060>