diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-03 09:13:36 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-03 09:13:36 +0000 |
commit | 33671988f1dd9335ddc2badd4abe001f7319c48f (patch) | |
tree | 268dbbfd8f67f275f2b65d333f78aeb90110ddc4 /lib/Frontend/PCHWriterDecl.cpp | |
parent | 360435908c9b90429cfe192fab22854af1d4497c (diff) |
Use llvm_report_error instead of fprintf + assert + exit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriterDecl.cpp')
-rw-r--r-- | lib/Frontend/PCHWriterDecl.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Frontend/PCHWriterDecl.cpp b/lib/Frontend/PCHWriterDecl.cpp index c7bfee2c8b..64b1aaf478 100644 --- a/lib/Frontend/PCHWriterDecl.cpp +++ b/lib/Frontend/PCHWriterDecl.cpp @@ -14,9 +14,9 @@ #include "clang/Frontend/PCHWriter.h" #include "clang/AST/DeclVisitor.h" #include "clang/AST/Expr.h" +#include "llvm/ADT/Twine.h" #include "llvm/Bitcode/BitstreamWriter.h" -#include <cstdio> - +#include "llvm/Support/ErrorHandling.h" using namespace clang; //===----------------------------------------------------------------------===// @@ -568,12 +568,9 @@ void PCHWriter::WriteDecl(ASTContext &Context, Decl *D) { W.Visit(D); if (DC) W.VisitDeclContext(DC, LexicalOffset, VisibleOffset); - if (!W.Code) { - fprintf(stderr, "Cannot serialize declaration of kind %s\n", - D->getDeclKindName()); - assert(false && "Unhandled declaration kind while generating PCH"); - exit(-1); - } + if (!W.Code) + llvm::llvm_report_error(llvm::StringRef("unexpected declaration kind '") + + D->getDeclKindName() + "'"); Stream.EmitRecord(W.Code, Record, W.AbbrevToUse); // If the declaration had any attributes, write them now. |