Do not destroy external linkage when deleting function body
authorPetar Jovanovic <petar.jovanovic@imgtec.com>
Tue, 23 Sep 2014 12:54:19 +0000 (12:54 +0000)
committerPetar Jovanovic <petar.jovanovic@imgtec.com>
Tue, 23 Sep 2014 12:54:19 +0000 (12:54 +0000)
commitfd42335e831d256f34b4bd995fe8dc1e8d8d2f2c
tree1bbd5a9a683171c0ddb06e0a303b7e62953d4567
parent4850be49a3d8b50eab2d3b9b2b2ade823194a5d0
Do not destroy external linkage when deleting function body

The function deleteBody() converts the linkage to external and thus destroys
original linkage type value. Lack of correct linkage type causes wrong
relocations to be emitted later.
Calling dropAllReferences() instead of deleteBody() will fix the issue.

Differential Revision: http://reviews.llvm.org/D5415

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218302 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Bitcode/Reader/BitcodeReader.cpp
unittests/Bitcode/BitReaderTest.cpp