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
- Build Status
Buildable 10380 Build 10380: arc lint + arc unit
Event Timeline
| docs/CFIVerify.rst | ||
|---|---|---|
| 38 | ensures | |
| 56 | 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 | ||
| 2 | Run clang-format | |
| 213 | errs() | |
| 236 | This can assert() on a bad opcode, should we check if (BadInstruction) before this? | |
| 244 | 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 | ||
|---|---|---|
| 244 | 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 | Could we change these messages to 'Failed to initialize MCRegisterInfo' instead? | |
| docs/CFIVerify.rst | ||
|---|---|---|
| 65 | 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 | Fallthrough-to-ud2 is currently present. Will write some code to evaluate this case and provide report. | |
ensures