#include "bolt/Passes/AsmDump.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Target/TargetMachine.h"
#include <unordered_set>
#define DEBUG_TYPE …
usingnamespacellvm;
namespace opts {
extern bool shouldPrint(const bolt::BinaryFunction &Function);
extern cl::OptionCategory BoltCategory;
extern cl::opt<unsigned> Verbosity;
cl::opt<std::string> AsmDump("asm-dump",
cl::desc("dump function into assembly"),
cl::value_desc("dump folder"), cl::ValueOptional,
cl::Hidden, cl::cat(BoltCategory));
}
namespace llvm {
namespace bolt {
void dumpCFI(const BinaryFunction &BF, const MCInst &Instr, AsmPrinter &MAP) { … }
void dumpTargetFunctionStub(raw_ostream &OS, const BinaryContext &BC,
const MCSymbol *CalleeSymb,
const BinarySection *&LastCS) { … }
void dumpJumpTableSymbols(raw_ostream &OS, const JumpTable *JT, AsmPrinter &MAP,
const BinarySection *&LastBS) { … }
void dumpBinaryDataSymbols(raw_ostream &OS, const BinaryData *BD,
const BinarySection *&LastBS) { … }
void dumpFunction(const BinaryFunction &BF) { … }
Error AsmDumpPass::runOnFunctions(BinaryContext &BC) { … }
}
}