Skip to content

Commit e0a5155

Browse files
committed
[LoongArch] Simplify RISCVSubtarget. NFC
The flags, initialization of the flags, and the getter methods for features defined in LoongArch.td can be generated by TableGen.
1 parent 1c8ba24 commit e0a5155

File tree

1 file changed

+10
-28
lines changed

1 file changed

+10
-28
lines changed

llvm/lib/Target/LoongArch/LoongArchSubtarget.h

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,11 @@ class StringRef;
3131

3232
class LoongArchSubtarget : public LoongArchGenSubtargetInfo {
3333
virtual void anchor();
34-
bool HasLA32 = false;
35-
bool HasLA64 = false;
36-
bool HasBasicF = false;
37-
bool HasBasicD = false;
38-
bool HasExtLSX = false;
39-
bool HasExtLASX = false;
40-
bool HasExtLVZ = false;
41-
bool HasExtLBT = false;
42-
bool HasLaGlobalWithPcrel = false;
43-
bool HasLaGlobalWithAbs = false;
44-
bool HasLaLocalWithAbs = false;
45-
bool HasUAL = false;
46-
bool HasLinkerRelax = false;
47-
bool HasExpAutoVec = false;
48-
bool HasFrecipe = false;
34+
35+
#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
36+
bool ATTRIBUTE = DEFAULT;
37+
#include "LoongArchGenSubtargetInfo.inc"
38+
4939
unsigned GRLen = 32;
5040
MVT GRLenVT = MVT::i32;
5141
LoongArchABI::ABI TargetABI = LoongArchABI::ABI_Unknown;
@@ -92,20 +82,12 @@ class LoongArchSubtarget : public LoongArchGenSubtargetInfo {
9282
const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
9383
return &TSInfo;
9484
}
85+
86+
#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
87+
bool GETTER() const { return ATTRIBUTE; }
88+
#include "LoongArchGenSubtargetInfo.inc"
89+
9590
bool is64Bit() const { return HasLA64; }
96-
bool hasBasicF() const { return HasBasicF; }
97-
bool hasBasicD() const { return HasBasicD; }
98-
bool hasExtLSX() const { return HasExtLSX; }
99-
bool hasExtLASX() const { return HasExtLASX; }
100-
bool hasExtLVZ() const { return HasExtLVZ; }
101-
bool hasExtLBT() const { return HasExtLBT; }
102-
bool hasLaGlobalWithPcrel() const { return HasLaGlobalWithPcrel; }
103-
bool hasLaGlobalWithAbs() const { return HasLaGlobalWithAbs; }
104-
bool hasLaLocalWithAbs() const { return HasLaLocalWithAbs; }
105-
bool hasUAL() const { return HasUAL; }
106-
bool hasLinkerRelax() const { return HasLinkerRelax; }
107-
bool hasExpAutoVec() const { return HasExpAutoVec; }
108-
bool hasFrecipe() const { return HasFrecipe; }
10991
MVT getGRLenVT() const { return GRLenVT; }
11092
unsigned getGRLen() const { return GRLen; }
11193
LoongArchABI::ABI getTargetABI() const { return TargetABI; }

0 commit comments

Comments
 (0)