[PATCH] D56263: [clangd] Always try to build absolute path

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 3 05:49:56 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL350306: [clangd] Always try to build absolute path (authored by kadircet, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56263/new/

https://reviews.llvm.org/D56263

Files:
  clang-tools-extra/trunk/clangd/SourceCode.cpp


Index: clang-tools-extra/trunk/clangd/SourceCode.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/SourceCode.cpp
+++ clang-tools-extra/trunk/clangd/SourceCode.cpp
@@ -187,15 +187,8 @@
                                        const SourceManager &SourceMgr) {
   if (!F)
     return None;
-  // Ideally, we get the real path from the FileEntry object.
-  SmallString<128> FilePath = F->tryGetRealPathName();
-  if (!FilePath.empty() && sys::path::is_absolute(FilePath))
-    return FilePath.str().str();
-
-  // Otherwise, we try to compute ourselves.
-  FilePath = F->getName();
-  vlog("FileEntry for {0} did not contain the real path.", FilePath);
 
+  SmallString<128> FilePath = F->getName();
   if (!sys::path::is_absolute(FilePath)) {
     if (auto EC =
             SourceMgr.getFileManager().getVirtualFileSystem()->makeAbsolute(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56263.180044.patch
Type: text/x-patch
Size: 895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190103/6b162fe6/attachment.bin>


More information about the cfe-commits mailing list