[Cloning] Copy metadata of global declarations
authorRuiling Song <ruiling.song@amd.com>
Thu, 17 Dec 2020 00:03:20 +0000 (08:03 +0800)
committerRuiling Song <ruiling.song@amd.com>
Fri, 8 Jan 2021 00:21:18 +0000 (08:21 +0800)
commit8dddcc762dd98d53b9406b36e92f62502834187c
tree210052f34c1779e2e56b6006a96e253ac81d26f7
parent6acfc3a78210639367ab8345a9af04e97692a661
[Cloning] Copy metadata of global declarations

We have modules with metadata on declarations, and out-of-tree passes
use that metadata, and we need to clone those modules. We really expect
such metadata is kept during the clone operation.

Reviewed by: arsenm, aprantl

Differential Revision: https://reviews.llvm.org/D93451
llvm/lib/Transforms/Utils/CloneModule.cpp
llvm/test/Other/copy-metadata-of-declaration.ll [new file with mode: 0644]