diff options
| author | Mitch Phillips <mitchphillips@outlook.com> | 2017-10-25 21:21:16 +0000 | 
|---|---|---|
| committer | Mitch Phillips <mitchphillips@outlook.com> | 2017-10-25 21:21:16 +0000 | 
| commit | 5ff01cdc59027ed3d298dd650786ab4d30b21d81 (patch) | |
| tree | c04daca6cffda5a549cbaf5a37763c637b9b374c /llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h | |
| parent | 13e37d4d0a3fd5cb34b7adee3ba123127b15f9c4 (diff) | |
| download | bcm5719-llvm-5ff01cdc59027ed3d298dd650786ab4d30b21d81.tar.gz bcm5719-llvm-5ff01cdc59027ed3d298dd650786ab4d30b21d81.zip | |
Add FileVerifier::isCFIProtected().
Add a CFI protection check that is implemented by building a graph and inspecting the output to deduce if the indirect CF instruction is CFI protected. Also added the output of this instruction to printIndirectInstructions().
Reviewers: vlad.tsyrklevich
Subscribers: llvm-commits, kcc, pcc, mgorny
Differential Revision: https://reviews.llvm.org/D38428
llvm-svn: 316610
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h')
| -rw-r--r-- | llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h index 803eeee97e0..1ed575bb9e4 100644 --- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h +++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.h @@ -66,6 +66,12 @@ public:    FileAnalysis(const FileAnalysis &) = delete;    FileAnalysis(FileAnalysis &&Other) = default; +  // Check whether the provided instruction is CFI protected in this file. +  // Returns false if this instruction doesn't exist in this file, if it's not +  // an indirect control flow instruction, or isn't CFI protected. Returns true +  // otherwise. +  bool isIndirectInstructionCFIProtected(uint64_t Address) const; +    // Returns the instruction at the provided address. Returns nullptr if there    // is no instruction at the provided address.    const Instr *getInstruction(uint64_t Address) const; | 

