15 #define DEBUG_TYPE "orc" 21 : DumpDir(
std::move(DumpDir)),
22 IdentifierOverride(
std::move(IdentifierOverride)) {
25 while (!this->DumpDir.empty() &&
27 this->DumpDir.pop_back();
34 std::string DumpPathStem;
36 << DumpDir << (DumpDir.empty() ?
"" :
"/") << getBufferIdentifier(*Obj);
38 std::string DumpPath = DumpPathStem +
".o";
46 <<
" -- " << (
const void *)(Obj->getBufferEnd() - 1) <<
" ] to " 54 DumpStream.
write(Obj->getBufferStart(), Obj->getBufferSize());
56 return std::move(Obj);
60 if (!IdentifierOverride.empty())
61 return IdentifierOverride;
virtual StringRef getBufferIdentifier() const
Return an identifier for this buffer, typically the filename it was read from.
bool is_separator(char value, Style style=Style::native)
Check whether the given char is a path separator on the host OS.
This class represents lattice values for constants.
Expected< std::unique_ptr< MemoryBuffer > > operator()(std::unique_ptr< MemoryBuffer > Obj)
Dumps the given buffer to disk.
Tagged union holding either a T or a Error.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
const char * getBufferStart() const
Return the beginning of the current stream buffer, or 0 if the stream is unbuffered.
raw_ostream & write(unsigned char C)
This interface provides simple read-only access to a block of memory, and provides simple methods for...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
A raw_ostream that writes to a file descriptor.
bool consume_back(StringRef Suffix)
Returns true if this StringRef has the given suffix and removes that suffix.
A raw_ostream that writes to an std::string.
StringRef - Represent a constant reference to a string, i.e.
bool exists(const basic_file_status &status)
Does file exist?
DumpObjects(std::string DumpDir="", std::string IdentifierOverride="")
Construct a DumpObjects transform that will dump objects to disk.