1 //===--- HeaderMap.h - A file that acts like dir of symlinks ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the HeaderMap interface.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_LEX_HEADERMAP_H
15 #define LLVM_CLANG_LEX_HEADERMAP_H
27 /// This class represents an Apple concept known as a 'header map'. To the
28 /// #include file resolution process, it basically acts like a directory of
29 /// symlinks to files. Its advantages are that it is dense and more efficient
30 /// to create and process than a directory of symlinks.
32 HeaderMap(const HeaderMap&); // DO NOT IMPLEMENT
33 void operator=(const HeaderMap&); // DO NOT IMPLEMENT
35 const llvm::MemoryBuffer *FileBuffer;
38 HeaderMap(const llvm::MemoryBuffer *File, bool BSwap)
39 : FileBuffer(File), NeedsBSwap(BSwap) {
44 /// HeaderMap::Create - This attempts to load the specified file as a header
45 /// map. If it doesn't look like a HeaderMap, it gives up and returns null.
46 static const HeaderMap *Create(const FileEntry *FE);
48 /// LookupFile - Check to see if the specified relative filename is located in
49 /// this HeaderMap. If so, open it and return its FileEntry.
50 const FileEntry *LookupFile(llvm::StringRef Filename, FileManager &FM) const;
52 /// getFileName - Return the filename of the headermap.
53 const char *getFileName() const;
55 /// dump - Print the contents of this headermap to stderr.
59 unsigned getEndianAdjustedWord(unsigned X) const;
60 const HMapHeader &getHeader() const;
61 HMapBucket getBucket(unsigned BucketNo) const;
62 const char *getString(unsigned StrTabIdx) const;
65 } // end namespace clang.