15 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTIONIMPORTUTILS_H
16 #define LLVM_TRANSFORMS_UTILS_FUNCTIONIMPORTUTILS_H
41 bool HasExportedFunctions =
false;
48 bool shouldPromoteLocalToGlobal(
const GlobalValue *SGV);
54 bool isNonRenamableLocal(
const GlobalValue &GV)
const;
59 bool isPerformingImport()
const {
return GlobalsToImport !=
nullptr; }
60 bool isModuleExporting()
const {
return HasExportedFunctions; }
70 std::string getName(
const GlobalValue *SGV,
bool DoPromote);
76 void processGlobalsForThinLTO();
89 : M(M), ImportIndex(Index), GlobalsToImport(GlobalsToImport) {
115 Module &M,
const ModuleSummaryIndex &Index,
116 DenseSet<const GlobalValue *> *GlobalsToImport =
nullptr);
GlobalVariable * collectUsedGlobalVariables(const Module &M, SmallPtrSetImpl< GlobalValue * > &Set, bool CompilerUsed)
Given "llvm.used" or "llvm.compiler.used" as a global name, collect the initializer elements of that ...
A Module instance is used to store all the information related to an LLVM module. ...
Implements a dense probed hash-table based set.
Class to handle necessary GlobalValue changes required by ThinLTO function importing, including linkage changes and any necessary renaming.
Class to hold module path string table and global value map, and encapsulate methods for operating on...
FunctionImportGlobalProcessing(Module &M, const ModuleSummaryIndex &Index, DenseSet< const GlobalValue * > *GlobalsToImport=nullptr)
bool hasExportedFunctions(const Module &M) const
Check if the given Module has any functions available for exporting in the index. ...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
bool renameModuleForThinLTO(Module &M, const ModuleSummaryIndex &Index, DenseSet< const GlobalValue * > *GlobalsToImport=nullptr)
Perform in-place global value handling on the given Module for exported local functions renamed and p...
LinkageTypes
An enumeration for the kinds of linkage for global values.
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...