clang API Documentation
#include "clang/Lex/HeaderSearch.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Lex/HeaderMap.h"
#include "clang/Lex/HeaderSearchOptions.h"
#include "clang/Lex/LexDiagnostic.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Capacity.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdio>
Go to the source code of this file.
Functions | |
static const FileEntry * | getFileAndSuggestModule (HeaderSearch &HS, StringRef FileName, const DirectoryEntry *Dir, bool IsSystemHeaderDir, ModuleMap::KnownHeader *SuggestedModule) |
static const DirectoryEntry * | getTopFrameworkDir (FileManager &FileMgr, StringRef DirName, SmallVectorImpl< std::string > &SubmodulePath) |
Given a framework directory, find the top-most framework directory. | |
static bool | checkMSVCHeaderSearch (DiagnosticsEngine &Diags, const FileEntry *MSFE, const FileEntry *FE, SourceLocation IncludeLoc) |
Return true with a diagnostic if the file that MSVC would have found fails to match the one that Clang would have found with MSVC header search disabled. | |
static const char * | copyString (StringRef Str, llvm::BumpPtrAllocator &Alloc) |
static void | mergeHeaderFileInfo (HeaderFileInfo &HFI, const HeaderFileInfo &OtherHFI) |
Merge the header file info provided by OtherHFI into the current header file info (HFI ) | |
static const FileEntry * | getPrivateModuleMap (StringRef ModuleMapPath, const DirectoryEntry *Directory, FileManager &FileMgr) |
static bool checkMSVCHeaderSearch | ( | DiagnosticsEngine & | Diags, |
const FileEntry * | MSFE, | ||
const FileEntry * | FE, | ||
SourceLocation | IncludeLoc | ||
) | [static] |
Return true with a diagnostic if the file that MSVC would have found fails to match the one that Clang would have found with MSVC header search disabled.
Definition at line 543 of file HeaderSearch.cpp.
References clang::FileEntry::getName(), and clang::DiagnosticsEngine::Report().
Referenced by clang::HeaderSearch::LookupFile().
static const char* copyString | ( | StringRef | Str, |
llvm::BumpPtrAllocator & | Alloc | ||
) | [static] |
Definition at line 553 of file HeaderSearch.cpp.
Referenced by clang::HeaderSearch::LookupFile().
static const FileEntry* getFileAndSuggestModule | ( | HeaderSearch & | HS, |
StringRef | FileName, | ||
const DirectoryEntry * | Dir, | ||
bool | IsSystemHeaderDir, | ||
ModuleMap::KnownHeader * | SuggestedModule | ||
) | [static] |
Definition at line 237 of file HeaderSearch.cpp.
References clang::HeaderSearch::findModuleForHeader(), clang::FileManager::getFile(), clang::HeaderSearch::getFileMgr(), clang::ModuleMap::KnownHeader::getModule(), and clang::HeaderSearch::hasModuleMap().
Referenced by clang::DirectoryLookup::LookupFile(), and clang::HeaderSearch::LookupFile().
static const FileEntry* getPrivateModuleMap | ( | StringRef | ModuleMapPath, |
const DirectoryEntry * | Directory, | ||
FileManager & | FileMgr | ||
) | [static] |
Definition at line 1119 of file HeaderSearch.cpp.
References clang::FileManager::getFile(), and clang::DirectoryEntry::getName().
static const DirectoryEntry* getTopFrameworkDir | ( | FileManager & | FileMgr, |
StringRef | DirName, | ||
SmallVectorImpl< std::string > & | SubmodulePath | ||
) | [static] |
Given a framework directory, find the top-most framework directory.
FileMgr | The file manager to use for directory lookups. |
DirName | The name of the framework directory. |
SubmodulePath | Will be populated with the submodule path from the returned top-level module to the originally named framework. |
Definition at line 345 of file HeaderSearch.cpp.
References clang::FileManager::getCanonicalName(), and clang::FileManager::getDirectory().
Referenced by clang::HeaderSearch::LookupSubframeworkHeader().
static void mergeHeaderFileInfo | ( | HeaderFileInfo & | HFI, |
const HeaderFileInfo & | OtherHFI | ||
) | [static] |
Merge the header file info provided by OtherHFI
into the current header file info (HFI
)
Definition at line 942 of file HeaderSearch.cpp.
References clang::HeaderFileInfo::ControllingMacro, clang::HeaderFileInfo::ControllingMacroID, clang::HeaderFileInfo::DirInfo, clang::HeaderFileInfo::External, clang::HeaderFileInfo::Framework, clang::HeaderFileInfo::IndexHeaderMapHeader, clang::HeaderFileInfo::isImport, clang::HeaderFileInfo::isModuleHeader, clang::HeaderFileInfo::isPragmaOnce, clang::HeaderFileInfo::NumIncludes, and clang::HeaderFileInfo::Resolved.
Referenced by clang::HeaderSearch::isFileMultipleIncludeGuarded().