[all-commits] [llvm/llvm-project] 6e06f1: GCOVProfiling: Avoid use-after-move

David Blaikie via All-commits all-commits at lists.llvm.org
Sun Sep 13 13:11:06 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e06f1cd0816b03d9336083667a0c71760d6b99f
      https://github.com/llvm/llvm-project/commit/6e06f1cd0816b03d9336083667a0c71760d6b99f
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2020-09-13 (Sun, 13 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp

  Log Message:
  -----------
  GCOVProfiling: Avoid use-after-move

Turns out this was use-after-move of function_ref, which is trivially
copyable and movable, so the move did nothing and use after move was
safe.

But since this function_ref is being copied into a std::function, change
the function_ref to be std::function to avoid extra layers of type
erasure indirection - and then it's a real use after move, and fix that
by referring to the moved-to member variable rather than the moved-from
parameter.


  Commit: 7940af02baa27e23ebbd9cd09b24ef1b24ea8cec
      https://github.com/llvm/llvm-project/commit/7940af02baa27e23ebbd9cd09b24ef1b24ea8cec
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2020-09-13 (Sun, 13 Sep 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h

  Log Message:
  -----------
  Correct end-of-namespace comment to be clang-tidy/LLVM style appropriate


  Commit: ce89eeee16dd1e7ca6eead3b9d7f256ca583f6e1
      https://github.com/llvm/llvm-project/commit/ce89eeee16dd1e7ca6eead3b9d7f256ca583f6e1
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2020-09-13 (Sun, 13 Sep 2020)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCInstrInfo.h

  Log Message:
  -----------
  PPCInstrInfo: Fix readability-inconsistent-declaration-parameter-name clang-tidy warning

Reduces the chance of confusion when calling the function with
autocomplete (will show the more accurate/informative variable name),
etc.


Compare: https://github.com/llvm/llvm-project/compare/8889faaed0b7...ce89eeee16dd


More information about the All-commits mailing list