[PATCH] D25641: [Driver] Use VFS to perform all distribution checks

Michał Górny via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 17 11:16:41 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL284403: [Driver] Use VFS to perform all distribution checks (authored by mgorny).

Changed prior to commit:
  https://reviews.llvm.org/D25641?vs=74767&id=74874#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25641

Files:
  cfe/trunk/lib/Driver/ToolChains.cpp


Index: cfe/trunk/lib/Driver/ToolChains.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp
+++ cfe/trunk/lib/Driver/ToolChains.cpp
@@ -3844,7 +3844,7 @@
 
 static Distro DetectDistro(const Driver &D, llvm::Triple::ArchType Arch) {
   llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
-      llvm::MemoryBuffer::getFile("/etc/lsb-release");
+      D.getVFS().getBufferForFile("/etc/lsb-release");
   if (File) {
     StringRef Data = File.get()->getBuffer();
     SmallVector<StringRef, 16> Lines;
@@ -3876,7 +3876,7 @@
       return Version;
   }
 
-  File = llvm::MemoryBuffer::getFile("/etc/redhat-release");
+  File = D.getVFS().getBufferForFile("/etc/redhat-release");
   if (File) {
     StringRef Data = File.get()->getBuffer();
     if (Data.startswith("Fedora release"))
@@ -3894,7 +3894,7 @@
     return UnknownDistro;
   }
 
-  File = llvm::MemoryBuffer::getFile("/etc/debian_version");
+  File = D.getVFS().getBufferForFile("/etc/debian_version");
   if (File) {
     StringRef Data = File.get()->getBuffer();
     if (Data[0] == '5')


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25641.74874.patch
Type: text/x-patch
Size: 1114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161017/cd741746/attachment.bin>


More information about the cfe-commits mailing list