@@ -311,18 +311,16 @@ class SearchPathOptions {
311311 friend class ASTContext ;
312312
313313public:
314- struct FrameworkSearchPath {
314+ struct SearchPath {
315315 std::string Path;
316316 bool IsSystem = false ;
317- FrameworkSearchPath (StringRef path, bool isSystem)
318- : Path(path), IsSystem(isSystem) {}
317+ SearchPath (StringRef path, bool isSystem)
318+ : Path(path), IsSystem(isSystem) {}
319319
320- friend bool operator ==(const FrameworkSearchPath &LHS,
321- const FrameworkSearchPath &RHS) {
320+ friend bool operator ==(const SearchPath &LHS, const SearchPath &RHS) {
322321 return LHS.Path == RHS.Path && LHS.IsSystem == RHS.IsSystem ;
323322 }
324- friend bool operator !=(const FrameworkSearchPath &LHS,
325- const FrameworkSearchPath &RHS) {
323+ friend bool operator !=(const SearchPath &LHS, const SearchPath &RHS) {
326324 return !(LHS == RHS);
327325 }
328326 };
@@ -332,23 +330,23 @@ class SearchPathOptions {
332330
333331 // / Path to the SDK which is being built against.
334332 // /
335- // / Must me modified through setter to keep \c SearchPathLookup in sync.
333+ // / Must be modified through setter to keep \c Lookup in sync.
336334 std::string SDKPath;
337335
338336 // / Path(s) which should be searched for modules.
339337 // /
340- // / Must me modified through setter to keep \c SearchPathLookup in sync.
341- std::vector<std::string > ImportSearchPaths;
338+ // / Must be modified through setter to keep \c Lookup in sync.
339+ std::vector<SearchPath > ImportSearchPaths;
342340
343341 // / Path(s) which should be searched for frameworks.
344342 // /
345- // / Must me modified through setter to keep \c SearchPathLookup in sync.
346- std::vector<FrameworkSearchPath > FrameworkSearchPaths;
343+ // / Must be modified through setter to keep \c Lookup in sync.
344+ std::vector<SearchPath > FrameworkSearchPaths;
347345
348346 // / Paths to search for stdlib modules. One of these will be
349347 // / compiler-relative.
350348 // /
351- // / Must me modified through setter to keep \c SearchPathLookup in sync.
349+ // / Must be modified through setter to keep \c Lookup in sync.
352350 std::vector<std::string> RuntimeLibraryImportPaths;
353351
354352 // / When on Darwin the framework paths that are implicitly imported.
@@ -369,17 +367,16 @@ class SearchPathOptions {
369367
370368 // / Add a single import search path. Must only be called from
371369 // / \c ASTContext::addSearchPath.
372- void addImportSearchPath (StringRef Path, llvm::vfs::FileSystem *FS) {
373- ImportSearchPaths.push_back (Path. str () );
374- Lookup.searchPathAdded (FS, ImportSearchPaths.back (),
375- ModuleSearchPathKind::Import, /* isSystem= */ false ,
370+ void addImportSearchPath (SearchPath Path, llvm::vfs::FileSystem *FS) {
371+ ImportSearchPaths.push_back (Path);
372+ Lookup.searchPathAdded (FS, ImportSearchPaths.back (). Path ,
373+ ModuleSearchPathKind::Import, Path. IsSystem ,
376374 ImportSearchPaths.size () - 1 );
377375 }
378376
379377 // / Add a single framework search path. Must only be called from
380378 // / \c ASTContext::addSearchPath.
381- void addFrameworkSearchPath (FrameworkSearchPath NewPath,
382- llvm::vfs::FileSystem *FS) {
379+ void addFrameworkSearchPath (SearchPath NewPath, llvm::vfs::FileSystem *FS) {
383380 FrameworkSearchPaths.push_back (NewPath);
384381 Lookup.searchPathAdded (FS, FrameworkSearchPaths.back ().Path ,
385382 ModuleSearchPathKind::Framework, NewPath.IsSystem ,
@@ -448,21 +445,21 @@ class SearchPathOptions {
448445 SysRoot = sysroot;
449446 }
450447
451- ArrayRef<std::string > getImportSearchPaths () const {
448+ ArrayRef<SearchPath > getImportSearchPaths () const {
452449 return ImportSearchPaths;
453450 }
454451
455- void setImportSearchPaths (std::vector<std::string > NewImportSearchPaths) {
452+ void setImportSearchPaths (std::vector<SearchPath > NewImportSearchPaths) {
456453 ImportSearchPaths = NewImportSearchPaths;
457454 Lookup.searchPathsDidChange ();
458455 }
459456
460- ArrayRef<FrameworkSearchPath > getFrameworkSearchPaths () const {
457+ ArrayRef<SearchPath > getFrameworkSearchPaths () const {
461458 return FrameworkSearchPaths;
462459 }
463460
464- void setFrameworkSearchPaths (
465- std::vector<FrameworkSearchPath > NewFrameworkSearchPaths) {
461+ void
462+ setFrameworkSearchPaths ( std::vector<SearchPath > NewFrameworkSearchPaths) {
466463 FrameworkSearchPaths = NewFrameworkSearchPaths;
467464 Lookup.searchPathsDidChange ();
468465 }
@@ -597,8 +594,7 @@ class SearchPathOptions {
597594 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS) const ;
598595
599596private:
600- static StringRef
601- pathStringFromFrameworkSearchPath (const FrameworkSearchPath &next) {
597+ static StringRef pathStringFromSearchPath (const SearchPath &next) {
602598 return next.Path ;
603599 };
604600
@@ -609,17 +605,16 @@ class SearchPathOptions {
609605 using llvm::hash_combine;
610606 using llvm::hash_combine_range;
611607
612- using FrameworkPathView = ArrayRefView<FrameworkSearchPath, StringRef,
613- pathStringFromFrameworkSearchPath>;
614- FrameworkPathView frameworkPathsOnly{FrameworkSearchPaths};
608+ using SearchPathView =
609+ ArrayRefView<SearchPath, StringRef, pathStringFromSearchPath>;
610+ SearchPathView importPathsOnly{ImportSearchPaths};
611+ SearchPathView frameworkPathsOnly{FrameworkSearchPaths};
615612
616613 return hash_combine (SDKPath,
617- hash_combine_range (ImportSearchPaths.begin (),
618- ImportSearchPaths.end ()),
619- hash_combine_range (VFSOverlayFiles.begin (),
620- VFSOverlayFiles.end ()),
621- // FIXME: Should we include the system-ness of framework
614+ // FIXME: Should we include the system-ness of
622615 // search paths too?
616+ hash_combine_range (importPathsOnly.begin (), importPathsOnly.end ()),
617+ hash_combine_range (VFSOverlayFiles.begin (), VFSOverlayFiles.end ()),
623618 hash_combine_range (frameworkPathsOnly.begin (),
624619 frameworkPathsOnly.end ()),
625620 hash_combine_range (LibrarySearchPaths.begin (),
0 commit comments