summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-05 00:00:31 +0000
committerChris Lattner <sabre@nondot.org>2009-03-05 00:00:31 +0000
commitbd61a95481aebeaf8e9efec9a17ad5c4b6e6552a (patch)
treeda9bd083a1283bb584697b8fffc32658ff179372 /clang/lib/Parse/ParseStmt.cpp
parent00dfe3040939aea32f1edbfd5e33a1ca6777708d (diff)
downloadbcm5719-llvm-bd61a95481aebeaf8e9efec9a17ad5c4b6e6552a.tar.gz
bcm5719-llvm-bd61a95481aebeaf8e9efec9a17ad5c4b6e6552a.zip
Include information about compound statements when crashing in sema or the
parser. For example, we now print out: 0. t.c:5:10: in compound statement {} 1. t.c:3:12: in compound statement {} 2. clang t.c -fsyntax-only llvm-svn: 66108
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r--clang/lib/Parse/ParseStmt.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 208338a71a4..4f7affc69ca 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -15,10 +15,11 @@
#include "clang/Parse/Parser.h"
#include "ExtensionRAIIObject.h"
#include "AstGuard.h"
-#include "clang/Basic/Diagnostic.h"
-#include "clang/Basic/SourceManager.h"
#include "clang/Parse/DeclSpec.h"
#include "clang/Parse/Scope.h"
+#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/PrettyStackTrace.h"
+#include "clang/Basic/SourceManager.h"
using namespace clang;
//===----------------------------------------------------------------------===//
@@ -409,6 +410,10 @@ Parser::OwningStmtResult Parser::ParseCompoundStatement(bool isStmtExpr) {
/// consume the '}' at the end of the block. It does not manipulate the scope
/// stack.
Parser::OwningStmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
+ PrettyStackTraceLoc CrashInfo(PP.getSourceManager(),
+ Tok.getLocation(),
+ "in compound statement ('{}')");
+
SourceLocation LBraceLoc = ConsumeBrace(); // eat the '{'.
// TODO: "__label__ X, Y, Z;" is the GNU "Local Label" extension. These are
OpenPOWER on IntegriCloud