[PATCH] D37937: Introduce the llvm-cfi-verify tool.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 15:41:04 PDT 2017


hctim added inline comments.


================
Comment at: tools/llvm-cfi-verify/llvm-cfi-verify.cpp:243
+      bool UsesRegisterOperand = false;
+      for (unsigned i = 0; i < Instruction.getNumOperands(); ++i) {
+        if (Instruction.getOperand(i).isReg()) {
----------------
vlad.tsyrklevich wrote:
> I believe you can use a range-based for loop here: `for (auto &Op : Instruction)`
Thanks for the catch, had a look at the source for a range-iterator from ::Operands.begin() to ::Operands.end() under the name "operands()" but didn't realise that they were simply under the object itself.


https://reviews.llvm.org/D37937





More information about the llvm-commits mailing list