[llvm] r223521 - Remove dead code. We are only lazy about functions with bodies.
Rafael Espindola
rafael.espindola at gmail.com
Fri Dec 5 13:36:06 PST 2014
Author: rafael
Date: Fri Dec 5 15:36:06 2014
New Revision: 223521
URL: http://llvm.org/viewvc/llvm-project?rev=223521&view=rev
Log:
Remove dead code. We are only lazy about functions with bodies.
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=223521&r1=223520&r2=223521&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Fri Dec 5 15:36:06 2014
@@ -1518,9 +1518,6 @@ bool ModuleLinker::run() {
Function *SF = LazilyLinkFunctions.back();
LazilyLinkFunctions.pop_back();
- if (!SF)
- continue;
-
Function *DF = cast<Function>(ValueMap[SF]);
if (SF->hasPrefixData()) {
// Link in the prefix data.
@@ -1532,11 +1529,8 @@ bool ModuleLinker::run() {
if (std::error_code EC = SF->materialize())
return emitError(EC.message());
- // Skip if no body (function is external).
- if (SF->isDeclaration())
- continue;
-
// Link in function body.
+ assert(!SF->isDeclaration());
linkFunctionBody(DF, SF);
SF->Dematerialize();
}
More information about the llvm-commits
mailing list