@@ -121,29 +121,10 @@ static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
121
121
return std::make_unique<ARMElfTargetObjectFile>();
122
122
}
123
123
124
- static ARMBaseTargetMachine::ARMABI
125
- computeTargetABI (const Triple &TT, StringRef CPU,
126
- const TargetOptions &Options) {
127
- StringRef ABIName = Options.MCOptions .getABIName ();
128
-
129
- if (ABIName.empty ())
130
- ABIName = ARM::computeDefaultTargetABI (TT, CPU);
131
-
132
- if (ABIName == " aapcs16" )
133
- return ARMBaseTargetMachine::ARM_ABI_AAPCS16;
134
- else if (ABIName.starts_with (" aapcs" ))
135
- return ARMBaseTargetMachine::ARM_ABI_AAPCS;
136
- else if (ABIName.starts_with (" apcs" ))
137
- return ARMBaseTargetMachine::ARM_ABI_APCS;
138
-
139
- llvm_unreachable (" Unhandled/unknown ABI Name!" );
140
- return ARMBaseTargetMachine::ARM_ABI_UNKNOWN;
141
- }
142
-
143
124
static std::string computeDataLayout (const Triple &TT, StringRef CPU,
144
125
const TargetOptions &Options,
145
126
bool isLittle) {
146
- auto ABI = computeTargetABI (TT, CPU, Options);
127
+ auto ABI = ARM:: computeTargetABI (TT, CPU, Options. MCOptions . ABIName );
147
128
std::string Ret;
148
129
149
130
if (isLittle)
@@ -163,19 +144,19 @@ static std::string computeDataLayout(const Triple &TT, StringRef CPU,
163
144
Ret += " -Fi8" ;
164
145
165
146
// ABIs other than APCS have 64 bit integers with natural alignment.
166
- if (ABI != ARMBaseTargetMachine ::ARM_ABI_APCS)
147
+ if (ABI != ARM ::ARM_ABI_APCS)
167
148
Ret += " -i64:64" ;
168
149
169
150
// We have 64 bits floats. The APCS ABI requires them to be aligned to 32
170
151
// bits, others to 64 bits. We always try to align to 64 bits.
171
- if (ABI == ARMBaseTargetMachine ::ARM_ABI_APCS)
152
+ if (ABI == ARM ::ARM_ABI_APCS)
172
153
Ret += " -f64:32:64" ;
173
154
174
155
// We have 128 and 64 bit vectors. The APCS ABI aligns them to 32 bits, others
175
156
// to 64. We always ty to give them natural alignment.
176
- if (ABI == ARMBaseTargetMachine ::ARM_ABI_APCS)
157
+ if (ABI == ARM ::ARM_ABI_APCS)
177
158
Ret += " -v64:32:64-v128:32:128" ;
178
- else if (ABI != ARMBaseTargetMachine ::ARM_ABI_AAPCS16)
159
+ else if (ABI != ARM ::ARM_ABI_AAPCS16)
179
160
Ret += " -v128:64:128" ;
180
161
181
162
// Try to align aggregates to 32 bits (the default is 64 bits, which has no
@@ -187,9 +168,9 @@ static std::string computeDataLayout(const Triple &TT, StringRef CPU,
187
168
188
169
// The stack is 128 bit aligned on NaCl, 64 bit aligned on AAPCS and 32 bit
189
170
// aligned everywhere else.
190
- if (TT.isOSNaCl () || ABI == ARMBaseTargetMachine ::ARM_ABI_AAPCS16)
171
+ if (TT.isOSNaCl () || ABI == ARM ::ARM_ABI_AAPCS16)
191
172
Ret += " -S128" ;
192
- else if (ABI == ARMBaseTargetMachine ::ARM_ABI_AAPCS)
173
+ else if (ABI == ARM ::ARM_ABI_AAPCS)
193
174
Ret += " -S64" ;
194
175
else
195
176
Ret += " -S32" ;
@@ -226,7 +207,7 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, const Triple &TT,
226
207
TT, CPU, FS, Options,
227
208
getEffectiveRelocModel(TT, RM),
228
209
getEffectiveCodeModel(CM, CodeModel::Small), OL),
229
- TargetABI(computeTargetABI(TT, CPU, Options)),
210
+ TargetABI(ARM:: computeTargetABI(TT, CPU, Options.MCOptions.ABIName )),
230
211
TLOF(createTLOF(getTargetTriple())), isLittle(isLittle) {
231
212
232
213
// Default to triple-appropriate float ABI
@@ -271,22 +252,6 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, const Triple &TT,
271
252
272
253
ARMBaseTargetMachine::~ARMBaseTargetMachine () = default ;
273
254
274
- bool ARMBaseTargetMachine::isAPCS_ABI () const {
275
- assert (TargetABI != ARMBaseTargetMachine::ARM_ABI_UNKNOWN);
276
- return TargetABI == ARMBaseTargetMachine::ARM_ABI_APCS;
277
- }
278
-
279
- bool ARMBaseTargetMachine::isAAPCS_ABI () const {
280
- assert (TargetABI != ARMBaseTargetMachine::ARM_ABI_UNKNOWN);
281
- return TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS ||
282
- TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16;
283
- }
284
-
285
- bool ARMBaseTargetMachine::isAAPCS16_ABI () const {
286
- assert (TargetABI != ARMBaseTargetMachine::ARM_ABI_UNKNOWN);
287
- return TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16;
288
- }
289
-
290
255
MachineFunctionInfo *ARMBaseTargetMachine::createMachineFunctionInfo (
291
256
BumpPtrAllocator &Allocator, const Function &F,
292
257
const TargetSubtargetInfo *STI) const {
0 commit comments