clang  16.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::OffloadBundler Class Reference

#include "clang/Driver/OffloadBundler.h"

Collaboration diagram for clang::OffloadBundler:
Collaboration graph
[legend]

Public Member Functions

 OffloadBundler (const OffloadBundlerConfig &BC)
 
llvm::Error BundleFiles ()
 Bundle the files. Return true if an error was found. More...
 
llvm::Error UnbundleFiles ()
 
llvm::Error UnbundleArchive ()
 UnbundleArchive takes an archive file (".a") as input containing bundled code object files, and a list of offload targets (not host), and extracts the code objects into a new archive file for each offload target. More...
 

Static Public Member Functions

static llvm::Error ListBundleIDsInFile (llvm::StringRef InputFileName, const OffloadBundlerConfig &BundlerConfig)
 

Public Attributes

const OffloadBundlerConfigBundlerConfig
 

Detailed Description

Definition at line 47 of file OffloadBundler.h.

Constructor & Destructor Documentation

◆ OffloadBundler()

clang::OffloadBundler::OffloadBundler ( const OffloadBundlerConfig BC)
inline

Definition at line 52 of file OffloadBundler.h.

Member Function Documentation

◆ BundleFiles()

Error OffloadBundler::BundleFiles ( )

◆ ListBundleIDsInFile()

Error OffloadBundler::ListBundleIDsInFile ( llvm::StringRef  InputFileName,
const OffloadBundlerConfig BundlerConfig 
)
static

Definition at line 883 of file OffloadBundler.cpp.

References BundlerConfig, and CreateFileHandler().

◆ UnbundleArchive()

Error OffloadBundler::UnbundleArchive ( )

UnbundleArchive takes an archive file (".a") as input containing bundled code object files, and a list of offload targets (not host), and extracts the code objects into a new archive file for each offload target.

Each resulting archive file contains all code object files corresponding to that particular offload target. The created archive file does not contain an index of the symbols and code object files are named as <<Parent Bundle Name>-<CodeObject's GPUArch>>, with ':' replaced with '_'.

Map of target names with list of object files that will form the device specific archive for that target

Iterate over all bundled code object files in the input archive.

Write out an archive for each target

Definition at line 1119 of file OffloadBundler.cpp.

References clang::OffloadBundlerConfig::AllowMissingBundles, BundlerConfig, clang::serialized_diags::create(), CreateFileHandler(), getCompatibleOffloadTargets(), getDefaultArchiveKindForHost(), getDeviceLibraryFileName(), clang::OffloadBundlerConfig::InputFileNames, clang::OffloadBundlerConfig::OutputFileNames, FileHandler::ReadBundle(), FileHandler::ReadBundleEnd(), FileHandler::ReadBundleStart(), FileHandler::ReadHeader(), string(), clang::Target, and clang::OffloadBundlerConfig::TargetNames.

◆ UnbundleFiles()

Error OffloadBundler::UnbundleFiles ( )

Member Data Documentation

◆ BundlerConfig

const OffloadBundlerConfig& clang::OffloadBundler::BundlerConfig

Definition at line 49 of file OffloadBundler.h.

Referenced by BundleFiles(), ListBundleIDsInFile(), UnbundleArchive(), and UnbundleFiles().


The documentation for this class was generated from the following files: