This is an archive of the discontinued LLVM Phabricator instance.

ImportArguments analysis printer
AbandonedPublic

Authored by thgarnie on Mar 2 2017, 1:32 PM.

Details

Reviewers
lattner
Summary

Add a module pass that displays constants and simple constraints applied to integer arguments for imported functions. It can help to infer how an API is used.

For example, if the mmap and mprotect libc functions never use the PROT_EXEC flag; it can be assumed the module does not generate dynamic code.

It outputs a YAML format:

caller:      check_set_after
import:      externalfunction
arguments:
  1:
    - type:            eq
      value:           3
...

This first commit outputs the collected information. Following changes will help drive the analysis to specific function and mark binaries matching specific constraints. I also plan to extend the constraints to strings.

Diff Detail

Event Timeline

thgarnie created this revision.Mar 2 2017, 1:32 PM

Any feedback on this change?

I've chatted a bit to Thomas about this off the list and wanted to follow up here so that there wasn't radio silence.

I think in order for folks to review this patch effectively they'll need to have the context of what the problem being solved is, and an overall view of the design to solve and it why that design was chosen. I've suggested that Thomas start an 'RFC' thread on llvm-dev once he has a write up of this and we can go from there.

thgarnie abandoned this revision.May 2 2017, 10:40 AM