Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • src
  • OpenGL
  • compiler
  • preprocessor
  • MacroExpander.cpp
Find file
BlameHistoryPermalink
  • Ben Clayton's avatar
    Change for loops to use const refs, per performance-for-range-copy clang-tidy. · 9aff7ae7
    Ben Clayton authored Apr 02, 2020
    This CL optimizes C++11 range-based for loops where the variable is copied in each iteration but it would suffice to obtain it by const reference.  This is only applied to loop variables of types that are expensive to copy which means they are not trivially copyable or have a non-trivial copy constructor or destructor.
    
    To ensure that it is safe to replace the copy with a const reference the following heuristic is employed:
      The loop variable is const qualified.
      The loop variable is not const, but only const methods or operators are invoked on it, or it is used as const reference or value argument in constructors or function calls.
    
    See cl/304001946 for more information.
    
    Bug: None.
    Change-Id: Idbb5a0dbf19c6dccb16a0d525900aa99419a8527
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43368
    Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
    Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    Tested-by: 's avatarBen Clayton <bclayton@google.com>
    9aff7ae7
MacroExpander.cpp 13.4 KB
EditWeb IDE
×

Replace MacroExpander.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.