@@ -136,8 +136,12 @@ IndexUnitWriter::IndexUnitWriter(FileManager &FileMgr,
136
136
this ->ProviderIdentifier = std::string (ProviderIdentifier);
137
137
this ->ProviderVersion = std::string (ProviderVersion);
138
138
SmallString<256 > AbsOutputFile (OutputFile);
139
- if (OutputFile != " -" ) // Can't make stdout absolute, should stay as "-".
139
+ if (OutputFile != " -" ) {
140
+ // Can't make stdout absolute, should stay as "-".
140
141
FileMgr.makeAbsolutePath (AbsOutputFile);
142
+ llvm::sys::path::native (AbsOutputFile);
143
+ }
144
+
141
145
this ->OutputFile = std::string (AbsOutputFile.str ());
142
146
this ->ModuleName = std::string (ModuleName);
143
147
this ->MainFile = MainFile;
@@ -227,13 +231,14 @@ void IndexUnitWriter::getUnitNameForOutputFile(StringRef FilePath,
227
231
SmallVectorImpl<char > &Str) {
228
232
SmallString<256 > AbsPath (FilePath);
229
233
FileMgr.makeAbsolutePath (AbsPath);
234
+ llvm::sys::path::native (AbsPath);
230
235
return getUnitNameForAbsoluteOutputFile (AbsPath, Str, Remapper);
231
236
}
232
237
233
238
void IndexUnitWriter::getUnitPathForOutputFile (StringRef FilePath,
234
239
SmallVectorImpl<char > &Str) {
235
240
Str.append (UnitsPath.begin (), UnitsPath.end ());
236
- Str.push_back (' / ' );
241
+ Str.push_back (llvm::sys::path::get_separator (). front () );
237
242
return getUnitNameForOutputFile (FilePath, Str);
238
243
}
239
244
0 commit comments