mirror of https://github.com/llvm/circt.git
[ImportVerilog] Fix root op ordering
Use `upper_bound` to pick an insertion point for modules. This ensures that multiple parametrizations of a module appear in the order in which they were instantiated, instead of the reverse order.
This commit is contained in:
parent
9845589129
commit
419de21c45
|
@ -534,7 +534,7 @@ Context::convertModuleHeader(const slang::ast::InstanceBodySymbol *module) {
|
|||
|
||||
// Pick an insertion point for this module according to the source file
|
||||
// location.
|
||||
auto it = orderedRootOps.lower_bound(module->location);
|
||||
auto it = orderedRootOps.upper_bound(module->location);
|
||||
if (it == orderedRootOps.end())
|
||||
builder.setInsertionPointToEnd(intoModuleOp.getBody());
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue