[all-commits] [llvm/llvm-project] 08e238: Revert "Revert "[llvm][NFC] Cleanup uses of std::f...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Fri May 15 12:30:27 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 08e2386dee3f51c0085f87ca909f533681609bd0
      https://github.com/llvm/llvm-project/commit/08e2386dee3f51c0085f87ca909f533681609bd0
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2020-05-15 (Fri, 15 May 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/InlineCost.h
    M llvm/include/llvm/Transforms/Utils/Cloning.h
    M llvm/lib/Analysis/InlineAdvisor.cpp
    M llvm/lib/Analysis/InlineCost.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUInline.cpp
    M llvm/lib/Transforms/IPO/AlwaysInliner.cpp
    M llvm/lib/Transforms/IPO/InlineSimple.cpp
    M llvm/lib/Transforms/IPO/Inliner.cpp
    M llvm/lib/Transforms/IPO/PartialInlining.cpp
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    M llvm/lib/Transforms/Utils/InlineFunction.cpp

  Log Message:
  -----------
  Revert "Revert "[llvm][NFC] Cleanup uses of std::function in Inlining-related APIs""

This reverts commit 454de99a6fec705e76ed7743bf538f7a77296f59.

The problem was that one of the ctor arguments of CallAnalyzer was left
to be const std::function<>&. A function_ref was passed for it, and then
the ctor stored the value in a function_ref field. So a std::function<>
would be created as a temporary, and not survive past the ctor
invocation, while the field would.

Tested locally by following https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild

Original Differential Revision: https://reviews.llvm.org/D79917




More information about the All-commits mailing list