Skip to content

Commit 4ce333b

Browse files
lanzabeccadax
authored andcommitted
---
yaml --- r: 348532 b: refs/heads/master c: 57bf724 h: refs/heads/master
1 parent a2d3b5d commit 4ce333b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: fd51631a6fc2e8cd413984d3c5cec8ac9143e81a
2+
refs/heads/master: 57bf724b1ea478f68ce7199a5ec9884ebc1eeb96
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/ClangImporter/ClangImporter.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,17 +1173,18 @@ ClangImporter::create(ASTContext &ctx, const ClangImporterOptions &importerOpts,
11731173
bool ClangImporter::addSearchPath(StringRef newSearchPath, bool isFramework,
11741174
bool isSystem) {
11751175
clang::FileManager &fileMgr = Impl.Instance->getFileManager();
1176-
auto entry = fileMgr.getDirectory(newSearchPath);
1177-
if (!entry)
1176+
auto optionalEntry = fileMgr.getOptionalDirectoryRef(newSearchPath);
1177+
if (!optionalEntry)
11781178
return true;
1179+
auto entry = *optionalEntry;
11791180

11801181
auto &headerSearchInfo = Impl.getClangPreprocessor().getHeaderSearchInfo();
11811182
auto exists = std::any_of(headerSearchInfo.search_dir_begin(),
11821183
headerSearchInfo.search_dir_end(),
11831184
[&](const clang::DirectoryLookup &lookup) -> bool {
11841185
if (isFramework)
1185-
return lookup.getFrameworkDir() == *entry;
1186-
return lookup.getDir() == *entry;
1186+
return lookup.getFrameworkDir() == &entry.getDirEntry();
1187+
return lookup.getDir() == &entry.getDirEntry();
11871188
});
11881189
if (exists) {
11891190
// Don't bother adding a search path that's already there. Clang would have
@@ -1192,7 +1193,7 @@ bool ClangImporter::addSearchPath(StringRef newSearchPath, bool isFramework,
11921193
}
11931194

11941195
auto kind = isSystem ? clang::SrcMgr::C_System : clang::SrcMgr::C_User;
1195-
headerSearchInfo.AddSearchPath({*entry, kind, isFramework},
1196+
headerSearchInfo.AddSearchPath({entry, kind, isFramework},
11961197
/*isAngled=*/true);
11971198

11981199
// In addition to changing the current preprocessor directly, we still need

0 commit comments

Comments
 (0)