15 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTIONIMPORTUTILS_H 16 #define LLVM_TRANSFORMS_UTILS_FUNCTIONIMPORTUTILS_H 41 bool HasExportedFunctions =
false;
53 bool shouldPromoteLocalToGlobal(
const GlobalValue *SGV);
59 bool isNonRenamableLocal(
const GlobalValue &GV)
const;
64 bool isPerformingImport()
const {
return GlobalsToImport !=
nullptr; }
65 bool isModuleExporting()
const {
return HasExportedFunctions; }
75 std::string getName(
const GlobalValue *SGV,
bool DoPromote);
81 void processGlobalsForThinLTO();
94 : M(M), ImportIndex(Index), GlobalsToImport(GlobalsToImport) {
112 static bool doImportAsDefinition(
const GlobalValue *SGV,
This class represents lattice values for constants.
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.
bool hasExportedFunctions(const Module &M) const
Check if the given Module has any functions available for exporting in the index. ...
Class to hold module path string table and global value map, and encapsulate methods for operating on...
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...
FunctionImportGlobalProcessing(Module &M, const ModuleSummaryIndex &Index, SetVector< GlobalValue *> *GlobalsToImport=nullptr)
void computeSyntheticCounts(ModuleSummaryIndex &Index)
Compute synthetic function entry counts.
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 ...
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...
A vector that has set insertion semantics.