Skip to content

Commit 416c7b3

Browse files
authored
[ARM] Remove unneeded global inits (NFCI) (#129299)
Theses consts in ASMTargetParser were causing unnecessary global initialization fuctions. _GLOBAL__sub_I_ARMTargetParser.cpp _GLOBAL__sub_I_Triple.cpp Both functions init the same consts. I messed up the first PR on this sorry.
1 parent f937b17 commit 416c7b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/include/llvm/TargetParser/ARMTargetParser.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ struct ExtName {
7777
StringRef NegFeature;
7878
};
7979

80-
const ExtName ARCHExtNames[] = {
80+
constexpr ExtName ARCHExtNames[] = {
8181
#define ARM_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \
8282
{NAME, ID, FEATURE, NEGFEATURE},
8383
#include "ARMTargetParser.def"
8484
};
8585

8686
// List of HWDiv names (use getHWDivSynonym) and which architectural
8787
// features they correspond to (use getHWDivFeatures).
88-
const struct {
88+
constexpr struct {
8989
StringRef Name;
9090
uint64_t ID;
9191
} HWDivNames[] = {
@@ -112,7 +112,7 @@ struct CpuNames {
112112
uint64_t DefaultExtensions;
113113
};
114114

115-
const CpuNames CPUNames[] = {
115+
constexpr CpuNames CPUNames[] = {
116116
#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \
117117
{NAME, ARM::ArchKind::ID, IS_DEFAULT, DEFAULT_EXT},
118118
#include "ARMTargetParser.def"
@@ -173,7 +173,7 @@ struct FPUName {
173173
FPURestriction Restriction;
174174
};
175175

176-
static const FPUName FPUNames[] = {
176+
static constexpr FPUName FPUNames[] = {
177177
#define ARM_FPU(NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION) \
178178
{NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION},
179179
#include "llvm/TargetParser/ARMTargetParser.def"
@@ -199,7 +199,7 @@ struct ArchNames {
199199
StringRef getSubArch() const { return ArchFeature.substr(1); }
200200
};
201201

202-
static const ArchNames ARMArchNames[] = {
202+
static constexpr ArchNames ARMArchNames[] = {
203203
#define ARM_ARCH(NAME, ID, CPU_ATTR, ARCH_FEATURE, ARCH_ATTR, ARCH_FPU, \
204204
ARCH_BASE_EXT) \
205205
{NAME, CPU_ATTR, ARCH_FEATURE, ARCH_FPU, \

0 commit comments

Comments
 (0)