Skip to content

Commit 1b44fc3

Browse files
committed
[llvm] add some more debugger stubs for dumping LLVM machine objects
1 parent 4bad702 commit 1b44fc3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/codegen.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7583,6 +7583,22 @@ extern "C" void jl_dump_llvm_debugloc(void *v)
75837583
llvm_dump((DebugLoc*)v);
75847584
}
75857585

7586+
namespace llvm {
7587+
class MachineBasicBlock;
7588+
class MachineFunction;
7589+
raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
7590+
void printMIR(raw_ostream &OS, const MachineFunction &MF);
7591+
}
7592+
extern "C" void jl_dump_llvm_mbb(void *v)
7593+
{
7594+
errs() << *(llvm::MachineBasicBlock*)v;
7595+
}
7596+
extern "C" void jl_dump_llvm_mfunction(void *v)
7597+
{
7598+
llvm::printMIR(errs(), *(llvm::MachineFunction*)v);
7599+
}
7600+
7601+
75867602
extern void jl_write_bitcode_func(void *F, char *fname) {
75877603
std::error_code EC;
75887604
raw_fd_ostream OS(fname, EC, sys::fs::F_None);

0 commit comments

Comments
 (0)