Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ CreateFrontendAction(CompilerInstance &CI) {
}

bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
unsigned NumErrorsBefore = Clang->getDiagnostics().getNumErrors();

// Honor -help.
if (Clang->getFrontendOpts().ShowHelp) {
driver::getDriverOptTable().printHelp(
Expand Down Expand Up @@ -293,7 +295,7 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
#endif

// If there were errors in processing arguments, don't do anything else.
if (Clang->getDiagnostics().hasErrorOccurred())
if (Clang->getDiagnostics().getNumErrors() != NumErrorsBefore)
return false;
// Create and execute the frontend action.
std::unique_ptr<FrontendAction> Act(CreateFrontendAction(*Clang));
Expand Down
Loading