From 984843a46ac20687304f099d55f62d6b0452ac26 Mon Sep 17 00:00:00 2001 From: lyken Date: Sat, 13 Jul 2024 14:02:50 +0800 Subject: [PATCH] core/irrt: build.rs capture IR defined constants --- nac3core/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nac3core/build.rs b/nac3core/build.rs index e1cf9834..71859dc8 100644 --- a/nac3core/build.rs +++ b/nac3core/build.rs @@ -63,8 +63,11 @@ fn main() { // - `(?ms:^define.*?\}$)` captures LLVM `define` blocks // - `(?m:^declare.*?$)` captures LLVM `declare` lines // - `(?m:^%.+?=\s*type\s*\{.+?\}$)` captures LLVM `type` declarations - let regex_filter = - Regex::new(r"(?ms:^define.*?\}$)|(?m:^declare.*?$)|(?m:^%.+?=\s*type\s*\{.+?\}$)").unwrap(); + // - `(?m:^@.+?=.+$)` captures global constants + let regex_filter = Regex::new( + r"(?ms:^define.*?\}$)|(?m:^declare.*?$)|(?m:^%.+?=\s*type\s*\{.+?\}$)|(?m:^@.+?=.+$)", + ) + .unwrap(); for f in regex_filter.captures_iter(&output) { assert_eq!(f.len(), 1); filtered_output.push_str(&f[0]);