[cfe-commits] r84312 - /cfe/trunk/lib/Parse/Parser.cpp

Daniel Dunbar daniel at zuster.org
Fri Oct 16 23:13:04 PDT 2009


Author: ddunbar
Date: Sat Oct 17 01:13:04 2009
New Revision: 84312

URL: http://llvm.org/viewvc/llvm-project?rev=84312&view=rev
Log:
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'.

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=84312&r1=84311&r2=84312&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Sat Oct 17 01:13:04 2009
@@ -77,7 +77,10 @@
 
   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";
 }
 
 





More information about the cfe-commits mailing list