Bug 193443

Summary: clang-tidy: Fix unnecessary copy of for loop variables in ANGLE
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: ANGLEAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, dino, ews-watchlist, graouts, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.chromium.org/p/angleproject/issues/detail?id=3075
Attachments:
Description Flags
Patch v1 none

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>