[llvm] r259973 - Relax assertion in ReplaceableMetadataImpl::replaceAllUsesWith().
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 6 12:41:57 PST 2016
Can you add a unit test for this? I think it's fine to remove the
assertion (since you found a legitimate use), but I think it should
be tested locally in LLVM. IIRC, unittests/IR/MetadataTest.cpp has
a lot of stuff like this.
> On 2016-Feb-05, at 17:56, Adrian Prantl via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
> Author: adrian
> Date: Fri Feb 5 19:56:55 2016
> New Revision: 259973
>
> URL: http://llvm.org/viewvc/llvm-project?rev=259973&view=rev
> Log:
> Relax assertion in ReplaceableMetadataImpl::replaceAllUsesWith().
> There is a legitimate use-case in clang where we need to replace a
> temporary placeholder node with the temporary node that may be a
> forward declaration.
>
> <rdar://problem/24493203>
>
> Modified:
> llvm/trunk/lib/IR/Metadata.cpp
>
> Modified: llvm/trunk/lib/IR/Metadata.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=259973&r1=259972&r2=259973&view=diff
> ==============================================================================
> --- llvm/trunk/lib/IR/Metadata.cpp (original)
> +++ llvm/trunk/lib/IR/Metadata.cpp Fri Feb 5 19:56:55 2016
> @@ -188,8 +188,6 @@ void ReplaceableMetadataImpl::moveRef(vo
> }
>
> void ReplaceableMetadataImpl::replaceAllUsesWith(Metadata *MD) {
> - assert(!(MD && isa<MDNode>(MD) && cast<MDNode>(MD)->isTemporary()) &&
> - "Expected non-temp node");
> assert(CanReplace &&
> "Attempted to replace Metadata marked for no replacement");
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list