Author: d0k Date: Fri Oct 28 08:00:49 2016 New Revision: 285396 URL: http://llvm.org/viewvc/llvm-project?rev=285396&view=rev Log: [include-fixer] Make error message sound less like clang crashed.
We suppress all Clang diagnostics (because they would be wrong, include-fixer does custom recovery) but still want to give some feedback in case there was a compiler error we couldn't recover from. The most common case for this is a #include in the file that couldn't be found. Modified: clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp Modified: clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp?rev=285396&r1=285395&r2=285396&view=diff ============================================================================== --- clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp (original) +++ clang-tools-extra/trunk/include-fixer/tool/ClangIncludeFixer.cpp Fri Oct 28 08:00:49 2016 @@ -351,8 +351,12 @@ int includeFixerMain(int argc, const cha Style, MinimizeIncludePaths); if (tool.run(&Factory) != 0) { - llvm::errs() - << "Clang died with a fatal error! (incorrect include paths?)\n"; + // We suppress all Clang diagnostics (because they would be wrong, + // include-fixer does custom recovery) but still want to give some feedback + // in case there was a compiler error we couldn't recover from. The most + // common case for this is a #include in the file that couldn't be found. + llvm::errs() << "Fatal compiler error occurred while parsing file!" + " (incorrect include paths?)\n"; return 1; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits