This is an archive of the discontinued LLVM Phabricator instance.

Fix DataFlowSanitizer instrumentation pass to take parameter position changes into account for custom functions.
ClosedPublic

Authored by skerner on Feb 9 2018, 10:27 AM.

Details

Summary

When DataFlowSanitizer transforms a call to a custom function, the new call has extra parameters. The attributes on parameters must be updated to take the new position of each parameter into account.

Diff Detail

Event Timeline

skerner created this revision.Feb 9 2018, 10:27 AM
pcc added a reviewer: pcc.Feb 9 2018, 11:16 AM
pcc added a subscriber: pcc.
pcc added inline comments.
lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
243

I think this can just be a std::vector<unsigned>.

251

Please use llvm naming conventions (i.e. CallSiteAttrs instead of call_site_attrs). Also elsewhere.

skerner updated this revision to Diff 133888.Feb 12 2018, 9:44 AM
skerner marked an inline comment as done.

Fix review comments.

skerner updated this revision to Diff 133891.Feb 12 2018, 9:54 AM
skerner marked an inline comment as done.

Address review comments.

Peter, thanks for the review!

lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
243

I chose a map so that arguments to the original function which are not included in the transformed function can be excluded. However, I now see that this can not happen. Changed.

sbucur added a subscriber: sbucur.Feb 12 2018, 10:52 AM
pcc accepted this revision.Feb 12 2018, 4:17 PM

LGTM

This revision is now accepted and ready to land.Feb 12 2018, 4:17 PM

Peter, can you please commit this change?

This revision was automatically updated to reflect the committed changes.