30
30
31
31
namespace llvm
32
32
{
33
-
34
- class StringRef ;
35
-
33
+ // ! \brief Holds information about an AVR subtarget.
36
34
class AVRSubtarget : public AVRGenSubtargetInfo
37
35
{
38
36
virtual void anchor ();
37
+
39
38
public:
40
- // / This constructor initializes the data members to match that
41
- // / of the specified triple.
42
- // /
39
+ // ! \brief Creates an AVR subtarget.
40
+ // ! \param TT The target triple.
41
+ // ! \param CPU The CPU to target.
42
+ // ! \param FS The feature string.
43
+ // ! \param TM The target machine.
43
44
AVRSubtarget (const std::string &TT, const std::string &CPU,
44
45
const std::string &FS, AVRTargetMachine &TM);
45
46
@@ -49,62 +50,63 @@ class AVRSubtarget : public AVRGenSubtargetInfo
49
50
const AVRSelectionDAGInfo *getSelectionDAGInfo () const override { return &TSInfo; }
50
51
const AVRRegisterInfo *getRegisterInfo () const override { return &InstrInfo.getRegisterInfo (); }
51
52
52
- // / ParseSubtargetFeatures - Parses features string setting specified
53
- // / subtarget options. Definition of function is auto generated by tblgen.
53
+ // / \brief Parses a subtarget feature string, setting appropriate options.
54
+ // / \note Definition of function is auto generated by ` tblgen` .
54
55
void ParseSubtargetFeatures (StringRef CPU, StringRef FS);
55
56
56
- bool hasLPM () const { return this ->HasLPM ; }
57
- bool hasLPMX () const { return this ->HasLPMX ; }
58
-
59
- bool hasELPM () const { return this ->HasELPM ; }
60
- bool hasELPMX () const { return this ->HasELPMX ; }
61
-
62
- bool hasSPM () const { return this ->HasSPM ; }
63
- bool hasSPMX () const { return this ->HasSPMX ; }
64
-
65
- bool hasMUL () const { return this ->HasMUL ; }
66
- bool hasFMUL () const { return this ->HasFMUL ; }
67
-
68
- bool hasMOVW () const { return this ->HasMOVW ; }
69
- bool hasDES () const { return this ->HasDES ; }
70
- bool hasBREAK () const { return this ->HasBREAK ; }
71
- bool supportsRMW () const { return this ->SupportsRMW ; }
72
-
73
- bool hasSRAM () const { return this ->HasSRAM ; }
74
- bool hasEIND () const { return this ->HasEIND ; }
75
-
76
- bool isTiny () const { return this ->IsTiny ; }
77
- bool isMega () const { return this ->IsMega ; }
57
+ // Subtarget feature getters.
58
+ // See AVR.td for details.
59
+ bool hasSRAM () const { return this ->m_hasSRAM ; }
60
+ bool hasJMPCALL () const { return this ->m_hasJMPCALL ; }
61
+ bool hasIJMPCALL () const { return this ->m_hasIJMPCALL ; }
62
+ bool hasEIJMPCALL () const { return this ->m_hasEIJMPCALL ; }
63
+ bool hasADDSUBIW () const { return this ->m_hasADDSUBIW ; }
64
+ bool hasSmallStack () const { return m_hasSmallStack; }
65
+ bool hasMOVW () const { return this ->m_hasMOVW ; }
66
+ bool hasLPM () const { return this ->m_hasLPM ; }
67
+ bool hasLPMX () const { return this ->m_hasLPMX ; }
68
+ bool hasELPM () const { return this ->m_hasELPM ; }
69
+ bool hasELPMX () const { return this ->m_hasELPMX ; }
70
+ bool hasSPM () const { return this ->m_hasSPM ; }
71
+ bool hasSPMX () const { return this ->m_hasSPMX ; }
72
+ bool hasDES () const { return this ->m_hasDES ; }
73
+ bool supportsRMW () const { return this ->m_supportsRMW ; }
74
+ bool supportsMultiplication () const { return this ->m_supportsMultiplication ; }
75
+ bool hasBREAK () const { return this ->m_hasBREAK ; }
76
+ bool hasTinyEncoding () const { return this ->m_hasTinyEncoding ; }
78
77
79
78
private:
80
79
81
80
AVRInstrInfo InstrInfo;
82
81
AVRFrameLowering FrameLowering;
83
82
AVRTargetLowering TLInfo;
84
83
AVRSelectionDAGInfo TSInfo;
85
-
86
- // Supported instructions
87
- bool HasLPM;
88
- bool HasLPMX;
89
- bool HasELPM;
90
- bool HasELPMX;
91
- bool HasSPM;
92
- bool HasSPMX;
93
- bool HasMUL;
94
- bool HasFMUL;
95
- bool HasMOVW;
96
- bool HasDES;
97
- bool HasBREAK;
98
- bool SupportsRMW;
99
-
100
- // Other features
101
- bool HasSRAM;
102
- bool HasEIND;
103
- bool IsTiny;
104
- bool IsMega;
105
-
84
+
85
+ // Subtarget feature settings
86
+ // See AVR.td for details.
87
+ bool m_hasSRAM;
88
+ bool m_hasJMPCALL;
89
+ bool m_hasIJMPCALL;
90
+ bool m_hasEIJMPCALL;
91
+ bool m_hasADDSUBIW;
92
+ bool m_hasSmallStack;
93
+ bool m_hasMOVW;
94
+ bool m_hasLPM;
95
+ bool m_hasLPMX;
96
+ bool m_hasELPM;
97
+ bool m_hasELPMX;
98
+ bool m_hasSPM;
99
+ bool m_hasSPMX;
100
+ bool m_hasDES;
101
+ bool m_supportsRMW;
102
+ bool m_supportsMultiplication;
103
+ bool m_hasBREAK;
104
+ bool m_hasTinyEncoding;
105
+
106
106
// Dummy feature value, used by PseudoSubtargetFeature.
107
- bool DummyFeature;
107
+ // We cannot have a SubtargetFeature with no variable, so
108
+ // we instead bind pseudo features to this variable.
109
+ bool m_DummyFeature;
108
110
};
109
111
110
112
} // end namespace llvm
0 commit comments