003 File Manager
Current Path:
/usr/src/contrib/llvm-project/clang/include/clang/Lex
usr
/
src
/
contrib
/
llvm-project
/
clang
/
include
/
clang
/
Lex
/
📁
..
📄
CodeCompletionHandler.h
(3.02 KB)
📄
DependencyDirectivesSourceMinimizer.h
(3.66 KB)
📄
DirectoryLookup.h
(7.21 KB)
📄
ExternalPreprocessorSource.h
(1.52 KB)
📄
HeaderMap.h
(3.27 KB)
📄
HeaderMapTypes.h
(1.45 KB)
📄
HeaderSearch.h
(31.25 KB)
📄
HeaderSearchOptions.h
(8.62 KB)
📄
LexDiagnostic.h
(496 B)
📄
Lexer.h
(33.92 KB)
📄
LiteralSupport.h
(10.06 KB)
📄
MacroArgs.h
(5.41 KB)
📄
MacroInfo.h
(20.14 KB)
📄
ModuleLoader.h
(7.25 KB)
📄
ModuleMap.h
(27.64 KB)
📄
MultipleIncludeOpt.h
(6.41 KB)
📄
PPCallbacks.h
(23.05 KB)
📄
PPConditionalDirectiveRecord.h
(3.75 KB)
📄
Pragma.h
(4.23 KB)
📄
PreprocessingRecord.h
(20.55 KB)
📄
Preprocessor.h
(89.66 KB)
📄
PreprocessorExcludedConditionalDirectiveSkipMapping.h
(1.24 KB)
📄
PreprocessorLexer.h
(6.1 KB)
📄
PreprocessorOptions.h
(8.35 KB)
📄
ScratchBuffer.h
(1.41 KB)
📄
Token.h
(11.63 KB)
📄
TokenConcatenation.h
(2.55 KB)
📄
TokenLexer.h
(9.96 KB)
📄
VariadicMacroSupport.h
(8.95 KB)
Editing: HeaderMap.h
//===--- HeaderMap.h - A file that acts like dir of symlinks ----*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines the HeaderMap interface. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LEX_HEADERMAP_H #define LLVM_CLANG_LEX_HEADERMAP_H #include "clang/Basic/FileManager.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MemoryBuffer.h" #include <memory> namespace clang { struct HMapBucket; struct HMapHeader; /// Implementation for \a HeaderMap that doesn't depend on \a FileManager. class HeaderMapImpl { std::unique_ptr<const llvm::MemoryBuffer> FileBuffer; bool NeedsBSwap; public: HeaderMapImpl(std::unique_ptr<const llvm::MemoryBuffer> File, bool NeedsBSwap) : FileBuffer(std::move(File)), NeedsBSwap(NeedsBSwap) {} // Check for a valid header and extract the byte swap. static bool checkHeader(const llvm::MemoryBuffer &File, bool &NeedsByteSwap); /// If the specified relative filename is located in this HeaderMap return /// the filename it is mapped to, otherwise return an empty StringRef. StringRef lookupFilename(StringRef Filename, SmallVectorImpl<char> &DestPath) const; /// Return the filename of the headermap. StringRef getFileName() const; /// Print the contents of this headermap to stderr. void dump() const; private: unsigned getEndianAdjustedWord(unsigned X) const; const HMapHeader &getHeader() const; HMapBucket getBucket(unsigned BucketNo) const; /// Look up the specified string in the string table. If the string index is /// not valid, return None. Optional<StringRef> getString(unsigned StrTabIdx) const; }; /// 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. class HeaderMap : private HeaderMapImpl { HeaderMap(std::unique_ptr<const llvm::MemoryBuffer> File, bool BSwap) : HeaderMapImpl(std::move(File), BSwap) {} public: /// 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. static std::unique_ptr<HeaderMap> Create(const FileEntry *FE, FileManager &FM); /// 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". Optional<FileEntryRef> LookupFile(StringRef Filename, FileManager &FM) const; using HeaderMapImpl::lookupFilename; using HeaderMapImpl::getFileName; using HeaderMapImpl::dump; }; } // end namespace clang. #endif
Upload File
Create Folder