Include namespace contexts in the virtual stack trace, so we get stuff

like this:

Stack dump:
0.	using-directive.cpp:9:14: in compound statement ('{}')
1.	using-directive.cpp:9:14: parsing function body 'A::B::f'
2.	using-directive.cpp:7:3: parsing namespace 'A::B'
3.	using-directive.cpp:5:1: parsing namespace 'A'
4.	clang using-directive.cpp 
Abort

for testcase like like:

namespace A {
  short i;
  namespace B {
    long i;
    void f() { <<crash>>

llvm-svn: 66123
This commit is contained in:
Chris Lattner 2009-03-05 02:09:07 +00:00
parent 78ab338024
commit e332b82320
1 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,10 @@ Parser::DeclTy *Parser::ParseNamespace(unsigned Context) {
DeclTy *NamespcDecl =
Actions.ActOnStartNamespaceDef(CurScope, IdentLoc, Ident, LBrace);
PrettyStackTraceDecl CrashInfo(NamespcDecl, NamespaceLoc, Actions,
PP.getSourceManager(),
"parsing namespace");
while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof))
ParseExternalDeclaration();