summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
diff options
context:
space:
mode:
authorMitch Phillips <mitchphillips@outlook.com>2017-11-09 00:18:31 +0000
committerMitch Phillips <mitchphillips@outlook.com>2017-11-09 00:18:31 +0000
commitd64af525853ebe92cc794f3abd1f820591add786 (patch)
treee5053e32ad7d08ec3b38a3e7ba97a71a2f80922f /llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
parentfb5ef73460189fa410e2b42fba827d131142ca0e (diff)
downloadbcm5719-llvm-d64af525853ebe92cc794f3abd1f820591add786.tar.gz
bcm5719-llvm-d64af525853ebe92cc794f3abd1f820591add786.zip
[cfi-verify] Adds blacklist blame behaviour to cfi-verify.
Adds the blacklist behaviour to llvm-cfi-verify. Now will calculate which lines caused expected failures in the blacklist and reports the number of affected indirect CF instructions for each blacklist entry. Also moved DWARF checking after instruction analysis to improve performance significantly - unrolling the inlining stack is expensive. Reviewers: vlad.tsyrklevich Subscribers: aprantl, pcc, kcc, llvm-commits Differential Revision: https://reviews.llvm.org/D39750 llvm-svn: 317743
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp')
-rw-r--r--llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
index 0d4e1f497ff..863bbfb045e 100644
--- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
+++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
@@ -370,21 +370,6 @@ void FileAnalysis::parseSectionContents(ArrayRef<uint8_t> SectionBytes,
InstrMeta.InstructionSize = InstructionSize;
InstrMeta.Valid = ValidInstruction;
- // Check if this instruction exists in the range of the DWARF metadata.
- if (!IgnoreDWARFFlag) {
- auto LineInfo =
- Symbolizer->symbolizeCode(Object->getFileName(), VMAddress);
- if (!LineInfo) {
- handleAllErrors(LineInfo.takeError(), [](const ErrorInfoBase &E) {
- errs() << "Symbolizer failed to get line: " << E.message() << "\n";
- });
- continue;
- }
-
- if (LineInfo->FileName == "<invalid>")
- continue;
- }
-
addInstruction(InstrMeta);
if (!ValidInstruction)
@@ -406,6 +391,21 @@ void FileAnalysis::parseSectionContents(ArrayRef<uint8_t> SectionBytes,
if (!usesRegisterOperand(InstrMeta))
continue;
+ // Check if this instruction exists in the range of the DWARF metadata.
+ if (!IgnoreDWARFFlag) {
+ auto LineInfo =
+ Symbolizer->symbolizeCode(Object->getFileName(), VMAddress);
+ if (!LineInfo) {
+ handleAllErrors(LineInfo.takeError(), [](const ErrorInfoBase &E) {
+ errs() << "Symbolizer failed to get line: " << E.message() << "\n";
+ });
+ continue;
+ }
+
+ if (LineInfo->FileName == "<invalid>")
+ continue;
+ }
+
IndirectInstructions.insert(VMAddress);
}
}
OpenPOWER on IntegriCloud