Patch simplifies for loops in LIR following LLVM guidelines: https://llvm.org/docs/CodingStandards.html#use-range-based-for-loops-wherever-possible.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
667 | That could be simplified a bit with 'seq' but extra headers need to included, so decided leave it as it is. |
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
667 | I don't find this more readable. I'm not sure what the L in LU was supposed to do. long is 32-bits on 64-bit Windows so if you were trying to make it the same size as size_t to match the return type of SL.size(), it didn't work. |
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
667 |
Well, it's less verbose but indeed maybe not really more readable.
Yes, that was my intention but I failed miserably. I will go back to previous loop version without auto. |
Please limit your use of auto to only the cases explicitly listed in https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable, i.e. if the type is already otherwise mentioned (cast/dyn_cast) or abstracted anyway (iterator typedefs). There is more nuance to this policy, but as you tend to heavily overuse auto I will recommend that you stick to these explicitly allowed cases only.
That could be simplified a bit with 'seq' but extra headers need to included, so decided leave it as it is.