This is an archive of the discontinued LLVM Phabricator instance.

Remove unused and undocumented data_offset parameter
ClosedPublic

Authored by aprantl on Aug 7 2019, 3:52 PM.

Details

Summary

Value::GetValueAsData() takes an undocumented parameter called data_offset that is always 0. I couldn't figure out what it is supposed to be used for and it is never used, so here's a patch to remove it.

Diff Detail

Event Timeline

aprantl created this revision.Aug 7 2019, 3:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 3:53 PM
aprantl updated this revision to Diff 214024.Aug 7 2019, 3:54 PM

From the looks of it, this appears to be the offset in the data extractor that you want to start extracting from (so, e.g. if you have a large data extractor, and you know that the value you're interested in is at byte 47, you would say GetValueAsData(large_extractor, 47).

That said, I think it would be good to remove this, as it does not seem to be a common use case, and one can always create a sub-data extractor, if he really wants to start extracting from a random offset.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 8 2019, 12:22 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 12:22 PM