Lines Matching defs:FileEntryRef
10 /// Defines interfaces for clang::FileEntry and clang::FileEntryRef.
44 class FileEntryRef;
49 template <> class OptionalStorage<clang::FileEntryRef>;
57 class FileEntryRef {
89 friend bool operator==(const FileEntryRef &LHS, const FileEntryRef &RHS) {
92 friend bool operator==(const FileEntry *LHS, const FileEntryRef &RHS) {
95 friend bool operator==(const FileEntryRef &LHS, const FileEntry *RHS) {
98 friend bool operator!=(const FileEntryRef &LHS, const FileEntryRef &RHS) {
101 friend bool operator!=(const FileEntry *LHS, const FileEntryRef &RHS) {
104 friend bool operator!=(const FileEntryRef &LHS, const FileEntry *RHS) {
110 friend llvm::hash_code hash_value(FileEntryRef Ref) {
123 /// VFSs that use external names. In that case, the \c FileEntryRef
137 bool isSameRef(const FileEntryRef &RHS) const { return ME == RHS.ME; }
139 /// Allow FileEntryRef to degrade into 'const FileEntry*' to facilitate
154 /// FIXME: Once FileEntryRef is "everywhere" and FileEntry::LastRef and
158 FileEntryRef() = delete;
159 explicit FileEntryRef(const MapEntry &ME) : ME(&ME) {
166 const clang::FileEntryRef::MapEntry &getMapEntry() const { return *ME; }
177 friend class FileMgr::MapEntryOptionalStorage<FileEntryRef>;
181 FileEntryRef(optional_none_tag) : ME(nullptr) {}
184 friend struct llvm::DenseMapInfo<FileEntryRef>;
189 FileEntryRef(dense_map_empty_tag)
191 FileEntryRef(dense_map_tombstone_tag)
194 return isSameRef(FileEntryRef(dense_map_empty_tag())) ||
195 isSameRef(FileEntryRef(dense_map_tombstone_tag()));
201 static_assert(sizeof(FileEntryRef) == sizeof(const FileEntry *),
202 "FileEntryRef must avoid size overhead");
204 static_assert(std::is_trivially_copyable<FileEntryRef>::value,
205 "FileEntryRef must be trivially copyable");
207 using OptionalFileEntryRef = CustomizableOptional<FileEntryRef>;
211 /// Customize OptionalStorage<FileEntryRef> to use FileEntryRef and its
214 class OptionalStorage<clang::FileEntryRef>
215 : public clang::FileMgr::MapEntryOptionalStorage<clang::FileEntryRef> {
217 clang::FileMgr::MapEntryOptionalStorage<clang::FileEntryRef>;
226 OptionalStorage &operator=(clang::FileEntryRef Ref) {
232 static_assert(sizeof(OptionalFileEntryRef) == sizeof(FileEntryRef),
243 /// Specialisation of DenseMapInfo for FileEntryRef.
244 template <> struct DenseMapInfo<clang::FileEntryRef> {
245 static inline clang::FileEntryRef getEmptyKey() {
246 return clang::FileEntryRef(clang::FileEntryRef::dense_map_empty_tag());
249 static inline clang::FileEntryRef getTombstoneKey() {
250 return clang::FileEntryRef(clang::FileEntryRef::dense_map_tombstone_tag());
253 static unsigned getHashValue(clang::FileEntryRef Val) {
257 static bool isEqual(clang::FileEntryRef LHS, clang::FileEntryRef RHS) {
270 /// Support for finding `const FileEntry *` in a `DenseMap<FileEntryRef, T>`.
275 static bool isEqual(const clang::FileEntry *LHS, clang::FileEntryRef RHS) {
347 off_t FileEntryRef::getSize() const { return getFileEntry().getSize(); }
349 unsigned FileEntryRef::getUID() const { return getFileEntry().getUID(); }
351 const llvm::sys::fs::UniqueID &FileEntryRef::getUniqueID() const {
355 time_t FileEntryRef::getModificationTime() const {
359 bool FileEntryRef::isNamedPipe() const { return getFileEntry().isNamedPipe(); }
361 void FileEntryRef::closeFile() const { getFileEntry().closeFile(); }
363 void FileEntryRef::updateFileEntryBufferSize(unsigned BufferSize) {