[llvm-branch-commits] [cfe-branch] r228684 - Port r226896 to the 3.6 branch.
Rafael Espindola
rafael.espindola at gmail.com
Tue Feb 10 04:57:14 PST 2015
Author: rafael
Date: Tue Feb 10 06:57:14 2015
New Revision: 228684
URL: http://llvm.org/viewvc/llvm-project?rev=228684&view=rev
Log:
Port r226896 to the 3.6 branch.
Original message:
[pr22293] Don't crash during codegen of a recursive destructor.
In ItaniumCXXABI::EmitCXXDestructors we first emit the base destructor
and then try to emit the complete one as an alias.
If in the base ends up calling the complete destructor, the GD for the
complete will be in the list of deferred decl by the time we replace
it with an alias and delete the original GV.
Modified:
cfe/branches/release_36/lib/CodeGen/CodeGenModule.h
cfe/branches/release_36/test/CodeGenCXX/ctor-dtor-alias.cpp
Modified: cfe/branches/release_36/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/CodeGenModule.h?rev=228684&r1=228683&r2=228684&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/branches/release_36/lib/CodeGen/CodeGenModule.h Tue Feb 10 06:57:14 2015
@@ -324,7 +324,7 @@ private:
/// referenced. These get code generated when the module is done.
struct DeferredGlobal {
DeferredGlobal(llvm::GlobalValue *GV, GlobalDecl GD) : GV(GV), GD(GD) {}
- llvm::AssertingVH<llvm::GlobalValue> GV;
+ llvm::TrackingVH<llvm::GlobalValue> GV;
GlobalDecl GD;
};
std::vector<DeferredGlobal> DeferredDeclsToEmit;
Modified: cfe/branches/release_36/test/CodeGenCXX/ctor-dtor-alias.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/ctor-dtor-alias.cpp?rev=228684&r1=228683&r2=228684&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/ctor-dtor-alias.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/ctor-dtor-alias.cpp Tue Feb 10 06:57:14 2015
@@ -232,3 +232,14 @@ foo::~foo() {}
// CHECK6: @_ZN6test113fooD2Ev = alias {{.*}} @_ZN6test113barD2Ev
// CHECK6: @_ZN6test113fooD1Ev = alias {{.*}} @_ZN6test113fooD2Ev
}
+
+namespace test12 {
+template <int>
+struct foo {
+ ~foo() { delete this; }
+};
+
+template class foo<1>;
+// CHECK6: @_ZN6test123fooILi1EED1Ev = weak_odr alias {{.*}} @_ZN6test123fooILi1EED2Ev
+// CHECK6: define weak_odr void @_ZN6test123fooILi1EED2Ev({{.*}}) {{.*}} comdat($_ZN6test123fooILi1EED5Ev)
+}
More information about the llvm-branch-commits
mailing list