Skip to content

Commit

Permalink
Get location from fused loc instead of operand
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Sep 27, 2024
1 parent f02555f commit f8f2aa5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Dialect/OM/Evaluator/Evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,13 @@ circt::om::Evaluator::evaluateObjectInstance(StringAttr className,

auto fieldNames = cls.getFieldNames();
auto operands = cls.getFieldsOp()->getOperands();
for (auto [name, value] : llvm::zip(fieldNames, operands)) {
Location loc = value.getLoc();
auto fieldsLoc = cls.getFieldsOp()->getLoc();
for (size_t i = 0; i < fieldNames.size(); ++i) {
auto name = fieldNames[i];
auto value = operands[i];
Location loc = fieldsLoc;
if (auto locs = dyn_cast<FusedLoc>(loc))
loc = locs.getLocations()[i];
FailureOr<evaluator::EvaluatorValuePtr> result =
evaluateValue(value, actualParams, loc);
if (failed(result))
Expand Down

0 comments on commit f8f2aa5

Please sign in to comment.