]> granicus.if.org Git - llvm/commitdiff
Merge 80780 from mainline.
authorTanya Lattner <tonic@nondot.org>
Fri, 4 Sep 2009 19:27:52 +0000 (19:27 +0000)
committerTanya Lattner <tonic@nondot.org>
Fri, 4 Sep 2009 19:27:52 +0000 (19:27 +0000)
Opaque types didn't work if llvm_is_multithreaded().
AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure.
Fix it by using the just constructed tmp instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@81030 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index 8aaee5433da642f37b7f6ee916156c263f43cb22..aec26ce4865de4b8f08c8d01bb0532a93944fcd4 100644 (file)
@@ -492,7 +492,7 @@ void DerivedType::dropAllTypeUses() {
         tmp = AlwaysOpaqueTy;
         if (!tmp) {
           tmp = OpaqueType::get(getContext());
-          PATypeHolder* tmp2 = new PATypeHolder(AlwaysOpaqueTy);
+          PATypeHolder* tmp2 = new PATypeHolder(tmp);
           sys::MemoryFence();
           AlwaysOpaqueTy = tmp;
           Holder = tmp2;