ADT: Support copying of IntrusiveRefCntPtr objects
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 3 Dec 2020 23:28:40 +0000 (15:28 -0800)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 4 Dec 2020 01:42:32 +0000 (17:42 -0800)
commit2e83ccc2ee333389110659f3cb313968a0c970d4
tree4296b7a4f991507bd05a7bbdf0995852e823e453
parentc95acf052b53e5c18e380b8632e7de24b5e65dbe
ADT: Support copying of IntrusiveRefCntPtr objects

This was partially supported but untested for RefCountedBase (the
implicit copy assignment would've been problematic - so delete that) and
unsupported (would not have compiled, because std::atomic is
non-copyable) for ThreadSafeRefCountedBase (implement similar support
to RefCountedBase)

Fix the test that had a copy ctor for the derived object but called
RefCountBase's default ctor from that copy ctor - which meant it wasn't
actually testing RefCountBase's copy semantics.
llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
llvm/unittests/ADT/IntrusiveRefCntPtrTest.cpp