jfb created this revision. Herald added subscribers: cfe-commits, dexonsmith. Herald added a project: clang. jfb planned changes to this revision. jfb added a comment.
There's a failure in `clang/test/Index/pch-from-libclang.c`. @thakis disabled that test for all but Darwin in r352809, and with my change I now get: Internal compiler error: LFS error for "/Users/jfb/s/llvmm/debug/tools/clang/test/Index/Output/pch-from-libclang.c.tmp.mcp/14EC4PG1UTVLY/modules.idx"failed to create unique file /Users/jfb/s/llvmm/debug/tools/clang/test/Index/Output/pch-from-libclang.c.tmp.mcp/14EC4PG1UTVLY/modules.idx.lock-0ae18733: No such file or directory >From the test, it's the result of running: /Users/jfb/s/llvmm/debug/bin/clang -fsyntax-only -include /Users/jfb/s/llvmm/debug/tools/clang/test/Index/Output/pch-from-libclang.c.tmp.h /Users/jfb/s/llvmm/clang/test/Index/pch-from-libclang.c -Xclang -verify -fmodules -fmodules-cache-path=/Users/jfb/s/llvmm/debug/tools/clang/test/Index/Output/pch-from-libclang.c.tmp.mcp -Xclang -detailed-preprocessing-record -Xclang -triple -Xclang x86_64-apple-darwin -Xclang -fallow-pch-with-compiler-errors @akyrtzi do you know what's going on? I haven't investigate yet, and am hoping you'll just know :) It's called in a few place, and for D63518 <https://reviews.llvm.org/D63518> I initially set all their error propagation to ignore errors so we could propagate them one at a time. This change takes that second step and enables propagation, improving some module-related diagnostics. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D65846 Files: clang/lib/Frontend/CompilerInstance.cpp clang/lib/Frontend/FrontendAction.cpp clang/lib/Serialization/GlobalModuleIndex.cpp Index: clang/lib/Serialization/GlobalModuleIndex.cpp =================================================================== --- clang/lib/Serialization/GlobalModuleIndex.cpp +++ clang/lib/Serialization/GlobalModuleIndex.cpp @@ -860,7 +860,9 @@ llvm::LockFileManager Locked(IndexPath); switch (Locked) { case llvm::LockFileManager::LFS_Error: - return llvm::createStringError(std::errc::io_error, "LFS error"); + return llvm::createStringError( + std::errc::io_error, "LFS error for \"%s\": %s", IndexPath.c_str(), + Locked.getErrorMessage().c_str()); case llvm::LockFileManager::LFS_Owned: // We're responsible for building the index ourselves. Do so below. @@ -869,8 +871,10 @@ case llvm::LockFileManager::LFS_Shared: // Someone else is responsible for building the index. We don't care // when they finish, so we're done. - return llvm::createStringError(std::errc::device_or_resource_busy, - "someone else is building the index"); + return llvm::createStringError( + std::errc::device_or_resource_busy, + "someone else is building the index \"%s\": %s", IndexPath.c_str(), + Locked.getErrorMessage().c_str()); } // The module index builder. Index: clang/lib/Frontend/FrontendAction.cpp =================================================================== --- clang/lib/Frontend/FrontendAction.cpp +++ clang/lib/Frontend/FrontendAction.cpp @@ -940,15 +940,10 @@ CI.hasPreprocessor()) { StringRef Cache = CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath(); - if (!Cache.empty()) { + if (!Cache.empty()) if (llvm::Error Err = GlobalModuleIndex::writeIndex( - CI.getFileManager(), CI.getPCHContainerReader(), Cache)) { - // FIXME this drops the error on the floor, but - // Index/pch-from-libclang.c seems to rely on dropping at least some of - // the error conditions! - consumeError(std::move(Err)); - } - } + CI.getFileManager(), CI.getPCHContainerReader(), Cache)) + return Err; } return llvm::Error::success(); Index: clang/lib/Frontend/CompilerInstance.cpp =================================================================== --- clang/lib/Frontend/CompilerInstance.cpp +++ clang/lib/Frontend/CompilerInstance.cpp @@ -943,9 +943,8 @@ getSourceManager().clearIDTables(); if (Act.BeginSourceFile(*this, FIF)) { - if (llvm::Error Err = Act.Execute()) { - consumeError(std::move(Err)); // FIXME this drops errors on the floor. - } + if (llvm::Error Err = Act.Execute()) + OS << "Internal compiler error: " << toString(std::move(Err)) << "\n"; Act.EndSourceFile(); } }
Index: clang/lib/Serialization/GlobalModuleIndex.cpp =================================================================== --- clang/lib/Serialization/GlobalModuleIndex.cpp +++ clang/lib/Serialization/GlobalModuleIndex.cpp @@ -860,7 +860,9 @@ llvm::LockFileManager Locked(IndexPath); switch (Locked) { case llvm::LockFileManager::LFS_Error: - return llvm::createStringError(std::errc::io_error, "LFS error"); + return llvm::createStringError( + std::errc::io_error, "LFS error for \"%s\": %s", IndexPath.c_str(), + Locked.getErrorMessage().c_str()); case llvm::LockFileManager::LFS_Owned: // We're responsible for building the index ourselves. Do so below. @@ -869,8 +871,10 @@ case llvm::LockFileManager::LFS_Shared: // Someone else is responsible for building the index. We don't care // when they finish, so we're done. - return llvm::createStringError(std::errc::device_or_resource_busy, - "someone else is building the index"); + return llvm::createStringError( + std::errc::device_or_resource_busy, + "someone else is building the index \"%s\": %s", IndexPath.c_str(), + Locked.getErrorMessage().c_str()); } // The module index builder. Index: clang/lib/Frontend/FrontendAction.cpp =================================================================== --- clang/lib/Frontend/FrontendAction.cpp +++ clang/lib/Frontend/FrontendAction.cpp @@ -940,15 +940,10 @@ CI.hasPreprocessor()) { StringRef Cache = CI.getPreprocessor().getHeaderSearchInfo().getModuleCachePath(); - if (!Cache.empty()) { + if (!Cache.empty()) if (llvm::Error Err = GlobalModuleIndex::writeIndex( - CI.getFileManager(), CI.getPCHContainerReader(), Cache)) { - // FIXME this drops the error on the floor, but - // Index/pch-from-libclang.c seems to rely on dropping at least some of - // the error conditions! - consumeError(std::move(Err)); - } - } + CI.getFileManager(), CI.getPCHContainerReader(), Cache)) + return Err; } return llvm::Error::success(); Index: clang/lib/Frontend/CompilerInstance.cpp =================================================================== --- clang/lib/Frontend/CompilerInstance.cpp +++ clang/lib/Frontend/CompilerInstance.cpp @@ -943,9 +943,8 @@ getSourceManager().clearIDTables(); if (Act.BeginSourceFile(*this, FIF)) { - if (llvm::Error Err = Act.Execute()) { - consumeError(std::move(Err)); // FIXME this drops errors on the floor. - } + if (llvm::Error Err = Act.Execute()) + OS << "Internal compiler error: " << toString(std::move(Err)) << "\n"; Act.EndSourceFile(); } }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits