diff options
| author | Fangrui Song <maskray@google.com> | 2019-11-26 16:09:22 -0800 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2019-11-26 16:15:39 -0800 |
| commit | 3bb24bf25767ef5bbcef958b484e7a06d8689204 (patch) | |
| tree | cd911a5c9b0ba7a12a5c2024312baa034c697805 /clang/lib/Lex/PPMacroExpansion.cpp | |
| parent | df773ebb5f8ff54cda385f4491ff877464228c18 (diff) | |
| download | bcm5719-llvm-3bb24bf25767ef5bbcef958b484e7a06d8689204.tar.gz bcm5719-llvm-3bb24bf25767ef5bbcef958b484e7a06d8689204.zip | |
Fix tests on Windows after D49466
It is tricky to use replace_path_prefix correctly on Windows which uses
backslashes as native path separators. Switch back to the old approach
(startswith is not ideal) to appease build bots for now.
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
| -rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 3b53d07cc4a..cf8bb2fbab9 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -1456,10 +1456,10 @@ static void remapMacroPath( const std::map<std::string, std::string, std::greater<std::string>> &MacroPrefixMap) { for (const auto &Entry : MacroPrefixMap) - if (llvm::sys::path::replace_path_prefix(Path, Entry.first, Entry.second, - llvm::sys::path::Style::native, - true)) + if (Path.startswith(Entry.first)) { + Path = (Twine(Entry.second) + Path.substr(Entry.first.size())).str(); break; + } } /// ExpandBuiltinMacro - If an identifier token is read that is to be expanded |

