[PATCH] D66324: clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 13:34:32 PDT 2019


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/MisExpect.cpp:150
+    // Operand 0 is a string tag "branch_weights"
+    if (MDString *Tag = cast<MDString>(MD->getOperand(0))) {
+      unsigned NOps = MD->getNumOperands();
----------------
Sorry if I'm going back and forth on this, but it may make sense to check the number of operands first, before accessing any.


================
Comment at: llvm/lib/Transforms/Utils/MisExpect.cpp:159
+        }
+        misexpect::verifyMisExpect(&I, RealWeights, I.getContext());
+      }
----------------
do you need the `misexpect::` qualifier here? I think your `using` statement above should make this one unnecessary?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66324/new/

https://reviews.llvm.org/D66324





More information about the cfe-commits mailing list