We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ea1c39 commit 5b6ceafCopy full SHA for 5b6ceaf
llvm/include/llvm/Support/SwapByteOrder.h
@@ -14,6 +14,7 @@
14
#ifndef LLVM_SUPPORT_SWAPBYTEORDER_H
15
#define LLVM_SUPPORT_SWAPBYTEORDER_H
16
17
+#include "llvm/ADT/STLForwardCompat.h"
18
#include "llvm/ADT/bit.h"
19
#include <cstdint>
20
#include <type_traits>
@@ -53,8 +54,7 @@ inline double getSwappedBytes(double C) {
53
54
55
template <typename T>
56
inline std::enable_if_t<std::is_enum_v<T>, T> getSwappedBytes(T C) {
- return static_cast<T>(
57
- llvm::byteswap(static_cast<std::underlying_type_t<T>>(C)));
+ return static_cast<T>(llvm::byteswap(llvm::to_underlying(C)));
58
}
59
60
template<typename T>
0 commit comments