File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -260,24 +260,18 @@ void AArch64::ExtensionSet::addArchDefaults(const ArchInfo &Arch) {
260
260
bool AArch64::ExtensionSet::parseModifier (StringRef Modifier) {
261
261
LLVM_DEBUG (llvm::dbgs () << " parseModifier(" << Modifier << " )\n " );
262
262
263
- // Negative modifiers, with the syntax "no<feat>"
264
- if (Modifier.starts_with (" no" )) {
265
- StringRef ModifierBase (Modifier.substr (2 ));
266
- for (const auto &AE : Extensions) {
267
- if (!AE.NegFeature .empty () && ModifierBase == AE.Name ) {
268
- disable (AE.ID );
269
- return true ;
270
- }
271
- }
272
- }
263
+ bool IsNegated = Modifier.starts_with (" no" );
264
+ StringRef ArchExt = IsNegated ? Modifier.drop_front (2 ) : Modifier;
273
265
274
- // Positive modifiers
275
- for (const auto &AE : Extensions) {
276
- if (!AE.Feature .empty () && Modifier == AE.Name ) {
277
- enable (AE.ID );
266
+ if (auto AE = parseArchExtension (ArchExt)) {
267
+ if (IsNegated && !AE->NegFeature .empty ()) {
268
+ disable (AE->ID );
269
+ return true ;
270
+ }
271
+ if (!AE->Feature .empty ()) {
272
+ enable (AE->ID );
278
273
return true ;
279
274
}
280
275
}
281
-
282
276
return false ;
283
277
}
You can’t perform that action at this time.
0 commit comments