summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
diff options
context:
space:
mode:
authorMitch Phillips <mitchphillips@outlook.com>2017-11-14 22:43:13 +0000
committerMitch Phillips <mitchphillips@outlook.com>2017-11-14 22:43:13 +0000
commit02993892d81f256d1a4a61bb4886db3376a75644 (patch)
tree34ba89032d0ee2746aeba55cac62a0e50ba5c905 /llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
parente6201c8724dbce94969bc0b7f81e950cdbb6f742 (diff)
downloadbcm5719-llvm-02993892d81f256d1a4a61bb4886db3376a75644.tar.gz
bcm5719-llvm-02993892d81f256d1a4a61bb4886db3376a75644.zip
[cfi-verify] Add DOT graph printing for GraphResult objects.
Allows users to view GraphResult objects in a DOT directed-graph format. This feature can be turned on through the --print-graphs flag. Also enabled pretty-printing of instructions in output. Together these features make analysis of unprotected CF instructions much easier by providing a visual control flow graph. Reviewers: pcc Subscribers: llvm-commits, kcc, vlad.tsyrklevich Differential Revision: https://reviews.llvm.org/D39819 llvm-svn: 318211
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp')
-rw-r--r--llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
index 42de8cb4f7d..8f3a6837cfa 100644
--- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
+++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
@@ -273,6 +273,11 @@ FileAnalysis::validateCFIProtection(const GraphResult &Graph) const {
return CFIProtectionStatus::PROTECTED;
}
+void FileAnalysis::printInstruction(const Instr &InstrMeta,
+ raw_ostream &OS) const {
+ Printer->printInst(&InstrMeta.Instruction, OS, "", *SubtargetInfo.get());
+}
+
Error FileAnalysis::initialiseDisassemblyMembers() {
std::string TripleName = ObjectTriple.getTriple();
ArchName = "";
OpenPOWER on IntegriCloud