clang 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
clang::HeaderMap Class Reference

This class represents an Apple concept known as a 'header map'. More...

#include "clang/Lex/HeaderMap.h"

Inheritance diagram for clang::HeaderMap:
Inheritance graph
[legend]

Public Member Functions

void dump () const
 Print the contents of this headermap to stderr.
 
template<typename Func >
void forEachKey (Func Callback) const
 
StringRef getFileName () const
 Return the filename of the headermap.
 
StringRef 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.
 
StringRef reverseLookupFilename (StringRef DestPath) const
 Return key for specifed path.
 

Static Public Member Functions

static std::unique_ptr< HeaderMapCreate (FileEntryRef FE, FileManager &FM)
 This attempts to load the specified file as a header map.
 

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 84 of file HeaderMap.h.

Member Function Documentation

◆ Create()

std::unique_ptr< HeaderMap > HeaderMap::Create ( FileEntryRef  FE,
FileManager FM 
)
static

This attempts to load the specified file as a header map.

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 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 49 of file HeaderMap.cpp.

References clang::FileManager::getBufferForFile(), and clang::FileEntryRef::getSize().

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

◆ dump()

LLVM_DUMP_METHOD void HeaderMapImpl::dump ( ) const

Print the contents of this headermap to stderr.

dump - Print the contents of this headermap to stderr.

Definition at line 65 of file HeaderMap.cpp.

◆ forEachKey()

template<typename Func >
void clang::HeaderMapImpl::forEachKey ( Func  Callback) const
inline

Definition at line 44 of file HeaderMap.h.

◆ getFileName()

StringRef HeaderMapImpl::getFileName ( ) const

Return the filename of the headermap.

getFileName - Return the filename of the headermap.

Definition at line 62 of file HeaderMap.cpp.

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

◆ lookupFilename()

StringRef HeaderMapImpl::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 58 of file HeaderMap.cpp.

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

◆ reverseLookupFilename()

StringRef HeaderMapImpl::reverseLookupFilename ( StringRef  DestPath) const

Return key for specifed path.

Definition at line 68 of file HeaderMap.cpp.


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