This is an archive of the discontinued LLVM Phabricator instance.

Make llvm::djbHash an inline function.
ClosedPublic

Authored by ruiu on Feb 22 2018, 1:56 PM.

Details

Summary

djbHash() is so small that we should always inline.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Feb 22 2018, 1:56 PM
labath accepted this revision.Mar 2 2018, 12:55 PM

Sorry, I missed this one, I'll have to configure my email filters better.

llvm/lib/Support/DJB.cpp
22–24 ↗(On Diff #135514)

It may be better to put this in the header as well (perhaps in a detail namespace) so you don't have to manually inline it below, but that's just splitting hairs. I am fine with this option as well.

This revision is now accepted and ready to land.Mar 2 2018, 12:55 PM
ruiu added inline comments.Mar 2 2018, 1:21 PM
llvm/lib/Support/DJB.cpp
22–24 ↗(On Diff #135514)

Honestly I don't think this isn't worth to be in the header as (1) there is no situation in which you want to use this function independently, and (2) this is extremely small, and (3) it is not intended to change. So I'm more comfortable to just inline it just like I did in this patch.

This revision was automatically updated to reflect the committed changes.