summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-10-17 06:13:04 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-10-17 06:13:04 +0000
commit68d9d7b319368dcd422a161bc67279dee1b0eba8 (patch)
treecb933aef676baeb22b51b8733379ffd687c3869d /clang/lib/Parse/Parser.cpp
parenta6e4db8ff798eac256ae029151af52e20bd5f9fd (diff)
downloadbcm5719-llvm-68d9d7b319368dcd422a161bc67279dee1b0eba8.tar.gz
bcm5719-llvm-68d9d7b319368dcd422a161bc67279dee1b0eba8.zip
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
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 2f500a484da..bc737e9f0c8 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -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";
}
OpenPOWER on IntegriCloud