summaryrefslogtreecommitdiff
path: root/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-08-20 20:51:32 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-08-20 20:51:32 +0000
commitf1e1c239e31b467e17f1648b1f524fc9ab5b431a (patch)
treea855e7a2a8808555da60e6aa9601d6867eb23bac /lib/ReaderWriter/MachO/CompactUnwindPass.cpp
parent7d6988fdd2aee0e033034e147f16fe05594a60e4 (diff)
Notes
Diffstat (limited to 'lib/ReaderWriter/MachO/CompactUnwindPass.cpp')
-rw-r--r--lib/ReaderWriter/MachO/CompactUnwindPass.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
index fa0aaa103eeb8..de5adb088799e 100644
--- a/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
+++ b/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
@@ -1,9 +1,8 @@
//===- lib/ReaderWriter/MachO/CompactUnwindPass.cpp -------------*- C++ -*-===//
//
-// The LLVM Linker
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
@@ -388,12 +387,9 @@ private:
// Gather the personality functions now, so that they're in deterministic
// order (derived from the DefinedAtom order).
- if (unwindEntry.personalityFunction) {
- auto pFunc = std::find(personalities.begin(), personalities.end(),
- unwindEntry.personalityFunction);
- if (pFunc == personalities.end())
- personalities.push_back(unwindEntry.personalityFunction);
- }
+ if (unwindEntry.personalityFunction &&
+ !llvm::count(personalities, unwindEntry.personalityFunction))
+ personalities.push_back(unwindEntry.personalityFunction);
}
}
@@ -552,8 +548,7 @@ private:
}
}
- auto personality = std::find(personalities.begin(), personalities.end(),
- entry.personalityFunction);
+ auto personality = llvm::find(personalities, entry.personalityFunction);
uint32_t personalityIdx = personality == personalities.end()
? 0
: personality - personalities.begin() + 1;