Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
99b6bef
Refactor how we store object conds for objectdecls
JonatanWaern Jun 8, 2026
5470475
Add logic to select between hashif branches
JonatanWaern Sep 22, 2026
68f9d0d
Fixup markdown mistakes in changelog
JonatanWaern Sep 4, 2026
eba5f3a
Make conflict reporting deterministic
JonatanWaern Sep 22, 2026
df5785d
Full conflict cross-checking
JonatanWaern Sep 23, 2026
76b3e13
Report params under #if
JonatanWaern Sep 23, 2026
50ab720
Filter out provably inactive imports/instantiations when possible
JonatanWaern Sep 23, 2026
ca58942
Create one auth evaluation context
JonatanWaern Sep 24, 2026
fd7b34e
Do not unconditionally index the import map
JonatanWaern Sep 24, 2026
9f2a536
Rework insert-guard for queue in add_template_specs
JonatanWaern Sep 25, 2026
6db19b6
Also apply mutual exclusion to declarations behind 'is' or 'import'
JonatanWaern Sep 25, 2026
82baf6d
Make pathbufkey sorting deterministic
JonatanWaern Sep 28, 2026
cb98f72
Remove possibility of race condition in track path
JonatanWaern Sep 28, 2026
cdd7451
Add ExistCondition never and construct it when opposing conditions ar…
JonatanWaern Sep 28, 2026
0341bc9
Do not add specs from inactive ineachs
JonatanWaern Sep 28, 2026
3a72e30
Perform full cross-check for conflicting object types
JonatanWaern Sep 28, 2026
5169ffc
Fixup tests
JonatanWaern Sep 28, 2026
d5813dc
Perform full cross-check for mismatching dimensions
JonatanWaern Sep 29, 2026
6af4c5c
Minor fixes
JonatanWaern Sep 30, 2026
b7306e6
Fixup conflicting cases of auto-params
JonatanWaern Sep 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
# Change Log

## 0.9.21

- The DLS will now properly not report conflicts between statements in a `#if` and its corresponding `#else` branch
- The DLS will now consider all `#if` branches on conditions directly based on `dml_1_2` and `dml_1_4` dead or alive appropriately
- Made error reporting for name collisions more stable
- Name collisions will now report all combinations of conflicts
- The DLS will now correctly report `param` declarations directly below a `#if` or `#else` block

## 0.9.20
- Made GetKnownContexts custom request not wait for analysis results by default, reducing the chances of overfilling workpool capacity while analysises are running.
Expand All @@ -20,7 +24,7 @@
- Fixed a bug that caused intermittent failures around instantiated templates
- Added the ability to goto-definition on imports to find the file that was imported
- Allowed empty `-> ()` type specifier for method returns
- Replace provisional `explicit\_object\_decls` with `explicit\_object\_extensions`
- Replace provisional `explicit_object_decls` with `explicit_object_extensions`

## 0.9.18
- Fixed a rare case where the DLS would crash when reporting device contexts
Expand All @@ -31,12 +35,12 @@
- The DLS will now report when an ambiguous default call is made
- Improvements and clarifications to connections between symbols and references,
for details, see [USAGE.md](USAGE.md).
-- Method declared in unrelated templates in an allowed way will now have their
- Method declared in unrelated templates in an allowed way will now have their
references correctly resolved.
-- Goto-reference on default calls will now go to the methods that may be called.
-- Goto-implementations on templates will now go to all places where they are
- Goto-reference on default calls will now go to the methods that may be called.
- Goto-implementations on templates will now go to all places where they are
instantiated.
-- Goto-implementations on objects will now go to all the 'in each' declarations
- Goto-implementations on objects will now go to all the 'in each' declarations
which apply to that object.
- Added parser support for provisional 'explicit\_method\_decls', note that it has no semantic effect.
- The DLS will now correctly report missing template names in 'in each' constructs
Expand Down
31 changes: 22 additions & 9 deletions src/analysis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use rayon::prelude::*;
use crate::actions::{SourcedDMLError, DeviceAnalysisJobOptions};
use crate::actions::analysis_storage::{TimestampedStorage};
use crate::actions::semantic_lookup::{DLSLimitation, isolated_template_limitation};
use crate::analysis::templating::evaluation::{EvaluationContext};
use crate::analysis::symbols::{DMLSymbolKind, SimpleSymbol, StructureSymbol, SymbolContainer, SymbolMaker, SymbolSource};
pub use crate::analysis::symbols::SymbolRef;
use crate::analysis::reference::{GlobalReference, NodeRef, CodeReference, Reference, ReferenceKind, ReferenceVariant, VariableReference};
Expand Down Expand Up @@ -1817,12 +1818,20 @@ impl IsolatedAnalysis {
Ok(res)
}

pub fn get_imports(&self) -> &Vec<ObjectDecl<Import>> {
&self.toplevel.spec.imports
fn get_active_imports(&self) -> Vec<&ObjectDecl<Import>> {
let mut eval_context = EvaluationContext::new();
self.toplevel.spec.imports.iter()
// We intentionally discard errors here, they will have been reported earlier
.filter(|imp|imp.cond.exists_no_report(&mut eval_context))
.collect()
}

pub fn get_imports(&self) -> impl Iterator<Item = &ObjectDecl<Import>> {
self.get_active_imports().into_iter()
}

pub fn get_import_names(&self) -> Vec<PathBuf> {
self.get_imports().iter().map(
self.get_imports().map(
|imp|deconstruct_import(imp)).collect()
}

Expand All @@ -1833,9 +1842,8 @@ impl IsolatedAnalysis {
{
let mut found = HashSet::default();
let mut missing = HashSet::default();
let import_paths = self.get_imports().iter()
.map(|i|(deconstruct_import(i),
i.clone()));
let import_paths = self.get_imports()
.map(|i|(deconstruct_import(i), i.clone()));
// Patch in implicit dependencies here. These won't affect template
// or file ordering. But we DO want to make sure they are imported
let import_paths = import_paths.chain(
Expand Down Expand Up @@ -2356,16 +2364,18 @@ impl DeviceAnalysis {
&str, &ObjectDecl<Template>>,
files: &HashMap<&str, &TopLevel>,
imp_map: &HashMap<Import, CanonPath>,
eval_context: &mut EvaluationContext,
errors: &mut Vec<DMLError>)
-> TemplateTraitInfo {
info!("Rank templates");
let (templates, order, invalid_isimps, rank_struct)
= rank_templates(unique_templates, files, imp_map, errors);
= rank_templates(unique_templates, files, imp_map,
eval_context, errors);
info!("Templates+traits");
create_templates_traits(
start_of_file,
rank_maker, templates, order,
invalid_isimps, imp_map, rank_struct, errors)
invalid_isimps, imp_map, rank_struct, eval_context, errors)
}

fn match_references(&mut self,
Expand Down Expand Up @@ -2498,11 +2508,13 @@ impl DeviceAnalysis {
}
status.check_alive()?;
let mut rank_maker = RankMaker::new();
let mut eval_context = EvaluationContext::new();
let tt_info = Self::make_templates_traits(&root.toplevel.start_of_file,
&mut rank_maker,
&unique_templates,
&files,
&imp_map,
&mut eval_context,
&mut errors);
status.check_alive()?;
// TODO: catch typedef/traitname overlaps
Expand All @@ -2512,7 +2524,8 @@ impl DeviceAnalysis {
info!("Make device");
let device_key = make_device(&root.path, &root.toplevel,
&tt_info, imp_map, &mut container,
&mut rank_maker, &mut errors).key;
&mut rank_maker, &mut eval_context,
&mut errors).key;
status.check_alive()?;
// maps template declaration loc to objects
let template_object_implementation_map =
Expand Down
Loading
Loading