diff options
author | dim <dim@FreeBSD.org> | 2014-09-21 15:37:39 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-09-21 15:37:39 +0000 |
commit | 17dda45b300572031284676263e76ce1c05f2807 (patch) | |
tree | 2f079b6c441b61344fc1274eba1bb7d619b85f2d /contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff | |
parent | aa335f6556c9795b0e4dbe2f23b03824c0dbeee1 (diff) | |
download | FreeBSD-src-17dda45b300572031284676263e76ce1c05f2807.zip FreeBSD-src-17dda45b300572031284676263e76ce1c05f2807.tar.gz |
Add a few missing llvm/clang patches, update the other ones to be able
to apply with the same patch options onto a fresh upstream llvm/clang
3.4.1 checkout, and use approximately the same header tempate for them.
MFC after: 3 days
Diffstat (limited to 'contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff')
-rw-r--r-- | contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff | 75 |
1 files changed, 46 insertions, 29 deletions
diff --git a/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff b/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff index be4ce55..4088dbb 100644 --- a/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff +++ b/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff @@ -1,8 +1,17 @@ -diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp -index 59ba47c..dddc7e7 100644 ---- a/lib/CodeGen/CGDebugInfo.cpp -+++ b/lib/CodeGen/CGDebugInfo.cpp -@@ -2251,9 +2251,10 @@ llvm::DICompositeType CGDebugInfo::CreateLimitedType(const RecordType *Ty) { +Pull in r200797 from upstream clang trunk (by Adrian Prantl): + + Debug info: fix a crasher when when emitting debug info for + not-yet-completed templated types. getTypeSize() needs a complete type. + + rdar://problem/15931354 + +Introduced here: http://svnweb.freebsd.org/changeset/base/271282 + +Index: tools/clang/lib/CodeGen/CGDebugInfo.cpp +=================================================================== +--- tools/clang/lib/CodeGen/CGDebugInfo.cpp ++++ tools/clang/lib/CodeGen/CGDebugInfo.cpp +@@ -2251,9 +2251,10 @@ llvm::DICompositeType CGDebugInfo::CreateLimitedTy if (T && (!T.isForwardDecl() || !RD->getDefinition())) return T; @@ -16,36 +25,44 @@ index 59ba47c..dddc7e7 100644 return getOrCreateRecordFwdDecl(Ty, RDContext); uint64_t Size = CGM.getContext().getTypeSize(Ty); -diff --git a/test/CodeGenCXX/debug-info-template-fwd.cpp b/test/CodeGenCXX/debug-info-template-fwd.cpp -new file mode 100644 -index 0000000..b2b7073 ---- /dev/null -+++ b/test/CodeGenCXX/debug-info-template-fwd.cpp -@@ -0,0 +1,27 @@ +Index: tools/clang/test/CodeGenCXX/debug-info-template-fwd.cpp +=================================================================== +--- tools/clang/test/CodeGenCXX/debug-info-template-fwd.cpp ++++ tools/clang/test/CodeGenCXX/debug-info-template-fwd.cpp +@@ -0,0 +1,36 @@ +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -g -emit-llvm -o - | FileCheck %s -+// This test is for a crash when emitting debug info for not-yet-completed -+// types. ++// This test is for a crash when emitting debug info for not-yet-completed types. +// Test that we don't actually emit a forward decl for the offending class: -+// CHECK: [ DW_TAG_structure_type ] [Derived<int>] {{.*}} [def] ++// CHECK: [ DW_TAG_class_type ] [Derived<const __CFString, Foo>] {{.*}} [def] +// rdar://problem/15931354 -+template <class A> class Derived; ++typedef const struct __CFString * CFStringRef; ++template <class R> class Returner {}; ++typedef const __CFString String; + -+template <class A> class Base { -+ static Derived<A> *create(); ++template <class A, class B> class Derived; ++ ++template <class A, class B> ++class Base ++{ ++ static Derived<A, B>* create(); ++}; ++ ++template <class A, class B> ++class Derived : public Base<A, B> { ++public: ++ static void foo(); +}; + -+template <class A> struct Derived : Base<A> { ++class Foo ++{ ++ Foo(); ++ static Returner<Base<String,Foo> > all(); +}; + -+Base<int> *f; ++Foo::Foo(){} + -+// During the instantiation of Derived<int>, Base<int> becomes required to be -+// complete - since the declaration has already been emitted (due to 'f', -+// above), we immediately try to build debug info for Base<int> which then -+// requires the (incomplete definition) of Derived<int> which is problematic. -+// -+// (if 'f' is not present, the point at which Base<int> becomes required to be -+// complete during the instantiation of Derived<int> is a no-op because -+// Base<int> was never emitted so we ignore it and carry on until we -+// wire up the base class of Derived<int> in the debug info later on) -+Derived<int> d; ++Returner<Base<String,Foo> > Foo::all() ++{ ++ Derived<String,Foo>::foo(); ++ return Foo::all(); ++} |