[PATCH] D60389: FileCheck [9/12]: Add support for matching formats

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 03:48:30 PDT 2019


thopre updated this revision to Diff 205539.
thopre marked 5 inline comments as done.
thopre added a comment.

- Rebase on top of latest changes in patch series
- Address comments except initialization format


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60389

Files:
  llvm/lib/Support/FileCheck.cpp
  llvm/unittests/Support/FileCheckTest.cpp


Index: llvm/unittests/Support/FileCheckTest.cpp
===================================================================
--- llvm/unittests/Support/FileCheckTest.cpp
+++ llvm/unittests/Support/FileCheckTest.cpp
@@ -96,7 +96,8 @@
 }
 
 TEST_F(FileCheckTest, Binop) {
-  auto DefExpression = FileCheckExpression(nullptr, FormatUnsigned);
+  FileCheckExpression DefExpression =
+      FileCheckExpression(nullptr, FormatUnsigned);
   auto FooVar =
       std::make_shared<FileCheckNumericVariable>(1, "FOO", &DefExpression);
   FooVar->setValue(42);
Index: llvm/lib/Support/FileCheck.cpp
===================================================================
--- llvm/lib/Support/FileCheck.cpp
+++ llvm/lib/Support/FileCheck.cpp
@@ -62,10 +62,7 @@
     std::shared_ptr<FileCheckExpressionAST> AST,
     FileCheckExpressionFormat Format)
     : AST(AST) {
-  if (Format.Valid)
-    this->Format = Format;
-  else
-    this->Format = FormatUnsigned;
+  this->Format = Format.Valid ? Format : FormatUnsigned;
 }
 
 Expected<uint64_t> FileCheckNumericVariable::eval() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60389.205539.patch
Type: text/x-patch
Size: 1061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190619/edd5e416/attachment.bin>


More information about the llvm-commits mailing list