@@ -58,10 +58,10 @@ struct Align {
58
58
constexpr Align () = default;
59
59
// / Do not perform checks in case of copy/move construct/assign, because the
60
60
// / checks have been performed when building `Other`.
61
- constexpr Align (const Align &Other) = default;
62
- constexpr Align &operator =(const Align &Other) = default ;
63
- constexpr Align (Align &&Other) = default;
64
- constexpr Align &operator =(Align &&Other) = default ;
61
+ Align (const Align &Other) = default;
62
+ Align &operator =(const Align &Other) = default ;
63
+ Align (Align &&Other) = default ;
64
+ Align &operator =(Align &&Other) = default ;
65
65
66
66
explicit Align (uint64_t Value) {
67
67
assert (Value > 0 && " Value must not be 0" );
@@ -80,24 +80,6 @@ struct Align {
80
80
// / would be better than
81
81
// / `if (A > Align(1))`
82
82
constexpr static const Align None () { return Align (); }
83
-
84
- // / This function is useful when initializing constexpr Align constants.
85
- // / e.g. static constexpr Align kAlign16 = Align::Constant<16>();
86
- // / Most compilers (clang, gcc, icc) will be able to compute `ShiftValue`
87
- // / at compile time with `Align::Align(uint64_t Value)` but to be
88
- // / able to use Align as a constexpr constant use this method.
89
- // / FIXME: When LLVM is C++17 ready `Align::Align(uint64_t Value)`
90
- // / can be constexpr and we can dispatch between runtime (Log2_64) vs
91
- // / compile time (CTLog2) versions using constexpr-if. Then this
92
- // / function is no more necessary and we can add user defined literals
93
- // / for convenience.
94
- template <uint64_t kValue > constexpr static Align Constant () {
95
- static_assert (kValue > 0 && llvm::isPowerOf2_64 (kValue ),
96
- " Not a valid alignment" );
97
- Align A;
98
- A.ShiftValue = CTLog2<kValue >();
99
- return A;
100
- }
101
83
};
102
84
103
85
// / Treats the value 0 as a 1, so Align is always at least 1.
0 commit comments