[PATCH] D60388: FileCheck [8/12]: Define numeric var from expr

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 18:08:31 PDT 2019


craig.topper added inline comments.


================
Comment at: llvm/trunk/lib/Support/FileCheck.cpp:345
 
-  // Parse the expression itself.
-  Expr = Expr.ltrim(SpaceChars);
-  // The first operand in a legacy @LINE expression is always the @LINE pseudo
-  // variable.
-  AllowedOperand AO =
-      IsLegacyLineExpr ? AllowedOperand::LineVar : AllowedOperand::Any;
-  Expected<std::unique_ptr<FileCheckExpressionAST>> ParseResult =
-      parseNumericOperand(Expr, AO, SM);
-  while (ParseResult && !Expr.empty()) {
-    ParseResult =
-        parseBinop(Expr, std::move(*ParseResult), IsLegacyLineExpr, SM);
-    // Legacy @LINE expressions only allow 2 operands.
-    if (ParseResult && IsLegacyLineExpr && !Expr.empty())
-      return FileCheckErrorDiagnostic::get(
-          SM, Expr,
-          "unexpected characters at end of expression '" + Expr + "'");
-  }
-  if (!ParseResult)
-    return ParseResult;
-  return std::move(*ParseResult);
+  return ExpressionAST;
 }
----------------
gcc 7.3.1 seems to be unhappy with this line. I think it wants a std::move around ExpressionAST.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60388/new/

https://reviews.llvm.org/D60388





More information about the llvm-commits mailing list