[lld] r269331 - Move undefine to a separate function.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 12:46:15 PDT 2016


Author: pcc
Date: Thu May 12 14:46:14 2016
New Revision: 269331

URL: http://llvm.org/viewvc/llvm-project?rev=269331&view=rev
Log:
Move undefine to a separate function.

Modified:
    lld/trunk/ELF/LTO.cpp

Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=269331&r1=269330&r2=269331&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Thu May 12 14:46:14 2016
@@ -91,6 +91,10 @@ BitcodeCompiler::BitcodeCompiler()
     : Combined(new llvm::Module("ld-temp.o", Driver->Context)),
       Mover(*Combined) {}
 
+static void undefine(Symbol *S) {
+  replaceBody<Undefined>(S, S->body()->getName(), STV_DEFAULT, 0);
+}
+
 void BitcodeCompiler::add(BitcodeFile &F) {
   std::unique_ptr<IRObjectFile> Obj = std::move(F.Obj);
   std::vector<GlobalValue *> Keep;
@@ -139,7 +143,7 @@ void BitcodeCompiler::add(BitcodeFile &F
     // needs to be able to replace the original definition without conflicting.
     // In the latter case, we need to allow the combined LTO object to provide a
     // definition with the same name, for example when doing parallel codegen.
-    replaceBody<Undefined>(S, S->body()->getName(), STV_DEFAULT, 0);
+    undefine(S);
 
     if (!GV)
       // Module asm symbol.




More information about the llvm-commits mailing list