#include "llvm/Transforms/Utils/FunctionImportUtils.h"
#include "llvm/Support/CommandLine.h"
usingnamespacellvm;
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."));
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;
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) { … }