aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorJakub Kuderski <kubak@google.com>2023-03-15 10:43:55 -0400
committerJakub Kuderski <kubak@google.com>2023-03-15 10:43:56 -0400
commit8c258fda1f9b33fc847cfff9c2ee33ce4615ff0b (patch)
treecc9aedf6670964c0af0bc7561c4abf4060c86947 /llvm/lib/Support/CommandLine.cpp
parentbc47a195ccbb0b1a0296db9156a4bf3c06cf10a2 (diff)
downloadllvm-8c258fda1f9b33fc847cfff9c2ee33ce4615ff0b.zip
llvm-8c258fda1f9b33fc847cfff9c2ee33ce4615ff0b.tar.gz
llvm-8c258fda1f9b33fc847cfff9c2ee33ce4615ff0b.tar.bz2
[ADT][mlir][NFCI] Do not use non-const lvalue-refs with enumerate
Replace references to enumerate results with either result_pairs (reference wrapper type) or structured bindings. I did not use structured bindings everywhere as it wasn't clear to me it would improve readability. This is in preparation to the switch to zip semantics which won't support non-const lvalue reference to elements: https://reviews.llvm.org/D144503. I chose to use values instead of const lvalue-refs because MLIR is biased towards avoiding `const` local variables. This won't degrade performance because currently `result_pair` is cheap to copy (size_t + iterator), and in the future, the enumerator iterator dereference will return temporaries anyway. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D146006
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions