Skip to content

Commit 215060b

Browse files
jyasskingraydon
authored andcommitted
Teach the makefile to generate .ll files,
which are helpful in debugging the llvm backend. Also tell git to ignore LLVM's intermediate files.
1 parent 068c71f commit 215060b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*.dSYM
1414
*.d
1515
*.o
16+
*.ll
17+
*.bc
1618
*.aux
1719
*.cp
1820
*.fn

src/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ ifdef CFG_LLVM_CONFIG
189189
lltrans.ml llemit.ml)
190190
LLC := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llc"
191191
CFG_LLC_CFLAGS := -march=x86
192+
LLVM-DIS := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llvm-dis"
192193
$(info cfg: found llvm-config at $(CFG_LLVM_CONFIG))
193194
else
194195
VARIANT=x86
@@ -664,6 +665,11 @@ test/bench/shootout/%.x86$(CFG_EXE_SUFFIX): test/bench/shootout/%.rs $(REQ)
664665
@$(call CFG_ECHO, compile [x86]: $<)
665666
$(BOOT) -o $@ $<
666667

668+
%.ll: %.bc
669+
@$(call CFG_ECHO, dis [llvm]: $<)
670+
$(CFG_QUIET)$(LLVM-DIS) -o $@ $<
671+
672+
667673
%.s: %.bc
668674
@$(call CFG_ECHO, compile [llvm]: $<)
669675
$(CFG_QUIET)$(LLC) $(CFG_LLC_CFLAGS) -o $@ $<

0 commit comments

Comments
 (0)