From 519fc96c475680de2cc49e7811dbbfadb912cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:09 +0000 Subject: Vendor import of stripped clang trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/cfe/trunk@375505 --- lib/Tooling/Refactoring.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Tooling/Refactoring.cpp') diff --git a/lib/Tooling/Refactoring.cpp b/lib/Tooling/Refactoring.cpp index f379a9c3bcf6..d45cd8c57f10 100644 --- a/lib/Tooling/Refactoring.cpp +++ b/lib/Tooling/Refactoring.cpp @@ -78,7 +78,10 @@ bool formatAndApplyAllReplacements( const std::string &FilePath = FileAndReplaces.first; auto &CurReplaces = FileAndReplaces.second; - const FileEntry *Entry = Files.getFile(FilePath); + const FileEntry *Entry = nullptr; + if (auto File = Files.getFile(FilePath)) + Entry = *File; + FileID ID = SM.getOrCreateFileID(Entry, SrcMgr::C_User); StringRef Code = SM.getBufferData(ID); -- cgit v1.2.3