diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-26 20:23:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-26 20:23:13 +0000 |
commit | 95ae53ba5d4649e85aadf4852c2c99cb4ea3d836 (patch) | |
tree | ad31b6b0514f6b026c82e793f71daf709d464926 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 0cbd9c038bb8e45179007c0dc0196659bb478c76 (diff) |
Produce better pretty stack traces from crashes in template instantiation: add
pretty stack trace entries for all cases where we instantiate the definition of
something, and include the fully-qualified name with template arguments in the
name of the instantiated entity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 39ea31656a..554d1abbed 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -21,6 +21,7 @@ #include "clang/Sema/DeclSpec.h" #include "clang/Sema/Initialization.h" #include "clang/Sema/Lookup.h" +#include "clang/Sema/PrettyDeclStackTrace.h" #include "clang/Sema/Template.h" #include "clang/Sema/TemplateDeduction.h" @@ -1955,6 +1956,8 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation, InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation); if (Inst.isInvalid()) return true; + PrettyDeclStackTraceEntry CrashInfo(*this, Instantiation, SourceLocation(), + "instantiating class definition"); // Enter the scope of this instantiation. We don't use // PushDeclContext because we don't have a scope. @@ -2178,6 +2181,8 @@ bool Sema::InstantiateEnum(SourceLocation PointOfInstantiation, InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation); if (Inst.isInvalid()) return true; + PrettyDeclStackTraceEntry CrashInfo(*this, Instantiation, SourceLocation(), + "instantiating enum definition"); // The instantiation is visible here, even if it was first declared in an // unimported module. @@ -2250,6 +2255,8 @@ bool Sema::InstantiateInClassInitializer( InstantiatingTemplate Inst(*this, PointOfInstantiation, Instantiation); if (Inst.isInvalid()) return true; + PrettyDeclStackTraceEntry CrashInfo(*this, Instantiation, SourceLocation(), + "instantiating default member init"); // Enter the scope of this instantiation. We don't use PushDeclContext because // we don't have a scope. |