//===--- HeaderMap.cpp - A file that acts like dir of symlinks ------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the HeaderMap interface.
//
//===----------------------------------------------------------------------===//
using namespace clang;
/// HashHMapKey - This is the 'well known' hash function required by the file
/// format, used to look up keys in the hash table. The hash table uses simple
/// linear probing based on this function.
static inline unsigned
//===----------------------------------------------------------------------===//
// Verification and Construction
//===----------------------------------------------------------------------===//
/// HeaderMap::Create - This attempts to load the specified file as a header
/// map. If it doesn't look like a HeaderMap, it gives up and returns null.
/// If it looks like a HeaderMap but is obviously corrupted, it puts a reason
/// into the string error argument and returns null.
std::unique_ptr<HeaderMap>
bool
//===----------------------------------------------------------------------===//
// Utility Methods
//===----------------------------------------------------------------------===//
/// getFileName - Return the filename of the headermap.
StringRef
unsigned
/// getHeader - Return a reference to the file header, in unbyte-swapped form.
/// This method cannot fail.
const HMapHeader &
/// getBucket - Return the specified hash table bucket from the header map,
/// bswap'ing its fields as appropriate. If the bucket number is not valid,
/// this return a bucket with an empty key (0).
HMapBucket
Optional<StringRef>
//===----------------------------------------------------------------------===//
// The Main Drivers
//===----------------------------------------------------------------------===//
/// dump - Print the contents of this headermap to stderr.
LLVM_DUMP_METHOD void
StringRef
StringRef