Avoid crashing if a directory has no pch files.

Should fix some of the bots that have assertions disabled.

llvm-svn: 187329
This commit is contained in:
Rafael Espindola 2013-07-28 13:23:37 +00:00
parent cd61afb4ee
commit 5150f2f558
2 changed files with 3 additions and 1 deletions

View File

@ -455,6 +455,8 @@ bool FrontendAction::shouldEraseOutputFiles() {
void ASTFrontendAction::ExecuteAction() {
CompilerInstance &CI = getCompilerInstance();
if (!CI.hasPreprocessor())
return;
// FIXME: Move the truncation aspect of this into Sema, we delayed this till
// here so the source manager would be initialized.

View File

@ -1,5 +1,5 @@
// RUN: not %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-empty.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-EMPTY %s
// RUN: not --crash %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-dir.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s
// RUN: not %clang_cc1 -fsyntax-only -include-pch %S/Inputs/badpch-dir.h.gch %s 2>&1 | FileCheck -check-prefix=CHECK-DIR %s
// The purpose of this test is to verify that various invalid PCH files are
// reported as such.