LLVM 20.0.0git
|
A function object that can be used as an ObjectTransformLayer transform to dump object files to disk at a specified path. More...
#include "llvm/ExecutionEngine/Orc/DebugUtils.h"
Public Member Functions | |
DumpObjects (std::string DumpDir="", std::string IdentifierOverride="") | |
Construct a DumpObjects transform that will dump objects to disk. | |
Expected< std::unique_ptr< MemoryBuffer > > | operator() (std::unique_ptr< MemoryBuffer > Obj) |
Dumps the given buffer to disk. | |
A function object that can be used as an ObjectTransformLayer transform to dump object files to disk at a specified path.
Definition at line 103 of file DebugUtils.h.
llvm::orc::DumpObjects::DumpObjects | ( | std::string | DumpDir = "" , |
std::string | IdentifierOverride = "" |
||
) |
Construct a DumpObjects transform that will dump objects to disk.
DumpDir | specifies the path to write dumped objects to. DumpDir may be empty, in which case files will be dumped to the working directory. If DumpDir is non-empty then any trailing separators will be discarded. |
IdentifierOverride | specifies a file name stem to use when dumping objects. If empty, each MemoryBuffer's identifier will be used (with a .o suffix added if not already present). If an identifier override is supplied it will be used instead (since all buffers will use the same identifier, the resulting files will be named <ident>.o, <ident>.2.o, <ident>.3.o, and so on). IdentifierOverride should not contain an extension, as a .o suffix will be added by DumpObjects. |
Discard any trailing separators.
Definition at line 314 of file DebugUtils.cpp.
References llvm::sys::path::is_separator().
Expected< std::unique_ptr< MemoryBuffer > > llvm::orc::DumpObjects::operator() | ( | std::unique_ptr< MemoryBuffer > | Obj | ) |
Dumps the given buffer to disk.
Definition at line 325 of file DebugUtils.cpp.
References llvm::dbgs(), llvm::errorCodeToError(), llvm::sys::fs::exists(), llvm::raw_ostream::getBufferStart(), Idx, LLVM_DEBUG, and llvm::raw_ostream::write().