To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit aaff5ded authored by qinsoon's avatar qinsoon
Browse files

keep original IR through the compilation, and use it for inlining

parent 5b67db51
......@@ -68,7 +68,7 @@ rm -rf emit/*
if [ "$OS" == "linux" ]; then
rm -rf target/*
RUSTFLAGS=-Zincremental=target/incr-cache RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CC=clang-3.8 cargo test "$@"
RUSTFLAGS=-Zincremental=target/incr-cache RUST_BACKTRACE=1 RUST_TEST_THREADS=1 cargo test "$@"
elif [ "$OS" == "Darwin" ]; then
RUSTFLAGS=-Zincremental=target/incr-cache RUST_BACKTRACE=1 RUST_TEST_THREADS=1 cargo test "$@"
else
......
......@@ -107,6 +107,7 @@ pub struct MuFunctionVersion {
orig_content: Option<FunctionContent>,
pub content: Option<FunctionContent>,
is_defined: bool,
pub context: FunctionContext,
......@@ -147,6 +148,7 @@ impl MuFunctionVersion {
sig: sig,
orig_content: None,
content: None,
is_defined: false,
context: FunctionContext::new(),
block_trace: None,
force_inline: false
......@@ -160,6 +162,7 @@ impl MuFunctionVersion {
sig: sig,
orig_content: Some(content.clone()),
content: Some(content),
is_defined: true,
context: context,
block_trace: None,
force_inline: false
......@@ -171,6 +174,11 @@ impl MuFunctionVersion {
}
pub fn define(&mut self, content: FunctionContent) {
if self.is_defined {
panic!("alread defined the function: {}", self);
}
self.is_defined = true;
self.orig_content = Some(content.clone());
self.content = Some(content);
}
......
......@@ -237,7 +237,7 @@ impl CompilerPass for GenMovPhi {
f_content.blocks.insert(block.id(), block);
}
func.define(f_content);
func.content = Some(f_content);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment