From c5103c3f3ea6ce13a43f7852efa9cbafca50a369 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 29 Jan 2013 23:57:10 +0000 Subject: [driver] Clear the FailureResultFiles when initializing clang diagnostics. Also, minor cleanup. llvm-svn: 173852 --- clang/lib/Driver/Compilation.cpp | 1 + clang/lib/Driver/Driver.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'clang/lib/Driver') diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index da589b9d5bf..86e617211f8 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -329,6 +329,7 @@ void Compilation::initCompilationForDiagnostics() { // Clear temporary/results file lists. TempFiles.clear(); ResultFiles.clear(); + FailureResultFiles.clear(); // Remove any user specified output. Claim any unclaimed arguments, so as // to avoid emitting warnings about unused args. diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 0ba61a3de8b..3ede6e32884 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -398,6 +398,12 @@ void Driver::generateCompilationDiagnostics(Compilation &C, } } + if (Inputs.empty()) { + Diag(clang::diag::note_drv_command_failed_diag_msg) + << "Error generating preprocessed source(s) - no preprocessable inputs."; + return; + } + // Don't attempt to generate preprocessed files if multiple -arch options are // used, unless they're all duplicates. llvm::StringSet<> ArchNames; @@ -416,12 +422,6 @@ void Driver::generateCompilationDiagnostics(Compilation &C, return; } - if (Inputs.empty()) { - Diag(clang::diag::note_drv_command_failed_diag_msg) - << "Error generating preprocessed source(s) - no preprocessable inputs."; - return; - } - // Construct the list of abstract actions to perform for this compilation. On // Darwin OSes this uses the driver-driver and builds universal actions. const ToolChain &TC = C.getDefaultToolChain(); -- cgit v1.2.3