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) {
107 static bool doImportAsDefinition(
const GlobalValue *SGV,
114 Module &M,
const ModuleSummaryIndex &Index,
115 SetVector<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. ...
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...
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...
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...
bool renameModuleForThinLTO(Module &M, const ModuleSummaryIndex &Index, SetVector< GlobalValue * > *GlobalsToImport=nullptr)
Perform in-place global value handling on the given Module for exported local functions renamed and p...
A vector that has set insertion semantics.
FunctionImportGlobalProcessing(Module &M, const ModuleSummaryIndex &Index, SetVector< GlobalValue * > *GlobalsToImport=nullptr)