Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Lex/PPDirectives.cpp
Show First 20 Lines • Show All 2,006 Lines • ▼ Show 20 Lines | Preprocessor::ImportAction Preprocessor::HandleHeaderIncludeOrImport( | ||||
SmallString<1024> SearchPath; | SmallString<1024> SearchPath; | ||||
SmallString<1024> RelativePath; | SmallString<1024> RelativePath; | ||||
// We get the raw path only if we have 'Callbacks' to which we later pass | // We get the raw path only if we have 'Callbacks' to which we later pass | ||||
// the path. | // the path. | ||||
ModuleMap::KnownHeader SuggestedModule; | ModuleMap::KnownHeader SuggestedModule; | ||||
SourceLocation FilenameLoc = FilenameTok.getLocation(); | SourceLocation FilenameLoc = FilenameTok.getLocation(); | ||||
StringRef LookupFilename = Filename; | StringRef LookupFilename = Filename; | ||||
#ifdef _WIN32 | |||||
llvm::sys::path::Style BackslashStyle = llvm::sys::path::Style::windows; | |||||
#else | |||||
// Normalize slashes when compiling with -fms-extensions on non-Windows. This | // Normalize slashes when compiling with -fms-extensions on non-Windows. This | ||||
// is unnecessary on Windows since the filesystem there handles backslashes. | // is unnecessary on Windows since the filesystem there handles backslashes. | ||||
SmallString<128> NormalizedPath; | SmallString<128> NormalizedPath; | ||||
llvm::sys::path::Style BackslashStyle = llvm::sys::path::Style::posix; | llvm::sys::path::Style BackslashStyle = llvm::sys::path::Style::native; | ||||
if (LangOpts.MicrosoftExt) { | if (is_style_posix(BackslashStyle) && LangOpts.MicrosoftExt) { | ||||
NormalizedPath = Filename.str(); | NormalizedPath = Filename.str(); | ||||
llvm::sys::path::native(NormalizedPath); | llvm::sys::path::native(NormalizedPath); | ||||
LookupFilename = NormalizedPath; | LookupFilename = NormalizedPath; | ||||
BackslashStyle = llvm::sys::path::Style::windows; | BackslashStyle = llvm::sys::path::Style::windows; | ||||
} | } | ||||
#endif | |||||
Optional<FileEntryRef> File = LookupHeaderIncludeOrImport( | Optional<FileEntryRef> File = LookupHeaderIncludeOrImport( | ||||
CurDir, Filename, FilenameLoc, FilenameRange, FilenameTok, | CurDir, Filename, FilenameLoc, FilenameRange, FilenameTok, | ||||
IsFrameworkFound, IsImportDecl, IsMapped, LookupFrom, LookupFromFile, | IsFrameworkFound, IsImportDecl, IsMapped, LookupFrom, LookupFromFile, | ||||
LookupFilename, RelativePath, SearchPath, SuggestedModule, isAngled); | LookupFilename, RelativePath, SearchPath, SuggestedModule, isAngled); | ||||
// Record the header's filename for later use. | // Record the header's filename for later use. | ||||
if (File) | if (File) | ||||
▲ Show 20 Lines • Show All 1,281 Lines • Show Last 20 Lines |