[llvm] 1fe6e6f - [llvm-exegesis] Rename range based for loop variable in a unit test so its different than the container being iterated over. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 13:52:01 PST 2020


Author: Craig Topper
Date: 2020-02-14T13:51:39-08:00
New Revision: 1fe6e6fd85f7da3b216fbb189ce365303512ad35

URL: https://github.com/llvm/llvm-project/commit/1fe6e6fd85f7da3b216fbb189ce365303512ad35
DIFF: https://github.com/llvm/llvm-project/commit/1fe6e6fd85f7da3b216fbb189ce365303512ad35.diff

LOG: [llvm-exegesis] Rename range based for loop variable in a unit test so its different than the container being iterated over. NFC

It seems like gcc 5.5 wants to iterate over the new variable instead
of the container that lives outside the loop. But of course this
new container is empty.

Plus using a different variable names makes the code more readable.

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/SnippetGenerator.h

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h
index d1e20b9b36a8..487c1f0a79af 100644
--- a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h
+++ b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.h
@@ -165,8 +165,8 @@ class CombinationGenerator {
     // Initialize the per-variable state to refer to the possible choices for
     // that variable.
     VariablesState.reserve(VariablesChoices.size());
-    for (ArrayRef<choice_type> VariablesChoices : VariablesChoices)
-      VariablesState.emplace_back(VariablesChoices);
+    for (ArrayRef<choice_type> VC : VariablesChoices)
+      VariablesState.emplace_back(VC);
 
     // Temporary buffer to store each combination before performing Callback.
     SmallVector<choice_type, variable_smallsize> CurrentCombination;


        


More information about the llvm-commits mailing list