llvm.org GIT mirror llvm / 174270c
cleanup hashSysV a bit. Don't pass a reference to a StringRef and use a range loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286232 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 3 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
505505 /// This function returns the hash value for a symbol in the .dynsym section
506506 /// Name of the API remains consistent as specified in the libelf
507507 /// REF : http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash
508 static inline unsigned hashSysV(StringRef &symbolName) {
508 inline unsigned hashSysV(StringRef SymbolName) {
509509 unsigned h = 0, g;
510 for (unsigned i = 0, j = symbolName.size(); i < j; i++) {
511 h = (h << 4) + symbolName[i];
510 for (char C : SymbolName) {
511 h = (h << 4) + C;
512512 g = h & 0xf0000000L;
513513 if (g != 0)
514514 h ^= g >> 24;