[PATCH] D43644: Make llvm::djbHash an inline function.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 13:23:38 PST 2018


ruiu added inline comments.


================
Comment at: llvm/lib/Support/DJB.cpp:22-24
-static inline uint32_t djbHashChar(unsigned char C, uint32_t H) {
-  return (H << 5) + H + C;
-}
----------------
labath wrote:
> 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.
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.


https://reviews.llvm.org/D43644





More information about the llvm-commits mailing list