From 02c5f89b251318da0baace3f442f955af1129111 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Thu, 9 Jan 2025 18:01:53 -0500 Subject: [PATCH] Fix paren balancing --- enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp b/enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp index 0c0a45c6ead..672cb8954e5 100644 --- a/enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp +++ b/enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp @@ -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);