Skip to content

Commit 02c5f89

Browse files
committed
Fix paren balancing
1 parent e8bc187 commit 02c5f89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,17 +1352,17 @@ void handleUse(
13521352

13531353
bool complexExpr = StringRef(conditionStr).contains(';');
13541354
if (complexExpr) {
1355-
conditionStr = "({ " + conditionStr + " })";
1355+
conditionStr = " ({ " + conditionStr + " }) ";
13561356
}
13571357

13581358
for (size_t i = numArgs == 3; i < numArgs; ++i) {
13591359
std::string conditionStr2 =
1360-
(i == numArgs - 1) ? ("!(" + conditionStr + ")") : conditionStr;
1360+
(i == numArgs - 1) ? (" !( " + conditionStr + " ) ") : conditionStr;
13611361
std::string precondition2;
13621362
if (precondition == "true")
13631363
precondition2 = conditionStr2;
13641364
else
1365-
precondition2 = "((" + precondition + ")&&(" + conditionStr2 + ")";
1365+
precondition2 = "((" + precondition + ")&&(" + conditionStr2 + "))";
13661366

13671367
auto name = resultTree->getArgNameStr(i);
13681368
auto arg = resultTree->getArg(i);

0 commit comments

Comments
 (0)