#include "llvm/ExecutionEngine/Orc/DebugUtils.h"
#include "llvm/ExecutionEngine/Orc/Core.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG_TYPE …
usingnamespacellvm;
namespace {
#ifndef NDEBUG
cl::opt<bool> PrintHidden("debug-orc-print-hidden", cl::init(true),
cl::desc("debug print hidden symbols defined by "
"materialization units"),
cl::Hidden);
cl::opt<bool> PrintCallable("debug-orc-print-callable", cl::init(true),
cl::desc("debug print callable symbols defined by "
"materialization units"),
cl::Hidden);
cl::opt<bool> PrintData("debug-orc-print-data", cl::init(true),
cl::desc("debug print data symbols defined by "
"materialization units"),
cl::Hidden);
#endif
template <typename T> struct PrintAll { … };
bool anyPrintSymbolOptionSet() { … }
bool flagsMatchCLOpts(const JITSymbolFlags &Flags) { … }
template <typename Sequence,
typename Pred = PrintAll<typename Sequence::value_type>>
class SequencePrinter {
public:
SequencePrinter(const Sequence &S, char OpenSeq, char CloseSeq,
Pred ShouldPrint = Pred())
: … { … }
void printTo(llvm::raw_ostream &OS) const { … }
private:
const Sequence &S;
char OpenSeq;
char CloseSeq;
mutable Pred ShouldPrint;
};
template <typename Sequence, typename Pred>
SequencePrinter<Sequence, Pred> printSequence(const Sequence &S, char OpenSeq,
char CloseSeq, Pred P = Pred()) { … }
template <typename Sequence, typename Pred>
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
const SequencePrinter<Sequence, Pred> &Printer) { … }
struct PrintSymbolFlagsMapElemsMatchingCLOpts { … };
struct PrintSymbolMapElemsMatchingCLOpts { … };
}
namespace llvm {
namespace orc {
raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPtr &Sym) { … }
raw_ostream &operator<<(raw_ostream &OS, NonOwningSymbolStringPtr Sym) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolNameSet &Symbols) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolNameVector &Symbols) { … }
raw_ostream &operator<<(raw_ostream &OS, ArrayRef<SymbolStringPtr> Symbols) { … }
raw_ostream &operator<<(raw_ostream &OS, const JITSymbolFlags &Flags) { … }
raw_ostream &operator<<(raw_ostream &OS, const ExecutorSymbolDef &Sym) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolFlagsMap::value_type &KV) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolMap::value_type &KV) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolFlagsMap &SymbolFlags) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolMap &Symbols) { … }
raw_ostream &operator<<(raw_ostream &OS,
const SymbolDependenceMap::value_type &KV) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolDependenceMap &Deps) { … }
raw_ostream &operator<<(raw_ostream &OS, const MaterializationUnit &MU) { … }
raw_ostream &operator<<(raw_ostream &OS, const LookupKind &K) { … }
raw_ostream &operator<<(raw_ostream &OS,
const JITDylibLookupFlags &JDLookupFlags) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupFlags &LookupFlags) { … }
raw_ostream &operator<<(raw_ostream &OS,
const SymbolLookupSet::value_type &KV) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupSet &LookupSet) { … }
raw_ostream &operator<<(raw_ostream &OS,
const JITDylibSearchOrder &SearchOrder) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolAliasMap &Aliases) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolState &S) { … }
raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPool &SSP) { … }
DumpObjects::DumpObjects(std::string DumpDir, std::string IdentifierOverride)
: … { … }
Expected<std::unique_ptr<MemoryBuffer>>
DumpObjects::operator()(std::unique_ptr<MemoryBuffer> Obj) { … }
StringRef DumpObjects::getBufferIdentifier(MemoryBuffer &B) { … }
}
}