Skip to content

Commit 77a429d

Browse files
committed
[Project] Remove all constexpr inline
1 parent d952f49 commit 77a429d

File tree

15 files changed

+59
-80
lines changed

15 files changed

+59
-80
lines changed

include/ADT/BasicMasksHandler.h

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ static T SetValueForMask(T &Integer, const T Mask, const T Value) noexcept {
3232
}
3333

3434
template <std::integral T = uint64_t>
35-
[[nodiscard]] constexpr
36-
static inline T
35+
[[nodiscard]] constexpr static T
3736
GetValueForMaskAndShift(const T Integer, const T Mask, const T Shift) noexcept {
3837
const auto MaskedValue = GetValueForMask(Integer, Mask);
3938
return (MaskedValue >> Shift);
4039
}
4140

4241
template <std::integral T = uint64_t>
43-
constexpr static
44-
T
42+
constexpr static T
4543
SetValueForMaskAndShift(T &Integer,
4644
const T Mask,
4745
const T Shift,
@@ -92,33 +90,33 @@ struct BasicMasksHandler {
9290
return BitSet.count();
9391
}
9492

95-
[[nodiscard]] constexpr
96-
inline bool operator==(const BasicMasksHandler &Rhs) const noexcept {
93+
[[nodiscard]]
94+
constexpr bool operator==(const BasicMasksHandler &Rhs) const noexcept {
9795
return Integer == Rhs.Integer;
9896
}
9997

100-
[[nodiscard]] constexpr
101-
inline bool operator!=(const BasicMasksHandler &Rhs) const noexcept {
98+
[[nodiscard]]
99+
constexpr bool operator!=(const BasicMasksHandler &Rhs) const noexcept {
102100
return Integer != Rhs.Integer;
103101
}
104102

105-
[[nodiscard]] constexpr
106-
inline bool operator<(const BasicMasksHandler &Rhs) const noexcept {
103+
[[nodiscard]]
104+
constexpr bool operator<(const BasicMasksHandler &Rhs) const noexcept {
107105
return Integer < Rhs.Integer;
108106
}
109107

110-
[[nodiscard]] constexpr
111-
inline bool operator<=(const BasicMasksHandler &Rhs) const noexcept {
108+
[[nodiscard]]
109+
constexpr bool operator<=(const BasicMasksHandler &Rhs) const noexcept {
112110
return Integer <= Rhs.Integer;
113111
}
114112

115-
[[nodiscard]] constexpr
116-
inline bool operator>(const BasicMasksHandler &Rhs) const noexcept {
113+
[[nodiscard]]
114+
constexpr bool operator>(const BasicMasksHandler &Rhs) const noexcept {
117115
return Integer > Rhs.Integer;
118116
}
119117

120-
[[nodiscard]] constexpr
121-
inline bool operator>=(const BasicMasksHandler &Rhs) const noexcept {
118+
[[nodiscard]]
119+
constexpr bool operator>=(const BasicMasksHandler &Rhs) const noexcept {
122120
return Integer >= Rhs.Integer;
123121
}
124122

include/ADT/Mach-O/BindUtil.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ namespace MachO {
118118
return *this;
119119
}
120120

121-
constexpr
122-
inline Info &setSymbol(const std::string *const Value) noexcept {
121+
constexpr Info &setSymbol(const std::string *const Value) noexcept {
123122
this->Symbol = Value;
124123
return *this;
125124
}
@@ -150,13 +149,12 @@ namespace MachO {
150149
}
151150

152151
constexpr
153-
inline Info &setIsNewSymbolName(const bool Value = true) noexcept {
152+
Info &setIsNewSymbolName(const bool Value = true) noexcept {
154153
this->sIsNewSymbolName = Value;
155154
return *this;
156155
}
157156

158-
constexpr
159-
inline Info &setFlags(const BindSymbolFlags &Value) noexcept {
157+
constexpr Info &setFlags(const BindSymbolFlags &Value) noexcept {
160158
this->Flags = Value;
161159
return *this;
162160
}

include/ADT/Mach-O/ExportTrie.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ namespace MachO {
217217
return Enum::None;
218218
}
219219

220-
[[nodiscard]] constexpr
221-
inline uint64_t ExportTrieExportKindGetLongestNameLength() noexcept {
220+
[[nodiscard]]
221+
constexpr uint64_t ExportTrieExportKindGetLongestNameLength() noexcept {
222222
const auto Result =
223223
EnumHelper<ExportTrieExportKind>::GetLongestAssocLength(
224224
ExportTrieExportKindGetName);

include/ADT/Mach-O/LoadCommands.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ namespace MachO {
279279
return KindIsRecognized(getKind(IsBigEndian));
280280
}
281281

282-
[[nodiscard]] constexpr
283-
bool isRequiredByDyld(const bool IsBigEndian) const noexcept {
282+
[[nodiscard]]
283+
constexpr bool isRequiredByDyld(const bool IsBigEndian) const noexcept {
284284
return KindIsRequiredByDyld(getKind(IsBigEndian));
285285
}
286286

@@ -416,8 +416,7 @@ namespace MachO {
416416
return *this;
417417
}
418418

419-
constexpr
420-
Section &
419+
constexpr Section &
421420
setSize(const uint32_t Value, const bool IsBigEndian) noexcept {
422421
this->Size = SwitchEndianIf(Value, IsBigEndian);
423422
return *this;
@@ -1001,8 +1000,7 @@ namespace MachO {
10011000
return hasValidCmdSize(getCmdSize(IsBigEndian));
10021001
}
10031002

1004-
[[nodiscard]] constexpr
1005-
static inline LoadCommand::CmdSizeInvalidKind
1003+
[[nodiscard]] constexpr static LoadCommand::CmdSizeInvalidKind
10061004
hasValidCmdSize(const uint32_t CmdSize) noexcept {
10071005
if (CmdSize < sizeof(DylibCommand)) {
10081006
return LoadCommand::CmdSizeInvalidKind::TooSmall;
@@ -1444,8 +1442,8 @@ namespace MachO {
14441442
return std::string_view();
14451443
}
14461444

1447-
[[nodiscard]] constexpr
1448-
inline uint64_t SymbolTableEntrySymbolKindGetLongestName() noexcept {
1445+
[[nodiscard]]
1446+
constexpr uint64_t SymbolTableEntrySymbolKindGetLongestName() noexcept {
14491447
const auto Result =
14501448
EnumHelper<SymbolTableEntrySymbolKind>::GetLongestAssocLength(
14511449
SymbolTableEntrySymbolKindGetName);
@@ -2678,8 +2676,8 @@ namespace MachO {
26782676
uint32_t Kind;
26792677
uint32_t Version;
26802678

2681-
[[nodiscard]] constexpr
2682-
enum Kind getKind(const bool IsBigEndian) const noexcept {
2679+
[[nodiscard]]
2680+
constexpr enum Kind getKind(const bool IsBigEndian) const noexcept {
26832681
const auto Integer = SwitchEndianIf(Kind, IsBigEndian);
26842682
return static_cast<enum Kind>(Integer);
26852683
}

include/ADT/Mach-O/LoadCommandsCommon.h

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ namespace MachO {
338338
return hasFlag(FlagEnum::ProtectionVersion1);
339339
}
340340

341-
[[nodiscard]]
342-
constexpr bool isReadOnlyAfterFixup() const noexcept {
341+
[[nodiscard]] constexpr bool isReadOnlyAfterFixup() const noexcept {
343342
return hasFlag(FlagEnum::ReadOnlyAfterFixup);
344343
}
345344

@@ -541,21 +540,18 @@ namespace MachO {
541540

542541
using Base::Base;
543542

544-
[[nodiscard]]
545-
constexpr bool isAllInstructions() const noexcept {
543+
[[nodiscard]] constexpr bool isAllInstructions() const noexcept {
546544
return hasValueForMask(MaskKind::IsAllInstructions);
547545
}
548546

549-
[[nodiscard]]
550-
constexpr bool noRanlibTableOfContents() const noexcept {
547+
[[nodiscard]] constexpr bool noRanlibTableOfContents() const noexcept {
551548
const auto NoRanlibTableOfContents =
552549
hasValueForMask(MaskKind::NoRanlibTableOfContents);
553550

554551
return NoRanlibTableOfContents;
555552
}
556553

557-
[[nodiscard]]
558-
constexpr bool shouldStripStaticSymbols() const noexcept {
554+
[[nodiscard]] constexpr bool shouldStripStaticSymbols() const noexcept {
559555
return hasValueForMask(MaskKind::StripStaticSymbols);
560556
}
561557

@@ -567,27 +563,23 @@ namespace MachO {
567563
return hasValueForMask(MaskKind::LiveSupport);
568564
}
569565

570-
[[nodiscard]]
571-
constexpr bool hasSelfModifyingCode() const noexcept {
566+
[[nodiscard]] constexpr bool hasSelfModifyingCode() const noexcept {
572567
return hasValueForMask(MaskKind::SelfModifyingCode);
573568
}
574569

575570
[[nodiscard]] constexpr bool isDebugSection() const noexcept {
576571
return hasValueForMask(MaskKind::IsDebugSection);
577572
}
578573

579-
[[nodiscard]]
580-
constexpr bool hasSomeInstructions() const noexcept {
574+
[[nodiscard]] constexpr bool hasSomeInstructions() const noexcept {
581575
return hasValueForMask(MaskKind::HasSomeInstructions);
582576
}
583577

584-
[[nodiscard]]
585-
constexpr bool hasExternalRelocEntries() const noexcept {
578+
[[nodiscard]] constexpr bool hasExternalRelocEntries() const noexcept {
586579
return hasValueForMask(MaskKind::HasExternalRelocEntries);
587580
}
588581

589-
[[nodiscard]]
590-
constexpr bool hasLocalRelocEntries() const noexcept {
582+
[[nodiscard]] constexpr bool hasLocalRelocEntries() const noexcept {
591583
return hasValueForMask(MaskKind::HasLocalRelocEntries);
592584
}
593585

@@ -670,8 +662,7 @@ namespace MachO {
670662

671663
using Base::Base;
672664

673-
[[nodiscard]]
674-
constexpr Attributes getAttributes() const noexcept {
665+
[[nodiscard]] constexpr Attributes getAttributes() const noexcept {
675666
return Attributes(getValueForMask(MaskType::Attributes));
676667
}
677668

include/ADT/Mach-O/Objc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@ namespace MachO {
375375
return *this;
376376
}
377377

378-
constexpr ObjcClassRoFlags &
379-
setIsFuture(const bool Value = true) noexcept {
378+
constexpr
379+
ObjcClassRoFlags &setIsFuture(const bool Value = true) noexcept {
380380
setValueForFlag(Flags::IsFuture, Value);
381381
return *this;
382382
}

include/ADT/Mach-O/RebaseInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ namespace MachO {
270270
RebaseOpcodeIterator(const RebaseByte *const Begin,
271271
const RebaseByte *const End) noexcept
272272
: Iter(reinterpret_cast<const uint8_t *>(Begin),
273-
reinterpret_cast<const uint8_t *>(End)),
273+
reinterpret_cast<const uint8_t *>(End))
274274
{
275275
Info = std::make_unique<RebaseOpcodeIterateInfo>();
276276
Advance();
@@ -285,7 +285,6 @@ namespace MachO {
285285
reinterpret_cast<const uint8_t *>(End)),
286286
Info(std::move(Info))
287287
{
288-
ReachedEnd = false;
289288
Advance();
290289
}
291290

include/ADT/MemoryMap.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ struct ConstMemoryMap {
1818
const uint8_t *Begin;
1919
const uint8_t *End;
2020
public:
21-
constexpr
22-
ConstMemoryMap(const void *Begin, const void *End) noexcept
21+
constexpr ConstMemoryMap(const void *Begin, const void *End) noexcept
2322
: Begin(static_cast<const uint8_t *>(Begin)),
2423
End(static_cast<const uint8_t *>(End))
2524
{
@@ -87,14 +86,14 @@ struct ConstMemoryMap {
8786
return getRange().isLargeEnoughForSize(Size);
8887
}
8988

90-
[[nodiscard]] constexpr
91-
inline ConstMemoryMap mapFromPtr(const void *Begin) const noexcept {
89+
[[nodiscard]]
90+
constexpr ConstMemoryMap mapFromPtr(const void *Begin) const noexcept {
9291
assert(containsPtr(Begin));
9392
return ConstMemoryMap(Begin, getEnd());
9493
}
9594

96-
[[nodiscard]] constexpr
97-
inline ConstMemoryMap mapFromOffset(uint64_t Offset) const noexcept {
95+
[[nodiscard]]
96+
constexpr ConstMemoryMap mapFromOffset(uint64_t Offset) const noexcept {
9897
assert(containsOffset(Offset));
9998
return ConstMemoryMap(getBegin() + Offset, getEnd());
10099
}
@@ -152,7 +151,7 @@ struct MemoryMap : public ConstMemoryMap {
152151
}
153152

154153
[[nodiscard]] constexpr
155-
inline ConstMemoryMap constMapFromOffset(uint64_t Offset) const noexcept {
154+
ConstMemoryMap constMapFromOffset(uint64_t Offset) const noexcept {
156155
return ConstMemoryMap::mapFromOffset(Offset);
157156
}
158157

include/ADT/PointerErrorStorage.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ struct PointerErrorStorage {
5656
return *this;
5757
}
5858

59-
constexpr
60-
inline PointerErrorStorage &operator=(const Enum &Value) noexcept {
59+
constexpr PointerErrorStorage &operator=(const Enum &Value) noexcept {
6160
setValue(Value);
6261
return *this;
6362
}

include/ADT/PointerOrError.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ struct PointerOrError {
7272
return *this;
7373
}
7474

75-
constexpr
76-
inline PointerOrError &operator=(const ErrorType &Error) const noexcept {
75+
constexpr PointerOrError &operator=(const ErrorType &Error) const noexcept {
7776
return setError(Error);
7877
}
7978

0 commit comments

Comments
 (0)