diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-05 08:04:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-05 08:04:57 +0000 |
commit | ff9fbcaa8afd7b77ff68716d835fd2e7bd0828a3 (patch) | |
tree | 6ce13db15a4d8087f86386f500b9d91a64198034 /clang/lib | |
parent | eae6cb6154b290c0cb8ce51ed321a4ceade261fc (diff) | |
download | bcm5719-llvm-ff9fbcaa8afd7b77ff68716d835fd2e7bd0828a3.tar.gz bcm5719-llvm-ff9fbcaa8afd7b77ff68716d835fd2e7bd0828a3.zip |
if we die in IR generation of a compound statement, include
it in the stack trace, giving us stuff like:
Stack dump:
0. Program arguments: clang t.c -emit-llvm
1. <eof> parser at end of file
2. t.c:1:5: LLVM IR generation of declaration 'a'
3. t.c:1:9: LLVM IR generation of compound statement ('{}')
4. t.c:2:3: LLVM IR generation of compound statement ('{}')
Abort
llvm-svn: 66154
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 839ba671b92..f4d6679c93b 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -15,6 +15,7 @@ #include "CodeGenModule.h" #include "CodeGenFunction.h" #include "clang/AST/StmtVisitor.h" +#include "clang/Basic/PrettyStackTrace.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/StringExtras.h" #include "llvm/InlineAsm.h" @@ -123,7 +124,9 @@ bool CodeGenFunction::EmitSimpleStmt(const Stmt *S) { /// (for use by the statement expression extension). RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast, llvm::Value *AggLoc, bool isAggVol) { - + PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),S.getLBracLoc(), + "LLVM IR generation of compound statement ('{}')"); + CGDebugInfo *DI = getDebugInfo(); if (DI) { EnsureInsertPoint(); |