[cfe-commits] r66149 - /cfe/trunk/lib/Parse/Parser.cpp
Chris Lattner
sabre at nondot.org
Wed Mar 4 23:27:50 PST 2009
Author: lattner
Date: Thu Mar 5 01:27:50 2009
New Revision: 66149
URL: http://llvm.org/viewvc/llvm-project?rev=66149&view=rev
Log:
fix eof check
Modified:
cfe/trunk/lib/Parse/Parser.cpp
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=66149&r1=66148&r2=66149&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Thu Mar 5 01:27:50 2009
@@ -43,11 +43,16 @@
/// what the current token is.
void PrettyStackTraceParserEntry::print(llvm::raw_ostream &OS) const {
const Token &Tok = P.getCurToken();
- if (Tok.getLocation().isInvalid()) {
+ if (Tok.is(tok::eof)) {
OS << "<eof> parser at end of file\n";
return;
}
+ if (Tok.getLocation().isInvalid()) {
+ OS << "<unknown> parser at unknown location\n";
+ return;
+ }
+
const Preprocessor &PP = P.getPreprocessor();
Tok.getLocation().print(OS, PP.getSourceManager());
OS << ": current parser token '" << PP.getSpelling(Tok) << "'\n";
More information about the cfe-commits
mailing list