Skip to content

Commit

Permalink
Fix paren balancing
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jan 9, 2025
1 parent e8bc187 commit 02c5f89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1352,17 +1352,17 @@ void handleUse(

bool complexExpr = StringRef(conditionStr).contains(';');
if (complexExpr) {
conditionStr = "({ " + conditionStr + " })";
conditionStr = " ({ " + conditionStr + " }) ";
}

for (size_t i = numArgs == 3; i < numArgs; ++i) {
std::string conditionStr2 =
(i == numArgs - 1) ? ("!(" + conditionStr + ")") : conditionStr;
(i == numArgs - 1) ? (" !( " + conditionStr + " ) ") : conditionStr;
std::string precondition2;
if (precondition == "true")
precondition2 = conditionStr2;
else
precondition2 = "((" + precondition + ")&&(" + conditionStr2 + ")";
precondition2 = "((" + precondition + ")&&(" + conditionStr2 + "))";

auto name = resultTree->getArgNameStr(i);
auto arg = resultTree->getArg(i);
Expand Down

0 comments on commit 02c5f89

Please sign in to comment.