Not entirely sure whether this is correct. I was unable to use Bugpoint to debug a miscompilation because its function splitting phase caused many verifier errors of this type: "Declaration may not be in a Comdat!" This patch resolved the issue.
This is similar in spirit to https://reviews.llvm.org/D21274 .