[llvm-branch-commits] [clang] e095959 - Fixup for 8c86197de3cba4257f26133e837d64e5f8ece210 to avoid making it platform-dependent

Duncan P. N. Exon Smith via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 11 17:39:00 PST 2020


Author: Duncan P. N. Exon Smith
Date: 2020-12-11T17:34:00-08:00
New Revision: e095959e0c23e250d6ad1dbe3612291736d12e1a

URL: https://github.com/llvm/llvm-project/commit/e095959e0c23e250d6ad1dbe3612291736d12e1a
DIFF: https://github.com/llvm/llvm-project/commit/e095959e0c23e250d6ad1dbe3612291736d12e1a.diff

LOG: Fixup for 8c86197de3cba4257f26133e837d64e5f8ece210 to avoid making it platform-dependent

Added: 
    

Modified: 
    clang/tools/clang-import-test/clang-import-test.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-import-test/clang-import-test.cpp b/clang/tools/clang-import-test/clang-import-test.cpp
index 5e84c5f97851..df173cf49f35 100644
--- a/clang/tools/clang-import-test/clang-import-test.cpp
+++ b/clang/tools/clang-import-test/clang-import-test.cpp
@@ -291,9 +291,9 @@ llvm::Error ParseSource(const std::string &Path, CompilerInstance &CI,
   SourceManager &SM = CI.getSourceManager();
   auto FE = CI.getFileManager().getFileRef(Path);
   if (!FE) {
+    llvm::consumeError(FE.takeError());
     return llvm::make_error<llvm::StringError>(
-        llvm::Twine(llvm::toString(FE.takeError())) + ": " + Path,
-        std::error_code());
+        llvm::Twine("No such file or directory: ", Path), std::error_code());
   }
   SM.setMainFileID(SM.createFileID(*FE, SourceLocation(), SrcMgr::C_User));
   ParseAST(CI.getPreprocessor(), &Consumer, CI.getASTContext());


        


More information about the llvm-branch-commits mailing list