Skip to content

Commit 64751e9

Browse files
committed
Update SwapByteOrder.h
1 parent a9673ce commit 64751e9

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 <cstddef>
1920
#include <cstdint>
@@ -82,8 +83,7 @@ inline double getSwappedBytes(double C) {
8283

8384
template <typename T>
8485
inline std::enable_if_t<std::is_enum_v<T>, T> getSwappedBytes(T C) {
85-
return static_cast<T>(
86-
llvm::byteswap(static_cast<std::underlying_type_t<T>>(C)));
86+
return static_cast<T>(llvm::byteswap(llvm::to_underlying(C)));
8787
}
8888

8989
template<typename T>

0 commit comments

Comments
 (0)