about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-08-18 18:02:14 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-09-06 07:27:23 -0400
commit9b45874445111b5f79d2888fa37086d1db7e4870 (patch)
treeb8b71ea3b6d96ff6d1eeaaebd74d3551724cdbc2
parentfaa9ec81b53be2b460caac0e7dcf46e7a41b8f13 (diff)
downloadrust-9b45874445111b5f79d2888fa37086d1db7e4870.tar.gz
rust-9b45874445111b5f79d2888fa37086d1db7e4870.zip
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
-rw-r--r--mk/main.mk12
-rw-r--r--mk/target.mk1
2 files changed, 13 insertions, 0 deletions
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) \