[llvm] r256162 - Remove unused functions from ModuleLinker (NFC)

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 09:41:31 PST 2015


Thanks!
On Dec 21, 2015 10:53 AM, "Teresa Johnson via llvm-commits" <
llvm-commits at lists.llvm.org> wrote:

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


More information about the llvm-commits mailing list