From c17fb7bd9a06b027c792c7dfad7e9fa430277aff Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 1 Sep 2009 05:12:24 +0000 Subject: [PATCH] Add pretty stack traces when instantiating functions and static data members. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80661 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplateInstantiateDecl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 314a99322b..82228143e4 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -15,6 +15,7 @@ #include "clang/AST/DeclTemplate.h" #include "clang/AST/DeclVisitor.h" #include "clang/AST/Expr.h" +#include "clang/Basic/PrettyStackTrace.h" #include "clang/Lex/Preprocessor.h" #include "llvm/Support/Compiler.h" @@ -1418,6 +1419,11 @@ void Sema::PerformPendingImplicitInstantiations() { // Instantiate function definitions if (FunctionDecl *Function = dyn_cast(Inst.first)) { + PrettyStackTraceActionsDecl CrashInfo(DeclPtrTy::make(Function), + Function->getLocation(), *this, + Context.getSourceManager(), + "instantiating function definition"); + if (!Function->getBody()) InstantiateFunctionDefinition(/*FIXME:*/Inst.second, Function, true); continue; @@ -1426,6 +1432,13 @@ void Sema::PerformPendingImplicitInstantiations() { // Instantiate static data member definitions. VarDecl *Var = cast(Inst.first); assert(Var->isStaticDataMember() && "Not a static data member?"); + + PrettyStackTraceActionsDecl CrashInfo(DeclPtrTy::make(Var), + Var->getLocation(), *this, + Context.getSourceManager(), + "instantiating static data member " + "definition"); + InstantiateStaticDataMemberDefinition(/*FIXME:*/Inst.second, Var, true); } } -- 2.40.0