clang 19.0.0git
HeaderSearch.h
Go to the documentation of this file.
1//===- HeaderSearch.h - Resolve Header File Locations -----------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the HeaderSearch interface.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LEX_HEADERSEARCH_H
14#define LLVM_CLANG_LEX_HEADERSEARCH_H
15
19#include "clang/Lex/HeaderMap.h"
20#include "clang/Lex/ModuleMap.h"
21#include "llvm/ADT/ArrayRef.h"
22#include "llvm/ADT/DenseMap.h"
23#include "llvm/ADT/SmallString.h"
24#include "llvm/ADT/StringMap.h"
25#include "llvm/ADT/StringRef.h"
26#include "llvm/ADT/StringSet.h"
27#include "llvm/Support/Allocator.h"
28#include <cassert>
29#include <cstddef>
30#include <memory>
31#include <string>
32#include <utility>
33#include <vector>
34
35namespace llvm {
36
37class Triple;
38
39} // namespace llvm
40
41namespace clang {
42
43class DiagnosticsEngine;
44class DirectoryEntry;
45class ExternalPreprocessorSource;
46class FileEntry;
47class FileManager;
48class HeaderSearch;
49class HeaderSearchOptions;
50class IdentifierInfo;
51class LangOptions;
52class Module;
53class Preprocessor;
54class TargetInfo;
55
56/// The preprocessor keeps track of this information for each
57/// file that is \#included.
59 // TODO: Whether the file was imported is not a property of the file itself.
60 // It's a preprocessor state, move it there.
61 /// True if this is a \#import'd file.
62 LLVM_PREFERRED_TYPE(bool)
64
65 /// True if this is a \#pragma once file.
66 LLVM_PREFERRED_TYPE(bool)
67 unsigned isPragmaOnce : 1;
68
69 /// Keep track of whether this is a system header, and if so,
70 /// whether it is C++ clean or not. This can be set by the include paths or
71 /// by \#pragma gcc system_header. This is an instance of
72 /// SrcMgr::CharacteristicKind.
73 LLVM_PREFERRED_TYPE(SrcMgr::CharacteristicKind)
74 unsigned DirInfo : 3;
75
76 /// Whether this header file info was supplied by an external source,
77 /// and has not changed since.
78 LLVM_PREFERRED_TYPE(bool)
79 unsigned External : 1;
80
81 /// Whether this header is part of a module.
82 LLVM_PREFERRED_TYPE(bool)
83 unsigned isModuleHeader : 1;
84
85 /// Whether this header is part of the module that we are building.
86 LLVM_PREFERRED_TYPE(bool)
88
89 /// Whether this structure is considered to already have been
90 /// "resolved", meaning that it was loaded from the external source.
91 LLVM_PREFERRED_TYPE(bool)
92 unsigned Resolved : 1;
93
94 /// Whether this is a header inside a framework that is currently
95 /// being built.
96 ///
97 /// When a framework is being built, the headers have not yet been placed
98 /// into the appropriate framework subdirectories, and therefore are
99 /// provided via a header map. This bit indicates when this is one of
100 /// those framework headers.
101 LLVM_PREFERRED_TYPE(bool)
103
104 /// Whether this file has been looked up as a header.
105 LLVM_PREFERRED_TYPE(bool)
106 unsigned IsValid : 1;
107
108 /// The ID number of the controlling macro.
109 ///
110 /// This ID number will be non-zero when there is a controlling
111 /// macro whose IdentifierInfo may not yet have been loaded from
112 /// external storage.
113 unsigned ControllingMacroID = 0;
114
115 /// If this file has a \#ifndef XXX (or equivalent) guard that
116 /// protects the entire contents of the file, this is the identifier
117 /// for the macro that controls whether or not it has any effect.
118 ///
119 /// Note: Most clients should use getControllingMacro() to access
120 /// the controlling macro of this header, since
121 /// getControllingMacro() is able to load a controlling macro from
122 /// external storage.
124
125 /// If this header came from a framework include, this is the name
126 /// of the framework.
127 StringRef Framework;
128
130 : isImport(false), isPragmaOnce(false), DirInfo(SrcMgr::C_User),
133
134 /// Retrieve the controlling macro for this header file, if
135 /// any.
136 const IdentifierInfo *
138};
139
140/// An external source of header file information, which may supply
141/// information about header files already included.
143public:
145
146 /// Retrieve the header file information for the given file entry.
147 ///
148 /// \returns Header file information for the given file entry, with the
149 /// \c External bit set. If the file entry is not known, return a
150 /// default-constructed \c HeaderFileInfo.
152};
153
154/// This structure is used to record entries in our framework cache.
156 /// The directory entry which should be used for the cached framework.
158
159 /// Whether this framework has been "user-specified" to be treated as if it
160 /// were a system framework (even if it was found outside a system framework
161 /// directory).
163};
164
165namespace detail {
166template <bool Const, typename T>
167using Qualified = std::conditional_t<Const, const T, T>;
168
169/// Forward iterator over the search directories of \c HeaderSearch.
170template <bool IsConst>
172 : llvm::iterator_facade_base<SearchDirIteratorImpl<IsConst>,
173 std::forward_iterator_tag,
174 Qualified<IsConst, DirectoryLookup>> {
175 /// Const -> non-const iterator conversion.
176 template <typename Enable = std::enable_if<IsConst, bool>>
178 : HS(Other.HS), Idx(Other.Idx) {}
179
181
183
184 bool operator==(const SearchDirIteratorImpl &RHS) const {
185 return HS == RHS.HS && Idx == RHS.Idx;
186 }
187
189 assert(*this && "Invalid iterator.");
190 ++Idx;
191 return *this;
192 }
193
195 assert(*this && "Invalid iterator.");
196 return HS->SearchDirs[Idx];
197 }
198
199 /// Creates an invalid iterator.
200 SearchDirIteratorImpl(std::nullptr_t) : HS(nullptr), Idx(0) {}
201
202 /// Checks whether the iterator is valid.
203 explicit operator bool() const { return HS != nullptr; }
204
205private:
206 /// The parent \c HeaderSearch. This is \c nullptr for invalid iterator.
208
209 /// The index of the current element.
210 size_t Idx;
211
212 /// The constructor that creates a valid iterator.
214 : HS(&HS), Idx(Idx) {}
215
216 /// Only HeaderSearch is allowed to instantiate valid iterators.
217 friend HeaderSearch;
218
219 /// Enables const -> non-const conversion.
220 friend SearchDirIteratorImpl<!IsConst>;
221};
222} // namespace detail
223
226
227using ConstSearchDirRange = llvm::iterator_range<ConstSearchDirIterator>;
228using SearchDirRange = llvm::iterator_range<SearchDirIterator>;
229
230/// Encapsulates the information needed to find the file referenced
231/// by a \#include or \#include_next, (sub-)framework lookup, etc.
233 friend class DirectoryLookup;
234
236 friend SearchDirIterator;
237
238 /// Header-search options used to initialize this header search.
239 std::shared_ptr<HeaderSearchOptions> HSOpts;
240
241 /// Mapping from SearchDir to HeaderSearchOptions::UserEntries indices.
242 llvm::DenseMap<unsigned, unsigned> SearchDirToHSEntry;
243
244 DiagnosticsEngine &Diags;
245 FileManager &FileMgr;
246
247 /// \#include search path information. Requests for \#include "x" search the
248 /// directory of the \#including file first, then each directory in SearchDirs
249 /// consecutively. Requests for <x> search the current dir first, then each
250 /// directory in SearchDirs, starting at AngledDirIdx, consecutively.
251 std::vector<DirectoryLookup> SearchDirs;
252 /// Whether the DirectoryLookup at the corresponding index in SearchDirs has
253 /// been successfully used to lookup a file.
254 std::vector<bool> SearchDirsUsage;
255 unsigned AngledDirIdx = 0;
256 unsigned SystemDirIdx = 0;
257
258 /// Maps HeaderMap keys to SearchDir indices. When HeaderMaps are used
259 /// heavily, SearchDirs can start with thousands of HeaderMaps, so this Index
260 /// lets us avoid scanning them all to find a match.
261 llvm::StringMap<unsigned, llvm::BumpPtrAllocator> SearchDirHeaderMapIndex;
262
263 /// The index of the first SearchDir that isn't a header map.
264 unsigned FirstNonHeaderMapSearchDirIdx = 0;
265
266 /// \#include prefixes for which the 'system header' property is
267 /// overridden.
268 ///
269 /// For a \#include "x" or \#include <x> directive, the last string in this
270 /// list which is a prefix of 'x' determines whether the file is treated as
271 /// a system header.
272 std::vector<std::pair<std::string, bool>> SystemHeaderPrefixes;
273
274 /// The hash used for module cache paths.
275 std::string ModuleHash;
276
277 /// The path to the module cache.
278 std::string ModuleCachePath;
279
280 /// All of the preprocessor-specific data about files that are
281 /// included, indexed by the FileEntry's UID.
282 mutable std::vector<HeaderFileInfo> FileInfo;
283
284 /// Keeps track of each lookup performed by LookupFile.
285 struct LookupFileCacheInfo {
286 // The requesting module for the lookup we cached.
287 const Module *RequestingModule = nullptr;
288
289 /// Starting search directory iterator that the cached search was performed
290 /// from. If there is a hit and this value doesn't match the current query,
291 /// the cache has to be ignored.
292 ConstSearchDirIterator StartIt = nullptr;
293
294 /// The search directory iterator that satisfied the query.
295 ConstSearchDirIterator HitIt = nullptr;
296
297 /// This is non-null if the original filename was mapped to a framework
298 /// include via a headermap.
299 const char *MappedName = nullptr;
300
301 /// Default constructor -- Initialize all members with zero.
302 LookupFileCacheInfo() = default;
303
304 void reset(const Module *NewRequestingModule,
305 ConstSearchDirIterator NewStartIt) {
306 RequestingModule = NewRequestingModule;
307 StartIt = NewStartIt;
308 MappedName = nullptr;
309 }
310 };
311 llvm::StringMap<LookupFileCacheInfo, llvm::BumpPtrAllocator> LookupFileCache;
312
313 /// Collection mapping a framework or subframework
314 /// name like "Carbon" to the Carbon.framework directory.
315 llvm::StringMap<FrameworkCacheEntry, llvm::BumpPtrAllocator> FrameworkMap;
316
317 /// Maps include file names (including the quotes or
318 /// angle brackets) to other include file names. This is used to support the
319 /// include_alias pragma for Microsoft compatibility.
320 using IncludeAliasMap =
321 llvm::StringMap<std::string, llvm::BumpPtrAllocator>;
322 std::unique_ptr<IncludeAliasMap> IncludeAliases;
323
324 /// This is a mapping from FileEntry -> HeaderMap, uniquing headermaps.
325 std::vector<std::pair<FileEntryRef, std::unique_ptr<HeaderMap>>> HeaderMaps;
326
327 /// The mapping between modules and headers.
328 mutable ModuleMap ModMap;
329
330 /// Describes whether a given directory has a module map in it.
331 llvm::DenseMap<const DirectoryEntry *, bool> DirectoryHasModuleMap;
332
333 /// Set of module map files we've already loaded, and a flag indicating
334 /// whether they were valid or not.
335 llvm::DenseMap<const FileEntry *, bool> LoadedModuleMaps;
336
337 // A map of discovered headers with their associated include file name.
338 llvm::DenseMap<const FileEntry *, llvm::SmallString<64>> IncludeNames;
339
340 /// Uniqued set of framework names, which is used to track which
341 /// headers were included as framework headers.
342 llvm::StringSet<llvm::BumpPtrAllocator> FrameworkNames;
343
344 /// Entity used to resolve the identifier IDs of controlling
345 /// macros into IdentifierInfo pointers, and keep the identifire up to date,
346 /// as needed.
347 ExternalPreprocessorSource *ExternalLookup = nullptr;
348
349 /// Entity used to look up stored header file information.
350 ExternalHeaderFileInfoSource *ExternalSource = nullptr;
351
352 /// Scan all of the header maps at the beginning of SearchDirs and
353 /// map their keys to the SearchDir index of their header map.
354 void indexInitialHeaderMaps();
355
356public:
357 HeaderSearch(std::shared_ptr<HeaderSearchOptions> HSOpts,
358 SourceManager &SourceMgr, DiagnosticsEngine &Diags,
359 const LangOptions &LangOpts, const TargetInfo *Target);
360 HeaderSearch(const HeaderSearch &) = delete;
362
363 /// Retrieve the header-search options with which this header search
364 /// was initialized.
365 HeaderSearchOptions &getHeaderSearchOpts() const { return *HSOpts; }
366
367 FileManager &getFileMgr() const { return FileMgr; }
368
369 DiagnosticsEngine &getDiags() const { return Diags; }
370
371 /// Interface for setting the file search paths.
372 void SetSearchPaths(std::vector<DirectoryLookup> dirs, unsigned angledDirIdx,
373 unsigned systemDirIdx,
374 llvm::DenseMap<unsigned, unsigned> searchDirToHSEntry);
375
376 /// Add an additional search path.
377 void AddSearchPath(const DirectoryLookup &dir, bool isAngled);
378
379 /// Add an additional system search path.
381 SearchDirs.push_back(dir);
382 SearchDirsUsage.push_back(false);
383 }
384
385 /// Set the list of system header prefixes.
386 void SetSystemHeaderPrefixes(ArrayRef<std::pair<std::string, bool>> P) {
387 SystemHeaderPrefixes.assign(P.begin(), P.end());
388 }
389
390 /// Checks whether the map exists or not.
391 bool HasIncludeAliasMap() const { return (bool)IncludeAliases; }
392
393 /// Map the source include name to the dest include name.
394 ///
395 /// The Source should include the angle brackets or quotes, the dest
396 /// should not. This allows for distinction between <> and "" headers.
397 void AddIncludeAlias(StringRef Source, StringRef Dest) {
398 if (!IncludeAliases)
399 IncludeAliases.reset(new IncludeAliasMap);
400 (*IncludeAliases)[Source] = std::string(Dest);
401 }
402
403 /// Maps one header file name to a different header
404 /// file name, for use with the include_alias pragma. Note that the source
405 /// file name should include the angle brackets or quotes. Returns StringRef
406 /// as null if the header cannot be mapped.
407 StringRef MapHeaderToIncludeAlias(StringRef Source) {
408 assert(IncludeAliases && "Trying to map headers when there's no map");
409
410 // Do any filename replacements before anything else
411 IncludeAliasMap::const_iterator Iter = IncludeAliases->find(Source);
412 if (Iter != IncludeAliases->end())
413 return Iter->second;
414 return {};
415 }
416
417 /// Set the hash to use for module cache paths.
418 void setModuleHash(StringRef Hash) { ModuleHash = std::string(Hash); }
419
420 /// Set the path to the module cache.
421 void setModuleCachePath(StringRef CachePath) {
422 ModuleCachePath = std::string(CachePath);
423 }
424
425 /// Retrieve the module hash.
426 StringRef getModuleHash() const { return ModuleHash; }
427
428 /// Retrieve the path to the module cache.
429 StringRef getModuleCachePath() const { return ModuleCachePath; }
430
431 /// Consider modules when including files from this directory.
433 DirectoryHasModuleMap[Dir] = true;
434 }
435
436 /// Forget everything we know about headers so far.
438 FileInfo.clear();
439 }
440
442 ExternalLookup = EPS;
443 }
444
446 return ExternalLookup;
447 }
448
449 /// Set the external source of header information.
451 ExternalSource = ES;
452 }
453
454 /// Set the target information for the header search, if not
455 /// already known.
456 void setTarget(const TargetInfo &Target);
457
458 /// Given a "foo" or <foo> reference, look up the indicated file,
459 /// return null on failure.
460 ///
461 /// \returns If successful, this returns 'UsedDir', the DirectoryLookup member
462 /// the file was found in, or null if not applicable.
463 ///
464 /// \param IncludeLoc Used for diagnostics if valid.
465 ///
466 /// \param isAngled indicates whether the file reference is a <> reference.
467 ///
468 /// \param CurDir If non-null, the file was found in the specified directory
469 /// search location. This is used to implement \#include_next.
470 ///
471 /// \param Includers Indicates where the \#including file(s) are, in case
472 /// relative searches are needed. In reverse order of inclusion.
473 ///
474 /// \param SearchPath If non-null, will be set to the search path relative
475 /// to which the file was found. If the include path is absolute, SearchPath
476 /// will be set to an empty string.
477 ///
478 /// \param RelativePath If non-null, will be set to the path relative to
479 /// SearchPath at which the file was found. This only differs from the
480 /// Filename for framework includes.
481 ///
482 /// \param SuggestedModule If non-null, and the file found is semantically
483 /// part of a known module, this will be set to the module that should
484 /// be imported instead of preprocessing/parsing the file found.
485 ///
486 /// \param IsMapped If non-null, and the search involved header maps, set to
487 /// true.
488 ///
489 /// \param IsFrameworkFound If non-null, will be set to true if a framework is
490 /// found in any of searched SearchDirs. Will be set to false if a framework
491 /// is found only through header maps. Doesn't guarantee the requested file is
492 /// found.
494 StringRef Filename, SourceLocation IncludeLoc, bool isAngled,
496 ArrayRef<std::pair<OptionalFileEntryRef, DirectoryEntryRef>> Includers,
497 SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath,
498 Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule,
499 bool *IsMapped, bool *IsFrameworkFound, bool SkipCache = false,
500 bool BuildSystemModule = false, bool OpenFile = true,
501 bool CacheFailures = true);
502
503 /// Look up a subframework for the specified \#include file.
504 ///
505 /// For example, if \#include'ing <HIToolbox/HIToolbox.h> from
506 /// within ".../Carbon.framework/Headers/Carbon.h", check to see if
507 /// HIToolbox is a subframework within Carbon.framework. If so, return
508 /// the FileEntry for the designated file, otherwise return null.
510 StringRef Filename, FileEntryRef ContextFileEnt,
511 SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath,
512 Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule);
513
514 /// Look up the specified framework name in our framework cache.
515 /// \returns The DirectoryEntry it is in if we know, null otherwise.
517 return FrameworkMap[FWName];
518 }
519
520 /// Mark the specified file as a target of a \#include,
521 /// \#include_next, or \#import directive.
522 ///
523 /// \return false if \#including the file will have no effect or true
524 /// if we should include it.
526 bool isImport, bool ModulesEnabled, Module *M,
527 bool &IsFirstIncludeOfFile);
528
529 /// Return whether the specified file is a normal header,
530 /// a system header, or a C++ friendly system header.
533 }
534
535 /// Mark the specified file as a "once only" file due to
536 /// \#pragma once.
539 FI.isPragmaOnce = true;
540 }
541
542 /// Mark the specified file as a system header, e.g. due to
543 /// \#pragma GCC system_header.
546 }
547
548 /// Mark the specified file as part of a module.
550 bool isCompilingModuleHeader);
551
552 /// Mark the specified file as having a controlling macro.
553 ///
554 /// This is used by the multiple-include optimization to eliminate
555 /// no-op \#includes.
557 const IdentifierInfo *ControllingMacro) {
558 getFileInfo(File).ControllingMacro = ControllingMacro;
559 }
560
561 /// Determine whether this file is intended to be safe from
562 /// multiple inclusions, e.g., it has \#pragma once or a controlling
563 /// macro.
564 ///
565 /// This routine does not consider the effect of \#import
567
568 /// Determine whether the given file is known to have ever been \#imported.
571 return FI && FI->isImport;
572 }
573
574 /// Determine which HeaderSearchOptions::UserEntries have been successfully
575 /// used so far and mark their index with 'true' in the resulting bit vector.
576 /// Note: implicit module maps don't contribute to entry usage.
577 std::vector<bool> computeUserEntryUsage() const;
578
579 /// Collect which HeaderSearchOptions::VFSOverlayFiles have been meaningfully
580 /// used so far and mark their index with 'true' in the resulting bit vector.
581 ///
582 /// Note: this ignores VFSs that redirect non-affecting files such as unused
583 /// modulemaps.
584 std::vector<bool> collectVFSUsageAndClear() const;
585
586 /// This method returns a HeaderMap for the specified
587 /// FileEntry, uniquing them through the 'HeaderMaps' datastructure.
589
590 /// Get filenames for all registered header maps.
592
593 /// Retrieve the name of the cached module file that should be used
594 /// to load the given module.
595 ///
596 /// \param Module The module whose module file name will be returned.
597 ///
598 /// \returns The name of the module file that corresponds to this module,
599 /// or an empty string if this module does not correspond to any module file.
601
602 /// Retrieve the name of the prebuilt module file that should be used
603 /// to load a module with the given name.
604 ///
605 /// \param ModuleName The module whose module file name will be returned.
606 ///
607 /// \param FileMapOnly If true, then only look in the explicit module name
608 // to file name map and skip the directory search.
609 ///
610 /// \returns The name of the module file that corresponds to this module,
611 /// or an empty string if this module does not correspond to any module file.
612 std::string getPrebuiltModuleFileName(StringRef ModuleName,
613 bool FileMapOnly = false);
614
615 /// Retrieve the name of the prebuilt module file that should be used
616 /// to load the given module.
617 ///
618 /// \param Module The module whose module file name will be returned.
619 ///
620 /// \returns The name of the module file that corresponds to this module,
621 /// or an empty string if this module does not correspond to any module file.
623
624 /// Retrieve the name of the (to-be-)cached module file that should
625 /// be used to load a module with the given name.
626 ///
627 /// \param ModuleName The module whose module file name will be returned.
628 ///
629 /// \param ModuleMapPath A path that when combined with \c ModuleName
630 /// uniquely identifies this module. See Module::ModuleMap.
631 ///
632 /// \returns The name of the module file that corresponds to this module,
633 /// or an empty string if this module does not correspond to any module file.
634 std::string getCachedModuleFileName(StringRef ModuleName,
635 StringRef ModuleMapPath);
636
637 /// Lookup a module Search for a module with the given name.
638 ///
639 /// \param ModuleName The name of the module we're looking for.
640 ///
641 /// \param ImportLoc Location of the module include/import.
642 ///
643 /// \param AllowSearch Whether we are allowed to search in the various
644 /// search directories to produce a module definition. If not, this lookup
645 /// will only return an already-known module.
646 ///
647 /// \param AllowExtraModuleMapSearch Whether we allow to search modulemaps
648 /// in subdirectories.
649 ///
650 /// \returns The module with the given name.
651 Module *lookupModule(StringRef ModuleName,
652 SourceLocation ImportLoc = SourceLocation(),
653 bool AllowSearch = true,
654 bool AllowExtraModuleMapSearch = false);
655
656 /// Try to find a module map file in the given directory, returning
657 /// \c nullopt if none is found.
659 bool IsFramework);
660
661 /// Determine whether there is a module map that may map the header
662 /// with the given file name to a (sub)module.
663 /// Always returns false if modules are disabled.
664 ///
665 /// \param Filename The name of the file.
666 ///
667 /// \param Root The "root" directory, at which we should stop looking for
668 /// module maps.
669 ///
670 /// \param IsSystem Whether the directories we're looking at are system
671 /// header directories.
672 bool hasModuleMap(StringRef Filename, const DirectoryEntry *Root,
673 bool IsSystem);
674
675 /// Retrieve the module that corresponds to the given file, if any.
676 ///
677 /// \param File The header that we wish to map to a module.
678 /// \param AllowTextual Whether we want to find textual headers too.
680 bool AllowTextual = false,
681 bool AllowExcluded = false) const;
682
683 /// Retrieve all the modules corresponding to the given file.
684 ///
685 /// \ref findModuleForHeader should typically be used instead of this.
688
689 /// Like \ref findAllModulesForHeader, but do not attempt to infer module
690 /// ownership from umbrella headers if we've not already done so.
693
694 /// Read the contents of the given module map file.
695 ///
696 /// \param File The module map file.
697 /// \param IsSystem Whether this file is in a system header directory.
698 /// \param ID If the module map file is already mapped (perhaps as part of
699 /// processing a preprocessed module), the ID of the file.
700 /// \param Offset [inout] An offset within ID to start parsing. On exit,
701 /// filled by the end of the parsed contents (either EOF or the
702 /// location of an end-of-module-map pragma).
703 /// \param OriginalModuleMapFile The original path to the module map file,
704 /// used to resolve paths within the module (this is required when
705 /// building the module from preprocessed source).
706 /// \returns true if an error occurred, false otherwise.
707 bool loadModuleMapFile(FileEntryRef File, bool IsSystem, FileID ID = FileID(),
708 unsigned *Offset = nullptr,
709 StringRef OriginalModuleMapFile = StringRef());
710
711 /// Collect the set of all known, top-level modules.
712 ///
713 /// \param Modules Will be filled with the set of known, top-level modules.
715
716 /// Load all known, top-level system modules.
718
719private:
720 /// Lookup a module with the given module name and search-name.
721 ///
722 /// \param ModuleName The name of the module we're looking for.
723 ///
724 /// \param SearchName The "search-name" to derive filesystem paths from
725 /// when looking for the module map; this is usually equal to ModuleName,
726 /// but for compatibility with some buggy frameworks, additional attempts
727 /// may be made to find the module under a related-but-different search-name.
728 ///
729 /// \param ImportLoc Location of the module include/import.
730 ///
731 /// \param AllowExtraModuleMapSearch Whether we allow to search modulemaps
732 /// in subdirectories.
733 ///
734 /// \returns The module named ModuleName.
735 Module *lookupModule(StringRef ModuleName, StringRef SearchName,
736 SourceLocation ImportLoc,
737 bool AllowExtraModuleMapSearch = false);
738
739 /// Retrieve the name of the (to-be-)cached module file that should
740 /// be used to load a module with the given name.
741 ///
742 /// \param ModuleName The module whose module file name will be returned.
743 ///
744 /// \param ModuleMapPath A path that when combined with \c ModuleName
745 /// uniquely identifies this module. See Module::ModuleMap.
746 ///
747 /// \param CachePath A path to the module cache.
748 ///
749 /// \returns The name of the module file that corresponds to this module,
750 /// or an empty string if this module does not correspond to any module file.
751 std::string getCachedModuleFileNameImpl(StringRef ModuleName,
752 StringRef ModuleMapPath,
753 StringRef CachePath);
754
755 /// Retrieve a module with the given name, which may be part of the
756 /// given framework.
757 ///
758 /// \param Name The name of the module to retrieve.
759 ///
760 /// \param Dir The framework directory (e.g., ModuleName.framework).
761 ///
762 /// \param IsSystem Whether the framework directory is part of the system
763 /// frameworks.
764 ///
765 /// \returns The module, if found; otherwise, null.
766 Module *loadFrameworkModule(StringRef Name, DirectoryEntryRef Dir,
767 bool IsSystem);
768
769 /// Load all of the module maps within the immediate subdirectories
770 /// of the given search directory.
771 void loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir);
772
773 /// Find and suggest a usable module for the given file.
774 ///
775 /// \return \c true if the file can be used, \c false if we are not permitted to
776 /// find this file due to requirements from \p RequestingModule.
777 bool findUsableModuleForHeader(FileEntryRef File, const DirectoryEntry *Root,
778 Module *RequestingModule,
779 ModuleMap::KnownHeader *SuggestedModule,
780 bool IsSystemHeaderDir);
781
782 /// Find and suggest a usable module for the given file, which is part of
783 /// the specified framework.
784 ///
785 /// \return \c true if the file can be used, \c false if we are not permitted to
786 /// find this file due to requirements from \p RequestingModule.
787 bool findUsableModuleForFrameworkHeader(
788 FileEntryRef File, StringRef FrameworkName, Module *RequestingModule,
789 ModuleMap::KnownHeader *SuggestedModule, bool IsSystemFramework);
790
791 /// Look up the file with the specified name and determine its owning
792 /// module.
794 getFileAndSuggestModule(StringRef FileName, SourceLocation IncludeLoc,
795 const DirectoryEntry *Dir, bool IsSystemHeaderDir,
796 Module *RequestingModule,
797 ModuleMap::KnownHeader *SuggestedModule,
798 bool OpenFile = true, bool CacheFailures = true);
799
800 /// Cache the result of a successful lookup at the given include location
801 /// using the search path at \c HitIt.
802 void cacheLookupSuccess(LookupFileCacheInfo &CacheLookup,
804 SourceLocation IncludeLoc);
805
806 /// Note that a lookup at the given include location was successful using the
807 /// search path at index `HitIdx`.
808 void noteLookupUsage(unsigned HitIdx, SourceLocation IncludeLoc);
809
810public:
811 /// Retrieve the module map.
812 ModuleMap &getModuleMap() { return ModMap; }
813
814 /// Retrieve the module map.
815 const ModuleMap &getModuleMap() const { return ModMap; }
816
817 unsigned header_file_size() const { return FileInfo.size(); }
818
819 /// Return the HeaderFileInfo structure for the specified FileEntry,
820 /// in preparation for updating it in some way.
822
823 /// Return the HeaderFileInfo structure for the specified FileEntry,
824 /// if it has ever been filled in.
825 /// \param WantExternal Whether the caller wants purely-external header file
826 /// info (where \p External is true).
828 bool WantExternal = true) const;
829
830 SearchDirIterator search_dir_begin() { return {*this, 0}; }
831 SearchDirIterator search_dir_end() { return {*this, SearchDirs.size()}; }
833 return {search_dir_begin(), search_dir_end()};
834 }
835
838 assert(n < SearchDirs.size());
839 return {*this, n};
840 }
843 return {search_dir_begin(), search_dir_end()};
844 }
845
846 unsigned search_dir_size() const { return SearchDirs.size(); }
847
848 ConstSearchDirIterator quoted_dir_begin() const { return {*this, 0}; }
850
852 return {*this, AngledDirIdx};
853 }
855
857 return {*this, SystemDirIdx};
858 }
860 return {*this, SearchDirs.size()};
861 }
862
863 /// Get the index of the given search directory.
864 unsigned searchDirIdx(const DirectoryLookup &DL) const;
865
866 /// Retrieve a uniqued framework name.
867 StringRef getUniqueFrameworkName(StringRef Framework);
868
869 /// Retrieve the include name for the header.
870 ///
871 /// \param File The entry for a given header.
872 /// \returns The name of how the file was included when the header's location
873 /// was resolved.
874 StringRef getIncludeNameForHeader(const FileEntry *File) const;
875
876 /// Suggest a path by which the specified file could be found, for use in
877 /// diagnostics to suggest a #include. Returned path will only contain forward
878 /// slashes as separators. MainFile is the absolute path of the file that we
879 /// are generating the diagnostics for. It will try to shorten the path using
880 /// MainFile location, if none of the include search directories were prefix
881 /// of File.
882 ///
883 /// \param IsAngled If non-null, filled in to indicate whether the suggested
884 /// path should be referenced as <Header.h> instead of "Header.h".
886 llvm::StringRef MainFile,
887 bool *IsAngled = nullptr) const;
888
889 /// Suggest a path by which the specified file could be found, for use in
890 /// diagnostics to suggest a #include. Returned path will only contain forward
891 /// slashes as separators. MainFile is the absolute path of the file that we
892 /// are generating the diagnostics for. It will try to shorten the path using
893 /// MainFile location, if none of the include search directories were prefix
894 /// of File.
895 ///
896 /// \param WorkingDir If non-empty, this will be prepended to search directory
897 /// paths that are relative.
898 std::string suggestPathToFileForDiagnostics(llvm::StringRef File,
899 llvm::StringRef WorkingDir,
900 llvm::StringRef MainFile,
901 bool *IsAngled = nullptr) const;
902
903 void PrintStats();
904
905 size_t getTotalMemory() const;
906
907private:
908 /// Describes what happened when we tried to load a module map file.
909 enum LoadModuleMapResult {
910 /// The module map file had already been loaded.
911 LMM_AlreadyLoaded,
912
913 /// The module map file was loaded by this invocation.
914 LMM_NewlyLoaded,
915
916 /// There is was directory with the given name.
917 LMM_NoDirectory,
918
919 /// There was either no module map file or the module map file was
920 /// invalid.
921 LMM_InvalidModuleMap
922 };
923
924 LoadModuleMapResult loadModuleMapFileImpl(FileEntryRef File, bool IsSystem,
925 DirectoryEntryRef Dir,
926 FileID ID = FileID(),
927 unsigned *Offset = nullptr);
928
929 /// Try to load the module map file in the given directory.
930 ///
931 /// \param DirName The name of the directory where we will look for a module
932 /// map file.
933 /// \param IsSystem Whether this is a system header directory.
934 /// \param IsFramework Whether this is a framework directory.
935 ///
936 /// \returns The result of attempting to load the module map file from the
937 /// named directory.
938 LoadModuleMapResult loadModuleMapFile(StringRef DirName, bool IsSystem,
939 bool IsFramework);
940
941 /// Try to load the module map file in the given directory.
942 ///
943 /// \param Dir The directory where we will look for a module map file.
944 /// \param IsSystem Whether this is a system header directory.
945 /// \param IsFramework Whether this is a framework directory.
946 ///
947 /// \returns The result of attempting to load the module map file from the
948 /// named directory.
949 LoadModuleMapResult loadModuleMapFile(DirectoryEntryRef Dir, bool IsSystem,
950 bool IsFramework);
951};
952
953/// Apply the header search options to get given HeaderSearch object.
954void ApplyHeaderSearchOptions(HeaderSearch &HS,
955 const HeaderSearchOptions &HSOpts,
956 const LangOptions &Lang,
957 const llvm::Triple &triple);
958
959} // namespace clang
960
961#endif // LLVM_CLANG_LEX_HEADERSEARCH_H
StringRef P
static char ID
Definition: Arena.cpp:183
StringRef Filename
Definition: Format.cpp:2952
unsigned Iter
Definition: HTMLLogger.cpp:154
llvm::MachO::Target Target
Definition: MachO.h:40
Defines the clang::SourceLocation class and associated facilities.
Defines the SourceManager interface.
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:192
A reference to a DirectoryEntry that includes the name of the directory as it was accessed by the Fil...
Cached information about one directory (either on disk or in the virtual file system).
DirectoryLookup - This class represents one entry in the search list that specifies the search order ...
An external source of header file information, which may supply information about header files alread...
Definition: HeaderSearch.h:142
virtual HeaderFileInfo GetHeaderFileInfo(FileEntryRef FE)=0
Retrieve the header file information for the given file entry.
Abstract interface for external sources of preprocessor information.
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
Definition: FileEntry.h:57
Cached information about one file (either on disk or in the virtual file system).
Definition: FileEntry.h:300
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Implements support for file system lookup, file system caching, and directory search management.
Definition: FileManager.h:53
This class represents an Apple concept known as a 'header map'.
Definition: HeaderMap.h:84
HeaderSearchOptions - Helper class for storing options related to the initialization of the HeaderSea...
Encapsulates the information needed to find the file referenced by a #include or #include_next,...
Definition: HeaderSearch.h:232
StringRef getUniqueFrameworkName(StringRef Framework)
Retrieve a uniqued framework name.
void setDirectoryHasModuleMap(const DirectoryEntry *Dir)
Consider modules when including files from this directory.
Definition: HeaderSearch.h:432
void SetExternalSource(ExternalHeaderFileInfoSource *ES)
Set the external source of header information.
Definition: HeaderSearch.h:450
HeaderSearch & operator=(const HeaderSearch &)=delete
unsigned search_dir_size() const
Definition: HeaderSearch.h:846
std::vector< bool > collectVFSUsageAndClear() const
Collect which HeaderSearchOptions::VFSOverlayFiles have been meaningfully used so far and mark their ...
SrcMgr::CharacteristicKind getFileDirFlavor(FileEntryRef File)
Return whether the specified file is a normal header, a system header, or a C++ friendly system heade...
Definition: HeaderSearch.h:531
FileManager & getFileMgr() const
Definition: HeaderSearch.h:367
const HeaderFileInfo * getExistingFileInfo(FileEntryRef FE, bool WantExternal=true) const
Return the HeaderFileInfo structure for the specified FileEntry, if it has ever been filled in.
void AddSearchPath(const DirectoryLookup &dir, bool isAngled)
Add an additional search path.
ConstSearchDirIterator angled_dir_end() const
Definition: HeaderSearch.h:854
Module * lookupModule(StringRef ModuleName, SourceLocation ImportLoc=SourceLocation(), bool AllowSearch=true, bool AllowExtraModuleMapSearch=false)
Lookup a module Search for a module with the given name.
void SetFileControllingMacro(FileEntryRef File, const IdentifierInfo *ControllingMacro)
Mark the specified file as having a controlling macro.
Definition: HeaderSearch.h:556
DiagnosticsEngine & getDiags() const
Definition: HeaderSearch.h:369
void MarkFileIncludeOnce(FileEntryRef File)
Mark the specified file as a "once only" file due to #pragma once.
Definition: HeaderSearch.h:537
ConstSearchDirIterator system_dir_begin() const
Definition: HeaderSearch.h:856
HeaderSearch(const HeaderSearch &)=delete
bool hasModuleMap(StringRef Filename, const DirectoryEntry *Root, bool IsSystem)
Determine whether there is a module map that may map the header with the given file name to a (sub)mo...
std::string suggestPathToFileForDiagnostics(FileEntryRef File, llvm::StringRef MainFile, bool *IsAngled=nullptr) const
Suggest a path by which the specified file could be found, for use in diagnostics to suggest a #inclu...
ConstSearchDirIterator search_dir_end() const
Definition: HeaderSearch.h:841
OptionalFileEntryRef LookupFile(StringRef Filename, SourceLocation IncludeLoc, bool isAngled, ConstSearchDirIterator FromDir, ConstSearchDirIterator *CurDir, ArrayRef< std::pair< OptionalFileEntryRef, DirectoryEntryRef > > Includers, SmallVectorImpl< char > *SearchPath, SmallVectorImpl< char > *RelativePath, Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule, bool *IsMapped, bool *IsFrameworkFound, bool SkipCache=false, bool BuildSystemModule=false, bool OpenFile=true, bool CacheFailures=true)
Given a "foo" or <foo> reference, look up the indicated file, return null on failure.
void getHeaderMapFileNames(SmallVectorImpl< std::string > &Names) const
Get filenames for all registered header maps.
void MarkFileSystemHeader(FileEntryRef File)
Mark the specified file as a system header, e.g.
Definition: HeaderSearch.h:544
StringRef getIncludeNameForHeader(const FileEntry *File) const
Retrieve the include name for the header.
std::string getPrebuiltImplicitModuleFileName(Module *Module)
Retrieve the name of the prebuilt module file that should be used to load the given module.
StringRef getModuleCachePath() const
Retrieve the path to the module cache.
Definition: HeaderSearch.h:429
void setModuleHash(StringRef Hash)
Set the hash to use for module cache paths.
Definition: HeaderSearch.h:418
ConstSearchDirIterator angled_dir_begin() const
Definition: HeaderSearch.h:851
void SetSystemHeaderPrefixes(ArrayRef< std::pair< std::string, bool > > P)
Set the list of system header prefixes.
Definition: HeaderSearch.h:386
ArrayRef< ModuleMap::KnownHeader > findAllModulesForHeader(FileEntryRef File) const
Retrieve all the modules corresponding to the given file.
ConstSearchDirRange search_dir_range() const
Definition: HeaderSearch.h:842
bool hasFileBeenImported(FileEntryRef File) const
Determine whether the given file is known to have ever been #imported.
Definition: HeaderSearch.h:569
unsigned searchDirIdx(const DirectoryLookup &DL) const
Get the index of the given search directory.
bool isFileMultipleIncludeGuarded(FileEntryRef File) const
Determine whether this file is intended to be safe from multiple inclusions, e.g.,...
ConstSearchDirIterator quoted_dir_begin() const
Definition: HeaderSearch.h:848
ExternalPreprocessorSource * getExternalLookup() const
Definition: HeaderSearch.h:445
void setModuleCachePath(StringRef CachePath)
Set the path to the module cache.
Definition: HeaderSearch.h:421
ConstSearchDirIterator search_dir_nth(size_t n) const
Definition: HeaderSearch.h:837
void loadTopLevelSystemModules()
Load all known, top-level system modules.
SearchDirIterator search_dir_end()
Definition: HeaderSearch.h:831
FrameworkCacheEntry & LookupFrameworkCache(StringRef FWName)
Look up the specified framework name in our framework cache.
Definition: HeaderSearch.h:516
std::vector< bool > computeUserEntryUsage() const
Determine which HeaderSearchOptions::UserEntries have been successfully used so far and mark their in...
ConstSearchDirIterator quoted_dir_end() const
Definition: HeaderSearch.h:849
ArrayRef< ModuleMap::KnownHeader > findResolvedModulesForHeader(FileEntryRef File) const
Like findAllModulesForHeader, but do not attempt to infer module ownership from umbrella headers if w...
bool loadModuleMapFile(FileEntryRef File, bool IsSystem, FileID ID=FileID(), unsigned *Offset=nullptr, StringRef OriginalModuleMapFile=StringRef())
Read the contents of the given module map file.
void SetSearchPaths(std::vector< DirectoryLookup > dirs, unsigned angledDirIdx, unsigned systemDirIdx, llvm::DenseMap< unsigned, unsigned > searchDirToHSEntry)
Interface for setting the file search paths.
const ModuleMap & getModuleMap() const
Retrieve the module map.
Definition: HeaderSearch.h:815
void setTarget(const TargetInfo &Target)
Set the target information for the header search, if not already known.
const HeaderMap * CreateHeaderMap(FileEntryRef FE)
This method returns a HeaderMap for the specified FileEntry, uniquing them through the 'HeaderMaps' d...
ModuleMap::KnownHeader findModuleForHeader(FileEntryRef File, bool AllowTextual=false, bool AllowExcluded=false) const
Retrieve the module that corresponds to the given file, if any.
SearchDirRange search_dir_range()
Definition: HeaderSearch.h:832
std::string getCachedModuleFileName(Module *Module)
Retrieve the name of the cached module file that should be used to load the given module.
void collectAllModules(SmallVectorImpl< Module * > &Modules)
Collect the set of all known, top-level modules.
void MarkFileModuleHeader(FileEntryRef FE, ModuleMap::ModuleHeaderRole Role, bool isCompilingModuleHeader)
Mark the specified file as part of a module.
OptionalFileEntryRef LookupSubframeworkHeader(StringRef Filename, FileEntryRef ContextFileEnt, SmallVectorImpl< char > *SearchPath, SmallVectorImpl< char > *RelativePath, Module *RequestingModule, ModuleMap::KnownHeader *SuggestedModule)
Look up a subframework for the specified #include file.
HeaderFileInfo & getFileInfo(FileEntryRef FE)
Return the HeaderFileInfo structure for the specified FileEntry, in preparation for updating it in so...
void SetExternalLookup(ExternalPreprocessorSource *EPS)
Definition: HeaderSearch.h:441
OptionalFileEntryRef lookupModuleMapFile(DirectoryEntryRef Dir, bool IsFramework)
Try to find a module map file in the given directory, returning nullopt if none is found.
bool ShouldEnterIncludeFile(Preprocessor &PP, FileEntryRef File, bool isImport, bool ModulesEnabled, Module *M, bool &IsFirstIncludeOfFile)
Mark the specified file as a target of a #include, #include_next, or #import directive.
size_t getTotalMemory() const
ModuleMap & getModuleMap()
Retrieve the module map.
Definition: HeaderSearch.h:812
HeaderSearchOptions & getHeaderSearchOpts() const
Retrieve the header-search options with which this header search was initialized.
Definition: HeaderSearch.h:365
bool HasIncludeAliasMap() const
Checks whether the map exists or not.
Definition: HeaderSearch.h:391
std::string getPrebuiltModuleFileName(StringRef ModuleName, bool FileMapOnly=false)
Retrieve the name of the prebuilt module file that should be used to load a module with the given nam...
unsigned header_file_size() const
Definition: HeaderSearch.h:817
ConstSearchDirIterator system_dir_end() const
Definition: HeaderSearch.h:859
void ClearFileInfo()
Forget everything we know about headers so far.
Definition: HeaderSearch.h:437
StringRef getModuleHash() const
Retrieve the module hash.
Definition: HeaderSearch.h:426
ConstSearchDirIterator search_dir_begin() const
Definition: HeaderSearch.h:836
void AddIncludeAlias(StringRef Source, StringRef Dest)
Map the source include name to the dest include name.
Definition: HeaderSearch.h:397
StringRef MapHeaderToIncludeAlias(StringRef Source)
Maps one header file name to a different header file name, for use with the include_alias pragma.
Definition: HeaderSearch.h:407
SearchDirIterator search_dir_begin()
Definition: HeaderSearch.h:830
void AddSystemSearchPath(const DirectoryLookup &dir)
Add an additional system search path.
Definition: HeaderSearch.h:380
One of these records is kept for each identifier that is lexed.
A header that is known to reside within a given module, whether it was included or excluded.
Definition: ModuleMap.h:159
ModuleHeaderRole
Flags describing the role of a module header.
Definition: ModuleMap.h:127
Describes a module or submodule.
Definition: Module.h:105
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Definition: Preprocessor.h:128
Encodes a location in the source.
Exposes information about the current target.
Definition: TargetInfo.h:213
CharacteristicKind
Indicates whether a file or directory holds normal user code, system code, or system code which is im...
Definition: SourceManager.h:81
std::conditional_t< Const, const T, T > Qualified
Definition: HeaderSearch.h:167
@ HeaderSearch
Remove unused header search paths including header maps.
The JSON file list parser is used to communicate input to InstallAPI.
void ApplyHeaderSearchOptions(HeaderSearch &HS, const HeaderSearchOptions &HSOpts, const LangOptions &Lang, const llvm::Triple &triple)
Apply the header search options to get given HeaderSearch object.
llvm::iterator_range< SearchDirIterator > SearchDirRange
Definition: HeaderSearch.h:228
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
@ Other
Other implicit parameter.
llvm::iterator_range< ConstSearchDirIterator > ConstSearchDirRange
Definition: HeaderSearch.h:227
YAML serialization mapping.
Definition: Dominators.h:30
#define false
Definition: stdbool.h:22
#define bool
Definition: stdbool.h:20
This structure is used to record entries in our framework cache.
Definition: HeaderSearch.h:155
bool IsUserSpecifiedSystemFramework
Whether this framework has been "user-specified" to be treated as if it were a system framework (even...
Definition: HeaderSearch.h:162
OptionalDirectoryEntryRef Directory
The directory entry which should be used for the cached framework.
Definition: HeaderSearch.h:157
The preprocessor keeps track of this information for each file that is #included.
Definition: HeaderSearch.h:58
unsigned IndexHeaderMapHeader
Whether this is a header inside a framework that is currently being built.
Definition: HeaderSearch.h:102
unsigned DirInfo
Keep track of whether this is a system header, and if so, whether it is C++ clean or not.
Definition: HeaderSearch.h:74
const IdentifierInfo * ControllingMacro
If this file has a #ifndef XXX (or equivalent) guard that protects the entire contents of the file,...
Definition: HeaderSearch.h:123
unsigned isModuleHeader
Whether this header is part of a module.
Definition: HeaderSearch.h:83
const IdentifierInfo * getControllingMacro(ExternalPreprocessorSource *External)
Retrieve the controlling macro for this header file, if any.
unsigned isPragmaOnce
True if this is a #pragma once file.
Definition: HeaderSearch.h:67
unsigned Resolved
Whether this structure is considered to already have been "resolved", meaning that it was loaded from...
Definition: HeaderSearch.h:92
unsigned isCompilingModuleHeader
Whether this header is part of the module that we are building.
Definition: HeaderSearch.h:87
unsigned IsValid
Whether this file has been looked up as a header.
Definition: HeaderSearch.h:106
unsigned isImport
True if this is a #import'd file.
Definition: HeaderSearch.h:63
StringRef Framework
If this header came from a framework include, this is the name of the framework.
Definition: HeaderSearch.h:127
unsigned ControllingMacroID
The ID number of the controlling macro.
Definition: HeaderSearch.h:113
unsigned External
Whether this header file info was supplied by an external source, and has not changed since.
Definition: HeaderSearch.h:79
Forward iterator over the search directories of HeaderSearch.
Definition: HeaderSearch.h:174
SearchDirIteratorImpl(std::nullptr_t)
Creates an invalid iterator.
Definition: HeaderSearch.h:200
Qualified< IsConst, DirectoryLookup > & operator*() const
Definition: HeaderSearch.h:194
bool operator==(const SearchDirIteratorImpl &RHS) const
Definition: HeaderSearch.h:184
SearchDirIteratorImpl(const SearchDirIteratorImpl< false > &Other)
Const -> non-const iterator conversion.
Definition: HeaderSearch.h:177
SearchDirIteratorImpl & operator++()
Definition: HeaderSearch.h:188
SearchDirIteratorImpl & operator=(const SearchDirIteratorImpl &)=default
SearchDirIteratorImpl(const SearchDirIteratorImpl &)=default