File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -260,24 +260,17 @@ 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
- }
273
-
274
- // Positive modifiers
275
- for (const auto &AE : Extensions) {
276
- if (!AE.Feature .empty () && Modifier == AE.Name ) {
277
- enable (AE.ID );
278
- return true ;
279
- }
263
+ bool IsNegated = Modifier.starts_with (" no" );
264
+ StringRef ArchExt = IsNegated ? Modifier.drop_front (2 ) : Modifier;
265
+
266
+ if (auto AE = parseArchExtension (ArchExt)) {
267
+ if (AE->Feature .empty () || AE->NegFeature .empty ())
268
+ return false ;
269
+ if (IsNegated)
270
+ disable (AE->ID );
271
+ else
272
+ enable (AE->ID );
273
+ return true ;
280
274
}
281
-
282
275
return false ;
283
276
}
You can’t perform that action at this time.
0 commit comments