[cfe-commits] r66154 - /cfe/trunk/lib/CodeGen/CGStmt.cpp
Chris Lattner
sabre at nondot.org
Thu Mar 5 00:04:58 PST 2009
Author: lattner
Date: Thu Mar 5 02:04:57 2009
New Revision: 66154
URL: http://llvm.org/viewvc/llvm-project?rev=66154&view=rev
Log:
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
Modified:
cfe/trunk/lib/CodeGen/CGStmt.cpp
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=66154&r1=66153&r2=66154&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu Mar 5 02:04:57 2009
@@ -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 @@
/// (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();
More information about the cfe-commits
mailing list