Skip to content

Commit 438ba3f

Browse files
committed
Revert "Update SwapByteOrder.h"
This reverts commit 64751e9.
1 parent 1b9139a commit 438ba3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/Support/SwapByteOrder.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndef LLVM_SUPPORT_SWAPBYTEORDER_H
1515
#define LLVM_SUPPORT_SWAPBYTEORDER_H
1616

17-
#include "llvm/ADT/STLForwardCompat.h"
1817
#include "llvm/ADT/bit.h"
1918
#include <cstddef>
2019
#include <cstdint>
@@ -83,7 +82,8 @@ inline double getSwappedBytes(double C) {
8382

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

8989
template<typename T>

0 commit comments

Comments
 (0)