Don't crash when dumping pretty stack traces, if the current tok is an

annotation token.
 - I'm not sure what the best thing to print is, for now we just print the token
   location and 'at annotation token'.

llvm-svn: 84312
This commit is contained in:
Daniel Dunbar 2009-10-17 06:13:04 +00:00
parent a6e4db8ff7
commit 68d9d7b319
1 changed files with 4 additions and 1 deletions

View File

@ -77,7 +77,10 @@ void PrettyStackTraceParserEntry::print(llvm::raw_ostream &OS) const {
const Preprocessor &PP = P.getPreprocessor();
Tok.getLocation().print(OS, PP.getSourceManager());
OS << ": current parser token '" << PP.getSpelling(Tok) << "'\n";
if (Tok.isAnnotation())
OS << ": at annotation token \n";
else
OS << ": current parser token '" << PP.getSpelling(Tok) << "'\n";
}