зеркало из https://github.com/microsoft/clang.git
Discard unused runtime function declarations (for readability).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59594 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
73d2a1b05b
Коммит
0293d540ba
|
@ -72,6 +72,12 @@ void CodeGenModule::BindRuntimeFunctions() {
|
||||||
llvm::Function *Fn = RuntimeFunctions[i].first;
|
llvm::Function *Fn = RuntimeFunctions[i].first;
|
||||||
const std::string &Name = RuntimeFunctions[i].second;
|
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.
|
// See if there is a conflict against a function.
|
||||||
llvm::Function *Conflict = TheModule.getFunction(Name);
|
llvm::Function *Conflict = TheModule.getFunction(Name);
|
||||||
if (Conflict) {
|
if (Conflict) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче