This is an archive of the discontinued LLVM Phabricator instance.

[cfi-verify] Add blame context printing, and improved print format.
ClosedPublic

Authored by hctim on Nov 15 2017, 4:46 PM.

Details

Summary

This update now allows users to specify --blame-context and --blame-context-all to print source file blame information for the source of the blame.

Also updates the inline printing to correctly identify the top of the inlining stack for blame information.

Event Timeline

hctim created this revision.Nov 15 2017, 4:46 PM
tools/llvm-cfi-verify/llvm-cfi-verify.cpp
67

errs()

72

I'd just make this a SmallVectorImpl<> or a std::vector<>, the small-size optimization here is not likely to help much since many files are >200 lines.

80

Why print this here at all? It would seem reasonable to me to just print the full protection status with the instruction, e.g. Expected Protected Instruction: ... and just have this print

 1: ...
>2: ...
 3: ...
92

Can we condense this to a single line and remove the text formatting? Like

outs() << "Instruction: " << stringCfiProtectionStatus() << ": " << format_hex() << ": ";
108

Prefer to put these with instruction printing (e.g. so it gets printed even if no SCL is given.)

127

We have lots of these delimiters, could we just place them at the start or end of an instruction and eliminate the rest?

This revision was not accepted when it landed; it landed in state Needs Review.Feb 1 2018, 3:47 PM
This revision was automatically updated to reflect the committed changes.