Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit 7b27c68

Browse files
Extend LucetOpt to support canonicalize_nans flag (#423)
#405 introduced a new option to support NaNs canonicalization in the compiler. Unfortunately, `LucetcOpts` was not updated properly to support the new flag in the public API. This change fixes that issue.
1 parent c89381d commit 7b27c68

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lucetc/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ pub trait LucetcOpts {
115115
fn with_sign(self) -> Self;
116116
fn count_instructions(&mut self, enable_count: bool);
117117
fn with_count_instructions(self, enable_count: bool) -> Self;
118+
fn canonicalize_nans(&mut self, enable_canonicalize_nans: bool);
119+
fn with_canonicalize_nans(self, enable_canonicalize_nans: bool) -> Self;
118120
}
119121

120122
impl<T: AsLucetc> LucetcOpts for T {
@@ -255,6 +257,15 @@ impl<T: AsLucetc> LucetcOpts for T {
255257
self.count_instructions(count_instructions);
256258
self
257259
}
260+
261+
fn canonicalize_nans(&mut self, enable_nans_canonicalization: bool) {
262+
self.as_lucetc().canonicalize_nans = enable_nans_canonicalization;
263+
}
264+
265+
fn with_canonicalize_nans(mut self, enable_nans_canonicalization: bool) -> Self {
266+
self.canonicalize_nans(enable_nans_canonicalization);
267+
self
268+
}
258269
}
259270

260271
impl Lucetc {

0 commit comments

Comments
 (0)