Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / lib / orc / stl_extras.h
blob33c877b193c533893f028fa5a8bf7723e8b7a73f
1 //===-------- stl_extras.h - Useful STL related functions-------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of the ORC runtime support library.
11 //===----------------------------------------------------------------------===//
13 #ifndef ORC_RT_STL_EXTRAS_H
14 #define ORC_RT_STL_EXTRAS_H
16 #include <utility>
17 #include <tuple>
19 namespace __orc_rt {
21 /// Substitute for std::identity.
22 /// Switch to std::identity once we can use c++20.
23 template <class Ty> struct identity {
24 using is_transparent = void;
25 using argument_type = Ty;
27 Ty &operator()(Ty &self) const { return self; }
28 const Ty &operator()(const Ty &self) const { return self; }
31 } // namespace __orc_rt
33 #endif // ORC_RT_STL_EXTRAS