23
23
#include " llvm/ADT/StringSet.h"
24
24
#include " llvm/Support/FileSystem.h"
25
25
#include " llvm/Support/Path.h"
26
- #include " llvm/Support/VirtualFileSystem.h"
27
26
#include " llvm/Support/raw_ostream.h"
28
27
#include < optional>
29
- #include < system_error>
30
28
31
29
using namespace clang ;
32
30
@@ -238,7 +236,6 @@ void DependencyFileGenerator::attachToPreprocessor(Preprocessor &PP) {
238
236
PP.SetSuppressIncludeNotFoundError (true );
239
237
240
238
DependencyCollector::attachToPreprocessor (PP);
241
- FS = PP.getFileManager ().getVirtualFileSystemPtr ();
242
239
}
243
240
244
241
bool DependencyFileGenerator::sawDependency (StringRef Filename, bool FromModule,
@@ -315,22 +312,11 @@ void DependencyFileGenerator::finishedMainFile(DiagnosticsEngine &Diags) {
315
312
// / https://msdn.microsoft.com/en-us/library/dd9y37ha.aspx for NMake info,
316
313
// / https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
317
314
// / for Windows file-naming info.
318
- static void printFilename (raw_ostream &OS, llvm::vfs::FileSystem *FS,
319
- StringRef Filename,
315
+ static void PrintFilename (raw_ostream &OS, StringRef Filename,
320
316
DependencyOutputFormat OutputFormat) {
321
317
// Convert filename to platform native path
322
318
llvm::SmallString<256 > NativePath;
323
319
llvm::sys::path::native (Filename.str (), NativePath);
324
- // Resolve absolute path. Make and Ninja canonicalize paths
325
- // without checking for symbolic links in the path, for performance concerns.
326
- // If there is something like `/bin/../lib64` -> `/usr/lib64`
327
- // (where `/bin` links to `/usr/bin`), Make will see them as `/lib64`.
328
- if (FS != nullptr && llvm::sys::path::is_absolute (NativePath)) {
329
- llvm::SmallString<256 > NativePathTmp = NativePath;
330
- std::error_code EC = FS->getRealPath (NativePathTmp, NativePath);
331
- if (EC)
332
- NativePath = NativePathTmp;
333
- }
334
320
335
321
if (OutputFormat == DependencyOutputFormat::NMake) {
336
322
// Add quotes if needed. These are the characters listed as "special" to
@@ -414,7 +400,7 @@ void DependencyFileGenerator::outputDependencyFile(llvm::raw_ostream &OS) {
414
400
Columns = 2 ;
415
401
}
416
402
OS << ' ' ;
417
- printFilename (OS, FS. get () , File, OutputFormat);
403
+ PrintFilename (OS, File, OutputFormat);
418
404
Columns += N + 1 ;
419
405
}
420
406
OS << ' \n ' ;
@@ -425,7 +411,7 @@ void DependencyFileGenerator::outputDependencyFile(llvm::raw_ostream &OS) {
425
411
for (auto I = Files.begin (), E = Files.end (); I != E; ++I) {
426
412
if (Index++ == InputFileIndex)
427
413
continue ;
428
- printFilename (OS, FS. get () , *I, OutputFormat);
414
+ PrintFilename (OS, *I, OutputFormat);
429
415
OS << " :\n " ;
430
416
}
431
417
}
0 commit comments