[polly] r216842 - Use range based for loops

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Sep 2 15:11:13 PDT 2014


> On 2014 Aug 31, at 12:10, Tobias Grosser <tobias at grosser.es> wrote:
> 
> @@ -562,9 +561,8 @@ SetVector<Value *> ClastStmtCodeGen::get
>   SetVector<Value *> Values;
> 
>   // The clast variables
> -  for (CharMapT::iterator I = ClastVars.begin(), E = ClastVars.end(); I != E;
> -       I++)
> -    Values.insert(I->second);
> +  for (auto I : ClastVars)
> +    Values.insert(I.second);
> 
>   // Find the temporaries that are referenced in the clast statements'
>   // basic blocks but are not defined by these blocks (e.g., references

Is there any reason not to use `const auto &` here (and in the cases
following)?  It's not obvious without looking up the container whether
copying this `pair` is cheap.



More information about the llvm-commits mailing list