From 9b45874445111b5f79d2888fa37086d1db7e4870 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 18 Aug 2015 18:02:14 -0400 Subject: [PATCH] plumbing to automatically run MIR for crates where it works; this serves as a poor man's unit test infrastructure until MIR is more built up --- mk/main.mk | 12 ++++++++++++ mk/target.mk | 1 + 2 files changed, 13 insertions(+) diff --git a/mk/main.mk b/mk/main.mk index f2234e09203..c0c6161aa2d 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -172,6 +172,18 @@ RUST_LIB_FLAGS_ST3 += -C prefer-dynamic # by not emitting them. RUSTFLAGS_STAGE0 += -Z no-landing-pads +# Enable MIR to "always build" for crates where this works. This is +# just temporary while MIR is being actively built up -- it's just a +# poor man's unit testing infrastructure. Anyway we only want this for +# stage1/stage2. +define ADD_MIR_FLAG +RUSTFLAGS1_$(1) += -Z always-build-mir +RUSTFLAGS2_$(1) += -Z always-build-mir +endef +$(foreach crate,$(TARGET_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate)))) +$(foreach crate,$(RUSTC_CRATES),$(eval $(call ADD_MIR_FLAG,$(crate)))) +$(foreach crate,syntax,$(eval $(call ADD_MIR_FLAG,$(crate)))) + # platform-specific auto-configuration include $(CFG_SRC_DIR)mk/platform.mk diff --git a/mk/target.mk b/mk/target.mk index 408ab966908..d6fa55bf7f5 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -93,6 +93,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \ $$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \ $$(LLVM_STDCPP_RUSTFLAGS_$(2)) \ $$(RUSTFLAGS_$(4)) \ + $$(RUSTFLAGS$(1)_$(4)) \ $$(RUSTFLAGS$(1)_$(4)_T_$(2)) \ --out-dir $$(@D) \ -C extra-filename=-$$(CFG_FILENAME_EXTRA) \