[PATCH] D38424: MC Helpers for llvm-cfi-verify.

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 10:10:37 PDT 2017


vlad.tsyrklevich added inline comments.


================
Comment at: tools/llvm-cfi-verify/FileVerifier.cpp:132
+bool FileVerifier::isUndefinedInstruction(const Instr &InstrMeta) const {
+  return MII->getName(InstrMeta.Instruction.getOpcode()) == "TRAP";
+}
----------------
`getOpcode() == Instruction::Undefined?` Also, what if InstrMeta.Bad?


================
Comment at: tools/llvm-cfi-verify/FileVerifier.cpp:171
+
+    return &NextKV->second;
+  }
----------------
Here you don't check `NextKV->second.bad` but below you do, which should it be?


================
Comment at: tools/llvm-cfi-verify/FileVerifier.h:90
+  // Undefined (and bad) instructions cannot fall through, and instruction that
+  // modify the control flow can only flow through if they are conditional
+  // branches or calls.
----------------
s/flow/fall/


================
Comment at: tools/llvm-cfi-verify/FileVerifier.h:95
+  // Returns the definitive next instruction. This is different from the next
+  // instruction sequantially as it will follow unconditional branches (assuming
+  // they can be resolved at compile time, i.e. not indirect). This instruction
----------------
s/qua/que/


================
Comment at: tools/llvm-cfi-verify/FileVerifier.h:96
+  // instruction sequantially as it will follow unconditional branches (assuming
+  // they can be resolved at compile time, i.e. not indirect). This instruction
+  // returns nullptr if the provided instruction does not transfer control flow
----------------
s/instruction/method/


https://reviews.llvm.org/D38424





More information about the llvm-commits mailing list