Teach the makefile to generate .ll files,

which are helpful in debugging the llvm backend.  Also tell git to ignore
LLVM's intermediate files.
This commit is contained in:
Jeffrey Yasskin 2010-07-20 11:46:20 +08:00 committed by Graydon Hoare
parent 068c71f11c
commit 215060b72b
2 changed files with 8 additions and 0 deletions

2
.gitignore vendored
View File

@ -13,6 +13,8 @@
*.dSYM *.dSYM
*.d *.d
*.o *.o
*.ll
*.bc
*.aux *.aux
*.cp *.cp
*.fn *.fn

View File

@ -189,6 +189,7 @@ ifdef CFG_LLVM_CONFIG
lltrans.ml llemit.ml) lltrans.ml llemit.ml)
LLC := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llc" LLC := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llc"
CFG_LLC_CFLAGS := -march=x86 CFG_LLC_CFLAGS := -march=x86
LLVM-DIS := "$(shell $(CFG_LLVM_CONFIG) --bindir)/llvm-dis"
$(info cfg: found llvm-config at $(CFG_LLVM_CONFIG)) $(info cfg: found llvm-config at $(CFG_LLVM_CONFIG))
else else
VARIANT=x86 VARIANT=x86
@ -664,6 +665,11 @@ test/bench/shootout/%.x86$(CFG_EXE_SUFFIX): test/bench/shootout/%.rs $(REQ)
@$(call CFG_ECHO, compile [x86]: $<) @$(call CFG_ECHO, compile [x86]: $<)
$(BOOT) -o $@ $< $(BOOT) -o $@ $<
%.ll: %.bc
@$(call CFG_ECHO, dis [llvm]: $<)
$(CFG_QUIET)$(LLVM-DIS) -o $@ $<
%.s: %.bc %.s: %.bc
@$(call CFG_ECHO, compile [llvm]: $<) @$(call CFG_ECHO, compile [llvm]: $<)
$(CFG_QUIET)$(LLC) $(CFG_LLC_CFLAGS) -o $@ $< $(CFG_QUIET)$(LLC) $(CFG_LLC_CFLAGS) -o $@ $<