diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-03-05 02:25:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-03-05 02:25:03 +0000 |
| commit | 477f990ac538ba44cb4bcd9e4690dddf2ffba4d8 (patch) | |
| tree | 25f3ec76d7c8f59a16dac5d2b4061739bd82b52f /clang/lib/Parse/ParseDecl.cpp | |
| parent | e332b823205a92ebcccf1f0892fc69de852da545 (diff) | |
| download | bcm5719-llvm-477f990ac538ba44cb4bcd9e4690dddf2ffba4d8.tar.gz bcm5719-llvm-477f990ac538ba44cb4bcd9e4690dddf2ffba4d8.zip | |
Include struct context info for parser/sema crashes. This
gives us:
Stack dump:
0. using-directive.cpp:26:16: in compound statement ('{}')
1. using-directive.cpp:26:16: parsing function body 'A::K1::foo'
2. using-directive.cpp:25:3: parsing struct/union/class body 'A::K1'
3. using-directive.cpp:5:1: parsing namespace 'A'
4. clang using-directive.cpp
Abort
for code like:
namespace A {
...
class K1 {
void foo() { <<crash>>
llvm-svn: 66124
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
| -rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index b24b80eb711..6e0ffe5e2b6 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1096,6 +1096,10 @@ ParseStructDeclaration(DeclSpec &DS, /// void Parser::ParseStructUnionBody(SourceLocation RecordLoc, unsigned TagType, DeclTy *TagDecl) { + PrettyStackTraceDecl CrashInfo(TagDecl, RecordLoc, Actions, + PP.getSourceManager(), + "parsing struct/union body"); + SourceLocation LBraceLoc = ConsumeBrace(); ParseScope StructScope(this, Scope::ClassScope|Scope::DeclScope); |

