llvm/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp

//===- lib/Transforms/Utils/FunctionImportUtils.cpp - Importing utilities -===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the FunctionImportGlobalProcessing class, used
// to perform the necessary global value handling for function importing.
//
//===----------------------------------------------------------------------===//

#include "llvm/Transforms/Utils/FunctionImportUtils.h"
#include "llvm/Support/CommandLine.h"
usingnamespacellvm;

/// Uses the "source_filename" instead of a Module hash ID for the suffix of
/// promoted locals during LTO. NOTE: This requires that the source filename
/// has a unique name / path to avoid name collisions.
static cl::opt<bool> UseSourceFilenameForPromotedLocals(
    "use-source-filename-for-promoted-locals", cl::Hidden,
    cl::desc("Uses the source file name instead of the Module hash. "
             "This requires that the source filename has a unique name / "
             "path to avoid name collisions."));

/// Checks if we should import SGV as a definition, otherwise import as a
/// declaration.
bool FunctionImportGlobalProcessing::doImportAsDefinition(
    const GlobalValue *SGV) {}

bool FunctionImportGlobalProcessing::shouldPromoteLocalToGlobal(
    const GlobalValue *SGV, ValueInfo VI) {}

#ifndef NDEBUG
bool FunctionImportGlobalProcessing::isNonRenamableLocal(
    const GlobalValue &GV) const {
  if (!GV.hasLocalLinkage())
    return false;
  // This needs to stay in sync with the logic in buildModuleSummaryIndex.
  if (GV.hasSection())
    return true;
  if (Used.count(const_cast<GlobalValue *>(&GV)))
    return true;
  return false;
}
#endif

std::string
FunctionImportGlobalProcessing::getPromotedName(const GlobalValue *SGV) {}

GlobalValue::LinkageTypes
FunctionImportGlobalProcessing::getLinkage(const GlobalValue *SGV,
                                           bool DoPromote) {}

void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {}

void FunctionImportGlobalProcessing::processGlobalsForThinLTO() {}

bool FunctionImportGlobalProcessing::run() {}

bool llvm::renameModuleForThinLTO(Module &M, const ModuleSummaryIndex &Index,
                                  bool ClearDSOLocalOnDeclarations,
                                  SetVector<GlobalValue *> *GlobalsToImport) {}