Skip to content

Commit e0669e8

Browse files
Error if conflicting options are passed.
Signed-off-by: Tomas Fabrizio Orsi <[email protected]>
1 parent 09aa5af commit e0669e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hir/src/pass/manager.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ impl TryFrom<&Options> for IRPrintingConfig {
5151
.iter()
5252
.map(|a| a.try_into())
5353
.collect::<Result<Vec<PassIdentifier>, Report>>()?;
54+
if options.print_ir_after_all && !pass_filters.is_empty() {
55+
return Err(Report::msg(
56+
"Flags `print_ir_after_all` and `print_ir_after_pass` are mutually exclusive. \
57+
Please select only one."
58+
.to_string(),
59+
));
60+
};
5461
Ok(IRPrintingConfig {
5562
print_ir_after_all: options.print_ir_after_all,
5663
print_ir_after_pass: pass_filters,

0 commit comments

Comments
 (0)