Introduces the llvm-cfi-verify tool to llvm. Includes the design document (docs/CFIVerify.rst). Current implementation of the tool is simply a disassembler that identifies and prints the indirect control flow instructions.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
docs/CFIVerify.rst | ||
---|---|---|
37 ↗ | (On Diff #115507) | ensures |
55 ↗ | (On Diff #115507) | nit: bytecode is traditionally used to refer to instructions run by a VM/interpreter, replace with 'machine code' instead |
tools/llvm-cfi-verify/llvm-cfi-verify.cpp | ||
1 ↗ | (On Diff #115507) | Run clang-format |
212 ↗ | (On Diff #115507) | errs() |
235 ↗ | (On Diff #115507) | This can assert() on a bad opcode, should we check if (BadInstruction) before this? |
243 ↗ | (On Diff #115507) | I believe you can use a range-based for loop here: for (auto &Op : Instruction) |
Updates from Vlad's comments.
tools/llvm-cfi-verify/llvm-cfi-verify.cpp | ||
---|---|---|
243 ↗ | (On Diff #115507) | 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. |
tools/llvm-cfi-verify/llvm-cfi-verify.cpp | ||
---|---|---|
153 ↗ | (On Diff #115737) | Could we change these messages to 'Failed to initialize MCRegisterInfo' instead? |
docs/CFIVerify.rst | ||
---|---|---|
65 ↗ | (On Diff #115737) | I thought the call should always be fallthrough. Did you see the opposite case? |
Changed error reporting text slightly. Single line if-else statements now no longer have braces. Utilised commit in D37719 to remove helper function for Triple deduction from an ObjectFile.
docs/CFIVerify.rst | ||
---|---|---|
65 ↗ | (On Diff #115737) | Fallthrough-to-ud2 is currently present. Will write some code to evaluate this case and provide report. |