Skip to content

Commit 57b292e

Browse files
authored
RegionLike trait (#668)
1 parent b63a78e commit 57b292e

File tree

21 files changed

+97
-75
lines changed

21 files changed

+97
-75
lines changed

macro/tests/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mod utility;
22

3-
use melior::ir::{Block, Location, Region};
3+
use melior::ir::{Block, Location, Region, RegionLike};
44
use utility::*;
55

66
melior_macro::dialect! {

melior/src/dialect/arith.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ mod tests {
176176
attribute::{StringAttribute, TypeAttribute},
177177
block::BlockLike,
178178
r#type::FunctionType,
179-
Attribute, Block, Location, Module, Region, Type,
179+
Attribute, Block, Location, Module, Region, RegionLike, Type,
180180
},
181181
test::load_all_dialects,
182182
Context,

melior/src/dialect/cf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ mod tests {
155155
ir::{
156156
attribute::{IntegerAttribute, StringAttribute, TypeAttribute},
157157
r#type::{FunctionType, IntegerType, Type},
158-
Block, Module, Region,
158+
Block, Module, Region, RegionLike,
159159
},
160160
test::load_all_dialects,
161161
Context,

melior/src/dialect/func.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn r#return<'c>(operands: &[Value<'c, '_>], location: Location<'c>) -> Opera
8787
mod tests {
8888
use super::*;
8989
use crate::{
90-
ir::{block::BlockLike, Block, Module, Type},
90+
ir::{block::BlockLike, Block, Module, RegionLike, Type},
9191
test::create_test_context,
9292
};
9393

melior/src/dialect/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ mod tests {
7777
attribute::{StringAttribute, TypeAttribute},
7878
block::BlockLike,
7979
r#type::{FunctionType, IntegerType},
80-
Block, Location, Module, Region, Type,
80+
Block, Location, Module, Region, RegionLike, Type,
8181
},
8282
test::load_all_dialects,
8383
Context,

melior/src/dialect/llvm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ pub fn zext<'c>(
368368

369369
#[cfg(test)]
370370
mod tests {
371-
use tests::r#type::pointer;
372-
373371
use super::*;
374372
use crate::{
375373
dialect::{
@@ -383,11 +381,12 @@ mod tests {
383381
attribute::{IntegerAttribute, StringAttribute, TypeAttribute},
384382
block::BlockLike,
385383
r#type::{FunctionType, IntegerType},
386-
Block, Module, Region,
384+
Block, Module, Region, RegionLike,
387385
},
388386
pass::{self, PassManager},
389387
test::create_test_context,
390388
};
389+
use tests::r#type::pointer;
391390

392391
fn convert_module<'c>(context: &'c Context, module: &mut Module<'c>) {
393392
let pass_manager = PassManager::new(context);

melior/src/dialect/memref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ mod tests {
326326
attribute::{DenseElementsAttribute, StringAttribute, TypeAttribute},
327327
block::BlockLike,
328328
r#type::{FunctionType, IntegerType, RankedTensorType},
329-
Block, Module, Region, Type,
329+
Block, Module, Region, RegionLike, Type,
330330
},
331331
test::create_test_context,
332332
};

melior/src/dialect/ods.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,8 @@ mod tests {
201201
dialect,
202202
ir::{
203203
attribute::{IntegerAttribute, StringAttribute, TypeAttribute},
204-
block::BlockLike,
205204
r#type::{FunctionType, IntegerType},
206-
Block, Location, Module, Region, Type,
205+
Block, BlockLike, Location, Module, Region, RegionLike, Type,
207206
},
208207
pass::{self, PassManager},
209208
test::create_test_context,

melior/src/dialect/scf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ mod tests {
116116
attribute::{FloatAttribute, IntegerAttribute, StringAttribute, TypeAttribute},
117117
block::BlockLike,
118118
r#type::{FunctionType, IntegerType, Type},
119-
Attribute, Block, Module,
119+
Attribute, Block, Module, RegionLike,
120120
},
121121
test::load_all_dialects,
122122
Context,

melior/src/ir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ pub use self::{
2020
module::Module,
2121
operation::{Operation, OperationRef},
2222
r#type::{ShapedTypeLike, Type, TypeLike},
23-
region::{Region, RegionRef},
23+
region::{Region, RegionLike, RegionRef},
2424
value::{Value, ValueLike},
2525
};

0 commit comments

Comments
 (0)