diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/SafeStackLayout.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/SafeStackLayout.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SafeStackLayout.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SafeStackLayout.cpp index c823454f825c..5d61b3a146b4 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SafeStackLayout.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SafeStackLayout.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include "SafeStackLayout.h" -#include "llvm/Analysis/StackLifetime.h" #include "llvm/IR/Value.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" @@ -141,10 +140,10 @@ void StackLayout::computeLayout() { // Sort objects by size (largest first) to reduce fragmentation. if (StackObjects.size() > 2) - std::stable_sort(StackObjects.begin() + 1, StackObjects.end(), - [](const StackObject &a, const StackObject &b) { - return a.Size > b.Size; - }); + llvm::stable_sort(drop_begin(StackObjects), + [](const StackObject &a, const StackObject &b) { + return a.Size > b.Size; + }); for (auto &Obj : StackObjects) layoutObject(Obj); |