Skip to content

Commit

Permalink
Move only unused declaration, the rest will be moved by Linker.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbabokin committed Dec 25, 2015
1 parent 5ac46e5 commit b67d7f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,9 @@ AddBitcodeToModule(const unsigned char *bitcode, int length,
// This trick should be legal, as both modules use the same LLVMContext.
for (llvm::Function& f : *bcModule) {
if (f.isDeclaration()) {
// Declarations with uses will be moved by Linker.
if (f.getNumUses() > 0)
continue;
module->getOrInsertFunction(f.getName(), f.getFunctionType(),
f.getAttributes());
}
Expand Down

0 comments on commit b67d7f0

Please sign in to comment.