LLVM 19.0.0git
Classes | Typedefs | Functions
llvm::objcopy::wasm Namespace Reference

Classes

struct  Object
 
class  Reader
 
struct  Section
 
class  Writer
 

Typedefs

using SectionPred = std::function< bool(const Section &Sec)>
 

Functions

Error executeObjcopyOnBinary (const CommonConfig &Config, const WasmConfig &, object::WasmObjectFile &In, raw_ostream &Out)
 Apply the transformations described by Config and WasmConfig to In and writes the result into Out.
 
static bool isDebugSection (const Section &Sec)
 
static bool isLinkerSection (const Section &Sec)
 
static bool isNameSection (const Section &Sec)
 
static bool isCommentSection (const Section &Sec)
 
static Error dumpSectionToFile (StringRef SecName, StringRef Filename, Object &Obj)
 
static void removeSections (const CommonConfig &Config, Object &Obj)
 
static Error handleArgs (const CommonConfig &Config, Object &Obj)
 

Typedef Documentation

◆ SectionPred

using llvm::objcopy::wasm::SectionPred = typedef std::function<bool(const Section &Sec)>

Definition at line 22 of file WasmObjcopy.cpp.

Function Documentation

◆ dumpSectionToFile()

static Error llvm::objcopy::wasm::dumpSectionToFile ( StringRef  SecName,
StringRef  Filename,
Object Obj 
)
static

◆ executeObjcopyOnBinary()

Error llvm::objcopy::wasm::executeObjcopyOnBinary ( const CommonConfig Config,
const WasmConfig ,
object::WasmObjectFile In,
raw_ostream Out 
)

Apply the transformations described by Config and WasmConfig to In and writes the result into Out.

Returns
any Error encountered whilst performing the operation.

Definition at line 144 of file WasmObjcopy.cpp.

References assert(), Config, llvm::objcopy::wasm::Reader::create(), llvm::createFileError(), E, llvm::Expected< T >::get(), handleArgs(), llvm::Error::success(), llvm::Expected< T >::takeError(), and llvm::objcopy::wasm::Writer::write().

Referenced by llvm::objcopy::executeObjcopyOnBinary().

◆ handleArgs()

static Error llvm::objcopy::wasm::handleArgs ( const CommonConfig Config,
Object Obj 
)
static

◆ isCommentSection()

static bool llvm::objcopy::wasm::isCommentSection ( const Section Sec)
static

Definition at line 36 of file WasmObjcopy.cpp.

References llvm::objcopy::wasm::Section::Name.

Referenced by removeSections().

◆ isDebugSection()

static bool llvm::objcopy::wasm::isDebugSection ( const Section Sec)
static

Definition at line 24 of file WasmObjcopy.cpp.

References llvm::objcopy::wasm::Section::Name, and llvm::StringRef::starts_with().

Referenced by removeSections().

◆ isLinkerSection()

static bool llvm::objcopy::wasm::isLinkerSection ( const Section Sec)
static

Definition at line 28 of file WasmObjcopy.cpp.

References llvm::objcopy::wasm::Section::Name, and llvm::StringRef::starts_with().

Referenced by removeSections().

◆ isNameSection()

static bool llvm::objcopy::wasm::isNameSection ( const Section Sec)
static

Definition at line 32 of file WasmObjcopy.cpp.

References llvm::objcopy::wasm::Section::Name.

Referenced by removeSections().

◆ removeSections()

static void llvm::objcopy::wasm::removeSections ( const CommonConfig Config,
Object Obj 
)
static