Skip to content

Commit 5b6ceaf

Browse files
[Support] Use llvm::to_underlying (NFC)
1 parent 7ea1c39 commit 5b6ceaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/Support/SwapByteOrder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_SUPPORT_SWAPBYTEORDER_H
1515
#define LLVM_SUPPORT_SWAPBYTEORDER_H
1616

17+
#include "llvm/ADT/STLForwardCompat.h"
1718
#include "llvm/ADT/bit.h"
1819
#include <cstdint>
1920
#include <type_traits>
@@ -53,8 +54,7 @@ inline double getSwappedBytes(double C) {
5354

5455
template <typename T>
5556
inline std::enable_if_t<std::is_enum_v<T>, T> getSwappedBytes(T C) {
56-
return static_cast<T>(
57-
llvm::byteswap(static_cast<std::underlying_type_t<T>>(C)));
57+
return static_cast<T>(llvm::byteswap(llvm::to_underlying(C)));
5858
}
5959

6060
template<typename T>

0 commit comments

Comments
 (0)