-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from albins/master
Add a naïve hybrid algorithm
- Loading branch information
Showing
4 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2019 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//! A hybrid version combining the optimized Datafrog model with the | ||
//! location-insensitive version. | ||
use crate::output::datafrog_opt; | ||
use crate::output::location_insensitive; | ||
use crate::output::Output; | ||
use facts::{AllFacts, Atom}; | ||
|
||
pub(super) fn compute<Region: Atom, Loan: Atom, Point: Atom>( | ||
dump_enabled: bool, | ||
all_facts: AllFacts<Region, Loan, Point>, | ||
) -> Output<Region, Loan, Point> { | ||
let lins_output = location_insensitive::compute(dump_enabled, &all_facts); | ||
if lins_output.errors.is_empty() { | ||
lins_output | ||
} else { | ||
datafrog_opt::compute(dump_enabled, all_facts) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters