From c5e3c9036e05bf94b3840d3f96ec6a603521da29 Mon Sep 17 00:00:00 2001 From: peefy Date: Sat, 20 Jul 2024 21:31:46 +0800 Subject: [PATCH] chore: remove un-used attributes Signed-off-by: peefy --- kclvm/compiler/src/codegen/llvm/context.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/kclvm/compiler/src/codegen/llvm/context.rs b/kclvm/compiler/src/codegen/llvm/context.rs index 0bc28f3f4..61edd892f 100644 --- a/kclvm/compiler/src/codegen/llvm/context.rs +++ b/kclvm/compiler/src/codegen/llvm/context.rs @@ -57,17 +57,15 @@ pub type CompileResult<'a> = Result, kcl_error::KCLError>; #[derive(Debug, Default)] pub struct Scope<'ctx> { /// Scalars denotes the expression statement values without attribute. - pub scalars: RefCell>>, + pub(crate) scalars: RefCell>>, /// schema_scalar_idx denotes whether a schema exists in the scalar list. - pub schema_scalar_idx: RefCell, + pub(crate) schema_scalar_idx: RefCell, /// Scope normal variables - pub variables: RefCell>>, + pub(crate) variables: RefCell>>, /// Scope normal initialized variables - pub uninitialized: RefCell>, - /// Scope closures referenced by internal scope. - pub closures: RefCell>>, + pub(crate) uninitialized: RefCell>, /// Potential arguments in the current scope, such as schema/lambda arguments. - pub arguments: RefCell>, + pub(crate) arguments: RefCell>, } /// Setter kind. @@ -115,8 +113,6 @@ pub struct LLVMCodeGenContext<'ctx> { pub global_strings: RefCell>>>, /// Global variable pointers cross different packages. pub global_vars: RefCell>>>, - /// The filename of the source file corresponding to the current instruction - pub current_filename: RefCell, /// The line number of the source file corresponding to the current instruction pub current_line: RefCell, /// Error handler to store compile errors. @@ -127,8 +123,6 @@ pub struct LLVMCodeGenContext<'ctx> { pub import_names: IndexMap>, /// No link mode pub no_link: bool, - /// Debug mode - pub debug: bool, /// Program modules according to AST modules pub modules: RefCell>>>, /// Program workdir @@ -1309,13 +1303,11 @@ impl<'ctx> LLVMCodeGenContext<'ctx> { target_vars: RefCell::new(vec![String::from("")]), global_strings: RefCell::new(IndexMap::default()), global_vars: RefCell::new(IndexMap::default()), - current_filename: RefCell::new(String::new()), current_line: RefCell::new(0), handler: RefCell::new(Handler::default()), backtrack_meta: RefCell::new(None), import_names, no_link, - debug: false, modules: RefCell::new(HashMap::new()), workdir, }