This is an archive of the discontinued LLVM Phabricator instance.

[Support] Change SaturatingAdd()/SaturatingMultiply() to use pointer for returning overflow state
ClosedPublic

Authored by slingn on Dec 3 2015, 4:48 PM.

Details

Summary

Improve SaturatingAdd()/SaturatingMultiply() to use bool * to optionally return overflow result.
This should make it clearer that the value is returned at callsites and reduces the size of the implementation.

Diff Detail

Event Timeline

slingn updated this revision to Diff 41831.Dec 3 2015, 4:48 PM
slingn retitled this revision from to [Support] Change SaturatingAdd()/SaturatingMultiply() to use pointer for returning overflow state.
slingn updated this object.
slingn added reviewers: davidxl, silvas.
slingn added a subscriber: llvm-commits.
davidxl accepted this revision.Dec 3 2015, 4:56 PM
davidxl edited edge metadata.
This revision is now accepted and ready to land.Dec 3 2015, 4:56 PM
silvas accepted this revision.Dec 3 2015, 5:22 PM
silvas edited edge metadata.
This revision was automatically updated to reflect the committed changes.