diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-12-13 18:11:11 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-12-13 18:11:11 +0000 |
commit | fe4e0156c91ffbf582a7133357af74bed2304acb (patch) | |
tree | 38cbbffcbb96d86f5a1b8b81522d62134bc83765 | |
parent | cc9270981e697cbaa2dd1a0e29b0599e556f61ce (diff) |
Add check in the driver to see if a serialized AST file has been successfully
deserialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45006 91177308-0d34-0410-b5e6-96231b3b80d8
-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()); |