Span trace utilities and runner source hint

This commit is contained in:
nyash-codex
2025-11-24 14:17:02 +09:00
parent 3154903121
commit 466e636af6
106 changed files with 4597 additions and 958 deletions

View File

@ -71,16 +71,26 @@ impl super::MirBuilder {
let lhs_is_str = match self.value_types.get(&lhs) {
Some(MirType::String) => true,
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => self.value_origin_newbox.get(&lhs).map(|s| s == "StringBox").unwrap_or(false),
_ => self
.value_origin_newbox
.get(&lhs)
.map(|s| s == "StringBox")
.unwrap_or(false),
};
let rhs_is_str = match self.value_types.get(&rhs) {
Some(MirType::String) => true,
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => self.value_origin_newbox.get(&rhs).map(|s| s == "StringBox").unwrap_or(false),
_ => self
.value_origin_newbox
.get(&rhs)
.map(|s| s == "StringBox")
.unwrap_or(false),
};
if lhs_is_str || rhs_is_str {
self.value_types.insert(dst, MirType::Box("StringBox".to_string()));
self.value_origin_newbox.insert(dst, "StringBox".to_string());
self.value_types
.insert(dst, MirType::Box("StringBox".to_string()));
self.value_origin_newbox
.insert(dst, "StringBox".to_string());
} else {
self.value_types.insert(dst, MirType::Integer);
}
@ -147,16 +157,26 @@ impl super::MirBuilder {
let lhs_is_str = match self.value_types.get(&lhs) {
Some(MirType::String) => true,
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => self.value_origin_newbox.get(&lhs).map(|s| s == "StringBox").unwrap_or(false),
_ => self
.value_origin_newbox
.get(&lhs)
.map(|s| s == "StringBox")
.unwrap_or(false),
};
let rhs_is_str = match self.value_types.get(&rhs) {
Some(MirType::String) => true,
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => self.value_origin_newbox.get(&rhs).map(|s| s == "StringBox").unwrap_or(false),
_ => self
.value_origin_newbox
.get(&rhs)
.map(|s| s == "StringBox")
.unwrap_or(false),
};
if lhs_is_str || rhs_is_str {
self.value_types.insert(dst, MirType::Box("StringBox".to_string()));
self.value_origin_newbox.insert(dst, "StringBox".to_string());
self.value_types
.insert(dst, MirType::Box("StringBox".to_string()));
self.value_origin_newbox
.insert(dst, "StringBox".to_string());
} else {
self.value_types.insert(dst, MirType::Integer);
}
@ -180,16 +200,26 @@ impl super::MirBuilder {
let lhs_is_str = match self.value_types.get(&lhs) {
Some(MirType::String) => true,
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => self.value_origin_newbox.get(&lhs).map(|s| s == "StringBox").unwrap_or(false),
_ => self
.value_origin_newbox
.get(&lhs)
.map(|s| s == "StringBox")
.unwrap_or(false),
};
let rhs_is_str = match self.value_types.get(&rhs) {
Some(MirType::String) => true,
Some(MirType::Box(bt)) if bt == "StringBox" => true,
_ => self.value_origin_newbox.get(&rhs).map(|s| s == "StringBox").unwrap_or(false),
_ => self
.value_origin_newbox
.get(&rhs)
.map(|s| s == "StringBox")
.unwrap_or(false),
};
if lhs_is_str || rhs_is_str {
self.value_types.insert(dst, MirType::Box("StringBox".to_string()));
self.value_origin_newbox.insert(dst, "StringBox".to_string());
self.value_types
.insert(dst, MirType::Box("StringBox".to_string()));
self.value_origin_newbox
.insert(dst, "StringBox".to_string());
} else {
self.value_types.insert(dst, MirType::Integer);
}