WebKit Bugzilla
Attachment 359156 Details for
Bug 193443
: clang-tidy: Fix unnecessary copy of for loop variables in ANGLE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-193443-20190115051722.patch (text/plain), 4.33 KB, created by
David Kilzer (:ddkilzer)
on 2019-01-15 05:17:23 PST
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2019-01-15 05:17:23 PST
Size:
4.33 KB
patch
obsolete
>Subversion Revision: 239934 >diff --git a/Source/ThirdParty/ANGLE/ChangeLog b/Source/ThirdParty/ANGLE/ChangeLog >index 5b856e38e06812687ecc8b7fd9963bebaf80515e..b1b90a6807a091b916674481e58c43cba7708d2f 100644 >--- a/Source/ThirdParty/ANGLE/ChangeLog >+++ b/Source/ThirdParty/ANGLE/ChangeLog >@@ -1,3 +1,26 @@ >+2019-01-15 David Kilzer <ddkilzer@apple.com> >+ >+ clang-tidy: Fix unnecessary copy of for loop variables in ANGLE >+ <https://webkit.org/b/193443> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fix unwanted copying of loop variables by making them const >+ references. >+ >+ * src/compiler/preprocessor/MacroExpander.cpp: >+ (pp::MacroExpander::ScopedMacroReenabler::~ScopedMacroReenabler): >+ - Prevents copy and reference churn of std::shared_ptr<Macro> >+ objects. >+ * src/compiler/translator/Compiler.cpp: >+ (sh::TCompiler::useAllMembersInUnusedStandardAndSharedBlocks): >+ - Prevents copy of sh::InterfaceBlock structs. >+ (sh::TCompiler::initializeOutputVariables): >+ - Prevents copy of sh::Varying structs. >+ * src/libANGLE/Program.cpp: >+ (gl::(anonymous namespace)::IncludeSameArrayElement): >+ - Prevents copy of std::string objects. >+ > 2018-10-03 Dan Bernstein <mitz@apple.com> > > ANGLE part of [Xcode] Update some build settings as recommended by Xcode 10 >diff --git a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/MacroExpander.cpp b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/MacroExpander.cpp >index d88d3a685382ced5031728b73d7c7b23a522e03c..6e2accf29dadbe44294afd655debd38987afcfb9 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/MacroExpander.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/MacroExpander.cpp >@@ -70,7 +70,7 @@ MacroExpander::ScopedMacroReenabler::ScopedMacroReenabler(MacroExpander *expande > MacroExpander::ScopedMacroReenabler::~ScopedMacroReenabler() > { > mExpander->mDeferReenablingMacros = false; >- for (auto macro : mExpander->mMacrosToReenable) >+ for (const auto& macro : mExpander->mMacrosToReenable) > { > // Copying the string here by using substr is a check for use-after-free. It detects > // use-after-free more reliably than just toggling the disabled flag. >diff --git a/Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp b/Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp >index 2f411cb58c75a463af3c961e982b5b1f79b9798d..594147d8695aff777ef9f40845eaee3f01711d35 100644 >--- a/Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp >+++ b/Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp >@@ -1067,7 +1067,7 @@ void TCompiler::useAllMembersInUnusedStandardAndSharedBlocks(TIntermBlock *root) > { > sh::InterfaceBlockList list; > >- for (auto block : uniformBlocks) >+ for (const auto& block : uniformBlocks) > { > if (!block.staticUse && > (block.layout == sh::BLOCKLAYOUT_STD140 || block.layout == sh::BLOCKLAYOUT_SHARED)) >@@ -1084,7 +1084,7 @@ void TCompiler::initializeOutputVariables(TIntermBlock *root) > InitVariableList list; > if (shaderType == GL_VERTEX_SHADER || shaderType == GL_GEOMETRY_SHADER_OES) > { >- for (auto var : outputVaryings) >+ for (const auto& var : outputVaryings) > { > list.push_back(var); > if (var.name == "gl_Position") >@@ -1097,7 +1097,7 @@ void TCompiler::initializeOutputVariables(TIntermBlock *root) > else > { > ASSERT(shaderType == GL_FRAGMENT_SHADER); >- for (auto var : outputVariables) >+ for (const auto& var : outputVariables) > { > list.push_back(var); > } >diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Program.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/Program.cpp >index 795d326041811a054a9410986e927ce1204b1540..9cb7fb768c86b906279cad75a98f9cd4e510943c 100644 >--- a/Source/ThirdParty/ANGLE/src/libANGLE/Program.cpp >+++ b/Source/ThirdParty/ANGLE/src/libANGLE/Program.cpp >@@ -192,7 +192,7 @@ bool IncludeSameArrayElement(const std::set<std::string> &nameSet, const std::st > { > std::vector<unsigned int> subscripts; > std::string baseName = ParseResourceName(name, &subscripts); >- for (auto nameInSet : nameSet) >+ for (const auto& nameInSet : nameSet) > { > std::vector<unsigned int> arrayIndices; > std::string arrayName = ParseResourceName(nameInSet, &arrayIndices);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193443
: 359156