Discard unused runtime function declarations (for readability).

llvm-svn: 59594
This commit is contained in:
Daniel Dunbar 2008-11-19 06:15:35 +00:00
parent 8d5bec4c7d
commit 1b9ad472a4
1 changed files with 6 additions and 0 deletions

View File

@ -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) {