pub struct FunctionAnalysisState {
pub string_table: HashMap<String, u32>,
pub strings: Vec<String>,
pub warnings: Vec<CompileWarning>,
}Expand description
Per-function mutable state during semantic analysis.
This struct contains all mutable state that is modified during function body analysis. For parallel analysis, each function gets its own instance, and results are merged afterward.
§Contents
- String literals encountered
- Warnings generated
§Note on Array Types
Array types are handled by the shared TypeInternPool in SemaContext.
They are no longer tracked per-function.
§Merging
After parallel analysis, use merge_into to combine results:
- Strings are deduplicated
- Warnings are concatenated
Fields§
§string_table: HashMap<String, u32>String table for deduplication.
strings: Vec<String>String literals in order of creation.
warnings: Vec<CompileWarning>Warnings collected during analysis.
Implementations§
Source§impl FunctionAnalysisState
impl FunctionAnalysisState
Sourcepub fn add_string(&mut self, content: String) -> u32
pub fn add_string(&mut self, content: String) -> u32
Add a string to the string table, returning its index. Deduplicates identical strings.
Sourcepub fn add_warning(&mut self, warning: CompileWarning)
pub fn add_warning(&mut self, warning: CompileWarning)
Add a warning.
Trait Implementations§
Source§impl Debug for FunctionAnalysisState
impl Debug for FunctionAnalysisState
Source§impl Default for FunctionAnalysisState
impl Default for FunctionAnalysisState
Source§fn default() -> FunctionAnalysisState
fn default() -> FunctionAnalysisState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FunctionAnalysisState
impl RefUnwindSafe for FunctionAnalysisState
impl Send for FunctionAnalysisState
impl Sync for FunctionAnalysisState
impl Unpin for FunctionAnalysisState
impl UnwindSafe for FunctionAnalysisState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more