Home | History | Annotate | Download | only in Lex
      1 //===- HeaderMapTypes.h - Types for the header map format -------*- 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 #ifndef LLVM_CLANG_LEX_HEADERMAPTYPES_H
     11 #define LLVM_CLANG_LEX_HEADERMAPTYPES_H
     12 
     13 #include <cstdint>
     14 
     15 namespace clang {
     16 
     17 enum {
     18   HMAP_HeaderMagicNumber = ('h' << 24) | ('m' << 16) | ('a' << 8) | 'p',
     19   HMAP_HeaderVersion = 1,
     20   HMAP_EmptyBucketKey = 0
     21 };
     22 
     23 struct HMapBucket {
     24   uint32_t Key;    // Offset (into strings) of key.
     25   uint32_t Prefix; // Offset (into strings) of value prefix.
     26   uint32_t Suffix; // Offset (into strings) of value suffix.
     27 };
     28 
     29 struct HMapHeader {
     30   uint32_t Magic;          // Magic word, also indicates byte order.
     31   uint16_t Version;        // Version number -- currently 1.
     32   uint16_t Reserved;       // Reserved for future use - zero for now.
     33   uint32_t StringsOffset;  // Offset to start of string pool.
     34   uint32_t NumEntries;     // Number of entries in the string table.
     35   uint32_t NumBuckets;     // Number of buckets (always a power of 2).
     36   uint32_t MaxValueLength; // Length of longest result path (excluding nul).
     37   // An array of 'NumBuckets' HMapBucket objects follows this header.
     38   // Strings follow the buckets, at StringsOffset.
     39 };
     40 
     41 } // end namespace clang.
     42 
     43 #endif
     44