core/irrt: build.rs capture IR defined types

This commit is contained in:
lyken 2024-07-09 21:02:20 +08:00
parent e9629a6688
commit 342206989e
No known key found for this signature in database
GPG Key ID: 3BD5FC6AC8325DD8
1 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,9 @@ fn main() {
// Regex:
// - `(?ms:^define.*?\}$)` captures LLVM `define` blocks
// - `(?m:^declare.*?$)` captures LLVM `declare` lines
let regex_filter = Regex::new(r"(?ms:^define.*?\}$)|(?m:^declare.*?$)").unwrap();
// - `(?m:^%.+?=\s*type\s*\{.+?\}$)` captures LLVM `type` declarations
let regex_filter =
Regex::new(r"(?ms:^define.*?\}$)|(?m:^declare.*?$)|(?m:^%.+?=\s*type\s*\{.+?\}$)").unwrap();
for f in regex_filter.captures_iter(&output) {
assert_eq!(f.len(), 1);
filtered_output.push_str(&f[0]);