[Calyx] Fix a clang warning identifying a bug.

warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
  StringRef portName = valueName(group->getParentOfType<ComponentOp>(), value);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Chris Lattner 2021-09-14 11:03:08 -07:00
parent 805d7e8be8
commit 64f16a2f50
1 changed files with 2 additions and 1 deletions

View File

@ -791,7 +791,8 @@ static LogicalResult isCombinational(Value value, GroupInterface group) {
"is not combinational.";
}
StringRef portName = valueName(group->getParentOfType<ComponentOp>(), value);
std::string portName =
valueName(group->getParentOfType<ComponentOp>(), value);
return group->emitOpError() << "with port: " << portName
<< ". This operation is not combinational.";
}