Skip to content

Commit 8c64789

Browse files
authored
Merge pull request #35934 from JuliaLang/jn/35934
minor compiler utility additions [NFC]
2 parents bde346f + 1b44fc3 commit 8c64789

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ FLAGS := \
2121
-I$(JULIAHOME)/deps/valgrind
2222
ifneq ($(USEMSVC), 1)
2323
FLAGS += -Wall -Wno-strict-aliasing -fno-omit-frame-pointer -fvisibility=hidden -fno-common \
24-
-Wpointer-arith -Wundef
24+
-Wno-comment -Wpointer-arith -Wundef
2525
ifeq ($(USEGCC),1) # GCC bug #25509 (void)__attribute__((warn_unused_result))
2626
FLAGS += -Wno-unused-result
2727
endif

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);

src/llvm-version.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@
1717
#endif
1818

1919
#define LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING 0
20+
21+
#if defined(__GNUC__) && (__GNUC__ >= 9)
22+
// Added in GCC 9, this warning is annoying
23+
#pragma GCC diagnostic ignored "-Winit-list-lifetime"
24+
#endif

0 commit comments

Comments
 (0)