clang API Documentation

Public Member Functions | Static Public Member Functions
clang::HeaderMap Class Reference

#include <HeaderMap.h>

List of all members.

Public Member Functions

const FileEntryLookupFile (StringRef Filename, FileManager &FM) const
StringRef lookupFilename (StringRef Filename, SmallVectorImpl< char > &DestPath) const
const char * getFileName () const
 getFileName - Return the filename of the headermap.
void dump () const
 dump - Print the contents of this headermap to stderr.

Static Public Member Functions

static const HeaderMapCreate (const FileEntry *FE, FileManager &FM)

Detailed Description

This class represents an Apple concept known as a 'header map'. To the #include file resolution process, it basically acts like a directory of symlinks to files. Its advantages are that it is dense and more efficient to create and process than a directory of symlinks.

Definition at line 35 of file HeaderMap.h.


Member Function Documentation

const HeaderMap * HeaderMap::Create ( const FileEntry FE,
FileManager FM 
) [static]

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.

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.

Definition at line 79 of file HeaderMap.cpp.

References clang::FileManager::getBufferForFile(), clang::FileEntry::getSize(), HMAP_HeaderMagicNumber, HMAP_HeaderVersion, clang::HMapHeader::Magic, clang::HMapHeader::Reserved, and clang::HMapHeader::Version.

Referenced by clang::HeaderSearch::CreateHeaderMap().

void HeaderMap::dump ( ) const
const char * HeaderMap::getFileName ( ) const

getFileName - Return the filename of the headermap.

Definition at line 115 of file HeaderMap.cpp.

Referenced by dump(), and clang::DirectoryLookup::getName().

const FileEntry * HeaderMap::LookupFile ( StringRef  Filename,
FileManager FM 
) const

LookupFile - Check to see if the specified relative filename is located in this HeaderMap. If so, open it and return its FileEntry. If RawPath is not NULL and the file is found, RawPath will be set to the raw path at which the file was found in the file system. For example, for a search path ".." and a filename "../file.h" this would be "../../file.h".

LookupFile - Check to see if the specified relative filename is located in this HeaderMap. If so, open it and return its FileEntry.

Definition at line 198 of file HeaderMap.cpp.

References clang::FileManager::getFile(), and lookupFilename().

Referenced by clang::DirectoryLookup::LookupFile().

StringRef HeaderMap::lookupFilename ( StringRef  Filename,
SmallVectorImpl< char > &  DestPath 
) const

If the specified relative filename is located in this HeaderMap return the filename it is mapped to, otherwise return an empty StringRef.

Definition at line 209 of file HeaderMap.cpp.

References Bucket, HashHMapKey(), HMAP_EmptyBucketKey, clang::HMapBucket::Key, clang::HMapHeader::NumBuckets, clang::HMapBucket::Prefix, and clang::HMapBucket::Suffix.

Referenced by LookupFile(), and clang::DirectoryLookup::LookupFile().


The documentation for this class was generated from the following files: