[cfe-commits] r45006 - /cfe/trunk/Driver/clang.cpp
Ted Kremenek
kremenek at apple.com
Thu Dec 13 10:11:11 PST 2007
Author: kremenek
Date: Thu Dec 13 12:11:11 2007
New Revision: 45006
URL: http://llvm.org/viewvc/llvm-project?rev=45006&view=rev
Log:
Add check in the driver to see if a serialized AST file has been successfully
deserialized.
Modified:
cfe/trunk/Driver/clang.cpp
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=45006&r1=45005&r2=45006&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Thu Dec 13 12:11:11 2007
@@ -984,7 +984,14 @@
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());
More information about the cfe-commits
mailing list