diff options
Diffstat (limited to 'clang-tools-extra/clangd/SourceCode.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/SourceCode.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp index d9911647a5f..eb9eb48cc48 100644 --- a/clang-tools-extra/clangd/SourceCode.cpp +++ b/clang-tools-extra/clangd/SourceCode.cpp @@ -442,10 +442,10 @@ llvm::Optional<std::string> getCanonicalPath(const FileEntry *F, // // The file path of Symbol is "/project/src/foo.h" instead of // "/tmp/build/foo.h" - if (const DirectoryEntry *Dir = SourceMgr.getFileManager().getDirectory( + if (auto Dir = SourceMgr.getFileManager().getDirectory( llvm::sys::path::parent_path(FilePath))) { llvm::SmallString<128> RealPath; - llvm::StringRef DirName = SourceMgr.getFileManager().getCanonicalName(Dir); + llvm::StringRef DirName = SourceMgr.getFileManager().getCanonicalName(*Dir); llvm::sys::path::append(RealPath, DirName, llvm::sys::path::filename(FilePath)); return RealPath.str().str(); |

