LLVM 19.0.0git
Functions
of APIs to run individual stages in isolation.

Functions

std::unique_ptr< ModuleSummaryIndexllvm::ThinLTOCodeGenerator::linkCombinedIndex ()
 Produce the combined summary index from all the bitcode files: "thin-link".
 
void llvm::ThinLTOCodeGenerator::promote (Module &Module, ModuleSummaryIndex &Index, const lto::InputFile &File)
 Perform promotion and renaming of exported internal functions, and additionally resolve weak and linkonce symbols.
 
void llvm::ThinLTOCodeGenerator::emitImports (Module &Module, StringRef OutputName, ModuleSummaryIndex &Index, const lto::InputFile &File)
 Compute and emit the imported files for module at ModulePath.
 
void llvm::ThinLTOCodeGenerator::crossModuleImport (Module &Module, ModuleSummaryIndex &Index, const lto::InputFile &File)
 Perform cross-module importing for the module identified by ModuleIdentifier.
 
void llvm::ThinLTOCodeGenerator::gatherImportedSummariesForModule (Module &Module, ModuleSummaryIndex &Index, std::map< std::string, GVSummaryMapTy > &ModuleToSummariesForIndex, const lto::InputFile &File)
 Compute the list of summaries needed for importing into module.
 
void llvm::ThinLTOCodeGenerator::internalize (Module &Module, ModuleSummaryIndex &Index, const lto::InputFile &File)
 Perform internalization.
 
void llvm::ThinLTOCodeGenerator::optimize (Module &Module)
 Perform post-importing ThinLTO optimizations.
 
std::string llvm::ThinLTOCodeGenerator::writeGeneratedObject (int count, StringRef CacheEntryPath, const MemoryBuffer &OutputBuffer)
 Write temporary object file to SavedObjectDirectoryPath, write symlink to Cache directory if needed.
 

Detailed Description

Function Documentation

◆ crossModuleImport()

void ThinLTOCodeGenerator::crossModuleImport ( Module Module,
ModuleSummaryIndex Index,
const lto::InputFile File 
)

Perform cross-module importing for the module identified by ModuleIdentifier.

Definition at line 727 of file ThinLTOCodeGenerator.cpp.

References llvm::ComputeCrossModuleImport(), computeDeadSymbolsInIndex(), llvm::Module::getModuleIdentifier(), and llvm::Module::getTargetTriple().

◆ emitImports()

void ThinLTOCodeGenerator::emitImports ( Module Module,
StringRef  OutputName,
ModuleSummaryIndex Index,
const lto::InputFile File 
)

Compute and emit the imported files for module at ModulePath.

Emit the list of files needed for importing into module.

Definition at line 805 of file ThinLTOCodeGenerator.cpp.

References llvm::ComputeCrossModuleImport(), computeDeadSymbolsInIndex(), llvm::EmitImportsFiles(), llvm::gatherImportedSummariesForModule(), llvm::Module::getModuleIdentifier(), llvm::Module::getTargetTriple(), and llvm::report_fatal_error().

◆ gatherImportedSummariesForModule()

void ThinLTOCodeGenerator::gatherImportedSummariesForModule ( Module Module,
ModuleSummaryIndex Index,
std::map< std::string, GVSummaryMapTy > &  ModuleToSummariesForIndex,
const lto::InputFile File 
)

◆ internalize()

void ThinLTOCodeGenerator::internalize ( Module TheModule,
ModuleSummaryIndex Index,
const lto::InputFile File 
)

◆ linkCombinedIndex()

std::unique_ptr< ModuleSummaryIndex > ThinLTOCodeGenerator::linkCombinedIndex ( )

Produce the combined summary index from all the bitcode files: "thin-link".

Definition at line 609 of file ThinLTOCodeGenerator.cpp.

References llvm::errs(), llvm::logAllUnhandledErrors(), and llvm::Mod.

Referenced by llvm::ThinLTOCodeGenerator::run().

◆ optimize()

void ThinLTOCodeGenerator::optimize ( Module Module)

Perform post-importing ThinLTO optimizations.

Definition at line 914 of file ThinLTOCodeGenerator.cpp.

References llvm::TargetMachineBuilder::create(), and llvm::Module::getTargetTriple().

◆ promote()

void ThinLTOCodeGenerator::promote ( Module TheModule,
ModuleSummaryIndex Index,
const lto::InputFile File 
)

Perform promotion and renaming of exported internal functions, and additionally resolve weak and linkonce symbols.

Perform promotion and renaming of exported internal functions.

Index is updated to reflect linkage changes from weak resolution.

Definition at line 675 of file ThinLTOCodeGenerator.cpp.

References llvm::ComputeCrossModuleImport(), computeDeadSymbolsInIndex(), llvm::Module::getModuleIdentifier(), llvm::Module::getTargetTriple(), llvm::thinLTOFinalizeInModule(), and llvm::thinLTOInternalizeAndPromoteInIndex().

◆ writeGeneratedObject()

std::string ThinLTOCodeGenerator::writeGeneratedObject ( int  count,
StringRef  CacheEntryPath,
const MemoryBuffer OutputBuffer 
)

Write temporary object file to SavedObjectDirectoryPath, write symlink to Cache directory if needed.

Write out the generated object file, either from CacheEntryPath or from OutputBuffer, preferring hard-link when possible.

Returns the path to the generated file in SavedObjectsDirectoryPath.

Definition at line 926 of file ThinLTOCodeGenerator.cpp.

References llvm::sys::path::append(), llvm::SmallString< InternalLen >::c_str(), llvm::sys::fs::copy_file(), llvm::count(), llvm::sys::fs::create_hard_link(), llvm::StringRef::empty(), llvm::errs(), llvm::sys::fs::exists(), llvm::Triple::getArchName(), llvm::MemoryBuffer::getBuffer(), llvm::sys::fs::OF_None, OS, llvm::sys::fs::remove(), llvm::report_fatal_error(), and llvm::TargetMachineBuilder::TheTriple.

Referenced by llvm::ThinLTOCodeGenerator::run().