forked from OSchip/llvm-project
Discard unused runtime function declarations (for readability).
llvm-svn: 59594
This commit is contained in:
parent
8d5bec4c7d
commit
1b9ad472a4
|
@ -72,6 +72,12 @@ void CodeGenModule::BindRuntimeFunctions() {
|
|||
llvm::Function *Fn = RuntimeFunctions[i].first;
|
||||
const std::string &Name = RuntimeFunctions[i].second;
|
||||
|
||||
// Discard unused runtime functions.
|
||||
if (Fn->use_empty()) {
|
||||
Fn->eraseFromParent();
|
||||
continue;
|
||||
}
|
||||
|
||||
// See if there is a conflict against a function.
|
||||
llvm::Function *Conflict = TheModule.getFunction(Name);
|
||||
if (Conflict) {
|
||||
|
|
Loading…
Reference in New Issue