[all-commits] [llvm/llvm-project] d0584e: [CodeLayout] Update to resolve Wdangling warning.

Alina Sbirlea via All-commits all-commits at lists.llvm.org
Wed Oct 25 11:32:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d0584e248d2dc9e9f425caed5983282e2749159d
      https://github.com/llvm/llvm-project/commit/d0584e248d2dc9e9f425caed5983282e2749159d
  Author: Alina Sbirlea <asbirlea at google.com>
  Date:   2023-10-25 (Wed, 25 Oct 2023)

  Changed paths:
    M llvm/lib/Transforms/Utils/CodeLayout.cpp

  Log Message:
  -----------
  [CodeLayout] Update to resolve Wdangling warning.

Change cc2fbc648d7babbfa612f4f5eda3160212ef6ca7 introduced -Wdangling
warning, use temporaries to resolve.

llvm/lib/Transforms/Utils/CodeLayout.cpp:764:27: error: temporary whose address is used as value of local variable '[minDensity, maxDensity]' will be destroyed at the end of the full-expression [-Werror,-Wdangling]
  764 |               std::minmax(ChainPred->density(), ChainSucc->density());

llvm/lib/Transforms/Utils/CodeLayout.cpp:764:49: error: temporary whose address is used as value of local variable '[minDensity, maxDensity]' will be destroyed at the end of the full-expression [-Werror,-Wdangling]
  764 |               std::minmax(ChainPred->density(), ChainSucc->density());




More information about the All-commits mailing list