<p dir="ltr">Thanks!</p>
<div class="gmail_quote">On Dec 21, 2015 10:53 AM, "Teresa Johnson via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: tejohnson<br>
Date: Mon Dec 21 09:49:59 2015<br>
New Revision: 256162<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=256162&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=256162&view=rev</a><br>
Log:<br>
Remove unused functions from ModuleLinker (NFC)<br>
<br>
Remove a couple ModuleLinker methods and a related static function that<br>
are no longer used after the linker split.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Linker/LinkModules.cpp<br>
<br>
Modified: llvm/trunk/lib/Linker/LinkModules.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=256162&r1=256161&r2=256162&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=256162&r1=256161&r2=256162&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)<br>
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Dec 21 09:49:59 2015<br>
@@ -142,16 +142,6 @@ class ModuleLinker {<br>
   /// to be adjusted.<br>
   GlobalValue::LinkageTypes getLinkage(const GlobalValue *SGV);<br>
<br>
-  /// Copies the necessary global value attributes and name from the source<br>
-  /// to the newly cloned global value.<br>
-  void copyGVAttributes(GlobalValue *NewGV, const GlobalValue *SrcGV);<br>
-<br>
-  /// Updates the visibility for the new global cloned from the source<br>
-  /// and, if applicable, linked with an existing destination global.<br>
-  /// Handles visibility change required for promoted locals.<br>
-  void setVisibility(GlobalValue *NewGV, const GlobalValue *SGV,<br>
-                     const GlobalValue *DGV = nullptr);<br>
-<br>
 public:<br>
   ModuleLinker(IRMover &Mover, Module &SrcM, unsigned Flags,<br>
                const FunctionInfoIndex *Index = nullptr,<br>
@@ -175,38 +165,6 @@ public:<br>
 };<br>
 }<br>
<br>
-/// The LLVM SymbolTable class autorenames globals that conflict in the symbol<br>
-/// table. This is good for all clients except for us. Go through the trouble<br>
-/// to force this back.<br>
-static void forceRenaming(GlobalValue *GV, StringRef Name) {<br>
-  // If the global doesn't force its name or if it already has the right name,<br>
-  // there is nothing for us to do.<br>
-  // Note that any required local to global promotion should already be done,<br>
-  // so promoted locals will not skip this handling as their linkage is no<br>
-  // longer local.<br>
-  if (GV->hasLocalLinkage() || GV->getName() == Name)<br>
-    return;<br>
-<br>
-  Module *M = GV->getParent();<br>
-<br>
-  // If there is a conflict, rename the conflict.<br>
-  if (GlobalValue *ConflictGV = M->getNamedValue(Name)) {<br>
-    GV->takeName(ConflictGV);<br>
-    ConflictGV->setName(Name); // This will cause ConflictGV to get renamed<br>
-    assert(ConflictGV->getName() != Name && "forceRenaming didn't work");<br>
-  } else {<br>
-    GV->setName(Name); // Force the name back<br>
-  }<br>
-}<br>
-<br>
-/// copy additional attributes (those not needed to construct a GlobalValue)<br>
-/// from the SrcGV to the DestGV.<br>
-void ModuleLinker::copyGVAttributes(GlobalValue *NewGV,<br>
-                                    const GlobalValue *SrcGV) {<br>
-  NewGV->copyAttributesFrom(SrcGV);<br>
-  forceRenaming(NewGV, getName(SrcGV));<br>
-}<br>
-<br>
 bool ModuleLinker::doImportAsDefinition(const GlobalValue *SGV) {<br>
   if (!isPerformingImport())<br>
     return false;<br>
@@ -383,18 +341,6 @@ getMinVisibility(GlobalValue::Visibility<br>
   return GlobalValue::DefaultVisibility;<br>
 }<br>
<br>
-void ModuleLinker::setVisibility(GlobalValue *NewGV, const GlobalValue *SGV,<br>
-                                 const GlobalValue *DGV) {<br>
-  GlobalValue::VisibilityTypes Visibility = SGV->getVisibility();<br>
-  if (DGV)<br>
-    Visibility = getMinVisibility(DGV->getVisibility(), Visibility);<br>
-  // For promoted locals, mark them hidden so that they can later be<br>
-  // stripped from the symbol table to reduce bloat.<br>
-  if (SGV->hasLocalLinkage() && doPromoteLocalToGlobal(SGV))<br>
-    Visibility = GlobalValue::HiddenVisibility;<br>
-  NewGV->setVisibility(Visibility);<br>
-}<br>
-<br>
 bool ModuleLinker::getComdatLeader(Module &M, StringRef ComdatName,<br>
                                    const GlobalVariable *&GVar) {<br>
   const GlobalValue *GVal = M.getNamedValue(ComdatName);<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>