[all-commits] [llvm/llvm-project] a010d3: [flang] Use value instead of getValue (NFC)

kazutakahirata via All-commits all-commits at lists.llvm.org
Mon Jul 25 00:55:21 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a010d32abb9083ecf74c24876a482e5d04d1dba6
      https://github.com/llvm/llvm-project/commit/a010d32abb9083ecf74c24876a482e5d04d1dba6
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp

  Log Message:
  -----------
  [flang] Use value instead of getValue (NFC)

Flang C++ Style Guide tells us to use x.value() when no presence test
is obviously protecting the reference.  Since a failure in EXPECT_TRUE
doesn't terminate a given test, I don't count it as "protection" here.

Differential Revision: https://reviews.llvm.org/D130410


  Commit: fac0fb4d966efe8c70d3e566cca6a5d0bd049302
      https://github.com/llvm/llvm-project/commit/fac0fb4d966efe8c70d3e566cca6a5d0bd049302
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M flang/lib/Optimizer/Transforms/AffinePromotion.cpp
    M flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp

  Log Message:
  -----------
  [flang] Use X->foo() instead of X.getValue().foo() (NFC)

Flang C++ Style Guide tells us to use *X when the reference is
protected by a presense test.  However, (*X).foo() is a little harder
to read, especially when X is a complicated expression.

This patch slightly deviates from the guide (but retains the spirit)
by using X->foo() instead.

Differential Revision: https://reviews.llvm.org/D130413


Compare: https://github.com/llvm/llvm-project/compare/b66ca91fe6f9...fac0fb4d966e


More information about the All-commits mailing list