diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-07-20 21:16:17 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-07-20 21:16:17 +0000 |
commit | d7a3ba03f69892aac02e0771eb2e6d1b7b1d1267 (patch) | |
tree | 3915104cc5920d220fffd0edbde9544b191af173 /lib/Driver/Driver.cpp | |
parent | e1809074d08f3a91bb2ef5f088b52bb46a08fb8a (diff) |
Temporarily revert r135614 while I fix the cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 74 |
1 files changed, 9 insertions, 65 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index b01e8fca1b..789f6f7ae9 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -60,9 +60,9 @@ Driver::Driver(llvm::StringRef ClangExecutable, CCLogDiagnosticsFilename(0), CCCIsCXX(false), CCCIsCPP(false),CCCEcho(false), CCCPrintBindings(false), CCPrintOptions(false), CCPrintHeaders(false), CCLogDiagnostics(false), - CCGenDiagnostics(false), CCCGenericGCCName(""), CheckInputsExist(true), - CCCUseClang(true), CCCUseClangCXX(true), CCCUseClangCPP(true), - CCCUsePCH(true), SuppressMissingInputWarning(false) { + CCCGenericGCCName(""), CheckInputsExist(true), CCCUseClang(true), + CCCUseClangCXX(true), CCCUseClangCPP(true), CCCUsePCH(true), + SuppressMissingInputWarning(false) { if (IsProduction) { // In a "production" build, only use clang on architectures we expect to // work, and don't use clang C++. @@ -313,63 +313,7 @@ Compilation *Driver::BuildCompilation(llvm::ArrayRef<const char *> ArgList) { return C; } -// When clang crashes, produce diagnostic information including the fully -// preprocessed source file(s). Request that the developer attach the -// diagnostic information to a bug report. -void Driver::generateCompilationDiagnostics(Compilation &C, - const Command *FailingCommand) { - Diag(clang::diag::note_drv_command_failed_diag_msg) - << "Please submit a bug report to " BUG_REPORT_URL " and include command" - " line arguments and all diagnostic information."; - - // Suppress driver output and emit preprocessor output to temp file. - CCCIsCPP = true; - CCGenDiagnostics = true; - - // Clear stale state and suppress tool output. - C.initCompilationForDiagnostics(); - - // Construct the list of abstract actions to perform for this compilation. - Diags.Reset(); - if (Host->useDriverDriver()) - BuildUniversalActions(C.getDefaultToolChain(), C.getArgs(), - C.getActions()); - else - BuildActions(C.getDefaultToolChain(), C.getArgs(), C.getActions()); - - BuildJobs(C); - - // If there were errors building the compilation, quit now. - if (Diags.hasErrorOccurred()) { - Diag(clang::diag::note_drv_command_failed_diag_msg) - << "Error generating preprocessed source(s)."; - return; - } - - // Generate preprocessed output. - FailingCommand = 0; - int Res = C.ExecuteJob(C.getJobs(), FailingCommand); - - // If the command succeeded, we are done. - if (Res == 0) { - Diag(clang::diag::note_drv_command_failed_diag_msg) - << "Preprocessed source(s) are located at:"; - ArgStringList Files = C.getTempFiles(); - for (ArgStringList::const_iterator it = Files.begin(), ie = Files.end(); - it != ie; ++it) - Diag(clang::diag::note_drv_command_failed_diag_msg) << *it; - } else { - // Failure, remove preprocessed files. - if (!C.getArgs().hasArg(options::OPT_save_temps)) - C.CleanupFileList(C.getTempFiles(), true); - - Diag(clang::diag::note_drv_command_failed_diag_msg) - << "Error generating preprocessed source(s)."; - } -} - -int Driver::ExecuteCompilation(const Compilation &C, - const Command *&FailingCommand) const { +int Driver::ExecuteCompilation(const Compilation &C) const { // Just print if -### was present. if (C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) { C.PrintJob(llvm::errs(), C.getJobs(), "\n", true); @@ -377,9 +321,10 @@ int Driver::ExecuteCompilation(const Compilation &C, } // If there were errors building the compilation, quit now. - if (Diags.hasErrorOccurred()) + if (getDiags().hasErrorOccurred()) return 1; + const Command *FailingCommand = 0; int Res = C.ExecuteJob(C.getJobs(), FailingCommand); // Remove temp files. @@ -1253,7 +1198,7 @@ void Driver::BuildJobsForAction(Compilation &C, A->getType(), BaseInput); } - if (CCCPrintBindings && !CCGenDiagnostics) { + if (CCCPrintBindings) { llvm::errs() << "# \"" << T.getToolChain().getTripleString() << '"' << " - \"" << T.getName() << "\", inputs: ["; for (unsigned i = 0, e = InputInfos.size(); i != e; ++i) { @@ -1280,12 +1225,11 @@ const char *Driver::GetNamedOutputPath(Compilation &C, } // Default to writing to stdout? - if (AtTopLevel && isa<PreprocessJobAction>(JA) && !CCGenDiagnostics) + if (AtTopLevel && isa<PreprocessJobAction>(JA)) return "-"; // Output to a temporary file? - if ((!AtTopLevel && !C.getArgs().hasArg(options::OPT_save_temps)) || - CCGenDiagnostics) { + if (!AtTopLevel && !C.getArgs().hasArg(options::OPT_save_temps)) { std::string TmpName = GetTemporaryPath(types::getTypeTempSuffix(JA.getType())); return C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str())); |