diff options
-rw-r--r-- | Driver/clang.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 8a6d132684..bcffeb73b7 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -984,7 +984,14 @@ static void ProcessSerializedFile(const std::string& InFile, Diagnostic& Diag, exit (1); } - TranslationUnit* TU = TranslationUnit::ReadBitcodeFile(Filename,FileMgr); + TranslationUnit* TU = TranslationUnit::ReadBitcodeFile(Filename,FileMgr); + + if (!TU) { + fprintf(stderr, "error: file '%s' could not be deserialized\n", + InFile.c_str()); + exit (1); + } + ASTConsumer* Consumer = CreateASTConsumer(InFile,Diag, FileMgr,TU->getLangOpts()); |