LCOV - code coverage report
Current view: top level - include/llvm/Support - DJB.h (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 2 2 100.0 %
Date: 2018-10-20 13:21:21 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===-- llvm/Support/DJB.h ---DJB Hash --------------------------*- C++ -*-===//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : //
      10             : // This file contains support for the DJ Bernstein hash function.
      11             : //
      12             : //===----------------------------------------------------------------------===//
      13             : 
      14             : #ifndef LLVM_SUPPORT_DJB_H
      15             : #define LLVM_SUPPORT_DJB_H
      16             : 
      17             : #include "llvm/ADT/StringRef.h"
      18             : 
      19             : namespace llvm {
      20             : 
      21             : /// The Bernstein hash function used by the DWARF accelerator tables.
      22             : inline uint32_t djbHash(StringRef Buffer, uint32_t H = 5381) {
      23 18671112607 :   for (unsigned char C : Buffer.bytes())
      24 17196358015 :     H = (H << 5) + H + C;
      25             :   return H;
      26             : }
      27             : 
      28             : /// Computes the Bernstein hash after folding the input according to the Dwarf 5
      29             : /// standard case folding rules.
      30             : uint32_t caseFoldingDjbHash(StringRef Buffer, uint32_t H = 5381);
      31             : } // namespace llvm
      32             : 
      33             : #endif // LLVM_SUPPORT_DJB_H

Generated by: LCOV version 1.13