aboutsummaryrefslogtreecommitdiff
path: root/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
commit9fa31dd71e0414e2ca905380e2f8d42710b22c82 (patch)
treede5c5700ac779242d7bbbffd7761496c7689f5ec /lib/Parse/Parser.cpp
parent7804bcba90bf5ea8ec6cd0f6cc9a64577f1a9259 (diff)
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'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 2f500a484d..bc737e9f0c 100644
--- a/lib/Parse/Parser.cpp
+++ b/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";
}